Files
SVSimServer/SVSim.BattleEngine/Engine/ChangeAffiliationVfx.cs
gamer147 957af3d1ec feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
2026-06-05 17:22:20 -04:00

53 lines
1.7 KiB
C#

using UnityEngine;
using Wizard.Battle.View;
using Wizard.Battle.View.Vfx;
public class ChangeAffiliationVfx : SequentialVfxPlayer
{
private readonly IBattleCardView _view;
public ChangeAffiliationVfx(BattleCardBase card, CardBasePrm.ClanType clan)
{
ChangeAffiliationVfx changeAffiliationVfx = this;
GameObject effectGameObject = null;
_view = card.BattleCardView;
if ((card.IsPlayer || GameMgr.GetIns().IsAdminWatch || !card.IsInHand) && clan != CardBasePrm.ClanType.NONE)
{
Register(new WaitLoadEffectAndSetSeVfx("cmn_card_classchange_1", "se_cmn_card_classchange_1", delegate(GameObject e)
{
effectGameObject = e;
}));
Register(new PlayEffectAndSeVfx(delegate
{
effectGameObject.GetComponent<Effect>().ChangeParticleColor(changeAffiliationVfx.GetClanColor(clan));
return effectGameObject;
}, _view.Transform));
Register(WaitVfx.Create(0.3f));
}
}
private VfxBase ChangeEffectColor(Effect effect, Color color)
{
return InstantVfx.Create(delegate
{
effect.ChangeParticleColor(color);
});
}
private Color GetClanColor(CardBasePrm.ClanType clan)
{
return clan switch
{
CardBasePrm.ClanType.ALL => Color.white,
CardBasePrm.ClanType.MIN => new Color(0.2f, 1f, 0.8f),
CardBasePrm.ClanType.ROYAL => new Color(1f, 0.9f, 0.5f),
CardBasePrm.ClanType.WITCH => new Color(0.7f, 0.5f, 1f),
CardBasePrm.ClanType.DRAGON => new Color(1f, 0.5f, 0f),
CardBasePrm.ClanType.NECRO => new Color(0.5f, 0.4f, 1f),
CardBasePrm.ClanType.VAMPIRE => new Color(1f, 0.2f, 0.2f),
CardBasePrm.ClanType.BISHOP => new Color(0.5f, 0.7f, 1f),
_ => Color.white,
};
}
}