Ejemplo n.º 1
0
        public void SelectTarget(Point target)
        {
            DungeonMap map     = Game.DungeonMap;
            Player     player  = Game.Player;
            Monster    monster = map.GetMonsterAt(target.X, target.Y);

            if (monster != null)
            {
                Game.MessageLog.Add($"{player.Name} casts a {Name} at {monster.Name}");
                Actor magicMissleActor = new Actor {
                    Attack = _attack, AttackChance = _attackChance, Name = Name
                };
                Game.CommandSystem.Attack(magicMissleActor, monster);
                if (Dice.Roll("1D100") < _poisonChance)
                {
                    if (monster.IsPoisonedImmune == false && _poisonDamage != 0)
                    {
                        monster.State = new MonsterAbnormalState(monster, _poisonLength, "Poisoned", -1, -1, _poisonDamage);
                    }
                }
                if (_lifestealing == true)
                {
                    Game.MessageLog.Add($"You steal {_attack / 2} health points from the {monster.Name}", Colors.Healing);
                    RegainHP regainHP = new RegainHP(_attack / 2, 0);
                    regainHP.Perform();
                }
            }
        }
Ejemplo n.º 2
0
        protected override bool PerformAbility()
        {
            if (Dice.Roll("1D100") < _lifestealChance)
            {
                int _lifesteal = Dice.Roll("2D4");
                Game.MessageLog.Add($"The {Game.Player.Hand.Name} steals {_lifesteal} health points from the {Victim.Name}", Colors.Healing);
                RegainHP regainHP = new RegainHP(_lifesteal, 0);
                regainHP.Perform();
            }

            return(true);
        }