public void The_End_Is_Next()
        {
            BattleEndState endState = new BattleEndState();

            //_battleSystem.WhosNext();
            Assert.AreEqual(_battleSystem.CurrentState, endState);
        }
Example #2
0
 //Try to end battle by escaping WIP
 public void Escape()
 {
     //TODO escape mechanic
     Debug.Log("Trying to escape");
     endState = BattleEndState.player1escape;
     activeBattle.EndBattle(endState);
 }
Example #3
0
    /****** System ******/

    //Will set the first turn and handicaps for the second turn if necessary && call BattleManagement && call special IA if necessary
    public void ConfigureBattle()
    {
        turn = true;         //TODO mechanic to decide firsdt turn
        Handicap();

        Debug.Log("Battle state none");
        endState = BattleEndState.none;


        //Calls the function that manages battle
        BattleStateMachine();
    }
Example #4
0
    void _endBattle(BattleEndState state)
    {
        _BattleData._EndState = state;

        if (state == BattleEndState.Win)
        {
            Audio.AudioInstance.PlaySFX(SoundEffect.Battle_Won);
        }
        else
        {
            Audio.AudioInstance.PlaySFX(SoundEffect.Battle_Lost);
        }

        if (_BattleData._BattleType == BattleType.PvP)
        {
            if (state != BattleEndState.Loss)
            {
                _BattleUnitPositionManager.ShowChest(BattlerType.Opposition);
            }
            else
            {
                _BattleUnitPositionManager.ShowChest(BattlerType.Instigator);
            }
            PlayerType p = GetPlayerTypeByBattler(activePlayer);
            ModalPanel.Instance().ShowOK(p.ToString() + " Won", "You reap the spoils and take the enemy prisoner!", () => {
                Audio.AudioInstance.PlaySFX(SoundEffect.Spoils_Collected);
                Player player = p == _GameStateHolder._ActivePlayer.Type ? _GameStateHolder._ActivePlayer : _GameStateHolder._InactivePlayer;
                _reapSpoils(player);
            });
            _BattleUnitPositionManager.ChangeToMainCamera();
            _BattleUnitPositionManager.Hide();
            return;
        }

        if (state != BattleEndState.Loss)
        {
            _BattleUnitPositionManager.ShowChest(BattlerType.Opposition);
            _BattleUnitPositionManager.ChangeToMainCamera();
            _BattleUnitPositionManager.Hide();
            ModalPanel.Instance().ShowOK("You Won", "You reap the spoils of the battle!", () => {
                Audio.AudioInstance.PlaySFX(SoundEffect.Spoils_Collected);
                _reapSpoils(_GameStateHolder._ActivePlayer);
            });
        }
        else
        {
            _actuallyEndBattle();
        }
    }
Example #5
0
	void _endBattle(BattleEndState state) {

		_BattleData._EndState = state;

		if (state == BattleEndState.Win) {
			Audio.AudioInstance.PlaySFX(SoundEffect.Battle_Won);
		} else {
			Audio.AudioInstance.PlaySFX(SoundEffect.Battle_Lost);
		}

		if (_BattleData._BattleType == BattleType.PvP) {
			if (state != BattleEndState.Loss) {
				_BattleUnitPositionManager.ShowChest(BattlerType.Opposition);
			} else {
				_BattleUnitPositionManager.ShowChest(BattlerType.Instigator);
			}
			PlayerType p = GetPlayerTypeByBattler(activePlayer);
			ModalPanel.Instance().ShowOK(p.ToString() + " Won", "You reap the spoils and take the enemy prisoner!", () => {
				Audio.AudioInstance.PlaySFX(SoundEffect.Spoils_Collected);
				Player player = p == _GameStateHolder._ActivePlayer.Type ? _GameStateHolder._ActivePlayer : _GameStateHolder._InactivePlayer;
				_reapSpoils(player);
			});
			_BattleUnitPositionManager.ChangeToMainCamera();
			_BattleUnitPositionManager.Hide();
			return;
		}

		if (state != BattleEndState.Loss) {
			_BattleUnitPositionManager.ShowChest(BattlerType.Opposition);
			_BattleUnitPositionManager.ChangeToMainCamera();
			_BattleUnitPositionManager.Hide();
			ModalPanel.Instance().ShowOK("You Won", "You reap the spoils of the battle!", () => {
				Audio.AudioInstance.PlaySFX(SoundEffect.Spoils_Collected);
				_reapSpoils(_GameStateHolder._ActivePlayer);
			});	
		} else {
			_actuallyEndBattle();
		}
	}