Files
SVSimServer/SVSim.BattleEngine/Engine/StoryResultReporter.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

108 lines
3.2 KiB
C#

using System;
using System.Collections.Generic;
using Cute;
using LitJson;
using UnityEngine;
using Wizard;
using Wizard.Lottery;
using Wizard.Story;
public class StoryResultReporter : IBattleResultReporter
{
private readonly GameObject m_reportEndAgentObj;
private readonly StoryReportEndAgent m_reportEndAgent;
public bool IsEnd => m_reportEndAgent.IsEnd;
public int ClassExp => GetClassExp();
public List<UserAchievement> UserAchievement => GetUserAchievementList();
public List<UserMission> UserMission => GetUserMissionList();
public List<ReceivedReward> MissionRewards => GetRewardsList();
public List<ReceivedReward> VictoryRewards => null;
public LotteryApplyData LotteryData => Data.StoryFinish.data.AchievedInfo._lotteryData;
public MyPageHomeDialogData HomeDialogData => null;
public bool IsDataExist => true;
public StoryResultReporter()
{
m_reportEndAgentObj = new GameObject();
m_reportEndAgent = m_reportEndAgentObj.AddComponent<StoryReportEndAgent>();
}
public void Report(bool isWin)
{
StartFinishStory(delegate
{
m_reportEndAgent.Finished();
});
}
public void StartFinishStory(Action callback)
{
SelectedStoryInfo selectedStoryInfo = Data.SelectedStoryInfo;
NetworkManager networkManager = Toolbox.NetworkManager;
BattleManagerBase battleMgr = BattleManagerBase.GetIns();
if (Convert.ToBoolean(battleMgr.isStorySuccessful))
{
selectedStoryInfo.SetPart(ScenarioPart.SecondHalf);
}
int cumulativeEvolutionCount = battleMgr.BattlePlayer._cumulativeEvolutionCount;
int turn = battleMgr.BattlePlayer.Turn;
LocalLog.RecordCheckLog(LocalLog.RecordType.CERBERUS, battleMgr.isStorySuccessful == 1);
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
StoryFinishTask storyFinishTask = new StoryFinishTask(selectedStoryInfo);
storyFinishTask.SetParameter(battleMgr.isStorySuccessful, cumulativeEvolutionCount, turn, dataMgr.IsSelectEmptyDeck() ? (dataMgr.GetPlayerClassId() + 90) : dataMgr.GetSelectDeckId(), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.BuildDeck), dataMgr.GetSelectDeckFormat(), dataMgr.GetPlayerClassId());
selectedStoryInfo.IsFailure = battleMgr.isStorySuccessful == 0;
m_reportEndAgent.StartCoroutine(networkManager.Connect(storyFinishTask, delegate
{
if (battleMgr.isStorySuccessful != 0)
{
StoryNextSceneSelector.SetDeckRentalLoseCount(0);
}
else
{
StoryNextSceneSelector.SetDeckRentalLoseCount(StoryNextSceneSelector.GetDeckRentalLoseCount() + 1);
}
callback.Call();
}, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode));
}
public void Destroy()
{
UnityEngine.Object.Destroy(m_reportEndAgentObj);
}
public JsonData GetFinishResponseData()
{
return Data.StoryFinish.data._responseData;
}
public List<UserAchievement> GetUserAchievementList()
{
return Data.StoryFinish.data.achieved_achievement_list;
}
public List<UserMission> GetUserMissionList()
{
return Data.StoryFinish.data.achieved_mission_list;
}
public List<ReceivedReward> GetRewardsList()
{
return Data.StoryFinish.data.Rewards;
}
public int GetClassExp()
{
return Data.StoryFinish.data.get_class_chara_experience;
}
}