Skip to content

Commit

Permalink
Remove #TEST_SCENE flag
Browse files Browse the repository at this point in the history
- Remove TableSheets.Intance requirement
- Remove VFXController requirement
  • Loading branch information
ipdae committed Dec 26, 2024
1 parent 674064a commit c1b51f7
Show file tree
Hide file tree
Showing 32 changed files with 160 additions and 158 deletions.
6 changes: 0 additions & 6 deletions nekoyume/Assets/_Scripts/Editor/TestArena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -418,4 +413,3 @@ public IEnumerator CoShatterStrike(ArenaCharacter caster, IEnumerable<ArenaSkill
}
}
}

8 changes: 3 additions & 5 deletions nekoyume/Assets/_Scripts/Editor/TestArenaCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
using Nekoyume.Game;
using Nekoyume.Game.Character;
using Nekoyume.Game.Controller;
using Nekoyume.Game.VFX;
using Nekoyume.Model.BattleStatus.Arena;
using Nekoyume.UI;
using UnityEngine;
using Nekoyume.Model.Skill;
using Nekoyume.Model.Elemental;
using Nekoyume.Model.Item;
using UnityEngine.Serialization;

namespace Nekoyume.Editor
{
Expand Down Expand Up @@ -103,7 +101,7 @@ public void Init(
_equipments.Clear();
_equipments.AddRange(digest.Equipments);
_target = target;
appearance.Set(digest, avatarAddress, Animator, _hudContainer);
appearance.Set(digest, avatarAddress, Animator, _hudContainer, TestArena.Instance.TableSheets);
}

public void Spawn(Model.ArenaCharacter model)
Expand All @@ -128,7 +126,7 @@ public void Spawn(Model.ArenaCharacter model)
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, TestArena.Instance.TableSheets, false);
UpdateBuffVfx();
}

Expand Down Expand Up @@ -256,7 +254,7 @@ private IEnumerator CoExecuteAction()
}
}

yield return new WaitForSeconds(StageConfig.instance.actionDelay);
yield return new WaitForSeconds(0.5f);
if (_runningAction != null)
{
yield return StartCoroutine(TestArena.Instance.CoSkill(_runningAction));
Expand Down
6 changes: 3 additions & 3 deletions nekoyume/Assets/_Scripts/Extensions/BuffSheetExtension.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Nekoyume.Game;
using Nekoyume.Helper;
using Nekoyume.L10n;
using Nekoyume.Model.Buff;
using Nekoyume.TableData;
using UnityEngine;

namespace Nekoyume
Expand All @@ -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);
}
}
}
2 changes: 1 addition & 1 deletion nekoyume/Assets/_Scripts/Game/Battle/Arena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private IEnumerator CoStart(

_turnNumber = 1;

Widget.Find<ArenaBattle>().Show(myDigest, enemyDigest, myAvatarAddress, enemyAvatarAddress);
Widget.Find<ArenaBattle>().Show(myDigest, enemyDigest, myAvatarAddress, enemyAvatarAddress, TableSheets.Instance);
enemy.Pet.Animator.DestroyTarget();
yield return new WaitForSeconds(2.0f);

Expand Down
6 changes: 2 additions & 4 deletions nekoyume/Assets/_Scripts/Game/Battle/Stage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1464,8 +1464,6 @@ IEnumerator CoFrostBite(IReadOnlyList<Skill.SkillInfo> skillInfos)
));
break;
}

;
}
// This Tick from 'Stun'
else if (tick.SkillId == 0)
Expand Down Expand Up @@ -1622,7 +1620,7 @@ public Actor GetActor(CharacterBase caster)
}
}

character?.Set(caster);
character?.Set(caster, TableSheets.Instance);

return character;
}
Expand Down
20 changes: 10 additions & 10 deletions nekoyume/Assets/_Scripts/Game/Character/Actor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -606,15 +606,15 @@ 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)
{
return;
}

var buff = info.Buff;
var effect = BattleRenderer.Instance.BuffController.Get<BuffVFX>(target.gameObject, buff);
var effect = BattleRenderer.Instance.BuffController.Get<BuffVFX>(target.gameObject, buff, tableSheets);
effect.Target = target;
effect.Buff = buff;

Expand All @@ -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();
Expand Down Expand Up @@ -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}");
Expand Down Expand Up @@ -1168,20 +1168,20 @@ public IEnumerator CoBuff(IReadOnlyList<Model.BattleStatus.Skill.SkillInfo> 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<Actor>();
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);
Expand Down
10 changes: 5 additions & 5 deletions nekoyume/Assets/_Scripts/Game/Character/ArenaCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -378,15 +378,15 @@ private void ProcessBuff(ArenaCharacter target, ArenaSkill.ArenaSkillInfo info)
}

var buff = info.Buff;
var effect = BattleRenderer.Instance.BuffController.Get<BuffVFX>(target.gameObject, buff);
var effect = BattleRenderer.Instance.BuffController.Get<BuffVFX>(target.gameObject, buff, TableSheets.Instance);
effect.Target = target;
effect.Buff = buff;

effect.Play();
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);
Expand Down Expand Up @@ -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))
{
Expand Down
Loading

0 comments on commit c1b51f7

Please sign in to comment.