feat(battle-engine): grow god-object + VFX-container shim surface

GameMgr (managers/setting/flags), UIManager (GetInstance + scene/dialog/loading
surface), EffectMgr (Start/effect lifecycle), VfxMgr + VfxWithLoading(Sequential)
register methods -- signatures mirrored from decomp. 15.9k -> 10.0k errors.
This commit is contained in:
gamer147
2026-06-05 20:27:00 -04:00
parent 4491c6c7f3
commit 78f310c2b3
2 changed files with 184 additions and 20 deletions

View File

@@ -1,12 +1,15 @@
// AUTHORED SHIM (not copied). The god-object singletons the engine reaches for
// presentation/scene/effects. These are the M0 "stop the bleed" types: copying
// them would re-explode the closure into the whole app (audio, scene, UI, net),
// so we shim a minimal surface. The nested enums below are presentation
// classifiers used only inside never-run VFX actions (IsForecast suppresses VFX),
// so their VALUES are immaterial to game state -- but the symbols the engine
// references must exist to compile. Members listed are exactly those the compiler
// demanded (extracted from the copied engine, not guessed).
// (Global namespace: the decomp root files declare no namespace.)
// presentation/scene/effects/sound/data. These are the M0 "stop the bleed" types:
// copying them re-explodes the closure into the whole app (audio, scene, UI, net),
// so we shim a minimal surface. Manager GETTERS return the (copied) manager types as
// null fields -- the engine only dereferences them inside never-run VFX (IsForecast
// suppresses VFX) or non-battle code paths, so a null is harmless headless and avoids
// constructing copied types with heavy ctors. Member signatures mirror the decomp
// exactly (extracted, not guessed) so call sites compile unchanged.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EffectMgr
{
@@ -26,16 +29,120 @@ public class EffectMgr
CMN_RESULT_LVUP_1, CMN_RESULT_MATCH_1, CMN_RESULT_ORB_1, CMN_RESULT_ORB_2,
CMN_RESULT_RANKDOWN_1, CMN_RESULT_RANKUP_1, CMN_RESULT_TIERUP_1,
CMN_START_CARD_1, CMN_START_VS_1, CMN_START_VS_ST2,
CMN_UI_TURN_1, CMN_UI_TURN_5, CMN_UI_TURN_6,
CMN_UI_TURN_1, CMN_UI_TURN_5, CMN_UI_TURN_6, CMN_CLASS_APPEAR_1,
}
public enum MoveType { NONE, DIRECT, DIRECT_HAND, DIRECT_LEADER }
public enum TargetType { NONE, NONE_WAIT, SINGLE, SINGLE_ONLY_OPPONENT, AREA_ALL, AREA_OPPONENT, AREA_SELF }
public enum EngineType { NONE, SHURIKEN, SOLID }
public GameObject EffectContainer => null;
public bool IsPlayerBattleEffectReady => true;
public bool IsEnemyBattleEffectReady => true;
public bool IsPreInEffectReady => true;
public bool IsFieldEffectReady => true;
public bool IsBattleUIEffectReady => true;
public Effect Start(EffectType type, Vector3 pos, Quaternion rot, int layer = -1) => null;
public Effect Start(EffectType type, Vector3 pos, GameObject obj = null) => null;
public Effect Start(EffectType type, float posX, float posY) => null;
public Effect Start(EffectType type) => null;
public Effect StartTouchEffect(EffectType type, float posX, float posY) => null;
public Effect StartBuff(EffectType type, GameObject obj) => null;
public Effect StartBuffLookAt(EffectType type, GameObject fromObject, GameObject toObject) => null;
public Effect StartBuffLookAtCamera(EffectType type, GameObject fromObject, Camera toCamera) => null;
public Effect StopBuff(EffectType type, GameObject obj) => null;
public Effect FadePlay(GameObject obj, float posX, float posY) => null;
public Effect FadeStop(GameObject obj) => null;
public Effect FadeStop(EffectType type) => null;
public Effect Stop(EffectType type) => null;
public List<string> InitCommonEffect(string filePath, bool isBattle = false, bool isField = false, bool isBattleEffect = false, Action callback = null) => new List<string>();
public List<string> SetUIParticleShader(List<GameObject> effectObjList, Action callback, bool isBattle = false, bool isField = false) => new List<string>();
public List<string> SetUIParticleShader(GameObject effectObj, Action callback, bool isBattle = false, bool isField = false) => new List<string>();
public List<string> LoadUIParticleShader(GameObject effectObj, Action callback, bool isBattle) => new List<string>();
public void SetOnlyUIParticleShader(GameObject effectObj) { }
public void SetParticleShader(GameObject effectObj) { }
public void ChangeMaskShader(GameObject effectObj, int stencil = 1) { }
public void InitBattleEffect() { }
public void InitEnemyBattleEffect() { }
public void DisposeLatestMadeEffects() { }
public void ClearLastCacheEffect() { }
public void SetupEffectContainer() { }
public void DestroyBattleEffectContainer() { }
public void ImmediateDestroyBattleEffectContainer() { }
public void ClearBattleFeildEffect() { }
public void RestUnneededEffect() { }
public EffectBattle GetEffectBattle(string key) => null;
public EffectBattle GetEnemyEffectBattle(string key) => null;
public static MoveType ToStrMoveType(string str) => MoveType.NONE;
public static EngineType ToStrEngineType(string str) => EngineType.NONE;
public static TargetType ToStrTargetType(string str) => TargetType.NONE;
}
public class GameObjMgr { }
public class GameMgr
{
public static GameMgr GetIns() => _ins ??= new GameMgr();
private static GameMgr _ins;
public GameObject m_GameManagerObj;
public bool IsNewReplayBattle;
public bool IsAdmin;
public bool IsWatchHandInvisible;
public float ScreenAspect = 1.777f;
public DateTime AnnounceTime;
public Wizard.RankWinnerReward _rankWinnerReward;
public bool IsAdminWatch => false;
public bool IsWatchBattle => false;
public bool IsReplayBattle => false;
public bool IsNetworkBattle => false;
public bool IsAINetwork => false;
public bool IsPuzzleQuest => false;
private EffectMgr _effect;
private SoundMgr _sound;
private DataMgr _data;
private GameObjMgr _gameObj = new GameObjMgr();
private PrefabMgr _prefab;
private InputMgr _input;
private BattleControl _battleCtrl;
private NetworkUserInfoData _netUser;
public EffectMgr GetEffectMgr() => _effect ??= new EffectMgr();
public SoundMgr GetSoundMgr() => _sound;
public DataMgr GetDataMgr() => _data;
public GameObjMgr GetGameObjMgr() => _gameObj;
public PrefabMgr GetPrefabMgr() => _prefab;
public InputMgr GetInputMgr() => _input;
public BattleControl GetBattleCtrl() => _battleCtrl;
public NetworkUserInfoData GetNetworkUserInfoData() => _netUser;
public void SetNetworkUserInfoData(NetworkUserInfoData infoData) => _netUser = infoData;
public Wizard.MailTopTask GetMailTopTask() => null;
public Wizard.MyPageTask GetMyPageTask() => null;
public Wizard.DeckUpdateTask GetDeckUpdateTask() => null;
public Wizard.CardDestructTask GetCardDestructTask() => null;
public Wizard.CardCreateTask GetCardCreateTask() => null;
public Wizard.MissionInfoTask GetMissionInfoTask() => null;
public static void CreateIns() { _ins ??= new GameMgr(); }
public void CreateMgrIns(GameObject gameobj) { }
public void BuildDeckData() { }
public void DestroyBattleManagements() { }
public void Init() { }
public void InitializeSelfInfo() { }
public void SettingSelfInfo(Dictionary<string, object> info, bool isWatchReplayRecovery) { }
public void SettingOpponentInfo(Dictionary<string, object> info, bool isWatchReplayRecovery) { }
public void SettingBattleStartSelfInfo(Dictionary<string, object> info) { }
public void SettingBattleStartOpponentInfo(Dictionary<string, object> info) { }
public void SettingSelfDeck(List<object> info) { }
public bool IsUseUnapprovedList(bool isPlayer) => false;
}
public class UIManager
{
public static UIManager GetIns() => _ins ??= new UIManager();
public static UIManager GetInstance() => _ins ??= new UIManager();
public static UIManager GetIns() => GetInstance();
private static UIManager _ins;
public enum ViewScene
@@ -46,16 +153,57 @@ public class UIManager
NeutralPopularityVote, Profile, QuestSelectionPage, RankMatch, Room,
StorySelectPage, StorySelectionWorld, TwoPick,
}
public class ChangeViewSceneParam { }
public class ChangeViewSceneParam { public ChangeViewSceneParam() { } }
public Camera UIRootLoadingCamera;
public Dictionary<ViewScene, ChangeViewSceneParam> TopBarBackParameterDict = new Dictionary<ViewScene, ChangeViewSceneParam>();
public Footer _Footer => null;
public bool IsTouchable => true;
public Camera getCamera() => null;
public GameObject gameObject => null;
public Coroutine StartCoroutine(IEnumerator routine) => null;
public UIBase GetUIBase(ViewScene scene) => null;
public T GetCurrentSceneParam<T>() where T : class => null;
public void ChangeViewScene(ViewScene nextScene, ChangeViewSceneParam param = null, object sceneParam = null) { }
public void Force_Increment_LockCountChangeView() { }
public void Force_Decrement_LockCountChangeView() { }
public ViewScene GetCurrentScene() => ViewScene.Battle;
public bool IsCurrentScene(ViewScene scene) => false;
public UIBase GetUiBaseOfCurrentScene() => null;
public DialogBase CreateDialogClose(bool isSystem = false, bool dontChangeLabelColor = false) => null;
public DialogBase CreateConfirmationDialog(string message) => null;
public void dialogAllClear() { }
public bool isOpenDialog() => false;
public bool isOpenLoading() => false;
public void closeInSceneLoading(bool force = true) { }
public void createInSceneCenterLoading(bool notBlack = false, bool notCollider = false, bool force = true, string overrideText = null) { }
public void closeInSceneCenterLoading(bool force = true, bool disableCollider = false) { }
public LoadingInScene CloseInSceneLoadingMatching() => null;
public LoadingInScene createInSceneLoadingBattle(bool notBlack = false, bool notCollider = false) => null;
public LoadingInScene CloseInSceneLoadingBattle() => null;
public bool isFading() => false;
public bool IsActiveFirstTips() => false;
public VideoHostingHUD GetVideoHostingHUD() => null;
public void setBackScene(GameObject obj, ViewScene backScene) { }
public static void ApplicationQuit() { }
public static void SetObjectToGrey(GameObject o, bool b) { }
public static void ShowDialogUrl(string title, string url, Action<DialogBase> onDialogOpening = null) { }
public class CreatFade { }
public void CreatFadeOpen() { }
public void CreatFadeBlack() { }
public Wizard.RankWinnerReward createRankWinnerReward() => null;
}
public class GameMgr
public class Footer { }
public class VideoHostingHUD { }
namespace Wizard
{
public static GameMgr GetIns() => _ins ??= new GameMgr();
private static GameMgr _ins;
public bool IsAdminWatch => false;
public bool IsWatchBattle => false;
public bool IsReplayBattle => false;
public EffectMgr GetEffectMgr() => _effect ??= new EffectMgr();
private EffectMgr _effect;
// RankWinnerReward, CardDestructTask, CardCreateTask, MissionInfoTask already exist
// in the copied set (declared in other files) -- only these three were missing.
public class MailTopTask { }
public class MyPageTask { }
public class DeckUpdateTask { }
}

