/// <summary> /// Called when the player selects destination for gold /// </summary> void GoldDestinationSelected_(ButtonValues selection) { _goldZone = selection; _selectionState = MineSelectionState.CoalDestination; Carts[(int)selection].SetContents(MineItemDrop.Gold); TxtCommentary.text = _players[_activePlayerIndex].GetPlayerName() + ":\nWhere would you like to place the COAL?"; }
/// <summary> /// Called when the player selects destination for gold /// </summary> void GoldClaimSelected_(ButtonValues selection) { // stop the time limit _zoneSelectionLimit.Abort(); // store the selection _goldClaimZone = selection; _selectionState = MineSelectionState.None; // show carts and enable movement StartCoroutine(MoveCartsOn()); StartCoroutine(Runaround_()); }
/// <summary> /// Called when the player selects destination for coal /// </summary> void CoalDestinationSelected_(ButtonValues selection) { // can't put coal and gold in the same zone if (_goldZone != selection) { TxtErrorMessage.text = ""; _coalZone = selection; _selectionState = MineSelectionState.GoldClaim; Carts[(int)selection].SetContents(MineItemDrop.Coal); TxtCommentary.text = _players[_activePlayerIndex].GetPlayerName() + ":\nTell the other players where you put the gold.\nYou get " + Truth_Points + " for telling the truth,\nor " + Wrong_Points + " for each player who picks\nthe cart that contains coal"; } else { TxtErrorMessage.text = "Gold and coal cannot go into same cart"; } }
/// <summary> /// Callback for the zone selection timer - called once timer expires /// </summary> void ZoneSelectionTimeoutCallback_() { _timeoutOccurred = true; var random = UnityEngine.Random.Range(0, 3); _goldZone = (ButtonValues)random; _goldClaimZone = (ButtonValues)random; _coalZone = (ButtonValues)(3 - random); TxtErrorMessage.text = ""; _selectionState = MineSelectionState.None; // add items to carts Carts[random].SetContents(MineItemDrop.Gold); Carts[3 - random].SetContents(MineItemDrop.Coal); // show carts and enable movement StartCoroutine(MoveCartsOn()); StartCoroutine(Runaround_()); }
/// <summary> /// Callback for when the player reaches the platform position /// </summary> void RunOnCallback() { foreach (var cart in Carts) { cart.SetContents(MineItemDrop.None); } // enable players except the one that needs to run off foreach (var p in _players) { if (p.GetPlayerIndex() != _activePlayerIndex) { p.CanMove(true); } } _selectionState = MineSelectionState.GoldDestination; // start a timeout _zoneSelectionLimit.StartTimer(); TxtCommentary.text = _players[_activePlayerIndex].GetPlayerName() + ":\nIn which cart would you like to place the GOLD?"; }