-
-
Save todorok1/33f94b80420d289f65c4bc4d538006ca to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第116回 戦闘中の攻撃アクションを処理するクラス
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// 攻撃のメッセージを表示します。 | |
| /// </summary> | |
| IEnumerator ShowAttackMessage(BattleAction action, int damage, bool isTargetDefeated) | |
| { | |
| string actorName = _actionProcessor.GetCharacterName(action.actorId, action.isActorFriend); | |
| string targetName = _actionProcessor.GetCharacterName(action.targetId, action.isTargetFriend); | |
| // 攻撃時の効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.Attack); | |
| _actionProcessor.SetPauseMessage(true); | |
| _messageWindowController.GenerateAttackMessage(actorName); | |
| while (_actionProcessor.IsPausedMessage) | |
| { | |
| yield return null; | |
| } | |
| // ダメージの効果音を再生します。 | |
| AudioManager.Instance.PlaySe(SeNames.Damage); | |
| _actionProcessor.SetPauseMessage(true); | |
| _messageWindowController.GenerateDamageMessage(targetName, damage); | |
| _battleManager.OnUpdateStatus(); | |
| while (_actionProcessor.IsPausedMessage) | |
| { | |
| yield return null; | |
| } | |
| if (!isTargetDefeated) | |
| { | |
| _actionProcessor.SetPauseProcess(false); | |
| yield break; | |
| } | |
| if (action.isTargetFriend) | |
| { | |
| _actionProcessor.SetPauseMessage(true); | |
| _messageWindowController.GenerateDefeateFriendMessage(targetName); | |
| while (_actionProcessor.IsPausedMessage) | |
| { | |
| yield return null; | |
| } | |
| if (CharacterStatusManager.IsAllCharacterDefeated()) | |
| { | |
| _battleManager.OnGameover(); | |
| } | |
| } | |
| else | |
| { | |
| _actionProcessor.SetPauseMessage(true); | |
| _battleSpriteController.HideEnemy(); | |
| _messageWindowController.GenerateDefeateEnemyMessage(targetName); | |
| while (_actionProcessor.IsPausedMessage) | |
| { | |
| yield return null; | |
| } | |
| if (_enemyStatusManager.IsAllEnemyDefeated()) | |
| { | |
| _battleManager.OnEnemyDefeated(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment