public override IEnumerator ConstructBuilding(GameObject building) { Entity buildScript = building.GetComponent <Entity>(); Debug.Log("Construct"); BattleSystem.CurrentPlayer.ChangeOre(buildScript.Cost * (-1)); BattleSystem.Player(); yield return(new WaitForSeconds(0f)); }
public override IEnumerator Start() { Debug.Log("Move State Active."); BattleSystem.UnitInterface.SetActive(false); if (!BattleSystem.SelectedUnit.CanMove()) { Debug.Log("Unit can't move this turn."); BattleSystem.SetState(new PlayerTurn(BattleSystem)); } yield return(new WaitForSeconds(0f)); }
public override IEnumerator Start() { Debug.Log("SelectedBilding State Active."); BattleSystem.BuildingInterface.SetActive(true); BattleSystem.BuildingInterface.transform.localPosition = BattleSystem.PanelPosition(BattleSystem.SelectedBuilding, 1f); if (BattleSystem.SelectedBuilding.GetComponent <Factory>()) { Debug.Log("Factory."); BattleSystem.SelectedBuilding.GetComponent <Factory>().factoryInterface = BattleSystem.FactoryProduce; } yield return(new WaitForSeconds(0f)); }
public override IEnumerator Start() { Debug.Log("SelectedTile State Active."); Player tileOwner = BattleSystem.SelectedTile.GetComponent <Tile>().Owner; if (tileOwner == BattleSystem.CurrentPlayer || tileOwner == null) { BattleSystem.BuildingInterface.SetActive(false); BattleSystem.TileInterface.SetTileInterface(BattleSystem.SelectedTile.gameObject); } else { BattleSystem.Player(); } yield return(new WaitForSeconds(0f)); }
public override IEnumerator Start() { // Hide all buttons, update hud to display info for current player. Debug.Log("PlayerTurn State Active. " + BattleSystem.CurrentPlayer.Name); BattleSystem.BuildingInterface.SetActive(false); BattleSystem.UnitInterface.SetActive(false); BattleSystem.TileInterface.HideUI(); if (BattleSystem.NewTurn) { Debug.Log("This is a new turn. Resources are being produced."); BattleSystem.NewTurn = false; foreach (Tile t in BattleSystem.CurrentPlayer.Tiles) { Building build = t.GetComponentInChildren <Building>(); if (build == null || build.CompareTag("Fortification")) { continue; } build.PanelButton = BattleSystem.AddToBuildingPanel(build); build.UpdateButtonData(); if (BattleSystem.CurrentTurn > build.NextTurnToProduce) { Debug.Log("Producing from " + build.gameObject.name); build.AddToStorage(); } } foreach (Entity e in BattleSystem.CurrentPlayer.Units) { if (e == null) { continue; } e.Rest(); } } BattleSystem.Interface.SetCurrentPlayer(BattleSystem.CurrentPlayer); yield return(new WaitForSeconds(1f)); }
public override IEnumerator Tile() { //if (BattleSystem.SelectedUnit.Tile.CanStrikeTile(BattleSystem.SelectedTile, BattleSystem.SelectedUnit.GetRange())) if (BattleSystem.SelectedUnit.tilesWithinRange.Contains(BattleSystem.SelectedTile)) { HighlightManager.UnHighlightTileList(BattleSystem.SelectedUnit.tilesWithinRange); Tile targetTile = BattleSystem.SelectedTile; targetTile.strikeParticles.Play(); if (BattleSystem.SelectedUnit.GetSplash()) { targetTile.SplashDamage(BattleSystem.SelectedUnit.GetDamage()); } else { targetTile.DistributeDamage(BattleSystem.SelectedUnit.GetDamage()); } BattleSystem.SelectedUnit.OnStrike(); } BattleSystem.Player(); yield return(new WaitForSeconds(0f)); }
public State(BattleSystem battleSystem) { BattleSystem = battleSystem; }
public PlayerTurn(BattleSystem battleSystem) : base(battleSystem) { }
public override IEnumerator Unit() { yield return(new WaitForSeconds(0f)); BattleSystem.SetState(new SelectedUnit(BattleSystem)); }
public SelectedBuilding(BattleSystem battleSystem) : base(battleSystem) { }
public override IEnumerator Building() { BattleSystem.SetState(new SelectedBuilding(BattleSystem)); yield return(new WaitForSeconds(0f)); }
public Move(BattleSystem battleSystem) : base(battleSystem) { }
public SelectedTile(BattleSystem battleSystem) : base(battleSystem) { }
public Fortify(BattleSystem battleSystem) : base(battleSystem) { }
public Strike(BattleSystem battleSystem) : base(battleSystem) { }
public override IEnumerator Fortify(Tile tile) { yield return(new WaitForSeconds(0f)); BattleSystem.SetState(new Fortify(BattleSystem)); }
public SelectedUnit(BattleSystem battleSystem) : base(battleSystem) { }
public Begin(BattleSystem battleSystem) : base(battleSystem) { }