// Update is called once per frame void Update() { Debug.Log(currentState); switch (currentState) { case (BattleStates.START): //SETUP BATTLE FUNCTION //It will run until something ends the battle break; case (BattleStates.PLAYERCHOICE): break; case (BattleStates.ENEMYCHOICE): break; case (BattleStates.LOSE): break; case (BattleStates.WIN): if (!hasAddedXP) { IncreaseExperience.AddExperience(); hasAddedXP = true; } break; } }
// Update is called once per frame void Update() { Debug.Log(currentState); switch (currentState) { case BattleStates.START: //setup battle function break; case BattleStates.PLAYERCHOICE: break; case BattleStates.ENEMYCHOICE: break; case BattleStates.LOSE: break; case BattleStates.WIN: if (!hasAddedXP) { IncreaseExperience.AddExperience(); hasAddedXP = true; } break; } }
// Update is called once per frame void Update() { Debug.Log(currentState); switch (currentState) { case (BattleStates.START): break; case (BattleStates.PLAYERCHOICE): break; case (BattleStates.ENEMYCHOICE): break; case (BattleStates.LOSE): break; case (BattleStates.WIN): if (!hasAddedExp) { IncreaseExperience.AddExperience(); hasAddedExp = true; } break; } }
void Update() { Debug.Log(currentState); switch (currentState) { case (BattleStates.START): //SETUP BATTLE FUNCTION break; case (BattleStates.PLAYERCHOISE): break; case (BattleStates.ENEMYCHOISE): break; case (BattleStates.LOOSE): break; case (BattleStates.WIN): if (!hasAddedXP) { IncreaseExperience.AddExperience(); hasAddedXP = true; } break; } }
void Update() { Debug.Log(_currentState); switch (_currentState) { case BattleStates.Start: //SETUP BATTLE FUNCTION break; case BattleStates.PlayerChoice: break; case BattleStates.EnemyChoice: break; case BattleStates.Lose: break; case BattleStates.Win: if (!_hasAddetXP) { IncreaseExperience.AddExperience(); _hasAddetXP = true; } break; } }
void Update() { switch (currentState) { case (BattleStates.START): battleStartScript.PrepareBattle(); break; case (BattleStates.PLAYERCHOICE): break; case (BattleStates.ENEMYCHOICE): break; case (BattleStates.CALCDAMAGE): battleCalcScript.CalculatePlayerFunctionDamage(playerFunctionUsed); break; case (BattleStates.STATUSEFFECTS): break; case (BattleStates.LOSE): break; case (BattleStates.WIN): if (!hasAddedExp) { IncreaseExperience.AddExperience(); hasAddedExp = true; } GameObject.Find("Player").GetComponent <PlayerMovement>().CanMove = true; AutoFade.LoadLevel(GameInformation.CurrentRoom, 0, 1, Color.black); break; } }
void DeathMob() { GetComponent <Animation>().CrossFade(mobDie.name); if (GetComponent <Animation>()[mobDie.name].time > GetComponent <Animation>()[mobDie.name].length * 0.9) { IncreaseExperience.AddDefeatedEnemyExperience(350); Destroy(gameObject); } }
private void OnGUI() { if (GUILayout.Button("EXP + 10")) { IncreaseExperience.AddExperience(10); Debug.Log("Lv: " + GameInformation.Player1Level + " " + GameInformation.Player1Experience + "/" + GameInformation.Player1Required + " xp - ATK:" + GameInformation.Attack1 + " DEF:" + GameInformation.Defence1 + " HP:" + GameInformation.Health1 + " MP:" + GameInformation.Magic1); } if (GUILayout.Button("EXP + 100")) { IncreaseExperience.AddExperience(100); Debug.Log("Lv: " + GameInformation.Player1Level + " " + GameInformation.Player1Experience + "/" + GameInformation.Player1Required + " xp - ATK:" + GameInformation.Attack1 + " DEF:" + GameInformation.Defence1 + " HP:" + GameInformation.Health1 + " MP:" + GameInformation.Magic1); } if (GUILayout.Button("EXP + 1000")) { IncreaseExperience.AddExperience(1000); Debug.Log("Lv: " + GameInformation.Player1Level + " " + GameInformation.Player1Experience + "/" + GameInformation.Player1Required + " xp - ATK:" + GameInformation.Attack1 + " DEF:" + GameInformation.Defence1 + " HP:" + GameInformation.Health1 + " MP:" + GameInformation.Magic1); } }
public void LevelUP(BasePlayer.AilaArchetype ailaClass) { GameInformation.Aila.PlayerLevel += 1; GameInformation.Aila.XPAtual -= GameInformation.Aila.XPNecessario; //permite que o jogador retenha algum do seu xp ao passar de nível if (ailaClass == BasePlayer.AilaArchetype.DESTEMIDA) { poderModifier = 3.0f; imaginacaoModifier = 1.0f; resistenciaModifier = 2.0f; determinacaoModifier = 1.0f; sorteModifier = 2.0f; } else if (ailaClass == BasePlayer.AilaArchetype.CRIATIVA) { poderModifier = 1.0f; imaginacaoModifier = 3.5f; resistenciaModifier = 1.5f; determinacaoModifier = 2.0f; sorteModifier = 1.5f; } else if (ailaClass == BasePlayer.AilaArchetype.AVOADA) { poderModifier = 0.2f; imaginacaoModifier = 0.2f; resistenciaModifier = 0.2f; determinacaoModifier = 0.2f; sorteModifier = 0.3f; } AtualizarStats(GameInformation.Aila.PlayerLevel); GameInformation.Aila.XPNecessario = DeterminarXPNecessario(); IncreaseExperience.CheckLevelUp(); //depois de fazer todo o processo de subir o nível e mudar os status de acordo, checamos novamente se o jogador ainda pode subir de nível com o xp que sobrou depois }
// Update is called once per frame void Update() { Debug.Log(currentState); switch (currentState) { case (BattleStates.START): //set up battle function?? //create enemy battleStateStartScript.PrepareBattle(); //choose who goes first based on luck break; case (BattleStates.PLAYERCHOICE): //player chooses ability they wanna use currentUser = BattleStates.PLAYERCHOICE; break; case (BattleStates.ENEMYCHOICE): //Coded AI goes here. currentUser = BattleStates.ENEMYCHOICE; battleStateEnemyChoiceScript.EnemyCompleteTurn(); //enemyDidCompleteTurn = true; //CheckWhoGoesNext(); break; case (BattleStates.CALCDAMAGE): // we calc damage done by player, look for existing status effects and add that damage if (currentUser == BattleStates.PLAYERCHOICE) { battleCalcScript.CalculateTotalPlayerDamage(playerUsedAbility); } if (currentUser == BattleStates.ENEMYCHOICE) { battleCalcScript.CalculateTotalEnemyDamage(enemyUsedAbility); } //Debug.Log ("CALCULATING DAMAGE"); CheckWhoGoesNext(); break; case (BattleStates.ADDSTATUSEFFECTS): // we try to add a status effect, if it exists. battleStateAddStatusEffectsScript.CheckAbilityForStatusEffects(playerUsedAbility); break; case (BattleStates.ENDTURN): totalTurnCount += 1; playerDidCompleteTurn = false; enemyDidCompleteTurn = false; Debug.Log(totalTurnCount); currentState = firstTurn; //switch back to whoever went first. break; case (BattleStates.LOSE): break; case (BattleStates.WIN): Debug.Log("WON!!!!"); if (!hasAddedXP) { IncreaseExperience.AddExperience(); hasAddedXP = true; } GameInformation.BattleWon = true; SceneManager.LoadScene(GameInformation.PreviousScene); SaveInformation.SaveAllInformation(); break; } }
// Update is called once per frame void FixedUpdate() { Debug.Log(currentState); if (!waitActive) //Só lê o próximo estado estado, ou seja, só avança o game state se não tiver que esperar por algo, seja la o que for { switch (currentState) { case (BattleStates.START): //Apresentar os inimigos, ativa o hud e tals battleStartscript.PrepareBattle(); //A CD aumenta para cada inimigo na lista. por enquanto sempre vai ser 3 turnLogText = "Falsas memórias foram encontradas!"; cd = cd * inimigosList.Count; waitActive = true; break; case (BattleStates.PLAYERCHOICE): CameraParaJogador(); turnLogText = "Sua vez!"; currentActor = BattleStates.PLAYERCHOICE; //armazenando que o ator é o jogador break; case (BattleStates.PLAYERANIM): break; case (BattleStates.ENEMYCHOICE): //colocar IA aqui currentActor = BattleStates.ENEMYCHOICE; //checa cada inimigo na lista para ver se ele já agiu int inimIndex = 0; //sempre reseta para o primeiro, porém ... foreach (Inimigo inimstat in inimigosList) { if (inimstat.Agiu) { inimIndex++; //...sempre que encontra um inimigo que já agiu ele adiciona 1 no indexador inimigoTerminouTurno = true; } else { //e quando encontra um que não agiu, significa que o turno dos inimigos ainda não acabou inimigoTerminouTurno = false; } } if (inimigoTerminouTurno == false) //só entra aqui se cada inimigo na lista ainda não agiu { battleStateEnemyChoicescript.EnemyCompleteTurn(inimIndex); enemyActionCamera.transform.position = inimigodavez.cameraPos.transform.position; CameraParaInimigo(); } else { DecidirProximoAtor(); } break; case (BattleStates.ENEMYANIM): //faz os paranaue de animar la break; case (BattleStates.CALCDAMAGE): Debug.Log("CALCULANDO DANO"); if (currentActor == BattleStates.PLAYERCHOICE) //se é o turno do jogador e ele escolheu alguma ação { battleCalcScript.CalculateTotalPlayerDMG(playerUsedAction, inimAlvo); } if (currentActor == BattleStates.ENEMYCHOICE && inimigodavez != null) //calcula o dano se o inimigo ainda não agiu { battleCalcScript.CalculateTotalEnemyDMG(enemyUsedAction, inimigodavez); inimigodavez.Agiu = true; } DecidirProximoAtor(); // Depois de calcular todo o dano, vai retornar para o turno dos inimigos se algum deles não terminou o turno; break; case (BattleStates.ADDSTATUSEFFECT): //Adicionar status no alvo, se houver algum battleAddEffectscript.CheckActionStatus(playerUsedAction); break; case (BattleStates.ENDROUND): totalRoundCounter += 1; jogadorTerminouTurno = false; inimigoTerminouTurno = false; DecidirProximoAtor(); CameraParaJogador(); turnLogText = "Fim da rodada"; waitActive = true; break; case (BattleStates.WIN): //Código que mostra resultados da batalha como XP e itens aqui if (!xprecebido) { battleResultsPanel.SetActive(true); int xpDado = IncreaseExperience.AddExperience(cd); xprecebido = true; expPointsDados.text = " " + xpDado; if (jogPassouNivel) { lvlupwarnTxt.SetActive(true); } } break; case (BattleStates.LOSE): break; } } else { waitTime -= Time.deltaTime; if (waitTime <= 0) { waitActive = false; waitTime = startWaitTime; } } turnLogBox.GetComponent <TextMeshProUGUI>().text = turnLogText; }