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.
This commit is contained in:
65
SVSim.BattleEngine/Engine/Skill_damage_modifier.cs
Normal file
65
SVSim.BattleEngine/Engine/Skill_damage_modifier.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class Skill_damage_modifier : SkillBase
|
||||
{
|
||||
private DamageModifier _info;
|
||||
|
||||
public const string AND_TEXT = "_and_";
|
||||
|
||||
public Skill_damage_modifier(SkillParameter skillPrm, string option)
|
||||
: base(skillPrm, option)
|
||||
{
|
||||
}
|
||||
|
||||
public override VfxWithLoading Start(CallParameter parameter)
|
||||
{
|
||||
int num = base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_damage, 0);
|
||||
int num2 = base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.set_damage, -1);
|
||||
string damageType = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.card_type, "_OPT_NULL_");
|
||||
bool isUseClass = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.owner, "all") == "all";
|
||||
CardBasePrm.ClanType clanType = CardBasePrm.GetClanType(base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.clan));
|
||||
List<BattleCardBase> list = parameter.targetCards.ToList();
|
||||
if (num != 0)
|
||||
{
|
||||
_info = new AddDamageInfo(num, damageType, clanType, isUseClass, base.SkillPrm.selfBattlePlayer.BattleMgr.AllPublishedDamageModifierCount++);
|
||||
}
|
||||
else if (num2 != -1)
|
||||
{
|
||||
_info = new SetDamageInfo(num2, damageType, clanType, isUseClass, base.SkillPrm.selfBattlePlayer.BattleMgr.AllPublishedDamageModifierCount++);
|
||||
}
|
||||
for (int i = 0; i < parameter.targetCards.Count(); i++)
|
||||
{
|
||||
list[i].SkillApplyInformation.GiveAddDamage(_info);
|
||||
BuffInfo buffInfo = ((num != 0 || num2 != -1) ? AddBuffInfoIfNeeded(list[i]) : null);
|
||||
buffInfoContainer.Add(new BuffInfoContainer(list[i], buffInfo, -1, "", null, 0L));
|
||||
base.IsActivity = true;
|
||||
SetOnLoseEvent(list[i], null, null);
|
||||
}
|
||||
VfxWithLoading result = CreateSkillEffect(base.SkillPrm.resourceMgr, parameter.targetCards);
|
||||
if (IsBattleLog)
|
||||
{
|
||||
BattleLogManager.GetInstance().AddLogSkillGain(list, this, SkillGainType.AddDamage, num);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public override VfxWithLoading Stop(SkillProcessor skillProcessor)
|
||||
{
|
||||
for (int i = 0; i < buffInfoContainer.Count; i++)
|
||||
{
|
||||
BattleCardBase targetCard = buffInfoContainer[i]._targetCard;
|
||||
targetCard.RemoveBuffInfo(buffInfoContainer[i]._buffInfo);
|
||||
targetCard.SkillApplyInformation.DepriveAddDamage(_info);
|
||||
}
|
||||
buffInfoContainer.Clear();
|
||||
return base.Stop(skillProcessor);
|
||||
}
|
||||
|
||||
public override void SetOnLoseEvent(BattleCardBase targetCard, BuffInfo buff, BuffInfoContainer container)
|
||||
{
|
||||
targetCard.OnLoseSkillOneTime += (SkillBase loseSkill, SkillProcessor skillProcessor, BattleCardBase card) => card.IsDead ? ((VfxBase)NullVfx.GetInstance()) : ((VfxBase)Stop(skillProcessor));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user