private void handleInicioRonda() { // Primeramente desactivo el movimiento de todos los totems this.desactivarMovimientoTotems(); resetContornoTotemActual(); // Por defecto, a cada inicio de ronda empezará el primer jugador con el movimiento activado this.totemActual = this.listaTotemsJugador.Poll(); this.totemActual.activarControlMovimiento(); // Finalmente, actualizo el estado this.estadoPartida = PARTIDA_STATE.TURNO_RONDA; this.turnoJugador = TURNO_JUGADOR.PRIMER_JUGADOR; ronda += 1; txtNumeroRonda.text = "ROUND: " + ronda; StartCoroutine(intercambiarInventario()); // Actualiza el contorno del módulo actualizarContornoTotemActual(); if (BoxTurn()) { ThrowBox(); } }
private void handleFinalRonda() { //Si han pasado X turnos (box turn) y no ha sucedido la condición de final, lanzamos la caja a la escena txtNumeroRonda.text = "ROUND: " + ronda; estadoPartida = PARTIDA_STATE.INICIO_RONDA; Debug.Log("Fin de la ronda"); }
// Use this for initialization void Start() { this.stateHolder = GetComponent <StateHolder>(); initPlayers(); estadoPartida = PARTIDA_STATE.INICIO_RONDA; turnoJugador = TURNO_JUGADOR.PRIMER_JUGADOR; GameObject inventarioGameObject = GameObject.FindGameObjectWithTag("MainInventory"); this.inventario = inventarioGameObject.GetComponent <Inventory>(); GameObject hotbarGameObject = GameObject.FindGameObjectWithTag("Hotbar"); this.hotbar = hotbarGameObject.GetComponent <Inventory>(); gestorInventario = this.gameObject.AddComponent <GestionInventario>(); gestorInventario.inventory = inventarioGameObject; gestorHotbar = this.gameObject.AddComponent <GestionHotbar>(); gestorHotbar.inventory = hotbarGameObject; condicionFinJuego = GetComponent <EndGameCondition>(); gameObject.AddComponent <PlatformSpawner> (); //txtTurnoJugador.text = "Turno: " + turnoJugador.ToString(); ronda = 0; turnCounter = 1; numCajasLanzadas = 1; this.listaItemsPrimerJugador = new List <int>(); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoAngel); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoEscudoDoble); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoEscudoSimple); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoIglu); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoMissile); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoMissile); this.listaItemsSegundoJugador = new List <int>(); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoAngel); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoEscudoDoble); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoEscudoSimple); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoIglu); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoMissile); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoMissile); }
private void handleTurno() { // En caso que el totem del jugador actual no exceda la distancia desactivo su movimiento while (!totemActual.excedeLimiteDistancia()) { actualizarDistancia(); return; } Debug.Log("Intercambio turno"); if (turnoJugador == TURNO_JUGADOR.SEGUNDO_JUGADOR) { estadoPartida = PARTIDA_STATE.FIN_RONDA; } else { intercambiarTurno(); } turnCounter += 1; }