-
-
Save todorok1/4a6d0d2e2a1ab32b705e0d58884e9285 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第72回 味方キャラクターのステータスをセットアップするクラス
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> | |
void SetPlayerStatus() | |
{ | |
var exp = 0; | |
var level = _playerLevel; | |
List<CharacterStatus> characterStatuses = new(); | |
foreach (int characterId in _partyCharacters) | |
{ | |
// レベルに対応するパラメータデータを取得します。 | |
var parameterTable = CharacterDataManager.GetParameterTable(characterId); | |
var parameterRecord = parameterTable.parameterRecords.Find(record => record.level == level); | |
// 指定したレベルまでに覚えている魔法のIDをリスト化します。 | |
var magicList = GetMagicIdList(characterId, level); | |
// キャラクターのステータスを設定します。 | |
CharacterStatus status = new() | |
{ | |
characterId = characterId, | |
level = level, | |
exp = exp, | |
currentHp = parameterRecord.hp, | |
currentMp = parameterRecord.mp, | |
equipWeaponId = _weaponId, | |
equipArmorId = _armorId, | |
magicList = magicList, | |
}; | |
characterStatuses.Add(status); | |
} | |
// 省略 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment