コード例 #1
0
    public int Attack(BattlerType t, iBattleable target)
    {
        int totalDamage = 0;

        if (t == BattlerType.Instigator)
        {
            totalDamage = _instigatorBattlers.Sum(x => x.GetStrength());
            Audio.AudioInstance.PlaySFX(_instigatorBattlers[0].GetAttackSound());
        }
        else
        {
            totalDamage = _oppositionBattler.GetStrength();
            Audio.AudioInstance.PlaySFX(_oppositionBattler.GetAttackSound());
        }
        target.ReduceHP(totalDamage);
        OnBattleAbleTakeDamage(target, totalDamage);
        OnBattleAbleUpdate(target);

        if (target.IsKO())
        {
            Audio.AudioInstance.PlaySFX(target.GetDeathSound());
        }
        else
        {
            Audio.AudioInstance.PlaySFX(target.GetHitSound());
        }

        Debug.Log(t + " attacked " + target.GetType() + " for " + totalDamage + " damage.");
        Debug.Log(target.GetCurrentHP() + " hp left (" + target.GetHPPercentage() * 100 + "%)");
        return(totalDamage);
    }
コード例 #2
0
 void BattleManager_OnBattleAbleTakeDamage(iBattleable battleAbleObject, int i)
 {
     //Animator a =
     if (battleAbleObject.IsKO())
     {
     }
 }
コード例 #3
0
    IEnumerator endTurn()
    {
        if (!(activePlayer == BattlerType.Opposition && _BattleData._BattleType != BattleType.PvP))
        {
            // do end turn stuff
            _BattleUnitPositionManager._ArmyUI.Hide();
            _BattleUnitPositionManager._HandUI.Hide();
            _BattleUnitPositionManager._ButtonsUI.Hide();
        }
        yield return(new WaitForSeconds(2));

        if (_instigatorBattlers.Count() == 0)
        {
            _endBattle(BattleEndState.Loss);
        }
        else if (_oppositionBattler.IsKO())
        {
            if (_BattleData._BattleType == BattleType.LostImmortal)
            {
                if (_oppositionReserveB != null)
                {
                    _BattleUnitPositionManager.RemoveOpposition();
                    _BattleUnitPositionManager.SetReserveBAsOpposition();
                    _oppositionBattler  = _oppositionReserveB;
                    _oppositionReserveB = null;
                    switchPlayer();
                }
                else if (_oppositionReserveC != null)
                {
                    _BattleUnitPositionManager.RemoveOpposition();
                    _BattleUnitPositionManager.SetReserveCAsOpposition();
                    _oppositionBattler  = _oppositionReserveC;
                    _oppositionReserveC = null;
                    switchPlayer();
                }
                else
                {
                    _BattleUnitPositionManager.RemoveOpposition();
                    _endBattle(BattleEndState.Win);
                }
            }
            else
            {
                _BattleUnitPositionManager.RemoveOpposition();
                _endBattle(BattleEndState.Win);
            }
        }
        else
        {
            switchPlayer();
        }
    }
コード例 #4
0
	void BattleManager_OnBattleAbleTakeDamage(iBattleable battleAbleObject, int i) {
		//Animator a = 
		if (battleAbleObject.IsKO()) {
			
		}
	}
コード例 #5
0
ファイル: BattleManager.cs プロジェクト: EpicPants90/ELB
	public int Attack(BattlerType t, iBattleable target) {
		int totalDamage = 0;
		if (t == BattlerType.Instigator) {
			totalDamage = _instigatorBattlers.Sum(x => x.GetStrength());
			Audio.AudioInstance.PlaySFX(_instigatorBattlers[0].GetAttackSound());
		}
		else {
			totalDamage = _oppositionBattler.GetStrength();
			Audio.AudioInstance.PlaySFX(_oppositionBattler.GetAttackSound());
		}
		target.ReduceHP(totalDamage);
		OnBattleAbleTakeDamage (target, totalDamage);
		OnBattleAbleUpdate (target);

		if (target.IsKO()) {
			Audio.AudioInstance.PlaySFX(target.GetDeathSound());
		} else {
			Audio.AudioInstance.PlaySFX(target.GetHitSound());
		}

		Debug.Log(t + " attacked " + target.GetType() + " for " + totalDamage + " damage.");
		Debug.Log(target.GetCurrentHP() + " hp left (" + target.GetHPPercentage()*100 + "%)");
		return totalDamage;
	}