コード例 #1
0
ファイル: GameLogic.cs プロジェクト: Jeckman03/RougeLikeC-
        // Enemy attack logic method
        public static int EnemyAttack(EnemyModel enemy, CharacterModel character)
        {
            // Enemy attack damage - player health
            int output = (character.Defense - enemy.AttackDmg) - character.Health;

            // Return player health
            return(output);
        }
コード例 #2
0
ファイル: GameLogic.cs プロジェクト: Jeckman03/RougeLikeC-
        // Player attack logic method
        public static (bool, int) PlayerAttack(CharacterModel character, EnemyModel enemy)
        {
            // players attack - enemy health
            int enemyHealth = enemy.Health - character.AttackDmg;

            bool isDead = IsDead(enemyHealth);

            return(isDead, enemyHealth);
        }