Example #1
0
        // 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);
        }
Example #2
0
        // 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);
        }