public static void MaoEscorregadia() { Inventario jogador = GerenciadorPartida.OrdemJogadores[jogadorEscolhido] .GetComponent <Inventario>(); if (jogador.powerUps.Count > 0) { TipoPowerUps pwTemp = jogador.powerUps[jogador.powerUps.Count - 1].tipo; jogador.powerUps.RemoveAt(jogador.powerUps.Count - 1); jogador = GerenciadorPartida.InvAtual; if (jogador.powerUps.Count < 3) { jogador.AddPowerUp(pwTemp); } } }
public void AtivarEscolha(int i) { if (RPCDeJogadores.DeveUsarRPC()) { RPCDeJogadores.UsarRPCArg("RPC_AtivarEscolha", i); return; } Inventario inv = GerenciadorPartida.InvAtual; if (i < inv.powerUps.Count) { jogadorEscolhido = -1; textoBtn.text = "Escolher Jogador"; powerUpEscolhido = inv.powerUps[i].tipo; pnlEscolherJogador.SetActive(true); Debug.Log(powerUpEscolhido); } }
public void AddPowerUp(TipoPowerUps novoPowerUp, int i = -1) { if (i < 0) { i = GerenciadorPartida.Turno; } Inventario inv = GerenciadorPartida.OrdemJogadores[i].GetComponent <Inventario>(); if (inv.powerUps.Count >= 3) { return; } Transform pnlDescricao = TabuleiroHUD.PnlsDescricoes[i]; bool pnlActive = pnlDescricao.gameObject.activeSelf; pnlDescricao.gameObject.SetActive(true); string txt = LeitorDescr.LeLinha((int)novoPowerUp); PowerUp pw = new PowerUp(); pw.tipo = novoPowerUp; pw.titulo = txt.Split(';')[0]; pw.descricao = txt.Split(';')[1]; inv.powerUps.Add(pw); int teste = powerUps.Count - 1; pnlDescricao = pnlDescricao.GetChild(teste); pnlDescricao.Find("titulo").GetComponentInChildren <Text>().text = pw.titulo; pnlDescricao.Find("conteudo").GetComponentInChildren <Text>().text = pw.descricao; pnlDescricao.gameObject.SetActive(pnlActive); TabuleiroHUD.FundoPowerUps(TabuleiroHUD.corOn, powerUps.Count - 1, i); }