// ============================================================================= // add a new die to myself public PharoahDie AddDie(DiceFactory.DieType dieType) { PharoahDie die = GameState.GetCurrentGameState().diceFactory.NewDie(dieType); diceList.Add(die); die.ReadyToRoll(); return(die); }
public void EndTurn() { GameState.Message(this.name + " turn has ended"); this.gameObject.SetActive(false); // End of Turn Triggers foreach (Tile tile in tileList) { TileAbility ability = tile.GetComponent <TileAbility>(); if (ability) { // Herder ability. If the player has locked a pair, then give the player a die for the remainder of the turn. if (ability.onStateTrigger == TileAbility.PlayerTurnStateTriggers.LockedAny) { } } } // remove all temporary tiles. RemoveAllTempTiles(); // for all dice - remove all temporary dice for (int ii = diceList.Count - 1; ii >= 0; ii--) // reverse remove so we don't get weird list problems { PharoahDie d6 = diceList[ii]; if (d6.isTemporary()) // remove temporary dice { diceList.RemoveAt(ii); // take this die out of this list Destroy(d6.gameObject); // destroy this whole die. } } /* * foreach (PharoahDie d6 in diceList) * { * if (d6.isTemporary()) // remove temporary dice * { * diceList.Remove(d6); * Destroy(d6.gameObject); * } * } */ // for all dice - reset all permanent dice foreach (PharoahDie d6 in diceList) { d6.ReadyToRoll(); d6.EndTurn(); d6.transform.parent = this.transform; } foreach (Tile tile in tileList) { tile.canUndo = false; } pgs.SetState(PlayerGameState.PlayerGameStates.WaitingNextTurn); }
// roll a single die public bool RollDie(PharoahDie die) { if (die == null) { return(false); } GameState.GetCurrentGameState().purchaseBoard.SetState(PurchaseBoard.PurchaseBoardState.isTuckedAway); UnhideDice(); DiceCup.StartRolling(); die.ReadyToRoll(); die.RollDie(); return(true); }
public bool Reroll(PharoahDie die) { if (!die.isActiveDie()) { GameState.Message("Cannot use Scarab on non-active die."); return false; } GameState.Message("Rerolling " + die.name); DiceCup.StartRolling(); die.ReadyToRoll(); die.RollDie(); isConsumed = true; return true; }
public bool Reroll(PharoahDie die) { if (!die.isActiveDie()) { GameState.Message("Cannot use Scarab on non-active die."); return(false); } GameState.Message("Rerolling " + die.name); DiceCup.StartRolling(); die.ReadyToRoll(); die.RollDie(); isConsumed = true; return(true); }
public void DestroyDie(PharoahDie die) { die.ReadyToRoll(); diceList.Remove(die); Destroy(die.gameObject); }
// roll a single die public bool RollDie(PharoahDie die) { if (die == null) return false; GameState.GetCurrentGameState().purchaseBoard.SetState(PurchaseBoard.PurchaseBoardState.isTuckedAway); UnhideDice(); DiceCup.StartRolling(); die.ReadyToRoll(); die.RollDie(); return true; }
public void DestroyDie(PharoahDie die) { die.ReadyToRoll(); diceList.Remove(die); Destroy (die.gameObject); }