Beispiel #1
0
        private bool RangedAttack(GameCharacter character, Tile destination)
        {
            if (!CoreHelper.checkEffect(character.activeEffects, character.passiveEffects, StatType.Stun))
            {
                GameCharacter target = getCharacterFromTile(destination);

                if (target != null)
                {
                    if (CombatHelper.RangedAttack(character, target, destination, this))
                    {
                        return(true);
                    }
                }
            }
            else
            {
                battleLog.AddEntry(string.Format("{0} is stunned and unable to attack.", character.name));
            }

            return(false);
        }
Beispiel #2
0
        private bool Attack(GameCharacter character, Tile targetTile)
        {
            if (!CoreHelper.checkEffect(character.activeEffects, character.passiveEffects, StatType.Stun))
            {
                GameCharacter target = getCharacterFromTile(targetTile);
                if (target != null)
                {
                    if (character.weapon != null)
                    {
                        if (character.SpendAP(character.weapon.actionPoints))
                        {
                            return(CombatHelper.Attack(character, target, this));
                        }
                    }
                }
            }
            else
            {
                battleLog.AddEntry(string.Format("{0} is stunned and unable attack.", character.name));
            }

            return(false);
        }