Ejemplo n.º 1
0
        public Monster(Creatures.Creature creature, Spawn spawn, int map)
        {
            var direction = (Rng.Next(0, 100) >= 50);

            _spawn    = spawn;
            _variance = (direction == true ? Rng.NextDouble() * -1 : Rng.NextDouble()) * _spawn.Variance;


            Name          = creature.Name;
            Sprite        = creature.Sprite;
            World         = Game.World;
            Map           = Game.World.WorldData.Get <Map>(map);
            Stats.Level   = spawn.Stats.Level;
            Stats.BaseHp  = VariantHp;
            Stats.Hp      = VariantHp;
            Stats.BaseMp  = VariantMp;
            Stats.Mp      = VariantMp;
            DisplayText   = creature.Description;
            Stats.BaseStr = VariantStr;
            Stats.BaseInt = VariantInt;
            Stats.BaseWis = VariantWis;
            Stats.BaseCon = VariantCon;
            Stats.BaseDex = VariantDex;
            _castables    = spawn.Castables;

            Stats.BaseDefensiveElement = (Enums.Element)spawn.GetDefensiveElement();
            Stats.BaseDefensiveElement = (Enums.Element)spawn.GetOffensiveElement();
            LootableItems = new List <ItemObject>();

            //until intents are fixed, this is how this is going to be done.
            IsHostile    = _random.Next(0, 7) < 2;
            ShouldWander = IsHostile == false;
            CanCast      = spawn.Castables.Count > 0;
        }