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.
113 lines
3.9 KiB
C#
113 lines
3.9 KiB
C#
using Wizard.Battle.UI;
|
|
using Wizard.Battle.View.Vfx;
|
|
|
|
public class Skill_possess_ep_modifier : SkillBase
|
|
{
|
|
public static readonly int EP_NONE = -1;
|
|
|
|
public Skill_possess_ep_modifier(SkillParameter skillPrm, string option)
|
|
: base(skillPrm, option)
|
|
{
|
|
}
|
|
|
|
public override VfxWithLoading Start(CallParameter parameter)
|
|
{
|
|
if (BattleManagerBase.IsForecast)
|
|
{
|
|
return NullVfxWithLoading.GetInstance();
|
|
}
|
|
int num = base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_eptotal, 0);
|
|
int num2 = base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_ep, 0);
|
|
int num3 = base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.set_ep, EP_NONE);
|
|
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
|
foreach (BattleCardBase targetCard in parameter.targetCards)
|
|
{
|
|
int currentEpCount = targetCard.SelfBattlePlayer.CurrentEpCount;
|
|
if (num2 != 0)
|
|
{
|
|
parallelVfxPlayer.Register(AddEp(parameter.skillProcessor, num2, targetCard.SelfBattlePlayer));
|
|
}
|
|
else if (num != 0)
|
|
{
|
|
parallelVfxPlayer.Register(AddEpTotal(parameter.skillProcessor, num, targetCard.SelfBattlePlayer));
|
|
}
|
|
else if (num3 != EP_NONE)
|
|
{
|
|
parallelVfxPlayer.Register(SetEp(num3, targetCard.SelfBattlePlayer));
|
|
}
|
|
int currentEpCount2 = targetCard.SelfBattlePlayer.CurrentEpCount;
|
|
int epTotal = targetCard.SelfBattlePlayer.EpTotal;
|
|
parallelVfxPlayer.Register(new EpChangeVfx(targetCard.SelfBattlePlayer, currentEpCount, currentEpCount2, epTotal));
|
|
if (IsBattleLog)
|
|
{
|
|
BattleLogManager.GetInstance().AddLogSkillSetEP(currentEpCount2, targetCard.SelfBattlePlayer.Class, this);
|
|
}
|
|
}
|
|
VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
|
|
vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(base.SkillPrm.resourceMgr, parameter.targetCards, isFollowInHand: false, addToLastOperation: true));
|
|
vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
|
|
return vfxWithLoadingSequential;
|
|
}
|
|
|
|
protected virtual VfxBase AddEp(SkillProcessor skillProcessor, int add, BattlePlayerBase battlePlayer)
|
|
{
|
|
AddToEpWithFloor(skillProcessor, add, battlePlayer);
|
|
if (battlePlayer.CurrentEpCount > battlePlayer.EpTotal)
|
|
{
|
|
battlePlayer.SetCurrentEpCount(battlePlayer.EpTotal);
|
|
}
|
|
return NullVfx.GetInstance();
|
|
}
|
|
|
|
private VfxBase AddEpTotal(SkillProcessor skillProcessor, int add, BattlePlayerBase battlePlayer)
|
|
{
|
|
AddToEpWithFloor(skillProcessor, add, battlePlayer);
|
|
int currentEpCount = battlePlayer.CurrentEpCount;
|
|
return UpdateUsableAndMaxEp(battlePlayer, currentEpCount);
|
|
}
|
|
|
|
protected virtual VfxBase SetEp(int set, BattlePlayerBase battlePlayer)
|
|
{
|
|
if (set < 0)
|
|
{
|
|
return NullVfx.GetInstance();
|
|
}
|
|
int currentEpCount = battlePlayer.CurrentEpCount;
|
|
battlePlayer.SetCurrentEpCount(set);
|
|
return UpdateUsableAndMaxEp(battlePlayer, currentEpCount);
|
|
}
|
|
|
|
private void AddToEpWithFloor(SkillProcessor skillProcessor, int amountToAdd, BattlePlayerBase battlePlayer)
|
|
{
|
|
if (amountToAdd < 0)
|
|
{
|
|
amountToAdd *= -1;
|
|
if (battlePlayer.CurrentEpCount < amountToAdd)
|
|
{
|
|
amountToAdd = battlePlayer.CurrentEpCount;
|
|
}
|
|
battlePlayer.UseEpCount(amountToAdd);
|
|
battlePlayer.StartSkillWhenUseEpSelfAndOther(skillProcessor);
|
|
}
|
|
else
|
|
{
|
|
battlePlayer.AddCurrentEpCount(amountToAdd);
|
|
}
|
|
}
|
|
|
|
private VfxBase UpdateUsableAndMaxEp(BattlePlayerBase battlePlayer, int oldMaxEpAmount)
|
|
{
|
|
if (battlePlayer.CurrentEpCount > battlePlayer.EpTotal)
|
|
{
|
|
if (battlePlayer.EpTotal == BattleManagerBase.FIRST_PLAYER_EP_NUM)
|
|
{
|
|
battlePlayer.EpTotal = BattleManagerBase.SECOND_PLAYER_EP_NUM;
|
|
battlePlayer.SetCurrentEpCount(BattleManagerBase.SECOND_PLAYER_EP_NUM);
|
|
return battlePlayer.StatusPanelControl.PlayIncreaseMaxEpAnimation(oldMaxEpAmount, battlePlayer.CurrentEpCount);
|
|
}
|
|
battlePlayer.SetCurrentEpCount(battlePlayer.EpTotal);
|
|
}
|
|
return NullVfx.GetInstance();
|
|
}
|
|
}
|