private IEnumerator LevelUp(CharacterData characterData) { List <string> ms = new List <string>(); Status growth = characterData.playerData.GrowthRate; characterData.lv++; characterData.status.maxHp += growth.maxHp; characterData.status.maxMp += growth.maxMp; characterData.status.attack += growth.attack; characterData.status.deffence += growth.deffence; characterData.status.speed += growth.speed; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append($"{characterData.GetName()}は レベル{characterData.lv}に あがった!"); sb.Append($"\nさいだいHPが {growth.maxHp}ポイント あがった!"); sb.Append($"\nさいだいMPが {growth.maxMp}ポイント あがった!"); ms.Add(sb.ToString()); sb.Clear(); sb.Append($"こうげき+{growth.attack} ぼうぎょ+{growth.deffence}\n"); sb.Append($"すばやさ+{growth.speed}"); ms.Add(sb.ToString()); yield return(BattleMessage.GetWindow().ShowClick(ms)); //呪文を覚える yield return(LearnSpell(characterData)); //特技を覚える yield return(LearnSkill(characterData)); yield break; }
public IEnumerator GameOver() { BattleController.isBattle = false; yield return(StartCoroutine(BattleMessage.GetWindow().ShowClick("まけました"))); SceneController.Instance.Transition("Title"); yield break; }
public IEnumerator Do() { //暗転を解除 yield return(StartCoroutine(SceneFader.FadeSceneIn())); //遭遇メッセージを表示 yield return(StartCoroutine(BattleMessage.GetWindow().ShowAuto("敵が現れた"))); yield break; }
public IEnumerator Do() { List <PlayerCharacter> aliveMember = PlayerParty.Instance.AliveMember(); int dropExp = BattleController.instance.GetRewardExp(); foreach (var alivePlayer in aliveMember) { alivePlayer.status.exp = dropExp; string ms = alivePlayer.CharacterName + "は" + dropExp + "けいけんちをかくとく"; yield return(StartCoroutine(BattleMessage.GetWindow().ShowClick(ms))); } yield break; }
private IEnumerator LearnSkill(CharacterData characterData) { var learnSkills = characterData.playerData.SkillDatas; Skill learnSkill = learnSkills.FirstOrDefault(x => x.lv == characterData.lv)?.skill; if (learnSkill == null) { yield break; } yield return(BattleMessage.GetWindow().ShowClick($"{characterData.GetName()}は {learnSkill.skillName}の じゅもんを おぼえた!")); yield break; }
private IEnumerator RewardItem() { Item item = BattleController.instance.GetRewardItem(); if (item == null) { yield break; } InventorySystem.AddItem(item); string ms = "たからばこが おちている!\n" + item.itemName + "を てにいれた"; yield return(BattleMessage.GetWindow().ShowClick(ms)); yield break; }
public IEnumerator Escape() { MessageWindow messageWindow = BattleMessage.GetWindow(); if (IsEscapeSuccess()) { yield return(StartCoroutine(messageWindow.ShowAuto("逃げ切れた"))); yield return(StartCoroutine(SceneController.Instance.BackToField())); yield break; } else { yield return(StartCoroutine(messageWindow.ShowAuto("逃げ切れなかった"))); } escape = false; yield break; }
public IEnumerator Do() { //お金を獲得 int gold = BattleController.instance.GetRewardGold(); GameController.Money += gold; if (gold > 0) { yield return(StartCoroutine(BattleMessage.GetWindow().ShowClick(gold + "ゴールドを てにいれた!"))); } //経験値の獲得とレベルアップ List <PlayerCharacter> aliveMember = BattleController.instance.AlivePlayerCharacters; int dropExp = BattleController.instance.GetRewardExp(); if (dropExp > 0) { foreach (var alivePlayer in aliveMember) { CharacterData characterData = Party.Find(alivePlayer.playerData.CharacterID); string ms = alivePlayer.CharacterName + "は" + dropExp + "けいけんちをかくとく"; yield return(StartCoroutine(BattleMessage.GetWindow().ShowClick(ms))); int lv = characterData.lv; yield return(GiveExp(characterData, dropExp)); if (characterData.lv == lv) { continue; } //レベルが上昇したとき回復する alivePlayer.status.hp = characterData.status.maxHp; alivePlayer.status.mp = characterData.status.maxMp; } } //アイテムの獲得 yield return(RewardItem()); yield break; }
private void Start() { message = BattleMessage.GetWindow(); }