Ejemplo n.º 1
0
        private IEnumerator OfferPokemon(PlayerData.PokemonLocator loc)
        {
            if (playerOfferedPokemonLocator != null)
            {
                Debug.LogError("Trying to set new offered pokemon when a pokemon already offered");
                yield break;
            }

            if (tradeStage != TradeStage.ConfirmingOfferChoice)
            {
                Debug.LogError("Trying to set offered pokemon when trade stage isn't choosing offer stage");
                yield break;
            }

            playerOfferedPokemonLocator = loc;

            if (!commsManager.TrySendOfferPokemon(PlayerOfferedPokemon))
            {
                Debug.LogError("Failed to send offered pokemon comm");
                yield break;
            }

            tradeUIController.SetInteractionEnabled(false);

            if (otherUserOfferedPokemon == null)
            {
                yield return(StartCoroutine(SetTradeStage(TradeStage.WaitingForOtherUserOffer)));
            }
            else
            {
                yield return(StartCoroutine(SetTradeStage(TradeStage.DecidingOnOffer)));
            }
        }
Ejemplo n.º 2
0
        public void OnPokemonSelected(PlayerData.PokemonLocator locator)
        {
            selectedPokemonLocator = locator;
            selectedPokemonDetails.SetPokemon(selectedPokemonLocator?.Get(Player));

            RefreshOfferButtonInteractivity();
        }
Ejemplo n.º 3
0
        public void TryConfirmOfferPokemon(PlayerData.PokemonLocator loc)
        {
            if (playerOfferedPokemonLocator != null)
            {
                Debug.LogError("Trying to set new offered pokemon when a pokemon already offered");
                return;
            }

            if (disallowedSendPokemonGuids.Contains(loc.Get(Player).guid)) //If other user isn't allowed to receive this pokemon, don't allow offering it
            {
                needToNotifyPlayerDisallowedTrade = true;
            }
            else
            {
                locatorToBeConfirmed = loc; //Main trade scene coroutine will deal with changing trade stage and prompting for confirmation
            }
        }
Ejemplo n.º 4
0
 public void OnPokemonSelected(PlayerData.PokemonLocator locator)
 {
     tradeUIController.OnPokemonSelected(locator);
 }