public float DefinirNivel(Dados.ArmaNivel nivel) { switch (arma) { case Dados.Armas.Alabarda: //NivelAlabarda(nivel); return(NiveisArma[(int)nivel].multiplicador); case Dados.Armas.Arco: NivelArco(nivel); return(NiveisArma[(int)nivel].multiplicador); case Dados.Armas.Cajado: //NivelCajado(nivel); return(NiveisArma[(int)nivel].multiplicador); case Dados.Armas.Espada: NivelEspada(nivel); return(NiveisArma[(int)nivel].multiplicador); case Dados.Armas.Lanca: //NivelLanca(nivel); return(NiveisArma[(int)nivel].multiplicador); case Dados.Armas.Machado: NivelMachado(nivel); return(NiveisArma[(int)nivel].multiplicador); default: return(1); } }
void Awake() { atbPlayer = GetComponent <Atributos>(); ctrAnim = GetComponent <ControleDeAnimacao>(); arma = AutoSave.QualArma(atbPlayer.Personagem); nivel = AutoSave.QualNivel(arma); }
public static void AddNivelArma(Dados.Armas arma, Dados.ArmaNivel nivel) { ArmaNivel a; a.arma = arma; a.nivel = nivel; ArmasNiveis.Add(a); }
public void TrocaArma() { if (indice > Itens.Length - 1) { indice = 0; } if (indice < 0) { indice = Itens.Length - 1; } TrocaTitulo(Itens[indice].Arma); for (int x = 0; x < Itens.Length; x++) { Dados.ArmaNivel nArma = 0; for (int y = 0; y < AutoSave.ArmasNiveis.Count; y++) { if (Itens[x].Arma == AutoSave.ArmasNiveis[y].arma) { nArma = AutoSave.ArmasNiveis[y].nivel; } } for (int y = 0; y < Itens[x].ArmaNiveis.Length; y++) { Itens[x].ArmaNiveis[y].SetActive(x == indice); if (x == indice) { txtValorNivel[y].text = ""; if (y <= (int)nArma) { Itens[x].ArmaNiveis[y].GetComponentInParent <Image>().color = Color.white; } if (y == (int)nArma && Arma == Itens[x].Arma) { Itens[x].ArmaNiveis[y].GetComponentInParent <Image>().color = Color.yellow; } else { Itens[x].ArmaNiveis[y].GetComponentInParent <Image>().color = Color.white; } if (y > (int)nArma) { Itens[x].ArmaNiveis[y].GetComponentInParent <Image>().color = Color.gray; txtValorNivel[y].text = Dados.CustoNivel[y].ToString(); } } } } }
public void FecharLoja() { Selecionados.VezLoja = Dados.PlayerIndice.Vazio; loja.SetActive(false); alvoLoja = null; Selecionados.LojaAberta = false; Personagem = Dados.Personagens.Nenhum; Player = Dados.PlayerIndice.Vazio; Arma = Dados.Armas.Nenhum; ArmaNivel = Dados.ArmaNivel.Nivel1; }
public void AtivarArma(Dados.Armas A, Dados.ArmaNivel N) { ctrAnim.TrocaArma(A); for (int x = 0; x < Arsenal.Length; x++) { if (Arsenal[x].Arma == A) { Arsenal[x].Local.SetActive(true); multi = Arsenal[x].Local.GetComponent <NivelArma>().DefinirNivel(N); break; } } }
public void CarregarDadosSave() { Player = alvoLoja.GetComponent <Move>().playerIndice; Personagem = alvoLoja.GetComponent <Atributos>().Personagem; Arma = alvoLoja.GetComponent <ControleDeArmas>().arma; for (int x = 0; x < AutoSave.ArmasNiveis.Count; x++) { if (AutoSave.ArmasNiveis[x].arma == Arma) { ArmaNivel = AutoSave.ArmasNiveis[x].nivel; break; } } }
void NivelAlabarda(Dados.ArmaNivel nivel) { switch (nivel) { case Dados.ArmaNivel.Nivel1: NiveisArma[0].nivel.SetActive(true); NiveisArma[1].nivel.SetActive(false); NiveisArma[2].nivel.SetActive(false); NiveisArma[3].nivel.SetActive(false); NiveisArma[4].nivel.SetActive(false); break; case Dados.ArmaNivel.Nivel2: NiveisArma[0].nivel.SetActive(true); NiveisArma[1].nivel.SetActive(true); NiveisArma[2].nivel.SetActive(false); NiveisArma[3].nivel.SetActive(false); NiveisArma[4].nivel.SetActive(false); break; case Dados.ArmaNivel.Nivel3: NiveisArma[0].nivel.SetActive(true); NiveisArma[1].nivel.SetActive(true); NiveisArma[2].nivel.SetActive(true); NiveisArma[3].nivel.SetActive(false); NiveisArma[4].nivel.SetActive(false); break; case Dados.ArmaNivel.Nivel4: NiveisArma[0].nivel.SetActive(true); NiveisArma[1].nivel.SetActive(true); NiveisArma[2].nivel.SetActive(true); NiveisArma[3].nivel.SetActive(true); NiveisArma[4].nivel.SetActive(false); break; case Dados.ArmaNivel.Nivel5: NiveisArma[0].nivel.SetActive(true); NiveisArma[1].nivel.SetActive(true); NiveisArma[2].nivel.SetActive(true); NiveisArma[3].nivel.SetActive(true); NiveisArma[4].nivel.SetActive(true); break; } }
void Start() { if (Personagens.Length == 0) { txtBotaoPlayer.text = "Em breve..."; } for (int x = 0; x < Personagens.Length; x++) { Personagens[x].GetComponent <Rigidbody>().isKinematic = true; Personagens[x].GetComponent <Move>().enabled = false; Animator anim = Personagens[x].GetComponent <Animator>(); Dados.Personagens person = Personagens[x].GetComponent <Atributos>().Personagem; Dados.Armas arma = AutoSave.QualArma(person); Dados.ArmaNivel nivel = AutoSave.QualNivel(arma); Personagens[x].SetActive(false); } }