public Actor(ActorType actorType, int health, int armor, int damage, int maxHealth = -1, string name = "", Random rnd = null, string animationFile = "", int level = -1)
{
_actorType = actorType;
_abilities = new List<Ability>();
_quicklist = new List<int>(10);
for (int i = 0; i < 10; ++i)
{
_quicklist.Add(0);
}
if (rnd == null) _random = new Random(); else _random = rnd;
if (level < 0)
{
_level = 0;
for (int counter = level; counter < 0; counter += 1)
{
_exp = 3 * (_level) ^ 2 + 83 * (_level) + 41;
LevelUp();
}
}
else
{
_level = level;
_expNeeded = 3 * (_level + 1) ^ 2 + 83 * (_level + 1) + 41;
}
if (health < 0)
{
if (maxHealth > 0)
{
health = 5 + _random.Next(maxHealth - 5);
}
else
{
health = 15 + _random.Next(30);
}
}
this._health = health;
if (maxHealth == -1)
{
_maxhealth = health;
}
if (armor < 0)
{
armor = _random.Next(10);
fireDefense = _random.Next(10);
iceDefense = _random.Next(10);
}
this._armor = armor;
if (damage < 0)
{
damage = 12 + _random.Next(10);
}
this._damage = damage;
if (name.Trim() == "") GenerateName();
else _name = name;
this._inventory = new List<Item>();
_animationFile = animationFile;
}