View File

@@ -67,11 +67,18 @@ namespace Wizard.Battle.View.Vfx
public class VfxWithLoading : SequentialVfxPlayer
{
public static new VfxWithLoading Create() => new VfxWithLoading();
public virtual VfxBase LoadingVfx => NullVfx.GetInstance();
public virtual VfxBase MainVfx => NullVfx.GetInstance();
}
public class VfxWithLoadingSequential : SequentialVfxPlayer
public class VfxWithLoadingSequential : VfxWithLoading
{
public static new VfxWithLoadingSequential Create() => new VfxWithLoadingSequential();
public override VfxBase LoadingVfx => NullVfx.GetInstance();
public override VfxBase MainVfx => NullVfx.GetInstance();
public void RegisterToLoadingVfx(VfxBase vfxToRegister) { }
public void RegisterToMainVfx(VfxBase vfxToRegister) { }
public void RegisterVfxWithLoading(VfxWithLoading vfxWithLoadingToRegister) { }
}
// Non-generic base (engine references bare `VfxWith` as well as the generics).
@@ -107,8 +114,17 @@ namespace Wizard.Battle.View.Vfx
// when IsForecast; we no-op unconditionally since we never pump the render loop).
public class VfxMgr
{
public virtual bool IsEnd => true;
public string CurrentVfxName => "";
public int CurrentVfxTime => 0;
public void RegisterImmediateVfx<T>(T vfx) where T : VfxBase { }
public void Register<T>(T vfx) where T : VfxBase { }
public virtual void RegisterSequentialVfx<T>(T vfx) where T : VfxBase { }
public Queue<VfxBase> GetSequentialVfxQueues() => new Queue<VfxBase>();
public List<VfxBase> GetVfxList<TType>() => new List<VfxBase>();
public virtual void Update(float dt) { }
public virtual void Cancel() { }
public void Dispose() { }
public void Clear() { }
}
}