public BattleManager(BattleInterface listener) { this.listener = listener; calculate = new BattleCalculator(); activeManager = ActiveSkillManager.GetInstance(); passiveSkill = new PassiveManager(); active = new ActiveUse(this); enemyAI = new EnemyAI(this); playerList = new List <CharacterModel>(); enemyList = new List <CharacterModel>(); }
/// <summary> /// Changes the state of the game. /// </summary> /// <param name="state">The game state to change to.</param> public static void ChangeState(GameState state) { switch (GameController.state) { } GameController.state = state; switch (state) { case GameState.TITLE: if (mainBattle) { BattleInterface.Dettach(); mainBattle.End(); } Cameraman.TakePosition("Overhead Title View"); Interface.SwitchMenu("CANCEL_OVERRIDE"); Interface.SwitchMenu("Title Screen"); Soundman.ChangeTrack(0, true, true); NewBattle(new PlayerInitializer[] { new PlayerInitializer(Color.red, true, 7), new PlayerInitializer(Color.red, true, 7) }, false); //NewBattle(new PlayerInitializer[] { new PlayerInitializer(Color.red, true), new PlayerInitializer(Color.red, true), new PlayerInitializer(Color.red, true), new PlayerInitializer(Color.red, true), new PlayerInitializer(Color.red, true) }, false); break; case GameState.BATTLING: Cameraman.TakePosition("Overhead View"); Interface.SwitchMenu("Overhead"); Soundman.ChangeTrack(2, true, true); break; case GameState.PLACING_SHIPS: Soundman.ChangeTrack(-1, true, false); break; case GameState.PLAYER_SELECTION: Soundman.ChangeTrack(1, true, false); Interface.SwitchMenu("Player Selection Screen"); PlayerSelector.Reset(); break; } }
/// <summary> /// Starts the battle. /// </summary> public void StartBattle() { battling = true; attackingPlayerID = -1; NextPlayer(); recentTurnInformation = (MoveInformator)ScriptableObject.CreateInstance("MoveInformator"); recentTurnInformation.Reset(); if (isMainBattle) { GameController.ChangeState(GameState.BATTLING); BattleInterface.Attach(this); } else { foreach (Player player in players) { player.ShipsShown(true, false); } } }
void Awake() { instance = this; }