Exemplo n.º 1
0
 public void SetBattle(Player player, Monster monster, Floor floor)
 {
     _player = player;
     _monster = monster;
     _floor = floor;
     _counter = 0;
     _enemyAttackTime = 0;
     _playerAttackTime = 0;
     _playerTurn = true;
 }
Exemplo n.º 2
0
        private int ComputeApproximateDamage(Player player, Monster monster)
        {
            int ret;
            int dealDamageToMonster;
            int dealDamageToPlayer;

            dealDamageToMonster = player.Atk - monster.Def;
            if (dealDamageToMonster <= 0)
            {
                return 99999999;
            }

            if (monster.Ability.Contains(Monster.MonsterFeature.Penetrate))
            {
                dealDamageToPlayer = monster.Atk;
            }
            else
            {
                dealDamageToPlayer = monster.Atk - player.Def;
            }

            if (dealDamageToPlayer <= 0)
            {
                return 0;
            }

            dealDamageToPlayer *= monster.AttackTime;
            dealDamageToMonster *= player.AttackTime;

            ret = (int)(Math.Ceiling((double)monster.Hp / dealDamageToMonster) - 1) * dealDamageToPlayer;

            return ret;
        }