public void The_End_Is_Next() { BattleEndState endState = new BattleEndState(); //_battleSystem.WhosNext(); Assert.AreEqual(_battleSystem.CurrentState, endState); }
//Try to end battle by escaping WIP public void Escape() { //TODO escape mechanic Debug.Log("Trying to escape"); endState = BattleEndState.player1escape; activeBattle.EndBattle(endState); }
/****** 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(); }
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(); } }
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(); } }