Esempio n. 1
0
 public void BattleEnd()
 {
     if (onBattleEnd != null)
     {
         onBattleEnd.Invoke();
     }
 }
Esempio n. 2
0
        private void PlayerAttack(int index)
        {
            enemyHealthBars[index].Progress -= (int)(AccountManager.CurrentUser.Attack / (float)enemy.Health * 100);

            Animation?.Invoke(EAnimationTarget.Player, index);

            if (enemyHealthBars[index].Progress <= 0)
            {
                KillEnemy(index);
                EnemyKilled?.Invoke(index);
            }

            if (EnemiesAreDead)
            {
                BattleEnd?.Invoke(BattleCore.EBattleEndType.Won);
            }
        }
Esempio n. 3
0
        private void EnemyAttack(int index)
        {
            Animation?.Invoke(EAnimationTarget.Enemy, index);

            //if (!AccountManager.CurrentUser.ShouldHit)
            //    return;

            var damage = enemy.Attack;

            damage = AccountManager.CurrentUser.GetDamage(damage);

            AccountManager.CurrentUser.Health -= damage;

            if (AccountManager.CurrentUser.Health <= 0)
            {
                BattleEnd?.Invoke(BattleCore.EBattleEndType.Lost);
            }
        }
Esempio n. 4
0
 public void RunAway() =>
 BattleEnd?.Invoke(BattleCore.EBattleEndType.Ran);
Esempio n. 5
0
 public void EndBattle()
 {
     BattleEnd?.Invoke();
 }