void OnMouseDown() { Debug.Log("ScarabUI.OnMouseDown()"); GameState gs = GameState.GetCurrentGameState(); PlayerBoard currentPlayer = gs.currentPlayer; if (GameState.GetCurrentGameState().CheatModeEnabled) { currentPlayer.AddScarab(type); } switch (scuiState) { default: break; case ScarabUIState.ready: if (currentPlayer.hasScarabType(type) != null) { SetState(ScarabUIState.scarab_activated); } else { GameState.Message(currentPlayer.name + " does not have scarab " + type.ToString()); } break; case ScarabUIState.waiting_die_select: GameState.Message(currentPlayer.name + " please select a die for scarab action"); break; } //if (currentPlayer.UseScarab(type)) //{ //} }
// does something when we acquire this tile public override void OnAcquire(PlayerBoard plr) { base.OnAcquire(plr); if (doubleCurrentTokens_Ankh) { nScarabs = plr.CountScarabs(); } for (int ii = 0; ii < nScarabs; ii++) { rndType = (Scarab.ScarabType)Random.Range(0, 2); Scarab bug = plr.AddScarab(rndType); scarabList.Add(bug); bug.name = "Scarab " + rndType.ToString(); } }
public bool UseScarab(Scarab.ScarabType type) { bool bSuccess = false; Scarab hasScarab = hasScarabType(type); if (hasScarab != null) { curScarabInUse = hasScarab; scarabList.Remove(hasScarab); // remove my scarab from the list and hold it in curScarabInUse until we've decided what happens to it. Consumed or Undo. PlayerBoardAllUI.RefreshScarabUI(); // this will wait until the player has selected a die, and then perform the scarab's delegate function on that die. this.AskToChooseDie(curScarabInUse.onDieSelect, type.ToString()); } return(bSuccess); }
List<Scarab> scarabList; // the scarab that is associated with this tile. #endregion Fields #region Methods // does something when we acquire this tile public override void OnAcquire(PlayerBoard plr) { base.OnAcquire(plr); if (doubleCurrentTokens_Ankh) { nScarabs = plr.CountScarabs(); } for (int ii = 0; ii < nScarabs; ii++) { rndType = (Scarab.ScarabType)Random.Range(0, 2); Scarab bug = plr.AddScarab(rndType); scarabList.Add(bug); bug.name = "Scarab " + rndType.ToString(); } }