engine cleanup passes 4-7 + multi-instancing ambient rip
Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed, +11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that turns concurrent battles into a type-system property rather than a scope contract. ## What landed **Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a cascading cull across the skill graph, view layer, and receive-path periphery. Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/ IsAINetwork) became `const false`, every guarded block deleted. Field*.cs subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan family reworked to take a mgr param through IMulliganMgr.InitMulligan. Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/ skill filters converted from static ambient reads to per-mgr reads via SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr. **Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient- Context / TestBattleScope in full. Every per-battle mutable slot now lives on the mgr instance itself: mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo / InstanceViewerId / InstanceNetworkAgent / GameMgr BattleManagerBase.GetIns() returns null unconditionally; the residual static flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo, ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the handful of engine-internal readers that still reference their types. Zero BattleAmbient references anywhere in engine + node + tests. Added pre-seeded GameMgr ctor overload threaded through the mgr chain (BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard- BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it to the mgr's ctor — no ambient reach. Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal BEFORE mgr construction. Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to `HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten around per-mgr construction (GetIns() → null is the pinned invariant). ## Regression fixes - **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied by the WireMulliganPhase seam; unit tests exposed the live-path gap. ## Ship state - SVSim.BattleEngine.Tests: 56/56 pass, 2 skip - SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48) - Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs in SVSim.EmulatedEntrypoint, unrelated) - Sequential PVP smoke: verified live (two back-to-back battles, no regression on cleanup/spinup) - Concurrent PVP smoke: verified live Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure analyzer needed to make future cascade cleanup safe (per feedback memory "Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -114,14 +114,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
IsRemainSkill = RemainingSkillCount > 0;
|
||||
}
|
||||
|
||||
public void SetConditionInReplay(NetworkBattleReceiver.MyRotationBonusInfo bonusInfo)
|
||||
{
|
||||
RemainingIncreaseAddPptotalTurn = bonusInfo.RemainingIncreaseAddPptotalTurn;
|
||||
IsRemainIncreaseAddPptotalTurn = bonusInfo.IsRemainIncreaseAddPptotalTurn;
|
||||
RemainingSkillCount = bonusInfo.RemainingSkillCount;
|
||||
IsRemainSkill = bonusInfo.IsRemainSkill;
|
||||
}
|
||||
|
||||
public bool GetAndReduceAddPpTurn()
|
||||
{
|
||||
bool num = RemainingIncreaseAddPptotalTurn > 0;
|
||||
@@ -193,8 +185,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
}
|
||||
|
||||
public const int MAX_PP = 10;
|
||||
|
||||
public List<BattleCardBase> SelfDiscardList = new List<BattleCardBase>();
|
||||
|
||||
protected BattlePlayerBase _opponentBattlePlayer;
|
||||
@@ -209,8 +199,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
|
||||
protected int m_EpTotal;
|
||||
|
||||
private const int MAX_BP = 99;
|
||||
|
||||
public bool CantPlayChoiceBrave;
|
||||
|
||||
public HashSet<BattleCardBase> PredictionWarningCards = new HashSet<BattleCardBase>();
|
||||
@@ -235,18 +223,10 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
|
||||
public List<AvatarBattleDescInfo> ChoiceBraveSkillDescInfoList;
|
||||
|
||||
public const int MAX_NUM_HAND_CARDS = 9;
|
||||
|
||||
public const int MAX_NUM_IN_PLAY_CARDS_WITH_CLASS = 6;
|
||||
|
||||
public const int MAX_NUM_IN_PLAY_CARDS = 5;
|
||||
|
||||
protected int _gameUsedEpCount;
|
||||
|
||||
protected int _turnUsedEpCount;
|
||||
|
||||
private const string TOKEN_EFFECT_PATH = "cmn_token_draw_1";
|
||||
|
||||
public BattleManagerBase BattleMgr { get; protected set; }
|
||||
|
||||
public virtual bool IsGameFirst => false;
|
||||
@@ -363,7 +343,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
List<int> list2 = SkillOptionValue.ParseOptionTokenID(skillBase.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.card_id, "_OPT_NULL_")).ToList();
|
||||
for (int num = 0; num < list2.Count(); num++)
|
||||
{
|
||||
BattleCardBase item = BattleManagerBase.GetIns().CreateTransformCardRegisterVfx(Class, list2[num], IsPlayer, null, isRecoveryFinish: false, isChoice: true);
|
||||
BattleCardBase item = BattleMgr.CreateTransformCardRegisterVfx(Class, list2[num], IsPlayer, null, isRecoveryFinish: false, isChoice: true);
|
||||
list.Add(item);
|
||||
}
|
||||
return list;
|
||||
@@ -414,8 +394,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
}
|
||||
|
||||
public BattleCardBase LowestCostChoiceBraveCard => ChoiceBraveCards.OrderBy((BattleCardBase c) => c.Cost).FirstOrDefault();
|
||||
|
||||
public bool IsShortageDeckLose { get; protected set; }
|
||||
|
||||
public bool IsShortageDeckWin => Class.SkillApplyInformation.IsShortageDeckWin;
|
||||
@@ -484,8 +462,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
}
|
||||
|
||||
public IClassInfomationUI _classInfomationUI { get; protected set; }
|
||||
|
||||
public ClassInformationUIController ClassInformationUIController { get; protected set; }
|
||||
|
||||
public bool IsBuffDetail
|
||||
@@ -536,8 +512,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
|
||||
public BattleCardBase DrewSkillCard { get; set; }
|
||||
|
||||
public BattleCardBase ReturnSkillCard { get; set; }
|
||||
|
||||
public List<BattleCardBase> EvolvedCards { get; set; }
|
||||
|
||||
public List<BattleCardBase> DestroyedWhenDestroyCards { get; set; }
|
||||
@@ -688,8 +662,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
|
||||
public IEnumerable<TurnAndCard> SkillInfoGameTurnPlayCards => GameTurnPlayCards;
|
||||
|
||||
public IEnumerable<TurnAndCard> SkillInfoGameEnhancePlayCards => GameEnhancePlayCards;
|
||||
|
||||
public IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameCrystallizedPlayCards => ConvertToSkillInfoCollection(GameCrystallizedPlayCards);
|
||||
|
||||
public IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameSkillActivated => ConvertToSkillInfoCollection(ChoiceBraveCardList);
|
||||
@@ -773,20 +745,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
}
|
||||
|
||||
public List<BattleCardBase> AllCardsWithSkillIngredient
|
||||
{
|
||||
get
|
||||
{
|
||||
List<BattleCardBase> list = AllCardsWithCemeteryAndBanish.ToList();
|
||||
list.AddRange(FusionIngredientList);
|
||||
list.AddRange(GetOnList);
|
||||
list.AddRange(UniteList);
|
||||
list.AddRange(ReservedCardList);
|
||||
list.AddRange(BlackHole);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<BattleCardBase> InPlayCards
|
||||
{
|
||||
get
|
||||
@@ -1016,11 +974,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
IsShortageDeck = false;
|
||||
}
|
||||
|
||||
public void SetCumulativeEvolutionCount(int count)
|
||||
{
|
||||
_cumulativeEvolutionCount = count;
|
||||
}
|
||||
|
||||
public int AddDamageByClassUseCard(string damageType)
|
||||
{
|
||||
if (Class != null)
|
||||
@@ -1041,7 +994,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
protected BattlePlayerBase(BattleManagerBase battleMgr, BattleCamera battleCamera, BackGroundBase backGround, IInnerOptionsBuilder innerOptionsBuilder)
|
||||
{
|
||||
BattleMgr = battleMgr;
|
||||
_dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
_dataMgr = BattleMgr.GameMgr.GetDataMgr();
|
||||
BattleCamera = battleCamera;
|
||||
BackGround = backGround;
|
||||
_innerOptionsBuilder = innerOptionsBuilder;
|
||||
@@ -1131,12 +1084,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
return new BattlePlayerVfxCreatorBase(BattleView);
|
||||
}
|
||||
|
||||
public virtual VfxBase LoadResources(IBattleResourceMgr resourceMgr)
|
||||
{
|
||||
long sleeveId = (IsPlayer ? _dataMgr.GetPlayerSleeveId() : _dataMgr.GetEnemySleeveId());
|
||||
return SequentialVfxPlayer.Create(resourceMgr.LoadSleeveMaterial(sleeveId, IsPlayer), ClassInformationUIController.LoadResources(StatusPanelControl.GetClassInfoAnchor(), IsPlayer));
|
||||
}
|
||||
|
||||
public virtual void Setup(BattlePlayerBase opponentBattlePlayer)
|
||||
{
|
||||
IsShortageDeckLose = false;
|
||||
@@ -1144,9 +1091,9 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
_cumulativeEvolutionCount = 0;
|
||||
_opponentBattlePlayer = opponentBattlePlayer;
|
||||
_opponentBattlePlayer.Class.ChangeClassClanParameter();
|
||||
GameMgr ins = GameMgr.GetIns();
|
||||
GameMgr ins = BattleMgr.GameMgr;
|
||||
List<IClassInfomationUI> list = new List<IClassInfomationUI>();
|
||||
BattleManagerBase ins2 = BattleManagerBase.GetIns();
|
||||
BattleManagerBase ins2 = BattleMgr;
|
||||
if (IsPlayer)
|
||||
{
|
||||
int key = (IsPlayer ? ins.GetNetworkUserInfoData().GetSelfChaosId() : ins.GetNetworkUserInfoData().GetOpponentChaosId());
|
||||
@@ -1336,57 +1283,9 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateStatusPanel(int handCount, int cemeteryCount, int deckCount)
|
||||
{
|
||||
if (StatusPanelControl != null)
|
||||
{
|
||||
StatusPanelControl.SetHandCount(handCount);
|
||||
StatusPanelControl.SetGrave(cemeteryCount);
|
||||
StatusPanelControl.SetDeck(deckCount);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual IClassInfomationUI CreateClassInfomationUI(int orderCount = 1, int totalInfoNum = 1, int clanId = -1)
|
||||
{
|
||||
if (clanId == -1)
|
||||
{
|
||||
clanId = (IsPlayer ? _dataMgr.GetPlayerClassId() : _dataMgr.GetEnemyClassId());
|
||||
}
|
||||
IBattlePlayerView battlePlayerView = (IsPlayer ? BattleView : _opponentBattlePlayer.BattleView);
|
||||
IBattlePlayerView battleEnemyView = (IsPlayer ? _opponentBattlePlayer.BattleView : BattleView);
|
||||
switch ((CardBasePrm.ClanType)clanId)
|
||||
{
|
||||
case CardBasePrm.ClanType.MIN:
|
||||
return new ElfInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.ROYAL:
|
||||
return new RoyalInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.WITCH:
|
||||
if (IsPlayer || totalInfoNum > 1)
|
||||
{
|
||||
return new WitchInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
}
|
||||
return new ClassInfomationUIBase(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.DRAGON:
|
||||
return new DragonInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.NECRO:
|
||||
return new NecromanceInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.VAMPIRE:
|
||||
return new VampireInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.BISHOP:
|
||||
return new BishopInfomationUI(this, battlePlayerView, battleEnemyView, orderCount, totalInfoNum);
|
||||
case CardBasePrm.ClanType.NEMESIS:
|
||||
return new NemesisInfomationUI(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
default:
|
||||
return new ClassInfomationUIBase(this, battlePlayerView, orderCount, totalInfoNum);
|
||||
}
|
||||
}
|
||||
|
||||
public VfxBase Recovery()
|
||||
{
|
||||
return SequentialVfxPlayer.Create(ClassInformationUIController.LoadResources(StatusPanelControl.GetClassInfoAnchor(), IsPlayer), InstantVfx.Create(delegate
|
||||
{
|
||||
ClassInformationUIController.ShowInfomation(playEffect: false);
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract void SetupClone(BattlePlayerBase sourceBattlePlayer, BattlePlayerBase virtualOpponentBattlePlayer, CloneActualFlags cloneFlags);
|
||||
@@ -1438,7 +1337,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
processor.OnEvolutionComplete = (Action)Delegate.Combine(processor.OnEvolutionComplete, new Action(BattleMgr.DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvolutionEvent));
|
||||
processor.OnAttackComplete = (Action)Delegate.Combine(processor.OnAttackComplete, new Action(AddToDeckCardIndexChange));
|
||||
processor.OnAttackComplete = (Action)Delegate.Combine(processor.OnAttackComplete, new Action(BattleMgr.DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent));
|
||||
if (GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle)
|
||||
if (BattleMgr.GameMgr.IsWatchBattle && !BattleMgr.GameMgr.IsReplayBattle)
|
||||
{
|
||||
processor.OnFusionComplete = (Action)Delegate.Combine(processor.OnFusionComplete, new Action(BattleMgr.DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent));
|
||||
}
|
||||
@@ -1469,7 +1368,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
|
||||
public virtual BattleCardBase CreateCard(int cardId, int cardIndex, bool isChoiceBrave = false)
|
||||
{
|
||||
BattleCardBase battleCardBase = CardCreatorBase.CreateCard(cardId, IsPlayer, cardIndex, BattleManagerBase.GetIns().SBattleLoad, BattleMgr, BattleManagerBase.GetIns().BattleResourceMgr, _innerOptionsBuilder, isChoiceBrave);
|
||||
BattleCardBase battleCardBase = CardCreatorBase.CreateCard(cardId, IsPlayer, cardIndex, BattleMgr.SBattleLoad, BattleMgr, BattleMgr.BattleResourceMgr, _innerOptionsBuilder, isChoiceBrave);
|
||||
SetupCardEvent(battleCardBase);
|
||||
return battleCardBase;
|
||||
}
|
||||
@@ -1584,7 +1483,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
{
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
if (!GameMgr.GetIns().IsAdminWatch && !GameMgr.GetIns().IsReplayBattle)
|
||||
if (!BattleMgr.GameMgr.IsAdminWatch && !BattleMgr.GameMgr.IsReplayBattle)
|
||||
{
|
||||
BattleLogManager.GetInstance().AddFusionIngredients(fusionCard, isCreateClone: false);
|
||||
}
|
||||
@@ -1604,7 +1503,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
sequentialVfxPlayer.Register(parallelVfxPlayer);
|
||||
TurnFusionCards.Add(fusionCard);
|
||||
AddCurrentTurnFusionCount(1);
|
||||
if (GameMgr.GetIns().IsAdminWatch || GameMgr.GetIns().IsReplayBattle)
|
||||
if (BattleMgr.GameMgr.IsAdminWatch || BattleMgr.GameMgr.IsReplayBattle)
|
||||
{
|
||||
BattleLogManager.GetInstance().AddFusionIngredients(fusionCard, isCreateClone: true);
|
||||
}
|
||||
@@ -1618,7 +1517,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
sequentialVfxPlayer.Register(BattleView.ReturnActCardAfterFusion(fusionCard.BattleCardView, flag));
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
ImmediateVfxMgr.GetInstance().Register(new ShowSideLogVfx(originalCard, null, originalCard.SelfBattlePlayer.BattleView.GetSideLogControl(isSkillTargetSelect: false), originalCard.GetCardSkillDescription(new SideLogInfo(null)), 3f));
|
||||
}));
|
||||
VfxBase vfx = fusionCard.Fusion(skillProcessor, ingredientCards, flag);
|
||||
sequentialVfxPlayer.Register(vfx);
|
||||
@@ -1891,10 +1789,10 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
SkillProcessor.ProcessInfo info4 = banishedCard.Skills.CreateWhenBanishInfo(banishedCard, skillProcessor, playerInfoPair);
|
||||
skillProcessor.Register(info4, ignoreOwnerDeadCheck: true);
|
||||
sequentialVfxPlayer.Register(CardToBanishZone(banishedCard, skill, registerEvent: true, isRandom, isOpen));
|
||||
if (!BattleManagerBase.IsForecast)
|
||||
if (!this.BattleMgr.InstanceIsForecast)
|
||||
{
|
||||
sequentialVfxPlayer.Register(new DeckChangeVfx(this));
|
||||
sequentialVfxPlayer.Register(new DummyDeckRemoveCardVfx(IsPlayer, 1));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
}
|
||||
}
|
||||
sequentialVfxPlayer.Register(StartSkillWhenChangeInplay(null, null, skillProcessor));
|
||||
@@ -2033,7 +1931,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
SkillProcessor skillProcessor = new SkillProcessor();
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
_ = PpTotal;
|
||||
GameMgr.GetIns().GetDataMgr();
|
||||
BattleMgr.GameMgr.GetDataMgr();
|
||||
int num = 0;
|
||||
IDetailPanelControl detailPanelControl = BattleMgr.DetailMgr.DetailPanelControl;
|
||||
if (EvolveWaitTurnCount <= 0)
|
||||
@@ -2128,7 +2026,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
sequentialVfxPlayer.Register(TurnStartDraw(skillProcessor));
|
||||
sequentialVfxPlayer.Register(skillProcessor.Process(battlePlayerPair));
|
||||
BattleUIContainer battleUIContainer = BattleManagerBase.GetIns().BattleUIContainer;
|
||||
BattleUIContainer battleUIContainer = BattleMgr.BattleUIContainer;
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
battleUIContainer.EnableMenu();
|
||||
@@ -2140,9 +2038,9 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
BattleLogManager.GetInstance().EndLogBlockTurnChangeReactive();
|
||||
if (!BattleMgr.IsBattleEnd)
|
||||
{
|
||||
if (GameMgr.GetIns().IsNetworkBattle && IsPlayer)
|
||||
if (BattleMgr.GameMgr.IsNetworkBattle && IsPlayer)
|
||||
{
|
||||
NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase;
|
||||
NetworkBattleManagerBase networkBattleManagerBase = BattleMgr as NetworkBattleManagerBase;
|
||||
if (networkBattleManagerBase.turnEndTimeController != null)
|
||||
{
|
||||
networkBattleManagerBase.turnEndTimeController.AddTurnEndTimerLog("Player SetActiveVFX");
|
||||
@@ -2188,7 +2086,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
sequentialVfxPlayer.Register(m_vfxCreator.CreateUpdateEp(CurrentEpCount, EvolveWaitTurnCount));
|
||||
if (NowTurnEvol && CurrentEpCount > 0 && EvolveWaitTurnCount <= 0)
|
||||
{
|
||||
sequentialVfxPlayer.Register(new TurnStartEvolveVfx(eqIcon, firstEvolve));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2197,9 +2095,9 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
sequentialVfxPlayer.Register(m_vfxCreator.CreateUpdateEp(CurrentEpCount, EvolveWaitTurnCount));
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_YOURTURN);
|
||||
|
||||
BattleMgr.TurnPanelControl.StartUI(Turn, EvolveWaitTurnCount, IsPlayer);
|
||||
if (GameMgr.GetIns().IsWatchBattle || GameMgr.GetIns().IsReplayBattle)
|
||||
if (BattleMgr.GameMgr.IsWatchBattle || BattleMgr.GameMgr.IsReplayBattle)
|
||||
{
|
||||
BattleView.TurnEndButtonUI.GameObject.SetActive(value: true);
|
||||
BattleView.TurnEndButtonUI.ChangeButtonView(IsPlayer);
|
||||
@@ -2207,7 +2105,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}));
|
||||
if (NowTurnEvol && CurrentEpCount > 0 && EvolveWaitTurnCount <= 0)
|
||||
{
|
||||
sequentialVfxPlayer.Register(new TurnStartEvolveVfx(eqIcon, firstEvolve));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
}
|
||||
sequentialVfxPlayer.Register(WaitVfx.Create(1.6f));
|
||||
}
|
||||
@@ -2218,7 +2116,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
{
|
||||
DeckCardList.Sort((BattleCardBase a, BattleCardBase b) => a.Index - b.Index);
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
if (!Class.IsDead && !_opponentBattlePlayer.Class.IsDead && !BattleManagerBase.GetIns().IsPuzzleMgr)
|
||||
if (!Class.IsDead && !_opponentBattlePlayer.Class.IsDead && !BattleMgr.IsPuzzleMgr)
|
||||
{
|
||||
sequentialVfxPlayer.Register(TurnStartDrawCard(skillProcessor));
|
||||
}
|
||||
@@ -2286,7 +2184,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
text = text + "nowPP " + Pp;
|
||||
LocalLog.AccumulateLastTraceLog(text);
|
||||
}
|
||||
parallelVfxPlayer.Register(new PpChangeVfx(this));
|
||||
parallelVfxPlayer.Register(NullVfx.GetInstance());
|
||||
this.OnChangePP.Call(PpTotal - ppTotal);
|
||||
this.OnAddPpTotal.Call(PpTotal - ppTotal, Pp, IsPlayer, ownerCard, bySkill);
|
||||
if (skillProcessor != null)
|
||||
@@ -2551,8 +2449,8 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
break;
|
||||
case SkillBaseSummon.SUMMON_TYPE.DECK:
|
||||
DeckCardToField(unit, skill);
|
||||
sequentialVfxPlayer.Register(new DeckChangeVfx(this));
|
||||
sequentialVfxPlayer.Register(new DummyDeckRemoveCardVfx(IsPlayer, 1));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
break;
|
||||
case SkillBaseSummon.SUMMON_TYPE.TOKEN:
|
||||
TokenToField(unit, skill, isGetoff, isReanimate);
|
||||
@@ -3117,16 +3015,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
return result;
|
||||
}
|
||||
|
||||
public void RegisterSkill(IBattlePlayerSkill battlePlayerSkill)
|
||||
{
|
||||
_skillList.Add(battlePlayerSkill);
|
||||
}
|
||||
|
||||
public void UnregisterSkill(IBattlePlayerSkill battlePlayerSkill)
|
||||
{
|
||||
_skillList.Remove(battlePlayerSkill);
|
||||
}
|
||||
|
||||
private void CallSkill(Func<IBattlePlayerSkill, Func<BattleCardBase, VfxBase>> getFunc, BattleCardBase targetCard)
|
||||
{
|
||||
foreach (IBattlePlayerSkill skill in _skillList)
|
||||
@@ -3159,11 +3047,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public virtual VfxBase MoveToDeck(List<BattleCardBase> cardsToMoveToDeck)
|
||||
{
|
||||
return new MoveToDeckVfx(cardsToMoveToDeck, IsPlayer);
|
||||
}
|
||||
|
||||
protected virtual VfxWith<IEnumerable<BattleCardBase>> LotteryRandomDrawCard(int drawCount, SkillProcessor skillProcessor)
|
||||
{
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
@@ -3171,7 +3054,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
{
|
||||
return new VfxWith<IEnumerable<BattleCardBase>>(SendShortageDeck(), list);
|
||||
}
|
||||
if (BattleManagerBase.IsRandomDraw)
|
||||
if (this.BattleMgr.InstanceIsRandomDraw)
|
||||
{
|
||||
list = SkillRandomSelectFilter.Filtering(drawCount, DeckCardList, BattleMgr).ToList();
|
||||
}
|
||||
@@ -3209,7 +3092,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
{
|
||||
resultInfo.drawCards = ConvertToSkillInfoCollection(vfxWith.Value);
|
||||
}
|
||||
if (IsPlayer || GameMgr.GetIns().IsAdminWatch || isVisible || BattleMgr is SingleBattleMgr)
|
||||
if (IsPlayer || BattleMgr.GameMgr.IsAdminWatch || isVisible || BattleMgr is SingleBattleMgr)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
foreach (BattleCardBase card in drawCards)
|
||||
@@ -3229,16 +3112,16 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
}
|
||||
if (IsPlayer)
|
||||
{
|
||||
sequentialVfxPlayer.Register(new PlayerDrawCardVfx(drawCards, isVisible));
|
||||
sequentialVfxPlayer.Register(new PlayerEndDrawVfx(drawCards));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(GameMgr.GetIns().IsAdminWatch && isVisible))
|
||||
if (!(BattleMgr.GameMgr.IsAdminWatch && isVisible))
|
||||
{
|
||||
sequentialVfxPlayer.Register(new OpponentDrawCardVfx(drawCards, isVisible));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
}
|
||||
sequentialVfxPlayer.Register(new OpponentDrawCardToHandVfx(drawCards, 0.4f, isVisible));
|
||||
sequentialVfxPlayer.Register(NullVfx.GetInstance());
|
||||
}
|
||||
VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
|
||||
vfxWithLoadingSequential.RegisterToMainVfx(InstantVfx.Create(delegate
|
||||
@@ -3428,42 +3311,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
|
||||
public void ApplyFixedUseCostInfo()
|
||||
{
|
||||
HandParameter.IconLayout currentIconLayout = BattleCardView.GetCurrentIconLayout();
|
||||
HandControl.ArrangeType type = (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FIXEDUSE_COST_INFO) ? HandControl.ArrangeType.Flat : HandControl.ArrangeType.Fan);
|
||||
NetworkBattleManagerBase networkBattleMgr = BattleManagerBase.GetIns() as NetworkBattleManagerBase;
|
||||
UpdateHandCostViewStrategy();
|
||||
InitHandParameterIconPos(currentIconLayout);
|
||||
BattleView.HandView.ChangeArrangeType(type);
|
||||
if (networkBattleMgr != null && networkBattleMgr.IsSkillSelectTiming)
|
||||
{
|
||||
BattleMgr.VfxMgr.RegisterImmediateVfx(SequentialVfxPlayer.Create(UpdateHandCardsCost(playEffect: false, isOnlyFixedUseCost: true), WaitEventVfx.Create(() => !networkBattleMgr.IsSkillSelectTiming), UpdateHandCardsCost(playEffect: false)));
|
||||
}
|
||||
else
|
||||
{
|
||||
BattleMgr.VfxMgr.RegisterImmediateVfx(UpdateHandCardsCost(playEffect: false));
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateHandCostViewStrategy()
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = HandCardList.Count; i < count; i++)
|
||||
{
|
||||
HandCardList[i].UpdateCostViewStrategy();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitHandParameterIconPos(HandParameter.IconLayout layout)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = HandCardList.Count; i < count; i++)
|
||||
{
|
||||
HandCardList[i].InitHandParameterIconPos(layout);
|
||||
}
|
||||
}
|
||||
|
||||
public VfxWithLoadingSequential AddSpellChargeCountVfx(List<BattleCardBase> targetCardList, List<int> addCountList)
|
||||
{
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
@@ -3474,7 +3321,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
BattleCardBase battleCardBase = targetCardList[i];
|
||||
int num = addCountList[i];
|
||||
battleCardBase.AddSpellChargeCount(num);
|
||||
if ((!battleCardBase.IsPlayer && !GameMgr.GetIns().IsAdminWatch) || battleCardBase.IsInDeck)
|
||||
if ((!battleCardBase.IsPlayer && !BattleMgr.GameMgr.IsAdminWatch) || battleCardBase.IsInDeck)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -3491,7 +3338,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
list3.Add(Skill_spell_charge.SPELL_CHARGE_INTERVAL);
|
||||
}
|
||||
}
|
||||
return new SpellChargeSkillActivationVfx(list, list2, list3);
|
||||
return VfxWithLoadingSequential.Create();
|
||||
}
|
||||
|
||||
public abstract EffectBattle GetSkillEffect(string skillEffectPath);
|
||||
@@ -4206,9 +4053,8 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
|
||||
public IEnumerable<IReadOnlyBattleCardInfo> GetSpecificTurnDestroyCards(TurnPlayerInfo turnPlayerInfo)
|
||||
{
|
||||
BattleManagerBase ins = BattleManagerBase.GetIns();
|
||||
bool isCheckSelf = IsPlayer == turnPlayerInfo.IsSelfPlayer;
|
||||
int turn = (isCheckSelf ? ins.BattlePlayer.Turn : ins.BattleEnemy.Turn);
|
||||
int turn = (isCheckSelf ? BattleMgr.BattlePlayer.Turn : BattleMgr.BattleEnemy.Turn);
|
||||
turn -= turnPlayerInfo.TurnOffset;
|
||||
return from c in TurnDestroyCards
|
||||
where c.IsSelfTurn == isCheckSelf && c.Turn == turn
|
||||
@@ -4349,49 +4195,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo
|
||||
return 0;
|
||||
}
|
||||
|
||||
public VfxWithLoading CreateTokenSpawnVfx(BattleCardBase firstToken)
|
||||
{
|
||||
Color color;
|
||||
switch (firstToken.Clan)
|
||||
{
|
||||
case CardBasePrm.ClanType.MIN:
|
||||
color = Global.EFFECT_COLOR_ELF;
|
||||
break;
|
||||
case CardBasePrm.ClanType.ROYAL:
|
||||
color = Global.EFFECT_COLOR_ROYAL;
|
||||
break;
|
||||
case CardBasePrm.ClanType.WITCH:
|
||||
color = Global.EFFECT_COLOR_WITCH_1;
|
||||
break;
|
||||
case CardBasePrm.ClanType.DRAGON:
|
||||
color = Global.EFFECT_COLOR_DRAGON;
|
||||
break;
|
||||
case CardBasePrm.ClanType.NECRO:
|
||||
color = Global.EFFECT_COLOR_NECROMANCER;
|
||||
break;
|
||||
case CardBasePrm.ClanType.VAMPIRE:
|
||||
color = Global.EFFECT_COLOR_VANPIRE;
|
||||
break;
|
||||
case CardBasePrm.ClanType.BISHOP:
|
||||
color = Global.EFFECT_COLOR_BISHOP;
|
||||
break;
|
||||
case CardBasePrm.ClanType.NEMESIS:
|
||||
color = Global.EFFECT_COLOR_NEMESIS;
|
||||
break;
|
||||
default:
|
||||
color = Color.clear;
|
||||
break;
|
||||
}
|
||||
Func<Vector3> getEffectSpawnPoint = () => firstToken.BattleCardView.GameObject.transform.position;
|
||||
EffectBattle effectBattle = null;
|
||||
SkillBase.WaitEffectLoadVfx loadingVfx = new SkillBase.WaitEffectLoadVfx("cmn_token_draw_1", EffectMgr.EngineType.SHURIKEN, "se_cmn_token_draw_1", BattleMgr.BattleResourceMgr, delegate(EffectBattle eb)
|
||||
{
|
||||
effectBattle = eb;
|
||||
});
|
||||
DelaySetupVfx mainVfx = new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, firstToken.BattleCardView, BattleMgr.BattleResourceMgr, getEffectSpawnPoint, getEffectSpawnPoint, 0f, 0f, EffectMgr.MoveType.DIRECT, IsPlayer, color));
|
||||
return VfxWithLoading.Create(loadingVfx, mainVfx);
|
||||
}
|
||||
|
||||
public void CallOnTokenDraw(BattleCardBase owner, List<BattleCardBase> drawList, List<BattleCardBase> targets, bool isPlayer, bool isOpen, bool isReserved)
|
||||
{
|
||||
this.OnTokenDrawCards.Call(owner, drawList, targets, isPlayer, isOpen, isReserved);
|
||||
|
||||
Reference in New Issue
Block a user