diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23aa9cbb8cc..e0fae8ea91a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -241,7 +241,7 @@ Example: - Set notifications to **Suggestion** level. #### Code Body -- Prefer block body over expression body for functions. +- Prefer block body over expression body for functions. - Recommend expression body for properties, indexers, and events. ```csharp @@ -253,7 +253,7 @@ private int Add(int a, int b) ``` #### Attributes -- Separate each attribute with its own square brackets. +- Separate each attribute with its own square brackets. ### Braces Layout - Use BSD style (default setting). @@ -269,4 +269,52 @@ private int Add(int a, int b) - Place field or property/indexer/event attribute on the same line ### Spaces -- Use default settings except for **Between attribute sections**, which is set to `false`. \ No newline at end of file +- Use default settings except for **Between attribute sections**, which is set to `false`. + +Arena simulation +--- +You can simulate an ArenaBattle using the Assets/_Scenes/BattleSimulation scene in the editor. +you can config avatar spec with `Assets/StreamingAssets/avatar.json`, `Assets/StreamingAssets/avatar-enemy.json` + +### avatar.json format +```json5 +{ + "Level": 1, // Represents the level of the avatar in the simulation + "collectionIds": [ + 1, // Corresponds to a specific collection ID in the CollectionSheet. Refers to collections to activate. + 8 // Refer to the CollectionSheet for more details. + ], + "RuneItems": [ + { + "Id": 30001, // ID of the rune, as defined in the RuneListSheet + "Level": 2, // The level of the rune + "SlotIndex": 0 // Slot where the rune is equipped (0-6). If empty, only level bonuses are applied. + } + ], + "CostumeIds": [ + 49900024 // ID of the costume to equip. Refer to the CostumeItemSheet. + ], + "EquipmentItems": [ + { + "Id": 10120000, // ID of the equipment item, as defined in the EquipmentItemSheet + "Level": 17, // The level of the equipment + "StatOptions": [ + { + "StatType": "HP", // The type of stat (e.g., HP, ATK, etc.) from StatType Enum + "Value": 100 // The value of the stat to be applied + } + ], + "SkillOptions": [ + { + "Id": 800072, // ID of the skill option + "Power": 100, // The power of the skill + "Chance": 100, // The probability of skill activation (percentage) + "StatPowerRatio": 1, // Skill power ratio based on stats + "StatType": "HP" // The type of stat influencing the skill (from StatType Enum) + } + ] + } + ] +} + +``` diff --git a/nekoyume/Assets/StreamingAssets/avatar-enemy.json b/nekoyume/Assets/StreamingAssets/avatar-enemy.json new file mode 100644 index 00000000000..f0f74ed4466 --- /dev/null +++ b/nekoyume/Assets/StreamingAssets/avatar-enemy.json @@ -0,0 +1,38 @@ +{ + "Level": 1, + "collectionIds": [ + 1, + 8 + ], + "RuneItems": [ + { + "Id": 30001, + "Level": 2, + "SlotIndex": 0 + } + ], + "CostumeIds": [ + 49900024 + ], + "EquipmentItems": [ + { + "Id": 10120000, + "Level": 17, + "StatOptions": [ + { + "StatType": "ATK", + "Value": 100 + } + ], + "SkillOptions": [ + { + "Id": 800072, + "Power": 100, + "Chance": 100, + "StatPowerRatio": 1, + "StatType": "HP" + } + ] + } + ] +} diff --git a/nekoyume/Assets/StreamingAssets/avatar-enemy.json.meta b/nekoyume/Assets/StreamingAssets/avatar-enemy.json.meta new file mode 100644 index 00000000000..da2ed4e5cf3 --- /dev/null +++ b/nekoyume/Assets/StreamingAssets/avatar-enemy.json.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6220b39361224537a799d8f7f44de42a +timeCreated: 1735179458 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/avatar.json b/nekoyume/Assets/StreamingAssets/avatar.json new file mode 100644 index 00000000000..55c6a3f8aaa --- /dev/null +++ b/nekoyume/Assets/StreamingAssets/avatar.json @@ -0,0 +1,38 @@ +{ + "Level": 1, + "collectionIds": [ + 1, + 8 + ], + "RuneItems": [ + { + "Id": 30001, + "Level": 2, + "SlotIndex": 0 + } + ], + "CostumeIds": [ + 49900024 + ], + "EquipmentItems": [ + { + "Id": 10120000, + "Level": 17, + "StatOptions": [ + { + "StatType": "HP", + "Value": 100 + } + ], + "SkillOptions": [ + { + "Id": 800072, + "Power": 100, + "Chance": 100, + "StatPowerRatio": 1, + "StatType": "HP" + } + ] + } + ] +} diff --git a/nekoyume/Assets/StreamingAssets/avatar.json.meta b/nekoyume/Assets/StreamingAssets/avatar.json.meta new file mode 100644 index 00000000000..97b8519db65 --- /dev/null +++ b/nekoyume/Assets/StreamingAssets/avatar.json.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6147050a2dcd450eaae3bf45241686cd +timeCreated: 1735015554 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_allrune1.txt b/nekoyume/Assets/StreamingAssets/serialized_allrune1.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_allrune1.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_allrune1.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_allrune1.txt.meta deleted file mode 100644 index 6db03396493..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_allrune1.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a00afff56557417dba26893fbc830941 -timeCreated: 1733377780 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_allrune2.txt b/nekoyume/Assets/StreamingAssets/serialized_allrune2.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_allrune2.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_allrune2.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_allrune2.txt.meta deleted file mode 100644 index f82a0e484d6..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_allrune2.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 61b0bb1cc6194b3fa788858408fe33f8 -timeCreated: 1733377874 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_avatar1.txt b/nekoyume/Assets/StreamingAssets/serialized_avatar1.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_avatar1.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_avatar1.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_avatar1.txt.meta deleted file mode 100644 index ea049b6c471..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_avatar1.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b455126d602f49b982425490d4bbf776 -timeCreated: 1733377712 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_avatar2.txt b/nekoyume/Assets/StreamingAssets/serialized_avatar2.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_avatar2.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_avatar2.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_avatar2.txt.meta deleted file mode 100644 index 221556b21cc..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_avatar2.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 675132fd3b46418a92cc8ca7266721a2 -timeCreated: 1733377871 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_collection1.txt b/nekoyume/Assets/StreamingAssets/serialized_collection1.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_collection1.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_collection1.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_collection1.txt.meta deleted file mode 100644 index 54377580b1f..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_collection1.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6deac5ed69d64b3cbce4baca9b04b7a7 -timeCreated: 1733377841 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_collection2.txt b/nekoyume/Assets/StreamingAssets/serialized_collection2.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_collection2.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_collection2.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_collection2.txt.meta deleted file mode 100644 index 1fde0333e8a..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_collection2.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 3043e27eb6fc44e79ef24386aeffff89 -timeCreated: 1733377866 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_inventory1.txt b/nekoyume/Assets/StreamingAssets/serialized_inventory1.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_inventory1.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_inventory1.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_inventory1.txt.meta deleted file mode 100644 index 746b835a7cd..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_inventory1.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9097259e6639439985b668df62045006 -timeCreated: 1733377746 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_inventory2.txt b/nekoyume/Assets/StreamingAssets/serialized_inventory2.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_inventory2.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_inventory2.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_inventory2.txt.meta deleted file mode 100644 index 2ac8271a552..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_inventory2.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f15346a37454444eb83024d8d33cf0ca -timeCreated: 1733377862 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt b/nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt.meta deleted file mode 100644 index 5aa4534db8e..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ebfa67dd48534f1f9096fd2d28bd6aa7 -timeCreated: 1733377796 \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt b/nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt deleted file mode 100644 index 5f282702bb0..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt.meta b/nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt.meta deleted file mode 100644 index 1bab5607b5c..00000000000 --- a/nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b0fff4605552493fbb28212946207c5e -timeCreated: 1733377857 \ No newline at end of file diff --git a/nekoyume/Assets/_Scripts/Editor/TestArena.cs b/nekoyume/Assets/_Scripts/Editor/TestArena.cs index ea1d52809f0..0168f357e83 100644 --- a/nekoyume/Assets/_Scripts/Editor/TestArena.cs +++ b/nekoyume/Assets/_Scripts/Editor/TestArena.cs @@ -5,21 +5,16 @@ using Cysharp.Threading.Tasks; using Libplanet.Crypto; using Nekoyume; -using Nekoyume.Blockchain; using Nekoyume.Editor; using Nekoyume.Game; using Nekoyume.Game.Battle; using Nekoyume.Game.Character; -using Nekoyume.Game.Controller; -using Nekoyume.Game.Util; -using Nekoyume.Game.VFX.Skill; using Nekoyume.Helper; using Nekoyume.L10n; using Nekoyume.Model; using Nekoyume.Model.BattleStatus.Arena; using Nekoyume.Model.Item; using Nekoyume.Model.Skill; -using Nekoyume.UI; using UniRx; using UnityEngine; using ArenaCharacter = Nekoyume.Model.ArenaCharacter; @@ -418,4 +413,3 @@ public IEnumerator CoShatterStrike(ArenaCharacter caster, IEnumerable(jsonData); + var avatarName = me ? "me" : "enemy"; + var avatar = GetAvatarState(result.Level, avatarName, avatarSheets); + var inventory = new Inventory(); + var equipmentItemSheet = tableSheets.EquipmentItemSheet; + var skillSheet = tableSheets.SkillSheet; + foreach (var equipmentItem in result.EquipmentItems) + { + var row = equipmentItemSheet[equipmentItem.Id]; + var equipment = (Equipment)ItemFactory.CreateItemUsable(row, new Guid(), 0L, equipmentItem.Level); + foreach (var statOption in equipmentItem.StatOptions) + { + var statMap = new DecimalStat(statOption.StatType, statOption.Value); + equipment.StatsMap.AddStatAdditionalValue(statMap.StatType, statMap.TotalValue); + } - var collection1Str = - GetTrimmedStringFromPath("serialized_collection1.txt"); - var collection2Str = - GetTrimmedStringFromPath("serialized_collection1.txt"); - CollectionState collection1; - CollectionState collection2; - try + foreach (var skillOption in equipmentItem.SkillOptions) + { + var skillRow = skillSheet.Values.First(r => r.Id == skillOption.Id); + var skill = SkillFactory.Get(skillRow, skillOption.Power, skillOption.Chance, skillOption.StatPowerRatio, skillOption.StatType); + equipment.Skills.Add(skill); + } + equipment.equipped = true; + inventory.AddItem(equipment); + } + var costumeSheet = tableSheets.CostumeItemSheet; + foreach (var costumeId in result.CostumeIds) { - collection1 = GetCollectionStateFromRawState(collection1Str); + var costume = new Costume(costumeSheet[costumeId], new Guid()) + { + equipped = true, + }; + inventory.AddItem(costume); } - catch + var allRuneState = new AllRuneState(); + var runeSlotInfos = new List(); + foreach (var runeItem in result.RuneItems) { - collection1 = new CollectionState(); - foreach (var id in collection1Str.Trim().Split(",").Select(int.Parse)) + var runeId = runeItem.Id; + allRuneState.AddRuneState(new RuneState(runeId, runeItem.Level)); + if (runeItem.SlotIndex.HasValue) { - collection1.Ids.Add(id); + runeSlotInfos.Add(new RuneSlotInfo(runeItem.SlotIndex.Value, runeId)); } } + var runeSlotState = new RuneSlotState(BattleType.Arena); + runeSlotState.UpdateSlot(runeSlotInfos, tableSheets.RuneListSheet); - try + CollectionState collectionState = new CollectionState(); + var collectionIds = result.CollectionIds.Distinct(); + foreach (var collectionId in collectionIds) { - collection2 = GetCollectionStateFromRawState(collection2Str); + collectionState.Ids.Add(collectionId); } - catch + if (me) { - collection2 = new CollectionState(); - foreach (var id in collection2Str.Trim().Split(",").Select(int.Parse)) - { - collection2.Ids.Add(id); - } + _myCollectionState = collectionState; + _me = new ArenaPlayerDigest(avatar, + inventory.Costumes.Where(eq => eq.equipped).ToList(), + inventory.Equipments.Where(eq => eq.equipped).ToList(), + allRuneState, + runeSlotState); + _myAddress = avatar.address; + } + else + { + _enemyCollectionState = collectionState; + _enemy = new ArenaPlayerDigest(avatar, + inventory.Costumes.Where(eq => eq.equipped).ToList(), + inventory.Equipments.Where(eq => eq.equipped).ToList(), + allRuneState, + runeSlotState); + _enemyAddress = avatar.address; } - _myCollectionState = collection1; - _enemyCollectionState = collection2; - _me = new ArenaPlayerDigest(avatar1, - inventory1.Costumes.Where(eq => eq.equipped).ToList(), - inventory1.Equipments.Where(eq => eq.equipped).ToList(), - allRune1, - runeSlot1); - _myAddress = avatar1.address; - _enemy = new ArenaPlayerDigest(avatar2, - inventory2.Costumes.Where(eq => eq.equipped).ToList(), - inventory2.Equipments.Where(eq => eq.equipped).ToList(), - allRune2, - runeSlot2); - _enemyAddress = avatar2.address; - - NcDebug.Log($"name: {avatar1.name}\n" + StatStringFromDigest(_me, - _myCollectionState.GetModifiers(TestArena.Instance.TableSheets.CollectionSheet)), - "TestArenaSimulation"); - NcDebug.Log($"name: {avatar2.name}\n" + StatStringFromDigest(_enemy, - _enemyCollectionState.GetModifiers(TestArena.Instance.TableSheets - .CollectionSheet)), + NcDebug.Log($"name: {avatar.name}\n" + StatStringFromDigest(_me, + _myCollectionState.GetModifiers(TestArena.Instance.TableSheets.CollectionSheet)), "TestArenaSimulation"); } @@ -122,7 +153,8 @@ private void Simulate() _myCollectionState.GetModifiers(TestArena.Instance.TableSheets.CollectionSheet), _enemyCollectionState.GetModifiers(TestArena.Instance.TableSheets.CollectionSheet), TestArena.Instance.TableSheets.BuffLimitSheet, - TestArena.Instance.TableSheets.BuffLinkSheet); + TestArena.Instance.TableSheets.BuffLinkSheet, + true); TestArena.Instance.Enter(log, new List(), _me, @@ -131,40 +163,11 @@ private void Simulate() _enemyAddress); } - private string GetTrimmedStringFromPath(string path) - { - return File.ReadAllText(Platform.GetStreamingAssetsPath(path)).Trim(); - } - - private static IValue GetStateFromRawState(string rawBinaryString) - { - var binary = Binary.FromHex(rawBinaryString); - return new Codec().Decode(binary.ToByteArray()); - } - - private static AvatarState GetAvatarStateFromRawState(string rawBinaryString) - { - return new AvatarState((List)GetStateFromRawState(rawBinaryString)); - } - - private static Inventory GetInventoryFromRawState(string rawBinaryString) + private static AvatarState GetAvatarState(int level, string name, AvatarSheets avatarSheets) { - return new Inventory((List)GetStateFromRawState(rawBinaryString)); - } - - private static AllRuneState GetAllRuneStateFromRawState(string rawBinaryString) - { - return new AllRuneState((List)GetStateFromRawState(rawBinaryString)); - } - - private static RuneSlotState GetRuneSlotStateStateFromRawState(string rawBinaryString) - { - return new RuneSlotState((List)GetStateFromRawState(rawBinaryString)); - } - - private static CollectionState GetCollectionStateFromRawState(string rawBinaryString) - { - return new CollectionState((List)GetStateFromRawState(rawBinaryString)); + var avatarState = AvatarState.Create(new Address(), new Address(), 0, avatarSheets, new Address(), name); + avatarState.level = level; + return avatarState; } public static string StatStringFromDigest(ArenaPlayerDigest avatar, List modifier) @@ -190,5 +193,49 @@ public static string StatStringFromArenaCharacter(ArenaCharacter arenaCharacter) cri: {arenaCharacter.CRI} cdmg: {arenaCharacter.CDMG}"; } + + [Serializable] + public class AvatarModel + { + public int Level; + public int[] CollectionIds; + public RuneItem[] RuneItems; + public int[] CostumeIds; + public EquipmentItem[] EquipmentItems; + } + + [Serializable] + public class RuneItem + { + public int Id; + public int Level; + public int? SlotIndex; + } + + [Serializable] + public class EquipmentItem + { + public int Id; + public int Level; + public StatOptions[] StatOptions; + public SkillOptions[] SkillOptions; + } + + [Serializable] + public class StatOptions + { + public StatType StatType; + public int Value; + } + + [Serializable] + public class SkillOptions + { + public int Id; + public int Power; + public int Chance; + public int StatPowerRatio; + public StatType StatType; + } } } diff --git a/nekoyume/Assets/_Scripts/Extensions/BuffSheetExtension.cs b/nekoyume/Assets/_Scripts/Extensions/BuffSheetExtension.cs index f2f2f5711c6..ab004c9565f 100644 --- a/nekoyume/Assets/_Scripts/Extensions/BuffSheetExtension.cs +++ b/nekoyume/Assets/_Scripts/Extensions/BuffSheetExtension.cs @@ -1,7 +1,7 @@ +using Nekoyume.Game; using Nekoyume.Helper; using Nekoyume.L10n; using Nekoyume.Model.Buff; -using Nekoyume.TableData; using UnityEngine; namespace Nekoyume @@ -28,9 +28,9 @@ public static string GetLocalizedDescription(this Buff buff) return $"!{buff.BuffInfo.Id}!"; } - public static Sprite GetIcon(this Buff buff) + public static Sprite GetIcon(this Buff buff, TableSheets tableSheets) { - return BuffHelper.GetBuffIcon(buff); + return BuffHelper.GetBuffIcon(buff, tableSheets); } } } diff --git a/nekoyume/Assets/_Scripts/Game/Battle/Arena.cs b/nekoyume/Assets/_Scripts/Game/Battle/Arena.cs index f7b94a324d2..38b9653357d 100644 --- a/nekoyume/Assets/_Scripts/Game/Battle/Arena.cs +++ b/nekoyume/Assets/_Scripts/Game/Battle/Arena.cs @@ -132,7 +132,7 @@ private IEnumerator CoStart( _turnNumber = 1; - Widget.Find().Show(myDigest, enemyDigest, myAvatarAddress, enemyAvatarAddress); + Widget.Find().Show(myDigest, enemyDigest, myAvatarAddress, enemyAvatarAddress, TableSheets.Instance); enemy.Pet.Animator.DestroyTarget(); yield return new WaitForSeconds(2.0f); diff --git a/nekoyume/Assets/_Scripts/Game/Battle/Stage.cs b/nekoyume/Assets/_Scripts/Game/Battle/Stage.cs index eb16c2c27f0..44c04404abf 100644 --- a/nekoyume/Assets/_Scripts/Game/Battle/Stage.cs +++ b/nekoyume/Assets/_Scripts/Game/Battle/Stage.cs @@ -892,7 +892,7 @@ public IEnumerator CoSpawnPlayer(Model.Player character) #endif var avatarState = States.Instance.CurrentAvatarState; var playerCharacter = RunPlayer(false); - playerCharacter.Set(avatarState.address, character, true); + playerCharacter.Set(avatarState.address, character, true, TableSheets.Instance); playerCharacter.Run(); playerCharacter.ShowSpeech("PLAYER_INIT"); var player = playerCharacter.gameObject; @@ -1464,8 +1464,6 @@ IEnumerator CoFrostBite(IReadOnlyList skillInfos) )); break; } - - ; } // This Tick from 'Stun' else if (tick.SkillId == 0) @@ -1622,7 +1620,7 @@ public Actor GetActor(CharacterBase caster) } } - character?.Set(caster); + character?.Set(caster, TableSheets.Instance); return character; } diff --git a/nekoyume/Assets/_Scripts/Game/Character/Actor.cs b/nekoyume/Assets/_Scripts/Game/Character/Actor.cs index 04cb4ba3df4..026f409d9b1 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/Actor.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/Actor.cs @@ -154,7 +154,7 @@ protected override void OnDisable() #endregion - public virtual void Set(CharacterBase model, bool updateCurrentHp = false) + public virtual void Set(CharacterBase model, TableSheets tableSheets, bool updateCurrentHp = false) { _disposablesForModel.DisposeAllAndClear(); CharacterModel = model; @@ -267,7 +267,7 @@ public virtual void UpdateActorHud() HudContainer.UpdatePosition(ActionCamera.instance.Cam, gameObject, HUDOffset); ActorHud.Set(CurrentHp, CharacterModel.AdditionalHP, Hp); - ActorHud.SetBuffs(CharacterModel.Buffs); + ActorHud.SetBuffs(CharacterModel.Buffs, TableSheets.Instance); ActorHud.SetLevel(Level); OnUpdateActorHud.OnNext(this); @@ -606,7 +606,7 @@ protected virtual void ProcessHeal( } } - private void ProcessBuff(Actor target, Model.BattleStatus.Skill.SkillInfo info) + private void ProcessBuff(Actor target, Model.BattleStatus.Skill.SkillInfo info, TableSheets tableSheets) { if (!target || info.Target!.IsDead) { @@ -614,7 +614,7 @@ private void ProcessBuff(Actor target, Model.BattleStatus.Skill.SkillInfo info) } var buff = info.Buff; - var effect = BattleRenderer.Instance.BuffController.Get(target.gameObject, buff); + var effect = BattleRenderer.Instance.BuffController.Get(target.gameObject, buff, tableSheets); effect.Target = target; effect.Buff = buff; @@ -631,7 +631,7 @@ private void ProcessBuff(Actor target, Model.BattleStatus.Skill.SkillInfo info) if (effect.IsPersisting) { target.AttachPersistingVFX(buff.BuffInfo.GroupId, effect); - StartCoroutine(BuffController.CoChaseTarget(effect, target, buff)); + StartCoroutine(BuffController.CoChaseTarget(effect, target, buff, tableSheets)); } target.UpdateActorHud(); @@ -765,10 +765,10 @@ protected virtual IEnumerator CoAnimationCast(Model.BattleStatus.Skill.SkillInfo PostAnimationForTheKindOfAttack(); } - private IEnumerator CoAnimationBuffCast(Model.BattleStatus.Skill.SkillInfo info) + private IEnumerator CoAnimationBuffCast(Model.BattleStatus.Skill.SkillInfo info, TableSheets tableSheets) { var pos = transform.position; - var effect = BattleRenderer.Instance.BuffController.Get(pos, info.Buff); + var effect = BattleRenderer.Instance.BuffController.Get(pos, info.Buff, tableSheets); if (effect is null) { NcDebug.LogError($"[CoAnimationBuffCast] [Buff] {info.Buff.BuffInfo.Id}"); @@ -1168,20 +1168,20 @@ public IEnumerator CoBuff(IReadOnlyList skil continue; } - var buffPrefab = BuffHelper.GetCastingVFXPrefab(skillInfo.Buff.BuffInfo.Id); + var buffPrefab = BuffHelper.GetCastingVFXPrefab(skillInfo.Buff.BuffInfo.Id, TableSheets.Instance); _buffSkillInfoMap[buffPrefab.name] = skillInfo; } foreach (var (_, skillInfo) in _buffSkillInfoMap) { - yield return StartCoroutine(CoAnimationBuffCast(skillInfo)); + yield return StartCoroutine(CoAnimationBuffCast(skillInfo, TableSheets.Instance)); } var dispeledTargets = new HashSet(); foreach (var info in skillInfos) { var target = Game.instance.Stage.GetActor(info.Target); - ProcessBuff(target, info); + ProcessBuff(target, info, TableSheets.Instance); if (!info.Affected || (info.DispelList != null && info.DispelList.Count() > 0)) { dispeledTargets.Add(target); diff --git a/nekoyume/Assets/_Scripts/Game/Character/ArenaCharacter.cs b/nekoyume/Assets/_Scripts/Game/Character/ArenaCharacter.cs index 33d634728a6..90238e8ce54 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/ArenaCharacter.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/ArenaCharacter.cs @@ -110,7 +110,7 @@ public void Init( _equipments.Clear(); _equipments.AddRange(digest.Equipments); _target = target; - appearance.Set(digest, avatarAddress, Animator, _hudContainer); + appearance.Set(digest, avatarAddress, Animator, _hudContainer, TableSheets.Instance); } public void Spawn(Model.ArenaCharacter model) @@ -140,7 +140,7 @@ public void UpdateStatusUI() } _hudContainer.UpdatePosition(ActionCamera.instance.Cam, gameObject, HUDOffset); - _arenaBattle.UpdateStatus(CharacterModel.IsEnemy, _currentHp, CharacterModel.HP, CharacterModel.Buffs); + _arenaBattle.UpdateStatus(CharacterModel.IsEnemy, _currentHp, CharacterModel.HP, CharacterModel.Buffs, TableSheets.Instance, true); UpdateBuffVfx(); } @@ -378,7 +378,7 @@ private void ProcessBuff(ArenaCharacter target, ArenaSkill.ArenaSkillInfo info) } var buff = info.Buff; - var effect = BattleRenderer.Instance.BuffController.Get(target.gameObject, buff); + var effect = BattleRenderer.Instance.BuffController.Get(target.gameObject, buff, TableSheets.Instance); effect.Target = target; effect.Buff = buff; @@ -386,7 +386,7 @@ private void ProcessBuff(ArenaCharacter target, ArenaSkill.ArenaSkillInfo info) if (effect.IsPersisting) { target.AttachPersistingVFX(buff.BuffInfo.GroupId, effect); - StartCoroutine(BuffController.CoChaseTarget(effect, target, buff)); + StartCoroutine(BuffController.CoChaseTarget(effect, target, buff, TableSheets.Instance)); } OnBuff?.Invoke(buff.BuffInfo.GroupId); @@ -481,7 +481,7 @@ private IEnumerator CoAnimationBuffCast(ArenaSkill.ArenaSkillInfo info) var sfxCode = AudioController.GetElementalCastingSFX(info.ElementalType); AudioController.instance.PlaySfx(sfxCode); var pos = transform.position; - var effect = BattleRenderer.Instance.BuffController.Get(pos, info.Buff); + var effect = BattleRenderer.Instance.BuffController.Get(pos, info.Buff, TableSheets.Instance); if (BuffCastCoroutine.TryGetValue(info.Buff.BuffInfo.Id, out var coroutine)) { diff --git a/nekoyume/Assets/_Scripts/Game/Character/CharacterAppearance.cs b/nekoyume/Assets/_Scripts/Game/Character/CharacterAppearance.cs index f251f304439..ca2a57acd2f 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/CharacterAppearance.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/CharacterAppearance.cs @@ -7,6 +7,7 @@ using Nekoyume.Model; using Nekoyume.Model.Item; using Nekoyume.State; +using Nekoyume.TableData; using Nekoyume.UI; using UnityEngine; @@ -41,7 +42,8 @@ public void Set( ArenaPlayerDigest digest, Address avatarAddress, CharacterAnimator animator, - HudContainer hudContainer) + HudContainer hudContainer, + TableSheets tableSheets) { var armor = (Armor)digest.Equipments.FirstOrDefault(x => x.ItemSubType == ItemSubType.Armor); var weapon = (Weapon)digest.Equipments.FirstOrDefault(x => x.ItemSubType == ItemSubType.Weapon); @@ -49,7 +51,7 @@ public void Set( UpdateAvatar(avatarAddress, animator, hudContainer, digest.Costumes, armor, weapon, aura, - digest.EarIndex, digest.LensIndex, digest.HairIndex, digest.TailIndex); + digest.EarIndex, digest.LensIndex, digest.HairIndex, digest.TailIndex, tableSheets); } public void Set( @@ -62,6 +64,7 @@ public void Set( int lensIndex, int hairIndex, int tailIndex, + TableSheets tableSheets, bool isFriendCharacter = false, System.Action onFinish = null) { @@ -71,7 +74,7 @@ public void Set( UpdateAvatar(avatarAddress, animator, hudContainer, costumes, armor, weapon, aura, - earIndex, lensIndex, hairIndex, tailIndex, isFriendCharacter, onFinish); + earIndex, lensIndex, hairIndex, tailIndex, tableSheets, isFriendCharacter, onFinish); } public void Set( @@ -85,11 +88,12 @@ public void Set( int earIndex, int lensIndex, int hairIndex, - int tailIndex) + int tailIndex, + TableSheets tableSheets) { UpdateAvatar(avatarAddress, animator, hudContainer, costumes, armor, weapon, aura, - earIndex, lensIndex, hairIndex, tailIndex); + earIndex, lensIndex, hairIndex, tailIndex, tableSheets); } public void SetForPrologue( @@ -100,7 +104,8 @@ public void SetForPrologue( int earIndex, int lensIndex, int hairIndex, - int tailIndex) + int tailIndex, + CostumeItemSheet costumeItemSheet) { _animator = animator; _hudContainer = hudContainer; @@ -108,10 +113,10 @@ public void SetForPrologue( SpineController.UnequipFullCostume(false); SpineController.UpdateBody(armorId, 0, false); SpineController.UpdateWeapon(weaponId, null); - UpdateEar(earIndex, false); - UpdateFace(lensIndex, false); - UpdateHair(hairIndex, false); - UpdateTail(tailIndex, false); + UpdateEar(earIndex, false, costumeItemSheet); + UpdateFace(lensIndex, false, costumeItemSheet); + UpdateHair(hairIndex, false, costumeItemSheet); + UpdateTail(tailIndex, false, costumeItemSheet); UpdateAcFace(0, false); UpdateAcEye(0, false); UpdateAcHead(0, false); @@ -154,12 +159,14 @@ private async void UpdateAvatar( int lensIndex, int hairIndex, int tailIndex, + TableSheets tableSheets, bool isFriendCharacter = false, System.Action onFinish = null) { _animator = animator; _hudContainer = hudContainer; Destroy(_cachedCharacterTitle); + var costumeItemSheet = tableSheets.CostumeItemSheet; var isDcc = Dcc.instance.IsVisible(avatarAddress, out var id, out var isVisible); if (isDcc && !isFriendCharacter && @@ -176,10 +183,10 @@ States.Instance.CurrentAvatarState is not null && UpdateArmor(armor, dccParts[DccPartsType.skin], true); UpdateWeapon(weapon); UpdateAura(aura); - UpdateEar(dccParts[DccPartsType.ear_tail], true); - UpdateFace(dccParts[DccPartsType.face], true); - UpdateHair(dccParts[DccPartsType.hair], true); - UpdateTail(dccParts[DccPartsType.ear_tail], true); + UpdateEar(dccParts[DccPartsType.ear_tail], true, costumeItemSheet); + UpdateFace(dccParts[DccPartsType.face], true, costumeItemSheet); + UpdateHair(dccParts[DccPartsType.hair], true, costumeItemSheet); + UpdateTail(dccParts[DccPartsType.ear_tail], true, costumeItemSheet); UpdateAcFace(dccParts[DccPartsType.ac_face], true); UpdateAcEye(dccParts[DccPartsType.ac_eye], true); UpdateAcHead(dccParts[DccPartsType.ac_head], true); @@ -201,10 +208,10 @@ States.Instance.CurrentAvatarState is not null && else { SpineController.UnequipFullCostume(false); - UpdateEar(earIndex, false); - UpdateFace(lensIndex, false); - UpdateHair(hairIndex, false); - UpdateTail(tailIndex, false); + UpdateEar(earIndex, false, costumeItemSheet); + UpdateFace(lensIndex, false, costumeItemSheet); + UpdateHair(hairIndex, false, costumeItemSheet); + UpdateTail(tailIndex, false, costumeItemSheet); UpdateAcFace(0, false); UpdateAcEye(0, false); UpdateAcHead(0, false); @@ -278,33 +285,29 @@ private void UpdateAura(Aura aura) SpineController.UpdateAura(vfx); } - private void UpdateEar(int index, bool isDcc) + private void UpdateEar(int index, bool isDcc, CostumeItemSheet sheet) { - var sheet = TableSheets.Instance.CostumeItemSheet; var row = sheet.OrderedList.FirstOrDefault(row => row.ItemSubType == ItemSubType.EarCostume); var id = isDcc ? index : row.Id + index; SpineController.UpdateEar(id, isDcc); } - private void UpdateFace(int index, bool isDcc) + private void UpdateFace(int index, bool isDcc, CostumeItemSheet sheet) { - var sheet = TableSheets.Instance.CostumeItemSheet; var row = sheet.OrderedList.FirstOrDefault(row => row.ItemSubType == ItemSubType.EyeCostume); var id = isDcc ? index : row.Id + index; SpineController.UpdateFace(id, isDcc); } - private void UpdateHair(int index, bool isDcc) + private void UpdateHair(int index, bool isDcc, CostumeItemSheet sheet) { - var sheet = TableSheets.Instance.CostumeItemSheet; var row = sheet.OrderedList.FirstOrDefault(row => row.ItemSubType == ItemSubType.HairCostume); var id = isDcc ? index : row.Id + index; SpineController.UpdateHair(id, isDcc); } - private void UpdateTail(int index, bool isDcc) + private void UpdateTail(int index, bool isDcc, CostumeItemSheet sheet) { - var sheet = TableSheets.Instance.CostumeItemSheet; var row = sheet.OrderedList.FirstOrDefault(row => row.ItemSubType == ItemSubType.TailCostume); var id = isDcc ? index : row.Id + index; SpineController.UpdateTail(id, isDcc); diff --git a/nekoyume/Assets/_Scripts/Game/Character/EnemyPlayer.cs b/nekoyume/Assets/_Scripts/Game/Character/EnemyPlayer.cs index dd6799eb962..e66919bcc07 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/EnemyPlayer.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/EnemyPlayer.cs @@ -22,7 +22,7 @@ public override void UpdateActorHud() public void Set(Model.CharacterBase model, Player player, bool updateCurrentHP = false) { - base.Set(model, updateCurrentHP); + base.Set(model, TableSheets.Instance, updateCurrentHP); _player = player; InitBT(); diff --git a/nekoyume/Assets/_Scripts/Game/Character/FriendCharacter.cs b/nekoyume/Assets/_Scripts/Game/Character/FriendCharacter.cs index 718f692423b..781e208b1f9 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/FriendCharacter.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/FriendCharacter.cs @@ -40,6 +40,7 @@ public void Set( avatarState.lens, avatarState.hair, avatarState.tail, + TableSheets.Instance, true); } diff --git a/nekoyume/Assets/_Scripts/Game/Character/LobbyCharacter.cs b/nekoyume/Assets/_Scripts/Game/Character/LobbyCharacter.cs index 96dcf7c9585..87c42e82a25 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/LobbyCharacter.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/LobbyCharacter.cs @@ -46,6 +46,7 @@ public void Set( avatarState.lens, avatarState.hair, avatarState.tail, + TableSheets.Instance, onFinish: onFinish); var title = costumes.FirstOrDefault(x => x.ItemSubType == ItemSubType.Title); diff --git a/nekoyume/Assets/_Scripts/Game/Character/Player.cs b/nekoyume/Assets/_Scripts/Game/Character/Player.cs index dc122fb29f5..d706be2c45b 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/Player.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/Player.cs @@ -10,6 +10,7 @@ using Nekoyume.UI; using UnityEngine; using Nekoyume.Model.State; +using Nekoyume.TableData; namespace Nekoyume.Game.Character { @@ -120,10 +121,10 @@ public void Set(AvatarState avatarState) tableSheets.CharacterSheet, tableSheets.CharacterLevelSheet, tableSheets.EquipmentItemSetEffectSheet); - Set(model); + Set(model, tableSheets); } - public override void Set(Model.CharacterBase model, bool updateCurrentHp = false) + public override void Set(Model.CharacterBase model, TableSheets tableSheets, bool updateCurrentHp = false) { if (!(model is Model.Player playerModel)) { @@ -131,12 +132,12 @@ public override void Set(Model.CharacterBase model, bool updateCurrentHp = false } var avatarState = Game.instance.States.CurrentAvatarState; - Set(avatarState.address, playerModel, updateCurrentHp); + Set(avatarState.address, playerModel, updateCurrentHp, tableSheets); } - public void Set(Address avatarAddress, Model.Player model, bool updateCurrentHP) + public void Set(Address avatarAddress, Model.Player model, bool updateCurrentHP, TableSheets tableSheets) { - Set(avatarAddress, model, model.Costumes, model.armor, model.weapon, model.aura, updateCurrentHP); + Set(avatarAddress, model, model.Costumes, model.armor, model.weapon, model.aura, updateCurrentHP, tableSheets); } public void Set( @@ -146,10 +147,11 @@ public void Set( Armor armor, Weapon weapon, Aura aura, - bool updateCurrentHP) + bool updateCurrentHP, + TableSheets tableSheets) { InitStats(model); - base.Set(model, updateCurrentHP); + base.Set(model, tableSheets, updateCurrentHP); _disposablesForModel.DisposeAllAndClear(); CharacterModel = model; @@ -165,7 +167,8 @@ public void Set( model.earIndex, model.lensIndex, model.hairIndex, - model.tailIndex); + model.tailIndex, + tableSheets); if (!SpeechBubble) { @@ -239,7 +242,8 @@ public void EquipForPrologue(int armorId, int weaponId) 0, 0, 0, - 0); + 0, + TableSheets.Instance.CostumeItemSheet); SpineController.UpdateWeapon(weaponId); } diff --git a/nekoyume/Assets/_Scripts/Game/Character/PrologueCharacter.cs b/nekoyume/Assets/_Scripts/Game/Character/PrologueCharacter.cs index 1934e7b3300..1e42abb1a68 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/PrologueCharacter.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/PrologueCharacter.cs @@ -225,7 +225,7 @@ public IEnumerator CoBuff(StatBuff buff) yield return StartCoroutine(CoAnimationBuffCast(buff)); Animator.CastAttack(); AudioController.instance.PlaySfx(AudioController.SfxCode.FenrirGrowlCastingAttack); - var effect = BattleRenderer.Instance.BuffController.Get(_target.gameObject, buff); + var effect = BattleRenderer.Instance.BuffController.Get(_target.gameObject, buff, TableSheets.Instance); effect.Play(); yield return new WaitForSeconds(Game.DefaultSkillDelay); } @@ -237,7 +237,7 @@ private IEnumerator CoAnimationBuffCast(StatBuff buff) AudioController.instance.PlaySfx(sfxCode); Animator.Cast(); var pos = transform.position; - var effect = BattleRenderer.Instance.BuffController.Get(pos, buff); + var effect = BattleRenderer.Instance.BuffController.Get(pos, buff, TableSheets.Instance); effect.Play(); yield return new WaitForSeconds(Game.DefaultSkillDelay); } diff --git a/nekoyume/Assets/_Scripts/Game/Character/RaidCharacter.cs b/nekoyume/Assets/_Scripts/Game/Character/RaidCharacter.cs index dddac06b375..c0c5cc0da4d 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/RaidCharacter.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/RaidCharacter.cs @@ -137,7 +137,7 @@ public virtual void UpdateHpBar() _hudContainer.UpdatePosition(Game.instance.RaidStage.Camera.Cam, gameObject, HUDOffset); HPBar.Set(_currentHp, _characterModel.AdditionalHP, _characterModel.HP); - HPBar.SetBuffs(_characterModel.Buffs); + HPBar.SetBuffs(_characterModel.Buffs, TableSheets.Instance); UpdateBuffVfx(); @@ -646,7 +646,7 @@ private IEnumerator CoAnimationBuffCast(Skill.SkillInfo info) AudioController.instance.PlaySfx(sfxCode); Animator.Cast(); var pos = transform.position; - var effect = BattleRenderer.Instance.BuffController.Get(pos, info.Buff); + var effect = BattleRenderer.Instance.BuffController.Get(pos, info.Buff, TableSheets.Instance); if (BuffCastCoroutine.TryGetValue(info.Buff.BuffInfo.Id, out var coroutine)) { yield return coroutine.Invoke(effect); @@ -766,7 +766,7 @@ protected void ProcessBuff(RaidCharacter target, Skill.SkillInfo info) } var buff = info.Buff; - var effect = BattleRenderer.Instance.BuffController.Get(target.gameObject, buff); + var effect = BattleRenderer.Instance.BuffController.Get(target.gameObject, buff, TableSheets.Instance); effect.Target = target; effect.Buff = buff; @@ -774,7 +774,7 @@ protected void ProcessBuff(RaidCharacter target, Skill.SkillInfo info) if (effect.IsPersisting) { target.AttachPersistingVFX(buff.BuffInfo.GroupId, effect); - StartCoroutine(BuffController.CoChaseTarget(effect, target, buff)); + StartCoroutine(BuffController.CoChaseTarget(effect, target, buff, TableSheets.Instance)); } target.AddNextBuff(buff); diff --git a/nekoyume/Assets/_Scripts/Game/Character/RaidPlayer.cs b/nekoyume/Assets/_Scripts/Game/Character/RaidPlayer.cs index cf8dbf5b92d..6875e4e1e26 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/RaidPlayer.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/RaidPlayer.cs @@ -33,7 +33,7 @@ public void Init(Address avatarAddress, ArenaPlayerDigest digest, RaidCharacter { Init(target); - appearance.Set(digest, avatarAddress, Animator, _hudContainer); + appearance.Set(digest, avatarAddress, Animator, _hudContainer, TableSheets.Instance); _attackTime = SpineAnimationHelper.GetAnimationDuration(appearance, "Attack"); _criticalAttackTime = SpineAnimationHelper.GetAnimationDuration(appearance, "CriticalAttack"); _target = target; diff --git a/nekoyume/Assets/_Scripts/Game/Character/StageMonster.cs b/nekoyume/Assets/_Scripts/Game/Character/StageMonster.cs index bbbb48d496c..6efaaf1d3e4 100644 --- a/nekoyume/Assets/_Scripts/Game/Character/StageMonster.cs +++ b/nekoyume/Assets/_Scripts/Game/Character/StageMonster.cs @@ -47,7 +47,7 @@ private void OnDestroy() #endregion - public override void Set(Model.CharacterBase model, bool updateCurrentHp = false) + public override void Set(Model.CharacterBase model, TableSheets tableSheets, bool updateCurrentHp = false) { if (!(model is Model.Enemy enemyModel)) { @@ -59,7 +59,7 @@ public override void Set(Model.CharacterBase model, bool updateCurrentHp = false public void Set(Model.Enemy model, Player player, bool updateCurrentHP) { - base.Set(model, updateCurrentHP); + base.Set(model, TableSheets.Instance, updateCurrentHP); _disposablesForModel.DisposeAllAndClear(); diff --git a/nekoyume/Assets/_Scripts/Game/Factory/PlayerFactory.cs b/nekoyume/Assets/_Scripts/Game/Factory/PlayerFactory.cs index 858e2e95425..ac68014fac3 100644 --- a/nekoyume/Assets/_Scripts/Game/Factory/PlayerFactory.cs +++ b/nekoyume/Assets/_Scripts/Game/Factory/PlayerFactory.cs @@ -26,9 +26,9 @@ public static GameObject Create(AvatarState avatarState) public static GameObject Create(Player model = null) { + var tableSheets = Game.instance.TableSheets; if (model is null) { - var tableSheets = Game.instance.TableSheets; model = new Player( 1, tableSheets.CharacterSheet, @@ -44,7 +44,7 @@ public static GameObject Create(Player model = null) } var address = new Address(); - player.Set(address, model, true); + player.Set(address, model, true, tableSheets); return player.gameObject; } @@ -73,7 +73,7 @@ public static GameObject Create( throw new NotFoundComponentException(); } - player.Set(avatarState.address, model, costumes, armor, weapon, aura, true); + player.Set(avatarState.address, model, costumes, armor, weapon, aura, true, tableSheets); return player.gameObject; } } diff --git a/nekoyume/Assets/_Scripts/Game/Prologue.cs b/nekoyume/Assets/_Scripts/Game/Prologue.cs index 50afee2d896..e7d60291143 100644 --- a/nekoyume/Assets/_Scripts/Game/Prologue.cs +++ b/nekoyume/Assets/_Scripts/Game/Prologue.cs @@ -230,10 +230,10 @@ private IEnumerator CoPlayerHeal() var buffRow = Game.instance.TableSheets.StatBuffSheet.Values.First(r => r.Value > 0 && r.StatType == StatType.HP); var buff = new StatBuff(buffRow); - var castingEffect = BattleRenderer.Instance.BuffController.Get(_player.transform.position, buff); + var castingEffect = BattleRenderer.Instance.BuffController.Get(_player.transform.position, buff, TableSheets.Instance); castingEffect.Play(); yield return new WaitForSeconds(Game.DefaultSkillDelay); - var effect = BattleRenderer.Instance.BuffController.Get(_player.gameObject, buff); + var effect = BattleRenderer.Instance.BuffController.Get(_player.gameObject, buff, TableSheets.Instance); effect.Play(); var position = _player.transform.TransformPoint(0f, 1.7f, 0f); var force = new Vector3(-0.1f, 0.5f); diff --git a/nekoyume/Assets/_Scripts/Game/TableSheets.cs b/nekoyume/Assets/_Scripts/Game/TableSheets.cs index 232427925be..457bd9434cb 100644 --- a/nekoyume/Assets/_Scripts/Game/TableSheets.cs +++ b/nekoyume/Assets/_Scripts/Game/TableSheets.cs @@ -20,16 +20,7 @@ namespace Nekoyume.Game { public class TableSheets { - public static TableSheets Instance - { - get - { -#if TEST_SCENE - return SimulationTest.TestArena.Instance.TableSheets; -#endif - return Game.instance.TableSheets; - } - } + public static TableSheets Instance => Game.instance.TableSheets; private TableSheets() { diff --git a/nekoyume/Assets/_Scripts/Game/VFX/Skill/BuffController.cs b/nekoyume/Assets/_Scripts/Game/VFX/Skill/BuffController.cs index 6fff6bfa452..696da138c85 100644 --- a/nekoyume/Assets/_Scripts/Game/VFX/Skill/BuffController.cs +++ b/nekoyume/Assets/_Scripts/Game/VFX/Skill/BuffController.cs @@ -17,7 +17,7 @@ public class BuffController #endif private ObjectPool _pool; - + public async UniTask InitializeAsync(ObjectPool objectPool) { _pool = objectPool; @@ -33,16 +33,16 @@ await ResourceManager.Instance.LoadAllAsync(ResourceManager.BuffLabe }); } - public T Get(GameObject target, Buff buff) where T : BuffVFX + public T Get(GameObject target, Buff buff, TableSheets tableSheets) where T : BuffVFX { if (target == null) { return null; } - var position = target.transform.position + BuffHelper.GetBuffPosition(buff.BuffInfo.Id); + var position = target.transform.position + BuffHelper.GetBuffPosition(buff.BuffInfo.Id, tableSheets); - var resourceName = BuffHelper.GetBuffVFXPrefab(buff).name; + var resourceName = BuffHelper.GetBuffVFXPrefab(buff, tableSheets).name; var go = _pool.Get(resourceName, false, position); if (go == null) { @@ -52,11 +52,11 @@ public T Get(GameObject target, Buff buff) where T : BuffVFX return GetEffect(go); } - public BuffCastingVFX Get(Vector3 position, Buff buff) + public BuffCastingVFX Get(Vector3 position, Buff buff, TableSheets tableSheets) { // TODO: ID대신 GroupID사용 고려 혹은 ID와 GroupID사이의 정의 정리 - var resourceName = BuffHelper.GetCastingVFXPrefab(buff).name; - position += BuffHelper.GetBuffPosition(buff.BuffInfo.Id, true); + var resourceName = BuffHelper.GetCastingVFXPrefab(buff, tableSheets).name; + position += BuffHelper.GetBuffPosition(buff.BuffInfo.Id, tableSheets, true); var go = _pool.Get(resourceName, false, position); if (go == null) { @@ -78,13 +78,13 @@ private static T GetEffect(GameObject go) return effect; } - public static IEnumerator CoChaseTarget(Component vfx, Character.Character target, Buff buffModel) + public static IEnumerator CoChaseTarget(Component vfx, Character.Character target, Buff buffModel, TableSheets tableSheets) { var g = vfx.gameObject; var t = vfx.transform; while (g.activeSelf && target) { - t.position = target.transform.position + BuffHelper.GetBuffPosition(buffModel.BuffInfo.Id); + t.position = target.transform.position + BuffHelper.GetBuffPosition(buffModel.BuffInfo.Id, tableSheets); if (buffModel is ActionBuff actionBuff) { diff --git a/nekoyume/Assets/_Scripts/Helper/BuffHelper.cs b/nekoyume/Assets/_Scripts/Helper/BuffHelper.cs index 0f0d0f687f7..74763823953 100644 --- a/nekoyume/Assets/_Scripts/Helper/BuffHelper.cs +++ b/nekoyume/Assets/_Scripts/Helper/BuffHelper.cs @@ -25,10 +25,10 @@ private static BuffVFXScriptableObject VFXData } } - public static GameObject GetCastingVFXPrefab(Buff buff) + public static GameObject GetCastingVFXPrefab(Buff buff, TableSheets tableSheets) { var id = buff.BuffInfo.Id; - var actionBuffCastingPrefab = GetActionBuffCastingPrefab(id); + var actionBuffCastingPrefab = GetActionBuffCastingPrefab(id, tableSheets); if (actionBuffCastingPrefab != null) { return actionBuffCastingPrefab; @@ -55,9 +55,9 @@ public static GameObject GetCastingVFXPrefab(Buff buff) isPositive ? data.PlusCastingVFX : data.MinusCastingVFX; } - public static GameObject GetCastingVFXPrefab(int buffId) + public static GameObject GetCastingVFXPrefab(int buffId, TableSheets tableSheets) { - var actionBuffCastingPrefab = GetActionBuffCastingPrefab(buffId); + var actionBuffCastingPrefab = GetActionBuffCastingPrefab(buffId, tableSheets); if (actionBuffCastingPrefab != null) { return actionBuffCastingPrefab; @@ -70,9 +70,9 @@ public static GameObject GetCastingVFXPrefab(int buffId) } [CanBeNull] - private static GameObject GetActionBuffCastingPrefab(int id) + private static GameObject GetActionBuffCastingPrefab(int id, TableSheets tableSheets) { - var actionSheet = GetActionBuffSheet(); + var actionSheet = GetActionBuffSheet(tableSheets); var hasActionBuff = actionSheet.TryGetValue(id, out var actionBuffRow); if (!hasActionBuff) { @@ -86,10 +86,10 @@ private static GameObject GetActionBuffCastingPrefab(int id) return actionOverrideData?.CastingVFX; } - public static GameObject GetBuffVFXPrefab(Buff buff) + public static GameObject GetBuffVFXPrefab(Buff buff, TableSheets tableSheets) { var id = buff.BuffInfo.Id; - var actionBuffPrefab = GetActionBuffPrefab(id); + var actionBuffPrefab = GetActionBuffPrefab(id, tableSheets); if (actionBuffPrefab != null) { return actionBuffPrefab; @@ -115,9 +115,9 @@ public static GameObject GetBuffVFXPrefab(Buff buff) isPositive ? data.PlusVFX : data.MinusVFX; } - public static GameObject GetBuffVFXPrefab(int buffId) + public static GameObject GetBuffVFXPrefab(int buffId, TableSheets tableSheets) { - var actionBuffPrefab = GetActionBuffPrefab(buffId); + var actionBuffPrefab = GetActionBuffPrefab(buffId, tableSheets); if (actionBuffPrefab != null) { return actionBuffPrefab; @@ -129,9 +129,9 @@ public static GameObject GetBuffVFXPrefab(int buffId) } [CanBeNull] - private static GameObject GetActionBuffPrefab(int id) + private static GameObject GetActionBuffPrefab(int id, TableSheets tableSheets) { - var actionSheet = GetActionBuffSheet(); + var actionSheet = GetActionBuffSheet(tableSheets); var hasActionBuff = actionSheet.TryGetValue(id, out var actionBuffRow); if (!hasActionBuff) { @@ -145,10 +145,10 @@ private static GameObject GetActionBuffPrefab(int id) return actionOverrideData?.BuffVFX; } - public static Sprite GetBuffIcon(Buff buff) + public static Sprite GetBuffIcon(Buff buff, TableSheets tableSheets) { var id = buff.BuffInfo.Id; - var actionBuffIcon = GetActionBuffIcon(id); + var actionBuffIcon = GetActionBuffIcon(id, tableSheets); if (actionBuffIcon != null) { return actionBuffIcon; @@ -174,9 +174,9 @@ public static Sprite GetBuffIcon(Buff buff) isPositive ? data.PlusIcon : data.MinusIcon; } - public static Sprite GetBuffOverrideIcon(int id) + public static Sprite GetBuffOverrideIcon(int id, TableSheets tableSheets) { - var actionBuffIcon = GetActionBuffIcon(id); + var actionBuffIcon = GetActionBuffIcon(id, tableSheets); if (actionBuffIcon != null) { return actionBuffIcon; @@ -187,9 +187,9 @@ public static Sprite GetBuffOverrideIcon(int id) } [CanBeNull] - private static Sprite GetActionBuffIcon(int id) + private static Sprite GetActionBuffIcon(int id, TableSheets tableSheets) { - var actionSheet = GetActionBuffSheet(); + var actionSheet = GetActionBuffSheet(tableSheets); var hasActionBuff = actionSheet.TryGetValue(id, out var actionBuffRow); if (!hasActionBuff) { @@ -214,9 +214,10 @@ public static Vector3 GetDefaultBuffPosition() return VFXData.FallbackPosition; } - public static Vector3 GetBuffPosition(int id, bool isCasting = false) + public static Vector3 GetBuffPosition(int id, TableSheets tableSheets, + bool isCasting = false) { - var actionSheet = GetActionBuffSheet(); + var actionSheet = GetActionBuffSheet(tableSheets); var hasActionBuff = actionSheet.TryGetValue(id, out var actionBuffRow); if (hasActionBuff) { @@ -235,9 +236,9 @@ public static Vector3 GetBuffPosition(int id, bool isCasting = false) return overrideData?.Position ?? VFXData.FallbackPosition; } - private static ActionBuffSheet GetActionBuffSheet() + private static ActionBuffSheet GetActionBuffSheet(TableSheets tableSheets) { - return TableSheets.Instance.ActionBuffSheet; + return tableSheets.ActionBuffSheet; } } } diff --git a/nekoyume/Assets/_Scripts/UI/BuffIcon.cs b/nekoyume/Assets/_Scripts/UI/BuffIcon.cs index d701de6341a..e0b8284c4e1 100644 --- a/nekoyume/Assets/_Scripts/UI/BuffIcon.cs +++ b/nekoyume/Assets/_Scripts/UI/BuffIcon.cs @@ -1,3 +1,4 @@ +using Nekoyume.Game; using Nekoyume.Game.Controller; using Nekoyume.Game.VFX; using Nekoyume.Model; @@ -16,22 +17,20 @@ public class BuffIcon : MonoBehaviour public Buff Data { get; set; } public CharacterBase character; - public void Show(Buff buff, bool isAdded) + public void Show(Buff buff, bool isAdded, TableSheets tableSheets, bool vfx) { Data = buff; gameObject.SetActive(true); remainedDurationText.enabled = true; - var sprite = Data.GetIcon(); + var sprite = Data.GetIcon(tableSheets); image.overrideSprite = sprite; UpdateStatus(Data); if (isAdded && - enabled) + enabled && vfx) { -#if !TEST_SCENE VFXController.instance .CreateAndChaseRectTransform(image.rectTransform); -#endif } } diff --git a/nekoyume/Assets/_Scripts/UI/Module/ArenaStatus.cs b/nekoyume/Assets/_Scripts/UI/Module/ArenaStatus.cs index ed67d55b8e3..d7a9f97d3a7 100644 --- a/nekoyume/Assets/_Scripts/UI/Module/ArenaStatus.cs +++ b/nekoyume/Assets/_Scripts/UI/Module/ArenaStatus.cs @@ -34,10 +34,10 @@ public void OnDisable() gameObject.SetActive(false); } - public void Set(int portraitId, string avatarName, int level, Address address) + public void Set(int portraitId, string avatarName, int level, Address address, TableSheets tableSheets, bool vfx) { SetProfile(portraitId, avatarName, level, address); - SetBuff(); + SetBuff(tableSheets, vfx); } public void Show() @@ -72,9 +72,10 @@ public void SetHp(long current, long max) hpText.text = $"{current}/{max}"; } - public void SetBuff(Dictionary modelBuffs = null) + public void SetBuff(TableSheets tableSheets, bool vfx, + Dictionary modelBuffs = null) { - buffLayout.SetBuff(modelBuffs); + buffLayout.SetBuff(modelBuffs, tableSheets, vfx); } public void OnCompleteOfShowAnimation() diff --git a/nekoyume/Assets/_Scripts/UI/Module/BossStatus.cs b/nekoyume/Assets/_Scripts/UI/Module/BossStatus.cs index c121bed68bb..4d62ed2f959 100644 --- a/nekoyume/Assets/_Scripts/UI/Module/BossStatus.cs +++ b/nekoyume/Assets/_Scripts/UI/Module/BossStatus.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Nekoyume.Game; using UnityEngine; using UnityEngine.UI; using TMPro; @@ -22,7 +23,7 @@ public class BossStatus : MonoBehaviour public void Show() { gameObject.SetActive(true); - buffLayout.SetBuff(null); + buffLayout.SetBuff(null, TableSheets.Instance, true); animator.enabled = true; } @@ -63,7 +64,7 @@ public void SetProfile(int level, string name, Sprite sprite = null) public void SetBuff(Dictionary modelBuffs) { - buffLayout.SetBuff(modelBuffs); + buffLayout.SetBuff(modelBuffs, TableSheets.Instance, true); } public void OnCompleteOfShowAnimation() diff --git a/nekoyume/Assets/_Scripts/UI/Module/BuffLayout.cs b/nekoyume/Assets/_Scripts/UI/Module/BuffLayout.cs index f307221adc7..860a04dfa3e 100644 --- a/nekoyume/Assets/_Scripts/UI/Module/BuffLayout.cs +++ b/nekoyume/Assets/_Scripts/UI/Module/BuffLayout.cs @@ -2,6 +2,7 @@ using Nekoyume.Model.Stat; using System.Collections.Generic; using System.Linq; +using Nekoyume.Game; using UnityEngine; namespace Nekoyume.UI.Module @@ -54,7 +55,7 @@ private void OnDisable() } } - public void SetBuff(IReadOnlyDictionary buffs) + public void SetBuff(IReadOnlyDictionary buffs, TableSheets tableSheets, bool vfx) { foreach (var icon in pool.Where(icon => icon.gameObject.activeSelf)) { @@ -84,7 +85,7 @@ public void SetBuff(IReadOnlyDictionary buffs) foreach (var buff in ordered) { var icon = GetDisabledIcon(); - icon.Show(buff, AddedBuffs.Contains(buff)); + icon.Show(buff, AddedBuffs.Contains(buff), tableSheets, vfx); } } diff --git a/nekoyume/Assets/_Scripts/UI/Module/Common/SkillPositionTooltip.cs b/nekoyume/Assets/_Scripts/UI/Module/Common/SkillPositionTooltip.cs index 1591bc4b755..60d3146a94b 100644 --- a/nekoyume/Assets/_Scripts/UI/Module/Common/SkillPositionTooltip.cs +++ b/nekoyume/Assets/_Scripts/UI/Module/Common/SkillPositionTooltip.cs @@ -65,7 +65,8 @@ public void Show(SkillSheet.Row skillRow, EquipmentItemOptionSheet.Row optionRow optionRow.SkillDamageMax, optionRow.StatDamageRatioMin, optionRow.StatDamageRatioMax, - optionRow.SkillChanceMin); + optionRow.SkillChanceMin, + TableSheets.Instance); } else { @@ -114,7 +115,7 @@ public void Show(SkillSheet.Row skillRow, RuneOptionSheet.Row.RuneOptionInfo opt gameObject.SetActive(true); } - private void SetSkillDescription(string key, SkillSheet.Row skillRow, long skillPowerMin, long skillPowerMax, int skillRatioMin, int skillRatioMax, int skillChance) + private void SetSkillDescription(string key, SkillSheet.Row skillRow, long skillPowerMin, long skillPowerMax, int skillRatioMin, int skillRatioMax, int skillChance, TableSheets tableSheets) { var sheets = TableSheets.Instance; var arg = new List(); @@ -188,7 +189,7 @@ private void SetSkillDescription(string key, SkillSheet.Row skillRow, long skill arg.Add(skillChance.ToString()); arg.Add(skillRow.Cooldown.ToString()); arg.Add(skillPowerMin.ToString()); - var buffIcon = BuffHelper.GetBuffOverrideIcon(skillActionBuffRow.BuffIds.First()); + var buffIcon = BuffHelper.GetBuffOverrideIcon(skillActionBuffRow.BuffIds.First(), tableSheets); buffIconImage.overrideSprite = buffIcon; buffStatTypeText.text = skillRow.SkillCategory.ToString(); debuffObject.SetActive(false); @@ -264,7 +265,8 @@ public void Show( powerMax, ratioMin, ratioMax, - chanceMin); + chanceMin, + TableSheets.Instance); } else { diff --git a/nekoyume/Assets/_Scripts/UI/Module/RaidBossStatus.cs b/nekoyume/Assets/_Scripts/UI/Module/RaidBossStatus.cs index ef3377924ae..4d357213f41 100644 --- a/nekoyume/Assets/_Scripts/UI/Module/RaidBossStatus.cs +++ b/nekoyume/Assets/_Scripts/UI/Module/RaidBossStatus.cs @@ -7,6 +7,7 @@ using Nekoyume.L10n; using Nekoyume.Helper; using System; +using Nekoyume.Game; namespace Nekoyume.UI.Module { @@ -43,7 +44,7 @@ public struct BossIconInfo public void Show() { gameObject.SetActive(true); - buffLayout.SetBuff(null); + buffLayout.SetBuff(null, TableSheets.Instance, true); } public void Close(bool ignoreAnimation = true) @@ -80,7 +81,7 @@ public void SetProfile(int level, string name, Sprite sprite) public void SetBuff(Dictionary modelBuffs) { - buffLayout.SetBuff(modelBuffs); + buffLayout.SetBuff(modelBuffs, TableSheets.Instance, true); } } } diff --git a/nekoyume/Assets/_Scripts/UI/Module/Stat/EnhancementSkillOptionView.cs b/nekoyume/Assets/_Scripts/UI/Module/Stat/EnhancementSkillOptionView.cs index 44f6985df88..4624426bdc4 100644 --- a/nekoyume/Assets/_Scripts/UI/Module/Stat/EnhancementSkillOptionView.cs +++ b/nekoyume/Assets/_Scripts/UI/Module/Stat/EnhancementSkillOptionView.cs @@ -43,7 +43,7 @@ public class EnhancementSkillOptionView : MonoBehaviour private const string VariableColorTag = ""; - public void Set(string skillName, SkillType skillType, int skillId, int coolDown, string chanceText, string valueText) + public void Set(string skillName, SkillType skillType, int skillId, int coolDown, string chanceText, string valueText, TableSheets tableSheets) { titleText.text = skillName; @@ -55,7 +55,7 @@ public void Set(string skillName, SkillType skillType, int skillId, int coolDown { buffObject.SetActive(false); debuffObject.SetActive(true); - var buffIcon = BuffHelper.GetBuffOverrideIcon(skillActionBuffRow.BuffIds.First()); + var buffIcon = BuffHelper.GetBuffOverrideIcon(skillActionBuffRow.BuffIds.First(), tableSheets); buffIconImage.overrideSprite = buffIcon; buffStatTypeText.text = skillName; debuffObject.SetActive(false); diff --git a/nekoyume/Assets/_Scripts/UI/Widget/ArenaBattle.cs b/nekoyume/Assets/_Scripts/UI/Widget/ArenaBattle.cs index 26bde25c200..23e16216f6e 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/ArenaBattle.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/ArenaBattle.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Libplanet.Crypto; using Nekoyume.Battle; +using Nekoyume.Game; using Nekoyume.Game.Controller; using Nekoyume.Game.VFX; using Nekoyume.Helper; @@ -44,13 +45,14 @@ public void Show( ArenaPlayerDigest enemyDigest, Address myAvatarAddress, Address enemyAvatarAddress, + TableSheets tableSheets, bool ignoreShowAnimation = false) { Find().Close(true); Find().Close(true); Find().Close(true); - SetStatus(myDigest, myStatus, myAvatarAddress); - SetStatus(enemyDigest, enemyStatus, enemyAvatarAddress); + SetStatus(myDigest, myStatus, myAvatarAddress, tableSheets, true); + SetStatus(enemyDigest, enemyStatus, enemyAvatarAddress, tableSheets, true); comboText.comboMax = AttackCountHelper.GetCountMax(myDigest.Level); comboText.Close(); @@ -81,17 +83,19 @@ public void UpdateStatus( bool isEnemy, long currentHp, long maxHp, - Dictionary buffs) + Dictionary buffs, + TableSheets tableSheets, + bool vfx) { if (isEnemy) { enemyStatus.SetHp(currentHp, maxHp); - enemyStatus.SetBuff(buffs); + enemyStatus.SetBuff(tableSheets, vfx, buffs); } else { myStatus.SetHp(currentHp, maxHp); - myStatus.SetBuff(buffs); + myStatus.SetBuff(tableSheets, vfx, buffs); } } @@ -101,10 +105,10 @@ public void ShowComboText(bool attacked) comboText.Show(attacked); } - private void SetStatus(ArenaPlayerDigest digest, ArenaStatus status, Address address) + private void SetStatus(ArenaPlayerDigest digest, ArenaStatus status, Address address, TableSheets tableSheets, bool vfx) { var portraitId = Util.GetPortraitId(digest.Equipments, digest.Costumes); - status.Set(portraitId, digest.NameWithHash, digest.Level, address); + status.Set(portraitId, digest.NameWithHash, digest.Level, address, tableSheets, vfx); status.gameObject.SetActive(false); } } diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Hud/HpBar.cs b/nekoyume/Assets/_Scripts/UI/Widget/Hud/HpBar.cs index 6b54f638229..9bead0ed985 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Hud/HpBar.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Hud/HpBar.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Nekoyume.Game; using Nekoyume.Game.Controller; using Nekoyume.Game.VFX; using Nekoyume.Model.Buff; @@ -24,9 +25,9 @@ public class HpBar : ProgressBar public HpBarVFX HpVFX { get; private set; } - public void SetBuffs(IReadOnlyDictionary buffs) + public void SetBuffs(IReadOnlyDictionary buffs, TableSheets tableSheets) { - buffLayout.SetBuff(buffs); + buffLayout.SetBuff(buffs, tableSheets, true); if (buffLayout.IsBuffAdded(StatType.HP)) { diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Status.cs b/nekoyume/Assets/_Scripts/UI/Widget/Status.cs index 76994876052..e05ed1ba990 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Status.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Status.cs @@ -84,7 +84,7 @@ public override void Show(bool ignoreStartAnimation = false) base.Show(ignoreStartAnimation); battleTimerView.Close(); hpBar.transform.parent.gameObject.SetActive(false); - buffLayout.SetBuff(null); + buffLayout.SetBuff(null, TableSheets.Instance, true); #if UNITY_ANDROID || UNITY_IOS transform.SetSiblingIndex(Find().transform.GetSiblingIndex()+1); @@ -159,7 +159,7 @@ private void SubscribeOnUpdatePlayerStatus(Player player) } UpdateExp(); - buffLayout.SetBuff(player.Model.Buffs); + buffLayout.SetBuff(player.Model.Buffs, TableSheets.Instance, true); } private void UpdateExp() diff --git a/nekoyume/Assets/_Scripts/UI/Widget/Workshop/Enhancement.cs b/nekoyume/Assets/_Scripts/UI/Widget/Workshop/Enhancement.cs index dcd0b2e5520..4ffa0a9bcbd 100644 --- a/nekoyume/Assets/_Scripts/UI/Widget/Workshop/Enhancement.cs +++ b/nekoyume/Assets/_Scripts/UI/Widget/Workshop/Enhancement.cs @@ -11,6 +11,7 @@ using Nekoyume.Action; using Nekoyume.Battle; using Nekoyume.Extensions; +using Nekoyume.Game; using Nekoyume.Helper; using Nekoyume.TableData; using Nekoyume.UI.Model; @@ -610,7 +611,7 @@ private void UpdateInformation(EnhancementInventoryItem baseModel, var valueText = $"({currentEffect} > {targetEffectMin.Replace("%", "")}~{targetEffectMax})"; var chanceText = $"({chance}% > {skillChancesMin[skillIndex]}~{skillChancesMax[skillIndex]}%)"; - skillView.Set(skillRow.GetLocalizedName(), skillRow.SkillType, skillRow.Id, skillRow.Cooldown, chanceText, valueText); + skillView.Set(skillRow.GetLocalizedName(), skillRow.SkillType, skillRow.Id, skillRow.Cooldown, chanceText, valueText, TableSheets.Instance); } // Update next CP text