public void RegisterFireAction() { Debug.Log("Fire action registered"); if (actionPointsThisTurn - apToFireCannon < 0) { Debug.Log("Not enough AP!"); return; } GameTile targetTile = SelectTile(selectedPosition); PlaceableObjectType t = targetTile.GetOccupyingObjectType(); if (t == PlaceableObjectType.BALLOON) { Debug.Log("That's a valid thing to destroy"); targetTile.RemoveObjectOnThisTile(); PlayerController p = targetTile.myOwner; List <GameTile> toRemove = targetTile.RevokeOwnership(tc.GetActivePlayer()); p.RemoveFromLandList(toRemove); SubtractAP(apToFireCannon); am.Play("fireSFX"); } else { Debug.Log("That's not a balloon"); } }
public void AddLandToList(List <GameTile> newLand) { foreach (GameTile gt in newLand) { if (!myLand.Contains(gt)) { myLand.Add(gt); PlaceableObjectType pot = gt.GetOccupyingObjectType(); AddToScore(pot); Debug.Log(name + " controls " + gt.name); GameObject g = (GameObject)Instantiate(boxSpritePrefab); g.transform.position = gt.transform.position; boxDict.Add(gt, g); } } }
public void AddToScore(PlaceableObjectType pot) { if (pot == PlaceableObjectType.BALLOON) { myScore += balloonPoints; } if (pot == PlaceableObjectType.CANNON) { myScore += cannonPoints; } if (pot == PlaceableObjectType.BRIDGE) { Debug.Log("Bridge!"); myScore += bridgePoints; } if (pot == PlaceableObjectType.NULL) { myScore += landPoints; } if (this.onPointsChanged != null) { this.onPointsChanged((this.GetName() == "First")? 1 : 2, myScore); } }