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().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