diff --git a/.run/DCGEngine + ContentServer.run.xml b/.run/DCGEngine + ContentServer.run.xml new file mode 100644 index 00000000..2d6b78d4 --- /dev/null +++ b/.run/DCGEngine + ContentServer.run.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SVSim.BattleEngine.Tests/AssemblyAttributes.cs b/SVSim.BattleEngine.Tests/AssemblyAttributes.cs index 0d201510..09adbed7 100644 --- a/SVSim.BattleEngine.Tests/AssemblyAttributes.cs +++ b/SVSim.BattleEngine.Tests/AssemblyAttributes.cs @@ -1,7 +1,7 @@ -// Each engine-state fixture wraps its tests in a TestBattleScope, so AsyncLocal ambient -// isolates per-test state (mgr/GameMgr/IsForecast/IsRandomDraw/RecoveryInfo/etc.). The -// residual process-globals (Unity Resources shim cache, Wizard.LocalLog accumulators) are -// now thread-safe (ConcurrentDictionary / static lock), so fixtures can run in parallel. +// Per-test isolation: after the Phase-5 ambient rip (chunks 38-47), every piece of per-battle +// mutable state lives on the mgr instance itself; there is no shared ambient to leak across +// fixtures. Residual process-globals (Unity Resources shim cache, Wizard.LocalLog accumulators) +// are already thread-safe (ConcurrentDictionary / static lock), so fixtures run in parallel. using NUnit.Framework; [assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/SVSim.BattleEngine.Tests/BattleAmbientTests.cs b/SVSim.BattleEngine.Tests/BattleAmbientTests.cs deleted file mode 100644 index 6c011231..00000000 --- a/SVSim.BattleEngine.Tests/BattleAmbientTests.cs +++ /dev/null @@ -1,246 +0,0 @@ -#nullable enable -using SVSim.BattleEngine.Ambient; -using NUnit.Framework; -using System.Runtime.Serialization; -using System.Threading.Tasks; - -namespace SVSim.BattleEngine.Tests; - -[TestFixture, Parallelizable(ParallelScope.Self)] -public class BattleAmbientTests -{ - [Test] - public void Current_IsNull_WhenNoScope() - { - Assert.That(BattleAmbient.Current, Is.Null); - } - - [Test] - public void Require_Throws_WhenNoScope() - { - Assert.Throws(() => BattleAmbient.Require()); - } - - [Test] - public void Enter_SetsCurrent_RestoresOnDispose() - { - var ctx = new BattleAmbientContext { ViewerId = 42 }; - Assert.That(BattleAmbient.Current, Is.Null); - using (var _ = BattleAmbient.Enter(ctx)) - { - Assert.That(BattleAmbient.Current, Is.SameAs(ctx)); - Assert.That(BattleAmbient.Require().ViewerId, Is.EqualTo(42)); - } - Assert.That(BattleAmbient.Current, Is.Null); - } - - [Test] - public void Enter_Nested_RestoresPriorOnDispose() - { - var outer = new BattleAmbientContext { ViewerId = 1 }; - var inner = new BattleAmbientContext { ViewerId = 2 }; - using (var _o = BattleAmbient.Enter(outer)) - { - Assert.That(BattleAmbient.Current!.ViewerId, Is.EqualTo(1)); - using (var _i = BattleAmbient.Enter(inner)) - { - Assert.That(BattleAmbient.Current!.ViewerId, Is.EqualTo(2)); - } - Assert.That(BattleAmbient.Current!.ViewerId, Is.EqualTo(1)); - } - } - - [Test] - public async Task Enter_FlowsAcrossAwait() - { - var ctx = new BattleAmbientContext { ViewerId = 99 }; - using (var _ = BattleAmbient.Enter(ctx)) - { - await Task.Yield(); - Assert.That(BattleAmbient.Current, Is.SameAs(ctx)); - } - } - - [Test] - public async Task Enter_IsolatedBetweenConcurrentTasks() - { - var ctxA = new BattleAmbientContext { ViewerId = 100 }; - var ctxB = new BattleAmbientContext { ViewerId = 200 }; - - var taskA = Task.Run(async () => { - using var _ = BattleAmbient.Enter(ctxA); - await Task.Delay(20); - return BattleAmbient.Current!.ViewerId; - }); - var taskB = Task.Run(async () => { - using var _ = BattleAmbient.Enter(ctxB); - await Task.Delay(20); - return BattleAmbient.Current!.ViewerId; - }); - - var results = await Task.WhenAll(taskA, taskB); - Assert.That(results[0], Is.EqualTo(100)); - Assert.That(results[1], Is.EqualTo(200)); - } - - [Test] - public void IsForecast_ReadsAmbient_WhenScopeActive() - { - var ctx = new BattleAmbientContext { IsForecast = false }; - using var _ = BattleAmbient.Enter(ctx); - Assert.That(BattleManagerBase.IsForecast, Is.False); - ctx.IsForecast = true; - Assert.That(BattleManagerBase.IsForecast, Is.True); - } - - [Test] - public void IsForecast_WriteInsideScope_WritesAmbient_NotFallback() - { - var ctx = new BattleAmbientContext { IsForecast = false }; - using (var _ = BattleAmbient.Enter(ctx)) - { - BattleManagerBase.IsForecast = true; - Assert.That(ctx.IsForecast, Is.True); - } - } - - [Test] - public void IsForecast_OutsideScope_GetAndSetThrow() - { - // Post-Task-8: fallback is gone. Both get and set go through BattleAmbient.Require(), - // which throws when no scope is active. This is the forcing function — any unwrapped - // engine code that touches IsForecast fails fast instead of silently writing a static. - Assert.That(BattleAmbient.Current, Is.Null); - Assert.Throws(() => { var _ = BattleManagerBase.IsForecast; }); - Assert.Throws(() => BattleManagerBase.IsForecast = true); - } - - [Test] - public void IsRandomDraw_OutsideScope_GetAndSetThrow_InsideScope_Roundtrips() - { - // Post-Task-8: get/set both Require() a scope. Inside a scope, writes land on the ctx. - Assert.That(BattleAmbient.Current, Is.Null); - Assert.Throws(() => { var _ = BattleManagerBase.IsRandomDraw; }); - Assert.Throws(() => BattleManagerBase.IsRandomDraw = true); - - var ctx = new BattleAmbientContext { IsRandomDraw = false }; - using (var _ = BattleAmbient.Enter(ctx)) - { - Assert.That(BattleManagerBase.IsRandomDraw, Is.False); - BattleManagerBase.IsRandomDraw = true; - Assert.That(ctx.IsRandomDraw, Is.True); - } - - // Scope disposed -> back to throwing on access. - Assert.Throws(() => { var _ = BattleManagerBase.IsRandomDraw; }); - } - - [Test] - public void GetIns_ReadsAmbient_WhenScopeActive() - { - var fakeMgr = (BattleManagerBase)System.Runtime.Serialization - .FormatterServices.GetUninitializedObject(typeof(BattleManagerBase)); - var ctx = new BattleAmbientContext { Mgr = fakeMgr }; - using var _ = BattleAmbient.Enter(ctx); - Assert.That(BattleManagerBase.GetIns(), Is.SameAs(fakeMgr)); - } - - [Test] - public void GetIns_OutsideScope_ReturnsNull() - { - // Post-Task-8: fallback is gone. GetIns() reads Current?.Mgr (soft, kept null-tolerant so - // engine call sites that pattern `GetIns()?.Foo ?? default` still compose). With no scope - // active, Current is null, so GetIns() returns null. - Assert.That(BattleAmbient.Current, Is.Null); - Assert.That(BattleManagerBase.GetIns(), Is.Null); - } - - [Test] - public void ViewerId_ReadsAmbient_WhenScopeActive() - { - var ctx = new BattleAmbientContext { ViewerId = 12345 }; - using var _ = BattleAmbient.Enter(ctx); - Assert.That(Cute.Certification.ViewerId, Is.EqualTo(12345)); - } - - [Test] - public void RealTimeNetworkAgent_ReadsAmbient_WhenScopeActive() - { - var ctx = new BattleAmbientContext(); - using var _ = BattleAmbient.Enter(ctx); - Assert.That(Wizard.ToolboxGame.RealTimeNetworkAgent, Is.Null); - var agent = (RealTimeNetworkAgent)System.Runtime.Serialization - .FormatterServices.GetUninitializedObject(typeof(RealTimeNetworkAgent)); - ctx.NetworkAgent = agent; - Assert.That(Wizard.ToolboxGame.RealTimeNetworkAgent, Is.SameAs(agent)); - } - - [Test] - public void SetRealTimeNetworkBattle_InsideScope_WritesAmbient() - { - var ctx = new BattleAmbientContext(); - using var _ = BattleAmbient.Enter(ctx); - var agent = (RealTimeNetworkAgent)System.Runtime.Serialization - .FormatterServices.GetUninitializedObject(typeof(RealTimeNetworkAgent)); - Wizard.ToolboxGame.SetRealTimeNetworkBattle(agent); - Assert.That(ctx.NetworkAgent, Is.SameAs(agent)); - } - - [Test] - public void BattleRecoveryInfo_ReadsAmbient_WhenScopeActive() - { - var info = (Wizard.BattleRecoveryInfo)System.Runtime.Serialization - .FormatterServices.GetUninitializedObject(typeof(Wizard.BattleRecoveryInfo)); - var ctx = new BattleAmbientContext { RecoveryInfo = info }; - using var _ = BattleAmbient.Enter(ctx); - Assert.That(Wizard.Data.BattleRecoveryInfo, Is.SameAs(info)); - } - - [Test] - public void BattleRecoveryInfo_SetInsideScope_WritesAmbient() - { - var ctx = new BattleAmbientContext(); - using var _ = BattleAmbient.Enter(ctx); - var info = (Wizard.BattleRecoveryInfo)System.Runtime.Serialization - .FormatterServices.GetUninitializedObject(typeof(Wizard.BattleRecoveryInfo)); - Wizard.Data.BattleRecoveryInfo = info; - Assert.That(ctx.RecoveryInfo, Is.SameAs(info)); - } - - [Test] - public void GameMgr_GetIns_InsideScope_ReturnsScopeInstance() - { - var mgr = new GameMgr(); - var ctx = new BattleAmbientContext { GameMgr = mgr }; - using var _ = BattleAmbient.Enter(ctx); - Assert.That(GameMgr.GetIns(), Is.SameAs(mgr)); - } - - [Test] - public void GameMgr_GetIns_OutsideScope_Throws() - { - Assert.That(BattleAmbient.Current, Is.Null); - Assert.Throws(() => GameMgr.GetIns()); - } - - [Test] - public async Task GameMgr_GetIns_IsolatedBetweenConcurrentTasks() - { - var mgrA = new GameMgr(); - var mgrB = new GameMgr(); - - var taskA = Task.Run(async () => { - using var _ = BattleAmbient.Enter(new BattleAmbientContext { GameMgr = mgrA }); - await Task.Delay(20); - return GameMgr.GetIns(); - }); - var taskB = Task.Run(async () => { - using var _ = BattleAmbient.Enter(new BattleAmbientContext { GameMgr = mgrB }); - await Task.Delay(20); - return GameMgr.GetIns(); - }); - var results = await Task.WhenAll(taskA, taskB); - Assert.That(results[0], Is.SameAs(mgrA)); - Assert.That(results[1], Is.SameAs(mgrB)); - } -} diff --git a/SVSim.BattleEngine.Tests/BuffFollowerOracleTests.cs b/SVSim.BattleEngine.Tests/BuffFollowerOracleTests.cs index 830fb388..2d6b879b 100644 --- a/SVSim.BattleEngine.Tests/BuffFollowerOracleTests.cs +++ b/SVSim.BattleEngine.Tests/BuffFollowerOracleTests.cs @@ -14,10 +14,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class BuffFollowerOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -32,8 +30,7 @@ namespace SVSim.BattleEngine.Tests public void Self_buff_fanfare_raises_own_atk_and_life() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/ConstructionProbeTests.cs b/SVSim.BattleEngine.Tests/ConstructionProbeTests.cs index 41521f40..43b93b8e 100644 --- a/SVSim.BattleEngine.Tests/ConstructionProbeTests.cs +++ b/SVSim.BattleEngine.Tests/ConstructionProbeTests.cs @@ -14,10 +14,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class ConstructionProbeTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); [Test] public void SingleBattleMgr_constructs_headless() @@ -30,7 +28,7 @@ namespace SVSim.BattleEngine.Tests SingleBattleMgr mgr = null; try { - mgr = new SingleBattleMgr(new HeadlessContentsCreator()); + mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); } catch (Exception ex) { @@ -42,7 +40,6 @@ namespace SVSim.BattleEngine.Tests Assert.That(mgr, Is.Not.Null); Assert.That(mgr.BattlePlayer, Is.Not.Null, "BattlePlayer (self) not created"); Assert.That(mgr.BattleEnemy, Is.Not.Null, "BattleEnemy (opponent) not created"); - _scope.Ctx.Mgr = mgr; } } } diff --git a/SVSim.BattleEngine.Tests/Coverage/CleanupRegressionTests.cs b/SVSim.BattleEngine.Tests/Coverage/CleanupRegressionTests.cs new file mode 100644 index 00000000..3c164583 --- /dev/null +++ b/SVSim.BattleEngine.Tests/Coverage/CleanupRegressionTests.cs @@ -0,0 +1,43 @@ +extern alias engine; +using NUnit.Framework; +using System.Reflection; + +namespace SVSim.BattleEngine.Tests.Coverage; + +/// Regression backstop for the engine shim cleanup. Asserts every type we +/// deleted in Tasks 9-15 of docs/superpowers/plans/2026-06-27-engine-shim-cleanup.md +/// stays deleted. If a rebase or merge accidentally re-introduces one, this test +/// fails loudly. +[TestFixture] +public class CleanupRegressionTests +{ + private static readonly string[] DeletedFqns = new[] + { + // Task 9 — DEAD-ORPHAN sweep (commit 119bf77) + "Wizard.AIBarrierGlobal", + + // Task 10 — *Vfx.cs sweep (commit 3235f47) + "Wizard.Battle.Player.ClassCharacter.SkinEffectVfx", + "Wizard.Battle.Player.Emotion.Debug722006NullVfx", + + // Task 12 — *Page.cs sweep (commit b3e2df2) + "Wizard.Bingo.BingoPage", + "Wizard.Lottery.LotteryPage", + "Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase.BuildDeckPurchasePage", + "Wizard.StorySelectPage", + + // Task 13 — *Window.cs sweep (commit 92b6bf6) + "Wizard.CardSleeveDetailWindow", + "Wizard.ClassSkinDetailWindow", + "Wizard.OptionSettingWindow", + "Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase.BuildDeckDetailWindow", + }; + + [TestCaseSource(nameof(DeletedFqns))] + public void DeletedType_StaysDeleted(string fqn) + { + var asm = typeof(engine::BattleManagerBase).Assembly; + Assert.That(asm.GetType(fqn), Is.Null, + $"Type {fqn} was deleted in the engine shim cleanup (see plan Tasks 9-15) and must not be re-introduced."); + } +} diff --git a/SVSim.BattleEngine.Tests/Coverage/CoverageRecorder.cs b/SVSim.BattleEngine.Tests/Coverage/CoverageRecorder.cs new file mode 100644 index 00000000..90a06a5e --- /dev/null +++ b/SVSim.BattleEngine.Tests/Coverage/CoverageRecorder.cs @@ -0,0 +1,72 @@ +extern alias engine; +using System.Collections.Concurrent; +using System.IO; +using System.Linq; +using System.Reflection; +using HarmonyLib; + +namespace SVSim.BattleEngine.Tests.Coverage; + +/// Harmony-prefix-based method-invocation logger over SVSim.BattleEngine.dll. +/// Idempotent: Install is safe to call from every fixture's [OneTimeSetUp]; only the first +/// call patches. +public static class CoverageRecorder +{ + private static readonly ConcurrentDictionary _hit = new(); + private static readonly Harmony _h = new("svsim.engine.coverage"); + private static bool _installed; + private static readonly object _gate = new(); + + public static int HitCount => _hit.Count; + + public static void Reset() => _hit.Clear(); + + public static void Install() + { + lock (_gate) + { + if (_installed) return; + _installed = true; + } + + var asm = typeof(engine::BattleManagerBase).Assembly; + var prefix = AccessTools.Method(typeof(CoverageRecorder), nameof(Hit)); + var hm = new HarmonyMethod(prefix); + + foreach (var t in asm.GetTypes()) + { + var ns = t.FullName ?? string.Empty; + // Only engine + shim types — skip framework/3rd-party that happens to be co-located. + if (!ns.StartsWith("SVSim.BattleEngine.") && + !ns.StartsWith("Wizard.") && + !ns.StartsWith("Cute.") && + !ns.StartsWith("Toolbox.") && + !ns.StartsWith("UnityEngine.")) continue; + if (t.IsGenericTypeDefinition) continue; + + var members = t.GetMethods(BindingFlags.Instance | BindingFlags.Static | + BindingFlags.Public | BindingFlags.NonPublic | + BindingFlags.DeclaredOnly); + foreach (var m in members) + { + if (m.IsAbstract) continue; + if (m.ContainsGenericParameters) continue; + if (m.GetMethodBody() is null) continue; + try { _h.Patch(m, prefix: hm); } catch { /* generic/inlined; skipped */ } + } + } + } + + public static void Dump(string path) + { + Directory.CreateDirectory(Path.GetDirectoryName(path)!); + File.WriteAllLines(path, _hit.Keys.OrderBy(k => k)); + } + + private static void Hit(MethodBase __originalMethod) + { + var t = __originalMethod.DeclaringType; + if (t is null) return; + _hit.TryAdd($"{t.FullName}.{__originalMethod.Name}", 0); + } +} diff --git a/SVSim.BattleEngine.Tests/Coverage/CoverageRecorderTests.cs b/SVSim.BattleEngine.Tests/Coverage/CoverageRecorderTests.cs new file mode 100644 index 00000000..8176d066 --- /dev/null +++ b/SVSim.BattleEngine.Tests/Coverage/CoverageRecorderTests.cs @@ -0,0 +1,42 @@ +extern alias engine; +using System.IO; +using System.Linq; +using NUnit.Framework; +using SVSim.BattleEngine.Tests.Coverage; + +namespace SVSim.BattleEngine.Tests.Coverage; + +[TestFixture, NonParallelizable] +public class CoverageRecorderTests +{ + [SetUp] public void SetUp() => CoverageRecorder.Reset(); + + [Test] + public void Install_RecordsAtLeastOneHit_AfterCallingAnEngineType() + { + CoverageRecorder.Install(); + // Phase-5 chunk 47: was `BattleAmbient.Current` (deleted). Call any engine-type method + // with a body so the Harmony prefix records a hit; Certification.ViewerId's getter is a + // small non-inlined engine method that still ships (façade retained; consumers all read + // per-mgr now). + var _ = engine::Cute.Certification.ViewerId; + Assert.That(CoverageRecorder.HitCount, Is.GreaterThan(0)); + } + + [Test] + public void Dump_WritesSortedFqns_OneLineEach() + { + CoverageRecorder.Install(); + // Phase-5 chunk 47: was `BattleAmbient.Current` (deleted). Call any engine-type method + // with a body so the Harmony prefix records a hit; Certification.ViewerId's getter is a + // small non-inlined engine method that still ships (façade retained; consumers all read + // per-mgr now). + var _ = engine::Cute.Certification.ViewerId; + var path = Path.Combine(Path.GetTempPath(), "coverage-recorder-test.txt"); + CoverageRecorder.Dump(path); + var lines = File.ReadAllLines(path).ToList(); + Assert.That(lines, Is.Not.Empty); + Assert.That(lines, Is.Ordered); + Assert.That(lines.All(l => l.Contains(".")), Is.True); + } +} diff --git a/SVSim.BattleEngine.Tests/Coverage/CoverageSetUpFixture.cs b/SVSim.BattleEngine.Tests/Coverage/CoverageSetUpFixture.cs new file mode 100644 index 00000000..e6e98603 --- /dev/null +++ b/SVSim.BattleEngine.Tests/Coverage/CoverageSetUpFixture.cs @@ -0,0 +1,37 @@ +using System; +using System.IO; +using NUnit.Framework; +using SVSim.BattleEngine.Tests.Coverage; + +namespace SVSim.BattleEngine.Tests; + +/// Assembly-level NUnit fixture. When SVSIM_COVERAGE=1, installs +/// CoverageRecorder before any test runs and dumps the recorded FQNs after +/// the assembly finishes. Outside SVSIM_COVERAGE=1, this fixture is a no-op +/// — production test runs are unaffected. +[SetUpFixture] +public class CoverageSetUpFixture +{ + public static bool IsEnabled => + Environment.GetEnvironmentVariable("SVSIM_COVERAGE") == "1"; + + public static string DumpPath => + Path.Combine(TestContext.CurrentContext.TestDirectory, + "..", "..", "..", "obj", "coverage", + "SVSim.BattleEngine.Tests.live.txt"); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + if (!IsEnabled) return; + CoverageRecorder.Install(); + } + + [OneTimeTearDown] + public void OneTimeTearDown() + { + if (!IsEnabled) return; + CoverageRecorder.Dump(DumpPath); + TestContext.Progress.WriteLine($"[coverage] dumped {CoverageRecorder.HitCount} FQNs to {DumpPath}"); + } +} diff --git a/SVSim.BattleEngine.Tests/Coverage/CoverageSetUpFixtureTests.cs b/SVSim.BattleEngine.Tests/Coverage/CoverageSetUpFixtureTests.cs new file mode 100644 index 00000000..82432b7c --- /dev/null +++ b/SVSim.BattleEngine.Tests/Coverage/CoverageSetUpFixtureTests.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using SVSim.BattleEngine.Tests; + +namespace SVSim.BattleEngine.Tests.Coverage; + +[TestFixture] +public class CoverageSetUpFixtureTests +{ + [Test] + public void DumpPath_IsObjCoverageBattleEngineLiveTxt() + { + Assert.That( + CoverageSetUpFixture.DumpPath, + Does.EndWith("obj/coverage/SVSim.BattleEngine.Tests.live.txt") + .Or.EndWith(@"obj\coverage\SVSim.BattleEngine.Tests.live.txt")); + } + + [Test] + public void IsEnabled_ReflectsEnvVar() + { + var prior = System.Environment.GetEnvironmentVariable("SVSIM_COVERAGE"); + try + { + System.Environment.SetEnvironmentVariable("SVSIM_COVERAGE", "1"); + Assert.That(CoverageSetUpFixture.IsEnabled, Is.True); + System.Environment.SetEnvironmentVariable("SVSIM_COVERAGE", null); + Assert.That(CoverageSetUpFixture.IsEnabled, Is.False); + } + finally + { + System.Environment.SetEnvironmentVariable("SVSIM_COVERAGE", prior); + } + } +} diff --git a/SVSim.BattleEngine.Tests/DrawSpellOracleTests.cs b/SVSim.BattleEngine.Tests/DrawSpellOracleTests.cs index bafa87d7..a737480c 100644 --- a/SVSim.BattleEngine.Tests/DrawSpellOracleTests.cs +++ b/SVSim.BattleEngine.Tests/DrawSpellOracleTests.cs @@ -21,10 +21,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class DrawSpellOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -39,8 +37,7 @@ namespace SVSim.BattleEngine.Tests public void Draw_spell_moves_the_seeded_deck_card_into_hand() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/DynamicValueSpellOracleTests.cs b/SVSim.BattleEngine.Tests/DynamicValueSpellOracleTests.cs index c00c641f..3b35bdb1 100644 --- a/SVSim.BattleEngine.Tests/DynamicValueSpellOracleTests.cs +++ b/SVSim.BattleEngine.Tests/DynamicValueSpellOracleTests.cs @@ -33,10 +33,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class DynamicValueSpellOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -51,8 +49,7 @@ namespace SVSim.BattleEngine.Tests public void Dynamic_damage_spell_deals_engine_computed_play_count_value() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs b/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs index 9b6378fc..6ac2425a 100644 --- a/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs +++ b/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs @@ -12,10 +12,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class EmitPathReadOracleTests : NetworkEmitFixtureBase { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); // The process-global reset (IsForecast=true + clear injected agent) now lives in the shared // NetworkEmitFixtureBase.ResetNetworkEmitGlobals [TearDown], inherited here — see that file @@ -25,7 +23,6 @@ namespace SVSim.BattleEngine.Tests public void M3_spell_driven_via_OperateMgr_reaches_emit_without_crashing() { var (mgr, emitted) = HeadlessEngineEnv.NewNetworkEmitBattle(); - _scope.Ctx.Mgr = mgr; var player = mgr.BattlePlayer; var enemy = mgr.BattleEnemy; @@ -58,7 +55,7 @@ namespace SVSim.BattleEngine.Tests // the flow reaches stockEmitMessageMgr.StockData(info); read it back. If the stock machinery is // not drivable headless this milestone, this assertion is DEFERRED to structural validation // (spec §6) — the OnEmit + no-throw + state checks above are the decisive O1 read on their own. - var agent = Wizard.ToolboxGame.RealTimeNetworkAgent; + var agent = mgr.InstanceNetworkAgent; // Phase-5 chunk 41: was Wizard.ToolboxGame.RealTimeNetworkAgent var stocked = HeadlessEngineEnv.TryReadStockedEmitData(agent); // returns null if unreachable if (stocked != null) Assert.That(stocked, Is.Not.Empty, "the emitted dict should be stocked non-empty"); diff --git a/SVSim.BattleEngine.Tests/FixedDamageSpellOracleTests.cs b/SVSim.BattleEngine.Tests/FixedDamageSpellOracleTests.cs index 8af41965..364d37d9 100644 --- a/SVSim.BattleEngine.Tests/FixedDamageSpellOracleTests.cs +++ b/SVSim.BattleEngine.Tests/FixedDamageSpellOracleTests.cs @@ -14,10 +14,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class FixedDamageSpellOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); // The spell's sole skill is `damage=3` to the enemy leader (cards.json skill_option for 900124030). private const int ExpectedLeaderDamage = 3; @@ -35,8 +33,7 @@ namespace SVSim.BattleEngine.Tests public void Fixed_damage_spell_reduces_opponent_leader_life() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/GatedConditionalOracleTests.cs b/SVSim.BattleEngine.Tests/GatedConditionalOracleTests.cs index abce40a1..c866c576 100644 --- a/SVSim.BattleEngine.Tests/GatedConditionalOracleTests.cs +++ b/SVSim.BattleEngine.Tests/GatedConditionalOracleTests.cs @@ -39,10 +39,8 @@ namespace SVSim.BattleEngine.Tests // FALSE branch, exactly as M4's load-bearing probe did when it removed its seed. private const int GateFalseSeed = 0; - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -63,8 +61,7 @@ namespace SVSim.BattleEngine.Tests PlayGatedSelfBuff(int seededPlayCount) { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; // route GetIns() to this branch's mgr + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/HeadlessFixture.cs b/SVSim.BattleEngine.Tests/HeadlessFixture.cs index 1309baa6..abbee78f 100644 --- a/SVSim.BattleEngine.Tests/HeadlessFixture.cs +++ b/SVSim.BattleEngine.Tests/HeadlessFixture.cs @@ -175,10 +175,11 @@ namespace SVSim.BattleEngine.Tests private static readonly object _processGlobalsGate = new object(); // Process-globals only: load card master, install master data, seed LoadDetail/Crossover, - // seed Certification.udid. Per-battle/per-test state (IsForecast, chara ids on the DataMgr, - // NetworkUserInfoData) is now seeded inside TestBattleScope's ctor against the per-scope - // GameMgr — calling it here would crash because GameMgr.GetIns() Requires an ambient scope. - // Thread-safe (assembly-level Parallelizable(Fixtures) means many fixtures' [SetUp] race here). + // seed Certification.udid. Per-battle/per-test state (chara ids on the DataMgr, + // NetworkUserInfoData) is seeded on the mgr's own GameMgr via NewSeededSingleBattleMgr / + // NewSeededHeadlessBattleMgr / NewSeededHeadlessNetworkBattleMgr in the fixture entry points + // — no shared state to race here. Thread-safe (assembly-level Parallelizable(Fixtures) means + // many fixtures' [SetUp] race this one function). public static void EnsureProcessGlobals() { if (_done) return; @@ -233,39 +234,57 @@ namespace SVSim.BattleEngine.Tests return deck; } - // Per-ambient seeder: writes the player/enemy chara ids onto the AMBIENT GameMgr's DataMgr. - // Called by TestBattleScope after the scope is entered so GameMgr.GetIns() routes to the - // per-test GameMgr, not whichever one happened to be ambient last. - public static void SeedCharaIdsOnCurrentAmbient() + // Per-GameMgr chara-id seeder. Fixtures construct a GameMgr up-front and pass it to the + // mgr ctor (chunk-45 overload); this stamps the player/enemy leader chara ids on its DataMgr. + // Set the backing fields directly: the public SetPlayerCharaId() also pulls MyRotation / + // AvatarBattle info (more null statics) the resolution path doesn't need. + public static void SeedCharaIds(GameMgr gm) { - // Player/enemy leaders (chara ids must map to a ClassCharacterMasterData in Master). - // Set the backing fields directly: the public SetPlayerCharaId() also pulls MyRotation/ - // AvatarBattle info (more null statics) which the resolution path doesn't need (the - // TryGet* accessors are null-tolerant). - var dm = GameMgr.GetIns().GetDataMgr(); + var dm = gm.GetDataMgr(); SetField(dm, "_playerCharaId", HeadlessMasterData.PlayerCharaId); SetField(dm, "_enemyCharaId", HeadlessMasterData.EnemyCharaId); } - // Per-ambient seeder: installs a no-op NetworkUserInfoData on the AMBIENT GameMgr so - // NetworkBattleManagerBase.CreateBackgroundId()'s GetNetworkUserInfoData().GetFieldId() call - // resolves (M13). Field id 1 == ForestField, a valid background. - public static void SeedNetUserOnCurrentAmbient() + // Per-GameMgr net-user seeder. NetworkBattleManagerBase.CreateBackgroundId reads + // gm.GetNetworkUserInfoData().GetFieldId() when the RecoveryManager yields no bg id; the bare + // ctor path leaves _netUser null (no lazy init). Seed a no-op instance whose _selfInfo carries + // fieldId=1 (== ForestField, valid). Only satisfies the bg lookup — no game-state effect. + public static void SeedNetUser(GameMgr gm) { - // NetworkBattleManagerBase.CreateBackgroundId() (M13) reads - // GameMgr.GetIns().GetNetworkUserInfoData().GetFieldId() when the RecoveryManager yields no - // bg id (NullRecoveryManager.BackGroundId == -1). In production RealTimeNetworkAgent seeds - // this NetworkUserInfoData at match start; the bare construction path leaves GameMgr's - // _netUser null (no lazy init, unlike the other GodObject getters). Seed a no-op instance - // whose _selfInfo carries just "fieldId" (GetFieldId reads _selfInfo["fieldId"]); field id 1 - // == ForestField, a valid background. Nothing here drives game state — it only satisfies the - // network mgr's background lookup, a background lookup the single-battle path - // (`SingleBattleMgr`) never performs. var netUser = new NetworkUserInfoData(); netUser.SetSelfInfo( new System.Collections.Generic.Dictionary { ["fieldId"] = 1 }, isWatchReplayRecovery: false); - GameMgr.GetIns().SetNetworkUserInfoData(netUser); + gm.SetNetworkUserInfoData(netUser); + } + + // Phase-5 chunk 46: canonical seeded SingleBattleMgr factory. Replaces the historical + // `new SingleBattleMgr(new HeadlessContentsCreator())` pattern from every oracle test, + // which relied on the ambient bridge to reach a chara-id/net-user-seeded GameMgr. Now the + // GameMgr is built + seeded here and passed to the mgr's chunk-45 ctor overload directly. + public static SingleBattleMgr NewSeededSingleBattleMgr() + { + var gm = new GameMgr(); + SeedCharaIds(gm); + SeedNetUser(gm); + return new SingleBattleMgr(new HeadlessContentsCreator(), gm); + } + + // Same idea for the RNG-injectable HeadlessBattleMgr / HeadlessNetworkBattleMgr twins. + public static HeadlessBattleMgr NewSeededHeadlessBattleMgr(IRandomSource rng = null) + { + var gm = new GameMgr(); + SeedCharaIds(gm); + SeedNetUser(gm); + return new HeadlessBattleMgr(new HeadlessContentsCreator(), rng, gm); + } + + public static HeadlessNetworkBattleMgr NewSeededHeadlessNetworkBattleMgr(IRandomSource rng = null) + { + var gm = new GameMgr(); + SeedCharaIds(gm); + SeedNetUser(gm); + return new HeadlessNetworkBattleMgr(new HeadlessContentsCreator(), rng, gm); } // Seed each leader's starting life on a freshly-constructed mgr. The engine does this in @@ -376,8 +395,16 @@ namespace SVSim.BattleEngine.Tests public static HeadlessBattleMgr NewAuthoritativeBattle(IRandomSource rng) { EnsureProcessGlobals(); // sets IsForecast = true among other globals - BattleManagerBase.IsRandomDraw = true; // the second RNG gate (F-RNG-2) - var mgr = new HeadlessBattleMgr(new HeadlessContentsCreator(), rng); + // Phase-5 chunk 45: build a pre-seeded GameMgr and hand it to the mgr ctor, bypassing + // the ambient bridge. The base ctor's BattlePlayer construction reads chara-id/net-user + // through GameMgr.GetIns() (which routes to mgr.GameMgr once base ctor runs), so the + // GameMgr must be seeded BEFORE the mgr ctor completes. + var gm = new GameMgr(); + SeedCharaIds(gm); + SeedNetUser(gm); + var mgr = new HeadlessBattleMgr(new HeadlessContentsCreator(), rng, gm); + // Phase-5 chunk 42: write InstanceIsRandomDraw directly (mgr not yet ambient-attached). + mgr.InstanceIsRandomDraw = true; // the second RNG gate (F-RNG-2) mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; @@ -401,7 +428,11 @@ namespace SVSim.BattleEngine.Tests NewNetworkEmitBattle(IRandomSource rng = null) { EnsureProcessGlobals(); // sets IsForecast = true among other globals - var mgr = new HeadlessNetworkBattleMgr(new HeadlessContentsCreator(), rng); + // Phase-5 chunk 45: build + seed a per-mgr GameMgr up-front (no ambient bridge). + var gm = new GameMgr(); + SeedCharaIds(gm); + SeedNetUser(gm); + var mgr = new HeadlessNetworkBattleMgr(new HeadlessContentsCreator(), rng, gm); // NOTE: IsRecovery is left FALSE here (unlike the solo NewAuthoritativeBattle). The network // emit path is gated on !IsRecovery in BOTH places: NetworkStandardBattleMgr.SendPlayCard // (NetworkStandardBattleMgr.cs:155) and the OnSetCardComplete->SendPlayCard subscription in @@ -419,7 +450,10 @@ namespace SVSim.BattleEngine.Tests // play exercises the real view layer — those view touches are satisfied by the no-op view shims // (InitCardTemplates, the HandView/DetailPanel fills below). M3's damage is literal, immune to // any play-count bump the OperateMgr path adds vs the direct path. - BattleManagerBase.IsForecast = false; + // Phase-5 chunk 42: mgr isn't yet attached to the ambient at this point (_scope.Ctx.Mgr + // is set by the caller after this fixture returns), so BattleManagerBase.IsForecast=false + // would silently no-op (ambient bridge is gone). Write InstanceIsForecast directly. + mgr.InstanceIsForecast = false; var player = mgr.BattlePlayer; var enemy = mgr.BattleEnemy; SetField(player, "_opponentBattlePlayer", enemy); @@ -447,28 +481,17 @@ namespace SVSim.BattleEngine.Tests // public setter runs cleanly headless. Prepared (50) is the real enum member (RealTimeNetworkAgent.cs:35). agent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.Prepared); - // EmitMsgPack -> AddActionSequence (RealTimeNetworkAgent.cs:1773, fired for the PlayActions URI) - // does `_gungnir._actionSequenceNum++` and `NetworkLogger.LogInfo(...)`. On the - // GetUninitializedObject agent both are null (the real ctor builds them at :289/:301). Seed an - // uninitialized Gungnir (its ctor news a ConnectionReporter + Ticks — unneeded; AddActionSequence - // only touches the int counter) and the engine's own NetworkNullLogger no-op so the action-seq - // bookkeeping runs without crashing. Neither drives game state. - SetField(agent, "_gungnir", - System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(Gungnir))); + // The engine RTA is a pass-7 stub with no-op method bodies. AddActionSequence / + // EmitMsgPack / OnEmit-plumbing were dropped; the historical Gungnir + _notEmit seeds + // are no longer needed. NetworkLogger stays as a NetworkNullLogger since it's a + // typed property (INetworkLogger) that some tests may still inspect. SetProperty(agent, "NetworkLogger", new NetworkNullLogger()); - // Suppress the actual socket transmission. After OnEmit fires (RealTimeNetworkAgent.cs:1270, the - // O1 liveness signal), EmitMsgPack -> EmitMsgUriPack reaches the stockEmitMessageMgr / _manager.Socket - // network I/O (RealTimeNetworkAgent.cs:1444+/1487) — none of which exists headless. The engine's - // OWN _notEmit flag (set in recovery/replay) short-circuits EmitMsgUriPack at :1438 BEFORE any of - // that, so the emit stays genuine (OnEmit already fired through the real send path) while the - // byte-push is skipped. This is the only honest way to terminate the path headless: we are NOT - // faking OnEmit, only declining to open a socket we cannot open. - SetField(agent, "_notEmit", true); - var emitted = new System.Collections.Generic.List(); agent.OnEmit += uri => emitted.Add(uri); - Wizard.ToolboxGame.SetRealTimeNetworkBattle(agent); + // Phase-5 chunk 40: ambient fallback removed from ToolboxGame.SetRealTimeNetworkBattle; + // fixture has mgr in scope, so seed it directly instead of via the ambient-routed static. + mgr.InstanceNetworkAgent = agent; return (mgr, emitted); } diff --git a/SVSim.BattleEngine.Tests/LethalDamageSpellOracleTests.cs b/SVSim.BattleEngine.Tests/LethalDamageSpellOracleTests.cs index 17f5d35b..6e9d9503 100644 --- a/SVSim.BattleEngine.Tests/LethalDamageSpellOracleTests.cs +++ b/SVSim.BattleEngine.Tests/LethalDamageSpellOracleTests.cs @@ -26,10 +26,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class LethalDamageSpellOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -44,8 +42,7 @@ namespace SVSim.BattleEngine.Tests public void Lethal_damage_spell_kills_the_selected_follower_and_chips_the_survivor() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/MultiInstanceEngineTests.cs b/SVSim.BattleEngine.Tests/MultiInstanceEngineTests.cs index 62b55c34..373c3bb5 100644 --- a/SVSim.BattleEngine.Tests/MultiInstanceEngineTests.cs +++ b/SVSim.BattleEngine.Tests/MultiInstanceEngineTests.cs @@ -2,18 +2,18 @@ using System.Linq; using System.Threading.Tasks; using NUnit.Framework; -using SVSim.BattleEngine.Ambient; using SVSim.BattleNode.Sessions.Engine; namespace SVSim.BattleEngine.Tests; -/// The forcing-function tests for the multi-instancing migration (Task 8). Each engine -/// instance carries its OWN internally (SessionBattleEngine -/// constructs a per-session ctx in its field initializer and enters it on every Setup/Receive/ -/// read), so two engines on two tasks must resolve independently — no shared "current mgr", -/// "current GameMgr", or "current viewer id" state. The stress test pins -/// parallel-equals-sequential to catch any residual contamination (which would manifest as a -/// life/PP/hand-count mismatch between the parallel and sequential runs). +/// Forcing-function tests for the multi-instancing migration. After the chunk-46/47 +/// ambient rip, per-battle mutable state (IsForecast/IsRandomDraw/RecoveryInfo/ViewerId/ +/// NetworkAgent + GameMgr) lives on the mgr instance itself; there is no ambient at all, +/// no "current mgr / current GameMgr" static gate. Two engines on two tasks resolve +/// independently because their mgrs are different objects, full stop — this fixture pins +/// parallel-equals-sequential to catch any residual contamination through the not-yet-culled +/// static accumulators (Wizard.LocalLog trace SB, Unity Resources cache — both already +/// thread-safe). [TestFixture, Parallelizable(ParallelScope.All)] public class MultiInstanceEngineTests { @@ -34,13 +34,9 @@ public class MultiInstanceEngineTests var taskB = Task.Run(() => DriveBasicTurns(engineB)); await Task.WhenAll(taskA, taskB); - // Pin the engines' post-Setup state to concrete starting values: LeaderLife=20 (InitLeaderLife's - // DefaultLeaderLife, applied by SessionBattleEngine.Setup), Pp=0 (pre-first-turn, no PP refill - // has run), HandCount=0 (Setup builds the deck/leader graph but doesn't deal an opening hand — - // mulligan/draw happens once a turn-start phase runs, which DriveBasicTurns doesn't trigger). - // Both engines must report the SAME starting state regardless of distinct masterSeeds, which is - // the cross-contamination property under test: ambient isolation means neither engine's reads - // can leak into the other's seat lookups. + // Pin the engines' post-Setup state to concrete starting values. Both engines must + // report the SAME starting state regardless of distinct masterSeeds, which is the + // cross-contamination property under test. Assert.That(engineA.LeaderLife(true), Is.EqualTo(20)); Assert.That(engineB.LeaderLife(true), Is.EqualTo(20)); Assert.That(engineA.Pp(true), Is.EqualTo(0)); @@ -56,13 +52,6 @@ public class MultiInstanceEngineTests for (int i = 0; i < n; i++) inputs[i] = (1000 + i, HeadlessEngineEnv.SampleDeck(), HeadlessEngineEnv.SampleDeck()); - // Setup AND Drive both parallelize: the residual decomp-origin static accumulators - // (Wizard.LocalLog._lastTraceLogStringBuilder etc.) and the Unity Resources shim - // cache are now thread-safe (static lock / ConcurrentDictionary), so two engines - // constructing in parallel no longer corrupts shared scratch state. The full - // construct-then-read pipeline runs concurrently per task and the result still - // pins to the sequential baseline — that is the cross-contamination property - // under test (ambient isolation + safe shared statics). var parallel = await Task.WhenAll(inputs.Select(input => Task.Run(() => { var e = new SessionBattleEngine(); @@ -84,10 +73,12 @@ public class MultiInstanceEngineTests } [Test] - public void GameMgr_GetIns_WithoutScope_Throws() + public void BattleManagerBase_GetIns_Always_Null() { - Assert.That(BattleAmbient.Current, Is.Null); - Assert.Throws(() => GameMgr.GetIns()); + // Post-chunk-46 ambient rip: GetIns() has no scope-based mechanism; every engine consumer + // was converted to per-mgr instance reads, and the residual static returns null so its + // ?. cascade landing in the 3 façades / IsForecast+IsRandomDraw returns their defaults. + Assert.That(BattleManagerBase.GetIns(), Is.Null); } private static void DriveBasicTurns(SessionBattleEngine e) diff --git a/SVSim.BattleEngine.Tests/NetworkEmitFixtureBase.cs b/SVSim.BattleEngine.Tests/NetworkEmitFixtureBase.cs index 4efbb35a..e105582e 100644 --- a/SVSim.BattleEngine.Tests/NetworkEmitFixtureBase.cs +++ b/SVSim.BattleEngine.Tests/NetworkEmitFixtureBase.cs @@ -3,16 +3,17 @@ namespace SVSim.BattleEngine.Tests // Shared base for every network-emit test fixture (M13 EmitPathReadOracleTests, the // construction-probe's OnEmit seam test, and any M14+ network fixture to come). // - // POST-TASK-8 (multi-instancing migration): now empty. The historical hygiene gap this class - // closed (HeadlessEngineEnv.NewNetworkEmitBattle leaving IsForecast=false + a stray injected - // agent visible to a later solo fixture) was a PROCESS-GLOBAL leak via the now-deleted + // Post-Phase-5a: still empty. The historical hygiene gap this class closed + // (HeadlessEngineEnv.NewNetworkEmitBattle leaving IsForecast=false + a stray injected agent + // visible to a later solo fixture) was a PROCESS-GLOBAL leak via the long-deleted // BattleManagerBase._isForecastFallback + ToolboxGame._realTimeNetworkAgentFallback statics. - // Both fields are gone: IsForecast/RealTimeNetworkAgent live on the per-test ambient context - // (TestBattleScope's BattleAmbientContext), so scope Dispose drops them. A later fixture's - // new TestBattleScope starts a fresh ctx with IsForecast=true and a null NetworkAgent by - // default — exactly the EnsureInitialized invariant the old TearDown manually restored. + // As of Phase 5a IsForecast/RealTimeNetworkAgent live on the mgr instance (authoritative) + // with the per-test BattleAmbientContext as bridge fallback: scope Dispose drops the ctx and + // the next fixture's new TestBattleScope starts a fresh ctx with IsForecast=true and a null + // NetworkAgent — exactly the EnsureInitialized invariant the old TearDown restored. // - // Kept as a marker base class so derived fixtures don't churn; can be deleted in Task 9. + // Kept as a marker base class so derived fixtures don't churn; deleteable once every + // fixture stops touching the ambient (Phase 5b + ambient rip). public abstract class NetworkEmitFixtureBase { } diff --git a/SVSim.BattleEngine.Tests/NetworkMgrConstructionProbeTests.cs b/SVSim.BattleEngine.Tests/NetworkMgrConstructionProbeTests.cs index 48584f48..b464775b 100644 --- a/SVSim.BattleEngine.Tests/NetworkMgrConstructionProbeTests.cs +++ b/SVSim.BattleEngine.Tests/NetworkMgrConstructionProbeTests.cs @@ -11,18 +11,15 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class NetworkMgrConstructionProbeTests : NetworkEmitFixtureBase { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); [Test] public void HeadlessNetworkBattleMgr_constructs_headless() { Assert.DoesNotThrow(() => { - var mgr = new HeadlessNetworkBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededHeadlessNetworkBattleMgr(); Assert.That(mgr, Is.Not.Null); }); } @@ -31,10 +28,9 @@ namespace SVSim.BattleEngine.Tests public void OnEmit_capture_seam_is_wired_via_injected_agent() { var (mgr, emitted) = HeadlessEngineEnv.NewNetworkEmitBattle(); - _scope.Ctx.Mgr = mgr; Assert.That(mgr, Is.Not.Null); - Assert.That(Wizard.ToolboxGame.RealTimeNetworkAgent, Is.Not.Null, - "agent must be injected so NetworkBattleSender's ToolboxGame.RealTimeNetworkAgent.* calls resolve"); + Assert.That(mgr.InstanceNetworkAgent, Is.Not.Null, + "agent must be injected so NetworkBattleSender's _battleMgr.InstanceNetworkAgent.* calls resolve"); Assert.That(emitted, Is.Empty, "no emit yet — only the seam is wired"); } } diff --git a/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs b/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs index 7ddb2e60..2aea49e1 100644 --- a/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs +++ b/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs @@ -16,20 +16,16 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class RandomDrawOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); [TearDown] public void ResetRandomDrawGate() { - // NewAuthoritativeBattle sets the process-global BattleManagerBase.IsRandomDraw = true; reset it - // so this fixture doesn't leak that state into later-running fixtures (which expect the default - // false / top-of-deck draw behavior). Prevents order-dependent flakes as more RNG oracles land. - // (Now an ambient write inside the scope; harmless either way.) + // NewAuthoritativeBattle sets BattleManagerBase.IsRandomDraw = true on the mgr; the static + // setter now no-ops without a mgr in scope (Phase-5 chunk 46), so this reset became a + // per-mgr concern rather than a global fixture-hygiene one. Kept for symmetry. BattleManagerBase.IsRandomDraw = false; - _scope?.Dispose(); - _scope = null; } // Draw with a single scripted unit; return (drawnCardId, deckCountAfter). The deck is seeded with @@ -38,7 +34,6 @@ namespace SVSim.BattleEngine.Tests private (int drawnId, int deckAfter) DrawWith(double unit) { var mgr = HeadlessEngineEnv.NewAuthoritativeBattle(new ScriptedRandomSource(new[] { unit })); - _scope.Ctx.Mgr = mgr; var player = mgr.BattlePlayer; HeadlessEngineEnv.SeedDeck(mgr, HeadlessEngineEnv.RngDeckCardA, index: 2, isPlayer: true); diff --git a/SVSim.BattleEngine.Tests/RngSeamTests.cs b/SVSim.BattleEngine.Tests/RngSeamTests.cs index 5a0f1e8c..55a48302 100644 --- a/SVSim.BattleEngine.Tests/RngSeamTests.cs +++ b/SVSim.BattleEngine.Tests/RngSeamTests.cs @@ -9,10 +9,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class RngSeamTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); // RandomSourceBridge.Range must mirror the engine's exact roll arithmetic: // BattleManagerBase.StableRandom does `(int)Math.Floor((double)val * unit)`. @@ -72,8 +70,7 @@ namespace SVSim.BattleEngine.Tests // StableRandomDouble() -> 0.25 // StableRandomOnlySelf(10) -> scripted self pick 4 var src = new ScriptedRandomSource(new[] { 0.5, 0.25 }, new[] { 4 }); - var mgr = new HeadlessBattleMgr(new HeadlessContentsCreator(), src); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededHeadlessBattleMgr(src); Assert.That(mgr.StableRandom(7), Is.EqualTo(3), "StableRandom did not use the injected source"); Assert.That(mgr.randomResult, Is.EqualTo(0.5), "StableRandom must set randomResult to the rolled unit"); @@ -91,8 +88,7 @@ namespace SVSim.BattleEngine.Tests { BattleManagerBase.IsForecast = true; - var mgr = new HeadlessBattleMgr(new HeadlessContentsCreator()); // default SeededRandomSource(12345) - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededHeadlessBattleMgr(); // default SeededRandomSource(12345) var reference = new System.Random(12345); for (int i = 0; i < 10; i++) diff --git a/SVSim.BattleEngine.Tests/SVSim.BattleEngine.Tests.csproj b/SVSim.BattleEngine.Tests/SVSim.BattleEngine.Tests.csproj index 80beec2d..b946d65d 100644 --- a/SVSim.BattleEngine.Tests/SVSim.BattleEngine.Tests.csproj +++ b/SVSim.BattleEngine.Tests/SVSim.BattleEngine.Tests.csproj @@ -13,13 +13,18 @@ + - + + + global,engine + diff --git a/SVSim.BattleEngine.Tests/SequentialBattleTests.cs b/SVSim.BattleEngine.Tests/SequentialBattleTests.cs new file mode 100644 index 00000000..f49f5596 --- /dev/null +++ b/SVSim.BattleEngine.Tests/SequentialBattleTests.cs @@ -0,0 +1,54 @@ +#nullable enable +using NUnit.Framework; +using SVSim.BattleNode.Sessions.Engine; + +namespace SVSim.BattleEngine.Tests; + +/// Confirms that constructing engine B after engine A has finished does not inherit +/// any leftover ambient/static state from engine A. Catches the static-not-cleared family of +/// bugs that the multi-instance Task.Run tests don't exercise (their scopes never overlap +/// AsyncLocal flow). Backstop for engine shim cleanup Task 5. +[TestFixture, NonParallelizable] +public class SequentialBattleTests +{ + [OneTimeSetUp] + public void OneTimeSetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); + + [Test] + public void Sequential_SecondBattle_StartsCleanAfterFirstCompletes() + { + var engineA = new SessionBattleEngine(); + engineA.Setup(masterSeed: 333, HeadlessEngineEnv.SampleDeck(), HeadlessEngineEnv.SampleDeck(), + seatAClass: 1, seatBClass: 2); + _ = engineA.LeaderLife(true); + _ = engineA.Pp(true); + _ = engineA.HandCount(true); + // Drop engineA. No explicit Dispose today; we rely on scope-exit semantics in SessionBattleEngine. + + // Now construct engine B in the same AppDomain. + var engineB = new SessionBattleEngine(); + engineB.Setup(masterSeed: 444, HeadlessEngineEnv.SampleDeck(), HeadlessEngineEnv.SampleDeck(), + seatAClass: 3, seatBClass: 4); + + Assert.That(engineB.LeaderLife(true), Is.EqualTo(20), + "engineB starting life leaked from engineA — sequential static-state bug."); + Assert.That(engineB.Pp(true), Is.EqualTo(0)); + Assert.That(engineB.HandCount(true), Is.EqualTo(0)); + + // Re-read engineA after engineB exists, to confirm engineB's setup didn't poison engineA's reads. + Assert.That(engineA.LeaderLife(true), Is.EqualTo(20), + "engineA reads changed after engineB.Setup — cross-contamination bug."); + } + + [Test] + public void Sequential_ThirdBattle_AfterTwoCompletes_StillClean() + { + for (int i = 0; i < 3; i++) + { + var e = new SessionBattleEngine(); + e.Setup(masterSeed: 500 + i, HeadlessEngineEnv.SampleDeck(), HeadlessEngineEnv.SampleDeck()); + Assert.That(e.LeaderLife(true), Is.EqualTo(20)); + Assert.That(e.Pp(true), Is.EqualTo(0)); + } + } +} diff --git a/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineConstructionTests.cs b/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineConstructionTests.cs index f851b3a0..b7a5a72e 100644 --- a/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineConstructionTests.cs +++ b/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineConstructionTests.cs @@ -7,10 +7,8 @@ namespace SVSim.BattleEngine.Tests.SessionEngine [TestFixture] public class SessionEngineConstructionTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); [Test] public void SessionBattleEngine_instantiates_and_is_not_ready_before_setup() diff --git a/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineShadowReplayTests.cs b/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineShadowReplayTests.cs index e1210db0..06607cf2 100644 --- a/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineShadowReplayTests.cs +++ b/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineShadowReplayTests.cs @@ -9,10 +9,8 @@ namespace SVSim.BattleEngine.Tests.SessionEngine [TestFixture] public class SessionEngineShadowReplayTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); // Frames that are transport/keepalive, not game actions — not ingested. private static readonly HashSet SkipUris = new() diff --git a/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineSpellboostTests.cs b/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineSpellboostTests.cs index 01daf4e2..58b9115f 100644 --- a/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineSpellboostTests.cs +++ b/SVSim.BattleEngine.Tests/SessionEngine/SessionEngineSpellboostTests.cs @@ -8,10 +8,8 @@ namespace SVSim.BattleEngine.Tests.SessionEngine; [TestFixture] public class SessionEngineSpellboostTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); [Test] public void EngineGlobalInit_makes_a_fresh_engine_ready() diff --git a/SVSim.BattleEngine.Tests/SummonTokenOracleTests.cs b/SVSim.BattleEngine.Tests/SummonTokenOracleTests.cs index 3586b706..2f9fc8f7 100644 --- a/SVSim.BattleEngine.Tests/SummonTokenOracleTests.cs +++ b/SVSim.BattleEngine.Tests/SummonTokenOracleTests.cs @@ -18,10 +18,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class SummonTokenOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -36,8 +34,7 @@ namespace SVSim.BattleEngine.Tests public void Summon_token_spell_places_a_new_token_on_the_board() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/TargetedDamageSpellOracleTests.cs b/SVSim.BattleEngine.Tests/TargetedDamageSpellOracleTests.cs index 86550ff6..c7631196 100644 --- a/SVSim.BattleEngine.Tests/TargetedDamageSpellOracleTests.cs +++ b/SVSim.BattleEngine.Tests/TargetedDamageSpellOracleTests.cs @@ -19,10 +19,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class TargetedDamageSpellOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -37,8 +35,7 @@ namespace SVSim.BattleEngine.Tests public void Targeted_damage_spell_hits_only_the_selected_enemy_follower() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/TargetedDestroySpellOracleTests.cs b/SVSim.BattleEngine.Tests/TargetedDestroySpellOracleTests.cs index 2698b922..2ac52ba9 100644 --- a/SVSim.BattleEngine.Tests/TargetedDestroySpellOracleTests.cs +++ b/SVSim.BattleEngine.Tests/TargetedDestroySpellOracleTests.cs @@ -21,10 +21,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class TargetedDestroySpellOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -39,8 +37,7 @@ namespace SVSim.BattleEngine.Tests public void Targeted_destroy_spell_removes_only_the_selected_enemy_follower() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine.Tests/TestBattleScope.cs b/SVSim.BattleEngine.Tests/TestBattleScope.cs deleted file mode 100644 index a2290390..00000000 --- a/SVSim.BattleEngine.Tests/TestBattleScope.cs +++ /dev/null @@ -1,50 +0,0 @@ -#nullable enable -using System; -using System.Runtime.Serialization; -using SVSim.BattleEngine.Ambient; - -namespace SVSim.BattleEngine.Tests; - -/// Per-test ambient scope. Each test that touches engine statics wraps its body -/// in `using var scope = new TestBattleScope();` (or with an explicit Mgr/ViewerId). -/// -/// The constructor enters a fresh (carrying a brand-new -/// so per-test mgr/DataMgr writes never bleed across tests), then -/// runs the per-ambient seeders that -/// no longer does (chara ids on DataMgr, NetworkUserInfoData). Process-globals -/// (card master, LoadDetail, Crossover, Certification.udid) come from -/// which runs once per process. -/// -/// Public surface (vs. internal) so SVSim.UnitTests can reuse it via the same project -/// reference in Task 7. -public sealed class TestBattleScope : IDisposable -{ - private readonly BattleAmbient.Scope _scope; - public BattleAmbientContext Ctx { get; } - - public TestBattleScope(BattleManagerBase? mgr = null, int viewerId = 1001) - { - // Make sure process-globals are seeded before we enter; idempotent + cheap after first call. - HeadlessEngineEnv.EnsureProcessGlobals(); - - Ctx = new BattleAmbientContext - { - Mgr = mgr, - GameMgr = new GameMgr(), - ViewerId = viewerId, - IsForecast = true, - IsRandomDraw = true, - RecoveryInfo = (Wizard.BattleRecoveryInfo)FormatterServices - .GetUninitializedObject(typeof(Wizard.BattleRecoveryInfo)), - }; - _scope = BattleAmbient.Enter(Ctx); - - // Per-ambient seeders MUST run AFTER scope entry so GameMgr.GetIns() resolves to this - // scope's GameMgr (not a stray one). EnsureProcessGlobals used to do these writes against - // the global GameMgr; now they're scoped. - HeadlessEngineEnv.SeedCharaIdsOnCurrentAmbient(); - HeadlessEngineEnv.SeedNetUserOnCurrentAmbient(); - } - - public void Dispose() => _scope.Dispose(); -} diff --git a/SVSim.BattleEngine.Tests/VanillaFollowerOracleTests.cs b/SVSim.BattleEngine.Tests/VanillaFollowerOracleTests.cs index cbd236af..314c3438 100644 --- a/SVSim.BattleEngine.Tests/VanillaFollowerOracleTests.cs +++ b/SVSim.BattleEngine.Tests/VanillaFollowerOracleTests.cs @@ -12,10 +12,8 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class VanillaFollowerOracleTests { - private TestBattleScope _scope; - [SetUp] public void SetUpScope() { _scope = new TestBattleScope(); } - [TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; } + [SetUp] public void SetUp() => HeadlessEngineEnv.EnsureProcessGlobals(); private static void SetPrivateField(object obj, string name, object value) { @@ -32,8 +30,7 @@ namespace SVSim.BattleEngine.Tests public void Vanilla_follower_resolves_to_correct_state() { BattleManagerBase.IsForecast = true; // suppress VFX registration (F1) - var mgr = new SingleBattleMgr(new HeadlessContentsCreator()); - _scope.Ctx.Mgr = mgr; + var mgr = HeadlessEngineEnv.NewSeededSingleBattleMgr(); mgr.IsRecovery = true; // collapse wait delays to 0 (F1) var player = mgr.BattlePlayer; diff --git a/SVSim.BattleEngine/COPIED.manifest.tsv b/SVSim.BattleEngine/COPIED.manifest.tsv index 0b09acbe..83810931 100644 --- a/SVSim.BattleEngine/COPIED.manifest.tsv +++ b/SVSim.BattleEngine/COPIED.manifest.tsv @@ -1562,10 +1562,8 @@ Wizard.Battle.Player.ClassCharacter\Player3dClassCharacter.cs Wizard.Battle.Play Wizard.Battle.Player.ClassCharacter\PlayerClassCharacter.cs Wizard.Battle.Player.ClassCharacter\PlayerClassCharacter.cs 79c4a5b7b34b79abf748ba421fcba213eecc04c789ee5ea8e5903abea2c05fa2 0 Wizard.Battle.Player.ClassCharacter\PlayerHighRankSpineClassCharacter.cs Wizard.Battle.Player.ClassCharacter\PlayerHighRankSpineClassCharacter.cs fd0ac732efff8feee43aabf86cfc089e93f874ad8e4a40e60e538cf092b4e821 0 Wizard.Battle.Player.ClassCharacter\PlayerSpineClassCharacter.cs Wizard.Battle.Player.ClassCharacter\PlayerSpineClassCharacter.cs dada07b44ca77565d464f8b06c2e6e50bd5bbf46308c0b25042551cc2dfe5b30 0 -Wizard.Battle.Player.ClassCharacter\SkinEffectVfx.cs Wizard.Battle.Player.ClassCharacter\SkinEffectVfx.cs 615c275919ee29473983b6a5386e64ebfb2bff959d9231863f8b72506da5756e 0 Wizard.Battle.Player.ClassCharacter\SpineClassCharacter.cs Wizard.Battle.Player.ClassCharacter\SpineClassCharacter.cs fa478f3dc08ddf42951add4bc12ce65f6588d8974ac1941bd2ef88beb564fb55 0 Wizard.Battle.Player.ClassCharacter\SpineObject.cs Wizard.Battle.Player.ClassCharacter\SpineObject.cs bd325662311d523dc9948557b3ddf899ed5a72fe18430f69e307360f7fa6758f 0 -Wizard.Battle.Player.Emotion\Debug722006NullVfx.cs Wizard.Battle.Player.Emotion\Debug722006NullVfx.cs 65801eb05b7c9ee4c6514faa6d67f2d632ee95a47a74836a2f34072fe19a30db 0 Wizard.Battle.Player.Emotion\EmotionBase.cs Wizard.Battle.Player.Emotion\EmotionBase.cs 8a8edb24dbf845b07acf74e70658335d8fe23f67105e1e70e814153b836d4fad 0 Wizard.Battle.Player.Emotion\EnemyAIEmotion.cs Wizard.Battle.Player.Emotion\EnemyAIEmotion.cs da412c54c553497108cf02172d041ef893420d9e495b1d017ea0f8dd70360c7f 0 Wizard.Battle.Player.Emotion\EnemyEmotionBase.cs Wizard.Battle.Player.Emotion\EnemyEmotionBase.cs 35c86dd528fcab638f076c4bf0ef4f4b96737b83bba5450d117abe5024aaec6c 0 @@ -1613,7 +1611,11 @@ Wizard.Battle.Touch/ITouchProcessor.cs Wizard.Battle.Touch/ITouchProcessor.cs 63 Wizard.Battle.UI/IClassInfomationUI.cs Wizard.Battle.UI/IClassInfomationUI.cs 05831a370255fda7e5f0091a278fb0c35ce7dd81c504395127589505e9cce4ee 0 Wizard.Battle.UI/LogType.cs Wizard.Battle.UI/LogType.cs a8de41a8d5d8f2289f75b9b9fc25d277e74c42723e78d09762fc72ae5f5e9e34 0 Wizard.Battle.UI/SkillGainType.cs Wizard.Battle.UI/SkillGainType.cs 7b12e7d3982bbf23dfeebbd90ea5fb045d801ff47d7713a3fb835db9642d05a5 0 +Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs fd471e4254bde6dded2c1447714e605a9889b97b01a834bc616585bcff738825 0 +Wizard.Battle.View.Vfx/NullCardVfxCreator.cs Wizard.Battle.View.Vfx/NullCardVfxCreator.cs bf8f34d27f41df0dc728c47f874465869649299a5195c2d616597d7a37c581f5 0 +Wizard.Battle.View.Vfx/NullVfxWithLoading.cs Wizard.Battle.View.Vfx/NullVfxWithLoading.cs c297c7c7e53fc9a41e46b5f52baa65f905bc51943d6a0fbe683a98fc0668b9b9 0 Wizard.Battle.View.Vfx/VfxResultEventExtension.cs Wizard.Battle.View.Vfx/VfxResultEventExtension.cs e34ff65e9a0df76f24f17185b3a80ebab326f4e413bccc18f084efea9a4094ac 0 +Wizard.Battle.View/CardIconControl.cs Wizard.Battle.View/CardIconControl.cs affd5a289a04bc9f446f3e892403dd9cd560ee557de1e5cd743dcb031dab280c 0 Wizard.Battle.View/HandCardFrameEffectType.cs Wizard.Battle.View/HandCardFrameEffectType.cs 0457f58fe09057aa9f32c8b131186d1a252aaf30930e4269ef204d6429188ff5 0 Wizard.Battle.View/HandParameter.cs Wizard.Battle.View/HandParameter.cs e55287d3bdf32b98849f626ef833c347311a3483ffca92a73c70c9598955ec40 0 Wizard.Battle.View/IBattleCardView.cs Wizard.Battle.View/IBattleCardView.cs 79657bc2b1a864d548e9929640d5f2322561041114119ff3f6ce987c1a073f68 0 @@ -1634,7 +1636,6 @@ Wizard.Battle\PlayerInnerOptionsBuilder.cs Wizard.Battle\PlayerInnerOptionsBuild Wizard.Bingo\BingoDrawTask.cs Wizard.Bingo\BingoDrawTask.cs 9c235721777d20d8d0bf0eba785c92b794881142c4904ead3fbb73bd9c28d995 0 Wizard.Bingo\BingoInfoTask.cs Wizard.Bingo\BingoInfoTask.cs 3c651be0075b3dfdf781286166ddcffa16771a6a73eff7ae7d76a8a9e7a8d315 0 Wizard.Bingo\BingoMissionDialog.cs Wizard.Bingo\BingoMissionDialog.cs 979377d116e53fbb2b126eee2d2ee6b27856ebbc6305e0c04ea651d4e7c98e09 0 -Wizard.Bingo\BingoPage.cs Wizard.Bingo\BingoPage.cs 5e806667bd74fcd0ba59bdd9506d53a3395b4a76f0607518579a3c2022e01fc5 0 Wizard.Bingo\BingoRewardsDialog.cs Wizard.Bingo\BingoRewardsDialog.cs 286d731b08070587ff651349c51f80a1b195f99d2020d52f379d3d6463f4781a 0 Wizard.DeckCardEdit\CachingCardBundle.cs Wizard.DeckCardEdit\CachingCardBundle.cs 3efcb163e9be8d023e12394684c83745081c500cf13a84b91674aab0eeace113 0 Wizard.DeckCardEdit\CardBundle.cs Wizard.DeckCardEdit\CardBundle.cs ae56efeea60e2288b595d57f6b48bc83661ff8f22b0607746a39b080714e439e 0 @@ -1671,7 +1672,6 @@ Wizard.Lottery\LotteryLoadTaskData.cs Wizard.Lottery\LotteryLoadTaskData.cs 4c93 Wizard.Lottery\LotteryMissionData.cs Wizard.Lottery\LotteryMissionData.cs 2844dfd64d868c6ee758e9a32c986cdc2ffe9c3d7cefba74f151b3248569a9a0 0 Wizard.Lottery\LotteryMissionDialog.cs Wizard.Lottery\LotteryMissionDialog.cs 002c660ba2174e63c5a198ff16656843eb4d1d9734383bcb4da1c1528965af2f 0 Wizard.Lottery\LotteryMissionTreasureBox.cs Wizard.Lottery\LotteryMissionTreasureBox.cs 2dd2831bce979e9cfaf1b0c4bef4514d2f1048e3ba22533a9ebf931462c908e6 0 -Wizard.Lottery\LotteryPage.cs Wizard.Lottery\LotteryPage.cs a5a97a7b28946779d4ebea31cccd2b6277bbbbae945823110f3f23541ba07977 0 Wizard.Lottery\LotteryReceiveBigChanceTask.cs Wizard.Lottery\LotteryReceiveBigChanceTask.cs 0010ea6f71467290e35e5355db17af8e65ad8270aa71e1211414a393db262dd6 0 Wizard.Lottery\LotteryReceiveDoubleChanceTask.cs Wizard.Lottery\LotteryReceiveDoubleChanceTask.cs 4ad932089f01371ffcfd8517a4d85515a5b59e3f2a886c5232aaf0c11f43063f 0 Wizard.Lottery\LotteryReceiveTask.cs Wizard.Lottery\LotteryReceiveTask.cs 583a8c70272db900446ab96c3f47578b8b837c8326a4697e6847a4391e30a737 0 @@ -1698,12 +1698,10 @@ Wizard.Scripts.Network.Data.TaskData.Arena\FinishDetail.cs Wizard.Scripts.Networ Wizard.Scripts.Network.Data.TaskData.Arena\TwoPickInfo.cs Wizard.Scripts.Network.Data.TaskData.Arena\TwoPickInfo.cs 8e76e6eca0a1bfae75aace89bb9e3bcd9edba9d5536e2ddc19e88e9b088e3ac1 0 Wizard.Scripts.Network.Data.TaskData.Battle\DoMatchingResponse.cs Wizard.Scripts.Network.Data.TaskData.Battle\DoMatchingResponse.cs 0333da0ebce1e8f6fec5d43ae0995ed62490be9536dde8868d4e70e0015b7879 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckBuyTask.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckBuyTask.cs bf259e4e745e2e7ca90860e31d9cdafdf3f1b0b81bea289a66c781588007998c 0 -Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckDetailWindow.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckDetailWindow.cs 4a9c050e5aac15a4bc941d11ff7742db9053ae28104695633de6f9fb39e195b9 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPlate.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPlate.cs bd9c91055c8a8f1568d52aa151905a4b2f48bbdae67ce8e220d5d6e2d926bf08 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckProductInfo.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckProductInfo.cs 2db317cebfbedee935a6035145c5c580ce1f4f9ea1b054485c16b8697f4fea6b 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPurchaseInfo.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPurchaseInfo.cs 045817a97fbc695eaa151ed8bba8878f1296ff764f3c7967c7f7aa762cb386c6 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPurchaseInfoTask.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPurchaseInfoTask.cs 4354baf3caae53349994512d02bf7279a1e9670c1cf57336a6160e8afac02aa7 0 -Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPurchasePage.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckPurchasePage.cs 9195762e8890b62bac3795bbae963a167aa494df9704b1cc1f394ebe332def4c 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckSelectBuyMeansDialog.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckSelectBuyMeansDialog.cs 505e70d4cbf0c22591efd8a324b5cac980bb6ec1297d9fa88348f571f95e6b5e 0 Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckSeriesPurchaseInfo.cs Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase\BuildDeckSeriesPurchaseInfo.cs d8aba20b16e641ba45718dafa95bb5bcd20c65417572dcad4a4e6f97fc96d7b4 0 Wizard.Scripts.Network.Data.TaskData.ItemPurchase\ItemPurchaseBuyTask.cs Wizard.Scripts.Network.Data.TaskData.ItemPurchase\ItemPurchaseBuyTask.cs 5efb8b505dfdce8f140a7272da996a88f88f6689bce8fa1cc1a7e849ceeedca2 0 @@ -1747,7 +1745,6 @@ Wizard/AIAttackableCountSimulationUtility.cs Wizard/AIAttackableCountSimulationU Wizard/AIBanAttackSimulationUtility.cs Wizard/AIBanAttackSimulationUtility.cs 2ff8a7514a804143901f369c14bbe4dbbb19b68fb040623202ab051503e4dbd2 0 Wizard/AIBanishSelectLogicArgument.cs Wizard/AIBanishSelectLogicArgument.cs 14f0aab679d51d6d80f0da96d42ee7ae0cc43d95fa49ac6f438ed6466c165f06 0 Wizard/AIBanishSimulationUtility.cs Wizard/AIBanishSimulationUtility.cs f74d601995fb6bbd292dcbc2d70214756a265b21e938b3bbf7f85a1e7e0546d8 0 -Wizard/AIBarrierGlobal.cs Wizard/AIBarrierGlobal.cs 55686ebf9a77cc69d8fd3a19e2a2e4c527cd6ff0edbc5a431397d7f9124a7bdb 0 Wizard/AIBasicTargetSelectUtility.cs Wizard/AIBasicTargetSelectUtility.cs 75525d16629b77f4f27ddfea6cee68059109c98ea618e2c8d4b161fc30e6e68b 0 Wizard/AIBerserkUtility.cs Wizard/AIBerserkUtility.cs 94c6827ae773205374ecb80b82e47080d765696c3fd382cdec1a038a4d470254 0 Wizard/AIBounceSelectLogicArgument.cs Wizard/AIBounceSelectLogicArgument.cs 8866f8448a80272d3ae32eb5e27656aefc86397b3d461e141f571f88cbe9fc5b 0 @@ -2512,7 +2509,6 @@ Wizard\CardSelectListConfirmPagerView.cs Wizard\CardSelectListConfirmPagerView.c Wizard\CardSetName.cs Wizard\CardSetName.cs 943b0083d367048c7cdebcfdc2780aee27f6d9f1adfafec7cb720830bb614f6f 0 Wizard\CardSetNameMgr.cs Wizard\CardSetNameMgr.cs 146a4a804055f9c3341301c3823bda3cf3f560e8032b5df46e1b7fca87009649 0 Wizard\CardSkillHashUtility.cs Wizard\CardSkillHashUtility.cs ad5fba74351ce510165f83273391762c3cb57e96ff605e13cf3d5e544a2e6edd 0 -Wizard\CardSleeveDetailWindow.cs Wizard\CardSleeveDetailWindow.cs b74705d70564b25e3972d121591c55be39437df0dfa16cf0e14db3501761fd02 0 Wizard\CardSleeveRewardItem.cs Wizard\CardSleeveRewardItem.cs 9cf753ca79d8e25f1aaec1af3f4d9e0f565c3e1b6827ced3479fb86cb824b5cd 0 Wizard\CardSleeveRewardView.cs Wizard\CardSleeveRewardView.cs 239ffd404400fe94dbfc08cc48d0591bcef769a5081a389134d5409275c84180 0 Wizard\CenteringUIWidget.cs Wizard\CenteringUIWidget.cs 1ddc0ddbbfcd6638010dc6889706b3a5944ac5b122103cf24f9c0d7adde66efc 0 @@ -2564,7 +2560,6 @@ Wizard\ClassSelectionButton.cs Wizard\ClassSelectionButton.cs e54b6667dcf47f83bd Wizard\ClassSelectionPage.cs Wizard\ClassSelectionPage.cs 9824d4d179df52757687f5c6e9a3aa6a403997f140d036f805105742146d51e3 0 Wizard\ClassSelectionPageParam.cs Wizard\ClassSelectionPageParam.cs 11c33bf47223789c7ab191b2d048a04ae324485be18f86a3f9aa2ce28fa4680c 0 Wizard\ClassSet.cs Wizard\ClassSet.cs 37d444f7109e8637da98bc721c35286d6f0c45c49dbcf552603e26e453908e32 0 -Wizard\ClassSkinDetailWindow.cs Wizard\ClassSkinDetailWindow.cs 05f8f178d4cbec20554dcfbae3f9f62c22f55cadda61528334284c38185a0aae 0 Wizard\ClassSkinSelectBuyMeansDialog.cs Wizard\ClassSkinSelectBuyMeansDialog.cs 769c2c46a5c7fab555acfd53982eeac368e3f0452eef8a34ecaca0402196cf0d 0 Wizard\ClassType.cs Wizard\ClassType.cs c0be0ce00bb64ad28a85f1f1edfafa0216b67a47fa8d744a1b69c19b78c786ce 0 Wizard\ClassUtil.cs Wizard\ClassUtil.cs fbfe755aff08092de955f89e8cc0494b289d74cf09eab426a239dcb2aca78a27 0 @@ -2945,7 +2940,6 @@ Wizard\NoneFormatBehavior.cs Wizard\NoneFormatBehavior.cs 885cfa3a6bc7896ecb67ca Wizard\NotificatonAnimation.cs Wizard\NotificatonAnimation.cs 86079fa67434ccd594837728872c521648a01111dc6917ecc9b100b892556c99 0 Wizard\NullReceiveTurnEndToJudgeResult.cs Wizard\NullReceiveTurnEndToJudgeResult.cs 6d6ef2f3f0e2e43c47b58fcbc3f0aea7b139cc156df84fa6a93d14349534aa6c 0 Wizard\OneMoreLastwordTagCollection.cs Wizard\OneMoreLastwordTagCollection.cs 43ded6b3ecf0cea6d0880bb9e6a0294fecf17eacca1f27bdfdbf4073a9f36661 0 -Wizard\OptionSettingWindow.cs Wizard\OptionSettingWindow.cs ddca8fc3a8fa399d2a19e143de82647c9a7dc3e849ae4538b9f42c5e4987f79a 0 Wizard\OtherAttackTagCollection.cs Wizard\OtherAttackTagCollection.cs 01abdfb334ad2c7a75244ce40aa76963123120b1311b55d9f72b30eb602dcf45 0 Wizard\OtherBanishBonusTagCollection.cs Wizard\OtherBanishBonusTagCollection.cs 9cc66ef3cb7e38fb9c393c8a827942003083062f1a704374c9adc600317c445d 0 Wizard\OtherBanishTagCollection.cs Wizard\OtherBanishTagCollection.cs b0b834a06e5e3c202233667ea591c26fb8ddfcc1d3f04a05cf5530cbb6629aab 0 @@ -3219,7 +3213,6 @@ Wizard\StoryNotification.cs Wizard\StoryNotification.cs 2031e97ce2caa711e695a8ca Wizard\StorySectionBtn.cs Wizard\StorySectionBtn.cs 4c5017f7a46c2aadf025f170455524a7fbcdaf230357f103411171a21d2e67b9 0 Wizard\StorySectionSummaryDialog.cs Wizard\StorySectionSummaryDialog.cs 2592e979478669a865bccc1f2dcfd8943d38248f4f93e842c58cac1fc2125455 0 Wizard\StorySectionTask.cs Wizard\StorySectionTask.cs f0bb589fd600a447d375f42b1653ccc12c6225016bc00a53e6977520ee648653 0 -Wizard\StorySelectPage.cs Wizard\StorySelectPage.cs 9f24b2f8f98fd01b416272fbd6653d2a4394e94276813dbe4392144e459c831e 0 Wizard\StorySummaryDialog.cs Wizard\StorySummaryDialog.cs bb46317567e6879b90f7752051b09039c5795bcf25af63fadfdcbcfcca99e80b 0 Wizard\SubClassSelectDialog.cs Wizard\SubClassSelectDialog.cs ce9eed6444e38ddd10eb305755b400808395d861621442d60553e91e46b6351f 0 Wizard\SummonTagCollection.cs Wizard\SummonTagCollection.cs 584ee636f3d8826973893728e77f5a72cc4c4b608357b6bccb993f17abf46976 0 @@ -3308,7 +3301,3 @@ WrapVariableContentsScrollBarSize.cs WrapVariableContentsScrollBarSize.cs 05c94e YuwanField.cs YuwanField.cs 1368d0b2755edbae36ce4dcabd69d8d2f6ce854765ea46621199ef20d407d13a 0 iTween.cs iTween.cs 8da77cd885d8fb1e8727e91681ab5ac00a889d0fcc9b973a4162f15a0b642a54 0 llField.cs llField.cs a0e0eaed3f22a8c4ce47f82fa80346e3b99e3ac0a6765e1ad4ade3a87c1b0189 0 -Wizard.Battle.View/CardIconControl.cs Wizard.Battle.View/CardIconControl.cs affd5a289a04bc9f446f3e892403dd9cd560ee557de1e5cd743dcb031dab280c 0 -Wizard.Battle.View.Vfx/NullCardVfxCreator.cs Wizard.Battle.View.Vfx/NullCardVfxCreator.cs bf8f34d27f41df0dc728c47f874465869649299a5195c2d616597d7a37c581f5 0 -Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs fd471e4254bde6dded2c1447714e605a9889b97b01a834bc616585bcff738825 0 -Wizard.Battle.View.Vfx/NullVfxWithLoading.cs Wizard.Battle.View.Vfx/NullVfxWithLoading.cs c297c7c7e53fc9a41e46b5f52baa65f905bc51943d6a0fbe683a98fc0668b9b9 0 diff --git a/SVSim.BattleEngine/Engine/AISendIntervalTrigger.cs b/SVSim.BattleEngine/Engine/AISendIntervalTrigger.cs deleted file mode 100644 index 416b9448..00000000 --- a/SVSim.BattleEngine/Engine/AISendIntervalTrigger.cs +++ /dev/null @@ -1,6 +0,0 @@ -public class AISendIntervalTrigger : SendIntervalTrigger -{ - public override void SendDataCheck(NetworkBattleManagerBase networkBattleManager, NetworkBattleDefine.NetworkBattleURI sendUri) - { - } -} diff --git a/SVSim.BattleEngine/Engine/AITurnControl.cs b/SVSim.BattleEngine/Engine/AITurnControl.cs deleted file mode 100644 index 2f27d851..00000000 --- a/SVSim.BattleEngine/Engine/AITurnControl.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Cute; -using Wizard; - -public class AITurnControl -{ - private DateTime _startTime; - - private bool _isStartTimer; - - public AITurnControl() - { - _isStartTimer = false; - } - - public void StartTurnTimer() - { - _isStartTimer = true; - _startTime = TimeUtil.GetAbsoluteTime(); - } - - public void SetAndStartTurnTimer(DateTime time) - { - _isStartTimer = true; - _startTime = time; - } - - public void Update(IEnemyAI ai) - { - if (ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive && !ai.IsConnectNetwork) - { - ai.Reconnect(); - } - if (!_isStartTimer || !ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive) - { - if (_isStartTimer && ai.IsConnectNetwork) - { - ai.Disconnect(); - } - } - else if ((float)NetworkUtility.GetTimeSpanSecond(_startTime.Ticks) >= 90f) - { - if (ai.IsStackAction) - { - ai.CleanupStackedAction(); - } - if (!ai.IsStackAction) - { - ai.TurnEnd(); - } - } - } - - public void StopTurnTimer() - { - _isStartTimer = false; - } -} diff --git a/SVSim.BattleEngine/Engine/AchievedInfo.cs b/SVSim.BattleEngine/Engine/AchievedInfo.cs index c828ac8e..21d539a0 100644 --- a/SVSim.BattleEngine/Engine/AchievedInfo.cs +++ b/SVSim.BattleEngine/Engine/AchievedInfo.cs @@ -5,27 +5,6 @@ using Wizard.Lottery; public class AchievedInfo { - private const string ACHIEVEMENT = "achieved_achievement_list"; - - private const string MISSION = "achieved_mission_list"; - - private const string REWARD = "achieved_mission_reward_list"; - - private const string VICTORY_REWARD = "win_reward_list"; - - private const string GRAND_MASTER_REWARD = "grand_master_reward_list"; - - private const string MISSION_START = "mission_start_data"; - - private const string BEGINNER_MISSION_REWARD = "achieved_beginner_mission_reward_list"; - - private const string BEGINNER_MISSION_REWARD_MESSAGE = "achieved_beginner_mission_list"; - - private const string BATTLE_PASS_REWARD_LIST = "battle_pass_reward_list"; - - private const string BATTLE_PASS_MESSAGE_LIST = "battle_pass_message_list"; - - private const long DONT_NOTIFY_IF_SMALLER_THAN_SECONDS = 10L; public List _missions; diff --git a/SVSim.BattleEngine/Engine/AchievementWindowBase.cs b/SVSim.BattleEngine/Engine/AchievementWindowBase.cs index d301dcf2..959297d5 100644 --- a/SVSim.BattleEngine/Engine/AchievementWindowBase.cs +++ b/SVSim.BattleEngine/Engine/AchievementWindowBase.cs @@ -79,31 +79,14 @@ public class AchievementWindowBase : MonoBehaviour [SerializeField] private UILabel _labelTopRight; - [SerializeField] - private UILabel _missionStartTime; - - [SerializeField] - private UILabel _missionTimeOver; - - [SerializeField] - private UILabel _applyFinish; - - private const int ACHIEVEMENT_STARS_MAX = 5; - private ResourceHandler _resourceHandler; - private const string SPRITE_PREFIX_BUTTON_BLUE = "btn_common_02_s_"; - private int _viewMailId; private QuestRewardInfo _questRewardInfo; private Action _onReceivceAchievementSuccess; - private CrossoverRewardInfo _crossoverRewardInfo; - - private const int BINGO_MISSION_SPRITE_WIDTH = 752; - private void Awake() { LabelDetailBtn.text = Data.SystemText.Get("Common_0022"); @@ -117,11 +100,6 @@ public class AchievementWindowBase : MonoBehaviour UIManager.SetObjectToGrey(goButtonReward, typeBase == AchievementType.Nonattainment || typeBase == AchievementType.PointRunning); } - public void SetActiveGaugeUI(bool isActive) - { - GaugeUI.gameObject.SetActive(isActive); - } - public void OnRewardClick() { AchievementReceiveRewardTask achievementReceiveRewardTask = new AchievementReceiveRewardTask(); @@ -129,14 +107,6 @@ public class AchievementWindowBase : MonoBehaviour StartCoroutine(Toolbox.NetworkManager.Connect(achievementReceiveRewardTask, OnRequestRewardAchievement, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); } - public void OnDetail() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Mission_0007")); - dialogBase.SetText(strAchievementData); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - } - private void OnRequestRewardAchievement(NetworkTask.ResultCode error) { OnRequestReward(error, Data.MissionInfo.data.total_reward_list); @@ -227,7 +197,7 @@ public class AchievementWindowBase : MonoBehaviour component.onClick.Clear(); component.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + OnRewardClick(); })); } @@ -260,49 +230,6 @@ public class AchievementWindowBase : MonoBehaviour } } - public void SetCrossoverReward(CrossoverRewardInfo reward, AchievementType type, ResourceHandler resourceHandler, Action onReceiveReward) - { - _crossoverRewardInfo = reward; - _resourceHandler = resourceHandler; - SetType(type); - string texName = UserGoods.GetUserGoodsImageName((UserGoods.Type)reward.RewardType, reward.RewardDetailId); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(texName, ResourcesManager.AssetLoadPathType.Item); - _resourceHandler.Add(assetTypePath, delegate - { - if (reward.RewardDetailId == _crossoverRewardInfo.RewardDetailId) - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(texName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - achievementIconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath2); - } - }); - RankInfo rankInfo = Data.Load.data.GetRankInfo(Format.Crossover, reward.Rank); - labelAchievementTitle.text = Data.SystemText.Get("Profile_0042", Data.SystemText.Get(rankInfo.rank_name)); - labelAchievementData.text = ReceiveReward.getTitle((UserGoods.Type)reward.RewardType, reward.RewardDetailId, reward.RewardCount); - GaugeUI.gameObject.SetActive(value: false); - UIButton component = goButtonReward.GetComponent(); - component.GetComponentInChildren().text = Data.SystemText.Get("Mail_0023"); - goButtonReward.gameObject.SetActive(type != AchievementType.PointReceived); - UIManager.SetObjectToGrey(goButtonReward, type != AchievementType.PointClear); - component.onClick.Clear(); - component.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - ReceiveCrossoverReward(reward.RewardId, onReceiveReward); - })); - CopyAnchor(_labelTopRight.rightAnchor, labelAchievementTitle.rightAnchor); - } - - private void ReceiveCrossoverReward(int rewardId, Action onReceiveReward) - { - CrossoverReceiveRankRewardTask task = new CrossoverReceiveRankRewardTask(); - task.SetParameter(rewardId); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - onReceiveReward.Call(); - DialogCreator.CreateRewardReceiveDialog(task.ReceivedRewardList); - })); - } - public void SetQuestPoint(QuestRewardInfo reward, AchievementType type, ResourceHandler resourceHandler, Action onRequestRewardPointCallBack) { _questRewardInfo = reward; @@ -329,7 +256,7 @@ public class AchievementWindowBase : MonoBehaviour component.onClick.Clear(); component.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + OnQuestPointReceive(reward.Id, onRequestRewardPointCallBack); })); GetComponent().spriteName = string.Empty; @@ -378,7 +305,7 @@ public class AchievementWindowBase : MonoBehaviour component.GetComponentInChildren().text = systemText.Get("Mission_0029"); component.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ChangeMission(mission.id, mission.mission_name, onChangeMissionSuccess); })); goButtonReward.SetActive(displayChange && !mission.default_flag); @@ -452,9 +379,7 @@ public class AchievementWindowBase : MonoBehaviour private bool SetMissionWait(UserMission mission) { - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); - long num = (long)Time.realtimeSinceStartup - missionInfoTask.RequestTime; - long num2 = missionInfoTask.ServerTime + num; + long num = 0L; long num2 = 0L; // Pre-Phase-5b: MissionInfoTask headless-unreachable TimeSpan timeSpan = TimeSpan.FromSeconds(mission.start_time - num2).Add(new TimeSpan(0, 1, 0)); int num3 = timeSpan.Hours; int num4 = timeSpan.Minutes; @@ -495,7 +420,7 @@ public class AchievementWindowBase : MonoBehaviour _labelMissionPeriod.gameObject.SetActive(value: false); return; } - long nowUnixTime = GameMgr.GetIns().GetMissionInfoTask().NowUnixTime(); + long nowUnixTime = 0L; // Pre-Phase-5b: headless has no MissionInfoTask string remainingTime = ConvertTime.GetRemainingTime(TimeSpan.FromSeconds(mission.GetMissionPeriodSec(nowUnixTime))); goButtonReward.gameObject.SetActive(value: false); _labelMissionPeriod.gameObject.SetActive(value: true); @@ -531,26 +456,6 @@ public class AchievementWindowBase : MonoBehaviour }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); } - public void SetHistoryItem(ItemAcquireHistory item, bool enableSeparator, ResourceHandler resourceHandler) - { - _resourceHandler = resourceHandler; - SystemText systemText = Data.SystemText; - if (item.RewardType == 4) - { - ReceiveReward.SetTicket(item.RewardUserGoodsId, item.RewardCount, achievementIconTexture, labelAchievementTitle, _resourceHandler); - } - else - { - ReceiveReward.SetTexture((UserGoods.Type)item.RewardType, achievementIconTexture, _resourceHandler); - labelAchievementTitle.text = ReceiveReward.getTitle((UserGoods.Type)item.RewardType, item.RewardUserGoodsId, item.RewardCount); - } - labelAchievementData.text = item.Message; - labelAchievementCount.text = systemText.Get("Mail_0043", ConvertTime.ToLocal(item.AcquireTime)); - GaugeUI.gameObject.SetActive(value: false); - goButtonReward.SetActive(value: false); - _Separator.gameObject.SetActive(enableSeparator); - } - public void SetMail(MailData mail, Action OnReadMail, ResourceHandler handler) { _resourceHandler = handler; @@ -618,160 +523,4 @@ public class AchievementWindowBase : MonoBehaviour { UIManager.SetObjectToGrey(goButtonReward, b: true); } - - public void SetLottery(LotteryMissionData lotteryData, bool needCeparator) - { - string userGoodsImageName = UserGoods.GetUserGoodsImageName(lotteryData.UserGoodsType, lotteryData.ItemId); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(userGoodsImageName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - base.gameObject.GetComponent().width = 800; - achievementIconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath); - _Separator.gameObject.SetActive(needCeparator); - labelAchievementTitle.text = lotteryData.MissionTitle; - if (lotteryData.UserGoodsType == UserGoods.Type.Item) - { - labelAchievementData.text = ReceiveReward.SetTicketTitle(lotteryData.ItemId, lotteryData.ItemCount); - } - else - { - labelAchievementData.text = ReceiveReward.getTitle(lotteryData.UserGoodsType, lotteryData.ItemId, lotteryData.ItemCount); - } - goButtonReward.SetActive(value: false); - if (lotteryData.StartTime.Second > 0) - { - _missionStartTime.text = Data.SystemText.Get("Mission_0077", lotteryData.StartTime.LocalTime); - _missionStartTime.gameObject.SetActive(value: true); - } - else - { - _labelMissionPeriod.text = lotteryData.EndTime.GetShowText("Mission_0062", "Mission_0060", "Mission_0061"); - _labelMissionPeriod.gameObject.SetActive(value: true); - } - CopyAnchor(_labelTopRight.rightAnchor, labelAchievementTitle.rightAnchor); - _applyFinish.gameObject.SetActive(lotteryData.IsCleared); - _labelMissionPeriod.gameObject.SetActive(!lotteryData.IsCleared && !lotteryData.IsTimeOver); - _missionTimeOver.gameObject.SetActive(lotteryData.IsTimeOver); - GaugeLabel.text = lotteryData.MissionCurrent + "/" + lotteryData.MissionMax; - GaugeUI.Value = lotteryData.MissionRatio; - bool active = true; - if (lotteryData.IsCleared || lotteryData.MissionMax == 0) - { - active = false; - } - GaugeUI.gameObject.SetActive(active); - } - - public void SetBingoMission(BingoInfoTask.BingoMissionData missionData, bool needCeparator, ResourceHandler handler) - { - _resourceHandler = handler; - base.gameObject.GetComponent().width = 752; - base.gameObject.GetComponent().enabled = false; - alreadyReceived.gameObject.SetActive(missionData.IsCleared); - labelAchievementData.text = ReceiveReward.getTitle((UserGoods.Type)missionData.Reward.reward_type, missionData.Reward.rewardUserGoodsId, missionData.Reward.reward_count); - string textureName = UserGoods.GetUserGoodsImageName((UserGoods.Type)missionData.Reward.reward_type, missionData.Reward.rewardUserGoodsId); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item); - _resourceHandler.Add(assetTypePath, delegate - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - achievementIconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath2); - }); - CopyAnchor(_labelTopRight.rightAnchor, labelAchievementTitle.rightAnchor); - _titleLine.SetAnchor((GameObject)null); - _titleLine.spriteName = "quest_line_05"; - _titleLine.SetDimensions(610, 2); - _Separator.spriteName = "quest_line_02"; - _Separator.gameObject.SetActive(needCeparator); - goButtonReward.SetActive(value: false); - GaugeLabel.text = missionData.MissionCurrent + "/" + missionData.MissionMax; - GaugeUI.Value = missionData.MissionRatio; - labelAchievementTitle.text = missionData.MissionTitle; - } - - public void SetBingoRewardDetails(ReceivedReward reward, bool needCeparator, ResourceHandler handler) - { - _resourceHandler = handler; - base.gameObject.GetComponent().width = 752; - base.gameObject.GetComponent().enabled = false; - goButtonReward.SetActive(value: false); - _titleLine.SetAnchor((GameObject)null); - _titleLine.spriteName = "quest_line_05"; - _titleLine.SetDimensions(610, 2); - _Separator.spriteName = "quest_line_02"; - _Separator.gameObject.SetActive(needCeparator); - labelAchievementTitle.text = string.Format(Data.SystemText.Get("Bingo_0004", reward.lineNum.ToString())); - labelAchievementData.text = ReceiveReward.getTitle((UserGoods.Type)reward.reward_type, reward.rewardUserGoodsId, reward.reward_count); - GaugeUI.gameObject.SetActive(value: false); - string textureName = UserGoods.GetUserGoodsImageName((UserGoods.Type)reward.reward_type, reward.rewardUserGoodsId); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item); - _resourceHandler.Add(assetTypePath, delegate - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - achievementIconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath2); - }); - } - - public void SetBingoSideBarRewards(string lineNum, ReceivedReward reward, bool isCleared, bool needCeparator, ResourceHandler handler) - { - _resourceHandler = handler; - _Separator.gameObject.SetActive(needCeparator); - goButtonReward.SetActive(value: false); - labelAchievementTitle.text = string.Format(Data.SystemText.Get("Bingo_0004", lineNum)); - labelAchievementData.text = ReceiveReward.getTitle((UserGoods.Type)reward.reward_type, reward.rewardUserGoodsId, reward.reward_count); - alreadyReceived.gameObject.SetActive(isCleared); - string textureName = UserGoods.GetUserGoodsImageName((UserGoods.Type)reward.reward_type, reward.rewardUserGoodsId); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item); - _resourceHandler.Add(assetTypePath, delegate - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - achievementIconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath2); - }); - } - - public void SetPracticePuzzleMission(PracticePuzzleMissionData mission, ResourceHandler resourceHandler, bool canChangeMissions, bool enableSeparator, bool displayChange, Action onChangeMissionSuccess = null) - { - _resourceHandler = resourceHandler; - _Separator.gameObject.SetActive(enableSeparator); - goButtonReward.SetActive(value: false); - _ = Data.SystemText; - if (mission.UserGoodsType == UserGoods.Type.Item) - { - ReceiveReward.SetTicket(mission.ItemId, mission.ItemCount, achievementIconTexture, labelAchievementData, _resourceHandler); - } - else - { - ReceiveReward.SetTexture(mission.UserGoodsType, mission.ItemId, achievementIconTexture, _resourceHandler); - labelAchievementData.text = ReceiveReward.getTitle(mission.UserGoodsType, mission.ItemId, mission.ItemCount); - } - labelAchievementTitle.text = mission.Name; - int totalMissionCount = mission.TotalMissionCount; - bool flag = totalMissionCount > 0; - GaugeUI.gameObject.SetActive(flag); - if (flag) - { - int num = ((mission.TotalMissionCount > mission.CurrentClearCount) ? mission.CurrentClearCount : mission.TotalMissionCount); - GaugeLabel.text = num + "/" + totalMissionCount; - if (num != 0) - { - float value = (float)num / (float)totalMissionCount; - GaugeUI.Value = value; - } - else - { - GaugeUI.Value = 0f; - } - } - alreadyReceived.gameObject.SetActive(mission.IsCleared); - labelAchievementCount.gameObject.SetActive(value: false); - CopyAnchor(_labelTopRight.rightAnchor, labelAchievementTitle.rightAnchor); - } - - public void SetRedEtherMission(RedEtherCampaignRewardData rewardData, ResourceHandler resourceHandler) - { - _resourceHandler = resourceHandler; - goButtonReward.SetActive(value: false); - ReceiveReward.SetTexture(rewardData.UserGoodsType, 0L, achievementIconTexture, _resourceHandler); - labelAchievementData.text = ReceiveReward.getTitle(rewardData.UserGoodsType, 0L, rewardData.ItemCount); - labelAchievementTitle.text = rewardData.MissionText; - alreadyReceived.gameObject.SetActive(rewardData.IsCleared); - GaugeUI.gameObject.SetActive(value: false); - } } diff --git a/SVSim.BattleEngine/Engine/ActiveAnimation.cs b/SVSim.BattleEngine/Engine/ActiveAnimation.cs index 59f470da..8e32be11 100644 --- a/SVSim.BattleEngine/Engine/ActiveAnimation.cs +++ b/SVSim.BattleEngine/Engine/ActiveAnimation.cs @@ -5,16 +5,9 @@ using UnityEngine; [AddComponentMenu("NGUI/Internal/Active Animation")] public class ActiveAnimation : MonoBehaviour { - public static ActiveAnimation current; public List onFinished = new List(); - [HideInInspector] - public GameObject eventReceiver; - - [HideInInspector] - public string callWhenFinished; - private Animation mAnim; private Direction mLastDirection; @@ -103,119 +96,6 @@ public class ActiveAnimation : MonoBehaviour } } - public void Reset() - { - if (mAnim != null) - { - foreach (AnimationState item in mAnim) - { - if (mLastDirection == Direction.Reverse) - { - item.time = item.length; - } - else if (mLastDirection == Direction.Forward) - { - item.time = 0f; - } - } - return; - } - if (mAnimator != null) - { - mAnimator.Play(mClip, 0, (mLastDirection == Direction.Reverse) ? 1f : 0f); - } - } - - private void Start() - { - if (eventReceiver != null && EventDelegate.IsValid(onFinished)) - { - eventReceiver = null; - callWhenFinished = null; - } - } - - private void Update() - { - float deltaTime = RealTime.deltaTime; - if (deltaTime == 0f) - { - return; - } - if (mAnimator != null) - { - mAnimator.Update((mLastDirection == Direction.Reverse) ? (0f - deltaTime) : deltaTime); - if (isPlaying) - { - return; - } - mAnimator.enabled = false; - base.enabled = false; - } - else - { - if (!(mAnim != null)) - { - base.enabled = false; - return; - } - bool flag = false; - foreach (AnimationState item in mAnim) - { - if (!mAnim.IsPlaying(item.name)) - { - continue; - } - float num = item.speed * deltaTime; - item.time += num; - if (num < 0f) - { - if (item.time > 0f) - { - flag = true; - } - else - { - item.time = 0f; - } - } - else if (item.time < item.length) - { - flag = true; - } - else - { - item.time = item.length; - } - } - mAnim.Sample(); - if (flag) - { - return; - } - base.enabled = false; - } - if (!mNotify) - { - return; - } - mNotify = false; - if (current == null) - { - current = this; - EventDelegate.Execute(onFinished); - if (eventReceiver != null && !string.IsNullOrEmpty(callWhenFinished)) - { - eventReceiver.SendMessage(callWhenFinished, SendMessageOptions.DontRequireReceiver); - } - current = null; - } - if (mDisableDirection != Direction.Toggle && mLastDirection == mDisableDirection) - { - NGUITools.SetActive(base.gameObject, state: false); - } - } - private void Play(string clipName, Direction playDirection) { if (playDirection == Direction.Toggle) @@ -308,16 +188,6 @@ public class ActiveAnimation : MonoBehaviour return activeAnimation; } - public static ActiveAnimation Play(Animation anim, string clipName, Direction playDirection) - { - return Play(anim, clipName, playDirection, EnableCondition.DoNothing, DisableCondition.DoNotDisable); - } - - public static ActiveAnimation Play(Animation anim, Direction playDirection) - { - return Play(anim, null, playDirection, EnableCondition.DoNothing, DisableCondition.DoNotDisable); - } - public static ActiveAnimation Play(Animator anim, string clipName, Direction playDirection, EnableCondition enableBeforePlay, DisableCondition disableCondition) { if (enableBeforePlay != EnableCondition.IgnoreDisabledState && !NGUITools.GetActive(anim.gameObject)) diff --git a/SVSim.BattleEngine/Engine/AddTargetInfo.cs b/SVSim.BattleEngine/Engine/AddTargetInfo.cs index 5b46fc8e..00680dce 100644 --- a/SVSim.BattleEngine/Engine/AddTargetInfo.cs +++ b/SVSim.BattleEngine/Engine/AddTargetInfo.cs @@ -52,15 +52,6 @@ public class AddTargetInfo _skillCreator.SetupSkillTargetOld(_targetFilter, _ownerCard, list2, skill); } - public List GetAddTargetCard(SkillBase skill, BattlePlayerReadOnlyInfoPair pair, SkillConditionCheckerOption checkerOption, SkillOptionValue optionValue) - { - if (typeCheck(skill) && FilterComparison(skill.ApplyFilterCollection)) - { - return _targetFilter.Filtering(pair, checkerOption, optionValue).Cast().ToList(); - } - return null; - } - private Func SetTypeCheck(string skillType, string ownerCardType) { if (skillType != null && skillType == "damage") @@ -83,22 +74,6 @@ public class AddTargetInfo }; } - private bool FilterComparison(ApplySkillTargetFilterCollection ownerSkillFilter) - { - if (_conditionFilter.BattlePlayerFilter.GetType() == ownerSkillFilter.BattlePlayerFilter.GetType() && _conditionFilter.TargetFilter.GetType() == ownerSkillFilter.TargetFilter.GetType()) - { - foreach (ISkillCardFilter cardType in _conditionFilter.CardFilterList) - { - if (!ownerSkillFilter.CardFilterList.Any((ISkillCardFilter s) => s.GetType() == cardType.GetType())) - { - return false; - } - } - return true; - } - return false; - } - public AddTargetInfo Clone(BattleCardBase ownerCard) { return new AddTargetInfo(ownerCard, _conditionFilterText, _targetFilterText, _skillTypeText, _ownerCardtype, null); diff --git a/SVSim.BattleEngine/Engine/AlleyField.cs b/SVSim.BattleEngine/Engine/AlleyField.cs index ac666455..5f04e846 100644 --- a/SVSim.BattleEngine/Engine/AlleyField.cs +++ b/SVSim.BattleEngine/Engine/AlleyField.cs @@ -1,77 +1,15 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class AlleyField : BackGroundBase { public override int FieldId => 22; - public override int FieldEffectId => 22; public AlleyField(string bgmId = "NONE") : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_aley_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles22").gameObject; - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_22, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_22_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(2750f, -510f, -10f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-10f, -53f, 84f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(300f, -30f, -150f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-11f, -100f, 92f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1") - { - _ = _gimicCntDictionary[obj.tag]; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/ApiType.cs b/SVSim.BattleEngine/Engine/ApiType.cs index 5bb6bfe5..790c72c5 100644 --- a/SVSim.BattleEngine/Engine/ApiType.cs +++ b/SVSim.BattleEngine/Engine/ApiType.cs @@ -4,7 +4,6 @@ public class ApiType { public enum Type { - SignUp, Load, GetCardMaster, Mypage, @@ -62,7 +61,6 @@ public class ApiType LimitedStoryFinish, LimitedStorySection, LimitedStoryLeaderSelect, - LimitedStoryGetDeckList, EventStorySection, EventStoryLeaderSelect, EventStoryInfo, @@ -134,7 +132,6 @@ public class ApiType RankMatchFinishRotation, RankMatchFinishUnlimited, RankMatchFinishCrossover, - FreeMatchSetParam, FreeMatchFinishRotation, FreeMatchFinishUnlimited, FreeMatchFinishPreRotation, @@ -260,7 +257,6 @@ public class ApiType OpenRoomMultiGetHistory, EventRoomMultiDeckSet, EventRoomMultiResetHistory, - EventRoomRetire, OpenRoomMultiDeckBanDecideBan, OpenRoomGetDeckHof, OpenRoomSetDeckHof, @@ -391,11 +387,6 @@ public class ApiType DebugReleaseClassChara, DebugAddBattlePoint, DebugTutorialUpdate, - PaymentItemList, - PaymentStart, - PaymentCancel, - PaymentFinish, - BirthUpdate, EmblemInfo, EmblemUpdate, EmblemFavorite, diff --git a/SVSim.BattleEngine/Engine/ApplySkillTargetFilterCollection.cs b/SVSim.BattleEngine/Engine/ApplySkillTargetFilterCollection.cs index 481d5a47..f4f2f91e 100644 --- a/SVSim.BattleEngine/Engine/ApplySkillTargetFilterCollection.cs +++ b/SVSim.BattleEngine/Engine/ApplySkillTargetFilterCollection.cs @@ -34,7 +34,7 @@ public class ApplySkillTargetFilterCollection : SkillFilterCollectionBase if (base.TargetFilter != null) { list = base.TargetFilter.Filtering(battlePlayerInfos, checkerOption).ToList(); - if (BattleManagerBase.GetIns().XorShiftRandom(isSelf: true) != null && BattleManagerBase.GetIns().XorShiftRandom(isSelf: false) == null && !pair.ReadOnlySelf.IsPlayer && (base.TargetFilter is SkillTargetInHandCardFilter || base.TargetFilter is SkillTargetReturnCardFilter || base.TargetFilter is SkillTargetTokenDrawCardFilter)) + if (false /* Pre-Phase-5b: XorShiftRandom is a mgr-instance feature; guard collapses to false */) { return list; } diff --git a/SVSim.BattleEngine/Engine/AreaBGInfo.cs b/SVSim.BattleEngine/Engine/AreaBGInfo.cs index 91272c34..fd7571c9 100644 --- a/SVSim.BattleEngine/Engine/AreaBGInfo.cs +++ b/SVSim.BattleEngine/Engine/AreaBGInfo.cs @@ -10,7 +10,7 @@ public class AreaBGInfo : MonoBehaviour SectionId = 2, ExtraTextureChapter = 10, BGExtraEffectPath = "scn_map_change_1", - SeType = Se.TYPE.SE_MAP_TREE_EFFECT + SeType = 0 }, new ChapterExtraData { @@ -31,7 +31,7 @@ public class AreaBGInfo : MonoBehaviour SectionId = 1, ExtraTextureChapter = 4, BGExtraEffectPath = "scn_map_change_1", - SeType = Se.TYPE.SE_MAP_TREE_EFFECT, + SeType = 0, ClanType = CardBasePrm.ClanType.NEMESIS }, new ChapterExtraData @@ -57,8 +57,8 @@ public class AreaBGInfo : MonoBehaviour BGSectionId = 4, BGExtraEffectPath = "scn_map_change_4", BGFirstClearEffectPath = "scn_map_change_2", - FirstClearSeType = Se.TYPE.SE_MAP_SECTION9_CHAPTER1, - SeType = Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER, + FirstClearSeType = 0, + SeType = 0, ChapterMoveTime = 0f, FirstClearEffectDelayTime = 1.2f, FirstClearMoveOutDelayTime = 0.5f @@ -70,8 +70,8 @@ public class AreaBGInfo : MonoBehaviour BGSectionId = 7, BGExtraEffectPath = "scn_map_change_4", BGFirstClearEffectPath = "scn_map_change_3", - FirstClearSeType = Se.TYPE.SE_MAP_SECTION9_CHAPTER2, - SeType = Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER, + FirstClearSeType = 0, + SeType = 0, FirstClearEffectDelayTime = 1.2f, FirstClearMoveDelayTime = 1f }, diff --git a/SVSim.BattleEngine/Engine/AreaBGInfoSection20.cs b/SVSim.BattleEngine/Engine/AreaBGInfoSection20.cs index 137abd2d..a49cd35d 100644 --- a/SVSim.BattleEngine/Engine/AreaBGInfoSection20.cs +++ b/SVSim.BattleEngine/Engine/AreaBGInfoSection20.cs @@ -3,37 +3,6 @@ using Cute; public class AreaBGInfoSection20 { - public const int SECTION_ID = 20; - - public const int WERUSA_START = 10; - - private const int WERUSA_END = 17; - - private const int WERUSA_BG_SECTION_ID = 12; - - private const int LEVIRU_START = 18; - - private const int LEVIRU_END = 25; - - private const int LEVIRU_BG_SECTION_ID = 10; - - private const int IZUNIA_CHANGE_TEXTURE_START = 3; - - private const int IZUNIA_END = 9; - - private const int IZUNIA_BG_SECTION_ID = 2; - - public const int NATERA_START = 26; - - private const int NATERA_END = 33; - - private const int NATERA_BG_SECTION_ID = 9; - - private const int LAST_BATTLE_START = 34; - - private const int LAST_BATTLE_END = 40; - - private const int LAST_BATTLE_BG_SECTION_ID = 20; public static List GetChapterExtraDatas() { @@ -62,7 +31,7 @@ public class AreaBGInfoSection20 if (i == 17 || i == 25 || i == 33) { chapterExtraData.BGExtraEffectPath = "scn_map_change_9"; - chapterExtraData.SeType = Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER; + chapterExtraData.SeType = 0; } if (extraTextureIndex.IsNotNullOrEmpty()) { @@ -83,7 +52,7 @@ public class AreaBGInfoSection20 SectionId = 20, ExtraTextureChapter = 1, BGExtraEffectPath = "scn_map_change_9", - SeType = Se.TYPE.SE_MAP_SECTION20_CHANGE_CHAPTER1 + SeType = 0 }, new ChapterExtraData { @@ -91,7 +60,7 @@ public class AreaBGInfoSection20 ExtraTextureChapter = 2, BGExtraEffectPath = "scn_map_change_8", AttachExtraEffectToBgRoot = true, - SeType = Se.TYPE.SE_MAP_TREE_EFFECT + SeType = 0 } }; } @@ -112,7 +81,7 @@ public class AreaBGInfoSection20 if (i == 9) { chapterExtraData.BGExtraEffectPath = "scn_map_change_9"; - chapterExtraData.SeType = Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER; + chapterExtraData.SeType = 0; } list.Add(chapterExtraData); } diff --git a/SVSim.BattleEngine/Engine/AreaSelInfo.cs b/SVSim.BattleEngine/Engine/AreaSelInfo.cs index 0f282ed5..fb929e2b 100644 --- a/SVSim.BattleEngine/Engine/AreaSelInfo.cs +++ b/SVSim.BattleEngine/Engine/AreaSelInfo.cs @@ -8,24 +8,10 @@ public class AreaSelInfo : MonoBehaviour { private enum eTableCategory { - CARD, - SLEEVE, - OTHER, - MAX } - private const float LEFTSTAGEINFO_X_IN = 0f; - - private const float LEFTSTAGEINFO_X_OUT = -1120f; - - private const int CLEARPRESENT_MAX = 3; - private static readonly Vector3 CLEARPRESENT_CARD_COLLISIONSIZE = new Vector3(175f, 230f, 1f); - private const int CLEARPRESENT_CARD_DEPTHOFFSET = 50; - - private const int CLEARPRESENT_RESOURCELIST_CAPACITY = 2; - private static readonly string[] CLEARPRESENT_NAME = new string[10] { "", "Common_0205", "", "Common_0201", "", "", "", "", "", "Common_0115" }; private static readonly string[] CLEARPRESENT_THUMBNAIL_SPRITENAME = new string[10] { "", "thumbnail_liquid", "", "thumbnail_crystal", "", "", "thumbnail_card", "thumbnail_emblem", "thumbnail_title", "thumbnail_rupy" }; @@ -34,12 +20,6 @@ public class AreaSelInfo : MonoBehaviour private readonly Vector3 REWARD_TABLE_CARD_POSITION = new Vector3(28.5f, -85.3f, 0f); - private const float TABLE_CONTAINS_CARD_REWARD_OFFSET_X = -16f; - - private const int REWARD_BG_BASIC_WIDTH = 250; - - private const int REWARD_BG_OFFSET_WIDTH_PER_GOODS = 90; - private readonly Dictionary REWARD_BG_OFFSET_MAGNIFICATION = new Dictionary { { @@ -76,8 +56,6 @@ public class AreaSelInfo : MonoBehaviour } }; - private const float LABEL_ONLY_DEGREE_OFFSET_Y = -10f; - [SerializeField] private GameObject _clearRewardPrefab; @@ -436,11 +414,6 @@ public class AreaSelInfo : MonoBehaviour return _isLoadEnd; } - public void ResetInfoPosition() - { - base.gameObject.transform.localPosition = new Vector3(0f, base.gameObject.transform.localPosition.y, base.gameObject.transform.localPosition.z); - } - public void MoveToScreen(bool isIn, bool isImmediate) { MoveToScreenObj(base.gameObject, isIn ? 0f : (-1120f), isImmediate ? 0f : 0.5f); @@ -503,7 +476,7 @@ public class AreaSelInfo : MonoBehaviour } case UserGoods.Type.Skin: { - ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId((int)userGoodsId); + ClassCharacterMasterData charaPrmByCharaId = null; // Pre-Phase-5b: no chara master headless if (charaPrmByCharaId == null) { return string.Empty; diff --git a/SVSim.BattleEngine/Engine/AreaSelectBG.cs b/SVSim.BattleEngine/Engine/AreaSelectBG.cs index dd45e197..fb8b1a2d 100644 --- a/SVSim.BattleEngine/Engine/AreaSelectBG.cs +++ b/SVSim.BattleEngine/Engine/AreaSelectBG.cs @@ -8,31 +8,6 @@ using UnityEngine; [Serializable] public class AreaSelectBG { - private const float BGTEXTURE_WIDTH = 1024f; - - private const float BGTEXTURE_HEIGHT = 1024f; - - private const int BGTEXTURE_NUM_X = 4; - - private const int BGTEXTURE_NUM_Y = 3; - - private const float BGTEXTURE_WIDTH_HALF_LEFT = 2048f; - - private const float BGTEXTURE_WIDTH_HALF_RIGHT = 2560f; - - private const float BGTEXTURE_HEIGHT_HALF_UP = 1536f; - - private const float BGTEXTURE_HEIGHT_HALF_BOTTOM = 1536f; - - private const float BGTEXTURE_DRAG_MARGIN = 5f; - - private const float BGTEXTURE_DRAG_DECELERATION = 0.875f; - - private const float BGTEXTURE_DRAGARROW_ANIM_SPEED = 1f; - - private const float BGDRAG_SEC_MAXSPEED = 0.25f; - - private const float BGDRAG_SEC_RESETUPTOTIME_MAX = 0.5f; private AreaSelectUI _areaSelectUI; @@ -74,8 +49,6 @@ public class AreaSelectBG private bool _isNormalBgSet = true; - private bool _changeChapterFirstCall = true; - private float _currentAspectRatio; private Vector3 _currentBGScale = Vector3.one; @@ -145,11 +118,6 @@ public class AreaSelectBG return Toolbox.ResourcesManager.GetAssetTypePath("bg_story_" + backGroundId.ToString("00") + "_" + (index + 1).ToString("00"), ResourcesManager.AssetLoadPathType.Background, isFetch); } - private string GetExtraBackGroundPath(StorySectionData sectionData, int index, string suffix, bool isFetch = false) - { - return Toolbox.ResourcesManager.GetAssetTypePath("bg_story_" + sectionData.BackGroundId.ToString("00") + "_" + (index + 1).ToString("00") + suffix, ResourcesManager.AssetLoadPathType.Background, isFetch); - } - private string GetExtraBackGroundPath(int backgroundId, int index, string suffix, bool isFetch = false) { return Toolbox.ResourcesManager.GetAssetTypePath("bg_story_" + backgroundId.ToString("00") + "_" + (index + 1).ToString("00") + suffix, ResourcesManager.AssetLoadPathType.Background, isFetch); @@ -275,8 +243,9 @@ public class AreaSelectBG extraChapter.ExtraEffect.transform.parent = _areaSelectUI.transform; } extraChapter.ExtraEffect.SetActive(value: false); - List collection = GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(extraChapter.ExtraEffect, null); - _loadedResources.AddRange(collection); + // Pre-Phase-5b: GameMgr.GetEffectMgr().SetUIParticleShader queued the ExtraEffect + // for shader-swap and returned load-time resource paths for cleanup. Headless has + // no EffectMgr and no visible ExtraEffect; the resource tracker doesn't fire either. } if (!string.IsNullOrEmpty(extraChapter.BGFirstClearEffectPath)) { @@ -284,15 +253,13 @@ public class AreaSelectBG extraChapter.FirstClearEffect = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(assetTypePath2) as GameObject); extraChapter.FirstClearEffect.transform.parent = _areaSelectUI.transform; extraChapter.FirstClearEffect.SetActive(value: false); - List collection2 = GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(extraChapter.FirstClearEffect, null); - _loadedResources.AddRange(collection2); + // Pre-Phase-5b: same shader-swap pattern for FirstClearEffect. See ExtraEffect above. } } - List collection3 = GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list, delegate - { - _isLoadEndParticle = true; - }); - _loadedResources.AddRange(collection3); + // Pre-Phase-5b: shader-swap on the collected particle systems, then callback flipped the + // `_isLoadEndParticle` flag. Headless has no EffectMgr; set the flag directly here so the + // GetLoadEnd() gate is coherent. + _isLoadEndParticle = true; _isLoadEndBGTexture = true; } @@ -369,35 +336,6 @@ public class AreaSelectBG return source.Select((ChapterExtraData s) => s.ExtraTextureChapter).ToList(); } - public void SetExtraEffect(int chapterId, bool isFirstClear = false) - { - if (_extraChapters.Count == 0) - { - return; - } - List list = new List(); - list = ((BeforeChapterId >= chapterId) ? _extraChapters.FindAll((ChapterExtraData n) => n.ExtraTextureChapter != 0 && BeforeChapterId > n.ExtraTextureChapter && n.ExtraTextureChapter >= chapterId) : _extraChapters.FindAll((ChapterExtraData n) => n.ExtraTextureChapter != 0 && BeforeChapterId <= n.ExtraTextureChapter && n.ExtraTextureChapter < chapterId)); - BeforeChapterId = chapterId; - TransitionChapterExtraData = list.FirstOrDefault((ChapterExtraData n) => n.ExtraEffect != null); - if (isFirstClear) - { - return; - } - if (list.Count() == 0 || TransitionChapterExtraData == null) - { - _changeChapterFirstCall = false; - return; - } - TransitionChapterExtraData = list.FirstOrDefault((ChapterExtraData n) => n.ExtraEffect != null); - if (!_changeChapterFirstCall && TransitionChapterExtraData != null && TransitionChapterExtraData.ExtraEffect != null) - { - TransitionChapterExtraData.ExtraEffect.SetActive(value: false); - TransitionChapterExtraData.ExtraEffect.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySe(TransitionChapterExtraData.SeType); - } - _changeChapterFirstCall = false; - } - public IEnumerator SetClearEffect() { ChapterExtraData clearChapterExtraData = _extraChapters.FirstOrDefault((ChapterExtraData n) => n.ExtraTextureChapter == BeforeChapterId); @@ -406,7 +344,7 @@ public class AreaSelectBG yield return new WaitForSeconds(clearChapterExtraData.FirstClearEffectDelayTime); clearChapterExtraData.FirstClearEffect.SetActive(value: false); clearChapterExtraData.FirstClearEffect.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySe(clearChapterExtraData.FirstClearSeType); + } } diff --git a/SVSim.BattleEngine/Engine/AreaSelectChapterEffect.cs b/SVSim.BattleEngine/Engine/AreaSelectChapterEffect.cs index ac2f5450..8c9ba1f9 100644 --- a/SVSim.BattleEngine/Engine/AreaSelectChapterEffect.cs +++ b/SVSim.BattleEngine/Engine/AreaSelectChapterEffect.cs @@ -79,10 +79,9 @@ public class AreaSelectChapterEffect } } } - _loadedResources.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list, delegate - { - _isLoadEnd = true; - })); + // Pre-Phase-5b: SetUIParticleShader queued shader swap + callback flipped _isLoadEnd. + // Headless has no EffectMgr; flip the load-end flag inline. + _isLoadEnd = true; })); } diff --git a/SVSim.BattleEngine/Engine/AreaSelectMapIcon.cs b/SVSim.BattleEngine/Engine/AreaSelectMapIcon.cs index e648ae42..54d35406 100644 --- a/SVSim.BattleEngine/Engine/AreaSelectMapIcon.cs +++ b/SVSim.BattleEngine/Engine/AreaSelectMapIcon.cs @@ -2,21 +2,14 @@ using System; using System.Collections.Generic; using UnityEngine; +// Post-Phase-5b (2026-07-03) UI stub. AreaSelectMapIcon is chapter-select map +// icon particle effects (Start/Stop of CMN_MAP_MAPICON_CLEARED etc.). Every +// EffectMgr call is a Unity3D particle system launch that never fires headless. +// AreaSelectUI holds a single instance and its methods are only invoked from +// UI callbacks. Surface preserved as no-ops so AreaSelectUI still compiles. [Serializable] public class AreaSelectMapIcon { - public const int MAPICONLIST_CAPACITY_DEFAULT = 8; - - private readonly string MAP_ICON_EFFECT_NAME_CIRCLE4 = "ef_circle4_add_nor_1"; - - private readonly string MAP_ICON_EFFECT_NAME_TWINKLE1 = "ef_twinkle1_add_nor_1"; - - private readonly Color32 MAP_ICON_EFFECT_COLOR_CLEARED = new Color32(byte.MaxValue, 192, 64, byte.MaxValue); - - private readonly Color32 MAP_ICON_EFFECT_COLOR_ALREADY_READ_CIRCLE4 = new Color32(78, 95, 125, byte.MaxValue); - - private readonly Color32 MAP_ICON_EFFECT_COLOR_ALREADY_READ_TWINKLE1 = new Color32(190, 218, 242, byte.MaxValue); - [SerializeField] private GameObject MapIconRoot; @@ -25,114 +18,41 @@ public class AreaSelectMapIcon private List MapIconList; - private GameObject MapIconEffect; - public void Init() { } public void Term() { - MapIconEffect = null; - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_MAP_MAPICON_CLEARED); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_MAP_MAPICON_NOTCLEARED); } public void SetupMapIcon(List chapterDataList) { - if (MapIconList != null) - { - int i = 0; - for (int count = MapIconList.Count; i < count; i++) - { - UnityEngine.Object.Destroy(MapIconList[i].gameObject); - } - } - MapIconList = new List(8); - UISprite uISprite = null; - for (int j = 0; j < chapterDataList.Count; j++) - { - if (chapterDataList[j].IsReleased) - { - uISprite = UnityEngine.Object.Instantiate(MapIconOriginal); - if (!(null == uISprite)) - { - uISprite.transform.parent = MapIconRoot.transform; - uISprite.transform.localPosition = new Vector3(chapterDataList[j].MapIconPos.x, chapterDataList[j].MapIconPos.y); - uISprite.transform.localScale = Vector3.one; - uISprite.name = "mapicon_" + j; - uISprite.gameObject.SetActive(chapterDataList[j].IsDisplayMapIcon); - MapIconList.Add(uISprite); - } - } - } - MapIconOriginal.gameObject.SetActive(value: false); } public Vector3 GetMapIconPos(int chapterIndex, bool isLocal) { - if (MapIconList == null) - { - return Vector3.zero; - } - if (chapterIndex < 0 || chapterIndex >= MapIconList.Count) - { - return Vector3.zero; - } - if (!isLocal) - { - return MapIconList[chapterIndex].transform.position; - } - return MapIconList[chapterIndex].transform.localPosition; + return Vector3.zero; } public void SetActiveMapIcon(int chapterIndex, bool isActive) { - if (chapterIndex >= 0 && chapterIndex < MapIconList.Count) - { - MapIconList[chapterIndex].gameObject.SetActive(isActive); - } } public void StartMapIconEffect(StoryChapterData.ChapterClearStatus clearState, int chapterIndex) { - Effect effect = null; - switch (clearState) - { - case StoryChapterData.ChapterClearStatus.Cleared: - effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_MAP_MAPICON_CLEARED); - effect.ChangeParticleColor(MAP_ICON_EFFECT_COLOR_CLEARED); - break; - case StoryChapterData.ChapterClearStatus.AlreadyRead: - effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_MAP_MAPICON_CLEARED); - MotionUtils.ChangeParticleSystemColor(effect.transform.Find(MAP_ICON_EFFECT_NAME_CIRCLE4).gameObject, MAP_ICON_EFFECT_COLOR_ALREADY_READ_CIRCLE4); - MotionUtils.ChangeParticleSystemColor(effect.transform.Find(MAP_ICON_EFFECT_NAME_TWINKLE1).gameObject, MAP_ICON_EFFECT_COLOR_ALREADY_READ_TWINKLE1); - break; - default: - effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_MAP_MAPICON_NOTCLEARED); - break; - } - MapIconEffect = effect.GetGameObjIns(); - UpdateMapIconEffectPos(chapterIndex); } public void StopMapIconEffect() { - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_MAP_MAPICON_CLEARED); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_MAP_MAPICON_NOTCLEARED); } public void UpdateMapIconEffectPos(int chapterIndex) { - if (MapIconList != null && chapterIndex >= 0 && chapterIndex < MapIconList.Count && !(null == MapIconEffect)) - { - Vector3 position = MapIconList[chapterIndex].transform.position; - MapIconEffect.transform.position = position; - } } public GameObject GetMapIconObject(int chapterIndex) { - return MapIconList[chapterIndex].gameObject; + return null; } } diff --git a/SVSim.BattleEngine/Engine/AreaSelectUI.cs b/SVSim.BattleEngine/Engine/AreaSelectUI.cs index ea6bc67b..5a85b3e4 100644 --- a/SVSim.BattleEngine/Engine/AreaSelectUI.cs +++ b/SVSim.BattleEngine/Engine/AreaSelectUI.cs @@ -28,16 +28,6 @@ public class AreaSelectUI : UIBase Loaded } - private const float CLEAR_EFFECT_WAIT_SEC = 1.1f; - - private const float CLEAR_LABEL_DELAY_SEC = 0.4f; - - private const float NEWCHAPTER_FOCUS_SEC = 1f; - - private const float NEWCHAPTER_FOCUS_MAPICON_ENABLE_THRESHOLD = 0.55f; - - private const float MAPICON_EFFECTWAIT_SEC = 0.05f; - private CHAPTERUNLOCK_STATE StateChapterUnlock; private float NewAreaTimer; @@ -60,32 +50,6 @@ public class AreaSelectUI : UIBase private List _loadEffectResources = new List(); - public static readonly string CUESHEETNAME_MAP = "se_st_map"; - - public const int CHAPTERLIST_CAPACITY_DEFAULT = 8; - - private const int SORTINGORDER_EFFECT_OVER = 1; - - private const float PLAYERICON_Y = -320f; - - private const float TITLEPANEL_X_IN = 0f; - - private const float TITLEPANEL_X_OUT = 949f; - - private const float CHAPTERLIST_X_IN = -200f; - - private const float CHAPTERLIST_X_OUT = 400f; - - private const int CHAPTERLISTICON_MAX = 5; - - public const float CHAPTERLISTICON_OFFSET_Y = 80f; - - public const int CHAPTERLISTICON_MARGIN = 50; - - public const float CHAPTERLIST_SCROLL_RADIUS = 200f; - - public const float CHAPTERLIST_SWITCH_SEC = 0.5f; - private static readonly Vector2 CHAPTERLIST_PANEL_CLIPOFFSET = new Vector2(0f, -420f); private static readonly Vector2 CHAPTERLIST_PANEL_CLIPPOS = new Vector2(0f, 0f); @@ -189,8 +153,6 @@ public class AreaSelectUI : UIBase private bool _isBackTransitionStarted; - private IProcessing _firstSelectionProcessing; - private StoryChapterData _anotherEndingAppearanceAnimationChapterData; private GameObject _anotherEndingAppearanceEffect; @@ -203,20 +165,6 @@ public class AreaSelectUI : UIBase public static readonly Vector3 BG_SCALE_ZOOMIN = new Vector3(0.6f, 0.6f, 0.6f); - public const float BG_POS_ZOOMIN_OFFSET_Y = -400f; - - private const float CHAPTERLISTROOT_X_OUT = 800f; - - private const float CHAPTERLISTROOT_X_IN = -25f; - - private const float MAPMOVE_TIMER_IDLE = 1f; - - private const float MAPMOVE_TIMER_ZOOMIN = 1f; - - private const float MAPMOVE_TIMER_TOEND = 1f; - - private const float ANOTHER_ENDING_APPEARANCE_ANIMATION_TIME = 1.5f; - [SerializeField] private iTween.EaseType BG_ZOOMIN_EASETYPE = iTween.EaseType.easeInOutCubic; @@ -461,7 +409,7 @@ public class AreaSelectUI : UIBase { _chapterSelectButtonList[_selectChapterIndex].OnStartClearEffect(); IsClearLabelDisplayed = false; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_MAP_CLEAR); + GameObject obj = ((_selectChapterData.ClearStatus == StoryChapterData.ChapterClearStatus.Cleared) ? _clearEffect : _alreadyReadEffect); obj.transform.parent = _clearEffectPlayingChapter.ClearLabelTransform; obj.transform.localPosition = Vector3.zero; @@ -489,8 +437,8 @@ public class AreaSelectUI : UIBase { _mapIcon.SetActiveMapIcon(_selectChapterIndex, isActive: true); Vector3 mapIconPos = _mapIcon.GetMapIconPos(_selectChapterIndex, isLocal: false); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_MAP_CHAPTER_1, mapIconPos.x, mapIconPos.y); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_MAP_NEW_AREA_RELEASE); + // Pre-Phase-5b: fired CMN_MAP_CHAPTER_1 UI VFX. Dropped headless. + } IsNewMapIconOpened = true; } @@ -504,7 +452,7 @@ public class AreaSelectUI : UIBase private void StateUnlockChapter_FocusNewChapter_Enter() { SelectChapter(nowAreaAllNum - 1, isplayse: false, iscalcscroll: true, ismapiconeffectenable: false, isFirstClear: true); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_MAP_CAMERA_MOVE); + NewAreaTimer = ((_BG.TransitionChapterExtraData == null) ? 1f : (1f + _BG.TransitionChapterExtraData.FirstClearMoveOutDelayTime)); IsNewMapIconOpened = false; } @@ -599,19 +547,19 @@ public class AreaSelectUI : UIBase protected override void onClose() { - GameMgr.GetIns().GetEffectMgr().StopBuff(EffectMgr.EffectType.CMN_MAP_PLAYERICON, PlayerIcon); + // Pre-Phase-5b: StopBuff CMN_MAP_PLAYERICON. Dropped headless. _mapIcon.Term(); _chapterEffect.UnLoadEffect(); _chapterEffect.Term(); StopEffectTap(); if (LoadStatusTutorialEffect.Loaded == _loadStatusTutorialEffect) { - GameMgr.GetIns().GetEffectMgr().DisposeLatestMadeEffects(); + // Pre-Phase-5b: DisposeLatestMadeEffects. Dropped headless. _loadStatusTutorialEffect = LoadStatusTutorialEffect.NotLoad; } Toolbox.ResourcesManager.RemoveAssetGroup(_resourcePathList); _resourcePathList.Clear(); - GameMgr.GetIns().GetSoundMgr().UnloadSe(CUESHEETNAME_MAP); + UnloadUnlockChapterResources(); _BG.UnLoadBG(); _BG.Term(); @@ -631,7 +579,7 @@ public class AreaSelectUI : UIBase { if (chapterindex == _selectChapterIndex) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + StopEffectTap(); ExecuteSelectionProcessings(); } @@ -666,7 +614,7 @@ public class AreaSelectUI : UIBase { if (chapterindex == _selectChapterIndex) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ExecuteSelectionProcessings(); } else @@ -676,20 +624,12 @@ public class AreaSelectUI : UIBase } } - private void OnCancelScenarioSummary() - { - if (IsUseChapterListTapEffect) - { - StartEffectTap(); - } - } - private void StartEffectTap() { if (IsUseChapterListTapEffect && !(null != ChapterListTapEffect)) { ChapterListTapEffectLocator = _chapterSelectButtonList[_chapterSelectButtonList.Count - 1].TapEffectLocator; - ChapterListTapEffect = GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_TUTORIAL_TAP_1, ChapterListTapEffectLocator); + ChapterListTapEffect = null; // Pre-Phase-5b: StartBuff CMN_TUTORIAL_TAP_1. Dropped headless. } } @@ -697,7 +637,7 @@ public class AreaSelectUI : UIBase { if (!(null == ChapterListTapEffectLocator)) { - GameMgr.GetIns().GetEffectMgr().StopBuff(EffectMgr.EffectType.CMN_TUTORIAL_TAP_1, ChapterListTapEffectLocator); + // Pre-Phase-5b: StopBuff CMN_TUTORIAL_TAP_1. Dropped headless. ChapterListTapEffectLocator = null; ChapterListTapEffect = null; } @@ -818,7 +758,7 @@ public class AreaSelectUI : UIBase _BG.SetBGDragEnable(!enable); if (isplayse) { - GameMgr.GetIns().GetSoundMgr().PlaySe(enable ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + } } @@ -856,7 +796,6 @@ public class AreaSelectUI : UIBase _chapterEffect.Init(this, base.transform); SetPlayerIconVisible(isvisible: false); PlayerIcon.transform.localPosition = new Vector3(0f, -320f, 0f); - _firstSelectionProcessing = CreateSelectionProcessings(SectionData.IsTutorialCategory); StartCoroutine(Setup()); } @@ -917,12 +856,11 @@ public class AreaSelectUI : UIBase if (IsUseChapterListTapEffect) { _loadStatusTutorialEffect = LoadStatusTutorialEffect.Loading; - GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectTutorialData", isBattle: false, isField: false, isBattleEffect: false, delegate - { - _loadStatusTutorialEffect = LoadStatusTutorialEffect.Loaded; - }); + // Pre-Phase-5b: async-loaded tutorial effect JSON via EffectMgr; callback flipped the + // load-status flag. Headless has no EffectMgr; mark loaded synchronously so the + // LoadStatusTutorialEffect state machine stays coherent. + _loadStatusTutorialEffect = LoadStatusTutorialEffect.Loaded; } - GameMgr.GetIns().GetSoundMgr().LoadSe(CUESHEETNAME_MAP); _scenarioSummary = new ScenarioSummary(SectionId, SectionClassId); yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_resourcePathList, null)); bool isLoadedClearEffect = false; @@ -1039,7 +977,7 @@ public class AreaSelectUI : UIBase _chapterRewardPanel.SetClearPresent(_selectChapterData); if (isplayse) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SCROLL); + } if (iscalcscroll) { @@ -1125,30 +1063,6 @@ public class AreaSelectUI : UIBase { } - private static void ShowBuildDeckBuyConfirmDialog(int currentCount, int maxCount) - { - int productId = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_ID); - if (currentCount < maxCount) - { - SystemText systemText = Data.SystemText; - string message = systemText.Get("Story_0057"); - if (currentCount > 0) - { - message = systemText.Get("Story_0058"); - } - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(message); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("Story_0056")); - dialogBase.SetButtonText(systemText.Get("Shop_0095"), systemText.Get("Common_0005")); - dialogBase.onPushButton1 = delegate - { - BuildDeckPurchasePage.BuildDeckConfirmDialogShow(productId); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.BuildDeckPurchasePage); - UIManager.GetInstance()._Footer.UpdateCurrentIndex(5); - }; - } - } - private void SetupChapterDataListTutorial() { Data.StoryInfo.ChapterDataList = Data.Master.TutorialAreaSelectList.Select((TutorialAreaSelect x) => new StoryChapterData(x)).ToList(); @@ -1211,11 +1125,11 @@ public class AreaSelectUI : UIBase { if (isvisible) { - GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_MAP_PLAYERICON, PlayerIcon); + // Pre-Phase-5b: StartBuff CMN_MAP_PLAYERICON. Dropped headless. } else { - GameMgr.GetIns().GetEffectMgr().StopBuff(EffectMgr.EffectType.CMN_MAP_PLAYERICON, PlayerIcon); + // Pre-Phase-5b: StopBuff CMN_MAP_PLAYERICON. Dropped headless. } } @@ -1260,43 +1174,8 @@ public class AreaSelectUI : UIBase SelectedStoryInfo.ClearInfoForChapterSelectionScene(); } - private static IProcessing CreateSelectionProcessings(bool isTutorialCategory) +private void ExecuteSelectionProcessings() { - IProcessing[] array = ((!isTutorialCategory) ? new IProcessing[8] - { - new SubChapterSelectionDialogDisplay(), - new SummaryDialogDisplay(), - new DeckSelectionDialogDisplay(), - new ChapterCharaDecider(), - new DownloadInfoGetter(), - new DownloadConfirmDialogDisplay(), - new DeckSelectionConfirmDialogDisplay(), - new StoryStarter() - } : new IProcessing[3] - { - new SummaryDialogDisplay(), - new ChapterCharaDecider(), - new TutorialStoryStarter() - }); - for (int i = 0; i < array.Length - 1; i++) - { - array[i].NextProcessing = array[i + 1]; - } - return array.FirstOrDefault(); - } - - private void ExecuteSelectionProcessings() - { - if (_firstSelectionProcessing != null) - { - Parameter param = CreateSelectionProcessingParameter(); - _firstSelectionProcessing.Execute(param); - } - } - - private Parameter CreateSelectionProcessingParameter() - { - return new Parameter(this, _commonPrefabContainer, _scenarioSummary, SelectedStoryInfo, _selectChapterData, nowAreaAllNum, null, _selectChapterData.IsPlayedChapter ? new int?(_selectChapterIndex) : ((int?)null)); } private void InitBGStartMove() diff --git a/SVSim.BattleEngine/Engine/AreaSelectUtility.cs b/SVSim.BattleEngine/Engine/AreaSelectUtility.cs index 9c042828..8218a05a 100644 --- a/SVSim.BattleEngine/Engine/AreaSelectUtility.cs +++ b/SVSim.BattleEngine/Engine/AreaSelectUtility.cs @@ -2,11 +2,6 @@ using UnityEngine; public class AreaSelectUtility { - public const string BTN_IMAGE_NAME_SUFFIX_OFF = "{0}_off"; - - public const string BTN_IMAGE_NAME_SUFFIX_ON = "{0}_on"; - - public static readonly string ChapterSelectBtnPathPrefix = "btn_story_select"; public static readonly Color32 CLEAR_LABEL_COLOR_CLEARD_GRADIENT_TOP = new Color32(byte.MaxValue, 245, 161, byte.MaxValue); diff --git a/SVSim.BattleEngine/Engine/ArenaColosseum.cs b/SVSim.BattleEngine/Engine/ArenaColosseum.cs index 7baf3699..1250b031 100644 --- a/SVSim.BattleEngine/Engine/ArenaColosseum.cs +++ b/SVSim.BattleEngine/Engine/ArenaColosseum.cs @@ -9,29 +9,17 @@ public class ArenaColosseum : ArenaEntryDataBase public enum eRound { FinalNotAdvance = -1, - Round1 = 1, - Round2B = 2, - Round2A = 3, - FinalB = 4, - FinalA = 5, - FinalMin = 4, - RoundMax = 5, Undecided = 6, Lose = 7 } public enum eStageNo { - Stage1 = 1, - Stage2, - FinalStage, - Max - } +} public enum eEntryStatus { TwoPickClassSelect = 1, - TwoPickCardSelect, SetUpComplete } @@ -51,27 +39,10 @@ public class ArenaColosseum : ArenaEntryDataBase public enum eDeckIndex { - Main = 0, - First = 0, - Second = 1, - Third = 2 - } + First = 0 } public struct Detail { - public string RoundTimeText { get; set; } - - public string RoundTimeStartText { get; set; } - - public string RoundTimeEndText { get; set; } - - public string GroupName { get; set; } - - public int MaxBattleNum { get; set; } - - public int BreakThroughNum { get; set; } - - public int MaxEntryNum { get; set; } } public class TwoPick @@ -80,8 +51,6 @@ public class ArenaColosseum : ArenaEntryDataBase public CandidateCardInfo CandidateCard { get; set; } - public Deck DeckData { get; set; } - public CandidateChaos CandidateChaos { get; set; } } @@ -97,8 +66,6 @@ public class ArenaColosseum : ArenaEntryDataBase public bool CanUseNonPossessionCard; - public int DeckEntryId { get; set; } - public bool IsColosseumPeriod { get; set; } public bool IsRoundPeriod { get; set; } @@ -131,32 +98,6 @@ public class ArenaColosseum : ArenaEntryDataBase public int ChaoseTipsId { get; set; } - public bool IsSpecialDeckSelectRule - { - get - { - if (Rule != eRule.HOF) - { - return Rule == eRule.WindFall; - } - return true; - } - } - - public bool IsDeckMaxNumberChange => Rule == eRule.WindFall; - - public int DeckMaxNumber - { - get - { - if (Rule == eRule.WindFall) - { - return 35; - } - return 40; - } - } - public bool IsRankMatching { get @@ -196,10 +137,6 @@ public class ArenaColosseum : ArenaEntryDataBase public int RetryRemainingNum { get; set; } - public int BattleMax { get; set; } - - public int ClearWinNum { get; set; } - public bool IsDeckEntry { get; set; } public bool IsFreeEntry @@ -220,10 +157,6 @@ public class ArenaColosseum : ArenaEntryDataBase public bool IsClear { get; set; } - public bool IsRetire { get; set; } - - public bool IsFinish { get; set; } - public bool IsDeckDeleted { get; set; } public bool IsFinalRoundTry { get; set; } @@ -236,26 +169,14 @@ public class ArenaColosseum : ArenaEntryDataBase public double RemainingServerUnixTime { get; set; } - public string NextRoundStartTimeText { get; set; } - public string NowRoundTimeText { get; set; } - public string ColosseumTimeText { get; set; } - - public string AnnounceNo { get; set; } - public Detail[] DetailData { get; set; } - public eStageNo FocusStageNo { get; set; } - - public int WinBattleNum { get; set; } - public List BattleResultList { get; set; } public List BoxGradeList { get; set; } - public int FinalRoundEliminateCount { get; set; } - public TwoPick TwoPickData { get; set; } public ArenaColosseum() @@ -273,70 +194,6 @@ public class ArenaColosseum : ArenaEntryDataBase TwoPickData.CandidateChaos = new CandidateChaos(); } - public int GetRoundNumber(eRound inRound) - { - switch (inRound) - { - case eRound.Round1: - return 1; - case eRound.Round2B: - case eRound.Round2A: - return 2; - default: - return 0; - } - } - - public string GetGroupText(eRound inRound) - { - switch (inRound) - { - case eRound.Round2A: - case eRound.FinalA: - return Data.SystemText.Get("Colosseum_0020"); - case eRound.Round2B: - case eRound.FinalB: - return Data.SystemText.Get("Colosseum_0021"); - default: - return ""; - } - } - - public eStageNo GetStageNoFromRoundId(eRound inRoundId) - { - switch (inRoundId) - { - case eRound.Round1: - return eStageNo.Stage1; - case eRound.Round2B: - case eRound.Round2A: - return eStageNo.Stage2; - case eRound.FinalB: - case eRound.FinalA: - return eStageNo.FinalStage; - default: - return eStageNo.Stage1; - } - } - - public bool IsFinalRound() - { - if (Round == eRound.FinalA || Round == eRound.FinalB) - { - return true; - } - return false; - } - - public DialogBase CreateDetailDialog(GameObject defaultDetailPrefab) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - GameObject gameObject = Object.Instantiate(defaultDetailPrefab); - dialogBase.SetObj(gameObject); - gameObject.GetComponent().Init(dialogBase); - return dialogBase; - } - public void ApiRuleParseAndSet(int apiRule) { ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; diff --git a/SVSim.BattleEngine/Engine/ArenaCompetition.cs b/SVSim.BattleEngine/Engine/ArenaCompetition.cs index 72a17e7e..7c1ed803 100644 --- a/SVSim.BattleEngine/Engine/ArenaCompetition.cs +++ b/SVSim.BattleEngine/Engine/ArenaCompetition.cs @@ -10,22 +10,16 @@ public class ArenaCompetition : ArenaEntryDataBase public enum EntryStatusType { NotEntry, - NotChallenge, NotRegistDeck, InBattle } public enum FreebieStatusType { - InFreeBattle, - CanPermanentEntry, - PermanentEntryDone - } +} public enum EntryCostType { - EntryWithFree, - EntryWithCost } private bool _isRankMatching; @@ -197,10 +191,4 @@ public class ArenaCompetition : ArenaEntryDataBase } base.LootBoxType = PlayerStaticData.LootBoxType.COMPETITION; } - - public void SetRestChallangeCountByEntry(JsonData responseData) - { - RestChallangeCount = responseData["rest_challenge_count"].ToInt(); - IsEntry = true; - } } diff --git a/SVSim.BattleEngine/Engine/ArenaData.cs b/SVSim.BattleEngine/Engine/ArenaData.cs index c0ca7b6e..63d3c065 100644 --- a/SVSim.BattleEngine/Engine/ArenaData.cs +++ b/SVSim.BattleEngine/Engine/ArenaData.cs @@ -5,12 +5,7 @@ public class ArenaData : HeaderData { public enum eARENA_PAY { - None = 0, - Crystal = 1, - Ticket = 3, - Rupy = 4, - Free = 5 - } + None = 0 } public ArenaTwoPickData TwoPickData { get; set; } @@ -44,14 +39,6 @@ public class ArenaData : HeaderData SealedData = new SealedData(); } - public void SetSealedMyPageResponseData(JsonData rootData) - { - if (rootData.Keys.Contains("sealed_info")) - { - SealedMyPageResponseData = new SealedMyPageResponseData(rootData["sealed_info"]); - } - } - public static Format ApiDeckFormatParse(ArenaColosseum.eRule rule) { Format format = Format.Rotation; diff --git a/SVSim.BattleEngine/Engine/ArenaEntryBase.cs b/SVSim.BattleEngine/Engine/ArenaEntryBase.cs deleted file mode 100644 index 1800a492..00000000 --- a/SVSim.BattleEngine/Engine/ArenaEntryBase.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; -using Wizard; - -public abstract class ArenaEntryBase : MonoBehaviour -{ - [SerializeField] - protected GameObject ArenaEntryDialog; - - [SerializeField] - protected GameObject CompetitionEntryDialog; - - [SerializeField] - protected UIButton ButtonEntry; - - [SerializeField] - protected UIButton ButtonResume; - - [SerializeField] - protected GameObject HeadLineObject; - - private UIWidget[] _headlineWidgetArray; - - private Color[] _headlineWidgetDefaultColorArray; - - private Coroutine _initCoroutine; - - protected bool _isFreeEntry; - - protected bool _isCompetition; - - protected string[] _labelsText; - - protected string _entryDialogTitleText; - - protected Action _initFunc; - - protected Action _resumeFunc; - - protected Func _isJoinFunc; - - protected Action _freeEntryFunc; - - protected Action _freeBattleFunc; - - protected Func _isFreeBattleCompetition; - - protected Action _entryFunc; - - private const float GLAY_SCALE = 0.33f; - - protected abstract void EntryDialogCreate(GameObject inDialog); - - protected virtual void EntryBaseInit(GameObject costRootObject) - { - _headlineWidgetArray = costRootObject.transform.GetComponentsInChildren(); - _headlineWidgetDefaultColorArray = new Color[_headlineWidgetArray.Length]; - for (int i = 0; i < _headlineWidgetArray.Length; i++) - { - _headlineWidgetDefaultColorArray[i] = _headlineWidgetArray[i].color; - } - } - - private void OnEnable() - { - UpdateMenu(); - } - - private void OnDestroy() - { - if (_initCoroutine != null) - { - StopCoroutine(_initCoroutine); - } - } - - public void UpdateMenu() - { - _initCoroutine = UIManager.GetInstance().StartCoroutine(_InitCoroutine()); - } - - protected virtual IEnumerator _InitCoroutine() - { - while (!MyPageMenu.IsMyPageRequestEnd) - { - yield return null; - } - if (_initFunc != null) - { - _initFunc(); - } - ButtonEntry.onClick.Clear(); - ButtonEntry.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (_entryFunc != null) - { - _entryFunc(); - } - else if (_isFreeEntry) - { - _freeEntryFunc(); - } - else - { - DialogBase.Size size = ((Data.ArenaData.CompetitionData.CostType != ArenaCompetition.EntryCostType.EntryWithCost) ? DialogBase.Size.M : DialogBase.Size.XL); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(size); - dialogBase.SetTitleLabel(_entryDialogTitleText); - GameObject gameObject = UnityEngine.Object.Instantiate(_isCompetition ? CompetitionEntryDialog : ArenaEntryDialog); - EntryDialogCreate(gameObject); - if (_isCompetition && Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithCost) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.COMPETITION_JOIN_BUTTON_LATEST_ID, Data.ArenaData.CompetitionData.CompetitionId); - Data.MyPageNotifications.data.IsCompetitionBadge = false; - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - UpdateCompetitionEntryBadge(); - } - gameObject.GetComponent().ParentDialog = dialogBase; - dialogBase.SetObj(gameObject.gameObject); - DialogBase.ButtonLayout buttonLayout = DialogBase.ButtonLayout.CloseBtn; - dialogBase.SetButtonLayout(buttonLayout); - } - })); - ButtonResume.onClick.Clear(); - ButtonResume.onClick.Add(new EventDelegate(delegate - { - _resumeFunc(); - })); - UpdateEntryResumeButton(); - } - - protected virtual void UpdateCompetitionEntryBadge() - { - } - - protected virtual void UpdateEntryResumeButton() - { - bool flag = _isJoinFunc(); - ButtonEntry.gameObject.SetActive(!flag); - ButtonResume.gameObject.SetActive(flag); - if (flag) - { - for (int i = 0; i < _headlineWidgetArray.Length; i++) - { - _headlineWidgetArray[i].color = new Color(_headlineWidgetDefaultColorArray[i].r * 0.33f, _headlineWidgetDefaultColorArray[i].g * 0.33f, _headlineWidgetDefaultColorArray[i].b * 0.33f, 255f); - } - } - else - { - for (int j = 0; j < _headlineWidgetArray.Length; j++) - { - _headlineWidgetArray[j].color = _headlineWidgetDefaultColorArray[j]; - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/ArenaEntryDialogBase.cs b/SVSim.BattleEngine/Engine/ArenaEntryDialogBase.cs deleted file mode 100644 index 0c4010fb..00000000 --- a/SVSim.BattleEngine/Engine/ArenaEntryDialogBase.cs +++ /dev/null @@ -1,175 +0,0 @@ -using UnityEngine; -using Wizard; - -public abstract class ArenaEntryDialogBase : MonoBehaviour -{ - protected Se.TYPE _entryButtonSe = Se.TYPE.SYS_BTN_DECIDE_TRANS; - - private const int CHECK_DIALOG_DEPTH = 10; - - private ArenaEntryDataBase _entryData; - - private ArenaEntryDialogData _dialogData; - - protected ArenaData.eARENA_PAY _payType; - - public bool IsCompetition; - - protected string _mainTextId; - - protected string _ticketSpriteName; - - protected string _arenaNameTextId; - - public DialogBase ParentDialog { get; set; } - - protected abstract void Init(); - - protected abstract int GetTicketNum(); - - protected abstract ArenaEntryDataBase GetEntryData(); - - private void Start() - { - Init(); - _entryData = GetEntryData(); - _dialogData = GetComponent(); - SystemText systemText = Data.SystemText; - if (_dialogData._mainText != null) - { - _dialogData._mainText.text = systemText.Get(_mainTextId); - } - if (_dialogData._ticketHaveTitle != null) - { - _dialogData._ticketHaveTitle.text = systemText.Get("Arena_0037"); - _dialogData._ticketHaveNum.text = GetTicketNum().ToString(); - _dialogData._ticketHaveUnit.text = systemText.Get("Common_0117"); - _dialogData._ticketButtonTitle.text = systemText.Get("Arena_0004"); - _dialogData._ticketButtonSubTitle.text = systemText.Get("Arena_0038"); - _dialogData._ticketButtonUseNum.text = _entryData.ticketCost.ToString(); - _dialogData._ticketSprite.spriteName = _ticketSpriteName; - _dialogData._ticketButton.onClick.Add(new EventDelegate(delegate - { - if (ParentDialog.GetNowScene() == DialogBase.DialogScene.WAIT) - { - OnClickTicketEntryButton(); - } - })); - } - if (_dialogData._rupyHaveTitle != null) - { - _dialogData._rupyHaveTitle.text = systemText.Get("Shop_0065"); - _dialogData._rupyHaveNum.text = PlayerStaticData.UserRupyCount.ToString(); - _dialogData._rupyHaveUnit.text = systemText.Get("Common_0120"); - _dialogData._rupyButtonTitle.text = (IsCompetition ? systemText.Get("Competition_0067") : systemText.Get("Arena_0036")); - _dialogData._rupyButtonSubTitle.text = systemText.Get("Shop_0062"); - _dialogData._rupyButtonUseNum.text = _entryData.rupyCost.ToString(); - _dialogData._rupyButton.onClick.Add(new EventDelegate(delegate - { - if (ParentDialog.GetNowScene() == DialogBase.DialogScene.WAIT) - { - OnClickRupyEntryButton(); - } - })); - } - _dialogData._crystalHaveTitle.text = systemText.Get("Shop_0064"); - _dialogData._crystalHaveNum.text = PlayerStaticData.UserCrystalCount.ToString(); - _dialogData._crystalHaveUnit.text = systemText.Get("Common_0116"); - _dialogData._crystalButtonTitle.text = (IsCompetition ? systemText.Get("Competition_0046") : systemText.Get("Arena_0023")); - _dialogData._crystalButtonSubTitle.text = systemText.Get("Shop_0061"); - _dialogData._crystalButtonUseNum.text = _entryData.crystalCost.ToString(); - if (_entryData.ticketCost > GetTicketNum()) - { - SetButtonDisable(_dialogData._ticketButton, _dialogData._ticketButtonTitle); - } - if (_entryData.rupyCost > PlayerStaticData.UserRupyCount) - { - SetButtonDisable(_dialogData._rupyButton, _dialogData._rupyButtonTitle); - } - _dialogData._crystalButton.onClick.Add(new EventDelegate(delegate - { - if (ParentDialog.GetNowScene() == DialogBase.DialogScene.WAIT) - { - OnClickCrystalEntryButton(); - } - })); - } - - private void SetButtonDisable(UIButton in_Button, UILabel in_Label) - { - in_Button.GetComponent().isEnabled = false; - in_Label.color = LabelDefine.TEXT_COLOR_BUTTON_DISABLE; - in_Button.GetComponent().duration = 0f; - } - - private void OnClickTicketEntryButton() - { - int ticketNum = GetTicketNum(); - SystemText systemText = Data.SystemText; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Arena_0005")); - dialogBase.SetPanelDepth(10); - ArenaBuyDialog component = Object.Instantiate(_dialogData.BuyDialogObject).GetComponent(); - dialogBase.SetObj(component.gameObject); - component.SetTicketConfirmDialog(_entryData.ticketCost, ticketNum, _arenaNameTextId, _ticketSpriteName); - dialogBase.onPushButton1 = Entry; - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Dia_Arena_003_Button")); - dialogBase.ClickSe_Btn1 = _entryButtonSe; - _payType = ArenaData.eARENA_PAY.Ticket; - } - - private void OnClickCrystalEntryButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (PlayerStaticData.IsLootBoxRegulation(_entryData.LootBoxType)) - { - LootBoxDialogUtility.CreateLootBoxRegulationDialog(_entryData.LootBoxType); - return; - } - if (_entryData.crystalCost > PlayerStaticData.UserCrystalCount) - { - ShopCommonUtility.CreateCrystalShortagePopup(); - return; - } - int userCrystalCount = PlayerStaticData.UserCrystalCount; - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Arena_0005")); - dialogBase.SetPanelDepth(10); - ArenaBuyDialog component = Object.Instantiate(_dialogData.BuyDialogObject).GetComponent(); - dialogBase.SetObj(component.gameObject); - component.SetClystalConfirmDialog(_entryData.crystalCost, userCrystalCount, _arenaNameTextId, _entryData.ExpirtyInfo); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - string text_btn = (IsCompetition ? systemText.Get("Competition_0036") : systemText.Get("Dia_Arena_004_Button")); - dialogBase.SetButtonText(text_btn); - dialogBase.ClickSe_Btn1 = _entryButtonSe; - dialogBase.onPushButton1 = Entry; - _payType = ArenaData.eARENA_PAY.Crystal; - } - - private void OnClickRupyEntryButton() - { - int userRupyCount = PlayerStaticData.UserRupyCount; - SystemText systemText = Data.SystemText; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Arena_0005")); - dialogBase.SetPanelDepth(10); - ArenaBuyDialog component = Object.Instantiate(_dialogData.BuyDialogObject).GetComponent(); - dialogBase.SetObj(component.gameObject); - component.SetRupyConfirmDialog(_entryData.rupyCost, userRupyCount, _arenaNameTextId); - dialogBase.onPushButton1 = Entry; - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - string text_btn = (IsCompetition ? systemText.Get("Competition_0036") : systemText.Get("Dia_Arena_005_Button")); - dialogBase.SetButtonText(text_btn); - dialogBase.ClickSe_Btn1 = _entryButtonSe; - _payType = ArenaData.eARENA_PAY.Rupy; - } - - protected virtual void Entry() - { - ParentDialog.CloseWithoutSelect(); - } -} diff --git a/SVSim.BattleEngine/Engine/ArenaEntryDialogData.cs b/SVSim.BattleEngine/Engine/ArenaEntryDialogData.cs deleted file mode 100644 index 6c630937..00000000 --- a/SVSim.BattleEngine/Engine/ArenaEntryDialogData.cs +++ /dev/null @@ -1,52 +0,0 @@ -using UnityEngine; - -public class ArenaEntryDialogData : MonoBehaviour -{ - public GameObject BuyDialogObject; - - public UILabel _mainText; - - public UISprite _ticketSprite; - - public UIButton _ticketButton; - - public UIButton _rupyButton; - - public UIButton _crystalButton; - - public UILabel _ticketHaveTitle; - - public UILabel _ticketHaveNum; - - public UILabel _ticketHaveUnit; - - public UILabel _ticketButtonTitle; - - public UILabel _ticketButtonSubTitle; - - public UILabel _ticketButtonUseNum; - - public UILabel _rupyHaveTitle; - - public UILabel _rupyHaveNum; - - public UILabel _rupyHaveUnit; - - public UILabel _rupyButtonTitle; - - public UILabel _rupyButtonSubTitle; - - public UILabel _rupyButtonUseNum; - - public UILabel _crystalHaveTitle; - - public UILabel _crystalHaveNum; - - public UILabel _crystalHaveUnit; - - public UILabel _crystalButtonTitle; - - public UILabel _crystalButtonSubTitle; - - public UILabel _crystalButtonUseNum; -} diff --git a/SVSim.BattleEngine/Engine/ArenaField.cs b/SVSim.BattleEngine/Engine/ArenaField.cs index 5f6adf88..a7b64f1c 100644 --- a/SVSim.BattleEngine/Engine/ArenaField.cs +++ b/SVSim.BattleEngine/Engine/ArenaField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class ArenaField : BackGroundBase { public override int FieldId => 9; @@ -10,71 +11,4 @@ public class ArenaField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_arna_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles09").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_9, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_9_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(2700f, -880f, 300f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-19f, -90f, 90f)); - Vector3[] bezierCubic = MotionUtils.GetBezierCubic(new Vector3(2700f, -880f, 300f), new Vector3(1700f, -550f, -220f), new Vector3(700f, -200f, 20f), new Vector3(-240f, -190f, -70f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierCubic, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-37f, -117f, 107f), "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1") - { - _ = _gimicCntDictionary[obj.tag]; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/ArenaNextSceneSelector.cs b/SVSim.BattleEngine/Engine/ArenaNextSceneSelector.cs deleted file mode 100644 index a25edc09..00000000 --- a/SVSim.BattleEngine/Engine/ArenaNextSceneSelector.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Cute; -using UnityEngine; -using Wizard; - -public class ArenaNextSceneSelector : INextSceneSelector -{ - private BattleResultUIController m_battleResultNewControl; - - private bool _movingToMyPage; - - public ArenaNextSceneSelector(BattleResultUIController battleResultControl) - { - m_battleResultNewControl = battleResultControl; - _movingToMyPage = false; - } - - public void Setup(bool isWin, GameObject gameObject) - { - if (m_battleResultNewControl.ResultMsgReportBtnFlag) - { - m_battleResultNewControl.ReportBtnObj.labels[0].text = Data.SystemText.Get("Con_Management_001_Button"); - m_battleResultNewControl.ReportBtnObj.gameObject.SetActive(value: true); - m_battleResultNewControl.ReportBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.ReportBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - ConsistencyReportButtonAction.CreateReportConfirmWindow(); - })); - } - m_battleResultNewControl.MissionBtnObj.labels[0].text = Data.SystemText.Get("Battle_0200"); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().createInSceneCenterLoading(); - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); - missionInfoTask.SetParameter(); - m_battleResultNewControl.StartCoroutine(Toolbox.NetworkManager.Connect(missionInfoTask, delegate - { - m_battleResultNewControl.CreateMissionList(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - })); - m_battleResultNewControl.HomeBtnObj.labels[0].text = Data.SystemText.Get("Battle_0202"); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MoveToMyPage(); - })); - if (GameMgr.GetIns().GetDataMgr().IsColosseumBattleType()) - { - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0489"); - } - else if (GameMgr.GetIns().GetDataMgr().IsCompetitionBattleType()) - { - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Competition_0021"); - } - else if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.Sealed) - { - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Sealed_BattleResult_0001"); - } - else - { - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0203"); - } - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.TwoPick) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.TwoPick); - } - else if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.Sealed) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Sealed); - } - else if (GameMgr.GetIns().GetDataMgr().IsCompetitionBattleType()) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.CompetitionLobby); - } - else - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Colosseum); - } - })); - } - - public void Show() - { - iTween.MoveTo(m_battleResultNewControl.ButtonGrid.gameObject, iTween.Hash("position", m_battleResultNewControl.DefaultPosDict["ButtonGrid"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void MoveToMyPage() - { - if (!_movingToMyPage) - { - _movingToMyPage = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.MyPage); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ArenaResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/ArenaResultAnimationAgent.cs deleted file mode 100644 index 6e46e97e..00000000 --- a/SVSim.BattleEngine/Engine/ArenaResultAnimationAgent.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; - -public class ArenaResultAnimationAgent : ResultAnimationAgent -{ - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - RankWinnerReward winnerReward = GameMgr.GetIns()._rankWinnerReward; - if (winnerReward == null) - { - int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE); - string value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING); - if (value != 0 && value2 != "") - { - winnerReward = UIManager.GetInstance().createRankWinnerReward(); - GameMgr.GetIns()._rankWinnerReward = winnerReward; - winnerReward.SetInfomation(value, value2); - winnerReward.gameObject.SetActive(value: false); - } - } - if (winnerReward != null && isWin) - { - float seconds = 3f; - StartCoroutine(winnerReward.ResultWinnerReward()); - yield return new WaitForSeconds(seconds); - StartCoroutine(winnerReward.HideRewardObject()); - } - if (!battleResultControl.IsDraw && ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (Data.ArenaBattleFinish.data != null) - { - TreasureBoxCpResultInfo treasureBoxCpResultInfo = Data.ArenaBattleFinish.data.TreasureBoxCpResultInfo; - if (treasureBoxCpResultInfo.IsPlayGradeUpAnimation()) - { - yield return TreasureBoxCpOpenBoxAnimation(battleResultControl, treasureBoxCpResultInfo.AfterGrade); - } - if (treasureBoxCpResultInfo.IsBoxOpened()) - { - yield return CreateTreasureBoxCpRewardDialog(treasureBoxCpResultInfo); - } - } - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - PlayWinVoice(); - } - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - bool _isFinishBattlePass = false; - battleResultControl.SetBattlePassGauge(delegate - { - _isFinishBattlePass = true; - }); - while (!_isFinishBattlePass) - { - yield return null; - } - if (Data.RedEtherCampaignResultData != null) - { - bool isFinishRedEther = false; - RedEtherCampaignPanel.Create(battleResultControl.gameObject, Data.RedEtherCampaignResultData, battleResultControl, delegate - { - isFinishRedEther = true; - }); - while (!isFinishRedEther) - { - yield return null; - } - yield return ShowRewardDialog(Data.RedEtherCampaignResultData.RewardList); - } - battleResultControl.GreySpriteBGVisible = false; - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - } -} diff --git a/SVSim.BattleEngine/Engine/ArenaResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/ArenaResultAnimationHandler.cs deleted file mode 100644 index e8c8f9ce..00000000 --- a/SVSim.BattleEngine/Engine/ArenaResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class ArenaResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly ArenaResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public ArenaResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/ArenaResultReporter.cs b/SVSim.BattleEngine/Engine/ArenaResultReporter.cs deleted file mode 100644 index ec621be6..00000000 --- a/SVSim.BattleEngine/Engine/ArenaResultReporter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard; -using Wizard.Lottery; - -public class ArenaResultReporter : IBattleResultReporter -{ - public bool IsEnd => Data.ArenaBattleFinish.data != null; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => Data.ArenaBattleFinish.data._missionRewards; - - public List VictoryRewards => Data.ArenaBattleFinish.data._victoryRewards; - - public LotteryApplyData LotteryData => LotteryApplyData.EmptyData(); - - public bool IsDataExist - { - get - { - if (Data.ArenaBattleFinish.data != null) - { - return Data.ArenaBattleFinish.data.IsProcessed; - } - return false; - } - } - - public MyPageHomeDialogData HomeDialogData => null; - - public void Report(bool isWin) - { - } - - public void Destroy() - { - } - - public JsonData GetFinishResponseData() - { - return Data.ArenaBattleFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.ArenaBattleFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.ArenaBattleFinish.data.achieved_mission_list; - } - - public int GetClassExp() - { - return Data.ArenaBattleFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/ArrowControl.cs b/SVSim.BattleEngine/Engine/ArrowControl.cs index 3eed5283..e0987759 100644 --- a/SVSim.BattleEngine/Engine/ArrowControl.cs +++ b/SVSim.BattleEngine/Engine/ArrowControl.cs @@ -5,113 +5,4 @@ public class ArrowControl : MonoBehaviour { [SerializeField] private GameObject ArrowHead; - - [SerializeField] - private GameObject ArrowEfc; - - [SerializeField] - private int DivideCnt = 10; - - [SerializeField] - private bool isEvo; - - private IList ArrowEfcList; - - private GameObject FromObj; - - private GameObject ToObj; - - private bool isOn; - - private bool _isTargettingEnemy; - - private float ChangeTime; - - private IList ArrowTarList; - - private void Start() - { - ArrowEfcList = new List(); - ArrowEfcList.Add(ArrowEfc); - for (int i = 1; i < DivideCnt; i++) - { - GameObject gameObject = Object.Instantiate(ArrowEfc); - if (!(null == gameObject)) - { - gameObject.transform.parent = base.transform; - ArrowEfcList.Add(gameObject); - } - } - ArrowTarList = new List(); - for (int j = 0; j < DivideCnt; j++) - { - ArrowTarList.Add(j); - } - HideArrow(); - } - - private void Update() - { - if (isOn) - { - SetArrowLine(); - } - } - - public void ShowArrow(GameObject fromObj, GameObject toObj, bool isTargettingEnemy) - { - FromObj = fromObj; - ToObj = toObj; - _isTargettingEnemy = isTargettingEnemy; - isOn = true; - base.gameObject.SetActive(value: true); - } - - public void HideArrow() - { - isOn = false; - for (int i = 0; i < DivideCnt; i++) - { - ArrowEfcList[i].SetActive(value: false); - } - base.gameObject.SetActive(value: false); - } - - private void SetArrowLine() - { - if (isEvo) - { - ChangeTime -= Time.deltaTime * 5f; - } - else - { - ChangeTime -= Time.deltaTime; - } - if (ChangeTime <= 0f) - { - ChangeTime = 1f; - ArrowTarList.Add(ArrowTarList[0]); - ArrowTarList.RemoveAt(0); - } - ArrowHead.transform.position = ToObj.transform.position; - Vector3 position = FromObj.transform.position; - Vector3 position2 = ToObj.transform.position; - Vector3 p = (_isTargettingEnemy ? position : position2) + Vector3.back * Vector3.Distance(position, position2) + Vector3.down * Vector3.Distance(position, position2) * -0.5f; - Vector3[] array = new Vector3[DivideCnt]; - array = MotionUtils.GetBezierQuad(position, p, position2, DivideCnt); - for (int i = 0; i < array.Length; i++) - { - float num = 1f - ChangeTime; - if (ArrowTarList[i] != 0) - { - ArrowEfcList[i].SetActive(value: true); - ArrowEfcList[i].transform.position = (array[ArrowTarList[i]] - array[ArrowTarList[i] - 1]) * num + array[ArrowTarList[i] - 1]; - } - else - { - ArrowEfcList[i].SetActive(value: false); - ArrowEfcList[i].transform.position = array[0]; - } - } - } } diff --git a/SVSim.BattleEngine/Engine/AspectCamera.cs b/SVSim.BattleEngine/Engine/AspectCamera.cs index f5b99a80..eab78e76 100644 --- a/SVSim.BattleEngine/Engine/AspectCamera.cs +++ b/SVSim.BattleEngine/Engine/AspectCamera.cs @@ -3,74 +3,6 @@ using UnityEngine; [ExecuteInEditMode] public class AspectCamera : MonoBehaviour { - public Vector2 aspect = new Vector2(4f, 3f); - - public Color32 backgroundColor = Color.black; - - private float aspectRate; - - private Camera _camera; - - private static Camera _backgroundCamera; - - private int sizeVal = 1; - - public const float LOWER_LIMIT_ASPECT_RATIO = 0.5625f; - - public const float UPPER_LIMIT_ASPECT_RATIO = 0.4618f; - - public const float LOWER_LIMIT_ASPECT_RATIO_RECIPROCAL = 1.7777778f; - - private const float SAFE_AREA_RATE = 0.892f; - - private const float SAFE_AREA_NONE_RATE = 1f; public static float SafeAreaRate; - - private void Start() - { - aspectRate = aspect.x / aspect.y; - _camera = GetComponent(); - SafeAreaRate = 1f; - float num = (float)Screen.height / (float)Screen.width; - if (num < 0.5625f) - { - num = Mathf.Max(num, 0.4618f); - float t = (0.5625f - num) / 0.10069999f; - SafeAreaRate = Mathf.Lerp(1f, 0.892f, t); - } - } - - private void UpdateScreenRate() - { - float num = aspect.y / aspect.x; - float num2 = (float)Screen.height / (float)Screen.width; - if (num2 < 0.5625f) - { - num2 = 0.5625f; - } - if (num > num2) - { - float num3 = num2 / num; - _camera.rect = new Rect(0f, 0f, 1f, 1f); - _camera.orthographicSize = (float)sizeVal * num3; - } - else - { - float num4 = num / num2; - _camera.rect = new Rect(0f, 0f, 1f, 1f); - _camera.orthographicSize = (float)sizeVal / num4; - } - } - - private bool IsChangeAspect() - { - return _camera.aspect == aspectRate; - } - - private void Update() - { - UpdateScreenRate(); - _camera.ResetAspect(); - } } diff --git a/SVSim.BattleEngine/Engine/AspectCameraPerspective.cs b/SVSim.BattleEngine/Engine/AspectCameraPerspective.cs index 4fe8b8a3..8c6031cf 100644 --- a/SVSim.BattleEngine/Engine/AspectCameraPerspective.cs +++ b/SVSim.BattleEngine/Engine/AspectCameraPerspective.cs @@ -2,7 +2,6 @@ using UnityEngine; public class AspectCameraPerspective : MonoBehaviour { - private Camera m_camera; private bool m_isSetFOV; @@ -10,35 +9,4 @@ public class AspectCameraPerspective : MonoBehaviour { m_isSetFOV = false; } - - private void Start() - { - m_camera = GetComponent(); - } - - private void Update() - { - if (!m_isSetFOV && GameMgr.GetIns() != null && m_camera != null) - { - float num = 0f; - float num2 = 0f; - if (Screen.width > Screen.height) - { - num = Screen.width; - num2 = Screen.height; - } - else - { - num = Screen.height; - num2 = Screen.width; - } - float num3 = num / num2; - if (num3 > 1.7777778f) - { - num3 = 1.7777778f; - } - m_camera.fieldOfView = Mathf.Atan2(1f, num3) * 57.29578f * 2f; - m_isSetFOV = true; - } - } } diff --git a/SVSim.BattleEngine/Engine/AssetBundleEditorTag.cs b/SVSim.BattleEngine/Engine/AssetBundleEditorTag.cs deleted file mode 100644 index 67899712..00000000 --- a/SVSim.BattleEngine/Engine/AssetBundleEditorTag.cs +++ /dev/null @@ -1,54 +0,0 @@ -public class AssetBundleEditorTag -{ - public enum BUNDLE_CATEGORY - { - BG, - CARD, - EFFECT, - MASTER, - STORY, - UI, - UIDOWNLOAD, - TUTORIAL, - PACKBOX, - UILANG, - STORYLANG, - FONT, - SLEEVE, - MAX - } - - public enum CardStatType - { - CARD_STAT_NORMAL, - CARD_STAT_FOIL, - CARD_STAT_PROMOTION - } - - public struct categoryProps - { - public string name; - - public categoryProps(string in_name) - { - name = in_name; - } - } - - public static categoryProps[] categoryNameList = new categoryProps[13] - { - new categoryProps("bg"), - new categoryProps("card"), - new categoryProps("effect"), - new categoryProps("master"), - new categoryProps("story"), - new categoryProps("ui"), - new categoryProps("uidownload"), - new categoryProps("tutorial"), - new categoryProps("packbox"), - new categoryProps("uilang"), - new categoryProps("storylang"), - new categoryProps("font"), - new categoryProps("sleeve") - }; -} diff --git a/SVSim.BattleEngine/Engine/AttackSelectControl.cs b/SVSim.BattleEngine/Engine/AttackSelectControl.cs index 257cde05..8850cd1d 100644 --- a/SVSim.BattleEngine/Engine/AttackSelectControl.cs +++ b/SVSim.BattleEngine/Engine/AttackSelectControl.cs @@ -30,13 +30,6 @@ public class AttackSelectControl _isReady = attackPairCard._isReady; _hasStartedMoving = attackPairCard._hasStartedMoving; } - - public void Clear() - { - _battleCardView = null; - _isReady = false; - _hasStartedMoving = false; - } } public AttackPairCard _attackInitiator; @@ -66,21 +59,6 @@ public class AttackSelectControl _attackInitiator = new AttackPairCard(attackPair._attackInitiator); _attackTarget = new AttackPairCard(attackPair._attackTarget); } - - public bool Compare(IBattleCardView attackInitiatorView, IBattleCardView attackTargetView) - { - if (_attackInitiator._battleCardView == attackInitiatorView) - { - return _attackTarget._battleCardView == attackTargetView; - } - return false; - } - - public void Clear() - { - _attackInitiator.Clear(); - _attackTarget.Clear(); - } } public class WaitUntilAttackPairIsReadyVfx : VfxBase @@ -107,24 +85,12 @@ public class AttackSelectControl } } - private BattleCardBase currentAttackInitiatorBattleCard; - private bool areAttackPairsBeingUpdated; private readonly AttackPair currentAttackPair = new AttackPair(null, null); private readonly List successfulAttackPairs = new List(); - public const float Z_FLOAT_AMOUNT = -100f; - - private const float EPSILON = 0.1f; - - private const float SMOOTHING_AMOUNT = 0.01f; - - private const float DECAY_MULTIPLIER = 10f; - - private const float IDLING_POSITION = 0.025390625f; - private IBattleCardView currentAttackInitiator { get @@ -149,55 +115,6 @@ public class AttackSelectControl } } - public void Update() - { - float t = MotionUtils.CalculateFrameRateIndependantDampingConstant(0.01f, 10f); - if (currentAttackInitiator != null && !currentAttackInitiator._attackTargetSelectInfo.IsCardInvolvedInAttack) - { - MoveCardUpwards(currentAttackPair._attackInitiator, t); - } - if (currentAttackTarget != null && !currentAttackTarget._attackTargetSelectInfo.IsCardInvolvedInAttack) - { - MoveCardUpwards(currentAttackPair._attackTarget, t); - } - } - - public void RegisterAttackInitiator(BattleCardBase attackInitiatorCard, BattlePlayerBase opponentBattlePlayer) - { - currentAttackInitiatorBattleCard = attackInitiatorCard; - currentAttackInitiator = attackInitiatorCard.BattleCardView; - ToggleAttackableCardFrameEffects(isEnabled: true, opponentBattlePlayer); - attackInitiatorCard.BattleCardView._attackTargetSelectInfo._isBeingSelectedInAttack = true; - if (!attackInitiatorCard.BattleCardView._attackTargetSelectInfo.IsCardInvolvedInAttack) - { - ResetCardOrientationAndStopMovement(attackInitiatorCard.BattleCardView); - } - } - - public void RegisterAttackTarget(IBattleCardView attackTargetCard) - { - if (currentAttackTarget == attackTargetCard) - { - return; - } - if (attackTargetCard != null) - { - attackTargetCard._attackTargetSelectInfo._isBeingSelectedInAttack = true; - if (!attackTargetCard._attackTargetSelectInfo.IsCardInvolvedInAttack) - { - ResetCardOrientationAndStopMovement(attackTargetCard); - } - } - currentAttackPair._attackTarget._isReady = !IsCardTranslatable(attackTargetCard); - currentAttackPair._attackTarget._hasStartedMoving = !IsCardTranslatable(attackTargetCard); - ResetCardPosition(currentAttackTarget); - if (currentAttackTarget != null) - { - currentAttackTarget._attackTargetSelectInfo._isBeingSelectedInAttack = false; - } - currentAttackTarget = attackTargetCard; - } - public virtual void RegisterAttackPair(AttackPair attackPair) { IBattleCardView battleCardView = attackPair._attackInitiator._battleCardView; @@ -217,34 +134,6 @@ public class AttackSelectControl } } - public void CancelAttackSelect(bool wasAttackSuccessful, BattlePlayerBase opponentBattlePlayer) - { - if (wasAttackSuccessful) - { - AttackPair attackPair = new AttackPair(currentAttackPair); - RegisterAttackPair(attackPair); - } - else - { - ResetCardPosition(currentAttackInitiator); - ResetCardPosition(currentAttackTarget); - } - if (currentAttackInitiatorBattleCard != null) - { - ToggleAttackableCardFrameEffects(isEnabled: false, opponentBattlePlayer); - } - if (currentAttackInitiator != null) - { - currentAttackInitiator._attackTargetSelectInfo._isBeingSelectedInAttack = false; - } - if (currentAttackTarget != null) - { - currentAttackTarget._attackTargetSelectInfo._isBeingSelectedInAttack = false; - } - currentAttackInitiatorBattleCard = null; - currentAttackPair.Clear(); - } - public void ResetCardOrientationAndStopMovement(IBattleCardView targetCard) { if (!targetCard._attackTargetSelectInfo.IsUneffectedByAttackTargetting) @@ -294,13 +183,6 @@ public class AttackSelectControl private void ResetCardPosition(IBattleCardView targetCard) { - if (!BattleManagerBase.GetIns().IsRecovery && IsCardTranslatable(targetCard) && !targetCard._attackTargetSelectInfo.IsCardInvolvedInAttack && !targetCard._attackTargetSelectInfo.IsUneffectedByAttackTargetting) - { - ImmediateVfxMgr.GetInstance().Register(SequentialVfxPlayer.Create(InstantVfx.Create(delegate - { - iTween.Stop(targetCard.CardWrapObject); - }), new DelaySetupVfx(() => (targetCard._attackTargetSelectInfo._isBeingSelectedInAttack || targetCard._attackTargetSelectInfo.IsCardInvolvedInAttack) ? ((VfxBase)NullVfx.GetInstance()) : ((VfxBase)new FallToGroundVfx(targetCard.CardWrapObject))))); - } } public virtual void StartCardIdling(IBattleCardView battleCardView) @@ -309,47 +191,6 @@ public class AttackSelectControl iTween.MoveAdd(battleCardView.CardWrapObject, iTween.Hash("z", 0.025390625f, "time", Random.Range(0.5f, 0.6f), "looptype", iTween.LoopType.pingPong, "easetype", iTween.EaseType.easeInOutQuad)); } - public virtual VfxBase RemoveAttackPairVfx(IBattleCardView attackInitiator, IBattleCardView attackTarget) - { - AttackPair attackPairToRemove = null; - for (int i = 0; i < successfulAttackPairs.Count; i++) - { - if (successfulAttackPairs[i].Compare(attackInitiator, attackTarget)) - { - attackPairToRemove = successfulAttackPairs[i]; - break; - } - } - if (attackPairToRemove != null) - { - VfxBase vfxBase = CreateWaitUntilAttackPairIsReadyVfx(attackPairToRemove); - VfxBase vfxBase2 = InstantVfx.Create(delegate - { - successfulAttackPairs.Remove(attackPairToRemove); - }); - return SequentialVfxPlayer.Create(vfxBase, vfxBase2); - } - return NullVfx.GetInstance(); - } - - private void ToggleAttackableCardFrameEffects(bool isEnabled, BattlePlayerBase opponentBattlePlayer) - { - List classAndInPlayCardList = opponentBattlePlayer.ClassAndInPlayCardList; - for (int i = 0; i < classAndInPlayCardList.Count; i++) - { - if (CanCardAttackTarget(currentAttackInitiatorBattleCard, classAndInPlayCardList[i], opponentBattlePlayer.InPlayCards) && classAndInPlayCardList[i].AreCanBeAttackedConditionsFulfilled) - { - classAndInPlayCardList[i].BattleCardView._inPlayFrameEffect.ToggleTargetSelectEffect(isEnabled); - } - } - currentAttackInitiator._inPlayFrameEffect.ToggleTargetSelectEffect(isEnabled, isAttackTargetSelectInitiator: true); - } - - private VfxBase CreateWaitUntilAttackPairIsReadyVfx(AttackPair attackPair) - { - return new WaitUntilAttackPairIsReadyVfx(attackPair); - } - private IEnumerator UpdateAttackPairs() { areAttackPairsBeingUpdated = true; @@ -380,7 +221,7 @@ public class AttackSelectControl private void MoveCardUpwards(AttackPair.AttackPairCard attackPairCard, float t) { - if (BattleManagerBase.GetIns().IsRecovery) + if (false /* Pre-Phase-5b: IsRecovery guard headless-safe as false */) { attackPairCard._isReady = true; } @@ -508,15 +349,6 @@ public class AttackSelectControl return true; } - public static bool IsAttackPossible(BattleCardBase attacker, BattleCardBase target, IEnumerable opponentInPlayCards) - { - if (attacker.Attackable) - { - return CanCardAttackTarget(attacker, target, opponentInPlayCards); - } - return false; - } - public static bool IsAttackPossible(AIVirtualCard attacker, AIVirtualCard target, BattlePlayerBase opponent) { if (attacker.BaseCard.Attackable) diff --git a/SVSim.BattleEngine/Engine/BMFont.cs b/SVSim.BattleEngine/Engine/BMFont.cs index 3e20ab70..1af65e70 100644 --- a/SVSim.BattleEngine/Engine/BMFont.cs +++ b/SVSim.BattleEngine/Engine/BMFont.cs @@ -9,10 +9,6 @@ public class BMFont [SerializeField] private int mSize = 16; - [HideInInspector] - [SerializeField] - private int mBase; - [HideInInspector] [SerializeField] private int mWidth; @@ -45,18 +41,6 @@ public class BMFont } } - public int baseOffset - { - get - { - return mBase; - } - set - { - mBase = value; - } - } - public int texWidth { get @@ -81,18 +65,6 @@ public class BMFont } } - public int glyphCount - { - get - { - if (!isValid) - { - return 0; - } - return mSaved.Count; - } - } - public string spriteName { get @@ -105,8 +77,6 @@ public class BMFont } } - public List glyphs => mSaved; - public BMGlyph GetGlyph(int index, bool createIfMissing) { BMGlyph value = null; @@ -134,12 +104,6 @@ public class BMFont return GetGlyph(index, createIfMissing: false); } - public void Clear() - { - mDict.Clear(); - mSaved.Clear(); - } - public void Trim(int xMin, int yMin, int xMax, int yMax) { if (isValid) diff --git a/SVSim.BattleEngine/Engine/BMGlyph.cs b/SVSim.BattleEngine/Engine/BMGlyph.cs index dcd9b70e..4852f3d8 100644 --- a/SVSim.BattleEngine/Engine/BMGlyph.cs +++ b/SVSim.BattleEngine/Engine/BMGlyph.cs @@ -40,24 +40,6 @@ public class BMGlyph return 0; } - public void SetKerning(int previousChar, int amount) - { - if (kerning == null) - { - kerning = new List(); - } - for (int i = 0; i < kerning.Count; i += 2) - { - if (kerning[i] == previousChar) - { - kerning[i + 1] = amount; - return; - } - } - kerning.Add(previousChar); - kerning.Add(amount); - } - public void Trim(int xMin, int yMin, int xMax, int yMax) { int num = x + width; diff --git a/SVSim.BattleEngine/Engine/BackGroundBase.cs b/SVSim.BattleEngine/Engine/BackGroundBase.cs index eaef9db9..3fa356c0 100644 --- a/SVSim.BattleEngine/Engine/BackGroundBase.cs +++ b/SVSim.BattleEngine/Engine/BackGroundBase.cs @@ -62,7 +62,10 @@ public class BackGroundBase _battleCamera = null; m_Battle3DContainer = null; m_BattleCutInContainer = null; - m_BtlMgrIns = BattleManagerBase.GetIns(); + // Pre-Phase-5b: seeded m_BtlMgrIns from the ambient mgr. All Field*.cs subclass ctors + // were stubbed to no-ops in chunk 3; nothing reads m_BtlMgrIns after that cull. Keeping + // the field as null in headless is safe (no user of it survives the Field cull). + m_BtlMgrIns = null; IsLoadDone = false; _str3DFieldNo = ""; _str3DFieldPath = ""; @@ -103,66 +106,11 @@ public class BackGroundBase BattleCoroutine.GetInstance().StopCoroutine(battleLoadCoroutine); } - public void CreateField(BattleCamera battleCamera, GameObject battle3DContainer, GameObject cutInContainer) - { - _battleCamera = battleCamera; - m_Battle3DContainer = battle3DContainer; - m_BattleCutInContainer = cutInContainer; - Camera componentInChildren = m_Battle3DContainer.GetComponentInChildren(); - Camera component = componentInChildren.transform.Find("Camera 3DGround").GetComponent(); - _battleCamera.SetUp(componentInChildren, m_BattleCutInContainer.transform.Find("Camera").GetComponent(), component); - LoadField(); - } - - protected void LoadField() - { - IsLoadDone = false; - m_BtlMgrIns = BattleManagerBase.GetIns(); - _str3DFieldNo = GetFieldIdString(FieldEffectId); - _str3DFieldPath = "3DField" + GetFieldIdString(FieldId); - m_SoundAssetPathList.Add($"s/se_field_{_str3DFieldNo}.acb"); - m_SoundAssetPathList.Add(string.Format("b/bgm_field_{0}.acb", (_bgmId != "NONE") ? GetFieldIdString(_bgmId) : _str3DFieldNo)); - m_SoundAssetPathList.Add(string.Format("b/bgm_field_{0}.awb", (_bgmId != "NONE") ? GetFieldIdString(_bgmId) : _str3DFieldNo)); - m_FieldAssetPath = Toolbox.ResourcesManager.GetAssetTypePath(_str3DFieldPath, ResourcesManager.AssetLoadPathType.Field3D); - List additionalAssetList = CollectAdditionalAssets(); - GameMgr.GetIns().GetEffectMgr().InitCommonEffect(string.Format("Json/FIeld" + _str3DFieldNo + "EffectData", _str3DFieldNo), isBattle: true); - battleLoadCoroutine = BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(m_SoundAssetPathList, delegate - { - BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(m_FieldAssetPath, delegate - { - Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(m_SoundAssetPathList); - Toolbox.ResourcesManager.BattleListAssetPathList.Add(m_FieldAssetPath); - (UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(_str3DFieldPath, ResourcesManager.AssetLoadPathType.Field3D, isfetch: true))) as GameObject).name = _str3DFieldPath; - if (additionalAssetList.IsNotNullOrEmpty()) - { - BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(additionalAssetList, delegate - { - Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(additionalAssetList); - BattleFieldBuild(); - })); - } - else - { - BattleFieldBuild(); - } - })); - })); - } - private string GetFieldIdString(int fieldId) { return fieldId.ToString((fieldId < 100) ? "00" : "0000"); } - private string GetFieldIdString(string fileldId) - { - if (int.TryParse(fileldId, out var result)) - { - return result.ToString((result < 100) ? "00" : "0000"); - } - return fileldId; - } - protected virtual void BattleFieldBuild() { } @@ -178,7 +126,7 @@ public class BackGroundBase public virtual void StartFieldTapEffect(int areaId, Vector3 pos) { - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.IsTouchable(); + m_BtlMgrIns.BattlePlayer.PlayerBattleView.IsTouchable(); } public void StartFieldOpening() @@ -191,7 +139,7 @@ public class BackGroundBase public void PlayBgm() { - GameMgr.GetIns().GetSoundMgr().PlayBGM(string.Format("bgm_field_{0}", (_bgmId != "NONE") ? GetFieldIdString(_bgmId) : _str3DFieldNo), 0f, 0L); + } protected virtual IEnumerator RunFieldOpening() @@ -201,16 +149,16 @@ public class BackGroundBase public static IEnumerator ObjectChecker(float fWaitSecs, string strObjectFind, Action callback) { - while (GameObject.Find(strObjectFind) == null || !GameMgr.GetIns().GetEffectMgr().IsFieldEffectReady || !GameMgr.GetIns().GetEffectMgr().IsBattleUIEffectReady) - { - yield return null; - } + // Pre-Phase-5b: polled GameObject.Find + EffectMgr readiness flags. All Field*.cs + // subclass BattleFieldBuild bodies were stubbed to no-ops in chunk 3; ObjectChecker + // is now only reachable via dead code. Fire the callback immediately. + yield return null; callback(); } public void StartFieldGimic(GameObject obj) { - if (!GameMgr.GetIns().IsReplayBattle && BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.IsTouchable()) + if (!m_BtlMgrIns.GameMgr.IsReplayBattle && m_BtlMgrIns.BattlePlayer.PlayerBattleView.IsTouchable()) { BattleCoroutine.GetInstance().StartCoroutine(RunFieldGimic(obj)); } diff --git a/SVSim.BattleEngine/Engine/BattleCamera.cs b/SVSim.BattleEngine/Engine/BattleCamera.cs index b422d836..888c7128 100644 --- a/SVSim.BattleEngine/Engine/BattleCamera.cs +++ b/SVSim.BattleEngine/Engine/BattleCamera.cs @@ -18,15 +18,6 @@ public class BattleCamera Camera = null; } - public void SetUp(Camera camera, UICamera cutInCamera, Camera backgroundCamera) - { - Camera = camera; - m_CutInCamera = cutInCamera; - _backgroundCamera = backgroundCamera; - BattleCameraPos = Camera.transform.localPosition; - BattleCameraRot = Camera.transform.eulerAngles; - } - public VfxBase ShakeCamera(Vector3 amount, float time, float delay) { ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); @@ -37,16 +28,6 @@ public class BattleCamera return parallelVfxPlayer; } - public static VfxBase ShakeCameraGameObject(GameObject obj, Vector3 amount, float time, float delay) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - iTween.ShakePosition(obj, iTween.Hash("amount", amount, "time", time, "delay", delay)); - })); - return parallelVfxPlayer; - } - public VfxBase ShakeComplete() { return InstantVfx.Create(delegate @@ -57,16 +38,6 @@ public class BattleCamera }); } - public static VfxBase ShakeCompleteGameObject(GameObject obj, Vector3 position, Vector3 euler) - { - return InstantVfx.Create(delegate - { - obj.transform.localPosition = position; - obj.transform.eulerAngles = euler; - iTween.Stop(obj); - }); - } - public Camera Get3DCamera() { return Camera; diff --git a/SVSim.BattleEngine/Engine/BattleCardBase.cs b/SVSim.BattleEngine/Engine/BattleCardBase.cs index 0d24e10a..95724c05 100644 --- a/SVSim.BattleEngine/Engine/BattleCardBase.cs +++ b/SVSim.BattleEngine/Engine/BattleCardBase.cs @@ -99,19 +99,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { return (DeathTypeInformation)MemberwiseClone(); } - - public void Reset() - { - WhenDestroy = false; - DestroyedByKiller = false; - ChantDestroy = false; - MysteriesDestroy = false; - BanishDestroy = false; - BurialRite = false; - UseFusionIngredient = false; - UseFusionMetamorphoseIngredient = false; - LeaveByGetOn = false; - } } public class ParameterChangeInformation @@ -455,18 +442,10 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu } } - private const string CONDITION_CHARGE_COUNT = "charge_count"; - - private const string TARGET_CONDITION_CHARGE_COUNT = "self.charge_count"; - - private const string ME_INPLAY_CLASS_COUNT = "{me.inplay.class.count}"; - private BattleCardBase _finalMetamorphoseCard; protected BuildInfo _buildInfo; - public List ReplayNoConsumeEpBuffInfoNameList = new List(); - protected SkillCollectionBase _normalSkillCollection; protected SkillCollectionBase _evolveSkillCollection; @@ -479,12 +458,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu private bool _isOndraw; - public const int NONE_COST = -1; - - public const int DEFAULT_SKILL_ACTIVATED_COUNT = 1; - - public const int DEFAULT_THIS_TURN_SKILL_ACTIVATED_COUNT = 0; - private int _skillActivatedCountWrapValue = -1; private int _skillActivatedCount; @@ -551,23 +524,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu } } - public int MetamorphoseCount - { - get - { - int num = 0; - BattleCardBase metamorphoseCard = MetamorphoseCard; - while (metamorphoseCard != null) - { - metamorphoseCard = metamorphoseCard.MetamorphoseCard; - num++; - } - return num; - } - } - - public BattleCardBase ReplayBuffInfoCard { get; set; } - public int PlayedTurn { get; protected set; } public DeathTypeInformation DeathTypeInfo { get; protected set; } @@ -578,8 +534,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public string UpdateBuildInfoBeforeCardName { get; private set; } = string.Empty; - public bool IsChoiceEvolutionCardBeforeUpdateBuildInfo => UpdateBuildInfoBeforeCardId / 1000000 == 910; - public List NormalSkillBuildInfos => _buildInfo.NormalSkillBuildInfos; public List EvolveSkillBuildInfos => _buildInfo.EvolveSkillBuildInfos; @@ -599,12 +553,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public List BuffInfoList { get; private set; } - public List ReplayBuffInfoList { get; set; } = new List(); - - public List ReplayAllCopyBuffInfoList { get; set; } = new List(); - - public List ReplayBuffInfoLabelList { get; set; } = new List(); - protected CardInnerOptionsBase InnerOptions => _buildInfo.InnerOptions; public IBattleResourceMgr ResourceMgr => _buildInfo.ResourceMgr; @@ -695,7 +643,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { get { - if (!GameMgr.GetIns().IsNewReplayBattle) + if (!_buildInfo.BattleMgr.GameMgr.IsNewReplayBattle) { if (!SelfBattlePlayer.Class.IsCantAttackClass && !SkillApplyInformation.IsSkillCantAtkClass && !IsEvolDrunkenness) { @@ -713,22 +661,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public bool IsCantAttackClassOnReplay { get; set; } - public bool IsCantAttackClassOnlyEvolDrunkenness - { - get - { - if (!SelfBattlePlayer.Class.IsCantAttackClass && !SkillApplyInformation.IsSkillCantAtkClass && IsEvolDrunkenness) - { - if (IsFirstTurn && SkillApplyInformation.IsRush) - { - return SkillApplyInformation.IsQuick; - } - return true; - } - return false; - } - } - public bool IsSummonDrunkenness { get; set; } public bool IsPreviousTurnAttacked { get; set; } @@ -1015,7 +947,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { get { - if (!GameMgr.GetIns().IsNewReplayBattle) + if (!_buildInfo.BattleMgr.GameMgr.IsNewReplayBattle) { if (AttackableCount <= 0 || (IsSummonDrunkenness && (!IsSummonDrunkenness || !IsEvolution)) || IsCantAttack) { @@ -1089,32 +1021,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public int CardId => _buildInfo.CardId; - public int EquitedCardId - { - get - { - if (IsChoiceEvolutionCard) - { - return BaseParameter.BaseCardId; - } - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; - if (specialBattleSettingInfo == null) - { - return CardId; - } - Dictionary idOverridePairDict = specialBattleSettingInfo.IdOverridePairDict; - if (idOverridePairDict == null) - { - return CardId; - } - if (idOverridePairDict.ContainsKey(CardId)) - { - return idOverridePairDict[CardId]; - } - return CardId; - } - } - public int Cost { get @@ -1164,8 +1070,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public int MaxLife => SkillApplyInformation.GetMaxLife(); - public int[] GenericValueArray => SkillApplyInformation.SkillGenericValueArray; - public virtual int BaseMaxLife { get @@ -1199,20 +1103,10 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public DamageParam DamageCalculationAtkTypeBeAttacked => new DamageParam(SkillApplyInformation.IsAttackByLifeTypeBeAttacked ? Life : Atk, this, SkillFilterCreator.ContentKeyword.unit.ToString(), Clan); - public ICardVfxCreator VfxCreator { get; protected set; } - public bool AreCanPlayConditionsFulfilled => this.OnCheckCanPlay.GetAllFuncCallResults().All((bool condition) => condition); public bool AreCanAttackConditionsFulfilled => this.OnCheckCanAttack.GetAllFuncCallResults().All((bool condition) => condition); - public bool AreCanBeAttackedConditionsFulfilled => this.OnCheckCanBeAttacked.GetAllFuncCallResults().All((bool condition) => condition); - - public bool AreCanBeSelectedConditionsFulfilled => this.OnCheckCanBeSelected.GetAllFuncCallResults().All((bool condition) => condition); - - public bool AreCanShowDetailConditionsFulfilled => this.OnCheckCanShowDetail.GetAllFuncCallResults().All((bool condition) => condition); - - public bool AreCanEvolveConditionsFulfilled => this.OnCheckCanEvolve.GetAllFuncCallResults().All((bool condition) => condition); - public int FixedUseCost => CalcFixedUseCost(SelfBattlePlayer.Pp); public List UseCostList @@ -1336,10 +1230,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public bool HasWhenFight => Skills.Any((SkillBase s) => s.IsWhenFightSkill); - public bool HasFusionSkill => Skills.Any((SkillBase s) => s is Skill_fusion); - - public bool HasNoSelectFusionSkill => Skills.Any((SkillBase s) => s.IsNoSelectFusionSkill); - public bool IsChoiceBraveSkillCard { get; set; } public bool HasSkillWhenEvolve => EvolutionSkills.Any((SkillBase s) => s.IsWhenEvolveSkill); @@ -1375,8 +1265,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu } } - public bool IsLegend => BaseParameter.Rarity >= 4; - public int DrawTurn { get; set; } public bool IsHaveBurialRiteJudgeBothFlag @@ -1473,14 +1361,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public event Func OnCheckCanAttack; - public event Func OnCheckCanBeAttacked; - - public event Func OnCheckCanBeSelected; - - public event Func OnCheckCanShowDetail; - - public event Func OnCheckCanEvolve; - public void SetPlayedTurnNow() { PlayedTurn = SelfBattlePlayer.Turn; @@ -1527,19 +1407,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu } } - public void UpdateChoiceEvolutionBeforeCard(int cardId, string cardName) - { - UpdateBuildInfoBeforeCardId = cardId; - UpdateBuildInfoBeforeCardName = cardName; - } - - public void ResetReplayBuffInfo() - { - ReplayBuffInfoList.Clear(); - ReplayNoConsumeEpBuffInfoNameList.Clear(); - ReplayBuffInfoLabelList.Clear(); - } - public virtual string SkillDescription(BattlePlayerBase.SideLogInfo sideLogInfo = null, bool isSkipOption = false, BuffInfo buff = null, string divergenceId = "", List skillDescriptionValueList = null, List sideLogDescriptionValueList = null) { return ConvertSkillDescription(BaseParameter.SkillDescription, sideLogInfo, isSkipOption, buff, divergenceId, skillDescriptionValueList, (IsBuffDetail && sideLogInfo == null && ReplayBuffDetailSkillDescriptionValueList.Count > 0) ? ReplayBuffDetailSkillDescriptionValueList : ((sideLogDescriptionValueList != null) ? sideLogDescriptionValueList : ReplaySkillDescriptionValueList)); @@ -1550,26 +1417,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu return ConvertSkillDescription(BaseParameter.EvoSkillDescription, sideLogInfo, isSkipOption, buff, divergenceId, skillDescriptionValueList, (IsBuffDetail && sideLogInfo == null && ReplayBuffDetailEvoSkillDescriptionValueList.Count > 0) ? ReplayBuffDetailEvoSkillDescriptionValueList : ((sideLogDescriptionValueList != null) ? sideLogDescriptionValueList : ReplayEvoSkillDescriptionValueList)); } - public string CopiedSkillDescription(string skillDescription, List skillDescriptionValueList) - { - return ConvertSkillDescription(skillDescription, null, isSkipOption: false, null, "", skillDescriptionValueList, null); - } - - public string CopiedEvoSkillDescription(string skillDescription, List skillDescriptionValueList) - { - return ConvertSkillDescription(skillDescription, null, isSkipOption: false, null, "", skillDescriptionValueList, null); - } - - public string CopiedSkillDescriptionInReplay(BuffInfo buff, List copiedSkillDescriptionValueList) - { - return ConvertSkillDescription(BaseParameter.SkillDescription, null, isSkipOption: false, buff, "", null, copiedSkillDescriptionValueList); - } - - public string CopiedEvoSkillDescriptionInReplay(BuffInfo buff, List copiedEvoSkillDescriptionValueList) - { - return ConvertSkillDescription(BaseParameter.EvoSkillDescription, null, isSkipOption: false, buff, "", null, copiedEvoSkillDescriptionValueList); - } - public virtual bool CantBeFocusedAttack(BattleCardBase attackCard) { if (SkillApplyInformation.IsSneak) @@ -1687,7 +1534,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { return false; } - if (!SelfBattlePlayer.IsPlayer && GameMgr.GetIns().IsAdminWatch) + if (!SelfBattlePlayer.IsPlayer && _buildInfo.BattleMgr.GameMgr.IsAdminWatch) { if (isCheckOnDraw && IsOnDraw) { @@ -1853,7 +1700,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public Action ForceAttackOff() { - if (BattleManagerBase.GetIns().IsRecovery) + if (_buildInfo.BattleMgr.IsRecovery) { return delegate { @@ -1881,47 +1728,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu return NormalSkills.Any((SkillBase s) => s.IsWhenPlaySkill); } - public int GetCurrentAtkBuff() - { - if (IsEvolution) - { - return SkillApplyInformation.GetAtk(ignoreLowerLimit: true) - BaseParameter.EvoAtk; - } - return SkillApplyInformation.GetAtk(ignoreLowerLimit: true) - BaseParameter.Atk; - } - - public int GetCurrentLifeBuff() - { - if (IsEvolution) - { - return SkillApplyInformation.GetMaxLife() - BaseParameter.EvoLife; - } - return SkillApplyInformation.GetMaxLife() - BaseParameter.Life; - } - - public bool IsMutationPlayPp(int pp) - { - int num = CalcFixedUseCost(pp, skipCondition: true); - if (-1 != num && num <= pp) - { - return pp < Cost; - } - return false; - } - - public Skill_pp_fixeduse GetAccelerateOrCrystallizeSkill(int currentPp) - { - Skill_pp_fixeduse result = null; - for (int i = 0; i < Skills.Count(); i++) - { - if (Skills.ElementAt(i) is Skill_pp_fixeduse skill_pp_fixeduse && skill_pp_fixeduse._fixedUsePP <= currentPp && skill_pp_fixeduse._fixedUsePP < Cost && currentPp < Cost) - { - result = skill_pp_fixeduse; - } - } - return result; - } - public int CalcFixedUseCost(int currentPp, bool skipCondition = false) { int num = -1; @@ -1942,15 +1748,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu return num; } - public int GetPaidFixedCost() - { - if (ExecutedFixedUseCostIndex != -1 && Skills.ElementAt(ExecutedFixedUseCostIndex) is Skill_pp_fixeduse skill_pp_fixeduse) - { - return skill_pp_fixeduse._fixedUsePP; - } - return -1; - } - public bool CheckConditionFixedUseCost(bool isPrePlay) { for (int i = 0; i < Skills.Count(); i++) @@ -2006,13 +1803,13 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu private CardParameter CreateClassParameter(bool isPlayer) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = _buildInfo.BattleMgr.GameMgr.GetDataMgr(); return new CardParameter((CardBasePrm.ClanType)(isPlayer ? dataMgr.GetPlayerClassId() : dataMgr.GetEnemyClassId())); } public void ChangeClassClanParameter() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = _buildInfo.BattleMgr.GameMgr.GetDataMgr(); BaseParameter.ChangeClanParameter((CardBasePrm.ClanType)(IsPlayer ? dataMgr.GetPlayerClassId() : dataMgr.GetEnemyClassId())); } @@ -2070,7 +1867,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public virtual void Setup(bool createNullView = false, bool isRecreate = false) { BattleCardView = CreateView(CreateViewBuildInfo(_buildInfo), createNullView); - VfxCreator = CreateVfxCreator(IsPlayer, BattleCardView, createNullView); if (!createNullView) { foreach (SkillBase normalSkill in NormalSkills) @@ -2084,7 +1880,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu } if (SkillApplyInformation == null) { - SkillApplyInformation = CreateSkillApplyInformation(this, VfxCreator); + SkillApplyInformation = CreateSkillApplyInformation(this); SkillApplyInformation.InitializeInformation(); } if (!isRecreate) @@ -2096,13 +1892,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu BanishedInfo = new BanishInfo(-1, isSelfTurn: false, BanishInfo.BanishPlace.None); } - public void RecreateView(GameObject cardGameObject) - { - _buildInfo.GameObject = cardGameObject; - Setup(createNullView: false, isRecreate: true); - SkillApplyInformation.ReSetupVfxCreator(VfxCreator); - } - protected virtual void InitSkillCollection() { _normalSkillCollection = CreateSkillCondition(_buildInfo.NormalSkillBuildInfos, _buildInfo.SelfBattlePlayer, _buildInfo.OpponentBattlePlayer, _buildInfo.ResourceMgr); @@ -2223,16 +2012,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu } } - public virtual VfxBase Draw(Vector3 Pos) - { - return VfxCreator.CreateDraw(Pos, IsLegend); - } - - public virtual VfxBase Moving(Vector3 Pos) - { - return VfxCreator.CreateMoving(Pos); - } - protected virtual VfxBase StartPlayCard() { foreach (BattleCardBase handCard in SelfBattlePlayer.HandCardList) @@ -2243,7 +2022,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu handCard.BattleCardView.UpdateMovability(); } } - if (!GameMgr.GetIns().IsNewReplayBattle) + if (!_buildInfo.BattleMgr.GameMgr.IsNewReplayBattle) { SelfBattlePlayer.CantPlayChoiceBrave = false; SelfBattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); @@ -2335,7 +2114,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu if (!SelfBattlePlayer.ClassAndInPlayCardList.Contains(this)) { DeathTypeInfo.WhenDestroy = Skills._skillTimingInfo.IsWhenDestroy; - VfxBase vfx = VfxCreator.CreateDestroy(DeathTypeInfo, SelfBattlePlayer); + VfxBase vfx = NullVfx.GetInstance(); sequentialVfxPlayer.Register(vfx); } sequentialVfxPlayer.Register(allFuncVfxResults); @@ -2357,7 +2136,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu VfxBase allFuncVfxResults = this.OnDestroy.GetAllFuncVfxResults(this, skillProcessor); if (!SelfBattlePlayer.HandCardList.Contains(this)) { - VfxBase vfx = VfxCreator.CreateDestroyHand(DeathTypeInfo, SelfBattlePlayer); + VfxBase vfx = NullVfx.GetInstance(); BattleCardView.HideCanPlayEffect(); sequentialVfxPlayer.Register(vfx); } @@ -2390,7 +2169,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu sequentialVfxPlayer.Register(this.OnBanish.GetAllFuncVfxResults(this, skillProcessor)); if (!isReturn) { - sequentialVfxPlayer.Register(VfxCreator.CreateBanish(DeathTypeInfo, SelfBattlePlayer)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } return sequentialVfxPlayer; } @@ -2400,7 +2179,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(this.OnBanish.GetAllFuncVfxResults(this, skillProcessor)); if (!SelfBattlePlayer.HandCardList.Contains(this)) { - vfxWithLoadingSequential.RegisterVfxWithLoading(VfxCreator.CreateBanishHand(DeathTypeInfo, SelfBattlePlayer)); + vfxWithLoadingSequential.RegisterVfxWithLoading(NullVfxWithLoading.GetInstance()); } return vfxWithLoadingSequential; } @@ -2414,7 +2193,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(this.OnGetOn.GetAllFuncVfxResults(this, skillProcessor)); - sequentialVfxPlayer.Register(VfxCreator.CreateGeton(vehicleCardTrans, vehicleCardView, DeathTypeInfo, SelfBattlePlayer)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); return sequentialVfxPlayer; } @@ -2425,7 +2204,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu sequentialVfxPlayer.Register(SkillApplyInformation.AllSkillEffectStop()); sequentialVfxPlayer.Register(RemoveFromInPlay()); sequentialVfxPlayer.Register(SelfBattlePlayer.UniteCard(this, skillProcessor, skill)); - sequentialVfxPlayer.Register(VfxCreator.CreateBanish(DeathTypeInfo, SelfBattlePlayer)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); return sequentialVfxPlayer; } @@ -2436,7 +2215,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu DeathTypeInfo.UseFusionIngredient = true; DeathTypeInfo.UseFusionMetamorphoseIngredient = isFusionMetamorphose; VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(this.OnBanish.GetAllFuncVfxResults(this, skillProcessor)); - vfxWithLoadingSequential.RegisterVfxWithLoading(VfxCreator.CreateFusionHand(SelfBattlePlayer, fusionCard.BattleCardView, isFusionMetamorphose)); + vfxWithLoadingSequential.RegisterVfxWithLoading(NullVfxWithLoading.GetInstance()); return vfxWithLoadingSequential; } @@ -2460,12 +2239,12 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public VfxBase StartHandEffect() { - if (SelfBattlePlayer.IsPlayer || GameMgr.GetIns().IsAdminWatch) + if (SelfBattlePlayer.IsPlayer || _buildInfo.BattleMgr.GameMgr.IsAdminWatch) { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); if (SpellChargeCount > 0 && HasSpellCharge && IsInHand) { - sequentialVfxPlayer.Register(new HandEffectLoopStartVfx(BattleCardView, () => IsActionCard, HandEffectLoopStartVfx.HandEffectType.SpellCharge)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } return sequentialVfxPlayer; } @@ -2483,7 +2262,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public virtual VfxBase StopSpellCharge() { - return new HandEffectLoopEndVfx(BattleCardView); + return NullVfx.GetInstance(); } public virtual VfxBase CreateMoveToHandVfx() @@ -2500,7 +2279,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_SIDE_LOG)) { BattlePlayerBase.SideLogInfo sideLogInfo = new BattlePlayerBase.SideLogInfo(skill); - return new ShowSideLogVfx(this, skill, SelfBattlePlayer.BattleView.GetSideLogControl(isSkillTargetSelect: false), (SkillDescription == string.Empty) ? GetCardSkillDescription(sideLogInfo, isEvolve) : SkillDescription, time, isEvol: false, sideLogInfo); + return NullVfx.GetInstance(); } return NullVfx.GetInstance(); } @@ -2524,7 +2303,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { SkillCollectionBase skillCollectionBase = (isEvolve ? EvolutionSkills : Skills); NetworkBattleManagerBase networkBattleManagerBase = SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; - GameMgr ins = GameMgr.GetIns(); + GameMgr ins = _buildInfo.BattleMgr.GameMgr; if (!ins.IsAdminWatch && !ins.IsAINetwork && networkBattleManagerBase != null) { NetworkBattleReceiver.ReceiveData receiveData = networkBattleManagerBase.networkBattleData.GetReceiveData(); @@ -2720,7 +2499,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public VfxBase CreateMaskCardInPlayVfx() { - return VfxCreator.CreateMaskCardInPlay(); + return NullVfx.GetInstance(); } public void AddCostModifier(ICardCostModifier modifier, SkillBase skill, bool eventCall = true) @@ -3042,23 +2821,9 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu return ParallelVfxPlayer.Create(parallelVfxPlayer, parallelVfxPlayer2); } - protected virtual ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) + protected virtual ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card) { - if (isNullView) - { - return NullCardVfxCreator.GetInstance(); - } - return new CardVfxCreatorBase(isPlayer, this, battleCardView, _buildInfo.ResourceMgr); - } - - protected virtual ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) - { - return new SkillApplyInformation(card, vfxCreator); - } - - public ParameterChangeInformation CreateParameterChangeInfo() - { - return new ParameterChangeInformation(Atk, BaseAtk, Life, MaxLife, BaseMaxLife); + return new SkillApplyInformation(card); } public void AddBuffInfo(BuffInfo buffInfo) @@ -3085,11 +2850,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu BuffInfoList.RemoveAll(condition); } - public bool IsContainBuffInfo(BuffInfo buffInfo) - { - return BuffInfoList.Contains(buffInfo); - } - public void ClearBuffInfo() { BuffInfoList.Clear(); @@ -3170,7 +2930,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu if ((handCardFrameEffectType < handCardFrameEffectType2 || (handCardFrameEffectType == HandCardFrameEffectType.LIGHT_BLUE && skill is Skill_pp_fixeduse)) && skill.VisualCheckCondition(pair, option, isPrePlay: true) && skill.PreprocessList.All((SkillPreprocessBase p) => p.IsRight(pair, option))) { handCardFrameEffectType = handCardFrameEffectType2; - if ((GameMgr.GetIns().IsWatchBattle || isNewReplayRecord) && handCardFrameEffectType == HandCardFrameEffectType.YELLOW && (skill.ConditionTargetFilter is SkillTargetDeckFilter || skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter c) => c.Text.Contains("deck") && RegisterSkillConditionCheck.IsSkillConditionCheck(skill)))) + if ((_buildInfo.BattleMgr.GameMgr.IsWatchBattle || isNewReplayRecord) && handCardFrameEffectType == HandCardFrameEffectType.YELLOW && (skill.ConditionTargetFilter is SkillTargetDeckFilter || skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter c) => c.Text.Contains("deck") && RegisterSkillConditionCheck.IsSkillConditionCheck(skill)))) { handCardFrameEffectType = HandCardFrameEffectType.NONE; } @@ -3187,7 +2947,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu bool isRobBuff = buff != null && buff.IsCopied; string text2 = (text.Contains("<<${") ? GetSkillDescriptionVariables(text) : text); bool flag = IsInHand || (text2.Contains("{me.inplay.class.count}") && (text2.Contains(SkillFilterCreator.ContentKeyword.hand.ToString()) || text2.Contains(SkillFilterCreator.ContentKeyword.deck.ToString()))); - if (num && !isSkipOption && !IsPlayer && !GameMgr.GetIns().IsAdminWatch && flag) + if (num && !isSkipOption && !IsPlayer && !_buildInfo.BattleMgr.GameMgr.IsAdminWatch && flag) { isSkipOption = true; } @@ -3350,7 +3110,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu bool isSkillDescriptionExpressionValueDefault = !flag2; if (flag) { - isSkillDescriptionExpressionValueDefault = ((flag3 || !GameMgr.GetIns().IsNewReplayBattle || text2.Contains("(divergence_id=")) ? EvalExpressionAndCondition(isSkillDescriptionExpressionValueDefault, text2, flag2, flag3, divergenceId, action, dictionary) : (replaySkillDescriptionValueList[num - 1] == 1)); + isSkillDescriptionExpressionValueDefault = ((flag3 || true /* headless: IsNewReplayBattle is const-false, guard collapses */ || text2.Contains("(divergence_id=")) ? EvalExpressionAndCondition(isSkillDescriptionExpressionValueDefault, text2, flag2, flag3, divergenceId, action, dictionary) : (replaySkillDescriptionValueList[num - 1] == 1)); string empty = string.Empty; empty = ((!isSkillDescriptionExpressionValueDefault) ? list2[2] : list2[1]); valueList?.Add(isSkillDescriptionExpressionValueDefault ? 1 : 0); @@ -3380,13 +3140,13 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu if (Regex.Match(text, "{<<([^>])+>>@").Success) { text = text5 + list.Count + text6; - int item = ((flag3 || !GameMgr.GetIns().IsNewReplayBattle) ? skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.v) : replaySkillDescriptionValueList[num - 1]); + int item = ((flag3 || true /* headless: IsNewReplayBattle is const-false, guard collapses */) ? skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.v) : replaySkillDescriptionValueList[num - 1]); list.Add(item.ToString()); valueList?.Add(item); } else { - int item2 = ((flag3 || !GameMgr.GetIns().IsNewReplayBattle) ? skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.v) : replaySkillDescriptionValueList[num - 1]); + int item2 = ((flag3 || true /* headless: IsNewReplayBattle is const-false, guard collapses */) ? skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.v) : replaySkillDescriptionValueList[num - 1]); text = text5 + item2 + text6; valueList?.Add(item2); } @@ -3592,8 +3352,8 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public virtual VfxBase RecoveryInPlay(int inPlayIndex, bool newReplayMoveTurn = false) { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new SummonCardPreperationVfx(this)); - sequentialVfxPlayer.Register(new ChangeInPlayViewVfx(BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(CreateMaskCardInPlayVfx()); sequentialVfxPlayer.Register(InstantVfx.Create(delegate { @@ -3715,11 +3475,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public VfxBase GetSpellChargeLoopEffect(int num) { - Func getIsActionCard = () => IsActionCard || IsInplay || BattleCardView._hasCardEnteredPlayQueue; - if (SpellChargeCount == 0 && num > 0) - { - return new HandEffectLoopStartVfx(BattleCardView, getIsActionCard, HandEffectLoopStartVfx.HandEffectType.SpellCharge); - } return NullVfx.GetInstance(); } @@ -3754,11 +3509,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu BattleCardView.UpdateCostViewStrategy(isForceUpdate); } - public void InitHandParameterIconPos(HandParameter.IconLayout layout) - { - BattleCardView.InitHandParameterIconPos(layout); - } - public IEnumerable AsIEnumerable() { yield return this; @@ -3778,7 +3528,7 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu { return false; } - if (!GameMgr.GetIns().IsAdmin && !IsPlayer && IsInHand) + if (!_buildInfo.BattleMgr.GameMgr.IsAdmin && !IsPlayer && IsInHand) { return false; } @@ -3809,20 +3559,13 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu public int GetBurialRiteCount(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool isPrePlay) { - if (BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView._isEvolutionSkillSelect) + if (_buildInfo.BattleMgr.BattlePlayer.PlayerBattleView._isEvolutionSkillSelect) { return EvolutionSkills.Count((SkillBase s) => s.CheckConditionWithoutBurialRite(playerInfoPair, option, isPrePlay)); } return Skills.Count((SkillBase s) => s.CheckConditionWithoutBurialRite(playerInfoPair, option, isPrePlay)); } - public void ReplaceParameterAndSkillOnDeck(int id) - { - _buildInfo.CardId = id; - CreateParameter(); - InitSkillApplyInformationOnWhenReturn(); - } - public bool HasInductionSkill() { for (int i = 0; i < Skills.Count(); i++) @@ -3849,18 +3592,6 @@ public abstract class BattleCardBase : IReadOnlyBattleCardInfo, IBattleCardUniqu return false; } - public int GetInductionLabelNumber() - { - SkillBase skillBase = Skills.FirstOrDefault((SkillBase s) => s.IsInductionSkill && s.SkillPrm.buildInfo._icon != "induction" && s.SkillPrm.buildInfo._icon.Contains("induction")); - if (skillBase == null) - { - return -1; - } - SkillOptionValue skillOptionValue = new SkillOptionValue(skillBase.SkillPrm.buildInfo._icon); - skillOptionValue.SetupFilterVariable(BattleManagerBase.GetIns().GetBattlePlayerInfoPair(IsPlayer), this, isPrePlay: false, null); - return skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.induction); - } - public bool HasStackWhiteRitualAndOtherIconSkill() { if (HasSkillStackWhiteRitual) diff --git a/SVSim.BattleEngine/Engine/BattleCardIconAnimations.cs b/SVSim.BattleEngine/Engine/BattleCardIconAnimations.cs index 2eac6ae1..fdb7303c 100644 --- a/SVSim.BattleEngine/Engine/BattleCardIconAnimations.cs +++ b/SVSim.BattleEngine/Engine/BattleCardIconAnimations.cs @@ -39,12 +39,6 @@ public class BattleCardIconAnimations : MonoBehaviour private int _inductionLabelNumber = -1; - private const float ALPHA_BLEND_RATE = 0.6f; - - private const string INDUCTION_ICON_SPRITE_NAME = "battle_notice_status_04"; - - private const string WHITE_RITUAL_STACK_SPRITE_NAME = "battle_notice_status_11"; - public VfxBase Initialize(BattleCardBase card, SkillCollectionBase collection, bool isStackWhiteRitual = false) { _card = card; @@ -66,19 +60,6 @@ public class BattleCardIconAnimations : MonoBehaviour }); } - public VfxBase InitializeOnlyStack(BattleCardBase card, SkillCollectionBase collection) - { - _card = card; - this.collection = collection; - bool isEarthRiteField = IsEarthRiteField(); - bool hasWhiteRirualStackSkill = HasStackWhiteRitualSkill(); - int whiteRitualCount = _card.SkillApplyInformation.WhiteRitualCount; - return InstantVfx.Create(delegate - { - InitializeIcon(isEarthRiteField && !hasWhiteRirualStackSkill, isEarthRiteField && hasWhiteRirualStackSkill, whiteRitualCount, hasInductionSkill: false, hasInductionNumberSkill: false, hasKiller: false, hasDrain: false, hasWhenDestroySkill: false, hasGetonSkill: false); - }); - } - private void InitializeIcon(bool hasWhiteRirualSkill, bool hasWhiteRirualStackSkill, int whiteRitualCount, bool hasInductionSkill, bool hasInductionNumberSkill, bool hasKiller, bool hasDrain, bool hasWhenDestroySkill, bool hasGetonSkill, bool isGetOnAfter = false, bool isReplay = false, bool isStackWhiteRitual = false) { if (!(_card.BattleCardView.GameObject == null)) @@ -123,43 +104,6 @@ public class BattleCardIconAnimations : MonoBehaviour } } - public VfxBase UpdateLabelNumber() - { - return InstantVfx.Create(delegate - { - SkillIcon skillIcon = skillIconListWithoutDuplicates.FirstOrDefault((SkillIcon i) => i._key == "induction_number"); - if (skillIcon != null) - { - skillIcon.LabelNumber = GetInductionLabelNumber(); - if (cardTemplate.SkillIconTemp.spriteName == "battle_notice_status_04") - { - ChangeSkillIconLabel(cardTemplate.SkillIconLabelTemp, skillIcon.LabelNumber); - } - } - }); - } - - public VfxBase UpdateWhiteRitualCountLabel() - { - if (!HasStackWhiteRitualSkill() || !IsEarthRiteField()) - { - return NullVfx.GetInstance(); - } - int whiteRitualCount = _card.SkillApplyInformation.WhiteRitualCount; - return InstantVfx.Create(delegate - { - SkillIcon skillIcon = skillIconListWithoutDuplicates.FirstOrDefault((SkillIcon i) => i._key == "stack_white_ritual"); - if (skillIcon != null) - { - skillIcon.LabelNumber = whiteRitualCount; - if (cardTemplate.SkillIconTemp.spriteName == "battle_notice_status_11") - { - ChangeSkillIconLabel(cardTemplate.SkillIconLabelTemp, skillIcon.LabelNumber); - } - } - }); - } - private void AddToIconList(string key, string spriteName, bool addCondition, int labelNumber = -1) { if (addCondition) @@ -189,37 +133,6 @@ public class BattleCardIconAnimations : MonoBehaviour } } - public VfxBase ShowIcon() - { - return InstantVfx.Create(delegate - { - cardTemplate.SkillIconTemp.gameObject.SetActive(value: true); - }); - } - - public VfxBase HideIcon() - { - return InstantVfx.Create(delegate - { - cardTemplate.SkillIconTemp.gameObject.SetActive(value: false); - }); - } - - private void Update() - { - if (cardTemplate != null) - { - if (cardTemplate.SkillIconTemp.gameObject.activeSelf) - { - SkillIconAlphaBlend(); - } - else - { - cardTemplate.SkillIconTemp.alpha = 0f; - } - } - } - public void AddSkillIcon(string key, string fileName, int labelNumber = -1) { string iconSpriteName = ((!skillIconList.Any((SkillIcon v) => v._key == key)) ? fileName : null); @@ -242,22 +155,6 @@ public class BattleCardIconAnimations : MonoBehaviour ChangeTexture(); } - public void DeleteUnneededSkillIcons() - { - RemoveSkillIconFromList("white_ritual", () => !IsEarthRiteField()); - RemoveSkillIconFromList("induction", () => !HasInductionSkill()); - RemoveSkillIconFromList("induction_number", () => !HasInductionNumberSkill()); - RemoveSkillIconFromList("destroy", () => !HasWhenDestroySkill()); - } - - private void RemoveSkillIconFromList(string key, Func deleteCondition) - { - if (deleteCondition()) - { - DeleteSkillIcon(key); - } - } - private void ChangeTexture() { if (skillIconListWithoutDuplicates.Count() - 1 > skillCount) @@ -307,48 +204,6 @@ public class BattleCardIconAnimations : MonoBehaviour skillIconListWithoutDuplicates.Clear(); } - private void SkillIconAlphaBlend() - { - bool flag = cardTemplate.SkillIconLabelTemp.text.IsNotNullOrEmpty(); - if (skillIconListWithoutDuplicates.Count > 1) - { - if (skillIconAlphaFlg) - { - cardTemplate.SkillIconTemp.alpha += (flag ? (0.6f * Time.deltaTime * 2f) : (0.6f * Time.deltaTime)); - } - else - { - cardTemplate.SkillIconTemp.alpha -= (flag ? (0.6f * Time.deltaTime * 2f) : (0.6f * Time.deltaTime)); - } - } - else if (cardTemplate.SkillIconTemp.spriteName == string.Empty) - { - cardTemplate.SkillIconTemp.alpha = 1f; - if (skillIconListWithoutDuplicates.Count > 0) - { - if (cardTemplate.SkillIconTemp.spriteName != skillIconListWithoutDuplicates[0]._iconSpriteName) - { - cardTemplate.SkillIconTemp.spriteName = skillIconListWithoutDuplicates[0]._iconSpriteName; - } - ChangeSkillIconLabel(cardTemplate.SkillIconLabelTemp, skillIconListWithoutDuplicates[0].LabelNumber); - UpdateSkillIconLabelColor(); - } - } - else - { - cardTemplate.SkillIconTemp.alpha = 1f; - } - if (skillIconAlphaFlg && cardTemplate.SkillIconTemp.alpha >= (flag ? 2f : 1f)) - { - skillIconAlphaFlg = false; - } - else if (!skillIconAlphaFlg && cardTemplate.SkillIconTemp.alpha <= 0f) - { - ChangeTexture(); - skillIconAlphaFlg = true; - } - } - private bool HasWhenDestroySkill() { return collection._skillTimingInfo.IsWhenDestroy; @@ -402,7 +257,7 @@ public class BattleCardIconAnimations : MonoBehaviour return -1; } SkillOptionValue skillOptionValue = new SkillOptionValue(skillBase.SkillPrm.buildInfo._icon); - skillOptionValue.SetupFilterVariable(BattleManagerBase.GetIns().GetBattlePlayerInfoPair(_card.IsPlayer), _card, isPrePlay: false, null); + skillOptionValue.SetupFilterVariable(_card.SelfBattlePlayer.BattleMgr.GetBattlePlayerInfoPair(_card.IsPlayer), _card, isPrePlay: false, null); return skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.induction); } @@ -464,24 +319,4 @@ public class BattleCardIconAnimations : MonoBehaviour DeleteSkillIcon(key); } } - - public void DeleteSkillIcons() - { - if (!(cardTemplate == null)) - { - DeleteSkillIcon("white_ritual"); - DeleteSkillIcon("stack_white_ritual"); - DeleteSkillIcon("induction"); - DeleteSkillIcon("induction_number"); - DeleteSkillIcon("destroy"); - DeleteSkillIcon("killer"); - DeleteSkillIcon("drain"); - DeleteSkillIcon("geton"); - } - } - - public int GetIconListCount() - { - return skillIconListWithoutDuplicates.Count; - } } diff --git a/SVSim.BattleEngine/Engine/BattleControl.cs b/SVSim.BattleEngine/Engine/BattleControl.cs index e2bfb18d..0753671a 100644 --- a/SVSim.BattleEngine/Engine/BattleControl.cs +++ b/SVSim.BattleEngine/Engine/BattleControl.cs @@ -1,124 +1,28 @@ using System; using System.Collections; -using System.Collections.Generic; -using Cute; using UnityEngine; -using Wizard; using Wizard.Battle.UI; -using Wizard.Battle.View.Vfx; +// Post-Phase-5b (2026-07-03) UI stub. BattleControl handles UI-side end-of-battle +// scene-change cleanup (DestroyBattleEffectContainer, ResetEnemyData, UIContainer +// visibility, iTween tear-down). Every method is only invoked from UI code paths +// (DialogBase.OnClose, MyPageBannerBase, FreeAndRankMatchDeckSelectConfirmDialog, +// RecoveryManagerBase, SceneTransition) that don't run headless. The type stays +// because GameMgr.GetBattleCtrl() lazy-inits it; the method bodies are no-ops. public class BattleControl : MonoBehaviour { - private BattleManagerBase m_BtlMgrIns; - - private int FirstAttack; - - public void Init() - { - m_BtlMgrIns = BattleManagerBase.GetIns(); - GameMgr.GetIns().GetInputMgr().SetLayerMask(512); - LocalLog.AccumulateLastTraceLog("StartBattleCoroutine "); - StartCoroutine(WaitLoadOpponentObjectToBattleStart(m_BtlMgrIns.LoadOpponentObjects())); - } - - private IEnumerator WaitLoadOpponentObjectToBattleStart(VfxBase vfx) - { - if (GameMgr.GetIns().IsNetworkBattle) - { - FirstAttack = ToolboxGame.RealTimeNetworkAgent.GetIsFirstPlayer(); - } - while (!vfx.IsEnd) - { - yield return null; - } - LocalLog.AccumulateLastTraceLog("DecideFirstUser End "); - m_BtlMgrIns.StartOpening(FirstAttack); - } - public void BattleEnd(UIManager.ViewScene MoveTo, Action callback = null, Action paramCustomize = null, object sceneParam = null) { - ToolboxGame.UIManager.gameObject.SetActive(value: true); - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.OnBeforeChange = delegate - { - BattleManagerBase.GetIns().DisposeBattleGameObj(); - }; - changeViewSceneParam.OnChange = delegate - { - GameMgr.GetIns().GetEffectMgr().DestroyBattleEffectContainer(); - GameMgr.GetIns().GetDataMgr().ResetEnemyData(); - GameMgr.GetIns().DestroyBattleManagements(); - GameMgr.GetIns().GetGameObjMgr().GetUIContainer() - .SetActive(value: false); - if (callback != null) - { - callback(); - } - }; - paramCustomize.Call(changeViewSceneParam); - StartCoroutine(UnloadAllResources(MoveTo, changeViewSceneParam, null, sceneParam)); - } - - private IEnumerator UnloadAllResources(UIManager.ViewScene MoveTo = UIManager.ViewScene.None, UIManager.ChangeViewSceneParam param = null, Action callback = null, object sceneParam = null) - { - BattleLogManager.GetInstance().Clear(); - GameMgr.GetIns().GetEffectMgr().ClearLastCacheEffect(); - StopAllTweens(); - yield return Resources.UnloadUnusedAssets(); - GC.Collect(); callback?.Invoke(); - if (MoveTo != UIManager.ViewScene.None) - { - UIManager.GetInstance().ChangeViewScene(MoveTo, param, sceneParam); - } } public IEnumerator BattleEnd(Action callback = null) { - BattleRelease(); - yield return Resources.UnloadUnusedAssets(); - GC.Collect(); + yield return null; callback?.Invoke(); } public void BattleRelease() { - ToolboxGame.UIManager.gameObject.SetActive(value: true); - GameMgr.GetIns().GetEffectMgr().DestroyBattleEffectContainer(); - GameMgr.GetIns().GetDataMgr().ResetEnemyData(); - if (BattleManagerBase.GetIns() != null) - { - BattleManagerBase.GetIns().DisposeBattleGameObj(); - } - GameMgr.GetIns().DestroyBattleManagements(); - GameMgr.GetIns().GetGameObjMgr().GetUIContainer() - .SetActive(value: false); - BattleLogManager.GetInstance().Clear(); - GameMgr.GetIns().GetEffectMgr().ClearLastCacheEffect(); - StopAllTweens(); - } - - private void StopAllTweens() - { - HashSet hashSet = new HashSet(); - for (int i = 0; i < iTween.tweens.Count; i++) - { - if (iTween.tweens[i] != null) - { - GameObject gameObject = (GameObject)iTween.tweens[i]["target"]; - if (gameObject != null) - { - hashSet.Add(gameObject); - } - } - } - foreach (GameObject item in hashSet) - { - if (item != null) - { - iTween.Stop(item); - } - } - iTween.tweens.Clear(); } } diff --git a/SVSim.BattleEngine/Engine/BattleEnemy.cs b/SVSim.BattleEngine/Engine/BattleEnemy.cs index e0f8eeeb..a0a96ee9 100644 --- a/SVSim.BattleEngine/Engine/BattleEnemy.cs +++ b/SVSim.BattleEngine/Engine/BattleEnemy.cs @@ -11,7 +11,6 @@ using Wizard.Battle.View.Vfx; public class BattleEnemy : BattlePlayerBase { - private readonly Vector3 OFFSET_THINK_ICON_FROM_CLASSVIEW = new Vector3(0.62f, 0.15f, 0f); private IEmotion _emotion; @@ -83,7 +82,7 @@ public class BattleEnemy : BattlePlayerBase public override VfxBase StartTurnControl(string log = "") { - if (GameMgr.GetIns().IsAdminWatch) + if (BattleMgr.GameMgr.IsAdminWatch) { UpdateHandCardsPlayability(); } @@ -91,7 +90,7 @@ public class BattleEnemy : BattlePlayerBase SequentialVfxPlayer sequentialVfxPlayer = TurnEvolveControl(BattleView.EpIcon); VfxBase vfx = TurnStart(); sequentialVfxPlayer.Register(vfx); - VfxBase vfx2 = BattleManagerBase.GetIns().JudgeBattleResult(); + VfxBase vfx2 = BattleMgr.JudgeBattleResult(); sequentialVfxPlayer.Register(vfx2); sequentialVfxPlayer.Register(CreateThinkingVfx(base.BattleMgr)); return sequentialVfxPlayer; @@ -99,15 +98,11 @@ public class BattleEnemy : BattlePlayerBase public VfxBase CreateThinkingVfx(BattleManagerBase battleMgr) { - if (GameMgr.GetIns().IsAdminWatch) + if (BattleMgr.GameMgr.IsAdminWatch) { return NullVfx.GetInstance(); } - return new DelaySetupVfx(() => new ThinkIconShowVfx(delegate - { - Vector3 position = base.BattleCamera.Get3DCamera().WorldToScreenPoint(base.Class.BattleCardView.Transform.position + OFFSET_THINK_ICON_FROM_CLASSVIEW); - return UIManager.GetInstance().getCamera().ScreenToWorldPoint(position); - }, battleMgr.BattleResourceMgr)); + return NullVfx.GetInstance(); } public override VfxBase UsePp(int pp, bool isNewReplayMoveTurn = false) @@ -122,7 +117,7 @@ public class BattleEnemy : BattlePlayerBase Vector3 position = base.BattleCamera.Get3DCamera().WorldToScreenPoint(StatusPanelControl.GetPPPanel().transform.Find("PPIcon/PPLabel").transform.position); labelPosition = UIManager.GetInstance().getCamera().ScreenToWorldPoint(position); })); - sequentialVfxPlayer.Register(new DelaySetupVfx(() => m_vfxCreator.CreateUsePp(usedPp, maxPp, labelPosition, isNewReplayMoveTurn))); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); return sequentialVfxPlayer; } @@ -144,7 +139,7 @@ public class BattleEnemy : BattlePlayerBase public override VfxBase CardDrawVfx(IEnumerable DrawList, bool skipShuffle = false, bool isOpenDrawSkill = false) { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (GameMgr.GetIns().IsAdminWatch) + if (BattleMgr.GameMgr.IsAdminWatch) { foreach (BattleCardBase card in DrawList) { @@ -158,15 +153,15 @@ public class BattleEnemy : BattlePlayerBase } } } - sequentialVfxPlayer.Register(new OpponentDrawCardVfx(DrawList, isOpenDrawSkill)); - sequentialVfxPlayer.Register(new OpponentDrawCardToHandVfx(DrawList.ToList(), 0.4f, isOpenDrawSkill, skipShuffle)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); return sequentialVfxPlayer; } public override VfxBase TurnEnd() { - ParallelVfxPlayer result = ParallelVfxPlayer.Create(base.TurnEnd(), new ThinkIconHideVfx(base.BattleMgr.BattleResourceMgr)); - if (GameMgr.GetIns().IsAdminWatch) + ParallelVfxPlayer result = ParallelVfxPlayer.Create(base.TurnEnd(), NullVfx.GetInstance()); + if (BattleMgr.GameMgr.IsAdminWatch) { foreach (BattleCardBase handCard in base.HandCardList) { @@ -178,7 +173,7 @@ public class BattleEnemy : BattlePlayerBase protected override void SetActive() { - if (GameMgr.GetIns().IsAdminWatch) + if (BattleMgr.GameMgr.IsAdminWatch) { UpdateHandCardsPlayability(); } @@ -201,7 +196,7 @@ public class BattleEnemy : BattlePlayerBase handCard.BattleCardView.areArrowsForcedOff = areArrowsForcedOff; handCard.BattleCardView.UpdateMovability(); } - if (!GameMgr.GetIns().IsAdmin) + if (!BattleMgr.GameMgr.IsAdmin) { return; } @@ -218,7 +213,7 @@ public class BattleEnemy : BattlePlayerBase public override VfxBase MoveToHand(List cardsToMoveToHand) { - return SequentialVfxPlayer.Create(new OpponentDrawCardToHandVfx(cardsToMoveToHand.ToList(), 0.3f), InstantVfx.Create(delegate + return SequentialVfxPlayer.Create(NullVfx.GetInstance(), InstantVfx.Create(delegate { UpdateHandCardsPlayability(); })); @@ -226,7 +221,7 @@ public class BattleEnemy : BattlePlayerBase public override EffectBattle GetSkillEffect(string skillEffectPath) { - return GameMgr.GetIns().GetEffectMgr().GetEnemyEffectBattle(skillEffectPath); + return BattleMgr.GameMgr.GetEffectMgr().GetEnemyEffectBattle(skillEffectPath); } public override Vector3 GetFieldCenterPosition() diff --git a/SVSim.BattleEngine/Engine/BattleFinishParam.cs b/SVSim.BattleEngine/Engine/BattleFinishParam.cs deleted file mode 100644 index a114cd30..00000000 --- a/SVSim.BattleEngine/Engine/BattleFinishParam.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using Wizard; - -public class BattleFinishParam : BaseParam -{ - public int class_id; - - public int total_turn; - - public int evolve_count; - - public int enemy_evolve_count; - - public int battle_result; - - public int is_retire; - - public Dictionary mission; - - public string recovery_data; - - public int SDTRB; - - public string[] prosessing_time_data; -} diff --git a/SVSim.BattleEngine/Engine/BattleFinishResponsProcessing.cs b/SVSim.BattleEngine/Engine/BattleFinishResponsProcessing.cs index 128b0178..6ed68d49 100644 --- a/SVSim.BattleEngine/Engine/BattleFinishResponsProcessing.cs +++ b/SVSim.BattleEngine/Engine/BattleFinishResponsProcessing.cs @@ -6,7 +6,7 @@ public class BattleFinishResponsProcessing public void Processing(JsonData ResponseData, MatchFinishBase matchFinishData) { matchFinishData.IsProcessed = true; - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.RankBattle && Data.CurrentFormat != Format.Crossover) + if (false /* Pre-Phase-5b: no BattleType headless */ && Data.CurrentFormat != Format.Crossover) { if (ResponseData["data"].Keys.Contains("target_grand_master_point")) { @@ -18,7 +18,7 @@ public class BattleFinishResponsProcessing } } Data.RedEtherCampaignResultData = null; - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumNormal || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumTwoPick || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumHof || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumWindFall || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumAvatar) + if (false /* Pre-Phase-5b: no BattleType headless */) { Data.ArenaData.ColosseumData.ResultEffect = ArenaColosseum.eResultEffect.None; } @@ -51,7 +51,7 @@ public class BattleFinishResponsProcessing matchFinishData.battleResult = BattleManagerBase.BATTLE_RESULT_TYPE.CONSISTENCY; break; } - (BattleManagerBase.GetIns() as NetworkBattleManagerBase).BattleResultType = matchFinishData.battleResult; + /* Pre-Phase-5b: BattleResultType write dropped */ break; case "get_class_experience": matchFinishData.get_class_chara_experience = jsonData2.ToInt(); diff --git a/SVSim.BattleEngine/Engine/BattleFinishSendBase.cs b/SVSim.BattleEngine/Engine/BattleFinishSendBase.cs deleted file mode 100644 index 6de0fa68..00000000 --- a/SVSim.BattleEngine/Engine/BattleFinishSendBase.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using Cute; -using Wizard; - -public class BattleFinishSendBase -{ - private FinishTaskBase _finishTaskBase; - - private Action _onSuccess; - - private NetworkManager _networkManager; - - private BattleManagerBase _battleMgr; - - public BattleFinishSendBase(BattleManagerBase mgr) - { - _networkManager = Toolbox.NetworkManager; - _battleMgr = mgr; - } - - public void SendMatchingFinish(FinishTaskBase finishTaskBase, Action callbackOnSuccess) - { - _finishTaskBase = finishTaskBase; - SettingFinishBattleParameter(finishTaskBase); - _onSuccess = callbackOnSuccess; - StartMatchingFinish(); - } - - private void StartMatchingFinish() - { - LocalLog.AccumulateLastTraceLog("StartMatchingFinish"); - BattleCoroutine.GetInstance().StartCoroutine(_networkManager.Connect(_finishTaskBase, _onSuccess, CallbackOnFailure, null, encrypt: true, useJson: false, showLoadingIcon: false)); - } - - public void CallbackOnFailure(NetworkTask.ResultCode result) - { - LocalLog.AccumulateTraceLog("CallbackOnFailure" + result); - } - - private void SettingFinishBattleParameter(FinishTaskBase data) - { - int cumulativeEvolutionCount = _battleMgr.BattlePlayer._cumulativeEvolutionCount; - int cumulativeEvolutionCount2 = _battleMgr.BattleEnemy._cumulativeEvolutionCount; - int battle_result = ((!_battleMgr.BattlePlayer.Class.IsDead) ? 1 : 0); - int is_retire = (_battleMgr.IsPlayerRetire ? 1 : 0); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - data.SettingFinishBattleParameter(dataMgr.GetPlayerClassId(), _battleMgr.BattlePlayer.Turn, cumulativeEvolutionCount, cumulativeEvolutionCount2, battle_result, is_retire); - } -} diff --git a/SVSim.BattleEngine/Engine/BattleFinishToOpponentDisConnectChecker.cs b/SVSim.BattleEngine/Engine/BattleFinishToOpponentDisConnectChecker.cs index 5ec3d6b8..c7c58c09 100644 --- a/SVSim.BattleEngine/Engine/BattleFinishToOpponentDisConnectChecker.cs +++ b/SVSim.BattleEngine/Engine/BattleFinishToOpponentDisConnectChecker.cs @@ -12,18 +12,6 @@ public class BattleFinishToOpponentDisConnectChecker : NetworkBattleIntervalChec private int _dispScene; - private const int WINDOW_DISP_WAIT = 0; - - private const int WINDOW_UPDATE = 1; - - private const int FINISH_SEND_WAIT = 2; - - private const int FINISH_OPPONENT_DISCONNECT_INTERVAL = 8; - - private const int FINISH_OPPONENT_DISP_COUNTER_INTERVAL = 98; - - private const int FINISH_BATTLE_SEND_INTERVAL = 128; - private bool _isDisconnect; public bool IsStart { get; private set; } @@ -116,7 +104,7 @@ public class BattleFinishToOpponentDisConnectChecker : NetworkBattleIntervalChec { _isDisconnect = true; UIManager.GetInstance().closeInSceneNotNetwork(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.ShowAlert(PanelMgr.BattleAlertType.DisconnectInfomation, isClass: false); + networkBattleManager.BattlePlayer.PlayerBattleView.ShowAlert(PanelMgr.BattleAlertType.DisconnectInfomation, isClass: false); } } @@ -131,8 +119,8 @@ public class BattleFinishToOpponentDisConnectChecker : NetworkBattleIntervalChec { _isDisconnect = false; UIManager.GetInstance().createInSceneNotNetwork(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.OffNotHideAndNotCreate(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.HideAlertDialogue(); + networkBattleManager.BattlePlayer.PlayerBattleView.OffNotHideAndNotCreate(); + networkBattleManager.BattlePlayer.PlayerBattleView.HideAlertDialogue(); } } diff --git a/SVSim.BattleEngine/Engine/BattleKeywordInfoListMgr.cs b/SVSim.BattleEngine/Engine/BattleKeywordInfoListMgr.cs index c0cb71a9..5fca2e1c 100644 --- a/SVSim.BattleEngine/Engine/BattleKeywordInfoListMgr.cs +++ b/SVSim.BattleEngine/Engine/BattleKeywordInfoListMgr.cs @@ -13,38 +13,9 @@ public class BattleKeywordInfoListMgr : MonoBehaviour private static readonly string[] KEYWORD_PATTERNS = new string[2] { "\\[u\\]\\[(ffcd45|524522)\\](?.*?)\\[-\\]\\[/u\\]", "\\[b\\](?.*?)\\[/b\\]" }; - private static readonly string KEYWORD_TITLE_REMOVE_PATTERN = "<<\\{me.hand_self.count\\}\\+\\d\\?\\?>>"; - - private const int LABEL_KEYWORD = 0; - - private const int LABEL_DESC = 1; - - private const int LINE_SPRITE = 0; - - private const int PADDING_OBJECT = 1; - - private const int LINE_SPRITE_OFFSET = -12; - - private const int CLASS_EFFECT_TABLE_PADDING_Y = 30; - - private const int CLASS_EFFECT_FONT_SIZE = 21; - - [SerializeField] - public UIScrollView ScrollView; - - [SerializeField] - private NguiObjs SkillInfo; - - [SerializeField] - public UITable _table; - [SerializeField] private UIPanel _panel; - private IList SkillInfoList = new List(); - - private Action ResetTableFinishAction; - public static IList GetKeywords(CardParameter cardParameter) { return GetKeywords(cardParameter.SkillDescription + cardParameter.EvoSkillDescription); @@ -67,309 +38,6 @@ public class BattleKeywordInfoListMgr : MonoBehaviour return list; } - public void SetKeywordInfos(IList currentWords, CardMaster.CardMasterId cardMasterId) - { - List list = new List(); - for (int i = 0; i < currentWords.Count; i++) - { - string keywordTitle = string.Empty; - string skillinfo = string.Empty; - string text = currentWords[i]; - string valueOrDefault = Data.Master.BattleKeywordReplaceDic.GetValueOrDefault(text, text); - if (GetKeywordData(valueOrDefault, cardMasterId, out keywordTitle, out skillinfo) && !list.Contains(keywordTitle)) - { - AddKeywordInfo(keywordTitle, skillinfo, LabelDefine.TEXT_COLOR_KEYWORD, cardMasterId); - list.Add(keywordTitle); - } - } - StartCoroutine(RepositionTable()); - } - - public void SetBuffInfos(List baseCardID, List buff) - { - string empty = string.Empty; - for (int i = 0; i < baseCardID.Count; i++) - { - empty = ((CardMaster.GetInstanceForBattle().GetCardParameterFromId(baseCardID[i]).CardName != null && !(CardMaster.GetInstanceForBattle().GetCardParameterFromId(baseCardID[i]).CardName == string.Empty)) ? CardMaster.GetInstanceForBattle().GetCardParameterFromId(baseCardID[i]).CardName : Data.SystemText.Get("BattleLog_0097")); - AddKeywordInfo(empty, buff[i], LabelDefine.TEXT_COLOR_NORMAL, CardMaster.BatttleCardMasterId); - } - StartCoroutine(RepositionTable()); - } - - public IEnumerator RepositionTable() - { - yield return null; - _table.Reposition(); - ScrollView.verticalScrollBar.value = 0f; - ScrollView.ResetPosition(); - if (ResetTableFinishAction != null) - { - ResetTableFinishAction(); - } - } - - public void AddKeywordInfo(string keyword, string desc, Color32 keywordColor, CardMaster.CardMasterId cardMasterId, bool isClassEffect = false, Action onClickCardName = null, bool isKeyWordDisp = true) - { - NguiObjs nguiObjs = UnityEngine.Object.Instantiate(SkillInfo); - keyword = Regex.Replace(keyword, KEYWORD_TITLE_REMOVE_PATTERN, ""); - if (isClassEffect) - { - nguiObjs.labels[0].fontSize = 21; - nguiObjs.labels[1].fontSize = 21; - } - nguiObjs.transform.parent = _table.transform; - nguiObjs.labels[0].text = keyword; - nguiObjs.labels[0].color = keywordColor; - nguiObjs.labels[1].SetWrapText(desc); - nguiObjs.transform.localScale = new Vector3(1f, 1f, 1f); - nguiObjs.gameObject.name = SkillInfoList.Count.ToString(); - nguiObjs.gameObject.SetActive(value: true); - if (isClassEffect) - { - GameObject gameObject = new GameObject("paddingObject"); - gameObject.transform.SetParent(nguiObjs.labels[0].gameObject.transform); - gameObject.transform.localPosition = Vector3.zero; - gameObject.transform.localScale = Vector3.one; - UISprite uISprite = gameObject.AddComponent(); - uISprite.alpha = 0f; - uISprite.height = 30; - gameObject.transform.localPosition = new Vector3(nguiObjs.labels[0].width / 2, gameObject.transform.localPosition.y); - nguiObjs.objs.Add(gameObject); - if (SkillInfoList.Count == 0) - { - gameObject.SetActive(value: false); - } - BoxCollider boxCollider = nguiObjs.labels[1].gameObject.AddComponent(); - boxCollider.size = new Vector3(nguiObjs.labels[1].width, nguiObjs.labels[1].height); - boxCollider.center = new Vector3(nguiObjs.labels[1].width / 2, -nguiObjs.labels[1].height / 2); - List keyWordList = BattlePlayerView.GetKeyWordList(nguiObjs.labels[1].text); - UIEventListener uIEventListener = UIEventListener.Get(nguiObjs.labels[1].gameObject); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate - { - if (keyWordList.Count == 0) - { - onClickCardName(); - } - else - { - BattlePlayerView.CreateClassEffectPanel(keyWordList, cardMasterId); - } - }); - BattlePlayerView.SetKeyWordColor(nguiObjs.labels[1].gameObject, nguiObjs.labels[1]); - BoxCollider boxCollider2 = nguiObjs.labels[0].gameObject.AddComponent(); - boxCollider2.size = new Vector3(nguiObjs.labels[0].width, nguiObjs.labels[0].height); - boxCollider2.center = new Vector3(nguiObjs.labels[0].width / 2, -nguiObjs.labels[0].height / 2); - BattlePlayerView.SetLabelColorEvent(nguiObjs.labels[0]); - UIEventListener uIEventListener2 = UIEventListener.Get(nguiObjs.labels[0].gameObject); - uIEventListener2.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onClick, (UIEventListener.VoidDelegate)delegate - { - onClickCardName(); - }); - if (!isKeyWordDisp) - { - nguiObjs.labels[0].gameObject.SetActive(value: false); - nguiObjs.labels[1].transform.localPosition = new Vector3(nguiObjs.labels[1].transform.localPosition.x, nguiObjs.labels[0].transform.localPosition.y); - SkillInfoList[SkillInfoList.Count - 1].objs[0].SetActive(value: false); - } - boxCollider.gameObject.AddComponent().scrollView = ScrollView; - boxCollider2.gameObject.AddComponent().scrollView = ScrollView; - UILabel uILabel = nguiObjs.labels[1]; - uILabel.topAnchor.target = null; - uILabel.bottomAnchor.target = null; - uILabel.leftAnchor.target = null; - uILabel.rightAnchor.target = null; - UISprite component = nguiObjs.objs[0].GetComponent(); - component.topAnchor.target = null; - component.bottomAnchor.target = null; - component.leftAnchor.target = null; - component.rightAnchor.target = null; - component.transform.localPosition = new Vector3(component.transform.localPosition.x, uILabel.transform.localPosition.y - (float)uILabel.height + -12f); - } - SkillInfoList.Add(nguiObjs); - } - - public void RemoveKeyWord(int index) - { - bool activeSelf = SkillInfoList[index].labels[0].gameObject.activeSelf; - UnityEngine.Object.Destroy(SkillInfoList[index].gameObject); - if (SkillInfoList.Count > index + 1) - { - if (!SkillInfoList[index + 1].labels[0].gameObject.activeSelf) - { - Vector3 localPosition = SkillInfoList[index + 1].labels[1].transform.localPosition; - if (activeSelf) - { - SkillInfoList[index + 1].labels[0].gameObject.SetActive(value: true); - } - SkillInfoList[index + 1].labels[1].transform.localPosition = new Vector3(localPosition.x, SkillInfoList[index + 1].labels[0].transform.localPosition.y - (float)SkillInfoList[index + 1].labels[0].height); - SkillInfoList[index + 1].objs[0].transform.localPosition = new Vector3(SkillInfoList[index + 1].objs[0].transform.localPosition.x, -72 - SkillInfoList[index + 1].labels[1].height + -12); - } - } - else if (index - 1 > 0) - { - bool flag = false; - bool flag2 = false; - if (SkillInfoList[index - 1].labels[0].gameObject.activeSelf) - { - flag = true; - if (index + 1 < SkillInfoList.Count && !SkillInfoList[index + 1].labels[0].gameObject.activeSelf) - { - flag2 = true; - } - } - if (flag && !flag2) - { - SkillInfoList[index - 1].objs[0].SetActive(value: true); - } - } - SkillInfoList.RemoveAt(index); - if (SkillInfoList.Count != 0) - { - SkillInfoList[0].objs[1].SetActive(value: false); - } - if (base.gameObject.activeInHierarchy) - { - StartCoroutine(RepositionTable()); - } - } - - public void AddKeywordInfo(BattleCardBase card, string keyword, string desc, Color32 keywordColor) - { - NguiObjs nguiObjs = UnityEngine.Object.Instantiate(SkillInfo); - nguiObjs.transform.parent = _table.transform; - nguiObjs.labels[0].text = keyword; - nguiObjs.labels[0].color = keywordColor; - nguiObjs.labels[1].SetWrapText(desc); - nguiObjs.transform.localScale = new Vector3(1f, 1f, 1f); - nguiObjs.gameObject.name = SkillInfoList.Count.ToString(); - nguiObjs.gameObject.SetActive(value: true); - UIRect[] componentsInChildren = nguiObjs.gameObject.GetComponentsInChildren(); - for (int i = 0; i < componentsInChildren.Length; i++) - { - componentsInChildren[i].ResetAndUpdateAnchors(); - } - SkillInfoList.Add(nguiObjs); - } - - public void SetScrollView(DialogBase dia) - { - UIPanel component = ScrollView.GetComponent(); - GameObject gameObject = dia.WindowSprite.gameObject; - GameObject gameObject2 = dia.titleLine.gameObject; - component.topAnchor.target = gameObject2.transform; - component.topAnchor.relative = 0f; - component.topAnchor.absolute = -10; - component.bottomAnchor.target = gameObject.transform; - component.bottomAnchor.relative = 0f; - component.bottomAnchor.absolute = 25; - component.leftAnchor.target = gameObject.transform; - component.leftAnchor.relative = 0f; - component.leftAnchor.absolute = 25; - component.rightAnchor.target = gameObject.transform; - component.rightAnchor.relative = 1f; - component.rightAnchor.absolute = -25; - gameObject.GetComponent().scrollView = ScrollView; - component.UpdateAnchors(); - } - - private bool GetKeywordData(string skill, CardMaster.CardMasterId cardMasterId, out string keywordTitle, out string skillinfo) - { - keywordTitle = string.Empty; - skillinfo = string.Empty; - if (Data.Master.BattleKeyWordDic.ContainsKey(skill)) - { - string skillToLower = skill.ToLower(); - KeyValuePair keyValuePair = Data.Master.BattleKeyWordDic.First((KeyValuePair data) => data.Key.ToLower() == skillToLower); - keywordTitle = keyValuePair.Key; - skillinfo = keyValuePair.Value; - List cardIdsInDesc = GetCardIdsInDesc(skillinfo); - if (cardIdsInDesc.Count > 0) - { - skillinfo = string.Empty; - for (int num = 0; num < cardIdsInDesc.Count; num++) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId(cardIdsInDesc[num]); - if (num > 0) - { - skillinfo += "\n"; - skillinfo += Data.SystemText.Get("Card_0198_BattleKeyWord_01", cardParameterFromId.CardName); - skillinfo += "\n"; - } - skillinfo += GetCardDescText(cardParameterFromId); - } - } - skillinfo = skillinfo.Trim(); - return true; - } - return false; - } - - public static string GetCardDescText(CardParameter param) - { - string empty = string.Empty; - string clanNameByKey = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)param.Clan); - string cardTypeName = CardBasePrm.GetCardTypeName(param.CharType); - empty = ((!(param.TribeName == "ALL")) ? (Data.SystemText.Get("Card_0200_BattleKeyWord_03", param.Cost.ToString(), clanNameByKey, param.TribeName, cardTypeName) + "\n") : (Data.SystemText.Get("Card_0199_BattleKeyWord_02", param.Cost.ToString(), clanNameByKey, cardTypeName) + "\n")); - if (param.CharType == CardBasePrm.CharaType.NORMAL || param.CharType == CardBasePrm.CharaType.EVOLUTION) - { - if (!param.IsEvolveChoiceCard) - { - empty = empty + Data.SystemText.Get("Card_0201_BattleKeyWord_04", param.Atk.ToString(), param.Life.ToString()) + "\n"; - if (param.ConvertedSkillDescription != string.Empty) - { - empty = empty + ConvertKeywordsInText(param.ConvertedSkillDescription) + "\n"; - } - } - empty = empty + Data.SystemText.Get("Card_0202_BattleKeyWord_05") + "\n"; - empty = empty + Data.SystemText.Get("Card_0201_BattleKeyWord_04", param.EvoAtk.ToString(), param.EvoLife.ToString()) + "\n"; - if (param.ConvertedEvoSkillDescription != string.Empty) - { - empty = empty + ConvertKeywordsInText(param.ConvertedEvoSkillDescription) + "\n"; - } - } - else - { - empty = empty + ConvertKeywordsInText(param.ConvertedSkillDescription) + "\n"; - } - return empty; - } - - private static string ConvertKeywordsInText(string skilldisc) - { - List list = new List(); - List list2 = new List(); - for (int i = 0; i < KEYWORD_PATTERNS.Length; i++) - { - foreach (Match item2 in Regex.Matches(skilldisc, KEYWORD_PATTERNS[i])) - { - string item = Regex.Escape(item2.Value); - if (list.Contains(item)) - { - continue; - } - string value = item2.Groups["KEYWORD"].Value; - if (Data.Master.BattleKeyWordDic.ContainsKey(value)) - { - List cardIdsInDesc = GetCardIdsInDesc(Data.Master.BattleKeyWordDic[value]); - list.Add(item); - if (cardIdsInDesc.Count > 0) - { - list2.Add(Data.SystemText.Get("Card_0203_BattleKeyWord_06", value)); - } - else - { - list2.Add(value); - } - } - } - } - for (int j = 0; j < list.Count; j++) - { - skilldisc = Regex.Replace(skilldisc, list[j], list2[j]); - } - return Global.ConvertToWithoutBBCode(skilldisc); - } - public static List GetCardIdsInDesc(string desc) { string text = "KEYWORD"; @@ -386,36 +54,6 @@ public class BattleKeywordInfoListMgr : MonoBehaviour return list; } - public List GetKeyWordNameList() - { - List list = new List(SkillInfoList.Count); - for (int i = 0; i < SkillInfoList.Count; i++) - { - list.Add(SkillInfoList[i].labels[0].text); - } - return list; - } - - public IList GetSkillInfoList() - { - return SkillInfoList; - } - - public float GetScrollViewSizeY() - { - return ScrollView.GetComponent().GetViewSize().y; - } - - public void SetResetTableFinishAction(Action inAction) - { - ResetTableFinishAction = inAction; - } - - public void SetKeyWordFocus(float inScrollBarValue) - { - ScrollView.verticalScrollBar.value = inScrollBarValue; - } - public void SetPanelDepth(int depth) { _panel.depth = depth; diff --git a/SVSim.BattleEngine/Engine/BattleLifeTimeSharedObject.cs b/SVSim.BattleEngine/Engine/BattleLifeTimeSharedObject.cs index 68877ee2..2bd9ef1e 100644 --- a/SVSim.BattleEngine/Engine/BattleLifeTimeSharedObject.cs +++ b/SVSim.BattleEngine/Engine/BattleLifeTimeSharedObject.cs @@ -9,11 +9,6 @@ public class BattleLifeTimeSharedObject _skillBuildInfoSharedObject = new Dictionary(); } - ~BattleLifeTimeSharedObject() - { - _skillBuildInfoSharedObject.Clear(); - } - public void SetSkillBuildInfo(string key, SkillCreator.SkillBuildInfo value) { if (!_skillBuildInfoSharedObject.ContainsKey(key)) diff --git a/SVSim.BattleEngine/Engine/BattleLogTextBuilderAttachSkill.cs b/SVSim.BattleEngine/Engine/BattleLogTextBuilderAttachSkill.cs deleted file mode 100644 index 30e13967..00000000 --- a/SVSim.BattleEngine/Engine/BattleLogTextBuilderAttachSkill.cs +++ /dev/null @@ -1,851 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using Wizard; - -public abstract class BattleLogTextBuilderAttachSkill -{ - private static readonly string COST_MAX = "cost.max"; - - private const string OP_INPLAY_UNIT_COUNT = "op.inplay.unit.count"; - - private const string ME_INPLAY = "me.inplay"; - - private const string ME_HAND = "me.hand"; - - private const string ME_INPLAY_UNIT = "me.inplay.unit"; - - private const string ME_INPLAY_CLASS_EP = "me.inplay.class.ep"; - - private const string ME_HAND_COUNT = "me.hand.count"; - - private const string PLAYED_CARD = "played_card"; - - private const string ME_INPLAY_SELF = "me.inplay_self.count"; - - private const string ME_INPLAY_CLASS_PP = "me.inplay.class.pp"; - - private const string ME_TURN_COUNT = "{me.inplay.class.turn}"; - - private const string ME_DECK_NOT_DUPLICATION = "me.deck.unique_base_card_id_card"; - - public abstract string BuildTextAttachSkill(SkillBase attachedSkill, bool isBuffText, bool isNow); - - public static string _GetSpecificCardCostInformation(SkillBase skill, bool isTarget) - { - if (isTarget) - { - if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterCostFilter)) - { - SkillParameterCostFilter skillParameterCostFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillParameterCostFilter) as SkillParameterCostFilter; - if (skillParameterCostFilter.GetParameterText().Contains(COST_MAX)) - { - return Data.SystemText.Get("BattleLog_0165"); - } - if (skillParameterCostFilter.GetParameterOptionText() == ">=") - { - return Data.SystemText.Get("BattleLog_0182", skillParameterCostFilter.GetParameterText()); - } - if (skillParameterCostFilter.GetParameterOptionText() == "<=") - { - return Data.SystemText.Get("BattleLog_0230", skillParameterCostFilter.GetParameterText()); - } - } - if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterBaseCostFilter)) - { - SkillParameterBaseCostFilter skillParameterBaseCostFilter = skill.ApplyCardFilterList.FirstOrDefault((ISkillCardFilter f) => f is SkillParameterBaseCostFilter) as SkillParameterBaseCostFilter; - if (skillParameterBaseCostFilter.GetParameterOptionText() == "<=") - { - return Data.SystemText.Get("BattleLog_0164", skillParameterBaseCostFilter.GetParameterText()); - } - } - } - else if (skill.ConditionFilterCollection.VariableCompareFilter.Count > 0) - { - string text = skill.ConditionFilterCollection.VariableCompareFilter.First().Lhs.Trim('{', '}'); - VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection(); - SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text, skill.SkillPrm.ownerCard, skill); - if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillParameterBaseCostFilter)) - { - SkillParameterBaseCostFilter skillParameterBaseCostFilter2 = variableSkillFilterCollection.CardFilterList.First((ISkillCardFilter f) => f is SkillParameterBaseCostFilter) as SkillParameterBaseCostFilter; - if (skillParameterBaseCostFilter2.GetParameterOptionText() == "<=") - { - return Data.SystemText.Get("BattleLog_0164", skillParameterBaseCostFilter2.GetParameterText()); - } - if (skillParameterBaseCostFilter2.GetParameterOptionText() == "=") - { - return Data.SystemText.Get("BattleLog_0194", skillParameterBaseCostFilter2.GetParameterText()); - } - } - } - return ""; - } - - public static string _GetCardTypeByFilterList(List filters) - { - if (filters.Any((ISkillCardFilter f) => f is SkillUnitFilter)) - { - return Data.SystemText.Get("BattleLog_0172"); - } - if (filters.Any((ISkillCardFilter f) => f is SkillSpellFilter)) - { - return Data.SystemText.Get("BattleLog_0173"); - } - if (filters.Any((ISkillCardFilter f) => f is SkillChantFieldFilter)) - { - return Data.SystemText.Get("BattleLog_0176"); - } - if (filters.Any((ISkillCardFilter f) => f is SkillFieldFilter)) - { - return Data.SystemText.Get("BattleLog_0175"); - } - if (filters.Any((ISkillCardFilter f) => f is SkillSpellAndFieldFilter)) - { - return Data.SystemText.Get("BattleLog_0183"); - } - return string.Empty; - } - - public static string _GetSpecificCardType(SkillBase skill, bool isTarget) - { - if (isTarget) - { - string text = _GetCardTypeByFilterList(skill.ApplyCardFilterList); - if (text != string.Empty) - { - return text; - } - } - else - { - if (skill.ConditionCardFilterList.Count > 0) - { - string text = _GetCardTypeByFilterList(skill.ConditionCardFilterList); - if (text != string.Empty) - { - return text; - } - } - if (skill.ConditionFilterCollection.VariableCompareFilter.Count > 0) - { - string text2 = skill.ConditionFilterCollection.VariableCompareFilter.First().Lhs.Trim('{', '}'); - VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection(); - SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text2, skill.SkillPrm.ownerCard, skill); - if (variableSkillFilterCollection.CardFilterList.Count > 0) - { - string text = _GetCardTypeByFilterList(variableSkillFilterCollection.CardFilterList); - if (text != string.Empty) - { - return text; - } - } - } - } - return Data.SystemText.Get("BattleLog_0174"); - } - - public static string _GetSpecificCardTribeClan(SkillBase skill, bool isTarget) - { - if (isTarget) - { - if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillClanFilter)) - { - SkillClanFilter skillClanFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillClanFilter) as SkillClanFilter; - string clanNameByKey = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)skillClanFilter._clan); - string text = ((skillClanFilter.OptionText == SkillFilterCreator.NOTEQUAL) ? Data.SystemText.Get("BattleLog_0238") : ""); - return Data.SystemText.Get("BattleLog_0234", clanNameByKey, text); - } - if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter)) - { - return DataMgr.GetTribeNameByKey((int)(skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillTribeFilter) as SkillTribeFilter)._type); - } - } - else - { - if (skill.ConditionCardFilterList.Any((ISkillCardFilter f) => f is SkillClanFilter)) - { - SkillClanFilter skillClanFilter2 = skill.ConditionCardFilterList.First((ISkillCardFilter f) => f is SkillClanFilter) as SkillClanFilter; - return GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)skillClanFilter2._clan); - } - if (skill.ConditionCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter)) - { - return DataMgr.GetTribeNameByKey((int)(skill.ConditionCardFilterList.First((ISkillCardFilter f) => f is SkillTribeFilter) as SkillTribeFilter)._type); - } - if (skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains(SkillFilterCreator.ContentKeyword.tribe.ToString()))) - { - string text2 = skill.ConditionFilterCollection.VariableCompareFilter.FirstOrDefault((SkillVariableComareFilter f) => f.Lhs.Contains(SkillFilterCreator.ContentKeyword.tribe.ToString())).Lhs.Trim('{', '}'); - VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection(); - SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text2, skill.SkillPrm.ownerCard, skill); - ISkillCardFilter skillCardFilter = variableSkillFilterCollection.CardFilterList.FirstOrDefault((ISkillCardFilter f) => f is SkillTribeFilter); - if (skillCardFilter != null) - { - return DataMgr.GetTribeNameByKey((int)(skillCardFilter as SkillTribeFilter)._type); - } - } - } - return ""; - } - - public static string _GetSpecificCardException(SkillBase skill) - { - if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterIdFilter)) - { - SkillParameterIdFilter skillParameterIdFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillParameterIdFilter) as SkillParameterIdFilter; - if (skillParameterIdFilter.GetOptionText() == "!=") - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(int.Parse(skillParameterIdFilter.GetFilterId().First())); - return Data.SystemText.Get("BattleLog_0166", cardParameterFromId.CardName); - } - } - return ""; - } - - public static string _GetSpecificCardTargetCount(SkillBase skill, bool isTarget) - { - if (!isTarget) - { - return ""; - } - if (skill.ApplySelectFilter is SkillRandomSelectFilter) - { - SkillRandomSelectFilter skillRandomSelectFilter = skill.ApplySelectFilter as SkillRandomSelectFilter; - if (!skillRandomSelectFilter.IsContainVariableValue()) - { - int num = int.Parse(skillRandomSelectFilter.Context); - if (num >= 1) - { - return Data.SystemText.Get("BattleLog_0163", num.ToString()); - } - } - return ""; - } - if (skill.ApplySelectFilter is SkillUserSelectFilter) - { - SkillUserSelectFilter skillUserSelectFilter = skill.ApplySelectFilter as SkillUserSelectFilter; - return Data.SystemText.Get("BattleLog_0163", skillUserSelectFilter.CalcCount(skill.OptionValue).ToString()); - } - if (skill.ApplyingTargetFilter is SkillTargetLastTargetFilter) - { - int num2 = skill.SkillPrm.selfBattlePlayer.SkillInfoLastTargets.Count(); - return Data.SystemText.Get("BattleLog_0163", num2.ToString()); - } - if (skill.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter) - { - int num3 = skill.GetDrewCardInHand().Count(); - return Data.SystemText.Get("BattleLog_0163", num3.ToString()); - } - if (skill.ConditionTargetFilter is SkillTargetPlayedCardFilter) - { - return ""; - } - return Data.SystemText.Get("BattleLog_0171"); - } - - public static string _GetSpecificCard(SkillBase skill, bool isBuffText, bool isTarget) - { - string text = _GetSpecificCardCostInformation(skill, isTarget); - string text2 = _GetSpecificCardTribeClan(skill, isTarget); - string text3 = _GetSpecificCardType(skill, isTarget); - if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterIdFilter)) - { - SkillParameterIdFilter skillParameterIdFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillParameterIdFilter) as SkillParameterIdFilter; - if (skillParameterIdFilter.GetOptionText() == SkillFilterCreator.EQUAL) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(int.Parse(skillParameterIdFilter.GetFilterId().First())); - text2 = ""; - text3 = cardParameterFromId.CardName; - } - } - string text4 = _GetSpecificCardException(skill); - string text5 = _GetSpecificCardTargetCount(skill, isTarget); - if (isBuffText) - { - string text6 = string.Empty; - if ((isTarget && skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter)) || (!isTarget && (skill.ConditionCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter) || skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains(SkillFilterCreator.ContentKeyword.tribe.ToString()))))) - { - text6 = Data.SystemText.Get("BattleLog_0252"); - } - return Data.SystemText.Get("BattleLog_0156", text, text2, text3, text4, text5, text6); - } - string text7 = Data.SystemText.Get("BattleLog_0225"); - if (text == string.Empty && text2 == string.Empty && text3 == Data.SystemText.Get("BattleLog_0174") && text4 == string.Empty) - { - text7 = string.Empty; - } - return Data.SystemText.Get("BattleLog_0161", text5, text7); - } - - public static string _GetSkillTarget(SkillBase skill, bool isBuffText) - { - if (skill.ApplyFilterCollection.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.BattlePlayerFilter is OpponentBattlePlayerFilter && f.CardFilterList.Any((ISkillCardFilter c) => c is SkillUnitFilter)) && skill.ApplyFilterCollection.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.BattlePlayerFilter is SelfBattlePlayerFilter && f.CardFilterList.Any((ISkillCardFilter c) => c is SkillClassFilter))) - { - return Data.SystemText.Get("BattleLog_0147"); - } - if (skill.ApplyingTargetFilter is SkillTargetBeAttackedFilter) - { - return Data.SystemText.Get("BattleLog_0063"); - } - if (skill.ApplyingTargetFilter is SkillTargetAttackerFilter) - { - return Data.SystemText.Get("BattleLog_0101"); - } - if (skill.ApplyingTargetFilter is SkillTargetFightTargetFilter) - { - return Data.SystemText.Get("BattleLog_0103"); - } - if (skill.ApplyingTargetFilter is SkillTargetSelfFilter) - { - return Data.SystemText.Get("BattleLog_0064"); - } - if (skill.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter) - { - if (isBuffText) - { - return Data.SystemText.Get("BattleLog_0118"); - } - return Data.SystemText.Get("BattleLog_0065"); - } - if (skill.ApplyingTargetFilter is SkillTargetHandOtherSelfFilter || skill.ApplyingTargetFilter is SkillTargetHandFilter) - { - return Data.SystemText.Get("BattleLog_0082", _GetSpecificCard(skill, isBuffText, isTarget: true)); - } - if (skill.ApplyingTargetFilter is SkillTargetDeckFilter) - { - return Data.SystemText.Get("BattleLog_0083", _GetSpecificCard(skill, isBuffText, isTarget: true)); - } - if (skill.ApplyingTargetFilter is SkillTargetSummonedCardFilter) - { - return Data.SystemText.Get("BattleLog_0093"); - } - if (skill.ApplyingTargetFilter is SkillTargetPlayedCardFilter) - { - return Data.SystemText.Get("BattleLog_0118"); - } - if (skill.ApplyingTargetFilter is SkillTargetInPlayFilter) - { - int num = 0; - for (int count = skill.ApplyCardFilterList.Count; num < count; num++) - { - if (skill.ApplyCardFilterList[num] is SkillClassFilter) - { - if (skill.ApplyBattlePlayerFilter is SelfBattlePlayerFilter) - { - return Data.SystemText.Get("BattleLog_0115"); - } - if (skill.ApplyBattlePlayerFilter is OpponentBattlePlayerFilter) - { - return Data.SystemText.Get("BattleLog_0004"); - } - } - else if (skill.ApplyCardFilterList[num] is SkillUnitAndClassFilter) - { - if (skill.ApplySelectFilter != null) - { - if (!(skill.ApplySelectFilter is SkillSelectAllFilter) && !(skill.ApplySelectFilter is SkillSelectNullFilter)) - { - return Data.SystemText.Get("BattleLog_0120"); - } - if (skill.ApplyBattlePlayerFilter is OpponentBattlePlayerFilter) - { - return Data.SystemText.Get("BattleLog_0112"); - } - if (skill.ApplyBattlePlayerFilter is SelfBattlePlayerFilter) - { - return Data.SystemText.Get("BattleLog_0190"); - } - } - else - { - Debug.LogError("ApplySelectFilter is not allowed null!"); - } - } - else - { - if (!(skill.ApplyCardFilterList[num] is SkillUnitFilter)) - { - continue; - } - if (skill.ApplySelectFilter != null) - { - string text = _ConvertSkillConditionCharacter((skill.ApplyBattlePlayerFilter is OpponentBattlePlayerFilter) ? SkillFilterCreator.ContentKeyword.op.ToStringCustom() : SkillFilterCreator.ContentKeyword.me.ToStringCustom()); - if (!(skill.ApplySelectFilter is SkillSelectAllFilter) && !(skill.ApplySelectFilter is SkillSelectNullFilter)) - { - string text2 = _GetSkillTargetCount(skill); - int result = -1; - int.TryParse(text2, out result); - return Data.SystemText.Get("BattleLog_0133", text2, text); - } - return Data.SystemText.Get("BattleLog_0124", text); - } - Debug.LogError("ApplySelectFilter is not allowed null!"); - } - } - return ""; - } - if (skill.ApplyingTargetFilter is SkillTargetInPlayOtherSelfFilter) - { - if (skill.ApplySelectFilter is SkillRandomSelectFilter) - { - return Data.SystemText.Get("BattleLog_0146"); - } - return Data.SystemText.Get("BattleLog_0121"); - } - if (skill.ApplyingTargetFilter is SkillTargetLastTargetFilter) - { - return Data.SystemText.Get("BattleLog_0118"); - } - if (skill.ApplyingTargetFilter is SkillTargetInplaySelfAndClassFilter) - { - return Data.SystemText.Get("BattleLog_0214"); - } - if (!(skill.ApplyingTargetFilter is SkillTargetTokenDrawCardFilter)) - { - _ = skill.ApplyingTargetFilter is SkillTargetReturnCardFilter; - } - return ""; - } - - public static string _GetSkillPeriod(SkillBase skill, bool isNow) - { - if (skill.PreprocessList.FirstOrDefault((SkillPreprocessBase pre) => pre is SkillPreprocessInPlayPeriodOfTime) is SkillPreprocessInPlayPeriodOfTime) - { - if (isNow) - { - return Data.SystemText.Get("BattleLog_0091"); - } - return Data.SystemText.Get("BattleLog_0159"); - } - if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillPreprocessTurnStartStop && (a as SkillPreprocessTurnStartStop).Target == "op")) - { - return Data.SystemText.Get("BattleLog_0189"); - } - if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillConditionTurn && (a as SkillConditionTurn).judgeFlg)) - { - return Data.SystemText.Get("BattleLog_0126"); - } - if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillPreprocessTurnEndStop)) - { - return Data.SystemText.Get("BattleLog_0215"); - } - return ""; - } - - protected static string _GetSkillTiming(SkillBase skill, bool isBuffText) - { - if (skill.IsWhenPlaySkill) - { - return ""; - } - if (skill.IsWhenDestroySkill) - { - return Data.SystemText.Get("BattleLog_0066"); - } - if (skill.IsBeforAttackSkill || skill.IsBeforeAttackSelfAndOtherSkill) - { - if (skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionAttackerIsOther)) - { - return Data.SystemText.Get("BattleLog_0192"); - } - return Data.SystemText.Get("BattleLog_0067"); - } - if (skill.OnAfterAttackStart != 0) - { - return Data.SystemText.Get("BattleLog_0254"); - } - if (skill.IsWhenFightSkill) - { - return Data.SystemText.Get("BattleLog_0102"); - } - if (skill.OnSelfTurnStartStart != 0) - { - return Data.SystemText.Get("BattleLog_0068"); - } - if (skill.OnSelfTurnEndStart != 0) - { - return Data.SystemText.Get("BattleLog_0069"); - } - if (skill.OnWhenSummonOtherStart != 0) - { - if (skill.ApplyBattlePlayerFilter is SelfBattlePlayerFilter) - { - return Data.SystemText.Get("BattleLog_0092", _GetSpecificCard(skill, isBuffText, isTarget: false)); - } - return ""; - } - if (skill.OnWhenPlayOtherStart != 0) - { - if (skill.ConditionTargetFilter is SkillTargetPlayedCardFilter && skill.ConditionCardFilterList.Any((ISkillCardFilter c) => c is SkillSpellFilter)) - { - return Data.SystemText.Get("BattleLog_0108"); - } - return Data.SystemText.Get("BattleLog_0117", _GetSpecificCard(skill, isBuffText, isTarget: false)); - } - if (skill.OnWhenDamageStart != 0) - { - return Data.SystemText.Get("BattleLog_0127"); - } - if (skill.OnWhenDestroyOtherStart != 0) - { - return Data.SystemText.Get("BattleLog_0257", _GetSpecificCard(skill, isBuffText, isTarget: false)); - } - if (skill.OnWhenDamageStart != 0 && skill.ConditionCheckerList.Any((ISkillConditionChecker c) => c is SkillConditionTurn)) - { - return ""; - } - if (skill.OnWhenDrawOtherStart != 0) - { - return ""; - } - if (skill.OnWhenPpHealStart != 0) - { - return ""; - } - if (skill.OnOpponentTurnEndStart != 0) - { - return ""; - } - if (skill.OnWhenReturnOtherStart != 0) - { - return Data.SystemText.Get("BattleLog_0264"); - } - return ""; - } - - protected static string _GetSkillTargetCount(SkillBase skill) - { - if (skill.ApplySelectFilter != null) - { - return skill.ApplySelectFilter.CalcCount(skill.OptionValue).ToString(); - } - return ""; - } - - protected static string _GetSkillPreProcessText(SkillBase skill) - { - SkillPreprocessBase skillPreprocessBase = skill.PreprocessList.FirstOrDefault((SkillPreprocessBase s) => s is SkillPreprocessUsePp); - if (skillPreprocessBase != null) - { - int consumeValue = (skillPreprocessBase as SkillPreprocessUsePp).ConsumeValue; - return Data.SystemText.Get("BattleLog_0236", consumeValue.ToString()); - } - return string.Empty; - } - - protected static string _GetSkillOptionSetCost(SkillBase skill) - { - int num = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.set, int.MinValue); - int num2 = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add, int.MinValue); - if (num != int.MinValue) - { - return num.ToString(); - } - if (num2 != int.MinValue) - { - return num2.ToString(); - } - return ""; - } - - protected static string _GetSkillDetailCondition(SkillBase skill) - { - if (skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionResonance) && (skill.ConditionCheckerList.First((ISkillConditionChecker f) => f is SkillConditionResonance) as SkillConditionResonance).judgeFlg) - { - return Data.SystemText.Get("BattleLog_0169"); - } - List variableCompareFilter = skill.ConditionFilterCollection.VariableCompareFilter; - if (variableCompareFilter.Count > 0) - { - SkillVariableComareFilter skillVariableComareFilter = variableCompareFilter.First(); - string compare = skillVariableComareFilter.Compare; - string text = skillVariableComareFilter.Lhs.Trim('{', '}'); - VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection(); - SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text, skill.SkillPrm.ownerCard, skill); - if (text.Contains("me.deck.unique_base_card_id_card")) - { - if (compare == "=") - { - return Data.SystemText.Get("BattleLog_0260"); - } - return Data.SystemText.Get("BattleLog_0259"); - } - if (text.Contains("op.inplay.unit.count")) - { - string rhs = skillVariableComareFilter.Rhs; - if (compare == ">" && rhs == "0") - { - return Data.SystemText.Get("BattleLog_0158"); - } - if (compare == "=" && rhs == "0") - { - return Data.SystemText.Get("BattleLog_0181"); - } - } - else if (variableSkillFilterCollection.CardCountFilter != null && variableSkillFilterCollection.BattlePlayerFilter is SelfBattlePlayerFilter) - { - string rhs2 = skillVariableComareFilter.Rhs; - if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillParameterIdFilter)) - { - SkillParameterIdFilter skillParameterIdFilter = variableSkillFilterCollection.CardFilterList.FirstOrDefault((ISkillCardFilter f) => f is SkillParameterIdFilter) as SkillParameterIdFilter; - string cardName = CardMaster.GetInstanceForBattle().GetCardParameterFromId(int.Parse(skillParameterIdFilter.GetFilterId().First())).CardName; - if (variableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains("me.inplay") && f.Rhs == "0") && variableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains("me.hand") && f.Rhs == "0")) - { - return Data.SystemText.Get("BattleLog_0193", cardName, Data.SystemText.Get("BattleLog_0177")); - } - if (compare == "=" && rhs2 == "0") - { - string text2 = Data.SystemText.Get("BattleLog_0205"); - if (variableSkillFilterCollection.TargetFilter is SkillTargetHandFilter) - { - text2 = Data.SystemText.Get("BattleLog_0206"); - } - return Data.SystemText.Get("BattleLog_0193", cardName, text2); - } - } - if (compare == ">" && rhs2 == "0") - { - if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillFieldFilter)) - { - return Data.SystemText.Get("BattleLog_0149"); - } - if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillUnitFilter)) - { - return Data.SystemText.Get("BattleLog_0148"); - } - } - } - else if (variableSkillFilterCollection.ParameterSelectFilter is SkillParameterTurnDamageValueFilter) - { - int num = int.Parse(skillVariableComareFilter.Rhs.ToString()); - if (compare == ">=") - { - return Data.SystemText.Get("BattleLog_0197", num.ToString()); - } - if (compare == "<") - { - return Data.SystemText.Get("BattleLog_0198", (num - 1).ToString()); - } - } - if (text.Contains("me.hand.count")) - { - string rhs3 = skillVariableComareFilter.Rhs; - switch (compare) - { - case "<=": - return Data.SystemText.Get("BattleLog_0187", rhs3); - case "<": - { - int num3 = int.Parse(rhs3) - 1; - return Data.SystemText.Get("BattleLog_0187", num3.ToString()); - } - case ">=": - return Data.SystemText.Get("BattleLog_0188", rhs3); - case ">": - { - int num2 = int.Parse(rhs3) + 1; - return Data.SystemText.Get("BattleLog_0188", num2.ToString()); - } - } - } - if (text.Contains("me.inplay.class.ep")) - { - return Data.SystemText.Get("BattleLog_0177"); - } - if (variableSkillFilterCollection.BattlePlayerFilter != null && variableSkillFilterCollection.TargetFilter is SkillTargetInPlayFilter && variableSkillFilterCollection.CardFilterList.Count > 0 && variableSkillFilterCollection.CardCountFilter != null) - { - string[] array = text.Split('.'); - string text3 = _ConvertSkillConditionCharacter(array[0]); - string text4 = _ConvertSkillConditionTarget(array[1]); - string text5 = _ConvertSkillConditionCardType(array[2]); - string rhs4 = skillVariableComareFilter.Rhs; - switch (compare) - { - case "=": - return Data.SystemText.Get("BattleLog_0200", text3, text4, text5, rhs4); - case ">=": - return Data.SystemText.Get("BattleLog_0209", text3, text4, text5, rhs4); - case "<=": - return Data.SystemText.Get("BattleLog_0210", text3, text4, text5, rhs4); - } - } - if (text.Contains("me.inplay.class.pp")) - { - string rhs5 = skillVariableComareFilter.Rhs; - if (compare != null && compare == ">=") - { - return Data.SystemText.Get("BattleLog_0235", rhs5); - } - } - if (text.Contains(SkillFilterCreator.ContentKeyword.turn_play_cards.ToString())) - { - return Data.SystemText.Get("BattleLog_0191", skillVariableComareFilter.Rhs, _GetSpecificCard(skill, isBuffText: true, isTarget: false)); - } - } - if (skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionTurn) && (skill.ConditionCheckerList.First((ISkillConditionChecker f) => f is SkillConditionTurn) as SkillConditionTurn).judgeFlg) - { - return Data.SystemText.Get("BattleLog_0126"); - } - if (skill.ConditionCheckerList.Any((ISkillConditionChecker s) => s is SkillConditionPlayCount)) - { - SkillConditionPlayCount skillConditionPlayCount = (SkillConditionPlayCount)skill.ConditionCheckerList.First((ISkillConditionChecker s) => s is SkillConditionPlayCount); - return Data.SystemText.Get("BattleLog_0191", skillConditionPlayCount.GetCount().ToString(), _GetSpecificCard(skill, isBuffText: true, isTarget: false)); - } - if (skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessTimesPerTurn && (p as SkillPreprocessTimesPerTurn).GetLimitCount() == 1)) - { - return Data.SystemText.Get("BattleLog_0196"); - } - return ""; - } - - protected static string _CombineSkillCondition(SkillBase skill, string condition) - { - if (skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDestroyTribe && (p as SkillPreprocessDestroyTribe).IsWhiteRitual)) - { - return Data.SystemText.Get("BattleLog_0178", condition); - } - SkillVariableComareFilter skillVariableComareFilter = skill.ConditionFilterCollection.VariableCompareFilter.FirstOrDefault((SkillVariableComareFilter f) => f.Lhs == "{me.inplay.class.turn}"); - if (skillVariableComareFilter != null) - { - int num = int.Parse(skillVariableComareFilter.Rhs); - return Data.SystemText.Get("BattleLog_0150", num.ToString(), condition); - } - return condition; - } - - protected static string _GetSkillCondition(SkillBase skill, bool isBuffText) - { - if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillConditionTurn && (a as SkillConditionTurn).judgeFlg)) - { - return ""; - } - if (skill.ConditionCardFilterList.Any((ISkillCardFilter s) => s is SkillAllCardFilter || s is SkillUnitFilter || s is SkillClassFilter || s is SkillFieldFilter || s is SkillChantFieldFilter || s is SkillNotChantFieldFilter || s is SkillSpellFilter || s is SkillUnitAndClassFilter || s is SkillUnitAndAllFieldFilter || s is SkillSpellAndFieldFilter) && !skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => !f.Lhs.Contains("played_card") && !f.Lhs.Contains("me.inplay_self.count")) && !skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessTimesPerTurn && (p as SkillPreprocessTimesPerTurn).GetLimitCount() == 1) && !skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionResonance || f is SkillConditionHalfLife || f is SkillConditionTurn || f is SkillPreprocessDestroyTribe || f is SkillConditionPlayCount)) - { - return ""; - } - if (isBuffText) - { - return _CombineSkillCondition(skill, _GetSkillDetailCondition(skill)); - } - return Data.SystemText.Get("BattleLog_0113"); - } - - public static string _ConvertSkillConditionCharacter(string character) - { - if (!SkillFilterCreator.PLAYER_FILTER_NAMES.Contains(character)) - { - return ""; - } - return SkillFilterCreator.Str2ContentKeyword(character) switch - { - SkillFilterCreator.ContentKeyword.me => Data.SystemText.Get("BattleLog_0218"), - SkillFilterCreator.ContentKeyword.op => Data.SystemText.Get("BattleLog_0219"), - SkillFilterCreator.ContentKeyword.both => Data.SystemText.Get("BattleLog_0208"), - _ => "", - }; - } - - protected static string _ConvertSkillConditionTarget(string target) - { - if (!SkillFilterCreator.PLAYER_TARGET_FILTER_NAMES.Contains(target)) - { - return ""; - } - return SkillFilterCreator.Str2ContentKeyword(target) switch - { - SkillFilterCreator.ContentKeyword.inplay => Data.SystemText.Get("BattleLog_0205"), - SkillFilterCreator.ContentKeyword.hand => Data.SystemText.Get("BattleLog_0206"), - SkillFilterCreator.ContentKeyword.deck => Data.SystemText.Get("BattleLog_0207"), - _ => "", - }; - } - - protected static string _ConvertSkillConditionCardType(string cardType) - { - if (!SkillFilterCreator.CARD_TYPE_FILTER_NAMES.Contains(cardType)) - { - return ""; - } - return SkillFilterCreator.Str2ContentKeyword(cardType) switch - { - SkillFilterCreator.ContentKeyword.unit => Data.SystemText.Get("BattleLog_0172"), - SkillFilterCreator.ContentKeyword.spell => Data.SystemText.Get("BattleLog_0173"), - SkillFilterCreator.ContentKeyword.field => Data.SystemText.Get("BattleLog_0175"), - SkillFilterCreator.ContentKeyword.chant_field => Data.SystemText.Get("BattleLog_0176"), - _ => "", - }; - } - - protected static string _GetSkillOptionDamage(SkillBase skill) - { - return Mathf.Max(0, skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.damage, 0)).ToString(); - } - - protected static string _GetSkillOptionAddDamage(SkillBase skill) - { - int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_damage, 0); - return Mathf.Max(0, b).ToString(); - } - - protected static string _GetSkillOptionDamageCut(SkillBase skill) - { - int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.cut_amount, 0); - return Mathf.Max(0, b).ToString(); - } - - protected static int _GetSkillOptionDamageClipping(SkillBase skill) - { - return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.cut_clipping, int.MaxValue); - } - - protected static string _GetSkillOptionHealing(SkillBase skill) - { - int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.healing, 0); - return Mathf.Max(0, b).ToString(); - } - - protected static string _GetSkillOptionAddPp(SkillBase skill) - { - int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_pp, 0); - return Mathf.Max(0, b).ToString(); - } - - protected static string _GetSkillOptionAddOffense(SkillBase skill) - { - return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_offense, 0).ToString(); - } - - protected static string _GetSkillOptionAddLife(SkillBase skill) - { - return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_life, 0).ToString(); - } - - protected static string _GetSkillOptionMultiplyOffense(SkillBase skill) - { - return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.multiply_offense, 1).ToString(); - } - - protected static string _GetSkillOptionMultiplyLife(SkillBase skill) - { - return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.multiply_life, 1).ToString(); - } - - protected static int _GetSkillOptionLifeLowerLimit(SkillBase skill) - { - return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.life_lower_limit, 0); - } - - protected static string _GetSkillCallCount(SkillBase skill) - { - int callCount = skill.CallCount; - if (callCount >= 2) - { - return Data.SystemText.Get("BattleLog_0114", callCount.ToString()); - } - return ""; - } - - protected static string _GetSkillOptionAddEp(SkillBase skill) - { - int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_ep, 0); - return Mathf.Max(0, b).ToString(); - } -} diff --git a/SVSim.BattleEngine/Engine/BattleManagerBase.cs b/SVSim.BattleEngine/Engine/BattleManagerBase.cs index ef2e365a..e8210bbc 100644 --- a/SVSim.BattleEngine/Engine/BattleManagerBase.cs +++ b/SVSim.BattleEngine/Engine/BattleManagerBase.cs @@ -90,8 +90,6 @@ public class BattleManagerBase private Dictionary _originalTargetDictionary; - private const string MISSION_INFO_EQUAL = "mission_info="; - public MissionNecessaryInformation(Dictionary targetDictionary) { _originalTargetDictionary = targetDictionary; @@ -103,17 +101,6 @@ public class BattleManagerBase } } - public Dictionary GetMissionNecessaryInfo(BattlePlayerPair pair, BattleCardBase selfClass) - { - Dictionary dictionary = new Dictionary(); - foreach (KeyValuePair item in NecessaryTargetDictionary) - { - SkillCollectionBase.SetupOptionValue(item.Value, pair, selfClass, null); - dictionary.Add(item.Key, item.Value.GetInt(SkillFilterCreator.ContentKeyword.mission_info, 0)); - } - return dictionary; - } - public Dictionary GetOriginalTargetDictionary() { return _originalTargetDictionary; @@ -150,9 +137,13 @@ public class BattleManagerBase return false; } - public bool IsOwnerCardDead() + // Fusion-list parameter: headless has no fusion animation, so the outer mgr's list is + // always empty and Contains(...) always returns false — the block below always runs. + // Passed as a parameter (not read via BattleLogManager.GetInstance()) so concurrent + // battles resolve against their own instance's list rather than a process singleton. + public bool IsOwnerCardDead(List enemyFusionCard) { - if (!BattleLogManager.GetInstance().EnemyFusionCard.Contains(_ownerCard)) + if (!enemyFusionCard.Contains(_ownerCard)) { if (!_ownerCard.IsDead) { @@ -272,18 +263,12 @@ public class BattleManagerBase private Dictionary _calledCreateOrFilterDictionary = new Dictionary(); - public const int SIMPLE_STAGE_ID = 9; - - public const int NEW_INDEX = -1; + public List EnemyFusionCard = new List(); public static readonly int FIRST_PLAYER_EP_NUM = 2; public static readonly int SECOND_PLAYER_EP_NUM = 3; - protected const int FIRST_PLAYER_EVOLVE_WAIT_TURN = 5; - - protected const int SECOND_PLAYER_EVOLVE_WAIT_TURN = 4; - public SBattleLoad SBattleLoad; protected IBattleMgrContentsCreator _contentsCreator; @@ -352,8 +337,6 @@ public class BattleManagerBase public SideLogControl ESelectSkillSideLogControl; - private const string UnityEventAgentStr = "Prefab/Game/UnityEventAgent"; - public ITurnPanelControl TurnPanelControl; public GameObject BattleResult; @@ -384,8 +367,6 @@ public class BattleManagerBase protected int _temporaryPublishedAddCount; - public const int NOT_LETHAL_PUBLISHED_COUNT = -1; - protected int _lethalPublishedActiveSkillCount = -1; protected int _lethalMovementCount; @@ -398,28 +379,50 @@ public class BattleManagerBase public int SecondTurn; - public int GroundID; - - public int DamageCount; - private GameObject _unityEventAgentObject; private UnityEventAgent _unityEventAgent; protected IPhase _phase; - private NetworkTouchControl _networkTouchControl; + // Instance-backed IsRandomDraw / IsForecast / RecoveryInfo (Phase 5a, 2026-07-02). + // Static accessors (this.InstanceIsForecast, Wizard.Data.BattleRecoveryInfo, etc.) + // route through the ambient's current Mgr — same lookup shape as GetIns() — but the + // authoritative state lives on the mgr instance itself, not in separate ambient slots. + // Defaults mirror the ambient's historical defaults. + public bool InstanceIsRandomDraw { get; set; } = true; + public bool InstanceIsForecast { get; set; } = true; + public Wizard.BattleRecoveryInfo InstanceRecoveryInfo { get; set; } + // Instance-backed ViewerId. Default 1001 matches EngineGlobalInit.ThisViewerId (the historical + // PlayerStaticData / Certification default when neither has been assigned by a session). + public int InstanceViewerId { get; set; } = 1001; + + // Instance-backed RealTimeNetworkAgent. Owner: mgr; nullable — headless mostly runs without an + // agent, and existing readers guard with `?.`. + public RealTimeNetworkAgent InstanceNetworkAgent { get; set; } + + // Phase-5 chunk 42 (2026-07-03): ambient bridge dropped. All engine per-mgr readers and writers + // now use `mgr.InstanceIsRandomDraw` / `mgr.InstanceIsForecast` directly. The residual static + // setter/getter keeps the shape only for pre-mgr fixture/node writes — no ambient-slot fallback. + // If GetIns() is null (no scope), the setter silently no-ops and the getter returns the default. public static bool IsRandomDraw { - get => SVSim.BattleEngine.Ambient.BattleAmbient.Require().IsRandomDraw; - set => SVSim.BattleEngine.Ambient.BattleAmbient.Require().IsRandomDraw = value; + get => GetIns()?.InstanceIsRandomDraw ?? true; + set { if (GetIns() is { } m) m.InstanceIsRandomDraw = value; } } public static bool IsForecast { - get => SVSim.BattleEngine.Ambient.BattleAmbient.Require().IsForecast; - set => SVSim.BattleEngine.Ambient.BattleAmbient.Require().IsForecast = value; + get => GetIns()?.InstanceIsForecast ?? true; + set { if (GetIns() is { } m) m.InstanceIsForecast = value; } } + // Phase-5 chunk 45 (2026-07-03): pure per-instance GameMgr assigned in ctor. The property has + // no field initializer so the ctor can set it before the base-ctor chain reads it. Subclasses + // that need a pre-seeded GameMgr (test fixtures with chara-id / net-user data) call the + // (contentsCreator, gameMgr) overload; the parameterless overload keeps the historical ambient + // bridge so pre-existing TestBattleScope seeders still work while the fixture rewrite lands. + public GameMgr GameMgr { get; } + public BattleLifeTimeSharedObject BattleLifeTimeSharedObject; private BattleUIContainer _battleUIContainer; @@ -434,8 +437,6 @@ public class BattleManagerBase protected XorShift _oppXorShiftRandom; - public bool IsKeyboardEnable = true; - public static bool IsTutorial { get @@ -448,8 +449,6 @@ public class BattleManagerBase } } - protected virtual bool IsStoryTutorial => false; - protected virtual bool DisableCustomMouse => false; public static bool UseCustomMouse @@ -465,46 +464,14 @@ public class BattleManagerBase } } - public static bool UseKeyboard - { - get - { - bool flag = GetIns()?.IsStoryTutorial ?? false; - GameMgr ins = GameMgr.GetIns(); - bool isWatchBattle = ins.IsWatchBattle; - bool isReplayBattle = ins.IsReplayBattle; - if (InputMgr.KeyboardControl && !flag && !isWatchBattle) - { - return !isReplayBattle; - } - return false; - } - } - - public static bool UseKeyboardTurnEndSpaceShortcut - { - get - { - if (UseKeyboard) - { - return InputMgr.KeyboardControlSpace; - } - return false; - } - } - public int BackgroundId { get; private set; } public string BgmId { get; private set; } - public bool IsBackGroundLoad => _backGround.IsLoadDone; - public BattleCamera Camera => _battleCamera; public BackGroundBase BackGround => _backGround; - public Camera SubParticleCamera => _subParticleCamera; - public int AllPublishedActiveSkillCount { get @@ -599,8 +566,6 @@ public class BattleManagerBase public IPhaseCreator PhaseCreator { get; private set; } - public bool IsPreRecovery { get; set; } - public bool IsRecovery { get; set; } public bool IsPuzzleMgr => this is PuzzleBattleManager; @@ -658,7 +623,7 @@ public class BattleManagerBase public bool IsTurnEnd { get; protected set; } - public virtual bool IsVirtualBattle => IsForecast; + public virtual bool IsVirtualBattle => this.InstanceIsForecast; public virtual bool IsVirtualBattleEnemyTurn { @@ -712,15 +677,23 @@ public class BattleManagerBase public static BattleManagerBase GetIns() { - // Soft read: returns null when no scope is active, preserving engine call sites that pattern - // `GetIns()?.Foo ?? default` (or null-tolerant successors). Inside a scope, returns the - // scope's Mgr (which may itself be null mid-Setup — see SessionBattleEngine.SetupInternal, - // which publishes Mgr before WireMulliganPhase). - return SVSim.BattleEngine.Ambient.BattleAmbient.Current?.Mgr; + // Phase-5 chunk 46: pure per-instance world. GetIns() no longer routes through the ambient + // (which is being deleted). All direct engine callers were converted to per-mgr reads in + // chunks 38-42; residual callers are the 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo, + // ToolboxGame.RealTimeNetworkAgent) and the two static flags (IsForecast, IsRandomDraw), + // each of which returns a null-tolerant default when GetIns() is null — matching the "no scope" + // semantics the ambient used to provide. + return null; } protected BattleManagerBase(IBattleMgrContentsCreator contentsCreator) + : this(contentsCreator, new GameMgr()) { + } + + protected BattleManagerBase(IBattleMgrContentsCreator contentsCreator, GameMgr gameMgr) + { + GameMgr = gameMgr; BattleLifeTimeSharedObject = new BattleLifeTimeSharedObject(); PublishedSkillList = new List(); _contentsCreator = contentsCreator; @@ -765,8 +738,8 @@ public class BattleManagerBase SubUI = null; SubUIOverLayBG = null; MenuButtonObject = null; - GameMgr.GetIns().GetPrefabMgr().Load("Prefab/Game/UnityEventAgent"); - _unityEventAgentObject = UnityEngine.Object.Instantiate(GameMgr.GetIns().GetPrefabMgr().Get("Prefab/Game/UnityEventAgent")); + this.GameMgr.GetPrefabMgr().Load("Prefab/Game/UnityEventAgent"); + _unityEventAgentObject = UnityEngine.Object.Instantiate(this.GameMgr.GetPrefabMgr().Get("Prefab/Game/UnityEventAgent")); _unityEventAgent = _unityEventAgentObject.GetComponent(); _unityEventAgent.SetBattleMgr(this); Prediction = new Prediction(BattleResourceMgr, GetBattlePlayerPair(isPlayer: true)); @@ -780,7 +753,7 @@ public class BattleManagerBase FirstReplaySetting(); OnBattleSettingInfoClear += delegate { - GameMgr.GetIns().GetDataMgr().SetStoryBgmID("NONE"); + this.GameMgr.GetDataMgr().SetStoryBgmID("NONE"); }; LocalLog.AccumulateSettingLog(); } @@ -792,7 +765,7 @@ public class BattleManagerBase public void StartRecoveryRecording() { - _contentsCreator.RecoveryRecordManager.SetupRecording(this, GameMgr.GetIns().GetDataMgr().m_BattleType, _contentsCreator.RandomSeed, BackgroundId, BgmId); + _contentsCreator.RecoveryRecordManager.SetupRecording(this, this.GameMgr.GetDataMgr().m_BattleType, _contentsCreator.RandomSeed, BackgroundId, BgmId); } protected virtual void FirstReplaySetting() @@ -805,11 +778,6 @@ public class BattleManagerBase _contentsCreator.ReplayRecordManager.SetupRecording(this); } - public void SetupReplayBattleInfoFilter() - { - _contentsCreator.ReplayRecordManager.SetupBattleInfoFilter(); - } - public void CreateXorShift(int selfIdxSeed, int oppIdxSeed = -1) { if (selfIdxSeed != -1) @@ -841,12 +809,12 @@ public class BattleManagerBase return backGroundId; } int result = 1; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SIMPLE_STAGE)) { result = 9; } - else if (dataMgr.m_BattleType == DataMgr.BattleType.Story || dataMgr.IsQuestBattleType() || GameMgr.GetIns().IsPuzzleQuest) + else if (dataMgr.m_BattleType == DataMgr.BattleType.Story || dataMgr.IsQuestBattleType() || this.GameMgr.IsPuzzleQuest) { result = dataMgr.GetSoroPlay3DFieldID(); } @@ -900,7 +868,7 @@ public class BattleManagerBase return bgmId; } string result = "NONE"; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); if (dataMgr.m_BattleType == DataMgr.BattleType.Story || dataMgr.IsQuestBattleType()) { result = dataMgr.GetStoryBgmID(); @@ -908,17 +876,10 @@ public class BattleManagerBase return result; } - public BackGroundBase CreateBattleField() - { - _backGround.CreateField(_battleCamera, Battle3DContainer, CutInContainer); - GameMgr.GetIns().GetInputMgr().SetBackGround(_backGround); - return _backGround; - } - protected void CreateManager() { _battleCamera = new BattleCamera(); - GameMgr.GetIns().GetInputMgr().SetBattleCamera(_battleCamera); + this.GameMgr.GetInputMgr().SetBattleCamera(_battleCamera); DetailMgr = new DetailMgr(); switch (BackgroundId) { @@ -1122,20 +1083,6 @@ public class BattleManagerBase SetupEvolCount(doesPlayerGoFirst); } - protected virtual void SetupInitialGameState(bool doesPlayerGoFirst, bool areCardsRandomlyDrawn, int playerCurrentLife, int enemyCurrentLife, int playerMaxLife, int enemyMaxLife, int playerEvolCount, int enemyEvolCount, int playerEvolWaitTurnCount, int enemyEvolWaitTurnCount, int playerInitialPp, int enemyInitialPp, int playerInitialCemeteryAmount, int enemyInitialCemeteryAmount, int currentTurnNumber, bool showTurnsLeftUntilEvolve) - { - IsFirst = doesPlayerGoFirst; - IsRandomDraw = areCardsRandomlyDrawn; - InitializeClassLife(playerMaxLife, enemyMaxLife); - TurnPanelControl.Initialize(showTurnsLeftUntilEvolve, showTurnsLeftUntilEvolve); - int maxEvolCount = (doesPlayerGoFirst ? FIRST_PLAYER_EP_NUM : SECOND_PLAYER_EP_NUM); - int maxEvolCount2 = ((!doesPlayerGoFirst) ? FIRST_PLAYER_EP_NUM : SECOND_PLAYER_EP_NUM); - InitializePlayer(BattlePlayer, playerEvolCount, maxEvolCount, playerEvolWaitTurnCount, playerInitialPp, playerInitialCemeteryAmount, playerCurrentLife, playerMaxLife); - InitializePlayer(BattleEnemy, enemyEvolCount, maxEvolCount2, enemyEvolWaitTurnCount, enemyInitialPp, enemyInitialCemeteryAmount, enemyCurrentLife, enemyMaxLife); - FirstTurn = currentTurnNumber; - SecondTurn = currentTurnNumber; - } - public void SetupEvolCount(bool doesPlayerGoFirst) { BattlePlayerBase battlePlayerBase; @@ -1167,21 +1114,6 @@ public class BattleManagerBase ((ClassBattleCardBase)BattleEnemy.Class).InitBaseMaxLife(enemyMaxLife); } - private void InitializePlayer(BattlePlayerBase battlePlayerBase, int evolCount, int maxEvolCount, int evolWaitTurnCount, int initialPp, int initialCemeteryAmount, int currentLife, int maxLife) - { - SetPlayerInitialEp(battlePlayerBase, evolCount, maxEvolCount, evolWaitTurnCount); - battlePlayerBase.SetPpTotal(initialPp, isUpdatePp: true, null); - for (int i = 0; i < initialCemeteryAmount; i++) - { - BattleCardBase item = CardCreatorBase.CreateDummyInstance(); - battlePlayerBase.CemeteryList.Add(item); - } - if (currentLife < maxLife) - { - battlePlayerBase.Class.SkillApplyInformation.DamageLife(maxLife - currentLife, -1, isSelfTurn: false); - } - } - protected virtual void SetupEvent() { BattlePlayer.OnTurnEndFinish += delegate @@ -1254,16 +1186,6 @@ public class BattleManagerBase }; } - public VfxBase LoadOpponentObjects() - { - VfxBase vfxBase = GetIns().SBattleLoad.NetworkBattleStartToLoadOpponentObjects(delegate - { - DelayLoadCompleteOpponentResources(); - }); - VfxMgr.RegisterSequentialVfx(vfxBase); - return vfxBase; - } - protected virtual void DelayLoadCompleteOpponentResources() { SetupBattlePlayersEvent(); @@ -1353,11 +1275,6 @@ public class BattleManagerBase return TurnPanelControl.LoadResource(); } - public void ReinitializeTurnPanelControl() - { - TurnPanelControl.Initialize(BattlePlayer.EvolveWaitTurnCount > 0, BattleEnemy.EvolveWaitTurnCount > 0); - } - public virtual void Update(float dt) { VfxWith vfxWith = _phase.Update(dt); @@ -1378,50 +1295,35 @@ public class BattleManagerBase LocalLog.SubmitAccumulateLastTraceLog(); } - public virtual void Pause() - { - _phase.Pause(); - Prediction.Clear(); - } - public IPhase GetCurrentPhase() { return _phase; } - public virtual void Resume() - { - } - public virtual void FinishBattle() { } - public void OnBattleSettingInfoClearIsNullClear() - { - this.OnBattleSettingInfoClear = null; - } - public virtual void DisposeBattleGameObj() { BattleResourceMgr.Dispose(); VfxMgr.Dispose(); DetailMgr.Dispose(); - Data.BattleRecoveryInfo = null; + this.InstanceRecoveryInfo = null; BattleLifeTimeSharedObject = null; this.OnBattleSettingInfoClear.Call(); BattleLogItem.ClearHeaderTextureCache(); CardVoiceInfoCache.ClearCardVoiceInfo(); NullBattleCardView.ReleaseSharedDummy(); NullBattleCard.ReleaseSharedDummy(); - GameMgr.GetIns().GetEffectMgr().ClearBattleFeildEffect(); - GameMgr.GetIns().GetEffectMgr().RestUnneededEffect(); + this.GameMgr.GetEffectMgr().ClearBattleFeildEffect(); + this.GameMgr.GetEffectMgr().RestUnneededEffect(); _backGround.Dispose(); _battleCamera.Dispose(); Toolbox.ResourcesManager.RemoveAssetGroup(Toolbox.ResourcesManager.BattleListAssetPathList); Toolbox.ResourcesManager.BattleListAssetPathList.Clear(); RenderSettings.fog = false; - GameMgr.GetIns().GetEffectMgr().ImmediateDestroyBattleEffectContainer(); + this.GameMgr.GetEffectMgr().ImmediateDestroyBattleEffectContainer(); if (PanelMgr != null) { DisposeBattleGameObj_DestroyImmediate(PanelMgr.gameObject); @@ -1476,9 +1378,9 @@ public class BattleManagerBase SubUI = null; SubParticleContainer = null; UIManager.GetInstance().DestroyView(UIManager.ViewScene.Battle); - GameMgr.GetIns().GetPrefabMgr().DisposeAllClonedObject(); - GameMgr.GetIns().GetGameObjMgr().DisposeUIGameObj(); - GameMgr.GetIns().GetPrefabMgr().AllUnLoad(); + this.GameMgr.GetPrefabMgr().DisposeAllClonedObject(); + this.GameMgr.GetGameObjMgr().DisposeUIGameObj(); + this.GameMgr.GetPrefabMgr().AllUnLoad(); } private void DisposeBattleGameObj_DestroyImmediate(GameObject obj) @@ -1538,16 +1440,7 @@ public class BattleManagerBase public BattleControl GetBattleControl() { - return GameMgr.GetIns().GetBattleCtrl(); - } - - public CardParameterListInfo GetCardParameterListInfo(bool isPlayer) - { - if (!isPlayer) - { - return EnemyCardParameterListInfo; - } - return PlayerCardParameterListInfo; + return this.GameMgr.GetBattleCtrl(); } public BattlePlayerBase GetBattlePlayer(bool isPlayer) @@ -1573,14 +1466,9 @@ public class BattleManagerBase return new BattlePlayerReadOnlyInfoPair(battlePlayer, battlePlayer2); } - public Transform GetBattle3DContainerChild(string childName) - { - return Battle3DContainer.transform.Find(childName); - } - public virtual int StableRandom(int val) { - if (IsForecast) + if (this.InstanceIsForecast) { return 0; } @@ -1591,7 +1479,7 @@ public class BattleManagerBase public virtual double StableRandomDouble() { - if (IsForecast) + if (this.InstanceIsForecast) { return 0.0; } @@ -1602,7 +1490,7 @@ public class BattleManagerBase public virtual int StableRandomOnlySelf(int val) { - if (IsForecast) + if (this.InstanceIsForecast) { return 0; } @@ -1688,12 +1576,6 @@ public class BattleManagerBase return battleCardBase; } - public BattleCardBase CreateFusionCard(int cardId, bool isPlayer) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId); - return CardCreatorBase.CreateToken(CreateCardBuildInfo(null, cardParameterFromId, isPlayer, cardId, cardId), createNullView: true); - } - public BattleCardBase ReplaceChoiceBraveCard(BattleCardBase originalCard, int cardId, BattleCardBase selectSkillCard) { BattleCardBase choiceBraveCard = originalCard.SelfBattlePlayer.CreateCard(cardId, originalCard.SelfBattlePlayer.Class.Index, isChoiceBrave: true); @@ -1729,15 +1611,15 @@ public class BattleManagerBase GameObject gameObject = null; if (cardParameter.CharType == CardBasePrm.CharaType.NORMAL) { - gameObject = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(SBattleLoad.UnitCardTemplate.gameObject, _backGround.m_Battle3DContainer); + gameObject = this.GameMgr.GetPrefabMgr().CloneObjectToParent(SBattleLoad.UnitCardTemplate.gameObject, _backGround.m_Battle3DContainer); } else if (cardParameter.CharType == CardBasePrm.CharaType.SPELL) { - gameObject = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(SBattleLoad.SpellCardTemplate.gameObject, _backGround.m_Battle3DContainer); + gameObject = this.GameMgr.GetPrefabMgr().CloneObjectToParent(SBattleLoad.SpellCardTemplate.gameObject, _backGround.m_Battle3DContainer); } else if (cardParameter.CharType == CardBasePrm.CharaType.FIELD || cardParameter.CharType == CardBasePrm.CharaType.CHANT_FIELD) { - gameObject = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(SBattleLoad.FieldCardTemplate.gameObject, _backGround.m_Battle3DContainer); + gameObject = this.GameMgr.GetPrefabMgr().CloneObjectToParent(SBattleLoad.FieldCardTemplate.gameObject, _backGround.m_Battle3DContainer); gameObject.transform.Find("CardObj/NormalField").gameObject.SetActive(value: false); } SetupCardObjectTags(gameObject, isPlayer, cardIndex); @@ -1820,7 +1702,7 @@ public class BattleManagerBase public VfxBase DeadClass(bool PlayerDead, FINISH_TYPE finishType) { ClassBattleCardBase classBattleCardBase = (ClassBattleCardBase)GetBattlePlayer(PlayerDead).Class; - if (GameMgr.GetIns().IsReplayBattle && !classBattleCardBase.ClassBattleCardView.InPlayModelActive) + if (this.GameMgr.IsReplayBattle && !classBattleCardBase.ClassBattleCardView.InPlayModelActive) { return NullVfx.GetInstance(); } @@ -1881,7 +1763,7 @@ public class BattleManagerBase public virtual void InitiateGameEndSequence(bool hasWon) { - if (GameMgr.GetIns().IsReplayBattle && !GameMgr.GetIns().IsNewReplayBattle) + if (this.GameMgr.IsReplayBattle && !this.GameMgr.IsNewReplayBattle) { hasWon = Data.ReplayBattleInfo.is_win; } @@ -1897,7 +1779,7 @@ public class BattleManagerBase public virtual VfxBase PlaySpecialWin(BattlePlayerBase winPlayer) { - GetIns().VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); + GetIns().VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); bool playerDead = !winPlayer.IsPlayer; return SequentialVfxPlayer.Create(DeadClass(playerDead, FINISH_TYPE.SPECIAL_WIN), InstantVfx.Create(delegate { @@ -1907,7 +1789,7 @@ public class BattleManagerBase public virtual void PlayRetire() { - GetIns().VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); + GetIns().VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); if (!GetBattlePlayer(isPlayer: true).Class.IsDead) { BattlePlayer.BattleView.HideTurnEndButton(); @@ -1920,11 +1802,6 @@ public class BattleManagerBase } } - public void MulliganSubmit() - { - VfxMgr.RegisterSequentialVfx(this.OnSubmitMulligan.GetAllFuncVfxResults()); - } - public void ChangeCameraFieldOfView(float aspectRatio) { if ((bool)Battle3DContainer) @@ -1947,7 +1824,7 @@ public class BattleManagerBase } Camera component2 = transform2.GetComponent(); component2.fieldOfView = num; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); if (dataMgr.Is3DSkin(isPlayer: true)) { component2.depth = 40f; @@ -1982,7 +1859,7 @@ public class BattleManagerBase public bool CanOpenEvolutionConfirmation(BattleCardBase card) { - if (IsStopOperate || !card.IsInplay || !card.SelfBattlePlayer.IsSelfTurn || !card.IsPlayer || !card.IsUnit || GameMgr.GetIns().IsWatchBattle) + if (IsStopOperate || !card.IsInplay || !card.SelfBattlePlayer.IsSelfTurn || !card.IsPlayer || !card.IsUnit || this.GameMgr.IsWatchBattle) { return false; } @@ -1994,7 +1871,7 @@ public class BattleManagerBase SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); if (battlePlayer.IsShortageDeckWin) { - sequentialVfxPlayer.Register(new DeckOutWinVfx(battlePlayer)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(DeadClass(!battlePlayer.IsPlayer, FINISH_TYPE.SPECIAL_WIN)); battlePlayer.Class.OpponentBattlePlayer.Class.FlagCardAsDestroyedBySkill(); } @@ -2002,12 +1879,12 @@ public class BattleManagerBase { if (battlePlayer.IsPlayer) { - sequentialVfxPlayer.Register(new PlayerDeckOutVfx(BattlePlayer, this)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); BattlePlayer.SetIsShortageDeckLose(flag: true); } else { - sequentialVfxPlayer.Register(new EnemyDeckOutVfx(BattleEnemy, this)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); BattleEnemy.SetIsShortageDeckLose(flag: true); } sequentialVfxPlayer.Register(DeadClass(battlePlayer.IsPlayer, FINISH_TYPE.NORMAL)); @@ -2114,7 +1991,7 @@ public class BattleManagerBase { if (item.Key.HasOwnerCard()) { - if (item.Key.IsOwnerCardDead()) + if (item.Key.IsOwnerCardDead(EnemyFusionCard)) { list.Add(item.Key); } @@ -2133,7 +2010,7 @@ public class BattleManagerBase { if (item3.Key.HasOwnerCard()) { - if (item3.Key.IsOwnerCardDead()) + if (item3.Key.IsOwnerCardDead(EnemyFusionCard)) { list.Add(item3.Key); } @@ -2152,7 +2029,7 @@ public class BattleManagerBase { if (item5.Key.HasOwnerCard()) { - if (item5.Key.IsOwnerCardDead()) + if (item5.Key.IsOwnerCardDead(EnemyFusionCard)) { list.Add(item5.Key); } @@ -2170,7 +2047,7 @@ public class BattleManagerBase protected void SetUpMyRotationBattle(int playerMaxLife, int enemyMaxLife) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); MyRotationInfo myRotationInfo; bool flag = dataMgr.TryGetPlayerMyRotationInfo(out myRotationInfo); MyRotationInfo myRotationInfo2; @@ -2253,7 +2130,7 @@ public class BattleManagerBase { if (Data.CurrentFormat == Format.Avatar) { - GameMgr.GetIns().GetDataMgr(); + this.GameMgr.GetDataMgr(); if (doesPlayerGoFirst) { SetupSpecifiedPlayerAvatarBattle(isPlayer: true); @@ -2269,7 +2146,7 @@ public class BattleManagerBase private void SetupSpecifiedPlayerAvatarBattle(bool isPlayer) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); if ((!isPlayer) ? dataMgr.TryGetEnemyAvatarBattleInfo(out var avatarBattleInfo) : dataMgr.TryGetPlayerAvatarBattleInfo(out avatarBattleInfo)) { SetupPlayerAvatarBattle(isPlayer ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy), avatarBattleInfo); @@ -2321,19 +2198,6 @@ public class BattleManagerBase return new AttachInfo(battleCardBase, skillBase, targetSkillBuildInfo, myRotationBonusId); } - public static bool IsCardPrivate(BattleCardBase card) - { - if (!card.IsPlayer) - { - if (!card.IsInHand) - { - return card.IsInDeck; - } - return true; - } - return false; - } - public VfxBase LoadCardResources(List cards, bool isRecoveryFinish = false) { if (cards.Count == 0) @@ -2387,63 +2251,8 @@ public class BattleManagerBase }); } } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(new WaitLoadResourceVfx(list2, action)); + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(NullVfx.GetInstance()); sequentialVfxPlayer.Register(parallelVfxPlayer); return sequentialVfxPlayer; } - - public VfxBase RecoveryInPlayAndHandCards() - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < BattlePlayer.InPlayCards.Count(); i++) - { - BattleCardBase battleCardBase = BattlePlayer.InPlayCards.ElementAt(i); - battleCardBase.BattleCardView.CardWrapObject.SetActive(value: true); - iTween.Stop(battleCardBase.BattleCardView.GameObject); - list.Add(battleCardBase); - parallelVfxPlayer.Register(battleCardBase.RecoveryInPlay(i, newReplayMoveTurn: true)); - } - for (int j = 0; j < BattleEnemy.InPlayCards.Count(); j++) - { - BattleCardBase battleCardBase2 = BattleEnemy.InPlayCards.ElementAt(j); - iTween.Stop(battleCardBase2.BattleCardView.GameObject); - list.Add(battleCardBase2); - parallelVfxPlayer.Register(battleCardBase2.RecoveryInPlay(j, newReplayMoveTurn: true)); - } - for (int k = 0; k < BattlePlayer.HandCardList.Count; k++) - { - BattleCardBase card = BattlePlayer.HandCardList[k]; - list.Add(card); - card.SetOnDraw(draw: false); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(card.BattleCardView.RecoveryInHand()); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView.GameObject.SetActive(value: false); - MotionUtils.SetLayerAll(card.BattleCardView.GameObject, 10); - card.BattleCardView.InitCostViewAnim(); - card.BattleCardView.Transform.parent = BattlePlayer.HandControl.Transform; - BattlePlayer.BattleView.HandView.AddCardToView(card.BattleCardView, 0f, isNewReplayMoveTurn: true); - card.BattleCardView.GameObject.SetActive(value: true); - card.BattleCardView.CardWrapObject.SetActive(value: true); - })); - parallelVfxPlayer.Register(sequentialVfxPlayer); - } - for (int num = 0; num < BattleEnemy.HandCardList.Count; num++) - { - BattleCardBase card2 = BattleEnemy.HandCardList[num]; - list.Add(card2); - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - sequentialVfxPlayer2.Register(InstantVfx.Create(delegate - { - card2.BattleCardView.GameObject.SetActive(value: false); - MotionUtils.SetLayerAll(card2.BattleCardView.GameObject, 10); - card2.BattleCardView.Transform.parent = BattleEnemy.HandControl.Transform; - BattleEnemy.BattleView.HandView.AddCardToView(card2.BattleCardView, 0f, isNewReplayMoveTurn: true); - card2.BattleCardView.GameObject.SetActive(value: true); - })); - parallelVfxPlayer.Register(sequentialVfxPlayer2); - } - return SequentialVfxPlayer.Create(LoadCardResources(list), parallelVfxPlayer); - } } diff --git a/SVSim.BattleEngine/Engine/BattleMenuMgr.cs b/SVSim.BattleEngine/Engine/BattleMenuMgr.cs deleted file mode 100644 index 7e35d079..00000000 --- a/SVSim.BattleEngine/Engine/BattleMenuMgr.cs +++ /dev/null @@ -1,609 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle.View; -using Wizard.RoomMatch; - -public class BattleMenuMgr : NonDialogPopup -{ - [SerializeField] - private GameObject UserPanel; - - [SerializeField] - private NguiObjs UserPanelP; - - [SerializeField] - private NguiObjs UserPanelE; - - [SerializeField] - private GameObject CharPanelP; - - [SerializeField] - private GameObject CharPanelE; - - [SerializeField] - private UITexture CharTextureP; - - [SerializeField] - private UITexture CharTextureE; - - [SerializeField] - private GameObject _roomIDRoot; - - [SerializeField] - private UILabel _roomIDLabel; - - [SerializeField] - private GameObject _winnerRewardRoot; - - [SerializeField] - private UISprite _winnerRewardBox; - - [SerializeField] - private UILabel _winnerRewardNameLabel; - - [SerializeField] - private GameObject _vsRoot; - - [SerializeField] - private GameObject _ratingRoot; - - [SerializeField] - private GameObject _backSpriteRoot; - - [SerializeField] - private UIButton _backSpriteButton; - - [SerializeField] - private GameObject _defaultMenuRoot; - - [SerializeField] - private GameObject _titleLine; - - [SerializeField] - private GameObject _titleLineWithFormat; - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UISprite _formatIcon; - - [SerializeField] - private UILabel _tsRotaionFormatLabel; - - [SerializeField] - private UIButton _retireButton; - - [SerializeField] - private UILabel _retireButtonLabel; - - [SerializeField] - private UIButton _settingButton; - - [SerializeField] - private UILabel _settingButtonLabel; - - [SerializeField] - private UIButton _backButton; - - [SerializeField] - private UILabel _backButtonLabel; - - [SerializeField] - private GameObject _questMenuRoot; - - [SerializeField] - private UIButton _questRetireButton; - - [SerializeField] - private UILabel _questRetireButtonLabel; - - [SerializeField] - private UIButton _questSettingButton; - - [SerializeField] - private UILabel _questSettingButtonLabel; - - [SerializeField] - private UIButton _questBackButton; - - [SerializeField] - private UILabel _questBackButtonLabel; - - [SerializeField] - private UIButton _questMissionButton; - - [SerializeField] - private UILabel _questMissionButtonLabel; - - [SerializeField] - private GameObject _questMissionDialogPrefab; - - [SerializeField] - private ClassInfoParts _classInfoP; - - [SerializeField] - private ClassInfoParts _classInfoE; - - [SerializeField] - private ClassInfoParts _classInfoWithSubClassP; - - [SerializeField] - private ClassInfoParts _classInfoWithSubClassE; - - [SerializeField] - private FlexibleGrid _subClassGridP; - - [SerializeField] - private FlexibleGrid _subClassGridE; - - [SerializeField] - private MyRotationParts _myRotationInfoP; - - [SerializeField] - private MyRotationParts _myRotationInfoE; - - private Dictionary defPosDict = new Dictionary(); - - public const float OPEN_DURATION_TIME = 0.3f; - - private bool IsQuestBattle => GameMgr.GetIns().GetDataMgr().IsQuestBattleType(); - - public GameObject QuestMissionDialogPrefab => _questMissionDialogPrefab; - - public void DisplayBattleMenu(Action retireAction, Action settingAction, Action backAction, Action questMissionAction) - { - InitializeBattleMenu(); - iTween.MoveTo(UserPanel, iTween.Hash("position", defPosDict["UserPanel"], "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(CharPanelP, iTween.Hash("position", defPosDict["CharPanelP"], "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(CharPanelE, iTween.Hash("position", defPosDict["CharPanelE"], "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(UserPanel, 0f, 0f); - TweenAlpha.Begin(UserPanel, 0.3f, 1f); - if (IsQuestBattle && !BattleManagerBase.GetIns().IsPuzzleMgr && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.BossRushQuest && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.SecretBossQuest) - { - SetupQuestButtonMenu(retireAction, settingAction, backAction, questMissionAction); - } - else - { - SetupDefaultButtonMenu(retireAction, settingAction, backAction); - } - TweenAlpha.Begin(base.gameObject, 0f, 0f); - TweenAlpha.Begin(base.gameObject, 0.3f, 1f); - TweenAlpha.Begin(_backSpriteRoot.gameObject, 0f, 0f); - TweenAlpha.Begin(_backSpriteRoot.gameObject, 0.3f, 1f); - } - - private void InitializeBattleMenu() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData(); - PuzzleQuestData puzzleQuestData = null; - bool isPuzzleMgr = BattleManagerBase.GetIns().IsPuzzleMgr; - if (isPuzzleMgr) - { - puzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == GameMgr.GetIns().GetDataMgr().PuzzleQuestId); - } - string text = PlayerStaticData.UserName.ToString(); - if (GameMgr.GetIns().IsWatchBattle) - { - text = networkUserInfoData.GetSelfName(); - } - UserPanelP.labels[0].text = text; - if (GameMgr.GetIns().IsNetworkBattle) - { - UserPanelE.labels[0].text = VideoHostingUtil.GetUserNameHidden(networkUserInfoData.GetOpponentName().ToString()); - } - else - { - UserPanelE.labels[0].text = dataMgr.GetEnemyCharaData().chara_name; - } - if (dataMgr.m_BattleType == DataMgr.BattleType.RankBattle) - { - if (PlayerStaticData.IsMasterRankCurrentFormat()) - { - UserPanelP.labels[1].text = PlayerStaticData.UserMasterPointCurrentFormat().ToString(); - } - else - { - int num = PlayerStaticData.UserBattlePointCurrentFormat(); - if (GameMgr.GetIns().IsWatchBattle) - { - num = networkUserInfoData.GetSelfBattlePoint(); - } - UserPanelP.labels[1].text = num.ToString(); - } - if (networkUserInfoData.GetOpponentIsMasterRank()) - { - UserPanelE.labels[1].text = networkUserInfoData.GetOpponentMasterPoint().ToString(); - } - else - { - UserPanelE.labels[1].text = networkUserInfoData.GetOpponentBattlePoint().ToString(); - } - } - else - { - UserPanelP.labels[1].gameObject.SetActive(value: false); - UserPanelE.labels[1].gameObject.SetActive(value: false); - } - if (GameMgr.GetIns().IsWatchBattle) - { - UserPanelP.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else if (isPuzzleMgr) - { - UserPanelP.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.PlayerEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else - { - PlayerStaticData.AttachUserEmblemTexture(UserPanelP.textures[0], PlayerStaticData.EmblemTexSize.M); - } - if (GameMgr.GetIns().IsNetworkBattle) - { - UserPanelE.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else - { - int num2 = 100000000; - if (isPuzzleMgr) - { - num2 = puzzleQuestData.EnemyEmblemId; - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.Quest) - { - num2 = dataMgr.QuestBattleData.EmblemId; - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest || dataMgr.m_BattleType == DataMgr.BattleType.SecretBossQuest) - { - num2 = dataMgr.BossRushBattleData.EmblemId; - } - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(num2.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M); - if (Toolbox.ResourcesManager.IsLoadedAssetBundle(assetTypePath)) - { - UserPanelE.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(num2.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else - { - UserPanelE.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(num2.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - } - if (GameMgr.GetIns().IsWatchBattle) - { - DegreeHelper.InitializeDegree(UserPanelP.textures[1], networkUserInfoData.GetSelfDegreeId(), DegreeHelper.DegreeType.SMALL); - } - else if (isPuzzleMgr) - { - DegreeHelper.InitializeDegree(UserPanelP.textures[1], puzzleQuestData.PlayerDegreeId, DegreeHelper.DegreeType.MIDDLE); - } - else - { - DegreeHelper.InitializeDegree(UserPanelP.textures[1], PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.SMALL); - } - int num3 = (GameMgr.GetIns().IsNetworkBattle ? networkUserInfoData.GetOpponentDegreeId() : (isPuzzleMgr ? puzzleQuestData.EnemyDegreeId : ((dataMgr.m_BattleType == DataMgr.BattleType.Quest) ? dataMgr.QuestBattleData.DegreeId : ((dataMgr.m_BattleType != DataMgr.BattleType.BossRushQuest && dataMgr.m_BattleType != DataMgr.BattleType.SecretBossQuest) ? dataMgr.PracticeDifficultyDegreeId : dataMgr.BossRushBattleData.DegreeId)))); - if ((dataMgr.m_BattleType != DataMgr.BattleType.Practice || dataMgr.PracticeDifficultyDegreeId != -1 || isPuzzleMgr) && (!dataMgr.IsQuestBattleType() || num3 != -1) && dataMgr.m_BattleType != DataMgr.BattleType.Story) - { - DegreeHelper.InitializeDegree(UserPanelE.textures[1], num3, DegreeHelper.DegreeType.SMALL); - } - UserPanelE.textures[1].gameObject.SetActive(value: true); - if (dataMgr.m_BattleType != DataMgr.BattleType.Practice && dataMgr.m_BattleType != DataMgr.BattleType.Story && dataMgr.m_BattleType != DataMgr.BattleType.Quest && dataMgr.m_BattleType != DataMgr.BattleType.BossRushQuest && dataMgr.m_BattleType != DataMgr.BattleType.SecretBossQuest) - { - if (GameMgr.GetIns().IsWatchBattle || UserPanelP.textures[2].mainTexture == null) - { - UserPanelP.textures[2].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture; - } - else - { - PlayerStaticData.AttachUserRankTexture(UserPanelP.textures[2], PlayerStaticData.RankTexSize.S); - } - UserPanelE.textures[2].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture; - } - else - { - UserPanelP.textures[2].gameObject.SetActive(value: false); - UserPanelE.textures[2].gameObject.SetActive(value: false); - } - if (GameMgr.GetIns().IsWatchBattle) - { - UIUtil.SetCountryTexture(UserPanelP.textures[3], networkUserInfoData.GetSelfCountryCode()); - } - else - { - bool flag = !string.IsNullOrEmpty(PlayerStaticData.UserCountryCode); - UserPanelP.textures[3].gameObject.SetActive(flag); - if (flag) - { - PlayerStaticData.AttachUserCountryTexture(UserPanelP.textures[3], PlayerStaticData.CountryTexSize.M); - } - else - { - UserPanelP.textures[3].mainTexture = null; - } - } - if (GameMgr.GetIns().IsNetworkBattle) - { - UIUtil.SetCountryTexture(UserPanelE.textures[3], networkUserInfoData.GetOpponentCountryCode()); - } - else - { - UserPanelE.textures[3].gameObject.SetActive(value: false); - UserPanelE.textures[3].mainTexture = null; - } - _myRotationInfoP.gameObject.SetActive(value: false); - if (dataMgr.TryGetPlayerSubClassId(out var subClassId)) - { - SetClassInfoWithSubClass(dataMgr.GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId(), subClassId, _classInfoP, _classInfoWithSubClassP, _subClassGridP); - } - else - { - if (dataMgr.TryGetPlayerMyRotationInfo(out var myRotationInfo)) - { - _myRotationInfoP.gameObject.SetActive(value: true); - _myRotationInfoP.SetMyRotationInfo(myRotationInfo); - _myRotationInfoP.Reposition(); - } - _classInfoP.InitByCharaPrm(dataMgr.GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId()); - _classInfoWithSubClassP.gameObject.SetActive(value: false); - } - _myRotationInfoE.gameObject.SetActive(value: false); - if (dataMgr.TryGetEnemySubClassId(out var subClassId2)) - { - SetClassInfoWithSubClass(dataMgr.GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId(), subClassId2, _classInfoE, _classInfoWithSubClassE, _subClassGridE); - } - else - { - if (dataMgr.TryGetEnemyMyRotationInfo(out var myRotationInfo2)) - { - _myRotationInfoE.gameObject.SetActive(value: true); - _myRotationInfoE.SetMyRotationInfo(myRotationInfo2); - _myRotationInfoE.Reposition(); - } - _classInfoE.InitByCharaPrm(dataMgr.GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId()); - _classInfoWithSubClassE.gameObject.SetActive(value: false); - } - BattleManagerBase ins = BattleManagerBase.GetIns(); - string playerSkinId = dataMgr.GetPlayerSkinId().ToString("00"); - ResourcesManager.AssetLoadPathType assetTypePlayer = (ins.BattlePlayer.IsSkinEvolved ? ResourcesManager.AssetLoadPathType.ClassCharaEvolve : ResourcesManager.AssetLoadPathType.ClassCharaBase); - string playerClassAssetName = Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId, assetTypePlayer); - if (Toolbox.ResourcesManager.IsLoadedAssetBundle(playerClassAssetName)) - { - CharTextureP.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId, assetTypePlayer, isfetch: true)); - } - else - { - StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(playerClassAssetName, delegate - { - Toolbox.ResourcesManager.BattleListAssetPathList.Add(playerClassAssetName); - CharTextureP.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId, assetTypePlayer, isfetch: true)); - })); - } - string enemySkinId = dataMgr.GetEnemySkinId().ToString("00"); - ResourcesManager.AssetLoadPathType assetTypeEnemy = (ins.BattleEnemy.IsSkinEvolved ? ResourcesManager.AssetLoadPathType.ClassCharaEvolve : ResourcesManager.AssetLoadPathType.ClassCharaBase); - string enemyClassAssetName = Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId, assetTypeEnemy); - if (Toolbox.ResourcesManager.IsLoadedAssetBundle(enemyClassAssetName)) - { - CharTextureE.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId, assetTypeEnemy, isfetch: true)); - } - else - { - StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(enemyClassAssetName, delegate - { - Toolbox.ResourcesManager.BattleListAssetPathList.Add(enemyClassAssetName); - CharTextureE.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId, assetTypeEnemy, isfetch: true)); - })); - } - bool activeOfficialUserIconSprite = (GameMgr.GetIns().IsWatchBattle ? networkUserInfoData.GetSelfIsOfficialUser() : PlayerStaticData.IsOfficialUserDisplay); - bool activeOfficialUserIconSprite2 = GameMgr.GetIns().IsNetworkBattle && networkUserInfoData.GetOpponentIsOfficialUser(); - UserPanelP.gameObject.GetComponent().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite); - UserPanelE.gameObject.GetComponent().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite2); - defPosDict["UserPanel"] = UserPanel.transform.localPosition + (IsQuestBattle ? new Vector3(0f, -7f, 0f) : Vector3.zero); - defPosDict["CharPanelP"] = CharPanelP.transform.localPosition; - defPosDict["CharPanelE"] = CharPanelE.transform.localPosition; - UserPanel.transform.localPosition = defPosDict["UserPanel"] + Vector3.down * 50f; - CharPanelP.transform.localPosition = defPosDict["CharPanelP"] + Vector3.left * 300f; - CharPanelE.transform.localPosition = defPosDict["CharPanelE"] + Vector3.right * 300f; - TweenAlpha.Begin(UserPanel, 0f, 0f); - if (dataMgr.GetEnemyBattleSkillReverse() == 0) - { - CharTextureE.uvRect = new Rect(1f, 0f, -1f, 1f); - } - _SetupRoomIDObj(); - SetupRankWinnerReward(); - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString()) - { - _ratingRoot.SetActive(value: true); - } - else - { - _ratingRoot.SetActive(value: false); - } - } - - private static void SetClassInfoWithSubClass(ClassCharacterMasterData charaData, int chaosId, int subClassId, ClassInfoParts defaultClassInfoParts, ClassInfoParts classInfoParts, FlexibleGrid grid) - { - classInfoParts.gameObject.SetActive(value: true); - defaultClassInfoParts.ClassNameLabel.text = string.Empty; - classInfoParts.InitByCharaPrm(charaData, chaosId); - classInfoParts.SetSubClass((CardBasePrm.ClanType)subClassId); - UIUtil.AdjustClassInfoPartsSize(classInfoParts, grid, defaultClassInfoParts.ClassNameLabel.width); - } - - private void _SetupRoomIDObj() - { - _roomIDRoot.SetActive(value: false); - if (GameMgr.GetIns().IsReplayBattle || !GameMgr.GetIns().GetDataMgr().IsRoomBattleType()) - { - return; - } - if (RoomBase.IsConnectControllerActive()) - { - if (!RoomBase.ConnectController.IsGathering) - { - _roomIDRoot.SetActive(value: true); - _roomIDLabel.text = $"{RoomBase.ConnectController.DisplayRoomID:00000}"; - } - } - else if (Data.BattleRecoveryInfo != null && !Data.BattleRecoveryInfo.IsGatheringRoom) - { - _roomIDRoot.SetActive(value: true); - _roomIDLabel.text = $"{PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.ROOM_MATCH_DISPLAY_ID):00000}"; - } - } - - private void SetupRankWinnerReward() - { - if (GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.RankBattle && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.TwoPick) - { - return; - } - RankWinnerReward rankWinnerReward = GameMgr.GetIns()._rankWinnerReward; - if (rankWinnerReward == null) - { - int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE); - string value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING); - if (value != 0 && value2 != "") - { - GameMgr.GetIns()._rankWinnerReward = UIManager.GetInstance().createRankWinnerReward(); - GameMgr.GetIns()._rankWinnerReward.SetInfomation(value, value2); - GameMgr.GetIns()._rankWinnerReward.gameObject.SetActive(value: false); - rankWinnerReward = GameMgr.GetIns()._rankWinnerReward; - } - else - { - _winnerRewardRoot.SetActive(value: false); - } - } - if (rankWinnerReward != null) - { - UIManager.GetInstance().AttachAtlas(_winnerRewardRoot); - _winnerRewardNameLabel.text = rankWinnerReward.RewardString; - _winnerRewardBox.spriteName = rankWinnerReward.GetBoxSpriteName(); - _winnerRewardBox.transform.localPosition = rankWinnerReward.GetBattleMenuBoxPosition(); - _winnerRewardRoot.SetActive(value: true); - _vsRoot.SetActive(value: false); - } - } - - private void SetupDefaultButtonMenu(Action retireAction, Action settingAction, Action backAction) - { - _defaultMenuRoot.SetActive(value: true); - _questMenuRoot.SetActive(value: false); - if (Data.CurrentFormat != Format.Max && DataMgr.IsEnableFormatIconBattleType(GameMgr.GetIns().GetDataMgr().m_BattleType)) - { - _titleLine.SetActive(value: false); - _titleLineWithFormat.SetActive(value: true); - if (Data.CurrentFormat != Format.Rotation || CustomPreference.GetTextLanguage() != Global.LANG_TYPE.Jpn.ToString()) - { - _formatLabel.gameObject.SetActive(value: true); - _formatIcon.gameObject.SetActive(value: true); - _tsRotaionFormatLabel.gameObject.SetActive(value: false); - _formatLabel.text = UIUtil.GetFormatName(Data.CurrentFormat); - _formatIcon.spriteName = UIUtil.GetFormatSmallSpriteName(Data.CurrentFormat); - } - else - { - _formatLabel.gameObject.SetActive(value: false); - _formatIcon.gameObject.SetActive(value: false); - _tsRotaionFormatLabel.gameObject.SetActive(value: true); - _tsRotaionFormatLabel.text = UIUtil.GetFormatName(Data.CurrentFormat); - } - UIUtil.AddPositionY(_retireButton.transform, -5f); - } - else - { - _titleLine.SetActive(value: true); - _titleLineWithFormat.SetActive(value: false); - _formatLabel.gameObject.SetActive(value: false); - _formatIcon.gameObject.SetActive(value: false); - _tsRotaionFormatLabel.gameObject.SetActive(value: false); - } - SetButton(_retireButton, _retireButtonLabel, GetRetireButtonText(), delegate - { - UnityEngine.Object.Destroy(base.gameObject); - retireAction(); - }, Se.TYPE.SYS_BTN_DECIDE); - SetButton(_settingButton, _settingButtonLabel, Data.SystemText.Get("Common_0209"), delegate - { - UnityEngine.Object.Destroy(base.gameObject); - settingAction(); - }, Se.TYPE.SYS_BTN_DECIDE); - SetButton(_backButton, _backButtonLabel, Data.SystemText.Get("Battle_0406"), delegate - { - backAction(); - UnityEngine.Object.Destroy(base.gameObject); - }, Se.TYPE.SYS_BTN_CANCEL); - _backSpriteButton.onClick.Add(new EventDelegate(Close)); - } - - private void SetupQuestButtonMenu(Action retireAction, Action settingAction, Action backAction, Action questMissionAction) - { - _defaultMenuRoot.SetActive(value: false); - _questMenuRoot.SetActive(value: true); - SetButton(_questRetireButton, _questRetireButtonLabel, GetRetireButtonText(), delegate - { - UnityEngine.Object.Destroy(base.gameObject); - retireAction(); - }, Se.TYPE.SYS_BTN_DECIDE); - SetButton(_questSettingButton, _questSettingButtonLabel, Data.SystemText.Get("Common_0209"), delegate - { - UnityEngine.Object.Destroy(base.gameObject); - settingAction(); - }, Se.TYPE.SYS_BTN_DECIDE); - SetButton(_questBackButton, _questBackButtonLabel, Data.SystemText.Get("Battle_0406"), delegate - { - backAction(); - UnityEngine.Object.Destroy(base.gameObject); - }, Se.TYPE.SYS_BTN_CANCEL); - SetButton(_questMissionButton, _questMissionButtonLabel, Data.SystemText.Get("Quest_0013"), delegate - { - UnityEngine.Object.Destroy(base.gameObject); - questMissionAction(); - }, Se.TYPE.SYS_BTN_DECIDE); - _backSpriteButton.onClick.Add(new EventDelegate(Close)); - } - - private string GetRetireButtonText() - { - string result = Data.SystemText.Get("Common_0051"); - if (GameMgr.GetIns().IsReplayBattle) - { - result = Data.SystemText.Get("Common_0149"); - } - else if (GameMgr.GetIns().IsWatchBattle) - { - result = Data.SystemText.Get("Common_0147"); - } - return result; - } - - private void SetButton(UIButton button, UILabel label, string text, Action action, Se.TYPE se) - { - label.text = text; - button.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(se); - action(); - })); - } - - public void SetSettingButtonDisable() - { - UIManager.SetObjectToGrey(_settingButton.gameObject, b: true); - UIManager.SetObjectToGrey(_questSettingButton.gameObject, b: true); - } - - public override void Close() - { - if (_defaultMenuRoot.activeSelf) - { - EventDelegate.Execute(_backButton.onClick); - } - else if (_questMenuRoot.activeSelf) - { - EventDelegate.Execute(_questBackButton.onClick); - } - } -} diff --git a/SVSim.BattleEngine/Engine/BattlePlayer.cs b/SVSim.BattleEngine/Engine/BattlePlayer.cs index 309ad2ee..90246a3b 100644 --- a/SVSim.BattleEngine/Engine/BattlePlayer.cs +++ b/SVSim.BattleEngine/Engine/BattlePlayer.cs @@ -16,7 +16,7 @@ public class BattlePlayer : BattlePlayerBase private BattleUIContainer _battleUIContainer; - protected CanNotTouchCardVfx _canNotTouchCardVfx; + protected VfxBase _canNotTouchCardVfx; public bool _isPlayerActive; @@ -96,7 +96,7 @@ public class BattlePlayer : BattlePlayerBase PlayerEmotion = _innerOptionsBuilder.CreatePlayerEmotion((IClassBattleCardView)base.Class.BattleCardView); base.OnTurnEnd += (SkillProcessor skill) => InstantVfx.Create(delegate { - if (!GameMgr.GetIns().IsWatchBattle) + if (!BattleMgr.GameMgr.IsWatchBattle) { PlayerBattleView.TurnEndButtonUI.ChangeButtonView(base.IsSelfTurn); } @@ -107,7 +107,7 @@ public class BattlePlayer : BattlePlayerBase ITurnEndButtonUI turnEndButtonUI = PlayerBattleView.TurnEndButtonUI; if (!turnEndButtonUI.GameObject.activeSelf) { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_1, turnEndButtonUI.GetBtnPosition()); + BattleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_1, turnEndButtonUI.GetBtnPosition()); } turnEndButtonUI.GameObject.SetActive(value: true); turnEndButtonUI.EnableButton(); @@ -167,12 +167,12 @@ public class BattlePlayer : BattlePlayerBase { if (_canNotTouchCardVfx == null) { - _canNotTouchCardVfx = new CanNotTouchCardVfx(); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx); + _canNotTouchCardVfx = NullVfx.GetInstance(); + BattleMgr.VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx); } - if (GameMgr.GetIns().IsNetworkBattle) + if (BattleMgr.GameMgr.IsNetworkBattle) { - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + NetworkBattleManagerBase networkBattleManagerBase = BattleMgr as NetworkBattleManagerBase; if (networkBattleManagerBase.turnEndTimeController != null) { networkBattleManagerBase.turnEndTimeController.AddTurnEndTimerLog("TurnStart" + log); @@ -194,7 +194,7 @@ public class BattlePlayer : BattlePlayerBase public override VfxBase UsePp(int pp, bool isNewReplayMoveTurn = false) { base.UsePp(pp); - if (BattleManagerBase.IsForecast) + if (this.BattleMgr.InstanceIsForecast) { return NullVfx.GetInstance(); } @@ -218,7 +218,7 @@ public class BattlePlayer : BattlePlayerBase public override VfxBase TurnEnd() { bool flag = false; - if (BattleManagerBase.GetIns().VfxMgr.IsEnd && IsTimeOverTurnEndProcessing) + if (BattleMgr.VfxMgr.IsEnd && IsTimeOverTurnEndProcessing) { base.HandControl.RearrangeHand(0.4f, base.HandCardList.ConvertToViewList()); flag = true; @@ -267,14 +267,13 @@ public class BattlePlayer : BattlePlayerBase { TurnStartEffectEnd(); EnableBattleMenu(); - if (!GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle) + if (!BattleMgr.GameMgr.IsWatchBattle && !BattleMgr.GameMgr.IsReplayBattle) { ITurnEndButtonUI turnEndButtonUI = PlayerBattleView.TurnEndButtonUI; turnEndButtonUI.StartTurnEndCountdown(); turnEndButtonUI.ChangeButtonView(base.IsSelfTurn); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_1, turnEndButtonUI.GetBtnPosition()); + BattleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_1, turnEndButtonUI.GetBtnPosition()); } - _canNotTouchCardVfx.End(); _canNotTouchCardVfx = null; if (!IsGameFirst || Turn != 1) { @@ -295,22 +294,13 @@ public class BattlePlayer : BattlePlayerBase handCard.BattleCardView.areArrowsForcedOff = areArrowsForcedOff; handCard.BattleCardView.UpdateMovability(); } - if (base.IsSelfTurn && !GameMgr.GetIns().IsNewReplayBattle) + if (base.IsSelfTurn && !BattleMgr.GameMgr.IsNewReplayBattle) { CantPlayChoiceBrave = areArrowsForcedOff; BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); } } - private bool IsDrawing() - { - if (base.HandCardList.Count != 0) - { - return base.HandCardList[0].IsOnDraw; - } - return false; - } - public override VfxBase MoveToHand(List cardsToMoveToHand) { ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); @@ -331,7 +321,7 @@ public class BattlePlayer : BattlePlayerBase public override EffectBattle GetSkillEffect(string skillEffectPath) { - return GameMgr.GetIns().GetEffectMgr().GetEffectBattle(skillEffectPath); + return BattleMgr.GameMgr.GetEffectMgr().GetEffectBattle(skillEffectPath); } public override Vector3 GetFieldCenterPosition() diff --git a/SVSim.BattleEngine/Engine/BattlePlayerBase.cs b/SVSim.BattleEngine/Engine/BattlePlayerBase.cs index 1ec00591..3afd0267 100644 --- a/SVSim.BattleEngine/Engine/BattlePlayerBase.cs +++ b/SVSim.BattleEngine/Engine/BattlePlayerBase.cs @@ -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 SelfDiscardList = new List(); 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 PredictionWarningCards = new HashSet(); @@ -235,18 +223,10 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo public List 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 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 EvolvedCards { get; set; } public List DestroyedWhenDestroyCards { get; set; } @@ -688,8 +662,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo public IEnumerable SkillInfoGameTurnPlayCards => GameTurnPlayCards; - public IEnumerable SkillInfoGameEnhancePlayCards => GameEnhancePlayCards; - public IEnumerable SkillInfoGameCrystallizedPlayCards => ConvertToSkillInfoCollection(GameCrystallizedPlayCards); public IEnumerable SkillInfoGameSkillActivated => ConvertToSkillInfoCollection(ChoiceBraveCardList); @@ -773,20 +745,6 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo } } - public List AllCardsWithSkillIngredient - { - get - { - List list = AllCardsWithCemeteryAndBanish.ToList(); - list.AddRange(FusionIngredientList); - list.AddRange(GetOnList); - list.AddRange(UniteList); - list.AddRange(ReservedCardList); - list.AddRange(BlackHole); - return list; - } - } - public IEnumerable 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 list = new List(); - 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> 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 cardsToMoveToDeck) - { - return new MoveToDeckVfx(cardsToMoveToDeck, IsPlayer); - } - protected virtual VfxWith> LotteryRandomDrawCard(int drawCount, SkillProcessor skillProcessor) { List list = new List(); @@ -3171,7 +3054,7 @@ public abstract class BattlePlayerBase : IBattlePlayerReadOnlyInfo { return new VfxWith>(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 targetCardList, List addCountList) { List list = new List(); @@ -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 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 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 drawList, List targets, bool isPlayer, bool isOpen, bool isReserved) { this.OnTokenDrawCards.Call(owner, drawList, targets, isPlayer, isOpen, isReserved); diff --git a/SVSim.BattleEngine/Engine/BattlePlayerVfxCreatorBase.cs b/SVSim.BattleEngine/Engine/BattlePlayerVfxCreatorBase.cs index f1dfb94b..636de1a2 100644 --- a/SVSim.BattleEngine/Engine/BattlePlayerVfxCreatorBase.cs +++ b/SVSim.BattleEngine/Engine/BattlePlayerVfxCreatorBase.cs @@ -1,69 +1,32 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class BattlePlayerVfxCreatorBase : IBattlePlayerVfxCreator -{ - private readonly IBattlePlayerView m_battleView; - - public BattlePlayerVfxCreatorBase(IBattlePlayerView battleView) - { - m_battleView = battleView; - } - - public VfxBase CreateUsePp(int pp, int maxPp, Vector3 labelPosition, bool newReplayMoveTurn) - { - if (newReplayMoveTurn) - { - return ParallelVfxPlayer.Create(InstantVfx.Create(delegate - { - m_battleView.StatusParentPanel.GetComponent().SetPp(pp, maxPp, newReplayMoveTurn); - })); - } - return ParallelVfxPlayer.Create(new LoadAndPlayEffectVfx("cmn_ui_cost_1", null, labelPosition, 0f), InstantVfx.Create(delegate - { - m_battleView.StatusParentPanel.GetComponent().SetPp(pp, maxPp, newReplayMoveTurn); - })); - } - - public VfxBase CreateUseBp(int bp, int deltaBp, Func getPosition, bool isVariableCost, bool isSelf) - { - if (BattleManagerBase.GetIns().IsRecovery || isVariableCost) - { - return ParallelVfxPlayer.Create(m_battleView.SetBp(bp)); - } - string fileName = ((deltaBp < 0) ? "cmn_ui_hbp_2" : "cmn_ui_hbp_1"); - if (deltaBp < 0 && isSelf) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HBP_UP); - } - return ParallelVfxPlayer.Create(new LoadAndPlayEffectVfx(fileName, null, getPosition, 0f, BattleManagerBase.GetIns().Battle3DContainer.layer), m_battleView.SetBp(bp)); - } - - public VfxBase CreateUpdateEp(int evolCount, int evolveWaitTurnCount) - { - return new UpdateEpVfx(m_battleView, evolCount, evolveWaitTurnCount); - } - - public VfxBase CreateCardDraw(IEnumerable cards, bool isOpenDrawSkill) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - foreach (BattleCardBase card in cards) - { - if (card.BaseCost != card.Cost) - { - List costList = card.BattleCardView.GetUseCostList(card.Cost); - bool isInHand = card.IsInHand; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView.UpdateCost(costList, isGenerateInHand: true, playEffect: true, isInHand); - })); - } - } - sequentialVfxPlayer.Register(new PlayerDrawCardVfx(cards, isOpenDrawSkill)); - sequentialVfxPlayer.Register(new PlayerEndDrawVfx(cards)); - return sequentialVfxPlayer; - } -} +using System; +using System.Collections.Generic; +using UnityEngine; +using Wizard.Battle.View; +using Wizard.Battle.View.Vfx; + +public class BattlePlayerVfxCreatorBase : IBattlePlayerVfxCreator +{ + public BattlePlayerVfxCreatorBase(IBattlePlayerView battleView) + { + } + + public VfxBase CreateUsePp(int pp, int maxPp, Vector3 labelPosition, bool newReplayMoveTurn) + { + return NullVfx.GetInstance(); + } + + public VfxBase CreateUseBp(int bp, int deltaBp, Func getPosition, bool isVariableCost, bool isSelf) + { + return NullVfx.GetInstance(); + } + + public VfxBase CreateUpdateEp(int evolCount, int evolveWaitTurnCount) + { + return NullVfx.GetInstance(); + } + + public VfxBase CreateCardDraw(IEnumerable cards, bool isOpenDrawSkill) + { + return NullVfx.GetInstance(); + } +} diff --git a/SVSim.BattleEngine/Engine/BattlePlayersExtension.cs b/SVSim.BattleEngine/Engine/BattlePlayersExtension.cs deleted file mode 100644 index 3b5012d9..00000000 --- a/SVSim.BattleEngine/Engine/BattlePlayersExtension.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using Wizard.Battle; - -public static class BattlePlayersExtension -{ - public static IEnumerable AllCards(this IEnumerable battlePlayerInfos) - { - List list = new List(); - foreach (IBattlePlayerReadOnlyInfo battlePlayerInfo in battlePlayerInfos) - { - list.Add(battlePlayerInfo.SkillInfoClass); - list.AddRange(battlePlayerInfo.SkillInfoHandCards); - list.AddRange(battlePlayerInfo.SkillInfoDeckCards); - list.AddRange(battlePlayerInfo.SkillInfoInPlayCards); - list.AddRange(battlePlayerInfo.SkillInfoCemeterys); - list.AddRange(battlePlayerInfo.SkillInfoBanishCards); - list.AddRange(battlePlayerInfo.SkillInfoNecromanceZoneCards); - } - return list; - } -} diff --git a/SVSim.BattleEngine/Engine/BattleResultUIController.cs b/SVSim.BattleEngine/Engine/BattleResultUIController.cs index c784542e..89e8efd9 100644 --- a/SVSim.BattleEngine/Engine/BattleResultUIController.cs +++ b/SVSim.BattleEngine/Engine/BattleResultUIController.cs @@ -1,916 +1,22 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Battle.Recovery; - -public class BattleResultUIController : MonoBehaviour -{ - private enum MenuDialogSelect - { - None = -1, - Button1, - ButtonClose - } - - public const string BattleResultObjectPass = "Prefab/UI/BattleResult/BattleResultUI"; - - public const string RankMatchBattleResultObjectPass = "Prefab/UI/BattleResult/RankMatchBattleResultUI"; - - public const string QuestBattleResultObjectPass = "Prefab/UI/BattleResult/QuestSpecialBattleResultUI"; - - public const string ColosseumBattleResultObjectPass = "Prefab/UI/BattleResult/ColosseumBattleResultUI"; - - public const string PLUS_STRING = "+"; - - public static readonly Color PLUS_START_COLOR = new Color32(byte.MaxValue, 192, 0, 0); - - public static readonly Color PLUS_END_COLOR = new Color32(byte.MaxValue, 192, 0, byte.MaxValue); - - public static readonly Color MINUS_START_COLOR = new Color32(128, 192, byte.MaxValue, 0); - - public const float GAUGEUP_DURATION = 0.5f; - - public const float GAUGEUP_DELAY = 0.5f; - - public const float GAUGEUP_LABEL_DURATION = 0.3f; - - public const float GAUGEUP_LABEL_MOVE_DISTANCE = 10f; - - public const float GAUGEUP_LABEL_DISAPPEAR_DURATION = 0.5f; - - public const float GAUGEUP_LABEL_DISAPPEAR_DELAY = 0.5f; - - [SerializeField] - public RankMatchBattleResult RankMatchBattleResultObject; - - [SerializeField] - public QuestSpecialBattleResult QuestBattleResultObject; - - [SerializeField] - private GameObject _battlePassResultPanel; - - [SerializeField] - private Transform _acncorNoneRoot; - - [SerializeField] - private UISprite _backGroundWithRank; - - [SerializeField] - private UISprite _backGroundNotNeedRank; - - [Header("共通")] - [SerializeField] - public UIPanel MainPanel; - - [SerializeField] - public NguiObjs ClassCharObj; - - [SerializeField] - public UITexture Bg; - - [SerializeField] - public UISprite ArcaneIn; - - [SerializeField] - public UISprite ArcaneOut; - - [SerializeField] - public UISprite ResultTitle; - - [Header("クラス情報")] - [SerializeField] - public GameObject ClassInfo; - - [SerializeField] - private ClassInfoParts _classInfoParts; - - [SerializeField] - private UITexture ClassLvImg; - - [SerializeField] - private UILabel ClassLvLabel; - - [SerializeField] - private UIGauge ClassGaugeBar; - - [SerializeField] - private ParticleSystem ClassGaugeEfc; - - [SerializeField] - public UILabel ClassExpAddLabel; - - [SerializeField] - private UILabel ClassExpNextTitle; - - [SerializeField] - private UILabel ClassExpNextLabel; - - [Header("下部ボタン")] - [SerializeField] - public UIAnchor AnchorBottom; - - [SerializeField] - public UIGrid ButtonGrid; - - [SerializeField] - public NguiObjs MissionBtnObj; - - [SerializeField] - public NguiObjs HomeBtnObj; - - [SerializeField] - public NguiObjs RetryBtnObj; - - [SerializeField] - public NguiObjs ReportBtnObj; - - [Header("タイトル画像")] - [SerializeField] - private GameObject _titleRoot; - - [SerializeField] - public UISprite TitleWin; - - [SerializeField] - public UISprite TitleLose; - - [SerializeField] - public UISprite TitleDraw; - - [SerializeField] - public UISprite TitleMatch; - - [Header("通知表示")] - [SerializeField] - public NguiObjs ResultInfo; - - [SerializeField] - private GameObject _notificationAnimationParent; - - [SerializeField] - private NotificatonAnimation _notificationAnimationPrefab; - - [SerializeField] - private UISprite _battlePassBG; - - private string _resultTypeMsg = ""; - - [SerializeField] - private GameObject m_MissionBase; - - public IDictionary DefaultPosDict = new Dictionary(); - - private int _classLv; - - private int _classLvPrev; - - private int _classLvMax; - - private int _classExp; - - private int _nowClassExp; - - private int _nextClassExp; - - private IList _missionLogList = new List(); - - private int _beforeClassExp; - - private IList _classExpList = new List(); - - private bool _isResultTutorial; - - private bool _isUsingSpecialDeck; - - private int _usingSpecialDeckClassId; - - private List _resultAssetList = new List(); - - private INextSceneSelector _nextSceneSelector; - - [NonSerialized] - public IBattleResultReporter resultReporter; - - private IResultAnimationHandler resultAnimationHandler; - - public const int MISSION_SPRITE_WIDTH = 800; - - private const int MISSION_MARGIN = 24; - - private const string MAINTENANCE_TIME_KEY = "maintenance_time"; - - private int _selectedClassId; - - private NotificatonAnimation _notificationAnimation; - - [SerializeField] - private GameObject _missionSelect; - - [SerializeField] - private GameObject _retrySelect; - - [SerializeField] - private GameObject _homeSelect; - - private const int MISSION_SELECT = 0; - - private const int RETRY_SELECT = 1; - - private const int HOME_SELECT = 2; - - public DialogBase _missionDialog; - - private MenuDialogSelect _menuDialogSelect = MenuDialogSelect.None; - - [NonSerialized] - public bool IsRewardWait; - - public bool ResultMsgWindowFlag { get; private set; } - - public bool ResultMsgReportBtnFlag { get; private set; } - - public bool IsWin { get; set; } - - public int AddClassExp { get; private set; } - - public bool IsDraw { get; private set; } - - public bool IsResultOn { get; private set; } - - public bool AlreadyResultRecovery { get; set; } - - public bool GreySpriteBGVisible - { - set - { - _battlePassBG.gameObject.SetActive(value); - } - } - - public IBattleResultReporter ResultReporter => resultReporter; - - public event Action OnResultFinish; - - private void OnDestroy() - { - VideoHostingUtil.SetHUDScene(VideoHostingUtil.HUDScene.Home); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_RESULT_BACK_1); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_RESULT_BACK_2); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_RESULT_BACK_3); - if (resultAnimationHandler != null) - { - resultAnimationHandler.Destroy(); - } - if (GameMgr.GetIns()._rankWinnerReward != null) - { - GameMgr.GetIns()._rankWinnerReward.RemoveObject(); - GameMgr.GetIns()._rankWinnerReward = null; - } - } - - private void Start() - { - _titleRoot.SetActive(value: true); - IsResultOn = false; - DefaultPosDict["ClassCharObj"] = ClassCharObj.transform.localPosition; - DefaultPosDict["ResultTitle"] = ResultTitle.transform.localPosition; - DefaultPosDict["ClassInfo"] = ClassInfo.transform.localPosition; - DefaultPosDict["ButtonGrid"] = ButtonGrid.transform.localPosition; - MainPanel.alpha = 0f; - TitleMatch.alpha = 0f; - Toolbox.AudioManager.AddCueSheet("bgm_btl_jingle", "bgm_btl_jingle.acb", "b/", "bgm_btl_jingle.awb"); - ButtonGrid.gameObject.SetActive(value: false); - IsDraw = false; - base.gameObject.SetActive(value: false); - if (RankMatchBattleResultObject != null) - { - RankMatchBattleResultObject.Init(); - } - if (QuestBattleResultObject != null) - { - QuestBattleResultObject.Init(); - } - } - - public void StartUI(bool win, BattleCamera battleCamera) - { - base.gameObject.SetActive(value: true); - if (IsResultOn) - { - return; - } - IsResultOn = true; - Toolbox.AudioManager.AddCueSheet("bgm_btl_jingle", "bgm_btl_jingle.acb", "b/", "bgm_btl_jingle.awb"); - VideoHostingUtil.SetHUDScene(VideoHostingUtil.HUDScene.BattleResult); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - int skinId = dataMgr.GetPlayerSkinId(); - bool isEvolve = BattleManagerBase.GetIns().BattlePlayer.IsSkinEvolved; - if (!BattleManagerBase.IsTutorial) - { - if (win) - { - _resultAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(skinId.ToString("00"), isEvolve ? ResourcesManager.AssetLoadPathType.ClassCharaEvolveWin : ResourcesManager.AssetLoadPathType.ClassCharaBaseWin)); - string text = dataMgr.GetPlayerEmotionData()[ClassCharaPrm.EmotionType.WIN].GetVoiceId(isEvolve); - if (BattleManagerBase.GetIns().IsPuzzleMgr) - { - string clearVoiceId = (BattleManagerBase.GetIns() as PuzzleBattleManager).PuzzleQuestData.ClearVoiceId; - if (!string.IsNullOrEmpty(clearVoiceId)) - { - text = clearVoiceId; - } - } - _ = isEvolve; - _resultAssetList.Add("v/vo_" + text + ".acb"); - } - else - { - _resultAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(skinId.ToString("00"), isEvolve ? ResourcesManager.AssetLoadPathType.ClassCharaEvolveLose : ResourcesManager.AssetLoadPathType.ClassCharaBaseLose)); - _resultAssetList.Add("v/vo_" + dataMgr.GetPlayerEmotionData()[ClassCharaPrm.EmotionType.LOSE].GetVoiceId(isEvolve) + ".acb"); - } - } - if (dataMgr.IsFormatEnableBattleType()) - { - int num = PlayerStaticData.UserRankCurrentFormat(); - _resultAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(num.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L)); - } - List list = new List(); - list.Add(ClassGaugeEfc.gameObject); - if (RankMatchBattleResultObject != null) - { - list.Add(RankMatchBattleResultObject.RankGaugeEfc.gameObject); - } - if (QuestBattleResultObject != null) - { - list.Add(QuestBattleResultObject.QuestPointGaugeEffect.gameObject); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list, delegate - { - GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectResultData", isBattle: true, isField: false, isBattleEffect: true, delegate - { - Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(_resultAssetList, delegate - { - Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(_resultAssetList); - IsWin = win; - DataMgr.BattleType battleType = dataMgr.m_BattleType; - if (battleType == DataMgr.BattleType.Story && Data.SelectedStoryInfo.IsTutorialCategory) - { - _isResultTutorial = true; - _nextSceneSelector = new TutorialNextSceneSelector(this); - resultReporter = new TutorialResultReporter(); - resultAnimationHandler = new TutorialResultAnimationHandler(battleCamera); - } - else - { - ResourcesManager.AssetLoadPathType type = ((!isEvolve) ? (IsWin ? ResourcesManager.AssetLoadPathType.ClassCharaBaseWin : ResourcesManager.AssetLoadPathType.ClassCharaBaseLose) : (IsWin ? ResourcesManager.AssetLoadPathType.ClassCharaEvolveWin : ResourcesManager.AssetLoadPathType.ClassCharaEvolveLose)); - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(skinId.ToString("00"), type, isfetch: true)) as Texture; - ClassCharObj.textures[0].mainTexture = mainTexture; - _classInfoParts.InitByCharaPrm(dataMgr.GetPlayerCharaData()); - ClassLvImg.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(dataMgr.GetPlayerClassId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaIconLevel, isfetch: true)) as Texture; - if (battleType == DataMgr.BattleType.TwoPick) - { - _isUsingSpecialDeck = true; - if (Data.TwoPickInfo.deckInfo != null) - { - _usingSpecialDeckClassId = Data.TwoPickInfo.deckInfo.classId; - } - else - { - _usingSpecialDeckClassId = Data.BattleRecoveryInfo.chara_id; - } - } - SetResultFunc(battleCamera); - } - ResultSetupEnd(); - }); - }); - }, isBattle: true); - } - - private void SetResultFunc(BattleCamera battleCamera) - { - if (GameMgr.GetIns().IsReplayBattle) - { - _nextSceneSelector = new NullNextSceneSelector(this); - resultReporter = new RoomMatchResultReporter(); - resultAnimationHandler = new RoomMatchResultAnimationHandler(battleCamera); - return; - } - switch (GameMgr.GetIns().GetDataMgr().m_BattleType) - { - case DataMgr.BattleType.FreeBattle: - _nextSceneSelector = new NetworkMatchNextSceneSelector(this); - resultReporter = new FreeMatchResultReporter(); - resultAnimationHandler = new FreeMatchResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.RankBattle: - _nextSceneSelector = new NetworkMatchNextSceneSelector(this); - resultReporter = new RankMatchResultReporter(); - resultAnimationHandler = new RankMatchResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.Practice: - if (GameMgr.GetIns().IsPuzzleQuest) - { - _nextSceneSelector = new PracticePuzzleNextSceneSelector(this); - resultReporter = new PracticePuzzleResultReporter(); - resultAnimationHandler = new PracticeResultAnimationHandler(battleCamera); - } - else - { - _nextSceneSelector = new PracticeNextSceneSelector(this); - resultReporter = new PracticeResultReporter(); - resultAnimationHandler = new PracticeResultAnimationHandler(battleCamera); - } - break; - case DataMgr.BattleType.ColosseumNormal: - case DataMgr.BattleType.ColosseumTwoPick: - case DataMgr.BattleType.ColosseumHof: - case DataMgr.BattleType.ColosseumWindFall: - case DataMgr.BattleType.ColosseumAvatar: - _nextSceneSelector = new ArenaNextSceneSelector(this); - resultReporter = new ColosseumResultReporter(); - resultAnimationHandler = new ColosseumResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.CompetitionNormal: - case DataMgr.BattleType.CompetitionTwoPick: - _nextSceneSelector = new ArenaNextSceneSelector(this); - resultReporter = new CompetitionResultReporter(); - resultAnimationHandler = new CompetitionResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.TwoPick: - case DataMgr.BattleType.Sealed: - _nextSceneSelector = new ArenaNextSceneSelector(this); - resultReporter = new ArenaResultReporter(); - resultAnimationHandler = new ArenaResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.RoomBattle: - case DataMgr.BattleType.RoomTwoPick: - case DataMgr.BattleType.TwoPickBackdraft: - _nextSceneSelector = new NullNextSceneSelector(this); - resultReporter = new RoomMatchResultReporter(); - resultAnimationHandler = new RoomMatchResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.Story: - _nextSceneSelector = new StoryNextSceneSelector(this); - resultReporter = new StoryResultReporter(); - resultAnimationHandler = new StoryResultAnimationHandler(battleCamera); - break; - case DataMgr.BattleType.Quest: - case DataMgr.BattleType.BossRushQuest: - case DataMgr.BattleType.SecretBossQuest: - _nextSceneSelector = new QuestNextSceneSelector(this); - resultReporter = new QuestResultReporter(); - resultAnimationHandler = new QuestSpecialResultAnimationHandler(battleCamera, GetComponent()); - break; - } - if (BattleManagerBase.GetIns().IsPuzzleMgr && !IsWin) - { - _nextSceneSelector = new NullNextSceneSelector(this); - } - } - - private void ResultSetupEnd() - { - _nextSceneSelector.Setup(IsWin, base.gameObject); - ClassCharObj.transform.localPosition = DefaultPosDict["ClassCharObj"] + Vector3.right * 1200f; - ResultTitle.transform.localPosition = DefaultPosDict["ResultTitle"] + Vector3.up * 500f; - ClassInfo.transform.localPosition = DefaultPosDict["ClassInfo"] + Vector3.left * 2000f; - ButtonGrid.transform.localPosition = DefaultPosDict["ButtonGrid"] + Vector3.down * 200f; - for (int i = 0; i < _missionLogList.Count; i++) - { - _missionLogList[i].gameObject.SetActive(value: false); - } - ClassCharObj.gameObject.SetActive(value: true); - ResultTitle.gameObject.SetActive(value: true); - ClassInfo.gameObject.SetActive(value: true); - ButtonGrid.gameObject.SetActive(value: true); - ArcaneIn.transform.localScale = Vector3.one * 0.01f; - ArcaneOut.transform.localScale = Vector3.one * 0.01f; - ArcaneIn.alpha = 0f; - ArcaneOut.alpha = 0f; - ClassExpAddLabel.alpha = 0f; - ResultInfo.labels[0].alpha = 0f; - ResultInfo.sprites[0].alpha = 0f; - ButtonGrid.repositionNow = true; - ClassExpNextTitle.text = Data.SystemText.Get("Battle_0205"); - Format format = Data.CurrentFormat; - if (GameMgr.GetIns().GetDataMgr().IsDipslayHighRankFormat()) - { - format = PlayerStaticData.HighRankFormat(); - } - if (format == Format.PreRotation) - { - format = Format.Rotation; - } - if (GameMgr.GetIns().IsWatchBattle) - { - resultReporter.Destroy(); - StartCoroutine(resultAnimationHandler.m_resultAnimationAgent.RunUI(this, _nextSceneSelector, IsWin)); - } - else - { - StartCoroutine(GetServerData()); - } - if (RankMatchBattleResultObject != null) - { - RankMatchBattleResultObject.ResultSetupEnd(format); - } - if (QuestBattleResultObject != null) - { - QuestBattleResultObject.ResultSetupEnd(format); - } - } - - public void SetBattlePassGauge(Action completeAction) - { - if (_battlePassResultPanel == null || !PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.BATTLE_PASS_SHOW_RESULT) || !resultReporter.IsDataExist) - { - completeAction(); - return; - } - JsonData finishResponseData = resultReporter.GetFinishResponseData(); - if (finishResponseData != null && finishResponseData["data"].Keys.Contains("battle_pass_gauge_info")) - { - BattlePassGaugeInfo battlePassGaugeInfo = new BattlePassGaugeInfo(finishResponseData["data"]["battle_pass_gauge_info"]); - if (battlePassGaugeInfo.IsMaxPoint && battlePassGaugeInfo.IsBeforeMaxPoint) - { - completeAction(); - return; - } - GreySpriteBGVisible = true; - BattlePassResultPanel component = UnityEngine.Object.Instantiate(_battlePassResultPanel, _acncorNoneRoot).GetComponent(); - component.Initialize(battlePassGaugeInfo); - component.SetPointupAnimation(completeAction); - } - else - { - completeAction(); - } - } - - public void CreateMissionList() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(systemText.Get("Mission_0003")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.ScrollView.transform.DestroyChildren(); - dialogBase.ScrollView.panel.leftAnchor.absolute = 24; - dialogBase.ScrollView.panel.rightAnchor.absolute = -24; - GameObject gameObject = new GameObject("table"); - dialogBase.ScrollView.contentPivot = UIWidget.Pivot.Top; - dialogBase.AttachToScrollView(gameObject.transform); - UITable uITable = gameObject.AddComponent(); - uITable.columns = 1; - uITable.keepWithinPanel = true; - uITable.cellAlignment = UIWidget.Pivot.Center; - uITable.pivot = UIWidget.Pivot.Center; - ResourceHandler resourceHandler = base.gameObject.AddMissingComponent(); - int count = Data.MissionInfo.data.user_mission_list.Count; - for (int i = 0; i < Data.MissionInfo.data.user_mission_list.Count; i++) - { - UserMission mission = Data.MissionInfo.data.user_mission_list[i]; - GameObject obj = UnityEngine.Object.Instantiate(m_MissionBase); - obj.transform.parent = uITable.transform; - obj.transform.localPosition = Vector3.zero; - obj.transform.localScale = Vector3.one; - obj.SetActive(value: true); - obj.GetComponent().width = 800; - obj.GetComponent().SetMission(mission, resourceHandler, canChangeMissions: false, i != count - 1, displayChange: false); - } - _missionDialog = dialogBase; - StartCoroutine(ResetMissionScrollPos(dialogBase.ScrollView)); - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - private IEnumerator ResetMissionScrollPos(UIScrollView scroll) - { - yield return new WaitForSeconds(0.1f); - scroll.ResetPosition(); - } - - private IEnumerator GetServerData() - { - LocalLog.AccumulateLastTraceLog("GetServerData "); - LocalLog.SendClientInfoTraceLog(delegate - { - resultReporter.Report(IsWin); - }); - while (!resultReporter.IsEnd) - { - yield return null; - } - LocalLog.AccumulateLastTraceLog("GetServerData ReporterEnd"); - if (!resultReporter.IsDataExist) - { - Toolbox.NetworkManager.NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_3502"), Data.SystemText.Get("Error_3502"), ""); - yield break; - } - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - if (RankMatchBattleResultObject != null) - { - RankMatchBattleResultObject.GetServerData(); - } - if (QuestBattleResultObject != null) - { - QuestBattleResultObject.GetServerData(resultReporter); - } - if (dataMgr.IsColosseumBattleType()) - { - SetBackGroundNeedBattlePoint(needBattlePoint: false); - } - GameMgr.GetIns().GetDataMgr().CacheSingleRecovryData(); - RecoveryRecordManagerBase.DeleteRecoveryFile(); - AddClassExp = resultReporter.ClassExp; - resultReporter.Destroy(); - if (!_isResultTutorial) - { - if (_isUsingSpecialDeck) - { - _selectedClassId = ((_usingSpecialDeckClassId != 0) ? _usingSpecialDeckClassId : dataMgr.GetPlayerClassId()); - } - else - { - _selectedClassId = dataMgr.GetPlayerClassId(); - } - _beforeClassExp = dataMgr.GetClassPrm(_selectedClassId).GetClassCharaExp(); - } - _classExpList.Clear(); - for (int num = 0; num < Data.Load.data._classCharaExpList.Count; num++) - { - _classExpList.Add(Data.Load.data._classCharaExpList[num].necessary_exp); - } - _classLvMax = _classExpList.Count; - SetClassExp(0, isLvUpCheck: false); - _classLvPrev = _classLv; - StartCoroutine(resultAnimationHandler.m_resultAnimationAgent.RunUI(this, _nextSceneSelector, IsWin)); - } - - public void PrepareAchievementLog() - { - if (GameMgr.GetIns().IsWatchBattle) - { - return; - } - List list = new List(); - JsonData finishResponseData = resultReporter.GetFinishResponseData(); - if (finishResponseData != null && finishResponseData["data"].Keys.Contains("maintenance_time")) - { - DateTime dateTime = DateTime.Parse(finishResponseData["data"]["maintenance_time"].ToString()); - list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.MaintenanceOnResult, Data.SystemText.Get("System_0044", ConvertTime.ToLocal(dateTime)))); - } - if (finishResponseData != null && finishResponseData["data"].Keys.Contains("gathering_notification")) - { - string valueOrDefault = finishResponseData["data"]["gathering_notification"].GetValueOrDefault("matching_established_message", string.Empty); - if (!string.IsNullOrEmpty(valueOrDefault)) - { - list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.GatheringMatching, valueOrDefault)); - } - } - for (int i = 0; i < resultReporter.UserMission.Count; i++) - { - list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.Result, resultReporter.UserMission[i].achieved_message)); - } - for (int j = 0; j < resultReporter.UserAchievement.Count; j++) - { - list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.Result, resultReporter.UserAchievement[j].achieved_message)); - } - StartCoroutine(ShowAchieveLog(list)); - } - - public void RewardCheck() - { - IsRewardWait = false; - } - - public void FinishResult() - { - this.OnResultFinish.Call(); - } - - public void SettingAddClassExpTextAnimation() - { - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", AddClassExp, "time", 0.5f, "delay", 0.5f, "onstart", "StartClassExp", "onupdate", "UpdateClassExp", "oncomplete", "CompleteClassExp", "easetype", iTween.EaseType.easeOutQuad)); - bool flag = AddClassExp >= 0; - ClassExpAddLabel.text = (flag ? "+" : string.Empty) + AddClassExp; - ClassExpAddLabel.color = (flag ? PLUS_START_COLOR : MINUS_START_COLOR); - TweenAlpha.Begin(ClassExpAddLabel.gameObject, 0.3f, 1f); - iTween.MoveFrom(ClassExpAddLabel.gameObject, iTween.Hash("y", ClassExpAddLabel.transform.localPosition.y - 10f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void StartClassExp() - { - ClassGaugeEfc.gameObject.SetActive(value: true); - ClassGaugeEfc.Play(); - } - - private void UpdateClassExp(int num) - { - SetClassExp(num, isLvUpCheck: true); - } - - public void SetClassExp(int num, bool isLvUpCheck) - { - _classExp = _beforeClassExp + num; - _classLv = GetClassLv(_classExp); - _nowClassExp = GetClassExpNow(_classExp); - _nextClassExp = Mathf.Max(0, _classExpList[_classLv - 1] - _nowClassExp); - ClassLvLabel.text = _classLv.ToString(); - ClassExpNextLabel.text = _nextClassExp.ToString(); - if (AddClassExp >= 0) - { - ClassExpAddLabel.text = ((AddClassExp - num >= 0) ? "+" : "") + (AddClassExp - num); - } - else - { - ClassExpAddLabel.text = (AddClassExp - num).ToString(); - } - ClassGaugeBar.Value = (((float)_classExpList[_classLv - 1] >= 0f) ? Mathf.Min((float)_nowClassExp / (float)_classExpList[_classLv - 1], 1f) : 1f); - if (isLvUpCheck && _classLv > _classLvPrev) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_LVUP_1, ClassLvImg.transform.position); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, ClassGaugeBar.GetTransformGaugeStartEdge().position); - _classLvPrev = _classLv; - } - } - - private void CompleteClassExp() - { - ClassGaugeEfc.Stop(); - TweenAlpha.Begin(ClassExpAddLabel.gameObject, 0.5f, 0f).delay = 0.5f; - SetClassLvAndExp(); - } - - public void SetClassLvAndExp() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - switch (dataMgr.m_BattleType) - { - case DataMgr.BattleType.FreeBattle: - _classLv = Data.FreeMatchFinish.data.class_chara_level; - _classExp = Data.FreeMatchFinish.data.class_chara_experience; - break; - case DataMgr.BattleType.RankBattle: - _classLv = Data.RankMatchFinish.data.class_chara_level; - _classExp = Data.RankMatchFinish.data.class_chara_experience; - break; - case DataMgr.BattleType.Story: - _classLv = Data.StoryFinish.data.class_chara_level; - _classExp = Data.StoryFinish.data.class_chara_experience; - break; - case DataMgr.BattleType.Practice: - _classLv = Data.PracticeFinish.data.class_chara_level; - _classExp = Data.PracticeFinish.data.class_chara_experience; - break; - case DataMgr.BattleType.RoomBattle: - _classLv = Data.FreeMatchFinish.data.class_chara_level; - _classExp = Data.FreeMatchFinish.data.class_chara_experience; - break; - case DataMgr.BattleType.Quest: - case DataMgr.BattleType.BossRushQuest: - case DataMgr.BattleType.SecretBossQuest: - _classLv = Data.QuestFinish.data.class_chara_level; - _classExp = Data.QuestFinish.data.class_chara_experience; - break; - } - ClassCharaPrm classPrm = dataMgr.GetClassPrm(_selectedClassId); - classPrm.SetClassCharaLv(_classLv); - classPrm.SetClassCharaExp(_classExp); - } - - private int GetClassLv(int num) - { - int num2 = 1; - int num3 = 0; - for (int i = 0; i < _classExpList.Count; i++) - { - num3 += _classExpList[i]; - if (num < num3) - { - break; - } - num2++; - } - return Mathf.Min(num2, _classLvMax); - } - - private int GetClassExpNow(int num) - { - int num2 = num; - for (int i = 0; i < _classExpList.Count && num2 >= _classExpList[i]; i++) - { - num2 -= _classExpList[i]; - } - return num2; - } - - private IEnumerator ShowAchieveLog(List paramList) - { - if (_notificationAnimation != null) - { - UnityEngine.Object.Destroy(_notificationAnimation.gameObject); - _notificationAnimation = null; - } - _notificationAnimation = NGUITools.AddChild(_notificationAnimationParent, _notificationAnimationPrefab.gameObject).GetComponent(); - yield return StartCoroutine(_notificationAnimation.Exec(paramList)); - } - - public void SetSpecialResultTypeText(string text) - { - _resultTypeMsg = text; - ResultMsgWindowFlag = true; - } - - public void SetBattleFinishConsistency() - { - IsDraw = true; - ResultMsgReportBtnFlag = true; - } - - public IEnumerator ShowSpecialResultInfo() - { - ResultInfo.labels[0].text = _resultTypeMsg; - ResultInfo.labels[0].alpha = 0f; - ResultInfo.sprites[0].alpha = 0f; - ResultInfo.labels[0].transform.localPosition = Vector3.right * 200f; - ResultInfo.sprites[0].transform.localScale = new Vector3(0.01f, 0.1f, 1f); - TweenAlpha.Begin(ResultInfo.sprites[0].gameObject, 0.2f, 1f); - iTween.ScaleTo(ResultInfo.sprites[0].gameObject, iTween.Hash("scale", new Vector3(1f, 0.1f, 1f), "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - iTween.ScaleTo(ResultInfo.sprites[0].gameObject, iTween.Hash("scale", Vector3.one, "time", 0.5f, "delay", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutBack)); - yield return new WaitForSeconds(0.5f); - TweenAlpha.Begin(ResultInfo.labels[0].gameObject, 0.2f, 1f); - iTween.MoveTo(ResultInfo.labels[0].gameObject, iTween.Hash("position", Vector3.zero, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(2f); - TweenAlpha.Begin(ResultInfo.sprites[0].gameObject, 0.1f, 0f).delay = 0.2f; - TweenAlpha.Begin(ResultInfo.labels[0].gameObject, 0.1f, 0f).delay = 0.2f; - iTween.ScaleTo(ResultInfo.sprites[0].gameObject, iTween.Hash("scale", new Vector3(1f, 0.1f, 1f), "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.MoveTo(ResultInfo.labels[0].gameObject, iTween.Hash("position", Vector3.left * 200f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - } - - public void Recovery() - { - ClassInfo.SetActive(value: false); - ClassInfo.SetActive(value: true); - } - - public IEnumerator RunMatch() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_BEGIN); - TweenAlpha.Begin(TitleMatch.gameObject, 0.2f, 1f); - TitleMatch.transform.localScale = Vector3.one * 10f; - iTween.ScaleTo(TitleMatch.gameObject, iTween.Hash("scale", Vector3.one * 0.8f, "time", 0.2f, "easetype", iTween.EaseType.easeInQuad)); - yield return new WaitForSeconds(0.2f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_MATCH_1, Vector3.back); - TitleMatch.transform.localScale = Vector3.one; - iTween.ScaleTo(TitleMatch.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 3f, "easetype", iTween.EaseType.linear)); - yield return new WaitForSeconds(2.5f); - TweenAlpha.Begin(TitleMatch.gameObject, 0.3f, 0f); - iTween.ScaleTo(TitleMatch.gameObject, iTween.Hash("scale", Vector3.one * 10f, "time", 0.3f, "easetype", iTween.EaseType.easeInExpo)); - yield return new WaitForSeconds(0.3f); - } - - private void Update() - { - if (_missionDialog != null) - { - MenuDialogUpdate(_missionDialog); - } - } - - private void MenuDialogUpdate(DialogBase dialog) - { - InputMgr inputMgr = GameMgr.GetIns().GetInputMgr(); - if (inputMgr.IsKeyboardCancel()) - { - _missionDialog.CloseWithoutSelect(); - _menuDialogSelect = MenuDialogSelect.None; - } - bool flag = false; - if (inputMgr.IsKeyboardLeftArrow() || inputMgr.IsKeyboardRightArrow()) - { - _menuDialogSelect = ((_menuDialogSelect == MenuDialogSelect.Button1) ? MenuDialogSelect.ButtonClose : MenuDialogSelect.Button1); - flag = true; - } - if (flag) - { - dialog.KeyboardSelectButton(DialogBase.KeyboardDialogSelect.Button1, _menuDialogSelect == MenuDialogSelect.Button1); - dialog.KeyboardSelectButton(DialogBase.KeyboardDialogSelect.CloseButton, _menuDialogSelect == MenuDialogSelect.ButtonClose); - } - if (inputMgr.IsKeyboardEnter() && _menuDialogSelect != MenuDialogSelect.None) - { - _missionDialog.CloseWithoutSelect(); - _menuDialogSelect = MenuDialogSelect.None; - } - } - - public void SetBackGroundNeedBattlePoint(bool needBattlePoint) - { - _backGroundWithRank.gameObject.SetActive(needBattlePoint); - _backGroundNotNeedRank.gameObject.SetActive(!needBattlePoint); - } -} +using UnityEngine; + +// PASS-8/Phase-1 STUB: 776-line client-side battle-result UI. Held on BattleManagerBase +// as `public BattleResultUIController BattleResultControl` and carried into 6 NextSceneSelector +// variants (Arena/Colosseum/FreeMatch/NetworkMatch/Practice/Null) + 3 ResultAnimationAgent +// subclasses. Headless never runs the result screen; all instance-method calls happen on the +// null field (mgr.BattleResultControl stays null in headless). Reduced to the compile-time +// surface the ctor-params + external touches require. The 3 static color constants and 6 +// externally-touched members (TitleWin, TitleLose, IsResultOn, AlreadyResultRecovery, +// StartUI, SetSpecialResultTypeText) are kept as no-op/default returns. +public class BattleResultUIController : MonoBehaviour +{ + + public UISprite TitleWin; + public UISprite TitleLose; + + public bool IsResultOn { get; private set; } + public bool AlreadyResultRecovery { get; set; } + + public void StartUI(bool win, BattleCamera battleCamera) { } + public void SetSpecialResultTypeText(string text) { } +} diff --git a/SVSim.BattleEngine/Engine/BattleSettingData.cs b/SVSim.BattleEngine/Engine/BattleSettingData.cs index 0e6e4c82..5d0a4acd 100644 --- a/SVSim.BattleEngine/Engine/BattleSettingData.cs +++ b/SVSim.BattleEngine/Engine/BattleSettingData.cs @@ -41,8 +41,7 @@ public class BattleSettingData int num = jsonData["deck_skin_id_override"].ToInt(); if (num == 0) { - return GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(deckClassId, isCurrentChara: false) - .skin_id; + return 0; // Pre-Phase-5b: no chara master headless } return num; } @@ -56,8 +55,7 @@ public class BattleSettingData } if (baseCharaId == 0) { - return GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(classId, isCurrentChara: false) - .chara_id; + return 0; // Pre-Phase-5b: no chara master headless } return baseCharaId; } @@ -106,8 +104,7 @@ public class BattleSettingData private static string GetEmotionId(int charaId, int? variationId) { - int skin_id = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(charaId) - .skin_id; + int skin_id = 0; // Pre-Phase-5b: no chara master headless if (!variationId.HasValue) { return $"{skin_id}"; diff --git a/SVSim.BattleEngine/Engine/BattleStageChoiceObject.cs b/SVSim.BattleEngine/Engine/BattleStageChoiceObject.cs deleted file mode 100644 index 0a7a6f1c..00000000 --- a/SVSim.BattleEngine/Engine/BattleStageChoiceObject.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using UnityEngine; - -public class BattleStageChoiceObject : MonoBehaviour -{ - [SerializeField] - private UIButton _button; - - [SerializeField] - private UITexture _texture; - - [SerializeField] - private GameObject _offObject; - - public Action _onButton; - - public void Init() - { - UIEventListener.Get(_button.gameObject).onClick = null; - UIEventListener uIEventListener = UIEventListener.Get(_button.gameObject); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate - { - _onButton(); - }); - } - - public void SettingOffSelect(bool isOff) - { - _offObject.gameObject.SetActive(isOff); - } - - public void SettingTexture(Texture texture) - { - _texture.mainTexture = texture; - } -} diff --git a/SVSim.BattleEngine/Engine/BattleStageChoiceWindow.cs b/SVSim.BattleEngine/Engine/BattleStageChoiceWindow.cs deleted file mode 100644 index 70b4c797..00000000 --- a/SVSim.BattleEngine/Engine/BattleStageChoiceWindow.cs +++ /dev/null @@ -1,468 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class BattleStageChoiceWindow : MonoBehaviour -{ - public class PageData - { - public readonly GameObject Obj; - - public BattleStageChoiceObject[] StageList; - - public PageData(BattleStageChoiceObject[] stageList, GameObject obj) - { - StageList = stageList; - Obj = obj; - } - } - - public class StageData - { - public GameObject StageDataObject; - - public string TextureName; - - public StageData(GameObject obj, string textureName) - { - StageDataObject = obj; - TextureName = textureName; - } - } - - private bool _initializeEnd; - - [SerializeField] - private UIButton _leftButton; - - [SerializeField] - private UIButton _rightButton; - - [SerializeField] - private UIButton _allOffButton; - - [SerializeField] - private BoxCollider _flickCollider; - - [SerializeField] - private UIGrid _radioIconsGrid; - - [SerializeField] - private UIGrid _deckTableOriginal; - - [SerializeField] - private GameObject _deckTableRoot; - - private List _stagePageList = new List(); - - [SerializeField] - private BattleStageChoiceObject _battleTageSelectOriginal; - - [SerializeField] - private UISprite _radioIconOriginal; - - [SerializeField] - private GameObject _allOnLabel; - - [SerializeField] - private GameObject _allOffLabel; - - private int _currentPage; - - private bool _isChangePage; - - private float _timeChangePage; - - private List _radioIconClones; - - private List _pageList = new List(); - - private int _maxSelectStageNum; - - private bool _isScroll = true; - - private int _loadDoneStageTextureNum; - - private const int MAXNUM_STAGE_PER_TABLE = 9; - - private List _loadedResourceList = new List(); - - public bool[] SettingOffStageIndexs { get; private set; } - - public Action OnAllOff { get; set; } - - private void Update() - { - if (_isChangePage) - { - _timeChangePage += Time.deltaTime; - if (_timeChangePage >= 0.2f) - { - _isChangePage = false; - _timeChangePage = 0f; - } - } - } - - public IEnumerator LoadResource(Action onLoadEnd) - { - UIManager.GetInstance().createInSceneCenterLoading(); - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - for (int i = 0; i < Data.Load.data.OpenBattleFieldIdList.Count; i++) - { - string path = "BattleStage_" + int.Parse(Data.Load.data.OpenBattleFieldIdList[i]).ToString("00"); - _loadedResourceList.Add(resourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.BattlePass)); - } - yield return StartCoroutine(resourcesManager.LoadAssetGroupAsync(_loadedResourceList, null)); - UIManager.GetInstance().closeInSceneCenterLoading(); - onLoadEnd.Call(); - } - - public void Initialize() - { - if (_initializeEnd) - { - return; - } - _initializeEnd = true; - PlayerPrefsWrapper.TurnOnFirsStageIfStageIdListAllOff(); - _maxSelectStageNum = Data.Load.data.OpenBattleFieldIdList.Count; - if (_maxSelectStageNum <= 9) - { - _isScroll = false; - } - else - { - _isScroll = true; - } - if (_isScroll) - { - UIEventListener uIEventListener = UIEventListener.Get(_flickCollider.gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDragPanel)); - UIEventListener uIEventListener2 = UIEventListener.Get(_rightButton.gameObject); - uIEventListener2.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onClick, (UIEventListener.VoidDelegate)delegate - { - NextPage(); - }); - UIEventListener uIEventListener3 = UIEventListener.Get(_leftButton.gameObject); - uIEventListener3.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener3.onClick, (UIEventListener.VoidDelegate)delegate - { - PrevPage(); - }); - } - UIEventListener uIEventListener4 = UIEventListener.Get(_allOffButton.gameObject); - uIEventListener4.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onClick, (UIEventListener.VoidDelegate)delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (IsAllOff()) - { - for (int i = 0; i < SettingOffStageIndexs.Length; i++) - { - SettingOffStageIndexs[i] = false; - } - _allOnLabel.gameObject.SetActive(value: false); - _allOffLabel.gameObject.SetActive(value: true); - OnAllOff(obj: false); - } - else - { - for (int j = 0; j < SettingOffStageIndexs.Length; j++) - { - SettingOffStageIndexs[j] = true; - } - _allOnLabel.gameObject.SetActive(value: true); - _allOffLabel.gameObject.SetActive(value: false); - OnAllOff(obj: true); - } - UpdateStageOffView(); - }); - _radioIconClones = new List(); - SettingOffStageIndexs = new bool[_maxSelectStageNum]; - int num = _maxSelectStageNum; - _loadDoneStageTextureNum = 0; - int num2 = 1 + num / 9; - for (int num3 = 0; num3 < num2; num3++) - { - int num4 = num; - if (num4 >= 9) - { - num4 = 9; - } - AddStageTable(num3, num4); - num -= 9; - if (num <= 0) - { - break; - } - } - if (!_isScroll) - { - _leftButton.gameObject.SetActive(value: false); - _rightButton.gameObject.SetActive(value: false); - } - for (int num5 = 0; num5 < _stagePageList.Count; num5++) - { - _stagePageList[num5].Reposition(); - } - foreach (PageData page in _pageList) - { - page.Obj.SetActive(value: false); - } - _pageList[_currentPage].Obj.SetActive(value: true); - SettingOffStageIndexs = ConvertSaveDataToStageIndexList(); - UpdateStageOffView(); - UpdateAllOnOffLabel(); - UpdateRadioButtonView(); - } - - private bool[] ConvertSaveDataToStageIndexList() - { - string[] array = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.OFF_STAGE_ID).Split(','); - bool[] array2 = new bool[_maxSelectStageNum]; - for (int i = 0; i < array.Length; i++) - { - for (int j = 0; j < _maxSelectStageNum; j++) - { - if (array[i] == Data.Load.data.OpenBattleFieldIdList[j].ToString()) - { - array2[j] = true; - break; - } - } - } - return array2; - } - - public void SaveSetting() - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.OFF_STAGE_ID, PlayerPrefsWrapper.ConvertStageIdListToSaveData(SettingOffStageIndexs)); - } - - private void UpdateStageOffView() - { - int num = 0; - foreach (PageData page in _pageList) - { - BattleStageChoiceObject[] stageList = page.StageList; - foreach (BattleStageChoiceObject battleStageChoiceObject in stageList) - { - if (SettingOffStageIndexs[num]) - { - battleStageChoiceObject.SettingOffSelect(isOff: true); - } - else - { - battleStageChoiceObject.SettingOffSelect(isOff: false); - } - num++; - } - } - } - - private void UpdateAllOnOffLabel() - { - if (IsAllOff()) - { - _allOnLabel.gameObject.SetActive(value: true); - _allOffLabel.gameObject.SetActive(value: false); - OnAllOff(obj: true); - } - else - { - _allOnLabel.gameObject.SetActive(value: false); - _allOffLabel.gameObject.SetActive(value: true); - OnAllOff(obj: false); - } - } - - private bool IsAllOff() - { - bool result = true; - for (int i = 0; i < _maxSelectStageNum; i++) - { - if (!SettingOffStageIndexs[i]) - { - result = false; - break; - } - } - return result; - } - - private void AddStageTable(int tableIndex, int createNum) - { - BattleStageChoiceObject[] array = new BattleStageChoiceObject[createNum]; - UIGrid uIGrid = UnityEngine.Object.Instantiate(_deckTableOriginal); - uIGrid.transform.parent = _deckTableRoot.transform; - uIGrid.transform.localScale = Vector3.one; - uIGrid.transform.localPosition = Vector3.zero; - int num = 0; - uIGrid.sorting = UIGrid.Sorting.Custom; - _stagePageList.Add(uIGrid); - for (int i = 0; i < createNum; i++) - { - string textureId = Data.Load.data.OpenBattleFieldIdList[_loadDoneStageTextureNum]; - BattleStageChoiceObject battleStageChoiceObject = CreateStageFrame(tableIndex * 9 + i, textureId); - _loadDoneStageTextureNum++; - uIGrid.AddChild(battleStageChoiceObject.transform); - battleStageChoiceObject.transform.localScale = Vector3.one; - battleStageChoiceObject.gameObject.name = (num + i).ToString(); - array[i] = battleStageChoiceObject; - } - if (_isScroll) - { - UISprite uISprite = UnityEngine.Object.Instantiate(_radioIconOriginal); - _radioIconClones.Add(uISprite); - _radioIconsGrid.AddChild(uISprite.transform); - uISprite.transform.localScale = Vector3.one; - } - PageData item = new PageData(array, uIGrid.gameObject); - _pageList.Add(item); - } - - private BattleStageChoiceObject CreateStageFrame(int index, string textureId) - { - BattleStageChoiceObject battleStageChoiceObject = UnityEngine.Object.Instantiate(_battleTageSelectOriginal); - battleStageChoiceObject.Init(); - UIEventListener uIEventListener = UIEventListener.Get(battleStageChoiceObject.gameObject); - uIEventListener.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(uIEventListener.onPress, (UIEventListener.BoolDelegate)delegate(GameObject g, bool b) - { - StartCoroutine(PushedAnimation(g)); - }); - battleStageChoiceObject._onButton = (Action)Delegate.Combine(battleStageChoiceObject._onButton, (Action)delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - SettingOffStageIndexs[index] = !SettingOffStageIndexs[index]; - UpdateStageOffView(); - UpdateAllOnOffLabel(); - }); - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - string path = "BattleStage_" + int.Parse(textureId).ToString("00"); - Texture texture = resourcesManager.LoadObject(resourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.BattleStage, isfetch: true)); - battleStageChoiceObject.SettingTexture(texture); - UIEventListener uIEventListener2 = UIEventListener.Get(battleStageChoiceObject.gameObject); - uIEventListener2.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener2.onDrag, new UIEventListener.VectorDelegate(OnDragPanel)); - return battleStageChoiceObject; - } - - private void OnDragPanel(GameObject obj, Vector2 dir) - { - if (_isScroll) - { - if (dir.x >= 70f) - { - PrevPage(); - } - else if (dir.x <= -70f) - { - NextPage(); - } - } - } - - private void NextPage() - { - if (ChangePage(_currentPage + 1)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - - private void PrevPage() - { - if (ChangePage(_currentPage - 1)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - - private bool ChangePage(int newPage, bool isImmediate = false) - { - int currentPage = _currentPage; - if (_isChangePage) - { - return false; - } - int count = _radioIconClones.Count; - bool flag = false; - if (newPage < 0) - { - newPage = count - 1; - flag = true; - } - if (newPage >= count) - { - newPage = 0; - flag = true; - } - if (currentPage == newPage) - { - isImmediate = true; - } - _currentPage = newPage; - foreach (PageData page in _pageList) - { - page.Obj.SetActive(value: false); - } - _pageList[_currentPage].Obj.SetActive(value: true); - _pageList[currentPage].Obj.SetActive(value: true); - float num = ((_currentPage < currentPage) ? 1400f : (-1400f)); - if (flag) - { - num = 0f - num; - } - Vector3 pos = new Vector3(num, 0f, 0f); - Vector3 localPosition = new Vector3(0f - num, 0f, 0f); - Vector3 zero = Vector3.zero; - _pageList[_currentPage].Obj.transform.localPosition = localPosition; - TweenPosition.Begin(_pageList[currentPage].Obj, isImmediate ? 0f : 0.2f, pos); - TweenPosition.Begin(_pageList[_currentPage].Obj, isImmediate ? 0f : 0.2f, zero); - if (!isImmediate) - { - _isChangePage = true; - } - UpdateRadioButtonView(); - bool flag2; - bool active = (flag2 = _pageList.Count >= 2) || flag2; - _radioIconsGrid.gameObject.SetActive(active); - return true; - } - - private void UpdateRadioButtonView() - { - for (int i = 0; i < _radioIconClones.Count; i++) - { - if (i == _currentPage) - { - _radioIconClones[i].spriteName = _radioIconClones[i].spriteName.Replace("_off", "_on"); - } - else - { - _radioIconClones[i].spriteName = _radioIconClones[i].spriteName.Replace("_on", "_off"); - } - } - } - - private IEnumerator PushedAnimation(GameObject obj) - { - TweenScale scl = obj.GetComponent(); - if ((bool)scl) - { - scl.PlayForward(); - while (Input.GetMouseButton(0)) - { - yield return null; - } - scl.PlayReverse(); - } - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList = null; - } -} diff --git a/SVSim.BattleEngine/Engine/BattleStartControl.cs b/SVSim.BattleEngine/Engine/BattleStartControl.cs index 817926bc..ab92e538 100644 --- a/SVSim.BattleEngine/Engine/BattleStartControl.cs +++ b/SVSim.BattleEngine/Engine/BattleStartControl.cs @@ -1,584 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle.View.Vfx; - -public class BattleStartControl : MonoBehaviour -{ - [SerializeField] - private UIPanel MainPanel; - - [SerializeField] - private UISprite BgBlack; - - [SerializeField] - private UITexture CharP; - - [SerializeField] - private UITexture CharE; - - [SerializeField] - private ClassInfoParts ClassInfoP; - - [SerializeField] - private ClassInfoParts ClassInfoE; - - [SerializeField] - private UILabel ClassNameP; - - [SerializeField] - private UILabel ClassNameE; - - [SerializeField] - private UILabel CharaNameP; - - [SerializeField] - private UILabel CharaNameE; - - [SerializeField] - private ClassInfoParts _classInfoWithSubClassP; - - [SerializeField] - private ClassInfoParts _classInfoWithSubClassE; - - [SerializeField] - private FlexibleGrid _subClassGridP; - - [SerializeField] - private FlexibleGrid _subClassGridE; - - [SerializeField] - private MyRotationParts _myRotationInfoP; - - [SerializeField] - private MyRotationParts _myRotationInfoE; - - [SerializeField] - private NguiObjs UserPanelP; - - [SerializeField] - private NguiObjs UserPanelE; - - [SerializeField] - private UISprite VsArcane; - - [SerializeField] - private UISprite VsLine; - - [SerializeField] - private UISprite VsTitle; - - [SerializeField] - private UISprite CardP; - - [SerializeField] - private UISprite CardE; - - [SerializeField] - private UILabel CardLabelP; - - [SerializeField] - private UILabel CardLabelE; - - [SerializeField] - private UILabel TurnLabel; - - private IDictionary DefaultPosDict = new Dictionary(); - - private string CardFrontSpriteName = "battle_card_marigan_00"; - - private string CardBackSpriteName = "battle_card_marigan_03"; - - public bool IsReady { get; private set; } - - public void SetUp(SBattleLoad battleLoad) - { - if (GameMgr.GetIns().IsNetworkBattle && !BattleManagerBase.GetIns().IsRecovery && !GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle) - { - StartCoroutine(CheckAbleToInitialize(battleLoad)); - } - else - { - Initialize(); - } - } - - private IEnumerator CheckAbleToInitialize(SBattleLoad battleLoad) - { - while (GameMgr.GetIns().GetNetworkUserInfoData().SelfBattleStartInfo == null || GameMgr.GetIns().GetNetworkUserInfoData().OppoBattleStartInfo == null) - { - yield return null; - } - battleLoad.LoadOpponentAssets(delegate - { - Initialize(); - }); - } - - private void Initialize() - { - MainPanel.alpha = 0f; - InitBattleStartControl(); - base.gameObject.SetActive(value: false); - IsReady = true; - } - - private void InitBattleStartControl() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData(); - PuzzleQuestData puzzleQuestData = null; - bool isPuzzleMgr = BattleManagerBase.GetIns().IsPuzzleMgr; - if (isPuzzleMgr) - { - puzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == GameMgr.GetIns().GetDataMgr().PuzzleQuestId); - } - if (GameMgr.GetIns().IsWatchBattle) - { - DegreeHelper.InitializeDegree(UserPanelP.textures[0], networkUserInfoData.GetSelfDegreeId(), DegreeHelper.DegreeType.MIDDLE); - } - else if (isPuzzleMgr) - { - DegreeHelper.InitializeDegree(UserPanelP.textures[0], puzzleQuestData.PlayerDegreeId, DegreeHelper.DegreeType.MIDDLE); - } - else - { - DegreeHelper.InitializeDegree(UserPanelP.textures[0], PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.MIDDLE); - } - int num = (GameMgr.GetIns().IsNetworkBattle ? networkUserInfoData.GetOpponentDegreeId() : (isPuzzleMgr ? puzzleQuestData.EnemyDegreeId : ((dataMgr.m_BattleType == DataMgr.BattleType.Quest) ? dataMgr.QuestBattleData.DegreeId : ((dataMgr.m_BattleType != DataMgr.BattleType.BossRushQuest && dataMgr.m_BattleType != DataMgr.BattleType.SecretBossQuest) ? dataMgr.PracticeDifficultyDegreeId : dataMgr.BossRushBattleData.DegreeId)))); - if (GameMgr.GetIns().IsNetworkBattle || (dataMgr.m_BattleType == DataMgr.BattleType.Practice && dataMgr.PracticeDifficultyDegreeId != -1) || (dataMgr.IsQuestBattleType() && num != -1)) - { - DegreeHelper.InitializeDegree(UserPanelE.textures[0], num, DegreeHelper.DegreeType.MIDDLE); - } - if (GameMgr.GetIns().IsWatchBattle) - { - UserPanelP.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else if (isPuzzleMgr) - { - UserPanelP.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.PlayerEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else - { - PlayerStaticData.AttachUserEmblemTexture(UserPanelP.textures[1], PlayerStaticData.EmblemTexSize.M); - } - if (GameMgr.GetIns().IsNetworkBattle) - { - UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else if (isPuzzleMgr) - { - UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.EnemyEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.Quest) - { - UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(dataMgr.QuestBattleData.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest || dataMgr.m_BattleType == DataMgr.BattleType.SecretBossQuest) - { - UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(dataMgr.BossRushBattleData.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - else - { - UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(100000000.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true)); - } - if (GameMgr.GetIns().IsWatchBattle) - { - UIUtil.SetCountryTexture(UserPanelP.textures[2], networkUserInfoData.GetSelfCountryCode()); - } - else - { - bool flag = !string.IsNullOrEmpty(PlayerStaticData.UserCountryCode); - UserPanelP.textures[2].gameObject.SetActive(flag); - if (flag) - { - PlayerStaticData.AttachUserCountryTexture(UserPanelP.textures[2], PlayerStaticData.CountryTexSize.M); - } - else - { - UserPanelP.textures[2].mainTexture = null; - } - } - if (GameMgr.GetIns().IsNetworkBattle) - { - UIUtil.SetCountryTexture(UserPanelE.textures[2], networkUserInfoData.GetOpponentCountryCode()); - } - else - { - UserPanelE.textures[2].gameObject.SetActive(value: false); - UserPanelE.textures[2].mainTexture = null; - } - if (GameMgr.GetIns().IsWatchBattle) - { - UserPanelP.textures[3].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture; - } - else if (dataMgr.IsDipslayHighRankFormat()) - { - PlayerStaticData.LoadUserRankTexture(PlayerStaticData.HighRankFormat()); - PlayerStaticData.AttachUserRankTexture(UserPanelP.textures[3], PlayerStaticData.RankTexSize.S); - } - else - { - UserPanelP.textures[3].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(PlayerStaticData.UserRankCurrentFormat().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture; - } - if (GameMgr.GetIns().IsNetworkBattle) - { - UserPanelE.textures[3].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture; - } - if (GameMgr.GetIns().IsWatchBattle) - { - UserPanelP.labels[0].text = networkUserInfoData.GetSelfName(); - } - else - { - UserPanelP.labels[0].text = PlayerStaticData.UserName.ToString(); - } - if (GameMgr.GetIns().IsNetworkBattle) - { - UserPanelE.labels[0].text = VideoHostingUtil.GetUserNameHidden(networkUserInfoData.GetOpponentName().ToString()); - } - else - { - UserPanelE.labels[0].text = dataMgr.GetEnemyCharaData().chara_name; - } - Format inFormat = Data.CurrentFormat; - if (dataMgr.IsDipslayHighRankFormat()) - { - inFormat = PlayerStaticData.HighRankFormat(); - } - bool flag2 = dataMgr.m_BattleType == DataMgr.BattleType.RankBattle; - UILabel uILabel = UserPanelP.labels[1]; - UILabel uILabel2 = UserPanelE.labels[1]; - uILabel.gameObject.SetActive(flag2); - uILabel2.gameObject.SetActive(flag2); - if (flag2) - { - if (PlayerStaticData.IsMasterRank(inFormat)) - { - uILabel.text = PlayerStaticData.UserMasterPoint(inFormat).ToString(); - } - else - { - uILabel.text = PlayerStaticData.UserBattlePoint(inFormat).ToString(); - } - if (GameMgr.GetIns().IsNetworkBattle) - { - if (networkUserInfoData.GetOpponentIsMasterRank()) - { - uILabel2.text = networkUserInfoData.GetOpponentMasterPoint().ToString(); - } - else - { - uILabel2.text = networkUserInfoData.GetOpponentBattlePoint().ToString(); - } - } - else - { - uILabel2.text = "0"; - } - } - bool activeOfficialUserIconSprite = (GameMgr.GetIns().IsWatchBattle ? networkUserInfoData.GetSelfIsOfficialUser() : PlayerStaticData.IsOfficialUserDisplay); - bool activeOfficialUserIconSprite2 = GameMgr.GetIns().IsNetworkBattle && networkUserInfoData.GetOpponentIsOfficialUser(); - UserPanelP.gameObject.GetComponent().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite); - UserPanelE.gameObject.GetComponent().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite2); - DefaultPosDict["UserPanelP"] = UserPanelP.transform.localPosition; - DefaultPosDict["UserPanelE"] = UserPanelE.transform.localPosition; - DefaultPosDict["CharP"] = CharP.transform.localPosition; - DefaultPosDict["CharE"] = CharE.transform.localPosition; - DefaultPosDict["ClassNameP"] = ClassNameP.transform.localPosition; - DefaultPosDict["ClassNameE"] = ClassNameE.transform.localPosition; - DefaultPosDict["CharaNameP"] = CharaNameP.transform.localPosition; - DefaultPosDict["CharaNameE"] = CharaNameE.transform.localPosition; - DefaultPosDict["CardP"] = CardP.transform.localPosition; - DefaultPosDict["CardE"] = CardE.transform.localPosition; - DefaultPosDict["TurnLabel"] = TurnLabel.transform.localPosition; - } - - public VfxBase CreateStartVfx(float waitTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - return InstantVfx.Create(delegate - { - base.gameObject.SetActive(value: false); - }); - } - base.gameObject.SetActive(value: true); - float rot; - Vector3 p1; - Vector3 p2; - Vector3[] path; - return SequentialVfxPlayer.Create(InstantVfx.Create(delegate - { - int playerSkinId = GameMgr.GetIns().GetDataMgr().GetPlayerSkinId(); - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId.ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture; - CharP.mainTexture = mainTexture; - CharP.material = null; - mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GameMgr.GetIns().GetDataMgr().GetEnemySkinId() - .ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture; - CharE.mainTexture = mainTexture; - CharE.material = null; - NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData(); - _myRotationInfoP.gameObject.SetActive(value: false); - if (GameMgr.GetIns().GetDataMgr().TryGetPlayerSubClassId(out var subClassId)) - { - SetClassInfoWithSubClass(GameMgr.GetIns().GetDataMgr().GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId(), subClassId, ClassInfoP, _classInfoWithSubClassP, _subClassGridP); - } - else - { - if (GameMgr.GetIns().GetDataMgr().TryGetPlayerMyRotationInfo(out var myRotationInfo)) - { - _myRotationInfoP.gameObject.SetActive(value: true); - _myRotationInfoP.SetMyRotationInfo(myRotationInfo); - _myRotationInfoP.Reposition(); - } - ClassInfoP.InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId()); - _classInfoWithSubClassP.gameObject.SetActive(value: false); - } - _myRotationInfoE.gameObject.SetActive(value: false); - if (GameMgr.GetIns().GetDataMgr().TryGetEnemySubClassId(out var subClassId2)) - { - SetClassInfoWithSubClass(GameMgr.GetIns().GetDataMgr().GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId(), subClassId2, ClassInfoE, _classInfoWithSubClassE, _subClassGridE); - } - else - { - if (GameMgr.GetIns().GetDataMgr().TryGetEnemyMyRotationInfo(out var myRotationInfo2)) - { - _myRotationInfoE.gameObject.SetActive(value: true); - _myRotationInfoE.SetMyRotationInfo(myRotationInfo2); - _myRotationInfoE.Reposition(); - } - ClassInfoE.InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId()); - _classInfoWithSubClassE.gameObject.SetActive(value: false); - } - UserPanelP.transform.localPosition = DefaultPosDict["UserPanelP"]; - UserPanelE.transform.localPosition = DefaultPosDict["UserPanelE"]; - CharP.transform.localPosition = DefaultPosDict["CharP"]; - CharE.transform.localPosition = DefaultPosDict["CharE"]; - ClassNameP.transform.localPosition = DefaultPosDict["ClassNameP"]; - ClassNameE.transform.localPosition = DefaultPosDict["ClassNameE"]; - CharaNameP.transform.localPosition = DefaultPosDict["CharaNameP"]; - CharaNameE.transform.localPosition = DefaultPosDict["CharaNameE"]; - CardP.transform.localPosition = DefaultPosDict["CardP"] + Vector3.down * 1000f; - CardE.transform.localPosition = DefaultPosDict["CardE"] + Vector3.down * 1000f; - TurnLabel.transform.localPosition = DefaultPosDict["TurnLabel"]; - BgBlack.alpha = 0f; - CharP.alpha = 0f; - CharE.alpha = 0f; - ClassNameP.alpha = 0f; - ClassNameE.alpha = 0f; - CharaNameP.alpha = 0f; - CharaNameE.alpha = 0f; - VsArcane.alpha = 0f; - VsLine.alpha = 0f; - VsTitle.alpha = 0f; - CardP.color = Color.white; - CardE.color = Color.white; - TurnLabel.alpha = 0f; - TweenAlpha.Begin(UserPanelP.gameObject, 0f, 0f); - TweenAlpha.Begin(UserPanelE.gameObject, 0f, 0f); - VsArcane.transform.localScale = Vector3.one; - CardLabelP.text = Data.SystemText.Get("Battle_0430"); - CardLabelE.text = Data.SystemText.Get("Battle_0431"); - MainPanel.alpha = 1f; - }), InstantVfx.Create(delegate - { - TweenAlpha.Begin(VsTitle.gameObject, 0.3f, 1f); - VsTitle.transform.localScale = Vector3.one * 10f; - iTween.ScaleTo(VsTitle.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInCubic)); - }), WaitVfx.Create(0.3f), InstantVfx.Create(delegate - { - TweenAlpha.Begin(BgBlack.gameObject, 0.3f, 0.5f); - EffectMgr.EffectType type = EffectMgr.EffectType.CMN_START_VS_1; - Se.TYPE setype = Se.TYPE.BATTLE_START_VS; - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; - if (specialBattleSettingInfo != null && specialBattleSettingInfo.IsVsEffectOverride) - { - type = EffectMgr.EffectType.CMN_START_VS_ST2; - setype = Se.TYPE.BATTLE_START_VS_ST2; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(setype); - GameMgr.GetIns().GetEffectMgr().Start(type, Vector3.zero); - TweenAlpha.Begin(VsLine.gameObject, 0.3f, 1f); - VsLine.transform.localScale = new Vector3(0.1f, 1f, 1f); - iTween.ScaleTo(VsLine.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - TweenAlpha.Begin(VsArcane.gameObject, 0.3f, 1f); - VsArcane.transform.localRotation = Quaternion.identity; - VsArcane.transform.localScale = Vector3.one * 0.1f; - iTween.ScaleTo(VsArcane.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateAdd(VsArcane.gameObject, iTween.Hash("z", 360f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(CharP.gameObject, 0.3f, 1f); - TweenAlpha.Begin(CharE.gameObject, 0.3f, 1f); - CharP.transform.localPosition = DefaultPosDict["CharP"] + Vector3.right * 500f; - CharE.transform.localPosition = DefaultPosDict["CharE"] + Vector3.left * 500f; - if (GameMgr.GetIns().GetDataMgr().GetEnemyBattleSkillReverse() == 0) - { - CharE.uvRect = new Rect(0f, 0f, 1f, 1f); - } - iTween.MoveTo(CharP.gameObject, iTween.Hash("position", DefaultPosDict["CharP"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(CharE.gameObject, iTween.Hash("position", DefaultPosDict["CharE"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(ClassNameP.gameObject, 0.3f, 1f).delay = 0.1f; - TweenAlpha.Begin(ClassNameE.gameObject, 0.3f, 1f).delay = 0.1f; - ClassNameP.transform.localPosition = DefaultPosDict["ClassNameP"] + Vector3.right * 200f; - ClassNameE.transform.localPosition = DefaultPosDict["ClassNameE"] + Vector3.left * 200f; - iTween.MoveTo(ClassNameP.gameObject, iTween.Hash("position", DefaultPosDict["ClassNameP"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(ClassNameE.gameObject, iTween.Hash("position", DefaultPosDict["ClassNameE"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(CharaNameP.gameObject, 0.3f, 1f).delay = 0.1f; - TweenAlpha.Begin(CharaNameE.gameObject, 0.3f, 1f).delay = 0.1f; - CharaNameP.transform.localPosition = DefaultPosDict["CharaNameP"] + Vector3.right * 200f; - CharaNameE.transform.localPosition = DefaultPosDict["CharaNameE"] + Vector3.left * 200f; - iTween.MoveTo(CharaNameP.gameObject, iTween.Hash("position", DefaultPosDict["CharaNameP"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(CharaNameE.gameObject, iTween.Hash("position", DefaultPosDict["CharaNameE"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(UserPanelP.gameObject, 0.3f, 1f); - TweenAlpha.Begin(UserPanelE.gameObject, 0.3f, 1f); - UserPanelP.transform.localPosition = DefaultPosDict["UserPanelP"] + Vector3.left * 500f; - UserPanelE.transform.localPosition = DefaultPosDict["UserPanelE"] + Vector3.right * 500f; - iTween.MoveTo(UserPanelP.gameObject, iTween.Hash("position", DefaultPosDict["UserPanelP"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(UserPanelE.gameObject, iTween.Hash("position", DefaultPosDict["UserPanelE"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - }), WaitVfx.Create(waitTime), InstantVfx.Create(delegate - { - TweenAlpha.Begin(BgBlack.gameObject, 0.3f, 0.9f); - TweenAlpha.Begin(VsTitle.gameObject, 0.3f, 0f); - iTween.ScaleTo(VsTitle.gameObject, iTween.Hash("scale", Vector3.one * 2f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(VsArcane.gameObject, 0.3f, 0f); - iTween.ScaleTo(VsArcane.gameObject, iTween.Hash("scale", Vector3.one * 5f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(ClassNameP.gameObject, 0.3f, 0f); - iTween.MoveTo(ClassNameP.gameObject, iTween.Hash("x", DefaultPosDict["ClassNameP"].x - 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(ClassNameE.gameObject, 0.3f, 0f); - iTween.MoveTo(ClassNameE.gameObject, iTween.Hash("x", DefaultPosDict["ClassNameE"].x + 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(CharaNameP.gameObject, 0.3f, 0f); - iTween.MoveTo(CharaNameP.gameObject, iTween.Hash("x", DefaultPosDict["CharaNameP"].x - 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(CharaNameE.gameObject, 0.3f, 0f); - iTween.MoveTo(CharaNameE.gameObject, iTween.Hash("x", DefaultPosDict["CharaNameE"].x + 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(UserPanelP.gameObject, 0.3f, 0f); - iTween.MoveTo(UserPanelP.gameObject, iTween.Hash("x", DefaultPosDict["UserPanelP"].x + 200f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - TweenAlpha.Begin(UserPanelE.gameObject, 0.3f, 0f); - iTween.MoveTo(UserPanelE.gameObject, iTween.Hash("x", DefaultPosDict["UserPanelE"].x - 200f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - }), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.DRAW); - CardP.spriteName = CardFrontSpriteName; - CardE.spriteName = CardFrontSpriteName; - iTween.MoveTo(CardP.gameObject, iTween.Hash("position", DefaultPosDict["CardP"], "time", 0.4f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(CardE.gameObject, iTween.Hash("position", DefaultPosDict["CardE"], "time", 0.4f, "delay", 0.05f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - }), WaitVfx.Create(0.5f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1); - iTween.MoveTo(CardP.gameObject, iTween.Hash("position", Vector3.zero, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutCubic)); - iTween.MoveTo(CardE.gameObject, iTween.Hash("position", Vector3.zero, "time", 0.3f, "delay", 0.05f, "islocal", true, "easetype", iTween.EaseType.easeInOutCubic)); - iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - }), WaitVfx.Create(0.1f), InstantVfx.Create(delegate - { - CardP.depth = 0; - CardE.depth = 2; - CardLabelP.text = ""; - CardLabelE.text = ""; - CardP.spriteName = CardBackSpriteName; - CardE.spriteName = CardBackSpriteName; - iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - }), WaitVfx.Create(0.2f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_2); - rot = Random.value * 30f - 15f; - p1 = (Vector3)MotionUtils.GetPositionByAngle(rot) * 400f; - p2 = (Vector3)MotionUtils.GetPositionByAngle(rot + 180f) * 100f; - path = MotionUtils.GetBezierCubic(Vector3.zero, p1, p2, Vector3.zero, 20); - iTween.MoveTo(CardP.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.linear)); - path = MotionUtils.GetBezierCubic(Vector3.zero, p1 * -1f, p2 * -1f, Vector3.zero, 20); - iTween.MoveTo(CardE.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.linear)); - }), WaitVfx.Create(0.1f), InstantVfx.Create(delegate - { - CardP.depth = 2; - CardE.depth = 0; - }), WaitVfx.Create(0.1f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_2); - rot = Random.value * 30f - 15f + 180f; - p1 = (Vector3)MotionUtils.GetPositionByAngle(rot) * 320f; - p2 = (Vector3)MotionUtils.GetPositionByAngle(rot + 180f) * 80f; - path = MotionUtils.GetBezierCubic(Vector3.zero, p1, p2, Vector3.zero, 20); - iTween.MoveTo(CardP.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.16f, "islocal", true, "easetype", iTween.EaseType.linear)); - path = MotionUtils.GetBezierCubic(Vector3.zero, p1 * -1f, p2 * -1f, Vector3.zero, 20); - iTween.MoveTo(CardE.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.16f, "islocal", true, "easetype", iTween.EaseType.linear)); - }), WaitVfx.Create(0.08f), InstantVfx.Create(delegate - { - CardP.depth = 0; - CardE.depth = 2; - }), WaitVfx.Create(0.08f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_2); - rot = Random.value * 30f - 15f; - p1 = (Vector3)MotionUtils.GetPositionByAngle(rot) * 320f; - p2 = (Vector3)MotionUtils.GetPositionByAngle(rot + 180f) * 80f; - path = MotionUtils.GetBezierCubic(Vector3.zero, p1, p2, Vector3.zero, 20); - iTween.MoveTo(CardP.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.12f, "islocal", true, "easetype", iTween.EaseType.linear)); - path = MotionUtils.GetBezierCubic(Vector3.zero, p1 * -1f, p2 * -1f, Vector3.zero, 20); - iTween.MoveTo(CardE.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.12f, "islocal", true, "easetype", iTween.EaseType.linear)); - }), WaitVfx.Create(0.06f), InstantVfx.Create(delegate - { - CardP.depth = 2; - CardE.depth = 0; - }), WaitVfx.Create(0.06f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1); - iTween.MoveTo(CardP.gameObject, iTween.Hash("position", new Vector3(240f, -160f, 0f), "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(CardE.gameObject, iTween.Hash("position", new Vector3(-240f, 160f, 0f), "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - }), WaitVfx.Create(0.3f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_3); - iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - }), WaitVfx.Create(0.1f), InstantVfx.Create(delegate - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_START_CARD_1, CardP.transform.position); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.DRAW_CARD_OPEN); - CardP.spriteName = CardFrontSpriteName; - CardE.spriteName = CardFrontSpriteName; - if (BattleManagerBase.GetIns().IsFirst) - { - CardLabelP.text = Data.SystemText.Get("Battle_0430"); - CardLabelE.text = Data.SystemText.Get("Battle_0431"); - TurnLabel.text = Data.SystemText.Get("Battle_0432"); - } - else - { - CardLabelP.text = Data.SystemText.Get("Battle_0431"); - CardLabelE.text = Data.SystemText.Get("Battle_0430"); - TurnLabel.text = Data.SystemText.Get("Battle_0433"); - } - TweenAlpha.Begin(TurnLabel.gameObject, 0.3f, 1f); - TurnLabel.transform.localPosition = DefaultPosDict["TurnLabel"] + Vector3.right * 50f; - iTween.MoveTo(TurnLabel.gameObject, iTween.Hash("position", DefaultPosDict["TurnLabel"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenColor.Begin(CardE.gameObject, 0.1f, Color.gray); - TweenColor.Begin(CardLabelE.gameObject, 0.1f, Color.gray); - iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - }), WaitVfx.Create(1.5f), InstantVfx.Create(delegate - { - TweenAlpha.Begin(BgBlack.gameObject, 0.1f, 0f); - TweenAlpha.Begin(CardP.gameObject, 0.1f, 0f); - TweenAlpha.Begin(CardE.gameObject, 0.1f, 0f); - TweenAlpha.Begin(CharP.gameObject, 0.1f, 0f); - TweenAlpha.Begin(CharE.gameObject, 0.1f, 0f); - TweenAlpha.Begin(VsLine.gameObject, 0.1f, 0f); - TweenAlpha.Begin(TurnLabel.gameObject, 0.1f, 0f); - }), WaitVfx.Create(0.1f), InstantVfx.Create(delegate - { - base.gameObject.SetActive(value: false); - })); - } - - private static void SetClassInfoWithSubClass(ClassCharacterMasterData charaData, int chaosId, int subClassId, ClassInfoParts defaultClassInfoParts, ClassInfoParts classInfoParts, FlexibleGrid grid) - { - classInfoParts.gameObject.SetActive(value: true); - defaultClassInfoParts.ClassNameLabel.text = string.Empty; - classInfoParts.InitByCharaPrm(charaData, chaosId); - classInfoParts.SetSubClass((CardBasePrm.ClanType)subClassId); - UIUtil.AdjustClassInfoPartsSize(classInfoParts, grid, 375); - } -} +using UnityEngine; + +// PASS-8/Phase-1 STUB: 253-line battle-start intro UI. Only referenced from +// SBattleLoad.cs:249 as a GetComponent<>() attach that immediately calls SetUp(this). +// Held on BattleManagerBase.BattleStartControl field (nulled at battle start/end). +// Headless never runs the intro animation. +public class BattleStartControl : MonoBehaviour +{ + public void SetUp(SBattleLoad load) { } +} diff --git a/SVSim.BattleEngine/Engine/BattleStopChecker.cs b/SVSim.BattleEngine/Engine/BattleStopChecker.cs index 1c176e0a..34c53709 100644 --- a/SVSim.BattleEngine/Engine/BattleStopChecker.cs +++ b/SVSim.BattleEngine/Engine/BattleStopChecker.cs @@ -3,7 +3,6 @@ using Cute; public class BattleStopChecker : NetworkBattleIntervalCheckerBase { - private const int JUDGE_RESULT_RETRY_TIMER = 95; public event Action OnBattleStop; diff --git a/SVSim.BattleEngine/Engine/BattleUIContainer.cs b/SVSim.BattleEngine/Engine/BattleUIContainer.cs index cc72aca0..276c6e00 100644 --- a/SVSim.BattleEngine/Engine/BattleUIContainer.cs +++ b/SVSim.BattleEngine/Engine/BattleUIContainer.cs @@ -4,8 +4,6 @@ using Wizard; public class BattleUIContainer : MonoBehaviour { - [SerializeField] - public BattleButtonControl ButtonControl; [SerializeField] private WizardUIButton BattleMenuBtn; @@ -19,82 +17,16 @@ public class BattleUIContainer : MonoBehaviour [SerializeField] private GameObject _battery; - private const float LONG_PRESS_TIME = 0.2f; - - private float? _predictionWaitTime; - public Action ShowPrediction; private bool _enableMenuRequest; - private InputMgr _inputMgr; - public bool PlayerCardPlaying; private bool _forceDisableMenu; public GameObject Battery => _battery; - private void Start() - { - BattleMenuBtn.onPress.Clear(); - BattleMenuBtn.onPress.Add(new EventDelegate(delegate - { - ButtonControl.OnPressMenuBtn(); - })); - if (!GameMgr.GetIns().IsWatchBattle) - { - TurnEndBtn.onClick.Clear(); - TurnEndBtn.onClick.Add(new EventDelegate(delegate - { - ButtonControl.OnPressTurnEnd(); - })); - } - _predictionWaitTime = null; - UIEventListener.Get(TurnEndBtn.gameObject).onPress = delegate(GameObject obj, bool isPress) - { - if (isPress) - { - _predictionWaitTime = Time.realtimeSinceStartup; - } - else - { - _predictionWaitTime = null; - if (ShowPrediction != null) - { - ShowPrediction(obj: false); - } - } - }; - UIEventListener.Get(TurnEndBtn.gameObject).onHover = delegate(GameObject obj, bool isHover) - { - if (BattleManagerBase.UseCustomMouse && UIManager.GetInstance().ApplicationHasFocus) - { - if (isHover) - { - _predictionWaitTime = Time.realtimeSinceStartup; - } - else - { - _predictionWaitTime = null; - if (ShowPrediction != null) - { - ShowPrediction(isHover); - } - } - } - }; - UIEventListener.Get(TurnEndBtn.gameObject).onDragOut = delegate - { - _predictionWaitTime = null; - if (ShowPrediction != null) - { - ShowPrediction(obj: false); - } - }; - _inputMgr = GameMgr.GetIns().GetInputMgr(); - } - public void EnableMenu() { if (!PlayerCardPlaying && !_forceDisableMenu) @@ -110,15 +42,6 @@ public class BattleUIContainer : MonoBehaviour _enableMenuRequest = true; } - private void TryEnableMenu() - { - if (BattleManagerBase.GetIns().GetBattlePlayer(isPlayer: true).BattleView.IsTouchable()) - { - EnableMenu(); - _enableMenuRequest = false; - } - } - public void ForceEnableMenu() { _forceDisableMenu = false; @@ -127,7 +50,11 @@ public class BattleUIContainer : MonoBehaviour public void DisableMenu(bool isForceDisable = false) { - if (isForceDisable || (!BattleManagerBase.GetIns().IsRecovery && !GameMgr.GetIns().IsReplayBattle && !GameMgr.GetIns().IsWatchBattle)) + // Pre-Phase-5b: gate was `isForceDisable || (!IsRecovery && !IsReplayBattle && !IsWatchBattle)`. + // IsReplayBattle/IsWatchBattle are const-false in headless (Phase 4); the mgr's IsRecovery + // state is entirely a UI-hint concern here. Collapsing the branch to `isForceDisable` matches + // the semantic in the only path that matters headless (button visibility never observed). + if (isForceDisable) { BattleMenuBtn.isEnabled = false; SetEnableReset(isEnable: false); @@ -144,77 +71,17 @@ public class BattleUIContainer : MonoBehaviour public void SetEnableReset(bool isEnable) { - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins is PuzzleBattleManager) - { - (ins as PuzzleBattleManager).ResetButton.SetState((!isEnable) ? UIButtonColor.State.Disabled : UIButtonColor.State.Normal, immediate: false); - } + // Puzzle-mode only. Headless never runs PuzzleBattleManager; the branch was dead + // past the type check, so dropping the ambient reach preserves runtime behavior. } public void SetEnableHint(bool isEnable) { - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins is PuzzleBattleManager) - { - (ins as PuzzleBattleManager).HintButton.isEnabled = isEnable; - } + // Puzzle-mode only. See SetEnableReset — dropping the ambient reach is a no-op. } public bool IsEnableMenu() { return BattleMenuBtn.isEnabled; } - - private void Update() - { - UIManager instance = UIManager.GetInstance(); - GameMgr ins = GameMgr.GetIns(); - BattleManagerBase ins2 = BattleManagerBase.GetIns(); - if (_enableMenuRequest) - { - if (BattleMenuBtn.isEnabled) - { - _enableMenuRequest = false; - } - else - { - TryEnableMenu(); - } - } - if (!Input.GetMouseButton(0) && instance != null && instance.IsCurrentScene(UIManager.ViewScene.Battle) && !instance.isOpenLoading() && !instance.isFading() && ins.GetInputMgr().isBackKeyEnable && !BattleManagerBase.IsTutorial) - { - if (BattleMenuBtn.gameObject.activeInHierarchy && BattleMenuBtn.isActiveAndEnabled && !instance.isOpenDialog()) - { - if (Input.GetKeyDown(KeyCode.Escape) && IsEnableMenu()) - { - ButtonControl.OnPressMenuBtn(); - } - if (BattleManagerBase.UseKeyboardTurnEndSpaceShortcut && _inputMgr.IsKeyboardSpace() && ins2.BattlePlayer.PlayerBattleView.TurnEndButtonUI.GameObject.activeInHierarchy && ins2.BattlePlayer.PlayerBattleView.TurnEndButtonUI.GetEnableLabel && ins2.BattlePlayer.IsSelfTurn && _inputMgr.KeyboardEnableControlSpace) - { - ButtonControl.OnPressTurnEnd(); - } - } - else if (instance.isOpenDialog() && !ButtonControl.IsSettingMenuOpen && !ButtonControl.IsRetireMenuOpen && !ButtonControl.IsQuestMissionOpen && Input.GetKeyDown(KeyCode.Escape)) - { - ins2.BattlePlayer.PlayerBattleView.IsMenuCloseEscape = true; - ButtonControl.HideBattleMenu(); - } - } - if (TurnEndBtn.state == UIButtonColor.State.Pressed || BattleManagerBase.UseCustomMouse) - { - if (ShowPrediction != null && _predictionWaitTime.HasValue && _predictionWaitTime.Value + 0.2f < Time.realtimeSinceStartup) - { - ShowPrediction(obj: true); - _predictionWaitTime = null; - } - } - else - { - _predictionWaitTime = null; - } - if (ins.IsWatchBattle && ins2.IsBattleEnd) - { - ButtonControl.HideAllMenu(isWithoutSE: true); - } - } } diff --git a/SVSim.BattleEngine/Engine/BetterList.cs b/SVSim.BattleEngine/Engine/BetterList.cs index 3953ba8a..4b308f88 100644 --- a/SVSim.BattleEngine/Engine/BetterList.cs +++ b/SVSim.BattleEngine/Engine/BetterList.cs @@ -23,22 +23,6 @@ public class BetterList } } - [DebuggerHidden] - [DebuggerStepThrough] - public IEnumerator GetEnumerator() - { - if (buffer != null) - { - int i = 0; - while (i < size) - { - yield return buffer[i]; - int num = i + 1; - i = num; - } - } - } - private void AllocateMore() { T[] array = ((buffer != null) ? new T[Mathf.Max(buffer.Length << 1, 32)] : new T[32]); @@ -74,12 +58,6 @@ public class BetterList size = 0; } - public void Release() - { - size = 0; - buffer = null; - } - public void Add(T item) { if (buffer == null || size == buffer.Length) @@ -89,63 +67,6 @@ public class BetterList buffer[size++] = item; } - public void Insert(int index, T item) - { - if (buffer == null || size == buffer.Length) - { - AllocateMore(); - } - if (index > -1 && index < size) - { - for (int num = size; num > index; num--) - { - buffer[num] = buffer[num - 1]; - } - buffer[index] = item; - size++; - } - else - { - Add(item); - } - } - - public bool Contains(T item) - { - if (buffer == null) - { - return false; - } - for (int i = 0; i < size; i++) - { - ref readonly T reference = ref buffer[i]; - object obj = item; - if (reference.Equals(obj)) - { - return true; - } - } - return false; - } - - public int IndexOf(T item) - { - if (buffer == null) - { - return -1; - } - for (int i = 0; i < size; i++) - { - ref readonly T reference = ref buffer[i]; - object obj = item; - if (reference.Equals(obj)) - { - return i; - } - } - return -1; - } - public bool Remove(T item) { if (buffer != null) @@ -199,31 +120,4 @@ public class BetterList Trim(); return buffer; } - - [DebuggerHidden] - [DebuggerStepThrough] - public void Sort(CompareFunc comparer) - { - int num = 0; - int num2 = size - 1; - bool flag = true; - while (flag) - { - flag = false; - for (int i = num; i < num2; i++) - { - if (comparer(buffer[i], buffer[i + 1]) > 0) - { - T val = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = val; - flag = true; - } - else if (!flag) - { - num = ((i != 0) ? (i - 1) : 0); - } - } - } - } } diff --git a/SVSim.BattleEngine/Engine/Bgm.cs b/SVSim.BattleEngine/Engine/Bgm.cs deleted file mode 100644 index 8c6f484d..00000000 --- a/SVSim.BattleEngine/Engine/Bgm.cs +++ /dev/null @@ -1,219 +0,0 @@ -using System; -using System.Collections.Generic; -using CriWare; -using Cute; -using Wizard; - -public class Bgm -{ - public enum BGM_TYPE - { - NONE, - TITLE, - TITLE_SPECIAL_1, - TITLE_SPECIAL_2, - HOME, - BATTLE_STANDBY, - BATTLE, - SYS_WIN_LOOP, - SYS_LOSE_LOOP, - COLOSSEUM_FINAL, - GRANDPRIX_SPECIAL, - GRANDPRIX_SPECIAL_FINAL, - SEALED, - QUEST, - COMPETITION_LOBBY, - BINGO, - MAX - } - - private class BgmInfo - { - public string CueName { get; private set; } - - public string CueSheet { get; private set; } - - public BgmInfo(string cueName, string cueSheet) - { - CueName = cueName; - CueSheet = cueSheet; - } - } - - private const string CATEGORY_NAME = "BGM"; - - private Dictionary m_AudioData; - - private string m_PlayBgmCueName; - - private int m_CurrentBgmIdx; - - private int m_MaxBgmCount; - - private float m_volume; - - private bool m_isMuted; - - public Bgm() - { - m_AudioData = new Dictionary(); - m_PlayBgmCueName = null; - m_CurrentBgmIdx = 0; - m_MaxBgmCount = Toolbox.AudioManager.GetBgmMaxCount(); - SetVolume(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BGM_VOLUME)); - Mute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - } - - public void AddList(BGM_TYPE BgmType, string cueName, string cueSheet = null) - { - if (!m_AudioData.ContainsKey(BgmType)) - { - m_AudioData.Add(BgmType, new BgmInfo(cueName, (cueSheet == null) ? cueName : cueSheet)); - } - } - - public void RemoveList(BGM_TYPE BgmType) - { - if (m_AudioData.ContainsKey(BgmType)) - { - m_AudioData.Remove(BgmType); - } - } - - public virtual void Play(BGM_TYPE BgmType, float FadeTime = 0f, long startTime = 0L) - { - if (BgmType != BGM_TYPE.NONE) - { - BgmInfo bgmInfo = m_AudioData[BgmType]; - string cueSheet = bgmInfo.CueSheet; - m_PlayBgmCueName = bgmInfo.CueName; - Toolbox.AudioManager.PlayBgmFromName(cueSheet, m_PlayBgmCueName, cueSheet, cueSheet, m_CurrentBgmIdx, loop: false, FadeTime, 0f, startTime); - } - } - - public virtual void PlayCrossFade(BGM_TYPE BgmType, float fadeOutTime, float fadeInTime, long startTime) - { - if (BgmType != BGM_TYPE.NONE) - { - BgmInfo bgmInfo = m_AudioData[BgmType]; - string cueSheet = bgmInfo.CueSheet; - m_PlayBgmCueName = bgmInfo.CueName; - Toolbox.AudioManager.StopFadeBgm(m_CurrentBgmIdx, fadeOutTime); - m_CurrentBgmIdx = (m_CurrentBgmIdx + 1) % m_MaxBgmCount; - Toolbox.AudioManager.PlayBgmFromName(cueSheet, m_PlayBgmCueName, cueSheet, cueSheet, m_CurrentBgmIdx, loop: false, fadeInTime, 0f, startTime); - } - } - - public virtual void PlayFadeOut(BGM_TYPE BgmType, float FadeOutTime = 0f, float FadeInTime = 0f) - { - Toolbox.AudioManager.StopFadeBgm(m_CurrentBgmIdx, FadeOutTime); - if (BgmType != BGM_TYPE.NONE) - { - m_CurrentBgmIdx = (m_CurrentBgmIdx + 1) % m_MaxBgmCount; - BgmInfo bgmInfo = m_AudioData[BgmType]; - string cueSheet = bgmInfo.CueSheet; - m_PlayBgmCueName = bgmInfo.CueName; - Toolbox.AudioManager.PlayBgmFromName(cueSheet, m_PlayBgmCueName, cueSheet, cueSheet, m_CurrentBgmIdx, loop: false, FadeInTime, FadeOutTime, 0L); - } - } - - public virtual void Play(string cuename, float fadeInTime, long startTime) - { - if (IsPreInstall(cuename, out var type)) - { - Play(type, fadeInTime, startTime); - return; - } - m_PlayBgmCueName = cuename; - Toolbox.AudioManager.PlayBgmFromName(cuename, cuename, cuename, cuename, m_CurrentBgmIdx, loop: false, fadeInTime, 0f, startTime); - } - - public virtual void PlayCrossFade(string cuename, float fadeOutTime, float fadeInTime, long startTime) - { - if (IsPreInstall(cuename, out var type)) - { - PlayCrossFade(type, fadeOutTime, fadeInTime, startTime); - return; - } - m_PlayBgmCueName = cuename; - Toolbox.AudioManager.StopFadeBgm(m_CurrentBgmIdx, fadeOutTime); - m_CurrentBgmIdx = (m_CurrentBgmIdx + 1) % m_MaxBgmCount; - Toolbox.AudioManager.PlayBgmFromName(cuename, cuename, cuename, cuename, m_CurrentBgmIdx, loop: false, fadeInTime, 0f, startTime); - } - - public virtual void Pause() - { - for (int i = 0; i < m_MaxBgmCount; i++) - { - Toolbox.AudioManager.PauseBgm(isPause: true, i); - } - } - - public virtual void Stop(float FadeTime, Action onStopped) - { - m_PlayBgmCueName = null; - AudioManager audioManager = Toolbox.AudioManager; - audioManager.StopFadeBgm(m_CurrentBgmIdx, FadeTime); - audioManager.StartCoroutine_DelayMethod(FadeTime, onStopped); - } - - public virtual void StopAll(float FadeTime) - { - m_PlayBgmCueName = null; - for (int i = 0; i < m_MaxBgmCount; i++) - { - Toolbox.AudioManager.StopFadeBgm(i, FadeTime); - } - } - - public bool IsPlayBGM(BGM_TYPE bgmType) - { - if (bgmType != BGM_TYPE.NONE) - { - return m_AudioData[bgmType].CueName == m_PlayBgmCueName; - } - return m_PlayBgmCueName != null; - } - - public string GetCueSheet(BGM_TYPE bgmType) - { - return m_AudioData[bgmType].CueSheet; - } - - public bool IsPreInstall(string cuename, out BGM_TYPE type) - { - foreach (KeyValuePair audioDatum in m_AudioData) - { - BgmInfo value = audioDatum.Value; - if (value.CueName == cuename && value.CueSheet == SoundMgr.PREINSTALL_CUESHEET) - { - type = audioDatum.Key; - return true; - } - } - type = BGM_TYPE.NONE; - return false; - } - - public void SetVolume(float Prm) - { - CriAtomExCategory.SetVolume("BGM", Prm); - m_volume = Prm; - } - - public void Mute(bool isMute) - { - CriAtomExCategory.Mute("BGM", isMute); - m_isMuted = isMute; - } - - public float GetVolume() - { - return m_volume; - } - - public bool IsMuted() - { - return m_isMuted; - } -} diff --git a/SVSim.BattleEngine/Engine/BingoBall.cs b/SVSim.BattleEngine/Engine/BingoBall.cs deleted file mode 100644 index f2f9c257..00000000 --- a/SVSim.BattleEngine/Engine/BingoBall.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -public class BingoBall : MonoBehaviour -{ - public const string NUM_SPRITE_NAME_HEAD = "bingo_ball_"; - - public const string TEXTURE_BINGOBALL_BACK = "bingo_ball_back"; - - public const string TEXTURE_BINGOBALL_FRONT = "bingo_ball_front"; - - public const float NUM_SPACE = 11f; - - [SerializeField] - private UISprite _numSpriteLeft; - - [SerializeField] - private UISprite _numSpriteRight; - - [SerializeField] - private UISprite _ballSprite; - - [SerializeField] - private Transform _bottomPos; - - [SerializeField] - private TweenPositionX _tweenPositionX; - - [SerializeField] - private TweenPositionY _tweenPositionY; - - [SerializeField] - private Vector2 _ballMovement; - - private GameObject _effectObject; - - private GameObject _dustEffect1; - - private GameObject _dustEffect2; - - private int _ballNum; - - private List _inProcessCoroutines = new List(); - - private void Start() - { - _numSpriteLeft.gameObject.SetActive(value: false); - _numSpriteRight.gameObject.SetActive(value: false); - } - - public void SetBallNum(int num) - { - _ballNum = num; - } - - public void SetNumSprite() - { - if (_ballNum >= 0 && _ballNum <= 9) - { - _numSpriteRight.gameObject.SetActive(value: false); - _numSpriteLeft.gameObject.SetActive(value: true); - _numSpriteLeft.transform.localPosition = Vector3.zero; - _numSpriteLeft.spriteName = "bingo_ball_" + _ballNum; - } - else if (_ballNum >= 10) - { - _numSpriteRight.gameObject.SetActive(value: true); - _numSpriteLeft.gameObject.SetActive(value: true); - _numSpriteLeft.spriteName = "bingo_ball_" + _ballNum / 10; - _numSpriteRight.spriteName = "bingo_ball_" + _ballNum % 10; - } - } - - public void SetBallSprite(bool isFront) - { - _ballSprite.spriteName = (isFront ? "bingo_ball_front" : "bingo_ball_back"); - } - - public List PlayEffect(string effectName, bool isOnBottom) - { - List list = new List(); - if (_effectObject != null) - { - Object.Destroy(_effectObject); - } - _effectObject = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(effectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _effectObject.transform.parent = base.gameObject.transform; - list.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_effectObject, null)); - _effectObject.transform.localPosition = (isOnBottom ? _bottomPos.transform.localPosition : Vector3.zero); - _effectObject.SetActive(value: true); - return list; - } - - public List PlayDustEffect(string effectName, GameObject dustEffectContainer, float fallTime, float endWorldPosY, float delayTime) - { - List list = new List(); - _dustEffect1 = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(effectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _dustEffect2 = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(effectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - list.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_dustEffect1, null)); - list.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_dustEffect2, null)); - _dustEffect1.transform.parent = dustEffectContainer.transform; - _dustEffect2.transform.parent = dustEffectContainer.transform; - _dustEffect1.SetActive(value: false); - _dustEffect2.SetActive(value: false); - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlayDustEffect(fallTime, endWorldPosY, delayTime))); - return list; - } - - private IEnumerator PlayDustEffect(float fallTime, float endWorldPosY, float delayTime) - { - yield return new WaitForSeconds(delayTime + fallTime * 0.164f); - Vector3 position = base.gameObject.transform.position; - position.y = endWorldPosY - (base.gameObject.transform.position.y - _bottomPos.transform.position.y) * 0.95f; - _dustEffect1.transform.position = position; - _dustEffect1.SetActive(value: true); - yield return new WaitForSeconds(fallTime * 0.323f); - position = base.gameObject.transform.position; - position.y = endWorldPosY - (base.gameObject.transform.position.y - _bottomPos.transform.position.y) * 0.98f; - _dustEffect2.transform.position = position; - _dustEffect2.SetActive(value: true); - yield return new WaitForSeconds(0.4f); - Object.Destroy(_dustEffect1); - Object.Destroy(_dustEffect2); - } - - public void StopCoroutine() - { - if (_inProcessCoroutines.Count <= 0) - { - return; - } - foreach (Coroutine inProcessCoroutine in _inProcessCoroutines) - { - if (inProcessCoroutine != null) - { - UIManager.GetInstance().StopCoroutine(inProcessCoroutine); - } - } - } - - public void PlayTweenAnimation(Vector3 from, float delay) - { - _tweenPositionX.from = from.x; - _tweenPositionX.to = from.x + _ballMovement.x; - _tweenPositionY.from = from.y; - _tweenPositionY.to = from.y + _ballMovement.y; - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlayBallFallAnimation(delay))); - } - - private IEnumerator PlayBallFallAnimation(float delay) - { - yield return new WaitForSeconds(delay); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_sys_bng_ballfall_01", "se_sys_bng_ballfall_01", 0f, 0L); - base.gameObject.SetActive(value: true); - } - - public Vector2 GetBallMovement() - { - return _ballMovement; - } -} diff --git a/SVSim.BattleEngine/Engine/BingoSheetBlock.cs b/SVSim.BattleEngine/Engine/BingoSheetBlock.cs deleted file mode 100644 index 65227fa8..00000000 --- a/SVSim.BattleEngine/Engine/BingoSheetBlock.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class BingoSheetBlock : MonoBehaviour -{ - [SerializeField] - private UISprite _numSpriteLeft; - - [SerializeField] - private UISprite _numSpriteRight; - - [SerializeField] - private UISprite _blockSprite; - - [SerializeField] - private UISprite _treasureBoxSprite; - - [SerializeField] - private UITexture _stampTexutre; - - [SerializeField] - private UISprite _lightSprite; - - [SerializeField] - private TweenAlpha _lightTextureAlpha; - - private List _inProcessCoroutines = new List(); - - private const string NUM_SPRITE_NAME_HEAD = "bingo_square_"; - - private const float LINES_NUM_SPRITE_SPACE = 16.65f; - - public void SetNumLabel(int num, int maxPerLine) - { - if (num >= 0 && num <= 9) - { - _numSpriteRight.gameObject.SetActive(value: false); - _numSpriteLeft.gameObject.SetActive(value: true); - _numSpriteLeft.transform.localPosition = Vector3.zero; - _numSpriteLeft.spriteName = "bingo_square_" + num; - } - else if (num >= 10) - { - _numSpriteRight.gameObject.SetActive(value: true); - _numSpriteLeft.gameObject.SetActive(value: true); - _numSpriteLeft.spriteName = "bingo_square_" + num / 10; - _numSpriteRight.spriteName = "bingo_square_" + num % 10; - Vector3 zero = Vector3.zero; - zero.x = -16.65f; - _numSpriteLeft.transform.localPosition = zero; - zero.x = 16.65f; - _numSpriteRight.transform.localPosition = zero; - } - } - - public void SetBlockScale(float blockScale) - { - base.transform.localScale *= blockScale; - } - - public void SetPartsVisible(bool blockVisible, int treasureBoxGrade, bool isOpen) - { - _blockSprite.gameObject.SetActive(blockVisible); - SetTreasureBoxSprite(treasureBoxGrade, isOpen); - SetStampVisible(isOpen); - } - - public void SetStampTexture(Texture texture) - { - _stampTexutre.mainTexture = texture; - } - - public void SetTreasureBoxSprite(int treasureBoxGrade, bool isOpen) - { - if (!isOpen) - { - _treasureBoxSprite.spriteName = string.Format("box_2pick_0{0}{1}", (treasureBoxGrade - 1).ToString(), "_close"); - _treasureBoxSprite.gameObject.SetActive(treasureBoxGrade > 0); - } - else - { - _treasureBoxSprite.gameObject.SetActive(value: false); - } - } - - public void SetStampVisible(bool visible) - { - _stampTexutre.gameObject.SetActive(visible); - } - - public void StampDown(float delay) - { - iTween.ScaleTo(_stampTexutre.gameObject, iTween.Hash("scale", Vector3.one * 1f, "delay", delay, "time", 0.15f, "islocal", true, "easetype", iTween.EaseType.easeOutCubic)); - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(ChangeAlpha(_stampTexutre.gameObject, delay))); - } - - public void LightOn(float delay) - { - _lightTextureAlpha.SetOnFinished(delegate - { - _lightSprite.alpha = 0f; - _lightTextureAlpha.ResetToBeginning(); - _lightTextureAlpha.from = 0f; - }); - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(LightOn(_lightTextureAlpha, delay))); - } - - public void PlaySe(int lineNum, float delay) - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlaySeCoroutine(lineNum, delay))); - } - - private IEnumerator PlaySeCoroutine(int lineNum, float delay) - { - yield return new WaitForSeconds(delay); - string text = string.Format("se_sys_bng_line_{0}", Mathf.Clamp(lineNum + 1, 1, 12).ToString("00")); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(text, text, 0f, 0L); - } - - private IEnumerator ChangeAlpha(GameObject obj, float delay) - { - yield return new WaitForSeconds(delay); - TweenAlpha.Begin(obj, 0.15f, 1f); - } - - private IEnumerator LightOn(TweenAlpha tweenAlpha, float delay) - { - _lightTextureAlpha.ResetToBeginning(); - yield return new WaitForSeconds(delay); - tweenAlpha.PlayForward(); - } - - public void CancelAnimations() - { - _lightSprite.alpha = 0f; - if (_inProcessCoroutines.Count <= 0) - { - return; - } - foreach (Coroutine inProcessCoroutine in _inProcessCoroutines) - { - UIManager.GetInstance().StopCoroutine(inProcessCoroutine); - } - } - - public void ResetStampTexture() - { - _stampTexutre.gameObject.transform.localScale = Vector3.one * 1.5f; - _stampTexutre.alpha = 0f; - } -} diff --git a/SVSim.BattleEngine/Engine/BuffDetailInfoUI.cs b/SVSim.BattleEngine/Engine/BuffDetailInfoUI.cs deleted file mode 100644 index 0817251b..00000000 --- a/SVSim.BattleEngine/Engine/BuffDetailInfoUI.cs +++ /dev/null @@ -1,395 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; -using Wizard; -using Wizard.Battle.UI; - -public class BuffDetailInfoUI : MonoBehaviour -{ - [SerializeField] - private UILabel _titleLabel; - - [SerializeField] - private UILabel _buffLabel; - - private const float TITLE_HEIGHT = 50f; - - public const string NOT_SHOW_BUFF_DETAIL_STORY_SPECIAL_BATTLE_ID = "42"; - - public float Height => 50f + (float)_buffLabel.height; - - public void Initialize() - { - _titleLabel.text = Data.SystemText.Get("BattleLog_0268"); - } - - public void SetBuffDetailLabel(BattleCardBase cardBase) - { - StringBuilder stringBuilder = new StringBuilder(); - List allBuffSkills = GetAllBuffSkills(cardBase, cardBase.BuffInfoList.Select((BuffInfo b) => b.SkillFrom).ToList()); - if (!cardBase.IsClass) - { - if (cardBase.Cost != cardBase.BaseCost) - { - int num = cardBase.Cost - cardBase.BaseCost; - string text = ((num > 0) ? ("+" + num) : num.ToString()); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0273", text)); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_powerup || s is Skill_power_down)) - { - int currentAtkBuff = cardBase.GetCurrentAtkBuff(); - int currentLifeBuff = cardBase.GetCurrentLifeBuff(); - if (currentAtkBuff != 0 || currentLifeBuff != 0) - { - string retAttack = string.Empty; - string retLife = string.Empty; - BattleLogUtility.GetBuffValueStringFormatted(currentAtkBuff, currentLifeBuff, ref retAttack, ref retLife); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0040", retAttack, retLife)); - } - } - bool flag = allBuffSkills.Any((SkillBase s) => s is Skill_quick && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)); - bool flag2 = allBuffSkills.Any((SkillBase s) => s is Skill_rush && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)); - bool flag3 = allBuffSkills.Any((SkillBase s) => s is Skill_killer && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)); - bool flag4 = allBuffSkills.Any((SkillBase s) => s is Skill_drain && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)); - if (ExistCopiedSkillNeedDetailText(cardBase)) - { - IEnumerable source = cardBase.BuffInfoList.Where((BuffInfo b) => b.IsCopied); - for (int num2 = 0; num2 < source.Count(); num2++) - { - if (source.ElementAt(num2).SkillFrom is SkillBaseCopy skillBaseCopy) - { - switch (skillBaseCopy.SkillType) - { - case "quick": - flag = true; - break; - case "rush": - flag2 = true; - break; - case "killer": - flag3 = true; - break; - case "drain": - flag4 = true; - break; - } - } - } - } - if (flag) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0011")); - } - if (flag2) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0012")); - } - if (flag3) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0009")); - } - if (flag4) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0006")); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_attack_count && (!cardBase.IsInHand || s.OnWhenPlayStart == 0))) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0018", cardBase.MaxAttackableCount.ToString())); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_ignore_guard && (!cardBase.IsInHand || s.OnWhenPlayStart == 0))) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0008")); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_consume_ep_modifier && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)) || NeedNoConsumeEpText(cardBase)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0201")); - } - } - IEnumerable source2 = from s in allBuffSkills - where s is Skill_shield && (!cardBase.IsInHand || s.OnWhenPlayStart == 0) - select (Skill_shield)s; - if (source2.Any()) - { - if (source2.Any((Skill_shield s) => s.IsAllDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0274")); - } - if (source2.Any((Skill_shield s) => s.IsNextDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0275")); - } - if (source2.Any((Skill_shield s) => s.IsSkillDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0276")); - } - if (source2.Any((Skill_shield s) => s.IsSpellDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0277")); - } - } - List source3 = (from s in allBuffSkills - where s is Skill_damage_cut && (!cardBase.IsInHand || s.OnWhenPlayStart == 0) - select (Skill_damage_cut)s).ToList(); - if (source3.Any()) - { - if (source3.Any((Skill_damage_cut s) => s.IsAllDamageCut)) - { - int num3 = -source3.Where((Skill_damage_cut s) => s.IsAllDamageCut).Sum((Skill_damage_cut s) => s.CutAmount); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0278", num3.ToString())); - } - if (source3.Any((Skill_damage_cut s) => s.IsNextDamageCut)) - { - int num4 = -source3.Where((Skill_damage_cut s) => s.IsNextDamageCut).Sum((Skill_damage_cut s) => s.CutAmount); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0279", num4.ToString())); - } - if (source3.Any((Skill_damage_cut s) => s.IsSkillDamageCut)) - { - int num5 = -source3.Where((Skill_damage_cut s) => s.IsSkillDamageCut).Sum((Skill_damage_cut s) => s.CutAmount); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0280", num5.ToString())); - } - if (source3.Any((Skill_damage_cut s) => s.IsDamageClipping)) - { - List list = (from s in source3 - where s.ClippingMax != int.MaxValue - select s.ClippingMax).ToList(); - if (source3.Any((Skill_damage_cut s) => !IsNotShowDamageCutLifeLowerLimitBuffDetail(s))) - { - list.AddRange(from s in source3 - where s.LifeLowerLimit != -1 - select (!(s.SkillPrm.ownerCard is UnitBattleCard)) ? (s.SkillPrm.ownerCard.SelfBattlePlayer.Class.Life - 1) : (s.SkillPrm.ownerCard.Life - 1)); - } - if (list.Any()) - { - int num6 = list.Min(); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0281", (num6 + 1).ToString(), num6.ToString())); - } - } - } - _buffLabel.text = stringBuilder.ToString(); - } - - public void SetBuffDetailLabelInReplay(List buffInfoTextTypeList, BattleCardBase card) - { - StringBuilder stringBuilder = new StringBuilder(); - if (!card.IsClass) - { - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Cost)) - { - int num = card.Cost - card.BaseCost; - string text = ((num > 0) ? ("+" + num) : num.ToString()); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0273", text)); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.StatusBuff)) - { - string retAttack = string.Empty; - string retLife = string.Empty; - BattleLogUtility.GetBuffValueStringFormatted(card.GetCurrentAtkBuff(), card.GetCurrentLifeBuff(), ref retAttack, ref retLife); - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0040", retAttack, retLife)); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Quick)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0011")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Rush)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0012")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Killer)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0009")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Drain)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0006")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AttackCount)) - { - int value = buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AttackCount).Value; - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0018", value.ToString())); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.IgnoreGuard)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0008")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.ConsumeEpModifier)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0201")); - } - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0274")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0275")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0276")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SpellDamageShield)) - { - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0277")); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageCut)) - { - int num2 = -buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageCut).Value; - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0278", num2.ToString())); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageCut)) - { - int num3 = -buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageCut).Value; - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0279", num3.ToString())); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageCut)) - { - int num4 = -buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageCut).Value; - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0280", num4.ToString())); - } - if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.DamageClipping)) - { - int value2 = buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.DamageClipping).Value; - AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0281", (value2 + 1).ToString(), value2.ToString())); - } - _buffLabel.text = stringBuilder.ToString(); - } - - public static List GetAllBuffSkills(BattleCardBase cardBase, List buffSkills) - { - List list = new List(); - foreach (SkillBase buffSkill in buffSkills) - { - if (buffSkill is Skill_attach_skill) - { - IEnumerable source = from b in buffSkill.GetBuffInfoContainer() - where cardBase == b._targetCard - select b._attachSkill; - list.AddRange(GetAllBuffSkills(cardBase, source.Where((SkillBase s) => !cardBase.IsClass || !ExistClassSkillNeedBuffDetailText(s)).ToList())); - } - else - { - list.Add(buffSkill); - } - } - return list; - } - - public void AppendBuffText(StringBuilder buffTextsStringBuilder, string buffText) - { - if (buffTextsStringBuilder.Length > 0) - { - buffTextsStringBuilder.Append("\r\n"); - } - buffTextsStringBuilder.Append(buffText); - } - - public static bool NeedBuffDetailText(BattleCardBase cardBase) - { - if (cardBase is ClassBattleCardBase) - { - return cardBase.BuffInfoList.Any((BuffInfo s) => ExistClassSkillNeedBuffDetailText(s.SkillFrom)); - } - if (!cardBase.BuffInfoList.Exists((BuffInfo b) => ExistSkillNeedBuffDetailText(cardBase, b.SkillFrom))) - { - return NeedNoConsumeEpText(cardBase); - } - return true; - } - - public static bool IsNotShowDamageCutLifeLowerLimitBuffDetail(SkillBase skill) - { - bool num = skill is Skill_damage_cut { IsDamageClipping: not false } skill_damage_cut && skill_damage_cut.LifeLowerLimit != -1; - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; - if (num && specialBattleSettingInfo != null && specialBattleSettingInfo.Id == "42") - { - return skill.SkillPrm.ownerCard is EnemyClassBattleCard; - } - return false; - } - - private static bool ExistSkillNeedBuffDetailText(BattleCardBase cardBase, SkillBase skill) - { - if (cardBase.IsInHand && skill.Option.Contains("(timing:when_play)")) - { - return false; - } - if (!(skill is Skill_quick) && !(skill is Skill_ignore_guard) && !(skill is Skill_attack_count) && !(skill is Skill_shield) && !(skill is Skill_damage_cut) && !(skill is Skill_rush) && !ExistSkillCostChangeNeedDetailText(cardBase, skill) && !(skill is Skill_consume_ep_modifier) && !(skill is Skill_killer) && !(skill is Skill_drain) && !ExistSKillPowerChangeNeedDetailText(cardBase, skill) && !ExistAttachSkillNeedDetailText(cardBase, skill)) - { - return ExistCopiedSkillNeedDetailText(cardBase); - } - return true; - } - - private static bool ExistClassSkillNeedBuffDetailText(SkillBase skill) - { - if (!(skill is Skill_shield)) - { - if (skill is Skill_damage_cut) - { - return !IsNotShowDamageCutLifeLowerLimitBuffDetail(skill); - } - return false; - } - return true; - } - - public static bool NeedNoConsumeEpText(BattleCardBase cardBase) - { - if (cardBase.BuffInfoList.Any((BuffInfo b) => b.SkillFrom is Skill_consume_ep_modifier)) - { - return true; - } - if (DetailPanelControl.IsNeedNoConsumeEp(cardBase)) - { - return true; - } - return false; - } - - private static bool ExistSKillPowerChangeNeedDetailText(BattleCardBase cardBase, SkillBase skill) - { - if (skill is Skill_powerup || skill is Skill_power_down) - { - int currentAtkBuff = cardBase.GetCurrentAtkBuff(); - int currentLifeBuff = cardBase.GetCurrentLifeBuff(); - if (currentAtkBuff == 0) - { - return currentLifeBuff != 0; - } - return true; - } - return false; - } - - private static bool ExistAttachSkillNeedDetailText(BattleCardBase cardBase, SkillBase skill) - { - if (skill is Skill_attach_skill) - { - return skill.GetBuffInfoContainer().Any((SkillBase.BuffInfoContainer b) => cardBase == b._targetCard && ExistSkillNeedBuffDetailText(cardBase, b._attachSkill)); - } - return false; - } - - public static bool ExistCopiedSkillNeedDetailText(BattleCardBase cardBase) - { - return cardBase.BuffInfoList.Any(delegate(BuffInfo b) - { - if (!b.IsCopied) - { - return false; - } - return b.SkillFrom is SkillBaseCopy skillBaseCopy && skillBaseCopy.IsNeedDetail; - }); - } - - private static bool ExistSkillCostChangeNeedDetailText(BattleCardBase cardBase, SkillBase skill) - { - if (skill is Skill_cost_change) - { - return cardBase.Cost != cardBase.BaseCost; - } - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/BuffInfo.cs b/SVSim.BattleEngine/Engine/BuffInfo.cs index 190ad8ca..72e4f28a 100644 --- a/SVSim.BattleEngine/Engine/BuffInfo.cs +++ b/SVSim.BattleEngine/Engine/BuffInfo.cs @@ -4,9 +4,6 @@ using Wizard; public class BuffInfo { - public List CopiedSkillDescriptionValueList = new List(); - - public List CopiedEvoSkillDescriptionValueList = new List(); public int BaseCardIDFrom { get; private set; } @@ -61,11 +58,6 @@ public class BuffInfo } } - public string GetAttachFromCardName() - { - return CardMaster.GetInstanceForBattle().GetCardParameterFromId(BaseCardIDFrom).CardName; - } - public void SetPreviousOwner(BattleCardBase card) { PreviousOwner = card; @@ -102,18 +94,4 @@ public class BuffInfo } return SkillFrom == skill; } - - public BattleCardBase GetDisplayCard() - { - BattleCardBase result = OwnerCard; - if (PreviousOwner != null) - { - result = PreviousOwner; - } - if (IsSaveBurialRiteSkill || IsGetonSkill || IsReserveTokenDrawSkill) - { - result = TargetCard; - } - return result; - } } diff --git a/SVSim.BattleEngine/Engine/BuyCrystal.cs b/SVSim.BattleEngine/Engine/BuyCrystal.cs deleted file mode 100644 index 8c500a58..00000000 --- a/SVSim.BattleEngine/Engine/BuyCrystal.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard; - -public class BuyCrystal : MonoBehaviour -{ - public static void CreateBuyCrystal(bool isPlaySe = true, string scrollToProductId = null, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false) - { - if (isPlaySe) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - } - if (!onlyInputBirthday && Data.Load.data._userCrystalCount.EnableSpecialCrystal) - { - SpecialCrystalDialog.Create(UIManager.GetInstance().LegendCrystalBuyDialogPrefab, scrollToProductId, onCancel, onFinish); - } - else - { - InstantiateCrystalDialog(scrollToProductId, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal); - } - } - - public static void InstantiateCrystalDialog(string scrollToProductId = null, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false) - { - PaymentPC instance = PaymentPC.GetInstance(); - instance.initialize(); - instance.ProductListFailed += PaymentListErrorDialog; - instance.ProductListSucceeded += delegate - { - OpenItemList(scrollToProductId, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal); - }; - } - - private static void CheckVideoHostingRunningAndOpenItemList(string scrollToProductid, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false) - { - if (SingletonMonoBehaviour.instance.IsRecording() || SingletonMonoBehaviour.instance.IsPublising()) - { - VideoHostingUtil.CreateDialogPrivacyBuyCrystalEnter(delegate - { - OpenItemList(scrollToProductid, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal); - }); - } - else - { - OpenItemList(scrollToProductid, onlyInputBirthday, onCancel, onFinish, isSpecialCrystal); - } - } - - private static void OpenItemList(string scrollToProductId, bool onlyInputBirthday = false, Action onCancel = null, Action onFinish = null, bool isSpecialCrystal = false) - { - BuyCrystal buyCrystal = UnityEngine.Object.Instantiate(UIManager.GetInstance().BuyCrystalPrefab); - UIManager.GetInstance().IsCrystalDialogExe = true; - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - dialog.SetSize(DialogBase.Size.M); - dialog.SetTitleLabel(Data.SystemText.Get("Shop_0003")); - dialog.SetObj(buyCrystal.gameObject); - dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialog.isNotCloseWindowButton1 = true; - dialog.SetButtonText(Data.SystemText.Get("Dia_BuyCrystal_001_Button")); - dialog.OnClose = delegate - { - if (!isSpecialCrystal || !onlyInputBirthday) - { - PaymentImpl.GetInstance().finalize(); - } - if (VideoHostingUtil.IsAutoPauseRecording() || VideoHostingUtil.IsAutoPausePublishing()) - { - VideoHostingUtil.CreateDialogPrivacyBuyCrystalExit(); - } - UIManager.GetInstance().IsCrystalDialogExe = false; - }; - UIManager.GetInstance().closeInSceneLoading(); - CreateItemList item_list = buyCrystal.gameObject.GetComponent(); - item_list.ParentDialogBase = dialog; - item_list.ScrollToProductId = scrollToProductId; - item_list.IsOnlyInputBirthday = onlyInputBirthday; - item_list.OnFinishUpdateBirthday = delegate - { - onFinish.Call(); - if (onlyInputBirthday) - { - dialog.Close(); - } - }; - dialog.onPushButton1 = delegate - { - item_list.BirthUpdateButtonClickCallBack(); - }; - dialog.onPushButton2 = delegate - { - item_list.BirthCancelButtonClickCallBack(); - }; - dialog.onCloseWithoutSelect = delegate - { - onCancel.Call(); - }; - } - - public static void PaymentListErrorDialog() - { - if (BattleManagerBase.GetIns() == null) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0094")); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetText(Data.SystemText.Get("Shop_0093")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(100); - } - } - - public void OnClickCredit() - { - } -} diff --git a/SVSim.BattleEngine/Engine/ByteReader.cs b/SVSim.BattleEngine/Engine/ByteReader.cs deleted file mode 100644 index 36b9c1a8..00000000 --- a/SVSim.BattleEngine/Engine/ByteReader.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using UnityEngine; - -public class ByteReader -{ - private byte[] mBuffer; - - private int mOffset; - - private static BetterList mTemp = new BetterList(); - - public bool canRead - { - get - { - if (mBuffer != null) - { - return mOffset < mBuffer.Length; - } - return false; - } - } - - public ByteReader(byte[] bytes) - { - mBuffer = bytes; - } - - public ByteReader(TextAsset asset) - { - mBuffer = asset.bytes; - } - - public static ByteReader Open(string path) - { - FileStream fileStream = File.OpenRead(path); - if (fileStream != null) - { - fileStream.Seek(0L, SeekOrigin.End); - byte[] array = new byte[fileStream.Position]; - fileStream.Seek(0L, SeekOrigin.Begin); - fileStream.Read(array, 0, array.Length); - fileStream.Close(); - return new ByteReader(array); - } - return null; - } - - private static string ReadLine(byte[] buffer, int start, int count) - { - return Encoding.UTF8.GetString(buffer, start, count); - } - - public string ReadLine() - { - return ReadLine(skipEmptyLines: true); - } - - public string ReadLine(bool skipEmptyLines) - { - int num = mBuffer.Length; - if (skipEmptyLines) - { - while (mOffset < num && mBuffer[mOffset] < 32) - { - mOffset++; - } - } - int num2 = mOffset; - if (num2 < num) - { - int num3; - do - { - if (num2 < num) - { - num3 = mBuffer[num2++]; - continue; - } - num2++; - break; - } - while (num3 != 10 && num3 != 13); - string result = ReadLine(mBuffer, mOffset, num2 - mOffset - 1); - mOffset = num2; - return result; - } - mOffset = num; - return null; - } - - public Dictionary ReadDictionary() - { - Dictionary dictionary = new Dictionary(); - char[] separator = new char[1] { '=' }; - while (canRead) - { - string text = ReadLine(); - if (text == null) - { - break; - } - if (!text.StartsWith("//")) - { - string[] array = text.Split(separator, 2, StringSplitOptions.RemoveEmptyEntries); - if (array.Length == 2) - { - string key = array[0].Trim(); - string value = array[1].Trim().Replace("\\n", "\n"); - dictionary[key] = value; - } - } - } - return dictionary; - } - - public BetterList ReadCSV() - { - mTemp.Clear(); - string text = ""; - bool flag = false; - int num = 0; - while (canRead) - { - if (flag) - { - string text2 = ReadLine(skipEmptyLines: false); - if (text2 == null) - { - return null; - } - text2 = text2.Replace("\\n", "\n"); - text = text + "\n" + text2; - } - else - { - text = ReadLine(skipEmptyLines: true); - if (text == null) - { - return null; - } - text = text.Replace("\\n", "\n"); - num = 0; - } - int i = num; - for (int length = text.Length; i < length; i++) - { - switch (text[i]) - { - case ',': - if (!flag) - { - mTemp.Add(text.Substring(num, i - num)); - num = i + 1; - } - break; - case '"': - if (flag) - { - if (i + 1 >= length) - { - mTemp.Add(text.Substring(num, i - num).Replace("\"\"", "\"")); - return mTemp; - } - if (text[i + 1] != '"') - { - mTemp.Add(text.Substring(num, i - num).Replace("\"\"", "\"")); - flag = false; - if (text[i + 1] == ',') - { - i++; - num = i + 1; - } - } - else - { - i++; - } - } - else - { - num = i + 1; - flag = true; - } - break; - } - } - if (num < text.Length) - { - if (flag) - { - continue; - } - mTemp.Add(text.Substring(num, text.Length - num)); - } - return mTemp; - } - return null; - } -} diff --git a/SVSim.BattleEngine/Engine/CardBasePrm.cs b/SVSim.BattleEngine/Engine/CardBasePrm.cs index a20a3cd0..f11e92f5 100644 --- a/SVSim.BattleEngine/Engine/CardBasePrm.cs +++ b/SVSim.BattleEngine/Engine/CardBasePrm.cs @@ -75,18 +75,6 @@ public static class CardBasePrm } } - public const int MAX_LIFE = 20; - - public const int BERSERK_COUNT = 10; - - public const int AVARICE_COUNT = 2; - - public const int WRATH_COUNT = 7; - - public const int AWAKE_PP = 7; - - public const int MAX_DRAW_CARD = 8; - private static List _defaultType; public static List DefaultType @@ -114,17 +102,6 @@ public static class CardBasePrm return result; } - public static bool ToBoolIsFoil(string str) - { - int num = int.Parse(str); - bool result = false; - if (num == 1) - { - result = true; - } - return result; - } - public static ClanType ToStrClanType(string str) { int value = int.Parse(str); diff --git a/SVSim.BattleEngine/Engine/CardCreatorBase.cs b/SVSim.BattleEngine/Engine/CardCreatorBase.cs index 467c2c83..aff7c56c 100644 --- a/SVSim.BattleEngine/Engine/CardCreatorBase.cs +++ b/SVSim.BattleEngine/Engine/CardCreatorBase.cs @@ -88,9 +88,9 @@ public class CardCreatorBase return null; } GameObject gobj = cardCreatorBase.LoadRootObject(); - GameObject gameObject = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(gobj, BattleManagerBase.GetIns().Battle3DContainer); + GameObject gameObject = battleMgr.GameMgr.GetPrefabMgr().CloneObjectToParent(gobj, battleMgr.Battle3DContainer); CardTemplate component = gameObject.GetComponent(); - if (flag && !GameMgr.GetIns().IsWatchBattle && !sBattleLoad.isDbgEnableEnemyHandView && !GameMgr.GetIns().IsAdmin) + if (flag && !battleMgr.GameMgr.IsWatchBattle && !sBattleLoad.isDbgEnableEnemyHandView && !battleMgr.GameMgr.IsAdmin) { gameObject.GetComponent().CardNormalLodGroup.enabled = false; } @@ -189,9 +189,9 @@ public class CardCreatorBase CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId); _ = cardParameterFromId.CharType; GameObject gobj = new SpecialSkillCardCreator(sBattleLoad.SpellCardTemplate.gameObject).LoadRootObject(); - GameObject gameObject = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(gobj, BattleManagerBase.GetIns().Battle3DContainer); + GameObject gameObject = battleMgr.GameMgr.GetPrefabMgr().CloneObjectToParent(gobj, battleMgr.Battle3DContainer); CardTemplate component = gameObject.GetComponent(); - if (flag && !GameMgr.GetIns().IsWatchBattle && !sBattleLoad.isDbgEnableEnemyHandView && !GameMgr.GetIns().IsAdmin) + if (flag && !battleMgr.GameMgr.IsWatchBattle && !sBattleLoad.isDbgEnableEnemyHandView && !battleMgr.GameMgr.IsAdmin) { gameObject.GetComponent().CardNormalLodGroup.enabled = false; } @@ -231,7 +231,7 @@ public class CardCreatorBase tag2 = "Enemy"; gameObject.name = "E0"; } - CardTypeBuildInfo cardTypeBuildInfo = CreateCardTypeBuildInfo(cardParameterFromId.CharType, isPlayer); + CardTypeBuildInfo cardTypeBuildInfo = CreateCardTypeBuildInfo(battleMgr, cardParameterFromId.CharType, isPlayer); gameObject.SetActive(cardTypeBuildInfo.isActive); gameObject.transform.localPosition = cardTypeBuildInfo.localPosition; gameObject.transform.localScale = cardTypeBuildInfo.localScale; @@ -262,7 +262,7 @@ public class CardCreatorBase tag = "Enemy"; gameObject.name = "E" + battleCardIndex; } - CardTypeBuildInfo cardTypeBuildInfo = CreateCardTypeBuildInfo(cardParameterFromId.CharType, isPlayer); + CardTypeBuildInfo cardTypeBuildInfo = CreateCardTypeBuildInfo(battleMgr, cardParameterFromId.CharType, isPlayer); gameObject.SetActive(cardTypeBuildInfo.isActive); gameObject.transform.localPosition = cardTypeBuildInfo.localPosition; gameObject.transform.localScale = cardTypeBuildInfo.localScale; @@ -287,11 +287,6 @@ public class CardCreatorBase return CreateBase(new BattleCardBase.BuildInfo(null, cardId, battleMgr.GetBattlePlayer(isPlayer), battleMgr.GetBattlePlayer(!isPlayer), battleMgr.GetBattlePlayer(isPlayer), cardSkillsBuildInfo.normalSkillBuildInfos, cardSkillsBuildInfo.evolveSkillBuildInfos, isPlayer, battleCardIndex, innerOptionsBuilder.CreateCardOptions(), battleMgr, battleMgr.BattleResourceMgr), createNullView: true); } - public static BattleCardBase CreateVirtualClass(bool isPlayer, BattleManagerBase battleMgr, IInnerOptionsBuilder innerOptionsBuilder) - { - return new VirtualClassBattleCard(new ClassBattleCardBase.ClassBuildInfo(isPlayer, 20, battleMgr.GetBattlePlayer(isPlayer), battleMgr.GetBattlePlayer(!isPlayer), battleMgr, NullBattleResourceMgr.GetInstance())); - } - public static BattleCardBase CreateVirtualCard(int cardId, int index, bool isPlayer, BattleManagerBase battleMgr, BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer, IInnerOptionsBuilder innerOptionsBuilder) { CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId); @@ -367,9 +362,8 @@ public class CardCreatorBase return _dummyCardInstance; } - private static CardTypeBuildInfo CreateCardTypeBuildInfo(CardBasePrm.CharaType type, bool isPlayer) + private static CardTypeBuildInfo CreateCardTypeBuildInfo(BattleManagerBase ins, CardBasePrm.CharaType type, bool isPlayer) { - BattleManagerBase ins = BattleManagerBase.GetIns(); CardTypeBuildInfo cardTypeBuildInfo = new CardTypeBuildInfo(); if (type == CardBasePrm.CharaType.CLASS) { @@ -389,16 +383,4 @@ public class CardCreatorBase } return cardTypeBuildInfo; } - - public static void SetupClassMaterialToCenterCharacterMesh(MeshRenderer insideMesh, MeshRenderer outsideMesh, Material cardArtMaterial, Material cardFrameMaterial) - { - Material[] materials = insideMesh.materials; - Material[] materials2 = outsideMesh.materials; - cardFrameMaterial.shader = Shader.Find(cardFrameMaterial.shader.name); - cardArtMaterial.shader = Shader.Find(cardArtMaterial.shader.name); - materials2[0] = cardFrameMaterial; - materials[0] = cardArtMaterial; - insideMesh.materials = materials; - outsideMesh.materials = materials2; - } } diff --git a/SVSim.BattleEngine/Engine/CardDataModel.cs b/SVSim.BattleEngine/Engine/CardDataModel.cs index fdf8383d..37f0c874 100644 --- a/SVSim.BattleEngine/Engine/CardDataModel.cs +++ b/SVSim.BattleEngine/Engine/CardDataModel.cs @@ -20,12 +20,6 @@ public class CardDataModel public int skillMovementNum { get; set; } - public bool IsAttachSkill { get; set; } - - public int skillAttachCardIndex { get; set; } - - public int skillAttachSkillIndex { get; set; } - public List skillKeyCardIdxList { get; set; } public List SkillKeyCardIdList { get; set; } diff --git a/SVSim.BattleEngine/Engine/CardDetailBase.cs b/SVSim.BattleEngine/Engine/CardDetailBase.cs index 1261e573..9c877083 100644 --- a/SVSim.BattleEngine/Engine/CardDetailBase.cs +++ b/SVSim.BattleEngine/Engine/CardDetailBase.cs @@ -9,9 +9,6 @@ public class CardDetailBase : MonoBehaviour [Serializable] public class BgSizeInfo { - public int Line; - - public int BgSize; } [Serializable] @@ -33,51 +30,19 @@ public class CardDetailBase : MonoBehaviour public UILabel DiscLabel; - public BoxCollider DiscCollider; - public UIScrollBar DiscScrollBar; public int DefaultBgHeight; public UILabel _costLabel; - public UILabel _signLabel; - - public UILabel _zeroCostLabel; - - public UILabel _signedCostLabel; - - public UISprite _costSprite; - public UILabel _classLabel; public UISprite _classBG; - public GameObject _myRotationInfo; - - public UILabel _myRotationClassLabel; - - public GameObject _myRotationBonusIconOriginal; - - public UIGrid _myRotationBonusIconGrid; - - public FlexibleGrid _myRotationInfoGrid; - public UIRect RootAnchor; - - public void Initialize() - { - } } - private const int EVO_OR_FUSION_BUTTON_OFFSET = 65; - - private const int CLASS_LABEL_HEIGHT = 89; - - private const int PANEL_BOTTOM__ANCHOR = 4; - - private const int PANEL_BOTTOM__ANCHOR_SCROLL = 16; - [SerializeField] protected DetailPanelInfo _followerPanel; @@ -160,29 +125,4 @@ public class CardDetailBase : MonoBehaviour label.ProcessText(); return Global.GetTextLineCount(label.processedText); } - - protected void SetDetailKeywordEvents(Action onClick, BattleCardBase card, CardParameter baseParameter, DetailPanelControl control) - { - SetDetailKeywordEvent(_followerPanel, onClick, card, baseParameter, control); - SetDetailKeywordEvent(_followerEvoPanel, onClick, card, baseParameter, control); - SetDetailKeywordEvent(_nonFollowerPanel, onClick, card, baseParameter, control); - } - - private void SetDetailKeywordEvent(DetailPanelInfo panelInfo, Action onClick, BattleCardBase card, CardParameter baseParameter, DetailPanelControl control) - { - UILabel label = panelInfo.DiscLabel; - BoxCollider discCollider = panelInfo.DiscCollider; - if (label.text != " ") - { - UIEventListener.Get(discCollider.gameObject).onClick = delegate - { - onClick.Call(card, label.gameObject, baseParameter); - }; - BattlePlayerView.SetKeyWordColor(discCollider.gameObject, label, control); - } - else - { - UIEventListener.Get(discCollider.gameObject).onClick = null; - } - } } diff --git a/SVSim.BattleEngine/Engine/CardDetailFilterCategory.cs b/SVSim.BattleEngine/Engine/CardDetailFilterCategory.cs deleted file mode 100644 index 95cb260c..00000000 --- a/SVSim.BattleEngine/Engine/CardDetailFilterCategory.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -public class CardDetailFilterCategory : MonoBehaviour -{ - [SerializeField] - private UILabel _categoryName; - - [SerializeField] - private UIGrid _grid; - - public List AllKeyWord { get; private set; } - - private void Awake() - { - AllKeyWord = new List(); - } - - public void Initialize(string name) - { - _categoryName.text = name; - } - - public void Reset() - { - foreach (CardDetailFilterKeyWord item in AllKeyWord) - { - item.Reset(); - } - } - - public void AddChild(CardDetailFilterKeyWord keyword) - { - keyword.transform.parent = _grid.transform; - keyword.transform.localScale = Vector3.one; - _grid.Reposition(); - AllKeyWord.Add(keyword); - } -} diff --git a/SVSim.BattleEngine/Engine/CardDetailFilterDialog.cs b/SVSim.BattleEngine/Engine/CardDetailFilterDialog.cs deleted file mode 100644 index e75e69c6..00000000 --- a/SVSim.BattleEngine/Engine/CardDetailFilterDialog.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class CardDetailFilterDialog : MonoBehaviour -{ - private const int DIALOG_PANEL_DEPTH = 15; - - [SerializeField] - private CardDetailFilterCategory _categoryOriginal; - - [SerializeField] - private CardDetailFilterKeyWord _keywordOriginal; - - [SerializeField] - private FlexibleGrid _grid; - - [SerializeField] - private UIButton _resetButton; - - private List _allCategory = new List(); - - private List _saveList; - - private bool _initializeFinish; - - private bool _isChanged; - - private Dictionary _existKeyWordDictionary; - - public Action OnChange { get; set; } - - public DialogBase Dialog { get; private set; } - - public static CardDetailFilterDialog Create(GameObject prefab, List saveList, Dictionary existKeyWordDictionary) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0227")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.SetPanelDepth(15); - GameObject gameObject = UnityEngine.Object.Instantiate(prefab); - dialogBase.SetObj(gameObject); - CardDetailFilterDialog component = gameObject.GetComponent(); - component.Dialog = dialogBase; - component._saveList = saveList; - component._existKeyWordDictionary = existKeyWordDictionary; - return component; - } - - private bool IsCheckedInSaveList(string keyword) - { - if (_saveList != null) - { - return _saveList.Contains(keyword); - } - return false; - } - - private void Start() - { - _categoryOriginal.gameObject.SetActive(value: false); - _keywordOriginal.gameObject.SetActive(value: false); - foreach (string category in Data.Master.CardFilterKeyWord.CategoryList) - { - AddCategory(Data.SystemText.Get(category), Data.Master.CardFilterKeyWord.GetCategory(category)); - } - _grid.Reposition(); - UIEventListener.Get(_resetButton.gameObject).onClick = delegate - { - OnClickResetButton(); - }; - _initializeFinish = true; - } - - private void AddCategory(string categoryName, List keyList) - { - List list = new List(); - foreach (string key2 in keyList) - { - string key = Data.Master.BattleKeyWordTitleDic[key2]; - if (_existKeyWordDictionary == null || _existKeyWordDictionary.ContainsKey(key)) - { - list.Add(key2); - } - } - if (list.Count == 0) - { - return; - } - CardDetailFilterCategory component = NGUITools.AddChild(_grid.gameObject, _categoryOriginal.gameObject).GetComponent(); - _allCategory.Add(component); - component.name = "category_" + categoryName; - component.gameObject.SetActive(value: true); - component.Initialize(categoryName); - foreach (string item in list) - { - string keyword = Data.Master.BattleKeyWordTitleDic[item]; - CardDetailFilterKeyWord component2 = UnityEngine.Object.Instantiate(_keywordOriginal.gameObject).GetComponent(); - component2.gameObject.SetActive(value: true); - component2.Initialize(keyword); - component2.OnValueChange = delegate - { - if (_initializeFinish) - { - _isChanged = true; - } - }; - component.AddChild(component2); - if (IsCheckedInSaveList(keyword)) - { - component2.SetChecked(); - } - } - } - - private void Update() - { - if (_isChanged) - { - _isChanged = false; - List filterList = GetFilterList(); - if (!IsSameList(_saveList, filterList)) - { - _saveList = filterList; - OnChange.Call(); - } - } - } - - private int GetListCount(List list) - { - return list?.Count ?? 0; - } - - private bool IsSameList(List list1, List list2) - { - if (GetListCount(list1) == 0 && GetListCount(list2) == 0) - { - return true; - } - if (GetListCount(list1) != GetListCount(list2)) - { - return false; - } - foreach (string item in list1) - { - if (!list2.Contains(item)) - { - return false; - } - } - foreach (string item2 in list2) - { - if (!list1.Contains(item2)) - { - return false; - } - } - return true; - } - - private void OnClickResetButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - foreach (CardDetailFilterCategory item in _allCategory) - { - item.Reset(); - } - } - - public List GetFilterList() - { - List list = null; - foreach (CardDetailFilterCategory item in _allCategory) - { - foreach (CardDetailFilterKeyWord item2 in item.AllKeyWord) - { - if (item2.IsEnableKeyWord) - { - if (list == null) - { - list = new List(); - } - list.Add(item2.KeyWord); - } - } - } - return list; - } -} diff --git a/SVSim.BattleEngine/Engine/CardDetailFilterKeyWord.cs b/SVSim.BattleEngine/Engine/CardDetailFilterKeyWord.cs deleted file mode 100644 index f71dcaae..00000000 --- a/SVSim.BattleEngine/Engine/CardDetailFilterKeyWord.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -public class CardDetailFilterKeyWord : MonoBehaviour -{ - [SerializeField] - private UIToggle _toggle; - - [SerializeField] - private UILabel _label; - - private bool _checkedCache; - - public bool IsEnableKeyWord => _toggle.value; - - public string KeyWord { get; private set; } - - public Action OnValueChange { get; set; } - - private void Start() - { - } - - public void Reset() - { - _checkedCache = false; - _toggle.value = false; - } - - public void SetChecked() - { - _checkedCache = true; - _toggle.value = true; - } - - public void Initialize(string keyword) - { - EventDelegate.Add(_toggle.onChange, delegate - { - if (_toggle.value != _checkedCache) - { - _checkedCache = _toggle.value; - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - OnValueChange.Call(); - }); - _label.text = keyword; - KeyWord = keyword; - } -} diff --git a/SVSim.BattleEngine/Engine/CardDetailFilterOffButton.cs b/SVSim.BattleEngine/Engine/CardDetailFilterOffButton.cs deleted file mode 100644 index b06d6197..00000000 --- a/SVSim.BattleEngine/Engine/CardDetailFilterOffButton.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -public class CardDetailFilterOffButton : MonoBehaviour -{ - [SerializeField] - private UILabel _label; - - [SerializeField] - private UIButton _button; - - [SerializeField] - private UISprite _backGround; - - private string _keyword; - - public Action OnClick { get; set; } - - private void Start() - { - EventDelegate.Add(_button.onClick, delegate - { - OnClick.Call(_keyword); - }); - } - - public void Initialize(string text) - { - _keyword = text; - _label.text = text; - _label.InitializeFont(); - _label.ProcessText(); - _backGround.ResetAndUpdateAnchors(); - } -} diff --git a/SVSim.BattleEngine/Engine/CardDetailUI.cs b/SVSim.BattleEngine/Engine/CardDetailUI.cs index a6265022..ddf7d599 100644 --- a/SVSim.BattleEngine/Engine/CardDetailUI.cs +++ b/SVSim.BattleEngine/Engine/CardDetailUI.cs @@ -1,2620 +1,2431 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle.View; - -public class CardDetailUI : UIBase -{ - private class CardVoiceData - { - private const string ACC_CARD_ID_GROUP = "ACC_CARD_ID"; - - private const string ACC_CARD_ID_REGEX = "card_id=(?80\\d*)"; - - public readonly string MainVoiceId; - - public readonly List _acceleratedVoiceIdList = new List(); - - public readonly List _voiceListBeforeEvo; - - public readonly List _voiceListAfterEvo; - - private CardMaster.CardMasterId _cardMasterId; - - private List _splitVoiceList; - - public CardVoiceData(CardParameter cardParam, CardMaster.CardMasterId cardMasterId) - { - _cardMasterId = cardMasterId; - VoiceDictionaries voiceDictionaries = new VoiceDictionaries(cardParam.CardId, _cardMasterId); - MainVoiceId = voiceDictionaries.VoiceId; - List list = new List(); - List normalPlayVoices = voiceDictionaries.GetNormalPlayVoices(); - list.AddRange(normalPlayVoices); - list.AddRange(voiceDictionaries.atkVoices.GetAllVoiceList()); - list.AddRange(voiceDictionaries.destroyVoices.GetAllVoiceList()); - AddVoiceList(list, voiceDictionaries.skillVoices); - SkillOptionValue skillOptionValue = new SkillOptionValue(cardParam.SkillOption); - string option = skillOptionValue.GetOption(SkillFilterCreator.ContentKeyword.skill); - if (!string.IsNullOrEmpty(option)) - { - Skill_attach_skill.AttachOptionInfo attachOptionInfo = new Skill_attach_skill.AttachOptionInfo(option); - if (attachOptionInfo.Voice != string.Empty) - { - VoiceDictionary item = new VoiceDictionary(attachOptionInfo.Voice); - voiceDictionaries.attachSkillVoices.Add(item); - } - } - bool flag = skillOptionValue.GetOption(SkillFilterCreator.ContentKeyword.is_evolve, "false") == "true"; - if (voiceDictionaries.attachSkillVoices.Count > 0 && !flag) - { - AddVoiceList(list, voiceDictionaries.attachSkillVoices, list); - } - MatchCollection matchCollection = new Regex("card_id=(?80\\d*)").Matches(cardParam.SkillOption); - _acceleratedVoiceIdList.Clear(); - for (int i = 0; i < matchCollection.Count; i++) - { - VoiceDictionaries voiceDictionaries2 = new VoiceDictionaries(int.Parse(matchCollection[i].Groups["ACC_CARD_ID"].Value), _cardMasterId); - list.AddRange(voiceDictionaries2.playVoices.GetAllVoiceList()); - string voiceId = voiceDictionaries2.VoiceId; - if (!string.IsNullOrEmpty(voiceId)) - { - _acceleratedVoiceIdList.Add(voiceId); - } - } - _voiceListBeforeEvo = GetPlayableVoiceList(list); - List list2 = new List(); - list2.AddRange(voiceDictionaries.evoVoices.GetAllVoiceList()); - list2.AddRange(voiceDictionaries.evoAtkVoices.GetAllVoiceList()); - list2.AddRange(voiceDictionaries.evoDestroyVoices.GetAllVoiceList()); - AddVoiceList(list2, voiceDictionaries.evoSkillVoices, list); - if (voiceDictionaries.attachSkillVoices.Count > 0 && flag) - { - AddVoiceList(list2, voiceDictionaries.attachSkillVoices, list2); - } - _voiceListAfterEvo = GetPlayableVoiceList(list2); - } - - private List GetPlayableVoiceList(List voiceList) - { - List list = new List(); - for (int i = 0; i < voiceList.Count; i++) - { - if (!Data.Master.CardDetailVoiceIgnoreList.Contains(voiceList[i])) - { - list.Add(voiceList[i]); - } - } - return list; - } - - private void AddVoiceList(List tempVoiceList, List voices, List normalVoiceList = null) - { - if (_splitVoiceList != null && normalVoiceList != null) - { - if (voices == null) - { - voices = _splitVoiceList; - } - else - { - for (int num = _splitVoiceList.Count - 1; num >= 0; num--) - { - voices.Insert(0, _splitVoiceList[num]); - } - } - } - if (voices == null || voices.Count <= 0) - { - return; - } - for (int i = 0; i < voices.Count; i++) - { - string[] allVoiceList = voices[i].GetAllVoiceList(); - foreach (string text in allVoiceList) - { - if (text.Contains("none") || tempVoiceList.Contains(text)) - { - continue; - } - if (text.Contains('|')) - { - if (_splitVoiceList == null) - { - _splitVoiceList = new List(); - _splitVoiceList.Add(voices[i]); - } - else if (!_splitVoiceList.Contains(voices[i])) - { - _splitVoiceList.Add(voices[i]); - } - string[] array = text.Split('|'); - if (array.Length == 2) - { - string item = ((normalVoiceList == null) ? array[0] : array[1]); - tempVoiceList.Add(item); - } - } - else if (normalVoiceList == null) - { - tempVoiceList.Add(text); - } - else if (!normalVoiceList.Contains(text)) - { - tempVoiceList.Add(text); - } - } - } - } - } - - private class CardVoiceManager - { - private int _cardId; - - private bool _isPlayEvoVoice; - - private CardVoiceData _voiceData; - - private int _playIndex; - - private List _playVoiceList; - - private List _loadVoiceIdList = new List(); - - private List _unloadVoiceIdList = new List(); - - private List _loadedVoiceIdList = new List(); - - private const string VOICE_DATA_PREFIX = "vo_"; - - public void SequentiallyPlay(CardParameter cardParam, bool isPlayEvoVoice, CardMaster.CardMasterId cardMasterId) - { - int cardId = cardParam.CardId; - if (cardId == _cardId) - { - if (isPlayEvoVoice != _isPlayEvoVoice) - { - _isPlayEvoVoice = isPlayEvoVoice; - _playIndex = 0; - _playVoiceList = (isPlayEvoVoice ? _voiceData._voiceListAfterEvo : _voiceData._voiceListBeforeEvo); - } - else - { - _playIndex = (_playIndex + 1) % _playVoiceList.Count; - } - Stop(); - Play(); - return; - } - _cardId = cardId; - _isPlayEvoVoice = isPlayEvoVoice; - CardVoiceData voiceData = _voiceData; - _voiceData = new CardVoiceData(cardParam, cardMasterId); - _playIndex = 0; - _playVoiceList = (isPlayEvoVoice ? _voiceData._voiceListAfterEvo : _voiceData._voiceListBeforeEvo); - float unloadWaitTime = Stop(); - LoadAndUnload(_voiceData, voiceData, unloadWaitTime, delegate - { - Play(); - }); - } - - private void Play() - { - GameMgr.GetIns().GetSoundMgr().PlayVoiceScenario("vo_" + _playVoiceList[_playIndex]); - } - - public float Stop() - { - return GameMgr.GetIns().GetSoundMgr().StopVoiceAll(); - } - - private void LoadAndUnload(CardVoiceData loadData, CardVoiceData unloadData, float unloadWaitTime = 0f, Action onFinishLoad = null) - { - _loadVoiceIdList.Clear(); - if (loadData != null) - { - _loadVoiceIdList.Add(loadData.MainVoiceId); - _loadVoiceIdList.AddRange(loadData._acceleratedVoiceIdList); - _loadVoiceIdList = _loadVoiceIdList.Distinct().ToList(); - } - _unloadVoiceIdList.Clear(); - if (unloadData != null) - { - _unloadVoiceIdList.Add(unloadData.MainVoiceId); - _unloadVoiceIdList.AddRange(unloadData._acceleratedVoiceIdList); - _unloadVoiceIdList = _unloadVoiceIdList.Distinct().ToList(); - } - List list = _loadVoiceIdList.Intersect(_unloadVoiceIdList).ToList(); - if (list.Count > 0) - { - _loadVoiceIdList = _loadVoiceIdList.Except(list).ToList(); - _unloadVoiceIdList = _unloadVoiceIdList.Except(list).ToList(); - } - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - int loadTargetCount = _loadVoiceIdList.Count; - if (loadTargetCount <= 0) - { - onFinishLoad.Call(); - } - else - { - int loadedCount = 0; - for (int i = 0; i < loadTargetCount; i++) - { - string text = _loadVoiceIdList[i]; - soundMgr.LoadVoice("vo_" + text, delegate - { - if (++loadedCount == loadTargetCount) - { - onFinishLoad.Call(); - } - }); - } - _loadedVoiceIdList.AddRange(_loadVoiceIdList); - } - for (int num = 0; num < _unloadVoiceIdList.Count; num++) - { - string unloadId = _unloadVoiceIdList[num]; - UIManager.GetInstance().StartCoroutine(Timer.DelayMethod(unloadWaitTime, delegate - { - soundMgr.UnloadVoice("vo_" + unloadId); - })); - _loadedVoiceIdList.Remove(unloadId); - } - } - - public void UnloadAll(float unloadWaitTime = 0f) - { - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - for (int i = 0; i < _loadedVoiceIdList.Count; i++) - { - string unloadId = _loadedVoiceIdList[i]; - UIManager.GetInstance().StartCoroutine(Timer.DelayMethod(unloadWaitTime, delegate - { - soundMgr.UnloadVoice("vo_" + unloadId); - })); - } - _loadedVoiceIdList.Clear(); - } - } - - private static readonly string RELATION_CARD_DISABLE_CARD_ID_HEADER = "80"; - - private static readonly int[] RELATION_CARD_BUTTON_DISABLE_CARD_IDS = new int[2] { 810014010, 810034010 }; - - private readonly List RELATION_CARD_SKILLOPTION_EXCLUDED_OPTIONS = new List { "effect_path", "se_path", "skill_voice" }; - - private readonly char[] RELATION_CARD_SKILLOPTION_SEPARATORS = new char[2] { '(', ')' }; - - [SerializeField] - private GameObject DarkPanel; - - [SerializeField] - private GameObject Frame; - - [SerializeField] - private GameObject CardTexture; - - [SerializeField] - private GameObject CardNum; - - [SerializeField] - private GameObject CardText; - - [SerializeField] - private GameObject CardViewBG; - - [SerializeField] - private GameObject CardShadow; - - [SerializeField] - private GameObject UnitCardStatusObj; - - [SerializeField] - private GameObject UnitCardIntroductionObj; - - [SerializeField] - private GameObject SettingCardStatusObj; - - [SerializeField] - private GameObject SettingCardIntroductionObj; - - [SerializeField] - private GameObject SpellCardStatusObj; - - [SerializeField] - private GameObject SpellCardIntroductionObj; - - [SerializeField] - private UIScrollView UnitCardTextScrollView; - - [SerializeField] - private UIScrollView SpellCardTextScrollView; - - [SerializeField] - private UIScrollView SettingCardTextScrollView; - - [SerializeField] - private UILabel UnitCardSkill; - - [SerializeField] - private UILabel UnitCardEvoSkill; - - [SerializeField] - private UILabel UnitCardAtkRight; - - [SerializeField] - private UILabel UnitCardLifeRight; - - [SerializeField] - private UILabel UnitCardEvoAtkRight; - - [SerializeField] - private UILabel UnitCardEvoLifeRight; - - [SerializeField] - private UILabel UnitCardIntroduction; - - [SerializeField] - private UILabel SpellCardSkill; - - [SerializeField] - private UILabel SpellCardIntroduction; - - [SerializeField] - private UILabel SettingCardSkill; - - [SerializeField] - private UILabel SettingCardIntroduction; - - [SerializeField] - private GameObject ReturnButton; - - [SerializeField] - private GameObject CardIntroductionButton; - - [SerializeField] - private UIButton _favoriteButton; - - [SerializeField] - private UIButton _voiceButton; - - [SerializeField] - private GameObject CardEvolButton; - - [SerializeField] - private UIButton _premiumCardConversionButton; - - [SerializeField] - private GameObject RelationWrapperObj; - - [SerializeField] - private GameObject RelationCardButton; - - [SerializeField] - private GameObject RightButton; - - [SerializeField] - private GameObject LeftButton; - - [SerializeField] - private GameObject RelationBackButton; - - [SerializeField] - private UILabel DialogTitleLabel; - - [SerializeField] - private UILabel _cardNumLabel; - - [SerializeField] - private UILabel _nameValueLabel; - - [SerializeField] - private UILabel _classValueLabel; - - [SerializeField] - private UILabel _typeValueLabel; - - [SerializeField] - private UILabel _redEtherHaveValueLabel; - - [SerializeField] - private UILabel _evolutionButtonLabel; - - [SerializeField] - private GameObject _cardVoiceLabelRoot; - - [SerializeField] - private UILabel _cardVoiceValueLabel; - - [SerializeField] - private GameObject _cardSetLabelRoot; - - [SerializeField] - private UILabel _cardSetValueLabel; - - [SerializeField] - private GameObject RedEtherFrame; - - [SerializeField] - private GameObject RedEtherIcon; - - [SerializeField] - private GameObject QuestionMark; - - [SerializeField] - private PurchaseConfirm PurchaseConfirmPrefab; - - [SerializeField] - private PremiumCardConversionDialogParts _premiumCardConversionDialogPrefab; - - [SerializeField] - private CardCraftPanel _craftPanel; - - [SerializeField] - private UIPanel[] _allPanel; - - [SerializeField] - private UIButton _blankColliderButton; - - private GameObject _rotationOnlyIconSpell; - - private GameObject _rotationOnlyIconFollower; - - private GameObject _rotationOnlyIconAmulet; - - private static readonly float kCARD_SCALE = 90f; - - private static readonly float kCARD_POS_Z = -4f; - - private readonly Vector3 CardViewScale = new Vector3(110f, 110f, 1f); - - private const float CARD_ANIMATION_TIME = 0.3f; - - private const float CARD_ROTATION = 0f; - - private static readonly Color CARD_LIQUEFY_PARTICLE_COLOR = new Color(1f, 0.2509804f, 0.2509804f); - - private static readonly Color CARD_CREATE_PARTICLE_COLOR = new Color(1f, 0.2509804f, 0.2509804f); - - private static readonly Color PREMIUM_CARD_CONVERSION_PARTICLE_COLOR = new Color(14f / 85f, 32f / 85f, 0.5568628f); - - private static readonly Vector3 CARD_DESTROY_PARTICLE_OFFSET = new Vector3(0f, 0f, -1f); - - private const string EVO_EFFECT_PATH = "cmn_deckedit_evo_1"; - - private const float EVO_EFFECT_SCALE = 600f; - - private const float FAVORITE_BUTTON_INVALID_TIME = 0.9f; - - private const int PREMIUM_CARD_CONVERSION_PARTICLE_NUM = 4; - - private const int KEYWORD_DIALOG_DEPTH = 120; - - private const int KEYWORD_DIALOG_POSITION_Z = -5; - - private const int KEYWORD_DIALOG_POSITION_Y = 0; - - private static readonly Vector3 KEYWORD_DIALOG_BACK_VIEW_POSITION = new Vector3(0f, 0f, -5f); - - private GameObject UnitCardObject; - - private GameObject SpellCardObject; - - private GameObject FieldCardObject; - - private GameObject ViewCardObject; - - private UILabel UnitCost; - - private UILabel UnitAtk; - - private UILabel UnitLife; - - private UILabel UnitName; - - private UILabel SpellCost; - - private UILabel SpellName; - - private UILabel FieldCost; - - private UILabel FieldName; - - private BoxCollider UnitCardCollider; - - private BoxCollider SpellCardCollider; - - private BoxCollider FieldCardCollider; - - private bool _isFavorite; - - private bool _isFavoriteButtonEnabled; - - private bool _isEvolCard; - - private bool _isShowCardAblityText = true; - - private bool _shouldResetTextScrollView; - - private bool isCardViewMode; - - private bool isAnimation; - - [SerializeField] - private TextLineCreater _cardSkillTextLineCreater; - - [SerializeField] - private TextLineCreater _cardEvoSkillTextLineCreater; - - [SerializeField] - private TextLineCreater _cardSpellTextLineCreater; - - [SerializeField] - private TextLineCreater _cardAmuletTextLineCreater; - - [SerializeField] - private GameObject _evolveInfoObjectRoot; - - [SerializeField] - private UILabel _normalTitleLavel; - - private int _relationIndex; - - private List _relationCardIds = new List(); - - private Dictionary> _relationCardParentDict = new Dictionary>(); - - private GameObject _relationCardBaseGameObject; - - private int LayerDetail = 14; - - private bool isDetailOn; - - private ParticleSystem _evolEffect; - - private bool IsAnimationPlaying; - - private DialogBase _craftDialog; - - private DialogBase _keyWordDialog; - - private List _assetPathList = new List(); - - private List _assetTokenPathList = new List(); - - private CardVoiceManager _cardVoiceManager = new CardVoiceManager(); - - private bool _isAbleTapDialogObject = true; - - private static Shader _normalShader = null; - - private static Shader _premiumShader = null; - - private DialogBase _dialogForClose; - - private Material _cardMaterial; - - private int _originalCardId; - - private CardMaster.CardMasterId _cardMasterId; - - private UIButton[] _enableButtonList; - - private IFormatBehavior _formatBehaviorForCardPoolChange; - - public Action OnCardSellId; - - public Action OnCardBuy; - - public Action OnClose; - - public Action OnDragCard; - - public Action OnLiquefyAllCard; - - public Action OnChangeCardFavoriteState; - - public Action OnConvertedPremiumCard; - - public Action OnCreateFirstCard; - - private bool _isCardTextDialogLayerSet = true; - - private bool _isOwnCardNum; - - public CardParameter CardData { get; private set; } - - public Action OnDetailCardUpdate { get; set; } - - public Action OnCardNumChange { get; set; } - - private bool IsAbleToCraft - { - get - { - if (PlayerStaticData.UserRedEtherCount >= CardData.UseRedEther && !CardData.IsFoil) - { - if (GetPossessionCardNum(isIncludingSpotCard: true) >= 3) - { - return GetPossessionCardNum() == 0; - } - return true; - } - return false; - } - } - - private bool IsAbleToDestruct => GetPossessionCardNum() > 0; - - public bool IsShowFlavorTextButton { get; set; } - - public bool IsShowFavoriteButton { get; set; } - - public bool IsShowVoiceButton { get; set; } - - public bool IsShowEvolutionButton { get; set; } - - public bool IsShowCraftButtons { get; set; } - - public bool IsShowPremiumCardConversionButton { get; set; } - - public bool IsPopularityVote { get; set; } - - public bool IsCardTextDialogLayerSet - { - get - { - return _isCardTextDialogLayerSet; - } - set - { - _isCardTextDialogLayerSet = value; - } - } - - public bool IsOwnCardNum - { - get - { - return _isOwnCardNum; - } - set - { - _isOwnCardNum = value; - } - } - - public bool IsShortageUI { get; set; } - - public bool IsRelationCardViewing => RelationWrapperObj.activeSelf; - - public bool LeftButtonVisible - { - set - { - LeftButton.SetActive(value); - } - } - - public bool RightButtonVisible - { - set - { - RightButton.SetActive(value); - } - } - - public bool IsEvolCard => _isEvolCard; - - public bool IsEnableShowDetail - { - get - { - if (IsAnimationPlaying) - { - return false; - } - return true; - } - } - - private void OnDisable() - { - if (isCardViewMode) - { - RemoveCardViewMode(); - } - isDetailOn = false; - } - - public void Hide() - { - base.gameObject.SetActive(value: false); - if (_keyWordDialog != null) - { - _keyWordDialog.Close(); - } - if (IsAnimationPlaying) - { - iTween.Stop(UnitCardObject); - iTween.Stop(SpellCardObject); - iTween.Stop(FieldCardObject); - OnAnimationOver(); - } - DestroyDialogObject(); - } - - protected override void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList); - _assetPathList.Clear(); - Toolbox.ResourcesManager.RemoveAssetGroup(_assetTokenPathList); - _assetTokenPathList.Clear(); - float unloadWaitTime = _cardVoiceManager.Stop(); - _cardVoiceManager.UnloadAll(unloadWaitTime); - if (_keyWordDialog != null) - { - _keyWordDialog.Close(); - } - if (_cardMaterial != null) - { - UnityEngine.Object.Destroy(_cardMaterial); - } - DestroyDialogObject(); - base.OnDestroy(); - } - - private void DestroyDialogObject() - { - if (_dialogForClose != null) - { - UnityEngine.Object.Destroy(_dialogForClose.gameObject); - _dialogForClose = null; - } - } - - public void Initialize(int DetailLayer, CardMaster.CardMasterId cardMasterId, IFormatBehavior formatBehaviorForCardPoolChange = null) - { - _formatBehaviorForCardPoolChange = formatBehaviorForCardPoolChange; - ChangeCardMaster(cardMasterId); - LayerDetail = DetailLayer; - base.gameObject.layer = LayerDetail; - InitializeCard(); - SetButtonEvent(); - SetDisableArrowButton(); - _enableButtonList = GetComponentsInChildren(includeInactive: true); - } - - public void ChangeCardMaster(CardMaster.CardMasterId cardMasterId) - { - _cardMasterId = cardMasterId; - } - - private void InitializeCard() - { - InitializeCardObject(); - InitializeCardMesh(); - InitializeCardDecoration(); - } - - private void InitializeCardObject() - { - UnitCardObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Unit", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)) as GameObject; - SpellCardObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Spell", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)) as GameObject; - FieldCardObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Field", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)) as GameObject; - UnitCardObject = NGUITools.AddChild(CardTexture, UnitCardObject); - UnitCardObject.SetActive(value: false); - SpellCardObject = NGUITools.AddChild(CardTexture, SpellCardObject); - SpellCardObject.SetActive(value: false); - FieldCardObject = NGUITools.AddChild(CardTexture, FieldCardObject); - FieldCardObject.SetActive(value: false); - Transform obj = SpellCardObject.transform; - Vector3 localPosition = (FieldCardObject.transform.localPosition = new Vector3(0f, 0f, -500f)); - obj.localPosition = localPosition; - UIManager.GetInstance().SetLayerRecursive(UnitCardObject.transform, LayerDetail); - UIManager.GetInstance().SetLayerRecursive(SpellCardObject.transform, LayerDetail); - UIManager.GetInstance().SetLayerRecursive(FieldCardObject.transform, LayerDetail); - UnitCardCollider = UnitCardObject.AddComponent(); - SpellCardCollider = SpellCardObject.AddComponent(); - FieldCardCollider = FieldCardObject.AddComponent(); - BoxCollider unitCardCollider = UnitCardCollider; - BoxCollider spellCardCollider = SpellCardCollider; - Vector3 vector2 = (FieldCardCollider.size = new Vector3(3.6f, 5.5f, 1f)); - localPosition = (spellCardCollider.size = vector2); - unitCardCollider.size = localPosition; - UIWidget uIWidget = UnitCardObject.AddComponent(); - UIWidget uIWidget2 = SpellCardObject.AddComponent(); - UIWidget uIWidget3 = FieldCardObject.AddComponent(); - int num = (uIWidget3.depth = 1); - int depth = (uIWidget2.depth = num); - uIWidget.depth = depth; - GameObject prefab = Resources.Load("Prefab/CardDeco/RotationOnlyIcon") as GameObject; - _rotationOnlyIconSpell = NGUITools.AddChild(SpellCardObject, prefab); - _rotationOnlyIconFollower = NGUITools.AddChild(UnitCardObject, prefab); - _rotationOnlyIconAmulet = NGUITools.AddChild(FieldCardObject, prefab); - } - - private void InitializeCardMesh() - { - MeshFilter[] componentsInChildren = UnitCardObject.GetComponentsInChildren(); - Mesh sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren[0].sharedMesh = sharedMesh; - componentsInChildren[1].sharedMesh = sharedMesh2; - Quaternion quaternion = Quaternion.Euler(0f, componentsInChildren[0].transform.rotation.y + 180f, 0f); - Transform obj = componentsInChildren[0].transform; - Quaternion rotation = (componentsInChildren[1].transform.rotation = quaternion); - obj.rotation = rotation; - MeshFilter[] componentsInChildren2 = SpellCardObject.GetComponentsInChildren(); - Mesh sharedMesh3 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh4 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren2[0].sharedMesh = sharedMesh3; - componentsInChildren2[1].sharedMesh = sharedMesh4; - Quaternion quaternion3 = Quaternion.Euler(0f, componentsInChildren2[0].transform.rotation.y + 180f, 0f); - Transform obj2 = componentsInChildren2[0].transform; - rotation = (componentsInChildren2[1].transform.rotation = quaternion3); - obj2.rotation = rotation; - MeshFilter[] componentsInChildren3 = FieldCardObject.GetComponentsInChildren(); - Mesh sharedMesh5 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh6 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren3[0].sharedMesh = sharedMesh5; - componentsInChildren3[1].sharedMesh = sharedMesh6; - Quaternion quaternion5 = Quaternion.Euler(0f, componentsInChildren3[0].transform.rotation.y + 180f, 0f); - Transform obj3 = componentsInChildren3[0].transform; - rotation = (componentsInChildren3[1].transform.rotation = quaternion5); - obj3.rotation = rotation; - } - - private void InitializeCardDecoration() - { - GameObject prefab = Resources.Load("Prefab/CardDeco/Cost") as GameObject; - GameObject prefab2 = Resources.Load("Prefab/CardDeco/Atk") as GameObject; - GameObject prefab3 = Resources.Load("Prefab/CardDeco/Life") as GameObject; - GameObject prefab4 = Resources.Load("Prefab/CardDeco/Name") as GameObject; - GameObject gameObject = NGUITools.AddChild(UnitCardObject, prefab); - GameObject gameObject2 = NGUITools.AddChild(UnitCardObject, prefab2); - GameObject gameObject3 = NGUITools.AddChild(UnitCardObject, prefab3); - GameObject gameObject4 = NGUITools.AddChild(UnitCardObject, prefab4); - GameObject gameObject5 = NGUITools.AddChild(SpellCardObject, prefab); - GameObject gameObject6 = NGUITools.AddChild(SpellCardObject, prefab4); - GameObject gameObject7 = NGUITools.AddChild(FieldCardObject, prefab); - GameObject gameObject8 = NGUITools.AddChild(FieldCardObject, prefab4); - Transform obj = gameObject.transform; - Transform obj2 = gameObject5.transform; - Vector3 vector = (gameObject7.transform.localPosition = Global.POSITION_COST_ICON); - Vector3 localPosition = (obj2.localPosition = vector); - obj.localPosition = localPosition; - Transform obj3 = gameObject.transform; - Transform obj4 = gameObject5.transform; - vector = (gameObject7.transform.localScale = Global.SCALE_CARD_ICON); - localPosition = (obj4.localScale = vector); - obj3.localScale = localPosition; - Transform obj5 = gameObject4.transform; - Transform obj6 = gameObject6.transform; - vector = (gameObject8.transform.localPosition = Global.POSITION_NAME_TEXT); - localPosition = (obj6.localPosition = vector); - obj5.localPosition = localPosition; - Transform obj7 = gameObject4.transform; - Transform obj8 = gameObject6.transform; - vector = (gameObject8.transform.localScale = Global.SCALE_NAME_TEXT); - localPosition = (obj8.localScale = vector); - obj7.localScale = localPosition; - gameObject2.transform.localPosition = Global.POSITION_ATK_ICON; - gameObject3.transform.localPosition = Global.POSITION_LIFE_ICON; - Transform obj9 = gameObject2.transform; - localPosition = (gameObject3.transform.localScale = Global.SCALE_CARD_ICON); - obj9.localScale = localPosition; - UnitCost = gameObject.transform.Find("CostLabel").GetComponent(); - UnitAtk = gameObject2.transform.Find("AtkLabel").GetComponent(); - UnitLife = gameObject3.transform.Find("LifeLabel").GetComponent(); - UnitName = gameObject4.transform.Find("NameLabel").GetComponent(); - SpellCost = gameObject5.transform.Find("CostLabel").GetComponent(); - SpellName = gameObject6.transform.Find("NameLabel").GetComponent(); - FieldCost = gameObject7.transform.Find("CostLabel").GetComponent(); - FieldName = gameObject8.transform.Find("NameLabel").GetComponent(); - } - - private void SetButtonEvent() - { - UIEventListener uIEventListener = UIEventListener.Get(ReturnButton); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); - UIEventListener uIEventListener2 = UIEventListener.Get(_blankColliderButton.gameObject); - uIEventListener2.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); - UIEventListener uIEventListener3 = UIEventListener.Get(DarkPanel.gameObject); - uIEventListener3.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener3.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); - UIEventListener uIEventListener4 = UIEventListener.Get(Frame.gameObject); - uIEventListener4.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); - UIEventListener uIEventListener5 = UIEventListener.Get(CardIntroductionButton); - uIEventListener5.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener5.onClick, new UIEventListener.VoidDelegate(OnClickChangeCardTextTypeButton)); - UIEventListener uIEventListener6 = UIEventListener.Get(CardViewBG); - uIEventListener6.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener6.onClick, new UIEventListener.VoidDelegate(OnCloseCardViewMode)); - UIEventListener uIEventListener7 = UIEventListener.Get(UnitCardObject); - uIEventListener7.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener7.onClick, new UIEventListener.VoidDelegate(OnOpenCardViewMode)); - UIEventListener uIEventListener8 = UIEventListener.Get(SpellCardObject); - uIEventListener8.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener8.onClick, new UIEventListener.VoidDelegate(OnOpenCardViewMode)); - UIEventListener uIEventListener9 = UIEventListener.Get(FieldCardObject); - uIEventListener9.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener9.onClick, new UIEventListener.VoidDelegate(OnOpenCardViewMode)); - UIEventListener uIEventListener10 = UIEventListener.Get(_favoriteButton.gameObject); - uIEventListener10.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener10.onClick, new UIEventListener.VoidDelegate(OnClickFavoriteButton)); - UIEventListener uIEventListener11 = UIEventListener.Get(_voiceButton.gameObject); - uIEventListener11.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener11.onClick, new UIEventListener.VoidDelegate(OnClickVoiceButton)); - UIEventListener uIEventListener12 = UIEventListener.Get(_premiumCardConversionButton.gameObject); - uIEventListener12.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener12.onClick, new UIEventListener.VoidDelegate(OnClickPremiumCardConversionButton)); - UIEventListener uIEventListener13 = UIEventListener.Get(CardEvolButton); - uIEventListener13.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener13.onClick, new UIEventListener.VoidDelegate(OnClickEvolutionButton)); - UIEventListener uIEventListener14 = UIEventListener.Get(UnitCardObject); - uIEventListener14.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener14.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); - UIEventListener uIEventListener15 = UIEventListener.Get(SpellCardObject); - uIEventListener15.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener15.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); - UIEventListener uIEventListener16 = UIEventListener.Get(FieldCardObject); - uIEventListener16.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener16.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); - UIEventListener uIEventListener17 = UIEventListener.Get(Frame); - uIEventListener17.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener17.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); - UIEventListener uIEventListener18 = UIEventListener.Get(CardText); - uIEventListener18.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener18.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); - UIEventListener uIEventListener19 = UIEventListener.Get(QuestionMark); - uIEventListener19.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener19.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); - UIEventListener uIEventListener20 = UIEventListener.Get(RelationCardButton); - uIEventListener20.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener20.onClick, new UIEventListener.VoidDelegate(OnPushRelationCardButton)); - UIEventListener uIEventListener21 = UIEventListener.Get(RelationBackButton); - uIEventListener21.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener21.onClick, new UIEventListener.VoidDelegate(OnPushRelationBackButton)); - UIEventListener uIEventListener22 = UIEventListener.Get(RightButton); - uIEventListener22.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener22.onClick, new UIEventListener.VoidDelegate(OnPushRightButton)); - UIEventListener uIEventListener23 = UIEventListener.Get(LeftButton); - uIEventListener23.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener23.onClick, new UIEventListener.VoidDelegate(OnPushLeftButton)); - Action onClickDestructBtn = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - CreateDialog(StartCardDestruct, buy: false); - }; - Action onClickCreateBtn = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - CreateDialog(StartCardCraft, buy: true); - }; - _craftPanel.Init(onClickCreateBtn, onClickDestructBtn); - UIEventListener.Get(QuestionMark).onClick = delegate - { - if (_isAbleTapDialogObject) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UILabel keyWordLabel = GetKeyWordLabel(); - string empty = string.Empty; - empty = ((!CardData.IsEvolveChoiceCard) ? (CardData.ConvertedSkillDescription + CardData.ConvertedEvoSkillDescription) : CardData.ConvertedEvoSkillDescription); - _keyWordDialog = BattlePlayerView.CreateKeyPanel(empty, keyWordLabel, _cardMasterId); - UIManager.ViewScene currentScene = UIManager.GetInstance().GetCurrentScene(); - if ((currentScene == UIManager.ViewScene.Battle || currentScene == UIManager.ViewScene.LoginBonus || currentScene == UIManager.ViewScene.Colosseum || currentScene == UIManager.ViewScene.LotteryPage || currentScene == UIManager.ViewScene.QuestSelectionPage) && IsCardTextDialogLayerSet) - { - _keyWordDialog.SetPanelDepth(120); - Vector3 localPosition = _keyWordDialog.gameObject.transform.localPosition; - localPosition.z = -5f; - localPosition.y = 0f; - _keyWordDialog.gameObject.transform.localPosition = localPosition; - ChangeLayer(_keyWordDialog.gameObject, LayerDetail); - _keyWordDialog.SetBackViewLayer(LayerDetail); - _keyWordDialog.SetBackViewPosition(KEYWORD_DIALOG_BACK_VIEW_POSITION); - UIPanel[] componentsInChildren = _keyWordDialog.InsideObject.GetComponentsInChildren(); - for (int i = 0; i < componentsInChildren.Length; i++) - { - componentsInChildren[i].depth += 120; - } - } - } - }; - UIEventListener uIEventListener24 = UIEventListener.Get(QuestionMark); - uIEventListener24.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(uIEventListener24.onPress, (UIEventListener.BoolDelegate)delegate(GameObject g, bool b) - { - UILabel keyWordLabel = GetKeyWordLabel(); - if (keyWordLabel != null) - { - BattlePlayerView.PressKeyWordColorChange(keyWordLabel, b); - } - }); - UIEventListener uIEventListener25 = UIEventListener.Get(QuestionMark); - uIEventListener25.onDragStart = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener25.onDragStart, (UIEventListener.VoidDelegate)delegate - { - if (UnitCardTextScrollView.gameObject.activeInHierarchy) - { - BattlePlayerView.SetKeyWordLabelColor(UnitCardSkill); - BattlePlayerView.SetKeyWordLabelColor(UnitCardEvoSkill); - } - else - { - UILabel keyWordLabel = GetKeyWordLabel(); - if (keyWordLabel != null) - { - BattlePlayerView.SetKeyWordLabelColor(keyWordLabel); - } - } - }); - } - - private void AddAtlasOverrider(DialogBase dialog) - { - UIAtlas component = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("dummy", ResourcesManager.AssetLoadPathType.QuestAtlas, isfetch: true)).GetComponent(); - UISpriteAtlasOverwriter.TargetObject[] targetObjects = new UISpriteAtlasOverwriter.TargetObject[1] - { - new UISpriteAtlasOverwriter.TargetObject(dialog.gameObject, includeChildren: true) - }; - dialog.gameObject.AddMissingComponent().Init(component, targetObjects); - } - - private UILabel GetKeyWordLabel() - { - if (UnitCardTextScrollView.gameObject.activeInHierarchy) - { - Transform parent = UnitCardSkill.transform.parent; - UnitCardSkill.transform.SetParent(base.transform); - Vector3 vector = UnitCardSkill.transform.localPosition - new Vector3(0f, UnitCardSkill.printedSize.y, 0f); - UnitCardSkill.transform.SetParent(parent); - Vector3 vector2 = base.transform.InverseTransformPoint(UICamera.lastHit.point); - if (vector.y < vector2.y) - { - if (!string.IsNullOrEmpty(UnitCardSkill.text) && UnitCardSkill.text != " ") - { - return UnitCardSkill; - } - if (!string.IsNullOrEmpty(UnitCardEvoSkill.text) && UnitCardEvoSkill.text != " ") - { - return UnitCardEvoSkill; - } - } - else - { - if (!string.IsNullOrEmpty(UnitCardEvoSkill.text) && UnitCardEvoSkill.text != " ") - { - return UnitCardEvoSkill; - } - if (!string.IsNullOrEmpty(UnitCardSkill.text) && UnitCardSkill.text != " ") - { - return UnitCardSkill; - } - } - } - else - { - if (SpellCardTextScrollView.gameObject.activeInHierarchy) - { - return SpellCardSkill; - } - if (SettingCardTextScrollView.gameObject.activeInHierarchy) - { - return SettingCardSkill; - } - } - return null; - } - - public void OnPushCardDetailOn(GameObject g) - { - if (_isAbleTapDialogObject && ShowCardDetail(g)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO); - } - } - - public bool ShowCardDetail(GameObject g) - { - if (isDetailOn) - { - CloseDefault(playSe: true); - return false; - } - if (!IsEnableShowDetail) - { - return false; - } - CharIdx component = g.GetComponent(); - if (!component) - { - return false; - } - isDetailOn = true; - IsAnimationPlaying = true; - base.gameObject.SetActive(value: true); - DarkPanel.SetActive(value: true); - DestroyDialogObject(); - _dialogForClose = UIManager.GetInstance().DialogManager.CreateDialogBaseOpenCardDetail(this); - SetCardDetail(component.GetCardId(), g); - OpenCardAnimation(); - return true; - } - - private void OpenCardAnimation() - { - iTween.Stop(CardNum.gameObject); - if (GetPossessionCardNum(isIncludingSpotCard: true) > 0) - { - CardNum.transform.localScale = new Vector3(0.01f, 0.01f, 1f); - iTween.ScaleTo(CardNum.gameObject, iTween.Hash("scale", new Vector3(1f, 1f, 1f), "time", 0.3f)); - } - else - { - CardNum.transform.localScale = new Vector3(1f, 1f, 1f); - } - GameObject gameObject = null; - CardBasePrm.CharaType charType = CardData.CharType; - gameObject = (CardBasePrm.IsFollowerCard(charType) ? UnitCardObject : ((!CardBasePrm.IsSpellCard(charType)) ? FieldCardObject : SpellCardObject)); - gameObject.transform.localScale = new Vector3(1f, 1f, 1f); - iTween.Stop(gameObject); - iTween.ScaleTo(gameObject, iTween.Hash("islocal", true, "scale", new Vector3(kCARD_SCALE, kCARD_SCALE, 1f), "time", 0.3f, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(gameObject, iTween.Hash("islocal", true, "x", 0f, "y", 0f, "z", kCARD_POS_Z, "time", 0.3f, "oncompletetarget", base.gameObject, "oncomplete", "OnAnimationOver", "easetype", iTween.EaseType.easeOutExpo)); - } - - private void OnAnimationOver() - { - IsAnimationPlaying = false; - BoxCollider unitCardCollider = UnitCardCollider; - BoxCollider spellCardCollider = SpellCardCollider; - Vector3 vector = (FieldCardCollider.size = new Vector3(3.6f, 5.5f, 1f)); - Vector3 size = (spellCardCollider.size = vector); - unitCardCollider.size = size; - } - - public void CloseDefault(bool playSe) - { - if (!isDetailOn || isAnimation || IsAnimationPlaying) - { - return; - } - if (isCardViewMode) - { - OnCloseCardViewMode(); - return; - } - isDetailOn = false; - DarkPanel.SetActive(value: false); - if (base.gameObject.activeSelf && playSe) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - } - base.gameObject.SetActive(value: false); - if (_evolEffect != null) - { - UnityEngine.Object.Destroy(_evolEffect.gameObject); - } - Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList); - Toolbox.ResourcesManager.RemoveAssetGroup(_assetTokenPathList); - _assetTokenPathList.Clear(); - DestroyDialogObject(); - OnClose.Call(); - } - - private void SetCardDetail(int cardId, GameObject card2dObj = null, bool isUpdateRelation = true) - { - CardData = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId); - if (isUpdateRelation) - { - RelationWrapperObj.SetActive(value: false); - } - iTween.Stop(base.gameObject); - _isEvolCard = CardData.IsEvolveChoiceCard; - _isShowCardAblityText = true; - UpdateCardImage(); - SystemText systemText = Data.SystemText; - _nameValueLabel.text = CardData.CardName; - string key = "Common_01" + ((int)(4 + CardData.Clan)).ToString("00"); - _classValueLabel.text = systemText.Get(key); - _typeValueLabel.text = CardData.TribeName; - if (_typeValueLabel.text == "ALL") - { - _typeValueLabel.text = "-"; - } - UpdateCardText(); - _isFavoriteButtonEnabled = true; - UpdateButtonState(); - UpdateCreateLiquefyButton(); - if (isUpdateRelation) - { - UpdateRelation(cardId); - DialogTitleLabel.text = Data.SystemText.Get("Card_0135"); - } - UpdateCardNum(card2dObj); - if (!IsRelationCardViewing) - { - _relationCardBaseGameObject = card2dObj; - OnDetailCardUpdate.Call(); - } - } - - private void UpdateRelation(int cardId) - { - _relationCardIds.Clear(); - _relationCardParentDict.Clear(); - _relationIndex = 0; - _originalCardId = cardId; - if (RELATION_CARD_BUTTON_DISABLE_CARD_IDS.Contains(cardId)) - { - RelationCardButton.SetActive(value: false); - return; - } - CardMaster instance = CardMaster.GetInstance(_cardMasterId); - if (instance != null) - { - List allParams = new List(instance.GetAllParameters()); - ParseIdsFunc(allParams, cardId); - } - IDictionary> relationCardSortDic = Data.Master.RelationCardSortDic; - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId); - if (relationCardSortDic.ContainsKey(cardParameterFromId.NormalCardId)) - { - _relationCardIds = new List(relationCardSortDic[cardParameterFromId.NormalCardId]); - } - else - { - _relationCardIds = SortRelationCardByKeyWordTextOrder(_relationCardIds); - } - bool flag = false; - foreach (int relationCardId in _relationCardIds) - { - if (relationCardSortDic.ContainsKey(relationCardId)) - { - flag = true; - break; - } - } - if (!relationCardSortDic.ContainsKey(cardParameterFromId.NormalCardId) && flag) - { - _relationCardIds = SortPartOfRelationCard(_relationCardIds, cardParameterFromId.NormalCardId); - } - } - - private static List SortPartOfRelationCard(List originalList, int cardId) - { - List list = new List(); - list.AddRange(originalList); - IDictionary> relationCardSortDic = Data.Master.RelationCardSortDic; - foreach (int original in originalList) - { - if (!relationCardSortDic.TryGetValue(original, out var value)) - { - continue; - } - List list2 = new List(); - for (int i = 0; i < value.Count; i++) - { - int num = value[i]; - for (int j = 0; j < originalList.Count; j++) - { - if (originalList[j] == num) - { - list2.Add(j); - break; - } - } - } - list2.Sort(); - for (int k = 0; k < list2.Count; k++) - { - int index = list2[k]; - list[index] = value[k]; - } - } - return list; - } - - private List SortRelationCardByKeyWordTextOrder(List originalList) - { - if (originalList.Count < 2) - { - return originalList; - } - List sortedCardIdList = new List(); - List keywordListInCard = GetKeywordListInCard(CardData.CardId); - for (int i = 0; i < keywordListInCard.Count; i++) - { - List cardIdsInKeyword = GetCardIdsInKeyword(keywordListInCard[i]); - if (cardIdsInKeyword.Count == 0) - { - continue; - } - int num = cardIdsInKeyword[0]; - if (!originalList.Contains(num)) - { - continue; - } - if (!sortedCardIdList.Contains(num)) - { - sortedCardIdList.Add(num); - } - List keywordListInCard2 = GetKeywordListInCard(num); - for (int j = 0; j < keywordListInCard2.Count; j++) - { - List cardIdsInKeyword2 = GetCardIdsInKeyword(keywordListInCard2[j]); - if (cardIdsInKeyword2.Count == 0) - { - continue; - } - for (int k = 0; k < cardIdsInKeyword2.Count; k++) - { - int num2 = cardIdsInKeyword2[k]; - if (originalList.Contains(num2) && !sortedCardIdList.Contains(num2)) - { - sortedCardIdList.Add(num2); - } - if (k > 0) - { - AddNonAppearedRelationCardId(num2, ref sortedCardIdList); - } - } - AddNonAppearedRelationCardId(cardIdsInKeyword2[0], ref sortedCardIdList); - } - AddNonAppearedRelationCardId(num, ref sortedCardIdList); - } - foreach (int original in originalList) - { - if (!sortedCardIdList.Contains(original)) - { - sortedCardIdList.Add(original); - } - } - return sortedCardIdList; - } - - private void AddNonAppearedRelationCardId(int parentCardId, ref List sortedCardIdList) - { - if (!_relationCardParentDict.TryGetValue(parentCardId, out var value)) - { - return; - } - foreach (int item in value) - { - if (!sortedCardIdList.Contains(item)) - { - sortedCardIdList.Add(item); - } - } - } - - private List GetKeywordListInCard(int cardId) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId); - List list = BattleKeywordInfoListMgr.GetKeywords(cardParameterFromId.ConvertedSkillDescription).ToList(); - if (CardBasePrm.IsFollowerCard(CardData.CharType)) - { - list.AddRange(BattleKeywordInfoListMgr.GetKeywords(cardParameterFromId.ConvertedEvoSkillDescription).ToList()); - } - return list; - } - - private List GetCardIdsInKeyword(string keyword) - { - List list = new List(); - if (Data.Master.BattleKeyWordDic.ContainsKey(keyword)) - { - list.AddRange(BattleKeywordInfoListMgr.GetCardIdsInDesc(Data.Master.BattleKeyWordDic[keyword])); - } - return list; - } - - private void UpdateCardImage() - { - CardMaster instance = CardMaster.GetInstance(_cardMasterId); - int cardId = CardData.CardId; - CardParameter cardParameterFromId = instance.GetCardParameterFromId(cardId); - int resourceCardId = cardParameterFromId.ResourceCardId; - int rarity = CardData.Rarity; - CardBasePrm.CharaType charType = CardData.CharType; - GameObject gameObject = null; - Material material = null; - bool flag = CardBasePrm.IsFollowerCard(charType); - bool flag2 = CardBasePrm.IsSpellCard(charType); - bool flag3 = CardBasePrm.IsAmuletCard(charType); - UnitCardObject.SetActive(flag && !flag2 && !flag3); - SpellCardObject.SetActive(!flag && flag2 && !flag3); - FieldCardObject.SetActive(!flag && !flag2 && flag3); - if (flag2) - { - gameObject = SpellCardObject; - try - { - material = Toolbox.ResourcesManager.FindCardMaterial(resourceCardId, ResourcesManager.AssetLoadPathType.SpellCardMaterial, isEvol: false, CardMaster.IsMutationCardCheck(instance.GetCardParameterFromId(cardId).BaseCardId), instance.GetCardParameterFromId(resourceCardId).CharType); - CardShaderDefine.ReplaceShader(material); - } - catch (Exception ex) - { - Debug.LogError(ex.ToString()); - LocalLog.AccumulateTraceLog(ex.ToString()); - } - _rotationOnlyIconSpell.SetActive(cardParameterFromId.IsResurgentCard); - SpellCost.text = CardData.Cost.ToString(); - SpellName.text = CardData.CardName; - Global.SetRepositionNameLabel(SpellName, CardData.CardName, is2D: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(SpellCost, CardData.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(SpellName, CardData.IsFoil); - } - else if (flag3) - { - gameObject = FieldCardObject; - try - { - material = Toolbox.ResourcesManager.FindCardMaterial(resourceCardId, ResourcesManager.AssetLoadPathType.SpellCardMaterial, isEvol: false, CardMaster.IsMutationCardCheck(instance.GetCardParameterFromId(cardId).BaseCardId), instance.GetCardParameterFromId(resourceCardId).CharType); - CardShaderDefine.ReplaceShader(material); - } - catch (Exception ex2) - { - Debug.LogError(ex2.ToString()); - LocalLog.AccumulateTraceLog(ex2.ToString()); - } - _rotationOnlyIconAmulet.SetActive(cardParameterFromId.IsResurgentCard); - FieldCost.text = CardData.Cost.ToString(); - FieldName.text = CardData.CardName; - Global.SetRepositionNameLabel(FieldName, CardData.CardName, is2D: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(FieldCost, CardData.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(FieldName, CardData.IsFoil); - } - else if (flag) - { - gameObject = UnitCardObject; - try - { - material = Toolbox.ResourcesManager.FindCardMaterial(resourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial, _isEvolCard); - CardShaderDefine.ReplaceShader(material); - } - catch (Exception ex3) - { - Debug.LogError(ex3.ToString()); - LocalLog.AccumulateTraceLog(ex3.ToString()); - } - _rotationOnlyIconFollower.SetActive(cardParameterFromId.IsResurgentCard); - UnitCost.text = CardData.Cost.ToString(); - UnitAtk.text = (_isEvolCard ? CardData.EvoAtk.ToString() : CardData.Atk.ToString()); - UnitLife.text = (_isEvolCard ? CardData.EvoLife.ToString() : CardData.Life.ToString()); - UnitName.text = CardData.CardName; - Global.SetRepositionNameLabel(UnitName, CardData.CardName, is2D: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(UnitCost, CardData.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(UnitAtk, CardData.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(UnitLife, CardData.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(UnitName, CardData.IsFoil); - } - if (material != null) - { - if (cardParameterFromId.IsFoil) - { - if (_premiumShader == null) - { - _premiumShader = Shader.Find("Wizard/VariantCardShader"); - } - if (material.shader != _premiumShader) - { - material.shader = _premiumShader; - material.color = Color.white; - } - } - else - { - if (_normalShader == null) - { - _normalShader = Shader.Find("Wizard/Card/Basic_Front0_Back0_Normal"); - } - if (material.shader != _normalShader) - { - material.shader = _normalShader; - material.color = Color.white; - } - } - } - if (_cardMaterial != null) - { - UnityEngine.Object.Destroy(_cardMaterial); - } - Material cardMaterial = ((material != null) ? UnityEngine.Object.Instantiate(material) : null); - Material[] sharedMaterials = new Material[3] - { - UIManager.GetInstance().getUIBase_CardManager()._3dCardFrameManager.GetFrameMaterial(cardParameterFromId.IsPhantomCard, charType, rarity), - _cardMaterial = cardMaterial, - CardCreatorBase.GetSharedClassIconMaterial(CardData.Clan) - }; - LOD[] lODs = gameObject.GetComponent().GetLODs(); - for (int i = 0; i < lODs.Length; i++) - { - lODs[i].renderers[0].sharedMaterials = sharedMaterials; - } - AttachShadow(gameObject, CardShadow.gameObject); - bool active = UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.CardAllList && GetPossessionCardNum(isIncludingSpotCard: true) <= 0; - CardShadow.SetActive(active); - } - - private static void AttachShadow(GameObject parentObj, GameObject shadowObj) - { - Transform parent = parentObj.transform; - Transform obj = shadowObj.transform; - obj.parent = parent; - obj.localPosition = new Vector3(0f, 0f, kCARD_POS_Z - 1f); - obj.localRotation = Quaternion.identity; - obj.localScale = new Vector3(1f / kCARD_SCALE, 1f / kCARD_SCALE, 1f); - shadowObj.layer = parentObj.layer; - } - - private void UpdateCardNum(GameObject card2dObj = null) - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - if (_isOwnCardNum || card2dObj == null) - { - int possessionCardNum = GetPossessionCardNum(); - if (dataMgr.SpotCardData.ExistsSpotCard(CardData.CardId)) - { - int spotCardNum = dataMgr.SpotCardData.GetSpotCardNum(CardData.CardId); - SetCardNumLabel(possessionCardNum, spotCardNum); - } - else - { - SetCardNumLabel(possessionCardNum); - } - return; - } - CardListTemplate component = card2dObj.GetComponent(); - if (component != null && component.IsShowNum()) - { - if (component.IsIncludingSpotCard) - { - SetCardNumLabel(component.GetNum(), component.GetSpotCardNum()); - } - else - { - SetCardNumLabel(component.GetNum()); - } - } - else - { - SetCardNumLabel(0); - } - } - - private static bool IsTokenId(int cardId) - { - return cardId / 100000000 == 9; - } - - private int GetPossessionCardNumOnRelationCard(bool isIncludingSpotCard) - { - if (IsTokenId(CardData.CardId)) - { - return GetPosessionCardNum(_originalCardId, isIncludingSpotCard); - } - int posessionCardNum = GetPosessionCardNum(_originalCardId, isIncludingSpotCard); - int posessionCardNum2 = GetPosessionCardNum(CardData.CardId, isIncludingSpotCard); - if (posessionCardNum > 0 || posessionCardNum2 > 0) - { - return 1; - } - return 0; - } - - private int GetPosessionCardNum(int cardId, bool isIncludingSpotCard) - { - if (_formatBehaviorForCardPoolChange != null) - { - return _formatBehaviorForCardPoolChange.GetPossessionCardNum(cardId, isIncludingSpotCard); - } - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); - } - - private int GetPossessionCardNum(bool isIncludingSpotCard = false) - { - if (IsRelationCardViewing) - { - return GetPossessionCardNumOnRelationCard(isIncludingSpotCard); - } - return GetPosessionCardNum(CardData.CardId, isIncludingSpotCard); - } - - private void SetCardNumLabel(int num) - { - SetCardNumActive(num > 0); - _cardNumLabel.text = num.ToString(); - } - - private void SetCardNumLabel(int cardNum, int spotCardNum) - { - SetCardNumActive(cardNum + spotCardNum > 0); - _cardNumLabel.text = $"{cardNum}[fcd24a]+{spotCardNum}"; - } - - private void SetCardNumActive(bool isEnabled) - { - if (IsRelationCardViewing) - { - CardNum.SetActive(value: false); - } - else - { - CardNum.SetActive(isEnabled); - } - } - - private void UpdateCardText() - { - if (_isShowCardAblityText) - { - UpdateCardAbilityText(); - StartCoroutine(DelayResetScrollViewPosition()); - _shouldResetTextScrollView = true; - } - else - { - UpdateCardFlavorText(); - if (_shouldResetTextScrollView) - { - ResetScrollViewPosition(); - _shouldResetTextScrollView = false; - } - } - CardBasePrm.CharaType charType = CardData.CharType; - bool flag = CardBasePrm.IsFollowerCard(charType); - bool flag2 = CardBasePrm.IsSpellCard(charType); - bool flag3 = CardBasePrm.IsAmuletCard(charType); - UnitCardTextScrollView.gameObject.SetActive(flag && !flag2 && !flag3); - if (UnitCardTextScrollView.gameObject.activeSelf) - { - UnitCardStatusObj.gameObject.SetActive(_isShowCardAblityText); - UnitCardIntroductionObj.gameObject.SetActive(!_isShowCardAblityText); - } - SpellCardTextScrollView.gameObject.SetActive(!flag && flag2 && !flag3); - if (SpellCardTextScrollView.gameObject.activeSelf) - { - SpellCardStatusObj.gameObject.SetActive(_isShowCardAblityText); - SpellCardIntroductionObj.gameObject.SetActive(!_isShowCardAblityText); - } - SettingCardTextScrollView.gameObject.SetActive(!flag && !flag2 && flag3); - if (SettingCardTextScrollView.gameObject.activeSelf) - { - SettingCardStatusObj.gameObject.SetActive(_isShowCardAblityText); - SettingCardIntroductionObj.gameObject.SetActive(!_isShowCardAblityText); - } - _cardVoiceLabelRoot.gameObject.SetActive(!_isShowCardAblityText && CardData.CardVoice != string.Empty); - _cardSetLabelRoot.gameObject.SetActive(!_isShowCardAblityText); - } - - private void UpdateCardAbilityText() - { - CardBasePrm.CharaType charType = CardData.CharType; - string convertedSkillDescription = CardData.ConvertedSkillDescription; - if (CardBasePrm.IsFollowerCard(charType)) - { - FollowerCardAbilityTexActive(); - } - else if (CardBasePrm.IsSpellCard(charType)) - { - SpellCardSkill.SetWrapText(convertedSkillDescription); - SpellCardSkill.gameObject.SetActive(value: false); - SpellCardSkill.gameObject.SetActive(value: true); - _cardSpellTextLineCreater.ShowLines(GetLineNumber(SpellCardSkill), isOriginalActive: true); - } - else if (CardBasePrm.IsAmuletCard(charType)) - { - SettingCardSkill.SetWrapText(convertedSkillDescription); - SettingCardSkill.gameObject.SetActive(value: false); - SettingCardSkill.gameObject.SetActive(value: true); - _cardAmuletTextLineCreater.ShowLines(GetLineNumber(SettingCardSkill), isOriginalActive: true); - } - } - - private void FollowerCardAbilityTexActive() - { - bool isEvolveChoiceCard = CardData.IsEvolveChoiceCard; - UILabel normalTitleLavel = _normalTitleLavel; - string text3; - if (!isEvolveChoiceCard) - { - string text = (_normalTitleLavel.text = Data.SystemText.Get("Card_0037")); - text3 = text; - } - else - { - text3 = Data.SystemText.Get("Card_0038"); - } - normalTitleLavel.text = text3; - _evolveInfoObjectRoot.gameObject.SetActive(!isEvolveChoiceCard); - UnitCardSkill.SetWrapText(isEvolveChoiceCard ? CardData.ConvertedEvoSkillDescription : CardData.ConvertedSkillDescription); - UnitCardEvoSkill.SetWrapText(isEvolveChoiceCard ? string.Empty : CardData.ConvertedEvoSkillDescription); - UnitCardAtkRight.text = (isEvolveChoiceCard ? CardData.EvoAtk.ToString() : CardData.Atk.ToString()); - UnitCardLifeRight.text = (isEvolveChoiceCard ? CardData.EvoLife.ToString() : CardData.Life.ToString()); - UnitCardEvoAtkRight.text = (isEvolveChoiceCard ? string.Empty : CardData.EvoAtk.ToString()); - UnitCardEvoLifeRight.text = (isEvolveChoiceCard ? string.Empty : CardData.EvoLife.ToString()); - UnitCardSkill.gameObject.SetActive(value: false); - UnitCardSkill.gameObject.SetActive(value: true); - UnitCardEvoSkill.gameObject.SetActive(value: false); - UnitCardEvoSkill.gameObject.SetActive(!isEvolveChoiceCard); - _cardSkillTextLineCreater.ShowLines(GetLineNumber(UnitCardSkill)); - _cardEvoSkillTextLineCreater.ShowLines(GetLineNumber(UnitCardEvoSkill)); - } - - private int GetLineNumber(UILabel uILabel) - { - return Global.GetTextLineCount(uILabel.text); - } - - private void UpdateCardFlavorText() - { - string wrapText = "???"; - NGUIText.Alignment alignment = NGUIText.Alignment.Center; - if (IsPopularityVote || GetPossessionCardNum(isIncludingSpotCard: true) > 0) - { - wrapText = (_isEvolCard ? CardData.EvoDescription : CardData.Description); - alignment = NGUIText.Alignment.Left; - } - CardBasePrm.CharaType charType = CardData.CharType; - UILabel uILabel = null; - if (CardBasePrm.IsFollowerCard(charType)) - { - uILabel = UnitCardIntroduction; - } - else if (CardBasePrm.IsSpellCard(charType)) - { - uILabel = SpellCardIntroduction; - } - else if (CardBasePrm.IsAmuletCard(charType)) - { - uILabel = SettingCardIntroduction; - } - uILabel.SetWrapText(wrapText); - uILabel.alignment = alignment; - _cardVoiceValueLabel.text = CardData.CardVoice; - _cardSetValueLabel.text = Data.Master.CardSetNameMgr.Get(CardData.CardSetId).LongName; - } - - private void UpdateButtonState() - { - UpdateFavoriteButton(); - UpdateVoiceButton(); - CardIntroductionButton.SetActive(IsShowFlavorTextButton); - UpdateEvolutionButton(); - UpdatePremiumCardConversionButton(); - QuestionMark.SetActive(_isShowCardAblityText && BattlePlayerView.HasKeyword(CardData)); - } - - private void OnSwipeCard(GameObject g, Vector2 dir) - { - if (IsRelationCardViewing) - { - if (_relationCardIds.Count > 1) - { - if (dir.x >= 70f) - { - OnPushLeftButton(LeftButton); - } - if (dir.x <= -70f) - { - OnPushRightButton(RightButton); - } - } - } - else if (!IsAnimationPlaying && (!(_craftDialog != null) || !_craftDialog.IsOpen())) - { - OnDragCard.Call(dir); - } - } - - private void ParseIdsFunc(List allParams, int cardId) - { - foreach (CardParameter allParam in allParams) - { - if (allParam.CardId == cardId) - { - ParseIds(allParams, allParam.Skill, cardId); - ParseIds(allParams, allParam.SkillCondition, cardId); - ParseIds(allParams, allParam.SkillOption, cardId, RELATION_CARD_SKILLOPTION_EXCLUDED_OPTIONS, RELATION_CARD_SKILLOPTION_SEPARATORS); - ParseIds(allParams, allParam.SkillPreprocess, cardId); - ParseIds(allParams, allParam.SkillTarget, cardId); - break; - } - } - } - - private void ParseIds(List allParams, string str, int cardId, List excludedOptions = null, char[] separators = null) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId); - string normalSkillText = Global.ConvertToWithoutBBCode(cardParameterFromId.SkillDescription); - string evolSkillText = Global.ConvertToWithoutBBCode(cardParameterFromId.EvoSkillDescription); - if (excludedOptions != null && separators != null) - { - string[] sub = str.Split(separators, StringSplitOptions.RemoveEmptyEntries); - int i; - for (i = 0; i < sub.Length; i++) - { - if (excludedOptions.Any((string x) => sub[i].Contains(x))) - { - continue; - } - foreach (Match item in Regex.Matches(sub[i], "\\d{9}")) - { - int validateCardId = int.Parse(item.Value); - ValidateAddId(validateCardId, cardParameterFromId, normalSkillText, evolSkillText, allParams); - } - } - } - else - { - foreach (Match item2 in Regex.Matches(str, "\\d{9}")) - { - int validateCardId2 = int.Parse(item2.Value); - ValidateAddId(validateCardId2, cardParameterFromId, normalSkillText, evolSkillText, allParams); - } - } - if (_relationCardIds.Count > 0) - { - RelationCardButton.SetActive(value: true); - UpdateRelationCount(); - } - else - { - RelationCardButton.SetActive(value: false); - } - } - - private void ValidateAddId(int validateCardId, CardParameter refRootCardParam, string normalSkillText, string evolSkillText, List allParams) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_originalCardId); - CardParameter cardParameterFromId2 = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(validateCardId); - int validateBaseCardId = cardParameterFromId2.BaseCardId; - if ((validateBaseCardId == cardParameterFromId.BaseCardId && !cardParameterFromId2.IsEvolveChoiceCard) || validateCardId == 0 || _relationCardIds.Contains(validateCardId) || validateCardId == refRootCardParam.CardId || validateCardId == refRootCardParam.NormalCardId) - { - return; - } - if (refRootCardParam.CardId != _originalCardId) - { - int num = _relationCardIds.FindIndex((int cardId) => CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId).BaseCardId == validateBaseCardId); - if (num >= 0) - { - CardParameter cardParameterFromId3 = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_relationCardIds[num]); - if (cardParameterFromId3.BaseCardId == cardParameterFromId3.CardId || validateBaseCardId != validateCardId) - { - return; - } - _relationCardIds.RemoveAt(num); - } - } - if (validateCardId == 100011010) - { - string value = Global.ConvertToWithoutBBCode(CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(validateCardId).CardName); - if (!normalSkillText.Contains(value) && !evolSkillText.Contains(value)) - { - return; - } - } - if (!validateCardId.ToString().StartsWith(RELATION_CARD_DISABLE_CARD_ID_HEADER, StringComparison.Ordinal)) - { - _relationCardIds.Add(validateCardId); - if (!_relationCardParentDict.TryGetValue(refRootCardParam.CardId, out var value2)) - { - value2 = new List(); - _relationCardParentDict.Add(refRootCardParam.CardId, value2); - } - value2.Add(validateCardId); - } - ParseIdsFunc(allParams, validateCardId); - } - - private void OnPushRelationCardButton(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - if (!IsAnimationPlaying) - { - IsAnimationPlaying = true; - RelationCardButton.SetActive(value: false); - RelationWrapperObj.SetActive(value: true); - _relationIndex = 0; - RereshRelation(g); - } - } - - private void OnPushRelationBackButton(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SWITCH_MENU); - if (!IsAnimationPlaying) - { - RelationWrapperObj.SetActive(value: false); - IsAnimationPlaying = true; - _relationIndex = 0; - SetCardDetail(_originalCardId, _relationCardBaseGameObject); - OpenCardAnimation(); - DialogTitleLabel.text = Data.SystemText.Get("Card_0135"); - } - } - - private void OnPushRightButton(GameObject g) - { - if (IsRelationCardViewing) - { - if (!IsAnimationPlaying) - { - IsAnimationPlaying = true; - _relationIndex++; - if (_relationIndex >= _relationCardIds.Count) - { - _relationIndex = 0; - } - RereshRelation(g); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - else - { - OnDragCard.Call(new Vector2(-70f, 0f)); - } - } - - private void OnPushLeftButton(GameObject g) - { - if (IsRelationCardViewing) - { - if (!IsAnimationPlaying) - { - IsAnimationPlaying = true; - _relationIndex--; - if (_relationIndex < 0) - { - _relationIndex = _relationCardIds.Count - 1; - } - RereshRelation(g); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - else - { - OnDragCard.Call(new Vector2(70f, 0f)); - } - } - - private void UpdateRelationCount() - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_originalCardId); - DialogTitleLabel.text = string.Format(Data.SystemText.Get("Card_0217") + "\u3000({1}/{2})", cardParameterFromId.CardName, _relationIndex + 1, _relationCardIds.Count); - } - - private void RereshRelation(GameObject g) - { - UpdateRelationCount(); - if (IsRelationCardViewing) - { - bool active = _relationCardIds.Count > 1; - RightButton.SetActive(active); - LeftButton.SetActive(active); - } - Toolbox.ResourcesManager.RemoveAssetGroup(_assetTokenPathList); - _assetTokenPathList.Clear(); - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_originalCardId); - int id = _relationCardIds[_relationIndex]; - CardParameter cardParameterFromId2 = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(id); - if (cardParameterFromId.IsFoil) - { - id = cardParameterFromId2.FoilCardId; - } - AddResourceList(cardParameterFromId2); - CardTexture.SetActive(value: false); - SetEnableButtons(isEnable: false); - Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(_assetTokenPathList, delegate - { - CardTexture.SetActive(value: true); - SetCardDetail(id, g, isUpdateRelation: false); - OpenCardAnimation(); - SetEnableButtons(isEnable: true); - }); - } - - private void AddResourceList(CardParameter CardPrm) - { - int resourceCardId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(CardPrm.NormalCardId).ResourceCardId; - switch (CardPrm.CharType) - { - case CardBasePrm.CharaType.NORMAL: - { - string assetTypePath3 = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial); - _assetTokenPathList.Add(assetTypePath3); - break; - } - case CardBasePrm.CharaType.SPELL: - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); - _assetTokenPathList.Add(assetTypePath2); - break; - } - default: - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); - _assetTokenPathList.Add(assetTypePath); - break; - } - } - } - - private void OnOpenCardViewMode(GameObject g) - { - if (_isAbleTapDialogObject && !IsAnimationPlaying && !isAnimation && !isCardViewMode && (UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.CardAllList || GetPossessionCardNum(isIncludingSpotCard: true) > 0)) - { - isCardViewMode = true; - IsAnimationPlaying = true; - CardViewBG.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO); - CardBasePrm.CharaType charType = CardData.CharType; - if (CardBasePrm.IsSpellCard(charType)) - { - ViewCardObject = NGUITools.AddChild(base.gameObject, SpellCardObject); - } - else if (CardBasePrm.IsAmuletCard(charType)) - { - ViewCardObject = NGUITools.AddChild(base.gameObject, FieldCardObject); - } - else if (CardBasePrm.IsFollowerCard(charType)) - { - ViewCardObject = NGUITools.AddChild(base.gameObject, UnitCardObject); - } - iTween.ScaleTo(ViewCardObject, iTween.Hash("Scale", CardViewScale, "time", 0.3f)); - iTween.RotateTo(ViewCardObject, iTween.Hash("z", 0f, "time", 0.3f, "oncompletetarget", base.gameObject, "oncomplete", "OnAnimationOver")); - ViewCardObject.transform.localPosition = new Vector3(0f, 0f, -100f); - } - } - - private void OnCloseCardViewMode() - { - if (!IsAnimationPlaying && isCardViewMode) - { - IsAnimationPlaying = true; - RemoveCardViewMode(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - CardBasePrm.CharaType charType = CardData.CharType; - GameObject target = null; - if (CardBasePrm.IsSpellCard(charType)) - { - target = SpellCardObject; - } - else if (CardBasePrm.IsAmuletCard(charType)) - { - target = FieldCardObject; - } - else if (CardBasePrm.IsFollowerCard(charType)) - { - target = UnitCardObject; - } - iTween.MoveTo(target, iTween.Hash("islocal", true, "z", kCARD_POS_Z, "time", 0.3f, "oncompletetarget", base.gameObject, "oncomplete", "OnAnimationOver")); - } - } - - private void RemoveCardViewMode() - { - if (isCardViewMode) - { - UnityEngine.Object.Destroy(ViewCardObject); - CardViewBG.SetActive(value: false); - isCardViewMode = false; - } - } - - private void OnCloseCardViewMode(GameObject g) - { - OnCloseCardViewMode(); - } - - private void UpdateFavoriteButton() - { - _isFavorite = GameMgr.GetIns().GetDataMgr().FavoriteCardList.Contains(CardData.CardId); - _favoriteButton.gameObject.SetActive(IsShowFavoriteButton && GetPossessionCardNum() > 0 && CardData.IsEnableFavorite && !IsRelationCardViewing); - SetFavoriteButtonSprite(_isFavorite); - } - - private void SetFavoriteButtonSprite(bool isFavorite) - { - string text = "btn_favorite_"; - string text2 = "off"; - string text3 = "on"; - _favoriteButton.normalSprite = text + (isFavorite ? text3 : text2); - _favoriteButton.pressedSprite = text + (isFavorite ? text2 : text3); - } - - private void OnClickFavoriteButton(GameObject g) - { - if (_isFavoriteButtonEnabled && GetPossessionCardNum() > 0) - { - _isFavoriteButtonEnabled = false; - StartCoroutine(Timer.DelayMethod(0.9f, delegate - { - _isFavoriteButtonEnabled = true; - })); - bool flag = !_isFavorite; - GameMgr.GetIns().GetSoundMgr().PlaySe(flag ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - ChangeFavoriteState(); - } - } - - private void ChangeFavoriteState() - { - bool is_protected = !_isFavorite; - CardProtectTask cardProtectTask = new CardProtectTask(); - cardProtectTask.SetParameter(CardData.CardId, is_protected); - StartCoroutine(Toolbox.NetworkManager.Connect(cardProtectTask, OnSuccessProtectCard, null, OnErrorProtectCard)); - } - - private void OnSuccessProtectCard(NetworkTask.ResultCode code) - { - UpdateButtonState(); - UpdateCreateLiquefyButton(); - OnChangeCardFavoriteState.Call(); - } - - private void OnErrorProtectCard(int code) - { - UpdateButtonState(); - UpdateCreateLiquefyButton(); - } - - private void UpdateVoiceButton() - { - CardVoiceData cardVoiceData = new CardVoiceData(CardData, _cardMasterId); - bool flag = (!_isEvolCard && cardVoiceData._voiceListBeforeEvo.Count > 0) || (_isEvolCard && cardVoiceData._voiceListAfterEvo.Count > 0); - _voiceButton.gameObject.SetActive(flag && IsShowVoiceButton && (IsPopularityVote || GetPossessionCardNum(isIncludingSpotCard: true) > 0)); - } - - private void OnClickVoiceButton(GameObject g) - { - _cardVoiceManager.SequentiallyPlay(CardData, _isEvolCard, _cardMasterId); - } - - private void OnClickChangeCardTextTypeButton(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - _isShowCardAblityText = !_isShowCardAblityText; - UpdateCardText(); - UpdateButtonState(); - } - - private void UpdateEvolutionButton() - { - if (CardBasePrm.IsFollowerCard(CardData.CharType) && !CardData.IsEvolveChoiceCard) - { - CardEvolButton.gameObject.SetActive(IsShowEvolutionButton && (IsPopularityVote || GetPossessionCardNum(isIncludingSpotCard: true) > 0)); - _evolutionButtonLabel.text = Data.SystemText.Get(_isEvolCard ? "Card_0067" : "Card_0030"); - } - else - { - CardEvolButton.gameObject.SetActive(value: false); - } - } - - private void OnClickEvolutionButton(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_MYPAGE_EVOLVE); - _isEvolCard = !_isEvolCard; - UpdateCardImage(); - UpdateCardText(); - UpdateButtonState(); - _cardVoiceManager.Stop(); - if (_evolEffect != null) - { - _evolEffect.Play(); - return; - } - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("cmn_deckedit_evo_1", ResourcesManager.AssetLoadPathType.Effect2D); - _assetPathList.Add(assetTypePath); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(assetTypePath, delegate - { - GameObject gameObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_deckedit_evo_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject; - if (gameObject != null) - { - ParticleSystem component = gameObject.GetComponent(); - ParticleSystem.MainModule main = component.main; - main.playOnAwake = false; - _evolEffect = UnityEngine.Object.Instantiate(component); - _evolEffect.transform.parent = CardTexture.transform; - _evolEffect.transform.localPosition = Vector3.back * 10f; - _evolEffect.transform.localRotation = Quaternion.identity; - _evolEffect.transform.localScale = Vector3.one * 600f; - _evolEffect.gameObject.layer = base.gameObject.layer; - Transform[] componentsInChildren = _evolEffect.GetComponentsInChildren(); - for (int i = 0; i < componentsInChildren.Length; i++) - { - componentsInChildren[i].gameObject.layer = base.gameObject.layer; - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(new List { _evolEffect.gameObject }, delegate - { - if ((bool)_evolEffect) - { - _evolEffect.gameObject.SetActive(value: true); - _evolEffect.Play(); - } - }, isBattle: true); - } - })); - } - - private void UpdatePremiumCardConversionButton() - { - GameObject gameObject = _premiumCardConversionButton.gameObject; - UIManager.SetObjectToGrey(gameObject, PlayerStaticData.UserOrbNum <= 0); - if (!IsShowPremiumCardConversionButton || IsRelationCardViewing || GetPossessionCardNum() <= 0 || CardData.IsFoil || (CardData.IsNotCraftDestruct && !CardData.IsPreReleaseCard)) - { - gameObject.SetActive(value: false); - } - else - { - gameObject.SetActive(value: true); - } - } - - private void OnClickPremiumCardConversionButton(GameObject g) - { - if (GetPossessionCardNum() <= 0) - { - return; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (isAnimation) - { - return; - } - SystemText systemText = Data.SystemText; - if (PlayerStaticData.UserOrbNum <= 0) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Card_0163_1")); - dialogBase.SetText(systemText.Get("Card_0163_2")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } - else if (GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(CardData.FoilCardId, isIncludingSpotCard: true) >= 3) - { - DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(); - dialogBase2.SetTitleLabel(systemText.Get("Card_0164_1")); - dialogBase2.SetText(systemText.Get("Card_0164_2")); - dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } - else if (_isFavorite) - { - DialogBase dialogBase3 = UIManager.GetInstance().CreateDialogClose(); - dialogBase3.SetTitleLabel(systemText.Get("Card_0165_1")); - dialogBase3.SetText(systemText.Get("Card_0165_2")); - dialogBase3.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase3.SetButtonText(systemText.Get("Card_0165_3")); - dialogBase3.onPushButton1 = delegate - { - CreatePremiumCardConversionDialog(); - }; - } - else - { - CreatePremiumCardConversionDialog(); - } - } - - private void CreatePremiumCardConversionDialog() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - PremiumCardConversionDialogParts premiumCardConversionDialogParts = UnityEngine.Object.Instantiate(_premiumCardConversionDialogPrefab); - premiumCardConversionDialogParts.Initialize(CardData); - dialogBase.SetObj(premiumCardConversionDialogParts.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(systemText.Get("Card_0162_1")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Card_0162_7")); - dialogBase.onPushButton1 = delegate - { - if (!_isFavorite) - { - ConvertPremiumCard(); - } - else - { - ChangeFavoriteState(); - OnChangeCardFavoriteState = (Action)Delegate.Combine(OnChangeCardFavoriteState, new Action(ConvertPremiumCard)); - } - }; - } - - private void ConvertPremiumCard() - { - OnChangeCardFavoriteState = (Action)Delegate.Remove(OnChangeCardFavoriteState, new Action(ConvertPremiumCard)); - PremiumCardConversionTask premiumCardConversionTask = new PremiumCardConversionTask(); - premiumCardConversionTask.SetParameter(CardData.CardId, GetPossessionCardNum()); - StartCoroutine(Toolbox.NetworkManager.Connect(premiumCardConversionTask, OnSuccessPremiumCardConversion)); - } - - private void OnSuccessPremiumCardConversion(NetworkTask.ResultCode code) - { - OnConvertedPremiumCard.Call(CardData); - StartCoroutine(StartPremiumCardConversionAnimation()); - } - - private IEnumerator StartPremiumCardConversionAnimation() - { - isAnimation = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_USE_RED_ETHER); - yield return StartCoroutine(PlayCardCreateEffect(PREMIUM_CARD_CONVERSION_PARTICLE_COLOR, _premiumCardConversionButton.transform.position, _cardNumLabel.transform.position, 4)); - SetCardDetail(CardData.FoilCardId); - isAnimation = false; - } - - private void UpdateCreateLiquefyButton(bool isUpdateHaveRedether = true) - { - if (IsShowCraftButtons && !IsRelationCardViewing) - { - _craftPanel.gameObject.SetActive(value: true); - _craftPanel.UpdateCraftPanel(CardData, isUpdateHaveRedether); - } - else - { - _craftPanel.gameObject.SetActive(value: false); - } - } - - private void StartCardDestruct() - { - if (!IsAbleToDestruct) - { - return; - } - CardMake component = base.gameObject.GetComponent(); - component.OnCardSell = delegate - { - if (GetPossessionCardNum() <= 0) - { - OnLiquefyAllCard.Call(CardData); - } - StartCoroutine(RunCardDestruct()); - }; - component.StartCardDestruct(CardData.CardId); - } - - private IEnumerator RunCardDestruct() - { - isAnimation = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GET_RED_ETHER); - yield return StartCoroutine(PlayCardLiquefyEffect(CARD_LIQUEFY_PARTICLE_COLOR, _cardNumLabel.transform.position, RedEtherIcon.transform.position, CardData.Rarity)); - iTween.ValueTo(base.gameObject, iTween.Hash("from", int.Parse(_redEtherHaveValueLabel.text), "to", PlayerStaticData.UserRedEtherCount, "time", 0.5f, "onupdate", "OnUpdateRedEther", "oncomplete", "OnCompleteRedEther", "easetype", iTween.EaseType.easeOutQuad)); - UpdateCardNum(); - CardShadow.gameObject.SetActive(GetPossessionCardNum(isIncludingSpotCard: true) <= 0 && !IsShortageUI); - UpdateCardText(); - UpdateButtonState(); - OnCardNumChange.Call(); - UpdateCreateLiquefyButton(isUpdateHaveRedether: false); - OnCardSellId.Call(CardData.CardId); - yield return new WaitForSeconds(0.2f); - isAnimation = false; - } - - private IEnumerator PlayCardLiquefyEffect(Color particleColor, Vector3 particleStartPos, Vector3 particleEndPos, int particleNum) - { - particleStartPos += CARD_DESTROY_PARTICLE_OFFSET; - particleEndPos += CARD_DESTROY_PARTICLE_OFFSET; - EffectMgr effectMgr = GameMgr.GetIns().GetEffectMgr(); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_CARD_1); - for (int i = 0; i < CardData.Rarity; i++) - { - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_TRACK_1); - } - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_ICON_1); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_1); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_2); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_3); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_4); - effectMgr.Start(EffectMgr.EffectType.CMN_CRAFT_CARD_1, CardTexture.transform.position).ChangeParticleColor(particleColor); - for (int j = 0; j < particleNum; j++) - { - Effect effect = effectMgr.Start(EffectMgr.EffectType.CMN_CRAFT_TRACK_1, particleStartPos); - effect.ChangeParticleColor(particleColor); - Vector3 vector = new Vector3(UnityEngine.Random.value * 3f - 1.5f, UnityEngine.Random.value * 3f - 1.5f, -1f); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(particleStartPos, particleStartPos + vector, particleEndPos, 10); - iTween.MoveTo(effect.GetGameObjIns(), iTween.Hash("path", bezierQuad, "time", 0.5f, "movetopath", false, "easetype", iTween.EaseType.linear)); - } - yield return new WaitForSeconds(0.5f); - effectMgr.Start(EffectMgr.EffectType.CMN_CRAFT_ICON_1, particleEndPos).ChangeParticleColor(particleColor); - EffectMgr.EffectType type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_1; - switch (particleNum) - { - case 1: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_1; - break; - case 2: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_2; - break; - case 3: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_3; - break; - case 4: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_4; - break; - } - effectMgr.Start(type, particleEndPos).ChangeParticleColor(particleColor); - } - - private void StartCardCraft() - { - if (!IsAbleToCraft) - { - return; - } - CardMake component = base.gameObject.GetComponent(); - component.OnCardBuy = delegate - { - if (GetPossessionCardNum(isIncludingSpotCard: true) == 1) - { - OnCreateFirstCard.Call(); - } - StartCoroutine(RunCardCraft()); - }; - component.StartCardCraft(CardData.CardId); - } - - private IEnumerator RunCardCraft() - { - isAnimation = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_USE_RED_ETHER); - yield return StartCoroutine(PlayCardCreateEffect(CARD_CREATE_PARTICLE_COLOR, RedEtherIcon.transform.position, _cardNumLabel.transform.position, CardData.Rarity)); - iTween.ValueTo(base.gameObject, iTween.Hash("from", int.Parse(_redEtherHaveValueLabel.text), "to", PlayerStaticData.UserRedEtherCount, "time", 0.5f, "onupdate", "OnUpdateRedEther", "oncomplete", "OnCompleteRedEther", "easetype", iTween.EaseType.easeOutQuad)); - UpdateCardNum(); - CardShadow.gameObject.SetActive(value: false); - UpdateCardText(); - UpdateButtonState(); - UpdateCreateLiquefyButton(isUpdateHaveRedether: false); - OnCardNumChange.Call(); - OnCardBuy.Call(); - yield return new WaitForSeconds(0.2f); - isAnimation = false; - } - - private IEnumerator PlayCardCreateEffect(Color particleColor, Vector3 particleStartPos, Vector3 particleEndPos, int particleNum) - { - EffectMgr effectMgr = GameMgr.GetIns().GetEffectMgr(); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_ICON_1); - for (int i = 0; i < particleNum; i++) - { - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_TRACK_1); - } - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_CARD_2); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_1); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_2); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_3); - effectMgr.Stop(EffectMgr.EffectType.CMN_CRAFT_SPLASH_4); - effectMgr.Start(EffectMgr.EffectType.CMN_CRAFT_ICON_1, particleStartPos).ChangeParticleColor(particleColor); - for (int j = 0; j < particleNum; j++) - { - Effect effect = effectMgr.Start(EffectMgr.EffectType.CMN_CRAFT_TRACK_1, particleStartPos); - effect.ChangeParticleColor(particleColor); - Vector3 vector = new Vector3(UnityEngine.Random.value * 3f - 1.5f, UnityEngine.Random.value * 3f - 1.5f, -1f); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(particleStartPos, particleStartPos + vector, particleEndPos, 10); - iTween.MoveTo(effect.GetGameObjIns(), iTween.Hash("path", bezierQuad, "time", 0.5f, "movetopath", false, "easetype", iTween.EaseType.linear)); - } - yield return new WaitForSeconds(0.5f); - effectMgr.Start(EffectMgr.EffectType.CMN_CRAFT_CARD_2, CardTexture.transform.position + Vector3.back); - EffectMgr.EffectType type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_1; - switch (particleNum) - { - case 1: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_1; - break; - case 2: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_2; - break; - case 3: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_3; - break; - case 4: - type = EffectMgr.EffectType.CMN_CRAFT_SPLASH_4; - break; - } - effectMgr.Start(type, particleEndPos).ChangeParticleColor(particleColor); - } - - private void OnUpdateRedEther(int value) - { - _redEtherHaveValueLabel.text = value.ToString(); - } - - private void OnCompleteRedEther() - { - _redEtherHaveValueLabel.text = PlayerStaticData.UserRedEtherCount.ToString(); - } - - private void CreateDialog(Action onOk, bool buy) - { - if (!isAnimation) - { - _craftDialog = UIManager.GetInstance().CreateDialogClose(); - _craftDialog.onPushButton1 = onOk; - PurchaseConfirm purchaseConfirm = UnityEngine.Object.Instantiate(PurchaseConfirmPrefab); - _craftDialog.SetObj(purchaseConfirm.gameObject); - int userRedEtherCount = PlayerStaticData.UserRedEtherCount; - SystemText systemText = Data.SystemText; - if (buy) - { - _craftDialog.SetTitleLabel(systemText.Get("Card_0081")); - _craftDialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - _craftDialog.SetButtonText(systemText.Get("Dia_CardList_003_Button")); - int useRedEther = CardData.UseRedEther; - purchaseConfirm.SetCardBuy(systemText.Get("Common_0205"), userRedEtherCount, useRedEther, CardData); - } - else - { - _craftDialog.SetTitleLabel(systemText.Get("Card_0080")); - _craftDialog.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - _craftDialog.SetButtonText(systemText.Get("Dia_CardList_002_Button")); - int getRedEther = CardData.GetRedEther; - purchaseConfirm.SetCardSell(systemText.Get("Common_0205"), userRedEtherCount, getRedEther, CardData.CardName, CardData.IsFoil); - } - } - } - - private IEnumerator DelayResetScrollViewPosition() - { - yield return null; - ResetScrollViewPosition(); - } - - private void ResetScrollViewPosition() - { - UnitCardTextScrollView.ResetPosition(); - SpellCardTextScrollView.ResetPosition(); - SettingCardTextScrollView.ResetPosition(); - UnitCardTextScrollView.UpdateScrollbars(recalculateBounds: true); - SpellCardTextScrollView.UpdateScrollbars(recalculateBounds: true); - SettingCardTextScrollView.UpdateScrollbars(recalculateBounds: true); - } - - private void ChangeLayer(GameObject o, int layer) - { - o.layer = layer; - for (int i = 0; i < o.transform.childCount; i++) - { - ChangeLayer(o.transform.GetChild(i).gameObject, layer); - } - } - - public bool GetIsDetailOn() - { - return isDetailOn; - } - - public void SetDisableArrowButton() - { - OnDetailCardUpdate = delegate - { - RightButtonVisible = false; - LeftButtonVisible = false; - }; - } - - public void SetEnableButtons(bool isEnable) - { - for (int i = 0; i < _enableButtonList.Length; i++) - { - _enableButtonList[i].isEnabled = isEnable; - } - _isAbleTapDialogObject = isEnable; - if (isEnable) - { - UpdateButtonState(); - UpdateCreateLiquefyButton(); - } - } - - private void LateUpdate() - { - if (!UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.QuestSelectionPage)) - { - return; - } - for (int i = 0; i < base.transform.childCount; i++) - { - Transform child = base.transform.GetChild(i); - if (child.name != "CardTexture" && child.name != "CardText") - { - AllLabelColorChanger.ChangeAllLabel(child.gameObject, AllLabelColorChanger.COLOR_TABLE_DETAIL); - } - } - } - - public void SetSortOrder(int sortOrder) - { - for (int i = 0; i < _allPanel.Length; i++) - { - _allPanel[i].sortingOrder = sortOrder + i; - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using Cute; +using UnityEngine; +using Wizard; +using Wizard.Battle.View; + +public class CardDetailUI : UIBase +{ + private class CardVoiceData + { + + public readonly string MainVoiceId; + + public readonly List _acceleratedVoiceIdList = new List(); + + public readonly List _voiceListBeforeEvo; + + public readonly List _voiceListAfterEvo; + + private CardMaster.CardMasterId _cardMasterId; + + private List _splitVoiceList; + + public CardVoiceData(CardParameter cardParam, CardMaster.CardMasterId cardMasterId) + { + _cardMasterId = cardMasterId; + VoiceDictionaries voiceDictionaries = new VoiceDictionaries(cardParam.CardId, _cardMasterId); + MainVoiceId = voiceDictionaries.VoiceId; + List list = new List(); + List normalPlayVoices = voiceDictionaries.GetNormalPlayVoices(); + list.AddRange(normalPlayVoices); + list.AddRange(voiceDictionaries.atkVoices.GetAllVoiceList()); + list.AddRange(voiceDictionaries.destroyVoices.GetAllVoiceList()); + AddVoiceList(list, voiceDictionaries.skillVoices); + SkillOptionValue skillOptionValue = new SkillOptionValue(cardParam.SkillOption); + string option = skillOptionValue.GetOption(SkillFilterCreator.ContentKeyword.skill); + if (!string.IsNullOrEmpty(option)) + { + Skill_attach_skill.AttachOptionInfo attachOptionInfo = new Skill_attach_skill.AttachOptionInfo(option); + if (attachOptionInfo.Voice != string.Empty) + { + VoiceDictionary item = new VoiceDictionary(attachOptionInfo.Voice); + voiceDictionaries.attachSkillVoices.Add(item); + } + } + bool flag = skillOptionValue.GetOption(SkillFilterCreator.ContentKeyword.is_evolve, "false") == "true"; + if (voiceDictionaries.attachSkillVoices.Count > 0 && !flag) + { + AddVoiceList(list, voiceDictionaries.attachSkillVoices, list); + } + MatchCollection matchCollection = new Regex("card_id=(?80\\d*)").Matches(cardParam.SkillOption); + _acceleratedVoiceIdList.Clear(); + for (int i = 0; i < matchCollection.Count; i++) + { + VoiceDictionaries voiceDictionaries2 = new VoiceDictionaries(int.Parse(matchCollection[i].Groups["ACC_CARD_ID"].Value), _cardMasterId); + list.AddRange(voiceDictionaries2.playVoices.GetAllVoiceList()); + string voiceId = voiceDictionaries2.VoiceId; + if (!string.IsNullOrEmpty(voiceId)) + { + _acceleratedVoiceIdList.Add(voiceId); + } + } + _voiceListBeforeEvo = GetPlayableVoiceList(list); + List list2 = new List(); + list2.AddRange(voiceDictionaries.evoVoices.GetAllVoiceList()); + list2.AddRange(voiceDictionaries.evoAtkVoices.GetAllVoiceList()); + list2.AddRange(voiceDictionaries.evoDestroyVoices.GetAllVoiceList()); + AddVoiceList(list2, voiceDictionaries.evoSkillVoices, list); + if (voiceDictionaries.attachSkillVoices.Count > 0 && flag) + { + AddVoiceList(list2, voiceDictionaries.attachSkillVoices, list2); + } + _voiceListAfterEvo = GetPlayableVoiceList(list2); + } + + private List GetPlayableVoiceList(List voiceList) + { + List list = new List(); + for (int i = 0; i < voiceList.Count; i++) + { + if (!Data.Master.CardDetailVoiceIgnoreList.Contains(voiceList[i])) + { + list.Add(voiceList[i]); + } + } + return list; + } + + private void AddVoiceList(List tempVoiceList, List voices, List normalVoiceList = null) + { + if (_splitVoiceList != null && normalVoiceList != null) + { + if (voices == null) + { + voices = _splitVoiceList; + } + else + { + for (int num = _splitVoiceList.Count - 1; num >= 0; num--) + { + voices.Insert(0, _splitVoiceList[num]); + } + } + } + if (voices == null || voices.Count <= 0) + { + return; + } + for (int i = 0; i < voices.Count; i++) + { + string[] allVoiceList = voices[i].GetAllVoiceList(); + foreach (string text in allVoiceList) + { + if (text.Contains("none") || tempVoiceList.Contains(text)) + { + continue; + } + if (text.Contains('|')) + { + if (_splitVoiceList == null) + { + _splitVoiceList = new List(); + _splitVoiceList.Add(voices[i]); + } + else if (!_splitVoiceList.Contains(voices[i])) + { + _splitVoiceList.Add(voices[i]); + } + string[] array = text.Split('|'); + if (array.Length == 2) + { + string item = ((normalVoiceList == null) ? array[0] : array[1]); + tempVoiceList.Add(item); + } + } + else if (normalVoiceList == null) + { + tempVoiceList.Add(text); + } + else if (!normalVoiceList.Contains(text)) + { + tempVoiceList.Add(text); + } + } + } + } + } + + private class CardVoiceManager + { + private int _cardId; + + private bool _isPlayEvoVoice; + + private CardVoiceData _voiceData; + + private int _playIndex; + + private List _playVoiceList; + + private List _loadVoiceIdList = new List(); + + private List _unloadVoiceIdList = new List(); + + private List _loadedVoiceIdList = new List(); + + public void SequentiallyPlay(CardParameter cardParam, bool isPlayEvoVoice, CardMaster.CardMasterId cardMasterId) + { + int cardId = cardParam.CardId; + if (cardId == _cardId) + { + if (isPlayEvoVoice != _isPlayEvoVoice) + { + _isPlayEvoVoice = isPlayEvoVoice; + _playIndex = 0; + _playVoiceList = (isPlayEvoVoice ? _voiceData._voiceListAfterEvo : _voiceData._voiceListBeforeEvo); + } + else + { + _playIndex = (_playIndex + 1) % _playVoiceList.Count; + } + Stop(); + Play(); + return; + } + _cardId = cardId; + _isPlayEvoVoice = isPlayEvoVoice; + CardVoiceData voiceData = _voiceData; + _voiceData = new CardVoiceData(cardParam, cardMasterId); + _playIndex = 0; + _playVoiceList = (isPlayEvoVoice ? _voiceData._voiceListAfterEvo : _voiceData._voiceListBeforeEvo); + float unloadWaitTime = Stop(); + LoadAndUnload(_voiceData, voiceData, unloadWaitTime, delegate + { + Play(); + }); + } + + private void Play() + { + + } + + public float Stop() + { + return 0f; + } + + private void LoadAndUnload(CardVoiceData loadData, CardVoiceData unloadData, float unloadWaitTime = 0f, Action onFinishLoad = null) + { + _loadVoiceIdList.Clear(); + if (loadData != null) + { + _loadVoiceIdList.Add(loadData.MainVoiceId); + _loadVoiceIdList.AddRange(loadData._acceleratedVoiceIdList); + _loadVoiceIdList = _loadVoiceIdList.Distinct().ToList(); + } + _unloadVoiceIdList.Clear(); + if (unloadData != null) + { + _unloadVoiceIdList.Add(unloadData.MainVoiceId); + _unloadVoiceIdList.AddRange(unloadData._acceleratedVoiceIdList); + _unloadVoiceIdList = _unloadVoiceIdList.Distinct().ToList(); + } + List list = _loadVoiceIdList.Intersect(_unloadVoiceIdList).ToList(); + if (list.Count > 0) + { + _loadVoiceIdList = _loadVoiceIdList.Except(list).ToList(); + _unloadVoiceIdList = _unloadVoiceIdList.Except(list).ToList(); + } + onFinishLoad.Call(); + if (_loadVoiceIdList.Count > 0) + { + _loadedVoiceIdList.AddRange(_loadVoiceIdList); + } + for (int num = 0; num < _unloadVoiceIdList.Count; num++) + { + string unloadId = _unloadVoiceIdList[num]; + UIManager.GetInstance().StartCoroutine(Timer.DelayMethod(unloadWaitTime, delegate + { + + })); + _loadedVoiceIdList.Remove(unloadId); + } + } + + public void UnloadAll(float unloadWaitTime = 0f) + { + for (int i = 0; i < _loadedVoiceIdList.Count; i++) + { + string unloadId = _loadedVoiceIdList[i]; + UIManager.GetInstance().StartCoroutine(Timer.DelayMethod(unloadWaitTime, delegate + { + + })); + } + _loadedVoiceIdList.Clear(); + } + } + + private static readonly string RELATION_CARD_DISABLE_CARD_ID_HEADER = "80"; + + private static readonly int[] RELATION_CARD_BUTTON_DISABLE_CARD_IDS = new int[2] { 810014010, 810034010 }; + + private readonly List RELATION_CARD_SKILLOPTION_EXCLUDED_OPTIONS = new List { "effect_path", "se_path", "skill_voice" }; + + private readonly char[] RELATION_CARD_SKILLOPTION_SEPARATORS = new char[2] { '(', ')' }; + + [SerializeField] + private GameObject DarkPanel; + + [SerializeField] + private GameObject Frame; + + [SerializeField] + private GameObject CardTexture; + + [SerializeField] + private GameObject CardNum; + + [SerializeField] + private GameObject CardText; + + [SerializeField] + private GameObject CardViewBG; + + [SerializeField] + private GameObject CardShadow; + + [SerializeField] + private GameObject UnitCardStatusObj; + + [SerializeField] + private GameObject UnitCardIntroductionObj; + + [SerializeField] + private GameObject SettingCardStatusObj; + + [SerializeField] + private GameObject SettingCardIntroductionObj; + + [SerializeField] + private GameObject SpellCardStatusObj; + + [SerializeField] + private GameObject SpellCardIntroductionObj; + + [SerializeField] + private UIScrollView UnitCardTextScrollView; + + [SerializeField] + private UIScrollView SpellCardTextScrollView; + + [SerializeField] + private UIScrollView SettingCardTextScrollView; + + [SerializeField] + private UILabel UnitCardSkill; + + [SerializeField] + private UILabel UnitCardEvoSkill; + + [SerializeField] + private UILabel UnitCardAtkRight; + + [SerializeField] + private UILabel UnitCardLifeRight; + + [SerializeField] + private UILabel UnitCardEvoAtkRight; + + [SerializeField] + private UILabel UnitCardEvoLifeRight; + + [SerializeField] + private UILabel UnitCardIntroduction; + + [SerializeField] + private UILabel SpellCardSkill; + + [SerializeField] + private UILabel SpellCardIntroduction; + + [SerializeField] + private UILabel SettingCardSkill; + + [SerializeField] + private UILabel SettingCardIntroduction; + + [SerializeField] + private GameObject ReturnButton; + + [SerializeField] + private GameObject CardIntroductionButton; + + [SerializeField] + private UIButton _favoriteButton; + + [SerializeField] + private UIButton _voiceButton; + + [SerializeField] + private GameObject CardEvolButton; + + [SerializeField] + private UIButton _premiumCardConversionButton; + + [SerializeField] + private GameObject RelationWrapperObj; + + [SerializeField] + private GameObject RelationCardButton; + + [SerializeField] + private GameObject RightButton; + + [SerializeField] + private GameObject LeftButton; + + [SerializeField] + private GameObject RelationBackButton; + + [SerializeField] + private UILabel DialogTitleLabel; + + [SerializeField] + private UILabel _cardNumLabel; + + [SerializeField] + private UILabel _nameValueLabel; + + [SerializeField] + private UILabel _classValueLabel; + + [SerializeField] + private UILabel _typeValueLabel; + + [SerializeField] + private UILabel _redEtherHaveValueLabel; + + [SerializeField] + private UILabel _evolutionButtonLabel; + + [SerializeField] + private GameObject _cardVoiceLabelRoot; + + [SerializeField] + private UILabel _cardVoiceValueLabel; + + [SerializeField] + private GameObject _cardSetLabelRoot; + + [SerializeField] + private UILabel _cardSetValueLabel; + + [SerializeField] + private GameObject RedEtherIcon; + + [SerializeField] + private GameObject QuestionMark; + + [SerializeField] + private PurchaseConfirm PurchaseConfirmPrefab; + + [SerializeField] + private PremiumCardConversionDialogParts _premiumCardConversionDialogPrefab; + + [SerializeField] + private CardCraftPanel _craftPanel; + + [SerializeField] + private UIButton _blankColliderButton; + + private GameObject _rotationOnlyIconSpell; + + private GameObject _rotationOnlyIconFollower; + + private GameObject _rotationOnlyIconAmulet; + + private static readonly float kCARD_SCALE = 90f; + + private static readonly float kCARD_POS_Z = -4f; + + private readonly Vector3 CardViewScale = new Vector3(110f, 110f, 1f); + + private static readonly Color CARD_LIQUEFY_PARTICLE_COLOR = new Color(1f, 0.2509804f, 0.2509804f); + + private static readonly Color CARD_CREATE_PARTICLE_COLOR = new Color(1f, 0.2509804f, 0.2509804f); + + private static readonly Color PREMIUM_CARD_CONVERSION_PARTICLE_COLOR = new Color(14f / 85f, 32f / 85f, 0.5568628f); + + private static readonly Vector3 CARD_DESTROY_PARTICLE_OFFSET = new Vector3(0f, 0f, -1f); + + private static readonly Vector3 KEYWORD_DIALOG_BACK_VIEW_POSITION = new Vector3(0f, 0f, -5f); + + private GameObject UnitCardObject; + + private GameObject SpellCardObject; + + private GameObject FieldCardObject; + + private GameObject ViewCardObject; + + private UILabel UnitCost; + + private UILabel UnitAtk; + + private UILabel UnitLife; + + private UILabel UnitName; + + private UILabel SpellCost; + + private UILabel SpellName; + + private UILabel FieldCost; + + private UILabel FieldName; + + private BoxCollider UnitCardCollider; + + private BoxCollider SpellCardCollider; + + private BoxCollider FieldCardCollider; + + private bool _isFavorite; + + private bool _isFavoriteButtonEnabled; + + private bool _isEvolCard; + + private bool _isShowCardAblityText = true; + + private bool _shouldResetTextScrollView; + + private bool isCardViewMode; + + private bool isAnimation; + + [SerializeField] + private TextLineCreater _cardSkillTextLineCreater; + + [SerializeField] + private TextLineCreater _cardEvoSkillTextLineCreater; + + [SerializeField] + private TextLineCreater _cardSpellTextLineCreater; + + [SerializeField] + private TextLineCreater _cardAmuletTextLineCreater; + + [SerializeField] + private GameObject _evolveInfoObjectRoot; + + [SerializeField] + private UILabel _normalTitleLavel; + + private int _relationIndex; + + private List _relationCardIds = new List(); + + private Dictionary> _relationCardParentDict = new Dictionary>(); + + private GameObject _relationCardBaseGameObject; + + private int LayerDetail = 14; + + private bool isDetailOn; + + private ParticleSystem _evolEffect; + + private bool IsAnimationPlaying; + + private DialogBase _craftDialog; + + private DialogBase _keyWordDialog; + + private List _assetPathList = new List(); + + private List _assetTokenPathList = new List(); + + private CardVoiceManager _cardVoiceManager = new CardVoiceManager(); + + private bool _isAbleTapDialogObject = true; + + private static Shader _normalShader = null; + + private static Shader _premiumShader = null; + + private DialogBase _dialogForClose; + + private Material _cardMaterial; + + private int _originalCardId; + + private CardMaster.CardMasterId _cardMasterId; + + private UIButton[] _enableButtonList; + + private IFormatBehavior _formatBehaviorForCardPoolChange; + + public Action OnCardSellId; + + public Action OnCardBuy; + + public Action OnClose; + + public Action OnDragCard; + + public Action OnLiquefyAllCard; + + public Action OnChangeCardFavoriteState; + + public Action OnConvertedPremiumCard; + + public Action OnCreateFirstCard; + + private bool _isCardTextDialogLayerSet = true; + + private bool _isOwnCardNum; + + public CardParameter CardData { get; private set; } + + public Action OnDetailCardUpdate { get; set; } + + public Action OnCardNumChange { get; set; } + + private bool IsAbleToCraft + { + get + { + if (PlayerStaticData.UserRedEtherCount >= CardData.UseRedEther && !CardData.IsFoil) + { + if (GetPossessionCardNum(isIncludingSpotCard: true) >= 3) + { + return GetPossessionCardNum() == 0; + } + return true; + } + return false; + } + } + + private bool IsAbleToDestruct => GetPossessionCardNum() > 0; + + public bool IsShowFlavorTextButton { get; set; } + + public bool IsShowFavoriteButton { get; set; } + + public bool IsShowVoiceButton { get; set; } + + public bool IsShowEvolutionButton { get; set; } + + public bool IsShowCraftButtons { get; set; } + + public bool IsShowPremiumCardConversionButton { get; set; } + + public bool IsPopularityVote { get; set; } + + public bool IsCardTextDialogLayerSet + { + get + { + return _isCardTextDialogLayerSet; + } + set + { + _isCardTextDialogLayerSet = value; + } + } + + public bool IsOwnCardNum + { + get + { + return _isOwnCardNum; + } + set + { + _isOwnCardNum = value; + } + } + + public bool IsShortageUI { get; set; } + + public bool IsRelationCardViewing => RelationWrapperObj.activeSelf; + + public bool LeftButtonVisible + { + set + { + LeftButton.SetActive(value); + } + } + + public bool RightButtonVisible + { + set + { + RightButton.SetActive(value); + } + } + + public bool IsEnableShowDetail + { + get + { + if (IsAnimationPlaying) + { + return false; + } + return true; + } + } + + protected override void OnDestroy() + { + Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList); + _assetPathList.Clear(); + Toolbox.ResourcesManager.RemoveAssetGroup(_assetTokenPathList); + _assetTokenPathList.Clear(); + float unloadWaitTime = _cardVoiceManager.Stop(); + _cardVoiceManager.UnloadAll(unloadWaitTime); + if (_keyWordDialog != null) + { + _keyWordDialog.Close(); + } + if (_cardMaterial != null) + { + UnityEngine.Object.Destroy(_cardMaterial); + } + DestroyDialogObject(); + base.OnDestroy(); + } + + private void DestroyDialogObject() + { + if (_dialogForClose != null) + { + UnityEngine.Object.Destroy(_dialogForClose.gameObject); + _dialogForClose = null; + } + } + + public void Initialize(int DetailLayer, CardMaster.CardMasterId cardMasterId, IFormatBehavior formatBehaviorForCardPoolChange = null) + { + _formatBehaviorForCardPoolChange = formatBehaviorForCardPoolChange; + ChangeCardMaster(cardMasterId); + LayerDetail = DetailLayer; + base.gameObject.layer = LayerDetail; + InitializeCard(); + SetButtonEvent(); + SetDisableArrowButton(); + _enableButtonList = GetComponentsInChildren(includeInactive: true); + } + + public void ChangeCardMaster(CardMaster.CardMasterId cardMasterId) + { + _cardMasterId = cardMasterId; + } + + private void InitializeCard() + { + InitializeCardObject(); + InitializeCardMesh(); + InitializeCardDecoration(); + } + + private void InitializeCardObject() + { + UnitCardObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Unit", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)) as GameObject; + SpellCardObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Spell", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)) as GameObject; + FieldCardObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Field", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)) as GameObject; + UnitCardObject = NGUITools.AddChild(CardTexture, UnitCardObject); + UnitCardObject.SetActive(value: false); + SpellCardObject = NGUITools.AddChild(CardTexture, SpellCardObject); + SpellCardObject.SetActive(value: false); + FieldCardObject = NGUITools.AddChild(CardTexture, FieldCardObject); + FieldCardObject.SetActive(value: false); + Transform obj = SpellCardObject.transform; + Vector3 localPosition = (FieldCardObject.transform.localPosition = new Vector3(0f, 0f, -500f)); + obj.localPosition = localPosition; + UIManager.GetInstance().SetLayerRecursive(UnitCardObject.transform, LayerDetail); + UIManager.GetInstance().SetLayerRecursive(SpellCardObject.transform, LayerDetail); + UIManager.GetInstance().SetLayerRecursive(FieldCardObject.transform, LayerDetail); + UnitCardCollider = UnitCardObject.AddComponent(); + SpellCardCollider = SpellCardObject.AddComponent(); + FieldCardCollider = FieldCardObject.AddComponent(); + BoxCollider unitCardCollider = UnitCardCollider; + BoxCollider spellCardCollider = SpellCardCollider; + Vector3 vector2 = (FieldCardCollider.size = new Vector3(3.6f, 5.5f, 1f)); + localPosition = (spellCardCollider.size = vector2); + unitCardCollider.size = localPosition; + UIWidget uIWidget = UnitCardObject.AddComponent(); + UIWidget uIWidget2 = SpellCardObject.AddComponent(); + UIWidget uIWidget3 = FieldCardObject.AddComponent(); + int num = (uIWidget3.depth = 1); + int depth = (uIWidget2.depth = num); + uIWidget.depth = depth; + GameObject prefab = Resources.Load("Prefab/CardDeco/RotationOnlyIcon") as GameObject; + _rotationOnlyIconSpell = NGUITools.AddChild(SpellCardObject, prefab); + _rotationOnlyIconFollower = NGUITools.AddChild(UnitCardObject, prefab); + _rotationOnlyIconAmulet = NGUITools.AddChild(FieldCardObject, prefab); + } + + private void InitializeCardMesh() + { + MeshFilter[] componentsInChildren = UnitCardObject.GetComponentsInChildren(); + Mesh sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); + Mesh sharedMesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); + componentsInChildren[0].sharedMesh = sharedMesh; + componentsInChildren[1].sharedMesh = sharedMesh2; + Quaternion quaternion = Quaternion.Euler(0f, componentsInChildren[0].transform.rotation.y + 180f, 0f); + Transform obj = componentsInChildren[0].transform; + Quaternion rotation = (componentsInChildren[1].transform.rotation = quaternion); + obj.rotation = rotation; + MeshFilter[] componentsInChildren2 = SpellCardObject.GetComponentsInChildren(); + Mesh sharedMesh3 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); + Mesh sharedMesh4 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); + componentsInChildren2[0].sharedMesh = sharedMesh3; + componentsInChildren2[1].sharedMesh = sharedMesh4; + Quaternion quaternion3 = Quaternion.Euler(0f, componentsInChildren2[0].transform.rotation.y + 180f, 0f); + Transform obj2 = componentsInChildren2[0].transform; + rotation = (componentsInChildren2[1].transform.rotation = quaternion3); + obj2.rotation = rotation; + MeshFilter[] componentsInChildren3 = FieldCardObject.GetComponentsInChildren(); + Mesh sharedMesh5 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); + Mesh sharedMesh6 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); + componentsInChildren3[0].sharedMesh = sharedMesh5; + componentsInChildren3[1].sharedMesh = sharedMesh6; + Quaternion quaternion5 = Quaternion.Euler(0f, componentsInChildren3[0].transform.rotation.y + 180f, 0f); + Transform obj3 = componentsInChildren3[0].transform; + rotation = (componentsInChildren3[1].transform.rotation = quaternion5); + obj3.rotation = rotation; + } + + private void InitializeCardDecoration() + { + GameObject prefab = Resources.Load("Prefab/CardDeco/Cost") as GameObject; + GameObject prefab2 = Resources.Load("Prefab/CardDeco/Atk") as GameObject; + GameObject prefab3 = Resources.Load("Prefab/CardDeco/Life") as GameObject; + GameObject prefab4 = Resources.Load("Prefab/CardDeco/Name") as GameObject; + GameObject gameObject = NGUITools.AddChild(UnitCardObject, prefab); + GameObject gameObject2 = NGUITools.AddChild(UnitCardObject, prefab2); + GameObject gameObject3 = NGUITools.AddChild(UnitCardObject, prefab3); + GameObject gameObject4 = NGUITools.AddChild(UnitCardObject, prefab4); + GameObject gameObject5 = NGUITools.AddChild(SpellCardObject, prefab); + GameObject gameObject6 = NGUITools.AddChild(SpellCardObject, prefab4); + GameObject gameObject7 = NGUITools.AddChild(FieldCardObject, prefab); + GameObject gameObject8 = NGUITools.AddChild(FieldCardObject, prefab4); + Transform obj = gameObject.transform; + Transform obj2 = gameObject5.transform; + Vector3 vector = (gameObject7.transform.localPosition = Global.POSITION_COST_ICON); + Vector3 localPosition = (obj2.localPosition = vector); + obj.localPosition = localPosition; + Transform obj3 = gameObject.transform; + Transform obj4 = gameObject5.transform; + vector = (gameObject7.transform.localScale = Global.SCALE_CARD_ICON); + localPosition = (obj4.localScale = vector); + obj3.localScale = localPosition; + Transform obj5 = gameObject4.transform; + Transform obj6 = gameObject6.transform; + vector = (gameObject8.transform.localPosition = Global.POSITION_NAME_TEXT); + localPosition = (obj6.localPosition = vector); + obj5.localPosition = localPosition; + Transform obj7 = gameObject4.transform; + Transform obj8 = gameObject6.transform; + vector = (gameObject8.transform.localScale = Global.SCALE_NAME_TEXT); + localPosition = (obj8.localScale = vector); + obj7.localScale = localPosition; + gameObject2.transform.localPosition = Global.POSITION_ATK_ICON; + gameObject3.transform.localPosition = Global.POSITION_LIFE_ICON; + Transform obj9 = gameObject2.transform; + localPosition = (gameObject3.transform.localScale = Global.SCALE_CARD_ICON); + obj9.localScale = localPosition; + UnitCost = gameObject.transform.Find("CostLabel").GetComponent(); + UnitAtk = gameObject2.transform.Find("AtkLabel").GetComponent(); + UnitLife = gameObject3.transform.Find("LifeLabel").GetComponent(); + UnitName = gameObject4.transform.Find("NameLabel").GetComponent(); + SpellCost = gameObject5.transform.Find("CostLabel").GetComponent(); + SpellName = gameObject6.transform.Find("NameLabel").GetComponent(); + FieldCost = gameObject7.transform.Find("CostLabel").GetComponent(); + FieldName = gameObject8.transform.Find("NameLabel").GetComponent(); + } + + private void SetButtonEvent() + { + UIEventListener uIEventListener = UIEventListener.Get(ReturnButton); + uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); + UIEventListener uIEventListener2 = UIEventListener.Get(_blankColliderButton.gameObject); + uIEventListener2.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); + UIEventListener uIEventListener3 = UIEventListener.Get(DarkPanel.gameObject); + uIEventListener3.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener3.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); + UIEventListener uIEventListener4 = UIEventListener.Get(Frame.gameObject); + uIEventListener4.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onClick, new UIEventListener.VoidDelegate(OnPushCardDetailOn)); + UIEventListener uIEventListener5 = UIEventListener.Get(CardIntroductionButton); + uIEventListener5.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener5.onClick, new UIEventListener.VoidDelegate(OnClickChangeCardTextTypeButton)); + UIEventListener uIEventListener6 = UIEventListener.Get(CardViewBG); + uIEventListener6.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener6.onClick, new UIEventListener.VoidDelegate(OnCloseCardViewMode)); + UIEventListener uIEventListener7 = UIEventListener.Get(UnitCardObject); + uIEventListener7.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener7.onClick, new UIEventListener.VoidDelegate(OnOpenCardViewMode)); + UIEventListener uIEventListener8 = UIEventListener.Get(SpellCardObject); + uIEventListener8.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener8.onClick, new UIEventListener.VoidDelegate(OnOpenCardViewMode)); + UIEventListener uIEventListener9 = UIEventListener.Get(FieldCardObject); + uIEventListener9.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener9.onClick, new UIEventListener.VoidDelegate(OnOpenCardViewMode)); + UIEventListener uIEventListener10 = UIEventListener.Get(_favoriteButton.gameObject); + uIEventListener10.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener10.onClick, new UIEventListener.VoidDelegate(OnClickFavoriteButton)); + UIEventListener uIEventListener11 = UIEventListener.Get(_voiceButton.gameObject); + uIEventListener11.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener11.onClick, new UIEventListener.VoidDelegate(OnClickVoiceButton)); + UIEventListener uIEventListener12 = UIEventListener.Get(_premiumCardConversionButton.gameObject); + uIEventListener12.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener12.onClick, new UIEventListener.VoidDelegate(OnClickPremiumCardConversionButton)); + UIEventListener uIEventListener13 = UIEventListener.Get(CardEvolButton); + uIEventListener13.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener13.onClick, new UIEventListener.VoidDelegate(OnClickEvolutionButton)); + UIEventListener uIEventListener14 = UIEventListener.Get(UnitCardObject); + uIEventListener14.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener14.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); + UIEventListener uIEventListener15 = UIEventListener.Get(SpellCardObject); + uIEventListener15.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener15.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); + UIEventListener uIEventListener16 = UIEventListener.Get(FieldCardObject); + uIEventListener16.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener16.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); + UIEventListener uIEventListener17 = UIEventListener.Get(Frame); + uIEventListener17.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener17.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); + UIEventListener uIEventListener18 = UIEventListener.Get(CardText); + uIEventListener18.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener18.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); + UIEventListener uIEventListener19 = UIEventListener.Get(QuestionMark); + uIEventListener19.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener19.onDrag, new UIEventListener.VectorDelegate(OnSwipeCard)); + UIEventListener uIEventListener20 = UIEventListener.Get(RelationCardButton); + uIEventListener20.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener20.onClick, new UIEventListener.VoidDelegate(OnPushRelationCardButton)); + UIEventListener uIEventListener21 = UIEventListener.Get(RelationBackButton); + uIEventListener21.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener21.onClick, new UIEventListener.VoidDelegate(OnPushRelationBackButton)); + UIEventListener uIEventListener22 = UIEventListener.Get(RightButton); + uIEventListener22.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener22.onClick, new UIEventListener.VoidDelegate(OnPushRightButton)); + UIEventListener uIEventListener23 = UIEventListener.Get(LeftButton); + uIEventListener23.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener23.onClick, new UIEventListener.VoidDelegate(OnPushLeftButton)); + Action onClickDestructBtn = delegate + { + + CreateDialog(StartCardDestruct, buy: false); + }; + Action onClickCreateBtn = delegate + { + + CreateDialog(StartCardCraft, buy: true); + }; + _craftPanel.Init(onClickCreateBtn, onClickDestructBtn); + UIEventListener.Get(QuestionMark).onClick = delegate + { + if (_isAbleTapDialogObject) + { + + UILabel keyWordLabel = GetKeyWordLabel(); + string empty = string.Empty; + empty = ((!CardData.IsEvolveChoiceCard) ? (CardData.ConvertedSkillDescription + CardData.ConvertedEvoSkillDescription) : CardData.ConvertedEvoSkillDescription); + _keyWordDialog = BattlePlayerView.CreateKeyPanel(empty, keyWordLabel, _cardMasterId); + UIManager.ViewScene currentScene = UIManager.GetInstance().GetCurrentScene(); + if ((currentScene == UIManager.ViewScene.Battle || currentScene == UIManager.ViewScene.LoginBonus || currentScene == UIManager.ViewScene.Colosseum || currentScene == UIManager.ViewScene.LotteryPage || currentScene == UIManager.ViewScene.QuestSelectionPage) && IsCardTextDialogLayerSet) + { + _keyWordDialog.SetPanelDepth(120); + Vector3 localPosition = _keyWordDialog.gameObject.transform.localPosition; + localPosition.z = -5f; + localPosition.y = 0f; + _keyWordDialog.gameObject.transform.localPosition = localPosition; + ChangeLayer(_keyWordDialog.gameObject, LayerDetail); + _keyWordDialog.SetBackViewLayer(LayerDetail); + _keyWordDialog.SetBackViewPosition(KEYWORD_DIALOG_BACK_VIEW_POSITION); + UIPanel[] componentsInChildren = _keyWordDialog.InsideObject.GetComponentsInChildren(); + for (int i = 0; i < componentsInChildren.Length; i++) + { + componentsInChildren[i].depth += 120; + } + } + } + }; + UIEventListener uIEventListener24 = UIEventListener.Get(QuestionMark); + uIEventListener24.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(uIEventListener24.onPress, (UIEventListener.BoolDelegate)delegate(GameObject g, bool b) + { + UILabel keyWordLabel = GetKeyWordLabel(); + if (keyWordLabel != null) + { + BattlePlayerView.PressKeyWordColorChange(keyWordLabel, b); + } + }); + UIEventListener uIEventListener25 = UIEventListener.Get(QuestionMark); + uIEventListener25.onDragStart = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener25.onDragStart, (UIEventListener.VoidDelegate)delegate + { + if (UnitCardTextScrollView.gameObject.activeInHierarchy) + { + BattlePlayerView.SetKeyWordLabelColor(UnitCardSkill); + BattlePlayerView.SetKeyWordLabelColor(UnitCardEvoSkill); + } + else + { + UILabel keyWordLabel = GetKeyWordLabel(); + if (keyWordLabel != null) + { + BattlePlayerView.SetKeyWordLabelColor(keyWordLabel); + } + } + }); + } + + private UILabel GetKeyWordLabel() + { + if (UnitCardTextScrollView.gameObject.activeInHierarchy) + { + Transform parent = UnitCardSkill.transform.parent; + UnitCardSkill.transform.SetParent(base.transform); + Vector3 vector = UnitCardSkill.transform.localPosition - new Vector3(0f, UnitCardSkill.printedSize.y, 0f); + UnitCardSkill.transform.SetParent(parent); + Vector3 vector2 = base.transform.InverseTransformPoint(UICamera.lastHit.point); + if (vector.y < vector2.y) + { + if (!string.IsNullOrEmpty(UnitCardSkill.text) && UnitCardSkill.text != " ") + { + return UnitCardSkill; + } + if (!string.IsNullOrEmpty(UnitCardEvoSkill.text) && UnitCardEvoSkill.text != " ") + { + return UnitCardEvoSkill; + } + } + else + { + if (!string.IsNullOrEmpty(UnitCardEvoSkill.text) && UnitCardEvoSkill.text != " ") + { + return UnitCardEvoSkill; + } + if (!string.IsNullOrEmpty(UnitCardSkill.text) && UnitCardSkill.text != " ") + { + return UnitCardSkill; + } + } + } + else + { + if (SpellCardTextScrollView.gameObject.activeInHierarchy) + { + return SpellCardSkill; + } + if (SettingCardTextScrollView.gameObject.activeInHierarchy) + { + return SettingCardSkill; + } + } + return null; + } + + public void OnPushCardDetailOn(GameObject g) + { + if (_isAbleTapDialogObject && ShowCardDetail(g)) + { + + } + } + + public bool ShowCardDetail(GameObject g) + { + if (isDetailOn) + { + CloseDefault(playSe: true); + return false; + } + if (!IsEnableShowDetail) + { + return false; + } + CharIdx component = g.GetComponent(); + if (!component) + { + return false; + } + isDetailOn = true; + IsAnimationPlaying = true; + base.gameObject.SetActive(value: true); + DarkPanel.SetActive(value: true); + DestroyDialogObject(); + _dialogForClose = UIManager.GetInstance().DialogManager.CreateDialogBaseOpenCardDetail(this); + SetCardDetail(component.GetCardId(), g); + OpenCardAnimation(); + return true; + } + + private void OpenCardAnimation() + { + iTween.Stop(CardNum.gameObject); + if (GetPossessionCardNum(isIncludingSpotCard: true) > 0) + { + CardNum.transform.localScale = new Vector3(0.01f, 0.01f, 1f); + iTween.ScaleTo(CardNum.gameObject, iTween.Hash("scale", new Vector3(1f, 1f, 1f), "time", 0.3f)); + } + else + { + CardNum.transform.localScale = new Vector3(1f, 1f, 1f); + } + GameObject gameObject = null; + CardBasePrm.CharaType charType = CardData.CharType; + gameObject = (CardBasePrm.IsFollowerCard(charType) ? UnitCardObject : ((!CardBasePrm.IsSpellCard(charType)) ? FieldCardObject : SpellCardObject)); + gameObject.transform.localScale = new Vector3(1f, 1f, 1f); + iTween.Stop(gameObject); + iTween.ScaleTo(gameObject, iTween.Hash("islocal", true, "scale", new Vector3(kCARD_SCALE, kCARD_SCALE, 1f), "time", 0.3f, "easetype", iTween.EaseType.easeOutExpo)); + iTween.MoveTo(gameObject, iTween.Hash("islocal", true, "x", 0f, "y", 0f, "z", kCARD_POS_Z, "time", 0.3f, "oncompletetarget", base.gameObject, "oncomplete", "OnAnimationOver", "easetype", iTween.EaseType.easeOutExpo)); + } + + private void OnAnimationOver() + { + IsAnimationPlaying = false; + BoxCollider unitCardCollider = UnitCardCollider; + BoxCollider spellCardCollider = SpellCardCollider; + Vector3 vector = (FieldCardCollider.size = new Vector3(3.6f, 5.5f, 1f)); + Vector3 size = (spellCardCollider.size = vector); + unitCardCollider.size = size; + } + + public void CloseDefault(bool playSe) + { + if (!isDetailOn || isAnimation || IsAnimationPlaying) + { + return; + } + if (isCardViewMode) + { + OnCloseCardViewMode(); + return; + } + isDetailOn = false; + DarkPanel.SetActive(value: false); + if (base.gameObject.activeSelf && playSe) + { + + } + base.gameObject.SetActive(value: false); + if (_evolEffect != null) + { + UnityEngine.Object.Destroy(_evolEffect.gameObject); + } + Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList); + Toolbox.ResourcesManager.RemoveAssetGroup(_assetTokenPathList); + _assetTokenPathList.Clear(); + DestroyDialogObject(); + OnClose.Call(); + } + + private void SetCardDetail(int cardId, GameObject card2dObj = null, bool isUpdateRelation = true) + { + CardData = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId); + if (isUpdateRelation) + { + RelationWrapperObj.SetActive(value: false); + } + iTween.Stop(base.gameObject); + _isEvolCard = CardData.IsEvolveChoiceCard; + _isShowCardAblityText = true; + UpdateCardImage(); + SystemText systemText = Data.SystemText; + _nameValueLabel.text = CardData.CardName; + string key = "Common_01" + ((int)(4 + CardData.Clan)).ToString("00"); + _classValueLabel.text = systemText.Get(key); + _typeValueLabel.text = CardData.TribeName; + if (_typeValueLabel.text == "ALL") + { + _typeValueLabel.text = "-"; + } + UpdateCardText(); + _isFavoriteButtonEnabled = true; + UpdateButtonState(); + UpdateCreateLiquefyButton(); + if (isUpdateRelation) + { + UpdateRelation(cardId); + DialogTitleLabel.text = Data.SystemText.Get("Card_0135"); + } + UpdateCardNum(card2dObj); + if (!IsRelationCardViewing) + { + _relationCardBaseGameObject = card2dObj; + OnDetailCardUpdate.Call(); + } + } + + private void UpdateRelation(int cardId) + { + _relationCardIds.Clear(); + _relationCardParentDict.Clear(); + _relationIndex = 0; + _originalCardId = cardId; + if (RELATION_CARD_BUTTON_DISABLE_CARD_IDS.Contains(cardId)) + { + RelationCardButton.SetActive(value: false); + return; + } + CardMaster instance = CardMaster.GetInstance(_cardMasterId); + if (instance != null) + { + List allParams = new List(instance.GetAllParameters()); + ParseIdsFunc(allParams, cardId); + } + IDictionary> relationCardSortDic = Data.Master.RelationCardSortDic; + CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId); + if (relationCardSortDic.ContainsKey(cardParameterFromId.NormalCardId)) + { + _relationCardIds = new List(relationCardSortDic[cardParameterFromId.NormalCardId]); + } + else + { + _relationCardIds = SortRelationCardByKeyWordTextOrder(_relationCardIds); + } + bool flag = false; + foreach (int relationCardId in _relationCardIds) + { + if (relationCardSortDic.ContainsKey(relationCardId)) + { + flag = true; + break; + } + } + if (!relationCardSortDic.ContainsKey(cardParameterFromId.NormalCardId) && flag) + { + _relationCardIds = SortPartOfRelationCard(_relationCardIds, cardParameterFromId.NormalCardId); + } + } + + private static List SortPartOfRelationCard(List originalList, int cardId) + { + List list = new List(); + list.AddRange(originalList); + IDictionary> relationCardSortDic = Data.Master.RelationCardSortDic; + foreach (int original in originalList) + { + if (!relationCardSortDic.TryGetValue(original, out var value)) + { + continue; + } + List list2 = new List(); + for (int i = 0; i < value.Count; i++) + { + int num = value[i]; + for (int j = 0; j < originalList.Count; j++) + { + if (originalList[j] == num) + { + list2.Add(j); + break; + } + } + } + list2.Sort(); + for (int k = 0; k < list2.Count; k++) + { + int index = list2[k]; + list[index] = value[k]; + } + } + return list; + } + + private List SortRelationCardByKeyWordTextOrder(List originalList) + { + if (originalList.Count < 2) + { + return originalList; + } + List sortedCardIdList = new List(); + List keywordListInCard = GetKeywordListInCard(CardData.CardId); + for (int i = 0; i < keywordListInCard.Count; i++) + { + List cardIdsInKeyword = GetCardIdsInKeyword(keywordListInCard[i]); + if (cardIdsInKeyword.Count == 0) + { + continue; + } + int num = cardIdsInKeyword[0]; + if (!originalList.Contains(num)) + { + continue; + } + if (!sortedCardIdList.Contains(num)) + { + sortedCardIdList.Add(num); + } + List keywordListInCard2 = GetKeywordListInCard(num); + for (int j = 0; j < keywordListInCard2.Count; j++) + { + List cardIdsInKeyword2 = GetCardIdsInKeyword(keywordListInCard2[j]); + if (cardIdsInKeyword2.Count == 0) + { + continue; + } + for (int k = 0; k < cardIdsInKeyword2.Count; k++) + { + int num2 = cardIdsInKeyword2[k]; + if (originalList.Contains(num2) && !sortedCardIdList.Contains(num2)) + { + sortedCardIdList.Add(num2); + } + if (k > 0) + { + AddNonAppearedRelationCardId(num2, ref sortedCardIdList); + } + } + AddNonAppearedRelationCardId(cardIdsInKeyword2[0], ref sortedCardIdList); + } + AddNonAppearedRelationCardId(num, ref sortedCardIdList); + } + foreach (int original in originalList) + { + if (!sortedCardIdList.Contains(original)) + { + sortedCardIdList.Add(original); + } + } + return sortedCardIdList; + } + + private void AddNonAppearedRelationCardId(int parentCardId, ref List sortedCardIdList) + { + if (!_relationCardParentDict.TryGetValue(parentCardId, out var value)) + { + return; + } + foreach (int item in value) + { + if (!sortedCardIdList.Contains(item)) + { + sortedCardIdList.Add(item); + } + } + } + + private List GetKeywordListInCard(int cardId) + { + CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId); + List list = BattleKeywordInfoListMgr.GetKeywords(cardParameterFromId.ConvertedSkillDescription).ToList(); + if (CardBasePrm.IsFollowerCard(CardData.CharType)) + { + list.AddRange(BattleKeywordInfoListMgr.GetKeywords(cardParameterFromId.ConvertedEvoSkillDescription).ToList()); + } + return list; + } + + private List GetCardIdsInKeyword(string keyword) + { + List list = new List(); + if (Data.Master.BattleKeyWordDic.ContainsKey(keyword)) + { + list.AddRange(BattleKeywordInfoListMgr.GetCardIdsInDesc(Data.Master.BattleKeyWordDic[keyword])); + } + return list; + } + + private void UpdateCardImage() + { + CardMaster instance = CardMaster.GetInstance(_cardMasterId); + int cardId = CardData.CardId; + CardParameter cardParameterFromId = instance.GetCardParameterFromId(cardId); + int resourceCardId = cardParameterFromId.ResourceCardId; + int rarity = CardData.Rarity; + CardBasePrm.CharaType charType = CardData.CharType; + GameObject gameObject = null; + Material material = null; + bool flag = CardBasePrm.IsFollowerCard(charType); + bool flag2 = CardBasePrm.IsSpellCard(charType); + bool flag3 = CardBasePrm.IsAmuletCard(charType); + UnitCardObject.SetActive(flag && !flag2 && !flag3); + SpellCardObject.SetActive(!flag && flag2 && !flag3); + FieldCardObject.SetActive(!flag && !flag2 && flag3); + if (flag2) + { + gameObject = SpellCardObject; + try + { + material = Toolbox.ResourcesManager.FindCardMaterial(resourceCardId, ResourcesManager.AssetLoadPathType.SpellCardMaterial, isEvol: false, CardMaster.IsMutationCardCheck(instance.GetCardParameterFromId(cardId).BaseCardId), instance.GetCardParameterFromId(resourceCardId).CharType); + CardShaderDefine.ReplaceShader(material); + } + catch (Exception ex) + { + Debug.LogError(ex.ToString()); + LocalLog.AccumulateTraceLog(ex.ToString()); + } + _rotationOnlyIconSpell.SetActive(cardParameterFromId.IsResurgentCard); + SpellCost.text = CardData.Cost.ToString(); + SpellName.text = CardData.CardName; + Global.SetRepositionNameLabel(SpellName, CardData.CardName, is2D: false); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(SpellCost, CardData.IsFoil); + UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(SpellName, CardData.IsFoil); + } + else if (flag3) + { + gameObject = FieldCardObject; + try + { + material = Toolbox.ResourcesManager.FindCardMaterial(resourceCardId, ResourcesManager.AssetLoadPathType.SpellCardMaterial, isEvol: false, CardMaster.IsMutationCardCheck(instance.GetCardParameterFromId(cardId).BaseCardId), instance.GetCardParameterFromId(resourceCardId).CharType); + CardShaderDefine.ReplaceShader(material); + } + catch (Exception ex2) + { + Debug.LogError(ex2.ToString()); + LocalLog.AccumulateTraceLog(ex2.ToString()); + } + _rotationOnlyIconAmulet.SetActive(cardParameterFromId.IsResurgentCard); + FieldCost.text = CardData.Cost.ToString(); + FieldName.text = CardData.CardName; + Global.SetRepositionNameLabel(FieldName, CardData.CardName, is2D: false); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(FieldCost, CardData.IsFoil); + UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(FieldName, CardData.IsFoil); + } + else if (flag) + { + gameObject = UnitCardObject; + try + { + material = Toolbox.ResourcesManager.FindCardMaterial(resourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial, _isEvolCard); + CardShaderDefine.ReplaceShader(material); + } + catch (Exception ex3) + { + Debug.LogError(ex3.ToString()); + LocalLog.AccumulateTraceLog(ex3.ToString()); + } + _rotationOnlyIconFollower.SetActive(cardParameterFromId.IsResurgentCard); + UnitCost.text = CardData.Cost.ToString(); + UnitAtk.text = (_isEvolCard ? CardData.EvoAtk.ToString() : CardData.Atk.ToString()); + UnitLife.text = (_isEvolCard ? CardData.EvoLife.ToString() : CardData.Life.ToString()); + UnitName.text = CardData.CardName; + Global.SetRepositionNameLabel(UnitName, CardData.CardName, is2D: false); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(UnitCost, CardData.IsFoil); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(UnitAtk, CardData.IsFoil); + UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(UnitLife, CardData.IsFoil); + UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(UnitName, CardData.IsFoil); + } + if (material != null) + { + if (cardParameterFromId.IsFoil) + { + if (_premiumShader == null) + { + _premiumShader = Shader.Find("Wizard/VariantCardShader"); + } + if (material.shader != _premiumShader) + { + material.shader = _premiumShader; + material.color = Color.white; + } + } + else + { + if (_normalShader == null) + { + _normalShader = Shader.Find("Wizard/Card/Basic_Front0_Back0_Normal"); + } + if (material.shader != _normalShader) + { + material.shader = _normalShader; + material.color = Color.white; + } + } + } + if (_cardMaterial != null) + { + UnityEngine.Object.Destroy(_cardMaterial); + } + Material cardMaterial = ((material != null) ? UnityEngine.Object.Instantiate(material) : null); + Material[] sharedMaterials = new Material[3] + { + UIManager.GetInstance().getUIBase_CardManager()._3dCardFrameManager.GetFrameMaterial(cardParameterFromId.IsPhantomCard, charType, rarity), + _cardMaterial = cardMaterial, + CardCreatorBase.GetSharedClassIconMaterial(CardData.Clan) + }; + LOD[] lODs = gameObject.GetComponent().GetLODs(); + for (int i = 0; i < lODs.Length; i++) + { + lODs[i].renderers[0].sharedMaterials = sharedMaterials; + } + AttachShadow(gameObject, CardShadow.gameObject); + bool active = UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.CardAllList && GetPossessionCardNum(isIncludingSpotCard: true) <= 0; + CardShadow.SetActive(active); + } + + private static void AttachShadow(GameObject parentObj, GameObject shadowObj) + { + Transform parent = parentObj.transform; + Transform obj = shadowObj.transform; + obj.parent = parent; + obj.localPosition = new Vector3(0f, 0f, kCARD_POS_Z - 1f); + obj.localRotation = Quaternion.identity; + obj.localScale = new Vector3(1f / kCARD_SCALE, 1f / kCARD_SCALE, 1f); + shadowObj.layer = parentObj.layer; + } + + private void UpdateCardNum(GameObject card2dObj = null) + { + if (_isOwnCardNum || card2dObj == null) + { + // Pre-Phase-5b: reached GameMgr.DataMgr.SpotCardData to determine spot-card num. + // Headless has no user inventory or spot-card seed — collapse to the else branch + // so the label reflects the (zero) owned-card count. + SetCardNumLabel(GetPossessionCardNum()); + return; + } + CardListTemplate component = card2dObj.GetComponent(); + if (component != null && component.IsShowNum()) + { + if (component.IsIncludingSpotCard) + { + SetCardNumLabel(component.GetNum(), component.GetSpotCardNum()); + } + else + { + SetCardNumLabel(component.GetNum()); + } + } + else + { + SetCardNumLabel(0); + } + } + + private static bool IsTokenId(int cardId) + { + return cardId / 100000000 == 9; + } + + private int GetPossessionCardNumOnRelationCard(bool isIncludingSpotCard) + { + if (IsTokenId(CardData.CardId)) + { + return GetPosessionCardNum(_originalCardId, isIncludingSpotCard); + } + int posessionCardNum = GetPosessionCardNum(_originalCardId, isIncludingSpotCard); + int posessionCardNum2 = GetPosessionCardNum(CardData.CardId, isIncludingSpotCard); + if (posessionCardNum > 0 || posessionCardNum2 > 0) + { + return 1; + } + return 0; + } + + private int GetPosessionCardNum(int cardId, bool isIncludingSpotCard) + { + if (_formatBehaviorForCardPoolChange != null) + { + return _formatBehaviorForCardPoolChange.GetPossessionCardNum(cardId, isIncludingSpotCard); + } + return 0; // Pre-Phase-5b: headless has no user inventory + } + + private int GetPossessionCardNum(bool isIncludingSpotCard = false) + { + if (IsRelationCardViewing) + { + return GetPossessionCardNumOnRelationCard(isIncludingSpotCard); + } + return GetPosessionCardNum(CardData.CardId, isIncludingSpotCard); + } + + private void SetCardNumLabel(int num) + { + SetCardNumActive(num > 0); + _cardNumLabel.text = num.ToString(); + } + + private void SetCardNumLabel(int cardNum, int spotCardNum) + { + SetCardNumActive(cardNum + spotCardNum > 0); + _cardNumLabel.text = $"{cardNum}[fcd24a]+{spotCardNum}"; + } + + private void SetCardNumActive(bool isEnabled) + { + if (IsRelationCardViewing) + { + CardNum.SetActive(value: false); + } + else + { + CardNum.SetActive(isEnabled); + } + } + + private void UpdateCardText() + { + if (_isShowCardAblityText) + { + UpdateCardAbilityText(); + StartCoroutine(DelayResetScrollViewPosition()); + _shouldResetTextScrollView = true; + } + else + { + UpdateCardFlavorText(); + if (_shouldResetTextScrollView) + { + ResetScrollViewPosition(); + _shouldResetTextScrollView = false; + } + } + CardBasePrm.CharaType charType = CardData.CharType; + bool flag = CardBasePrm.IsFollowerCard(charType); + bool flag2 = CardBasePrm.IsSpellCard(charType); + bool flag3 = CardBasePrm.IsAmuletCard(charType); + UnitCardTextScrollView.gameObject.SetActive(flag && !flag2 && !flag3); + if (UnitCardTextScrollView.gameObject.activeSelf) + { + UnitCardStatusObj.gameObject.SetActive(_isShowCardAblityText); + UnitCardIntroductionObj.gameObject.SetActive(!_isShowCardAblityText); + } + SpellCardTextScrollView.gameObject.SetActive(!flag && flag2 && !flag3); + if (SpellCardTextScrollView.gameObject.activeSelf) + { + SpellCardStatusObj.gameObject.SetActive(_isShowCardAblityText); + SpellCardIntroductionObj.gameObject.SetActive(!_isShowCardAblityText); + } + SettingCardTextScrollView.gameObject.SetActive(!flag && !flag2 && flag3); + if (SettingCardTextScrollView.gameObject.activeSelf) + { + SettingCardStatusObj.gameObject.SetActive(_isShowCardAblityText); + SettingCardIntroductionObj.gameObject.SetActive(!_isShowCardAblityText); + } + _cardVoiceLabelRoot.gameObject.SetActive(!_isShowCardAblityText && CardData.CardVoice != string.Empty); + _cardSetLabelRoot.gameObject.SetActive(!_isShowCardAblityText); + } + + private void UpdateCardAbilityText() + { + CardBasePrm.CharaType charType = CardData.CharType; + string convertedSkillDescription = CardData.ConvertedSkillDescription; + if (CardBasePrm.IsFollowerCard(charType)) + { + FollowerCardAbilityTexActive(); + } + else if (CardBasePrm.IsSpellCard(charType)) + { + SpellCardSkill.SetWrapText(convertedSkillDescription); + SpellCardSkill.gameObject.SetActive(value: false); + SpellCardSkill.gameObject.SetActive(value: true); + _cardSpellTextLineCreater.ShowLines(GetLineNumber(SpellCardSkill), isOriginalActive: true); + } + else if (CardBasePrm.IsAmuletCard(charType)) + { + SettingCardSkill.SetWrapText(convertedSkillDescription); + SettingCardSkill.gameObject.SetActive(value: false); + SettingCardSkill.gameObject.SetActive(value: true); + _cardAmuletTextLineCreater.ShowLines(GetLineNumber(SettingCardSkill), isOriginalActive: true); + } + } + + private void FollowerCardAbilityTexActive() + { + bool isEvolveChoiceCard = CardData.IsEvolveChoiceCard; + UILabel normalTitleLavel = _normalTitleLavel; + string text3; + if (!isEvolveChoiceCard) + { + string text = (_normalTitleLavel.text = Data.SystemText.Get("Card_0037")); + text3 = text; + } + else + { + text3 = Data.SystemText.Get("Card_0038"); + } + normalTitleLavel.text = text3; + _evolveInfoObjectRoot.gameObject.SetActive(!isEvolveChoiceCard); + UnitCardSkill.SetWrapText(isEvolveChoiceCard ? CardData.ConvertedEvoSkillDescription : CardData.ConvertedSkillDescription); + UnitCardEvoSkill.SetWrapText(isEvolveChoiceCard ? string.Empty : CardData.ConvertedEvoSkillDescription); + UnitCardAtkRight.text = (isEvolveChoiceCard ? CardData.EvoAtk.ToString() : CardData.Atk.ToString()); + UnitCardLifeRight.text = (isEvolveChoiceCard ? CardData.EvoLife.ToString() : CardData.Life.ToString()); + UnitCardEvoAtkRight.text = (isEvolveChoiceCard ? string.Empty : CardData.EvoAtk.ToString()); + UnitCardEvoLifeRight.text = (isEvolveChoiceCard ? string.Empty : CardData.EvoLife.ToString()); + UnitCardSkill.gameObject.SetActive(value: false); + UnitCardSkill.gameObject.SetActive(value: true); + UnitCardEvoSkill.gameObject.SetActive(value: false); + UnitCardEvoSkill.gameObject.SetActive(!isEvolveChoiceCard); + _cardSkillTextLineCreater.ShowLines(GetLineNumber(UnitCardSkill)); + _cardEvoSkillTextLineCreater.ShowLines(GetLineNumber(UnitCardEvoSkill)); + } + + private int GetLineNumber(UILabel uILabel) + { + return Global.GetTextLineCount(uILabel.text); + } + + private void UpdateCardFlavorText() + { + string wrapText = "???"; + NGUIText.Alignment alignment = NGUIText.Alignment.Center; + if (IsPopularityVote || GetPossessionCardNum(isIncludingSpotCard: true) > 0) + { + wrapText = (_isEvolCard ? CardData.EvoDescription : CardData.Description); + alignment = NGUIText.Alignment.Left; + } + CardBasePrm.CharaType charType = CardData.CharType; + UILabel uILabel = null; + if (CardBasePrm.IsFollowerCard(charType)) + { + uILabel = UnitCardIntroduction; + } + else if (CardBasePrm.IsSpellCard(charType)) + { + uILabel = SpellCardIntroduction; + } + else if (CardBasePrm.IsAmuletCard(charType)) + { + uILabel = SettingCardIntroduction; + } + uILabel.SetWrapText(wrapText); + uILabel.alignment = alignment; + _cardVoiceValueLabel.text = CardData.CardVoice; + _cardSetValueLabel.text = Data.Master.CardSetNameMgr.Get(CardData.CardSetId).LongName; + } + + private void UpdateButtonState() + { + UpdateFavoriteButton(); + UpdateVoiceButton(); + CardIntroductionButton.SetActive(IsShowFlavorTextButton); + UpdateEvolutionButton(); + UpdatePremiumCardConversionButton(); + QuestionMark.SetActive(_isShowCardAblityText && BattlePlayerView.HasKeyword(CardData)); + } + + private void OnSwipeCard(GameObject g, Vector2 dir) + { + if (IsRelationCardViewing) + { + if (_relationCardIds.Count > 1) + { + if (dir.x >= 70f) + { + OnPushLeftButton(LeftButton); + } + if (dir.x <= -70f) + { + OnPushRightButton(RightButton); + } + } + } + else if (!IsAnimationPlaying && (!(_craftDialog != null) || !_craftDialog.IsOpen())) + { + OnDragCard.Call(dir); + } + } + + private void ParseIdsFunc(List allParams, int cardId) + { + foreach (CardParameter allParam in allParams) + { + if (allParam.CardId == cardId) + { + ParseIds(allParams, allParam.Skill, cardId); + ParseIds(allParams, allParam.SkillCondition, cardId); + ParseIds(allParams, allParam.SkillOption, cardId, RELATION_CARD_SKILLOPTION_EXCLUDED_OPTIONS, RELATION_CARD_SKILLOPTION_SEPARATORS); + ParseIds(allParams, allParam.SkillPreprocess, cardId); + ParseIds(allParams, allParam.SkillTarget, cardId); + break; + } + } + } + + private void ParseIds(List allParams, string str, int cardId, List excludedOptions = null, char[] separators = null) + { + CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId); + string normalSkillText = Global.ConvertToWithoutBBCode(cardParameterFromId.SkillDescription); + string evolSkillText = Global.ConvertToWithoutBBCode(cardParameterFromId.EvoSkillDescription); + if (excludedOptions != null && separators != null) + { + string[] sub = str.Split(separators, StringSplitOptions.RemoveEmptyEntries); + int i; + for (i = 0; i < sub.Length; i++) + { + if (excludedOptions.Any((string x) => sub[i].Contains(x))) + { + continue; + } + foreach (Match item in Regex.Matches(sub[i], "\\d{9}")) + { + int validateCardId = int.Parse(item.Value); + ValidateAddId(validateCardId, cardParameterFromId, normalSkillText, evolSkillText, allParams); + } + } + } + else + { + foreach (Match item2 in Regex.Matches(str, "\\d{9}")) + { + int validateCardId2 = int.Parse(item2.Value); + ValidateAddId(validateCardId2, cardParameterFromId, normalSkillText, evolSkillText, allParams); + } + } + if (_relationCardIds.Count > 0) + { + RelationCardButton.SetActive(value: true); + UpdateRelationCount(); + } + else + { + RelationCardButton.SetActive(value: false); + } + } + + private void ValidateAddId(int validateCardId, CardParameter refRootCardParam, string normalSkillText, string evolSkillText, List allParams) + { + CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_originalCardId); + CardParameter cardParameterFromId2 = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(validateCardId); + int validateBaseCardId = cardParameterFromId2.BaseCardId; + if ((validateBaseCardId == cardParameterFromId.BaseCardId && !cardParameterFromId2.IsEvolveChoiceCard) || validateCardId == 0 || _relationCardIds.Contains(validateCardId) || validateCardId == refRootCardParam.CardId || validateCardId == refRootCardParam.NormalCardId) + { + return; + } + if (refRootCardParam.CardId != _originalCardId) + { + int num = _relationCardIds.FindIndex((int cardId) => CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId).BaseCardId == validateBaseCardId); + if (num >= 0) + { + CardParameter cardParameterFromId3 = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_relationCardIds[num]); + if (cardParameterFromId3.BaseCardId == cardParameterFromId3.CardId || validateBaseCardId != validateCardId) + { + return; + } + _relationCardIds.RemoveAt(num); + } + } + if (validateCardId == 100011010) + { + string value = Global.ConvertToWithoutBBCode(CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(validateCardId).CardName); + if (!normalSkillText.Contains(value) && !evolSkillText.Contains(value)) + { + return; + } + } + if (!validateCardId.ToString().StartsWith(RELATION_CARD_DISABLE_CARD_ID_HEADER, StringComparison.Ordinal)) + { + _relationCardIds.Add(validateCardId); + if (!_relationCardParentDict.TryGetValue(refRootCardParam.CardId, out var value2)) + { + value2 = new List(); + _relationCardParentDict.Add(refRootCardParam.CardId, value2); + } + value2.Add(validateCardId); + } + ParseIdsFunc(allParams, validateCardId); + } + + private void OnPushRelationCardButton(GameObject g) + { + + if (!IsAnimationPlaying) + { + IsAnimationPlaying = true; + RelationCardButton.SetActive(value: false); + RelationWrapperObj.SetActive(value: true); + _relationIndex = 0; + RereshRelation(g); + } + } + + private void OnPushRelationBackButton(GameObject g) + { + + if (!IsAnimationPlaying) + { + RelationWrapperObj.SetActive(value: false); + IsAnimationPlaying = true; + _relationIndex = 0; + SetCardDetail(_originalCardId, _relationCardBaseGameObject); + OpenCardAnimation(); + DialogTitleLabel.text = Data.SystemText.Get("Card_0135"); + } + } + + private void OnPushRightButton(GameObject g) + { + if (IsRelationCardViewing) + { + if (!IsAnimationPlaying) + { + IsAnimationPlaying = true; + _relationIndex++; + if (_relationIndex >= _relationCardIds.Count) + { + _relationIndex = 0; + } + RereshRelation(g); + + } + } + else + { + OnDragCard.Call(new Vector2(-70f, 0f)); + } + } + + private void OnPushLeftButton(GameObject g) + { + if (IsRelationCardViewing) + { + if (!IsAnimationPlaying) + { + IsAnimationPlaying = true; + _relationIndex--; + if (_relationIndex < 0) + { + _relationIndex = _relationCardIds.Count - 1; + } + RereshRelation(g); + + } + } + else + { + OnDragCard.Call(new Vector2(70f, 0f)); + } + } + + private void UpdateRelationCount() + { + CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_originalCardId); + DialogTitleLabel.text = string.Format(Data.SystemText.Get("Card_0217") + "\u3000({1}/{2})", cardParameterFromId.CardName, _relationIndex + 1, _relationCardIds.Count); + } + + private void RereshRelation(GameObject g) + { + UpdateRelationCount(); + if (IsRelationCardViewing) + { + bool active = _relationCardIds.Count > 1; + RightButton.SetActive(active); + LeftButton.SetActive(active); + } + Toolbox.ResourcesManager.RemoveAssetGroup(_assetTokenPathList); + _assetTokenPathList.Clear(); + CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(_originalCardId); + int id = _relationCardIds[_relationIndex]; + CardParameter cardParameterFromId2 = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(id); + if (cardParameterFromId.IsFoil) + { + id = cardParameterFromId2.FoilCardId; + } + AddResourceList(cardParameterFromId2); + CardTexture.SetActive(value: false); + SetEnableButtons(isEnable: false); + Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(_assetTokenPathList, delegate + { + CardTexture.SetActive(value: true); + SetCardDetail(id, g, isUpdateRelation: false); + OpenCardAnimation(); + SetEnableButtons(isEnable: true); + }); + } + + private void AddResourceList(CardParameter CardPrm) + { + int resourceCardId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(CardPrm.NormalCardId).ResourceCardId; + switch (CardPrm.CharType) + { + case CardBasePrm.CharaType.NORMAL: + { + string assetTypePath3 = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial); + _assetTokenPathList.Add(assetTypePath3); + break; + } + case CardBasePrm.CharaType.SPELL: + { + string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); + _assetTokenPathList.Add(assetTypePath2); + break; + } + default: + { + string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); + _assetTokenPathList.Add(assetTypePath); + break; + } + } + } + + private void OnOpenCardViewMode(GameObject g) + { + if (_isAbleTapDialogObject && !IsAnimationPlaying && !isAnimation && !isCardViewMode && (UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.CardAllList || GetPossessionCardNum(isIncludingSpotCard: true) > 0)) + { + isCardViewMode = true; + IsAnimationPlaying = true; + CardViewBG.SetActive(value: true); + + CardBasePrm.CharaType charType = CardData.CharType; + if (CardBasePrm.IsSpellCard(charType)) + { + ViewCardObject = NGUITools.AddChild(base.gameObject, SpellCardObject); + } + else if (CardBasePrm.IsAmuletCard(charType)) + { + ViewCardObject = NGUITools.AddChild(base.gameObject, FieldCardObject); + } + else if (CardBasePrm.IsFollowerCard(charType)) + { + ViewCardObject = NGUITools.AddChild(base.gameObject, UnitCardObject); + } + iTween.ScaleTo(ViewCardObject, iTween.Hash("Scale", CardViewScale, "time", 0.3f)); + iTween.RotateTo(ViewCardObject, iTween.Hash("z", 0f, "time", 0.3f, "oncompletetarget", base.gameObject, "oncomplete", "OnAnimationOver")); + ViewCardObject.transform.localPosition = new Vector3(0f, 0f, -100f); + } + } + + private void OnCloseCardViewMode() + { + if (!IsAnimationPlaying && isCardViewMode) + { + IsAnimationPlaying = true; + RemoveCardViewMode(); + + CardBasePrm.CharaType charType = CardData.CharType; + GameObject target = null; + if (CardBasePrm.IsSpellCard(charType)) + { + target = SpellCardObject; + } + else if (CardBasePrm.IsAmuletCard(charType)) + { + target = FieldCardObject; + } + else if (CardBasePrm.IsFollowerCard(charType)) + { + target = UnitCardObject; + } + iTween.MoveTo(target, iTween.Hash("islocal", true, "z", kCARD_POS_Z, "time", 0.3f, "oncompletetarget", base.gameObject, "oncomplete", "OnAnimationOver")); + } + } + + private void RemoveCardViewMode() + { + if (isCardViewMode) + { + UnityEngine.Object.Destroy(ViewCardObject); + CardViewBG.SetActive(value: false); + isCardViewMode = false; + } + } + + private void OnCloseCardViewMode(GameObject g) + { + OnCloseCardViewMode(); + } + + private void UpdateFavoriteButton() + { + _isFavorite = false; // Pre-Phase-5b: headless has no user favorites + _favoriteButton.gameObject.SetActive(IsShowFavoriteButton && GetPossessionCardNum() > 0 && CardData.IsEnableFavorite && !IsRelationCardViewing); + SetFavoriteButtonSprite(_isFavorite); + } + + private void SetFavoriteButtonSprite(bool isFavorite) + { + string text = "btn_favorite_"; + string text2 = "off"; + string text3 = "on"; + _favoriteButton.normalSprite = text + (isFavorite ? text3 : text2); + _favoriteButton.pressedSprite = text + (isFavorite ? text2 : text3); + } + + private void OnClickFavoriteButton(GameObject g) + { + if (_isFavoriteButtonEnabled && GetPossessionCardNum() > 0) + { + _isFavoriteButtonEnabled = false; + StartCoroutine(Timer.DelayMethod(0.9f, delegate + { + _isFavoriteButtonEnabled = true; + })); + bool flag = !_isFavorite; + + ChangeFavoriteState(); + } + } + + private void ChangeFavoriteState() + { + bool is_protected = !_isFavorite; + CardProtectTask cardProtectTask = new CardProtectTask(); + cardProtectTask.SetParameter(CardData.CardId, is_protected); + StartCoroutine(Toolbox.NetworkManager.Connect(cardProtectTask, OnSuccessProtectCard, null, OnErrorProtectCard)); + } + + private void OnSuccessProtectCard(NetworkTask.ResultCode code) + { + UpdateButtonState(); + UpdateCreateLiquefyButton(); + OnChangeCardFavoriteState.Call(); + } + + private void OnErrorProtectCard(int code) + { + UpdateButtonState(); + UpdateCreateLiquefyButton(); + } + + private void UpdateVoiceButton() + { + CardVoiceData cardVoiceData = new CardVoiceData(CardData, _cardMasterId); + bool flag = (!_isEvolCard && cardVoiceData._voiceListBeforeEvo.Count > 0) || (_isEvolCard && cardVoiceData._voiceListAfterEvo.Count > 0); + _voiceButton.gameObject.SetActive(flag && IsShowVoiceButton && (IsPopularityVote || GetPossessionCardNum(isIncludingSpotCard: true) > 0)); + } + + private void OnClickVoiceButton(GameObject g) + { + _cardVoiceManager.SequentiallyPlay(CardData, _isEvolCard, _cardMasterId); + } + + private void OnClickChangeCardTextTypeButton(GameObject g) + { + + _isShowCardAblityText = !_isShowCardAblityText; + UpdateCardText(); + UpdateButtonState(); + } + + private void UpdateEvolutionButton() + { + if (CardBasePrm.IsFollowerCard(CardData.CharType) && !CardData.IsEvolveChoiceCard) + { + CardEvolButton.gameObject.SetActive(IsShowEvolutionButton && (IsPopularityVote || GetPossessionCardNum(isIncludingSpotCard: true) > 0)); + _evolutionButtonLabel.text = Data.SystemText.Get(_isEvolCard ? "Card_0067" : "Card_0030"); + } + else + { + CardEvolButton.gameObject.SetActive(value: false); + } + } + + private void OnClickEvolutionButton(GameObject g) + { + + _isEvolCard = !_isEvolCard; + UpdateCardImage(); + UpdateCardText(); + UpdateButtonState(); + _cardVoiceManager.Stop(); + if (_evolEffect != null) + { + _evolEffect.Play(); + return; + } + string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("cmn_deckedit_evo_1", ResourcesManager.AssetLoadPathType.Effect2D); + _assetPathList.Add(assetTypePath); + StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(assetTypePath, delegate + { + GameObject gameObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_deckedit_evo_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject; + if (gameObject != null) + { + ParticleSystem component = gameObject.GetComponent(); + ParticleSystem.MainModule main = component.main; + main.playOnAwake = false; + _evolEffect = UnityEngine.Object.Instantiate(component); + _evolEffect.transform.parent = CardTexture.transform; + _evolEffect.transform.localPosition = Vector3.back * 10f; + _evolEffect.transform.localRotation = Quaternion.identity; + _evolEffect.transform.localScale = Vector3.one * 600f; + _evolEffect.gameObject.layer = base.gameObject.layer; + Transform[] componentsInChildren = _evolEffect.GetComponentsInChildren(); + for (int i = 0; i < componentsInChildren.Length; i++) + { + componentsInChildren[i].gameObject.layer = base.gameObject.layer; + } + // Pre-Phase-5b: SetUIParticleShader swapped the evol effect's shader then triggered + // its playback via the callback. Headless has no EffectMgr; the SetActive/Play + // calls below produce no visible effect but preserve the state machine. + if ((bool)_evolEffect) + { + _evolEffect.gameObject.SetActive(value: true); + _evolEffect.Play(); + } + } + })); + } + + private void UpdatePremiumCardConversionButton() + { + GameObject gameObject = _premiumCardConversionButton.gameObject; + UIManager.SetObjectToGrey(gameObject, PlayerStaticData.UserOrbNum <= 0); + if (!IsShowPremiumCardConversionButton || IsRelationCardViewing || GetPossessionCardNum() <= 0 || CardData.IsFoil || (CardData.IsNotCraftDestruct && !CardData.IsPreReleaseCard)) + { + gameObject.SetActive(value: false); + } + else + { + gameObject.SetActive(value: true); + } + } + + private void OnClickPremiumCardConversionButton(GameObject g) + { + if (GetPossessionCardNum() <= 0) + { + return; + } + + if (isAnimation) + { + return; + } + SystemText systemText = Data.SystemText; + if (PlayerStaticData.UserOrbNum <= 0) + { + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); + dialogBase.SetTitleLabel(systemText.Get("Card_0163_1")); + dialogBase.SetText(systemText.Get("Card_0163_2")); + dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); + } + else if (false /* Pre-Phase-5b: headless has no user foil card count */) + { + DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(); + dialogBase2.SetTitleLabel(systemText.Get("Card_0164_1")); + dialogBase2.SetText(systemText.Get("Card_0164_2")); + dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); + } + else if (_isFavorite) + { + DialogBase dialogBase3 = UIManager.GetInstance().CreateDialogClose(); + dialogBase3.SetTitleLabel(systemText.Get("Card_0165_1")); + dialogBase3.SetText(systemText.Get("Card_0165_2")); + dialogBase3.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); + dialogBase3.SetButtonText(systemText.Get("Card_0165_3")); + dialogBase3.onPushButton1 = delegate + { + CreatePremiumCardConversionDialog(); + }; + } + else + { + CreatePremiumCardConversionDialog(); + } + } + + private void CreatePremiumCardConversionDialog() + { + SystemText systemText = Data.SystemText; + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); + PremiumCardConversionDialogParts premiumCardConversionDialogParts = UnityEngine.Object.Instantiate(_premiumCardConversionDialogPrefab); + premiumCardConversionDialogParts.Initialize(CardData); + dialogBase.SetObj(premiumCardConversionDialogParts.gameObject); + dialogBase.SetSize(DialogBase.Size.M); + dialogBase.SetTitleLabel(systemText.Get("Card_0162_1")); + dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); + dialogBase.SetButtonText(systemText.Get("Card_0162_7")); + dialogBase.onPushButton1 = delegate + { + if (!_isFavorite) + { + ConvertPremiumCard(); + } + else + { + ChangeFavoriteState(); + OnChangeCardFavoriteState = (Action)Delegate.Combine(OnChangeCardFavoriteState, new Action(ConvertPremiumCard)); + } + }; + } + + private void ConvertPremiumCard() + { + OnChangeCardFavoriteState = (Action)Delegate.Remove(OnChangeCardFavoriteState, new Action(ConvertPremiumCard)); + PremiumCardConversionTask premiumCardConversionTask = new PremiumCardConversionTask(); + premiumCardConversionTask.SetParameter(CardData.CardId, GetPossessionCardNum()); + StartCoroutine(Toolbox.NetworkManager.Connect(premiumCardConversionTask, OnSuccessPremiumCardConversion)); + } + + private void OnSuccessPremiumCardConversion(NetworkTask.ResultCode code) + { + OnConvertedPremiumCard.Call(CardData); + StartCoroutine(StartPremiumCardConversionAnimation()); + } + + private IEnumerator StartPremiumCardConversionAnimation() + { + isAnimation = true; + + yield return StartCoroutine(PlayCardCreateEffect(PREMIUM_CARD_CONVERSION_PARTICLE_COLOR, _premiumCardConversionButton.transform.position, _cardNumLabel.transform.position, 4)); + SetCardDetail(CardData.FoilCardId); + isAnimation = false; + } + + private void UpdateCreateLiquefyButton(bool isUpdateHaveRedether = true) + { + if (IsShowCraftButtons && !IsRelationCardViewing) + { + _craftPanel.gameObject.SetActive(value: true); + _craftPanel.UpdateCraftPanel(CardData, isUpdateHaveRedether); + } + else + { + _craftPanel.gameObject.SetActive(value: false); + } + } + + private void StartCardDestruct() + { + if (!IsAbleToDestruct) + { + return; + } + CardMake component = base.gameObject.GetComponent(); + component.OnCardSell = delegate + { + if (GetPossessionCardNum() <= 0) + { + OnLiquefyAllCard.Call(CardData); + } + StartCoroutine(RunCardDestruct()); + }; + component.StartCardDestruct(CardData.CardId); + } + + private IEnumerator RunCardDestruct() + { + isAnimation = true; + + yield return StartCoroutine(PlayCardLiquefyEffect(CARD_LIQUEFY_PARTICLE_COLOR, _cardNumLabel.transform.position, RedEtherIcon.transform.position, CardData.Rarity)); + iTween.ValueTo(base.gameObject, iTween.Hash("from", int.Parse(_redEtherHaveValueLabel.text), "to", PlayerStaticData.UserRedEtherCount, "time", 0.5f, "onupdate", "OnUpdateRedEther", "oncomplete", "OnCompleteRedEther", "easetype", iTween.EaseType.easeOutQuad)); + UpdateCardNum(); + CardShadow.gameObject.SetActive(GetPossessionCardNum(isIncludingSpotCard: true) <= 0 && !IsShortageUI); + UpdateCardText(); + UpdateButtonState(); + OnCardNumChange.Call(); + UpdateCreateLiquefyButton(isUpdateHaveRedether: false); + OnCardSellId.Call(CardData.CardId); + yield return new WaitForSeconds(0.2f); + isAnimation = false; + } + + // Pre-Phase-5b: coroutine driving card-craft liquefy particles (Stop/Start on several + // CMN_CRAFT_* effects + iTween bezier moves). All Unity3D UI VFX — headless has no + // EffectMgr; kept the shape as a single-yield stub so callers' coroutine flow still runs. + private IEnumerator PlayCardLiquefyEffect(Color particleColor, Vector3 particleStartPos, Vector3 particleEndPos, int particleNum) + { + yield return new WaitForSeconds(0.5f); + } + + private void StartCardCraft() + { + if (!IsAbleToCraft) + { + return; + } + CardMake component = base.gameObject.GetComponent(); + component.OnCardBuy = delegate + { + if (GetPossessionCardNum(isIncludingSpotCard: true) == 1) + { + OnCreateFirstCard.Call(); + } + StartCoroutine(RunCardCraft()); + }; + component.StartCardCraft(CardData.CardId); + } + + private IEnumerator RunCardCraft() + { + isAnimation = true; + + yield return StartCoroutine(PlayCardCreateEffect(CARD_CREATE_PARTICLE_COLOR, RedEtherIcon.transform.position, _cardNumLabel.transform.position, CardData.Rarity)); + iTween.ValueTo(base.gameObject, iTween.Hash("from", int.Parse(_redEtherHaveValueLabel.text), "to", PlayerStaticData.UserRedEtherCount, "time", 0.5f, "onupdate", "OnUpdateRedEther", "oncomplete", "OnCompleteRedEther", "easetype", iTween.EaseType.easeOutQuad)); + UpdateCardNum(); + CardShadow.gameObject.SetActive(value: false); + UpdateCardText(); + UpdateButtonState(); + UpdateCreateLiquefyButton(isUpdateHaveRedether: false); + OnCardNumChange.Call(); + OnCardBuy.Call(); + yield return new WaitForSeconds(0.2f); + isAnimation = false; + } + + // Pre-Phase-5b: coroutine driving card-craft create particles (Stop/Start on several + // CMN_CRAFT_* effects + iTween bezier moves). See PlayCardLiquefyEffect for rationale. + private IEnumerator PlayCardCreateEffect(Color particleColor, Vector3 particleStartPos, Vector3 particleEndPos, int particleNum) + { + yield return new WaitForSeconds(0.5f); + } + + private void OnUpdateRedEther(int value) + { + _redEtherHaveValueLabel.text = value.ToString(); + } + + private void OnCompleteRedEther() + { + _redEtherHaveValueLabel.text = PlayerStaticData.UserRedEtherCount.ToString(); + } + + private void CreateDialog(Action onOk, bool buy) + { + if (!isAnimation) + { + _craftDialog = UIManager.GetInstance().CreateDialogClose(); + _craftDialog.onPushButton1 = onOk; + PurchaseConfirm purchaseConfirm = UnityEngine.Object.Instantiate(PurchaseConfirmPrefab); + _craftDialog.SetObj(purchaseConfirm.gameObject); + int userRedEtherCount = PlayerStaticData.UserRedEtherCount; + SystemText systemText = Data.SystemText; + if (buy) + { + _craftDialog.SetTitleLabel(systemText.Get("Card_0081")); + _craftDialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); + _craftDialog.SetButtonText(systemText.Get("Dia_CardList_003_Button")); + int useRedEther = CardData.UseRedEther; + purchaseConfirm.SetCardBuy(systemText.Get("Common_0205"), userRedEtherCount, useRedEther, CardData); + } + else + { + _craftDialog.SetTitleLabel(systemText.Get("Card_0080")); + _craftDialog.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); + _craftDialog.SetButtonText(systemText.Get("Dia_CardList_002_Button")); + int getRedEther = CardData.GetRedEther; + purchaseConfirm.SetCardSell(systemText.Get("Common_0205"), userRedEtherCount, getRedEther, CardData.CardName, CardData.IsFoil); + } + } + } + + private IEnumerator DelayResetScrollViewPosition() + { + yield return null; + ResetScrollViewPosition(); + } + + private void ResetScrollViewPosition() + { + UnitCardTextScrollView.ResetPosition(); + SpellCardTextScrollView.ResetPosition(); + SettingCardTextScrollView.ResetPosition(); + UnitCardTextScrollView.UpdateScrollbars(recalculateBounds: true); + SpellCardTextScrollView.UpdateScrollbars(recalculateBounds: true); + SettingCardTextScrollView.UpdateScrollbars(recalculateBounds: true); + } + + private void ChangeLayer(GameObject o, int layer) + { + o.layer = layer; + for (int i = 0; i < o.transform.childCount; i++) + { + ChangeLayer(o.transform.GetChild(i).gameObject, layer); + } + } + + public bool GetIsDetailOn() + { + return isDetailOn; + } + + public void SetDisableArrowButton() + { + OnDetailCardUpdate = delegate + { + RightButtonVisible = false; + LeftButtonVisible = false; + }; + } + + public void SetEnableButtons(bool isEnable) + { + for (int i = 0; i < _enableButtonList.Length; i++) + { + _enableButtonList[i].isEnabled = isEnable; + } + _isAbleTapDialogObject = isEnable; + if (isEnable) + { + UpdateButtonState(); + UpdateCreateLiquefyButton(); + } + } +} diff --git a/SVSim.BattleEngine/Engine/CardFilterKeyWordMaster.cs b/SVSim.BattleEngine/Engine/CardFilterKeyWordMaster.cs deleted file mode 100644 index 5ac21d9e..00000000 --- a/SVSim.BattleEngine/Engine/CardFilterKeyWordMaster.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; - -public class CardFilterKeyWordMaster -{ - private Dictionary> _allData = new Dictionary>(); - - public List CategoryList { get; private set; } - - public CardFilterKeyWordMaster() - { - CategoryList = new List(); - } - - public void Add(string[] line) - { - string item = line[0]; - string text = line[1]; - if (!CategoryList.Contains(text)) - { - CategoryList.Add(text); - _allData[text] = new List(); - } - _allData[text].Add(item); - } - - public List GetCategory(string category) - { - return _allData[category]; - } -} diff --git a/SVSim.BattleEngine/Engine/CardMake.cs b/SVSim.BattleEngine/Engine/CardMake.cs index bf708eb6..ae566624 100644 --- a/SVSim.BattleEngine/Engine/CardMake.cs +++ b/SVSim.BattleEngine/Engine/CardMake.cs @@ -6,9 +6,6 @@ using Wizard; public class CardMake : MonoBehaviour { - public const int CAN_CREATE_MAX = 3; - - public const string FORMAT_CARD_CRAFT_PARAM = "{0},{1}"; private IDictionary DestructDict; @@ -34,7 +31,7 @@ public class CardMake : MonoBehaviour { DestructDict.Clear(); } - int possessionCardNum = GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard: false); + int possessionCardNum = 0; // Pre-Phase-5b: headless has no user inventory DestructDict = new Dictionary(); DestructDict.Add(cardId.ToString(), "1," + possessionCardNum); DestructCard(); @@ -42,9 +39,10 @@ public class CardMake : MonoBehaviour private void DestructCard() { - CardDestructTask cardDestructTask = GameMgr.GetIns().GetCardDestructTask(); - cardDestructTask.SetParameter(DestructDict); - StartCoroutine(Toolbox.NetworkManager.Connect(cardDestructTask, OnRequestFinishDestruct, OnError, OnError)); + // Pre-Phase-5b: fired CardDestructTask via NetworkManager. Headless has no wire + // task service; short-circuit straight to the success callback so the UI event + // chain (OnRequestFinishDestruct → TriggerUpdateUserDeck → OnClose) still fires. + OnRequestFinishDestruct(default(NetworkTask.ResultCode)); } private void OnRequestFinishDestruct(NetworkTask.ResultCode error) @@ -88,16 +86,15 @@ public class CardMake : MonoBehaviour { _craftDict.Clear(); } - int possessionCardNum = GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard: false); + int possessionCardNum = 0; // Pre-Phase-5b: headless has no user inventory _craftDict.Add(cardId.ToString(), $"{1},{possessionCardNum}"); CraftCard(); } private void CraftCard() { - CardCreateTask cardCreateTask = GameMgr.GetIns().GetCardCreateTask(); - cardCreateTask.SetParameter(_craftDict); - StartCoroutine(Toolbox.NetworkManager.Connect(cardCreateTask, OnRequestFinishCraft, OnError, OnError)); + // Pre-Phase-5b: fired CardCreateTask via NetworkManager. See DestructCard. + OnRequestFinishCraft(default(NetworkTask.ResultCode)); } private void OnRequestFinishCraft(NetworkTask.ResultCode error) @@ -112,27 +109,6 @@ public class CardMake : MonoBehaviour } } - public void StartDestructAll(IDictionary destructDict, Action onFinishCallBack = null) - { - _onFinishCardDestruct = onFinishCallBack; - DestructDict = destructDict; - if (DestructDict.Count > 0) - { - DestructCard(); - } - } - - public void StartDestructAll(IDictionary destructDict, Action callback = null) - { - Dictionary dictionary = new Dictionary(); - foreach (KeyValuePair item in destructDict) - { - string value = CreateRequestParam(item.Key, item.Value); - dictionary.Add(item.Key.ToString(), value); - } - StartDestructAll(dictionary, callback); - } - public void StartCraftAll(IDictionary craftDict) { if (_craftDict == null) @@ -159,7 +135,7 @@ public class CardMake : MonoBehaviour private string CreateRequestParam(int cardId, int num) { - int possessionCardNum = GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard: false); + int possessionCardNum = 0; // Pre-Phase-5b: headless has no user inventory return $"{num},{possessionCardNum}"; } diff --git a/SVSim.BattleEngine/Engine/CardPack.cs b/SVSim.BattleEngine/Engine/CardPack.cs index e3131aec..c9253cd9 100644 --- a/SVSim.BattleEngine/Engine/CardPack.cs +++ b/SVSim.BattleEngine/Engine/CardPack.cs @@ -2,18 +2,10 @@ public class CardPack : HeaderData { public int card_id; - public int base_card_id; - public int rarity; public string create_time; - public string update_time; - - public string delete_time; - - public string affected_rows; - public int SleeveId { get; set; } = 3000011; public bool IsSpecialCard { get; set; } diff --git a/SVSim.BattleEngine/Engine/CardPackManager.cs b/SVSim.BattleEngine/Engine/CardPackManager.cs index 7874f085..77efa623 100644 --- a/SVSim.BattleEngine/Engine/CardPackManager.cs +++ b/SVSim.BattleEngine/Engine/CardPackManager.cs @@ -1,1179 +1,34 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; - -public class CardPackManager : MonoBehaviour -{ - public class GachaMaskDark - { - public int PackId; - - public Rect UvRect; - - public Color Color; - - public GachaMaskDark(string[] columns) - { - int num = 0; - PackId = int.Parse(columns[num]); - num++; - UvRect = new Rect(float.Parse(columns[num]), float.Parse(columns[num + 1]), float.Parse(columns[num + 2]), float.Parse(columns[num + 3])); - num += 4; - Color = new Color(float.Parse(columns[num]), float.Parse(columns[num + 1]), float.Parse(columns[num + 2]), float.Parse(columns[num + 3])); - } - } - - private InputMgr m_InputMgrIns; - - private EffectMgr m_EfcMgrIns; - - private const int DRAW_NUM = 8; - - private const int ANIM_CNT_NONE = 100; - - private const int CARD_TOUCH_POS_DIV_CNT = 10; - - private const float DELAY_FADEOUT_SE = 1.5f; - - private const float WAIT_FADEOUT_FOR_DISPOSE = 1f; - - private const float SCALE_3D_OBJECT = 0.003125f; - - private const string PACK_BOX_NAME = "md_gachabox_{0}"; - - private const string PACK_EFFECT_IDLE_1 = "gch_box_idle_1_{0}"; - - private const string PACK_EFFECT_TAP_1 = "gch_box_tap_1_{0}"; - - private const string PACK_EFFECT_SHINE_1 = "gch_box_shine_1_{0}"; - - private const string PACK_EFFECT_SPECIAL_1 = "gch_box_special_1"; - - private const string PACK_EFFECT_SPECIAL_2 = "gch_box_special_2"; - - private const string CUESHEETNAME_GACHA_SE = "se_gacha"; - - private const string CUENAME_SE_GACHA_APPEAR = "se_sys_gacha_appear_{0}"; - - private const string CUENAME_SE_GACHA_OPEN = "se_sys_gacha_open_{0}"; - - private const int EFFECT_LAYER = 30; - - private const float FOV_ASPECT_BORDER = 1.5f; - - private const int FOV_UNDER_BORDER_SIZE = 70; - - private const int FOV_OVER_BORDER_SIZE = 64; - - private readonly Vector3 POSITION_CARDVIEW_CAMERA = new Vector3(9600f, 92f, -2900f); - - [HideInInspector] - public GameObject CardPackParent; - - private IList m_CardPackList; - - private IList m_CardAnimList; - - private Queue m_openCardQueue = new Queue(); - - private IList m_CardOpenList; - - private IList m_CardPosList; - - private IList m_CardRotList; - - private IList m_RarityList; - - private IList m_CostIconList; - - private IList m_LifeIconList; - - private IList m_AtkIconList; - - private IList m_NameLabelList; - - private int layer_Gacha = 18; - - private int animCnt = 100; - - private int currentCnt; - - private int packOpenCnt = 1; - - private bool _isAutoOpen; - - private bool _isCoutainSpecialCard; - - private Camera GachaCamera; - - private GameObject GachaLight; - - private GameObject GachaBox; - - private Animation GachaBoxAnim; - - private GameObject ClanLabels; - - private IList ClanLabelList = new List(); - - private UITexture DarkSideTex; - - private UITexture BgBlackTex; - - private GameObject PackEffectIdle1; - - private GameObject PackEffectTap1; - - private GameObject PackEffectShine1; - - private GameObject PackEffectSpecial1; - - private GameObject PackEffectSpecial2; - - private GameObject CardBefore; - - private Vector3 GachaObjScale = new Vector3(250f, 250f, 50f); - - private int cardPackSize; - - private int cardPackNum; - - private int lastLoadedCardIndex; - - private Vector3 mousePosPrev = Vector3.zero; - - private const int PAGE_CARD_COUNT = 8; - - private float m_BackupBgmVolume; - - private List PackAssetNameList = new List(); - - private List EffectAssetPathList; - - private GameObject GachaStay1Pool; - - private GameObject GachaStay2Pool; - - private GameObject GachaStay3Pool; - - private GameObject GachaSpecialStay1Pool; - - private GameObject GachaTwinkle1Pool; - - private bool m_IsNextCardCreated = true; - - private bool m_IsHideCardFinish = true; - - private const float DelayOpenCard = 0.05f; - - [SerializeField] - private UIButton SkipBtn; - - [SerializeField] - private UIButton OkBtn; - - [SerializeField] - private UILabel LabelPackNum; - - [SerializeField] - private UILabel LabelPackUnit; - - [SerializeField] - private NguiObjs TouchObj; - - private CardDetailUI _cardDetail; - - private UIManager.ViewScene _nextScene; - - private List _boxEffectList = new List(); - - private bool _isNextCardAnim; - - private bool _isDispose; - - private string _seNameGachaAppear = ""; - - private string _seNameGachaOpen = ""; - - private bool _isSpecialCardPackSet; - - public bool IsSkipped { get; private set; } - - public void Init(bool isAutoOpen, CardDetailUI cardDetail, UIManager.ViewScene nextScene, bool isCoutainSpecialCard, Action callback) - { - _isAutoOpen = isAutoOpen; - _isCoutainSpecialCard = isCoutainSpecialCard; - _cardDetail = cardDetail; - _nextScene = nextScene; - IsSkipped = false; - GameMgr.GetIns().GetPrefabMgr().Load("Gacha/GachaObj"); - m_InputMgrIns = GameMgr.GetIns().GetInputMgr(); - m_EfcMgrIns = GameMgr.GetIns().GetEffectMgr(); - CardPackParent = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(GameMgr.GetIns().GetPrefabMgr().GetObj("Gacha/GachaObj") as GameObject); - CardPackParent.layer = layer_Gacha; - CardPackParent.transform.localScale = new Vector3(0.003125f, 0.003125f, 0.003125f); - GachaObj component = CardPackParent.GetComponent(); - CardPackParent.SetActive(value: false); - GachaCamera = component.GachaCamera; - GachaLight = component.GachaLight; - GachaBox = component.GachaBox; - ClanLabels = component.ClanLabels; - DarkSideTex = component.DarkSideTex; - BgBlackTex = component.BgBlackTex; - ClanLabelList.Clear(); - for (int i = 0; i < ClanLabels.transform.childCount; i++) - { - ClanLabelList.Add(ClanLabels.transform.GetChild(i).GetComponent()); - } - OkBtn.onClick.Clear(); - OkBtn.onClick.Add(new EventDelegate(delegate - { - OnClickNextBtn(); - })); - SkipBtn.onClick.Clear(); - SkipBtn.onClick.Add(new EventDelegate(delegate - { - if (!_cardDetail.GetIsDetailOn()) - { - OnClickSkipBtn(); - } - })); - TouchObj.labels[0].text = Data.SystemText.Get("Common_0146"); - EffectAssetPathList = GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/CardPackEffectData", isBattle: false, isField: false, isBattleEffect: false, delegate - { - callback.Call(); - }); - } - - public void StartInstantiateCardPack(PackConfig packConfig) - { - _isDispose = false; - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - m_BackupBgmVolume = soundMgr.GetBgmVolume(); - soundMgr.FadeBgmVolume(0f); - animCnt = 0; - currentCnt = 0; - packOpenCnt = 1; - m_CardPackList = new List(); - m_CardAnimList = new List(); - m_CardOpenList = new List(); - m_CardPosList = new List(); - m_CardRotList = new List(); - m_RarityList = new List(); - m_CostIconList = new List(); - m_LifeIconList = new List(); - m_AtkIconList = new List(); - m_NameLabelList = new List(); - CardBefore = null; - GachaCamera.transform.localPosition = new Vector3(0f, 360f, -840f); - GachaCamera.transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 0f)); - GachaCamera.fieldOfView = ((GameMgr.GetIns().ScreenAspect < 1.5f) ? 70 : 64); - GachaBox.SetActive(value: true); - LabelPackNum.gameObject.SetActive(value: false); - OkBtn.gameObject.SetActive(value: true); - OkBtn.isEnabled = false; - SkipBtn.gameObject.SetActive(value: true); - ClanLabels.SetActive(value: false); - DarkSideTex.alpha = 1f; - DarkSideTex.transform.localScale = Vector3.one * 2f; - BgBlackTex.alpha = 0f; - CardPackParent.SetActive(value: true); - lastLoadedCardIndex = 0; - GachaCamera.gameObject.SetActive(value: true); - _isSpecialCardPackSet = packConfig.IsSpecialCardPack; - GameMgr.GetIns().GetSoundMgr().LoadSe("se_gacha", delegate - { - InstantiateCardPack(packConfig.GetGachaIdForEffectResource()); - }); - } - - private IEnumerator loadNextPage(Action onFinish) - { - m_IsNextCardCreated = false; - int b = cardPackSize - lastLoadedCardIndex; - int takeNum = Mathf.Min(8, b); - List targetCardList = Data.PackOpen.data.pack_list.Skip(lastLoadedCardIndex).Take(takeNum).ToList(); - List assetList = Toolbox.ResourcesManager.CardListAssetPathList; - Dictionary> cardObjectDic = new Dictionary>(); - foreach (IGrouping item in from x in targetCardList - group x by x.SleeveId) - { - PackAssetNameList.AddRange(assetList); - assetList.Clear(); - int sleeveId = item.Key; - yield return CreateGachaCardPack(item.Select((CardPack x) => x.card_id).ToList(), sleeveId); - cardObjectDic.Add(sleeveId, UIManager.GetInstance().getSelectCardListObjs()); - } - List SetShaderList = new List(); - List specialEffectList = new List(); - for (int num = 0; num < takeNum; num++) - { - CardPack cardPack = targetCardList[num]; - int card_id = cardPack.card_id; - List list = cardObjectDic[cardPack.SleeveId]; - UIBase_CardManager.CardObjData cardObjData = list[0]; - list.RemoveAt(0); - GameObject gameObject = cardObjData.CardObj.gameObject; - gameObject.SetActive(value: true); - Transform transform = gameObject.transform; - AttachCardDetailButton(gameObject); - if (CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(card_id).CharType == CardBasePrm.CharaType.NORMAL) - { - GameObject gameObject2 = transform.Find("Life(Clone)").gameObject; - gameObject2.transform.localPosition = Global.POSITION_LIFE_ICON; - m_LifeIconList.Add(gameObject2); - GameObject gameObject3 = transform.Find("Atk(Clone)").gameObject; - gameObject3.transform.localPosition = Global.POSITION_ATK_ICON; - m_AtkIconList.Add(gameObject3); - } - else - { - m_LifeIconList.Add(null); - m_AtkIconList.Add(null); - } - GameObject gameObject4 = transform.Find("Cost(Clone)").gameObject; - gameObject4.transform.localPosition = Global.POSITION_COST_ICON; - m_CostIconList.Add(gameObject4); - GameObject gameObject5 = transform.Find("Name(Clone)").gameObject; - gameObject5.SetActive(value: false); - m_NameLabelList.Add(gameObject5); - Transform transform2 = transform.Find("CardBase"); - GameObject gameObject6 = null; - if (transform2 != null) - { - gameObject6 = transform2.Find("CardBase_Specular").gameObject; - gameObject6.layer = layer_Gacha; - gameObject6.SetActive(value: true); - } - if (!Data.Master.PackRarityEffectOverrideDic.TryGetValue(card_id, out var value)) - { - value = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(card_id).Rarity; - } - m_RarityList.Add(value); - if (value > 1) - { - GameObject gobj = null; - switch (value) - { - case 2: - gobj = GachaStay1Pool; - break; - case 3: - gobj = GachaStay2Pool; - break; - case 4: - gobj = GachaStay3Pool; - break; - } - GameObject gameObject7 = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(gobj); - gameObject7.transform.parent = transform; - gameObject7.name = "cmn_gacha_stay"; - gameObject7.transform.localPosition = Vector3.zero; - gameObject7.transform.localScale = Vector3.one; - gameObject7.layer = 30; - SetShaderList.Add(gameObject7); - } - GameObject gameObject8 = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(GachaTwinkle1Pool); - gameObject8.transform.parent = transform; - gameObject8.name = "cmn_gacha_move"; - gameObject8.transform.localPosition = Vector3.back * 0.2f; - gameObject8.transform.localScale = Vector3.one; - gameObject8.layer = 30; - SetShaderList.Add(gameObject8); - if (cardPack.IsSpecialCard || cardPack.IsFreePackLeaderSkin) - { - gameObject6?.SetActive(value: false); - GameObject gameObject9 = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(GachaSpecialStay1Pool); - gameObject9.transform.parent = transform; - gameObject9.name = "cmn_gacha_special"; - gameObject9.transform.localPosition = Vector3.forward * 0.1f; - gameObject9.transform.localScale = Vector3.one; - gameObject9.layer = 30; - SetShaderList.Add(gameObject9); - specialEffectList.Add(gameObject9); - } - gameObject.GetComponent().SetIdx(lastLoadedCardIndex + num); - transform.parent = CardPackParent.transform; - gameObject.layer = layer_Gacha; - transform.localScale = GachaObjScale; - m_CardPackList.Add(gameObject); - } - lastLoadedCardIndex += takeNum; - List collection = GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(SetShaderList, delegate - { - for (int i = 0; i < SetShaderList.Count; i++) - { - SetShaderList[i].SetActive(value: false); - } - specialEffectList.ForEach(delegate(GameObject effect) - { - effect.SetActive(value: true); - }); - m_IsNextCardCreated = true; - onFinish?.Invoke(); - }); - EffectAssetPathList.AddRange(collection); - } - - private IEnumerator CreateGachaCardPack(IList cardPackList, int sleeveId) - { - UIManager.GetInstance().CardLoadGachaPack(base.gameObject, cardPackList, layer_Gacha, is2D: false, sleeveId); - while (UIManager.GetInstance().getSelectCardListObjs() == null) - { - yield return null; - } - while (UIManager.GetInstance().getSelectCardListObjs().Count < cardPackList.Count) - { - yield return null; - } - while (!UIManager.GetInstance().getUIBase_CardManager().getCreateEndFlag() || !UIManager.GetInstance().getUIBase_CardManager().isAssetAllReady) - { - yield return null; - } - } - - private void AttachCardDetailButton(GameObject cardObject) - { - cardObject.GetComponentInChildren().gameObject.AddComponent().onClick.Add(new EventDelegate(delegate - { - OnClickCard(cardObject); - })); - } - - private void InstantiateCardPack(int parent_id) - { - _seNameGachaAppear = $"se_sys_gacha_appear_{parent_id}"; - _seNameGachaOpen = $"se_sys_gacha_open_{parent_id}"; - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_stay_2", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_stay_3", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_stay_4", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_move_1", ResourcesManager.AssetLoadPathType.Effect2D)); - bool isExistFreePackLeaderSkin = false; - foreach (CardPack item in Data.PackOpen.data.pack_list) - { - if (item.IsFreePackLeaderSkin) - { - isExistFreePackLeaderSkin = true; - break; - } - } - if (_isSpecialCardPackSet || isExistFreePackLeaderSkin) - { - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_special_1", ResourcesManager.AssetLoadPathType.Effect2D)); - } - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath($"gch_box_idle_1_{parent_id}", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath($"gch_box_tap_1_{parent_id}", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath($"gch_box_shine_1_{parent_id}", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("gch_box_special_1", ResourcesManager.AssetLoadPathType.Effect2D)); - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath("gch_box_special_2", ResourcesManager.AssetLoadPathType.Effect2D)); - string packBoxName = $"md_gachabox_{parent_id}"; - PackAssetNameList.Add(Toolbox.ResourcesManager.GetAssetTypePath(packBoxName, ResourcesManager.AssetLoadPathType.PackBox)); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(PackAssetNameList, delegate - { - GameObject prefab = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(packBoxName, ResourcesManager.AssetLoadPathType.PackBox, isfetch: true)) as GameObject; - GameObject gameObject = NGUITools.AddChild(GachaBox, prefab); - GachaBoxAnim = gameObject.GetComponent(); - GachaBoxAnim[GachaBoxAnim.clip.name].speed = -1f; - GachaBoxAnim.Play(); - GameObject original = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath($"gch_box_idle_1_{parent_id}", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - GameObject original2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath($"gch_box_tap_1_{parent_id}", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - GameObject original3 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath($"gch_box_shine_1_{parent_id}", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - PackEffectIdle1 = UnityEngine.Object.Instantiate(original); - PackEffectIdle1.transform.position = Vector3.zero; - PackEffectIdle1.transform.parent = m_EfcMgrIns.EffectContainer.transform; - PackEffectIdle1.SetActive(value: false); - PackEffectTap1 = UnityEngine.Object.Instantiate(original2); - PackEffectTap1.transform.parent = m_EfcMgrIns.EffectContainer.transform; - PackEffectTap1.transform.position = Vector3.zero; - PackEffectTap1.SetActive(value: false); - PackEffectShine1 = UnityEngine.Object.Instantiate(original3); - PackEffectShine1.transform.parent = m_EfcMgrIns.EffectContainer.transform; - PackEffectShine1.transform.position = Vector3.zero; - PackEffectShine1.SetActive(value: false); - _boxEffectList.Add(PackEffectIdle1); - _boxEffectList.Add(PackEffectTap1); - _boxEffectList.Add(PackEffectShine1); - if (_isCoutainSpecialCard) - { - GameObject original4 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("gch_box_special_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - GameObject original5 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("gch_box_special_2", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - PackEffectSpecial1 = UnityEngine.Object.Instantiate(original4); - PackEffectSpecial1.transform.parent = m_EfcMgrIns.EffectContainer.transform; - PackEffectSpecial1.transform.position = Vector3.zero; - PackEffectSpecial1.SetActive(value: false); - PackEffectSpecial2 = UnityEngine.Object.Instantiate(original5); - PackEffectSpecial2.transform.parent = m_EfcMgrIns.EffectContainer.transform; - PackEffectSpecial2.transform.position = Vector3.zero; - PackEffectSpecial2.SetActive(value: false); - _boxEffectList.Add(PackEffectSpecial1); - _boxEffectList.Add(PackEffectSpecial2); - } - GachaStay1Pool = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_stay_2", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - GachaStay2Pool = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_stay_3", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - GachaStay3Pool = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_stay_4", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - GachaTwinkle1Pool = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_move_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - if (_isSpecialCardPackSet || isExistFreePackLeaderSkin) - { - GachaSpecialStay1Pool = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_gacha_special_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - } - cardPackSize = Data.PackOpen.data.pack_list.Count; - cardPackNum = (cardPackSize - 1) / 8 + 1; - LabelPackUnit.text = Data.SystemText.Get("Shop_0089", cardPackNum.ToString()); - List collection = GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_boxEffectList, delegate - { - StartCoroutine(loadNextPage(delegate - { - for (int i = 0; i < m_CardPackList.Count; i++) - { - if (m_CardPackList[i] != null) - { - m_CardPackList[i].SetActive(value: false); - } - } - ToolboxGame.UIManager.closeInSceneLoading(); - UIManager.GetInstance().CreatFadeOpen(); - SetLabelPackOpenCount(); - RunGachaAnim(); - })); - }); - EffectAssetPathList.AddRange(collection); - SetDarkSideParameter(parent_id); - })); - } - - private void SetDarkSideParameter(int packId) - { - if (Data.Master.GachaMaskDarkDic.TryGetValue(packId, out var value)) - { - DarkSideTex.color = value.Color; - DarkSideTex.uvRect = value.UvRect; - } - } - - private IEnumerator DisposeCardPackSecen() - { - _isDispose = true; - yield return new WaitForSeconds(1f); - while (_isNextCardAnim) - { - yield return null; - } - animCnt = 100; - StartCoroutine(WaitForCreateCards(delegate - { - for (int i = 0; i < m_CardPackList.Count; i++) - { - UnityEngine.Object.Destroy(m_CardPackList[i]); - } - m_CardPackList.Clear(); - m_EfcMgrIns.DisposeLatestMadeEffects(); - UnityEngine.Object.Destroy(PackEffectIdle1); - UnityEngine.Object.Destroy(PackEffectTap1); - UnityEngine.Object.Destroy(PackEffectShine1); - if (_isCoutainSpecialCard) - { - UnityEngine.Object.Destroy(PackEffectSpecial1); - UnityEngine.Object.Destroy(PackEffectSpecial2); - } - _boxEffectList.Clear(); - UnityEngine.Object.Destroy(CardPackParent); - SkipBtn.gameObject.SetActive(value: false); - OkBtn.gameObject.SetActive(value: false); - LabelPackNum.gameObject.SetActive(value: false); - TouchObj.gameObject.SetActive(value: false); - GameMgr.GetIns().GetSoundMgr().FadeBgmVolume(m_BackupBgmVolume); - RemoveAssets(); - MyPageMenu.SetEnableReloadCard(); - UIManager instance = UIManager.GetInstance(); - UIBase uIBase = instance.GetUIBase(_nextScene); - if (uIBase != null) - { - uIBase.Open(); - } - else - { - instance.ChangeViewScene(_nextScene); - } - })); - } - - private IEnumerator WaitForCreateCards(Action callback, bool isCenterLoading = false) - { - if (isCenterLoading && !m_IsNextCardCreated) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: false, notCollider: true); - } - while (true) - { - if (!m_IsNextCardCreated) - { - yield return null; - continue; - } - if (m_IsHideCardFinish) - { - break; - } - yield return null; - } - callback.Call(); - } - - private void OnClickNextBtn() - { - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - if (currentCnt < cardPackSize) - { - packOpenCnt++; - SetLabelPackOpenCount(); - RunGachaAnim(); - soundMgr.PlaySe(Se.TYPE.SYS_BTN_DECIDE); - soundMgr.PlaySe(Se.TYPE.SYS_GACHA_CARD_OUT); - } - else - { - soundMgr.PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - animCnt = 100; - UIManager.GetInstance().CreatFadeClose(); - StartCoroutine(DisposeCardPackSecen()); - } - } - - private void OnClickSkipBtn() - { - UIManager.GetInstance().createInSceneCenterLoading(); - GameMgr.GetIns().GetSoundMgr().StopSeAll(1.5f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - IsSkipped = true; - UIManager.GetInstance().CreatFadeClose(); - StartCoroutine(DisposeCardPackSecen()); - } - - private void RemoveAssets() - { - PackAssetNameList.AddRange(EffectAssetPathList); - PackAssetNameList.AddRange(Toolbox.ResourcesManager.CardListAssetPathList); - Toolbox.ResourcesManager.RemoveAssetGroup(PackAssetNameList); - PackAssetNameList.Clear(); - EffectAssetPathList.Clear(); - Toolbox.ResourcesManager.CardListAssetPathList.Clear(); - GameMgr.GetIns().GetPrefabMgr().UnLoad("Gacha/GachaObj"); - GameMgr.GetIns().GetSoundMgr().UnloadSe("se_gacha"); - } - - private void Update() - { - if (animCnt == 100) - { - return; - } - switch (animCnt) - { - case 2: - if (m_InputMgrIns.IsDown()) - { - RunGachaAnim(); - } - break; - case 6: - if (m_InputMgrIns.IsDown() || m_InputMgrIns.IsPress()) - { - CheckPressCardOpen(); - mousePosPrev = Input.mousePosition; - } - else - { - mousePosPrev = Vector3.zero; - } - break; - case 8: - if (!_cardDetail.GetIsDetailOn() && GameMgr.GetIns().GetInputMgr().isBackKeyEnable) - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; - } - break; - } - } - - private void OnClickCard(GameObject cardObject) - { - if (animCnt == 8 && !_isDispose && !_cardDetail.GetIsDetailOn()) - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - _cardDetail.OnPushCardDetailOn(cardObject); - } - } - - private void RunGachaAnim() - { - animCnt++; - switch (animCnt) - { - default: - _ = 100; - break; - case 1: - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(_seNameGachaAppear, "se_gacha", 0f, 0L); - GachaLight.transform.localRotation = Quaternion.Euler(Vector3.up * 45f); - iTween.RotateBy(GachaLight, iTween.Hash("z", -1f, "time", 2f, "looptype", iTween.LoopType.loop, "easetype", iTween.EaseType.linear)); - PackEffectIdle1.SetActive(value: true); - if (_isCoutainSpecialCard) - { - PackEffectSpecial1.SetActive(value: true); - } - iTween.MoveTo(GachaCamera.gameObject, iTween.Hash("position", new Vector3(0f, -1200f, -2000f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(GachaCamera.gameObject, iTween.Hash("rotation", Vector3.left * 30f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.ScaleTo(DarkSideTex.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "easetype", iTween.EaseType.easeInOutExpo)); - Invoke("RunGachaAnim", 2f); - break; - case 2: - TouchObj.gameObject.SetActive(value: true); - DarkSideTex.transform.localScale = Vector3.one; - iTween.ScaleTo(DarkSideTex.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 1f, "looptype", iTween.LoopType.pingPong, "easetype", iTween.EaseType.easeInOutQuad)); - break; - case 3: - PackEffectIdle1.SetActive(value: false); - PackEffectTap1.SetActive(value: true); - if (_isCoutainSpecialCard) - { - PackEffectSpecial1.SetActive(value: false); - PackEffectSpecial2.SetActive(value: true); - } - iTween.Stop(DarkSideTex.gameObject); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(_seNameGachaOpen, "se_gacha", 0f, 0L); - TouchObj.gameObject.SetActive(value: false); - Invoke("RunGachaAnim", 1f); - break; - case 4: - GachaBoxAnim[GachaBoxAnim.clip.name].speed = 1f; - GachaBoxAnim.Play(); - PackEffectShine1.SetActive(value: true); - iTween.ScaleTo(DarkSideTex.gameObject, iTween.Hash("scale", Vector3.one * 1.5f, "time", 1f, "delay", 2.5f, "easetype", iTween.EaseType.easeInOutExpo)); - Invoke("RunGachaAnim", 3.5f); - break; - case 5: - { - for (int num2 = 0; num2 < m_CardPackList.Count; num2++) - { - if (!(m_CardPackList[num2] == null)) - { - m_CardPackList[num2].transform.localPosition = Vector3.back * 200f; - m_CardPackList[num2].transform.localRotation = Quaternion.Euler(Vector3.up * 180f); - m_CardPackList[num2].SetActive(value: true); - } - } - if (m_CardPackList.Count <= 8) - { - iTween.MoveTo(GachaCamera.gameObject, iTween.Hash("position", POSITION_CARDVIEW_CAMERA, "time", 2.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(GachaCamera.gameObject, iTween.Hash("rotation", Vector3.zero, "time", 2.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - TweenAlpha.Begin(DarkSideTex.gameObject, 2.5f, 0f); - TweenAlpha.Begin(BgBlackTex.gameObject, 2.5f, 0.8f); - iTween.RotateTo(GachaLight, iTween.Hash("x", -45f, "y", 0f, "time", 2.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - SetCardAnimList(); - if (_isAutoOpen) - { - SetCardPosResult(); - for (int num3 = 0; num3 < m_CardAnimList.Count; num3++) - { - StartCoroutine(AlignCardFirst(num3)); - } - animCnt = 7; - Invoke("OpenCardAuto", 1.5f); - } - else - { - SetCardPosFirst(); - for (int num4 = 0; num4 < m_CardAnimList.Count; num4++) - { - StartCoroutine(AlignCardFirst(num4)); - } - } - float time = 0.1f; - float time2 = 1.6f; - if (m_CardPackList.Count <= 8) - { - time = 1.1f; - time2 = 2.6f; - } - else if (_isAutoOpen) - { - for (int num5 = 0; num5 < m_CardAnimList.Count; num5++) - { - int idx2 = m_CardAnimList[num5].GetComponent().m_Idx; - if (m_NameLabelList[idx2] != null) - { - m_NameLabelList[idx2].SetActive(value: true); - } - } - } - Invoke("drawSound", time); - Invoke("RunGachaAnim", time2); - m_openCardQueue.Clear(); - break; - } - case 6: - mousePosPrev = Vector3.zero; - _isNextCardAnim = false; - LabelPackNum.gameObject.SetActive(value: true); - m_CardOpenList.Clear(); - m_EfcMgrIns.Start(EffectMgr.EffectType.CMN_GACHA_CURSOR_1, new Vector3(30f, 0f, -1.5f)); - StartCoroutine("OpenCardList_Coroutine"); - break; - case 7: - SetCardPosResult(); - AlignCard(0.5f, 0.5f); - Invoke("RunGachaAnim", 1.1f); - break; - case 8: - _isNextCardAnim = false; - SetClanLabels(flg: true); - if (currentCnt < cardPackSize) - { - StartCoroutine(loadNextPage(null)); - } - if (_isAutoOpen) - { - for (int num = 0; num < m_CardAnimList.Count; num++) - { - int idx = m_CardAnimList[num].GetComponent().m_Idx; - if (m_LifeIconList[idx] != null) - { - m_LifeIconList[idx].SetActive(value: true); - } - if (m_AtkIconList[idx] != null) - { - m_AtkIconList[idx].SetActive(value: true); - } - if (m_CostIconList[idx] != null) - { - m_CostIconList[idx].SetActive(value: true); - } - if (m_NameLabelList[idx] != null) - { - m_NameLabelList[idx].SetActive(value: true); - } - } - LabelPackNum.gameObject.SetActive(value: true); - } - OkBtn.isEnabled = true; - break; - case 9: - _isNextCardAnim = true; - SetClanLabels(flg: false); - OkBtn.isEnabled = false; - HideCard(); - RunGachaAnim(); - break; - case 10: - StartCoroutine(WaitForCreateCards(delegate - { - animCnt = 4; - RunGachaAnim(); - UIManager.GetInstance().closeInSceneCenterLoading(); - }, isCenterLoading: true)); - break; - } - } - - private void SetCardAnimList() - { - foreach (GameObject cardAnim in m_CardAnimList) - { - UnityEngine.Object.Destroy(cardAnim); - } - m_CardAnimList.Clear(); - for (int i = 0; i < currentCnt; i++) - { - m_CardPackList[i] = null; - } - for (int j = 0; j < m_CardPackList.Count; j++) - { - if (m_CardAnimList.Count >= 8) - { - break; - } - if (currentCnt >= m_CardPackList.Count) - { - break; - } - m_CardAnimList.Add(m_CardPackList[currentCnt]); - currentCnt++; - } - } - - private void CheckPressCardOpen() - { - Vector3 mousePosition = Input.mousePosition; - if (mousePosPrev != Vector3.zero) - { - Vector3 vector = (mousePosition - mousePosPrev) / 10f; - for (int i = 1; i <= 10; i++) - { - RaycastHit[] array = Physics.RaycastAll(GachaCamera.ScreenPointToRay(vector * i + mousePosPrev)); - for (int j = 0; j < array.Length; j++) - { - SetOpenCardQueue(array[j].collider.transform.parent.gameObject); - } - } - } - else - { - RaycastHit[] array = Physics.RaycastAll(GachaCamera.ScreenPointToRay(mousePosition)); - for (int k = 0; k < array.Length; k++) - { - SetOpenCardQueue(array[k].collider.transform.parent.gameObject); - } - } - } - - private void SetOpenCardQueue(GameObject obj) - { - if (obj.CompareTag("Card") && !m_openCardQueue.Contains(obj) && !IsOpenedCard(obj)) - { - m_openCardQueue.Enqueue(obj); - } - } - - private IEnumerator OpenCardList_Coroutine() - { - while (animCnt == 6) - { - if (m_openCardQueue.Count > 0) - { - OpenCard(m_openCardQueue.Dequeue()); - yield return new WaitForSeconds(0.05f); - } - else - { - yield return null; - } - } - } - - private void AppearCardComplete(int cnt) - { - m_CardPackList[cnt].SetActive(value: false); - } - - private bool IsOpenedCard(GameObject obj) - { - for (int i = 0; i < m_CardOpenList.Count; i++) - { - if (m_CardOpenList[i] == obj.GetComponent().m_Idx) - { - return true; - } - } - return false; - } - - private void OpenCard(GameObject obj) - { - if (!IsOpenedCard(obj)) - { - m_EfcMgrIns.Stop(EffectMgr.EffectType.CMN_GACHA_CURSOR_1); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GACHA_COMMON); - float num = 0f; - int idx = obj.GetComponent().m_Idx; - switch (m_RarityList[idx]) - { - case 1: - num = 0.3f; - iTween.MoveTo(obj, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.95f + 30f, "y", obj.transform.position.y * 0.95f, "z", obj.transform.position.z - 0.5f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - break; - case 2: - { - GameMgr.GetIns().GetSoundMgr().StopSe(Se.TYPE.SYS_GACHA_COMMON); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GACHA_RARE); - num = 0.3f; - GameObject gameObjIns = m_EfcMgrIns.Start(EffectMgr.EffectType.CMN_GACHA_OPEN_2, obj.transform.position).GetGameObjIns(); - iTween.MoveTo(obj, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.9f + 30f, "y", obj.transform.position.y * 0.9f, "z", obj.transform.position.z - 1f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(gameObjIns, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.9f + 30f, "y", obj.transform.position.y * 0.9f, "z", obj.transform.position.z - 1f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - break; - } - case 3: - { - GameMgr.GetIns().GetSoundMgr().StopSe(Se.TYPE.SYS_GACHA_COMMON); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GACHA_EPIC); - num = 0.5f; - GameObject gameObjIns = m_EfcMgrIns.Start(EffectMgr.EffectType.CMN_GACHA_OPEN_3, obj.transform.position).GetGameObjIns(); - iTween.MoveTo(obj, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.5f + 30f, "y", obj.transform.position.y * 0.5f, "z", obj.transform.position.z - 4f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(gameObjIns, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.5f + 30f, "y", obj.transform.position.y * 0.5f, "z", obj.transform.position.z - 4f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ShakePosition(GachaCamera.gameObject, iTween.Hash("amount", Vector3.one * 0.1f, "time", num, "oncomplete", "InitCameraPos", "oncompletetarget", base.gameObject)); - break; - } - case 4: - { - GameMgr.GetIns().GetSoundMgr().StopSe(Se.TYPE.SYS_GACHA_COMMON); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GACHA_LEGEND); - num = 0.7f; - GameObject gameObjIns = m_EfcMgrIns.Start(EffectMgr.EffectType.CMN_GACHA_OPEN_4, obj.transform.position).GetGameObjIns(); - iTween.MoveTo(obj, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.25f + 30f, "y", obj.transform.position.y * 0.25f, "z", obj.transform.position.z - 6f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(gameObjIns, iTween.Hash("x", (obj.transform.position.x - 30f) * 0.25f + 30f, "y", obj.transform.position.y * 0.25f, "z", obj.transform.position.z - 6f, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ShakePosition(GachaCamera.gameObject, iTween.Hash("amount", Vector3.one * 0.2f, "time", num, "oncomplete", "InitCameraPos", "oncompletetarget", base.gameObject)); - break; - } - } - iTween.MoveTo(obj, iTween.Hash("position", obj.transform.position, "time", num, "delay", num, "easetype", iTween.EaseType.easeInExpo)); - float num2 = ((CardBefore != null) ? ((!(obj.transform.localPosition.x > CardBefore.transform.localPosition.x)) ? 180f : (-180f)) : ((!(obj.transform.localPosition.x - 9600f < 0f)) ? 180f : (-180f))); - iTween.RotateAdd(obj, iTween.Hash("y", num2, "time", num, "easetype", iTween.EaseType.easeOutExpo)); - CardBefore = obj; - m_CardOpenList.Add(idx); - if (m_CardOpenList.Count >= m_CardAnimList.Count) - { - Invoke("RunGachaAnim", 2f); - } - OpenCardSetting(obj); - } - } - - private void InitCameraPos() - { - GachaCamera.transform.localPosition = POSITION_CARDVIEW_CAMERA; - } - - private void OpenCardSetting(GameObject obj) - { - int idx = obj.GetComponent().m_Idx; - if (m_RarityList[idx] > 1) - { - obj.transform.Find("cmn_gacha_stay").gameObject.SetActive(value: true); - } - if (_isSpecialCardPackSet) - { - obj.transform.Find("cmn_gacha_special")?.gameObject.SetActive(value: false); - } - m_CostIconList[idx].SetActive(value: true); - if (m_LifeIconList[idx] != null) - { - m_LifeIconList[idx].SetActive(value: true); - } - if (m_AtkIconList[idx] != null) - { - m_AtkIconList[idx].SetActive(value: true); - } - if (m_NameLabelList[idx] != null) - { - m_NameLabelList[idx].SetActive(value: true); - } - } - - private void OpenCardAuto() - { - if (!_isDispose) - { - for (int i = 0; i < m_CardAnimList.Count; i++) - { - OpenCardSetting(m_CardAnimList[i]); - } - } - } - - private IEnumerator AlignCardFirst(int idx) - { - iTween.Stop(m_CardAnimList[idx]); - yield return new WaitForSeconds((float)idx / ((float)m_CardAnimList.Count - 1f) * 0.5f); - if (_isDispose) - { - yield break; - } - if (m_CardPackList.Count <= 8) - { - iTween.MoveTo(m_CardAnimList[idx], iTween.Hash("z", -1000f, "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (_isDispose) - { - yield break; - } - } - else - { - m_CardAnimList[idx].transform.localPosition += Vector3.back * 1000f; - } - m_CardAnimList[idx].transform.Find("cmn_gacha_move").gameObject.SetActive(value: true); - iTween.MoveTo(m_CardAnimList[idx], iTween.Hash("position", m_CardPosList[idx], "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(m_CardAnimList[idx], iTween.Hash("rotation", m_CardRotList[idx], "time", 1f, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void drawSound() - { - if (currentCnt != 8) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GACHA_CARD_IN); - } - } - - private void AlignCard(float time, float delay) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GACHA_MOVE); - for (int i = 0; i < m_CardAnimList.Count; i++) - { - iTween.MoveTo(m_CardAnimList[i], iTween.Hash("position", m_CardPosList[i], "time", time, "delay", (float)i / ((float)m_CardAnimList.Count - 1f) * delay, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(m_CardAnimList[i], iTween.Hash("rotation", m_CardRotList[i], "time", time, "delay", (float)i / ((float)m_CardAnimList.Count - 1f) * delay, "easetype", iTween.EaseType.easeOutExpo)); - } - } - - private void HideCard() - { - m_IsHideCardFinish = false; - for (int i = 0; i < m_CardAnimList.Count; i++) - { - iTween.MoveTo(m_CardAnimList[i], iTween.Hash("x", 14400f, "time", 0.3f, "delay", (float)i / ((float)m_CardAnimList.Count - 1f) * 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - } - Invoke("HideCardFinish", 0.6f); - } - - private void HideCardFinish() - { - m_IsHideCardFinish = true; - } - - private void SetCardPosFirst() - { - m_CardPosList.Clear(); - m_CardRotList.Clear(); - for (int i = 0; i < m_CardAnimList.Count; i++) - { - float num = (float)i / ((float)m_CardAnimList.Count - 1f); - float num2 = ((!(num < 0.5f)) ? (MotionUtils.GetEase(num * 2f - 1f, MotionUtils.EaseType.easeInQuad) * 0.5f + 0.5f) : (MotionUtils.GetEase(num * 2f, MotionUtils.EaseType.easeOutQuad) * 0.5f)); - Vector3 item = new Vector3(num * 4000f - 2000f + 9600f, Mathf.Abs(num2 - 0.5f) * -500f + 250f, (float)i * -10f - 100f); - Vector3 item2 = new Vector3(0f, -185f, num * 10f - 5f); - m_CardPosList.Add(item); - m_CardRotList.Add(item2); - } - } - - private void SetCardPosResult() - { - float num = 5000f; - float num2 = 2800f; - m_CardPosList.Clear(); - m_CardRotList.Clear(); - int num3 = ((m_CardAnimList.Count <= 5) ? m_CardAnimList.Count : ((int)Mathf.Ceil((float)m_CardAnimList.Count / 2f))); - int num4 = (int)Mathf.Ceil((float)m_CardAnimList.Count / (float)num3); - for (int i = 0; i < m_CardAnimList.Count; i++) - { - int num5 = ((i >= m_CardAnimList.Count - m_CardAnimList.Count % num3) ? (m_CardAnimList.Count % num3) : num3); - float num6 = num / (float)num5; - float num7 = num2 / (float)num4; - float x = (float)(i % num3) * num6 + num6 / 2f - num / 2f + 9600f; - float y = Mathf.Floor((float)i / (float)num3) * (0f - num7) - num7 / 2f + num2 / 2f + 220f; - m_CardPosList.Add(new Vector3(x, y, -100f)); - m_CardRotList.Add(Vector3.zero); - } - } - - private void SetLabelPackOpenCount() - { - LabelPackNum.text = packOpenCnt + "/" + cardPackNum; - } - - private void SetClanLabels(bool flg) - { - } -} +using System; +using UnityEngine; +using Cute; +using Wizard; + +// PASS-8/Phase-1 STUB: 1,055-line card-pack-open animation controller. Held as +// `GachaUI._cardPackManager` field but never constructed anywhere. Nested type +// `GachaMaskDark` is referenced from Wizard/Master.cs (`Dictionary GachaMaskDarkDic`) — kept as-is (CSV parser for pack mask data; +// small and self-contained). Everything else stripped. +public class CardPackManager : MonoBehaviour +{ + public bool IsSkipped { get; private set; } + + public void Init(bool isAutoOpen, CardDetailUI cardDetail, UIManager.ViewScene nextScene, bool isCoutainSpecialCard, Action callback) { } + public void StartInstantiateCardPack(PackConfig packConfig) { } + + public class GachaMaskDark + { + public int PackId; + public Rect UvRect; + public Color Color; + + public GachaMaskDark(string[] columns) + { + int num = 0; + PackId = int.Parse(columns[num]); + num++; + UvRect = new Rect(float.Parse(columns[num]), float.Parse(columns[num + 1]), float.Parse(columns[num + 2]), float.Parse(columns[num + 3])); + num += 4; + Color = new Color(float.Parse(columns[num]), float.Parse(columns[num + 1]), float.Parse(columns[num + 2]), float.Parse(columns[num + 3])); + } + } +} diff --git a/SVSim.BattleEngine/Engine/CardPanelMaintenancePlate.cs b/SVSim.BattleEngine/Engine/CardPanelMaintenancePlate.cs index 52d71523..294fbc46 100644 --- a/SVSim.BattleEngine/Engine/CardPanelMaintenancePlate.cs +++ b/SVSim.BattleEngine/Engine/CardPanelMaintenancePlate.cs @@ -13,9 +13,4 @@ public class CardPanelMaintenancePlate : MonoBehaviour _sprite.depth = depth; _label.depth = depth + 1; } - - public void SetText(string text) - { - _label.text = text; - } } diff --git a/SVSim.BattleEngine/Engine/CardSelectListUI_Positioning.cs b/SVSim.BattleEngine/Engine/CardSelectListUI_Positioning.cs index 6b12e546..9c914ca0 100644 --- a/SVSim.BattleEngine/Engine/CardSelectListUI_Positioning.cs +++ b/SVSim.BattleEngine/Engine/CardSelectListUI_Positioning.cs @@ -42,45 +42,6 @@ public class CardSelectListUI_Positioning : MonoBehaviour } } - public Vector3 LineDirection - { - get - { - return m_lineDirection; - } - set - { - m_lineDirection = value; - StartAnim(); - } - } - - public float LineWidth - { - get - { - return m_lineWidth; - } - set - { - m_lineWidth = value; - StartAnim(); - } - } - - public Vector3 BreakDirection - { - get - { - return m_breakDirection; - } - set - { - m_breakDirection = value; - StartAnim(); - } - } - public float BreakWidth { get @@ -94,19 +55,6 @@ public class CardSelectListUI_Positioning : MonoBehaviour } } - public int BreakNum - { - get - { - return (int)m_breakNum; - } - set - { - m_breakNum = value; - StartAnim(); - } - } - public float Speed { get @@ -183,11 +131,6 @@ public class CardSelectListUI_Positioning : MonoBehaviour return m_offset + m_lineDirection * num3 + m_breakDirection * num4; } - private void LateUpdate() - { - Update_Anim(); - } - private void Update_Anim() { m_prog += (1f - m_prog) * m_speed; diff --git a/SVSim.BattleEngine/Engine/CardShaderDefine.cs b/SVSim.BattleEngine/Engine/CardShaderDefine.cs index c30e2c66..ba40095b 100644 --- a/SVSim.BattleEngine/Engine/CardShaderDefine.cs +++ b/SVSim.BattleEngine/Engine/CardShaderDefine.cs @@ -3,9 +3,6 @@ using Wizard; public static class CardShaderDefine { - public const string CARD_SHADER_DEFAULT = "Wizard/Card/Basic_Front0_Back0_Normal"; - - public const string CARD_SHADER_FOIL = "Wizard/VariantCardShader"; public static void ReplaceShader(Material mat) { diff --git a/SVSim.BattleEngine/Engine/CardTemplate.cs b/SVSim.BattleEngine/Engine/CardTemplate.cs index c431be27..55331451 100644 --- a/SVSim.BattleEngine/Engine/CardTemplate.cs +++ b/SVSim.BattleEngine/Engine/CardTemplate.cs @@ -11,10 +11,6 @@ public class CardTemplate : MonoBehaviour public LODGroup CardNormalLodGroup; - public MeshRenderer FieldNormalMeshTemp; - - public MeshRenderer FieldEvolMeshTemp; - public MeshRenderer NormalCardBaseMeshTemp; public MeshRenderer EvolCardBaseMeshTemp; @@ -43,20 +39,8 @@ public class CardTemplate : MonoBehaviour public UILabel NormalChoiceBraveNameLabelTemp; - public GameObject FrameEffectNormal; - - public GameObject FrameEffectEvolve; - - public GameObject FrameEffectHandCard; - - public ParticleSystemRenderer[] FrameEffectHandRenderer; - - public GameObject _spellBoostFrameEffect; - public BoxCollider Collider; - public BoxCollider NotCancelCollider; - private bool isPlayer = true; private bool _isChoiceBrave; @@ -134,7 +118,7 @@ public class CardTemplate : MonoBehaviour UIManager.GetInstance().SetLayerRecursive(CardNormalTemp, 10); if (flag2) { - BattleManagerBase.GetIns().BattleResourceMgr.LoadChoiceBraveCardMesh(); + /* Pre-Phase-5b: LoadChoiceBraveCardMesh dropped; headless has no BattleResourceMgr wired here */ MeshFilter[] componentsInChildren = CardNormalTemp.GetComponentsInChildren(); componentsInChildren[0].sharedMesh = resourceMgr.GetChoiceBraveCardMesh(isLow: false); componentsInChildren[1].sharedMesh = resourceMgr.GetChoiceBraveCardMesh(isLow: true); @@ -229,30 +213,6 @@ public class CardTemplate : MonoBehaviour } } - public void ShowNameLabel() - { - if (_isChoiceBrave) - { - NormalChoiceBraveNameLabelTemp.alpha = 1f; - } - else - { - NormalNameLabelTemp.alpha = 1f; - } - } - - public void HideNameLabel() - { - if (_isChoiceBrave) - { - NormalChoiceBraveNameLabelTemp.alpha = 0f; - } - else - { - NormalNameLabelTemp.alpha = 0f; - } - } - public void SetEffectStyle(UILabel.Effect effectStyle) { NormalCostLabelTemp.effectStyle = effectStyle; @@ -310,10 +270,4 @@ public class CardTemplate : MonoBehaviour { Global.SetRepositionNameLabel(isChoiceBrave ? NormalChoiceBraveNameLabelTemp : NormalNameLabelTemp, cardName, is2D: false); } - - public void SetNormalLabelEnable(bool isEnable) - { - NormalNameLabelTemp.enabled = isEnable; - NormalChoiceBraveNameLabelTemp.enabled = isEnable; - } } diff --git a/SVSim.BattleEngine/Engine/CastleField.cs b/SVSim.BattleEngine/Engine/CastleField.cs index a6b09026..1b19b808 100644 --- a/SVSim.BattleEngine/Engine/CastleField.cs +++ b/SVSim.BattleEngine/Engine/CastleField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class CastleField : BackGroundBase { public override int FieldId => 2; @@ -10,173 +11,4 @@ public class CastleField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_ocsl_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles02").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldObjDictionary.Add("coffin", _fieldModel.transform.Find("md_bf_ocsl_01_coffin").gameObject); - _fieldObjDictionary.Add("sword", _fieldModel.transform.Find("md_bf_ocsl_01_sword").gameObject); - _fieldObjDictionary.Add("tapestry_a", _fieldModel.transform.Find("md_bf_ocsl_01_tapestry_a").gameObject); - _fieldObjDictionary.Add("tapestry_b", _fieldModel.transform.Find("md_bf_ocsl_01_tapestry_b").gameObject); - _fieldObjDictionary.Add("chain_a", _fieldModel.transform.Find("md_bf_ocsl_01_chain_a").gameObject); - _fieldObjDictionary.Add("chain_b", _fieldModel.transform.Find("md_bf_ocsl_01_chain_b").gameObject); - _fieldObjDictionary.Add("chain_c", _fieldModel.transform.Find("md_bf_ocsl_01_chain_c").gameObject); - _fieldObjDictionary.Add("chain_d", _fieldModel.transform.Find("md_bf_ocsl_01_chain_d").gameObject); - _fieldObjDictionary.Add("chain_e", _fieldModel.transform.Find("md_bf_ocsl_01_chain_e").gameObject); - _fieldObjDictionary.Add("grate", _fieldModel.transform.Find("md_bf_ocsl_01_grate").gameObject); - m_FieldAnimatorDictionary.Add("coffin", _fieldObjDictionary["coffin"].GetComponent()); - m_FieldAnimatorDictionary.Add("sword", _fieldObjDictionary["sword"].GetComponent()); - m_FieldAnimatorDictionary.Add("tapestry_a", _fieldObjDictionary["tapestry_a"].GetComponent()); - m_FieldAnimatorDictionary.Add("tapestry_b", _fieldObjDictionary["tapestry_b"].GetComponent()); - m_FieldAnimatorDictionary.Add("chain_a", _fieldObjDictionary["chain_a"].GetComponent()); - m_FieldAnimatorDictionary.Add("chain_b", _fieldObjDictionary["chain_b"].GetComponent()); - m_FieldAnimatorDictionary.Add("chain_c", _fieldObjDictionary["chain_c"].GetComponent()); - m_FieldAnimatorDictionary.Add("chain_d", _fieldObjDictionary["chain_d"].GetComponent()); - m_FieldAnimatorDictionary.Add("chain_e", _fieldObjDictionary["chain_e"].GetComponent()); - m_FieldAnimatorDictionary.Add("grate", _fieldObjDictionary["grate"].GetComponent()); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("coffin_open", _fieldParticles.transform.Find("coffin_open").GetComponent()); - _fieldParticleSystemDictionary.Add("coffin_close", _fieldParticles.transform.Find("coffin_close").GetComponent()); - _fieldParticleSystemDictionary.Add("coffin_gimic_1", _fieldParticles.transform.Find("coffin_gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("coffin_gimic_2", _fieldParticles.transform.Find("coffin_gimic_2").GetComponent()); - _fieldParticleSystemDictionary.Add("fog", _fieldParticles.transform.Find("fog").GetComponent()); - _fieldParticleSystemDictionary.Add("candle", _fieldParticles.transform.Find("candle").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_2, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_2_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["tapestry_a"].speed = 0.4f + Random.value * 0.2f; - m_FieldAnimatorDictionary["tapestry_b"].speed = 0.4f + Random.value * 0.2f; - _fieldParticleSystemDictionary["opening"].Play(); - _fieldParticleSystemDictionary["fog"].gameObject.SetActive(value: false); - _fieldParticleSystemDictionary["candle"].gameObject.SetActive(value: false); - m_RandomActionTime = 20f; - _battleCamera.Camera.transform.localPosition = new Vector3(2550f, -830f, -200f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-19f, -90f, 90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(2550f, -830f, -200f), new Vector3(840f, -250f, -200f), new Vector3(-240f, -190f, -70f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-37f, -117f, 107f), "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(0.6f); - m_FieldAnimatorDictionary["grate"].SetTrigger("Open"); - _fieldParticleSystemDictionary["candle"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(1.4f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - m_FieldAnimatorDictionary["grate"].SetTrigger("Close"); - _fieldParticleSystemDictionary["fog"].gameObject.SetActive(value: true); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{num}", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 1: - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[0], "se_field_" + _str3DFieldNo, 0f, 0L); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[1], "se_field_" + _str3DFieldNo, 0f, 0L); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[2], "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["coffin"].SetTrigger("Open"); - m_FieldAnimatorDictionary["sword"].SetTrigger("Open"); - _fieldParticleSystemDictionary["coffin_open"].Play(); - yield return new WaitForSeconds(1.5f); - _fieldParticleSystemDictionary["coffin_gimic_1"].Play(); - yield return new WaitForSeconds(2.5f); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[4], "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["coffin"].SetTrigger("Close"); - yield return new WaitForSeconds(1f); - m_FieldAnimatorDictionary["sword"].SetTrigger("Close"); - yield return new WaitForSeconds(1f); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[6], "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["coffin_close"].Play(); - yield return new WaitForSeconds(1f); - break; - case 2: - m_FieldAnimatorDictionary["coffin"].SetTrigger("Act"); - m_FieldAnimatorDictionary["sword"].SetTrigger("Act"); - yield return new WaitForSeconds(0.5f); - break; - } - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[5], "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag] = 0; - } - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["chain_a"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["chain_b"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["chain_c"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["chain_d"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["chain_e"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["chain_a"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["chain_b"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["chain_c"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["chain_d"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["chain_e"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["tapestry_a"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["tapestry_b"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["tapestry_a"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["tapestry_b"].SetTrigger("Shake"); - if (_gimicCntDictionary["FieldGimic1"] == 0) - { - m_FieldAnimatorDictionary["coffin"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["sword"].SetTrigger("Shake"); - } - yield return new WaitForSeconds(3f); - m_FieldAnimatorDictionary["tapestry_a"].speed = 0.4f + Random.value * 0.2f; - m_FieldAnimatorDictionary["tapestry_b"].speed = 0.4f + Random.value * 0.2f; - yield return new WaitForSeconds(0f); - } - - public override void UpdateFieldRandom() - { - if (IsFieldRandom) - { - m_RandomActionTime -= Time.deltaTime; - if (m_RandomActionTime <= 0f) - { - m_FieldAnimatorDictionary["tapestry_a"].SetTrigger("LoopRandom"); - m_FieldAnimatorDictionary["tapestry_b"].SetTrigger("LoopRandom"); - m_RandomActionTime = Random.value * 20f + 20f; - } - } - } } diff --git a/SVSim.BattleEngine/Engine/ChallengeConfig.cs b/SVSim.BattleEngine/Engine/ChallengeConfig.cs deleted file mode 100644 index a9a4246c..00000000 --- a/SVSim.BattleEngine/Engine/ChallengeConfig.cs +++ /dev/null @@ -1,6 +0,0 @@ -public class ChallengeConfig -{ - public bool UseTwoPickPremiumCard { get; set; } - - public long TwoPickSleeveId { get; set; } -} diff --git a/SVSim.BattleEngine/Engine/ChangeAffiliationVfx.cs b/SVSim.BattleEngine/Engine/ChangeAffiliationVfx.cs deleted file mode 100644 index 9fe74404..00000000 --- a/SVSim.BattleEngine/Engine/ChangeAffiliationVfx.cs +++ /dev/null @@ -1,52 +0,0 @@ -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class ChangeAffiliationVfx : SequentialVfxPlayer -{ - private readonly IBattleCardView _view; - - public ChangeAffiliationVfx(BattleCardBase card, CardBasePrm.ClanType clan) - { - ChangeAffiliationVfx changeAffiliationVfx = this; - GameObject effectGameObject = null; - _view = card.BattleCardView; - if ((card.IsPlayer || GameMgr.GetIns().IsAdminWatch || !card.IsInHand) && clan != CardBasePrm.ClanType.NONE) - { - Register(new WaitLoadEffectAndSetSeVfx("cmn_card_classchange_1", "se_cmn_card_classchange_1", delegate(GameObject e) - { - effectGameObject = e; - })); - Register(new PlayEffectAndSeVfx(delegate - { - effectGameObject.GetComponent().ChangeParticleColor(changeAffiliationVfx.GetClanColor(clan)); - return effectGameObject; - }, _view.Transform)); - Register(WaitVfx.Create(0.3f)); - } - } - - private VfxBase ChangeEffectColor(Effect effect, Color color) - { - return InstantVfx.Create(delegate - { - effect.ChangeParticleColor(color); - }); - } - - private Color GetClanColor(CardBasePrm.ClanType clan) - { - return clan switch - { - CardBasePrm.ClanType.ALL => Color.white, - CardBasePrm.ClanType.MIN => new Color(0.2f, 1f, 0.8f), - CardBasePrm.ClanType.ROYAL => new Color(1f, 0.9f, 0.5f), - CardBasePrm.ClanType.WITCH => new Color(0.7f, 0.5f, 1f), - CardBasePrm.ClanType.DRAGON => new Color(1f, 0.5f, 0f), - CardBasePrm.ClanType.NECRO => new Color(0.5f, 0.4f, 1f), - CardBasePrm.ClanType.VAMPIRE => new Color(1f, 0.2f, 0.2f), - CardBasePrm.ClanType.BISHOP => new Color(0.5f, 0.7f, 1f), - _ => Color.white, - }; - } -} diff --git a/SVSim.BattleEngine/Engine/ChantFieldBattleCard.cs b/SVSim.BattleEngine/Engine/ChantFieldBattleCard.cs index f7a6496f..4c94ecb9 100644 --- a/SVSim.BattleEngine/Engine/ChantFieldBattleCard.cs +++ b/SVSim.BattleEngine/Engine/ChantFieldBattleCard.cs @@ -35,7 +35,7 @@ public class ChantFieldBattleCard : FieldBattleCard { ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); parallelVfxPlayer.Register(base.SetUpInplay()); - parallelVfxPlayer.Register(new ShowChantCountVfx(this, base.ChantCount, base.SelfBattlePlayer.BattleMgr.BattleResourceMgr)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); return parallelVfxPlayer; } @@ -76,7 +76,7 @@ public class ChantFieldBattleCard : FieldBattleCard public override VfxBase RecoveryInPlay(int inPlayIndex, bool newReplayMoveTurn = false) { - return ParallelVfxPlayer.Create(base.RecoveryInPlay(inPlayIndex, newReplayMoveTurn), new ShowChantCountVfx(this, base.ChantCount, _buildInfo.ResourceMgr)); + return ParallelVfxPlayer.Create(base.RecoveryInPlay(inPlayIndex, newReplayMoveTurn), NullVfx.GetInstance()); } public override BattleCardBase VirtualClone(BattlePlayerBase virtualSelfBattlePlayer, BattlePlayerBase virtualOpponentBattlePlayer) diff --git a/SVSim.BattleEngine/Engine/ChapterExtraData.cs b/SVSim.BattleEngine/Engine/ChapterExtraData.cs index e3b6e7d2..e8fa4d5a 100644 --- a/SVSim.BattleEngine/Engine/ChapterExtraData.cs +++ b/SVSim.BattleEngine/Engine/ChapterExtraData.cs @@ -23,7 +23,7 @@ public class ChapterExtraData public GameObject ExtraEffect { get; set; } - public Se.TYPE SeType { get; set; } + public int SeType { get; set; } public float ChapterMoveTime { get; set; } = 1.5f; @@ -31,7 +31,7 @@ public class ChapterExtraData public GameObject FirstClearEffect { get; set; } - public Se.TYPE FirstClearSeType { get; set; } + public int FirstClearSeType { get; set; } public float FirstClearEffectDelayTime { get; set; } diff --git a/SVSim.BattleEngine/Engine/CharIdx.cs b/SVSim.BattleEngine/Engine/CharIdx.cs index b9193b30..7a9a6edb 100644 --- a/SVSim.BattleEngine/Engine/CharIdx.cs +++ b/SVSim.BattleEngine/Engine/CharIdx.cs @@ -2,20 +2,9 @@ using UnityEngine; public class CharIdx : MonoBehaviour { - public int m_Idx { get; protected set; } public int m_CardId { get; protected set; } - public void SetIdx(int idx) - { - m_Idx = idx; - } - - public int GetIdx() - { - return m_Idx; - } - public void SetCardId(int cardid) { m_CardId = cardid; diff --git a/SVSim.BattleEngine/Engine/Charactor3dInformation.cs b/SVSim.BattleEngine/Engine/Charactor3dInformation.cs deleted file mode 100644 index 92476f9e..00000000 --- a/SVSim.BattleEngine/Engine/Charactor3dInformation.cs +++ /dev/null @@ -1,430 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.Player.ClassCharacter; - -public class Charactor3dInformation : MonoBehaviour -{ - public GameObject[] Meshes; - - public Material[] Materials; - - public Animator[] Animators; - - public Transform[] LeftEyeInfoObject; - - public Transform[] RightEyeInfoObject; - - public Effect3dInformation EffectInfo; - - public Transform BodyNeck; - - public Transform FaceNeck; - - public Transform BodyHead; - - public Transform FaceHead; - - public Transform BodyHip; - - public Transform TailHip; - - public Transform BodyProp; - - public Transform PropProp; - - public GameObject Prop; - - public Transform HeadAttach; - - public Transform HeadCenterOffset; - - public Transform HeadTubeCenterOffset; - - public Transform HeadAttachR; - - public Transform HeadAttachL; - - private Material EyeMaterial; - - private Material FaceSkinMaterial; - - private Material HairMaterial; - - private Material BodyMaterial; - - public GameObject Quad; - - private string _oldMotion = ""; - - private Class3dCharacterBase _characterBase; - - private string _characterId = ""; - - private bool _isInitialized; - - private bool _isLoadMesh; - - private bool _isLoadedMesh; - - public bool IsTestScene; - - private List _meshList = new List(); - - private Class3dPostImageEffect _postEffect; - - private void Start() - { - string text = base.name; - text = text.Replace("chr", ""); - _characterId = text.Replace("(Clone)", ""); - if (Prop != null) - { - Prop.SetActive(value: true); - } - if (!IsTestScene) - { - _isLoadMesh = true; - } - } - - private void Update() - { - if ((_isLoadedMesh && !_isInitialized) || (IsTestScene && !_isInitialized)) - { - Initialize(); - _isInitialized = true; - } - if (_isLoadMesh && !_isLoadedMesh) - { - InitializeMesh(_characterBase, _postEffect); - _isLoadedMesh = true; - } - if (EyeMaterial != null) - { - Vector4[] values = new Vector4[3] - { - new Vector4(LeftEyeInfoObject[0].localPosition.x, LeftEyeInfoObject[0].localPosition.y, LeftEyeInfoObject[0].localPosition.z, LeftEyeInfoObject[0].localScale.x), - new Vector4(LeftEyeInfoObject[1].localPosition.x, LeftEyeInfoObject[1].localPosition.y, LeftEyeInfoObject[1].localPosition.z, LeftEyeInfoObject[1].localScale.x), - new Vector4(LeftEyeInfoObject[2].localPosition.x, LeftEyeInfoObject[2].localPosition.y, LeftEyeInfoObject[2].localPosition.z, LeftEyeInfoObject[2].localScale.x) - }; - EyeMaterial.SetVectorArray("_HighParam1", values); - Vector4[] values2 = new Vector4[2] - { - new Vector4(RightEyeInfoObject[0].localPosition.x, RightEyeInfoObject[0].localPosition.y, RightEyeInfoObject[0].localPosition.z, RightEyeInfoObject[0].localScale.x), - new Vector4(RightEyeInfoObject[1].localPosition.x, RightEyeInfoObject[1].localPosition.y, RightEyeInfoObject[1].localPosition.z, RightEyeInfoObject[1].localScale.x) - }; - EyeMaterial.SetVectorArray("_HighParam2", values2); - } - } - - private void Initialize() - { - SkinnedMeshRenderer[] componentsInChildren = GetComponentsInChildren(); - MeshRenderer meshRenderer = null; - if (Prop != null) - { - MeshRenderer[] componentsInChildren2 = Prop.GetComponentsInChildren(); - if (componentsInChildren2.Length != 0) - { - meshRenderer = componentsInChildren2[0]; - } - } - int num = 0; - SkinnedMeshRenderer[] array = componentsInChildren; - for (int i = 0; i < array.Length; i++) - { - Material[] materials = array[i].materials; - num += materials.Length; - } - num += ((meshRenderer != null) ? 1 : 0); - Materials = new Material[num]; - int num2 = 0; - array = componentsInChildren; - foreach (SkinnedMeshRenderer skinnedMeshRenderer in array) - { - Material[] materials2 = skinnedMeshRenderer.materials; - for (int j = 0; j < materials2.Length; j++) - { - skinnedMeshRenderer.sharedMaterials[j].shader = Shader.Find(materials2[j].shader.name); - Materials[num2] = skinnedMeshRenderer.sharedMaterials[j]; - if (skinnedMeshRenderer.sharedMaterials[j].name.Contains("face")) - { - FaceSkinMaterial = skinnedMeshRenderer.sharedMaterials[j]; - } - if (skinnedMeshRenderer.sharedMaterials[j].name.Contains("hair")) - { - HairMaterial = skinnedMeshRenderer.sharedMaterials[j]; - } - if (skinnedMeshRenderer.sharedMaterials[j].name.Contains("eye")) - { - EyeMaterial = skinnedMeshRenderer.sharedMaterials[j]; - } - if (skinnedMeshRenderer.sharedMaterials[j].name.Contains("bdy")) - { - BodyMaterial = skinnedMeshRenderer.sharedMaterials[j]; - } - num2++; - } - } - if (meshRenderer != null) - { - meshRenderer.sharedMaterial.shader = Shader.Find(meshRenderer.sharedMaterial.shader.name); - Materials[num2] = meshRenderer.sharedMaterial; - } - InitializeMaterials(); - EffectInfo = GetComponent(); - if (Prop != null) - { - Prop.SetActive(value: false); - } - } - - public void OnApplicationFocus(bool focus) - { - if (focus) - { - InitializeMaterials(); - } - } - - public void InitializeMaterials() - { - Material[] materials = Materials; - foreach (Material material in materials) - { - if (!(material == null)) - { - material.SetColor("_GlobalToonColor", Color.white); - material.SetColor("_GlobalRimColor", Color.white); - material.SetFloat("_GlobalOutlineWidth", 1f); - material.SetFloat("_GlobalOutlineOffset", 1f); - material.SetColor("_Global_FogColor", new Color(0.76f, 1f, 1f, 1f)); - material.SetVector("_Global_FogMinDistance", Vector4.zero); - material.SetVector("_Global_FogLength", new Vector4(1000f, 1000f, 1000f, 1000f)); - material.SetInt("_Global_MaxDensity", 1); - material.SetFloat("_Global_MaxHeight", 100f); - material.SetVector("_Global_FogWorld_Origin", Vector4.zero); - material.SetColor("_LightColorWizard", Color.white); - material.SetFloat("_RimStep", 0.5f); - material.SetFloat("_RimStep2", 0.1f); - material.SetFloat("_RimSpecRate", 0.5f); - } - } - } - - private void LateUpdate() - { - AnimatorClipInfo[] currentAnimatorClipInfo = Animators[0].GetCurrentAnimatorClipInfo(0); - if (currentAnimatorClipInfo != null && currentAnimatorClipInfo.Length != 0) - { - string text = currentAnimatorClipInfo[0].clip.name; - foreach (ClassCharaPrm.MotionType value5 in Enum.GetValues(typeof(ClassCharaPrm.MotionType))) - { - if (text.Contains(value5.ToString())) - { - if (EffectInfo != null) - { - EffectInfo.UpdateInfo(value5); - } - break; - } - } - Vector3 localScale = HeadAttach.localScale; - Color value = new Color(localScale.x, localScale.y, localScale.z); - Vector3 vector = HeadAttach.localRotation * Vector3.up; - Material[] materials = Materials; - foreach (Material material in materials) - { - if (!(material == null)) - { - material.SetColor("_CharaColor", value); - material.SetVector("_WorldSpaceLightPosWizard", vector); - } - } - string value2 = ClassCharaPrm.MotionType.extra.ToString(); - if (_characterBase != null && _characterBase.IsPlayer) - { - if (text.Equals(value2) && !_oldMotion.Equals(value2)) - { - _characterBase.EnableEvolve(enable: true); - } - else if (!text.Equals(value2) && _oldMotion.Equals(value2)) - { - _characterBase.EnableEvolve(enable: false); - } - } - if (_postEffect != null && text.Equals(value2)) - { - AnimatorStateInfo currentAnimatorStateInfo = Animators[0].GetCurrentAnimatorStateInfo(0); - float num = (float)currentAnimatorClipInfo.Length * currentAnimatorStateInfo.normalizedTime; - int num2 = (int)(85f * num) + 1; - if (_postEffect._param.FadeOutEndFrame <= num2) - { - _postEffect._param.DiffusionThreshold = _postEffect._param.EndDiffusionThreshold; - } - else if (_postEffect._param.FadeOutStartFrame <= num2) - { - float num3 = _postEffect._param.FadeOutEndFrame - _postEffect._param.FadeOutStartFrame; - float t = 0f; - if (num3 > 0f) - { - t = 1f / num3; - } - _postEffect._param.DiffusionThreshold = Mathf.Lerp(_postEffect._param.DiffusionThreshold, _postEffect._param.EndDiffusionThreshold, t); - } - else - { - _postEffect._param.DiffusionThreshold = _postEffect._param.DefaultDiffusionThreshold; - } - } - if (text != _oldMotion && BodyMaterial != null) - { - if (text.Contains(ClassCharaPrm.MotionType.idle.ToString())) - { - BodyMaterial.renderQueue = 1999; - } - if ((_characterId == "3606" && text.Contains("extra_2")) || (_characterId == "3603" && (text.Contains("extra_2") || text.Contains("shock") || text == "positive")) || (_characterId == "3617" && text.Contains("nagative_2_a"))) - { - BodyMaterial.renderQueue = 2001; - } - } - if (Prop != null) - { - if (text.Equals(value2) && !_oldMotion.Equals(value2)) - { - Prop.SetActive(value: true); - } - else if (!text.Equals(value2) && _oldMotion.Equals(value2)) - { - Prop.SetActive(value: false); - } - } - _oldMotion = text; - } - if (HeadCenterOffset != null && FaceSkinMaterial != null) - { - Vector3 forward = BodyHead.forward; - Vector3 up = BodyHead.up; - Vector3 vector2 = BodyHead.position + up * HeadCenterOffset.localPosition.y + forward * HeadCenterOffset.localPosition.z; - Vector3 vector3 = BodyHead.position + forward * HeadTubeCenterOffset.localPosition.z; - FaceSkinMaterial.SetVector("_FaceCenterPos", vector3); - HairMaterial.SetVector("_FaceCenterPos", vector2); - EyeMaterial.SetVector("_FaceCenterPos", vector3); - FaceSkinMaterial.SetVector("_FaceUp", up); - HairMaterial.SetVector("_FaceUp", up); - EyeMaterial.SetVector("_FaceUp", up); - FaceSkinMaterial.SetVector("_FaceForward", forward); - HairMaterial.SetVector("_FaceForward", forward); - EyeMaterial.SetVector("_FaceForward", forward); - if (HeadAttachR != null) - { - Material[] materials = Materials; - foreach (Material material2 in materials) - { - if (!(material2 == null)) - { - Vector3 localPosition = HeadAttachR.localPosition; - material2.SetFloat("_RimStep", localPosition.x); - material2.SetFloat("_RimFeather", localPosition.y); - material2.SetFloat("_RimSpecRate", localPosition.z); - if (material2.HasProperty("_RimColor")) - { - Color color = material2.GetColor("_RimColor"); - Vector3 localScale2 = HeadAttachR.localScale; - Color value3 = new Color(localScale2.x, localScale2.y, localScale2.z, color.a); - material2.SetColor("_RimColor", value3); - } - Vector3 localScale3 = HeadAttachL.localScale; - Color value4 = new Color(localScale3.x, localScale3.y, localScale3.z, 0f); - material2.SetColor("_ToonDarkColor", value4); - } - } - } - } - UpdateTransform(FaceNeck, BodyNeck); - FaceHead.localPosition = BodyHead.localPosition; - FaceHead.localRotation = BodyHead.localRotation; - UpdateTransform(TailHip, BodyHip); - if (Prop != null && Prop.activeSelf && BodyProp != null && PropProp != null) - { - UpdateTransform(PropProp, BodyProp); - } - } - - private void UpdateTransform(Transform face, Transform body) - { - face.position = body.position; - face.localRotation = body.rotation; - } - - public void InitializeMesh(Class3dCharacterBase characterBase = null, Class3dPostImageEffect postEffect = null) - { - _characterBase = characterBase; - _postEffect = postEffect; - Mesh mesh = new Mesh(); - mesh.vertices = new Vector3[4] - { - new Vector3(-0.5f, -0.5f, 0f), - new Vector3(-0.5f, 0.5f, 0f), - new Vector3(0.5f, 0.5f, 0f), - new Vector3(0.5f, -0.5f, 0f) - }; - mesh.triangles = new int[6] { 0, 1, 3, 1, 2, 3 }; - mesh.uv = new Vector2[4] - { - new Vector2(0.65f, 0.39f), - new Vector2(0.65f, 0.69f), - new Vector2(0.35f, 0.69f), - new Vector2(0.35f, 0.39f) - }; - mesh.RecalculateBounds(); - mesh.RecalculateNormals(); - mesh.RecalculateTangents(); - Quad.GetComponent().mesh = mesh; - } - - public void Destroy() - { - if (Materials != null) - { - for (int i = 0; i < Materials.Length; i++) - { - Material material = Materials[i]; - if (!(material == null)) - { - UnityEngine.Object.Destroy(material); - Materials[i] = null; - } - } - Materials = null; - } - if (Quad != null) - { - if (Quad.GetComponent().mesh != null) - { - UnityEngine.Object.Destroy(Quad.GetComponent().mesh); - Quad.GetComponent().mesh = null; - } - MeshRenderer component = Quad.GetComponent(); - if (component != null && component.sharedMaterial != null) - { - RenderTexture renderTexture = component.sharedMaterial.mainTexture as RenderTexture; - component.sharedMaterial.mainTexture = null; - if (renderTexture != null) - { - renderTexture.Release(); - } - UnityEngine.Object.Destroy(component.sharedMaterial); - component.sharedMaterial = null; - } - UnityEngine.Object.Destroy(Quad); - Quad = null; - } - if (_postEffect != null) - { - _postEffect.Destroy(); - _postEffect = null; - } - } -} diff --git a/SVSim.BattleEngine/Engine/ChateauField.cs b/SVSim.BattleEngine/Engine/ChateauField.cs index 9a1119b7..0e6923ba 100644 --- a/SVSim.BattleEngine/Engine/ChateauField.cs +++ b/SVSim.BattleEngine/Engine/ChateauField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class ChateauField : BackGroundBase { public override int FieldId => 6; @@ -10,101 +11,4 @@ public class ChateauField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_hous_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles06").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldObjDictionary.Add("door", _fieldModel.transform.Find("md_bf_hous_01_door").gameObject); - _fieldObjDictionary.Add("shelf_door", _fieldModel.transform.Find("md_bf_hous_01_shelf_door").gameObject); - m_FieldAnimatorDictionary.Add("door", _fieldObjDictionary["door"].GetComponent()); - m_FieldAnimatorDictionary.Add("shelf_door", _fieldObjDictionary["shelf_door"].GetComponent()); - _fieldParticleSystemDictionary.Add("clock_gimic_1", _fieldParticles.transform.Find("clock_gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("clock_gimic_2", _fieldParticles.transform.Find("clock_gimic_2").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_6, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_6_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_6_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["door"].SetTrigger("Open"); - _battleCamera.Camera.transform.localPosition = new Vector3(-870f, -690f, -40f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-37f, 90f, -90f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(10f, -10f, -100f), "time", 1.7f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-35f, 105f, -100f), "time", 1.7f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(0f, -20f, -200f), "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-35f, 10f, -15f), "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{num}", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 1: - _fieldParticleSystemDictionary["clock_gimic_1"].Play(); - yield return new WaitForSeconds(5f); - break; - case 2: - m_FieldAnimatorDictionary["shelf_door"].SetTrigger("Open"); - yield return new WaitForSeconds(0.5f); - _fieldParticleSystemDictionary["clock_gimic_2"].Play(); - yield return new WaitForSeconds(5f); - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Class3dPostImageEffect.cs b/SVSim.BattleEngine/Engine/Class3dPostImageEffect.cs deleted file mode 100644 index 01faea5e..00000000 --- a/SVSim.BattleEngine/Engine/Class3dPostImageEffect.cs +++ /dev/null @@ -1,339 +0,0 @@ -using UnityEngine; - -[ExecuteInEditMode] -public class Class3dPostImageEffect : MonoBehaviour -{ - public int BLOOM_DIVIDER = 4; - - public float BLOOM_WIDTHMOD = 0.5f; - - private const int PASS_FASTBLOOM_DOWNSAMPLE = 1; - - private const int PASS_FASTBLOOM_VERTICALBLUR = 2; - - private const int PASS_FASTBLOOM_HORIZONTALBLUR = 3; - - private const int PASS_POSTDIFFUSIONBLOOM_VERTICALGAUSS = 0; - - private const int PASS_POSTDIFFUSIONBLOOM_HORIZONGAUSS = 1; - - private const int PASS_POSTDIFFUSIONBLOOM_BLOOM = 2; - - private const int PASS_POSTDIFFUSIONBLOOM_OVERLAY1 = 3; - - private const int PASS_POSTDIFFUSIONBLOOM_OVERLAY2 = 5; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_APPLYBG = 0; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_APPLYBGDEBUG = 1; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_COC2ALPHA = 2; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_DOWNSAMPLE = 3; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_FOGBLOOM = 4; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_BLOOMCOLOR = 5; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_VERTICALGAUSS = 6; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_HORIZONGAUSS = 7; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_BLOOM = 8; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_COCBG_RICH = 9; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_COCBGFG = 10; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_OVERLAY1 = 11; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_OVERLAY1_INVERSE = 12; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_OVERLAY2 = 13; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_OVERLAY2_INVERSE = 14; - - private const int PASS_POSTDIFFUSIONDOFBLOOM_COCFG = 15; - - private const float DOF_HEIGHT_BASE_SIZE_HORIZONTAL = 0.0034722222f; - - private const float DOF_HEIGHT_BASE_SIZE_VERTICAL = 0.0010986328f; - - private const float DIVIDE_SCREEN = 1f; - - private const float DOFONEOVERBASESIZE = 0.001953125f; - - private const float DOFBASESIZE = 512f; - - private float _dofWidthOverHeight = 1.25f; - - private float _dofHeightBaseSize = 0.0024414062f; - - private int _rezworkWidth; - - private int _rezworkHeight; - - [SerializeField] - public DofDiffusionBloomOverlayParam _param = new DofDiffusionBloomOverlayParam(); - - [SerializeField] - private Material _postDiffusionBloomMaterial; - - [SerializeField] - private Material _postDiffusionDofBloomMaterial; - - [SerializeField] - private Material _fastBloomMaterial; - - [Header("Antialiasing")] - public bool EnableAntialiasing = true; - - public float edgeThresholdMin = 0.05f; - - public float edgeThreshold = 0.2f; - - public float edgeshilhouette = 4f; - - private Material antialiasingMaterial; - - public void Initialize() - { - _postDiffusionDofBloomMaterial = (_postDiffusionBloomMaterial = new Material(Shader.Find("Class3D/ImageEffects/Rich/PostDiffusionDofBloom_Rich"))); - _fastBloomMaterial = new Material(Shader.Find("Class3D/ImageEffects/FastBloom")); - Shader shader = Shader.Find("Hidden/FXAA III (Console)"); - if (shader != null && shader.isSupported) - { - antialiasingMaterial = new Material(shader); - } - _param.TargetCamera = GetComponent(); - } - - public void Destroy() - { - if (_fastBloomMaterial != null) - { - Object.Destroy(_fastBloomMaterial); - _fastBloomMaterial = null; - } - if (_postDiffusionBloomMaterial != null) - { - Object.Destroy(_postDiffusionBloomMaterial); - _postDiffusionBloomMaterial = null; - } - if (_postDiffusionDofBloomMaterial != null) - { - Object.Destroy(_postDiffusionDofBloomMaterial); - _postDiffusionDofBloomMaterial = null; - } - if (antialiasingMaterial != null) - { - Object.Destroy(antialiasingMaterial); - antialiasingMaterial = null; - } - } - - private static float GetLowResolutionDividerBasedOnQuality(float baseDivider) - { - return baseDivider * 0.5f; - } - - private RenderTexture CreateBloomTexture(RenderTexture source, RenderTexture downSample) - { - RenderTexture renderTexture = null; - int width = source.width / BLOOM_DIVIDER; - int height = source.height / BLOOM_DIVIDER; - if (_param.BloomBlurSize > 0f) - { - Vector4 zero = Vector4.zero; - bool flag = false; - RenderTexture renderTexture2 = downSample; - if (renderTexture2 == null) - { - zero.z = 0f; - zero.w = 1f; - _fastBloomMaterial.SetVector("_Parameter", zero); - renderTexture2 = RenderTexture.GetTemporary(width, height, 0); - renderTexture2.filterMode = FilterMode.Bilinear; - Graphics.Blit(source, renderTexture2, _fastBloomMaterial, 1); - flag = true; - } - float num = 1f * (float)source.width / (1f * (float)source.height); - float bloomBlurSize = _param.BloomBlurSize; - float num2 = 0.001953125f; - zero.x = bloomBlurSize / num * num2; - zero.y = bloomBlurSize * num2; - zero.z = _param.BloomThreshold; - zero.w = _param.BloomIntensity; - _fastBloomMaterial.SetVector("_Parameter", zero); - RenderTexture temporary = RenderTexture.GetTemporary(width, height, 0); - temporary.filterMode = FilterMode.Bilinear; - Graphics.Blit(renderTexture2, temporary, _fastBloomMaterial, 2); - renderTexture = temporary; - temporary = RenderTexture.GetTemporary(width, height, 0); - temporary.filterMode = FilterMode.Bilinear; - Graphics.Blit(renderTexture, temporary, _fastBloomMaterial, 3); - renderTexture.DiscardContents(); - RenderTexture.ReleaseTemporary(renderTexture); - if (flag) - { - renderTexture2.DiscardContents(); - RenderTexture.ReleaseTemporary(renderTexture2); - } - return temporary; - } - Vector4 zero2 = Vector4.zero; - zero2.z = _param.BloomThreshold; - zero2.w = _param.BloomIntensity; - _fastBloomMaterial.SetVector("_Parameter", zero2); - RenderTexture temporary2 = RenderTexture.GetTemporary(width, height, 0); - temporary2.filterMode = FilterMode.Bilinear; - Graphics.Blit(source, temporary2, _fastBloomMaterial, 1); - return temporary2; - } - - private RenderTexture OnRenderImageDiffusionDofBloom(RenderTexture source, RenderTexture destination) - { - PrepareDofParam(source, _postDiffusionDofBloomMaterial); - int num = 2; - RenderTexture temporary = RenderTexture.GetTemporary(source.width, source.height, 0); - RenderTexture temporary2 = RenderTexture.GetTemporary(_rezworkWidth, _rezworkHeight, 0); - RenderTexture temporary3 = RenderTexture.GetTemporary(_rezworkWidth, _rezworkHeight, 0); - RenderTexture temporary4 = RenderTexture.GetTemporary(_rezworkWidth, _rezworkHeight, 0); - num = 9; - if (_param.DofQualityType == DepthBlurAndBloom.DofQuality.BackgroundAndForeground) - { - _postDiffusionDofBloomMaterial.SetFloat("_dofForegroundSize", _param.DofForegroundSize); - num = 10; - } - Graphics.Blit(source, temporary, _postDiffusionDofBloomMaterial, num); - Graphics.Blit(temporary, temporary4, _postDiffusionDofBloomMaterial, 3); - BlurBlt(temporary4, temporary2, _param.DofMaxBlurSpread); - DiffusionFilterProcess(temporary2, temporary3); - _postDiffusionDofBloomMaterial.SetTexture("_TapLowBackground", temporary3); - RenderTexture renderTexture = null; - if (_param.IsEnableBloom) - { - renderTexture = CreateBloomTexture(temporary, temporary4); - _postDiffusionDofBloomMaterial.SetTexture("_Bloom", renderTexture); - _postDiffusionDofBloomMaterial.SetFloat("_BloomIsScreenBlend", (_param.BloomBlendMode == DofDiffusionBloomOverlayParam.BloomScreenBlendMode.Screen) ? 1f : 0f); - _param.ScreenOverlay.PostFilmBlit(temporary, destination, _postDiffusionDofBloomMaterial, 8, 11, 13); - } - else - { - _postDiffusionDofBloomMaterial.SetFloat("_BloomIsScreenBlend", 0f); - _param.ScreenOverlay.PostFilmBlit(temporary, destination, _postDiffusionDofBloomMaterial, -1, 11, 13); - } - if (renderTexture != null) - { - renderTexture.DiscardContents(); - RenderTexture.ReleaseTemporary(renderTexture); - renderTexture = null; - } - if (temporary != source) - { - temporary.DiscardContents(); - RenderTexture.ReleaseTemporary(temporary); - temporary = null; - } - if (temporary2 != null) - { - temporary2.DiscardContents(); - RenderTexture.ReleaseTemporary(temporary2); - temporary2 = null; - } - if (temporary3 != null) - { - temporary3.DiscardContents(); - RenderTexture.ReleaseTemporary(temporary3); - temporary3 = null; - } - if (temporary4 != null) - { - temporary4.DiscardContents(); - RenderTexture.ReleaseTemporary(temporary4); - temporary4 = null; - } - return destination; - } - - private void PrepareDofParam(RenderTexture source, Material mtrl) - { - source.filterMode = FilterMode.Bilinear; - source.wrapMode = TextureWrapMode.Clamp; - Camera targetCamera = _param.TargetCamera; - float num = targetCamera.farClipPlane - targetCamera.nearClipPlane; - float num2 = 0.1f; - Vector4 zero = Vector4.zero; - switch (_param.DofFocalType) - { - case DepthBlurAndBloom.DofFocalType.Transform: - num2 = ((!(_param.DofFocalTransfrom != null)) ? FocalDistance01(_param.DofFocalPoint) : (targetCamera.WorldToViewportPoint(_param.DofFocalTransfrom.position).z / num)); - break; - case DepthBlurAndBloom.DofFocalType.Position: - num2 = targetCamera.WorldToViewportPoint(_param.DofFocalPosition).z / num; - break; - case DepthBlurAndBloom.DofFocalType.Point: - num2 = FocalDistance01(_param.DofFocalPoint); - break; - } - if (num2 < 0f) - { - num2 = 0f; - } - if (_param.DofSmoothness < 0.1f) - { - _param.DofSmoothness = 0.1f; - } - zero.x = 1f / (float)source.width; - zero.y = 1f / (float)source.height; - mtrl.SetVector("_InvRenderTargetSize", zero); - float num3 = num2 * _param.DofSmoothness; - float num4 = num3; - _dofWidthOverHeight = (float)source.width / (float)source.height; - _dofHeightBaseSize = ((source.width > source.height) ? 0.0034722222f : 0.0010986328f); - float num5 = 1E-06f; - zero.x = ((num3 < num5) ? 0f : (1f / num3)); - zero.y = ((num4 < num5) ? 0f : (1f / num4)); - zero.z = _param.DofFocalSize / num * 0.5f + num2; - mtrl.SetVector("_CurveParams", zero); - mtrl.SetFloat("_bloomDofWeight", _param.BloomDofWeight); - float lowResolutionDividerBasedOnQuality = GetLowResolutionDividerBasedOnQuality(1f); - _rezworkWidth = (int)((float)source.width * lowResolutionDividerBasedOnQuality); - _rezworkHeight = (int)((float)source.height * lowResolutionDividerBasedOnQuality); - } - - private float FocalDistance01(float worldDist) - { - return _param.TargetCamera.WorldToViewportPoint((worldDist - _param.TargetCamera.nearClipPlane) * _param.TargetCamera.transform.forward + _param.TargetCamera.transform.position).z / (_param.TargetCamera.farClipPlane - _param.TargetCamera.nearClipPlane); - } - - private void DiffusionFilterProcess(RenderTexture source, RenderTexture destination) - { - float lowResolutionDividerBasedOnQuality = GetLowResolutionDividerBasedOnQuality(1f); - RenderTexture temporary = RenderTexture.GetTemporary(_rezworkWidth, _rezworkHeight, 0); - Vector4 zero = Vector4.zero; - zero.x = _param.DiffusionBlurSize * lowResolutionDividerBasedOnQuality / (float)_rezworkWidth; - zero.y = _param.DiffusionBlurSize * lowResolutionDividerBasedOnQuality / (float)_rezworkHeight; - _postDiffusionDofBloomMaterial.SetVector("_PixelSize", zero); - zero.x = _param.DiffusionBright; - zero.y = _param.DiffusionSaturation; - zero.z = _param.DiffusionContrast; - zero.w = _param.DiffusionThreshold; - _postDiffusionDofBloomMaterial.SetVector("_ColorParam", zero); - _postDiffusionDofBloomMaterial.mainTexture = source; - Graphics.Blit(null, temporary, _postDiffusionDofBloomMaterial, 6); - _postDiffusionDofBloomMaterial.mainTexture = temporary; - Graphics.Blit(null, destination, _postDiffusionDofBloomMaterial, 7); - _postDiffusionDofBloomMaterial.mainTexture = null; - if (temporary != null) - { - temporary.DiscardContents(); - RenderTexture.ReleaseTemporary(temporary); - temporary = null; - } - } - - private void BlurBlt(RenderTexture from, RenderTexture to, float spread) - { - } -} diff --git a/SVSim.BattleEngine/Engine/Class3dScreenOverlay.cs b/SVSim.BattleEngine/Engine/Class3dScreenOverlay.cs deleted file mode 100644 index c33cab29..00000000 --- a/SVSim.BattleEngine/Engine/Class3dScreenOverlay.cs +++ /dev/null @@ -1,343 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -[Serializable] -public class Class3dScreenOverlay -{ - [Serializable] - public class Overlay - { - public enum PostFilmMode - { - None, - Lerp, - Add, - Mul, - VignetteLerp, - VignetteAdd, - VignetteMul, - Monochrome, - ScreenBlend, - VignetteScreenBlend - } - - public enum LayerMode - { - Color, - UVMovie, - UVMovieNoScale - } - - public enum ColorBlend - { - None, - Lerp, - Additive, - Multiply - } - - public static readonly string[] SHADER_KEYWORD_MODE = new string[10] { "MODE_NONE", "MODE_LERP", "MODE_ADD", "MODE_MUL", "MODE_VIGNETTE_LERP", "MODE_VIGNETTE_ADD", "MODE_VIGNETTE_MUL", "MODE_MONOCHROME", "MODE_SCREENBLEND", "MODE_VIGNETT_SCREENBLEND" }; - - public static readonly string[] SHADER_KEYWORD_BLEND = new string[5] { "COLOR_ONLY", "BLEND_NONE", "BLEND_LERP", "BLEND_ADD", "BLEND_MUL" }; - - public const float DEFAULT_DEPTH_CLIP = 2f; - - public PostFilmMode postFilmMode; - - public float postFilmPower; - - public float depthPower; - - public float DepthClip = 2f; - - public Vector2 postFilmOffsetParam = Vector2.zero; - - public Vector4 postFilmOptionParam = Vector4.zero; - - public Color postFilmColor0 = Color.black; - - public Color postFilmColor1 = Color.black; - - public Color postFilmColor2 = Color.black; - - public Color postFilmColor3 = Color.black; - - public bool inverseVignette; - - public LayerMode layerMode; - - public ColorBlend colorBlend; - - public int movieResId; - - private bool _isExistMovieMask; - - private Texture _movieTexture; - - private Texture _movieMaskTexture; - - private Vector2 _movieTextureScale = Vector2.one; - - private Vector2 _movieTextureOffset = Vector2.zero; - - public float colorBlendFactor; - - public Vector4 RollParameter; - - public Vector4 ScaleParameter = Vector4.one; - - private bool _isUVMovieNoScale; - - public bool IsEnableDepth = true; - - public void SetMovieInfo(Texture texMovie, Texture texMask, Vector2 scale, Vector2 offset) - { - _movieTexture = texMovie; - _movieMaskTexture = texMask; - _movieTextureScale = scale; - _movieTextureOffset = offset; - _isExistMovieMask = !(texMask == null); - } - - public void SetScale(Vector2 scale) - { - ScaleParameter.x = 1f / scale.x; - ScaleParameter.y = 1f / scale.y; - } - - public void SetRollAngle(float angle) - { - RollParameter.x = Mathf.Sin(angle * (float)Math.PI / 180f); - RollParameter.y = Mathf.Cos(angle * (float)Math.PI / 180f); - } - - public Overlay() - { - SetRollAngle(0f); - } - - private static void SetShaderKeyword(int id, string[] _arrKeywords, Material mtrl) - { - for (int i = 0; i < _arrKeywords.Length; i++) - { - if (id != i) - { - mtrl.DisableKeyword(_arrKeywords[i]); - } - } - if (0 < id && id < _arrKeywords.Length) - { - mtrl.EnableKeyword(_arrKeywords[id]); - } - } - - public void Update(Material mtrl, RenderTexture mainTexture) - { - if (mtrl == null) - { - return; - } - SetShaderKeyword((int)postFilmMode, SHADER_KEYWORD_MODE, mtrl); - switch (layerMode) - { - case LayerMode.Color: - SetShaderKeyword((int)layerMode, SHADER_KEYWORD_BLEND, mtrl); - break; - case LayerMode.UVMovie: - case LayerMode.UVMovieNoScale: - SetShaderKeyword((int)layerMode + (int)colorBlend, SHADER_KEYWORD_BLEND, mtrl); - if (_movieTexture != null) - { - mtrl.SetTexture("_texMovie", _movieTexture); - float num = 0f; - float num2 = (float)mainTexture.width / num; - float num3 = (float)mainTexture.height / num; - float num4 = 7f; - float num5 = 3f; - if (2.3333333f > num2 / num3) - { - num4 *= Mathf.Ceil(num2 / num4); - num5 *= Mathf.Ceil(num3 / num5); - } - ScaleParameter.z = num2 / num4; - ScaleParameter.w = num3 / num5; - } - break; - } - _isUVMovieNoScale = layerMode == LayerMode.UVMovieNoScale; - if (_isExistMovieMask && _movieMaskTexture != null) - { - mtrl.SetTexture("_texMovieMask", _movieMaskTexture); - } - mtrl.SetVector("_movieScale", _movieTextureScale); - mtrl.SetVector("_movieOffset", _movieTextureOffset); - mtrl.SetFloat("_colorBlendFactor", colorBlendFactor); - } - - public bool IsDepthValid() - { - if (!IsEnableDepth) - { - return false; - } - return IsValid(); - } - - public bool IsValid() - { - bool result = true; - switch (postFilmMode) - { - case PostFilmMode.Monochrome: - result = postFilmColor0.a > 0f; - break; - case PostFilmMode.None: - result = false; - break; - default: - result = postFilmPower > 0f; - break; - case PostFilmMode.Mul: - case PostFilmMode.VignetteLerp: - case PostFilmMode.VignetteMul: - break; - } - return result; - } - - public void Blit(RenderTexture source, RenderTexture destination, Material material, int pass) - { - if (inverseVignette) - { - pass++; - } - Update(material, source); - Vector4 value = new Vector4(postFilmOffsetParam.x, postFilmOffsetParam.y); - material.SetFloat("_PostFilmPower", postFilmPower); - material.SetFloat("_DepthPower", depthPower); - float value2 = ((!(DepthClip > 1.5f)) ? (1.5f - DepthClip) : 0f); - material.SetFloat("_DepthClip", value2); - material.SetVector("_PostFilmOffsetParam", value); - material.SetVector("_PostFilmOptionParam", postFilmOptionParam); - material.SetColor("_PostFilmColor0", postFilmColor0); - material.SetColor("_PostFilmColor1", postFilmColor1); - material.SetColor("_PostFilmColor2", postFilmColor2); - material.SetColor("_PostFilmColor3", postFilmColor3); - RollParameter.z = (float)source.width / (float)source.height; - material.SetVector("_PostFilmRollParameter", RollParameter); - material.SetVector("_PostFilmScaleParameter", ScaleParameter); - material.SetFloat("_PostFilmIsUVMovieNoScale", _isUVMovieNoScale ? 1f : 0f); - material.SetFloat("_PostFilmIsInverseVignette", inverseVignette ? 1f : 0f); - material.SetFloat("_PostFilmIsAlphaMasking", _isExistMovieMask ? 1f : 0f); - material.SetFloat("_PostFilmIsWithoutDepth", IsEnableDepth ? 0f : 1f); - Graphics.Blit(source, destination, material, pass); - } - } - - [SerializeField] - [Header("Screen Overlay - First layer")] - private Overlay _overlay1 = new Overlay(); - - [SerializeField] - [Header("Screen Overlay - Second layer")] - private Overlay _overlay2 = new Overlay(); - - [SerializeField] - [Header("Screen Overlay - Third layer")] - private Overlay _overlay3 = new Overlay(); - - public bool IsScreenOverlay = true; - - public Overlay Overlay1 => _overlay1; - - public Overlay Overlay2 => _overlay2; - - public Overlay Overlay3 => _overlay3; - - public bool IsEnable - { - get - { - if (!_overlay1.IsValid() && !_overlay2.IsValid()) - { - return _overlay3.IsValid(); - } - return true; - } - } - - public bool IsUseDepthTexture - { - get - { - if (!_overlay1.IsDepthValid() && !_overlay2.IsDepthValid()) - { - return _overlay3.IsDepthValid(); - } - return true; - } - } - - public void PostFilmBlit(RenderTexture source, RenderTexture destination, Material material, int defaultPass, int filmPass1st, int filmPass2nd) - { - if (material == null || !IsScreenOverlay) - { - Graphics.Blit(source, destination); - return; - } - bool num = Overlay1.IsValid(); - bool flag = Overlay2.IsValid(); - bool flag2 = Overlay3.IsValid(); - RenderTexture renderTexture = destination; - RenderTexture source2 = source; - if (flag || flag2) - { - renderTexture = RenderTexture.GetTemporary(source.width, source.height, source.depth); - } - if (num) - { - Overlay1.Blit(source2, renderTexture, material, filmPass1st); - } - else if (defaultPass >= 0) - { - Graphics.Blit(source2, renderTexture, material, defaultPass); - } - else - { - Graphics.Blit(source2, renderTexture); - } - source2 = renderTexture; - renderTexture = destination; - if (flag) - { - if (flag2) - { - renderTexture = RenderTexture.GetTemporary(source.width, source.height, source.depth); - } - Overlay2.Blit(source2, renderTexture, material, filmPass2nd); - if (source2 != source) - { - RenderTexture.ReleaseTemporary(source2); - source2 = renderTexture; - renderTexture = destination; - } - } - if (flag2) - { - Overlay3.Blit(source2, renderTexture, material, filmPass2nd); - if (source2 != source) - { - RenderTexture.ReleaseTemporary(source2); - source2 = renderTexture; - renderTexture = destination; - } - } - } - - public static void SetShaderVariantKeyword(List keywordList) - { - keywordList.AddRange(Overlay.SHADER_KEYWORD_MODE); - keywordList.AddRange(Overlay.SHADER_KEYWORD_BLEND); - } -} diff --git a/SVSim.BattleEngine/Engine/ClassBattleCardBase.cs b/SVSim.BattleEngine/Engine/ClassBattleCardBase.cs index 125a3ca1..4d1c9bc0 100644 --- a/SVSim.BattleEngine/Engine/ClassBattleCardBase.cs +++ b/SVSim.BattleEngine/Engine/ClassBattleCardBase.cs @@ -47,8 +47,6 @@ public abstract class ClassBattleCardBase : BattleCardBase protected readonly ClassBuildInfo _classBuildInfo; - private readonly ClassBattleCardViewBase _classCardView; - protected int _baseMaxLife; public int BossRushStartLife; @@ -89,18 +87,6 @@ public abstract class ClassBattleCardBase : BattleCardBase } } - public int CharaId - { - get - { - if (!_classBuildInfo.isPlayer) - { - return GameMgr.GetIns().GetDataMgr().GetEnemyCharaId(); - } - return GameMgr.GetIns().GetDataMgr().GetPlayerCharaId(); - } - } - public override bool Attackable => false; public override bool IsClass => true; @@ -199,10 +185,10 @@ public abstract class ClassBattleCardBase : BattleCardBase DefaultDamage = new DamageInfo(skill, damage), FixedDamage = new DamageInfo(skill, damage2) }; - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _buildInfo.BattleMgr; base.SkillApplyInformation.DamageLife(damageParam.Damage, ins.CurrentTurn, ins.BattlePlayer.IsSelfTurn); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(CreateVfxWithCardPlayabilityRefresh(base.VfxCreator.CreateDamage(damageParam.Damage, base.Life, base.MaxLife, BaseMaxLife, isReflectedDamage, isSkillDamage)), parallelVfxPlayer)); + sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(CreateVfxWithCardPlayabilityRefresh(NullVfx.GetInstance()), parallelVfxPlayer)); SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); if (IsDead) { @@ -218,10 +204,10 @@ public abstract class ClassBattleCardBase : BattleCardBase public override HealResult ApplyHealing(HealParam healParam, SkillProcessor skillProcessor) { - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _buildInfo.BattleMgr; int num = HealLife(healParam.HealAmount, ins.CurrentTurn, ins.BattlePlayer.IsSelfTurn); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(CreateVfxWithCardPlayabilityRefresh(base.VfxCreator.CreateHealing(num, base.Life, base.MaxLife, BaseMaxLife))); + sequentialVfxPlayer.Register(CreateVfxWithCardPlayabilityRefresh(NullVfx.GetInstance())); new SkillConditionCheckerOption().HealingCardAndValue = new List { new BattlePlayerBase.CardAndValue(this, num) @@ -239,25 +225,15 @@ public abstract class ClassBattleCardBase : BattleCardBase return base.SelfBattlePlayer.BattleView.HandView.HandUnfocus(); } - private VfxBase CreatePullHandOutVfx() - { - if (base.IsSelfTurn) - { - return base.SelfBattlePlayer.BattleView.HandView.HandFocus(); - } - return NullVfx.GetInstance(); - } - public VfxBase DestroyBySpecialWin() { - return ((ClassCardVfxCreatorBase)base.VfxCreator).CreateDestroy(base.DeathTypeInfo, base.SelfBattlePlayer); + return NullVfx.GetInstance(); } public VfxBase Retire() { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(this.OnRetire.GetAllFuncVfxResults(this, new SkillProcessor())); - sequentialVfxPlayer.Register(((ClassCardVfxCreatorBase)base.VfxCreator).CreateRetire(base.SelfBattlePlayer)); return sequentialVfxPlayer; } @@ -297,19 +273,19 @@ public abstract class ClassBattleCardBase : BattleCardBase { HealLife(num4, base.SelfBattlePlayer.Turn, base.SelfBattlePlayer.IsSelfTurn); } - sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx(fileName, criSeName, base.SelfBattlePlayer.BattleMgr.IsRecovery ? null : base.BattleCardView.Transform, waitTime)); + sequentialVfxPlayer.Register(VfxWithLoadingSequential.Create()); HealParam healParam = new HealParam(num, this, this, applyModifier: false); HealResult healResult = ApplyHealing(healParam, new SkillProcessor()); sequentialVfxPlayer.Register(healResult.PrehealVfxVfx); sequentialVfxPlayer.Register(healResult.HealVfx); sequentialVfxPlayer.Register(healResult.PosthealVfxVfx); base.SkillApplyInformation.DepriveLifeZeroActivateLeonSkill(); - sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx(fileName2, criSeName2, Vector3.zero, waitTime2)); + sequentialVfxPlayer.Register(VfxWithLoadingSequential.Create()); for (int i = 0; i < list.Count; i++) { if (list[i].SkillApplyInformation.IsIndependent) { - sequentialVfxPlayer.Register(new OneShotHeavenlyAegisPlayVfx(list[i].BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); continue; } list[i].FlagCardAsDestroyedBySkill(); @@ -321,7 +297,7 @@ public abstract class ClassBattleCardBase : BattleCardBase BattlePlayerBase.SummonInfo summonInfo = new BattlePlayerBase.SummonInfo(base.SelfBattlePlayer.IsPlayer, summonedCardsList, SkillBaseSummon.SUMMON_TYPE.TOKEN); VfxWithLoadingSequential vfxWithLoadingToRegister = base.SelfBattlePlayer.CardManagement(null, new SkillProcessor(), BattlePlayerBase.CARD_MANAGEMENT.SUMMON, isRandom: false, null, null, null, summonInfo) as VfxWithLoadingSequential; base.SelfBattlePlayer.UpdateHandCardsPlayability(); - StartPickMultiCardVfx vfxToRegister = new StartPickMultiCardVfx(summonedCardsList, BattleManagerBase.GetIns().BattleResourceMgr, base.SelfBattlePlayer.IsPlayer, isToken: true, isIgnoreVoice: false, isRandomVoice: false, isGetoff: false, isEvoVoice: false, 0f); + StartPickMultiCardVfx vfxToRegister = new StartPickMultiCardVfx(summonedCardsList, _buildInfo.BattleMgr.BattleResourceMgr, base.SelfBattlePlayer.IsPlayer, isToken: true, isIgnoreVoice: false, isRandomVoice: false, isGetoff: false, isEvoVoice: false, 0f); if (!base.SelfBattlePlayer.BattleMgr.IsVirtualBattle) { BattleLogManager.GetInstance().BeginLogBlockTurnChangeReactive(); @@ -351,7 +327,7 @@ public abstract class ClassBattleCardBase : BattleCardBase public override VfxBase RecoveryInPlay(int inPlayIndex, bool newReplayMoveTurn = false) { - return SequentialVfxPlayer.Create(base.BattleCardView.RecoveryInPlay(), new RefreshHealthVfx(base.SelfBattlePlayer)); + return SequentialVfxPlayer.Create(base.BattleCardView.RecoveryInPlay(), NullVfx.GetInstance()); } public override BattleCardBase VirtualClone(BattlePlayerBase virtualSelfBattlePlayer, BattlePlayerBase virtualOpponentBattlePlayer) @@ -380,8 +356,8 @@ public abstract class ClassBattleCardBase : BattleCardBase return new BuildInfo(null, 0, classBuildInfo.selfBattlePlayer, classBuildInfo.opponentBattlePlayer, classBuildInfo.selfBattlePlayer, _isPlayer: classBuildInfo.isPlayer, _innerOptions: new CardInnerOptionsBase(), _normalSkillBuildInfos: _sharedEmptySkillInfo.normalSkillBuildInfos, _evolveSkillBuildInfos: _sharedEmptySkillInfo.evolveSkillBuildInfos, _battleCardIndex: 0, _battleMgr: classBuildInfo.battleMgr, _resourceMgr: classBuildInfo.resourceMgr); } - protected override ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) + protected override ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card) { - return new ClassSkillApplyInformation(card, vfxCreator); + return new ClassSkillApplyInformation(card); } } diff --git a/SVSim.BattleEngine/Engine/ClassCardCreator.cs b/SVSim.BattleEngine/Engine/ClassCardCreator.cs deleted file mode 100644 index 811e24b6..00000000 --- a/SVSim.BattleEngine/Engine/ClassCardCreator.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine; - -public class ClassCardCreator : CardCreatorBase -{ - public ClassCardCreator(GameObject rootObject) - : base(rootObject) - { - } -} diff --git a/SVSim.BattleEngine/Engine/ClassCharaExp.cs b/SVSim.BattleEngine/Engine/ClassCharaExp.cs deleted file mode 100644 index ae1cd109..00000000 --- a/SVSim.BattleEngine/Engine/ClassCharaExp.cs +++ /dev/null @@ -1,8 +0,0 @@ -public class ClassCharaExp : HeaderData -{ - public int level; - - public int necessary_exp; - - public int accumulate_exp; -} diff --git a/SVSim.BattleEngine/Engine/ClassCharaPrm.cs b/SVSim.BattleEngine/Engine/ClassCharaPrm.cs index 913f6246..c84edbd0 100644 --- a/SVSim.BattleEngine/Engine/ClassCharaPrm.cs +++ b/SVSim.BattleEngine/Engine/ClassCharaPrm.cs @@ -19,9 +19,7 @@ public class ClassCharaPrm positive_2, negative_2, extra_2, - extra_3, negative_2_a, - damege_a, extra_1_a, extra_1_b, extra_1_c, @@ -43,17 +41,7 @@ public class ClassCharaPrm public enum FaceType { - skin_01 = 1, - skin_02, - skin_03, - skin_04, - skin_05, - skin_06, - skin_07, - skin_08, - skin_09, - skin_10 - } + skin_01 = 1 } public enum EmotionType { @@ -64,30 +52,10 @@ public class ClassCharaPrm PRAISE, SURPRISE, CONFUSE, - WORRY, PROVOCATION, - EXTRA1, - EXTRA2, - EXTRA3, - BATTLESTART_DIFF, - BATTLESTART_SAME, - WIN, LOSE, SURRENDER_LOSE, - EVOLUTION_1, - EVOLUTION_2, - EVOLUTION_3, - DAMAGE_S_1, - DAMAGE_S_2, - DAMAGE_S_3, - DAMAGE_L_1, - DAMAGE_L_2, - IDLE_1, - IDLE_2, - IDLE_3, - SELECT, STORY_LOSE, - LEADER_SELECT, NEGOTIATION_1, NEGOTIATION_2, NEGOTIATION_3, @@ -140,19 +108,13 @@ public class ClassCharaPrm private int ClassCharaLv; - private int ClassCharaExp; - - private int ClassCharaBattleCount; - - private int ClassCharaWin; - - public ClassCharacterMasterData DefaultCharaData => GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(_defaultCharaId); + public ClassCharacterMasterData DefaultCharaData => null /* Pre-Phase-5b: headless has no chara master; DefaultCharaData surface preserved for typing */; public ClassCharacterMasterData CurrentCharaData { get { - ClassCharacterMasterData classCharacterMasterData = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(_currentCharaId); + ClassCharacterMasterData classCharacterMasterData = null; // Pre-Phase-5b: headless has no chara master if (classCharacterMasterData == null) { classCharacterMasterData = DefaultCharaData; @@ -165,94 +127,11 @@ public class ClassCharaPrm public List LeaderSkinIdList { get; private set; } = new List(); - public string EmoteNameGreet { get; set; } - - public string TextIdGreet { get; set; } - - public string VoiceIdGreet { get; set; } - - public string EmoteNameThank { get; set; } - - public string TextIdThank { get; set; } - - public string VoiceIdThank { get; set; } - - public string EmoteNameApology { get; set; } - - public string TextIdApology { get; set; } - - public string VoiceIdApology { get; set; } - - public string EmoteNamePraise { get; set; } - - public string TextIdPraise { get; set; } - - public string VoiceIdPraise { get; set; } - - public string EmoteNameSurprise { get; set; } - - public string TextIdSurprise { get; set; } - - public string VoiceIdSurprise { get; set; } - - public string EmoteNameConfuse { get; set; } - - public string TextIdConfuse { get; set; } - - public string VoiceIdConfuse { get; set; } - - public string EmoteNameWorry { get; set; } - - public string TextIdWorry { get; set; } - - public string VoiceIdWorry { get; set; } - - public string EmoteNameProvocation { get; set; } - - public string TextIdProvocation { get; set; } - - public string VoiceIdProvocation { get; set; } - - public void SetDefaultCharaId(int charaId) - { - _defaultCharaId = charaId; - } - public void SetCurrentCharaId(int charaId) { _currentCharaId = charaId; } - public void SetClassCharaLv(int classlv) - { - ClassCharaLv = classlv; - } - - public void SetClassCharaExp(int classexp) - { - ClassCharaExp = classexp; - } - - public void SetClassCharaBattleCount(int classbattlecnt) - { - ClassCharaBattleCount = classbattlecnt; - } - - public void AddClassCharaBattleCount() - { - ClassCharaBattleCount++; - } - - public void SetClassCharaWin(int classwin) - { - ClassCharaWin = classwin; - } - - public void AddClassCharaWin() - { - ClassCharaWin++; - } - public void SetLeaderRandomSkinIdList(JsonData skinIdList) { LeaderSkinIdList.Clear(); @@ -267,21 +146,6 @@ public class ClassCharaPrm return ClassCharaLv; } - public int GetClassCharaExp() - { - return ClassCharaExp; - } - - public int GetClassCharaBattleCount() - { - return ClassCharaBattleCount; - } - - public int GetClassCharaWin() - { - return ClassCharaWin; - } - public static Texture GetClassIconTexture(int clan_id) { return Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("class_card_" + clan_id.ToString("00"), ResourcesManager.AssetLoadPathType.CardFrameClassIcon, isfetch: true)) as Texture; @@ -302,12 +166,6 @@ public class ClassCharaPrm return "icon_class_color_" + num.ToString("00"); } - public static string GetLargeIconSpriteName(CardBasePrm.ClanType inClassId) - { - int num = (int)inClassId; - return "icon_class_color_large_" + num.ToString("00"); - } - public static string GetNameText(CardBasePrm.ClanType inClassId) { return Data.SystemText.Get("Common_" + ((int)(104 + inClassId)).ToString("0000")); @@ -319,14 +177,4 @@ public class ClassCharaPrm inLabel.effectDistance = LabelDefine.OUTLINE_DISTANCE_CLASS_NAME; inLabel.effectColor = ColorCode.Get(OUTLINE_COLOR[inClassId]); } - - public void SetParamWithUserClassJson(JsonData classJson) - { - IsRandomLeaderSkin = classJson["is_random_leader_skin"].ToBoolean(); - SetClassCharaLv(classJson["level"].ToInt()); - SetClassCharaExp(classJson["exp"].ToInt()); - SetCurrentCharaId(classJson["leader_skin_id"].ToInt()); - SetDefaultCharaId(classJson["default_leader_skin_id"].ToInt()); - SetLeaderRandomSkinIdList(classJson["leader_skin_id_list"]); - } } diff --git a/SVSim.BattleEngine/Engine/ClassInformationUIController.cs b/SVSim.BattleEngine/Engine/ClassInformationUIController.cs index b07d3419..922fce6b 100644 --- a/SVSim.BattleEngine/Engine/ClassInformationUIController.cs +++ b/SVSim.BattleEngine/Engine/ClassInformationUIController.cs @@ -23,16 +23,6 @@ public class ClassInformationUIController } } - public VfxBase LoadResources(Transform parent, bool isPlayer) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < _classInformationUIList.Count; i++) - { - parallelVfxPlayer.Register(_classInformationUIList[i].LoadResources(parent, isPlayer)); - } - return parallelVfxPlayer; - } - public void ShowInfomation(bool playEffect = true) { for (int i = 0; i < _classInformationUIList.Count; i++) @@ -44,76 +34,6 @@ public class ClassInformationUIController } } - public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - _classInformationUIList[i].NewReplayUpdateInfomation(classInfo); - } - } - } - - public bool HaveSpecificClassInformationUi(CardBasePrm.ClanType clanType) - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - switch (clanType) - { - case CardBasePrm.ClanType.MIN: - if (_classInformationUIList[i] is ElfInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.ROYAL: - if (_classInformationUIList[i] is RoyalInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.WITCH: - if (_classInformationUIList[i] is WitchInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.DRAGON: - if (_classInformationUIList[i] is DragonInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.NECRO: - if (_classInformationUIList[i] is NecromanceInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.VAMPIRE: - if (_classInformationUIList[i] is VampireInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.BISHOP: - if (_classInformationUIList[i] is BishopInfomationUI) - { - return true; - } - break; - case CardBasePrm.ClanType.NEMESIS: - if (_classInformationUIList[i] is NemesisInfomationUI) - { - return true; - } - break; - } - } - return false; - } - public void HideInfomation() { for (int i = 0; i < _classInformationUIList.Count; i++) @@ -125,39 +45,6 @@ public class ClassInformationUIController } } - public void HideOtherInfomation() - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - _classInformationUIList[i].HideOtherInfomation(); - } - } - } - - public void HideAllInfomation() - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - _classInformationUIList[i].HideAllInfomation(); - } - } - } - - public void Recovery() - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - _classInformationUIList[i].Recovery(); - } - } - } - public void SetIsSelect(bool isSelect) { for (int i = 0; i < _classInformationUIList.Count; i++) @@ -169,58 +56,7 @@ public class ClassInformationUIController } } - public void SetInCardFocus(bool inCardFocus) - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - _classInformationUIList[i].SetInCardFocus(inCardFocus); - } - } - } - - public void SetTouchable(bool isTouchable) - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - _classInformationUIList[i].SetTouchable(isTouchable); - } - } - } - - public void SetClassInformationUiPosition(bool isPlayer) - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - (_classInformationUIList[i] as ClassInfomationUIBase).SetClassInformationUiPosition(isPlayer); - } - } - } - - public void UpdateStatusPanelOnBattle(bool isPlayer) - { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - (_classInformationUIList[i] as ClassInfomationUIBase).UpdateStatusPanelOnBattle(isPlayer); - } - } - } - public void UpdateInfomation() { - for (int i = 0; i < _classInformationUIList.Count; i++) - { - if (_classInformationUIList[i] != null) - { - (_classInformationUIList[i] as ClassInfomationUIBase).UpdateInfomation(); - } - } } } diff --git a/SVSim.BattleEngine/Engine/ClassSkillApplyInformation.cs b/SVSim.BattleEngine/Engine/ClassSkillApplyInformation.cs index e7fb0306..b447896f 100644 --- a/SVSim.BattleEngine/Engine/ClassSkillApplyInformation.cs +++ b/SVSim.BattleEngine/Engine/ClassSkillApplyInformation.cs @@ -38,8 +38,8 @@ public class ClassSkillApplyInformation : SkillApplyInformation public event Action OnPpChange; - public ClassSkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) - : base(card, vfxCreator) + public ClassSkillApplyInformation(BattleCardBase card) + : base(card) { } @@ -456,7 +456,7 @@ public class ClassSkillApplyInformation : SkillApplyInformation protected override VfxBase CombatModifierChangeCalc(bool isOldAtkBuff, bool isNowAtkBuff, bool isOldMaxLifeBuff, bool isNowMaxLifeBuff, bool isOldAtkDebuff, bool isNowAtkDebuff, bool isOldMaxLifeDebuff, bool isNowMaxLifeDebuff, bool isSkillPowerDown = false, bool isNoBuff = false, bool skipWait = false) { - return _vfxCreator.CreateParameterChange(_card.CreateParameterChangeInfo()); + return NullVfx.GetInstance(); } public override void AddTokenDrawModifier(TokenDrawModifier modifier) diff --git a/SVSim.BattleEngine/Engine/ClassSkinPlate.cs b/SVSim.BattleEngine/Engine/ClassSkinPlate.cs index 036bfcd7..625a5c07 100644 --- a/SVSim.BattleEngine/Engine/ClassSkinPlate.cs +++ b/SVSim.BattleEngine/Engine/ClassSkinPlate.cs @@ -6,17 +6,6 @@ using Wizard.Scripts.Network.Data.TaskData.SkinPurchase; public class ClassSkinPlate : MonoBehaviour { - private const int MAX_LENGTH_VIEW_SINGLE_PRODUCT_NAME = 15; - - private const int MAX_LENGTH_VIEW_SINGLE_PRODUCT_NAME_ALPHABET = 35; - - private const int MAX_LENGTH_VIEW_LARGE_SIZE_PRODUCT_NAME = 20; - - private const int MAX_LENGTH_VIEW_LARGE_SIZE_PRODUCT_NAME_ALPHABET = 39; - - private const int WIDTH_PRODUCT_BG_SPRITE_NORMAL = 357; - - private const int WIDTH_PRODUCT_BG_SPRITE_LARGE = 411; private readonly Vector3 POS_VIEW_SINGLE_PRODUCT_NAME = new Vector3(13f, -52f, 0f); @@ -68,13 +57,6 @@ public class ClassSkinPlate : MonoBehaviour public SkinSeriesPurchaseInfo SeriesInfo { get; private set; } - public Texture ImageTexture { get; private set; } - - private void Start() - { - m_LabelPurchased.text = Data.SystemText.Get("Shop_0100"); - } - public void SetMultiData(SkinSeriesPurchaseInfo seriesInfo, EventDelegate onPushBuyBtnCallback = null, Action onTapSkinImage = null) { SetBuyButtonToGrey(isGrey: false); @@ -136,7 +118,7 @@ public class ClassSkinPlate : MonoBehaviour { SeriesInfo = null; ProductInfo = productInfo; - ClassCharacterMasterData charaPrmBySkinId = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId(productInfo.leader_skin_id); + ClassCharacterMasterData charaPrmBySkinId = null; // Pre-Phase-5b: no chara master headless _LabelProductName.transform.localPosition = POS_VIEW_SINGLE_PRODUCT_NAME; int maxLength = (Global.IsAlphabetLanguage() ? 35 : 15); _LabelProductName.text = ShopCommonUtility.TrimProductName(productInfo.saleInfo.name, maxLength); diff --git a/SVSim.BattleEngine/Engine/ClassSkinPurchasePage.cs b/SVSim.BattleEngine/Engine/ClassSkinPurchasePage.cs index abc85995..8fd60d24 100644 --- a/SVSim.BattleEngine/Engine/ClassSkinPurchasePage.cs +++ b/SVSim.BattleEngine/Engine/ClassSkinPurchasePage.cs @@ -16,8 +16,6 @@ public class ClassSkinPurchasePage : BaseShopPurchasePage rewardOnly } - private const int DEFAULT_INDEX = 0; - [SerializeField] private UITable _uiTableProducts; @@ -27,8 +25,8 @@ public class ClassSkinPurchasePage : BaseShopPurchasePage [SerializeField] private PurchaseConfirm _PrefabDialogPurchaseConfirm; - [SerializeField] - private ClassSkinDetailWindow _PrefabDialogSkinDetail; + // ClassSkinDetailWindow removed (DEAD-COLD engine cleanup Task 13) + // private ClassSkinDetailWindow _PrefabDialogSkinDetail; [SerializeField] private ShopDrumrollScrollManager _drumrollManager; @@ -49,8 +47,6 @@ public class ClassSkinPurchasePage : BaseShopPurchasePage private DialogBase _dialogSelectBuyMeans; - private DialogBase _dialogProductDetail; - private DialogBase _dialogCrystalShortage; private bool _isBuyConnect; @@ -103,7 +99,7 @@ public class ClassSkinPurchasePage : BaseShopPurchasePage { if (_loadedVoiceList.Count > 0) { - GameMgr.GetIns().GetSoundMgr().StopVoiceAll(0f); + Toolbox.ResourcesManager.RemoveAssetGroup(_loadedVoiceList); _loadedVoiceList.Clear(); } @@ -374,28 +370,12 @@ public class ClassSkinPurchasePage : BaseShopPurchasePage private void _onTapClassSkinImage(ClassSkinPlate plate, bool isMulti) { - if (!(_dialogProductDetail != null)) - { - _dialogProductDetail = UIManager.GetInstance().CreateDialogClose(); - _dialogProductDetail.SetSize(DialogBase.Size.M); - _dialogProductDetail.SetTitleLabel(Data.SystemText.Get("Dia_BuySkin_003_Title")); - _dialogProductDetail.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - ClassSkinDetailWindow component = UnityEngine.Object.Instantiate(_PrefabDialogSkinDetail).GetComponent(); - _dialogProductDetail.SetObj(component.gameObject); - if (isMulti) - { - component.SetMultiData(plate.SeriesInfo); - } - else - { - component.SetSingleData(plate.ProductInfo, _loadedVoiceList); - } - } + // ClassSkinDetailWindow removed (DEAD-COLD engine cleanup Task 13) } private void onPushBuyButton(ClassSkinPlate plate, bool isMulti) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + _selectPlate = plate; if (isMulti) { @@ -578,9 +558,11 @@ public class ClassSkinPurchasePage : BaseShopPurchasePage { DialogBase diaChange = UIManager.GetInstance().CreateDialogClose(); int skinId = _purchaseProductInfo.leader_skin_id; - ClassCharacterMasterData charaData = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId(skinId); + // Pre-Phase-5b: pulled ClassCharacterMasterData via GetCharaPrmBySkinId + GetClanNameByKey. + // Headless has no chara master; leave the purchase-success dialog text as the base + // "purchased X" substitution without the class/chara suffix. + ClassCharacterMasterData charaData = null; string text = Data.SystemText.Get("Shop_0022", _purchaseProductName.Replace("\n", "")); - text = text + "\n\n" + Data.SystemText.Get("Shop_0108", GameMgr.GetIns().GetDataMgr().GetClanNameByKey(charaData.class_id), charaData.chara_name); diaChange.SetText(text); diaChange.SetTitleLabel(Data.SystemText.Get("Dia_BuySkin_004_Title")); diaChange.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); diff --git a/SVSim.BattleEngine/Engine/ColorOverwrite.cs b/SVSim.BattleEngine/Engine/ColorOverwrite.cs index bc828ee0..56314e55 100644 --- a/SVSim.BattleEngine/Engine/ColorOverwrite.cs +++ b/SVSim.BattleEngine/Engine/ColorOverwrite.cs @@ -5,7 +5,6 @@ public class ColorOverwrite : MonoBehaviour public enum Change { No, - Yes, UseDeckColorSet, UseBingoButtonSet } diff --git a/SVSim.BattleEngine/Engine/ColosseumCardPanel.cs b/SVSim.BattleEngine/Engine/ColosseumCardPanel.cs deleted file mode 100644 index 7e847020..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumCardPanel.cs +++ /dev/null @@ -1,190 +0,0 @@ -using Cute; -using UnityEngine; -using Wizard; - -internal class ColosseumCardPanel : MyPageCardPanel -{ - private const string DEFAULT_GRAND_PRIX_ID = "0"; - - [SerializeField] - private GameObject _infoRoot; - - [SerializeField] - private UILabel _infoTitleLabel; - - [SerializeField] - private UILabel _infoNextRoundLabel; - - [SerializeField] - private UILabel _infoTimeLabel; - - [SerializeField] - private UILabel _nameLabel; - - [SerializeField] - private GameObject _freeEntryIcon; - - [SerializeField] - private UISprite _panelLineSprite; - - private const int SECONDS_PER_MINUTE = 60; - - private const float SECONDS_TASK_END_NEXT_INTERVAL = 0.5f; - - private float _updateTimer; - - private bool _isFreeEntryIconDisplayPermission; - - public GameObject MyPageFreeEntryIcon { private get; set; } - - public override void CheckMaintenanceType() - { - base.CheckMaintenanceType(); - if (Data.MaintenanceCodeList.Contains(maintenanceType)) - { - _infoRoot.SetActive(value: false); - } - else - { - _infoRoot.SetActive(value: true); - } - } - - public void SetIconDisplayPermission(bool isPermission) - { - _isFreeEntryIconDisplayPermission = isPermission; - NowUpdate(); - } - - public override string GetResourcePath(bool isfetch) - { - if (Data.ArenaData.ColosseumData.ColorCodeId == "0") - { - return base.GetResourcePath(isfetch); - } - return Toolbox.ResourcesManager.GetAssetTypePath("menu_arena_colosseum_gp_" + Data.ArenaData.ColosseumData.ColorCodeId, ResourcesManager.AssetLoadPathType.CardMenu, isfetch); - } - - public void NowUpdate() - { - _updateTimer = 0f; - } - - private void OnEnable() - { - NowUpdate(); - } - - private void OnApplicationPause(bool pause) - { - if (!pause) - { - NowUpdate(); - } - } - - private void Update() - { - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - if (colosseumData.IsColosseumPeriod) - { - _updateTimer -= Time.deltaTime; - if (_updateTimer < 0f) - { - SystemText systemText = Data.SystemText; - double num = colosseumData.RemainingServerUnixTime + (double)Time.realtimeSinceStartup - (double)colosseumData.RemainingSinceTime; - _updateTimer = (float)(60.0 - num % 60.0); - _nameLabel.text = colosseumData.Name; - string id; - string id2; - string id3; - if (colosseumData.IsRoundPeriod) - { - id = "Colosseum_0044"; - id2 = "Colosseum_0057"; - id3 = "Colosseum_0058"; - } - else - { - id = "Colosseum_0059"; - id2 = "Colosseum_0060"; - id3 = "Colosseum_0061"; - } - string text; - if (num > colosseumData.RemainingUnixTime) - { - text = systemText.Get(id3, "0"); - if (colosseumData.StageNo != ArenaColosseum.eStageNo.FinalStage || (!colosseumData.IsRoundPeriod && colosseumData.IsColosseumPeriod)) - { - ColosseumEntryInfoTask task = new ColosseumEntryInfoTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, ColosseumEntryInfoTaskSuccess)); - } - } - else - { - double num2 = colosseumData.RemainingUnixTime - num; - text = ((num2 < 3600.0) ? systemText.Get(id3, ((int)(num2 / 60.0) + 1).ToString()) : ((!(num2 < 86400.0)) ? systemText.Get(id, ((int)(num2 / 86400.0)).ToString()) : systemText.Get(id2, ((int)(num2 / 3600.0)).ToString()))); - } - if (colosseumData.IsRoundPeriod) - { - string text2 = ((colosseumData.StageNo != ArenaColosseum.eStageNo.FinalStage) ? systemText.Get("Colosseum_0062", systemText.Get("Colosseum_0007", ((int)colosseumData.StageNo).ToString())) : systemText.Get("Colosseum_0062", systemText.Get("Colosseum_0008"))); - _infoTitleLabel.text = text2; - _infoNextRoundLabel.text = systemText.Get("Colosseum_0043"); - _infoTimeLabel.text = text; - if (_isFreeEntryIconDisplayPermission) - { - _freeEntryIcon.SetActive(colosseumData.IsFreeEntry); - } - else - { - _freeEntryIcon.SetActive(value: false); - } - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - MyPageFreeEntryIcon.SetActive(colosseumData.IsFreeEntry); - } - else - { - string text3 = ((colosseumData.StageNo != ArenaColosseum.eStageNo.Stage1) ? systemText.Get("Colosseum_0045") : systemText.Get("Colosseum_0041")); - string text4 = ((colosseumData.StageNo != ArenaColosseum.eStageNo.FinalStage) ? systemText.Get("Colosseum_0042", systemText.Get("Colosseum_0007", ((int)colosseumData.StageNo).ToString())) : systemText.Get("Colosseum_0042", systemText.Get("Colosseum_0008"))); - _infoTitleLabel.text = text3; - _infoNextRoundLabel.text = text4; - _infoTimeLabel.text = text; - _freeEntryIcon.SetActive(value: false); - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - MyPageFreeEntryIcon.SetActive(value: false); - } - } - } - SetUILabelParam(); - } - - private void ColosseumEntryInfoTaskSuccess(NetworkTask.ResultCode inResult) - { - _updateTimer = 0.5f; - } - - private void SetUILabelParam() - { - string colorCodeId = Data.ArenaData.ColosseumData.ColorCodeId; - if (colorCodeId == "0") - { - _panelLineSprite.color = ColorCode.Get(eColorCodeId.CARD_PANEL_GP_LINE_SPRITE_COLOR); - base.TitleLabel.applyGradient = true; - base.TitleLabel.gradientTop = ColorCode.Get(eColorCodeId.CARD_PANEL_GP_TITLE_GRAD_TOP); - base.TitleLabel.gradientBottom = ColorCode.Get(eColorCodeId.CARD_PANEL_GP_TITLE_GRAD_BOTTOM); - base.TitleLabel.effectStyle = UILabel.Effect.Outline8; - base.TitleLabel.effectColor = ColorCode.Get(eColorCodeId.CARD_PANEL_GP_TITLE_OUTLINE); - _infoTitleLabel.effectStyle = UILabel.Effect.None; - } - else - { - _panelLineSprite.color = ColorCode.GetWithString("GP" + colorCodeId + "_CARD_PANEL_LINE_SPRITE_COLOR"); - base.TitleLabel.gradientTop = ColorCode.GetWithString("GP" + colorCodeId + "_CARD_PANEL_TITLE_GRAD_TOP"); - base.TitleLabel.gradientBottom = ColorCode.GetWithString("GP" + colorCodeId + "_CARD_PANEL_TITLE_GRAD_BOTTOM"); - base.TitleLabel.effectStyle = UILabel.Effect.Outline8; - base.TitleLabel.effectColor = ColorCode.GetWithString("GP" + colorCodeId + "_CARD_PANEL_TITLE_OUTLINE"); - _infoTitleLabel.effectStyle = UILabel.Effect.Outline8; - _infoTitleLabel.effectColor = ColorCode.GetWithString("GP" + colorCodeId + "_CARD_PANEL_ROUND_INFO_OUTLINE"); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumDetail.cs b/SVSim.BattleEngine/Engine/ColosseumDetail.cs deleted file mode 100644 index db4f1bf3..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumDetail.cs +++ /dev/null @@ -1,270 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Wizard; -using Wizard.ErrorDialog; - -public class ColosseumDetail : MonoBehaviour -{ - private enum eTitleLabel - { - StageName, - TimeStart, - TimeEnd, - Max - } - - private enum eGroupLabel - { - Group, - BattleNum, - BreakThrough, - Retry - } - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UILabel _timeLabel; - - [SerializeField] - private UILabel _ownStatusLabel; - - [SerializeField] - private UILabel[] _round1TitleLabels; - - [SerializeField] - private UILabel[] _round2TitleLabels; - - [SerializeField] - private UILabel[] _round3TitleLabels; - - [SerializeField] - private UILabel[] _round1GroupLabels; - - [SerializeField] - private UILabel[] _round2GroupALabels; - - [SerializeField] - private UILabel[] _round2GroupBLabels; - - [SerializeField] - private UILabel[] _round3GroupALabels; - - [SerializeField] - private UILabel[] _round3GroupBLabels; - - public void Init(DialogBase inDialog) - { - SystemText systemText = Wizard.Data.SystemText; - ArenaColosseum colosseumData = Wizard.Data.ArenaData.ColosseumData; - inDialog.SetSize(DialogBase.Size.M); - inDialog.SetTitleLabel(systemText.Get("Common_0022")); - inDialog.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn_GrayBtn); - inDialog.SetButtonText(systemText.Get("Colosseum_0023"), systemText.Get("Colosseum_0025")); - inDialog.onPushButton1 = delegate - { - if (!string.IsNullOrEmpty(Wizard.Data.ArenaData.ColosseumData.AnnounceNo)) - { - UIManager.GetInstance().WebViewHelper.OpenAnnounceWebView(Wizard.Data.ArenaData.ColosseumData.AnnounceNo); - } - else - { - Dialog.Create(4416); - } - }; - inDialog.onPushButton2 = delegate - { - if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.Avatar) - { - UIManager.GetInstance().StartFirstTips(FirstTips.TipsType.HeroesGrandPrix); - } - else if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.WindFall) - { - UIManager.GetInstance().StartFirstTips(FirstTips.TipsType.ColosseumWindFall); - } - else if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos) - { - UIManager.GetInstance().StartFirstTips(FirstTips.TipsType.Colosseum2PickChaos, null, 0, Wizard.Data.ArenaData.ColosseumData.ChaoseTipsId); - } - else - { - UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.ColosseumInfo); - } - }; - inDialog.isNotCloseWindowButton1 = true; - inDialog.isNotCloseWindowButton2 = true; - string text = colosseumData.Rule switch - { - ArenaColosseum.eRule.TwoPick => (colosseumData.IsNormalTwoPick ? systemText.Get("Arena_0002") : systemText.Get("Colosseum_0105")) + " " + systemText.Get("Colosseum_0093"), - ArenaColosseum.eRule.TwoPickChaos => systemText.Get("Chaos_FormatName"), - ArenaColosseum.eRule.HOF => systemText.Get("Colosseum_0108"), - ArenaColosseum.eRule.WindFall => systemText.Get("Colosseum_0115"), - ArenaColosseum.eRule.Crossover => systemText.Get("Common_0166"), - ArenaColosseum.eRule.MyRotation => systemText.Get("Common_0178"), - ArenaColosseum.eRule.Avatar => systemText.Get("HeroesBattle_0001"), - _ => ((colosseumData.DeckFormat == Format.Rotation) ? systemText.Get("Common_0154") : systemText.Get("Common_0155")) + systemText.Get("Colosseum_0093"), - }; - _formatLabel.text = systemText.Get("Colosseum_0054", text); - _timeLabel.text = systemText.Get("Colosseum_0084", colosseumData.ColosseumTimeText); - OwnStatusLabelUpdate(); - List list = new List(); - list.Add(_round1TitleLabels); - list.Add(_round2TitleLabels); - list.Add(_round3TitleLabels); - for (int num = 1; num < 4; num++) - { - UILabel[] array = list[num - 1]; - ArenaColosseum.eRound eRound = (ArenaColosseum.eStageNo)num switch - { - ArenaColosseum.eStageNo.Stage1 => ArenaColosseum.eRound.Round1, - ArenaColosseum.eStageNo.Stage2 => ArenaColosseum.eRound.Round2A, - _ => ArenaColosseum.eRound.FinalA, - }; - UILabel uILabel = array[0]; - if (num == 3) - { - uILabel.text = systemText.Get("Colosseum_0008"); - } - else - { - uILabel.text = systemText.Get("Colosseum_0007", num.ToString()); - } - UILabel uILabel2 = array[1]; - uILabel2.text = colosseumData.DetailData[(int)(eRound - 1)].RoundTimeStartText; - UILabel uILabel3 = array[2]; - uILabel3.text = colosseumData.DetailData[(int)(eRound - 1)].RoundTimeEndText; - if (num == (int)colosseumData.FocusStageNo) - { - uILabel.text = AddColorCode(uILabel.text); - uILabel2.text = AddColorCode(uILabel2.text); - uILabel3.text = AddColorCode(uILabel3.text); - } - } - List list2 = new List(); - list2.Add(_round1GroupLabels); - list2.Add(_round2GroupBLabels); - list2.Add(_round2GroupALabels); - list2.Add(_round3GroupBLabels); - list2.Add(_round3GroupALabels); - for (int num2 = 1; num2 < 6; num2++) - { - UILabel[] array = list2[num2 - 1]; - array[0].text = colosseumData.DetailData[num2 - 1].GroupName; - array[1].text = systemText.Get("Colosseum_0075", colosseumData.DetailData[num2 - 1].MaxBattleNum.ToString()); - if (num2 >= 4) - { - array[3].text = systemText.Get("Colosseum_0088", colosseumData.DetailData[num2 - 1].MaxEntryNum.ToString()); - } - else - { - array[3].text = systemText.Get("Colosseum_0078", colosseumData.DetailData[num2 - 1].MaxEntryNum.ToString()); - } - UILabel uILabel4 = array[2]; - if (num2 == 1) - { - string text2 = systemText.Get("Colosseum_0076", colosseumData.DetailData[num2 - 1].BreakThroughNum.ToString(), systemText.Get("Colosseum_0020")); - string text3 = systemText.Get("Colosseum_0080", (colosseumData.DetailData[num2 - 1].BreakThroughNum - 1).ToString(), systemText.Get("Colosseum_0021")); - uILabel4.text = text2 + "\n" + text3; - } - else if (num2 >= 4) - { - uILabel4.text = systemText.Get("Colosseum_0104", colosseumData.FinalRoundEliminateCount.ToString()); - } - else - { - switch (num2) - { - case 3: - { - string text4 = systemText.Get("Colosseum_0076_Group", colosseumData.DetailData[num2 - 1].BreakThroughNum.ToString(), systemText.Get("Colosseum_0020")); - string text5 = systemText.Get("Colosseum_0076_Group", colosseumData.DetailData[1].BreakThroughNum.ToString(), systemText.Get("Colosseum_0021")); - uILabel4.text = text4 + "\n" + text5; - break; - } - case 2: - uILabel4.text = systemText.Get("Colosseum_0076_Group", colosseumData.DetailData[num2 - 1].BreakThroughNum.ToString(), systemText.Get("Colosseum_0021")); - break; - } - } - if (colosseumData.GetStageNoFromRoundId((ArenaColosseum.eRound)num2) == colosseumData.FocusStageNo) - { - for (int num3 = 0; num3 < array.Length; num3++) - { - array[num3].text = AddColorCode(array[num3].text); - } - } - } - } - - private void OwnStatusLabelUpdate() - { - SystemText systemText = Wizard.Data.SystemText; - ArenaColosseum colosseumData = Wizard.Data.ArenaData.ColosseumData; - _ownStatusLabel.text = string.Empty; - if (colosseumData.IsClear) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0038", colosseumData.Name); - } - else if (colosseumData.IsFinalRound()) - { - _ownStatusLabel.text = string.Empty; - } - else if (!colosseumData.IsRoundPeriod && colosseumData.StageNo == ArenaColosseum.eStageNo.Stage1) - { - _ownStatusLabel.text = string.Empty; - } - else if (!colosseumData.IsRoundPeriod) - { - if (colosseumData.StageNo == ArenaColosseum.eStageNo.Stage2) - { - if (colosseumData.NextRound == ArenaColosseum.eRound.Round2A || colosseumData.NextRound == ArenaColosseum.eRound.Round2B) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0048", colosseumData.GetGroupText(colosseumData.NextRound)); - } - } - else if (colosseumData.StageNo == ArenaColosseum.eStageNo.FinalStage) - { - if (colosseumData.NextRound == ArenaColosseum.eRound.Undecided || colosseumData.NextRound == ArenaColosseum.eRound.Lose) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0052"); - } - else if (colosseumData.NextRound == ArenaColosseum.eRound.FinalA || colosseumData.NextRound == ArenaColosseum.eRound.FinalB) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0037_Group", colosseumData.GetGroupText(colosseumData.NextRound)); - } - } - } - else if (colosseumData.Round == ArenaColosseum.eRound.Round1) - { - if (colosseumData.NextRound == ArenaColosseum.eRound.Round2A || colosseumData.NextRound == ArenaColosseum.eRound.Round2B) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0048", colosseumData.GetGroupText(colosseumData.NextRound)); - } - } - else if ((colosseumData.Round == ArenaColosseum.eRound.Round2A || colosseumData.Round == ArenaColosseum.eRound.Round2B) && colosseumData.NextRound != ArenaColosseum.eRound.Lose) - { - if (colosseumData.NextRound == ArenaColosseum.eRound.Undecided) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0052"); - } - else if (colosseumData.NextRound == ArenaColosseum.eRound.FinalA || colosseumData.NextRound == ArenaColosseum.eRound.FinalB) - { - _ownStatusLabel.text = systemText.Get("Colosseum_0037_Group", colosseumData.GetGroupText(colosseumData.NextRound)); - } - } - else - { - _ownStatusLabel.text = string.Empty; - } - if (_ownStatusLabel.text != string.Empty) - { - _ownStatusLabel.text = AddColorCode(_ownStatusLabel.text); - } - } - - private string AddColorCode(string inOriginalText) - { - return "[fcd24a]" + inOriginalText + "[-]"; - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumEntry.cs b/SVSim.BattleEngine/Engine/ColosseumEntry.cs deleted file mode 100644 index fb088e28..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumEntry.cs +++ /dev/null @@ -1,580 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class ColosseumEntry : ArenaEntryBase -{ - [SerializeField] - private GameObject _detailPrefab; - - [SerializeField] - private MyPageItemArena _myPageItemArena; - - [SerializeField] - private GameObject _costRoot; - - [SerializeField] - private GameObject _entryStatusRoot; - - [SerializeField] - private UILabel _entryStatusLabel; - - [SerializeField] - private UIButton _entryButton; - - [SerializeField] - private GameObject _infoBase; - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UILabel _periodLabel; - - [SerializeField] - private UILabel _ownStatusLabel; - - [SerializeField] - private GameObject _twoPickRound1InfoBase; - - [SerializeField] - private UILabel _twoPickFormatLabel; - - [SerializeField] - private UILabel _twoPickPoolLabel; - - [SerializeField] - private UILabel _twoPickPeriodLabel; - - [SerializeField] - private UILabel _twoPickStatusLabel; - - [SerializeField] - private GameObject _twoPickRound2InfoBase; - - [SerializeField] - private UILabel _twoPickRound2FormatLabel; - - [SerializeField] - private UILabel _twoPickRound2PoolLabel; - - [SerializeField] - private UILabel _twoPickRound2PeriodLabel; - - [SerializeField] - private UILabel _twoPickRound2StatusLabel; - - [SerializeField] - private UILabel _retryNumberLabel; - - [SerializeField] - public GameObject _freeEntryIcon; - - private const string ORANGE_COLOR_CODE = "[fcd24a]"; - - private const int FORMAT_LABEL_UP_Y = 49; - - private const int FORMAT_LABEL_CENTER_Y = 14; - - private const int FORMAT_LABEL_UP_Y_FIVE_LINES = 56; - - private const int FORMAT_LABEL_CENTER_FIVE_LINES = 30; - - private const string DECK_DECISION_COLOSSEUM_PATH = "UI/DeckList/DeckDecisionColosseum"; - - private const string DECK_DECISION_COLOSSEUM_FINAL_PATH = "UI/DeckList/DeckDecisionColosseumFinal"; - - private void Awake() - { - EntryBaseInit(_costRoot); - } - - protected override void EntryBaseInit(GameObject costRootObject) - { - base.EntryBaseInit(costRootObject); - SystemText systemText = Data.SystemText; - _entryDialogTitleText = systemText.Get("Colosseum_0003"); - _resumeFunc = Resume; - _isJoinFunc = IsJoin; - _initFunc = Init; - } - - private void Init() - { - if (Data.ArenaData.ColosseumData.IsFreeEntry) - { - _isFreeEntry = true; - _freeEntryFunc = FreeEntry; - } - else - { - _isFreeEntry = false; - } - EntryStatusLabelInit(); - UIManager.SetObjectToGrey(_entryButton.gameObject, !isEntryPossible()); - UILabel componentInChildren = _entryButton.GetComponentInChildren(); - if (isEntryPossible() && _isFreeEntry) - { - componentInChildren.text = Data.SystemText.Get("Colosseum_0103"); - } - else - { - componentInChildren.text = Data.SystemText.Get("Arena_0034"); - } - } - - protected override void EntryDialogCreate(GameObject inDialogObject) - { - inDialogObject.AddComponent().ColosseumEntryClass = this; - } - - private void Resume() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - if (Data.ArenaData.ColosseumData.IsDeckEntry) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Colosseum); - } - else - { - EntryTaskSuccess(NetworkTask.ResultCode.Success); - } - } - - private bool IsJoin() - { - return Data.ArenaData.ColosseumData.isJoin; - } - - public void OnClickDetailButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OpenDetail(); - } - - private void FreeEntry() - { - ColosseumEntryTask colosseumEntryTask = new ColosseumEntryTask(); - colosseumEntryTask.SetParameter(ArenaData.eARENA_PAY.Free); - StartCoroutine(Toolbox.NetworkManager.Connect(colosseumEntryTask, FreeEntryTaskSuccess)); - } - - private void FreeEntryTaskSuccess(NetworkTask.ResultCode inResult) - { - EntryTaskSuccess(inResult); - Data.ArenaData.ColosseumData.IsFreeEntry = false; - _myPageItemArena._colosseumCardPanel.GetComponent().NowUpdate(); - } - - public void EntryTaskSuccess(NetworkTask.ResultCode inResult) - { - Data.ArenaData.ColosseumData.isJoin = true; - if (Data.ArenaData.ColosseumData.IsTwoPickRule || Data.ArenaData.ColosseumData.DeckFormat == Format.Avatar) - { - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.ColosseumTwoPick; - Data.CurrentFormat = Format.Max; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Colosseum); - } - else - { - UpdateEntryResumeButton(); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.ColosseumNormal; - Data.CurrentFormat = Data.ArenaData.ColosseumData.DeckFormat; - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Data.ArenaData.ColosseumData.DeckFormat); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - if (!RunSpecialDeckSelectEntry()) - { - DeckSelectUI.InitOptions initOptions = new DeckSelectUI.InitOptions - { - CanUseNonPossessionCard = Data.ArenaData.ColosseumData.CanUseNonPossessionCard - }; - DeckSelectUIDialog.Create(Data.SystemText.Get("Battle_0488"), task.DeckGroupListData, Data.ArenaData.ColosseumData.DeckFormat, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, CreateDeckSelectConfirmDialog, initOptions); - } - })); - } - HeadLineObject.GetComponent().UpdateHeadLine(); - } - - private bool RunSpecialDeckSelectEntry() - { - if (Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.HOF) - { - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.ColosseumHof; - ColosseumHOFDeckInfoTask task = new ColosseumHOFDeckInfoTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - List deckGroupList = new List - { - new DeckGroup(task.DeckList, Format.Max, DeckAttributeType.CustomDeck) - }; - DeckSelectUIDialog.Create(Data.SystemText.Get("Colosseum_0109"), new DeckGroupListData(deckGroupList), Format.Max, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: false, CreateDeckSelectConfirmDialog); - })); - return true; - } - if (Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.WindFall) - { - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.ColosseumWindFall; - ColosseumWindFallDeckInfoTask task2 = new ColosseumWindFallDeckInfoTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task2, delegate - { - List deckGroupList = new List - { - new DeckGroup(task2.DeckList, Format.Max, DeckAttributeType.CustomDeck) - }; - DeckSelectUIDialog.Create(Data.SystemText.Get("Colosseum_0117"), new DeckGroupListData(deckGroupList), Format.Max, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: false, CreateDeckSelectConfirmDialog); - })); - return true; - } - return false; - } - - private void CreateDeckSelectConfirmDialog(DialogBase dialogDeckList, DeckData deck) - { - if (!deck.IsUsable(Data.ArenaData.ColosseumData.CanUseNonPossessionCard)) - { - InCompleteDeckDecideDialog.Create(dialogDeckList, deck); - return; - } - CompleteDeckDecideDialog completeDeckDecideDialog = CompleteDeckDecideDialog.CreateForSingleDeck(dialogDeckList, deck, showSimpleStageOption: true, delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckSetAndMoveColosseum(deck); - }); - completeDeckDecideDialog.DecisionUI.CardDetailCustomize = delegate(CardDetailUI detailUI) - { - detailUI.IsShowFlavorTextButton = false; - detailUI.IsShowVoiceButton = false; - detailUI.IsShowEvolutionButton = false; - }; - completeDeckDecideDialog.DecisionUI.CardListCustomize = delegate(UICardList cardList) - { - if (Data.ArenaData.ColosseumData.IsSpecialDeckSelectRule) - { - cardList.SetShareButtonUse(isUse: false); - } - if (Data.ArenaData.ColosseumData.IsDeckMaxNumberChange) - { - cardList.SetMaxCardNum(Data.ArenaData.ColosseumData.DeckMaxNumber); - } - }; - if (Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.HOF) - { - completeDeckDecideDialog.DecisionUI.IsCanShowQRCode = false; - } - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.ColosseumNormal) - { - completeDeckDecideDialog.DecisionUI.gameObject.GetComponent().alpha = 0f; - DeckDecisionColosseum deckDecisionColosseum = Object.Instantiate(Toolbox.ResourcesManager.LoadObject("UI/DeckList/DeckDecisionColosseum", isServerResources: false)); - completeDeckDecideDialog.Dialog.SetObj(deckDecisionColosseum.gameObject); - deckDecisionColosseum.Init(deck); - completeDeckDecideDialog.DecisionUI.transform.SetParent(deckDecisionColosseum.transform.parent.transform); - } - } - - private void DeckSetAndMoveColosseum(DeckData inDeckData) - { - Data.ArenaData.ColosseumData.DeckList.Clear(); - Data.ArenaData.ColosseumData.DeckList.Add(inDeckData); - if (!Data.ArenaData.ColosseumData.IsSpecialDeckSelectRule) - { - DeckListUtility.SaveLastSelectDeck(inDeckData.GetDeckID(), isDefaultDeck: false, isTrialDeck: false, Data.ArenaData.ColosseumData.DeckFormat); - } - BaseTask baseTask = null; - if (Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.HOF) - { - ((ColosseumDeckEntryHOFTask)(baseTask = new ColosseumDeckEntryHOFTask())).SetParameter(Data.ArenaData.ColosseumData.DeckList); - } - else if (Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.WindFall) - { - ((ColosseumWindFallDeckEntry)(baseTask = new ColosseumWindFallDeckEntry())).SetParameter(Data.ArenaData.ColosseumData.DeckList); - } - else if (Data.ArenaData.ColosseumData.DeckFormat == Format.Avatar) - { - ((ColosseumDeckEntryAvatarTask)(baseTask = new ColosseumDeckEntryAvatarTask())).SetParameter(Data.ArenaData.ColosseumData.DeckList); - } - else - { - ((ColosseumDeckEntryTask)(baseTask = new ColosseumDeckEntryTask())).SetParameter(Data.ArenaData.ColosseumData.DeckList, isPublished: false); - } - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(baseTask, delegate - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Colosseum); - })); - } - - public void OpenDetail() - { - ColosseumDetailTask task = new ColosseumDetailTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, DetailTaskSuccess)); - } - - private void DetailTaskSuccess(NetworkTask.ResultCode inResultCode) - { - Data.ArenaData.ColosseumData.CreateDetailDialog(_detailPrefab); - } - - private bool isEntryPossible() - { - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - if ((!colosseumData.IsRetry || colosseumData.IsClear || colosseumData.IsFinalRoundTry) && !colosseumData.isJoin) - { - return false; - } - return true; - } - - protected void EntryStatusLabelInit() - { - InfoTextUpdate(); - EntryTextUpdate(); - } - - private void ColosseumDeckDeletedDialogMessageReceiver() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - if (Data.ArenaData.ColosseumData.IsTwoPickRule) - { - dialogBase.SetText(Data.SystemText.Get("Colosseum_0102")); - } - else - { - dialogBase.SetText(Data.SystemText.Get("Error_4403")); - } - dialogBase.SetTitleLabel(Data.SystemText.Get("Common_0021")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - Data.ArenaData.ColosseumData.IsDeckDeleted = false; - } - - private void InfoTextUpdate() - { - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - SystemText systemText = Data.SystemText; - UILabel uILabel = null; - string text = colosseumData.Rule switch - { - ArenaColosseum.eRule.TwoPick => (colosseumData.IsNormalTwoPick ? systemText.Get("Arena_0002") : systemText.Get("Colosseum_0105")) + " " + systemText.Get("Colosseum_0093"), - ArenaColosseum.eRule.TwoPickChaos => systemText.Get("Chaos_FormatName") + " " + systemText.Get("Colosseum_0093"), - ArenaColosseum.eRule.HOF => systemText.Get("Colosseum_0108"), - ArenaColosseum.eRule.WindFall => systemText.Get("Colosseum_0116"), - _ => UIUtil.GetFormatName(colosseumData.DeckFormat) + systemText.Get("Colosseum_0093"), - }; - UILabel uILabel2; - UILabel uILabel3; - UILabel uILabel4; - if (colosseumData.Rule == ArenaColosseum.eRule.TwoPick || colosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos) - { - if (colosseumData.StageNo == ArenaColosseum.eStageNo.Stage2) - { - _infoBase.SetActive(value: false); - _twoPickRound1InfoBase.SetActive(value: false); - _twoPickRound2InfoBase.SetActive(value: true); - uILabel2 = _twoPickRound2FormatLabel; - uILabel3 = _twoPickRound2PoolLabel; - uILabel4 = _twoPickRound2PeriodLabel; - uILabel = _twoPickRound2StatusLabel; - } - else - { - _infoBase.SetActive(value: false); - _twoPickRound1InfoBase.SetActive(value: true); - _twoPickRound2InfoBase.SetActive(value: false); - uILabel2 = _twoPickFormatLabel; - uILabel3 = _twoPickPoolLabel; - uILabel4 = _twoPickPeriodLabel; - uILabel = _twoPickStatusLabel; - } - } - else - { - _infoBase.SetActive(value: true); - _twoPickRound1InfoBase.SetActive(value: false); - _twoPickRound2InfoBase.SetActive(value: false); - uILabel2 = _formatLabel; - uILabel3 = null; - uILabel4 = _periodLabel; - uILabel = _ownStatusLabel; - } - uILabel2.text = systemText.Get("Colosseum_0054", text); - if (colosseumData.IsRoundPeriod) - { - uILabel4.text = colosseumData.NowRoundTimeText; - } - else - { - string text2 = ((colosseumData.StageNo != ArenaColosseum.eStageNo.FinalStage) ? systemText.Get("Colosseum_0007", ((int)colosseumData.StageNo).ToString()) : systemText.Get("Colosseum_0008")); - uILabel4.text = text2 + systemText.Get("Colosseum_0101") + colosseumData.NowRoundTimeText; - } - if (colosseumData.Rule == ArenaColosseum.eRule.TwoPick || colosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos) - { - uILabel3.text = systemText.Get("Arena_0142", colosseumData.CardPool); - } - _ownStatusLabel.text = string.Empty; - _twoPickStatusLabel.text = string.Empty; - _twoPickRound2StatusLabel.text = string.Empty; - if (colosseumData.StageNo == ArenaColosseum.eStageNo.Stage1) - { - if (colosseumData.NextRound == ArenaColosseum.eRound.Round2A || colosseumData.NextRound == ArenaColosseum.eRound.Round2B) - { - uILabel.text = systemText.Get("Colosseum_0048", colosseumData.GetGroupText(colosseumData.NextRound)); - } - } - else if (colosseumData.StageNo == ArenaColosseum.eStageNo.Stage2) - { - string text3 = string.Empty; - string text4 = string.Empty; - if (colosseumData.IsRoundPeriod) - { - if (colosseumData.Round == ArenaColosseum.eRound.Round2A || colosseumData.Round == ArenaColosseum.eRound.Round2B) - { - text3 = systemText.Get("Colosseum_0100", colosseumData.GetGroupText(colosseumData.Round)); - } - if (colosseumData.NextRound == ArenaColosseum.eRound.Undecided) - { - text4 = systemText.Get("Colosseum_0052"); - } - else if (colosseumData.NextRound == ArenaColosseum.eRound.FinalA || colosseumData.NextRound == ArenaColosseum.eRound.FinalB) - { - text4 = systemText.Get("Colosseum_0037_Group", colosseumData.GetGroupText(colosseumData.NextRound)); - } - uILabel.text = text3 + "\n" + text4; - } - else if (colosseumData.NextRound == ArenaColosseum.eRound.Round2A || colosseumData.NextRound == ArenaColosseum.eRound.Round2B) - { - uILabel.text = systemText.Get("Colosseum_0048", colosseumData.GetGroupText(colosseumData.NextRound)); - } - } - else if (colosseumData.StageNo == ArenaColosseum.eStageNo.FinalStage && colosseumData.Round != ArenaColosseum.eRound.Lose) - { - if (colosseumData.IsClear) - { - uILabel.text = systemText.Get("Colosseum_0038", colosseumData.Name); - } - else if (!colosseumData.IsFinalRoundTry) - { - string text5 = string.Empty; - if (colosseumData.IsRoundPeriod) - { - if (colosseumData.Round == ArenaColosseum.eRound.FinalA || colosseumData.Round == ArenaColosseum.eRound.FinalB) - { - text5 = systemText.Get("Colosseum_0100", colosseumData.GetGroupText(colosseumData.Round)); - } - uILabel.text = text5; - } - else if (colosseumData.NextRound == ArenaColosseum.eRound.Lose) - { - uILabel.text = string.Empty; - } - else - { - if (colosseumData.NextRound == ArenaColosseum.eRound.FinalA || colosseumData.NextRound == ArenaColosseum.eRound.FinalB) - { - text5 = systemText.Get("Colosseum_0100", colosseumData.GetGroupText(colosseumData.NextRound)); - } - uILabel.text = text5 + "\n" + systemText.Get("Colosseum_0037"); - } - } - } - if (uILabel.text == string.Empty) - { - if ((colosseumData.Rule == ArenaColosseum.eRule.TwoPick || colosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos) && colosseumData.StageNo == ArenaColosseum.eStageNo.FinalStage) - { - uILabel2.transform.localPosition = new Vector3(uILabel2.transform.localPosition.x, 30f); - } - else - { - uILabel2.transform.localPosition = new Vector3(uILabel2.transform.localPosition.x, 14f); - } - return; - } - if ((colosseumData.Rule == ArenaColosseum.eRule.TwoPick || colosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos) && colosseumData.StageNo == ArenaColosseum.eStageNo.Stage2) - { - uILabel2.transform.localPosition = new Vector3(uILabel2.transform.localPosition.x, 56f); - } - else - { - uILabel2.transform.localPosition = new Vector3(uILabel2.transform.localPosition.x, 49f); - } - uILabel.text = "[fcd24a]" + uILabel.text + "[-]"; - } - - private void EntryTextUpdate() - { - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - SystemText systemText = Data.SystemText; - if (!isEntryPossible()) - { - _costRoot.SetActive(value: false); - _entryStatusRoot.SetActive(value: true); - _entryStatusLabel.text = string.Empty; - if (colosseumData.IsClear || colosseumData.IsFinalRoundTry) - { - _entryStatusLabel.text = systemText.Get("Colosseum_0086"); - } - else if (colosseumData.Round == ArenaColosseum.eRound.Lose) - { - _entryStatusLabel.text = systemText.Get("Colosseum_0022"); - } - else if (!colosseumData.IsRoundPeriod) - { - if (colosseumData.StageNo == ArenaColosseum.eStageNo.Stage1) - { - _entryStatusLabel.text = systemText.Get("Colosseum_0064"); - } - else if (colosseumData.NextRound == ArenaColosseum.eRound.Lose) - { - _entryStatusLabel.text = systemText.Get("Colosseum_0022"); - } - else - { - _entryStatusLabel.text = systemText.Get("Colosseum_0056"); - } - } - else if (!colosseumData.IsRetry) - { - if (colosseumData.IsLastDay) - { - _entryStatusLabel.text = systemText.Get("Colosseum_0068"); - } - else - { - _entryStatusLabel.text = systemText.Get("Colosseum_0067"); - } - } - } - else if (colosseumData.IsFreeEntry || colosseumData.IsFinalRound()) - { - _costRoot.SetActive(value: false); - _entryStatusRoot.SetActive(value: true); - if (!colosseumData.IsFinalRound()) - { - string id = "Colosseum_0047"; - if (colosseumData.IsLastDay) - { - id = "Colosseum_0050"; - } - _entryStatusLabel.text = "[fcd24a]" + systemText.Get(id, colosseumData.RetryRemainingNum.ToString()) + "[-]\n\n" + systemText.Get("Colosseum_0026"); - } - else - { - _entryStatusLabel.text = systemText.Get("Colosseum_0092"); - } - } - else - { - _costRoot.SetActive(value: true); - _entryStatusRoot.SetActive(value: false); - } - if (colosseumData.IsLastDay) - { - _retryNumberLabel.text = systemText.Get("Colosseum_0050", colosseumData.RetryRemainingNum.ToString()); - } - else - { - _retryNumberLabel.text = systemText.Get("Colosseum_0047", colosseumData.RetryRemainingNum.ToString()); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumEntryDialog.cs b/SVSim.BattleEngine/Engine/ColosseumEntryDialog.cs deleted file mode 100644 index 761beed3..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumEntryDialog.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Cute; -using Wizard; - -public class ColosseumEntryDialog : ArenaEntryDialogBase -{ - public ColosseumEntry ColosseumEntryClass { get; set; } - - protected override void Init() - { - _mainTextId = "Colosseum_0004"; - _ticketSpriteName = "icon_colosseum_s"; - _arenaNameTextId = "Colosseum_0006"; - _entryButtonSe = Se.TYPE.SYS_BTN_DECIDE; - } - - protected override int GetTicketNum() - { - return PlayerStaticData.UserColosseumTicketNum; - } - - protected override ArenaEntryDataBase GetEntryData() - { - return Data.ArenaData.ColosseumData; - } - - protected override void Entry() - { - base.Entry(); - ColosseumEntryTask colosseumEntryTask = new ColosseumEntryTask(); - colosseumEntryTask.SetParameter(_payType); - StartCoroutine(Toolbox.NetworkManager.Connect(colosseumEntryTask, EntryTaskSuccess)); - } - - private void EntryTaskSuccess(NetworkTask.ResultCode inResult) - { - base.ParentDialog.CloseWithoutSelect(); - ColosseumEntryClass.EntryTaskSuccess(inResult); - } - - private void DeckSetAndMoveColosseum(DeckData inDeckData, bool isBattleEnd) - { - Data.ArenaData.ColosseumData.DeckList.Clear(); - Data.ArenaData.ColosseumData.DeckList.Add(inDeckData); - ColosseumDeckEntryTask colosseumDeckEntryTask = new ColosseumDeckEntryTask(); - colosseumDeckEntryTask.SetParameter(Data.ArenaData.ColosseumData.DeckList, isPublished: false); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(colosseumDeckEntryTask, delegate - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Colosseum); - })); - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumHeadLine.cs b/SVSim.BattleEngine/Engine/ColosseumHeadLine.cs deleted file mode 100644 index d2868d1e..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumHeadLine.cs +++ /dev/null @@ -1,51 +0,0 @@ -using UnityEngine; -using Wizard; - -public class ColosseumHeadLine : MonoBehaviour -{ - [SerializeField] - private UILabel _ticketNum; - - [SerializeField] - private UILabel _ticketCost; - - [SerializeField] - private UILabel _rupyNum; - - [SerializeField] - private UILabel _rupyCost; - - [SerializeField] - private UILabel _crystalNum; - - [SerializeField] - private UILabel _crystalCost; - - private void OnEnable() - { - UpdateHeadLine(); - } - - public void UpdateHeadLine() - { - int ticketCost = Data.ArenaData.ColosseumData.ticketCost; - int rupyCost = Data.ArenaData.ColosseumData.rupyCost; - int crystalCost = Data.ArenaData.ColosseumData.crystalCost; - SystemText systemText = Data.SystemText; - if (_ticketNum != null) - { - _ticketNum.text = PlayerStaticData.UserColosseumTicketNum.ToString(); - _ticketCost.text = systemText.Get("Arena_0045", ticketCost.ToString()); - } - if (_rupyNum != null) - { - _rupyNum.text = PlayerStaticData.UserRupyCount.ToString(); - _rupyCost.text = systemText.Get("Arena_0047", rupyCost.ToString()); - } - if (_crystalNum != null) - { - _crystalNum.text = PlayerStaticData.UserCrystalCount.ToString(); - _crystalCost.text = systemText.Get("Arena_0046", crystalCost.ToString()); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/ColosseumResultAnimationAgent.cs deleted file mode 100644 index eeead7c2..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumResultAnimationAgent.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; - -public class ColosseumResultAnimationAgent : ResultAnimationAgent -{ - private const float OBJECT_APPEAR_MOVE_SEC = 0.5f; - - private const float RESULT_TITLE_DELAY_SEC = 0f; - - private const float CLASS_CHAR_DELAY_SEC = 0.1f; - - private const float CLASS_INFO_DELAY_SEC = 0.3f; - - private const float GAUGE_WAIT_SEC = 0.5f; - - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); - } - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - if (ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); - } - if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - PlayWinVoice(); - } - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - yield return PlayGaugeUpSe(); - yield return new WaitForSeconds(0.5f); - } - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - if (colosseumData.ResultEffect != ArenaColosseum.eResultEffect.None) - { - if (colosseumData.ResultEffect == ArenaColosseum.eResultEffect.GroupA) - { - battleResultControl.TitleMatch.spriteName = "colosseum_battle_title_01"; - } - else if (colosseumData.ResultEffect == ArenaColosseum.eResultEffect.Final) - { - battleResultControl.TitleMatch.spriteName = "colosseum_battle_title_02"; - } - else - { - battleResultControl.TitleMatch.spriteName = "colosseum_battle_title_03"; - } - StartCoroutine(battleResultControl.RunMatch()); - yield return new WaitForSeconds(3f); - } - bool isFinishBattlePass = false; - battleResultControl.SetBattlePassGauge(delegate - { - isFinishBattlePass = true; - }); - while (!isFinishBattlePass) - { - yield return null; - } - if (Data.RedEtherCampaignResultData != null) - { - bool isFinishRedEther = false; - RedEtherCampaignPanel.Create(battleResultControl.gameObject, Data.RedEtherCampaignResultData, battleResultControl, delegate - { - isFinishRedEther = true; - }); - while (!isFinishRedEther) - { - yield return null; - } - yield return ShowRewardDialog(Data.RedEtherCampaignResultData.RewardList); - } - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - battleResultControl.GreySpriteBGVisible = false; - } - - private IEnumerator PlayGaugeUpSe() - { - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - int i = 0; - while (i < 10) - { - soundMgr.PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - int num = i + 1; - i = num; - } - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/ColosseumResultAnimationHandler.cs deleted file mode 100644 index b33fb211..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class ColosseumResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly ColosseumResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public ColosseumResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/ColosseumResultReporter.cs b/SVSim.BattleEngine/Engine/ColosseumResultReporter.cs deleted file mode 100644 index 17fa231d..00000000 --- a/SVSim.BattleEngine/Engine/ColosseumResultReporter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard; -using Wizard.Lottery; - -public class ColosseumResultReporter : IBattleResultReporter -{ - public bool IsEnd => Data.ColosseumBattleFinish.data != null; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => Data.ColosseumBattleFinish.data._missionRewards; - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => Data.ColosseumBattleFinish.data.AchievedInfo._lotteryData; - - public bool IsDataExist - { - get - { - if (Data.ColosseumBattleFinish.data != null) - { - return Data.ColosseumBattleFinish.data.IsProcessed; - } - return false; - } - } - - public MyPageHomeDialogData HomeDialogData => null; - - public void Report(bool isWin) - { - } - - public void Destroy() - { - } - - public JsonData GetFinishResponseData() - { - return Data.ColosseumBattleFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.ColosseumBattleFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.ColosseumBattleFinish.data.achieved_mission_list; - } - - public int GetClassExp() - { - return Data.ColosseumBattleFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/CommonBackGround.cs b/SVSim.BattleEngine/Engine/CommonBackGround.cs index 6f22246a..e37cdcfc 100644 --- a/SVSim.BattleEngine/Engine/CommonBackGround.cs +++ b/SVSim.BattleEngine/Engine/CommonBackGround.cs @@ -12,20 +12,6 @@ public class CommonBackGround : UIBase NIGHTTIME } - private const string LAYER_NAME_FRONT = "FrontUI"; - - private const int MorningStartTime = 4; - - private const int DayStartTime = 10; - - private const int NightStartTime = 18; - - private const string MorningTimeBGStr = "bg_mypage_morning"; - - private const string DayTimeBGStr = "bg_mypage_day"; - - private const string NightTimeBGStr = "bg_mypage_night"; - private static CommonBackGround _instance; [SerializeField] @@ -50,8 +36,6 @@ public class CommonBackGround : UIBase public static CommonBackGround Instance => _instance; - public eBGType BGType => _BGType; - public bool IsFinishLod => _bgFinishLoad; public bool EffectVisible @@ -150,11 +134,6 @@ public class CommonBackGround : UIBase }; } - public void SetMagicCircle(bool isVisible) - { - MagicCircle.SetActive(isVisible); - } - public bool IsFinishEffectLoading() { if (_currentEffectSetup != null) diff --git a/SVSim.BattleEngine/Engine/ConditionSkillFilterCollection.cs b/SVSim.BattleEngine/Engine/ConditionSkillFilterCollection.cs index b6e7e9c2..8ad07ef7 100644 --- a/SVSim.BattleEngine/Engine/ConditionSkillFilterCollection.cs +++ b/SVSim.BattleEngine/Engine/ConditionSkillFilterCollection.cs @@ -5,7 +5,6 @@ using Wizard; public class ConditionSkillFilterCollection : SkillFilterCollectionBase { - private const int CAP_CONDITION = 8; public List ConditionCheckerFilterList { get; set; } diff --git a/SVSim.BattleEngine/Engine/ConnectionReporter.cs b/SVSim.BattleEngine/Engine/ConnectionReporter.cs deleted file mode 100644 index fab6daa4..00000000 --- a/SVSim.BattleEngine/Engine/ConnectionReporter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; - -public class ConnectionReporter -{ - private const float DEFAULT_INTERVAL = 10f; - - private Coroutine coroutine; - - private readonly MonoBehaviour runner; - - private readonly Action report; - - private readonly float interval; - - public ConnectionReporter(MonoBehaviour runner, Action report, float interval = 10f) - { - this.runner = runner; - this.report = report; - this.interval = interval; - } - - public void StopReporter() - { - if (coroutine != null) - { - runner.StopCoroutine(coroutine); - coroutine = null; - } - } - - public void StartReporter() - { - if (coroutine == null && runner != null) - { - coroutine = runner.StartCoroutine(LoopCoroutine()); - } - } - - private IEnumerator LoopCoroutine() - { - WaitForSeconds secondWait = new WaitForSeconds(interval); - while (true) - { - report.Call(); - yield return secondWait; - } - } -} diff --git a/SVSim.BattleEngine/Engine/ConsistencyReportButtonAction.cs b/SVSim.BattleEngine/Engine/ConsistencyReportButtonAction.cs deleted file mode 100644 index 6e668fdf..00000000 --- a/SVSim.BattleEngine/Engine/ConsistencyReportButtonAction.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Wizard; -using Wizard.UI.ReportToManagement; - -public static class ConsistencyReportButtonAction -{ - public static void CreateReportConfirmWindow() - { - DialogReportToManagement.Create(ToolboxGame.RealTimeNetworkAgent.GetBattleId()); - } -} diff --git a/SVSim.BattleEngine/Engine/Convention/Offline.cs b/SVSim.BattleEngine/Engine/Convention/Offline.cs index ae4c9e3c..6179f10d 100644 --- a/SVSim.BattleEngine/Engine/Convention/Offline.cs +++ b/SVSim.BattleEngine/Engine/Convention/Offline.cs @@ -2,7 +2,6 @@ namespace Convention; public class Offline { - public const int CARD_NUMBER_OF_POSSESSION = 3; public static bool IsConventionMode { get; set; } diff --git a/SVSim.BattleEngine/Engine/ConventionInfo.cs b/SVSim.BattleEngine/Engine/ConventionInfo.cs index 9d0c7b89..52b3d0ca 100644 --- a/SVSim.BattleEngine/Engine/ConventionInfo.cs +++ b/SVSim.BattleEngine/Engine/ConventionInfo.cs @@ -6,7 +6,6 @@ public class ConventionInfo { public enum ConventionStatus { - DeckEntry = 1, GameStart } @@ -18,8 +17,6 @@ public class ConventionInfo public string DeckEntryLimitText { get; private set; } - public string StartTime { get; private set; } - public BattleParameter BattleParameterInstance { get; set; } public bool IsSelectableTurn { get; private set; } diff --git a/SVSim.BattleEngine/Engine/ConventionList.cs b/SVSim.BattleEngine/Engine/ConventionList.cs deleted file mode 100644 index f2e44cf5..00000000 --- a/SVSim.BattleEngine/Engine/ConventionList.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -public class ConventionList -{ - public List List { get; private set; } - - public void Parse(JsonData data) - { - List = new List(); - for (int i = 0; i < data.Count; i++) - { - List.Add(new ConventionInfo(data[i])); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ConventionListPlate.cs b/SVSim.BattleEngine/Engine/ConventionListPlate.cs deleted file mode 100644 index 17f81e72..00000000 --- a/SVSim.BattleEngine/Engine/ConventionListPlate.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard; - -public class ConventionListPlate : MonoBehaviour -{ - private const string DECK_ENTRY_SPRITE = "btn_decklogin"; - - private const string GAME_START_SPRITE = "btn_competition"; - - [SerializeField] - private UIButton _button; - - [SerializeField] - private UILabel _conventionName; - - [SerializeField] - private UILabel _deckSetTimeLimit; - - private ConventionInfo _conventionInfo; - - public Action OnSelect { get; set; } - - private void Start() - { - _button.onClick.Add(new EventDelegate(delegate - { - OnClickConvention(); - })); - } - - public void Initialize(ConventionInfo convention) - { - _conventionInfo = convention; - _conventionName.text = convention.Name; - if (convention.Status == ConventionInfo.ConventionStatus.GameStart) - { - _deckSetTimeLimit.gameObject.SetActive(value: false); - _button.normalSprite = "btn_competition"; - return; - } - _deckSetTimeLimit.gameObject.SetActive(value: true); - _deckSetTimeLimit.text = Data.SystemText.Get("Arena_0126", convention.DeckEntryLimitText); - _button.normalSprite = "btn_decklogin"; - } - - public void FadeOutHide() - { - FadeUtility.FadeOutObjectAndNonActive(_button.gameObject); - _button.enabled = false; - } - - private void OnClickConvention() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OnSelect.Call(_conventionInfo); - } -} diff --git a/SVSim.BattleEngine/Engine/ConventionListUI.cs b/SVSim.BattleEngine/Engine/ConventionListUI.cs deleted file mode 100644 index efd731ca..00000000 --- a/SVSim.BattleEngine/Engine/ConventionListUI.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -public class ConventionListUI : UIBase -{ - private const int SCROLL_CONVENTION_COUNT = 3; - - [SerializeField] - private ConventionListPlate _conventionItemOriginal; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private UIGrid _grid; - - [SerializeField] - private GameObject _conventionListPlateRoot; - - [SerializeField] - private GameObject _backGround; - - [SerializeField] - private GameObject _layout1; - - [SerializeField] - private GameObject[] _layout2; - - [SerializeField] - private GameObject _scrollBar; - - private List _plateList = new List(); - - public Action OnSelect { get; set; } - - private void Awake() - { - _conventionItemOriginal.gameObject.SetActive(value: false); - } - - public void Show(ConventionList conventionList) - { - List list = conventionList.List; - int num = 0; - foreach (ConventionInfo item in list) - { - GameObject parent = _conventionListPlateRoot; - switch (list.Count) - { - case 1: - parent = _layout1; - break; - case 2: - parent = _layout2[num]; - break; - } - num++; - GameObject obj = NGUITools.AddChild(parent, _conventionItemOriginal.gameObject); - obj.SetActive(value: true); - ConventionListPlate component = obj.GetComponent(); - component.Initialize(item); - component.OnSelect = OnSelectConvention; - _plateList.Add(component); - } - _backGround.SetActive(list.Count > 3); - _grid.Reposition(); - _scrollView.ResetPosition(); - } - - private void OnSelectConvention(ConventionInfo convention) - { - OnSelect.Call(convention); - foreach (ConventionListPlate plate in _plateList) - { - plate.FadeOutHide(); - } - } - - public void Hide() - { - _backGround.SetActive(value: false); - _scrollBar.SetActive(value: false); - } -} diff --git a/SVSim.BattleEngine/Engine/CostCurveUI.cs b/SVSim.BattleEngine/Engine/CostCurveUI.cs index d0db330c..683e298d 100644 --- a/SVSim.BattleEngine/Engine/CostCurveUI.cs +++ b/SVSim.BattleEngine/Engine/CostCurveUI.cs @@ -74,43 +74,16 @@ public class CostCurveUI : MonoBehaviour } } - public void Refresh(UIBase_CardManager.CardObjData[] array) - { - Refresh(); - if (array == null) - { - return; - } - for (int i = 0; i < array.Length; i++) - { - int num = array[i].mainCardNum + array[i].subCardNum; - for (int j = 0; j < num; j++) - { - Add(array[i].ids, withAnim: false); - } - } - } - public void Add(int cardId, bool withAnim) { ChangeValue(1, cardId, withAnim); } - public void Add(UIBase_CardManager.CardObjData card, bool withAnim) - { - Add(card.ids, withAnim); - } - public void Sub(int cardId, bool withAnim) { ChangeValue(-1, cardId, withAnim); } - public void Sub(UIBase_CardManager.CardObjData card, bool withAnim) - { - Sub(card.ids, withAnim); - } - private void ChangeValue(int addnum, int cardId, bool withAnim) { int num = Mathf.Min(Mathf.Max(CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(cardId).Cost, m_minCost), m_barNum) - m_minCost; diff --git a/SVSim.BattleEngine/Engine/CreateItemList.cs b/SVSim.BattleEngine/Engine/CreateItemList.cs deleted file mode 100644 index 8d9287c9..00000000 --- a/SVSim.BattleEngine/Engine/CreateItemList.cs +++ /dev/null @@ -1,564 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Cute; -using UnityEngine; -using Wizard; - -public class CreateItemList : MonoBehaviour -{ - private static CreateItemList main; - - [SerializeField] - private GameObject ItemListObj; - - [SerializeField] - private GameObject BirthInputObj; - - [SerializeField] - private NguiObjs BuyButtons; - - [SerializeField] - private UIScrollView CrystalScrollView; - - [SerializeField] - private UIScrollBar ScrollBar; - - [SerializeField] - private GameObject ButtonBase; - - [SerializeField] - private GameObject OneButtonBase; - - [SerializeField] - private UILabel BtnInfo0Label; - - [SerializeField] - private UILabel BtnInfo1Label; - - [SerializeField] - private UILabel OneButtonLabel; - - [SerializeField] - private TweenAlpha ItemListWindowAlpha; - - [SerializeField] - private TweenAlpha BirthWindowAlpha; - - [SerializeField] - private UILabel MyCrystalNumLabel; - - [SerializeField] - private GameObject BtnFundSettlementObj; - - [SerializeField] - private GameObject BtnLegalObj; - - [SerializeField] - private UILabel BirthLabel1; - - [SerializeField] - private UILabel BirthLabel2; - - [SerializeField] - private UILabel BirthAgeLabel; - - [SerializeField] - private UILabel BirthLimitLabel; - - [SerializeField] - private UILabel BirthPriceLabel; - - [SerializeField] - private UILabel BirthWarnLabel; - - [SerializeField] - private UILabel InputExampleLabel; - - [SerializeField] - private UIInput UIInputObject; - - [SerializeField] - private GameObject _noInputCollider; - - public static int BirthDayUpdateServerTime; - - public static float BirthDayUpdateRealTime; - - private string productId = ""; - - private int ProductIndex; - - private string DateOfBirth = ""; - - private NetworkManager networkManager; - - private DateTime NowTime; - - private List _itemObjectList; - - private List _notDispItemList = new List(); - - [HideInInspector] - public DialogBase ParentDialogBase; - - private const int BIRTH_DAY_NUMBER_DIGITS = 6; - - private const int CHILD_YEAR = 18; - - private const int CRYSTAL_LIMIT_UNDER = 2500; - - private const int CRYSTAL_LIMIT_TOP = 5000; - - private const int EN_LIMIT_UNDER = 5000; - - private const int EN_LIMIT_TOP = 10000; - - private const int ERROR_WINDOW_DEPTH = 50; - - private const string DEFAULT_BIRTH_DAY = "0"; - - private const string FORMAT_CONVERT_DATE_BIRTH = "{0}/{1}/15"; - - private const int NGUI_SEPARATOR = 0; - - private const int NGUI_ITEM_SPRITE = 0; - - public string ScrollToProductId; - - private Vector3 _lastScrollPosition; - - private const float SCROLL_OFFSET = 10f; - - private const float SCROLL_DELAY = 0f; - - private const float SCROLL_DELAY_LONG = 0f; - - private const float SCROLL_TIME = 0f; - - public bool IsOnlyInputBirthday { get; set; } - - public Action OnFinishUpdateBirthday { get; set; } - - public static CreateItemList GetInstance() - { - return main; - } - - private void Start() - { - main = this; - if (networkManager == null) - { - networkManager = Toolbox.NetworkManager; - } - SystemText systemText = Data.SystemText; - PaymentPC instance = PaymentPC.GetInstance(); - instance.ConsumePurchaseSucceeded += PaymentSuccessed; - BirthLabel1.text = systemText.Get("Shop_0029"); - BirthLabel2.text = systemText.Get("Shop_0030"); - BirthAgeLabel.text = systemText.Get("Shop_0035") + "\n" + systemText.Get("Shop_0036") + "\n" + systemText.Get("Shop_0037"); - BirthLimitLabel.text = systemText.Get("Shop_0038") + "\n" + systemText.Get("Shop_0038") + "\n" + systemText.Get("Shop_0040"); - string text; - string text2; - if (Data.SystemText.RegionCode == Global.LANG_TYPE.Ger.ToString()) - { - CultureInfo cultureInfo = new CultureInfo("de-de"); - text = 2500.ToString("N0", cultureInfo); - text2 = 5000.ToString("N0", cultureInfo); - } - else - { - text = $"{2500:N0}"; - text2 = $"{5000:N0}"; - } - BirthPriceLabel.text = systemText.Get("Shop_0039", text) + "\n" + systemText.Get("Shop_0039", text2); - BirthWarnLabel.text = systemText.Get("Shop_0031"); - InputExampleLabel.text = systemText.Get("Shop_0068"); - InputExampleLabel.gameObject.SetActive(value: true); - ParentDialogBase.SetButtonDisable(isEnableOK: true); - Dictionary productPurchaseLimitList = instance.ProductPurchaseLimitList; - Dictionary productPurchaseNumberList = instance.ProductPurchaseNumberList; - Dictionary productCsvIdList = instance.ProductCsvIdList; - _notDispItemList.Clear(); - if (productPurchaseNumberList.Count != 0) - { - foreach (KeyValuePair item in productCsvIdList) - { - if (productPurchaseNumberList.ContainsKey(item.Value) && int.Parse(productPurchaseLimitList[item.Value]) <= int.Parse(productPurchaseNumberList[item.Value])) - { - _notDispItemList.Add(item.Value); - } - } - } - InitScrollView(_notDispItemList); - UpdateCrystalCount(); - if (IsBirthdayNotInput()) - { - BirthInputObj.SetActive(value: true); - BirthWindowAlpha.PlayForward(); - return; - } - ItemListObj.SetActive(value: true); - ItemListWindowAlpha.PlayForward(); - ParentDialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - ParentDialogBase.SetButtonDisable(isEnableOK: false); - ParentDialogBase.onPushButton1 = delegate - { - ParentDialogBase.Close(); - }; - UIManager.GetInstance().closeInSceneCenterLoading(); - CrystalScrollView.ResetPosition(); - ScrollBar.value = 0f; - } - - public static bool IsBirthdayNotInput() - { - return PlayerStaticData.UserBirthDay == "0"; - } - - private void Update() - { - CheckScrollToItem(0f); - if (PlayerStaticData.UserBirthDay.Length != 6) - { - if (UIInputObject.isSelected) - { - InputExampleLabel.gameObject.SetActive(value: false); - } - else if (UIInputObject.value.Length == 0) - { - InputExampleLabel.gameObject.SetActive(value: true); - } - } - } - - protected void InitScrollView(List inDeleteIdList = null) - { - PaymentPC instance = PaymentPC.GetInstance(); - List productIdList = instance.ProductIdList; - Dictionary productCsvIdList = instance.ProductCsvIdList; - Dictionary productNameList = instance.ProductNameList; - Dictionary formatProductPriceList = instance.FormatProductPriceList; - Dictionary productImageNameList = instance.ProductImageNameList; - Dictionary productIsSpecialShop = instance.ProductIsSpecialShop; - SystemText systemText = Data.SystemText; - float num = 0f; - float num2 = 0f; - int num3 = 0; - _itemObjectList = new List(productIdList.Count); - for (int i = 0; i < productIdList.Count; i++) - { - string key = productIdList[i]; - if ((inDeleteIdList == null || !inDeleteIdList.Contains(productCsvIdList[key])) && !productIsSpecialShop[key] && productNameList.ContainsKey(key) && formatProductPriceList.ContainsKey(key)) - { - NguiObjs component = NGUITools.AddChild(CrystalScrollView.gameObject, BuyButtons.gameObject).GetComponent(); - _itemObjectList.Add(component); - component.gameObject.SetActive(value: true); - component.labels[0].text = productNameList[key]; - component.labels[1].text = systemText.Get("Shop_0083") + "$" + formatProductPriceList[key]; - component.labels[2].text = systemText.Get("Shop_0041"); - component.buttons[0].gameObject.name = i.ToString(); - UIEventListener uIEventListener = UIEventListener.Get(component.buttons[0].gameObject); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, new UIEventListener.VoidDelegate(BuyCrystalButtonClickCallBack)); - num2 = component.GetComponent().height; - num = (float)num3 * num2; - component.transform.localPosition = new Vector3(0f, 0f - num, 0f); - component.sprites[0].spriteName = productImageNameList[key]; - if (i == productIdList.Count - 1) - { - component.objs[0].SetActive(value: false); - } - else - { - component.objs[0].SetActive(value: true); - } - num3++; - } - } - OneButtonBase.SetActive(value: false); - ButtonBase.SetActive(value: false); - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString()) - { - OneButtonBase.SetActive(value: true); - OneButtonBase.transform.localPosition = new Vector3(0f, 0f - (num + num2 / 2f), 0f); - OneButtonLabel.text = systemText.Get("Shop_0125"); - } - CrystalScrollView.ResetPosition(); - ScrollBar.value = 0f; - } - - private void _PaymentListErrorDialog() - { - if (BattleManagerBase.GetIns() == null) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0094")); - dialogBase.SetText(Data.SystemText.Get("Shop_0093")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(100); - } - } - - public void BirthUpdateButtonClickCallBack() - { - DateOfBirth = UIInputObject.value; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetReturnMsg(base.gameObject, "BirthUpdateTask"); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0070")); - if (DateTime.TryParse($"{DateOfBirth.Substring(0, 4)}/{DateOfBirth.Substring(4, 2)}/15", out var result)) - { - result = TimeZoneInfo.ConvertTimeToUtc(result); - string text = ConvertTime.ToLocal(result, ConvertTime.FORMAT.YEAR_MONTH); - dialogBase.SetText(Data.SystemText.Get("Shop_0071", text)); - } - else - { - dialogBase.SetText(Data.SystemText.Get("Shop_0071", DateOfBirth)); - } - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Dia_BuyCrystal_002_Button")); - dialogBase.SetPanelDepth(100); - } - - private void BirthUpdateTask() - { - UpdateBirthTask updateBirthTask = new UpdateBirthTask(); - updateBirthTask.SetParameter(DateOfBirth); - StartCoroutine(networkManager.Connect(updateBirthTask, OnUpdateBirthFinished)); - } - - private void OnUpdateBirthFinished(NetworkTask.ResultCode code) - { - PlayerStaticData.UserBirthDay = UIInputObject.value; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_BuyCrystal_003_Title")); - dialogBase.SetText(Data.SystemText.Get("Shop_0069")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(100); - if (!IsOnlyInputBirthday) - { - dialogBase.OnClose = BirthCloseAndItemOpen; - return; - } - dialogBase.OnClose = delegate - { - OnFinishUpdateBirthday.Call(); - }; - } - - protected void BirthCloseAndItemOpen() - { - BirthWindowAlpha.PlayReverse(); - if (IsChildCheckDialog()) - { - ChildWarningDialog(); - } - else - { - ActivateItemList(); - } - } - - private void ActivateItemList() - { - ItemListObj.SetActive(value: true); - ParentDialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - ParentDialogBase.SetButtonDisable(isEnableOK: false); - ParentDialogBase.onPushButton1 = delegate - { - ParentDialogBase.Close(); - }; - ItemListWindowAlpha.PlayForward(); - CheckScrollToItem(0f); - } - - public void BirthCancelButtonClickCallBack() - { - ParentDialogBase.CloseWithoutSelect(); - } - - public void BirthInputOnChange() - { - if (UIInputObject.value.Length == 6) - { - ParentDialogBase.SetButtonDisable(isEnableOK: false); - } - else - { - ParentDialogBase.SetButtonDisable(isEnableOK: true); - } - } - - private void ChildWarningDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0078")); - dialogBase.SetText(Data.SystemText.Get("Shop_0079")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(100); - dialogBase.OnClose = ActivateItemList; - } - - private void BuyCrystalButtonClickCallBack(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ProductIndex = int.Parse(g.name); - StartPaymentDialog(); - } - - private void StartPaymentDialog() - { - productId = PaymentPC.GetInstance().ProductIdList[ProductIndex]; - Dictionary productNameList = PaymentPC.GetInstance().ProductNameList; - if (PlayerStaticData.IsPurchaseNotificationOfLootBox()) - { - LootBoxDialogUtility.CreatePurchaseNotificationLootBoxDialog(Data.SystemText.Get("Dia_BuyCrystal_004_Title"), productNameList[productId], StartPayment, CancelPayment); - return; - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_BuyCrystal_004_Title")); - dialogBase.SetText(Data.SystemText.Get("Shop_0017", productNameList[productId])); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Dia_BuyCrystal_004_Button")); - dialogBase.SetReturnMsg(base.gameObject, "StartPayment", "CancelPayment"); - dialogBase.SetPanelDepth(100); - } - - private void CancelPayment() - { - UIManager.GetInstance().WebViewHelper.DestroyWebView(); - } - - private void StartPayment() - { - PaymentPC.GetInstance().purchaceStart(productId); - } - - private void PaymentSuccessed() - { - try - { - Dictionary productPurchaseLimitList = PaymentPC.GetInstance().ProductPurchaseLimitList; - string lastPaymentId = Data.Load.data._userCrystalCount._lastPaymentId; - int lastPaymentItemBuyNumber = Data.Load.data._userCrystalCount._lastPaymentItemBuyNumber; - if (lastPaymentId != null && int.Parse(productPurchaseLimitList[lastPaymentId]) <= lastPaymentItemBuyNumber) - { - if (!_notDispItemList.Contains(lastPaymentId)) - { - _notDispItemList.Add(lastPaymentId); - } - for (int i = 0; i < _itemObjectList.Count; i++) - { - UnityEngine.Object.Destroy(_itemObjectList[i].gameObject); - } - _itemObjectList.Clear(); - InitScrollView(_notDispItemList); - } - } - catch (Exception ex) - { - LocalLog.AccumulateTraceLog("Payment suceeded but exception is captured :" + ex); - } - } - - public void UpdateCrystalCount() - { - MyCrystalNumLabel.text = PlayerStaticData.UserCrystalCount.ToString(); - } - - public void FundSettlementButtonClickCallBack() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.FUND_SETTLEMENT); - } - - public void LegalButtonClickCallBack() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.LEGALTEXT); - } - - public void OneButtonClickCallBack() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString()) - { - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.KOREA_CRYSTAL_PAGE); - } - } - - public bool IsChildCheckDialog() - { - if (BirthDayUpdateServerTime != 0) - { - int year = int.Parse(PlayerStaticData.UserBirthDay.Substring(0, 4)); - int month = int.Parse(PlayerStaticData.UserBirthDay.Substring(4, 2)); - DateTime dateTime = new DateTime(year, month, 1); - DateTime dateTime2 = UnixTimeToDateTime(BirthDayUpdateServerTime + (int)(Time.realtimeSinceStartup - BirthDayUpdateRealTime)); - DateTime dateTime3 = new DateTime(1, 1, 1); - TimeSpan timeSpan = dateTime2 - dateTime; - int num = (dateTime3 + timeSpan).Year - 1; - int num2 = (dateTime3 + timeSpan).Month - 1; - if (num < 18 || (num == 18 && num2 == 0)) - { - return true; - } - return false; - } - return false; - } - - protected DateTime UnixTimeToDateTime(int unixTime) - { - return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(unixTime); - } - - private void StartScrollToIndex(int index, float delay) - { - Vector3 localPosition = CrystalScrollView.transform.localPosition; - Vector3 vector = localPosition - _itemObjectList[index].transform.localPosition; - vector.y += 10f; - _lastScrollPosition = localPosition; - _noInputCollider.SetActive(value: true); - iTween.ValueTo(base.gameObject, iTween.Hash("from", localPosition, "to", vector, "delay", delay, "time", 0f, "easetype", iTween.EaseType.easeInOutQuad, "onupdate", "ScrollViewUpdate", "oncomplete", "DeactivateCollider")); - } - - private void ScrollViewUpdate(Vector3 v) - { - CrystalScrollView.MoveRelative(v - _lastScrollPosition); - CrystalScrollView.RestrictWithinBounds(instant: true); - _lastScrollPosition = v; - } - - private void DeactivateCollider() - { - _noInputCollider.SetActive(value: false); - } - - private int GetIndexFromProductId(string id) - { - List idList = PaymentPC.GetInstance().IdList; - if (_notDispItemList != null) - { - for (int i = 0; i < _notDispItemList.Count; i++) - { - idList.Remove(_notDispItemList[i]); - } - } - return idList.FindIndex((string x) => x == id); - } - - private void CheckScrollToItem(float delay) - { - if (CrystalScrollView.isActiveAndEnabled && !string.IsNullOrEmpty(ScrollToProductId)) - { - int indexFromProductId = GetIndexFromProductId(ScrollToProductId); - if (indexFromProductId > 0) - { - StartScrollToIndex(indexFromProductId, delay); - } - ScrollToProductId = null; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Cute.Payment/IPaymentCommonCallback.cs b/SVSim.BattleEngine/Engine/Cute.Payment/IPaymentCommonCallback.cs deleted file mode 100644 index ce176116..00000000 --- a/SVSim.BattleEngine/Engine/Cute.Payment/IPaymentCommonCallback.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; - -namespace Cute.Payment; - -public interface IPaymentCommonCallback -{ - void OnInitializeSucceeded(); - - void OnInitializeFailed(int errorCode, string errorMessage); - - void OnPurchaseFailed(string error); - - void OnPurchaseFailed(int errorCode, string message); - - void OnPurchaseCancelled(string productId, string price, string currencyCode); - - void OnGetProductListSucceeded(List productInfo, bool waitUnfinishedTransaction); - - void OnGetProductListFailed(int errorCode, string errorMessage); - - void OnConsumePurchaseSucceeded(); - - void OnConsumePurchaseFailed(int errorCode, string errorMessage); -} diff --git a/SVSim.BattleEngine/Engine/Cute.Payment/StringExtensions.cs b/SVSim.BattleEngine/Engine/Cute.Payment/StringExtensions.cs deleted file mode 100644 index 4e40f9aa..00000000 --- a/SVSim.BattleEngine/Engine/Cute.Payment/StringExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Cute.Payment; - -public static class StringExtensions -{ - public static string[] SubstringAtCount(this string self, int count) - { - List list = new List(); - int num = (int)Math.Ceiling((double)self.Length / (double)count); - for (int i = 0; i < num; i++) - { - int num2 = count * i; - if (self.Length <= num2) - { - break; - } - if (self.Length < num2 + count) - { - list.Add(self.Substring(num2)); - } - else - { - list.Add(self.Substring(num2, count)); - } - } - return list.ToArray(); - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/AchievementManager.cs b/SVSim.BattleEngine/Engine/Cute/AchievementManager.cs index cf9734d6..b1f69353 100644 --- a/SVSim.BattleEngine/Engine/Cute/AchievementManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/AchievementManager.cs @@ -27,35 +27,4 @@ public static class AchievementManager } }); } - - public static void ProceedAchievement(string id, float value) - { - Social.ReportProgress(id, value, delegate(bool success) - { - if (mCallback != null) - { - mCallback.OnProceedAchievement(success); - } - }); - } - - public static void ResetAchievements(Action callback) - { - } - - public static void LoadAchievements() - { - if (mCallback != null) - { - Social.LoadAchievements(mCallback.OnLoadAchievements); - } - } - - public static void LoadAchievementDescriptions() - { - if (mCallback != null) - { - Social.LoadAchievementDescriptions(mCallback.OnLoadAchievementDescriptions); - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/AdjustManager.cs b/SVSim.BattleEngine/Engine/Cute/AdjustManager.cs deleted file mode 100644 index e2c43320..00000000 --- a/SVSim.BattleEngine/Engine/Cute/AdjustManager.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Cute; - -public static class AdjustManager -{ - private const string _viewerIDEventToken = "qxq65x"; - - private const string _tutorialEventToken = "wlojkf"; - - private const string _paymentEventToken = "sgqjsc"; - - public static void ViewerIDEvent() - { - } - - public static void TutorialCompleteEvent() - { - } - - public static void PaymentEvent(double price, string currencycode, string transactionId, string itemTitle, string productId) - { - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/AssetErrorState.cs b/SVSim.BattleEngine/Engine/Cute/AssetErrorState.cs index 8dd5fd62..0bdb7de7 100644 --- a/SVSim.BattleEngine/Engine/Cute/AssetErrorState.cs +++ b/SVSim.BattleEngine/Engine/Cute/AssetErrorState.cs @@ -7,13 +7,9 @@ public class AssetErrorState public enum Code { NONE = 0, - SERVER_TIMEOUT = 1, - SERVER_UNDEFINED_ERROR = 2, LOCAL_CAPACITY_OVER = 4, CANCELED = 8, - FILE_READ_ERROR = 0x10, - SERVER_NOT_FOUND_ERROR = 0x20 - } + FILE_READ_ERROR = 0x10 } public enum DialogDecision { @@ -35,21 +31,11 @@ public class AssetErrorState return errorFlag != 0; } - public bool HasError(Code code) - { - return ((uint)errorFlag & (uint)code) != 0; - } - public void SetCanceled() { canceled = true; } - public int ErrorCount() - { - return errors.Count; - } - public AssetErrorState() { Reset(); @@ -64,15 +50,6 @@ public class AssetErrorState } } - public Code Query(string filename) - { - if (!errors.TryGetValue(filename, out var value)) - { - return Code.NONE; - } - return value; - } - public void Reset() { errorFlag = 0; diff --git a/SVSim.BattleEngine/Engine/Cute/AssetHandle.cs b/SVSim.BattleEngine/Engine/Cute/AssetHandle.cs index 9b29998e..ec820b58 100644 --- a/SVSim.BattleEngine/Engine/Cute/AssetHandle.cs +++ b/SVSim.BattleEngine/Engine/Cute/AssetHandle.cs @@ -37,30 +37,12 @@ public class AssetHandle private string _cryptFilename; - private const byte MultipleHandleIgnor = 2; - - private const byte SubManifest = 4; - private byte _HandleAttribute; - private const float BACKGROUND_DOWNLOAD_WAIT_BEFORE_RETRY_SECONDS = 5f; - private Action phase; private RequestType requestType; - public const int MANIFEST_INDEX_FILE_NAME = 0; - - public const int MANIFEST_INDEX_DATA_HASH = 1; - - private const int MANIFEST_INDEX_CATEGORY = 2; - - private const int MANIFEST_INDEX_FILE_SIZE = 3; - - private const int MANIFEST_INDEX_SMALL_HASH = 4; - - private const int MANIFEST_INDEX_SMALL_SIZE = 5; - public string manifestDataHash { get; set; } public string SmallDataHash { get; private set; } @@ -305,14 +287,6 @@ public class AssetHandle ManifestSmallDataSize = ((!flag2) ? 0.1f : result2); } - private void PhaseNone() - { - if (requestType != RequestType.None) - { - Debug.LogError("need initialize"); - } - } - private void PhaseIdle() { if (requestType == RequestType.Download) @@ -514,7 +488,7 @@ public class AssetHandle dialogBase.SetReturnMsg(UIManager.GetInstance().gameObject, "CommonRetry", "CommonResetGame"); dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); dialogBase.SetButtonText(Data.SystemText.Get("Battle_0301"), Data.SystemText.Get("System_0006")); - dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_CANCEL_TRANS; + dialogBase.ClickSe_Btn2 = 0; dialogBase.SetPanelDepth(6000); } UIManager.GetInstance().isNoAvailMemory = true; @@ -656,7 +630,7 @@ public class AssetHandle dialogBase2.SetReturnMsg(UIManager.GetInstance().gameObject, "CommonResetGame", "CommonResetGame", "CommonResetGame", "CommonResetGame"); dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); dialogBase2.SetButtonText(Data.SystemText.Get("System_0006")); - dialogBase2.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; + dialogBase2.ClickSe_Btn1 = 0; dialogBase2.SetPanelDepth(6000); } UIManager.GetInstance().isNoAvailMemory = true; @@ -711,11 +685,9 @@ public class AssetHandle case AssetType.TemporarySound: if (filename.Substring(filename.Length - 4).Equals(".awb")) { - Toolbox.AudioManager.RemoveCueSheet(filename); } else { - Toolbox.AudioManager.AddCueSheet(filename, Path.GetFileName(filename), directory); } Toolbox.AssetManager.AddLoadingCurrentCount(filename); break; @@ -841,124 +813,6 @@ public class AssetHandle Fin(); } - private IEnumerator _LoadStreamingAsset() - { - if (requestContext != null) - { - Utility.LeanSemaphore semaphore = requestContext.semaphore; - if (semaphore != null) - { - AssetErrorState errorState = requestContext.errorState; - while (!semaphore.TryWait()) - { - yield return 0; - } - if (errorState != null && errorState.canceled) - { - errorState.Report(filename, AssetErrorState.Code.CANCELED); - Fin(); - yield break; - } - } - } - if (assetType == AssetType.Manifests) - { - _LoadPostProcess(); - Fin(); - yield break; - } - Toolbox.AssetManager.AddLoadingCurrentCount(filename); - if (assetType == AssetType.AssetBundle && ++reference == 1) - { - int RetryCount = 0; - while (true) - { - string errorMessage = ""; - string localCachePath = BuildLocalCachePath(); - using (UnityWebRequest www = UnityWebRequest.Get(localCachePath)) - { - if (www == null) - { - break; - } - yield return www.SendWebRequest(); - bool isTimeOut = false; - float noProgressTime = Time.realtimeSinceStartup; - float oldProgress = 0f; - float timeOut = 30f; - while (!www.isDone) - { - float downloadProgress = www.downloadProgress; - if (downloadProgress <= oldProgress) - { - if (Time.realtimeSinceStartup - noProgressTime > timeOut) - { - isTimeOut = true; - break; - } - } - else - { - oldProgress = downloadProgress; - noProgressTime = Time.realtimeSinceStartup; - } - yield return null; - } - if (!string.IsNullOrEmpty(www.error) || isTimeOut) - { - string text = errorMessage + " : " + localCachePath; - Debug.LogError("_LoadStreamingAsset 01 load error:" + text); - Toolbox.AssetManager.AddLoadingCurrentCount(filename); - if (RetryCount > 5) - { - Fin(); - disposeWebRequest(www); - yield break; - } - RetryCount++; - disposeWebRequest(www); - continue; - } - AssetBundle content = DownloadHandlerAssetBundle.GetContent(www); - if (content == null) - { - string text2 = errorMessage + " : " + localCachePath; - Debug.LogError("_LoadStreamingAsset02 load error:" + text2); - Toolbox.AssetManager.AddLoadingCurrentCount(filename); - Fin(); - disposeWebRequest(www); - yield break; - } - Toolbox.AssetManager.SetAssetBundle(filename, content, isMultipleHandleIgnorAsset); - AssetBundle assetBundle = Toolbox.AssetManager.GetAssetBundleObject(filename).assetBundle; - string[] allAssetNames = assetBundle.GetAllAssetNames(); - UnityEngine.Object[] array = assetBundle.LoadAllAssets(); - int num = allAssetNames.Length; - int num2 = array.Length; - List list = new List(); - for (int i = 0; i < num2; i++) - { - for (int j = 0; j < num; j++) - { - string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(allAssetNames[j]); - if (array[i].name.ToLower().Equals(fileNameWithoutExtension.ToLower())) - { - string path = Path.ChangeExtension(allAssetNames[j], ".any"); - list.Add(new AssetObject(path, array[i])); - break; - } - } - } - Toolbox.AssetManager.SetObjectList(filename, list); - disposeWebRequest(www); - } - break; - } - } - _LoadPostProcess(); - Fin(); - } - private void _LoadCancel() { } @@ -986,60 +840,6 @@ public class AssetHandle } if (IsSound()) { - Toolbox.AudioManager.RemoveCueSheet(filename); - } - return true; - } - - private bool _UnloadTemporary() - { - if (--reference == 0) - { - if (assetType == AssetType.AssetBundle) - { - if (unloadTemporary) - { - Toolbox.AssetManager.UnloadAssetBundle(filename); - unloadTemporary = false; - } - else - { - int num = reference + 1; - reference = num; - } - } - } - else if (reference < 0) - { - reference = 0; - } - if (IsSound()) - { - Toolbox.AudioManager.RemoveCueSheet(filename); - } - return true; - } - - private bool _UnloadCommon() - { - if (--reference == 0) - { - if (assetType == AssetType.AssetBundle) - { - if (unloadCommon) - { - Toolbox.AssetManager.UnloadAssetBundle(filename); - } - else - { - int num = reference + 1; - reference = num; - } - } - } - else if (reference < 0) - { - reference = 0; } return true; } @@ -1057,19 +857,6 @@ public class AssetHandle action?.Invoke(this); } - public bool Download(AssetRequestContext requestContext) - { - requestType = RequestType.Download; - this.requestContext = requestContext; - phase(); - return true; - } - - public bool Download(Action callback) - { - return Download(new AssetRequestContext(callback)); - } - public void Unload() { if (_Unload()) @@ -1079,24 +866,6 @@ public class AssetHandle requestType = RequestType.None; } - public void UnloadCommon() - { - if (_UnloadCommon()) - { - phase = PhaseIdle; - } - requestType = RequestType.None; - } - - public void UnloadTemporary() - { - if (_UnloadTemporary()) - { - phase = PhaseIdle; - } - requestType = RequestType.None; - } - public bool Load(AssetRequestContext requestContext) { requestType = RequestType.Load; @@ -1105,11 +874,6 @@ public class AssetHandle return true; } - public bool Load(Action callback) - { - return Load(new AssetRequestContext(callback)); - } - public bool QuickLoadIfPossible() { if (phase != new Action(PhaseIdle)) @@ -1151,24 +915,6 @@ public class AssetHandle return flag; } - public bool IsAssetBundle() - { - if (assetType != AssetType.AssetBundle) - { - return false; - } - return true; - } - - public bool IsManifests() - { - if (assetType != AssetType.Manifests) - { - return false; - } - return true; - } - public bool IsSound() { if (assetType != AssetType.Sound && assetType != AssetType.TemporarySound) @@ -1178,24 +924,6 @@ public class AssetHandle return true; } - public bool IsSoundVoice() - { - if (IsSound() && (filename.Substring(0, 1).Equals("v") || filename.Substring(0, 1).Equals("c"))) - { - return true; - } - return false; - } - - public bool IsMovie() - { - if (assetType != AssetType.Movie) - { - return false; - } - return true; - } - public static string GenCryptoAssetFileName(string name) { if (sha1 == null) diff --git a/SVSim.BattleEngine/Engine/Cute/AssetManager.cs b/SVSim.BattleEngine/Engine/Cute/AssetManager.cs index ccda1fd8..df74c84b 100644 --- a/SVSim.BattleEngine/Engine/Cute/AssetManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/AssetManager.cs @@ -14,67 +14,20 @@ public class AssetManager : MonoBehaviour, IManager { public enum _tag_datamode { - DATAMODE_PREIN, - DATAMODE_ALLDL, - DATAMODE_HYBRID } private Dictionary handleDictionary = new Dictionary(); private Dictionary objectDictionary = new Dictionary(); - private const int BACKGROUND_DOWNLOAD_BETWEEN_JOBS_WAIT_FRAMES = 5; - - private string[] categoryNameList; - private static bool _isCryptAssetFileName = false; private AsyncJob _asyncJobDownload; private AsyncJob _asyncJobLoad; - private bool _isCompressionAssetBundle = true; - - public bool _isUsePersistSound_PreIncircumstance; - - public const string assetbundleManifestName = "_assetmanifest"; - - public const string manifestOfManifestName = "manifest_assetmanifest"; - - public const string soundManifestName = "soundmanifest"; - - public const string movieManifestName = "moviemanifest"; - - public const string fontManifestName = "fontmanifest"; - - public string currentMovieManifestName = ""; - private static string _savePath = null; - private static string _packageDataPath = null; - - public bool _isUseStreamingAsset; - - private const string DIRECTORY_ASSET_BUNDLE = "a"; - - public const string DIRECTORY_MOVIE = "m"; - - public const string DIRECTORY_FONT = "f"; - - public const string DIRECTORY_BGM = "b"; - - public const string DIRECTORY_SE = "s"; - - public const string DIRECTORY_VOICE = "v"; - - public const string DIRECTORY_TEMPORARY = "t"; - - public const string DIRECTORY_TEMPORARY_VOICE = "v/t"; - - private const string DIRECTORY_MANIFEST = "manifest"; - - private const string commonShaderAssetName = "card_shader_common.unity3d"; - private string manifestSavePath = ""; private string bundleSavePath = ""; @@ -85,20 +38,6 @@ public class AssetManager : MonoBehaviour, IManager private string fontSavePath = ""; - private string manifestPackagePath = ""; - - private string bundlePackagePath = ""; - - private string soundPackagePath = ""; - - private string moviePackagePath = ""; - - private string fontPackagePath = ""; - - private int downloadReqCount; - - private int downloadCompCount; - private int loadingReqCount; private int loadingCompCount; @@ -111,20 +50,8 @@ public class AssetManager : MonoBehaviour, IManager public List NoUnloadAssetName = new List(); - private static List assetList = new List(); - - private static List soundList = new List(); - - private static List movieList = new List(); - - private float _normalResourceDownloadSize; - - private float _smallResourceDownloadSize; - private float _downloadCompletedSize; - private float _prevFrameEndTime; - private List _temporaryVoiceNameList = new List(); public string MovieManifesHeadtName = "moviemanifest"; @@ -141,51 +68,15 @@ public class AssetManager : MonoBehaviour, IManager public bool IsBackgroundDownload { get; private set; } - public bool isCompressionAssetBundle - { - get - { - return _isCompressionAssetBundle; - } - set - { - _isCompressionAssetBundle = value; - } - } - public string manifestOfManifests { get; set; } public string manifestOfManifests_sub { get; set; } - public bool IsDownloadJobIdle() - { - return _asyncJobDownload.IsIdle; - } - public void CancelDownloadAsyncJob() { _asyncJobDownload.Cancel(); } - public void SetDownloadAsBg(bool isBackground) - { - IsBackgroundDownload = isBackground; - if (isBackground) - { - _asyncJobDownload.WantedWaitFramesBetweenJobs = 5; - } - else - { - _asyncJobDownload.WantedWaitFramesBetweenJobs = null; - } - } - - public void ClearManifestOfManifests() - { - manifestOfManifests = null; - manifestOfManifests_sub = null; - } - private ManifestDatahashKVS GetLocalDatahashStore() { if (_localDatahashStore == null && !_isLocalDatahashStoreRecoveryMode) @@ -271,58 +162,6 @@ public class AssetManager : MonoBehaviour, IManager return ""; } - public void DeleteLocalDatahashByPrefix(string prefix) - { - ManifestDatahashKVS localDatahashStore = GetLocalDatahashStore(); - if (localDatahashStore != null) - { - try - { - localDatahashStore.DeleteByPrefix(prefix); - } - catch (Exception ex) - { - HandleLocalDatahashException(ex); - } - } - } - - public List FindLocalDatahashByPattern(string patternEscaped) - { - List result = null; - ManifestDatahashKVS localDatahashStore = GetLocalDatahashStore(); - if (localDatahashStore != null) - { - try - { - result = localDatahashStore.FindLike(patternEscaped); - } - catch (Exception ex) - { - HandleLocalDatahashException(ex); - } - } - return result; - } - - public string EscapeLocalDatahashPattern(string patternNoEscaped) - { - string result = null; - ManifestDatahashKVS localDatahashStore = GetLocalDatahashStore(); - if (localDatahashStore != null) - { - try - { - result = localDatahashStore.EscapeLikePattern(patternNoEscaped); - } - catch (Exception ex) - { - HandleLocalDatahashException(ex); - } - } - return result; - } - public void UnloadManifestHashDB() { if (_localDatahashStore != null) @@ -332,325 +171,11 @@ public class AssetManager : MonoBehaviour, IManager } } - public void DisableDatahashCache() - { - if (_localDatahashStore != null) - { - _localDatahashStore.DisableCache(); - } - } - - public static string GetCryptFileName(string name) - { - return Cryptographer.ComputeSHA1(name); - } - public static string GetAssetSaveRootPath() { return _savePath; } - public static string BuildAssetLocalCachePath(string directory, string filename) - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(GetAssetSaveRootPath()); - stringBuilder.Append(directory); - stringBuilder.Append(isCryptAssetFileName ? GetCryptFileName(filename) : filename); - return stringBuilder.ToString(); - } - - public static string BuildAssetLocalCachePath(string assetName) - { - string fileName = Path.GetFileName(assetName); - return BuildAssetLocalCachePath(assetName.Substring(0, assetName.Length - fileName.Length), fileName); - } - - public static bool AssetFileExists(string assetName) - { - return File.Exists(BuildAssetLocalCachePath(assetName)); - } - - private IEnumerator Start() - { - _isUseStreamingAsset = false; - _savePath = Application.persistentDataPath + "/"; - _packageDataPath = Application.streamingAssetsPath + "/"; - while (Toolbox.ResourcesManager == null) - { - yield return 0; - } - int preferredParallelLoadNum = Toolbox.ResourcesManager.GetPreferredParallelLoadNum(); - int preferredParallelDownloadNum = Toolbox.ResourcesManager.GetPreferredParallelDownloadNum(); - preferredParallelLoadNum = ((preferredParallelLoadNum > preferredParallelDownloadNum) ? preferredParallelLoadNum : preferredParallelDownloadNum); - _asyncJobDownload = new AsyncJob(this, preferredParallelLoadNum); - _asyncJobDownload.Start(); - _asyncJobLoad = new AsyncJob(this, preferredParallelLoadNum); - _asyncJobLoad.Start(); - Toolbox.AssetManager = this; - yield return 0; - } - - private void OnDestroy() - { - UnloadManifestHashDB(); - } - - public int GetManifestCount() - { - int num = categoryNameList.Length; - int num2 = 1; - int num3 = 1; - int num4 = 1; - return num + num2 + num3 + num4; - } - - public bool CreateLocalFileCacheDirectories() - { - try - { - Directory.CreateDirectory(_savePath + "a"); - Directory.CreateDirectory(_savePath + "b"); - Directory.CreateDirectory(_savePath + "s"); - Directory.CreateDirectory(_savePath + "v"); - Directory.CreateDirectory(_savePath + "v/t"); - Directory.CreateDirectory(_savePath + "m"); - Directory.CreateDirectory(_savePath + "f"); - Directory.CreateDirectory(_savePath + "manifest"); - } - catch (Exception) - { - return false; - } - return true; - } - - private IEnumerator TryDownloadManifestOfManifest() - { - bool isError = false; - ClearManifestOfManifests(); - if (CustomPreference.GetResourceLanguage() != CustomPreference.GetSoundMovieLanguage()) - { - yield return StartCoroutine(DownloadManifestOfManifest("manifest_assetmanifest", delegate - { - isError = true; - }, isSubMani: true)); - } - if (isError) - { - yield break; - } - yield return StartCoroutine(DownloadManifestOfManifest("manifest_assetmanifest", delegate - { - isError = true; - }, isSubMani: false)); - if (!isError) - { - bool isDone = false; - CacheAsset("manifest_assetmanifest", delegate - { - isDone = true; - }); - while (!isDone) - { - yield return 0; - } - } - } - - private IEnumerator DownloadManifestOfManifest(string manifestOfManifestName, Action errorCallback, bool isSubMani) - { - bool isDone = false; - AssetErrorState errorState = new AssetErrorState(); - RequestDownload(manifestOfManifestName, isManifest: true, new AssetRequestContext(delegate - { - isDone = true; - }, null, errorState), isSubMani); - while (!isDone) - { - yield return 0; - } - if (errorState.HasError()) - { - errorCallback?.Invoke(); - } - } - - private bool CheckExtraDownload() - { - return true; - } - - private void DecideMovieManifestName() - { - currentMovieManifestName = string.Format("{0}_{1}", "moviemanifest", CustomPreference.GetSoundMovieLanguage().ToLower()); - } - - private void PrepareManifestList(out List downloadList, out List loadList, bool extraDownload) - { - List list = new List(); - loadList = new List(); - for (int i = 0; i < categoryNameList.Length; i++) - { - string item = categoryNameList[i] + "_assetmanifest"; - list.Add(item); - loadList.Add(item); - } - DecideMovieManifestName(); - if (extraDownload) - { - string[] array = new string[3] { "soundmanifest", currentMovieManifestName, "fontmanifest" }; - foreach (string item2 in array) - { - list.Add(item2); - loadList.Add(item2); - } - } - downloadList = new List(); - foreach (string item3 in list) - { - if (handleDictionary.TryGetValue(item3, out var value)) - { - if (value.isReDownloadAsset(CustomPreference.IsNormalResource)) - { - downloadList.Add(item3); - } - } - else - { - value = new AssetHandle(item3, null, null, null, null, null, isManifest: true); - handleDictionary.Add(item3, value); - downloadList.Add(item3); - } - } - } - - public IEnumerator InitializeManifest(Action completeCallback, bool isTutorialDL) - { - QualitySettings.vSyncCount = 0; - Application.targetFrameRate = 60; - if (!CreateLocalFileCacheDirectories()) - { - UIManager.GetInstance().isErrorProc = false; - string titleLabel = Data.SystemText.Get("System_0020"); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - if (dialogBase != null) - { - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetTitleLabel(titleLabel); - dialogBase.SetText(Data.SystemText.Get("System_0021")); - dialogBase.SetReturnMsg(UIManager.GetInstance().gameObject, "CommonResetGame"); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialogBase.SetButtonText(Data.SystemText.Get("System_0006")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - dialogBase.SetPanelDepth(6000); - } - UIManager.GetInstance().isNoAvailMemory = true; - UIManager.GetInstance().isRetryProc = false; - while (!UIManager.GetInstance().isErrorProc) - { - yield return 0; - } - UIManager.GetInstance().isNoAvailMemory = false; - if (!UIManager.GetInstance().isRetryProc) - { - SoftwareResetBase.SoftwareReset(null, null); - } - } - LoadPreinManifest(); - yield return StartCoroutine(TryDownloadManifestOfManifest()); - bool extraDownload = CheckExtraDownload(); - PrepareManifestList(out var downloadList, out var loadList, extraDownload); - if (downloadList.Count > 0) - { - yield return StartCoroutine(Toolbox.ResourcesManager.DownloadAssetGroup(downloadList, null, isProgress: false)); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(loadList, null, isProgress: false)); - bool isDone = false; - if (extraDownload) - { - isDone = false; - RequestDownload("card_shader_common.unity3d", isManifest: false, delegate - { - isDone = true; - }); - while (!isDone) - { - yield return 0; - } - } - CacheAsset("card_shader_common.unity3d", delegate - { - isDone = true; - }); - while (!isDone) - { - yield return 0; - } - loadList.Sort(); - ClearManifestOfManifests(); - Toolbox.SavedataManager.Save(); - QualitySettings.vSyncCount = 0; - Application.targetFrameRate = Toolbox.QualityManager.GetFrameRate(); - completeCallback?.Invoke(); - } - - public bool IsShouldLoadPreinResource(string fileName) - { - return false; - } - - public bool IsUseDownloadResource(string fileName) - { - return true; - } - - private void LoadPreinManifest() - { - } - - private string CalcWholeResourceHash(List loadedManfiestList) - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(Toolbox.SavedataManager.GetResourceVersion()); - stringBuilder.Append("|"); - int i = 0; - for (int count = loadedManfiestList.Count; i < count; i++) - { - string text = loadedManfiestList[i]; - if (handleDictionary.TryGetValue(text, out var value)) - { - if (string.IsNullOrEmpty(value.dataHash)) - { - Debug.LogError("manifest hash not found: " + text); - return ""; - } - stringBuilder.Append(text); - stringBuilder.Append(","); - stringBuilder.Append(value.dataHash); - stringBuilder.Append("|"); - } - } - SHA1CryptoServiceProvider sHA1CryptoServiceProvider = new SHA1CryptoServiceProvider(); - byte[] array = sHA1CryptoServiceProvider.ComputeHash(new UTF8Encoding().GetBytes(stringBuilder.ToString())); - StringBuilder stringBuilder2 = new StringBuilder(); - for (int j = 0; j < array.Length; j++) - { - stringBuilder2.Append(Convert.ToString(array[j], 16).PadLeft(2, '0')); - } - sHA1CryptoServiceProvider.Clear(); - return stringBuilder2.ToString(); - } - - public void SetCategoryList(string[] _categoryList) - { - categoryNameList = _categoryList; - } - - public string[] GetCategoryList() - { - return categoryNameList; - } - public bool RegistHandle(string key, AssetHandle handle) { try @@ -676,21 +201,6 @@ public class AssetManager : MonoBehaviour, IManager return true; } - public AssetBundleObject GetAssetBundleObject(string assetName) - { - AssetBundleObject value = null; - if (objectDictionary.TryGetValue(assetName, out value)) - { - return value; - } - return null; - } - - public void DownloadAsset(string assetName, AssetRequestContext requestContext, bool isManifest = false) - { - RequestDownload(assetName, isManifest, requestContext); - } - public void SetAssetBundle(string filename, AssetBundle assetbundle, bool isMultipleHandleIgnorAsset = false) { if (objectDictionary.TryGetValue(filename, out var value)) @@ -748,14 +258,6 @@ public class AssetManager : MonoBehaviour, IManager } } - public void UnloadAssetAll() - { - foreach (KeyValuePair item in handleDictionary) - { - item.Value.Unload(); - } - } - public void UnloadAsset(string assetName) { if (!string.IsNullOrEmpty(assetName) && handleDictionary.TryGetValue(assetName, out var value) && value.assetType != AssetHandle.AssetType.Movie) @@ -764,44 +266,6 @@ public class AssetManager : MonoBehaviour, IManager } } - public void UnloadTemporaryAssetAll() - { - foreach (KeyValuePair item in handleDictionary) - { - if (item.Value.unloadTemporary) - { - item.Value.UnloadTemporary(); - } - } - } - - public void UnloadTemporaryAsset(string assetName) - { - if (handleDictionary.TryGetValue(assetName, out var value) && value.unloadTemporary) - { - value.UnloadTemporary(); - } - } - - public void UnloadCommonAssetAll() - { - foreach (KeyValuePair item in handleDictionary) - { - if (item.Value.unloadCommon) - { - item.Value.UnloadCommon(); - } - } - } - - public void UnloadCommonAsset(string assetName) - { - if (handleDictionary.TryGetValue(assetName, out var value) && value.unloadCommon) - { - value.UnloadCommon(); - } - } - public void CacheAsset(string assetName, Action callback = null) { CacheAsset(assetName, new AssetRequestContext(delegate @@ -826,37 +290,6 @@ public class AssetManager : MonoBehaviour, IManager } } - public void CachePersistantAssetBeforeManifestLoad(string assetName, Action callback = null) - { - CachePersistantAssetBeforeManifestLoad(assetName, new AssetRequestContext(delegate - { - if (callback != null) - { - callback(); - } - })); - } - - public void CachePersistantAssetBeforeManifestLoad(string assetName, AssetRequestContext requestContext) - { - AssetHandle value = null; - if (handleDictionary.TryGetValue(assetName, out value)) - { - requestContext.callback(value); - return; - } - value = new AssetHandle(assetName, "", null, null, null, null); - if (File.Exists(value.BuildLocalCachePath())) - { - Toolbox.AssetManager.RegistHandle(assetName, value); - value.Load(requestContext); - } - else if (requestContext != null && requestContext.callback != null) - { - requestContext.callback(value); - } - } - public UnityEngine.Object LoadObject(string objectName, Type type, bool isIfFindLoad = false) { string value = objectName.ToLower() + "."; @@ -875,62 +308,6 @@ public class AssetManager : MonoBehaviour, IManager return null; } - public UnityEngine.Object LoadObject(string assetName, string objectName, Type type) - { - string text = objectName.ToLower() + "."; - if (objectDictionary.TryGetValue(assetName, out var value)) - { - int count = value.objectArray.Count; - for (int i = 0; i < count; i++) - { - if (value.objectArray[i].baseObject != null && text.Equals(value.objectArray[i].basePath) && (value.objectArray[i].baseObject.GetType() == type || value.objectArray[i].baseObject.GetType().IsSubclassOf(type))) - { - return value.objectArray[i].baseObject; - } - } - } - return null; - } - - public object LoadObjectByte(string objectName, Type type, bool isIfFindLoad = false) - { - if (string.IsNullOrEmpty(objectName)) - { - Debug.LogError("empty name for AssetManager.LoadObject"); - return null; - } - foreach (KeyValuePair item in objectDictionary) - { - AssetBundleObject value = item.Value; - for (int i = 0; i < value.objectArray.Count; i++) - { - if (value.objectArray[i] != null && value.objectArray[i].baseObject != null && (type == typeof(UnityEngine.Object) || value.objectArray[i].baseObject.GetType() == type)) - { - return value.objectArray[i].baseObject; - } - } - } - return null; - } - - public void RegistCommonAsset(string assetName) - { - AssetHandle assetHandle = GetAssetHandle(assetName); - if (assetHandle != null) - { - assetHandle.unloadCommon = true; - } - } - - public void RegistTemporaryAsset(string assetName) - { - AssetHandle assetHandle = GetAssetHandle(assetName); - if (assetHandle != null) - { - assetHandle.unloadTemporary = true; - } - } - public void AddDownloadJob(IEnumerator enumerator, Action cancelAction) { _asyncJobDownload.Add(enumerator, cancelAction); @@ -941,39 +318,6 @@ public class AssetManager : MonoBehaviour, IManager _asyncJobLoad.Add(enumerator, cancelAction); } - private void RequestDownload(string name, bool isManifest, Action callback, bool isSubMani = false) - { - RequestDownload(name, isManifest, new AssetRequestContext(delegate - { - if (callback != null) - { - callback(); - } - }), isSubMani); - } - - private void RequestDownload(string name, bool isManifest, AssetRequestContext requestContext, bool isSubMani = false) - { - if (isManifest && !handleDictionary.TryGetValue(name, out var value)) - { - value = new AssetHandle(name, null, null, null, null, null, isManifest); - handleDictionary.Add(name, value); - } - value = GetAssetHandle(name); - if (value == null) - { - value = new AssetHandle(name, "", null, null, null, null); - handleDictionary.Add(name, value); - } - value.isSubManifest = isSubMani; - value.Download(requestContext); - } - - public bool IsEnableAssetName(string assetName) - { - return handleDictionary.ContainsKey(assetName); - } - public AssetHandle GetAssetHandle(string assetName, bool isWarning = true) { AssetHandle value = null; @@ -981,382 +325,6 @@ public class AssetManager : MonoBehaviour, IManager return value; } - public void ClearAssetCacheAssetBundle() - { - foreach (KeyValuePair item in objectDictionary) - { - AssetBundleObject value = item.Value; - List objectArray = item.Value.objectArray; - if (objectArray != null) - { - for (int i = 0; i < objectArray.Count; i++) - { - UnityEngine.Object.DestroyImmediate(objectArray[i].baseObject, allowDestroyingAssets: true); - } - } - if (value.assetBundle != null) - { - value.assetBundle.Unload(unloadAllLoadedObjects: true); - } - } - objectDictionary.Clear(); - handleDictionary.Clear(); - } - - public void ClearAllAssetFile() - { - ClearManifestAll(); - ClearAssetBundleAll(forceCleanCache: true); - ClearSoundFileAll(); - ClearMovieAll(); - ClearFontAll(); - ClearTemporaryFileAll(); - Caching.ClearCache(); - } - - public void ClearManifestAll() - { - ClearManifestOfManifests(); - ClearLocalCache("manifest"); - if (_localDatahashStore != null) - { - _localDatahashStore.DeleteAll(); - } - } - - public void ClearAssetBundleAll(bool forceCleanCache) - { - ClearLocalCache("a"); - if (forceCleanCache) - { - Caching.ClearCache(); - } - } - - public void ClearMovieAll() - { - ClearLocalCache("m"); - } - - public void ClearFontAll() - { - ClearLocalCache("f"); - } - - public void ClearSoundFileAll() - { - ClearSoundFileBgm(); - ClearSoundFileSe(); - ClearSoundFileVoice(); - } - - public void ClearSoundFileBgm() - { - ClearLocalCache("b"); - } - - public void ClearSoundFileSe() - { - ClearLocalCache("s"); - } - - public void ClearSoundFileVoice() - { - ClearLocalCache("v"); - } - - public void ClearTemporaryFileAll() - { - ClearTemporaryVoiceFile(); - } - - public void ClearTemporaryVoiceFile() - { - ClearLocalCache("v/t"); - } - - private void ClearLocalCache(string keyword) - { - string value = keyword + "/"; - try - { - List list = new List(); - foreach (KeyValuePair item in handleDictionary) - { - if (item.Key.StartsWith(value)) - { - list.Add(item.Key); - } - } - int count = list.Count; - for (int i = 0; i < count; i++) - { - handleDictionary.Remove(list[i]); - } - DeleteLocalDatahashByPrefix(keyword + "/"); - string path = _savePath + keyword; - if (Directory.Exists(path)) - { - Directory.Delete(path, recursive: true); - } - } - catch (Exception ex) - { - Debug.LogError(ex.Message); - } - } - - public IEnumerator DownloadAssetBundleAll(Action callback) - { - assetList.Clear(); - foreach (KeyValuePair item in handleDictionary) - { - if (item.Value.IsAssetBundle()) - { - assetList.Add(item.Key); - } - } - yield return StartCoroutine(Toolbox.ResourcesManager.DownloadAssetGroup(assetList, callback)); - } - - public IEnumerator DownloadSoundAll(Action callback) - { - soundList.Clear(); - foreach (KeyValuePair item in handleDictionary) - { - if (item.Value.IsSound()) - { - soundList.Add(item.Key); - } - } - yield return StartCoroutine(Toolbox.ResourcesManager.DownloadAssetGroup(soundList, callback)); - } - - public IEnumerator DownloadMovieAll(Action callback) - { - movieList.Clear(); - foreach (KeyValuePair item in handleDictionary) - { - if (item.Value.IsMovie()) - { - movieList.Add(item.Key); - } - } - yield return StartCoroutine(Toolbox.ResourcesManager.DownloadAssetGroup(movieList, callback)); - } - - public IEnumerator PreDownloadListCoroutine(Action, List> onFinish) - { - Action, List, float, float> finish = delegate(List normalResourceDownloadList, List smallResourceDownloadList, float size, float smallResourceDownloadSize) - { - _normalResourceDownloadSize = size; - _smallResourceDownloadSize = smallResourceDownloadSize; - onFinish(normalResourceDownloadList, smallResourceDownloadList); - }; - while (!Toolbox.ResourcesManager.CanStartDownload()) - { - yield return new WaitForSeconds(1f); - } - PreDownloadListCoroutine(finish, withTutorial: true); - } - - public void RefreshNeedDownloadFile() - { - Action, List, float, float> onFinish = delegate(List normalResourceDownloadList, List smallResourceDownloadList, float size, float smallResourceDownloadSize) - { - _normalResourceDownloadSize = size; - _smallResourceDownloadSize = smallResourceDownloadSize; - }; - PreDownloadListCoroutine(onFinish, withTutorial: true); - } - - public void PreDownloadListCoroutine(Action, List, float, float> onFinish, bool withTutorial) - { - List list = new List(); - List list2 = new List(); - float num = 0f; - float num2 = 0f; - foreach (KeyValuePair item in handleDictionary) - { - AssetHandle value = item.Value; - bool flag = withTutorial || !value.isTutorialDownload; - if (!value.IsManifests() && value.isPreDownload && flag) - { - if (value.isReDownloadAsset(isNormalSizeResource: true)) - { - list.Add(item.Key); - num += value.manifestDataSize; - } - if (value.isReDownloadAsset(isNormalSizeResource: false)) - { - list2.Add(item.Key); - num2 += value.ManifestSmallDataSize; - } - } - } - onFinish.Call(list, list2, num, num2); - } - - public float GetNeedDownloadSize(bool isNormalResource, bool isTutorial) - { - float num = 0f; - foreach (KeyValuePair item in handleDictionary) - { - AssetHandle value = item.Value; - if ((!isTutorial || value.isTutorialDownload) && value.isPreDownload && !value.IsManifests() && value.isReDownloadAsset(isNormalResource)) - { - num += (isNormalResource ? value.manifestDataSize : value.ManifestSmallDataSize); - } - } - return num; - } - - public float GetTotalStrageUseSize(bool isNormalResource) - { - float num = 0f; - foreach (KeyValuePair item in handleDictionary) - { - AssetHandle value = item.Value; - if (value.isPreDownload && !value.IsManifests()) - { - num += (isNormalResource ? value.manifestDataSize : value.ManifestSmallDataSize); - } - } - return num; - } - - public float GetDownloadSize(bool isNormalResource) - { - if (!isNormalResource) - { - return _smallResourceDownloadSize; - } - return _normalResourceDownloadSize; - } - - public static string GetSuffixByDigit(float num) - { - int num2 = Mathf.FloorToInt(Mathf.Log(num, 2f)) + 1; - if (num2 <= 0) - { - return (num * 1024f).ToString("0.0") + "KB"; - } - if (num2 >= 11) - { - return (num / 1024f).ToString("0.0") + "GB"; - } - return num.ToString("0.0") + "MB"; - } - - public List GetTutorialDownloadList(bool isNormalResource) - { - List list = new List(); - if (isNormalResource) - { - _normalResourceDownloadSize = 0f; - } - else - { - _smallResourceDownloadSize = 0f; - } - foreach (KeyValuePair item in handleDictionary) - { - AssetHandle value = item.Value; - if (value.IsManifests() || !value.isTutorialDownload) - { - continue; - } - if (isNormalResource) - { - if (value.isReDownloadAsset(isNormalSizeResource: true)) - { - list.Add(item.Key); - _normalResourceDownloadSize += value.manifestDataSize; - } - } - else if (value.isReDownloadAsset(isNormalSizeResource: false)) - { - list.Add(item.Key); - _smallResourceDownloadSize += value.manifestDataSize; - } - } - return list; - } - - public int assetbundleOpenCount() - { - int num = 0; - foreach (KeyValuePair item in objectDictionary) - { - if (item.Value.assetBundle != null) - { - num++; - } - } - return num; - } - - public int assetbundleListCount() - { - return objectDictionary.Count; - } - - public IEnumerator InitializeSoundManifest() - { - handleDictionary.Remove("soundmanifest"); - bool isDone = false; - RequestDownload("soundmanifest", isManifest: true, delegate - { - Directory.CreateDirectory(_savePath + "b"); - Directory.CreateDirectory(_savePath + "s"); - Directory.CreateDirectory(_savePath + "v"); - isDone = true; - }); - while (!isDone) - { - yield return 0; - } - } - - public IEnumerator InitializeMovieManifest() - { - handleDictionary.Remove("moviemanifest"); - bool isDone = false; - RequestDownload("moviemanifest", isManifest: true, delegate - { - Directory.CreateDirectory(_savePath + "m"); - isDone = true; - }); - while (!isDone) - { - yield return 0; - } - } - - public void ResetDownloadCount() - { - downloadReqCount = 0; - downloadCompCount = 0; - _downloadCompletedSize = 0f; - ResetLoadCount(); - } - - public void ResetLoadCount() - { - loadingReqCount = 0; - loadingCompCount = 0; - loadingManifestCompCount = 0; - } - - public void createSavePath() - { - manifestSavePath = _savePath + "manifest/"; - bundleSavePath = _savePath + "a/"; - soundSavePath = _savePath; - movieSavePath = _savePath; - fontSavePath = _savePath; - } - public string getAssetSavePath(AssetHandle.AssetType _assetType) { switch (_assetType) @@ -1377,91 +345,11 @@ public class AssetManager : MonoBehaviour, IManager } } - public void createPackagePath() - { - manifestPackagePath = _packageDataPath + "manifest/"; - bundlePackagePath = _packageDataPath + "a/"; - soundPackagePath = _packageDataPath; - moviePackagePath = _packageDataPath + CustomPreference.GetLanguageFolderName(); - } - - public string getAssetPackagePath(AssetHandle.AssetType _assetType) - { - switch (_assetType) - { - case AssetHandle.AssetType.Manifests: - return manifestPackagePath; - case AssetHandle.AssetType.AssetBundle: - return bundlePackagePath; - case AssetHandle.AssetType.Sound: - case AssetHandle.AssetType.TemporarySound: - return soundPackagePath; - case AssetHandle.AssetType.Movie: - return moviePackagePath; - case AssetHandle.AssetType.Font: - return fontPackagePath; - default: - return bundlePackagePath; - } - } - - public int GetDownloadMaxCount() - { - return downloadReqCount; - } - - public int GetDownloadCurrentCount() - { - return downloadCompCount; - } - - public float GetDownloadCompletedSize() - { - return _downloadCompletedSize; - } - - public int GetLoadingMaxCount() - { - return loadingReqCount; - } - - public int GetLoadingCurrentCount() - { - return loadingCompCount; - } - - public int GetManifestMaxCount() - { - return categoryNameList.Length; - } - - public int GetManifestCompleteCount() - { - return loadingManifestCompCount; - } - public void AddManifestCount() { loadingManifestCompCount++; } - public void AddDownloadMaxCount(int cnt = -1) - { - if (cnt == -1) - { - downloadReqCount++; - } - else - { - downloadReqCount += cnt; - } - } - - public void AddDownloadCurrentCount() - { - downloadCompCount++; - } - public void AddDownloadCompletedSize(float size) { _downloadCompletedSize += size; @@ -1483,72 +371,4 @@ public class AssetManager : MonoBehaviour, IManager { loadingCompCount++; } - - public void AddNoUnloadAssetGroupName(string name) - { - if (name == "") - { - return; - } - for (int i = 0; i < NoUnloadAssetName.Count; i++) - { - if (NoUnloadAssetName[i].CompareTo(name) == 0) - { - return; - } - } - NoUnloadAssetName.Add(name); - } - - public void RemoveUnloadAssetGroupName(string name) - { - if (!(name == "")) - { - NoUnloadAssetName.Remove(name); - } - } - - public bool CheckSavedDataAccuracy(List DataNameList) - { - if (DataNameList == null) - { - return true; - } - SHA1CryptoServiceProvider sHA1CryptoServiceProvider = new SHA1CryptoServiceProvider(); - int i = 0; - for (int count = DataNameList.Count; i < count; i++) - { - string key = DataNameList[i]; - if (handleDictionary.TryGetValue(key, out var value)) - { - string value2 = Utility.CreateHash(File.ReadAllBytes(value.BuildLocalCachePath())).ToString(); - if (!value.dataHash.Equals(value2)) - { - sHA1CryptoServiceProvider.Clear(); - return false; - } - } - } - sHA1CryptoServiceProvider.Clear(); - return true; - } - - public bool DeleteUnity3dAssetHash(List deleteDataNameList) - { - int i = 0; - for (int count = deleteDataNameList.Count; i < count; i++) - { - string key = deleteDataNameList[i]; - if (handleDictionary.TryGetValue(key, out var value)) - { - Toolbox.SavedataManager.DeleteKey(value.directory + value.filename); - } - } - return true; - } - - public bool IsTemporaryVoice(string fileName) - { - return _temporaryVoiceNameList.Contains(fileName); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/AsyncJob.cs b/SVSim.BattleEngine/Engine/Cute/AsyncJob.cs index 511e02dc..3d52d5a3 100644 --- a/SVSim.BattleEngine/Engine/Cute/AsyncJob.cs +++ b/SVSim.BattleEngine/Engine/Cute/AsyncJob.cs @@ -28,58 +28,17 @@ public class AsyncJob private bool isCancel; - private int? _waitFramesBetweenJobs; - - private int _waitFramesBetweenJobsMin; - - private FramerateProfiler _framerateProfiler = new FramerateProfiler(); - - public int WAIT_FRAMES_INCREMENT = 5; - - public int WAIT_FRAMES_DECREMENT = 1; - - public bool IsIdle - { - get - { - if (!isCancel) - { - return jobList.Count == 0; - } - return false; - } - } - - public int? WantedWaitFramesBetweenJobs - { - set - { - _waitFramesBetweenJobs = value; - _waitFramesBetweenJobsMin = value.GetValueOrDefault(); - } - } - public AsyncJob(MonoBehaviour mono, int num) { this.mono = mono; this.num = num; } - public void Add(IEnumerator enumerator) - { - jobList.Add(new Unit(enumerator, null)); - } - public void Add(IEnumerator enumerator, Action calcelAction) { jobList.Add(new Unit(enumerator, calcelAction)); } - public void Add(Action action) - { - jobList.Add(new Unit(action, null)); - } - public void Add(Action action, Action calcelAction) { jobList.Add(new Unit(action, calcelAction)); @@ -98,85 +57,4 @@ public class AsyncJob { isCancel = false; } - - public void Start() - { - for (int i = 0; i < num; i++) - { - mono.StartCoroutine(MicroThread()); - } - _framerateProfiler = new FramerateProfiler(); - mono.StartCoroutine(RunFpsProfiler()); - } - - private IEnumerator RunFpsProfiler() - { - _framerateProfiler.Init(); - while (true) - { - _framerateProfiler.Update(); - yield return null; - } - } - - private IEnumerator MicroThread() - { - while (true) - { - if (jobList.Count <= 0) - { - yield return null; - continue; - } - Unit unit = jobList[0]; - jobList.RemoveAt(0); - if (isCancel) - { - if (unit.cancelAction != null) - { - unit.cancelAction(); - } - } - else if (unit.action is IEnumerator) - { - yield return mono.StartCoroutine((IEnumerator)unit.action); - if (!_waitFramesBetweenJobs.HasValue) - { - continue; - } - float? fps = _framerateProfiler.Fps; - if (fps.HasValue) - { - if (fps < 20f) - { - _waitFramesBetweenJobs += WAIT_FRAMES_INCREMENT; - _framerateProfiler.Init(); - } - else if (fps > 30f) - { - _waitFramesBetweenJobs -= WAIT_FRAMES_INCREMENT; - if (_waitFramesBetweenJobs.Value < _waitFramesBetweenJobsMin) - { - _waitFramesBetweenJobs = _waitFramesBetweenJobsMin; - } - _framerateProfiler.Init(); - } - } - yield return WaitFrames(_waitFramesBetweenJobs.Value); - } - else if (unit.action is Action) - { - ((Action)unit.action)(); - } - } - } - - private static IEnumerator WaitFrames(int frameCount) - { - while (frameCount > 0) - { - frameCount--; - yield return null; - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/AudioManager.cs b/SVSim.BattleEngine/Engine/Cute/AudioManager.cs deleted file mode 100644 index f1a5cb59..00000000 --- a/SVSim.BattleEngine/Engine/Cute/AudioManager.cs +++ /dev/null @@ -1,808 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using CriWare; -using UnityEngine; - -namespace Cute; - -public class AudioManager : MonoBehaviour, IManager -{ - [SerializeField] - private GameObject _bgmParent; - - [SerializeField] - private CriAtomSource[] _bgm; - - private int _bgmSourceCount; - - [SerializeField] - private GameObject _seParent; - - [SerializeField] - private CriAtomSource[] _se; - - private int _seSourceCount; - - private SoundData[] _playingSe; - - [SerializeField] - private GameObject _voiceParent; - - [SerializeField] - private CriAtomSource[] _voice; - - private int _voiceSourceCount; - - private bool _bgmPlaySuspend; - - private const int BGM_FADEOUT_TIME = 500; - - private const int SONG_PREVIEW_FADE_TIME = 500; - - private const int SONG_PREVIEW_FADE_SPACE_TIME = 1500; - - private const float SE_FADE_TIME = 0.5f; - - public const int DELAY_TIME_OFFSET = -4; - - private const float VOULMN_BOOST_FACTOR = 1.5f; - - public const string ACB_EXTENSION_WITHPARAM = "{0}.acb"; - - public const string ACB_EXTENSION = ".acb"; - - public const string AWB_EXTENSION_WITHPARAM = "{0}.awb"; - - public const string AWB_EXTENSION = ".awb"; - - private const string STR_SUBFOLDER_BGM = "b/"; - - public const string STR_SUBFOLDER_SE = "s/"; - - private const string STR_SUBFOLDER_SONG = "l/"; - - private const string STR_SUBFOLDER_VOICE = "v/"; - - private const string STR_SUBFOLDER_STORY = "c/"; - - private const string STR_SUBFOLDER_ROOM = "r/"; - - public bool isDownloadVoiceUse = true; - - protected bool _isRedy; - - private bool _noSeMode; - - private CriAtomExPlayback _playback; - - private CriAtomExPlayback _bgmPlayback; - - private float _sampleTime; - - private int _delayTime; - - private int _criDelayTime; - - private int _criInitializeCount; - - private const int CRI_RETRY_COUNT = 3; - - private Dictionary _acbDictionary = new Dictionary(); - - private string[] STR_PREINSTALL_FILENAME = new string[1] { "preinstall" }; - - public const float VOICE_MASTER_VOLUME = 0.8f; - - private Action _callbackVoiseEnd; - - private string _bgmName = ""; - - private int _cueId = -1; - - private string _bgmCue = ""; - - public bool isRedy => _isRedy; - - public int delayTime - { - get - { - return _delayTime; - } - set - { - _delayTime = value; - } - } - - public string bgmName - { - get - { - return _bgmName; - } - set - { - _bgmName = value; - } - } - - public int cueId - { - get - { - return _cueId; - } - set - { - _cueId = value; - } - } - - public string bgmCue - { - get - { - return _bgmCue; - } - set - { - _bgmCue = value; - } - } - - private void Awake() - { - } - - private IEnumerator Start() - { - _bgm = _bgmParent.GetComponentsInChildren(); - _bgmSourceCount = _bgm.Length; - for (int i = 0; i < _bgmSourceCount; i++) - { - CriAtomExPlayer player = _bgm[i].player; - player.AttachFader(); - player.ResetFaderParameters(); - player.SetFadeOutTime(500); - } - _se = _seParent.GetComponentsInChildren(); - _seSourceCount = _se.Length; - _playingSe = new SoundData[_seSourceCount]; - for (int j = 0; j < _seSourceCount; j++) - { - CriAtomExPlayer player2 = _se[j].player; - player2.AttachFader(); - player2.ResetFaderParameters(); - } - _voice = _voiceParent.GetComponentsInChildren(); - _voiceSourceCount = _voice.Length; - for (int k = 0; k < _voiceSourceCount; k++) - { - CriAtomExPlayer player3 = _voice[k].player; - player3.AttachFader(); - player3.ResetFaderParameters(); - } - Toolbox.AudioManager = this; - yield break; - } - - public void ResetSoundMode() - { - _noSeMode = false; - } - - private void Update() - { - } - - public void PauseAllBgm(bool pauseStatus) - { - if (pauseStatus) - { - _bgmPlaySuspend = false; - for (int i = 0; i < _bgmSourceCount; i++) - { - if (_bgm[i].status == CriAtomSource.Status.Prep || _bgm[i].status == CriAtomSource.Status.Playing) - { - _bgm[i].Pause(sw: true); - _bgmPlaySuspend = true; - } - } - } - else if (_bgmPlaySuspend) - { - for (int j = 0; j < _bgmSourceCount; j++) - { - _bgm[j].Pause(sw: false); - } - } - } - - public long GetMusicLength(string acbName) - { - CriAtomExAcb acb = CriAtom.GetAcb(acbName); - if (acb != null && acb.GetCueInfo(0, out var info)) - { - return info.length; - } - return -1L; - } - - public bool IsAvailableCueSheet(string cueName) - { - CriAtomCueSheet cueSheet = CriAtom.GetCueSheet(cueName); - if (cueSheet != null) - { - return cueSheet.acb != null; - } - return false; - } - - public bool AddCueSheet(string _name, string acbFile, string subFolderPath, string awbname = "") - { - _name = _name.Replace(".acb", ""); - if (CriAtom.GetCueSheet(_name) != null || CriAtom.GetCueSheet(acbFile) != null) - { - return true; - } - bool flag = false; - int num = STR_PREINSTALL_FILENAME.Length; - for (int i = 0; i < num; i++) - { - if (string.Compare(_name, STR_PREINSTALL_FILENAME[i]) == 0) - { - flag = true; - break; - } - } - if (flag) - { - acbFile = $"{subFolderPath}{acbFile}"; - awbname = $"{subFolderPath}{awbname}"; - } - else - { - acbFile = string.Format("{0}{1}{2}{3}", Application.persistentDataPath, "/", subFolderPath, acbFile); - awbname = string.Format("{0}{1}{2}{3}", Application.persistentDataPath, "/", subFolderPath, awbname); - } - CriAtomCueSheet criAtomCueSheet = CriAtom.AddCueSheet(_name, acbFile, awbname); - if (criAtomCueSheet == null) - { - return false; - } - if (criAtomCueSheet.acb == null) - { - RemoveCueSheet(_name); - return false; - } - return true; - } - - public bool AddCueSheetFromFileName(string _name, string acbFile, string awbname) - { - _name = _name.Replace(".acb", ""); - int num = STR_PREINSTALL_FILENAME.Length; - for (int i = 0; i < num && string.Compare(_name, STR_PREINSTALL_FILENAME[i]) != 0; i++) - { - } - if (CriAtom.GetCueSheet(_name) != null) - { - return true; - } - CriAtomCueSheet criAtomCueSheet = CriAtom.AddCueSheet(_name, acbFile, awbname); - if (criAtomCueSheet == null) - { - return false; - } - if (criAtomCueSheet.acb == null) - { - RemoveCueSheet(_name); - return false; - } - return true; - } - - public void RemoveCueSheet(string name) - { - name = name.Replace(".awb", ""); - name = name.Replace(".acb", ""); - name = name.Replace("s/", ""); - name = name.Replace("b/", ""); - CriAtom.RemoveCueSheet(name); - } - - public void RemoveCueSheet(List nameList) - { - for (int i = 0; i < nameList.Count; i++) - { - RemoveCueSheet(nameList[i]); - } - } - - public float GetSampleTime() - { - long numSamples = 0L; - int samplingRate = 0; - if (_playback.GetNumPlayedSamples(out numSamples, out samplingRate)) - { - _sampleTime = (float)numSamples / (float)samplingRate; - } - return _sampleTime; - } - - private void OnDestroy() - { - foreach (KeyValuePair item in _acbDictionary) - { - item.Value.Dispose(); - } - } - - public int GetDelayTimeFromCRI() - { - int result = 0; - if (_criInitializeCount >= 3) - { - return result; - } - return _criDelayTime / 10; - } - - public CriAtomSource GetBgmSource(int bgmId) - { - return _bgm[bgmId]; - } - - public int GetBgmMaxCount() - { - return _bgmSourceCount; - } - - public void VolumeUpdate_Bgm(int level, bool mute, int bgmId = -1) - { - if (bgmId < 0) - { - int num = _bgm.Length; - for (int i = 0; i < num; i++) - { - Volume_Bgm((float)level * 0.1f, mute, i); - } - } - else - { - Volume_Bgm((float)level * 0.1f, mute, bgmId); - } - } - - public void Volume_Bgm(float level, bool mute, int bgmId = -1) - { - if (mute) - { - level = 0f; - } - if (bgmId < 0) - { - int num = _bgm.Length; - for (int i = 0; i < num; i++) - { - _bgm[i].volume = level; - _bgm[i].player.Update(_bgmPlayback); - } - } - else - { - _bgm[bgmId].volume = level; - _bgm[bgmId].player.Update(_bgmPlayback); - } - } - - public bool IsPlayBgm(int bgmId = 0) - { - if (_bgm[bgmId].status == CriAtomSource.Status.Prep || _bgm[bgmId].status == CriAtomSource.Status.Playing) - { - return true; - } - return false; - } - - public int PlayBgmFromName(string cueSheet, string cueName, string acbName, string awbName = "", int bgmId = 0, bool loop = true, float FadeInfime = 0f, float OffsetTime = 0f, long startTime = 0L) - { - if (_bgmName == cueName) - { - return -1; - } - string acbFile = ""; - string awbname = ""; - if (acbName.CompareTo("") != 0) - { - acbFile = acbName + ".acb"; - } - if (awbName.CompareTo("") != 0) - { - awbname = awbName + ".awb"; - } - if (AddCueSheet(cueSheet, acbFile, "b/", awbname)) - { - StopBgm(bgmId); - _bgm[bgmId].cueSheet = cueSheet; - _bgm[bgmId].cueName = cueName; - _bgm[bgmId].player.ResetFaderParameters(); - _bgm[bgmId].player.SetStartTime(startTime); - _bgm[bgmId].player.SetFadeInTime((int)(FadeInfime * 1000f)); - _bgm[bgmId].player.SetFadeInStartOffset((int)(OffsetTime * 1000f)); - _bgm[bgmId].loop = loop; - _bgmPlayback = _bgm[bgmId].Play(); - _bgmName = cueName; - return 0; - } - return -1; - } - - public int PlayBgmFromId(string cueSheet, int cueId, int bgmId = 0, bool loop = true, float FadeInfime = 0f, float OffsetTime = 0f, long startTime = 0L) - { - if (_bgmCue == cueSheet && cueId == _cueId) - { - return -1; - } - if (CriAtom.GetCueSheet(cueSheet) != null) - { - StopBgm(bgmId); - _bgm[bgmId].cueSheet = cueSheet; - _bgm[bgmId].player.ResetFaderParameters(); - _bgm[bgmId].player.SetStartTime(startTime); - _bgm[bgmId].player.SetFadeInTime((int)(FadeInfime * 1000f)); - _bgm[bgmId].player.SetFadeInStartOffset((int)(OffsetTime * 1000f)); - _bgm[bgmId].loop = loop; - _bgmPlayback = _bgm[bgmId].Play(cueId); - _cueId = cueId; - _bgmCue = ""; - return 1; - } - return 0; - } - - public void StopBgm(int bgmId = 0) - { - _bgmName = ""; - _bgm[bgmId].Stop(); - } - - public void PauseBgm(bool isPause, int bgmId = 0) - { - _bgm[bgmId].Pause(isPause); - } - - public void StopFadeBgm(int bgmId = 0, float time = 0.5f) - { - _bgm[bgmId].player.SetFadeOutTime((int)(time * 1000f)); - StopBgm(bgmId); - } - - public void SetBgmVolume(float volume) - { - GameMgr.GetIns().GetSoundMgr().SetBgmVolume(volume); - } - - public void StartCoroutine_DelayMethod(float waitTime, Action process) - { - StartCoroutine(Timer.DelayMethod(waitTime, process)); - } - - public void VolumeUpdate_Se(int level, bool mute) - { - Volume_Se((float)level * 0.1f, mute); - } - - public void Volume_Se(float level, bool mute) - { - if (mute) - { - level = 0f; - } - for (int i = 0; i < _seSourceCount; i++) - { - _se[i].volume = level; - } - } - - public int PlaySeFromId(ref SoundData seData, bool loop = false) - { - int index = -1; - CriAtomSource criAtomSource = FindSe(ref seData, out index); - if (criAtomSource != null) - { - criAtomSource.cueSheet = seData._acbName; - criAtomSource.loop = loop; - CriAtomExPlayer player = criAtomSource.player; - player.ResetFaderParameters(); - player.SetFadeOutTime(0); - criAtomSource.Play(seData._cueName); - return index; - } - return index; - } - - public int PlaySeFromId(string cueName, int cueId, bool loop = false) - { - if (!IsAvailableCueSheet(cueName)) - { - return -1; - } - for (int i = 0; i < _seSourceCount; i++) - { - if (_se[i].status == CriAtomSource.Status.PlayEnd) - { - _se[i].Stop(); - } - if (_se[i].status == CriAtomSource.Status.Stop) - { - _se[i].cueSheet = cueName; - _se[i].loop = loop; - _se[i].Play(cueId); - return i; - } - } - return -1; - } - - private CriAtomSource FindSe(ref SoundData seData, out int index) - { - index = -1; - if (_noSeMode) - { - return null; - } - if (!IsAvailableCueSheet(seData._acbName)) - { - Debug.LogError($"No Include Acb!!!:{seData._acbName},{seData._cueName}"); - return null; - } - for (int i = 0; i < _seSourceCount; i++) - { - if (_se[i].status == CriAtomSource.Status.PlayEnd) - { - _se[i].Stop(); - } - if (_se[i].status == CriAtomSource.Status.Stop) - { - index = i; - return _se[i]; - } - } - return null; - } - - public int PlaySe(string cueName, int cueId, bool loop = false) - { - if (!IsAvailableCueSheet(cueName)) - { - return -1; - } - for (int i = 0; i < _seSourceCount; i++) - { - if (_se[i].status == CriAtomSource.Status.PlayEnd) - { - _se[i].Stop(); - } - if (_se[i].status == CriAtomSource.Status.Stop) - { - _se[i].cueSheet = cueName; - _se[i].loop = loop; - _se[i].Play(cueId); - return i; - } - } - return -1; - } - - public void StopSe(int index, float fadeout = 500f) - { - if (index >= 0 && index < _seSourceCount) - { - ResumeSe(index); - _se[index].player.SetFadeOutTime((int)(fadeout * 1000f)); - _se[index].Stop(); - } - } - - public void StopSe(string cuename, float fadeout = 500f) - { - for (int i = 0; i < _se.Length; i++) - { - if (_se[i].cueName.CompareTo(cuename) == 0) - { - ResumeSe(i); - _se[i].player.SetFadeOutTime((int)(fadeout * 1000f)); - _se[i].Stop(); - } - } - } - - public void StopSeAll(float fadeout = 500f) - { - for (int i = 0; i < _seSourceCount; i++) - { - StopSe(i, fadeout); - } - } - - public void PauseSe(int index) - { - if (index >= 0 && index < _seSourceCount && (_se[index].status == CriAtomSource.Status.Playing || _se[index].status == CriAtomSource.Status.Prep)) - { - _se[index].Pause(sw: true); - } - } - - public void ResumeSe(int index) - { - if (index >= 0 && index < _seSourceCount && _se[index].status == CriAtomSource.Status.Playing) - { - _se[index].Pause(sw: false); - } - } - - public bool IsPlaySe(string cueName, int cueId) - { - for (int i = 0; i < _seSourceCount; i++) - { - if (_playingSe[i]._cueName == cueName && _playingSe[i]._cueId == cueId && (_se[i].status == CriAtomSource.Status.Prep || _se[i].status == CriAtomSource.Status.Playing)) - { - return true; - } - } - return false; - } - - public bool IsPlaySe(string cueSheetName, string cueName, out int number) - { - number = 0; - for (int i = 0; i < _seSourceCount; i++) - { - if (_playingSe[i]._acbName == cueSheetName && _playingSe[i]._cueName == cueName && _se[i].status == CriAtomSource.Status.Playing) - { - number++; - } - } - if (number > 0) - { - return true; - } - return false; - } - - public bool IsPrepSe(string cueSheetName, string cueName, out int number) - { - number = 0; - for (int i = 0; i < _seSourceCount; i++) - { - if (_playingSe[i]._acbName == cueSheetName && _playingSe[i]._cueName == cueName && _se[i].status == CriAtomSource.Status.Prep) - { - number++; - } - } - if (number > 0) - { - return true; - } - return false; - } - - public void ResetSe() - { - for (int i = 0; i < _seSourceCount; i++) - { - _se[i].Stop(); - _se[i].Pause(sw: false); - } - } - - public bool IsPlaySe(int index) - { - if (_se[index].status == CriAtomSource.Status.Prep || _se[index].status == CriAtomSource.Status.Playing) - { - return true; - } - return false; - } - - public void SetAisac(string cuename, string param, float num) - { - for (int i = 0; i < _se.Length; i++) - { - if (_se[i].cueName.CompareTo(cuename) == 0) - { - _se[i].SetAisacControl(param, num); - } - } - } - - public int PlaySeFromName(string acbName, string seName, bool loop = false, float fadeInfime = 0f, long startTime = 0L) - { - if (!IsAvailableCueSheet(acbName)) - { - return -1; - } - for (int i = 0; i < _seSourceCount; i++) - { - if (_se[i].status == CriAtomSource.Status.PlayEnd) - { - _se[i].Stop(); - } - if (_se[i].status == CriAtomSource.Status.Stop) - { - _se[i].cueSheet = acbName; - _se[i].cueName = seName; - _se[i].loop = loop; - _se[i].player.ResetFaderParameters(); - _se[i].player.SetStartTime(startTime); - _se[i].player.SetFadeInTime((int)(fadeInfime * 1000f)); - _se[i].Play(seName); - return i; - } - } - return -1; - } - - public int GetVoiceSourceCount() - { - return _voiceSourceCount; - } - - public void VolumeUpdate_Voice(int level, bool mute, int voiceId = -1) - { - Volume_Voice((float)level * 0.1f, mute, voiceId); - } - - public void Volume_Voice(float level, bool mute, int voiceId = -1) - { - if (mute) - { - level = 0f; - } - if (voiceId < 0) - { - int num = _voice.Length; - for (int i = 0; i < num; i++) - { - _voice[i].volume = level; - } - } - else - { - _voice[voiceId].volume = level; - } - } - - public bool IsPlayVoice(int index) - { - if (_voice[index].status == CriAtomSource.Status.Prep || _voice[index].status == CriAtomSource.Status.Playing) - { - return true; - } - return false; - } - - public void PlayVoice(int voiceId, string acbFile, string cueSheet, string cueName) - { - AddCueSheet(cueSheet, acbFile, "v/"); - _voice[voiceId].Play(cueName); - } - - public void PlayVoice(int voiceId, string cueName) - { - _voice[voiceId].Play(cueName); - } - - public void StopVoice(int voiceId, float fadetout = 500f) - { - CriAtomSource criAtomSource = _voice[voiceId]; - if (criAtomSource != null && criAtomSource.player != null) - { - criAtomSource.player.SetFadeOutTime((int)(fadetout * 1000f)); - criAtomSource.Stop(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/BootApp.cs b/SVSim.BattleEngine/Engine/Cute/BootApp.cs index be8f4444..9b9f10c1 100644 --- a/SVSim.BattleEngine/Engine/Cute/BootApp.cs +++ b/SVSim.BattleEngine/Engine/Cute/BootApp.cs @@ -9,67 +9,4 @@ namespace Cute; public class BootApp : MonoBehaviour { public static string BootScene; - - private Coroutine _logCoroutine; - - private string _logMsg = ""; - - private IEnumerator Start() - { - _logCoroutine = StartCoroutine(WaitToAccumulateTraceLog()); - _logMsg += "start"; - createMutex(); - restrainOSXProcess(); - startSteamClient(); - while (Toolbox.BootSystem == null) - { - yield return 0; - } - _logMsg += "start2"; - CultureInfo.DefaultThreadCurrentUICulture = (CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("ja-JP", useUserOverride: false)); - Toolbox.AssetManager.createSavePath(); - yield return StartCoroutine(FontChanger.FontTryChangePersistant(null)); - _logMsg += "start3"; - _logMsg += "start4"; - StopCoroutine(_logCoroutine); - changeScene(); - } - - private IEnumerator WaitToAccumulateTraceLog() - { - yield return new WaitForSeconds(5f); - LocalLog.AccumulateTraceInquiryLog("BootApp " + _logMsg); - } - - private void createMutex() - { - Toolbox.mute = new Mutex(initiallyOwned: false, "Global\\ShadowversePcPlatformGlobalThread"); - if (Toolbox.mute != null && !Toolbox.mute.WaitOne(0, exitContext: false)) - { - Toolbox.mute.Close(); - Toolbox.mute = null; - Application.Quit(); - } - } - - private void startSteamClient() - { - _ = SteamManager.Initialized; - } - - private void restrainOSXProcess() - { - } - - private void changeScene() - { - if (BootScene != null) - { - Toolbox.SceneManager.ChangeScene(BootScene); - } - else - { - Toolbox.SceneManager.ChangeScene(SceneType._Splash); - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/BootNetwork.cs b/SVSim.BattleEngine/Engine/Cute/BootNetwork.cs index e1275ecf..70db66d4 100644 --- a/SVSim.BattleEngine/Engine/Cute/BootNetwork.cs +++ b/SVSim.BattleEngine/Engine/Cute/BootNetwork.cs @@ -6,9 +6,6 @@ namespace Cute; public class BootNetwork : MonoBehaviour { - public bool _autoSetup; - - public static bool IsDoneLanguageSetting; public bool IsDoneGameStartCheck { get; set; } @@ -16,78 +13,4 @@ public class BootNetwork : MonoBehaviour { Object.DontDestroyOnLoad(base.gameObject); } - - private IEnumerator Start() - { - while (Toolbox.BootSystem == null) - { - yield return 0; - } - while (Toolbox.NetworkManager == null) - { - yield return 0; - } - Toolbox.BootNetwork = this; - if (_autoSetup) - { - SetupNetwork(); - } - SetupNetworkLanguage(); - while (!IsDoneLanguageSetting) - { - yield return 0; - } - } - - private void OnDestroy() - { - } - - public void SetupNetwork() - { - if (!IsDoneGameStartCheck) - { - StartCoroutine(SetupNetworkCoroutine()); - } - } - - public void SetupNetworkLanguage() - { - string text = Toolbox.SavedataManager.GetString("LANG_SETTING"); - if (text == "Jpn") - { - Toolbox.SavedataManager.DeleteKey("LANG_SETTING"); - Toolbox.SavedataManager.DeleteKey("LANG_SOUND_SETTING"); - text = ""; - Toolbox.AssetManager.ClearAllAssetFile(); - Toolbox.AssetManager.ClearAssetCacheAssetBundle(); - } - if (string.IsNullOrEmpty(text)) - { - CustomPreference.SetScemeMode(CustomPreference.eSchemeType.Https); - CustomPreference.SetApplicationServerURL("utoongaize.shadowverse.jp/shadowverse/"); - } - else - { - IsDoneLanguageSetting = true; - } - } - - private IEnumerator SetupNetworkCoroutine() - { - if (!IsDoneGameStartCheck) - { - yield return StartCoroutine(Toolbox.NetworkManager._certification.Login()); - } - } - - public IEnumerator SetupNetworkCertification() - { - SetupNetwork(); - while (!IsDoneGameStartCheck) - { - yield return 0; - } - yield return StartCoroutine(Toolbox.AssetManager.InitializeManifest(null, Data.Load.data._userTutorial.tutorial_step != 100)); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/BootSystem.cs b/SVSim.BattleEngine/Engine/Cute/BootSystem.cs index 9bb024c5..57b1b2ec 100644 --- a/SVSim.BattleEngine/Engine/Cute/BootSystem.cs +++ b/SVSim.BattleEngine/Engine/Cute/BootSystem.cs @@ -2,9 +2,7 @@ using System; using System.Collections; using System.Diagnostics; -using com.adjust.sdk; using RedShellUnity; -using Steamworks; using UnityEngine; using Wizard; @@ -12,18 +10,9 @@ namespace Cute; public class BootSystem : MonoBehaviour { - [SerializeField] - [Tooltip("チェックするとMaxFramerateが有効")] - private bool _dontVsync; - - [SerializeField] - [Range(0f, 60f)] - private int _maxFramerate; public static bool isRootBootCamera; - private Coroutine _logCoroutine; - private string _logMsg = ""; private void Awake() @@ -38,84 +27,6 @@ public class BootSystem : MonoBehaviour UnityEngine.Object.DontDestroyOnLoad(base.gameObject); } - private IEnumerator Start() - { - _logCoroutine = StartCoroutine(WaitToAccumulateTraceLog()); - _logMsg += " Start"; - while (Toolbox.DeviceManager == null) - { - yield return 0; - } - _logMsg += " DeviceManager"; - while (Toolbox.SavedataManager == null) - { - yield return 0; - } - _logMsg += " SavedataManager"; - while (Toolbox.QualityManager == null) - { - yield return 0; - } - _logMsg += " QualityManager"; - while (Toolbox.SceneManager == null) - { - yield return 0; - } - _logMsg += " SceneManager"; - while (Toolbox.ResourcesManager == null) - { - yield return 0; - } - _logMsg += " ResourcesManager"; - while (Toolbox.AssetManager == null) - { - yield return 0; - } - _logMsg += " AssetManager"; - while (Toolbox.AudioManager == null) - { - yield return 0; - } - _logMsg += " AudioManager"; - while (Toolbox.MovieManager == null) - { - yield return 0; - } - _logMsg += " MovieManager"; - SocialServiceUtility.CreateInstance(); - bootAdjust(); - setupRedShell(); - if (_dontVsync) - { - QualitySettings.vSyncCount = 0; - Application.targetFrameRate = _maxFramerate; - } - StopCoroutine(_logCoroutine); - Toolbox.BootSystem = this; - } - - private IEnumerator WaitToAccumulateTraceLog() - { - yield return new WaitForSeconds(5f); - LocalLog.AccumulateTraceInquiryLog("BootSystem " + _logMsg); - } - - private void bootAdjust() - { - try - { - } - catch (Exception ex) - { - LocalLog.AccumulateTraceLog(ex.ToString()); - } - Adjust.addSessionCallbackParameter("viewer_id", Certification.ViewerId.ToString()); - } - - private void OnDestroy() - { - } - public void VisibleBootCamera(bool enable) { GameObject gameObject = base.transform.Find("BootCamera").gameObject; @@ -124,22 +35,4 @@ public class BootSystem : MonoBehaviour gameObject.SetActive(enable); } } - - [Conditional("STEAM")] - private void setupRedShell() - { - RedShell.SetVerboseLogs(verboseLogs: true); - RedShell.SetApiKey("04b8d4a58416140132fdcd680b17a0d8"); - try - { - RedShell.SetUserId(SteamUser.GetSteamID().m_SteamID.ToString()); - } - catch (Exception ex) - { - Debug.LogError("steam client が起動していない。steamの機能を使えません。"); - Debug.LogError(ex.Message); - Debug.LogError(ex.StackTrace); - } - RedShell.MarkConversion(); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/Certification.cs b/SVSim.BattleEngine/Engine/Cute/Certification.cs index 89cc8437..7e037b3c 100644 --- a/SVSim.BattleEngine/Engine/Cute/Certification.cs +++ b/SVSim.BattleEngine/Engine/Cute/Certification.cs @@ -1,18 +1,18 @@ using System; using System.Collections; using System.Text; -using Steamworks; using UnityEngine; using Wizard; using Wizard.Title; +// TODO(engine-cleanup-pass2): 43 of 45 methods unrun in baseline +// Type: Cute.Certification +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Cute; public class Certification : MonoBehaviour { - public static bool CheckUrlScheme; - - private const int ERROR_CODE_ACCOUNT_REMOVED = 5607; private static string udid; @@ -20,10 +20,6 @@ public class Certification : MonoBehaviour private static string sessionId; - private const float DELAY_TIME = 0.02f; - - protected Callback m_GetAuthSessionTicketResponse; - public static string Udid { get @@ -38,13 +34,11 @@ public class Certification : MonoBehaviour public static int ViewerId { - // Post-Task-8: strictly ambient. The historical SavedataManager-backed lazy decode was the - // client process's single-viewer-id source; in the headless multi-instance world the viewer - // id MUST come from the per-session ambient context. Setter is a no-op (BattleAmbientContext - // .ViewerId is `init`-only — fixed at scope entry per design — and the historical caller - // (SavedataManager.SetInt + Save) is dead in the server world). - get => SVSim.BattleEngine.Ambient.BattleAmbient.Require().ViewerId; - set { /* ambient ViewerId is init-only; SavedataManager path is dead headless */ } + // Instance-backed via BattleManagerBase.InstanceViewerId (Phase 5, chunk 40 — ambient + // fallback dropped; all consumers routed through mgr in chunks 38-39). Default 1001 matches + // EngineGlobalInit.ThisViewerId. Setter no-op preserved from Phase-4 semantics. + get => BattleManagerBase.GetIns()?.InstanceViewerId ?? 1001; + set { /* no-op; SavedataManager path dead headless */ } } public static int ShortUdid @@ -80,23 +74,10 @@ public class Certification : MonoBehaviour } } - public static string dmmViewerId { get; private set; } - - public static string dmmOnetimeToken { get; private set; } - public static ulong SteamID { get; private set; } public static string SteamSessionTicket { get; private set; } - public static bool IsExistsViewerId() - { - if (ViewerId != 0) - { - return true; - } - return false; - } - public static string GetEncodedViewerId() { string s = CryptAES.encrypt(ViewerId.ToString()); @@ -122,244 +103,4 @@ public class Certification : MonoBehaviour { return ""; } - - public static void SetKeyChainViewerId(string viewerId) - { - } - - public static void DeleteKeyChainViewerId() - { - } - - public static void InitializeFileds() - { - sessionId = null; - udid = null; - short_udid = 0; - Toolbox.SavedataManager.SetInt("VIEWER_ID", 0); - Toolbox.SavedataManager.SetInt("SHORT_UDID", 0); - Toolbox.SavedataManager.SetString("UDID", ""); - } - - public IEnumerator Login() - { - if (ViewerId == 0) - { - GenerateUdid(); - SignUpTask signUpTask = new SignUpTask(); - signUpTask.SetParameter(); - yield return StartCoroutine(Toolbox.NetworkManager.Connect(signUpTask, delegate - { - StartCoroutine(GameStartCheckTaskExec()); - }, delegate - { - if (Toolbox.BootNetwork != null) - { - Toolbox.BootNetwork.IsDoneGameStartCheck = false; - } - OutOfService.ShowServiceEndedDialogIfNeeded(); - }, delegate - { - if (Toolbox.BootNetwork != null) - { - Toolbox.BootNetwork.IsDoneGameStartCheck = false; - } - })); - } - else - { - yield return StartCoroutine(GameStartCheckTaskExec()); - } - } - - public static bool IsiCloudAvailable() - { - return false; - } - - public static void SetiCloudUser() - { - } - - public static void EraseiCloudUser() - { - } - - public static string GetiCloudUser() - { - return ""; - } - - public void CheckiCloudUserData(Action callback) - { - GetiCloudUserDataTask.VerifiediCloudUserData.Reset(); - string text = GetiCloudUser(); - if (string.IsNullOrEmpty(text)) - { - callback(NetworkTask.ResultCode.Success); - return; - } - GenerateUdid(); - GetiCloudUserDataTask getiCloudUserDataTask = new GetiCloudUserDataTask(); - getiCloudUserDataTask.SetParameter(text); - StartCoroutine(Toolbox.NetworkManager.Connect(getiCloudUserDataTask, callback)); - } - - public void MigrateiCloudUserData(Action callback) - { - string parameter = GetiCloudUser(); - UpdateiCloudUserDataTask updateiCloudUserDataTask = new UpdateiCloudUserDataTask(); - updateiCloudUserDataTask.SetParameter(parameter); - StartCoroutine(Toolbox.NetworkManager.Connect(updateiCloudUserDataTask, callback)); - } - - public void FirstTimeSaveiCloudUserData() - { - if (IsiCloudAvailable() && string.IsNullOrEmpty(GetiCloudUser())) - { - SetiCloudUser(); - } - } - - public IEnumerator GameStartCheckTaskExec() - { - GameStartCheckTask gameStartCheckTask = new GameStartCheckTask(); - gameStartCheckTask.AddSkipCuteCheckResultCode(5607); - gameStartCheckTask.SetParameter(); - bool isRemoveAccount = false; - yield return StartCoroutine(Toolbox.NetworkManager.Connect(gameStartCheckTask, delegate - { - if (Toolbox.BootNetwork != null) - { - Toolbox.BootNetwork.IsDoneGameStartCheck = true; - } - URLScheme.ClearCampaignData(); - }, delegate - { - if (Toolbox.BootNetwork != null) - { - Toolbox.BootNetwork.IsDoneGameStartCheck = false; - } - OutOfService.ShowServiceEndedDialogIfNeeded(); - }, delegate(int resultCode) - { - if (Toolbox.BootNetwork != null) - { - Toolbox.BootNetwork.IsDoneGameStartCheck = false; - } - URLScheme.ClearCampaignData(); - if (resultCode == 5607) - { - isRemoveAccount = true; - OnRemoveAccount(); - } - })); - if (isRemoveAccount) - { - while (true) - { - yield return null; - } - } - } - - private void OnRemoveAccount() - { - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("MyPage_0097")); - dialogBase.SetTitleLabel(Data.SystemText.Get("ErrorHeader_0001")); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.OnClose = delegate - { - UserInfoRequest.DeleteUserData(); - }; - } - - public void GenerateUdid() - { - udid = Cryptographer.decode(Toolbox.SavedataManager.GetString("UDID")); - if (string.IsNullOrEmpty(udid)) - { - Toolbox.SavedataManager.SetString("UDID", Cryptographer.encode(Guid.NewGuid().ToString())); - Toolbox.SavedataManager.Save(); - } - } - - public static bool IsLogined() - { - return !string.IsNullOrEmpty(sessionId); - } - - private IEnumerator Start() - { - while (Toolbox.BootSystem == null) - { - yield return 0; - } - SessionId = ""; - setDmmPlatformData(); - setSTEAMPlatformData(); - URLSchemeStart(); - } - - private void OnApplicationFocus(bool focus) - { - if (focus) - { - URLSchemeStart(); - } - } - - private void URLSchemeStart() - { - if (CheckUrlScheme) - { - StartCoroutine(Delay(0.02f, delegate - { - })); - } - } - - private IEnumerator Delay(float waitTime, Action action) - { - yield return new WaitForSeconds(waitTime); - action(); - } - - private void setSTEAMPlatformData() - { - try - { - SteamID = SteamUser.GetSteamID().m_SteamID; - m_GetAuthSessionTicketResponse = Callback.Create(OnGetAuthSessionTicketResponse); - byte[] array = new byte[1024]; - SteamNetworkingIdentity pSteamNetworkingIdentity = default(SteamNetworkingIdentity); - SteamUser.GetAuthSessionTicket(array, array.Length, out var pcbTicket, ref pSteamNetworkingIdentity); - Array.Resize(ref array, (int)pcbTicket); - StringBuilder stringBuilder = new StringBuilder(); - for (int i = 0; i < pcbTicket; i++) - { - stringBuilder.AppendFormat("{0:x2}", array[i]); - } - SteamSessionTicket = stringBuilder.ToString(); - } - catch (Exception ex) - { - Debug.LogError("steam client が起動していない。steamの機能を使えません。"); - Debug.LogError(ex.Message); - Debug.LogError(ex.StackTrace); - } - } - - private void OnGetAuthSessionTicketResponse(GetAuthSessionTicketResponse_t pCallback) - { - } - - private void setDmmPlatformData() - { - } - - public void URLSchemeStartiOS(string message) - { - URLScheme.URLSchemeStartiOS(message); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/CryptAES.cs b/SVSim.BattleEngine/Engine/Cute/CryptAES.cs index 7f2fafb8..4151a8f3 100644 --- a/SVSim.BattleEngine/Engine/Cute/CryptAES.cs +++ b/SVSim.BattleEngine/Engine/Cute/CryptAES.cs @@ -61,37 +61,6 @@ public class CryptAES return array4; } - public static string EncryptRJ256(string prm_text_to_encrypt) - { - using RijndaelManaged rijndaelManaged = new RijndaelManaged(); - rijndaelManaged.Padding = PaddingMode.Zeros; - rijndaelManaged.Mode = CipherMode.CBC; - rijndaelManaged.KeySize = 256; - rijndaelManaged.BlockSize = 256; - byte[] array = new byte[0]; - byte[] array2 = new byte[0]; - string s = Cryptographer.generateKeyString(); - string s2 = Certification.Udid.Replace("-", ""); - array = Encoding.UTF8.GetBytes(s); - array2 = Encoding.UTF8.GetBytes(s2); - ICryptoTransform transform = rijndaelManaged.CreateEncryptor(array, array2); - using MemoryStream memoryStream = new MemoryStream(); - using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write); - byte[] bytes = Encoding.UTF8.GetBytes(prm_text_to_encrypt); - cryptoStream.Write(bytes, 0, bytes.Length); - cryptoStream.FlushFinalBlock(); - byte[] array3 = memoryStream.ToArray(); - byte[] array4 = new byte[array3.Length + array.Length]; - Array.Copy(array3, 0, array4, 0, array3.Length); - Array.Copy(array, 0, array4, array3.Length, array.Length); - rijndaelManaged.Clear(); - memoryStream.Flush(); - memoryStream.Close(); - cryptoStream.Flush(); - cryptoStream.Close(); - return Convert.ToBase64String(array4); - } - public static string EncryptRJ256ForNode(string prm_text_to_encrypt) { using AesManaged aesManaged = new AesManaged(); @@ -135,33 +104,6 @@ public class CryptAES return array4; } - public static string DecryptRJ256(string prm_text_to_decrypt) - { - byte[] array = Convert.FromBase64String(prm_text_to_decrypt); - using RijndaelManaged rijndaelManaged = new RijndaelManaged(); - rijndaelManaged.Padding = PaddingMode.Zeros; - rijndaelManaged.Mode = CipherMode.CBC; - rijndaelManaged.KeySize = 256; - rijndaelManaged.BlockSize = 256; - byte[] array2 = new byte[32]; - byte[] array3 = new byte[32]; - byte[] array4 = new byte[array.Length - array2.Length]; - Array.Copy(array, 0, array4, 0, array4.Length); - Array.Copy(array, array.Length - array2.Length, array2, 0, array2.Length); - array3 = Encoding.UTF8.GetBytes(Certification.Udid.Replace("-", "")); - ICryptoTransform transform = rijndaelManaged.CreateDecryptor(array2, array3); - byte[] array5 = new byte[array4.Length]; - using MemoryStream memoryStream = new MemoryStream(array4); - using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Read); - cryptoStream.Read(array5, 0, array5.Length); - rijndaelManaged.Clear(); - cryptoStream.Flush(); - cryptoStream.Close(); - memoryStream.Flush(); - memoryStream.Close(); - return Encoding.UTF8.GetString(array5).TrimEnd(default(char)); - } - public static string DecryptRJ256ForNode(string prm_text_to_decrypt) { using AesManaged aesManaged = new AesManaged(); @@ -181,68 +123,4 @@ public class CryptAES aesManaged.Clear(); return result; } - - public static byte[] EncryptRJ256(byte[] binData) - { - using RijndaelManaged rijndaelManaged = new RijndaelManaged(); - rijndaelManaged.Padding = PaddingMode.PKCS7; - rijndaelManaged.Mode = CipherMode.CBC; - rijndaelManaged.KeySize = 256; - rijndaelManaged.BlockSize = 256; - byte[] array = new byte[0]; - byte[] array2 = new byte[0]; - string s = Cryptographer.generateKeyString(); - string s2 = Certification.Udid.Replace("-", ""); - array = Encoding.UTF8.GetBytes(s); - array2 = Encoding.UTF8.GetBytes(s2); - ICryptoTransform transform = rijndaelManaged.CreateEncryptor(array, array2); - using MemoryStream memoryStream = new MemoryStream(); - using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write); - byte[] bytes = BitConverter.GetBytes(binData.Length); - byte[] array3 = new byte[4 + binData.Length]; - Array.Copy(bytes, 0, array3, 0, 4); - Array.Copy(binData, 0, array3, 4, binData.Length); - cryptoStream.Write(array3, 0, array3.Length); - cryptoStream.FlushFinalBlock(); - byte[] array4 = memoryStream.ToArray(); - byte[] array5 = new byte[array.Length + array4.Length]; - Array.Copy(array4, 0, array5, 0, array4.Length); - Array.Copy(array, 0, array5, array4.Length, array.Length); - rijndaelManaged.Clear(); - memoryStream.Flush(); - memoryStream.Close(); - cryptoStream.Flush(); - cryptoStream.Close(); - return array5; - } - - public static byte[] DecryptRJ256(byte[] binData) - { - using RijndaelManaged rijndaelManaged = new RijndaelManaged(); - rijndaelManaged.Padding = PaddingMode.PKCS7; - rijndaelManaged.Mode = CipherMode.CBC; - rijndaelManaged.KeySize = 256; - rijndaelManaged.BlockSize = 256; - byte[] array = new byte[32]; - byte[] array2 = new byte[32]; - byte[] array3 = new byte[binData.Length - array.Length]; - Array.Copy(binData, 0, array3, 0, array3.Length); - Array.Copy(binData, binData.Length - array.Length, array, 0, array.Length); - array2 = Encoding.UTF8.GetBytes(Certification.Udid.Replace("-", "")); - ICryptoTransform transform = rijndaelManaged.CreateDecryptor(array, array2); - byte[] array4 = new byte[array3.Length]; - using MemoryStream memoryStream = new MemoryStream(array3); - using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Read); - cryptoStream.Read(array4, 0, array4.Length); - byte[] array5 = new byte[4]; - Array.Copy(array4, 0, array5, 0, 4); - byte[] array6 = new byte[BitConverter.ToInt32(array5, 0)]; - Array.Copy(array4, 4, array6, 0, array6.Length); - rijndaelManaged.Clear(); - memoryStream.Flush(); - memoryStream.Close(); - cryptoStream.Flush(); - cryptoStream.Close(); - return array6; - } } diff --git a/SVSim.BattleEngine/Engine/Cute/Cryptographer.cs b/SVSim.BattleEngine/Engine/Cute/Cryptographer.cs index 5df1dafa..f8302416 100644 --- a/SVSim.BattleEngine/Engine/Cute/Cryptographer.cs +++ b/SVSim.BattleEngine/Engine/Cute/Cryptographer.cs @@ -7,16 +7,11 @@ namespace Cute; public class Cryptographer { - public const int FBENCRYPT_BLOCK_SIZE = 32; private static string encode_buf; private static Random cRandom = new Random(); - private static SHA1CryptoServiceProvider sha1 = null; - - private static UTF8Encoding utf8 = null; - private static int random() { return cRandom.Next(1, 9); @@ -115,30 +110,4 @@ public class Cryptographer mD5CryptoServiceProvider.Clear(); return text; } - - public static string ComputeSHA1(string seed) - { - if (sha1 == null) - { - sha1 = new SHA1CryptoServiceProvider(); - } - if (utf8 == null) - { - utf8 = new UTF8Encoding(); - } - if (string.IsNullOrEmpty(seed)) - { - return ""; - } - byte[] bytes = utf8.GetBytes(seed); - byte[] array = sha1.ComputeHash(bytes); - StringBuilder stringBuilder = new StringBuilder(); - int num = array.Length; - for (int i = 0; i < num; i++) - { - stringBuilder.Append(Convert.ToString(array[i], 16).PadLeft(2, '0')); - } - sha1.Initialize(); - return stringBuilder.ToString(); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/CustomPreference.cs b/SVSim.BattleEngine/Engine/Cute/CustomPreference.cs index ad040e0e..9003b2ae 100644 --- a/SVSim.BattleEngine/Engine/Cute/CustomPreference.cs +++ b/SVSim.BattleEngine/Engine/Cute/CustomPreference.cs @@ -1,4 +1,8 @@ using Wizard; +// TODO(engine-cleanup-pass2): 37 of 39 methods unrun in baseline +// Type: Cute.CustomPreference +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Cute; @@ -15,48 +19,24 @@ public class CustomPreference public enum PlatformType { - NONE, - APPLE, - GOOGLE, - DMM, - STEAM - } + NONE } public enum SmallResourceStatus { - NO_SELECT, - USE_NORMAL, - USE_SMALL } - private const string fileScheme = "file:///"; - - private const string httpScheme = "http://"; - - private const string httpsScheme = "https://"; - - private const string jarFileScheme = "jar:file://"; - private static string nodeServerScheme = "ws://"; - private const string directoryLowLevelResources = "Low/"; - - private const string directoryHighLevelResources = "High/"; - private static string directoryRoot = "dl/"; private static string _applicationServerUrl = ""; private static string _resourceServerUrl = ""; - private static string _nodeServerUrl = ""; - private static string _deckBuilderServerUrl = ""; public static string _localePref = "Eng"; - private static string _signaturePref = ""; - private static string _languagePref = "Eng"; private static string _languageSoundPref = "Eng"; @@ -75,34 +55,8 @@ public class CustomPreference private static eSchemeType _schemeCDNType = eSchemeType.Http; - private static bool _isPreferenceComplete = false; - private static bool _isLocalAssetBundles = false; - public static bool isPreferenceComplete - { - get - { - return _isPreferenceComplete; - } - set - { - _isPreferenceComplete = value; - } - } - - public static bool isLocalAssetBundles - { - get - { - return _isLocalAssetBundles; - } - set - { - _isLocalAssetBundles = value; - } - } - public static bool IsNormalResource => !IsSmallResource; public static bool IsSmallResource => PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 2; @@ -112,44 +66,16 @@ public class CustomPreference return GetScheme() + _applicationServerUrl; } - public static void SetApplicationServerURL(string strApplicationServer) - { - _applicationServerUrl = strApplicationServer; - } - public static string GetResourceServerURL() { return GetCDNScheme() + _resourceServerUrl; } - public static void SetResourceServerURL(string strResourceServer) - { - _resourceServerUrl = strResourceServer; - } - - public static string GetNodeServerURL() - { - return nodeServerScheme + _nodeServerUrl; - } - - public static void SetNodeServerURL(string strNodeServer) - { - if (!string.IsNullOrEmpty(strNodeServer)) - { - _nodeServerUrl = strNodeServer; - } - } - public static string GetDeckBuilderServerURL() { return GetScheme() + _deckBuilderServerUrl; } - public static void SetDeckBuilderServerURL(string strDeckBuilderServer) - { - _deckBuilderServerUrl = strDeckBuilderServer; - } - public static int GetPlatform() { return 4; @@ -216,53 +142,6 @@ public class CustomPreference return Toolbox.SavedataManager.GetResourceVersion() + "/"; } - public static void SetScemeMode(eSchemeType schemeType) - { - _schemeType = schemeType; - } - - public static void SetScemeModeCDN(eSchemeType schemeCDNType) - { - _schemeCDNType = schemeCDNType; - } - - public static void SetOptionalNodeSceme() - { - if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_WSS)) - { - SetNodeSceme("wss://"); - } - else - { - SetNodeSceme("ws://"); - } - } - - private static void SetNodeSceme(string scheme) - { - nodeServerScheme = scheme; - } - - public static void SetRootFolderName(string strDir) - { - directoryRoot = strDir; - } - - public static void SetTextLanguage(string strLanguage) - { - _languagePref = strLanguage; - } - - public static void SetLocale(string strLocale) - { - _localePref = strLocale; - } - - public static string GetLanguageFolderName() - { - return _languagePref + "/"; - } - public static string GetTextLanguage() { return GetResourceLanguage(); @@ -273,11 +152,6 @@ public class CustomPreference return _languagePref; } - public static void SetSoundLanguage(string strLanguage) - { - _languageSoundPref = strLanguage; - } - public static string GetSoundMovieLanguageFolderName() { return _languageSoundPref + "/"; @@ -287,32 +161,4 @@ public class CustomPreference { return _languageSoundPref; } - - public static void SetSignature(string strSignature) - { - _signaturePref = strSignature; - } - - public static string GetSignaturePath() - { - return "/../" + _signaturePref; - } - - public static void createResourcePath() - { - if (_isLocalAssetBundles) - { - _assetbundleurl = GetResourceServerURL() + Utility.GetRuntimePlatform() + "/"; - _manifestsuburl = GetResourceServerURL() + Utility.GetRuntimePlatform() + "/"; - } - else - { - _assetbundleurl = GetResourceServerURL() + directoryRoot + "Resource/" + GetLanguageFolderName() + Utility.GetRuntimePlatform() + "/"; - string text = "Manifest/"; - _manifestsuburl = GetResourceServerURL() + directoryRoot + text + GetVersionFolderName() + GetSoundMovieLanguageFolderName() + Utility.GetRuntimePlatform() + "/"; - _manifestUrl = GetResourceServerURL() + directoryRoot + text + GetVersionFolderName() + GetLanguageFolderName() + Utility.GetRuntimePlatform() + "/"; - } - _soundurl = GetResourceServerURL() + directoryRoot + "Sound/" + GetSoundMovieLanguageFolderName(); - _movieurl = GetResourceServerURL() + directoryRoot + "Resource/" + GetSoundMovieLanguageFolderName() + Utility.GetRuntimePlatform() + "/"; - } } diff --git a/SVSim.BattleEngine/Engine/Cute/CuteNetworkDefine.cs b/SVSim.BattleEngine/Engine/Cute/CuteNetworkDefine.cs index 6631b782..678ecdc2 100644 --- a/SVSim.BattleEngine/Engine/Cute/CuteNetworkDefine.cs +++ b/SVSim.BattleEngine/Engine/Cute/CuteNetworkDefine.cs @@ -37,61 +37,13 @@ public static class CuteNetworkDefine GOOGLE_PLAY, GAME_CENTER, FACEBOOK, - DMM, - STEAM, APPLE_ID } public enum CONNECT_TYPE { - SOCIAL_ACCOUNT_CONNECT = 1, - SOCIAL_ACCOUNT_DISCONNECT, - SOCIAL_ACCOUNT_GAME_DATA_UPDATE, - TRANS_CODE_GAME_DATA_UPDATE } - public const int API_RESULT_SUCCESS_CODE = 1; - - public const int RESULT_CODE_DATABASE_ERROR = 100; - - public const int RESULT_CODE_MAINTENANCE_COMMON = 101; - - public const int RESULT_CODE_SERVER_ERROR = 102; - - public const int API_RESULT_SESSION_ERROR = 201; - - public const int RESULT_CODE_ACCOUNT_BLOCK_ERROR = 203; - - public const int RESULT_CODE_ACCOUNT_LIMITED_BLOCK_ERROR = 217; - - public const string ACCOUNT_LIMITED_BLOCK_END_TIME = "account_block_end_time"; - - public const int RESULT_CODE_NETEASE_ACCOUNT_BLOCK_ERROR = 330; - - public const int API_RESULT_VERSION_ERROR = 204; - - public const int RESULT_CODE_PROCESSED_ERROR = 213; - - public const int RESULT_CODE_PAYMENT_VALIDATION_ERROR = 308; - - public const int RESULT_CODE_DMM_ONETIMETOKEN_EXPIRED = 317; - - public const int RESULT_CODE_SOLO_PLAY_ALREADY_FINISH = 1352; - - public const int RESULT_CODE_MAINTENANCE_FROM = 2000; - - public const int RESULT_CODE_MAINTENANCE_TO = 2999; - - public const string MAINTENACE_END_TIME = "maintenance_end_time"; - - public const int RESULT_CODE_MAINTENANCE_CARD_TWO_PICK = 1710; - - public const int RESULT_CODE_MAINTENANCE_CARD_OPEN_SIX = 5013; - - public const int RESULT_CODE_ALREADY_BATTLE_RESULT = 3502; - - public const int RC_OPEN_ROOM_SET_DECK_IN_BATTLE_PHASE = 1768; - public static Dictionary ApiUrlList = new Dictionary { { diff --git a/SVSim.BattleEngine/Engine/Cute/DataMigration.cs b/SVSim.BattleEngine/Engine/Cute/DataMigration.cs deleted file mode 100644 index b3e93ef5..00000000 --- a/SVSim.BattleEngine/Engine/Cute/DataMigration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Wizard; - -namespace Cute; - -public class DataMigration -{ - public enum status - { - NONE, - OVER, - FAIL - } - - private static bool inProgress; - - public static bool canCombine() - { - if (Certification.ViewerId != 0) - { - return true; - } - return false; - } - - public static void CombineStart(string url) - { - BrowserURL.Open(url); - inProgress = true; - } - - public static bool isCombineSucceed() - { - if (Toolbox.SavedataManager.GetInt("COMBINED") != 1) - { - return false; - } - return true; - } - - public static bool isProgressing() - { - return inProgress; - } - - public static void ProgressOver() - { - inProgress = false; - URLScheme.Clear(); - } - - public static void CombineSucceed() - { - Toolbox.SavedataManager.SetInt("COMBINED", 1); - } - - public static void CombineFailed() - { - } - - public static void MigrationStart(string url) - { - BrowserURL.Open(url); - inProgress = true; - } - - public static void MigrationSucceed() - { - CombineSucceed(); - } - - public static void MigrationFailed() - { - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/DebugManager.cs b/SVSim.BattleEngine/Engine/Cute/DebugManager.cs index 7b687b28..6ecf4522 100644 --- a/SVSim.BattleEngine/Engine/Cute/DebugManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/DebugManager.cs @@ -7,96 +7,6 @@ namespace Cute; public class DebugManager : MonoBehaviour { public enum LOG_LEVEL - { - NORMAL, - HIGH, - VERY_HIGH, - VERY_HIGH2, - VERY_HIGH3, - VERY_HIGH4 - } - - [Conditional("USE_DBGSYS")] - public void Log(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void LogWarning(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void LogAppend(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void LogAppendWarning(string text) - { - } - - public void ClearLog() - { - } - - [Conditional("USE_DBGSYS")] - public void TextLog(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void SoundLog(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void SoundLogWarning(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void SoundLogAppend(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void SoundLogAppendWarning(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void ClearSoundLog() - { - } - - [Conditional("USE_DBGSYS")] - public void BattleLogAppend(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void BattleLogAppendWarning(string text) - { - } - - [Conditional("USE_DBGSYS")] - public void ClearBattleLog() - { - } - - [Conditional("USE_DBGSYS")] - public void Log(object log, LOG_LEVEL level) - { - } - - [Conditional("USE_DBGSYS")] - public void LogError(object log) - { - } - - [Conditional("USE_DBGSYS")] - public void LogException(Exception e) { } } diff --git a/SVSim.BattleEngine/Engine/Cute/DeviceManager.cs b/SVSim.BattleEngine/Engine/Cute/DeviceManager.cs index 5ffb492a..2260ef38 100644 --- a/SVSim.BattleEngine/Engine/Cute/DeviceManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/DeviceManager.cs @@ -15,22 +15,11 @@ public class DeviceManager : MonoBehaviour, IManager { public enum TextureCompression { - ETC, - DXT, - ATC, - PVRTC - } + DXT } public enum DeviceType { - NONE, - IPHONE, - ANDROID, - WINDOWS, - OSX - } - - private const string BUILDPARAMFILE = "/CuteBuildParam.xml"; + NONE } private string strBuildVersionName = "9.9.9"; @@ -40,8 +29,6 @@ public class DeviceManager : MonoBehaviour, IManager private string _winOsVersion; - private bool tokenSent; - private string _getIpAddressWithFamilyTypeLog = ""; private void Awake() @@ -49,35 +36,11 @@ public class DeviceManager : MonoBehaviour, IManager CheckTextureCompression(); } - private void Start() - { - SetBuildVersionName(); - Toolbox.DeviceManager = this; - } - - private void Update() - { - } - - private void OnDestroy() - { - } - - public TextureCompression GetTextureCompression() - { - return textureCommpression; - } - private void CheckTextureCompression() { textureCommpression = TextureCompression.DXT; } - public string GetModelName() - { - return SystemInfo.deviceModel; - } - public string GetOsVersion() { if (string.IsNullOrEmpty(_winOsVersion)) @@ -115,16 +78,6 @@ public class DeviceManager : MonoBehaviour, IManager return CustomPreference._localePref; } - public string getSignature() - { - return ""; - } - - public bool isRootUser() - { - return false; - } - public string GetDeviceUniqueIdentifier() { string text = ""; @@ -246,39 +199,4 @@ public class DeviceManager : MonoBehaviour, IManager _ipAddress = null; LocalLog.AccumulateTraceInquiryLog("ClearIpAddress " + StackTraceUtility.ExtractStackTrace()); } - - public string GetCarrier() - { - return ""; - } - - public void SetVersionName() - { - SetBuildVersionName(); - } - - public void SetBuildVersionName() - { - string text = Application.streamingAssetsPath + "/CuteBuildParam.xml"; - if (!File.Exists(text)) - { - return; - } - XmlDocument xmlDocument = new XmlDocument(); - xmlDocument.Load(text); - if (xmlDocument.FirstChild == null || xmlDocument.FirstChild.NextSibling == null) - { - return; - } - IEnumerator enumerator = xmlDocument.FirstChild.NextSibling.GetEnumerator(); - while (enumerator.MoveNext()) - { - XmlNode xmlNode = (XmlNode)enumerator.Current; - if (xmlNode.Name.Equals("versionName")) - { - strBuildVersionName = xmlNode.InnerText; - break; - } - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/EventExtension.cs b/SVSim.BattleEngine/Engine/Cute/EventExtension.cs index 61ad990e..80b8729b 100644 --- a/SVSim.BattleEngine/Engine/Cute/EventExtension.cs +++ b/SVSim.BattleEngine/Engine/Cute/EventExtension.cs @@ -1,4 +1,8 @@ using System; +// TODO(engine-cleanup-pass2): 20 of 21 methods unrun in baseline +// Type: Cute.EventExtension +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Cute; diff --git a/SVSim.BattleEngine/Engine/Cute/GameStartCheckTask.cs b/SVSim.BattleEngine/Engine/Cute/GameStartCheckTask.cs index 505ddadb..36651516 100644 --- a/SVSim.BattleEngine/Engine/Cute/GameStartCheckTask.cs +++ b/SVSim.BattleEngine/Engine/Cute/GameStartCheckTask.cs @@ -9,13 +9,6 @@ public class GameStartCheckTask : NetworkTask { private class CheckParams : PostParams { - public int app_type; - - public string campaign_data = ""; - - public string campaign_sign = ""; - - public int campaign_user; } private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.GameStartCheck; @@ -28,10 +21,6 @@ public class GameStartCheckTask : NetworkTask public static bool IsSetTransitionPassword; - public static int _tosId; - - public static int _privacyPolicyId; - public static bool HasAppliedForAccountDeletion { get; private set; } = false; public static string RefundUrl { get; private set; } = string.Empty; @@ -47,27 +36,6 @@ public class GameStartCheckTask : NetworkTask IsSocialAccountDataTransSet = new List(); } - public void SetParameter() - { - CheckParams checkParams = new CheckParams(); - if (URLScheme.AppType != 0) - { - checkParams.campaign_data = URLScheme.CampaignData; - checkParams.app_type = URLScheme.AppType; - } - checkParams.campaign_sign = Toolbox.DeviceManager.getSignature(); - int num = Random.Range(0, 100000); - if (Toolbox.DeviceManager.isRootUser()) - { - checkParams.campaign_user = 2 * num + 1; - } - else - { - checkParams.campaign_user = 2 * num; - } - base.Params = checkParams; - } - protected override int Parse() { int num = base.Parse(); @@ -112,7 +80,7 @@ public class GameStartCheckTask : NetworkTask } if (base.ResponseData["data"].Keys.Contains("rewrite_viewer_id")) { - Certification.ViewerId = base.ResponseData["data"]["rewrite_viewer_id"].ToInt(); + /* Pre-Phase-5 chunk 39: rewrite_viewer_id is a client-only Cute path; dead headless */ } if (base.ResponseData["data"].Keys.Contains("is_set_transition_password")) { diff --git a/SVSim.BattleEngine/Engine/Cute/GetGameDataByTransitionCode.cs b/SVSim.BattleEngine/Engine/Cute/GetGameDataByTransitionCode.cs deleted file mode 100644 index 13cc6b9f..00000000 --- a/SVSim.BattleEngine/Engine/Cute/GetGameDataByTransitionCode.cs +++ /dev/null @@ -1,97 +0,0 @@ -using LitJson; -using Wizard; - -namespace Cute; - -public class GetGameDataByTransitionCode : NetworkTask -{ - public class ChainedPlayData - { - public string ChainedViewerId { get; set; } - - public string Password { get; set; } - - public string UserName { get; set; } - - public string UserRankRotation { get; set; } - - public string UserRankUnlimited { get; set; } - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.GetGameDataByTransitionCode; - - public static ChainedPlayData ChainedPlayDatas { get; private set; } - - public static string NowUserName { get; private set; } - - public static string NowUserRankRotation { get; private set; } - - public static string NowUserRankUnlimited { get; private set; } - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public GetGameDataByTransitionCode() - { - ChainedPlayDatas = new ChainedPlayData(); - } - - public void SetParameter(string input_viewer_id, string password) - { - TransitionCodeParams transitionCodeParams = new TransitionCodeParams(); - transitionCodeParams.input_viewer_id = input_viewer_id; - transitionCodeParams.password = password; - base.Params = transitionCodeParams; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - ChainedPlayDatas.ChainedViewerId = ""; - ChainedPlayDatas.Password = ""; - ChainedPlayDatas.UserName = " - "; - ChainedPlayDatas.UserRankRotation = " - "; - ChainedPlayDatas.UserRankUnlimited = " - "; - NowUserName = " - "; - NowUserRankRotation = " - "; - NowUserRankUnlimited = " - "; - if (base.ResponseData["data"].Count > 0) - { - if (base.ResponseData["data"].Keys.Contains("chained_viewer_id") && base.ResponseData["data"]["chained_viewer_id"] != null && base.ResponseData["data"]["chained_viewer_id"].ToString() != "") - { - ChainedPlayDatas.ChainedViewerId = base.ResponseData["data"]["chained_viewer_id"].ToString(); - } - if (base.ResponseData["data"].Keys.Contains("password") && base.ResponseData["data"]["password"] != null && base.ResponseData["data"]["password"].ToString() != "") - { - ChainedPlayDatas.Password = base.ResponseData["data"]["password"].ToString(); - } - if (base.ResponseData["data"].Keys.Contains("name") && base.ResponseData["data"]["name"] != null && base.ResponseData["data"]["name"].ToString() != "") - { - ChainedPlayDatas.UserName = base.ResponseData["data"]["name"].ToString(); - } - string text = 1.ToString(); - string text2 = 2.ToString(); - SystemText systemText = Data.SystemText; - if (base.ResponseData["data"].Keys.Contains("rank") && base.ResponseData["data"]["rank"] != null) - { - JsonData jsonData = base.ResponseData["data"]["rank"]; - if (jsonData.Keys.Contains(text)) - { - ChainedPlayDatas.UserRankRotation = systemText.Get(jsonData[text].ToString()); - } - if (jsonData.Keys.Contains(text2)) - { - ChainedPlayDatas.UserRankUnlimited = systemText.Get(jsonData[text2].ToString()); - } - } - NowUserName = base.ResponseData["data"]["now_name"].ToString(); - JsonData jsonData2 = base.ResponseData["data"]["now_rank"]; - NowUserRankRotation = systemText.Get(jsonData2[text].ToString()); - NowUserRankUnlimited = systemText.Get(jsonData2[text2].ToString()); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/GetiCloudUserDataTask.cs b/SVSim.BattleEngine/Engine/Cute/GetiCloudUserDataTask.cs deleted file mode 100644 index 3429bcd8..00000000 --- a/SVSim.BattleEngine/Engine/Cute/GetiCloudUserDataTask.cs +++ /dev/null @@ -1,77 +0,0 @@ -using LitJson; -using Wizard; - -namespace Cute; - -public class GetiCloudUserDataTask : NetworkTask -{ - private class iCloudUserParams : PostParams - { - public string icloud_data = ""; - } - - public class VerifiediCloudBackupUserData - { - public int iCloudViewerId { get; set; } - - public string iCloudUserName { get; set; } = " - "; - - public string UserRankRotation { get; set; } - - public string UserRankUnlimited { get; set; } - - public bool HasUserData() - { - return iCloudViewerId != 0; - } - - public void Reset() - { - iCloudViewerId = 0; - iCloudUserName = " - "; - } - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.CheckiCloudUser; - - public static readonly VerifiediCloudBackupUserData VerifiediCloudUserData = new VerifiediCloudBackupUserData(); - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(string iCloudData) - { - iCloudUserParams iCloudUserParams = new iCloudUserParams(); - iCloudUserParams.icloud_data = iCloudData; - base.Params = iCloudUserParams; - } - - protected override int Parse() - { - if (resultCode != 1) - { - return resultCode; - } - JsonData jsonData = base.ResponseData["data"]; - if (jsonData["icloud_data_verified"].ToBoolean()) - { - VerifiediCloudUserData.iCloudViewerId = jsonData["icloud_viewer_id"].ToInt(); - VerifiediCloudUserData.iCloudUserName = jsonData["icloud_name"].ToString(); - string text = 1.ToString(); - string text2 = 2.ToString(); - SystemText systemText = Data.SystemText; - if (base.ResponseData["data"].Keys.Contains("rank") && base.ResponseData["data"]["rank"] != null) - { - JsonData jsonData2 = base.ResponseData["data"]["rank"]; - if (jsonData2.Keys.Contains(text)) - { - VerifiediCloudUserData.UserRankRotation = systemText.Get(jsonData2[text].ToString()); - } - if (jsonData2.Keys.Contains(text2)) - { - VerifiediCloudUserData.UserRankUnlimited = systemText.Get(jsonData2[text2].ToString()); - } - } - } - return resultCode; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/HangulManager.cs b/SVSim.BattleEngine/Engine/Cute/HangulManager.cs index 8949eb95..9372f93e 100644 --- a/SVSim.BattleEngine/Engine/Cute/HangulManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/HangulManager.cs @@ -53,14 +53,6 @@ public static class HangulManager } } - private const int STRING_BUILDER_CAPACITY = 512; - - private const char dHANGUL_START = '가'; - - private const char dHANGUL_END = '힣'; - - private const char JOSI_TYPE_IDENTIFIER = '@'; - private static readonly char[] CHOSUNG_TABLE = new char[19] { 'ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', @@ -99,8 +91,6 @@ public static class HangulManager private const string ENCLOSED = "ENCLOSED"; - private const string NUMERAL_PATTERN = "(?\\[num\\])(?.*?)(?\\[/num\\])"; - private static readonly string[] NUMERAL_TABLE = new string[100] { "0", "하나", "둘", "셋", "넷", "다섯", "여섯", "일곱", "여덟", "아홉", diff --git a/SVSim.BattleEngine/Engine/Cute/INetworkUI.cs b/SVSim.BattleEngine/Engine/Cute/INetworkUI.cs deleted file mode 100644 index 0c5c44df..00000000 --- a/SVSim.BattleEngine/Engine/Cute/INetworkUI.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace Cute; - -public interface INetworkUI -{ - string GetText(string code); - - void StartLoading(bool notEditor = false); - - void StopLoading(); - - void GoToMypage(); - - void SoftwareRest(); - - bool IsKeepLastRequest(); - - void SetKeepLastRequest(bool flag); - - void OpenRetryAndToTitleErrorPopUp(string title, string message, string code); - - void OpenGoToMypageErrorPopUp(string title, string message, string code); - - void OpenGoToTitleErrorPopUp(string title, string message, string code); - - void OpenGotoStoreErrorPopup(); - - void OpenRetryFailErrorPopup(); - - void OpenTimeOutErrorPopUp(); - - void OpenHttpStatusErrorPopUp(); - - void OpenResourceVersionUpPopUp(); - - void OpenSessionErrorPopUp(); - - bool isCloseDialogGroupError(int resultCode); - - void OpenCloseOnlyErrorPopUp(int resultCode); - - void OpenStrictServerErrorPopUp(int resultCode); - - void OpenAccountBlockErrorPopUp(int resultCode); - - void OpenAccountLimitedBlockErrorPopUp(int resultCode, string endTimeText); - - void OpenAllMaintenancePopUp(int resultCode, string endTime); - - void OpenEachFunctionMaintenancePopUp(int resultCode); - - void OpenOtherServerErrorPopUp(int resultCode); - - void OpenSocialServiceNoResponseErrorPopup(); -} diff --git a/SVSim.BattleEngine/Engine/Cute/LeanThreadPool.cs b/SVSim.BattleEngine/Engine/Cute/LeanThreadPool.cs index ec5cb98a..4b43af08 100644 --- a/SVSim.BattleEngine/Engine/Cute/LeanThreadPool.cs +++ b/SVSim.BattleEngine/Engine/Cute/LeanThreadPool.cs @@ -36,8 +36,6 @@ public class LeanThreadPool } } - public int ThreadsCount => _threads.Length; - private LeanThreadPool() { int processorCount = SystemInfo.processorCount; @@ -79,22 +77,6 @@ public class LeanThreadPool } } - public IEnumerator KillAll(Action callback = null) - { - _quit = true; - _convergeCount = 0; - lock (_jobsLock) - { - _jobs.Clear(); - } - _semaphore.Release(_threads.Length); - while (_convergeCount < _threads.Length) - { - yield return 0; - } - callback.Call(); - } - public void AddJob(ParallelJob job) { lock (_jobsLock) diff --git a/SVSim.BattleEngine/Engine/Cute/LocalSqliteKVS.cs b/SVSim.BattleEngine/Engine/Cute/LocalSqliteKVS.cs index 7b986a51..a88191a8 100644 --- a/SVSim.BattleEngine/Engine/Cute/LocalSqliteKVS.cs +++ b/SVSim.BattleEngine/Engine/Cute/LocalSqliteKVS.cs @@ -81,11 +81,6 @@ public class LocalSqliteKVS : ILocalKVS, IDisposable return new LocalSqliteKVS(path, enableCache); } - ~LocalSqliteKVS() - { - Dispose(); - } - public virtual void Dispose() { if (_db != null) @@ -121,60 +116,6 @@ public class LocalSqliteKVS : ILocalKVS, IDisposable } } - public List FindLike(string pattern) - { - List list = new List(); - try - { - _likeQuery.BindText(1, pattern); - while (_likeQuery.Step()) - { - list.Add(_likeQuery.GetText(0)); - } - return list; - } - catch (Exception ex) - { - throw ex; - } - finally - { - _likeQuery.Reset(); - } - } - - public string EscapeLikePattern(string pattern) - { - return Regex.Replace(pattern, "[_%\\[!]", "!$0"); - } - - public void DisableCache() - { - _enableCache = false; - _tableCache = null; - } - - public List GetAll() - { - List list = new List(); - try - { - while (_selectAllQuery.Step()) - { - list.Add(_selectAllQuery.GetText(0)); - } - return list; - } - catch (Exception ex) - { - throw ex; - } - finally - { - _selectAllQuery.Reset(); - } - } - public string Get(string key) { if (_enableCache) diff --git a/SVSim.BattleEngine/Engine/Cute/ManifestDatahashKVS.cs b/SVSim.BattleEngine/Engine/Cute/ManifestDatahashKVS.cs index 73056bad..fa6d1292 100644 --- a/SVSim.BattleEngine/Engine/Cute/ManifestDatahashKVS.cs +++ b/SVSim.BattleEngine/Engine/Cute/ManifestDatahashKVS.cs @@ -14,11 +14,6 @@ public class ManifestDatahashKVS : ILocalKVS, IDisposable _kvs = LocalSqliteKVS.Open(path, enableCache: true); } - ~ManifestDatahashKVS() - { - Dispose(); - } - public virtual void Dispose() { if (_kvs != null) @@ -39,18 +34,6 @@ public class ManifestDatahashKVS : ILocalKVS, IDisposable _kvs.Set(name, hash); } - public void Set(Dictionary _dictionary) - { - if (_dictionary.Count <= 0) - { - return; - } - foreach (KeyValuePair item in _dictionary) - { - Set(item.Key, item.Value); - } - } - public void Delete(string name) { _kvs.Delete(name); @@ -62,55 +45,6 @@ public class ManifestDatahashKVS : ILocalKVS, IDisposable Optimize(); } - public void DisableCache() - { - _kvs.DisableCache(); - } - - public void DeleteByList(List _deleteList) - { - if (_deleteList.Count > 0) - { - Transaction(delegate - { - _deleteList.ForEach(Delete); - }); - Optimize(); - } - } - - public void DeleteByPrefix(string prefix) - { - List deleteList = _kvs.FindLike(_kvs.EscapeLikePattern(prefix) + "%"); - if (deleteList.Count <= 0) - { - return; - } - Transaction(delegate - { - foreach (string item in deleteList) - { - Delete(item); - } - }); - Optimize(); - } - - public List GetAll() - { - return _kvs.GetAll(); - } - - public List FindLike(string patternEscaped) - { - return _kvs.FindLike(patternEscaped); - } - - public string EscapeLikePattern(string patternNoEscape) - { - return _kvs.EscapeLikePattern(patternNoEscape); - } - public void Optimize() { _kvs.Optimize(); diff --git a/SVSim.BattleEngine/Engine/Cute/MovieManager.cs b/SVSim.BattleEngine/Engine/Cute/MovieManager.cs deleted file mode 100644 index 64e26c8d..00000000 --- a/SVSim.BattleEngine/Engine/Cute/MovieManager.cs +++ /dev/null @@ -1,217 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; -using Wizard; - -namespace Cute; - -public class MovieManager : MonoBehaviour, IManager -{ - private string fileRootPath; - - private string streamingAssetfileRootPath; - - private MoviePlayer _player; - - private float _volume = 1f; - - private MovieSubtitles _movieSubtitles; - - private IEnumerator Start() - { - Toolbox.MovieManager = this; - while (!CustomPreference.isPreferenceComplete) - { - yield return null; - } - fileRootPath = "file:///" + Application.persistentDataPath + "/"; - streamingAssetfileRootPath = "file:///" + Application.streamingAssetsPath + "/"; - } - - private void CreateMoviePlayer() - { - GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("Prefab/Movie/MoviePlayer")) as GameObject; - gameObject.transform.parent = base.transform; - _player = gameObject.GetComponent(); - _player.SetVolume(_volume); - } - - public void Load(string filename) - { - if (!_player) - { - CreateMoviePlayer(); - } - _player.Load(fileRootPath + filename); - } - - public void Unload() - { - if ((bool)_player) - { - UnityEngine.Object.Destroy(_player.gameObject); - } - } - - public void Play() - { - if (IsReady() || IsPaused() || IsStopped()) - { - _player.Play(); - } - } - - public void PlayWithSubtitles(string subtitlesCSV) - { - GameObject prefab = (GameObject)Resources.Load("UI/MovieSubtitles"); - _movieSubtitles = NGUITools.AddChild(UIManager.GetInstance().UIManagerRoot.gameObject, prefab).GetComponent(); - SetCallbackStart(delegate - { - _movieSubtitles.PlaySubtitles(subtitlesCSV); - }); - Play(); - } - - public void Stop() - { - if (_movieSubtitles != null) - { - _movieSubtitles.Finish(); - _movieSubtitles = null; - } - if (IsPlaying() || IsPaused()) - { - _player.Stop(); - } - } - - public void Pause() - { - if (IsPlaying()) - { - _player.Pause(); - } - } - - public void SetVolume(float volume) - { - _volume = volume; - if ((bool)_player) - { - _player.SetVolume(volume); - } - } - - public int GetSeekPosition() - { - if (!_player) - { - return 0; - } - return _player.GetSeekPosition(); - } - - public int GetDuration() - { - if (!_player) - { - return 0; - } - return _player.GetDuration(); - } - - public int GetCurrentSeekPercent() - { - if (!_player) - { - return 0; - } - return _player.GetCurrentSeekPercent(); - } - - public void SeekTo(int seek) - { - if ((bool)_player) - { - _player.SeekTo(seek); - } - } - - public bool IsReady() - { - if (!_player) - { - return false; - } - return _player.IsReady(); - } - - public bool IsPlaying() - { - if (!_player) - { - return false; - } - return _player.IsPlaying(); - } - - public bool IsPaused() - { - if (!_player) - { - return false; - } - return _player.IsPaused(); - } - - public bool IsStopped() - { - if (!_player) - { - return false; - } - return _player.IsStopped(); - } - - public bool IsFinished() - { - if (!_player) - { - return false; - } - return _player.IsFinished(); - } - - public bool IsError() - { - if (!_player) - { - return true; - } - return _player.IsError(); - } - - public void SetCallbackReady(Action callback) - { - if ((bool)_player) - { - _player.CallbackReady += callback; - } - } - - public void SetCallbackStart(Action callback) - { - if ((bool)_player) - { - _player.CallbackStart += callback; - } - } - - public void SetCallbackEnd(Action callback) - { - if ((bool)_player) - { - _player.CallbackEnd += callback; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/MoviePlayer.cs b/SVSim.BattleEngine/Engine/Cute/MoviePlayer.cs deleted file mode 100644 index 524a0aff..00000000 --- a/SVSim.BattleEngine/Engine/Cute/MoviePlayer.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using CriWare; -using CriWare.CriMana; -using UnityEngine; - -namespace Cute; - -public class MoviePlayer : MonoBehaviour -{ - [SerializeField] - private CriManaMovieMaterial _movieController; - - [SerializeField] - private Camera _camera; - - public event Action CallbackReady; - - public event Action CallbackStart; - - public event Action CallbackEnd; - - private void Update() - { - if (_movieController.player == null) - { - return; - } - switch (_movieController.player.status) - { - case Player.Status.Playing: - if (this.CallbackStart != null) - { - this.CallbackStart(); - this.CallbackStart = null; - } - break; - case Player.Status.PlayEnd: - Stop(); - if (this.CallbackEnd != null) - { - this.CallbackEnd(); - this.CallbackEnd = null; - } - break; - } - } - - public void Load(string filePath) - { - filePath = filePath.Replace("file:///", ""); - _movieController.maxFrameDrop = CriManaMovieMaterial.MaxFrameDrop.Ten; - _movieController.player.Stop(); - _movieController.player.SetFile(null, filePath); - _movieController.player.Prepare(); - if (this.CallbackReady != null) - { - this.CallbackReady(); - this.CallbackReady = null; - } - } - - public void Play() - { - _camera.enabled = true; - if (IsPaused()) - { - _movieController.player.Pause(sw: false); - } - else - { - _movieController.player.Start(); - } - } - - public void Stop() - { - QualitySettings.vSyncCount = 0; - _camera.enabled = false; - _movieController.player.Stop(); - } - - public void Pause() - { - _movieController.player.Pause(!_movieController.player.IsPaused()); - } - - public void SetVolume(float volume) - { - _movieController.player.SetVolume(volume); - } - - public int GetSeekPosition() - { - return (int)(_movieController.player.GetTime() / 1000); - } - - public int GetDuration() - { - int totalFrames = (int)_movieController.player.movieInfo.totalFrames; - int num = (int)(_movieController.player.movieInfo.framerateN / 1000); - if (num == 0) - { - return -1; - } - return totalFrames / num * 1000; - } - - public int GetCurrentSeekPercent() - { - return GetSeekPosition() / GetDuration() * 100; - } - - public void SeekTo(int seek) - { - int num = (int)(_movieController.player.movieInfo.framerateN / 1000); - int seekPosition = seek * num / 1000; - _movieController.player.Stop(); - _movieController.player.SetSeekPosition(seekPosition); - _movieController.player.Start(); - } - - public bool IsReady() - { - return _movieController.player.status == Player.Status.Ready; - } - - public bool IsPlaying() - { - if (_movieController.player.status == Player.Status.Playing) - { - return !IsPaused(); - } - return false; - } - - public bool IsPaused() - { - return _movieController.player.IsPaused(); - } - - public bool IsStopped() - { - return _movieController.player.status == Player.Status.Stop; - } - - public bool IsFinished() - { - return _movieController.player.status == Player.Status.PlayEnd; - } - - public bool IsError() - { - return _movieController.player.status == Player.Status.Error; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/NativePluginWrapper.cs b/SVSim.BattleEngine/Engine/Cute/NativePluginWrapper.cs index 707f472b..e0e530a7 100644 --- a/SVSim.BattleEngine/Engine/Cute/NativePluginWrapper.cs +++ b/SVSim.BattleEngine/Engine/Cute/NativePluginWrapper.cs @@ -6,194 +6,14 @@ public static class NativePluginWrapper { public enum BatteryState { - UNKNOWN, - DISCHARGING, - CHARGING, - FULL - } +} public enum NetworkMode { - UNCONNECTED, - WIFI, - MOBILE - } - - public static void DeviceInit() - { - } - - public static int GetUseResidentMemory() - { - return 0; - } - - public static int GetUseVirtualMemory() - { - return 0; - } - - public static int GetDeviceFreeMemory() - { - return 0; - } - - public static int GetVmUseMemory() - { - return 0; - } - - public static int GetVmFreeMemory() - { - return 0; - } +} public static void SetStringToClipboard(string copyText) { ClipboardHelper.Clipboard = copyText; } - - public static int GetAccelerometerRotation() - { - return 1; - } - - public static void RequestAudioFocus() - { - } - - public static void AbandonAudioFocus() - { - } - - public static string GetMacAddressByName(string devicename) - { - return null; - } - - public static void DispStatusBar(bool isDisp) - { - if (isDisp) - { - Screen.fullScreen = false; - } - else - { - Screen.fullScreen = true; - } - } - - public static void RegistPhoneStateListener() - { - } - - public static void UnregistPhoneStateListener() - { - } - - public static int GetBatteryLevel() - { - return 0; - } - - public static BatteryState GetBatteryState() - { - return BatteryState.UNKNOWN; - } - - public static int GetWifiAntenaLevel() - { - return 0; - } - - public static NetworkMode GetNetworkMode() - { - return NetworkMode.UNCONNECTED; - } - - public static bool IsAirplaneMode() - { - return false; - } - - public static int GetCdmaDbm() - { - return 0; - } - - public static int GetCdmaEcio() - { - return 0; - } - - public static int GetEvdoDbm() - { - return 0; - } - - public static int GetEvdoEcio() - { - return 0; - } - - public static int GetDescriveContents() - { - return 0; - } - - public static bool IsGsm() - { - return false; - } - - public static int GetSignalHashCode() - { - return 0; - } - - public static int GetGsmSignalStrength() - { - return 0; - } - - public static int GetGsmBitErrorRate() - { - return 0; - } - - public static void ShowToast(string text) - { - } - - public static void DumpWWWCache() - { - } - - public static void SetCacheMemorySize(int nMemSize) - { - } - - public static int GetCacheDiskUsage() - { - return 0; - } - - public static int GetCacheDiskCapacity() - { - return 0; - } - - public static int GetCacheCurrentMemoryUsage() - { - return 0; - } - - public static int GetCacheCurrentMemoryCapacity() - { - return 0; - } - - public static void ClearWWWCache() - { - } } diff --git a/SVSim.BattleEngine/Engine/Cute/NetworkManager.cs b/SVSim.BattleEngine/Engine/Cute/NetworkManager.cs index a4283a05..d3a879b5 100644 --- a/SVSim.BattleEngine/Engine/Cute/NetworkManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/NetworkManager.cs @@ -19,8 +19,6 @@ public class NetworkManager : MonoBehaviour, IManager { public const float TimeOut = 30f; - public const float TimeOutShort = 2f; - protected NetworkTask lastRequestTask; public bool isConnect; @@ -37,24 +35,6 @@ public class NetworkManager : MonoBehaviour, IManager private IEnumerator connectCoroutine; - [SerializeField] - public Certification _certification; - - public INetworkUI NetworkUI { get; set; } - - private void Start() - { - Toolbox.NetworkManager = this; - } - - public bool IsReachability() - { - if (Application.internetReachability != NetworkReachability.NotReachable) - { - return true; - } - return false; - } public IEnumerator Connect(NetworkTask task, Action callbackOnSuccess = null, Action callbackOnFailure = null, Action callbackOnResultCodeError = null, bool encrypt = true, bool useJson = false, bool showLoadingIcon = true, bool showErrorDialog = true) { @@ -92,10 +72,6 @@ public class NetworkManager : MonoBehaviour, IManager isConnect = true; isTimeOut = false; isError = false; - if (NetworkUI != null && _showLoadingIcon) - { - NetworkUI.StartLoading(); - } bool isLogTraceCheckUri = false; if (lastRequestTask is DoMatchingBase || lastRequestTask is FinishTaskBase) { @@ -126,10 +102,6 @@ public class NetworkManager : MonoBehaviour, IManager { LogTraceCheck("3"); } - if (NetworkUI != null) - { - NetworkUI.StopLoading(); - } if (!unityWebRequest.isDone) { isTimeOut = true; @@ -139,23 +111,16 @@ public class NetworkManager : MonoBehaviour, IManager { if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)) || lastRequestTask.GetType().Equals(typeof(BuildDeckBuyTask)) || lastRequestTask.GetType().Equals(typeof(SleeveBuyTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuyMultiRewardTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuyMultiTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuySingleTask)) || lastRequestTask.GetType().Equals(typeof(ItemPurchaseBuyTask)) || lastRequestTask.GetType().Equals(typeof(SpotCardExchangeTask)) || lastRequestTask.GetType().Equals(typeof(CardCreateTask)) || lastRequestTask.GetType().Equals(typeof(CardDestructTask)) || lastRequestTask.GetType().Equals(typeof(StoryFinishTask)) || lastRequestTask.GetType().Equals(typeof(PracticeFinishTask)) || lastRequestTask.GetType().Equals(typeof(BingoDrawTask)) || lastRequestTask.GetType().Equals(typeof(MypageTreasureBoxCpOpenTask)) || lastRequestTask.GetType().Equals(typeof(MypageReceiveSpecialTreasureTask)) || lastRequestTask.GetType().Equals(typeof(FreeCardPackCampaignFinishTask))) { - NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), ""); + } else { - NetworkUI.OpenTimeOutErrorPopUp(); + } } if (lastRequestTask.CallbackOnFailure != null) { - if (lastRequestTask.GetType().Equals(typeof(PaymentPCFinishTask))) - { - NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), ""); - } - else - { - lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.TimeOut); - } + lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.TimeOut); } Toolbox.DeviceManager.ClearIpAddress(); } @@ -165,13 +130,13 @@ public class NetworkManager : MonoBehaviour, IManager isError = true; if (showErrorDialog && !lastRequestTask.isSkipCommonHttpStatusErrorPopUp()) { - if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)) || lastRequestTask.GetType().Equals(typeof(PaymentPCFinishTask))) + if (lastRequestTask.GetType().Equals(typeof(PackOpenTask))) { - NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), ""); + } else { - NetworkUI.OpenHttpStatusErrorPopUp(); + } } disposeUnityWebRequest(unityWebRequest); @@ -274,7 +239,7 @@ public class NetworkManager : MonoBehaviour, IManager private bool IsBattle() { - if (ToolboxGame.RealTimeNetworkAgent != null && BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().GetCurrentPhase() is MainPhase) + if (false /* Pre-Phase-5b: RTA + MainPhase gate headless-false */) { return true; } @@ -314,7 +279,7 @@ public class NetworkManager : MonoBehaviour, IManager public void ClearLastRequestTask() { - if ((NetworkUI != null && !NetworkUI.IsKeepLastRequest()) || lastRequestTask.isServerResultCodeOK()) + if (lastRequestTask.isServerResultCodeOK()) { if (IsBattle()) { @@ -328,7 +293,7 @@ public class NetworkManager : MonoBehaviour, IManager { if (lastRequestTask == null) { - NetworkUI.OpenRetryFailErrorPopup(); + yield break; } if (connectCoroutine != null) @@ -339,43 +304,12 @@ public class NetworkManager : MonoBehaviour, IManager yield return StartCoroutine(connectCoroutine); } - public void Certification() - { - _certification.GenerateUdid(); - } - - public void ReturnToTitle() - { - NetworkUI.SetKeepLastRequest(flag: false); - ClearLastRequestTask(); - NetworkUI.SoftwareRest(); - } - - public void GoToMypage() - { - NetworkUI.SetKeepLastRequest(flag: false); - ClearLastRequestTask(); - NetworkUI.GoToMypage(); - } - public void GoToStore() { lastRequestTask.GotoStore(); - NetworkUI.SetKeepLastRequest(flag: false); - ClearLastRequestTask(); - NetworkUI.SoftwareRest(); - } - public void QuitApplication() - { - NetworkUI.SetKeepLastRequest(flag: false); ClearLastRequestTask(); - if (Toolbox.mute != null) - { - Toolbox.mute.Close(); - Toolbox.mute = null; - } - Application.Quit(); + } private void disposeUnityWebRequest(UnityWebRequest unityWebRequest) @@ -395,12 +329,4 @@ public class NetworkManager : MonoBehaviour, IManager isConnect = false; } } - - private void OnDestroy() - { - if (RealTimeNetworkAgent.IsNormalNetworkBattle()) - { - LocalLog.AccumulateLastTraceLog("NetworkManager_Destroy"); - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/NetworkTask.cs b/SVSim.BattleEngine/Engine/Cute/NetworkTask.cs index 52c6d721..6859b209 100644 --- a/SVSim.BattleEngine/Engine/Cute/NetworkTask.cs +++ b/SVSim.BattleEngine/Engine/Cute/NetworkTask.cs @@ -111,18 +111,12 @@ public class NetworkTask resultCode = getDataHeader()["result_code"].ToInt(); } - public int GetResultCode() - { - return resultCode; - } - public ERROR_CODE_STATUS CheckResultCodeToPopupCreate_ReturnStatus(int rc = 0) { - INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI; if (isAppVersionUP()) { RecoveryRecordManagerBase.DeleteRecoveryFile(); - networkUI.OpenGotoStoreErrorPopup(); + return ERROR_CODE_STATUS.ERROR; } if (isResourceVersionUp()) @@ -132,25 +126,25 @@ public class NetworkTask if (!Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.GameStartCheck])) { RecoveryRecordManagerBase.DeleteRecoveryFile(); - networkUI.OpenResourceVersionUpPopUp(); + Parse(); return ERROR_CODE_STATUS.ERROR; } } if (isSessionError()) { - networkUI.OpenSessionErrorPopUp(); + return ERROR_CODE_STATUS.ERROR; } setSession(); if (isUnknownServerError() || isServerProcessedError() || isServerDataBaseError()) { - networkUI.OpenStrictServerErrorPopUp(resultCode); + return ERROR_CODE_STATUS.ERROR; } if (isAccountBlockError()) { - networkUI.OpenAccountBlockErrorPopUp(resultCode); + return ERROR_CODE_STATUS.ERROR; } if (isNeteaseAccountBlockError()) @@ -161,18 +155,18 @@ public class NetworkTask if (isAccountLimitedBlockError()) { string accountLimitedBlockEndTime = getAccountLimitedBlockEndTime(); - networkUI.OpenAccountLimitedBlockErrorPopUp(resultCode, accountLimitedBlockEndTime); + return ERROR_CODE_STATUS.ERROR; } if (IsAllMaintenanceError()) { string maintenanceEndTime = getMaintenanceEndTime(); - networkUI.OpenAllMaintenancePopUp(resultCode, maintenanceEndTime); + return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP; } if (IsEachFunctionMaintenanceError()) { - networkUI.OpenEachFunctionMaintenancePopUp(resultCode); + return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP; } if (IsCardMaintenanceError()) @@ -206,15 +200,6 @@ public class NetworkTask private void cuteCheckResultCode() { - INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI; - if (networkUI.isCloseDialogGroupError(resultCode)) - { - networkUI.OpenCloseOnlyErrorPopUp(resultCode); - } - else if (!isServerResultCodeOK()) - { - networkUI.OpenOtherServerErrorPopUp(resultCode); - } } protected virtual string getAccountLimitedBlockEndTime() @@ -297,16 +282,16 @@ public class NetworkTask private void AddHeaderParam() { string udid = getUdid(); - string viewer_id = CryptAES.encrypt(Certification.ViewerId.ToString()); + string viewer_id = CryptAES.encrypt(0 /* Pre-Phase-5 chunk 39: Cute NetworkTask is client-only; dead headless */.ToString()); Params.viewer_id = viewer_id; Params.steam_id = Certification.SteamID; Params.steam_session_ticket = Certification.SteamSessionTicket; string text = Convert.ToBase64String(MessagePackSerializer.FromJson(JsonMapper.ToJson(Params))); Uri uri = new Uri(Url.Trim()); string text2 = udid + uri.AbsolutePath + text; - if (Certification.ViewerId != 0) + if (0 /* Pre-Phase-5 chunk 39: Cute NetworkTask is client-only; dead headless */ != 0) { - text2 += Certification.ViewerId; + text2 += 0 /* Pre-Phase-5 chunk 39: Cute NetworkTask is client-only; dead headless */; } string value = Cryptographer.ComputeHash(text2); header["PARAM"] = value; @@ -380,11 +365,6 @@ public class NetworkTask { } - private void AddHeaderCarrier() - { - header["CARRIER"] = Toolbox.DeviceManager.GetCarrier(); - } - private void AddHeaderKeyChain() { header["KEYCHAIN"] = Certification.GetKeyChainViewerId(); @@ -521,16 +501,6 @@ public class NetworkTask Toolbox.SavedataManager.SetResourceVersion(resourceVersion); } - public void AddSkipCuteCheckResultCode(int resultCode) - { - skipCuteCheckResultCodes.Add(resultCode); - } - - public void AddSkipCuteCheckResultCode(List resultCodes) - { - skipCuteCheckResultCodes.Add(resultCodes); - } - public void SkipAllCuteResultCodeCheckErrorPopup() { skipCuteCheckResultCodes.setSkipAll(pSkipAll: true); @@ -555,16 +525,4 @@ public class NetworkTask { return skipCommonHttpStatusErrorPopUp; } - - public void ClearSkipCuteCheckResultCode() - { - skipCuteCheckResultCodes.Clear(); - } - - public void SkipAllNetworkChecks() - { - SkipAllCuteResultCodeCheckErrorPopup(); - SkipCuteTimeOutPopup(); - SkipCuteHttpStatusErrorPopup(); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/PCPlatform.cs b/SVSim.BattleEngine/Engine/Cute/PCPlatform.cs deleted file mode 100644 index 9809268c..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PCPlatform.cs +++ /dev/null @@ -1,10 +0,0 @@ -using LitJson; - -namespace Cute; - -public abstract class PCPlatform -{ - public abstract void Parse(JsonData response); - - public abstract PaymentPCStartParams SetParameter(string productId, bool isAlertAgree, bool isAlertActive); -} diff --git a/SVSim.BattleEngine/Engine/Cute/PCPlatformSTEAM.cs b/SVSim.BattleEngine/Engine/Cute/PCPlatformSTEAM.cs deleted file mode 100644 index 23363da0..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PCPlatformSTEAM.cs +++ /dev/null @@ -1,34 +0,0 @@ -using LitJson; - -namespace Cute; - -public class PCPlatformSTEAM : PCPlatform -{ - protected PaymentPCStartParamsSTEAM _postParams = new PaymentPCStartParamsSTEAM(); - - public static string State { get; private set; } - - public static string Country { get; private set; } - - public static string Currency { get; private set; } - - public static string Status { get; private set; } - - public override PaymentPCStartParams SetParameter(string productId, bool isAlertAgree, bool isAlertActive) - { - _postParams.product_id = productId; - _postParams.price = PaymentPC.GetInstance().ProductPriceList[productId]; - _postParams.ip_address = Toolbox.DeviceManager.GetIpAddress(); - _postParams.isalertagree = (isAlertAgree ? 1 : 0); - _postParams.isalertactive = (isAlertActive ? 1 : 0); - return _postParams; - } - - public override void Parse(JsonData response) - { - State = response["steam_user_info"]["state"].ToString(); - Country = response["steam_user_info"]["country"].ToString(); - Currency = response["steam_user_info"]["currency"].ToString(); - Status = response["steam_user_info"]["status"].ToString(); - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentCancelTask.cs b/SVSim.BattleEngine/Engine/Cute/PaymentCancelTask.cs deleted file mode 100644 index c6a8b713..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentCancelTask.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Cute; - -public class PaymentCancelTask : NetworkTask -{ - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentCancel; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(PaymentSkuInfo skuInfo, string errorMessage) - { - PaymentStartCancelParams paymentStartCancelParams = new PaymentStartCancelParams(); - paymentStartCancelParams.payment.product_id = skuInfo.productId; - paymentStartCancelParams.payment.currency_code = skuInfo.currencyCode; - paymentStartCancelParams.payment.price = skuInfo.price; - paymentStartCancelParams.error.message = errorMessage; - base.Params = paymentStartCancelParams; - } - - protected override int Parse() - { - return base.Parse(); - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentItemListTask.cs b/SVSim.BattleEngine/Engine/Cute/PaymentItemListTask.cs deleted file mode 100644 index 6afbf727..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentItemListTask.cs +++ /dev/null @@ -1,64 +0,0 @@ -using LitJson; - -namespace Cute; - -public class PaymentItemListTask : NetworkTask -{ - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentItemList; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - protected override int Parse() - { - PaymentImpl instance = PaymentImpl.GetInstance(); - resultCode = (int)base.ResponseData["data_headers"]["result_code"]; - if (resultCode != 1) - { - return resultCode; - } - JsonData jsonData = base.ResponseData["data"]; - instance.ProductIdList.Clear(); - instance.IdList.Clear(); - instance.ProductNameList.Clear(); - instance.ProductPriceList.Clear(); - instance.ProductTextList.Clear(); - instance.ProductPurchaseLimitList.Clear(); - instance.ProductPurchaseNumberList.Clear(); - instance.FormatProductPriceList.Clear(); - instance.ProductCsvIdList.Clear(); - instance.ProductImageNameList.Clear(); - instance.ProductIsSpecialShop.Clear(); - instance.ProductCurrentPurchaseCount.Clear(); - instance.ProductPurchaseLimitCount.Clear(); - instance.ProductEndTime.Clear(); - for (int i = 0; i < jsonData.Count; i++) - { - JsonData jsonData2 = jsonData[i]; - string text = jsonData2["store_product_id"].ToString(); - string value = jsonData2["name"].ToString().Replace("\\n", "\n"); - string value2 = jsonData2["text"].ToString(); - string text2 = jsonData2["purchase_limit"].ToString(); - string text3 = jsonData2["id"].ToString(); - string value3 = jsonData2["image_name"].ToString(); - string value4 = jsonData2["end_time"].ToString(); - bool value5 = ((jsonData2["special_shop_flag"].ToInt() != 0) ? true : false); - instance.ProductIdList.Add(text); - instance.IdList.Add(text3); - instance.ProductNameList.Add(text, value); - instance.ProductTextList.Add(text, value2); - instance.ProductPurchaseLimitList.Add(text3, text2); - instance.ProductPurchaseLimitCount.Add(text, int.Parse(text2)); - instance.ProductImageNameList.Add(text, value3); - if (jsonData2.Keys.Contains("number_of_product_purchased") && jsonData2["number_of_product_purchased"] != null) - { - string text4 = jsonData2["number_of_product_purchased"].ToString(); - instance.ProductPurchaseNumberList.Add(text3, text4); - instance.ProductCurrentPurchaseCount.Add(text, int.Parse(text4)); - } - instance.ProductCsvIdList.Add(text, text3); - instance.ProductIsSpecialShop.Add(text, value5); - instance.ProductEndTime.Add(text, value4); - } - return resultCode; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentPCFinishTask.cs b/SVSim.BattleEngine/Engine/Cute/PaymentPCFinishTask.cs deleted file mode 100644 index 170a0641..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentPCFinishTask.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Wizard; - -namespace Cute; - -public class PaymentPCFinishTask : NetworkTask -{ - public class PaymentPCFinishParams : PostParams - { - public string product_id = ""; - - public string steam_app_id = ""; - - public string steam_order_id = ""; - - public string steam_user_country = ""; - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentPCFinish; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(string ProductId, string StreamAppID = "", string SteamOrderId = "") - { - PaymentPCFinishParams paymentPCFinishParams = new PaymentPCFinishParams(); - paymentPCFinishParams.product_id = ProductId; - paymentPCFinishParams.steam_app_id = StreamAppID; - paymentPCFinishParams.steam_order_id = SteamOrderId; - paymentPCFinishParams.steam_user_country = PCPlatformSTEAM.Country; - base.Params = paymentPCFinishParams; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - if (base.ResponseData["data"].Count > 0) - { - if (base.ResponseData["data"]["purchased_times_data"] != null) - { - Data.Load.data._userCrystalCount._lastPaymentItemBuyNumber = base.ResponseData["data"]["purchased_times_data"]["number_of_product_purchased"].ToInt(); - if (base.ResponseData["data"]["purchased_times_data"].Keys.Contains("csv_data_id")) - { - Data.Load.data._userCrystalCount._lastPaymentId = base.ResponseData["data"]["purchased_times_data"]["csv_data_id"].ToString(); - } - } - else - { - Data.Load.data._userCrystalCount._lastPaymentItemBuyNumber = 0; - Data.Load.data._userCrystalCount._lastPaymentId = null; - } - Data.Load.data._userCrystalCount.total_crystal = base.ResponseData["data"]["after_free_crystal"].ToInt() + base.ResponseData["data"]["after_crystal"].ToInt(); - Data.Load.data._userCrystalCount.free_crystal = base.ResponseData["data"]["after_free_crystal"].ToInt(); - Data.Load.data._userCrystalCount.charge_crystal = base.ResponseData["data"]["after_crystal"].ToInt(); - MyPageMenu.Instance.UpdateCrystalCount(); - if (CreateItemList.GetInstance() != null) - { - CreateItemList.GetInstance().UpdateCrystalCount(); - } - if (GachaUI.GetInstance() != null) - { - GachaUI.GetInstance().UpdateUserItemCount(); - } - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentPCItemListTask.cs b/SVSim.BattleEngine/Engine/Cute/PaymentPCItemListTask.cs deleted file mode 100644 index 08b10540..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentPCItemListTask.cs +++ /dev/null @@ -1,61 +0,0 @@ -using LitJson; - -namespace Cute; - -public class PaymentPCItemListTask : NetworkTask -{ - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentPCItemList; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - protected override int Parse() - { - PaymentPC instance = PaymentPC.GetInstance(); - resultCode = (int)base.ResponseData["data_headers"]["result_code"]; - if (resultCode != 1) - { - return resultCode; - } - JsonData jsonData = base.ResponseData["data"]; - instance.ProductIdList.Clear(); - instance.IdList.Clear(); - instance.ProductNameList.Clear(); - instance.ProductPriceList.Clear(); - instance.ProductTextList.Clear(); - instance.ProductPurchaseLimitList.Clear(); - instance.FormatProductPriceList.Clear(); - instance.ProductCsvIdList.Clear(); - instance.ProductImageNameList.Clear(); - instance.ProductIsSpecialShop.Clear(); - instance.ProductCurrentPurchaseCount.Clear(); - instance.ProductEndTime.Clear(); - for (int i = 0; i < jsonData.Count; i++) - { - JsonData jsonData2 = jsonData[i]; - string text = jsonData2["store_product_id"].ToString(); - string value = jsonData2["name"].ToString().Replace("\\n", "\n"); - string value2 = jsonData2["text"].ToString(); - string value3 = jsonData2["price"].ToString(); - string text2 = jsonData2["purchase_limit"].ToString(); - string text3 = jsonData2["id"].ToString(); - string value4 = jsonData2["image_name"].ToString(); - string value5 = jsonData2["end_time"].ToString(); - bool value6 = ((jsonData2["special_shop_flag"].ToInt() != 0) ? true : false); - int value7 = jsonData2["purchase_num_current"].ToInt(); - instance.ProductIdList.Add(text); - instance.IdList.Add(text3); - instance.ProductNameList.Add(text, value); - instance.ProductPriceList.Add(text, value3); - instance.FormatProductPriceList.Add(text, value3); - instance.ProductTextList.Add(text, value2); - instance.ProductPurchaseLimitList.Add(text3, text2); - instance.ProductCsvIdList.Add(text, text3); - instance.ProductImageNameList.Add(text, value4); - instance.ProductIsSpecialShop.Add(text, value6); - instance.ProductCurrentPurchaseCount.Add(text, value7); - instance.ProductPurchaseLimitCount.Add(text, int.Parse(text2)); - instance.ProductEndTime.Add(text, value5); - } - return resultCode; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentPCStartParams.cs b/SVSim.BattleEngine/Engine/Cute/PaymentPCStartParams.cs deleted file mode 100644 index 7eee27fb..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentPCStartParams.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Cute; - -public class PaymentPCStartParams : PostParams -{ - public string product_id = ""; - - public string price = ""; - - public int isalertagree; - - public int isalertactive; -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentPCStartParamsSTEAM.cs b/SVSim.BattleEngine/Engine/Cute/PaymentPCStartParamsSTEAM.cs deleted file mode 100644 index d8792dec..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentPCStartParamsSTEAM.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Cute; - -public class PaymentPCStartParamsSTEAM : PaymentPCStartParams -{ - public string ip_address = ""; -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentPCStartTask.cs b/SVSim.BattleEngine/Engine/Cute/PaymentPCStartTask.cs deleted file mode 100644 index 921443e2..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentPCStartTask.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace Cute; - -public class PaymentPCStartTask : NetworkTask -{ - protected PCPlatform _platform; - - protected CuteNetworkDefine.ApiType _apiType = CuteNetworkDefine.ApiType.PaymentPCStart; - - public PaymentBase.RefundWarningType NeedRefundWarningType { get; private set; } - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[_apiType]}"; - - public PaymentPCStartTask() - { - _platform = new PCPlatformSTEAM(); - } - - public void SetParameter(string ProductId, bool isAlertAgree, bool isAlertActive) - { - base.Params = _platform.SetParameter(ProductId, isAlertAgree, isAlertActive); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - if (base.ResponseData["data"].Count > 0) - { - _platform.Parse(base.ResponseData["data"]); - NeedRefundWarningType = (PaymentBase.RefundWarningType)base.ResponseData["data"]["refund_penalty_type"].ToInt(); - } - return num; - } - - public PCPlatform getPCPlatform() - { - return _platform; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentStartCancelParams.cs b/SVSim.BattleEngine/Engine/Cute/PaymentStartCancelParams.cs deleted file mode 100644 index 4ee8a99c..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentStartCancelParams.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Cute; - -public class PaymentStartCancelParams : PostParams -{ - public class PaymentError - { - public string message = ""; - } - - public class Payment - { - public string product_id = ""; - - public string price = ""; - - public string currency_code = ""; - - public int isalertagree; - - public int isalertactive; - } - - public Payment payment = new Payment(); - - public PaymentError error = new PaymentError(); -} diff --git a/SVSim.BattleEngine/Engine/Cute/PaymentStartTask.cs b/SVSim.BattleEngine/Engine/Cute/PaymentStartTask.cs deleted file mode 100644 index 78e3b27b..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PaymentStartTask.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Cute; - -public class PaymentStartTask : NetworkTask -{ - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentStart; - - public PaymentBase.RefundWarningType NeedRefundWarningType { get; private set; } - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(PaymentSkuInfo skuInfo, bool isAlertAgree, bool isAlertActive) - { - PaymentStartCancelParams paymentStartCancelParams = new PaymentStartCancelParams(); - paymentStartCancelParams.payment.product_id = skuInfo.productId; - paymentStartCancelParams.payment.currency_code = skuInfo.currencyCode; - paymentStartCancelParams.payment.price = skuInfo.price; - paymentStartCancelParams.payment.isalertagree = (isAlertAgree ? 1 : 0); - paymentStartCancelParams.payment.isalertactive = (isAlertActive ? 1 : 0); - base.Params = paymentStartCancelParams; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - NeedRefundWarningType = (PaymentBase.RefundWarningType)base.ResponseData["data"]["refund_penalty_type"].ToInt(); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/PublistTransitionCode.cs b/SVSim.BattleEngine/Engine/Cute/PublistTransitionCode.cs deleted file mode 100644 index 24a461eb..00000000 --- a/SVSim.BattleEngine/Engine/Cute/PublistTransitionCode.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Cute; - -public class PublistTransitionCode : NetworkTask -{ - public class Email : PostParams - { - public string password { get; set; } - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.GetTransitionCode; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(string password) - { - Email email = new Email(); - email.password = password; - base.Params = email; - } - - protected override int Parse() - { - return base.Parse(); - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/QualityManager.cs b/SVSim.BattleEngine/Engine/Cute/QualityManager.cs index dd31f734..59489a23 100644 --- a/SVSim.BattleEngine/Engine/Cute/QualityManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/QualityManager.cs @@ -7,331 +7,48 @@ public class QualityManager : MonoBehaviour, IManager { public enum GPUQualityLevel { - Level_1, - Level_2, - Level_3, - Level_4 } public enum AssetQualityLevel { - None, - Level_1, - Level_2, - Max - } + None} public enum SoundQualityLevel { - None, - Level_1, - Level_2, - Max - } + None} public enum MovieQualityLevel { - None, - Level_1, - Level_2, - Max - } + None} public enum MemoryQualityLevel { - Level_1, - Level_2 } public enum GameQualityLevel { - Level_1, - Level_2, - Level_3, - Level_4 } public enum OutLineLevel { - OutLine_On, - OutLine_Off } - private GPUQualityLevel _gpuQualityLevel; - - private AssetQualityLevel _assetQualityLevel; - - private SoundQualityLevel _soundQualityLevel; - - private MovieQualityLevel _movieQualityLevel; - - private MemoryQualityLevel _memoryQualityLevel; - private Vector2 _deviceResolution = Vector2.zero; - private Vector2 _gameResolution = Vector2.zero; - private int _defaultFrameRate = 60; - private bool _isDeviceResolutionSetting; - public bool isFullScreen; - private GameQualityLevel _gameQualityLevel; - - private OutLineLevel _outlineLevel; - - public Vector2 deviceResolution => _deviceResolution; - - public Vector2 gameResolution => _gameResolution; - private void Awake() { UpdateFromUnity(); } - private IEnumerator Start() - { - while (Toolbox.SavedataManager == null) - { - yield return 0; - } - Initialize(); - Toolbox.QualityManager = this; - } - - private void OnDestroy() - { - } - - public void Initialize() - { - CheckGPUQuality(); - CheckMemoryQuality(); - CheckAssetQuality(); - CheckSoundQuality(); - CheckMovieQuality(); - InitializeGameQuality(); - } - - private void CheckGPUQuality() - { - _gpuQualityLevel = GPUQualityLevel.Level_4; - } - - private void CheckMemoryQuality() - { - _memoryQualityLevel = MemoryQualityLevel.Level_2; - } - - private void CheckAssetQuality() - { - _assetQualityLevel = ((_memoryQualityLevel == MemoryQualityLevel.Level_1) ? AssetQualityLevel.Level_1 : AssetQualityLevel.Level_2); - SetAssetQualityLevel(_assetQualityLevel); - } - - private void CheckSoundQuality() - { - int num = Toolbox.SavedataManager.GetInt("SOUNDQUALIY"); - if (num != 0) - { - _soundQualityLevel = (SoundQualityLevel)num; - } - else - { - _soundQualityLevel = ((_memoryQualityLevel == MemoryQualityLevel.Level_1) ? SoundQualityLevel.Level_1 : SoundQualityLevel.Level_2); - } - SetSoundQualityLevel(_soundQualityLevel); - } - - private void CheckMovieQuality() - { - _movieQualityLevel = ((_memoryQualityLevel == MemoryQualityLevel.Level_1) ? MovieQualityLevel.Level_1 : MovieQualityLevel.Level_2); - } - - public static GPUQualityLevel GetGPUQualityLevel() - { - if (Toolbox.QualityManager == null) - { - return GPUQualityLevel.Level_1; - } - return Toolbox.QualityManager._gpuQualityLevel; - } - - public static MemoryQualityLevel GetMemoryQualityLevel() - { - if (Toolbox.QualityManager == null) - { - return MemoryQualityLevel.Level_1; - } - return Toolbox.QualityManager._memoryQualityLevel; - } - - public static void SetAssetQualityLevel(AssetQualityLevel _AssetQualityLevel) - { - if (Toolbox.QualityManager != null) - { - Toolbox.QualityManager._assetQualityLevel = _AssetQualityLevel; - } - } - - public static AssetQualityLevel GetAssetQualityLevel() - { - if (Toolbox.QualityManager == null) - { - return AssetQualityLevel.Level_1; - } - return Toolbox.QualityManager._assetQualityLevel; - } - - public static void SetSoundQualityLevel(SoundQualityLevel _SoundQualityLevel) - { - if (Toolbox.QualityManager != null) - { - Toolbox.QualityManager._soundQualityLevel = _SoundQualityLevel; - Toolbox.SavedataManager.SetInt("SOUNDQUALIY", (int)Toolbox.QualityManager._soundQualityLevel); - } - } - - public static SoundQualityLevel GetSoundQualityLevel() - { - if (Toolbox.QualityManager == null) - { - return SoundQualityLevel.Level_1; - } - return Toolbox.QualityManager._soundQualityLevel; - } - - public static void SetMovieQualityLevel(MovieQualityLevel _MovieQualityLevel) - { - if (Toolbox.QualityManager != null) - { - Toolbox.QualityManager._movieQualityLevel = _MovieQualityLevel; - } - } - - public static MovieQualityLevel GetMovieQualityLevel() - { - if (Toolbox.QualityManager == null) - { - return MovieQualityLevel.Level_1; - } - return Toolbox.QualityManager._movieQualityLevel; - } - - public void LimitResolution() - { - _gameResolution = _deviceResolution; - if (_deviceResolution.x > 1280f || _deviceResolution.y > 1280f) - { - float num = 1280f / _deviceResolution.x; - _gameResolution = new Vector2(_deviceResolution.x * num, _deviceResolution.y * num); - Screen.SetResolution((int)_gameResolution.x, (int)_gameResolution.y, isFullScreen); - } - } - - public void ChangeResolution(float rate, bool saveratio = true) - { - LimitResolution(); - float num = _gameResolution.x * rate / _gameResolution.x; - _gameResolution = new Vector2(_gameResolution.x * num, _gameResolution.y * num); - Screen.SetResolution((int)_gameResolution.x, (int)_gameResolution.y, isFullScreen); - } - - public void ChangeResolutionToDeviceSetting() - { - _gameResolution = _deviceResolution; - Screen.SetResolution((int)_gameResolution.x, (int)_gameResolution.y, isFullScreen); - } - - public void ChangeResolution(float width, float height, bool fullscreen) - { - if (width == 0f || height == 0f) - { - width = Screen.width; - height = Screen.height; - } - isFullScreen = fullscreen; - _deviceResolution = new Vector2(width, height); - Screen.SetResolution((int)width, (int)height, fullscreen); - } - - private void InitializeGameQuality() - { - if (_gpuQualityLevel == GPUQualityLevel.Level_4) - { - _gameQualityLevel = GameQualityLevel.Level_4; - } - else if (_gpuQualityLevel == GPUQualityLevel.Level_3) - { - _gameQualityLevel = GameQualityLevel.Level_3; - } - else if (_gpuQualityLevel == GPUQualityLevel.Level_2) - { - _gameQualityLevel = GameQualityLevel.Level_2; - } - else - { - _gameQualityLevel = GameQualityLevel.Level_1; - } - if (_memoryQualityLevel == MemoryQualityLevel.Level_1) - { - _gameQualityLevel = GameQualityLevel.Level_1; - } - if (!_isDeviceResolutionSetting) - { - _deviceResolution = new Vector2(Screen.width, Screen.height); - _isDeviceResolutionSetting = true; - } - if (_gpuQualityLevel <= GPUQualityLevel.Level_2 && Toolbox.SavedataManager.GetInt("SOUNDQUALIY") == 0) - { - SetSoundQualityLevel(SoundQualityLevel.Level_1); - } - DecideDeviceSetting(); - } - - private void DecideDeviceSetting() - { - string graphicsDeviceName = SystemInfo.graphicsDeviceName; - if (graphicsDeviceName.Contains("PowerVR") && graphicsDeviceName.Contains("SGX 540")) - { - _outlineLevel = OutLineLevel.OutLine_Off; - } - } - - public void SetGameQualityLevel(GPUQualityLevel level) - { - _gpuQualityLevel = level; - } - - public GameQualityLevel GetGameQualityLevel() - { - return _gameQualityLevel; - } - - public void SetFrameRate(int frameRate) - { - _defaultFrameRate = frameRate; - } - public int GetFrameRate() { return _defaultFrameRate; } - public void ChangeResolutionFixedHalf() - { - } - - public void ChangeResolutionFixedBack() - { - } - - public OutLineLevel GetOutLineLevel() - { - return _outlineLevel; - } - public void UpdateFromUnity() { isFullScreen = Screen.fullScreen; diff --git a/SVSim.BattleEngine/Engine/Cute/ResourcesManager.cs b/SVSim.BattleEngine/Engine/Cute/ResourcesManager.cs index 79c04a09..2bf80d08 100644 --- a/SVSim.BattleEngine/Engine/Cute/ResourcesManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/ResourcesManager.cs @@ -143,81 +143,35 @@ public class ResourcesManager : MonoBehaviour, IManager private enum ProgressDebugType { Progress_NONE, - Progress_DOWNLOAD, Progress_LOAD } public enum BackgroundDownloadState { None, - Init, - Download, StopRequest } public enum StopResult { - Paused, - Stopped, - Finished } - public List Card3DAssetPathList = new List(); - public List Card2DAssetPathList = new List(); public List CardListAssetPathList = new List(); - public List SleeveListAssetPathList = new List(); - public List BattleListAssetPathList = new List(); - private bool downloadSemaphore; - - private AssetRequestContext downloadRequestContext = new AssetRequestContext(null, new Utility.LeanSemaphore(0), new AssetErrorState()); - private bool loadSemaphore; private AssetRequestContext loadRequestContext = new AssetRequestContext(null, new Utility.LeanSemaphore(0), new AssetErrorState()); - private bool useAssetBundle = true; - public static int fixedParallelTasks; private int _preferredParallelLoadTasks = -1; - private int _preferredParallelDownloadTasks = -1; - - private List downloadList; - public BackgroundDownloadState BgDownloadState; - private bool _stopForMovie; - - public static float TextureScaleRatio - { - get - { - if (QualityManager.GetAssetQualityLevel() == QualityManager.AssetQualityLevel.Level_1) - { - return 2f; - } - return 1f; - } - } - - public static float AtlasValueRatio - { - get - { - if (QualityManager.GetAssetQualityLevel() == QualityManager.AssetQualityLevel.Level_1) - { - return 0.5f; - } - return 1f; - } - } - public string GetAssetTypePath(string path, AssetLoadPathType type, bool isfetch = false) { if (string.IsNullOrEmpty(path)) @@ -934,12 +888,6 @@ public class ResourcesManager : MonoBehaviour, IManager return sleeveId; } - public bool IsExistSleeveNormalMap(long sleeveId) - { - string assetTypePath = GetAssetTypePath(sleeveId.ToString(), AssetLoadPathType.SleeveTextureNormalMap); - return ExistsAssetBundleManifest(assetTypePath); - } - private void AddAssetNotFoundLog(string path) { string text = "asset not found : " + path; @@ -947,11 +895,6 @@ public class ResourcesManager : MonoBehaviour, IManager LocalLog.AccumulateTraceLog(text); } - public string GetLoadFontFilePath(string fileName) - { - return "f/" + fileName; - } - public Material FindCardMaterial(int cardId, AssetLoadPathType type, bool isEvol = false, bool isMutation = false, CardBasePrm.CharaType originalType = CardBasePrm.CharaType.NORMAL, bool isChoiceBrave = false) { string text = ((cardId / 1000000000 == 1) ? GetAssetTypePath($"{cardId}_M", AssetLoadPathType.UnitCardMaterial, isfetch: true) : ((isEvol && type == AssetLoadPathType.UnitCardMaterial) ? GetAssetTypePath($"{cardId}1_M", type, isfetch: true) : ((!(isMutation || isChoiceBrave)) ? GetAssetTypePath($"{cardId}0_M", type, isfetch: true) : ((originalType != CardBasePrm.CharaType.NORMAL) ? GetAssetTypePath($"{cardId}0_M", AssetLoadPathType.SpellCardMaterial, isfetch: true) : GetAssetTypePath($"{cardId}0_M", AssetLoadPathType.UnitCardMaterial, isfetch: true))))); @@ -963,19 +906,6 @@ public class ResourcesManager : MonoBehaviour, IManager return obj; } - public int GetPreferredParallelDownloadNum() - { - if (fixedParallelTasks > 0) - { - return fixedParallelTasks; - } - if (_preferredParallelDownloadTasks < 0) - { - _preferredParallelDownloadTasks = 4; - } - return _preferredParallelDownloadTasks; - } - public int GetPreferredParallelLoadNum() { if (fixedParallelTasks > 0) @@ -993,177 +923,6 @@ public class ResourcesManager : MonoBehaviour, IManager { } - private void Start() - { - downloadList = new List(); - Toolbox.ResourcesManager = this; - } - - public void RequestDownloadStopForMovie() - { - if (BgDownloadState == BackgroundDownloadState.Download) - { - BgDownloadState = BackgroundDownloadState.StopRequest; - _stopForMovie = true; - } - } - - public void RequestDownloadStopForMainDownload() - { - if (BgDownloadState == BackgroundDownloadState.Download) - { - BgDownloadState = BackgroundDownloadState.StopRequest; - } - } - - private IEnumerator WaitBgDownloadStopRequestFulfilled() - { - while (!Toolbox.AssetManager.IsDownloadJobIdle()) - { - yield return null; - } - BgDownloadState = BackgroundDownloadState.None; - } - - public StopResult Stop() - { - if (BgDownloadState == BackgroundDownloadState.StopRequest) - { - BgDownloadState = BackgroundDownloadState.None; - if (_stopForMovie) - { - _stopForMovie = false; - return StopResult.Paused; - } - return StopResult.Stopped; - } - if (BgDownloadState == BackgroundDownloadState.Download) - { - BgDownloadState = BackgroundDownloadState.None; - return StopResult.Finished; - } - return StopResult.Stopped; - } - - public bool CanStartBgDownload() - { - if (CanStartDownload()) - { - return !Toolbox.MovieManager.IsPlaying(); - } - return false; - } - - public bool CanStartDownload() - { - if (BgDownloadState == BackgroundDownloadState.None && !downloadSemaphore) - { - return Toolbox.AssetManager.IsDownloadJobIdle(); - } - return false; - } - - public IEnumerator DownloadAssetGroupBackground(List assetList, Action callback, bool isProgress = true, bool isSavePlayerPrefs = true) - { - if (BgDownloadState == BackgroundDownloadState.Init) - { - BgDownloadState = BackgroundDownloadState.Download; - yield return _DownloadAssetGroup(assetList, callback, isProgress, isSavePlayerPrefs); - } - } - - public IEnumerator DownloadAssetGroup(List assetList, Action callback, bool isProgress = true, bool isSavePlayerPrefs = true) - { - while (BgDownloadState == BackgroundDownloadState.Init) - { - yield return null; - } - if (BgDownloadState == BackgroundDownloadState.Download) - { - BgDownloadState = BackgroundDownloadState.StopRequest; - } - while (BgDownloadState == BackgroundDownloadState.StopRequest) - { - yield return WaitBgDownloadStopRequestFulfilled(); - } - Action callback2 = delegate - { - if (callback != null) - { - callback(); - } - }; - yield return _DownloadAssetGroup(assetList, callback2, isProgress, isSavePlayerPrefs); - } - - private IEnumerator _DownloadAssetGroup(List assetList, Action callback, bool isProgress = true, bool isSavePlayerPrefs = true) - { - if (assetList == null || assetList.Count == 0) - { - callback?.Invoke(); - yield break; - } - while (downloadSemaphore) - { - yield return null; - } - SetDownloadProcessLock(enable_lock: true); - QualitySettings.vSyncCount = 0; - Application.targetFrameRate = 60; - if (downloadList.Count > 0) - { - downloadList.Clear(); - } - bool isDownloadVoiceUse = Toolbox.AudioManager.isDownloadVoiceUse; - for (int i = 0; i < assetList.Count; i++) - { - AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(assetList[i]); - if (assetHandle != null && (!assetHandle.IsSoundVoice() || isDownloadVoiceUse) && assetHandle.isReDownloadAsset(CustomPreference.IsNormalResource)) - { - downloadList.Add(assetList[i]); - } - } - if (downloadList.Count > 0) - { - Toolbox.AssetManager.AddDownloadMaxCount(downloadList.Count); - yield return StartCoroutine(DownloadAssetGroupSub(downloadList, isProgress)); - yield return new WaitForFixedUpdate(); - if (isSavePlayerPrefs) - { - Toolbox.SavedataManager.Save(); - } - } - QualitySettings.vSyncCount = 0; - Application.targetFrameRate = Toolbox.QualityManager.GetFrameRate(); - SetDownloadProcessLock(enable_lock: false); - callback?.Invoke(); - } - - private IEnumerator DownloadAssetGroupSub(List assetList, bool isProgress = true) - { - if (isProgress) - { - UIManager.GetInstance().LoadingViewManager.UpdateLoadingNum(0); - } - if (BgDownloadState != BackgroundDownloadState.StopRequest) - { - downloadRequestContext.callback = null; - yield return StartCoroutine(ParallelAssetListExec(assetList, GetPreferredParallelDownloadNum(), downloadRequestContext, DownloadAssetSub, isProgress ? ProgressDebugType.Progress_DOWNLOAD : ProgressDebugType.Progress_NONE)); - UIManager.GetInstance().LoadingViewManager.UpdateLoadingNum(100); - } - } - - public IEnumerator DownloadAsset(string assetName, Action callback, bool isSavePlayerPrefs = true) - { - List assetList = new List { assetName }; - yield return StartCoroutine(DownloadAssetGroup(assetList, callback, isProgress: true, isSavePlayerPrefs)); - } - - private void DownloadAssetSub(string assetName, AssetRequestContext requestContext) - { - Toolbox.AssetManager.DownloadAsset(assetName, requestContext); - } - private List FilterAssetList(List assetList, ref List duplicateList) { if (assetList.Count < 2) @@ -1305,17 +1064,6 @@ public class ResourcesManager : MonoBehaviour, IManager LocalLog.UpdateLoadResourceLog("FinishLoad"); } - public IEnumerator DownloadAssetGroupWithLoadAsset(List assetList, Action callback, bool isProgress = true) - { - if (assetList == null || assetList.Count == 0) - { - callback?.Invoke(); - yield break; - } - yield return StartCoroutine(DownloadAssetGroup(assetList, null, isProgress)); - yield return StartCoroutine(LoadAssetGroupAsync(assetList, null, isProgress)); - } - private bool QuickLoadAsset(string assetName) { AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(assetName); @@ -1395,23 +1143,6 @@ public class ResourcesManager : MonoBehaviour, IManager Toolbox.AssetManager.CacheAsset(assetName, requestContext); } - public void StartCoroutine_DownloadAssetGroupWithLoadAsset(List assetList, Action callback, bool isProgress = true) - { - if (assetList == null || assetList.Count == 0) - { - callback?.Invoke(); - } - else - { - StartCoroutine(DownloadAssetGroupWithLoadAsset(assetList, callback, isProgress)); - } - } - - public void StartCoroutine_DownloadAssetGroupWithLoadAsset(string asset, Action callback, bool isProgress = true) - { - StartCoroutine_DownloadAssetGroupWithLoadAsset(new List { asset }, callback, isProgress); - } - public void StartCoroutine_LoadAssetGroupAsync(List assetList, Action callback, bool isProgress = true) { if (assetList == null || assetList.Count == 0) @@ -1441,11 +1172,6 @@ public class ResourcesManager : MonoBehaviour, IManager } } - public void StartCoroutine_LoadAssetGroupSync(string asset, Action callback, bool isProgress = true) - { - StartCoroutine(LoadAssetGroupSync(new List { asset }, callback, isProgress)); - } - public void RemoveAssetGroup(List assetList) { for (int i = 0; i < assetList.Count; i++) @@ -1459,39 +1185,6 @@ public class ResourcesManager : MonoBehaviour, IManager Toolbox.AssetManager.UnloadAsset(assetName); } - public void RemoveAssetForceCommon() - { - Toolbox.AssetManager.UnloadCommonAssetAll(); - } - - public void RemoveAssetCommon(string assetName) - { - Toolbox.AssetManager.UnloadCommonAsset(assetName); - } - - public void RegistCommonAsset(List assetList) - { - for (int i = 0; i < assetList.Count; i++) - { - Toolbox.AssetManager.RegistCommonAsset(assetList[i]); - } - } - - public void RemoveAssetForceTemporary() - { - Toolbox.AssetManager.UnloadTemporaryAssetAll(); - } - - public void RemoveAssetTemporary(string assetName) - { - Toolbox.AssetManager.UnloadTemporaryAsset(assetName); - } - - public void RegistTemporaryAsset(string assetName) - { - Toolbox.AssetManager.RegistTemporaryAsset(assetName); - } - public bool ExistsAssetBundleManifest(string assetName) { if (Toolbox.AssetManager.GetAssetHandle(assetName) != null) @@ -1501,43 +1194,6 @@ public class ResourcesManager : MonoBehaviour, IManager return false; } - public bool CheckBeforeFileRequeset(string assetName) - { - return Toolbox.AssetManager.IsEnableAssetName(assetName); - } - - public bool IsLoadedAssetBundle(string assetName) - { - if (Toolbox.AssetManager == null) - { - return false; - } - if (Toolbox.AssetManager.GetAssetBundleObject(assetName) != null) - { - return true; - } - return false; - } - - public bool IsLoadedAssetBundleAndObjectArrayExist(string assetName) - { - if (IsLoadedAssetBundle(assetName)) - { - return Toolbox.AssetManager.GetAssetBundleObject(assetName).objectArray.Count > 0; - } - return false; - } - - public void UseAssetBundle(bool bEnabled) - { - useAssetBundle = bEnabled; - } - - public bool IsUseAssetBundle() - { - return useAssetBundle; - } - public UnityEngine.Object LoadObject(string objectName, bool isServerResources = true, bool isIfFindLoad = false) { return LoadObject(objectName, isServerResources); @@ -1561,147 +1217,8 @@ public class ResourcesManager : MonoBehaviour, IManager return Resources.Load(objectName); } - public UnityEngine.Object LoadObject(string assetName, string objectName, bool isServerResources = true) - { - return LoadObject(assetName, objectName, isServerResources); - } - - public T LoadObject(string assetName, string objectName, bool isServerResources = true) where T : UnityEngine.Object - { - if (!isServerResources) - { - return Resources.Load(objectName); - } - AssetManager assetManager = Toolbox.AssetManager; - if (assetManager != null) - { - UnityEngine.Object obj = assetManager.LoadObject(assetName, objectName, typeof(T)); - if (obj != null) - { - return (T)obj; - } - } - return Resources.Load(objectName); - } - - private void SetDownloadProcessLock(bool enable_lock) - { - downloadSemaphore = enable_lock; - } - private void SetLoadProcessLock(bool enable_lock) { loadSemaphore = enable_lock; } - - public IEnumerator GameInitialize() - { - Toolbox.BootNetwork.SetupNetwork(); - while (!Toolbox.BootNetwork.IsDoneGameStartCheck) - { - yield return 0; - } - yield return StartCoroutine(Toolbox.AssetManager.InitializeManifest(null, !Data.Load.data._userTutorial.NeedAllResource)); - } - - public static int calcTextureSize(int x) - { - return (int)(TextureScaleRatio * (float)x); - } - - public static Vector2 calcTextureSize(Vector2 vec) - { - return vec * TextureScaleRatio; - } - - public static int calcAtlasValue(int x, float rate) - { - return (int)(rate * (float)x + 0.5f); - } - - public static void ResizeUISprite(UISprite _sprite) - { - _sprite.MakePixelPerfect(); - int w = calcTextureSize(_sprite.width); - int h = calcTextureSize(_sprite.height); - _sprite.SetDimensions(w, h); - } - - public static void ResizeUISpriteSliced(UISprite _sprite) - { - } - - public static void resizeUIAtlas(UIAtlas atlas, GameObject parentObject, Material material = null) - { - if (atlas == null || atlas.replacement != null || QualityManager.GetAssetQualityLevel() != QualityManager.AssetQualityLevel.Level_1) - { - return; - } - string text = atlas.name; - UIAtlas uIAtlas = UnityEngine.Object.Instantiate(atlas); - uIAtlas.transform.parent = parentObject.transform; - uIAtlas.name = text + "_half"; - atlas.replacement = uIAtlas; - if (material != null) - { - uIAtlas.spriteMaterial = material; - } - List spriteList = uIAtlas.spriteList; - if (spriteList != null) - { - for (int i = 0; i < spriteList.Count; i++) - { - UISpriteData uISpriteData = spriteList[i]; - int width = uISpriteData.width; - int height = uISpriteData.height; - uISpriteData.x = calcAtlasValue(uISpriteData.x, AtlasValueRatio); - uISpriteData.y = calcAtlasValue(uISpriteData.y, AtlasValueRatio); - uISpriteData.width = calcAtlasValue(uISpriteData.width, AtlasValueRatio); - uISpriteData.height = calcAtlasValue(uISpriteData.height, AtlasValueRatio); - uISpriteData.borderLeft = uISpriteData.width - calcAtlasValue(width - uISpriteData.borderLeft, AtlasValueRatio); - uISpriteData.borderRight = calcAtlasValue(uISpriteData.borderRight, AtlasValueRatio); - uISpriteData.borderTop = calcAtlasValue(uISpriteData.borderTop, AtlasValueRatio); - uISpriteData.borderBottom = uISpriteData.height - calcAtlasValue(height - uISpriteData.borderBottom, AtlasValueRatio); - uISpriteData.paddingLeft = calcAtlasValue(uISpriteData.paddingLeft, AtlasValueRatio); - uISpriteData.paddingRight = calcAtlasValue(uISpriteData.paddingRight, AtlasValueRatio); - uISpriteData.paddingTop = calcAtlasValue(uISpriteData.paddingTop, AtlasValueRatio); - uISpriteData.paddingBottom = calcAtlasValue(uISpriteData.paddingBottom, AtlasValueRatio); - } - } - } - - public void ClearLoadCount() - { - Toolbox.AssetManager.ResetDownloadCount(); - } - - public int GetDownLoadMax() - { - return Toolbox.AssetManager.GetDownloadMaxCount(); - } - - public int GetDownLoadCompleted() - { - return Toolbox.AssetManager.GetDownloadCurrentCount(); - } - - public float GetDownloadCompletedSize() - { - return Toolbox.AssetManager.GetDownloadCompletedSize(); - } - - public float GetDownloadMaxSize() - { - return Toolbox.AssetManager.GetDownloadSize(CustomPreference.IsNormalResource); - } - - public int GetLoadingMax() - { - return Toolbox.AssetManager.GetLoadingMaxCount(); - } - - public int GetLoadingCompleted() - { - return Toolbox.AssetManager.GetLoadingCurrentCount(); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/SavedataManager.cs b/SVSim.BattleEngine/Engine/Cute/SavedataManager.cs index 84797f88..5e623784 100644 --- a/SVSim.BattleEngine/Engine/Cute/SavedataManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/SavedataManager.cs @@ -5,48 +5,6 @@ namespace Cute; public class SavedataManager : MonoBehaviour, IManager { - public const string RESOURCE_VERSION_KEY = "RES_VER"; - - public const string LANGUAGE_FIRST_SET = "LANG_FIRST_SET"; - - public const string LANGUAGE_KEY = "LANG_SETTING"; - - public const string LANGUAGE_SOUND_KEY = "LANG_SOUND_SETTING"; - - public const string LANGUAGE_FONT_KEY = "LANG_FONT"; - - public static string OMOTENASHI_COUNTRY_KEY = "OMOTE_COUNTRY"; - - public static string LANGUAGE_CHANGE = "LANG_CHANGE"; - - private void Start() - { - Toolbox.SavedataManager = this; - } - - private void OnDestroy() - { - } - - public void DeleteAll() - { - ObscuredPrefs.DeleteAll(); - } - - public void DeleteKey(string key) - { - ObscuredPrefs.DeleteKey(key); - } - - public float GetFloat(string key, float defaultValue = 0f) - { - return ObscuredPrefs.GetFloat(key, defaultValue); - } - - public void SetFloat(string key, float value) - { - ObscuredPrefs.SetFloat(key, value); - } public int GetInt(string key, int defaultValue = 0) { @@ -68,16 +26,6 @@ public class SavedataManager : MonoBehaviour, IManager ObscuredPrefs.SetString(key, value); } - public bool HasKey(string key) - { - return ObscuredPrefs.HasKey(key); - } - - public void Save() - { - ObscuredPrefs.Save(); - } - public void SetResourceVersion(string version) { SetString("RES_VER", version); diff --git a/SVSim.BattleEngine/Engine/Cute/SceneType.cs b/SVSim.BattleEngine/Engine/Cute/SceneType.cs deleted file mode 100644 index 46ec2eb2..00000000 --- a/SVSim.BattleEngine/Engine/Cute/SceneType.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Cute; - -public enum SceneType -{ - None, - _Splash, - GameTitle, - Title, - Battle, - CardList, - GAMESCENE_TYPE_MAX, - _SoftwareReset, - TYPE_MAX -} diff --git a/SVSim.BattleEngine/Engine/Cute/SignUpTask.cs b/SVSim.BattleEngine/Engine/Cute/SignUpTask.cs deleted file mode 100644 index 39af4f70..00000000 --- a/SVSim.BattleEngine/Engine/Cute/SignUpTask.cs +++ /dev/null @@ -1,72 +0,0 @@ -using LitJson; -using UnityEngine; - -namespace Cute; - -public class SignUpTask : NetworkTask -{ - private class LoginPostParams : PostParams - { - public string device_name = ""; - - public string client_type = ""; - - public string os_version = ""; - - public string app_version = ""; - - public string resource_version = ""; - - public string carrier = ""; - } - - private CuteNetworkDefine.ApiType apiType; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter() - { - LoginPostParams loginPostParams = new LoginPostParams(); - loginPostParams.device_name = Toolbox.DeviceManager.GetModelName(); - loginPostParams.client_type = Toolbox.DeviceManager.GetDeviceType().ToString(); - loginPostParams.os_version = Toolbox.DeviceManager.GetOsVersion(); - loginPostParams.app_version = Toolbox.DeviceManager.GetAppVersionName(); - loginPostParams.resource_version = "00000000"; - loginPostParams.carrier = Toolbox.DeviceManager.GetCarrier(); - base.Params = loginPostParams; - } - - protected override int Parse() - { - JsonData jsonData = base.ResponseData["data_headers"]; - resultCode = jsonData["result_code"].ToInt(); - if (resultCode != 1) - { - return resultCode; - } - int viewerId = jsonData["viewer_id"].ToInt(); - int shortUdid = jsonData["short_udid"].ToInt(); - string text = jsonData["udid"].ToString(); - if (Certification.Udid != text) - { - Debug.LogError("udid一致しません。不正のアクセスです。"); - } - else - { - Certification.ViewerId = viewerId; - Certification.ShortUdid = shortUdid; - Certification.SessionId = ""; - AdjustManager.ViewerIDEvent(); - GameObject gameObject = GameObject.Find("OmotePlugin"); - if (gameObject != null) - { - OmotePlugin component = gameObject.GetComponent(); - if (component != null) - { - component.SendConversion(text); - } - } - } - return resultCode; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/SkipCuteCheckResultCodes.cs b/SVSim.BattleEngine/Engine/Cute/SkipCuteCheckResultCodes.cs index 3f70b2cc..5c4296e5 100644 --- a/SVSim.BattleEngine/Engine/Cute/SkipCuteCheckResultCodes.cs +++ b/SVSim.BattleEngine/Engine/Cute/SkipCuteCheckResultCodes.cs @@ -18,23 +18,8 @@ internal class SkipCuteCheckResultCodes return skipAll; } - public void Add(int resultCode) - { - resultCodes.Add(resultCode); - } - - public void Add(List pResultCodes) - { - resultCodes.AddRange(pResultCodes); - } - public bool Contains(int resultCode) { return resultCodes.Contains(resultCode); } - - public void Clear() - { - resultCodes.Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/Cute/SocialServiceUtility.cs b/SVSim.BattleEngine/Engine/Cute/SocialServiceUtility.cs deleted file mode 100644 index db276498..00000000 --- a/SVSim.BattleEngine/Engine/Cute/SocialServiceUtility.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Facebook.Unity; -using UnityEngine; - -namespace Cute; - -public class SocialServiceUtility : MonoBehaviour -{ - private bool isLogin_; - - private bool isCountTime; - - private float timer; - - public bool IsRunning { get; protected set; } - - public bool IsLoggedIn - { - get - { - return isLogin_; - } - protected set - { - isLogin_ = value; - } - } - - public string SocialServiceUserId { get; private set; } - - public string FirebaseIdToken { get; private set; } - - public string FaceBookAccountId { get; private set; } - - public string FaceBookAuthenticationToken { get; private set; } - - public bool FaceBookIsLoggedIn => FB.IsLoggedIn; - - public static SocialServiceUtility Instance { get; private set; } - - public static SocialServiceUtility CreateInstance() - { - if (null == Instance) - { - Instance = new GameObject(typeof(SocialServiceUtility).Name).AddComponent(); - UnityEngine.Object.DontDestroyOnLoad(Instance); - } - return Instance; - } - - private void Update() - { - if (isCountTime) - { - checkTimeOut(); - } - } - - private void Awake() - { - } - - private void AndroidInit() - { - } - - private void FbInit() - { - } - - public void FbSignIn(string nonce, Action onetimeCallback) - { - if (IsRunning) - { - return; - } - if (FaceBookIsLoggedIn && FaceBookAccountId != null) - { - if (onetimeCallback != null) - { - onetimeCallback(FaceBookIsLoggedIn); - } - return; - } - IsRunning = true; - INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI; - networkUI.StartLoading(); - FB.LogInWithReadPermissions(new List { "public_profile" }, delegate(ILoginResult result) - { - IsRunning = false; - networkUI.StopLoading(); - if (result == null) - { - onetimeCallback(obj: false); - } - else if (!string.IsNullOrEmpty(result.Error)) - { - onetimeCallback(obj: false); - } - else if (result.Cancelled) - { - onetimeCallback(obj: false); - } - else if (!string.IsNullOrEmpty(result.RawResult)) - { - FaceBookAccountId = AccessToken.CurrentAccessToken.TokenString; - FaceBookAuthenticationToken = ""; - onetimeCallback(obj: true); - } - }); - } - - public IEnumerator SignIn(Action onetimeCallback) - { - if (IsRunning) - { - yield break; - } - if (IsLoggedIn && SocialServiceUserId != null) - { - onetimeCallback?.Invoke(IsLoggedIn); - yield break; - } - IsRunning = true; - INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI; - networkUI.StartLoading(); - StartTimeCount(); - UnitySocialPlatformSingIn(networkUI); - while (IsRunning) - { - yield return null; - } - onetimeCallback(IsLoggedIn); - } - - public void UnitySocialPlatformSingIn(INetworkUI networkUI) - { - Social.localUser.Authenticate(delegate(bool result) - { - if (IsRunning && !result) - { - IsLoggedIn = false; - IsRunning = false; - StopTimeCount(); - networkUI.StopLoading(); - } - }); - } - - private void getFirebaseIdToken(INetworkUI networkUI) - { - } - - public void FbSignOut() - { - if (FaceBookIsLoggedIn) - { - FB.LogOut(); - FaceBookAccountId = null; - } - } - - public void SignOut(Action onetimeCallback = null) - { - if (IsLoggedIn && !IsRunning) - { - IsRunning = true; - IsRunning = false; - IsLoggedIn = false; - onetimeCallback?.Invoke(); - } - } - - public static string GetSocialServiceName() - { - return ""; - } - - public static int GetSocialServiceType() - { - return 0; - } - - public void StartTimeCount() - { - isCountTime = true; - } - - public void StopTimeCount() - { - isCountTime = false; - timer = 0f; - } - - private void checkTimeOut() - { - timer += Time.deltaTime; - if (timer >= 30f) - { - timer = 0f; - INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI; - networkUI.StopLoading(); - StopTimeCount(); - networkUI.OpenSocialServiceNoResponseErrorPopup(); - IsRunning = false; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/SoftwareResetBase.cs b/SVSim.BattleEngine/Engine/Cute/SoftwareResetBase.cs index 38922665..b914aeb6 100644 --- a/SVSim.BattleEngine/Engine/Cute/SoftwareResetBase.cs +++ b/SVSim.BattleEngine/Engine/Cute/SoftwareResetBase.cs @@ -10,11 +10,6 @@ public static class SoftwareResetBase private static Action resetAction; - public static bool IsSoftwareReset() - { - return isSoftwareReset; - } - public static void setSoftwareResetAction(Action _action) { resetAction = _action; diff --git a/SVSim.BattleEngine/Engine/Cute/SoundData.cs b/SVSim.BattleEngine/Engine/Cute/SoundData.cs deleted file mode 100644 index b22c902d..00000000 --- a/SVSim.BattleEngine/Engine/Cute/SoundData.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Cute; - -public struct SoundData -{ - public string _acbName; - - public string _cueName; - - public int _cueId; - - public SoundData(string acbName, string cueName, int cueId) - { - _acbName = acbName; - _cueName = cueName; - _cueId = cueId; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/SteamMicroTxnInitTask.cs b/SVSim.BattleEngine/Engine/Cute/SteamMicroTxnInitTask.cs deleted file mode 100644 index ea7216ec..00000000 --- a/SVSim.BattleEngine/Engine/Cute/SteamMicroTxnInitTask.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Steamworks; - -namespace Cute; - -public class SteamMicroTxnInitTask : NetworkTask -{ - private class MicroTxtInitPost : PostParams - { - public new string steam_id = ""; - - public string app_id = ""; - - public string currency = ""; - - public string ip_address = ""; - - public string item_id = ""; - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.SteamMicroTxnInit; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(string item_id) - { - MicroTxtInitPost microTxtInitPost = new MicroTxtInitPost(); - try - { - microTxtInitPost.steam_id = SteamUser.GetSteamID().ToString(); - microTxtInitPost.app_id = SteamUtils.GetAppID().ToString(); - } - catch (Exception ex) - { - Debug.LogError(ex.Message); - Debug.LogError(ex.StackTrace); - Debug.LogError("steam client を起動してください。"); - } - microTxtInitPost.currency = PCPlatformSTEAM.Currency; - microTxtInitPost.ip_address = Toolbox.DeviceManager.GetIpAddress(); - microTxtInitPost.item_id = item_id; - base.Params = microTxtInitPost; - } - - protected override int Parse() - { - int result = base.Parse(); - _ = 1; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/TimeData.cs b/SVSim.BattleEngine/Engine/Cute/TimeData.cs index aaaa2487..f39b6a05 100644 --- a/SVSim.BattleEngine/Engine/Cute/TimeData.cs +++ b/SVSim.BattleEngine/Engine/Cute/TimeData.cs @@ -16,11 +16,6 @@ public class TimeData connectClientTime = (long)TimeNativePlugin.GetDeviceOperatingTime(); } - public DateTime GetNowTime() - { - return TimeUtil.GetNowTime(serverTime, connectClientTime); - } - public DateTime GetNowTime_UTC() { return TimeUtil.GetNowTime_UTC(serverTime, connectClientTime); @@ -30,48 +25,4 @@ public class TimeData { return (float)TimeUtil.GetTimeLeft(serverTime, endTime, 0L).millisecond / 1000f; } - - [Obsolete("動作未検証", false)] - public IEnumerator StartTimeLeft(MonoBehaviour obj, long endTime, Action callback) - { - IEnumerator enumerator = timeLeftCoroutine(callback, endTime, 0L); - obj.StartCoroutine(enumerator); - return enumerator; - } - - [Obsolete("動作未検証", false)] - public IEnumerator StartTimeLeft(MonoBehaviour obj, long endTime, long consumingTime, Action callback) - { - IEnumerator enumerator = timeLeftCoroutine(callback, endTime, consumingTime); - obj.StartCoroutine(enumerator); - return enumerator; - } - - [Obsolete("動作未検証", false)] - public string GetNowTimeString() - { - DateTime nowTime = GetNowTime(); - return $"{nowTime.Year:D4}-{nowTime.Month:D2}-{nowTime.Day:D2} {nowTime.Hour:D2}:{nowTime.Minute:D2}:{nowTime.Second:D2}"; - } - - [Obsolete("動作未検証", false)] - private TimeUtil.TimeLeftParam GetTimeLeft(long endTime, long consumingTime = 0L) - { - return TimeUtil.GetTimeLeft(TimeUtil.ToUnixTime(GetNowTime()), endTime, consumingTime); - } - - [Obsolete("動作未検証", false)] - private IEnumerator timeLeftCoroutine(Action callback, long endTime, long consumingTime = 0L) - { - while (true) - { - TimeUtil.TimeLeftParam timeLeft = GetTimeLeft(endTime, consumingTime); - callback(timeLeft); - if (timeLeft.isEnd) - { - break; - } - yield return null; - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/TimeUtil.cs b/SVSim.BattleEngine/Engine/Cute/TimeUtil.cs index 2b0b5d33..46e02ca0 100644 --- a/SVSim.BattleEngine/Engine/Cute/TimeUtil.cs +++ b/SVSim.BattleEngine/Engine/Cute/TimeUtil.cs @@ -1,4 +1,8 @@ using System; +// TODO(engine-cleanup-pass2): 11 of 12 methods unrun in baseline +// Type: Cute.TimeUtil +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Cute; @@ -70,21 +74,6 @@ public class TimeUtil private static readonly DateTime UNIX_EPOCH = new DateTime(1970, 1, 1, 0, 0, 0, 0); - public const int DAY_HOUR = 24; - - public const int DAY_SECOND = 86400; - - public const int HOUR_SECOND = 3600; - - public const int MINUTE_SECOND = 60; - - public const int MILLI_SECOND = 1000; - - public static DateTime GetNowTime(long serverTime, long connectClientTime) - { - return UNIX_EPOCH.AddSeconds((float)serverTime + TimeNativePlugin.GetDeviceOperatingTime() - (float)connectClientTime).ToLocalTime(); - } - public static DateTime GetNowTime_UTC(long serverTime, long connectClientTime) { return UNIX_EPOCH.AddSeconds((float)serverTime + TimeNativePlugin.GetDeviceOperatingTime() - (float)connectClientTime); @@ -95,53 +84,13 @@ public class TimeUtil return UNIX_EPOCH.AddSeconds(TimeNativePlugin.GetDeviceOperatingTime()); } - public static long ToUnixTime(string str) - { - if (str == null) - { - return 0L; - } - return ToUnixTime(DateTime.Parse(str)); - } - - public static long ToUnixTime(DateTime dateTime) - { - return (long)ToUnixTimeDouble(dateTime); - } - - public static double ToUnixTimeDouble(DateTime dateTime) - { - dateTime = dateTime.ToUniversalTime(); - return (dateTime - UNIX_EPOCH).TotalSeconds; - } - - public static DateTime FromUnixTime(long unixTime) - { - return UNIX_EPOCH.AddSeconds(Convert.ToDouble(unixTime)).ToLocalTime(); - } - - public static DateTime MicroTimeToFromUnixTime(long unixTime) - { - return FromUnixTime(unixTime / 1000); - } - public static TimeLeftParam GetTimeLeft(long nowTime, long endTime, long consumingTime = 0L) { return new TimeLeftParam(endTime - nowTime, consumingTime); } - public static long GetElapsedTime(DateTime baseDateTime, DateTime dateTime) - { - return ToUnixTime(dateTime) - ToUnixTime(baseDateTime); - } - public static TimeSpan GetElapsedTimeByTimeSpan(DateTime baseDateTime, DateTime dateTime) { return baseDateTime - dateTime; } - - public static bool IsTermTime(string startDate, string endDate, long checkTime = 0L) - { - return true; - } } diff --git a/SVSim.BattleEngine/Engine/Cute/Toolbox.cs b/SVSim.BattleEngine/Engine/Cute/Toolbox.cs index 11f74e27..83551efc 100644 --- a/SVSim.BattleEngine/Engine/Cute/Toolbox.cs +++ b/SVSim.BattleEngine/Engine/Cute/Toolbox.cs @@ -1,65 +1,32 @@ -using System.Threading; - -namespace Cute; - -public class Toolbox -{ - private enum SYSTEM_INIT - { - SYSTEM_NOT_READY, - SYSTEM_READY - } - - public static bool isLoadFromLocal; - - public static bool isLoadLocalSound; - - public static BootSystem BootSystem; - - public static BootNetwork BootNetwork; - - public static SceneManager SceneManager; - - public static NetworkManager NetworkManager; - - public static AssetManager AssetManager; - - public static SavedataManager SavedataManager; - - public static DeviceManager DeviceManager; - - public static QualityManager QualityManager; - - public static ResourcesManager ResourcesManager; - - public static AudioManager AudioManager; - - public static MovieManager MovieManager; - - public static DebugManager DebugManager; - - public static Mutex mute; - - public static void Clear() - { - BootSystem = null; - BootNetwork = null; - SceneManager = null; - NetworkManager = null; - AssetManager = null; - SavedataManager = null; - DeviceManager = null; - QualityManager = null; - ResourcesManager = null; - AudioManager = null; - } - - public static bool isFrameWorkLoaded() - { - if (BootSystem != null && BootNetwork != null && SceneManager != null && NetworkManager != null && AssetManager != null && SavedataManager != null && DeviceManager != null && QualityManager != null && ResourcesManager != null && AudioManager != null) - { - return true; - } - return false; - } -} +using System.Threading; + +namespace Cute; + +public class Toolbox +{ + private enum SYSTEM_INIT + { + } + + public static BootSystem BootSystem; + + public static BootNetwork BootNetwork; + + public static NetworkManager NetworkManager; + + public static AssetManager AssetManager; + + public static SavedataManager SavedataManager; + + public static DeviceManager DeviceManager; + + public static QualityManager QualityManager; + + public static ResourcesManager ResourcesManager; + + + + public static DebugManager DebugManager; + + public static Mutex mute; +} diff --git a/SVSim.BattleEngine/Engine/Cute/TransitionCodeParams.cs b/SVSim.BattleEngine/Engine/Cute/TransitionCodeParams.cs deleted file mode 100644 index 92e04a26..00000000 --- a/SVSim.BattleEngine/Engine/Cute/TransitionCodeParams.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Cute; - -internal class TransitionCodeParams : PostParams -{ - public string input_viewer_id = ""; - - public string password = ""; -} diff --git a/SVSim.BattleEngine/Engine/Cute/URLScheme.cs b/SVSim.BattleEngine/Engine/Cute/URLScheme.cs deleted file mode 100644 index 45dac985..00000000 --- a/SVSim.BattleEngine/Engine/Cute/URLScheme.cs +++ /dev/null @@ -1,180 +0,0 @@ -using UnityEngine; - -namespace Cute; - -public class URLScheme -{ - private enum CPTYPE - { - IORI = 1, - ALIVE - } - - private static string process = ""; - - private static string result = ""; - - private static string scheme = ""; - - private static int short_udid = 0; - - private static string udid = ""; - - private static string error_code = ""; - - private static string campaign_data = ""; - - private static int app_type = 0; - - private const string COMBINE = "combine"; - - private const string MIGRATION = "migration"; - - private const string OK = "ok"; - - private const string NG = "ng"; - - private const string IORI = "cg"; - - private const string ALIVE = "pc"; - - public const string EC_MIGRATION_CANCEL = "3070"; - - public const string EC_COMBINE_CANCEL = "3060"; - - public const string EC_MIGRATION_ALREADY_RECORDED = "3061"; - - public const string EC_COMBINE_NO_URL = "3054"; - - public const string EC_MIGRATION_NO_URL = "3063"; - - public const string EC_COMBINE_EXEC_HAVE_RECORD = "3057"; - - public static string CampaignData => campaign_data; - - public static int AppType => app_type; - - public static void URLSchemeStartAndroid() - { - GetURLSchemeParamsAndroid(); - ProcessSetting(); - } - - public static void URLSchemeStartiOS(string message) - { - GetURLSchemeParamsiOS(message); - ProcessSetting(); - } - - public static bool IsCombineOK() - { - if (process == "combine" && result == "ok") - { - return short_udid == Certification.ShortUdid; - } - return false; - } - - public static bool IsCombineNG() - { - if (process == "combine" && result == "ng") - { - return error_code != ""; - } - return false; - } - - public static bool IsMigrationOK() - { - if (process == "migration" && result == "ok") - { - return udid == Certification.Udid; - } - return false; - } - - public static bool IsMigrationNG() - { - if (process == "migration" && result == "ng") - { - return error_code != ""; - } - return false; - } - - public static bool IsMigrationFinished() - { - if (process == "migration" && result == "ng") - { - return error_code == "3061"; - } - return false; - } - - public static void Clear() - { - scheme = ""; - process = ""; - result = ""; - short_udid = 0; - udid = ""; - error_code = ""; - } - - public static void ClearCampaignData() - { - campaign_data = ""; - app_type = 0; - } - - private static void GetURLSchemeParamsAndroid() - { - Clear(); - } - - private static void GetURLSchemeParamsiOS(string url) - { - Clear(); - if (url == "") - { - url = PlayerPrefs.GetString("iOSUrlScheme", ""); - PlayerPrefs.DeleteKey("iOSUrlScheme"); - } - if (url.IndexOf("://") >= 0) - { - scheme = url.Substring(0, url.IndexOf("://")); - AnalysisResult(url.Substring(url.IndexOf("://") + 3)); - } - } - - private static void ProcessSetting() - { - if (!(scheme == "")) - { - if (IsCombineOK()) - { - DataMigration.CombineSucceed(); - } - else if (IsCombineNG()) - { - DataMigration.CombineFailed(); - } - else if (IsMigrationOK()) - { - DataMigration.MigrationSucceed(); - } - else if (IsMigrationNG()) - { - DataMigration.MigrationFailed(); - } - } - } - - private static void AnalysisResult(string host) - { - if (scheme == "shadowverse") - { - UIManager.GetInstance().AccountTransferHelper.GetAppleData(host); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/UpdateBirthTask.cs b/SVSim.BattleEngine/Engine/Cute/UpdateBirthTask.cs deleted file mode 100644 index fb8049a2..00000000 --- a/SVSim.BattleEngine/Engine/Cute/UpdateBirthTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -using UnityEngine; - -namespace Cute; - -public class UpdateBirthTask : NetworkTask -{ - private class UpdateBirthPostParams : PostParams - { - public string birth = ""; - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.BirthUpdate; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(string birth) - { - UpdateBirthPostParams updateBirthPostParams = new UpdateBirthPostParams(); - updateBirthPostParams.birth = birth; - base.Params = updateBirthPostParams; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - CreateItemList.BirthDayUpdateServerTime = base.ResponseData["data_headers"]["servertime"].ToInt(); - CreateItemList.BirthDayUpdateRealTime = Time.realtimeSinceStartup; - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/UpdateiCloudUserDataTask.cs b/SVSim.BattleEngine/Engine/Cute/UpdateiCloudUserDataTask.cs deleted file mode 100644 index cdb709cc..00000000 --- a/SVSim.BattleEngine/Engine/Cute/UpdateiCloudUserDataTask.cs +++ /dev/null @@ -1,47 +0,0 @@ -using LitJson; - -namespace Cute; - -public class UpdateiCloudUserDataTask : NetworkTask -{ - private class iCloudUserParams : PostParams - { - public string carrier = ""; - - public string icloud_data = ""; - } - - private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.MigrateiCloudUser; - - public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}"; - - public void SetParameter(string iCloudData) - { - iCloudUserParams iCloudUserParams = new iCloudUserParams(); - iCloudUserParams.icloud_data = iCloudData; - iCloudUserParams.carrier = Toolbox.DeviceManager.GetCarrier(); - base.Params = iCloudUserParams; - } - - protected override int Parse() - { - if (resultCode != 1) - { - return base.Parse(); - } - JsonData jsonData = base.ResponseData["data_headers"]; - int viewerId = jsonData["viewer_id"].ToInt(); - int shortUdid = jsonData["short_udid"].ToInt(); - string text = jsonData["udid"].ToString(); - if (Certification.Udid != text) - { - Debug.LogError("udid一致しません。不正のアクセスです。"); - } - else - { - Certification.ViewerId = viewerId; - Certification.ShortUdid = shortUdid; - } - return resultCode; - } -} diff --git a/SVSim.BattleEngine/Engine/Cute/Utility.cs b/SVSim.BattleEngine/Engine/Cute/Utility.cs index d33ae527..e6c67606 100644 --- a/SVSim.BattleEngine/Engine/Cute/Utility.cs +++ b/SVSim.BattleEngine/Engine/Cute/Utility.cs @@ -21,7 +21,6 @@ public class Utility public class EzCrypt { - private const string characters = ".SWK2hm4sVd8fOxZr0tqBncwX6P5k3HTCL_IzGYeMlyQFEbNvDjio9J7paRUAg1u-"; private int numScale; @@ -39,51 +38,6 @@ public class Utility table[i] = ".SWK2hm4sVd8fOxZr0tqBncwX6P5k3HTCL_IzGYeMlyQFEbNvDjio9J7paRUAg1u-".IndexOf((char)i); } } - - public char[] Encode(char[] src) - { - int num = key; - for (int i = 0; i < src.Length; i++) - { - num = new System.Random(num + src[i]).Next(); - } - int num2 = num % (numScale - 1) + 1; - int num3 = num / (numScale - 1) % (numScale - 1) + 1; - int num4 = num2 * numScale + num3; - int num5 = src.Length + 2; - char[] array = new char[num5]; - array[0] = ".SWK2hm4sVd8fOxZr0tqBncwX6P5k3HTCL_IzGYeMlyQFEbNvDjio9J7paRUAg1u-"[num2]; - array[num5 - 1] = ".SWK2hm4sVd8fOxZr0tqBncwX6P5k3HTCL_IzGYeMlyQFEbNvDjio9J7paRUAg1u-"[num3]; - int num6 = num4; - for (int j = 0; j < src.Length; j++) - { - int num7 = table[(uint)src[j]]; - if (num7 < 0) - { - return null; - } - array[j + 1] = ".SWK2hm4sVd8fOxZr0tqBncwX6P5k3HTCL_IzGYeMlyQFEbNvDjio9J7paRUAg1u-"[(num7 + num6) % numScale]; - num6 += num4 + array[j + 1]; - } - return array; - } - - public char[] Decode(char[] src) - { - int num = table[(uint)src[0]] * numScale + table[(uint)src[src.Length - 1]]; - int num2 = num; - char[] array = new char[src.Length - 2]; - for (int i = 0; i < src.Length - 2; i++) - { - int num3 = table[(uint)src[i + 1]]; - for (num3 = num3 + numScale - num2; num3 < 0; num3 += numScale) - { - } - array[i] = ".SWK2hm4sVd8fOxZr0tqBncwX6P5k3HTCL_IzGYeMlyQFEbNvDjio9J7paRUAg1u-"[num3 % numScale]; - num2 += num + src[i + 1]; - } - return array; - } } public class LeanSemaphore @@ -125,72 +79,8 @@ public class Utility } } - private static DateTime UNIX_EPOCH = new DateTime(1970, 1, 1, 0, 0, 0, 0); - private static readonly string LangTypeKorString = Global.LANG_TYPE.Kor.ToString(); - private static string[,] ArraySymbolCode = new string[33, 2] - { - { " ", "\u3000" }, - { "", "!" }, - { "\"", "”" }, - { "#", "#" }, - { "$", "$" }, - { "%", "%" }, - { "&", "&" }, - { "'", "’" }, - { "(", "(" }, - { ")", ")" }, - { "*", "*" }, - { "+", "+" }, - { ",", "," }, - { "-", "-" }, - { ".", "." }, - { "/", "/" }, - { ":", ":" }, - { ";", ";" }, - { "<", "<" }, - { "=", "=" }, - { ">", ">" }, - { "?", "?" }, - { "@", "@" }, - { "[", "[" }, - { "\\", "■" }, - { "]", "]" }, - { "^", "\uff3e" }, - { "_", "\uff3f" }, - { "`", "’" }, - { "{", "{" }, - { "|", "|" }, - { "}", "}" }, - { "~", "~" } - }; - - public static long GetUnixTime(DateTime targetTime) - { - return GetUnixTimeMilliSeconds(targetTime) / 1000; - } - - public static long GetUnixTimeMilliSeconds(DateTime targetTime) - { - targetTime = targetTime.ToUniversalTime(); - return (long)(targetTime - UNIX_EPOCH).TotalMilliseconds; - } - - public static string LongToTimeSpanString(long unixTime) - { - TimeSpan timeSpan = TimeSpan.FromSeconds(unixTime); - if (timeSpan.Hours > 0) - { - return timeSpan.Hours + "時間" + timeSpan.Minutes.ToString("{0:D2}") + "分"; - } - if (timeSpan.Minutes > 0) - { - return timeSpan.Hours + "分" + timeSpan.Seconds.ToString("{0:D2}") + "秒"; - } - return timeSpan.Seconds + "秒"; - } - public static ArrayList ConvertCSV(string csvText, bool removeTitle = true) { if (CustomPreference.GetTextLanguage() == LangTypeKorString) @@ -555,16 +445,6 @@ public class Utility return list; } - public static int CountString(string strInput, string strFind) - { - int num = 0; - for (int num2 = strInput.IndexOf(strFind); num2 > -1; num2 = strInput.IndexOf(strFind, num2 + 1)) - { - num++; - } - return num; - } - public static StringBuilder CreateHash(byte[] data) { MD5CryptoServiceProvider mD5CryptoServiceProvider = new MD5CryptoServiceProvider(); @@ -584,20 +464,6 @@ public class Utility return CreateHash(Encoding.UTF8.GetBytes(data)); } - public static string GetRegionString() - { - return "JP"; - } - - public static void LogString(string message) - { - string text = ""; - foreach (char c in message) - { - text += $"{(int)c:X2} "; - } - } - public static string GetRuntimePlatform() { string result = "Windows"; @@ -615,117 +481,4 @@ public class Utility } return result; } - - public static string ConvertInputText(string srcText) - { - srcText = StripColorTag(srcText); - StringInfo stringInfo = new StringInfo(srcText); - string text = ""; - int lengthInTextElements = stringInfo.LengthInTextElements; - for (int i = 0; i < lengthInTextElements; i++) - { - string text2 = stringInfo.SubstringByTextElements(i, 1); - if (IsEnableCharSet2(text2)) - { - text2 = ConvertSymbolCode(text2); - text += text2; - } - else - { - text += "■"; - } - } - return text; - } - - private static string ConvertSymbolCode(string srcText) - { - for (int i = 0; i < ArraySymbolCode.GetLength(0); i++) - { - if (srcText.Equals(ArraySymbolCode[i, 0])) - { - srcText = ArraySymbolCode[i, 1]; - break; - } - } - return srcText; - } - - private static string StripColorTag(string srcText) - { - return new Regex("[[][a-zA-Z0-9]{6}[]]").Replace(srcText, ""); - } - - private static bool IsEnableCharSet2(string checkChar) - { - byte[] bytes = Encoding.GetEncoding("UTF-8").GetBytes(checkChar); - if (bytes.Length == 1) - { - int num = bytes[0]; - if (num >= 32 && num <= 126) - { - return true; - } - } - if ("\u3000、。,.・:;?!\u309b\u309c\u00b4\uff40\u00a8\uff3e\uffe3\uff3fヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈〉《》「」『』【】+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓∈∋⊆⊇⊂⊃∪∩∧∨¬⇒⇔∀∃∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬ʼn♯♭♪†‡¶◯\t0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψω\tАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя".IndexOf(checkChar) >= 0) - { - return true; - } - if ("亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕".IndexOf(checkChar) >= 0) - { - return true; - } - if ("弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙".IndexOf(checkChar) >= 0) - { - return true; - } - if (new Regex("[\\uFF61-\\uFF9F]").IsMatch(checkChar)) - { - return true; - } - return false; - } - - private static bool IsEnableCharSet(string checkChar) - { - if (GetRegionString().Contains("JP")) - { - byte[] array = ToShiftJisByte(checkChar); - switch (array.Length) - { - case 1: - if (Encoding.GetEncoding("UTF-8").GetBytes(checkChar).Length != 1) - { - return false; - } - return true; - case 2: - { - int num = 256 * array[0] + array[1]; - if ((num >= 33088 && num <= 34716) || (num >= 34975 && num <= 39055) || (num >= 39056 && num <= 40959) || (num >= 57408 && num <= 60159)) - { - return true; - } - break; - } - } - } - return false; - } - - private static byte[] ToShiftJisByte(string str) - { - Encoding encoding = Encoding.GetEncoding("UTF-8"); - Encoding encoding2 = Encoding.GetEncoding("shift_jis"); - byte[] bytes = encoding.GetBytes(str); - try - { - return Encoding.Convert(encoding, encoding2, bytes); - } - catch (Exception ex) - { - Debug.LogError(ex.Message + " text = " + str); - return bytes; - } - } } diff --git a/SVSim.BattleEngine/Engine/Cute/WebViewManager.cs b/SVSim.BattleEngine/Engine/Cute/WebViewManager.cs index e39779fa..a736872f 100644 --- a/SVSim.BattleEngine/Engine/Cute/WebViewManager.cs +++ b/SVSim.BattleEngine/Engine/Cute/WebViewManager.cs @@ -23,26 +23,6 @@ public class WebViewManager : MonoBehaviour private bool screenDpiChangedWhileInvisible; - private static readonly Dictionary FontFamilyDict = new Dictionary - { - { - Global.LANG_TYPE.Jpn.ToString(), - "font_jpn" - }, - { - Global.LANG_TYPE.Kor.ToString(), - "font_kor" - }, - { - Global.LANG_TYPE.Cht.ToString(), - "font_cht" - }, - { - Global.LANG_TYPE.Chs.ToString(), - "font_chs" - } - }; - public Action Callback { get; set; } public static bool HasInstance => instance != null; @@ -77,11 +57,6 @@ public class WebViewManager : MonoBehaviour screenDpi = Screen.dpi; } - private bool IsScreenDpiChanged() - { - return Math.Abs(screenDpi - Screen.dpi) > 0.1f; - } - private void Awake() { instance = this; @@ -89,47 +64,6 @@ public class WebViewManager : MonoBehaviour UpdateScreenDpi(); } - private void OnLoadedCallback(string msg) - { - if (onLoaded != null) - { - onLoaded(msg); - } - } - - private string GetFontFamilyName() - { - if (!FontFamilyDict.TryGetValue(CustomPreference.GetTextLanguage(), out var value)) - { - return "font_alphabet"; - } - return value; - } - - private void OnErrorCallback(string error) - { - if (onError != null) - { - onError(error); - } - } - - private void OnApplicationFocus(bool focus) - { - if (focus && IsScreenDpiChanged()) - { - UpdateScreenDpi(); - if (Visible) - { - OnDpiChange(); - } - else - { - screenDpiChangedWhileInvisible = true; - } - } - } - private void OnDpiChange() { if (OnDpiChangedAction != null) @@ -147,70 +81,15 @@ public class WebViewManager : MonoBehaviour SetMargins((int)oldMargin.x, (int)oldMargin.y, (int)oldMargin.z, (int)oldMargin.w); } - public void ClearFontFilePaths() - { - } - - private void OnDestroy() - { - instance = null; - ClearFontFilePaths(); - } - - public void InitCustomFontFileInfo(Dictionary fileNamePathDict, int currentCustomFontFileIndex) - { - } - - private void InitIOSCustomFont() - { - } - - private void DisableIOSCustomFont() - { - } - - public void OpenWeb(string url) - { - m_WebViewScreen.CurBoxCollider.enabled = true; - SetMargins(UIManager.GetInstance().UIManagerRoot, m_WebViewScreen); - LoadWeb(url); - SetVisible(visible: true); - } - public void LoadWeb(string url) { } - public void ClearHistory() - { - } - public void SetMargins(int leftMargin, int topMargin, int rightMargin, int bottomMargin) { marginNow = new Vector4(leftMargin, topMargin, rightMargin, bottomMargin); } - public void SetMargins(UIRoot trgUIRoot, WebViewScreen trgScreen) - { - float arg = trgUIRoot.activeHeight; - Func func = delegate(float deviceSize, float activeScreenSize, float screenSize, float pos) - { - screenSize += pos * 2f; - screenSize /= activeScreenSize; - screenSize = 1f - screenSize; - return (int)(screenSize * deviceSize * 0.5f); - }; - Vector2 deviceResolution = Toolbox.QualityManager.deviceResolution; - float num = Mathf.Max(deviceResolution.x, deviceResolution.y); - BoxCollider curBoxCollider = trgScreen.CurBoxCollider; - int num2 = (int)(num - num * AspectCamera.SafeAreaRate); - int num3 = (int)(num * AspectCamera.SafeAreaRate) / 30 + num2 / 2; - int rightMargin = num3; - int topMargin = func(deviceResolution.y, arg, curBoxCollider.size.y, curBoxCollider.center.y); - int bottomMargin = func(deviceResolution.y, arg, curBoxCollider.size.y, 0f - curBoxCollider.center.y); - getInstance().SetMargins(num3, topMargin, rightMargin, bottomMargin); - } - public void UnloadWebView() { m_WebViewScreen.CurBoxCollider.enabled = false; @@ -221,14 +100,6 @@ public class WebViewManager : MonoBehaviour OnError = null; } - public void DestroyWebViewObject() - { - } - - public void EvaluateJS(string js) - { - } - public void SetVisible(bool visible) { Visible = visible; @@ -239,14 +110,6 @@ public class WebViewManager : MonoBehaviour } } - public void ClearCaches() - { - } - - public void Reload() - { - } - public bool CanGoBack() { return false; @@ -256,21 +119,8 @@ public class WebViewManager : MonoBehaviour { } - public void Screenshot() - { - } - - public void SetScreenshotData(int width, int height) - { - } - public void SetCallback(Action cb) { Callback = cb; } - - public void CacheClear() - { - LoadWeb(CustomPreference.GetApplicationServerURL() + "information/blank"); - } } diff --git a/SVSim.BattleEngine/Engine/DamageClippingInfo.cs b/SVSim.BattleEngine/Engine/DamageClippingInfo.cs index 52b956e6..a7541596 100644 --- a/SVSim.BattleEngine/Engine/DamageClippingInfo.cs +++ b/SVSim.BattleEngine/Engine/DamageClippingInfo.cs @@ -93,13 +93,4 @@ public class DamageClippingInfo _clippingMaxRange = int.Parse(maxRange); goto IL_0060; } - - public bool CheckMaxFilter(Type filterType) - { - if (_maxFilter != null) - { - return filterType == _maxFilter.GetType(); - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/DamageInfo.cs b/SVSim.BattleEngine/Engine/DamageInfo.cs index 8829b5c2..15ff3eee 100644 --- a/SVSim.BattleEngine/Engine/DamageInfo.cs +++ b/SVSim.BattleEngine/Engine/DamageInfo.cs @@ -1,41 +1,10 @@ public class DamageInfo { - public const string DAMAGE_BATTLE = "battle"; - - public const string DAMAGE_UNIT = "unit"; - - public const string DAMAGE_SPELL = "spell"; - - public const string DAMAGE_FIELD = "field"; public SkillBase Skill { get; private set; } public int Damage { get; private set; } - public string DamageKind - { - get - { - if (Skill == null) - { - return "battle"; - } - if (Skill.SkillPrm.ownerCard.IsUnit) - { - return "unit"; - } - if (Skill.SkillPrm.ownerCard.IsSpell) - { - return "spell"; - } - if (Skill.SkillPrm.ownerCard.IsField) - { - return "field"; - } - return ""; - } - } - public DamageInfo(SkillBase skill, int damage) { Skill = skill; diff --git a/SVSim.BattleEngine/Engine/DataMgr.cs b/SVSim.BattleEngine/Engine/DataMgr.cs index 4562aab4..d2d60d80 100644 --- a/SVSim.BattleEngine/Engine/DataMgr.cs +++ b/SVSim.BattleEngine/Engine/DataMgr.cs @@ -11,10 +11,7 @@ public class DataMgr { public enum SpecialBattleResultType { - None, - Belphomet, - Nerva - } + None } public class SpecialBattleSetting { @@ -157,7 +154,9 @@ public class DataMgr public int m_EnemyAIEmoteId; - public int m_EnemyAIMaxLife; + // Default 20 mirrors the historic AITestGlobal.AI_MAX_LIFE static default. Callers that don't + // invoke SetEnemyAI (e.g. non-AI test fixtures) still get a sensible enemy leader HP. + public int m_EnemyAIMaxLife = 20; public bool m_EnemyAIUseInnerEmote = true; @@ -173,8 +172,6 @@ public class DataMgr private bool _isDirtyPossessionCardDict; - public const int PRACTICE_DIFFICULTY_DEGREE_EASY = 400001; - public BattleType m_BattleType = BattleType.None; public TwoPickFormat TwoPickFormat; @@ -183,20 +180,12 @@ public class DataMgr private static string[] ClanNameTextIdList = new string[9] { "Common_0104", "Common_0105", "Common_0106", "Common_0107", "Common_0108", "Common_0109", "Common_0110", "Common_0111", "Common_0112" }; - public static readonly string[] TribeNameTextIdList = new string[18] - { - "TN_ALL", "TN_指揮官", "TN_兵士", "TN_土の印", "TN_マナリア", "TN_アーティファクト", "TN_財宝", "TN_機械", "TN_料理", "TN_レヴィオン", - "TN_自然", "TN_宴楽", "TN_ヒーロー", "TN_武装", "TN_チェス", "TN_八獄", "TN_学園", "" - }; - public DeckAttributeType LastSelectDeckAttributeType { private get; set; } public int PracticeDifficultyDegreeId { get; set; } public int Practice3DfieldId { get; set; } - public DeckData _roomTwoPickDeckData { get; set; } - public List FavoriteCardList { get; private set; } public DeckGroupListData CurrentDeckListParamData { get; set; } @@ -217,8 +206,6 @@ public class DataMgr public BossRushBattleData BossRushBattleData { get; private set; } - public int PracticePuzzleGroupId { get; set; } - public int PuzzleQuestId { get; set; } public int PuzzleDifficulty { get; set; } @@ -270,88 +257,6 @@ public class DataMgr RecoveryData = recoveryData; } - public void CacheSingleRecovryData() - { - if (RecoveryRecordManagerBase.IsExistsSingleRecoveryFile()) - { - RecoveryData = RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json"); - } - } - - public static bool IsNetworkBattleType(BattleType battleType) - { - switch (battleType) - { - case BattleType.FreeBattle: - case BattleType.RankBattle: - case BattleType.TwoPick: - case BattleType.RoomBattle: - case BattleType.RoomTwoPick: - case BattleType.TwoPickBackdraft: - case BattleType.ColosseumNormal: - case BattleType.ColosseumTwoPick: - case BattleType.ColosseumHof: - case BattleType.Sealed: - case BattleType.ColosseumWindFall: - case BattleType.Gathering: - case BattleType.CompetitionNormal: - case BattleType.CompetitionTwoPick: - return true; - default: - return false; - } - } - - public bool IsColosseumBattleType() - { - BattleType battleType = m_BattleType; - if ((uint)(battleType - 8) <= 1u || battleType == BattleType.ColosseumHof || battleType == BattleType.ColosseumWindFall) - { - return true; - } - return false; - } - - public bool IsCompetitionBattleType() - { - BattleType battleType = m_BattleType; - if (battleType == BattleType.CompetitionNormal || battleType == BattleType.CompetitionTwoPick) - { - return true; - } - return false; - } - - public static bool IsTwoPickBattleType(BattleType battleType) - { - switch (battleType) - { - case BattleType.TwoPick: - case BattleType.RoomTwoPick: - case BattleType.TwoPickBackdraft: - case BattleType.ColosseumTwoPick: - case BattleType.CompetitionTwoPick: - return true; - default: - return false; - } - } - - public static bool IsEnableFormatIconBattleType(BattleType battleType) - { - switch (battleType) - { - case BattleType.FreeBattle: - case BattleType.RankBattle: - case BattleType.RoomBattle: - case BattleType.ColosseumNormal: - case BattleType.CompetitionNormal: - return true; - default: - return false; - } - } - public bool IsDipslayHighRankFormat() { switch (m_BattleType) @@ -380,11 +285,6 @@ public class DataMgr } } - public bool IsTwoPickBattleType() - { - return IsTwoPickBattleType(m_BattleType); - } - public bool IsQuestBattleType() { return IsQuestBattleType(m_BattleType); @@ -399,34 +299,6 @@ public class DataMgr return false; } - public bool IsFormatEnableBattleType() - { - switch (m_BattleType) - { - case BattleType.TwoPick: - case BattleType.Story: - case BattleType.Practice: - case BattleType.ColosseumTwoPick: - case BattleType.ColosseumHof: - case BattleType.Sealed: - case BattleType.ColosseumWindFall: - case BattleType.Quest: - case BattleType.BossRushQuest: - case BattleType.SecretBossQuest: - return false; - default: - if (Data.CurrentFormat == Format.Avatar) - { - return false; - } - if (IsTwoPickBattleType() || Data.CurrentFormat == Format.Max || Data.CurrentFormat == Format.PreRotation || Data.CurrentFormat == Format.Windfall || Data.CurrentFormat == Format.MyRotation || Data.CurrentFormat == Format.TwoPick) - { - return false; - } - return true; - } - } - public bool IsRoomBattleType() { BattleType battleType = m_BattleType; @@ -437,15 +309,6 @@ public class DataMgr return false; } - public static bool IsSingleBattleType(BattleType battleType) - { - if ((uint)(battleType - 4) <= 1u || battleType == BattleType.Quest || (uint)(battleType - 45) <= 1u) - { - return true; - } - return false; - } - public DataMgr() { _possessionCardDict = new Dictionary(); @@ -456,10 +319,6 @@ public class DataMgr PracticeDifficultyDegreeId = 400001; } - public void PrintAIDataLibraryOnlyDebug() - { - } - public void Load() { LoadClassData(); @@ -606,11 +465,6 @@ public class DataMgr _enemyMyRotationInfo = Data.MyRotationAllInfo.Get(myRotationId); } - public void SetEnemyAvatarBattleInfo(string id) - { - _enemyAvatarBattleInfo = Data.AvatarBattleAllInfo.Get(id); - } - public void ClearEnemyAvatarBattleInfo() { _enemyAvatarBattleInfo = null; @@ -670,24 +524,12 @@ public class DataMgr } } - public void SetStoryAILogicAndDeckData(int classId, int enemyAiId) - { - StoryAISettingData settingData = Data.Master.StoryAISettingList.GetSettingData(enemyAiId); - SetCurrentEnemyDeckDataFromAIDeck(classId, -1, settingData.LogicLevel, 20, settingData.DeckId, settingData.StyleId, settingData.EmoteId, settingData.UseInnerEmote, enemyAiId); - } - public void SetQuestAILogicAndDeckData(int classId, int enemyAiId) { StoryAISettingData settingData = Data.Master.QuestAISettingList.GetSettingData(enemyAiId); SetCurrentEnemyDeckDataFromAIDeck(classId, -1, settingData.LogicLevel, 20, settingData.DeckId, settingData.StyleId, settingData.EmoteId, settingData.UseInnerEmote, enemyAiId); } - public void SetRankMatchAILogicAndDeckData(int enemyAiId) - { - RankMatchAISettingData settingData = Data.Master.RankMatchAISettingList.GetSettingData(enemyAiId); - SetCurrentEnemyDeckDataFromAIDeck(settingData.ClassId, -1, 2, 20, settingData.DeckId, settingData.StyleId, -1, useInnerEmote: false, enemyAiId); - } - public void SetCurrentEnemyDeckDataFromAIDeck(int classID, int difficulty, int logicLevel, int maxLife, int deckId, int styleId, int emoteId, bool useInnerEmote, int enemyAiID = -1, List specialAbilityIdList = null) { if (classID == 0) @@ -701,7 +543,6 @@ public class DataMgr m_EnemyAILogicLevel = logicLevel; m_EnemyAIMaxLife = maxLife; m_EnemyAIUseInnerEmote = useInnerEmote; - AITestGlobal.AI_MAX_LIFE = maxLife; AI_LOGIC_LV logicLv = AI_LOGIC_LV.STRONG; switch (logicLevel) { @@ -731,7 +572,6 @@ public class DataMgr m_EnemyAILogicLevel = logicLevel; m_EnemyAIMaxLife = maxLife; m_EnemyAIUseInnerEmote = useInnerEmote; - AITestGlobal.AI_MAX_LIFE = m_EnemyAIMaxLife; AI_LOGIC_LV logicLv = AI_LOGIC_LV.STRONG; switch (logicLevel) { @@ -768,39 +608,6 @@ public class DataMgr } } - public void SetUserOwnCardData(IDictionary userowncarddata) - { - _possessionCardDict = userowncarddata; - SetDirtyPossessionCardDict(); - } - - public void SetClassPrm(JsonData userClassCharaList, JsonData userRankMatchList) - { - Dictionary dictionary = new Dictionary(); - for (int i = 0; i < userClassCharaList.Count; i++) - { - JsonData jsonData = userClassCharaList[i]; - int num = jsonData["class_id"].ToInt(); - if (num < 1 || 9 <= num) - { - continue; - } - ClassCharaPrm classCharaPrm = new ClassCharaPrm(); - classCharaPrm.SetParamWithUserClassJson(jsonData); - for (int j = 0; j < userRankMatchList.Count; j++) - { - JsonData jsonData2 = userRankMatchList[j]; - if (jsonData2["class_id"].ToInt() == num) - { - classCharaPrm.SetClassCharaWin(jsonData2["win"].ToInt()); - classCharaPrm.SetClassCharaBattleCount(jsonData2["match_count"].ToInt()); - } - } - dictionary.Add(num, classCharaPrm); - } - _classPrmDict = dictionary; - } - public void SetSoroPlay3DFieldID(int fieldID) { _soroPlay3DFieldId = fieldID; @@ -822,11 +629,6 @@ public class DataMgr SpecialBattleSettingInfo = null; } - public void ResetStorySpecialBattleResultSkipFlag() - { - SkipStorySpecialBattleResult = SpecialBattleResultType.None; - } - private static Dictionary ParseIdOverrideText(string idOverrideText) { if (string.IsNullOrEmpty(idOverrideText)) @@ -874,25 +676,6 @@ public class DataMgr return ""; } - public static string GetTribeNameByKey(int tribeType) - { - if (tribeType >= TribeNameTextIdList.Length) - { - return ""; - } - string text = TribeNameTextIdList[tribeType]; - if (string.IsNullOrEmpty(text)) - { - return ""; - } - return Data.Master.GetTribeNameText(text); - } - - public IDictionary GetClassPrmDictionary() - { - return _classPrmDict; - } - public ClassCharaPrm GetClassPrm(int classId) { return _classPrmDict[classId]; @@ -932,21 +715,6 @@ public class DataMgr return _playerSubClassId; } - public bool TryGetPlayerSubClassId(out int subClassId) - { - subClassId = GetPlayerSubClassId(); - return IsValidSubClass(subClassId); - } - - private static bool IsValidSubClass(int subClassId) - { - if (subClassId > 0) - { - return subClassId != 10; - } - return false; - } - public bool TryGetPlayerMyRotationInfo(out MyRotationInfo myRotationInfo) { myRotationInfo = _playerMyRotationInfo; @@ -964,11 +732,6 @@ public class DataMgr return GetCharaPrmByCharaId(GetPlayerCharaId()); } - public ClassCharacterMasterData GetPlayerSubCharaData() - { - return GetCharaPrmByCharaId(GetPlayerSubClassId()); - } - public int GetPlayerClassId() { return GetPlayerCharaData().class_id; @@ -984,16 +747,6 @@ public class DataMgr return GetAbleSleeveId(_playerSleeveId); } - public int GetPlayerBattleSkillReverse() - { - return GetPlayerCharaData().battle_skin_reverse; - } - - public Dictionary GetPlayerEmotionData() - { - return Data.Master._emotionDic[GetPlayerEmotionId()]; - } - public string GetPlayerEmotionId() { if (!(_playerEmotionId == "")) @@ -1008,11 +761,6 @@ public class DataMgr _playerEmotionId = id; } - public Dictionary GetEnemyEmotionData() - { - return Data.Master._emotionDic[GetEnemyEmotionId()]; - } - public string GetEnemyEmotionId() { if (!(_enemyEmotionId == "")) @@ -1041,25 +789,14 @@ public class DataMgr return _enemySubClassId; } - public bool TryGetEnemySubClassId(out int subClassId) - { - subClassId = GetEnemySubClassId(); - return IsValidSubClass(subClassId); - } - public ClassCharacterMasterData GetEnemyCharaData() { return GetCharaPrmByCharaId(GetEnemyCharaId()); } - public ClassCharacterMasterData GetEnemySubCharaData() - { - return GetCharaPrmByCharaId(GetEnemySubClassId()); - } - public int GetEnemyClassId() { - if (GameMgr.GetIns().IsPuzzleQuest) + if (false /* Pre-Phase-5b: IsPuzzleQuest const-false */) { return PuzzleEnemyClass; } @@ -1092,21 +829,11 @@ public class DataMgr return GetAbleSleeveId(_enemySleeveId); } - public int GetEnemyBattleSkillReverse() - { - return GetEnemyCharaData().battle_skin_reverse; - } - public bool IsHighRankSkinPlayer() { return GetPlayerCharaData().IsHighRank; } - public bool IsHighRankSkinEnemy() - { - return GetEnemyCharaData().IsHighRank; - } - public bool Is3DSkin(bool isPlayer) { if (isPlayer) @@ -1125,33 +852,6 @@ public class DataMgr return GetEnemyCharaData().IsEvolveSkin; } - public int GetEvolutionDelayFrame(bool isPlayer) - { - if (isPlayer) - { - return GetPlayerCharaData().EvolutionDelayFrame; - } - return GetEnemyCharaData().EvolutionDelayFrame; - } - - public bool IsSelectEmptyDeck() - { - if (_selectDeckId != -1) - { - return false; - } - return true; - } - - public int GetSelectDeckId() - { - if (_selectDeckId == 0) - { - return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_ID); - } - return _selectDeckId; - } - public IList GetCurrentDeckData() { return _currentDeckCardIdList; @@ -1228,27 +928,6 @@ public class DataMgr return GetPossessionBaseCardNum(baseCardId, GetUserOwnCardData(isIncludingSpotCard), cardMasterId); } - public void UpdatePossessionCardNum(int cardId, int num) - { - GetUserOwnCardData(isIncludingSpotCard: false)[cardId] = num; - SetDirtyPossessionCardDict(); - } - - public void RemovePossessionCard(int cardId) - { - IDictionary userOwnCardData = GetUserOwnCardData(isIncludingSpotCard: false); - if (userOwnCardData.ContainsKey(cardId)) - { - userOwnCardData[cardId] = 0; - SetDirtyPossessionCardDict(); - } - } - - public List GetPossessionCardIdList(bool isIncludingSpotCard) - { - return GetUserOwnCardData(isIncludingSpotCard).Keys.ToList(); - } - public Dictionary GetPossessionBaseCardDictionary(bool isIncludingSpotCard, CardMaster.CardMasterId cardMasterId) { CardMaster instance = CardMaster.GetInstance(cardMasterId); diff --git a/SVSim.BattleEngine/Engine/Debug.cs b/SVSim.BattleEngine/Engine/Debug.cs index 5463c2a9..925baef4 100644 --- a/SVSim.BattleEngine/Engine/Debug.cs +++ b/SVSim.BattleEngine/Engine/Debug.cs @@ -5,125 +5,9 @@ using Wizard; public static class Debug { - public static bool isDebugBuild => UnityEngine.Debug.isDebugBuild; - - [Conditional("CYG_DEBUG")] - public static void Assert(bool condition) - { - } - - [Conditional("CYG_DEBUG")] - public static void Assert(bool condition, string message) - { - } - - [Conditional("CYG_DEBUG")] - public static void Assert(bool condition, string format, params object[] args) - { - } - - [Conditional("CYG_DEBUG")] - public static void Break() - { - } - - [Conditional("CYG_DEBUG")] - public static void ClearDeveloperConsole() - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawLine(Vector3 start, Vector3 end) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawLine(Vector3 start, Vector3 end, Color color) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawLine(Vector3 start, Vector3 end, Color color, float duration) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawLine(Vector3 start, Vector3 end, Color color, float duration, bool depthTest) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawRay(Vector3 start, Vector3 dir) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawRay(Vector3 start, Vector3 dir, Color color) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawRay(Vector3 start, Vector3 dir, Color color, float duration) - { - } - - [Conditional("CYG_DEBUG")] - public static void DrawRay(Vector3 start, Vector3 dir, Color color, float duration, bool depthTest) - { - } - - [Conditional("CYG_DEBUG")] - public static void Log(object message, UnityEngine.Object context = null) - { - } - - [Conditional("CYG_DEBUG")] - public static void LogFormat(string format, params object[] args) - { - } - - [Conditional("CYG_DEBUG")] - public static void LogFormat(UnityEngine.Object context, string format, params object[] args) - { - } public static void LogError(object message, UnityEngine.Object context = null) { LocalLog.AccumulateTraceLog(message.ToString()); } - - public static void LogErrorFormat(string format, params object[] args) - { - LocalLog.AccumulateTraceLog(format.ToString()); - } - - public static void LogErrorFormat(UnityEngine.Object context, string format, params object[] args) - { - LocalLog.AccumulateTraceLog(context.ToString() + "Context:" + context.ToString() + "Params:" + args.ToString()); - } - - public static void LogException(Exception exception) - { - LocalLog.AccumulateTraceLog(exception.ToString()); - } - - public static void LogException(Exception exception, UnityEngine.Object context) - { - LocalLog.AccumulateTraceLog(exception.ToString() + "Context:" + context.ToString()); - } - - [Conditional("CYG_DEBUG")] - public static void LogWarning(object message, UnityEngine.Object context = null) - { - } - - [Conditional("CYG_DEBUG")] - public static void LogWarningFormat(string format, params object[] args) - { - } - - [Conditional("CYG_DEBUG")] - public static void LogWarningFormat(UnityEngine.Object context, string format, params object[] args) - { - } } diff --git a/SVSim.BattleEngine/Engine/DeckCreateMenuUI.cs b/SVSim.BattleEngine/Engine/DeckCreateMenuUI.cs index 303cbbaa..328ddb8d 100644 --- a/SVSim.BattleEngine/Engine/DeckCreateMenuUI.cs +++ b/SVSim.BattleEngine/Engine/DeckCreateMenuUI.cs @@ -11,39 +11,14 @@ public class DeckCreateMenuUI : MonoBehaviour { private enum DeckCopyCodeType { - QRCode, - DeckCode } - public const int DECK_CODE_LENGTH_MIN = 4; - - [SerializeField] - private UIButton m_btnCreateNew; - - [SerializeField] - private UIButton m_btnCopy; - - [SerializeField] - private UIButton m_btnDeckCode; - - [SerializeField] - private UIButton m_btnAutoDeck; - [SerializeField] private UIButton _btnCamera; [SerializeField] private UIButton _btnLibrary; - [SerializeField] - private DeckCopyDialog _deckCopyDialogPrefab; - - [SerializeField] - private DeckCopyDialog _useSubClassDeckCopyDialogPrefab; - - [SerializeField] - private SubClassSelectDialog _subClassSelectDialogPrefab; - [SerializeField] private ItemToggle _foilPreferred; @@ -63,10 +38,6 @@ public class DeckCreateMenuUI : MonoBehaviour private Action _onStartChangeViewScene; - private const float CENTER_SEPARATOR_LINE_OFFSET = -70f; - - private static readonly Version ENABLE_USE_CAMERA_LIBRARY_IOS_VERSION = new Version("11.0"); - public static void ShowDeckCreateMenu(DeckData deck, ConventionDeckList conventionDeckList, Action onStartChangeViewScene = null) { Format format = deck.Format; @@ -114,525 +85,8 @@ public class DeckCreateMenuUI : MonoBehaviour component._onStartChangeViewScene = onStartChangeViewScene; } - private void OnSelectFinally() - { - DeckCardEditUI.CurrentDeckName = null; - if (_parentDialog != null) - { - _parentDialog.CloseWithoutSelect(); - _parentDialog = null; - } - } - - private void Start() - { - UIEventListener.Get(m_btnCreateNew.gameObject).onClick = OnClickCreateNew; - UIEventListener.Get(m_btnCopy.gameObject).onClick = OnClickCopy; - UIEventListener.Get(m_btnDeckCode.gameObject).onClick = OnClickDeckCode; - UIEventListener.Get(m_btnAutoDeck.gameObject).onClick = OnClickAutoDeck; - UIEventListener.Get(_btnCamera.gameObject).onClick = OnClickFromCamera; - UIEventListener.Get(_btnLibrary.gameObject).onClick = OnClickFromLibrary; - } - private void SetParentDialog(DialogBase dialog) { _parentDialog = dialog; } - - private void OnClickCreateNew(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - ClassSelectionPageParam sceneParam = ClassSelectionPageParam.CreateDeckEdit(_format, (_conventionDeckList != null) ? _conventionDeckList.Conventioninfo : null, GetConventionUsedClassIdList()); - ChangeViewScene(UIManager.ViewScene.ClassSelectionPage, sceneParam); - OnSelectFinally(); - } - - private void OnClickCopy(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - Format format = _format; - if (format == Format.Crossover) - { - format = Format.All; - } - DeckInfoTask task = new DeckInfoTask(); - task.SetParameterForCopySrcGet(Format.All, format); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - DeckGroupListData deckGroupListData = task.DeckGroupListData; - if (!_formatBehavior.UseSubClass) - { - deckGroupListData.RemoveUseSubClassDeckList(); - } - if (_format != Format.MyRotation) - { - deckGroupListData.RemoveFormat(Format.MyRotation); - } - deckGroupListData.ForceVisiblePreRotation(Prerelease.Status != Prerelease.eStatus.NONE); - Format value = (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_SELECT_DECK_FORMAT); - DeckSelectUIDialog.Create(Data.SystemText.Get("Card_0109"), deckGroupListData, value, DeckSelectUIDialog.eFormatChangeUIType.UseOtherCategory, isVisibleCreateNew: false, returnDeckSelect, new DeckSelectUI.InitOptions - { - OnUpdateDeckUICustomize = OnUpdateDeckUIForConvention - }).SetPanelDepth(12); - _parentDialog.Close(); - })); - } - - private void OnUpdateDeckUIForConvention(DeckUI deckUI) - { - if (_conventionDeckList == null) - { - return; - } - if (!deckUI.Deck.IsUsable(canUseNonPossessionCard: true)) - { - deckUI.SetSelectable(isSelectable: false); - return; - } - bool flag = _conventionDeckList.GetConventionDeckClassList().Contains(deckUI.Deck.GetDeckClassID()); - if (_formatBehavior.UseSubClass && _conventionDeckList.GetConventionDeckClassList().Contains(deckUI.Deck.GetDeckSubClassID())) - { - flag = true; - } - if (flag) - { - deckUI.SetTextCenterLabe(Data.SystemText.Get("RoomBattle_0085")); - deckUI.SetSelectable(isSelectable: false); - } - } - - private void OnClickDeckCode(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DialogBase nameEditDialog = InputDialog.Create(16, 16, UIInput.KeyboardType.EmailAddress); - nameEditDialog.InputAreaObjs.labels[2].text = Data.SystemText.Get("Card_0110"); - nameEditDialog.InputAreaObjs.labels[3].text = ""; - nameEditDialog.SetTitleLabel(Data.SystemText.Get("Card_0111")); - if (UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.QuestSelectionPage)) - { - AllLabelColorChanger.ChangeAllLabel(nameEditDialog.InputAreaObjs.gameObject); - } - Action method_btn = delegate - { - string text = nameEditDialog.InputAreaObjs.labels[0].text; - GetDeckDataFromCodeTask getDeckDataFromCodeTask = new GetDeckDataFromCodeTask(); - getDeckDataFromCodeTask.SetParameter(text); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(getDeckDataFromCodeTask, OnSuccessDeckCodeInfo, OnFailedDeckCodeInfo, OnFailedDeckCodeInfo, encrypt: false)); - }; - nameEditDialog.SetButtonDelegate(method_btn); - nameEditDialog.SetPanelDepth(2000); - nameEditDialog.SetButtonDisable(isEnableOK: true); - UIInput deckCodeInput = nameEditDialog.GetComponentInChildren(); - if (deckCodeInput != null) - { - deckCodeInput.onChange.Add(new EventDelegate(delegate - { - nameEditDialog.SetButtonDisable(deckCodeInput.value.Length < 4); - })); - } - _parentDialog.Close(); - } - - private void OnClickAutoDeck(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.AUTO_DECK_CREATE)) - { - ButtonMaintenance(); - return; - } - bool canUseNonPossessionCard = _conventionDeckList == null; - DeckCardEditUI.SetCreateAutoParameter(_format, canUseNonPossessionCard); - ClassSelectionPageParam sceneParam = ClassSelectionPageParam.CreateDeckEdit(_format, (_conventionDeckList != null) ? _conventionDeckList.Conventioninfo : null, GetConventionUsedClassIdList()); - ChangeViewScene(UIManager.ViewScene.ClassSelectionPage, sceneParam); - OnSelectFinally(); - } - - private void OnClickFromCamera(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.DECK_QR_CODE)) - { - ButtonMaintenance(); - return; - } - GameObject qrCameraObject = UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/QrCamera")); - QrCamera qrCamera = qrCameraObject.GetComponent(); - UIButton backButton = qrCamera.backButton; - qrCamera.SetCallBacks(OnSuccessQRCodeDeckInfo, OnFailedQRCodeDeckInfo); - UIManager.GetInstance().createInSceneCenterLoading(); - UIManager.GetInstance().StartCoroutine(qrCamera.StartQRCamera(qrCameraObject, _formatBehavior.CardMasterId, delegate - { - _parentDialog.Close(); - UIManager.GetInstance().closeInSceneCenterLoading(); - backButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - qrCamera.StopQRCamera(); - UnityEngine.Object.Destroy(qrCameraObject); - })); - }, delegate - { - qrCamera.StopQRCamera(); - UnityEngine.Object.Destroy(qrCameraObject); - FailedToStartQRCamera(); - UIManager.GetInstance().closeInSceneCenterLoading(); - _parentDialog.Close(); - })); - } - - private void OnClickFromLibrary(GameObject g) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.DECK_QR_CODE)) - { - ButtonMaintenance(); - return; - } - GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/QrCamera")); - QrCamera component = gameObject.GetComponent(); - component.SetCallBacks(OnSuccessQRCodeDeckInfo, OnFailedQRCodeDeckInfo); - component.StartGetQRCodeFromImageFile(gameObject, _formatBehavior.CardMasterId); - UnityEngine.Object.Destroy(gameObject); - _parentDialog.Close(); - } - - private void FailedToStartQRCamera() - { - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Card_0270")); - dialogBase.SetPanelDepth(2000); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.OnClose = delegate - { - OnSelectFinally(); - }; - } - - private void ButtonMaintenance() - { - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Card_0266")); - dialogBase.SetPanelDepth(2000); - dialogBase.SetSize(DialogBase.Size.M); - } - - private DialogBase CreateDeckCopyDialog(DialogBase dialogDeckList, DeckData deck) - { - bool flag = _formatBehavior.UseSubClass && FormatBehaviorManager.GetDefaultBehaviour(deck.Format).UseSubClass; - if (_format == Format.MyRotation) - { - if (deck.Format == Format.MyRotation) - { - return DeckCopyDialog.CreateDeckCopyDialog(_deckCopyDialogPrefab, deck); - } - return DeckCopyDialog.CreateDeckCopyDialogForMyRotation(_deckCopyDialogPrefab, deck); - } - if (flag) - { - return DeckCopyDialog.CreateDeckCopyDialogUseSubClass(_useSubClassDeckCopyDialogPrefab, deck); - } - return DeckCopyDialog.CreateDeckCopyDialog(_deckCopyDialogPrefab, deck); - } - - private void returnDeckSelect(DialogBase dialogDeckList, DeckData deck) - { - DialogBase dialog = CreateDeckCopyDialog(dialogDeckList, deck); - dialog.onPushButton1 = delegate - { - if (!_formatBehavior.UseSubClass) - { - OnChangeViewSceneFromDeckCopy(dialogDeckList, deck); - } - else if (FormatBehaviorManager.GetDefaultBehaviour(deck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS)) - { - OnChangeViewSceneFromDeckCopy(dialogDeckList, deck); - } - else - { - OnSelectSubClassFromDeckCopy(dialog, dialogDeckList, deck); - } - }; - dialog.SetPanelDepth(100); - } - - private void OnSelectSubClassFromDeckCopy(DialogBase dialog, DialogBase dialogDeckList, DeckData deck) - { - dialog.Close(); - SubClassSelectDialog.Create(deck, _subClassSelectDialogPrefab, GetConventionUsedClassIdList(), delegate(int classId) - { - deck.SetDeckSubClassID(classId); - OnChangeViewSceneFromDeckCopy(dialogDeckList, deck); - }); - } - - private void OnChangeViewSceneFromDeckCopy(DialogBase dialogDeckList, DeckData deck) - { - bool isCopySubClass = FormatBehaviorManager.Create(deck.Format, _conventionDeckList).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS); - MyRotationInfo myRotationInfo = null; - if (_format == Format.MyRotation) - { - myRotationInfo = ((deck.Format != Format.MyRotation) ? deck.GetMyRotationInfoFromCardList() : Data.MyRotationAllInfo.Get(deck.MyRotationId)); - } - DeckCardEditUI.SetDeckCopyParameter(deck, isCreatedByBuilder: false, isCopySubClass, _conventionDeckList, myRotationInfo); - dialogDeckList.CloseWithoutSelect(); - ChangeViewScene(UIManager.ViewScene.DeckCardEdit, null); - OnSelectFinally(); - } - - private void OnSuccessDeckCodeInfo(NetworkTask.ResultCode errorcode) - { - OnSuccessCodeDeckInfo(DeckCopyCodeType.DeckCode); - } - - private void OnSuccessQRCodeDeckInfo() - { - OnSuccessCodeDeckInfo(DeckCopyCodeType.QRCode); - } - - private void OnSuccessCodeDeckInfo(DeckCopyCodeType copyCodeType) - { - bool flag = false; - SetCodeCopyDeckParam(copyCodeType, out var clanId, out var subClanId, out var isSubClassSet, out var cardIds, out var myRotationInfo); - if (_conventionDeckList != null) - { - List conventionDeckClassList = _conventionDeckList.GetConventionDeckClassList(); - for (int i = 0; i < conventionDeckClassList.Count; i++) - { - if (conventionDeckClassList[i] == clanId) - { - flag = true; - break; - } - } - if (_formatBehavior.UseSubClass) - { - for (int j = 0; j < conventionDeckClassList.Count; j++) - { - if (conventionDeckClassList[j] == subClanId) - { - flag = true; - break; - } - } - } - } - if (isDeckcodeIncludingNonExistentCard(cardIds)) - { - string title = Data.SystemText.Get("Card_0196"); - string text = Data.SystemText.Get("Card_0197"); - CreateErrorDialog(title, text).OnClose = delegate - { - OnSelectFinally(); - }; - } - else if (flag) - { - string title2 = Data.SystemText.Get("ErrorHeader_10002"); - string text2 = Data.SystemText.Get("Arena_0067"); - if (_formatBehavior.UseSubClass) - { - text2 = Data.SystemText.Get("Arena_0141"); - } - CreateErrorDialog(title2, text2).OnClose = delegate - { - OnSelectFinally(); - }; - } - else if (!_formatBehavior.UseSubClass && isSubClassSet) - { - string title3 = Data.SystemText.Get("Card_0196"); - string text3 = ""; - switch (copyCodeType) - { - case DeckCopyCodeType.QRCode: - text3 = Data.SystemText.Get("Card_0285"); - break; - case DeckCopyCodeType.DeckCode: - text3 = Data.SystemText.Get("Card_0295"); - break; - } - CreateErrorDialog(title3, text3).OnClose = delegate - { - OnSelectFinally(); - }; - } - else if (myRotationInfo != null && _format != Format.MyRotation) - { - string title4 = Data.SystemText.Get("Card_0196"); - string text4 = ""; - switch (copyCodeType) - { - case DeckCopyCodeType.QRCode: - text4 = Data.SystemText.Get("MyRotation_ID_17"); - break; - case DeckCopyCodeType.DeckCode: - text4 = Data.SystemText.Get("MyRotation_ID_18"); - break; - } - CreateErrorDialog(title4, text4).OnClose = delegate - { - OnSelectFinally(); - }; - } - else - { - DeckData deck = CreateDeckFromCopyCode(clanId, subClanId, isSubClassSet, cardIds, myRotationInfo); - if (_formatBehavior.UseSubClass && !isSubClassSet) - { - OnCreateDeckFromCodeSelectSubClass(deck); - } - else - { - OnCreateDeckFromCode(deck); - } - } - } - - private void SetCodeCopyDeckParam(DeckCopyCodeType deckCopyCodeTypeout, out int clanId, out int subClanId, out bool isSubClassSet, out int[] cardIds, out MyRotationInfo myRotationInfo) - { - clanId = 10; - subClanId = 10; - isSubClassSet = false; - cardIds = null; - myRotationInfo = null; - switch (deckCopyCodeTypeout) - { - case DeckCopyCodeType.QRCode: - clanId = (int)QRCodeUtility.deckDataFromQRCode.ClanId; - subClanId = (int)QRCodeUtility.deckDataFromQRCode.SubClanId; - isSubClassSet = QRCodeUtility.deckDataFromQRCode.IsSubClassSet; - cardIds = QRCodeUtility.deckDataFromQRCode.CardIds; - myRotationInfo = QRCodeUtility.deckDataFromQRCode.MyRotationInfo; - break; - case DeckCopyCodeType.DeckCode: - clanId = Data.DeckDataFromDeckCode.ClanId; - subClanId = Data.DeckDataFromDeckCode.SubClanId; - isSubClassSet = Data.DeckDataFromDeckCode.IsSubClanSet; - cardIds = Data.DeckDataFromDeckCode.CardIds; - if (Data.DeckDataFromDeckCode.MyRotationId != null) - { - myRotationInfo = Data.MyRotationAllInfo.Get(Data.DeckDataFromDeckCode.MyRotationId); - } - break; - } - } - - private DeckData CreateDeckFromCopyCode(int clanId, int subClanId, bool isSubClassSet, int[] cardIds, MyRotationInfo myRotationInfo) - { - DeckData deckData = new DeckData(_format); - deckData.SetDeckClassID(clanId); - if (isSubClassSet) - { - deckData.SetDeckSubClassID(subClanId); - } - deckData.SetDeckName(""); - deckData.SetDeckSleeveID(3000011L); - deckData.SetDeckIsComplete(isComplete: true); - deckData.SetCardIdList(cardIds.ToList()); - if (myRotationInfo != null) - { - deckData.MyRotationId = myRotationInfo.Id; - } - return deckData; - } - - private DialogBase CreateErrorDialog(string title, string text) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(2000); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(text); - dialogBase.SetSize(DialogBase.Size.M); - return dialogBase; - } - - private void OnFailedQRCodeDeckInfo(string message) - { - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(message); - dialogBase.SetPanelDepth(2000); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.OnClose = delegate - { - OnSelectFinally(); - }; - } - - private void OnCreateDeckFromCode(DeckData deck) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(2000); - dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0142")); - dialogBase.SetText(Data.SystemText.Get("Card_0115")); - if (_format == Format.MyRotation && Data.MyRotationAllInfo.Get(deck.MyRotationId) == null) - { - MyRotationInfo myRotationInfoFromCardList = deck.GetMyRotationInfoFromCardList(); - deck.MyRotationId = myRotationInfoFromCardList.Id; - } - dialogBase.OnCloseStart = delegate - { - DeckCardEditUI.SetDeckCopyParameter(deck, isCreatedByBuilder: true, isCopySubClass: true, _conventionDeckList); - ChangeViewScene(UIManager.ViewScene.DeckCardEdit, null); - OnSelectFinally(); - }; - } - - private void OnCreateDeckFromCodeSelectSubClass(DeckData deck) - { - SubClassSelectDialog.Create(deck, _subClassSelectDialogPrefab, GetConventionUsedClassIdList(), delegate(int classId) - { - deck.SetDeckSubClassID(classId); - DeckCardEditUI.SetDeckCopyParameter(deck, isCreatedByBuilder: true, isCopySubClass: false, _conventionDeckList); - ChangeViewScene(UIManager.ViewScene.DeckCardEdit, null); - OnSelectFinally(); - }); - } - - private bool isDeckcodeIncludingNonExistentCard(int[] targetDeckCardIds) - { - List allCardIds = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetAllCardIds(); - int num = targetDeckCardIds.Length; - for (int i = 0; i < num; i++) - { - int item = targetDeckCardIds[i]; - if (!allCardIds.Contains(item)) - { - return true; - } - } - return false; - } - - private void OnFailedDeckCodeInfo(NetworkTask.ResultCode errorcode) - { - OnSelectFinally(); - } - - private void OnFailedDeckCodeInfo(int errorcode) - { - OnSelectFinally(); - } - - private List GetConventionUsedClassIdList() - { - List result = new List(); - if (_conventionDeckList == null) - { - return result; - } - return _conventionDeckList.GetConventionDeckClassList(); - } - - private void ChangeViewScene(UIManager.ViewScene viewScene, object sceneParam) - { - _onStartChangeViewScene.Call(); - if (UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.Battle)) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(viewScene, null, null, sceneParam); - } - else - { - UIManager.GetInstance().ChangeViewScene(viewScene, null, sceneParam); - } - } } diff --git a/SVSim.BattleEngine/Engine/DeckData.cs b/SVSim.BattleEngine/Engine/DeckData.cs index f3015bbc..51134235 100644 --- a/SVSim.BattleEngine/Engine/DeckData.cs +++ b/SVSim.BattleEngine/Engine/DeckData.cs @@ -20,16 +20,6 @@ public class DeckData Unknown } - public const int DEFAULT_DECK_ID_OFFSET = 90; - - private const string LEADER_SKIN_ID_KEY = "leader_skin_id"; - - public const string CARD_ID_ARRAY_KEY = "card_id_array"; - - public const int DEFAULT_SLEEVE_ID = 3000011; - - public const int UNSET_SKIN_ID = 0; - private int _deckId; private string _deckName; @@ -85,18 +75,6 @@ public class DeckData } } - public bool IsOutOfRotationFormat - { - get - { - if (Format == Format.Rotation || Format == Format.PreRotation) - { - return DeckCopyFormat == Format.Unlimited; - } - return false; - } - } - public DeckData(Format format = Format.Max, DeckAttributeType deckAttributeType = DeckAttributeType.Invalid) { _skinId = 0; @@ -241,41 +219,6 @@ public class DeckData return IsUsable(out reason, canUseNonPossessionCard); } - public bool IsDisplayable() - { - if (!IsUsable()) - { - return false; - } - Dictionary cardNumDict = GetCardNumDict(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - foreach (KeyValuePair item in cardNumDict) - { - int possessionCardNum = dataMgr.GetPossessionCardNum(item.Key, isIncludingSpotCard: true); - if (possessionCardNum == 0) - { - return false; - } - if (item.Value > possessionCardNum) - { - return false; - } - } - return true; - } - - public bool HasResurgentCard() - { - foreach (int cardId in _cardIdList) - { - if (CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format).CardMasterId).GetCardParameterFromId(cardId).IsResurgentCard) - { - return true; - } - } - return false; - } - public int GetDeckClassID() { return _deckClassId; @@ -312,28 +255,6 @@ public class DeckData _cardIdList = list; } - public Dictionary GetCardNumDict() - { - Dictionary dictionary = new Dictionary(); - if (IsNoCard()) - { - return dictionary; - } - for (int i = 0; i < _cardIdList.Count; i++) - { - int key = _cardIdList[i]; - if (dictionary.ContainsKey(key)) - { - dictionary[key]++; - } - else - { - dictionary.Add(key, 1); - } - } - return dictionary; - } - public bool IsNoCard() { return _cardIdList == null; @@ -356,16 +277,9 @@ public class DeckData public int GetSkinId(bool isDefaultSkin = false) { - if (isDefaultSkin) - { - return GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(GetDeckClassID(), isCurrentChara: false) - .skin_id; - } - if (_skinId == 0) - { - return GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(GetDeckClassID()) - .skin_id; - } + // Pre-Phase-5b: fell back to the class's default chara prm skin_id when _skinId was + // zero (or when the default was explicitly requested). Callers are all UI (deck-list + // display, avatar-dialog, avatar-battle info) so returning 0 headless is safe. return _skinId; } @@ -378,15 +292,6 @@ public class DeckData return defaultValue; } - private string GetJsonString(JsonData deckData, string key, string defaultValue) - { - if (deckData.Keys.Contains(key)) - { - return deckData[key].ToString(); - } - return defaultValue; - } - private bool GetJsonBool(JsonData deckData, string key, bool defaultValue) { if (deckData.Keys.Contains(key)) @@ -491,7 +396,9 @@ public class DeckData IsMaintenanceDeck = false; if (_cardIdList != null) { - IsMaintenanceDeck = _cardIdList.Any((int c) => GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(c)); + // Pre-Phase-5b: probed DataMgr.IsMaintenanceCard for each id; headless has no + // maintenance card list so no card is ever considered under maintenance. + IsMaintenanceDeck = false; } } @@ -501,19 +408,11 @@ public class DeckData return CreateMyRotationClassName(_deckClassId, info); } - public static string GetClassName(int classType, string rotationId) - { - MyRotationInfo myRotationInfo = Data.MyRotationAllInfo.Get(rotationId); - if (myRotationInfo != null) - { - return CreateMyRotationClassName(classType, myRotationInfo); - } - return GameMgr.GetIns().GetDataMgr().GetClanNameByKey(classType); - } - public static string CreateMyRotationClassName(int classType, MyRotationInfo info) { - return Data.SystemText.Get("MyRotation_ID_02", GameMgr.GetIns().GetDataMgr().GetClanNameByKey(classType), info.LastPackText); + // Pre-Phase-5b: threaded DataMgr.GetClanNameByKey for the class-name substitution. + // Headless has no class-name map; substitute the class type as a raw string. + return Data.SystemText.Get("MyRotation_ID_02", classType.ToString(), info.LastPackText); } public bool IsVisibleRandomIcon() @@ -526,52 +425,8 @@ public class DeckData { return true; } - if (GameMgr.GetIns().GetDataMgr().GetClassPrm(GetDeckClassID()) - .IsRandomLeaderSkin) - { - return _skinId == 0; - } + // Pre-Phase-5b: probed DataMgr.GetClassPrm(...).IsRandomLeaderSkin. Headless has no + // class prm map so no class is treated as random-skin-eligible. return false; } - - public MyRotationInfo GetMyRotationInfoFromCardList() - { - int num = int.MinValue; - MyRotationInfo result = null; - CardMaster instance = CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format.MyRotation).CardMasterId); - foreach (int cardId in GetCardIdList()) - { - CardParameter cardParameterFromId = instance.GetCardParameterFromId(cardId); - MyRotationInfo myRotationInfoFromPack = GetMyRotationInfoFromPack(cardParameterFromId.CardSetId); - if (myRotationInfoFromPack != null && int.Parse(myRotationInfoFromPack.Id) >= num) - { - result = myRotationInfoFromPack; - num = int.Parse(myRotationInfoFromPack.Id); - } - } - return result; - } - - public MyRotationInfo GetMyRotationInfoFromPack(string packId) - { - int num = int.MinValue; - MyRotationInfo myRotationInfo = null; - foreach (MyRotationInfo myRotationInfo2 in Data.MyRotationAllInfo.MyRotationInfoList) - { - if (!(packId != myRotationInfo2.LastPackId) && int.Parse(myRotationInfo2.Id) >= num) - { - num = int.Parse(myRotationInfo2.Id); - myRotationInfo = myRotationInfo2; - } - } - if (myRotationInfo == null) - { - if (GetDeckClassID() != 8) - { - return Data.MyRotationAllInfo.FirstPackInfo; - } - return Data.MyRotationAllInfo.FirstPackInfoNemesis; - } - return myRotationInfo; - } } diff --git a/SVSim.BattleEngine/Engine/DeckDecisionColosseum.cs b/SVSim.BattleEngine/Engine/DeckDecisionColosseum.cs deleted file mode 100644 index 75136d5c..00000000 --- a/SVSim.BattleEngine/Engine/DeckDecisionColosseum.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -using Wizard; - -public class DeckDecisionColosseum : MonoBehaviour -{ - [SerializeField] - private UILabel _descTextLabel; - - [SerializeField] - private UILabel _deckNameTextLabel; - - [SerializeField] - private UILabel _descText2Label; - - public void Init(DeckData inDeck) - { - _descTextLabel.text = Data.SystemText.Get("Card_0006"); - _deckNameTextLabel.text = Data.SystemText.Get("Card_0299", inDeck.GetDeckName()); - _descText2Label.text = Data.SystemText.Get("Colosseum_0081"); - } -} diff --git a/SVSim.BattleEngine/Engine/DeckDecisionCompetition.cs b/SVSim.BattleEngine/Engine/DeckDecisionCompetition.cs deleted file mode 100644 index 99a63d3e..00000000 --- a/SVSim.BattleEngine/Engine/DeckDecisionCompetition.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine; -using Wizard; -using Wizard.Dialog.Setting; - -public class DeckDecisionCompetition : MonoBehaviour -{ - [SerializeField] - private UILabel _descTextLabel; - - [SerializeField] - private UILabel _deckNameTextLabel; - - [SerializeField] - private UILabel _descText2Label; - - [SerializeField] - private ItemToggle _toggle; - - public void Init(DeckData inDeck) - { - _descTextLabel.text = Data.SystemText.Get("Card_0006"); - _deckNameTextLabel.text = Data.SystemText.Get("Card_0299", inDeck.GetDeckName()); - _descText2Label.text = Data.SystemText.Get("Colosseum_0081"); - SettingToggle(); - } - - protected ItemToggle SettingToggle() - { - SystemText systemText = Data.SystemText; - ItemToggle item = _toggle; - item.SetTitleLabel(systemText.Get("Colosseum_0085")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.COMPETITION_PUBLISHED_SETTING)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.COMPETITION_PUBLISHED_SETTING, value); - }); - item.SetActive_SeparatorLine(isActive: true); - return item; - } -} diff --git a/SVSim.BattleEngine/Engine/DeckDecisionUI.cs b/SVSim.BattleEngine/Engine/DeckDecisionUI.cs index 9782d426..d762fd9c 100644 --- a/SVSim.BattleEngine/Engine/DeckDecisionUI.cs +++ b/SVSim.BattleEngine/Engine/DeckDecisionUI.cs @@ -9,17 +9,6 @@ using Wizard.RoomMatch; public class DeckDecisionUI : MonoBehaviour { - [SerializeField] - private UILabel _textForOneLine; - - [SerializeField] - private UILabel _descTextLabel; - - [SerializeField] - private UILabel _deckNameTextLabel; - - [SerializeField] - private ItemToggle m_simpleStageToggle; [SerializeField] private GameObject _uiCardListPrefab; @@ -27,17 +16,10 @@ public class DeckDecisionUI : MonoBehaviour [SerializeField] private GameObject _cardDetailPrefab; - [SerializeField] - private UILabel _optionLabel; - protected List _loadCardAssetList; - private bool _textSetEnd; - protected static int DetailLayer; - protected const float CARD_DETAIL_Z = -300f; - private ConventionDeckList conventionDeckList; public bool IsCanShowQRCode = true; @@ -48,8 +30,6 @@ public class DeckDecisionUI : MonoBehaviour public string DeckName { get; set; } - public UILabel OptionLabel => _optionLabel; - public Action CardListCustomize { get; set; } protected CardDetailUI CardDetail { get; set; } @@ -67,74 +47,6 @@ public class DeckDecisionUI : MonoBehaviour _formatBehavior = FormatBehaviorManager.Create(deck.Format, deckList); } - public virtual void Start() - { - DetailLayer = LayerMask.NameToLayer("MyPage"); - UIWidget component = GetComponent(); - if (!_textSetEnd) - { - _descTextLabel.text = Data.SystemText.Get("Card_0006"); - _deckNameTextLabel.text = Data.SystemText.Get("Card_0299", DeckName); - SetTextLabelesState(string.IsNullOrEmpty(_descTextLabel.text), string.IsNullOrEmpty(_deckNameTextLabel.text)); - } - if (IsShowSimpleStageOption) - { - SettingToggle_SimpleStage(); - component.pivot = UIWidget.Pivot.Center; - } - else - { - m_simpleStageToggle.gameObject.SetActive(value: false); - component.pivot = UIWidget.Pivot.Bottom; - } - } - - public void SetText(string descText, string cardDeckText) - { - _textForOneLine.text = descText; - _descTextLabel.text = descText; - _deckNameTextLabel.text = cardDeckText; - SetTextLabelesState(string.IsNullOrEmpty(descText), string.IsNullOrEmpty(cardDeckText)); - _textSetEnd = true; - } - - protected void OnDestroy() - { - if (_loadCardAssetList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadCardAssetList); - _loadCardAssetList = null; - } - if (UiCardList != null) - { - UnityEngine.Object.Destroy(UiCardList.gameObject); - UiCardList = null; - } - if (CardDetail != null) - { - UnityEngine.Object.Destroy(CardDetail.gameObject); - CardDetail = null; - } - } - - protected ItemToggle SettingToggle_SimpleStage(bool isSperatorUse = true) - { - SystemText systemText = Data.SystemText; - ItemToggle item = m_simpleStageToggle; - item.SetTitleLabel(systemText.Get("OtherConfig_0022")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SIMPLE_STAGE)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SIMPLE_STAGE, value); - }); - if (isSperatorUse) - { - item.SetActive_SeparatorLine(isActive: true); - } - return item; - } - public void OnClickCreateCardList() { CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); @@ -223,23 +135,4 @@ public class DeckDecisionUI : MonoBehaviour { UIManager.GetInstance().ActiveChangeDialogAll(inDisp); } - - private void SetTextLabelesState(bool noDescText, bool noDeckNameText) - { - if (noDescText && noDeckNameText) - { - _textForOneLine.gameObject.SetActive(value: false); - _descTextLabel.gameObject.SetActive(value: false); - _deckNameTextLabel.gameObject.SetActive(value: false); - } - else if (noDeckNameText) - { - _descTextLabel.gameObject.SetActive(value: false); - _deckNameTextLabel.gameObject.SetActive(value: false); - } - else - { - _textForOneLine.gameObject.SetActive(value: false); - } - } } diff --git a/SVSim.BattleEngine/Engine/DeckIntroduction.cs b/SVSim.BattleEngine/Engine/DeckIntroduction.cs index 865831a3..05e3e909 100644 --- a/SVSim.BattleEngine/Engine/DeckIntroduction.cs +++ b/SVSim.BattleEngine/Engine/DeckIntroduction.cs @@ -10,11 +10,6 @@ using Wizard.UI.Profile; public class DeckIntroduction : MonoBehaviour { - private const int MAX_WIDTH_ANNOTATION_LABEL = 210; - - private const Format DEFAULT_FORMAT = Format.Rotation; - - private static readonly Vector2 FORMAT_CHANGE_UI_POSITION = new Vector2(-466f, 246f); private static readonly Dictionary FORMAT_TO_FORMAT_CATEGORY = new Dictionary { @@ -35,78 +30,21 @@ public class DeckIntroduction : MonoBehaviour [SerializeField] private TabList _tabList; - [SerializeField] - private UISprite _classIcon; - - [SerializeField] - private UITexture _classCharaTexture; - - [SerializeField] - private UILabel _className; - - [SerializeField] - private UITexture _classBG; - private Format _formatState; - [SerializeField] - private UILabel _labelAnnotation; - - private UIAtlas _classIconAtlas; - - private List _resourceList = new List(); - - private List _loadTopCardAssetList = new List(); - - private List _loadCardAssetList; - - private List _deckIntroductionItem = new List(); - [SerializeField] private GameObject _dialogAttachRoot; - [SerializeField] - private GameObject _deckViewPrefab; - - [SerializeField] - private GameObject _cardDetailPrefab; - - [SerializeField] - private GameObject _introductionItemPrefab; - - [SerializeField] - private UIGrid _deckListGrid; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private GameObject _confirmLabelForRotation; - private DialogBase _dialog; private DeckIntroductionTask _introductionTask; - private GameObject _deckViewObj; - - private UICardList _cardList; - - private GameObject _cardDetailObj; - - private CardDetailUI _cardDetail; - - private CardBasePrm.ClanType _classType = CardBasePrm.ClanType.NONE; - private bool _isUpdateDeckList = true; private FormatChangeUI _formatChangeUI; - private Vector3 _anotationLabelDefaultPosition; - private int _seriesId; - public const int LATEST_SERIES_ID = -1; - public static void Create(GameObject prefab, GameObject parent, int seriesId = -1, Format format = Format.Max) { GameObject obj = NGUITools.AddChild(parent, prefab); @@ -115,7 +53,7 @@ public class DeckIntroduction : MonoBehaviour component._formatState = format; DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.AddButton(DialogBase.ButtonType.Gray, isReflect: false, Data.SystemText.Get("OtherTop_0065")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE; + dialogBase.ClickSe_Btn1 = 0; dialogBase.isNotCloseWindowButton1 = true; dialogBase.onPushButton1 = component.CreateSelectSeriesIdDialog; dialogBase.AddButton(DialogBase.ButtonType.Close); @@ -136,27 +74,6 @@ public class DeckIntroduction : MonoBehaviour _seriesId = seriesId; } - private IEnumerator Start() - { - _anotationLabelDefaultPosition = _labelAnnotation.transform.localPosition; - yield return LoadAtlas(); - yield return StartCoroutine(StartDeckIntroductionTask()); - SetSeriesId(_introductionTask.DisplaySeriesId); - yield return LoadResource(); - _dialog.gameObject.SetActive(value: true); - if (_formatState == Format.Max) - { - _formatState = _introductionTask.DisplayFormat; - } - InitFormatBtn(_formatState); - InitClassTab(_introductionTask); - } - - private void OnDestroy() - { - ReleaseResource(); - } - private IEnumerator StartDeckIntroductionTask() { _introductionTask = new DeckIntroductionTask(); @@ -175,282 +92,6 @@ public class DeckIntroduction : MonoBehaviour } } - private void ReleaseResource() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_resourceList); - _resourceList.Clear(); - RemoveTopCardResource(); - } - - private IEnumerator LoadAtlas() - { - string sceneAssetPath = UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.Profile, null); - _resourceList.Add(sceneAssetPath); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(sceneAssetPath, null)); - sceneAssetPath = UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.Profile, null, isload: true); - _classIconAtlas = Toolbox.ResourcesManager.LoadObject(sceneAssetPath).GetComponent(); - } - - private static string GetClassBGPath(CardBasePrm.ClanType classType, bool isFetch) - { - int num = (int)classType; - return Toolbox.ResourcesManager.GetAssetTypePath("bg_deck_info_" + num.ToString("00"), ResourcesManager.AssetLoadPathType.Background, isFetch); - } - - private string GetClassCharaPath(CardBasePrm.ClanType classType, bool isFetch) - { - string charaTexName = ClassPage.GetCharaTexName(GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId((int)classType, isCurrentChara: false) - .skin_id); - return Toolbox.ResourcesManager.GetAssetTypePath(charaTexName, ResourcesManager.AssetLoadPathType.ClassCharaProfile, isFetch); - } - - private IEnumerator LoadResource() - { - List loadList = new List(); - int num = 9; - for (int i = 1; i < num; i++) - { - loadList.Add(GetClassCharaPath((CardBasePrm.ClanType)i, isFetch: false)); - loadList.Add(GetClassBGPath((CardBasePrm.ClanType)i, isFetch: false)); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _resourceList.AddRange(loadList); - } - - private IEnumerator LoadTopCardResource(CardBasePrm.ClanType classType, Action onFinish) - { - UIManager.GetInstance().createInSceneCenterLoading(); - List tempLoadList = new List(_loadTopCardAssetList); - _loadTopCardAssetList.Clear(); - for (int i = 0; i < _introductionTask._result.Count; i++) - { - DeckIntroductionTask.IntroductionData introductionData = _introductionTask._result[i]; - string cardMaterialPath = DeckIntroductionItem.GetCardMaterialPath(introductionData.TopCardId); - if (introductionData.Deck.Format == _formatState && introductionData.Deck.GetDeckClassID() == (int)classType && !_loadTopCardAssetList.Contains(cardMaterialPath)) - { - _loadTopCardAssetList.Add(cardMaterialPath); - } - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadTopCardAssetList, null)); - Toolbox.ResourcesManager.RemoveAssetGroup(tempLoadList); - onFinish.Call(classType); - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - private void RemoveTopCardResource() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadTopCardAssetList); - _loadTopCardAssetList.Clear(); - } - - private void InitClassTab(DeckIntroductionTask task) - { - _classIcon.atlas = _classIconAtlas; - int num = 9; - CardBasePrm.ClanType clanType = CardBasePrm.ClanType.NONE; - for (int i = 1; i < num; i++) - { - CardBasePrm.ClanType classType = (CardBasePrm.ClanType)i; - Tab tab = _tabList.AddTab(delegate - { - ChangePage(classType); - }, "class_tab_" + i.ToString("00")); - if (task.IsExistClass(classType, _formatState)) - { - if (clanType == CardBasePrm.ClanType.NONE) - { - clanType = classType; - } - } - else - { - _tabList.SetTabToGrayByIndex(i - 1, disable: true); - } - tab.name = "Class_" + i + "(Clone)"; - } - _tabList.Reset(); - _tabList.SelectTabByIndex((int)(clanType - 1), isForceSet: true); - } - - private bool NeedResurgentConfirmLabel() - { - if ((_seriesId == 34 || _seriesId == 33 || _seriesId == 9) && _formatState == Format.Rotation) - { - return true; - } - return false; - } - - private void ChangePage(CardBasePrm.ClanType classType) - { - if (_classType == classType && !_isUpdateDeckList) - { - return; - } - _classType = classType; - _isUpdateDeckList = false; - ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId((int)classType, isCurrentChara: false); - _className.text = charaPrmByClassId._className; - ClassCharaPrm.SetClassLabelSetting(_className, classType); - _classCharaTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(GetClassCharaPath(classType, isFetch: true)) as Texture; - _classBG.mainTexture = Toolbox.ResourcesManager.LoadObject(GetClassBGPath(classType, isFetch: true)) as Texture; - _confirmLabelForRotation.SetActive(NeedResurgentConfirmLabel()); - _labelAnnotation.transform.localPosition = _anotationLabelDefaultPosition; - string value; - if (IsNotCopyToUnlimited(classType) && _formatState == Format.Rotation) - { - _labelAnnotation.gameObject.SetActive(value: false); - } - else if (_introductionTask.AlternativeFormatAndSeries != null && _introductionTask.AlternativeFormatAndSeries.TryGetValue(_formatState, out value)) - { - _labelAnnotation.gameObject.SetActive(value: true); - SetAnnotationText(value); - if (NeedResurgentConfirmLabel()) - { - _labelAnnotation.transform.localPosition = new Vector3(_anotationLabelDefaultPosition.x, 209f, _anotationLabelDefaultPosition.z); - } - } - else - { - _labelAnnotation.gameObject.SetActive(value: false); - } - StartCoroutine(LoadTopCardResource(classType, InitDeckList)); - } - - private bool IsNotCopyToUnlimited(CardBasePrm.ClanType classType) - { - for (int i = 0; i < _introductionTask._result.Count; i++) - { - DeckData deck = _introductionTask._result[i].Deck; - if (deck.HasResurgentCard() && deck.IsOutOfRotationFormat && deck.GetDeckClassID() == (int)classType) - { - return true; - } - } - return false; - } - - private void InitDeckList(CardBasePrm.ClanType classType) - { - for (int i = 0; i < _deckIntroductionItem.Count; i++) - { - _deckIntroductionItem[i].gameObject.SetActive(value: false); - } - List list = new List(); - for (int j = 0; j < _introductionTask._result.Count; j++) - { - DeckIntroductionTask.IntroductionData introductionData = _introductionTask._result[j]; - if (introductionData.Deck.GetDeckClassID() == (int)classType && introductionData.Deck.Format == _formatState) - { - list.Add(introductionData); - } - } - for (int k = 0; k < list.Count; k++) - { - DeckIntroductionItem deckIntroductionItem = null; - if (k < _deckIntroductionItem.Count) - { - deckIntroductionItem = _deckIntroductionItem[k]; - deckIntroductionItem.gameObject.SetActive(value: true); - } - else - { - deckIntroductionItem = NGUITools.AddChild(_deckListGrid.gameObject, _introductionItemPrefab).GetComponent(); - _deckIntroductionItem.Add(deckIntroductionItem); - } - deckIntroductionItem.Initialize(list[k]); - deckIntroductionItem.OnClick = delegate(DeckIntroductionTask.IntroductionData data) - { - OnClickDeck(data); - }; - } - _deckListGrid.Reposition(); - _scrollView.ResetPosition(); - } - - private void InitFormatBtn(Format format) - { - _formatState = format; - FormatChangeUI.FormatCategory defaultFormatCategory = FORMAT_TO_FORMAT_CATEGORY[_formatState]; - FormatChangeUI.FormatCategory anotherFormatCategory = (_introductionTask.IsExistFormat(Format.Crossover) ? FORMAT_TO_FORMAT_CATEGORY[Format.Crossover] : FormatChangeUI.FormatCategory.Invalid); - _formatChangeUI = FormatChangeUI.Create(defaultFormatCategory, anotherFormatCategory, OnClickFormatBtn); - _formatChangeUI.ShowOldRotationIcon(); - _dialog.SetObj(_formatChangeUI.gameObject, FORMAT_CHANGE_UI_POSITION); - } - - private void SetAnnotationText(string serieasName) - { - _labelAnnotation.overflowMethod = UILabel.Overflow.ResizeFreely; - _labelAnnotation.text = Data.SystemText.Get("OtherTop_0068", serieasName); - _labelAnnotation.ProcessText(); - if (_labelAnnotation.width > 210) - { - _labelAnnotation.overflowMethod = UILabel.Overflow.ShrinkContent; - _labelAnnotation.width = 210; - } - } - - private void OnClickDeck(DeckIntroductionTask.IntroductionData data) - { - ShowDeckView(data.Deck); - } - - private void ShowDeckView(DeckData deck) - { - string text = "Detail"; - if (_cardDetailObj == null) - { - _cardDetailObj = NGUITools.AddChild(base.gameObject, _cardDetailPrefab); - _cardDetail = _cardDetailObj.GetComponent(); - _cardDetail.Initialize(LayerMask.NameToLayer(text), CardMaster.CardMasterId.Default); - _cardDetailObj.SetActive(value: false); - } - if (_deckViewObj == null) - { - _deckViewObj = UnityEngine.Object.Instantiate(_deckViewPrefab); - _cardList = _deckViewObj.GetComponent(); - _cardList.Init(base.gameObject, _cardDetail, null, OnCloseDeckView, text, in_DetailCameraUse: true, null, 40); - _deckViewObj.SetActive(value: false); - } - _scrollView.DisableSpring(); - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(CardLoadCoroutine(deck)); - } - - private IEnumerator CardLoadCoroutine(DeckData deck) - { - IList cardIdList = deck.GetCardIdList(); - _cardList.RemoveData(); - _loadCardAssetList = _cardList.GetLoadFileList(cardIdList as List); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadCardAssetList, null)); - _cardList.IsEnableMyRotationDisplay = false; - _cardList.IsConventionDeckIntroduction = true; - _cardList.SetDeck(deck, null); - if (deck.Format == Format.Rotation) - { - _cardList.SetFormatIcon("icon_rotation_s"); - } - _cardList.UpdateShortageRedEther(); - _cardList.SetShortageCardVisible(_cardList.IsEnableShortageCardVisible); - _cardList.SetActiveDeckIntroductionObj(isActive: true); - yield return null; - _dialog.SetDisp(inDisp: false); - _deckViewObj.SetActive(value: true); - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - private void OnCloseDeckView() - { - _dialog.SetDisp(inDisp: true); - _deckViewObj.SetActive(value: false); - _scrollView.UpdatePosition(); - if (_loadCardAssetList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadCardAssetList); - _loadCardAssetList.Clear(); - } - } - private void CreateSelectSeriesIdDialog() { int prevSeriesId = _seriesId; @@ -471,7 +112,7 @@ public class DeckIntroduction : MonoBehaviour } dialogBase.SetTitleLabel(Data.SystemText.Get("OtherTop_0066")); dialogBase.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE; + dialogBase.ClickSe_Btn1 = 0; dialogBase.onPushButton1 = delegate { if (_seriesId != prevSeriesId) @@ -516,17 +157,6 @@ public class DeckIntroduction : MonoBehaviour _tabList.SelectTabByIndex((int)(clanType - 1), isForceSet: true); } - private void OnClickFormatBtn(FormatChangeUI.FormatCategory formatCategory) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - Format key = FORMAT_TO_FORMAT_CATEGORY.First((KeyValuePair data) => data.Value == formatCategory).Key; - if (_formatState != key) - { - _formatState = key; - UpdateClassTab(); - } - } - private void UpdateFormatChangeUI() { bool flag = _introductionTask.IsExistFormat(Format.Rotation); diff --git a/SVSim.BattleEngine/Engine/DeckIntroductionCopyDialog.cs b/SVSim.BattleEngine/Engine/DeckIntroductionCopyDialog.cs deleted file mode 100644 index ce78b9bf..00000000 --- a/SVSim.BattleEngine/Engine/DeckIntroductionCopyDialog.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Wizard; -using Wizard.DeckCardEdit; -using Wizard.Dialog.Setting; - -public class DeckIntroductionCopyDialog : MonoBehaviour -{ - private const float GRID_Y_WITH_MY_ROTATION = -15f; - - private const float HINT_Y_WITH_MY_ROTATION = 53f; - - [SerializeField] - private UILabel _labelCopyConfirm; - - [SerializeField] - private UILabel _labelHint; - - [SerializeField] - private ItemToggle _copyToMyRotation; - - [SerializeField] - private ItemToggle _premium; - - [SerializeField] - private ItemToggle _prize; - - [SerializeField] - private UIGrid _grid; - - public bool IsMyRotationDeck; - - public bool IsResurgentToMyRotationDeck; - - private bool _isRotationPeriod; - - public bool IsCopyToMyRotation - { - get - { - if (!IsMyRotationDeck) - { - if (DisplayCopyToMyRotation) - { - return _copyToMyRotation.GetValue(); - } - return false; - } - return true; - } - } - - public string LabelCopyConfirm - { - set - { - _labelCopyConfirm.text = value; - } - } - - public string LabelHint - { - set - { - _labelHint.text = value; - } - } - - private bool DisplayCopyToMyRotation - { - get - { - if (Data.MyRotationAllInfo.IsWithinCopyDeckIntroductionPeriod && !IsMyRotationDeck) - { - return !IsDisableMyRotation; - } - return false; - } - } - - public bool IsDisableMyRotation { get; set; } - - private KeyValuePair MyRotationSaveDataKey - { - get - { - if (!_isRotationPeriod) - { - return PlayerPrefsWrapper.DECK_INTRO_IS_MYROTATION_COPY_NOT_EQUAL_PERIOD; - } - return PlayerPrefsWrapper.DECK_INTRO_IS_MYROTATION_COPY_EQUAL_PERIOD; - } - } - - public void Initialize(bool isRotationPeriod) - { - _isRotationPeriod = isRotationPeriod; - } - - private void Start() - { - if (IsResurgentToMyRotationDeck) - { - _copyToMyRotation.gameObject.SetActive(value: false); - _copyToMyRotation.SetValue(value: false); - _copyToMyRotation.SetActive_SeparatorLine(isActive: false); - } - else - { - _copyToMyRotation.gameObject.SetActive(DisplayCopyToMyRotation); - _copyToMyRotation.SetValue(DisplayCopyToMyRotation); - _copyToMyRotation.SetActive_SeparatorLine(isActive: true); - _copyToMyRotation.SetValue(PlayerPrefsWrapper.GetBool(MyRotationSaveDataKey)); - _copyToMyRotation.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetValue(MyRotationSaveDataKey, _copyToMyRotation.GetValue() ? 1 : 0); - }); - if (DisplayCopyToMyRotation) - { - ChangeY(_grid.transform, -15f); - ChangeY(_labelHint.transform, 53f); - } - } - ItemToggle itemPremium = _premium; - itemPremium.SetValue(Data.Load.data._userConfig.IsFoilPreferred); - itemPremium.AddChangeCallback(delegate - { - DeckCardEditUI.SendConfigUpdateFoilPreferred(itemPremium.GetValue()); - }); - itemPremium.SetActive_SeparatorLine(isActive: true); - ItemToggle itemPrize = _prize; - itemPrize.SetValue(Data.Load.data._userConfig.IsPrizePreferred); - itemPrize.AddChangeCallback(delegate - { - DeckCardEditUI.SendConfigUpdatePrizePreferred(itemPrize.GetValue()); - }); - itemPrize.SetActive_SeparatorLine(isActive: true); - _grid.Reposition(); - } - - private static void ChangeY(Transform trans, float y) - { - Vector3 localPosition = trans.localPosition; - localPosition.y = y; - trans.localPosition = localPosition; - } -} diff --git a/SVSim.BattleEngine/Engine/DeckIntroductionItem.cs b/SVSim.BattleEngine/Engine/DeckIntroductionItem.cs deleted file mode 100644 index 882c3bc1..00000000 --- a/SVSim.BattleEngine/Engine/DeckIntroductionItem.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; -using Wizard; - -public class DeckIntroductionItem : MonoBehaviour -{ - private const int WIDTH_DECK_NAME_LABEL_NORMAL = 284; - - private const int WIDTH_DECK_NAME_LABEL_USE_SUBCLASS = 242; - - [SerializeField] - private CostCurveUI _costCurve; - - [SerializeField] - private UILabel _deckName; - - [SerializeField] - private UISprite _formatIcon; - - [SerializeField] - private ClassInfoParts _classInfoParts; - - [SerializeField] - private UILabel _playerName; - - [SerializeField] - private UILabel _deckDetail; - - [SerializeField] - private UILabel _followerCount; - - [SerializeField] - private UILabel _amuletCount; - - [SerializeField] - private UILabel _spellCount; - - [SerializeField] - private UITexture _cardTexture; - - [SerializeField] - private UIButton _button; - - [SerializeField] - private TweenScale _buttonAnimationTween; - - private DeckIntroductionTask.IntroductionData _data; - - public Action OnClick { get; set; } - - public void Initialize(DeckIntroductionTask.IntroductionData data) - { - IFormatBehavior defaultBehaviour = FormatBehaviorManager.GetDefaultBehaviour(data.Deck.Format); - _data = data; - _playerName.text = data.PlayerName; - _deckDetail.text = data.Detail; - _formatIcon.spriteName = defaultBehaviour.SmallIconSpriteName; - if (data.Deck.Format == Format.Rotation) - { - _formatIcon.spriteName = "icon_rotation_s"; - } - _deckName.text = data.Deck.GetDeckName(); - _deckName.width = (defaultBehaviour.UseSubClass ? 242 : 284); - _classInfoParts.gameObject.SetActive(defaultBehaviour.UseSubClass); - if (defaultBehaviour.UseSubClass) - { - _classInfoParts.InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(data.Deck.GetDeckClassID())); - _classInfoParts.SetSubClass((CardBasePrm.ClanType)data.Deck.GetDeckSubClassID()); - } - int followerCount = 0; - int spellCount = 0; - int amuletCount = 0; - GetCardCountEachType(data.Deck, out followerCount, out spellCount, out amuletCount); - _followerCount.text = followerCount.ToString(); - _spellCount.text = spellCount.ToString(); - _amuletCount.text = amuletCount.ToString(); - _costCurve.Initialize(defaultBehaviour.CardMasterId); - _costCurve.Refresh(data.Deck.GetCardIdList().ToArray()); - _button.onClick.Clear(); - _button.onClick.Add(new EventDelegate(delegate - { - OnClickButton(); - })); - string battleLogTexturePath = GetBattleLogTexturePath(data.TopCardId); - _cardTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(battleLogTexturePath); - } - - private void Start() - { - UIEventListener uIEventListener = UIEventListener.Get(_button.gameObject); - uIEventListener.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(uIEventListener.onPress, (UIEventListener.BoolDelegate)delegate - { - StartCoroutine(ButtonAnimation()); - }); - } - - private IEnumerator ButtonAnimation() - { - BoxCollider btn = _button.GetComponent(); - Vector3 to = _buttonAnimationTween.to; - Vector3 defaultSize = btn.size; - Vector3 size = new Vector3(btn.size.x / to.x, btn.size.y / to.y, btn.size.z / to.z); - if ((bool)_buttonAnimationTween) - { - _buttonAnimationTween.PlayForward(); - btn.size = size; - while (Input.GetMouseButton(0)) - { - yield return null; - } - _buttonAnimationTween.PlayReverse(); - btn.size = defaultSize; - } - } - - public static string GetCardMaterialPath(int cardId) - { - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - CardParameter cardParameterFromId = instance.GetCardParameterFromId(cardId); - CardParameter cardParameterFromId2 = instance.GetCardParameterFromId(cardParameterFromId.NormalCardId); - ResourcesManager.AssetLoadPathType type = ResourcesManager.AssetLoadPathType.UnitCardMaterial; - if (instance.GetCardParameterFromId(cardId).CharType != CardBasePrm.CharaType.NORMAL && !CardMaster.IsMutationCardCheck(instance.GetCardParameterFromId(cardId).BaseCardId)) - { - type = ResourcesManager.AssetLoadPathType.SpellCardMaterial; - } - return Toolbox.ResourcesManager.GetAssetTypePath(cardParameterFromId2.ResourceCardId.ToString(), type); - } - - private static string GetBattleLogTexturePath(int cardId) - { - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - ResourcesManager.AssetLoadPathType assetLoadPathType = ResourcesManager.AssetLoadPathType.UnitHeader; - string path = instance.GetCardParameterFromId(cardId).ResourceCardId + "0"; - assetLoadPathType = ((instance.GetCardParameterFromId(cardId).CharType != CardBasePrm.CharaType.NORMAL && !CardMaster.IsMutationCardCheck(instance.GetCardParameterFromId(cardId).BaseCardId)) ? ResourcesManager.AssetLoadPathType.OtherHeader : ResourcesManager.AssetLoadPathType.UnitHeader); - return Toolbox.ResourcesManager.GetAssetTypePath(path, assetLoadPathType, isfetch: true); - } - - private void GetCardCountEachType(DeckData deck, out int followerCount, out int spellCount, out int amuletCount) - { - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - int num = 0; - int num2 = 0; - int num3 = 0; - foreach (int cardId in deck.GetCardIdList()) - { - switch (instance.GetCardParameterFromId(cardId).CharType) - { - case CardBasePrm.CharaType.NORMAL: - num++; - break; - case CardBasePrm.CharaType.SPELL: - num2++; - break; - case CardBasePrm.CharaType.FIELD: - case CardBasePrm.CharaType.CHANT_FIELD: - num3++; - break; - } - } - followerCount = num; - spellCount = num2; - amuletCount = num3; - } - - private void OnClickButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OnClick.Call(_data); - } -} diff --git a/SVSim.BattleEngine/Engine/DeckListMenuUI.cs b/SVSim.BattleEngine/Engine/DeckListMenuUI.cs index 7eb7042d..f8ab1297 100644 --- a/SVSim.BattleEngine/Engine/DeckListMenuUI.cs +++ b/SVSim.BattleEngine/Engine/DeckListMenuUI.cs @@ -35,10 +35,6 @@ public class DeckListMenuUI : MonoBehaviour Lock } - private const int MAXNUM_DECK_PER_TABLE = 9; - - private const int PAGE_SHOW_LABEL_BORDER = 11; - [SerializeField] private DeckUI _deckFrameOriginal; @@ -78,8 +74,6 @@ public class DeckListMenuUI : MonoBehaviour private bool _isChangePage; - private float _timeChangePage; - private List _deckUIList = new List(); private Action _onMultiDeckDelete; @@ -219,19 +213,6 @@ public class DeckListMenuUI : MonoBehaviour }); } - private void Update() - { - if (_isChangePage) - { - _timeChangePage += Time.deltaTime; - if (_timeChangePage >= 0.2f) - { - _isChangePage = false; - _timeChangePage = 0f; - } - } - } - public void UpdateDeckList(DeckGroup deckGroup, Action onFinish) { if (deckGroup != null) @@ -254,7 +235,7 @@ public class DeckListMenuUI : MonoBehaviour _resourcePathList = new List(); List list = new List(); List list2 = new List(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr for (int i = 1; i < 9; i++) { int skin_id = dataMgr.GetCharaPrmByClassId(i).skin_id; @@ -679,15 +660,6 @@ public class DeckListMenuUI : MonoBehaviour return true; } - private IEnumerator DeleteWaitCoroutine() - { - while (_loadCoroutine != null) - { - yield return null; - } - DeleteResource(); - } - private void Delete() { if (_loadCoroutine != null) @@ -757,7 +729,7 @@ public class DeckListMenuUI : MonoBehaviour { if (ChangePage(_currentPage + 1)) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + } } @@ -765,7 +737,7 @@ public class DeckListMenuUI : MonoBehaviour { if (ChangePage(_currentPage - 1)) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + } } @@ -791,7 +763,7 @@ public class DeckListMenuUI : MonoBehaviour switch (_editMode) { case EditMode.Default: - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + this.OnSelectDeck.Call(deckDisplay.Deck); break; case EditMode.MultiDelete: @@ -811,7 +783,7 @@ public class DeckListMenuUI : MonoBehaviour private void OnClickDeckSortStart() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + SetSortMode(); } @@ -819,7 +791,7 @@ public class DeckListMenuUI : MonoBehaviour { if (!IsSortDragging && !IsPlayingSortAnimation) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); + SetDefaultMode(); List list = new List(); for (int i = 0; i < _deckFrameDefaultList.Count; i++) @@ -835,7 +807,7 @@ public class DeckListMenuUI : MonoBehaviour { if (!IsSortDragging && !IsPlayingSortAnimation) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + SaveDeckOrder(delegate { SetDefaultMode(); @@ -871,12 +843,6 @@ public class DeckListMenuUI : MonoBehaviour } } - private void OnDestroy() - { - _isOnDestroy = true; - UIManager.GetInstance().StartCoroutine(DeleteWaitCoroutine()); - } - public DeckData GetDeckDataSamePage(DeckData targetDeck) { foreach (PageData page in _pageList) @@ -908,7 +874,7 @@ public class DeckListMenuUI : MonoBehaviour private void OnClickMultiDeckDeleteStartButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + SaveDeckOrder(delegate { SetMultiDeleteMode(); @@ -917,7 +883,7 @@ public class DeckListMenuUI : MonoBehaviour private void OnClickDeckForMultiDeckDelete(DeckUI deckDisplay) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + deckDisplay.SetVisibleCheckMark(!deckDisplay.IsCheckeMark); deckDisplay.SetColorToGrey(deckDisplay.IsCheckeMark); RefreshMultiDeleteDecideButtonEnable(); @@ -1020,13 +986,13 @@ public class DeckListMenuUI : MonoBehaviour private void OnClickMultiDeckDeleteCancelButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); + SetSortMode(); } private void OnClickMultiDeckDeleteDecideButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ClearBackButtonAction(); SystemText systemText = Data.SystemText; DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); diff --git a/SVSim.BattleEngine/Engine/DeckSortDragDrop.cs b/SVSim.BattleEngine/Engine/DeckSortDragDrop.cs index 411252b9..02a31f85 100644 --- a/SVSim.BattleEngine/Engine/DeckSortDragDrop.cs +++ b/SVSim.BattleEngine/Engine/DeckSortDragDrop.cs @@ -10,14 +10,6 @@ public class DeckSortDragDrop : UIDragDropItem Add } - private const int UIPANEL_DEPTH = 50; - - private const float DRAG_OBJECT_ALPHA = 0.5f; - - private const float SORT_DELTA_UNDER = 5f; - - private const float PAGE_CHANGE_INTERVAL_TIME = 0.75f; - public DeckListMenuUI DeckListMenuClass; protected Vector3 _defaultPosition; @@ -99,7 +91,7 @@ public class DeckSortDragDrop : UIDragDropItem CurrentTouchPositionSort(isDrop: true); if (_isSortExecEvenOnce) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } _isSortExecEvenOnce = false; _isDragStart = false; @@ -134,7 +126,7 @@ public class DeckSortDragDrop : UIDragDropItem _isDragStart = true; _isSortExecEvenOnce = false; _pageChangeIntervalTime = 0.75f; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } } @@ -315,16 +307,6 @@ public class DeckSortDragDrop : UIDragDropItem base.transform.gameObject.GetComponent().enabled = true; } - private void OnApplicationPause(bool paused) - { - if (_isPress && paused) - { - OnPress(isPressed: false); - StopDragging(UICamera.hoveredObject); - mPressed = false; - } - } - private void PageChangeUpdate() { BetterList hitsList = UICamera.GetHitsList(); diff --git a/SVSim.BattleEngine/Engine/DegreeInfoDetail.cs b/SVSim.BattleEngine/Engine/DegreeInfoDetail.cs index 48df8aa0..fc81b8e8 100644 --- a/SVSim.BattleEngine/Engine/DegreeInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/DegreeInfoDetail.cs @@ -2,5 +2,4 @@ using System.Collections.Generic; public class DegreeInfoDetail { - public List user_degree_list; } diff --git a/SVSim.BattleEngine/Engine/DepthBlurAndBloom.cs b/SVSim.BattleEngine/Engine/DepthBlurAndBloom.cs deleted file mode 100644 index 82763c7e..00000000 --- a/SVSim.BattleEngine/Engine/DepthBlurAndBloom.cs +++ /dev/null @@ -1,46 +0,0 @@ -public class DepthBlurAndBloom -{ - public enum DofFocalType - { - Transform, - Position, - Point - } - - public enum DofBlur - { - Horizon, - Mixed, - Disc, - BallBlur - } - - public enum DofQuality - { - OnlyBackground = 1, - BackgroundAndForeground = 5 - } - - public enum DofTransformTarget - { - Character0, - Character1, - Character2, - Character3, - Character4, - Character5, - Character6, - Character7, - Character8, - Character9, - Character10, - Character11, - Character12, - Character13, - Character14, - Character15, - Character16, - Character17, - Character18 - } -} diff --git a/SVSim.BattleEngine/Engine/DetailMgr.cs b/SVSim.BattleEngine/Engine/DetailMgr.cs index b0b73841..c5d2ed89 100644 --- a/SVSim.BattleEngine/Engine/DetailMgr.cs +++ b/SVSim.BattleEngine/Engine/DetailMgr.cs @@ -77,29 +77,4 @@ public class DetailMgr { return UIManager.GetInstance().UIRootLoadingCamera; } - - public void HideDetailPanel(BattleCardBase card) - { - if (card.IsSpell) - { - DetailSkill.SetActive(value: false); - } - else if (card.IsField) - { - DetailField.SetActive(value: false); - } - else - { - DetailNormal.SetActive(value: false); - } - DetailPanelControl.Hide(); - DetailPanelControl.SetScreenPosition(right: false); - card = null; - } - - public void HideSubDetailPanel(BattleCardBase card) - { - SubDetailPanelControl.Hide(); - SubDetailPanelControl.SetScreenPosition(right: false); - } } diff --git a/SVSim.BattleEngine/Engine/DetailPanelControl.cs b/SVSim.BattleEngine/Engine/DetailPanelControl.cs index 53632213..11608649 100644 --- a/SVSim.BattleEngine/Engine/DetailPanelControl.cs +++ b/SVSim.BattleEngine/Engine/DetailPanelControl.cs @@ -1,2261 +1,55 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle; -using Wizard.Battle.Touch; -using Wizard.Battle.UI; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class DetailPanelControl : CardDetailBase, IDetailPanelControl -{ - public enum ShowRequest - { - NORMAL, - MULLIGAN, - EVOLUTION_SELECT, - BATTLELOG, - DESTROYLOG, - CHOICE, - BUFF_DETAIL, - DECK_SUMMON_CARD_LIST, - FUSION_INFO_CARD_LIST, - CHOICE_BRAVE, - CHOICE_BRAVE_AND_BUFF - } - - private class CoroutineActions - { - public Coroutine _coroutine; - - public List _actions; - - public CoroutineActions(Action a) - { - _coroutine = null; - _actions = new List { a }; - } - } - - public struct ItemCursor - { - private const float ITEM_MARGIN = 3f; - - private float _offset; - - public float Height { get; private set; } - - public ItemCursor(float offset) - { - _offset = offset; - Height = 0f; - } - - public ItemCursor Clone() - { - ItemCursor result = new ItemCursor(0f); - result.Height = Height; - result._offset = _offset; - return result; - } - - public float AddAndGetCenterOffset(float height) - { - float result = _offset - 3f - height / 2f; - float num = 6f + height; - _offset -= num; - Height += num; - return result; - } - - public float AddAndGetTopOffset(float height) - { - float result = _offset - 3f; - float num = 6f + height; - _offset -= num; - Height += num; - return result; - } - } - - [SerializeField] - private BattleButtonControl battleButtonControl; - - [SerializeField] - private UIPanel MainPanel; - - [SerializeField] - private GameObject Window; - - [SerializeField] - private GameObject FollowerPanel; - - [SerializeField] - private UILabel FollowerAtkLabel; - - [SerializeField] - private UILabel FollowerLifeLabel; - - [SerializeField] - private GameObject EvoPanel; - - [SerializeField] - private UILabel EvoTitleLabel; - - [SerializeField] - private UILabel EvoAtkLabel; - - [SerializeField] - private UILabel EvoLifeLabel; - - [SerializeField] - private UISprite Underline; - - [SerializeField] - private UIButton EvolutionButton; - - [SerializeField] - private UILabel EvolutionComment; - - private UILabel _evolutionButtonUiLabel; - - [SerializeField] - private UIButton FusionButton; - - private UILabel _fusionButtonUiLabel; - - [SerializeField] - private UIButton NonFollowerFusionButton; - - private UILabel _nonFollowerFusionButtonUiLabel; - - [SerializeField] - private UISprite NonFollowerFusionUnderline; - - [SerializeField] - private UIWidget _buffRootWidget; - - [SerializeField] - private UISprite _buffPanelSprite; - - [SerializeField] - private UIPanel _buffPanel; - - [SerializeField] - private UIPanel _buffContentsPanel; - - [SerializeField] - private Transform _buffContentsParent; - - [SerializeField] - private UIScrollBar _buffScrollBar; - - [SerializeField] - private UIScrollView _buffScrollView; - - [SerializeField] - private UIDragScrollView _bgDragScrollView; - - [SerializeField] - private UILabel _buffTitleLabel; - - [SerializeField] - private UILabel _myRotationBonusTitleLabel; - - [SerializeField] - private UIPanel _myRotationBonusContentsPanel; - - [SerializeField] - private Transform _myRotationBonusContentsParent; - - [SerializeField] - private UISprite _myRotationBonusBorderLine; - - [SerializeField] - private UIPanel _avatarBattleBonusContentsPanel; - - [SerializeField] - private Transform _avatarBattleBonusContentsParent; - - [SerializeField] - private UIScrollBar _avatarBattleBonusScrollBar; - - [SerializeField] - private UIScrollView _avatarBattleBonusScrollView; - - [SerializeField] - private Transform _avatarBattleBonusBPIconParent; - - [SerializeField] - private UISprite _avatarBattleBonusBPSprite; - - [SerializeField] - private UILabel _avatarBattleBonusBPLabel; - - [SerializeField] - private UILabel _avatarBattleBonusBPDescriptionLabel; - - [SerializeField] - private UILabel _bossRushSpecialSkillTitleLabel; - - [SerializeField] - private UIPanel _bossRushSpecialSkillContentsPanel; - - [SerializeField] - private Transform _bossRushSpecialSkillContentsParent; - - [SerializeField] - public GameObject EvoTargetPanel; - - private GameObject _normalLightFrame; - - private GameObject _evoLightFrame; - - private Vector3 DefaultPanelPos; - - private Vector3 DefaultNorPanelPos; - - private Vector3 DefaultEvoPanelPos; - - [SerializeField] - private BoxCollider _buffPanelCollider; - - private BattleManagerBase _battleMgr; - - private OperateMgr _operateMgr; - - private SystemText _text; - - private BuffInfo _buff; - - private string _divergenceId = string.Empty; - - private int _logTextureId; - - private bool _isToGreyTextEnabled; - - private readonly string[] GREY_TEXT_PATTERNS = new string[2] { "\\[u\\]\\[524522\\]", "\\[555555\\]-?\\[b\\]" }; - - private const float LabelColliderSizeZ = 500f; - - private readonly float NONFOLOWER_SCROLLVIEW_POS_Y = -143.7f; - - private readonly float NONFOLOWER_DETAILLABEL_POS_Y = 37.7f; - - private const int CLASS_BUFF_CORRECTION_COEFFICIENT = 47; - - private const int CLASS_BUFF_ADVANCED_INFO_COEFFICIENT = 44; - - private const int MY_ROTATION_INFO_COEFFICIENT = 54; - - private const int CACHE_BUFF_LOG_MAX = 50; - - private const float BETWEEN_BUFF_AND_BUFF = 6f; - - private const float BETWEEN_BUFF_AND_BG_BOTTOM = 8f; - - private readonly Vector3 BATTLELOG_DETAIL = new Vector3(675f, -150f, 0f); - - private readonly Vector3 MULLIGAN_DETAIL = new Vector3(0f, 0f, -350f); - - private readonly Vector3 BUFF_LOG_DETAIL_LEFT = new Vector3(-434f, -106f, 0f); - - private readonly Vector3 BUFF_LOG_DETAIL_RIGHT = new Vector3(434f, -106f, 0f); - - private readonly Vector3 BATTLELOG_BUFF_SAME_BOTTOM_OFFSET = new Vector3(0f, 147f, 0f); - - private const float RIGHT_REL_OFFSET = -0.44f; - - private const float RIGHT_REL_OFFSET_MIN = -0.222f; - - private const float TOP_PIXEL_OFFSET = 34f; - - private const float TOP_PIXEL_OFFSET_MIN = -30f; - - private const float MIN_SCALE = 0.4f; - - private const float HIDE_DISTANCE = 10000f; - - private const float MAX_HEIGHT = 598f; - - private List _cacheLogList = new List(); - - private List _cacheMyRotationLogList = new List(); - - private List _cachePlayerBossRushSkillList = new List(); - - private List _cacheEnemyBossRushSkillList = new List(); - - private List _cacheAvatarBattleTitleList = new List(); - - private List _cacheAvatarBattlePassiveBonusList = new List(); - - private List _cacheAvatarBattleBonusList = new List(); - - private List _drawLogList = new List(); - - private GameObject _copiedLabel; - - private GameObject _saveBurialRiteLabel; - - private GameObject _getonCardLabel; - - private BuffDetailInfoUI _buffDetailInfoUI; - - private Vector3 _currentBuffWindowOffset = Vector3.zero; - - private const int CARD_ID_CLASS = 0; - - private static Dictionary loadHeaderCoroutine = new Dictionary(); - - private bool _hasKeyword; - - public const string PREFAB_PATH = "Prefab/UI/DetailPanel"; - - private DetailPanelControl _nextPanel; - - private DetailPanelControl _parentPanel; - - private const float LONG_PRESS_TIME = 0.2f; - - private float? _predictionWaitTime; - - private const string HBP_ICON_SPRITE_NAME = "icon_hbp"; - - private const string PP_ICON_SPRITE_NAME = "icon_pp"; - - public bool forceEvolutionConfirm { get; set; } - - public GameObject EvoTargetPanelColliderGameObject => EvoTargetPanel.GetComponent().gameObject; - - public bool IsShow { get; private set; } - - public UIButton EvolveButton => EvolutionButton; - - public EvolutionConfirmation _evolutionConfirmation { get; private set; } - - public bool IsUpdateCardDescription { get; private set; } - - public BattleCardBase _card { get; private set; } - - public ShowRequest CurrentShowRequest { get; private set; } - - private bool IsEvolveToOtherCardLog => _logTextureId / 1000000 == 910; - - public event Action OnHideOneTime; - - public static bool IsDestroyOrDeckCardList(ShowRequest showRequest) - { - if (ShowRequest.DESTROYLOG != showRequest) - { - return ShowRequest.DECK_SUMMON_CARD_LIST == showRequest; - } - return true; - } - - public static bool IsChoiceBraveRequest(ShowRequest showRequest) - { - if (showRequest != ShowRequest.CHOICE_BRAVE) - { - return showRequest == ShowRequest.CHOICE_BRAVE_AND_BUFF; - } - return true; - } - - public void ResetUpdateCardDescriptionFlag() - { - IsUpdateCardDescription = false; - } - - public void SetBuff(BuffInfo buff) - { - _buff = buff; - } - - private void Start() - { - _evolutionConfirmation = new EvolutionConfirmation(base.transform); - _evolutionButtonUiLabel = EvolutionButton.transform.Find("Label").GetComponent(); - _evolutionButtonUiLabel.text = Data.SystemText.Get("Battle_0117"); - EvolutionButton.defaultColor = new Color(1f, 1f, 1f); - EvolutionButton.onClick.Clear(); - EvolutionButton.onClick.Add(new EventDelegate(delegate - { - if (!GameMgr.GetIns().IsWatchBattle && _battleMgr != null && _operateMgr != null && _card != null) - { - BattleCardBase evoCard = _card; - if (_card.IsInplay) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.CONFIRM_EVOLVE) || forceEvolutionConfirm) - { - _battleMgr.BattlePlayer.PlayerBattleView.CallOnOpenEvolveDialoguePanel(); - _evolutionConfirmation.Show(_battleMgr.BattlePlayer).onPushButton1 = delegate - { - OnTouchEvolutionButton(evoCard); - }; - } - else - { - OnTouchEvolutionButton(evoCard); - } - } - } - })); - EventDelegate item = new EventDelegate(delegate - { - if (!GameMgr.GetIns().IsWatchBattle && _battleMgr != null && _operateMgr != null && _card != null && _card.IsInHand && _card.SelfBattlePlayer.IsSelfTurn) - { - OnTouchFusionButton(_card); - } - }); - FusionButton.defaultColor = new Color(1f, 1f, 1f); - FusionButton.onClick.Clear(); - FusionButton.onClick.Add(item); - _fusionButtonUiLabel = FusionButton.transform.Find("Label").GetComponent(); - _fusionButtonUiLabel.text = Data.SystemText.Get("Battle_0506"); - NonFollowerFusionButton.defaultColor = new Color(1f, 1f, 1f); - NonFollowerFusionButton.onClick.Clear(); - NonFollowerFusionButton.onClick.Add(item); - _nonFollowerFusionButtonUiLabel = NonFollowerFusionButton.transform.Find("Label").GetComponent(); - _nonFollowerFusionButtonUiLabel.text = Data.SystemText.Get("Battle_0506"); - _predictionWaitTime = null; - UIEventListener.Get(EvolutionButton.gameObject).onPress = delegate(GameObject obj, bool isPress) - { - if (isPress) - { - _predictionWaitTime = Time.realtimeSinceStartup; - } - else - { - _predictionWaitTime = null; - _battleMgr.Prediction.Clear(); - } - }; - UIEventListener.Get(EvolutionButton.gameObject).onDragOut = delegate - { - _predictionWaitTime = null; - _battleMgr.Prediction.Clear(); - }; - _normalLightFrame = FollowerPanel.transform.Find("LightFrame").gameObject; - _evoLightFrame = EvoPanel.transform.Find("LightFrame").gameObject; - DefaultPanelPos = MainPanel.transform.localPosition; - MainPanel.transform.localPosition = DefaultPanelPos + Vector3.left * 10000f; - MainPanel.alpha = 0f; - IsShow = false; - ResetUpdateCardDescriptionFlag(); - DefaultNorPanelPos = FollowerPanel.transform.localPosition; - DefaultEvoPanelPos = EvoPanel.transform.localPosition; - SystemText systemText = Data.SystemText; - EvoTargetPanel.transform.Find("Label").GetComponent().text = systemText.Get("Battle_0117"); - List list = new List(); - list.Add(base.gameObject); - list.Add(FollowerPanel); - list.Add(EvoPanel); - list.Add(_buffPanelSprite.gameObject); - list.Add(EvoTargetPanel); - UIManager.GetInstance().AttachAtlas(list); - SetSize(OptionSettingWindow.GetBattleDetailPanelSizePercent()); - _followerPanel.Initialize(); - _followerEvoPanel.Initialize(); - _nonFollowerPanel.Initialize(); - } - - private void Update() - { - if (EvolutionButton.state == UIButtonColor.State.Pressed) - { - if (_predictionWaitTime.HasValue && _predictionWaitTime.Value + 0.2f < Time.realtimeSinceStartup) - { - _battleMgr.Prediction.Evolve(_card); - _predictionWaitTime = null; - } - } - else - { - _predictionWaitTime = null; - } - } - - private void OnTouchEvolutionButton(BattleCardBase card) - { - Hide(); - if (!_battleMgr.BattlePlayer.IsSelfTurn) - { - LocalLog.AccumulateLastTraceLog("OnTouchEvolutionButton selfTurn"); - return; - } - BattleLogManager instance = BattleLogManager.GetInstance(); - if (instance._clickSubLogItem != null) - { - instance._clickSubLogItem.OnUnClickLog(); - } - _battleMgr.BattlePlayer.PlayerBattleView._isEvolutionSkillSelect = true; - TouchControl touchControl = _battleMgr.TouchControl; - touchControl.RegisterTouchProcessor(touchControl.CreateEvolutionSimpleProcessor(card)); - _battleMgr.BattleUIContainer.DisableMenu(); - } - - private void OnTouchFusionButton(BattleCardBase card) - { - Hide(); - BattleLogManager instance = BattleLogManager.GetInstance(); - if (instance._clickSubLogItem != null) - { - instance._clickSubLogItem.OnUnClickLog(); - } - if (!_battleMgr.BattlePlayer.IsSelfTurn) - { - LocalLog.AccumulateLastTraceLog("OnTouchFusionButton selfTurn"); - return; - } - _battleMgr.TouchControl.RegisterTouchProcessor(new FusionSimpleProcessor(fusionSkill: card.Skills.FirstOrDefault((SkillBase s) => s is Skill_fusion), fusionMetamorphoseSkill: card.Skills.FirstOrDefault((SkillBase s) => s is Skill_fusion_metamorphose) as Skill_fusion_metamorphose, battleMgr: _battleMgr, card: card)); - _battleMgr.BattleUIContainer.DisableMenu(); - } - - public void Show(BattleManagerBase battleMgrBase, OperateMgr operateMgr, BattleCardBase card, ShowRequest showRequest) - { - BattleCoroutine.GetInstance().StartCoroutine(StartShow(battleMgrBase, operateMgr, card, showRequest)); - } - - public void ShowList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List cards, ShowRequest showRequest, BuffInfo buff, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, string divergenceId = "", int logTextureId = 0) - { - BattleCoroutine.GetInstance().StartCoroutine(StartShow(battleMgrBase, operateMgr, cards[0], showRequest, textureOption, buff, divergenceId, logTextureId)); - if ((bool)_nextPanel && cards.Count > 1) - { - _nextPanel.SetParent(this); - List cards2 = new List(cards.GetRange(1, cards.Count - 1)); - _nextPanel.ShowList(battleMgrBase, operateMgr, cards2, showRequest, buff); - } - } - - public void CreateNextPanel() - { - GameMgr ins = GameMgr.GetIns(); - BattleManagerBase ins2 = BattleManagerBase.GetIns(); - GameObject gameObject = ins.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/DetailPanel"); - gameObject.transform.parent = ins2.BtlUIContainer.transform; - _nextPanel = gameObject.GetComponent(); - _nextPanel.SetParent(this); - } - - public void UpdateCardDescription() - { - if (!IsShow || _card == null || (_card.IsInHand && !_card.IsPlayer && !GameMgr.GetIns().IsAdminWatch && (CurrentShowRequest != ShowRequest.FUSION_INFO_CARD_LIST || !_isToGreyTextEnabled))) - { - return; - } - bool isSkipOption = CurrentShowRequest == ShowRequest.BATTLELOG || CurrentShowRequest == ShowRequest.DESTROYLOG || (CurrentShowRequest == ShowRequest.FUSION_INFO_CARD_LIST && !_isToGreyTextEnabled); - if (!_card.IsClass) - { - if (_card.IsUnit) - { - bool flag = GameMgr.GetIns().IsNewReplayBattle && _buff != null && _buff.IsCopied; - string skillDisc = (flag ? _card.CopiedSkillDescriptionInReplay(_buff, _buff.CopiedSkillDescriptionValueList) : _card.SkillDescription(null, isSkipOption, _buff, _divergenceId)); - string evoSkillDisc = ((IsEvolveToOtherCardLog || (_card.IsChoiceEvolutionCard && _logTextureId != 0)) ? CardMaster.GetInstanceForBattle().GetCardParameterFromId(_logTextureId).EvoSkillDescription : (flag ? _card.CopiedEvoSkillDescriptionInReplay(_buff, _buff.CopiedEvoSkillDescriptionValueList) : _card.EvoSkillDescription(null, isSkipOption, _buff))); - SetFollowerDetailLabel(skillDisc, evoSkillDisc, Underline.gameObject.activeSelf, resetScrollPosition: false); - } - else - { - SetDescLabelText(_nonFollowerPanel, _card.SkillDescription(null, isSkipOption, _buff, _divergenceId), NonFollowerFusionUnderline.gameObject.activeSelf, resetScrollPosition: false); - } - Window.SetActive(value: false); - Window.SetActive(value: true); - IsUpdateCardDescription = true; - } - } - - private void UpdateAvatarBattleBonusPanel() - { - if (!IsChoiceBraveRequest(CurrentShowRequest) || _card == null) - { - return; - } - _avatarBattleBonusBPLabel.text = _card.SelfBattlePlayer.Bp.ToString(); - BattlePlayerBase.AvatarBattleDescInfo passiveSkillDescInfo = (_card.IsPlayer ? _battleMgr.BattlePlayer.AvatarBattlePassiveSkillDescInfo : _battleMgr.BattleEnemy.AvatarBattlePassiveSkillDescInfo); - AvatarBattlePassiveBonusItem avatarBattlePassiveBonusItem = _cacheAvatarBattlePassiveBonusList.FirstOrDefault((AvatarBattlePassiveBonusItem cache) => cache.SkillDescInfo == passiveSkillDescInfo); - if (avatarBattlePassiveBonusItem != null) - { - avatarBattlePassiveBonusItem.SetText(_card); - } - List choiceBraveDescInfoList = (_card.IsPlayer ? _battleMgr.BattlePlayer.ChoiceBraveSkillDescInfoList : _battleMgr.BattleEnemy.ChoiceBraveSkillDescInfoList); - int i; - for (i = 0; i < choiceBraveDescInfoList.Count; i++) - { - AvatarBattleBonusItem avatarBattleBonusItem = _cacheAvatarBattleBonusList.FirstOrDefault((AvatarBattleBonusItem cache) => cache.SkillDescInfo == choiceBraveDescInfoList[i]); - if (avatarBattleBonusItem != null) - { - bool isNeedSeparator = _battleMgr.BattlePlayer.BattleView.IsShowCantChoiceBraveText || passiveSkillDescInfo.DescText != string.Empty || i != 0; - avatarBattleBonusItem.SetText(_card, isNeedSeparator); - } - } - } - - public void UpdateCardDescriptionOnEvent() - { - UpdateCardDescription(); - BattleManagerBase.GetIns().DetailMgr.SubDetailPanelControl.UpdateCardDescription(); - UpdateAvatarBattleBonusPanel(); - } - - public void UpdateCardDescriptionOnEvolutionEvent() - { - if (_card != null && !_card.IsChoiceEvolutionCard) - { - UpdateCardDescriptionOnEvent(); - } - } - - private IEnumerator StartShow(BattleManagerBase battleMgrBase, OperateMgr operateMgr, BattleCardBase card, ShowRequest showRequest, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, BuffInfo buff = null, string divergenceId = "", int logTextureId = 0) - { - base.gameObject.SetActive(value: true); - RemoveCardEvent(card); - _card = card; - _battleMgr = battleMgrBase; - _operateMgr = operateMgr; - _text = Data.SystemText; - CurrentShowRequest = showRequest; - _buff = buff; - _divergenceId = divergenceId; - _logTextureId = logTextureId; - _isToGreyTextEnabled = GREY_TEXT_PATTERNS.Any((string pattern) => Regex.IsMatch(_card.BaseParameter.SkillDescription, pattern)); - if (IsEvolveToOtherCardLog || (card.IsChoiceEvolutionCard && logTextureId == 0)) - { - textureOption = BattleLogItem.CardTextureOption.ForceEvolution; - } - else if ((card.IsChoiceEvolutionCard || card.IsChoiceEvolutionCardBeforeUpdateBuildInfo) && logTextureId != 0) - { - textureOption = BattleLogItem.CardTextureOption.ForceNormal; - } - CardParameter baseParameter = ((IsEvolveToOtherCardLog || ((card.IsChoiceEvolutionCard || card.IsChoiceEvolutionCardBeforeUpdateBuildInfo) && logTextureId != 0)) ? CardMaster.GetInstanceForBattle().GetCardParameterFromId(logTextureId) : card.BaseParameter); - DetailPanelInfo currentPanel = _followerPanel; - if (!card.IsUnit) - { - currentPanel = _nonFollowerPanel; - currentPanel._classLabel.gameObject.SetActive(value: true); - currentPanel._myRotationInfo.SetActive(value: false); - } - GameMgr gameMgr = GameMgr.GetIns(); - DataMgr dataMgr = gameMgr.GetDataMgr(); - bool isSkipOption = showRequest == ShowRequest.BATTLELOG || showRequest == ShowRequest.DESTROYLOG || (CurrentShowRequest == ShowRequest.FUSION_INFO_CARD_LIST && !_isToGreyTextEnabled); - string text = string.Format("battle_card_info_{0}", ((dataMgr.m_BattleType != DataMgr.BattleType.Story && !GameMgr.GetIns().IsPuzzleQuest) ? (card.IsClass ? dataMgr.GetCharaPrmByCharaId((card as ClassBattleCardBase).CharaId).class_id : ((int)card.BaseParameter.Clan)) : ((!card.IsPlayer) ? (card.IsClass ? dataMgr.GetEnemyClassId() : ((int)card.BaseParameter.Clan)) : (card.IsClass ? dataMgr.GetCharaPrmByCharaId((card as ClassBattleCardBase).CharaId).class_id : ((int)card.BaseParameter.Clan)))).ToString("00")); - if (currentPanel._classBG.spriteName != text) - { - currentPanel._classBG.spriteName = text; - } - bool loaded = false; - Action cbOnLoaded = delegate - { - loaded = true; - }; - if (card.IsClass) - { - bool isSkinEvolved = battleMgrBase.GetBattlePlayer(card.IsPlayer).IsSkinEvolved; - LoadClassHeaderTexture((card as ClassBattleCardBase).CharaId, currentPanel._logImage, cbOnLoaded, isSkinEvolved); - } - else if (IsDestroyOrDeckCardList(showRequest) || textureOption == BattleLogItem.CardTextureOption.ForceNormal) - { - LoadCardHeaderTexture(baseParameter.NormalCardId, card.IsUnit, currentPanel._logImage, isEvolution: false, isBattleLogHeader: false, cbOnLoaded); - } - else if (textureOption == BattleLogItem.CardTextureOption.ForceEvolution) - { - LoadCardHeaderTexture(baseParameter.NormalCardId, card.IsUnit, currentPanel._logImage, isEvolution: true, isBattleLogHeader: false, cbOnLoaded); - } - else - { - LoadCardHeaderTexture(baseParameter.NormalCardId, card.IsUnit || (card.IsSpecialSkill && card.BaseParameter.CharType == CardBasePrm.CharaType.NORMAL), currentPanel._logImage, card.IsEvolution, isBattleLogHeader: false, cbOnLoaded); - } - while (!loaded) - { - yield return null; - } - ResetDetailPosition(); - if (!card.IsUnit) - { - FollowerPanel.SetActive(value: true); - EvoPanel.SetActive(value: false); - if (card.IsClass) - { - _nonFollowerPanel._costSprite.gameObject.SetActive(value: false); - _nonFollowerPanel._costLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._zeroCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signedCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel.DiscLabel.gameObject.SetActive(value: false); - } - else if (card.IsSpecialSkill) - { - _nonFollowerPanel._costSprite.gameObject.SetActive(value: false); - _nonFollowerPanel._costLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._zeroCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signedCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel.DiscLabel.gameObject.SetActive(value: true); - } - else - { - _nonFollowerPanel._costSprite.gameObject.SetActive(value: true); - bool flag = CardMaster.IsChoiceBraveCardCheck(baseParameter.CardId); - _nonFollowerPanel._costSprite.spriteName = (flag ? "icon_hbp" : "icon_pp"); - if (baseParameter.IsVariableCost) - { - _nonFollowerPanel._costLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signLabel.gameObject.SetActive(value: true); - _nonFollowerPanel._zeroCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signedCostLabel.gameObject.SetActive(value: true); - _nonFollowerPanel._signLabel.text = "-"; - _nonFollowerPanel._signedCostLabel.text = "X"; - } - else if (flag) - { - if (baseParameter.Cost == 0) - { - _nonFollowerPanel._costLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._zeroCostLabel.gameObject.SetActive(value: true); - _nonFollowerPanel._signedCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._zeroCostLabel.text = baseParameter.Cost.ToString(); - } - else - { - _nonFollowerPanel._costLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signLabel.gameObject.SetActive(value: true); - _nonFollowerPanel._zeroCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signedCostLabel.gameObject.SetActive(value: true); - _nonFollowerPanel._signLabel.text = ((baseParameter.Cost > 0) ? "-" : "+"); - _nonFollowerPanel._signedCostLabel.text = Mathf.Abs(baseParameter.Cost).ToString(); - } - } - else - { - _nonFollowerPanel._costLabel.gameObject.SetActive(value: true); - _nonFollowerPanel._signLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._zeroCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._signedCostLabel.gameObject.SetActive(value: false); - _nonFollowerPanel._costLabel.text = baseParameter.Cost.ToString(); - } - _nonFollowerPanel.DiscLabel.gameObject.SetActive(value: true); - } - _normalLightFrame.SetActive(value: true); - _nonFollowerPanel._root.SetActive(value: true); - _followerPanel._root.SetActive(value: false); - _followerEvoPanel._root.SetActive(value: false); - } - else - { - FollowerPanel.SetActive(value: true); - _followerPanel._costLabel.text = baseParameter.Cost.ToString(); - FollowerAtkLabel.text = baseParameter.Atk.ToString(); - FollowerLifeLabel.text = baseParameter.Life.ToString(); - EvoPanel.SetActive(value: true); - EvoTitleLabel.text = _text.Get("Card_0038"); - EvoAtkLabel.text = baseParameter.EvoAtk.ToString(); - EvoLifeLabel.text = baseParameter.EvoLife.ToString(); - if (IsDestroyOrDeckCardList(showRequest)) - { - _normalLightFrame.SetActive(value: false); - _evoLightFrame.SetActive(value: false); - } - else - { - bool flag2 = card.IsEvolution; - switch (textureOption) - { - case BattleLogItem.CardTextureOption.ForceNormal: - flag2 = false; - break; - case BattleLogItem.CardTextureOption.ForceEvolution: - flag2 = true; - break; - } - _normalLightFrame.SetActive(!flag2); - _evoLightFrame.SetActive(flag2); - } - if (card.SelfBattlePlayer.IsSelfTurn && card.IsPlayer && card.IsInplay && card.AttackableCount <= 0) - { - _battleMgr.VfxMgr.RegisterImmediateVfx(card.BattleCardView.ShowAttackFinished()); - } - } - _avatarBattleBonusBPIconParent.gameObject.SetActive(IsChoiceBraveRequest(showRequest)); - AddCardEvent(card); - EvolutionConfigSetup(card, _text, showRequest); - if (card.IsUnit) - { - bool flag3 = GameMgr.GetIns().IsNewReplayBattle && buff != null && buff.IsCopied; - string skillDisc = (flag3 ? card.CopiedSkillDescriptionInReplay(buff, buff.CopiedSkillDescriptionValueList) : card.SkillDescription(null, isSkipOption, buff)); - string evoSkillDisc = ((IsEvolveToOtherCardLog || (card.IsChoiceEvolutionCard && logTextureId != 0)) ? baseParameter.EvoSkillDescription : (flag3 ? card.CopiedEvoSkillDescriptionInReplay(buff, buff.CopiedEvoSkillDescriptionValueList) : card.EvoSkillDescription(null, isSkipOption, buff))); - SetFollowerDetailLabel(skillDisc, evoSkillDisc, Underline.gameObject.activeSelf); - _buffRootWidget.topAnchor.target = _followerEvoPanel._bg.transform; - } - else if (card.IsClass) - { - SetDescLabelText(_nonFollowerPanel, card.SkillDescription(null, isSkipOption, divergenceId: _divergenceId, buff: _buff), needEvolutionOrFusionButton: false, resetScrollPosition: true, isClass: true); - _buffRootWidget.topAnchor.target = _nonFollowerPanel._bg.transform; - } - else - { - SetDescLabelText(_nonFollowerPanel, card.SkillDescription(null, isSkipOption, buff, _divergenceId), NonFollowerFusionUnderline.gameObject.activeSelf); - _buffRootWidget.topAnchor.target = _nonFollowerPanel._bg.transform; - } - _buffRootWidget.ResetAnchors(); - _buffRootWidget.UpdateAnchors(); - if (!card.IsUnit) - { - _nonFollowerPanel._scrollView.transform.localPosition = new Vector3(_nonFollowerPanel._scrollView.transform.localPosition.x, NONFOLOWER_SCROLLVIEW_POS_Y, _nonFollowerPanel._scrollView.transform.localPosition.z); - _nonFollowerPanel.DiscLabel.transform.localPosition = new Vector3(_nonFollowerPanel.DiscLabel.transform.localPosition.x, NONFOLOWER_DETAILLABEL_POS_Y, _nonFollowerPanel.DiscLabel.transform.localPosition.z); - } - if (card.IsClass) - { - ClassCharacterMasterData charaPrmByCharaId = dataMgr.GetCharaPrmByCharaId((card as ClassBattleCardBase).CharaId); - currentPanel._nameLabel.text = charaPrmByCharaId.chara_name; - if (charaPrmByCharaId.hide_class_name) - { - currentPanel._classLabel.text = ""; - } - else - { - currentPanel._classLabel.text = dataMgr.GetClanNameByKey((int)charaPrmByCharaId.clan); - if (card.IsPlayer) - { - if (dataMgr.GetPlayerSubClassId() != 10) - { - UILabel classLabel = currentPanel._classLabel; - classLabel.text = classLabel.text + "/" + dataMgr.GetClanNameByKey(dataMgr.GetPlayerSubClassId()); - } - if (dataMgr.TryGetPlayerMyRotationInfo(out var myRotationInfo)) - { - SetMyRotationLabel(currentPanel, dataMgr.GetPlayerCharaData(), myRotationInfo); - } - } - else - { - if (dataMgr.GetEnemySubClassId() != 10) - { - UILabel classLabel2 = currentPanel._classLabel; - classLabel2.text = classLabel2.text + "/" + dataMgr.GetClanNameByKey(dataMgr.GetEnemySubClassId()); - } - if (dataMgr.TryGetEnemyMyRotationInfo(out var myRotationInfo2)) - { - SetMyRotationLabel(currentPanel, dataMgr.GetEnemyCharaData(), myRotationInfo2); - } - } - } - } - else - { - currentPanel._nameLabel.text = (card.IsSpecialSkill ? Data.SystemText.Get("BossRush_0011", baseParameter.CardName) : baseParameter.CardName); - int clan = (int)baseParameter.Clan; - if (card.IsSpecialSkill) - { - currentPanel._classLabel.text = dataMgr.GetClanNameByKey(clan); - } - else - { - string tribeName = baseParameter.TribeName; - if (tribeName != null && tribeName == "ALL") - { - currentPanel._classLabel.text = dataMgr.GetClanNameByKey(clan); - } - else - { - currentPanel._classLabel.text = dataMgr.GetClanNameByKey(clan) + " / " + baseParameter.TribeName; - } - } - } - gameMgr.GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO_SMALL); - List myRotationBonusConditionList = new List(); - List bossRushSpecialSkillList = new List(); - AvatarBattleInfo avatarBattleInfo = null; - if (card.IsClass) - { - myRotationBonusConditionList.AddRange(card.SelfBattlePlayer.BonusConditionList); - bossRushSpecialSkillList = card.SelfBattlePlayer.BossRushSpecialSkillList.Distinct().ToList(); - avatarBattleInfo = ((!card.SelfBattlePlayer.IsPlayer) ? _battleMgr.BattleEnemy.AvatarBattleInfo : _battleMgr.BattlePlayer.AvatarBattleInfo); - } - bool isShowBuffList = ((((!GameMgr.GetIns().IsNewReplayBattle) ? (card.BuffInfoList.Count > 0) : (card.ReplayBuffInfoList.Count > 0 || card.ReplayNoConsumeEpBuffInfoNameList.Count > 0 || card.ReplayBuffInfoLabelList.Count > 0)) || IsNeedNoConsumeEp(card)) && showRequest != ShowRequest.EVOLUTION_SELECT && ((showRequest != ShowRequest.BATTLELOG && showRequest != ShowRequest.FUSION_INFO_CARD_LIST) || card.IsClass) && !IsDestroyOrDeckCardList(showRequest) && showRequest != ShowRequest.BUFF_DETAIL) || myRotationBonusConditionList.Count > 0 || bossRushSpecialSkillList.Count > 0 || avatarBattleInfo != null; - bool isShowAnimation = !IsShow; - if (!IsShow) - { - IsShow = true; - iTween.Stop(MainPanel.gameObject); - yield return null; - if (IsShow) - { - MainPanel.alpha = 0f; - TweenAlpha.Begin(MainPanel.gameObject, 0.1f, 1f); - if (!isShowBuffList) - { - _buffRootWidget.gameObject.SetActive(value: false); - } - else - { - _buffRootWidget.gameObject.SetActive(value: true); - AddBuffInfo(card, showRequest, myRotationBonusConditionList, bossRushSpecialSkillList, avatarBattleInfo); - } - } - } - else if (!isShowBuffList) - { - _buffRootWidget.gameObject.SetActive(value: false); - } - SetupPanelTouchEvent(showRequest, baseParameter); - Window.SetActive(value: false); - Window.SetActive(value: true); - _buffScrollView.RestrictWithinBounds(instant: true); - _buffScrollView.ResetPosition(); - MainPanel.transform.localPosition = GetShowPos(showRequest); - if (card.IsClass && (showRequest == ShowRequest.BATTLELOG || showRequest == ShowRequest.FUSION_INFO_CARD_LIST)) - { - MainPanel.transform.position = new Vector3(MainPanel.transform.position.x, BattleLogManager.GetInstance()._logWindow.transform.position.y, MainPanel.transform.position.z); - MainPanel.transform.localPosition += BATTLELOG_BUFF_SAME_BOTTOM_OFFSET; - } - if (isShowAnimation) - { - iTween.MoveFrom(MainPanel.gameObject, iTween.Hash("x", MainPanel.transform.localPosition.x, "y", MainPanel.transform.localPosition.y - 5f, "z", MainPanel.transform.localPosition.z, "islocal", true, "time", 0.1f, "easetype", iTween.EaseType.easeOutCubic)); - } - UpdateParentAnchor(); - BattleLogManager.GetInstance()._logWindow.HideCardListPanel(); - } - - private void SetMyRotationLabel(DetailPanelInfo currentPanel, ClassCharacterMasterData classCharaData, MyRotationInfo myRotationInfo) - { - currentPanel._myRotationClassLabel.text = DeckData.CreateMyRotationClassName(classCharaData.class_id, myRotationInfo); - currentPanel._classLabel.gameObject.SetActive(value: false); - currentPanel._myRotationInfo.SetActive(value: true); - currentPanel._myRotationBonusIconOriginal.SetActive(value: false); - currentPanel._myRotationBonusIconGrid.transform.DestroyChildren(); - foreach (MyRotationInfo.MyRotationBonus ability in myRotationInfo.Abilities) - { - GameObject obj = NGUITools.AddChild(currentPanel._myRotationBonusIconGrid.gameObject, currentPanel._myRotationBonusIconOriginal); - obj.GetComponent().spriteName = ability.IconName; - obj.SetActive(value: true); - } - currentPanel._myRotationBonusIconGrid.Reposition(); - currentPanel._myRotationInfoGrid.Reposition(); - StartCoroutine(currentPanel._myRotationInfoGrid.RepositionNextFrame()); - } - - private Vector3 GetShowPos(ShowRequest showRequest) - { - return DefaultPanelPos + GetBuffWindowOffset(showRequest); - } - - private Vector3 GetBuffWindowOffset(ShowRequest showRequest) - { - switch (showRequest) - { - case ShowRequest.MULLIGAN: - _currentBuffWindowOffset = MULLIGAN_DETAIL; - break; - case ShowRequest.BATTLELOG: - case ShowRequest.DESTROYLOG: - case ShowRequest.DECK_SUMMON_CARD_LIST: - case ShowRequest.FUSION_INFO_CARD_LIST: - _currentBuffWindowOffset = BATTLELOG_DETAIL; - break; - case ShowRequest.BUFF_DETAIL: - if (BattleManagerBase.GetIns().DetailMgr.DetailPanelControl.IsDisplayedRight()) - { - SetScreenPosition(right: true); - _currentBuffWindowOffset = BUFF_LOG_DETAIL_LEFT; - } - else - { - _currentBuffWindowOffset = BUFF_LOG_DETAIL_RIGHT; - } - break; - default: - _currentBuffWindowOffset = Vector3.zero; - break; - } - return _currentBuffWindowOffset; - } - - public bool IsDisplayedRight() - { - UIAnchor component = base.transform.Find("AnchorL").GetComponent(); - if (component != null) - { - return component.side == UIAnchor.Side.TopRight; - } - return false; - } - - private void SetupPanelTouchEvent(ShowRequest showRequest, CardParameter baseParameter) - { - SetDetailKeywordEvents(null, _card, baseParameter, this); - UIEventListener.Get(_buffPanelCollider.gameObject).onClick = null; - if (ShowRequest.EVOLUTION_SELECT != showRequest && _hasKeyword) - { - SetDetailKeywordEvents(battleButtonControl.OnPressKeyBtn, _card, baseParameter, this); - } - } - - public VfxBase ShowEvolutionButton(BattleCardBase card) - { - return InstantVfx.Create(delegate - { - EvoTargetPanel.transform.parent = card.BattleCardView.Transform; - EvoTargetPanel.transform.localPosition = new Vector3(0f, 18.5f, -1f); - EvoTargetPanel.SetActive(value: true); - GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_FRAME_BTN_2, EvoTargetPanel); - EvoTargetPanel.transform.localScale = new Vector3(1.6f, 1.6f, 1.6f); - EvoTargetPanel.transform.localEulerAngles = new Vector3(0f, 0f, 0f); - }); - } - - private void EvolutionConfigSetup(BattleCardBase targetCard, SystemText text, ShowRequest showRequest) - { - UIButton uIButton = (targetCard.IsUnit ? FusionButton : NonFollowerFusionButton); - UILabel uILabel = (targetCard.IsUnit ? _fusionButtonUiLabel : _nonFollowerFusionButtonUiLabel); - UISprite uISprite = (targetCard.IsUnit ? Underline : NonFollowerFusionUnderline); - if (GameMgr.GetIns().IsWatchBattle) - { - uISprite.gameObject.SetActive(value: false); - uIButton.gameObject.SetActive(value: false); - uILabel.gameObject.SetActive(value: false); - EvolutionButton.gameObject.SetActive(value: false); - EvolutionComment.gameObject.SetActive(value: false); - return; - } - if (showRequest == ShowRequest.NORMAL && targetCard.IsInHand && targetCard.SelfBattlePlayer.IsSelfTurn && targetCard.HasFusionSkill) - { - uISprite.gameObject.SetActive(value: true); - uIButton.isEnabled = targetCard.IsFusionable; - uIButton.UpdateColor(instant: true); - uIButton.gameObject.SetActive(value: true); - EvolutionButton.gameObject.SetActive(value: false); - EvolutionComment.gameObject.SetActive(value: false); - return; - } - if (showRequest == ShowRequest.EVOLUTION_SELECT || showRequest == ShowRequest.BATTLELOG || IsDestroyOrDeckCardList(showRequest) || showRequest == ShowRequest.BUFF_DETAIL || showRequest == ShowRequest.FUSION_INFO_CARD_LIST || targetCard.IsEvolution || !targetCard.IsUnit || !targetCard.IsInplay || !targetCard.SelfBattlePlayer.IsSelfTurn || !targetCard.IsPlayer) - { - uISprite.gameObject.SetActive(value: false); - EvolutionButton.gameObject.SetActive(value: false); - EvolutionComment.gameObject.SetActive(value: false); - uIButton.gameObject.SetActive(value: false); - return; - } - EvolutionButton.UpdateColor(instant: true); - uIButton.gameObject.SetActive(value: false); - if (!targetCard.SelfBattlePlayer.NowTurnEvol) - { - uISprite.gameObject.SetActive(value: true); - EvolutionButton.isEnabled = false; - EvolutionButton.gameObject.SetActive(value: true); - EvolutionComment.gameObject.SetActive(value: false); - } - else if (targetCard.SelfBattlePlayer.EvolveWaitTurnCount > 0) - { - uISprite.gameObject.SetActive(value: true); - EvolutionComment.text = text.Get("Battle_0114", targetCard.SelfBattlePlayer.EvolveWaitTurnCount.ToString()); - EvolutionComment.gameObject.SetActive(value: true); - EvolutionButton.gameObject.SetActive(value: false); - } - else if (targetCard.CanEvolution(isSkill: false, isSelfBattlePlayer: true) && targetCard.IsInplay && !_battleMgr.IsStopOperate) - { - uISprite.gameObject.SetActive(value: true); - EvolutionButton.isEnabled = targetCard.AreCanEvolveConditionsFulfilled; - EvolutionButton.gameObject.SetActive(value: true); - EvolutionComment.gameObject.SetActive(value: false); - } - else - { - uISprite.gameObject.SetActive(value: true); - EvolutionButton.isEnabled = false; - EvolutionButton.gameObject.SetActive(value: true); - EvolutionComment.gameObject.SetActive(value: false); - } - } - - public void Hide() - { - StartHide(); - } - - private void StartHide() - { - SetSize(OptionSettingWindow.GetBattleDetailPanelSizePercent()); - if (_battleMgr != null) - { - _battleMgr.BattlePlayer.IsShowBuffDetail = false; - _battleMgr.BattleEnemy.IsShowBuffDetail = false; - if (_card != null) - { - _card.IsShowBuffDetail = false; - } - } - IsShow = false; - _isToGreyTextEnabled = false; - ResetUpdateCardDescriptionFlag(); - this.OnHideOneTime.Call(); - this.OnHideOneTime = null; - RemoveCardEvent(_card); - EvoTargetPanel.SetActive(value: false); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_FRAME_BTN_2); - MainPanel.alpha = 0f; - MainPanel.transform.localPosition = DefaultPanelPos + Vector3.left * 10000f; - iTween.Stop(MainPanel.gameObject); - _buffScrollView.currentMomentum = Vector3.zero; - _card = null; - base.gameObject.SetActive(value: false); - _nonFollowerPanel._scrollView.currentMomentum = new Vector3(0f, 0f, 0f); - _nonFollowerPanel._scrollView.DisableSpring(); - _followerEvoPanel._root.SetActive(value: false); - _nonFollowerPanel._root.SetActive(value: false); - _followerEvoPanel._root.SetActive(value: false); - if ((bool)_nextPanel) - { - _nextPanel.StartHide(); - } - BattleManagerBase.GetIns().DetailMgr.SubDetailPanel.gameObject.SetActive(value: false); - battleButtonControl.HideKeyWordDialog(isNotCloseEvent: false); - } - - private void ResetDetailPosition() - { - FollowerPanel.transform.localPosition = DefaultNorPanelPos; - EvoPanel.transform.localPosition = DefaultEvoPanelPos; - } - - private void AddBuffInfo(BattleCardBase targetCard, ShowRequest request, List myRotationBonusList, List bossRushSpecialSkillList, AvatarBattleInfo avatarBattleInfo) - { - if (_card != null) - { - SetupAllBuffPanel(targetCard, GetBuffWindowOffset(request).y, myRotationBonusList, bossRushSpecialSkillList, avatarBattleInfo, isUpdate: false, IsChoiceBraveRequest(request)); - } - } - - public void UpdateBuffInfo(BattleCardBase targetCard, List myRotationBonusList) - { - if (!IsShow) - { - return; - } - List bossRushSkillList = new List(); - AvatarBattleInfo avatarBattleInfo = null; - if (targetCard.IsClass) - { - bossRushSkillList = targetCard.SelfBattlePlayer.BossRushSpecialSkillList.Distinct().ToList(); - avatarBattleInfo = ((!targetCard.SelfBattlePlayer.IsPlayer) ? _battleMgr.BattleEnemy.AvatarBattleInfo : _battleMgr.BattlePlayer.AvatarBattleInfo); - } - if ((GameMgr.GetIns().IsNewReplayBattle ? (targetCard.ReplayBuffInfoList.Count == 0) : (targetCard.BuffInfoList.Count == 0)) && myRotationBonusList.Count == 0 && avatarBattleInfo == null) - { - _buffRootWidget.gameObject.SetActive(value: false); - return; - } - if (!_buffRootWidget.gameObject.activeSelf) - { - _buffRootWidget.gameObject.SetActive(value: true); - } - SetupAllBuffPanel(targetCard, _currentBuffWindowOffset.y, myRotationBonusList, bossRushSkillList, avatarBattleInfo, isUpdate: true, avatarBattleInfo != null); - } - - public void UpdateLogItemBuffInfo(BattleCardBase targetCard) - { - List list = targetCard.ReplayBuffInfoList.Where((BuffInfo b) => b.IsCopied).ToList(); - for (int num = 0; num < list.Count; num++) - { - BuffInfo buffInfo = list[num]; - BattleLogItem logFromCacheLogList = GetLogFromCacheLogList(buffInfo, (!buffInfo.IsCopiedEvolutionSkill) ? BattleLogItem.CardTextureOption.ForceNormal : BattleLogItem.CardTextureOption.ForceEvolution, buffInfo.DivergenceId, checkActive: false); - if (logFromCacheLogList != null) - { - logFromCacheLogList.SetBuff(buffInfo); - } - } - } - - private void MakeCardLogItem(BuffInfo buff, Transform contentsParent, ref ItemCursor itemCursor) - { - if (buff.IsHiddenClassLogSkill) - { - return; - } - BattleCardBase battleCardBase = buff.OwnerCard; - bool flag = (buff.IsCopied && buff.IsCopiedEvolutionSkill) || (!buff.IsCopied && buff.IsEvolutionSkill); - if (battleCardBase.IsClass) - { - flag = battleCardBase.SelfBattlePlayer.IsSkinEvolved; - } - BattleLogItem.CardTextureOption textureOption = ((!flag) ? BattleLogItem.CardTextureOption.ForceNormal : BattleLogItem.CardTextureOption.ForceEvolution); - string divergenceId = string.Empty; - if (buff.SkillFrom != null || GameMgr.GetIns().IsNewReplayBattle) - { - divergenceId = buff.DivergenceId; - } - BattleLogItem battleLogItem = GetLogFromCacheLogList(buff, textureOption, divergenceId); - if (battleLogItem == null) - { - if (_cacheLogList.Count > 50) - { - for (int num = _cacheLogList.Count - 1; num >= 0; num--) - { - BattleLogItem battleLogItem2 = _cacheLogList[num]; - if (!battleLogItem2.gameObject.activeSelf) - { - UnityEngine.Object.Destroy(battleLogItem2.gameObject); - _cacheLogList.RemoveAt(num); - } - } - } - bool? isPlayer = null; - if (buff.IsCopied && buff.SkillFrom != null) - { - isPlayer = buff.IsPlayer; - } - if (buff.PreviousOwner != null) - { - battleCardBase = buff.PreviousOwner; - } - if (buff.IsSaveBurialRiteSkill || buff.IsGetonSkill || buff.IsReserveTokenDrawSkill) - { - battleCardBase = ((!GameMgr.GetIns().IsNewReplayBattle) ? battleCardBase.SelfBattlePlayer.BattleMgr.CreateTransformCardRegisterVfx(battleCardBase, buff.BaseCardIDFrom, _card.IsPlayer) : buff.TargetCard); - } - battleLogItem = BattleLogManager.CreateBuffLogItem(battleCardBase, battleCardBase, buff, isPlayer, buff.IsReserveTokenDrawSkill, textureOption, buff.CardIDFrom); - if (buff.IsReserveTokenDrawSkill) - { - battleLogItem.UpdateLogType(Wizard.Battle.UI.LogType.ReserveToken); - } - battleLogItem.SetLogSkill(buff.SkillFrom); - _cacheLogList.Add(battleLogItem); - } - else if (GameMgr.GetIns().IsNewReplayBattle && buff.IsCopied) - { - battleLogItem.SetBuff(buff); - } - battleLogItem.transform.SetParent(contentsParent); - battleLogItem.transform.localScale = Vector3.one; - battleLogItem.SetDivergenceId(divergenceId); - float y = itemCursor.AddAndGetCenterOffset(47f); - battleLogItem.transform.localPosition = new Vector3(buff.IsReserveTokenDrawSkill ? battleLogItem.GetPosX() : 0f, y, 0f); - battleLogItem.gameObject.SetActive(value: true); - _drawLogList.Add(battleLogItem.gameObject); - battleLogItem.SetSelectSpriteActive(setActive: false); - } - - private BattleLogItem GetLogFromCacheLogList(BuffInfo buff, BattleLogItem.CardTextureOption textureOption, string divergenceId, bool checkActive = true) - { - return _cacheLogList.FirstOrDefault(delegate(BattleLogItem cache) - { - if (cache.gameObject.activeSelf && checkActive) - { - return false; - } - bool flag = cache.IsCopiedBuff(); - if (buff.IsCopied != flag) - { - return false; - } - BattleCardBase card = cache.GetCard(); - if (buff.IsCopied && buff.PreviousOwner != null && buff.PreviousOwner == card && _card.IsPlayer != cache.IsPlayer && cache.GetTextureOption() == textureOption && buff.OwnerCard == cache.Buff.OwnerCard) - { - return true; - } - bool flag2 = (buff.IsGetonSkill || buff.IsSaveBurialRiteSkill || buff.IsReserveTokenDrawSkill) && cache.GetLogSkill() == buff.SkillFrom && card.BaseParameter.CardId == buff.BaseCardIDFrom && cache.GetTextureOption() == textureOption; - if (GameMgr.GetIns().IsNewReplayBattle) - { - if (buff.IsReserveTokenDrawSkill) - { - flag2 &= buff.TargetCard != null && buff.TargetCard == card; - } - else if (buff.IsGetonSkill || buff.IsSaveBurialRiteSkill) - { - flag2 &= buff.IsPlayer == cache.IsPlayer; - } - } - if (flag2) - { - return true; - } - if (buff.IsReserveTokenDrawSkill) - { - return false; - } - return !buff.IsCopied && card == buff.OwnerCard && card.IsPlayer == cache.IsPlayer && cache.GetTextureOption() == textureOption && cache.DivergenceId == divergenceId && cache.GetBuffMomentCardId() == buff.CardIDFrom; - }); - } - - private void MakeCardLogItemNoConsumeEp(BattleCardBase card, Transform contentsParent, ref ItemCursor itemCursor) - { - BattleLogItem.CardTextureOption textureOption = ((!card.IsEvolution) ? BattleLogItem.CardTextureOption.ForceNormal : BattleLogItem.CardTextureOption.ForceEvolution); - BattleLogItem battleLogItem = BattleLogManager.CreateBuffLogItem(card, card, null, card.IsPlayer, useSmall: false, textureOption); - battleLogItem.UpdateLogType(Wizard.Battle.UI.LogType.NotConsumeEp); - battleLogItem.transform.SetParent(contentsParent); - battleLogItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(47f); - battleLogItem.transform.localPosition = new Vector3(0f, y, 0f); - battleLogItem.gameObject.SetActive(value: true); - _drawLogList.Add(battleLogItem.gameObject); - battleLogItem.SetSelectSpriteActive(setActive: false); - } - - private void MakeMyRotationBonusItem(BattleCardBase classCard, BattlePlayerBase.MyRotationBonusCondition myRotationBonusCondition, bool needSeparator, ref ItemCursor itemCursor) - { - MyRotationBonusItem myRotationBonusItem = _cacheMyRotationLogList.FirstOrDefault(delegate(MyRotationBonusItem cache) - { - if (cache.gameObject.activeSelf) - { - return false; - } - return myRotationBonusCondition.MyRotationBonus.AbilityId == cache.MyRotationBonusCondition.MyRotationBonus.AbilityId && classCard.IsPlayer == cache.IsPlayer; - }); - if (myRotationBonusItem == null) - { - if (_cacheLogList.Count > 50) - { - for (int num = _cacheLogList.Count - 1; num >= 0; num--) - { - BattleLogItem battleLogItem = _cacheLogList[num]; - if (!battleLogItem.gameObject.activeSelf) - { - UnityEngine.Object.Destroy(battleLogItem.gameObject); - _cacheLogList.RemoveAt(num); - } - } - } - myRotationBonusItem = BattleLogManager.CreateMyRotationBonusItem(myRotationBonusCondition, classCard.IsPlayer, needSeparator); - _cacheMyRotationLogList.Add(myRotationBonusItem); - } - else - { - myRotationBonusItem.setIconActive(); - } - myRotationBonusItem.transform.SetParent(_myRotationBonusContentsParent); - myRotationBonusItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(54f); - myRotationBonusItem.transform.localPosition = new Vector3(0f, y, 0f); - myRotationBonusItem.gameObject.SetActive(value: true); - _drawLogList.Add(myRotationBonusItem.gameObject); - } - - private bool IsSameBuffLog(BuffInfo buffA, BuffInfo buffB) - { - if (buffA.IsCopied != buffB.IsCopied) - { - return false; - } - if (buffA.IsCopied) - { - return buffA.PreviousOwner == buffB.PreviousOwner; - } - BattleCardBase ownerCard = buffA.SkillFrom.SkillPrm.ownerCard; - BattleCardBase ownerCard2 = buffB.SkillFrom.SkillPrm.ownerCard; - if (!ownerCard.EquelsID(ownerCard2)) - { - return false; - } - if (ownerCard.CardId != buffA.CardIDFrom && buffA.CardIDFrom != buffB.CardIDFrom) - { - return false; - } - if (ownerCard.IsChoiceBraveSkillCard || ownerCard2.IsChoiceBraveSkillCard) - { - return ownerCard == ownerCard2; - } - if (buffA.PreviousOwner != null && buffB.PreviousOwner != null) - { - return buffA.PreviousOwner.CardId == buffB.PreviousOwner.CardId; - } - return buffA.PreviousOwner == buffB.PreviousOwner; - } - - private float SetupBuffContent(BattleCardBase targetCard, Transform contentsParent, ref ItemCursor itemCursor) - { - List buffInfoList = targetCard.BuffInfoList; - List source = ((!GameMgr.GetIns().IsNewReplayBattle) ? GetDistinctBuffList(buffInfoList) : targetCard.ReplayBuffInfoList); - if (GameMgr.GetIns().IsNewReplayBattle) - { - for (int i = 0; i < targetCard.ReplayNoConsumeEpBuffInfoNameList.Count; i++) - { - MakeCardLogItemNoConsumeEp(targetCard.ReplayNoConsumeEpBuffInfoNameList[i], contentsParent, ref itemCursor); - } - } - else if (IsNeedNoConsumeEp(targetCard)) - { - IEnumerable source2 = targetCard.SelfBattlePlayer.InPlayCards.Where((BattleCardBase c) => c.SkillApplyInformation.NotConsumeEpModifierInfoList.Any((NotConsumeEpModifierInfo b) => b.TargetCard == null && b.CheckNotConsumedCard(targetCard))); - for (int num = 0; num < source2.Count(); num++) - { - MakeCardLogItemNoConsumeEp(source2.ElementAt(num), contentsParent, ref itemCursor); - } - } - List list = source.Where((BuffInfo b) => !b.IsCopied && !b.IsSaveBurialRiteSkill && !b.IsGetonSkill && b.SpecialSkillInfo == null).ToList(); - for (int num2 = 0; num2 < list.Count; num2++) - { - MakeCardLogItem(list[num2], contentsParent, ref itemCursor); - } - List list2 = source.Where((BuffInfo b) => b.IsCopied).ToList(); - if (list2.Count > 0) - { - MakeHeadlineLabel(ref _copiedLabel, Data.SystemText.Get("BattleLog_0266"), contentsParent, ref itemCursor); - MakeLogItems(list2, contentsParent, ref itemCursor); - } - List list3 = source.Where((BuffInfo b) => b.IsSaveBurialRiteSkill).ToList(); - if (list3.Count > 0) - { - MakeHeadlineLabel(ref _saveBurialRiteLabel, Data.SystemText.Get("BattleLog_0269"), contentsParent, ref itemCursor); - MakeLogItems(list3, contentsParent, ref itemCursor); - } - List list4 = source.Where((BuffInfo b) => b.IsGetonSkill).ToList(); - if (list4.Count > 0) - { - MakeHeadlineLabel(ref _getonCardLabel, Data.SystemText.Get("BattleLog_0272"), contentsParent, ref itemCursor); - MakeLogItems(list4, contentsParent, ref itemCursor); - } - if ((!GameMgr.GetIns().IsNewReplayBattle) ? BuffDetailInfoUI.NeedBuffDetailText(targetCard) : (targetCard.ReplayBuffInfoLabelList.Count > 0)) - { - if (_buffDetailInfoUI == null) - { - _buffDetailInfoUI = (UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Log/SkillDetailLabel")) as GameObject).GetComponent(); - _buffDetailInfoUI.Initialize(); - } - _buffDetailInfoUI.gameObject.SetActive(value: true); - _buffDetailInfoUI.transform.SetParent(contentsParent); - _buffDetailInfoUI.transform.localScale = Vector3.one; - _drawLogList.Add(_buffDetailInfoUI.gameObject); - if (GameMgr.GetIns().IsNewReplayBattle) - { - _buffDetailInfoUI.SetBuffDetailLabelInReplay(targetCard.ReplayBuffInfoLabelList, targetCard); - } - else - { - _buffDetailInfoUI.SetBuffDetailLabel(targetCard); - } - float y = itemCursor.AddAndGetTopOffset(_buffDetailInfoUI.Height); - _buffDetailInfoUI.transform.localPosition = new Vector3(0f, y, 0f); - } - return itemCursor.Height; - } - - public List GetDistinctBuffList(List buffInfoList) - { - List list = new List(); - int i; - for (i = 0; i < buffInfoList.Count; i++) - { - if (buffInfoList[i].IsReserveTokenDrawSkill) - { - BuffInfo buffInfo = list.LastOrDefault(); - if (buffInfo == null || buffInfoList[i].SkillFrom.GetAttachSkill == null || buffInfo.SkillFrom.SkillPrm.ownerCard.Index == buffInfoList[i].SkillFrom.GetAttachSkill.SkillPrm.ownerCard.Index || (buffInfo.SkillFrom.GetAttachSkill != null && buffInfo.SkillFrom.GetAttachSkill.SkillPrm.ownerCard.Index == buffInfoList[i].SkillFrom.GetAttachSkill.SkillPrm.ownerCard.Index && buffInfo.SkillFrom.HasIndividualId)) - { - list.Add(buffInfoList[i]); - continue; - } - BuffInfo buffInfo2 = list.LastOrDefault((BuffInfo b) => b.SkillFrom.SkillPrm.ownerCard.Index == buffInfoList[i].SkillFrom.GetAttachSkill.SkillPrm.ownerCard.Index || (b.SkillFrom.GetAttachSkill != null && b.SkillFrom.GetAttachSkill.SkillPrm.ownerCard.Index == buffInfoList[i].SkillFrom.GetAttachSkill.SkillPrm.ownerCard.Index && b.SkillFrom.HasIndividualId)); - if (buffInfo2 == null) - { - buffInfo2 = list.LastOrDefault((BuffInfo b) => b.IsReserveTokenDrawSkill || b.SkillFrom.SkillPrm.ownerCard.BaseParameter.BaseCardId == buffInfoList[i].SkillFrom.SkillPrm.ownerCard.BaseParameter.BaseCardId); - } - list.Insert(list.IndexOf(buffInfo2) + 1, buffInfoList[i]); - } - else if ((!(buffInfoList[i].SkillFrom is Skill_token_draw_modifier) || !list.Any((BuffInfo b) => b.BaseCardIDFrom == buffInfoList[i].BaseCardIDFrom)) && !list.Any((BuffInfo b) => IsSameBuffLog(b, buffInfoList[i]))) - { - list.Add(buffInfoList[i]); - } - } - return list; - } - - public List GetBuffDetailLabel(BattleCardBase card) - { - List list = new List(); - if (!BuffDetailInfoUI.NeedBuffDetailText(card)) - { - return list; - } - List allBuffSkills = BuffDetailInfoUI.GetAllBuffSkills(card, card.BuffInfoList.Select((BuffInfo b) => b.SkillFrom).ToList()); - if (card.Cost != card.BaseCost) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Cost)); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_powerup || s is Skill_power_down) && (card.GetCurrentAtkBuff() != 0 || card.GetCurrentLifeBuff() != 0)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.StatusBuff)); - } - bool flag = false; - if (allBuffSkills.Any((SkillBase s) => s is Skill_quick && (!card.IsInHand || s.OnWhenPlayStart == 0))) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Quick)); - flag = true; - } - bool flag2 = false; - if (allBuffSkills.Any((SkillBase s) => s is Skill_rush && (!card.IsInHand || s.OnWhenPlayStart == 0))) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Rush)); - flag2 = true; - } - bool flag3 = false; - if (allBuffSkills.Any((SkillBase s) => s is Skill_killer && (!card.IsInHand || s.OnWhenPlayStart == 0))) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Killer)); - flag3 = true; - } - bool flag4 = false; - if (allBuffSkills.Any((SkillBase s) => s is Skill_drain && (!card.IsInHand || s.OnWhenPlayStart == 0))) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Drain)); - flag4 = true; - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_attack_count && (!card.IsInHand || s.OnWhenPlayStart == 0))) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.AttackCount, card.MaxAttackableCount)); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_ignore_guard && (!card.IsInHand || s.OnWhenPlayStart == 0))) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.IgnoreGuard)); - } - if (allBuffSkills.Any((SkillBase s) => s is Skill_consume_ep_modifier && (!card.IsInHand || s.OnWhenPlayStart == 0)) || BuffDetailInfoUI.NeedNoConsumeEpText(card)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.ConsumeEpModifier)); - } - if (BuffDetailInfoUI.ExistCopiedSkillNeedDetailText(card)) - { - IEnumerable source = card.BuffInfoList.Where((BuffInfo b) => b.IsCopied); - for (int num = 0; num < source.Count(); num++) - { - if (!(source.ElementAt(num).SkillFrom is SkillBaseCopy skillBaseCopy)) - { - continue; - } - switch (skillBaseCopy.SkillType) - { - case "rush": - if (!flag2) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Rush)); - } - break; - case "quick": - if (!flag) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Quick)); - } - break; - case "killer": - if (!flag3) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Killer)); - } - break; - case "drain": - if (!flag4) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.Drain)); - } - break; - } - } - } - IEnumerable source2 = from s in allBuffSkills - where s is Skill_shield && (!card.IsInHand || s.OnWhenPlayStart == 0) - select (Skill_shield)s; - if (source2.Any()) - { - if (source2.Any((Skill_shield s) => s.IsAllDamageShield)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageShield)); - } - if (source2.Any((Skill_shield s) => s.IsNextDamageShield)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageShield)); - } - if (source2.Any((Skill_shield s) => s.IsSkillDamageShield)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageShield)); - } - if (source2.Any((Skill_shield s) => s.IsSpellDamageShield)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.SpellDamageShield)); - } - } - List source3 = (from s in allBuffSkills - where s is Skill_damage_cut && (!card.IsInHand || s.OnWhenPlayStart == 0) - select (Skill_damage_cut)s).ToList(); - if (source3.Any()) - { - if (source3.Any((Skill_damage_cut s) => s.IsAllDamageCut)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageCut, source3.Where((Skill_damage_cut s) => s.IsAllDamageCut).Sum((Skill_damage_cut s) => s.CutAmount))); - } - if (source3.Any((Skill_damage_cut s) => s.IsNextDamageCut)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageCut, source3.Where((Skill_damage_cut s) => s.IsNextDamageCut).Sum((Skill_damage_cut s) => s.CutAmount))); - } - if (source3.Any((Skill_damage_cut s) => s.IsSkillDamageCut)) - { - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageCut, source3.Where((Skill_damage_cut s) => s.IsSkillDamageCut).Sum((Skill_damage_cut s) => s.CutAmount))); - } - if (source3.Any((Skill_damage_cut s) => s.IsDamageClipping)) - { - List list2 = (from s in source3 - where s.ClippingMax != int.MaxValue - select s.ClippingMax).ToList(); - list2.AddRange(from s in source3 - where s.LifeLowerLimit != -1 - select s.SkillPrm.ownerCard.Life - 1); - list.Add(new NetworkBattleReceiver.ReplayBuffInfoLabel(NetworkBattleReceiver.ReplayBuffInfoTextType.DamageClipping, list2.Min())); - } - } - return list; - } - - private float SetupMyRotationBonusContent(BattleCardBase targetCard, List myRotationBonusList) - { - ItemCursor itemCursor = new ItemCursor(0f); - if (myRotationBonusList != null) - { - for (int i = 0; i < myRotationBonusList.Count; i++) - { - MakeMyRotationBonusItem(targetCard, myRotationBonusList[i], i > 0, ref itemCursor); - } - } - return itemCursor.Height; - } - - private float SetupAvatarBattleBonusContent(BattleCardBase targetCard, AvatarBattleInfo avatarBattleInfo) - { - ItemCursor itemCursor = new ItemCursor(0f); - if (avatarBattleInfo == null) - { - return itemCursor.Height; - } - MakeAvatarBattleBonusTitleLogItem(Data.SystemText.Get("Battle_0522"), isBuffTitle: false, ref itemCursor); - AvatarBattleInfo.AvatarBattleBonus bonus = avatarBattleInfo.Bonus; - string allAbilityDesc = bonus.PassiveAbilityDesc + string.Join("", bonus.AbilityDesc); - MakeAvatarBattlePassiveBonusLogItem(targetCard, allAbilityDesc, ref itemCursor); - for (int i = 0; i < targetCard.SelfBattlePlayer.ChoiceBraveSkillDescInfoList.Count(); i++) - { - bool isNeedSeparator = _battleMgr.BattlePlayer.BattleView.IsShowCantChoiceBraveText || bonus.PassiveAbilityDesc != string.Empty || i != 0; - MakeAvatarBattleBonusLogItem(targetCard.SelfBattlePlayer.ChoiceBraveSkillDescInfoList[i], allAbilityDesc, isNeedSeparator, targetCard, ref itemCursor); - } - if (CurrentShowRequest == ShowRequest.CHOICE_BRAVE_AND_BUFF) - { - string buffTitleText = Data.SystemText.Get("Battle_0495"); - ItemCursor itemCursor2 = itemCursor.Clone(); - MakeAvatarBattleBonusTitleLogItem(buffTitleText, isBuffTitle: true, ref itemCursor); - float height = itemCursor.Height; - SetupBuffContent(targetCard, _avatarBattleBonusContentsParent, ref itemCursor); - if (itemCursor.Height - height <= 0f) - { - _cacheAvatarBattleTitleList.FirstOrDefault((AvatarBattleTitleItem cache) => cache.TitleText == buffTitleText).gameObject.SetActive(value: false); - itemCursor = itemCursor2; - } - } - return itemCursor.Height; - } - - private float MakeAvatarBattleBonusTitleLogItem(string titleText, bool isBuffTitle, ref ItemCursor itemCursor) - { - AvatarBattleTitleItem avatarBattleTitleItem = _cacheAvatarBattleTitleList.FirstOrDefault((AvatarBattleTitleItem cache) => cache.TitleText == titleText); - if (avatarBattleTitleItem == null) - { - avatarBattleTitleItem = ((!isBuffTitle) ? BattleLogManager.CreateAvatarBattleBonusTitleItem(titleText, _avatarBattleBonusScrollView) : BattleLogManager.CreateAvatarBattleBuffTitleItem(titleText, _avatarBattleBonusScrollView)); - _cacheAvatarBattleTitleList.Add(avatarBattleTitleItem); - } - avatarBattleTitleItem.transform.SetParent(_avatarBattleBonusContentsParent); - avatarBattleTitleItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(avatarBattleTitleItem.Height); - avatarBattleTitleItem.transform.localPosition = new Vector3(0f, y, 0f); - avatarBattleTitleItem.gameObject.SetActive(value: true); - _drawLogList.Add(avatarBattleTitleItem.gameObject); - return itemCursor.Height; - } - - private float MakeAvatarBattleBonusLogItem(BattlePlayerBase.AvatarBattleDescInfo skillDescInfo, string allAbilityDesc, bool isNeedSeparator, BattleCardBase targetCard, ref ItemCursor itemCursor) - { - AvatarBattleBonusItem avatarBattleBonusItem = _cacheAvatarBattleBonusList.FirstOrDefault((AvatarBattleBonusItem cache) => cache.SkillDescInfo == skillDescInfo); - if (avatarBattleBonusItem == null) - { - avatarBattleBonusItem = BattleLogManager.CreateAvatarBattleBonusItem(skillDescInfo, _avatarBattleBonusScrollView, isNeedSeparator, targetCard); - if (BattleKeywordInfoListMgr.GetKeywords(allAbilityDesc).Any((string word) => Data.Master.BattleKeyWordDic.ContainsKey(word))) - { - UIEventListener.Get(avatarBattleBonusItem.DescLabel.gameObject).onClick = delegate(GameObject obj) - { - battleButtonControl.OnPressKeyBtn(allAbilityDesc, obj); - }; - BattlePlayerView.SetKeyWordColor(avatarBattleBonusItem.DescLabel.gameObject, avatarBattleBonusItem.DescLabel); - } - _cacheAvatarBattleBonusList.Add(avatarBattleBonusItem); - } - else - { - avatarBattleBonusItem.SetText(targetCard, isNeedSeparator); - } - avatarBattleBonusItem.transform.SetParent(_avatarBattleBonusContentsParent); - avatarBattleBonusItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(avatarBattleBonusItem.Height); - avatarBattleBonusItem.transform.localPosition = new Vector3(0f, y, 0f); - avatarBattleBonusItem.gameObject.SetActive(value: true); - _drawLogList.Add(avatarBattleBonusItem.gameObject); - return itemCursor.Height; - } - - private float MakeAvatarBattlePassiveBonusLogItem(BattleCardBase targetCard, string allAbilityDesc, ref ItemCursor itemCursor) - { - BattlePlayerBase.AvatarBattleDescInfo passiveSkillDescInfo = targetCard.SelfBattlePlayer.AvatarBattlePassiveSkillDescInfo; - if (!_battleMgr.BattlePlayer.BattleView.IsShowCantChoiceBraveText && (passiveSkillDescInfo == null || passiveSkillDescInfo.DescText == string.Empty)) - { - return itemCursor.Height; - } - AvatarBattlePassiveBonusItem avatarBattlePassiveBonusItem = _cacheAvatarBattlePassiveBonusList.FirstOrDefault((AvatarBattlePassiveBonusItem cache) => cache.SkillDescInfo == passiveSkillDescInfo); - if (avatarBattlePassiveBonusItem == null) - { - avatarBattlePassiveBonusItem = BattleLogManager.CreateAvatarBattlePassiveBonusItem(passiveSkillDescInfo, targetCard, _avatarBattleBonusScrollView); - if (BattleKeywordInfoListMgr.GetKeywords(allAbilityDesc).Any((string word) => Data.Master.BattleKeyWordDic.ContainsKey(word))) - { - UIEventListener.Get(avatarBattlePassiveBonusItem.DescLabel.gameObject).onClick = delegate(GameObject obj) - { - battleButtonControl.OnPressKeyBtn(allAbilityDesc, obj); - }; - BattlePlayerView.SetKeyWordColor(avatarBattlePassiveBonusItem.DescLabel.gameObject, avatarBattlePassiveBonusItem.DescLabel); - } - _cacheAvatarBattlePassiveBonusList.Add(avatarBattlePassiveBonusItem); - } - else - { - avatarBattlePassiveBonusItem.SetText(targetCard); - } - avatarBattlePassiveBonusItem.transform.SetParent(_avatarBattleBonusContentsParent); - avatarBattlePassiveBonusItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(avatarBattlePassiveBonusItem.DescLabel.height); - avatarBattlePassiveBonusItem.transform.localPosition = new Vector3(0f, y, 0f); - avatarBattlePassiveBonusItem.gameObject.SetActive(value: true); - _drawLogList.Add(avatarBattlePassiveBonusItem.gameObject); - return itemCursor.Height; - } - - private float SetupBossRushSpecialSkillContent(BattleCardBase targetCard, List bossRushSpecialSkillList) - { - ItemCursor itemCursor = new ItemCursor(0f); - for (int i = 0; i < bossRushSpecialSkillList.Count(); i++) - { - if (targetCard.SelfBattlePlayer.IsPlayer) - { - MakePlayerBossRushSpecialSkillLogItem(targetCard, bossRushSpecialSkillList.ElementAt(i), ref itemCursor); - } - else - { - MakeEnemyBossRushSpecialSkillLogItem(targetCard, bossRushSpecialSkillList.ElementAt(i), ref itemCursor); - } - } - return itemCursor.Height; - } - - private void MakePlayerBossRushSpecialSkillLogItem(BattleCardBase classCard, BossRushSpecialSkill bossRushSpecialSkill, ref ItemCursor itemCursor) - { - BattleLogItem battleLogItem = _cachePlayerBossRushSkillList.FirstOrDefault((BattleLogItem cache) => cache.BossRushSpecialSkill != null && cache.BossRushSpecialSkill.OriginalCardId == bossRushSpecialSkill.OriginalCardId); - if (battleLogItem == null) - { - if (_cacheLogList.Count + _cachePlayerBossRushSkillList.Count > 50) - { - for (int num = _cachePlayerBossRushSkillList.Count - 1; num >= 0; num--) - { - BattleLogItem battleLogItem2 = _cachePlayerBossRushSkillList[num]; - if (!battleLogItem2.gameObject.activeSelf) - { - UnityEngine.Object.Destroy(battleLogItem2.gameObject); - _cacheLogList.RemoveAt(num); - } - } - } - BuffInfo buffInfo = classCard.BuffInfoList.FirstOrDefault((BuffInfo b) => b.SpecialSkillInfo.OriginalCardId == bossRushSpecialSkill.OriginalCardId); - if (buffInfo != null) - { - battleLogItem = BattleLogManager.CreateBossRushPlayerSpecialSkillLogItem(buffInfo.SkillFrom.SkillPrm.ownerCard, bossRushSpecialSkill); - } - _cachePlayerBossRushSkillList.Add(battleLogItem); - } - battleLogItem.transform.SetParent(_bossRushSpecialSkillContentsParent); - battleLogItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(47f); - battleLogItem.transform.localPosition = new Vector3(0f, y, 0f); - battleLogItem.gameObject.SetActive(value: true); - _drawLogList.Add(battleLogItem.gameObject); - battleLogItem.SetSelectSpriteActive(setActive: false); - } - - private void MakeEnemyBossRushSpecialSkillLogItem(BattleCardBase classCard, BossRushSpecialSkill bossRushSpecialSkill, ref ItemCursor itemCursor) - { - BossRushEnemySpecialSkillItem bossRushEnemySpecialSkillItem = _cacheEnemyBossRushSkillList.FirstOrDefault((BossRushEnemySpecialSkillItem cache) => cache.BossRushSpecialSkill != null && cache.BossRushSpecialSkill.OriginalCardId == bossRushSpecialSkill.OriginalCardId); - if (bossRushEnemySpecialSkillItem == null) - { - BuffInfo buffInfo = classCard.BuffInfoList.FirstOrDefault((BuffInfo b) => b.SpecialSkillInfo.OriginalCardId == bossRushSpecialSkill.OriginalCardId); - if (buffInfo != null) - { - bossRushEnemySpecialSkillItem = BattleLogManager.CreateEnemyBossRushSpecialSkillLogItem(buffInfo.SkillFrom.SkillPrm.ownerCard, bossRushSpecialSkill); - if (BattleKeywordInfoListMgr.GetKeywords(bossRushSpecialSkill.SkillDescText).Any((string word) => Data.Master.BattleKeyWordDic.ContainsKey(word))) - { - UIEventListener.Get(bossRushEnemySpecialSkillItem.DescLabel.gameObject).onClick = delegate(GameObject obj) - { - battleButtonControl.OnPressKeyBtn(bossRushSpecialSkill.SkillDescText, obj); - }; - BattlePlayerView.SetKeyWordColor(bossRushEnemySpecialSkillItem.DescLabel.gameObject, bossRushEnemySpecialSkillItem.DescLabel); - } - } - _cacheEnemyBossRushSkillList.Add(bossRushEnemySpecialSkillItem); - } - bossRushEnemySpecialSkillItem.transform.SetParent(_bossRushSpecialSkillContentsParent); - bossRushEnemySpecialSkillItem.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetCenterOffset(bossRushEnemySpecialSkillItem.DescLabel.height); - bossRushEnemySpecialSkillItem.transform.localPosition = new Vector3(0f, y, 0f); - bossRushEnemySpecialSkillItem.gameObject.SetActive(value: true); - _drawLogList.Add(bossRushEnemySpecialSkillItem.gameObject); - } - - public static bool IsNeedNoConsumeEp(BattleCardBase targetCard) - { - if (targetCard.SelfBattlePlayer.CheckNotConsumeEpCard(targetCard)) - { - return targetCard.SelfBattlePlayer.InPlayCards.Any((BattleCardBase c) => c.SkillApplyInformation.NotConsumeEpModifierInfoList.Any((NotConsumeEpModifierInfo b) => b.TargetCard == null && b.CheckNotConsumedCard(targetCard))); - } - return false; - } - - private void MakeHeadlineLabel(ref GameObject labelObject, string labelText, Transform contentsParent, ref ItemCursor itemCursor) - { - if (labelObject == null) - { - labelObject = UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Log/AdvancedSkillLabel")) as GameObject; - labelObject.GetComponentInChildren().text = labelText; - } - labelObject.SetActive(value: true); - labelObject.transform.SetParent(contentsParent); - labelObject.transform.localScale = Vector3.one; - float y = itemCursor.AddAndGetTopOffset(44f); - labelObject.transform.localPosition = new Vector3(0f, y, 0f); - _drawLogList.Add(labelObject); - } - - private void MakeLogItems(List buffList, Transform contentsParent, ref ItemCursor itemCursor) - { - for (int i = 0; i < buffList.Count; i++) - { - MakeCardLogItem(buffList[i], contentsParent, ref itemCursor); - } - } - - private float SetupMyRotationBonusPanel(BattleCardBase targetCard, List myRotationBonusList, bool hasLowerContents) - { - float num = SetupMyRotationBonusContent(targetCard, myRotationBonusList); - bool flag = num > 0f; - _myRotationBonusContentsPanel.gameObject.SetActive(flag); - _myRotationBonusBorderLine.gameObject.SetActive(hasLowerContents); - if (!flag) - { - return num; - } - _myRotationBonusTitleLabel.text = Data.SystemText.Get("Battle_0518"); - num -= _myRotationBonusContentsParent.localPosition.y; - if (hasLowerContents) - { - _myRotationBonusBorderLine.transform.localPosition = new Vector3(0f, 0f - num - 6f); - num += (float)_myRotationBonusBorderLine.height + 6f; - } - return num; - } - - private float SetupAvatarBattleBonusPanel(BattleCardBase targetCard, AvatarBattleInfo avatarBattleInfo, bool isShowAvatarBattleBonus) - { - float num = SetupAvatarBattleBonusContent(targetCard, avatarBattleInfo); - bool num2 = num > 0f; - _avatarBattleBonusContentsPanel.gameObject.SetActive(isShowAvatarBattleBonus); - if (!num2 || !isShowAvatarBattleBonus) - { - return 0f; - } - _avatarBattleBonusBPDescriptionLabel.text = Data.SystemText.Get("Battle_0523"); - Vector3 localPosition = _avatarBattleBonusBPDescriptionLabel.transform.localPosition; - Vector3 localPosition2 = _avatarBattleBonusBPSprite.transform.localPosition; - _avatarBattleBonusBPDescriptionLabel.transform.localPosition = new Vector3((float)_avatarBattleBonusBPDescriptionLabel.width / 2f, localPosition.y, localPosition.z); - _avatarBattleBonusBPSprite.transform.localPosition = new Vector3((float)_avatarBattleBonusBPDescriptionLabel.width + (float)_avatarBattleBonusBPSprite.width / 2f, localPosition2.y, localPosition2.z); - _avatarBattleBonusBPLabel.text = targetCard.SelfBattlePlayer.Bp.ToString(); - return num; - } - - private float SetupBossRushSkillPanel(BattleCardBase targetCard, List bossRushSpecialSkillList, float upperContentsHeight, bool hasLowerContents) - { - float num = SetupBossRushSpecialSkillContent(targetCard, bossRushSpecialSkillList); - bool flag = num > 0f; - _bossRushSpecialSkillContentsPanel.gameObject.SetActive(flag); - if (!flag) - { - return num; - } - _bossRushSpecialSkillTitleLabel.text = Data.SystemText.Get(_card.SelfBattlePlayer.IsPlayer ? "BossRush_0029" : "BossRush_0028"); - num -= _bossRushSpecialSkillContentsParent.localPosition.y; - _bossRushSpecialSkillContentsPanel.transform.localPosition = new Vector3(0f, 0f - upperContentsHeight); - if (hasLowerContents) - { - num += 6f; - } - return num; - } - - private float SetupBuffSkillPanel(BattleCardBase targetCard, float upperContentsHeight, bool isShowAvatarBattleBonus) - { - if (isShowAvatarBattleBonus) - { - _buffPanel.gameObject.SetActive(value: false); - return 0f; - } - ItemCursor itemCursor = new ItemCursor(0f); - float num = SetupBuffContent(targetCard, _buffContentsParent, ref itemCursor); - bool active = num > 0f; - _buffPanel.gameObject.SetActive(active); - if (num <= 0f) - { - return num; - } - _buffTitleLabel.text = Data.SystemText.Get(_card.IsClass ? "Battle_0495" : "Battle_0443"); - num -= _buffContentsParent.transform.localPosition.y; - _buffPanel.transform.localPosition = new Vector3(0f, -(int)upperContentsHeight); - _buffPanel.topAnchor.absolute = -(int)upperContentsHeight; - return num; - } - - private void SetupAllBuffPanel(BattleCardBase targetCard, float heightOffset, List myRotationBonusList, List bossRushSkillList, AvatarBattleInfo avatarBattleInfo, bool isUpdate, bool isShowAvatarBattleBonus = false) - { - for (int i = 0; i < _drawLogList.Count; i++) - { - _drawLogList[i].SetActive(value: false); - } - _drawLogList.Clear(); - bool flag = bossRushSkillList.Count > 0; - bool flag2 = NeedBuffSkillPanel(targetCard); - float num = 0f; - num += SetupMyRotationBonusPanel(targetCard, myRotationBonusList, flag || flag2); - num += SetupBossRushSkillPanel(targetCard, bossRushSkillList, num, flag2); - num += SetupAvatarBattleBonusPanel(targetCard, avatarBattleInfo, isShowAvatarBattleBonus); - num += SetupBuffSkillPanel(targetCard, num, isShowAvatarBattleBonus); - num += 8f; - _buffPanelSprite.gameObject.SetActive(flag2 || myRotationBonusList.Count > 0 || bossRushSkillList.Count > 0 || isShowAvatarBattleBonus); - float num2 = 598f + heightOffset; - num2 = ((!_card.IsUnit) ? (num2 - _nonFollowerPanel._bg.localSize.y) : (num2 - (_followerEvoPanel._bg.localSize.y + _followerPanel._bg.localSize.y))); - bool active = num2 < num; - UIScrollView component = _buffContentsPanel.GetComponent(); - component.InvalidateBounds(); - component.ResetPosition(); - component.enabled = active; - _buffScrollBar.gameObject.SetActive(active); - float num3 = Mathf.Min(num, num2); - _buffPanelSprite.height = (int)num3; - _buffPanelCollider.center = new Vector3(_buffPanelCollider.center.x, (0f - num3) / 2f); - _buffPanelCollider.size = new Vector3(_buffPanelCollider.size.x, num3); - _buffScrollView.UpdateScrollbars(); - _buffScrollView.RestrictWithinBounds(instant: true); - _buffScrollView.ResetPosition(); - if (isShowAvatarBattleBonus) - { - _bgDragScrollView.scrollView = _avatarBattleBonusScrollView; - } - else - { - _bgDragScrollView.scrollView = _buffScrollView; - } - _avatarBattleBonusScrollView.InvalidateBounds(); - _avatarBattleBonusScrollView.enabled = active; - _avatarBattleBonusScrollBar.gameObject.SetActive(active); - _avatarBattleBonusScrollView.UpdateScrollbars(); - if (!isUpdate) - { - _avatarBattleBonusScrollView.RestrictWithinBounds(instant: true); - _avatarBattleBonusScrollView.ResetPosition(); - } - } - - private bool NeedBuffSkillPanel(BattleCardBase card) - { - if (GameMgr.GetIns().IsNewReplayBattle) - { - if (card.ReplayNoConsumeEpBuffInfoNameList.Count <= 0 && card.ReplayBuffInfoList.Count() <= 0) - { - return card.ReplayBuffInfoLabelList.Count > 0; - } - return true; - } - bool num = IsNeedNoConsumeEp(card) && card.SelfBattlePlayer.InPlayCards.Where((BattleCardBase c) => c.SkillApplyInformation.NotConsumeEpModifierInfoList.Any((NotConsumeEpModifierInfo b) => b.TargetCard == null && b.CheckNotConsumedCard(card))).Count() > 0; - bool flag = (from b in GetDistinctBuffList(card.BuffInfoList) - where b.SpecialSkillInfo == null && !BuffDetailInfoUI.IsNotShowDamageCutLifeLowerLimitBuffDetail(b.SkillFrom) - select b).Count() > 0; - bool flag2 = BuffDetailInfoUI.NeedBuffDetailText(card); - return num || flag || flag2; - } - - private IEnumerator RepositionBuffContent() - { - yield return null; - _buffScrollView.ResetPosition(); - _buffScrollView.UpdateScrollbars(); - } - - private string GetBuffFromName(int baseCardID) - { - if (baseCardID == 0) - { - return Data.SystemText.Get("BattleLog_0097"); - } - return CardMaster.GetInstanceForBattle().GetCardParameterFromId(baseCardID).CardName; - } - - private void AddCardEvent(BattleCardBase card) - { - if (card != null) - { - card.OnDestroy += OnDestroyCard; - card.OnBanish += OnDestroyCard; - card.OnReturnCard += OnDestroyCard; - card.OnMetamorphose += OnDestroyCard; - card.OnGetOn += OnDestroyCard; - if (card.IsClass) - { - ((ClassBattleCardBase)card).OnRetire += OnDestroyCard; - } - } - } - - private void RemoveCardEvent(BattleCardBase card) - { - if (card != null) - { - card.OnDestroy -= OnDestroyCard; - card.OnBanish -= OnDestroyCard; - card.OnReturnCard -= OnDestroyCard; - card.OnMetamorphose -= OnDestroyCard; - card.OnGetOn -= OnDestroyCard; - if (card.IsClass) - { - ((ClassBattleCardBase)card).OnRetire -= OnDestroyCard; - } - } - } - - private VfxBase OnDestroyCard(BattleCardBase card, SkillProcessor skill) - { - if (_card == card) - { - return InstantVfx.Create(Hide); - } - return NullVfx.GetInstance(); - } - - public void ShowKeySubPanel(int page) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - } - - public void HideKeySubPanel() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - } - - public void SetKeyBtnActive(List hasKeyword) - { - if (hasKeyword.Count != 0) - { - _hasKeyword = hasKeyword[0]; - if (hasKeyword.Count > 1 && (bool)_nextPanel) - { - List keyBtnActive = new List(hasKeyword.GetRange(1, hasKeyword.Count - 1)); - _nextPanel.SetKeyBtnActive(keyBtnActive); - } - } - } - - public static void LoadCardHeaderTexture(int cardId, bool isUnit, UITexture headerUITexture, bool isEvolution = false, bool isBattleLogHeader = false, Action cbOnLoaded = null, List battleLogTextureInfo = null) - { - CardMaster instanceForBattle = CardMaster.GetInstanceForBattle(); - CardParameter cardParameterFromId = instanceForBattle.GetCardParameterFromId(cardId); - ResourcesManager resMgr = Toolbox.ResourcesManager; - string text = cardParameterFromId.ResourceCardId.ToString(); - ResourcesManager.AssetLoadPathType assetLoadPathType = ResourcesManager.AssetLoadPathType.UnitHeader; - ResourcesManager.AssetLoadPathType assetLoadPathType2 = ResourcesManager.AssetLoadPathType.UnitCardMaterial; - if (text.Length > 9) - { - assetLoadPathType = ResourcesManager.AssetLoadPathType.UnitHeader; - assetLoadPathType2 = ResourcesManager.AssetLoadPathType.UnitCardMaterial; - } - else if (isUnit || ((CardMaster.IsMutationCardCheck(instanceForBattle.GetCardParameterFromId(cardId).BaseCardId) || CardMaster.IsChoiceBraveCardCheck(cardId)) && instanceForBattle.GetCardParameterFromId(cardParameterFromId.ResourceCardId).CharType == CardBasePrm.CharaType.NORMAL)) - { - assetLoadPathType = ResourcesManager.AssetLoadPathType.UnitHeader; - text = (isEvolution ? (text + "1") : (text + "0")); - assetLoadPathType2 = ResourcesManager.AssetLoadPathType.UnitCardMaterial; - } - else - { - assetLoadPathType = ResourcesManager.AssetLoadPathType.OtherHeader; - text += "0"; - assetLoadPathType2 = ResourcesManager.AssetLoadPathType.SpellCardMaterial; - } - string cardAssetPath = resMgr.GetAssetTypePath(cardParameterFromId.ResourceCardId.ToString(), assetLoadPathType2); - string logHeaderAssetPath = resMgr.GetAssetTypePath(text, assetLoadPathType, isfetch: true); - if (resMgr.IsLoadedAssetBundleAndObjectArrayExist(cardAssetPath)) - { - Texture texture = resMgr.LoadObject(logHeaderAssetPath); - headerUITexture.mainTexture = texture; - cbOnLoaded.Call(texture); - return; - } - if (!isBattleLogHeader && loadHeaderCoroutine.ContainsKey(cardAssetPath)) - { - Coroutine coroutine = loadHeaderCoroutine[cardAssetPath]._coroutine; - BattleCoroutine.GetInstance().StopCoroutine(coroutine); - loadHeaderCoroutine.Remove(cardAssetPath); - } - Action action = delegate - { - Texture texture2 = resMgr.LoadObject(logHeaderAssetPath); - headerUITexture.mainTexture = texture2; - cbOnLoaded.Call(texture2); - }; - if (loadHeaderCoroutine.ContainsKey(cardAssetPath)) - { - loadHeaderCoroutine[cardAssetPath]._actions.Add(action); - return; - } - if (battleLogTextureInfo != null) - { - battleLogTextureInfo.Add(new NewReplayBattleMgr.BattleLogTextureInfo(cardAssetPath, logHeaderAssetPath, headerUITexture, cbOnLoaded)); - return; - } - CoroutineActions coroutineActions = new CoroutineActions(action); - coroutineActions._coroutine = BattleCoroutine.GetInstance().StartCoroutine(resMgr.LoadAssetAsync(cardAssetPath, delegate - { - foreach (Action action2 in coroutineActions._actions) - { - action2(); - } - loadHeaderCoroutine.Remove(cardAssetPath); - })); - Toolbox.ResourcesManager.BattleListAssetPathList.Add(cardAssetPath); - loadHeaderCoroutine.Add(cardAssetPath, coroutineActions); - } - - public static void LoadClassHeaderTexture(int cardId, UITexture headerUITexture, Action cbOnLoaded = null, bool isEvolve = false) - { - ResourcesManager resMgr = Toolbox.ResourcesManager; - ResourcesManager.AssetLoadPathType resourceType = ResourcesManager.AssetLoadPathType.UnitHeader; - resourceType = ResourcesManager.AssetLoadPathType.ClassCharaHeader; - int skin_id = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(cardId) - .skin_id; - string cardNameBgPath = ((skin_id < 10) ? ("log_class_0" + skin_id) : ("log_class_" + skin_id)); - if (isEvolve) - { - cardNameBgPath += "_evolve"; - } - string cardAssetName = resMgr.GetAssetTypePath(cardNameBgPath, resourceType); - BattleCoroutine.GetInstance().StartCoroutine(resMgr.LoadAssetAsync(cardAssetName, delegate - { - Texture texture = resMgr.LoadObject(resMgr.GetAssetTypePath(cardNameBgPath, resourceType, isfetch: true)); - headerUITexture.mainTexture = texture; - cbOnLoaded.Call(texture); - Toolbox.ResourcesManager.BattleListAssetPathList.Add(cardAssetName); - })); - } - - public void SetScreenPosition(bool right) - { - UIAnchor component = base.transform.Find("AnchorL").GetComponent(); - if ((bool)component) - { - if (right) - { - float num = -0.3633333f; - float num2 = -0.222f - num * 0.4f; - component.relativeOffset.x = num * base.transform.localScale.x + num2; - } - else - { - component.relativeOffset.x = 0f; - } - component.side = (right ? UIAnchor.Side.TopRight : UIAnchor.Side.TopLeft); - component.enabled = true; - } - } - - private void SetParent(DetailPanelControl parent) - { - _parentPanel = parent; - GameObject obj = base.transform.Find("AnchorL").gameObject; - UIAnchor component = obj.GetComponent(); - if ((bool)component) - { - UnityEngine.Object.Destroy(component); - } - UIWidget uIWidget = obj.AddMissingComponent(); - uIWidget.height = 1; - uIWidget.width = 1; - UIWidget lastBottomWidget = _parentPanel.GetLastBottomWidget(); - uIWidget.topAnchor.target = lastBottomWidget.transform; - uIWidget.topAnchor.absolute = 1; - } - - private UIWidget GetLastBottomWidget() - { - if (_buffPanelSprite.gameObject.activeInHierarchy) - { - return _buffPanelSprite; - } - if (_nonFollowerPanel._bg.gameObject.activeInHierarchy) - { - return _nonFollowerPanel._bg; - } - if (_followerEvoPanel._bg.gameObject.activeInHierarchy) - { - return _followerEvoPanel._bg; - } - return _followerPanel._bg; - } - - private void UpdateParentAnchor() - { - if ((bool)_parentPanel) - { - GameObject gameObject = base.transform.Find("AnchorL").gameObject; - UIWidget uIWidget = gameObject.AddMissingComponent(); - UIWidget lastBottomWidget = _parentPanel.GetLastBottomWidget(); - if (lastBottomWidget != uIWidget.topAnchor.target) - { - uIWidget.height = 1; - uIWidget.width = 1; - uIWidget.topAnchor.target = lastBottomWidget.transform; - uIWidget.ResetAndUpdateAnchors(); - uIWidget.topAnchor.absolute = 0; - uIWidget.topAnchor.relative = 0f; - Vector3 localPosition = gameObject.transform.localPosition; - localPosition.x = _parentPanel.transform.Find("AnchorL").localPosition.x; - gameObject.transform.localPosition = localPosition; - } - } - } - - public void SetSize(float percent) - { - float num = percent / 100f; - base.transform.localScale = new Vector3(num, num, num); - UIAnchor component = base.transform.Find("AnchorL").GetComponent(); - if ((bool)component) - { - float num2; - float num3; - if (component.side == UIAnchor.Side.TopRight) - { - num2 = -0.3633333f; - num3 = -0.222f - num2 * 0.4f; - component.relativeOffset.x = num2 * base.transform.localScale.x + num3; - } - component.relativeOffset.y = 0f; - num2 = 106.666664f; - num3 = -30f - num2 * 0.4f; - component.pixelOffset.y = num2 * num + num3; - component.enabled = true; - } - if ((bool)_nextPanel) - { - _nextPanel.SetSize(percent); - } - } -} +using System; +using System.Collections.Generic; +using UnityEngine; +using Wizard.Battle.UI; +using Wizard.Battle.View.Vfx; + +// PASS-8/Phase-1 STUB: 1,909-line client-side card-detail-panel UI. Held on `DetailMgr. +// SubDetailPanelControl` (nullable field) but never constructed anywhere — NullDetailPanelControl +// is the headless-live implementation carried into the receive path. The class exists purely +// as a compile-time surface: the ShowRequest enum + LoadCardHeaderTexture static + interface +// contract via IDetailPanelControl (mirroring NullDetailPanelControl's shape). Every instance +// member is a no-op / default because a headless `SubDetailPanelControl` is either null (NRE +// on read — never reached) or is actually a NullDetailPanelControl instance. +public class DetailPanelControl : CardDetailBase, IDetailPanelControl +{ + public enum ShowRequest + { + NORMAL, + MULLIGAN, + EVOLUTION_SELECT, + FUSION_INFO_CARD_LIST, + CHOICE_BRAVE, + CHOICE_BRAVE_AND_BUFF + } + + public bool IsShow => false; + public BattleCardBase _card => null; + public bool forceEvolutionConfirm { get; set; } + public UIButton EvolveButton => null; + public ShowRequest CurrentShowRequest => ShowRequest.NORMAL; + public GameObject EvoTargetPanelColliderGameObject => null; + public EvolutionConfirmation _evolutionConfirmation => null; + + public event Action OnHideOneTime { add { } remove { } } + + public void UpdateCardDescriptionOnEvent() { } + public void UpdateCardDescriptionOnEvolutionEvent() { } + public void Show(BattleManagerBase battleMgrBase, OperateMgr operateMgr, BattleCardBase card, ShowRequest showRequest) { } + public void ShowList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List cards, ShowRequest showRequest, + BuffInfo buff, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, + string divergenceId = "", int logTextureId = 0) { } + public void Hide() { } + public void SetSize(float percent) { } + public void UpdateBuffInfo(BattleCardBase targetCard, List myRotationBonusList) { } + public void UpdateLogItemBuffInfo(BattleCardBase targetCard) { } + public void SetScreenPosition(bool right) { } + public VfxBase ShowEvolutionButton(BattleCardBase card) => NullVfx.GetInstance(); + public void CreateNextPanel() { } + public void SetKeyBtnActive(List hasKeyword) { } + public void ShowKeySubPanel(int page) { } + public void HideKeySubPanel() { } + public bool IsDisplayedRight() => false; + public List GetDistinctBuffList(List buffInfoList) => new List(); + public List GetBuffDetailLabel(BattleCardBase targetCard) => new List(); +} diff --git a/SVSim.BattleEngine/Engine/DialogBase.cs b/SVSim.BattleEngine/Engine/DialogBase.cs index abb1fb65..ebd3da4e 100644 --- a/SVSim.BattleEngine/Engine/DialogBase.cs +++ b/SVSim.BattleEngine/Engine/DialogBase.cs @@ -13,19 +13,14 @@ public class DialogBase : MonoBehaviour { OPEN, WAIT, - CLOSE, - END, - ERASE - } + CLOSE } public enum Size { S, M, L, - XL, - BATTLE_LOG - } + XL } public enum ButtonLayout { @@ -95,19 +90,10 @@ public class DialogBase : MonoBehaviour { _panel.alpha = alpha; } - - public void ResetAlpha() - { - _panel.alpha = _originalAlpha; - } } public enum KeyboardDialogSelect { - Button1, - Button2, - Button3, - CloseButton } private class Button @@ -118,7 +104,7 @@ public class DialogBase : MonoBehaviour public string Text { get; private set; } - public Se.TYPE SE { get; private set; } + public int SE { get; private set; } public Action OnClick { get; private set; } @@ -132,58 +118,58 @@ public class DialogBase : MonoBehaviour { case ButtonType.Blue: Sprite = ButtonSprite.BLUE; - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; break; case ButtonType.Red: Sprite = ButtonSprite.RED; - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; break; case ButtonType.Gray: Sprite = ButtonSprite.GRAY; - SE = Se.TYPE.SYS_BTN_CANCEL; + SE = 0; break; case ButtonType.Yellow: Sprite = ButtonSprite.YELLOW; - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; break; case ButtonType.OK: Sprite = ButtonSprite.BLUE; Text = systemText.Get("Common_0004"); - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; break; case ButtonType.Decision: Sprite = ButtonSprite.BLUE; Text = systemText.Get("Common_0003"); - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; break; case ButtonType.Close: Sprite = ButtonSprite.GRAY; Text = systemText.Get("Common_0008"); - SE = Se.TYPE.SYS_BTN_CANCEL; + SE = 0; break; case ButtonType.Cancel: Sprite = ButtonSprite.GRAY; Text = systemText.Get("Common_0005"); - SE = Se.TYPE.SYS_BTN_CANCEL; + SE = 0; break; case ButtonType.Retry: Sprite = ButtonSprite.BLUE; Text = systemText.Get("Common_0133"); - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; OnClick = delegate { UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Retry()); }; - NetworkUI.GetInstance().SetKeepLastRequest(flag: true); + OnDestroy = delegate { - NetworkUI.GetInstance().SetKeepLastRequest(flag: false); + }; break; case ButtonType.BackToTitle: Sprite = ButtonSprite.GRAY; Text = systemText.Get("Common_0131"); - SE = Se.TYPE.SYS_BTN_CANCEL_TRANS; + SE = 0; OnClick = delegate { SoftwareReset.exec(); @@ -192,24 +178,20 @@ public class DialogBase : MonoBehaviour case ButtonType.BackToHome: Sprite = ButtonSprite.GRAY; Text = systemText.Get("Common_0132"); - SE = Se.TYPE.SYS_BTN_CANCEL_TRANS; + SE = 0; OnClick = delegate { + // Pre-Phase-5b: back-to-home dialog kicked off BattleEndCoroutine when in a + // battle scene. Headless has no scene, no BattleCtrl (Chunk 7 stubbed it), and + // no BattleEndCoroutine to run — collapse to the else branch. UIManager.GetInstance().closeInSceneCenterLoading(); - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle && GameMgr.GetIns().GetBattleCtrl() != null) - { - UIManager.GetInstance().StartCoroutine(BattleEndCoroutine()); - } - else - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); - } + UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); }; break; case ButtonType.QuitApplication: Sprite = ButtonSprite.GRAY; Text = systemText.Get("Common_0135"); - SE = Se.TYPE.SYS_BTN_CANCEL; + SE = 0; OnClick = delegate { if (Toolbox.mute != null) @@ -223,17 +205,17 @@ public class DialogBase : MonoBehaviour case ButtonType.VersionUp: Sprite = ButtonSprite.BLUE; Text = systemText.Get("Common_0136"); - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; OnClick = delegate { Toolbox.NetworkManager.GoToStore(); }; - NetworkUI.GetInstance().SetKeepLastRequest(flag: true); + break; case ButtonType.RecommendedList: Sprite = ButtonSprite.BLUE; Text = systemText.Get("Common_0134"); - SE = Se.TYPE.SYS_BTN_DECIDE; + SE = 0; OnClick = delegate { UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.RECOMMENDED_DEVICE); @@ -246,124 +228,15 @@ public class DialogBase : MonoBehaviour } } + // Pre-Phase-5b: waited for SBattleLoad + BattleCtrl.BattleEnd. Both are stubbed in + // headless (see BattleControl chunk 7); no caller after the back-to-home collapse above. + // Kept as a stub yielding immediately so the enclosing class shape stays intact. private IEnumerator BattleEndCoroutine() { yield return null; - SBattleLoad battleLoad = BattleManagerBase.GetIns().SBattleLoad; - while (!battleLoad.isLoadEnd) - { - yield return null; - } - yield return GameMgr.GetIns().GetBattleCtrl().BattleEnd(); - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.OnChange = delegate - { - UIManager.GetInstance().CloseInSceneLoadingBattle(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); } } - private const int ONE_BUTTON_1BUTTON_LEFT_ANCHOR = -128; - - private const int ONE_BUTTON_1BUTTON_RIGHT_ANCHOR = 128; - - private const int TWO_BUTTON_1BUTTON_LEFT_ANCHOR = 8; - - private const int TWO_BUTTON_1BUTTON_RIGHT_ANCHOR = 264; - - private const int TWO_BUTTON_2BUTTON_LEFT_ANCHOR = -264; - - private const int TWO_BUTTON_2BUTTON_RIGHT_ANCHOR = -8; - - private const int THREE_BUTTON_1BUTTON_LEFT_ANCHOR = -128; - - private const int THREE_BUTTON_1BUTTON_RIGHT_ANCHOR = 128; - - private const int THREE_BUTTON_2BUTTON_LEFT_ANCHOR = -398; - - private const int THREE_BUTTON_2BUTTON_RIGHT_ANCHOR = -142; - - private const int THREE_BUTTON_3BUTTON_LEFT_ANCHOR = 142; - - private const int THREE_BUTTON_3BUTTON_RIGHT_ANCHOR = 398; - - private const int WEBVIEW_ANCHOR_LEFT = 6; - - private const int WEBVIEW_ANCHOR_BOTTOM = 18; - - private const int WEBVIEW_ANCHOR_RIGHT = -6; - - private const int WEBVIEW_ANCHOR_TOP = -17; - - private const float START_ALPHA = 0.01f; - - public const float BACKVIEW_ALPHA = 0.8f; - - private const float OPEN_TIME = 0.3f; - - public const int DELTA_PANEL_DEPTH = 5; - - public static readonly Vector3 BATTLELOG_TITLELABEL_POS = new Vector3(0f, 16f, 0f); - - public static readonly Vector3 BATTLELOG_WINDOWSPRITE_POS = new Vector3(-250f, 0f, 0f); - - private const int BATTLELOG_WINDOW_W = 600; - - private const int BATTLELOG_WINDOW_H = 600; - - private const int FAQ_DEAPTH = 6100; - - public const int FRIEND_DIALOG_DEPTH = 1000; - - public const int ERROR_DIALOG_BATTLE = 5000; - - public const int ERROR_DIALOG_MATCHING_DEPTH = 5400; - - public const int ERROR_DIALOG_DEPTH = 5500; - - public const int ERROR_ASSETHANDLE_DIALOG_DEPTH = 6000; - - public const int HOME_LOGIN_BONUS_DEPTH = 10; - - public const int HOME_BATTLE_RESULT_DEPTH = 15; - - public const int QUIT_DIALOG_DEPTH = 7000; - - public const int GATHERING_STATE_CHANGE_DIALOG_DEPTH = 4000; - - public const int SCROLL_BOTTOM_ANCHOR_WINDOW = 8; - - public const int SCROLL_BOTTOM_ANCHOR_BUTTON_LINE = -2; - - private const int WEBVIEW_DISPLAY_MARGIN = 35; - - private const int WEBVIEW_Y_OFFSET = 2; - - private const string spriteButtonBlue = "btn_common_02_m_off"; - - private const string spriteButtonBluePush = "btn_common_02_m_on"; - - private const string spriteButtonGray = "btn_common_01_m_off"; - - private const string spriteButtonGrayPush = "btn_common_01_m_on"; - - private const string spriteButtonRed = "btn_common_04_m_off"; - - private const string spriteButtonRedPush = "btn_common_04_m_on"; - - private const string spriteButtonYellow = "btn_common_03_m_off"; - - private const string spriteButtonYellowPush = "btn_common_03_m_on"; - - private const string spriteButtonRed_S = "btn_common_04_s_off"; - - private const string spriteButtonRedPush_S = "btn_common_04_s_on"; - - private const string spriteButtonBlue_S = "btn_common_02_s_off"; - - private const string spriteButtonBluePush_S = "btn_common_02_s_on"; - [HideInInspector] public NguiObjs InputAreaObjs; @@ -388,13 +261,6 @@ public class DialogBase : MonoBehaviour [SerializeField] private GameObject _collider; - [SerializeField] - private UIPanel _colliderPanel; - - private float _colliderUpdateTimer; - - private bool _colliderUpdateEnable; - [SerializeField] private UILabel DetailMsg; @@ -446,21 +312,6 @@ public class DialogBase : MonoBehaviour [SerializeField] private UIScrollView scrollView; - [SerializeField] - public GameObject EscapeDialogPrefab; - - [SerializeField] - private GameObject _button1Select; - - [SerializeField] - private GameObject _button2Select; - - [SerializeField] - private GameObject _button3Select; - - [SerializeField] - private GameObject _closeButtonSelect; - private DialogScene dialogNowScene; private ButtonLayout dialogLayout; @@ -502,8 +353,6 @@ public class DialogBase : MonoBehaviour private string closeMsg; - private float timer; - private bool isOpenAnim = true; public bool isNotCloseWindowButton1; @@ -524,14 +373,8 @@ public class DialogBase : MonoBehaviour public InputDialog InputDialog { get; set; } - public bool IsEnableOpenSe { get; set; } = true; - public bool IsCloseByCloseButton { get; private set; } - public float PanelAlpha => base.gameObject.GetComponent().alpha; - - public CardDetailUI cardDetailDialog { get; set; } - public UIScrollView ScrollView => scrollView; public GameObject Btn1GameObject @@ -546,57 +389,20 @@ public class DialogBase : MonoBehaviour } } - public GameObject Btn2GameObject => button2.gameObject; + public int OpenSe { get; set; } - public Se.TYPE OpenSe { get; set; } + public int CloseSe { get; set; } - public Se.TYPE CloseSe { get; set; } + public int ClickSe_Btn1 { get; set; } - public Se.TYPE ClickSe_Btn1 { get; set; } + public int ClickSe_Btn2 { get; set; } - public Se.TYPE ClickSe_Btn2 { get; set; } - - public Se.TYPE ClickSe_Btn3 { get; set; } + public int ClickSe_Btn3 { get; set; } public GameObject InsideObject { get; private set; } public bool IsPossibleToCloseByAndroidBackKey { get; set; } - public bool IsButton1Enabled - { - set - { - button1.enabled = value; - } - } - - public bool IsButton2Enabled - { - set - { - button2.enabled = value; - } - } - - public bool IsCloseButtonEnabled - { - set - { - CloseButton.enabled = value; - } - } - - public bool IsEmptyColliderEnabled - { - set - { - if (backView != null && CloseButton.gameObject.activeSelf) - { - backView.GetComponentInChildren().gameObject.AddMissingComponent().enabled = value; - } - } - } - public bool Button2Grey { set @@ -607,16 +413,11 @@ public class DialogBase : MonoBehaviour public DialogBase() { - OpenSe = Se.TYPE.SYS_DIALOG_OPEN; - CloseSe = Se.TYPE.SYS_BTN_CANCEL; + OpenSe = 0; + CloseSe = 0; IsPossibleToCloseByAndroidBackKey = true; } - private void OnDestroy() - { - UnityEngine.Object.Destroy(backView); - } - private void Awake() { SetButtonSprite(); @@ -629,7 +430,7 @@ public class DialogBase : MonoBehaviour { if (dialogNowScene == DialogScene.WAIT) { - GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn1); + if (returnObj != null && returnMsg_Btn1 != "") { returnObj.SendMessage(returnMsg_Btn1); @@ -649,7 +450,7 @@ public class DialogBase : MonoBehaviour { if (dialogNowScene == DialogScene.WAIT) { - GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn2); + if (returnObj != null && !string.IsNullOrEmpty(returnMsg_Btn2)) { returnObj.SendMessage(returnMsg_Btn2); @@ -669,7 +470,7 @@ public class DialogBase : MonoBehaviour { if (dialogNowScene == DialogScene.WAIT) { - GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn3); + if (returnObj != null && !string.IsNullOrEmpty(returnMsg_Btn3)) { returnObj.SendMessage(returnMsg_Btn3); @@ -724,7 +525,7 @@ public class DialogBase : MonoBehaviour private void CloseNotSelect(bool isCloseButton) { IsCloseByCloseButton = isCloseButton; - GameMgr.GetIns().GetSoundMgr().PlaySe(CloseSe); + Close(); if (returnObj != null && !string.IsNullOrEmpty(closeMsg)) { @@ -736,92 +537,6 @@ public class DialogBase : MonoBehaviour } } - private void ColliderUpdate() - { - if (_colliderUpdateEnable) - { - _colliderUpdateTimer += Time.deltaTime; - if (_colliderUpdateTimer >= 0.24000001f) - { - _collider.SetActive(value: false); - _colliderUpdateEnable = false; - _colliderUpdateTimer = 0f; - } - } - } - - private void Update() - { - if (ToolboxGame.GameManager == null) - { - return; - } - ColliderUpdate(); - switch (dialogNowScene) - { - case DialogScene.OPEN: - { - if (IsEnableOpenSe) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(OpenSe); - } - dialogNowScene = DialogScene.WAIT; - if (onFirstUpdate != null) - { - onFirstUpdate(); - } - if (isOpenAnim) - { - iTween.MoveFrom(base.gameObject, iTween.Hash("y", base.transform.localPosition.y - 5f, "time", 0.3f, "movetopath", false, "islocal", true, "easetype", iTween.EaseType.easeOutCubic)); - TweenAlpha.Begin(base.gameObject, 0.3f, 1f); - if (backView != null) - { - TweenAlpha.Begin(backView.gameObject, 0.3f, 1f); - } - } - _colliderUpdateEnable = true; - _colliderUpdateTimer = 0f; - for (int i = 0; i < _insideObjectUIPanelAlphaControllerList.Count; i++) - { - _insideObjectUIPanelAlphaControllerList[i].ResetAlpha(); - } - break; - } - case DialogScene.CLOSE: - timer = 0.01f; - dialogNowScene = DialogScene.END; - break; - case DialogScene.END: - timer -= Time.deltaTime; - if (timer <= 0f) - { - Dispose(); - dialogNowScene = DialogScene.ERASE; - } - break; - case DialogScene.WAIT: - break; - } - } - - private void Dispose() - { - if (OnClose != null) - { - OnClose(); - } - if (OnClose_ForSystem != null) - { - OnClose_ForSystem(); - } - UnityEngine.Object.Destroy(base.gameObject); - } - - public DialogScene GetNowScene() - { - return dialogNowScene; - } - public bool IsOpen() { if (dialogNowScene != DialogScene.OPEN) @@ -847,32 +562,16 @@ public class DialogBase : MonoBehaviour scrollView.GetComponent().ResetAndUpdateAnchors(); } - public void SetAnchors() - { - WindowSprite.SetAnchor(base.gameObject, 6, 18, -6, -17); - } - public void SetTitleLabel(string str) { titleLabel.text = str; } - public string GetTitleLabelStr() - { - return titleLabel.text; - } - public void SetTitleLabelActive(bool active) { titleLabel.gameObject.SetActive(active); } - public void AttachObjToTitleLabel(GameObject obj, Action initializeCallBack) - { - obj.transform.parent = TitleObjs.transform; - initializeCallBack.Call(titleLabel); - } - public void AttachObjToTitleLabel(GameObject obj, Vector3 localPosition) { obj.transform.parent = TitleObjs.transform; @@ -1141,7 +840,7 @@ public class DialogBase : MonoBehaviour }; } - private void Display_1_Button(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1) + private void Display_1_Button(ButtonSprite sprite_btn1, string text_btn1, int se_btn1, Action onClick_btn1, Action onDestroy_btn1) { ButtonBase.SetActive(value: true); button1.gameObject.SetActive(value: true); @@ -1162,7 +861,7 @@ public class DialogBase : MonoBehaviour Display_1_Button(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy); } - private void Display_2_Buttons(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, Se.TYPE se_btn2, Action onClick_btn2, Action onDestroy_btn2) + private void Display_2_Buttons(ButtonSprite sprite_btn1, string text_btn1, int se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, int se_btn2, Action onClick_btn2, Action onDestroy_btn2) { ButtonBase.SetActive(value: true); button1.gameObject.SetActive(value: true); @@ -1186,7 +885,7 @@ public class DialogBase : MonoBehaviour Display_2_Buttons(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy, btn2.Sprite, btn2.Text, btn2.SE, btn2.OnClick, btn2.OnDestroy); } - private void Display_3_Buttons(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, Se.TYPE se_btn2, Action onClick_btn2, Action onDestroy_btn2, ButtonSprite sprite_btn3, string text_btn3, Se.TYPE se_btn3, Action onClick_btn3, Action onDestroy_btn3) + private void Display_3_Buttons(ButtonSprite sprite_btn1, string text_btn1, int se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, int se_btn2, Action onClick_btn2, Action onDestroy_btn2, ButtonSprite sprite_btn3, string text_btn3, int se_btn3, Action onClick_btn3, Action onDestroy_btn3) { ButtonBase.SetActive(value: true); button1.gameObject.SetActive(value: true); @@ -1260,7 +959,7 @@ public class DialogBase : MonoBehaviour scrollBarRect.UpdateAnchors(); } - private void SetButtonSe(Se.TYPE btn1 = Se.TYPE.SYS_BTN_DECIDE, Se.TYPE btn2 = Se.TYPE.SYS_BTN_DECIDE, Se.TYPE btn3 = Se.TYPE.SYS_BTN_DECIDE) + private void SetButtonSe(int btn1 = 0, int btn2 = 0, int btn3 = 0) { ClickSe_Btn1 = btn1; ClickSe_Btn2 = btn2; @@ -1281,18 +980,6 @@ public class DialogBase : MonoBehaviour scrollView.GetComponent().bottomAnchor.absolute += (int)contactButton.GetComponent().size.y; } - public void SetRefund(string url, string buttonText) - { - contactButton.gameObject.SetActive(value: true); - contactButton.onClick.Clear(); - contactButton.onClick.Add(new EventDelegate(delegate - { - UIManager.GetInstance().WebViewHelper.OpenUrl(url); - })); - contactButton_Label.text = buttonText; - scrollView.GetComponent().bottomAnchor.absolute += (int)contactButton.GetComponent().size.y; - } - public void SetVisibleWebViewBackButton(string url, bool isVisible) { webviewBackButton.gameObject.SetActive(isVisible); @@ -1322,19 +1009,6 @@ public class DialogBase : MonoBehaviour })); } - public void AddVScrollBar(UIScrollView view) - { - view.verticalScrollBar = vScrollBar; - scrollView.verticalScrollBar = null; - } - - public void AttachScrollView(UIScrollView view, float scrollStartValue) - { - scrollView.verticalScrollBar = null; - view.verticalScrollBar = vScrollBar; - view.verticalScrollBar.value = scrollStartValue; - } - public void CloseWithoutSelect() { if (!(this == null)) @@ -1365,28 +1039,6 @@ public class DialogBase : MonoBehaviour } } - public void CloseSoon() - { - if (!(UIManager.GetInstance() != null) || !(this != null) || !(this == UIManager.GetInstance().ApplicationFinishManager.QuitDialog)) - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - } - OnCloseStart.Call(); - Dispose(); - } - - public void ReOpen(bool isResetBackViewAlpha = false) - { - SetActive(inActive: true); - base.gameObject.GetComponent().alpha = 0.01f; - dialogNowScene = DialogScene.OPEN; - _collider.SetActive(value: true); - if (isResetBackViewAlpha) - { - ResetBackViewAlpha(); - } - } - public void TitleOnOff(bool flag) { TitleObjs.gameObject.SetActive(flag); @@ -1397,42 +1049,6 @@ public class DialogBase : MonoBehaviour CloseButton.gameObject.SetActive(flag); } - public void SetButtonLineVisible(bool b) - { - buttonLine.gameObject.SetActive(b); - } - - private void SetTextActive(bool b) - { - DetailMsg.gameObject.SetActive(b); - } - - public void SetTitleLineVisible(bool visible) - { - if (null != titleLine && titleLine.enabled != visible) - { - titleLine.enabled = visible; - } - } - - public void SetWindowSprite(string atlasname, string spritename) - { - List atlasList = UIManager.GetInstance().GetAtlasList(); - if (atlasList == null) - { - return; - } - for (int i = 0; i < atlasList.Count; i++) - { - if (atlasList[i].name == atlasname) - { - WindowSprite.atlas = atlasList[i]; - WindowSprite.spriteName = spritename; - break; - } - } - } - public void SetPanelDepth(int depth, bool isSetBackViewDepthImmediately = false) { GetComponent().depth = depth; @@ -1447,11 +1063,6 @@ public class DialogBase : MonoBehaviour } } - public int GetPanelDepth() - { - return GetComponent().depth; - } - private void backViewDepth() { UIPanel component = GetComponent(); @@ -1532,16 +1143,6 @@ public class DialogBase : MonoBehaviour t.localPosition = Vector3.zero; } - public void InactiveBackView() - { - backView.SetActive(value: false); - } - - public void ResetBackViewAlpha() - { - backView.gameObject.GetComponent().alpha = 1f; - } - public void SetFadeButtonEnabled(bool flag) { CloseOnOff(flag); @@ -1611,42 +1212,6 @@ public class DialogBase : MonoBehaviour return dialogBase; } - public void FadeOut() - { - FadeUtility.FadeOutGameObject(base.gameObject); - FadeUtility.FadeOutGameObject(backView.gameObject); - } - - public void KeyboardSelectButton(KeyboardDialogSelect select, bool enable) - { - switch (select) - { - case KeyboardDialogSelect.Button1: - _button1Select.SetActive(enable); - break; - case KeyboardDialogSelect.Button2: - _button2Select.SetActive(enable); - break; - case KeyboardDialogSelect.Button3: - _button3Select.SetActive(enable); - break; - case KeyboardDialogSelect.CloseButton: - _closeButtonSelect.SetActive(enable); - break; - } - } - - public Vector4 GetWebViewDisplayRect() - { - return new Vector4 - { - x = 0f, - y = -30f, - z = 1100f, - w = 510f - }; - } - public void AutoClose(float second) { if (_autoCloseCoroutine == null) @@ -1675,15 +1240,4 @@ public class DialogBase : MonoBehaviour CloseButton.enabled = false; IsPossibleToCloseByAndroidBackKey = false; } - - public int GetMaxPanelDepth() - { - UIPanel[] second = new UIPanel[1] { _colliderPanel }; - return base.transform.GetComponentsInChildren().Except(second).Max((UIPanel x) => x.depth); - } - - public void SetPanelDepthAboveDialog(DialogBase dialog) - { - SetPanelDepth(dialog.GetMaxPanelDepth() + 5); - } } diff --git a/SVSim.BattleEngine/Engine/DialogRewardScroll.cs b/SVSim.BattleEngine/Engine/DialogRewardScroll.cs deleted file mode 100644 index 73967f9c..00000000 --- a/SVSim.BattleEngine/Engine/DialogRewardScroll.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Wizard.Scripts.Network.Data.TableData; - -public class DialogRewardScroll : MonoBehaviour -{ - [SerializeField] - private UIWrapContentWizard WrapContent; - - [SerializeField] - private GameObject Item; - - [SerializeField] - private UIScrollBarWrapContent ScrollBar; - - [SerializeField] - private WrapContentsScrollBarSize WrapScrollbar; - - [SerializeField] - private UIScrollView ScrollView; - - [SerializeField] - private UILabel _emptyLabel; - - private const int SCROLL_ITEM_COUNT = 10; - - private const int HISTORY_ITEM_SPRITE_WIDTH = 800; - - private GameObject[] Items; - - private List _currentList; - - public List CurrentList - { - get - { - return _currentList; - } - set - { - _currentList = value; - _emptyLabel.gameObject.SetActive(_currentList.Count == 0); - } - } - - public ResourceHandler Handler { get; set; } - - public void Start() - { - CreateSomeItems(); - WrapContent.onInitializeItem = InitScrollItem; - ScrollBar.m_WrapContents = WrapContent; - } - - public void resetScrollWrap() - { - WrapContent.minIndex = -(CurrentList.Count - 1); - WrapContent.maxIndex = 0; - ScrollView.ResetPosition(); - WrapContent.resetItems(); - WrapScrollbar.ContentUpdate(); - ScrollView.ResetPosition(); - ScrollBar.gameObject.SetActive(value: true); - ScrollView.UpdateScrollbars(); - } - - private void InitScrollItem(GameObject obj, int wrapIndex, int realIndex) - { - GameObject gameObject = obj.transform.GetChild(0).gameObject; - if (-realIndex < 0 || -realIndex >= CurrentList.Count) - { - gameObject.SetActive(value: false); - return; - } - gameObject.SetActive(value: true); - int num = -realIndex; - SetHistoryItem(gameObject, CurrentList[num], num == CurrentList.Count - 1); - } - - private void SetHistoryItem(GameObject item, ItemAcquireHistory history, bool isLastItem) - { - item.GetComponent().width = 800; - item.GetComponent().SetHistoryItem(history, !isLastItem, Handler); - } - - private void CreateSomeItems() - { - Items = new GameObject[10]; - for (int i = 0; i < 10; i++) - { - GameObject gameObject = new GameObject(); - Transform obj = gameObject.transform; - obj.parent = WrapContent.transform; - obj.localPosition = Vector3.zero; - obj.localRotation = Quaternion.identity; - obj.localScale = Vector3.one; - gameObject.layer = WrapContent.gameObject.layer; - NGUITools.AddChild(gameObject, Item).SetActive(value: true); - gameObject.SetActive(value: true); - Items[i] = gameObject; - } - } -} diff --git a/SVSim.BattleEngine/Engine/DialogSupport.cs b/SVSim.BattleEngine/Engine/DialogSupport.cs index 9373aa78..f817277a 100644 --- a/SVSim.BattleEngine/Engine/DialogSupport.cs +++ b/SVSim.BattleEngine/Engine/DialogSupport.cs @@ -7,35 +7,15 @@ public class DialogSupport : MonoBehaviour { private enum Info { - UserId, AppVersion, OsVersion, Device } - [SerializeField] - private UITable _table; - private GameObject[] _items; - private const string CHECK_ON = "btn_check_on"; - - private const string CHECK_OFF = "btn_check_off"; - - private const string USERID = "&userid="; - - private const string APPVERSION = "&appver="; - - private const string OSVERSION = "&osver="; - private const string DEVICE = "&device="; - private const string ERRORCODE = "&errorcode="; - - private const string COUNTRY = "&country="; - - private const string CITY = "&city="; - public string ErrorCode { get; set; } public static DialogBase Create(string errorCode = null) @@ -64,35 +44,6 @@ public class DialogSupport : MonoBehaviour return dialogBase; } - public void Start() - { - string[] array = new string[4] { "Contact_Dialog_002", "Contact_Dialog_003", "Contact_Dialog_004", "Contact_Dialog_001_dmm" }; - int childCount = _table.transform.childCount; - _items = new GameObject[childCount]; - for (int i = 0; i < childCount; i++) - { - _items[i] = _table.transform.GetChild(i).gameObject; - UIButton bt = _items[i].GetComponentInChildren(); - UISprite sp = _items[i].GetComponentInChildren(); - _items[i].GetComponentInChildren().text = Data.SystemText.Get(array[i]); - bt.onClick.Add(new EventDelegate(delegate - { - if (sp.spriteName == "btn_check_off") - { - bt.normalSprite = "btn_check_on"; - bt.pressedSprite = "btn_check_off"; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - } - else - { - bt.normalSprite = "btn_check_off"; - bt.pressedSprite = "btn_check_on"; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); - } - })); - } - } - private bool IsChecked(Info info) { if ((int)info >= _items.Length) @@ -106,10 +57,8 @@ public class DialogSupport : MonoBehaviour { string key = "URL_0013_steam"; string text = Data.SystemText.Get(key); - if (IsChecked(Info.UserId) && PlayerStaticData.UserViewerID != 0) - { - text = text + "&userid=" + PlayerStaticData.UserViewerID; - } + // PlayerStaticData.UserViewerID read stripped in Phase-1 UI cull. GetUrl runs from a + // client-side report dialog; headless never invokes it. if (IsChecked(Info.AppVersion)) { text = text + "&appver=" + Toolbox.DeviceManager.GetAppVersionName(); diff --git a/SVSim.BattleEngine/Engine/DisconnectToDispChecker.cs b/SVSim.BattleEngine/Engine/DisconnectToDispChecker.cs index 15195b0c..b556edae 100644 --- a/SVSim.BattleEngine/Engine/DisconnectToDispChecker.cs +++ b/SVSim.BattleEngine/Engine/DisconnectToDispChecker.cs @@ -3,7 +3,6 @@ using Cute; public class DisconnectToDispChecker : NetworkBattleIntervalCheckerBase { - private const float DISP_DISCONNECT_INTERVAL = 16f; public bool isDisp; @@ -36,10 +35,6 @@ public class DisconnectToDispChecker : NetworkBattleIntervalCheckerBase StopChecker(); } - public void DebugDisconnectDisp(int cardId) - { - } - public override void FinishChecker() { base.FinishChecker(); diff --git a/SVSim.BattleEngine/Engine/DisconnectToLoseChecker.cs b/SVSim.BattleEngine/Engine/DisconnectToLoseChecker.cs index 42c1ad63..7019182c 100644 --- a/SVSim.BattleEngine/Engine/DisconnectToLoseChecker.cs +++ b/SVSim.BattleEngine/Engine/DisconnectToLoseChecker.cs @@ -5,13 +5,6 @@ using Wizard; public class DisconnectToLoseChecker : NetworkBattleIntervalCheckerBase { - private const float DISCONNECT_LOSE_INTERVAL = 125f; - - private const float DISCONNECT_CHECK_INTERVAL = 65f; - - private const float DISCONNECT_INTERVAL = 10f; - - private const float SOCKET_REPLACE_INTERVAL = 50f; private bool _isAlreadyTriedSocketReplace; @@ -35,7 +28,7 @@ public class DisconnectToLoseChecker : NetworkBattleIntervalCheckerBase public bool IsSelfDisconnectLose() { - if (IsSelfDisConnectOnTimeout() || ToolboxGame.RealTimeNetworkAgent.IsReceiveSelfDisconnect) + if (IsSelfDisConnectOnTimeout() || _networkBattleManagerBase.InstanceNetworkAgent.IsReceiveSelfDisconnect) { return true; } @@ -90,7 +83,7 @@ public class DisconnectToLoseChecker : NetworkBattleIntervalCheckerBase base.IntervalCheck(); if (!_isAlreadyTriedSocketReplace && (float)GetDisconnectTime() >= 50f) { - if (!_isSocketOpenDisconnectLog && ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.IsOpen()) + if (!_isSocketOpenDisconnectLog && _networkBattleManagerBase.InstanceNetworkAgent != null && _networkBattleManagerBase.InstanceNetworkAgent.IsOpen()) { _isSocketOpenDisconnectLog = true; } diff --git a/SVSim.BattleEngine/Engine/DoMatchingBase.cs b/SVSim.BattleEngine/Engine/DoMatchingBase.cs index c0cd3671..3cea0e5c 100644 --- a/SVSim.BattleEngine/Engine/DoMatchingBase.cs +++ b/SVSim.BattleEngine/Engine/DoMatchingBase.cs @@ -47,11 +47,6 @@ public class DoMatchingBase : BaseTask SkipAllCuteResultCodeCheckErrorPopup(); } - public virtual void SetParameter(int deck_no, int need_init, int log, bool includeCardMasterHash = false) - { - base.Params = ((need_init == 1 || includeCardMasterHash) ? new DoMatchingTaskIncludeCardMasterHashParam(deck_no, need_init, log) : new DoMatchingTaskParam(deck_no, need_init, log)); - } - protected override int Parse() { int num = base.Parse(); @@ -86,18 +81,4 @@ public class DoMatchingBase : BaseTask CardMaster.SetBattleCardMasterId(jsonData["card_master_id"].ToInt()); } } - - protected void SettingDoMatchingData() - { - Data.DoMatchingDetail.data = new DoMatchingDetail(); - Data.DoMatchingDetail.data.matchingState = base.ResponseData["data"]["matching_state"].ToInt(); - Data.DoMatchingDetail.data.timeoutPeriod = base.ResponseData["data"]["timeout_period"].ToInt(); - Data.DoMatchingDetail.data.retryPeriod = base.ResponseData["data"]["retry_period"].ToInt(); - Data.DoMatchingDetail.data.battleId = (base.ResponseData["data"].Keys.Contains("battle_id") ? base.ResponseData["data"]["battle_id"].ToString() : ""); - Data.DoMatchingDetail.data.nodeServerUrl = base.ResponseData["data"]["node_server_url"].ToString(); - if (base.ResponseData["data"].Keys.Contains("mission_parameter")) - { - GameMgr.GetIns().GetDataMgr().SetMissionNecessaryInformation(base.ResponseData["data"]["mission_parameter"]); - } - } } diff --git a/SVSim.BattleEngine/Engine/DoMatchingDetail.cs b/SVSim.BattleEngine/Engine/DoMatchingDetail.cs index 5c7393d4..ca06f9b4 100644 --- a/SVSim.BattleEngine/Engine/DoMatchingDetail.cs +++ b/SVSim.BattleEngine/Engine/DoMatchingDetail.cs @@ -1,41 +1,5 @@ public class DoMatchingDetail { - public int matchingState; - - public int timeoutPeriod; - - public int retryPeriod; public string battleId; - - public string nodeServerUrl; - - public int finishLoadTask_MatchingState; - - public bool isEnableWinnerReward { get; private set; } - - public int winnerRewardGrade { get; private set; } - - public string winnerRewardMessage { get; private set; } - - public long GetBattleId() - { - if (string.IsNullOrEmpty(battleId)) - { - return -1L; - } - return long.Parse(battleId); - } - - public void SetWinnerRewardInfo(int grade, string message) - { - isEnableWinnerReward = true; - winnerRewardMessage = message; - winnerRewardGrade = grade; - } - - public void ClearWinnerRewardInfo() - { - isEnableWinnerReward = false; - } } diff --git a/SVSim.BattleEngine/Engine/DofDiffusionBloomOverlayParam.cs b/SVSim.BattleEngine/Engine/DofDiffusionBloomOverlayParam.cs deleted file mode 100644 index c83f446f..00000000 --- a/SVSim.BattleEngine/Engine/DofDiffusionBloomOverlayParam.cs +++ /dev/null @@ -1,295 +0,0 @@ -using System; -using UnityEngine; - -[Serializable] -public class DofDiffusionBloomOverlayParam -{ - public enum DofDiffusionBloomType - { - None, - DofBloom, - DiffusionDofBloom, - Bloom, - DiffusionBloom, - Dof, - OldDof, - OldDofFastBloom, - OverlayOnly - } - - public enum BloomScreenBlendMode - { - Screen, - Add - } - - [SerializeField] - private DofDiffusionBloomType _useDofDiffusionBloomType; - - [SerializeField] - private bool _isEnableOldDof; - - [SerializeField] - private bool _isEnableDof; - - [SerializeField] - private bool _isEnableDiffusion; - - [SerializeField] - private bool _isEnableBloom = true; - - [Header("Rich DOF")] - public DepthBlurAndBloom.DofQuality DofQualityType = DepthBlurAndBloom.DofQuality.OnlyBackground; - - public DepthBlurAndBloom.DofFocalType DofFocalType = DepthBlurAndBloom.DofFocalType.Position; - - [SerializeField] - private Transform _dofFocalTransfrom; - - [SerializeField] - private Vector3 _dofFocalPosition = Vector3.zero; - - [SerializeField] - private float _dofFocalPoint = 1f; - - public float DofSmoothness = 0.5f; - - public float DofFocalSize = 4f; - - public float DofMaxFocalSize; - - public float DofMaxBlurSpread = 1.75f; - - [SerializeField] - public float DofForegroundSize; - - [SerializeField] - public DepthBlurAndBloom.DofBlur DofBlurType; - - [Range(0f, 1f)] - [Header("Rich Bloom")] - public float BloomDofWeight = 1f; - - [Range(0f, 1.5f)] - public float BloomThreshold = 0.95f; - - [Range(0f, 15f)] - public float BloomIntensity = 8f; - - [Range(0f, 10f)] - public float BloomBlurSize = 2f; - - public BloomScreenBlendMode BloomBlendMode; - - [Range(0.1f, 10f)] - [Header("Diffusion")] - public float DiffusionBlurSize = 10f; - - [Range(0f, 2f)] - public float DiffusionBright = 1f; - - [Range(0f, 1f)] - public float DiffusionThreshold = 0.4f; - - [SerializeField] - [Range(0f, 2f)] - public float DiffusionSaturation = 1.2f; - - [SerializeField] - [Range(0f, 2f)] - public float DiffusionContrast = 1f; - - [NonSerialized] - public float DefaultDiffusionThreshold = 0.4f; - - [Range(0f, 1f)] - public float EndDiffusionThreshold = 0.8f; - - [Range(0f, 85f)] - public int FadeOutStartFrame = 82; - - [Range(0f, 85f)] - public int FadeOutEndFrame = 82; - - [NonSerialized] - public Camera TargetCamera; - - private float _ballBlurPoewrFactor; - - private float _ballBlurBrightnessThreshhold = 1f; - - private float _ballBlurBrightnessIntensity = -1f; - - private float _ballBlurSpread = 1f; - - private bool _isPointBallBlur; - - [SerializeField] - [Header("ScreenOverlay")] - private Class3dScreenOverlay _screenOverlay = new Class3dScreenOverlay(); - - public bool IsDOF; - - public bool IsBloom; - - public bool IsDiffution; - - public bool IsScreenOverlay; - - public bool IsEnable => _useDofDiffusionBloomType != DofDiffusionBloomType.None; - - public DofDiffusionBloomType UseDofDiffusionBloomType => _useDofDiffusionBloomType; - - public bool IsEnableOldDof - { - get - { - return _isEnableOldDof; - } - set - { - _isEnableOldDof = value; - } - } - - public bool IsEnableDof - { - get - { - return _isEnableDof; - } - set - { - _isEnableDof = value; - } - } - - public bool IsEnableDiffusion - { - get - { - return _isEnableDiffusion; - } - set - { - _isEnableDiffusion = value; - } - } - - public bool IsEnableBloom - { - get - { - return _isEnableBloom; - } - set - { - _isEnableBloom = value; - } - } - - public bool IsEnableOverlay => ScreenOverlay.IsEnable; - - public bool IsEnableDofAutoDisable { get; set; } = true; - - public Transform DofFocalTransfrom - { - get - { - return _dofFocalTransfrom; - } - set - { - _dofFocalTransfrom = value; - DofFocalType = DepthBlurAndBloom.DofFocalType.Transform; - } - } - - public Vector3 DofFocalPosition - { - get - { - return _dofFocalPosition; - } - set - { - _dofFocalPosition = value; - DofFocalType = DepthBlurAndBloom.DofFocalType.Position; - } - } - - public float DofFocalPoint - { - get - { - return _dofFocalPoint; - } - set - { - _dofFocalPoint = value; - DofFocalType = DepthBlurAndBloom.DofFocalType.Point; - } - } - - public float BallBlurPowerFactor - { - get - { - return _ballBlurPoewrFactor; - } - set - { - _ballBlurPoewrFactor = value; - } - } - - public float BallBlurBrightnessThreshhold - { - get - { - return _ballBlurBrightnessThreshhold; - } - set - { - _ballBlurBrightnessThreshhold = value; - } - } - - public float BallBlurBrightnessIntensity - { - get - { - return _ballBlurBrightnessIntensity; - } - set - { - _ballBlurBrightnessIntensity = value; - } - } - - public float BallBlurSpread - { - get - { - return _ballBlurSpread; - } - set - { - _ballBlurSpread = value; - } - } - - public bool IsPointBallBlur - { - get - { - return _isPointBallBlur; - } - set - { - _isPointBallBlur = value; - } - } - - public Class3dScreenOverlay ScreenOverlay => _screenOverlay; -} diff --git a/SVSim.BattleEngine/Engine/Effect.cs b/SVSim.BattleEngine/Engine/Effect.cs index 8ad99d19..aa69ec44 100644 --- a/SVSim.BattleEngine/Engine/Effect.cs +++ b/SVSim.BattleEngine/Engine/Effect.cs @@ -1,4 +1,3 @@ -using CriWare; using UnityEngine; public class Effect : MonoBehaviour @@ -13,18 +12,8 @@ public class Effect : MonoBehaviour private bool m_Use; - private GameObject m_ChaseObjIns; - - private GameObject m_LookAtObject; - private bool _buff; - private CriAtomSource m_EffectSeSource; - - private Camera _lookAtCamera; - - private bool _isFollowScale; - public Effect() { m_Type = EffectMgr.EffectType.NONE; @@ -34,272 +23,13 @@ public class Effect : MonoBehaviour _buff = false; } - public void Init(EffectMgr.EffectType type, bool isCommon = false, string SePath = "", bool isFollowScale = false) - { - m_Type = type; - if (!string.IsNullOrEmpty(SePath)) - { - m_EffectSeSource = base.gameObject.GetComponent(); - m_EffectSeSource.use3dPositioning = true; - m_EffectSeSource.playOnStart = false; - } - m_GameObjIns = base.gameObject; - m_ParticleSystem = m_GameObjIns.GetComponent(); - m_ParticleSystem.GetComponent().sortingOrder = 4; - if (isCommon) - { - m_ParticleSystem.Stop(); - } - _isFollowScale = isFollowScale; - } - - public void Play(Vector3 Pos, Quaternion Rot) - { - m_Pos = Pos; - m_GameObjIns.transform.position = m_Pos; - m_GameObjIns.transform.rotation = Rot; - On(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - if (m_EffectSeSource != null) - { - m_EffectSeSource.Play(); - } - } - - public void Play(Vector3 Pos) - { - m_Pos = Pos; - m_GameObjIns.transform.position = m_Pos; - On(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - if (m_EffectSeSource != null) - { - m_EffectSeSource.Play(); - } - } - - public void Play(Vector3 Pos, GameObject obj) - { - m_ChaseObjIns = obj; - if (obj != null) - { - _buff = true; - } - m_Pos = Pos; - m_GameObjIns.transform.position = m_Pos; - On(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - if (m_EffectSeSource != null) - { - m_EffectSeSource.Play(); - } - } - - public void Play(float PosX, float PosY, float PosZ) - { - m_Pos.x = PosX; - m_Pos.y = PosY; - m_Pos.z = PosZ; - m_GameObjIns.transform.position = m_Pos; - On(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - if (m_EffectSeSource != null) - { - m_EffectSeSource.Play(); - } - } - - public void Play(float PosX, float PosY) - { - m_Pos.x = PosX; - m_Pos.y = PosY; - m_GameObjIns.transform.position = m_Pos; - On(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - if (m_EffectSeSource != null) - { - m_EffectSeSource.Play(); - } - } - - public void Play() - { - On(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - } - - public void FadeOut() - { - m_ParticleSystem.Stop(); - } - - public void FadeIn() - { - On(); - m_ParticleSystem.Play(); - } - - public void Stop() - { - Off(); - m_GameObjIns.SetActive(value: false); - m_ParticleSystem.Stop(); - } - - public void PlayBuff(GameObject obj) - { - m_Pos = obj.transform.position; - m_GameObjIns.transform.position = m_Pos; - m_ChaseObjIns = obj; - _buff = true; - On(); - UpdatePositionAndRotation(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - } - - public void StopBuff() - { - m_ChaseObjIns = null; - _buff = false; - Off(); - m_GameObjIns.SetActive(value: false); - m_ParticleSystem.Stop(); - } - - public void StartLookAtEffect(GameObject fromObject, GameObject toObject) - { - m_ChaseObjIns = fromObject; - m_LookAtObject = toObject; - _buff = true; - On(); - UpdatePositionAndRotation(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - } - - public void StartLookAtCameraEffect(GameObject fromObject, Camera toCamera) - { - m_ChaseObjIns = fromObject; - _lookAtCamera = toCamera; - _buff = true; - On(); - UpdatePositionAndRotation(); - m_GameObjIns.SetActive(value: true); - m_ParticleSystem.Play(); - } - - public void StopLookAtEffect() - { - m_ChaseObjIns = null; - m_LookAtObject = null; - _buff = false; - Off(); - m_GameObjIns.SetActive(value: false); - m_ParticleSystem.Stop(); - } - - private void UpdatePositionAndRotation() - { - m_GameObjIns.transform.position = m_ChaseObjIns.transform.position; - m_GameObjIns.transform.rotation = CalculateRotation(); - } - - private void UpdateScale() - { - m_GameObjIns.transform.localScale = m_ChaseObjIns.transform.localScale; - } - - private Quaternion CalculateRotation() - { - if (m_LookAtObject != null) - { - Vector3 position = m_ChaseObjIns.transform.position; - Vector3 position2 = m_LookAtObject.transform.position; - float z = Mathf.Atan2(position2.y - position.y, position2.x - position.x) * 57.29578f - 90f; - return Quaternion.Euler(0f, 0f, z); - } - if (_lookAtCamera != null) - { - Vector3 position3 = m_ChaseObjIns.transform.position; - Vector3 position4 = _lookAtCamera.transform.position; - return Quaternion.FromToRotation(Vector3.forward, position3 - position4); - } - return m_ChaseObjIns.transform.rotation; - } - - private void Update() - { - if (!_buff) - { - return; - } - if (m_ChaseObjIns != null) - { - if (_isFollowScale) - { - UpdateScale(); - } - UpdatePositionAndRotation(); - } - else - { - StopBuff(); - } - } - - public void On() - { - m_Use = true; - } - - public void Off() - { - m_Use = false; - } - - public void Change() - { - m_Use = !m_Use; - } - public void ChangeParticleColor(Color color) { MotionUtils.ChangeParticleSystemColor(m_ParticleSystem.gameObject, color); } - public EffectMgr.EffectType GetEffectType() - { - return m_Type; - } - public GameObject GetGameObjIns() { return m_GameObjIns; } - - public bool IsOn() - { - return m_Use; - } - - public bool IsPlay() - { - if (m_ParticleSystem.isPlaying || m_ParticleSystem.isPaused || m_ParticleSystem.IsAlive()) - { - return true; - } - return false; - } - - public GameObject GetChaseObjIns() - { - return m_ChaseObjIns; - } } diff --git a/SVSim.BattleEngine/Engine/Effect3dInformation.cs b/SVSim.BattleEngine/Engine/Effect3dInformation.cs deleted file mode 100644 index 57fe6004..00000000 --- a/SVSim.BattleEngine/Engine/Effect3dInformation.cs +++ /dev/null @@ -1,479 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -public class Effect3dInformation : MonoBehaviour -{ - public enum ModelBone - { - None = 1000, - Hip = 0, - Waist = 1, - Chest = 2, - Neck = 3, - Head = 4, - Shoulder_L = 5, - Arm_L = 6, - Elbow_L = 7, - Wrist_L = 8, - Shoulder_R = 9, - Arm_R = 10, - Elbow_R = 11, - Wrist_R = 12, - Eye_L = 13, - Eye_R = 14, - Mouth_Root = 15, - Prop_Under_Root = 16, - Prop_Top_Root = 17, - Bone_Max = 18 - } - - [Serializable] - public class EffectData - { - public GameObject Effect; - - private GameObject _effectInstance; - - private GameObject _attachRoot; - - public ModelBone AttachBone = ModelBone.None; - - private ModelBone _selectBone = ModelBone.None; - - public Vector3 Offset; - - public Vector3 RotateOffset; - - public ClassCharaPrm.MotionType PlayMotionType = ClassCharaPrm.MotionType.extra; - - private ClassCharaPrm.MotionType _nowMotionType = ClassCharaPrm.MotionType.idle; - - public float DelayTime; - - public float PlayTime; - - private bool _isPlay; - - public string EffectPath = ""; - - private bool _isLoad; - - private bool _isSetShader; - - private bool _isLoadMaterial; - - private bool _isLoadingMaterial; - - private string _testResoucePath = "Assets/_Wizard/Resources/"; - - private string _testEffectResoucePath = "Model/Effect/"; - - private string _resoucePath = "Assets/_WizardResources2/Resources/"; - - private string _effectResoucePath = "Jpn/Effect/Effects/"; - - public void UpdatePosition(Effect3dInformation info) - { - if (Effect != null) - { - if (_effectInstance == null) - { - LoadEffectInstance(info); - } - else - { - if (Effect.name != _effectInstance.name) - { - LoadEffectInstance(info); - } - if (!_isLoadingMaterial) - { - if (!info.IsTestScene) - { - LoadParticleMaterials(_effectInstance); - } - _isLoadingMaterial = true; - } - else if (_isLoadMaterial && !_isSetShader) - { - SetParticleShader(_effectInstance); - _isSetShader = true; - } - } - } - if (_effectInstance != null && _isPlay) - { - if (AttachBone != _selectBone || _attachRoot == null) - { - _attachRoot = info._boneList[AttachBone]; - _selectBone = AttachBone; - } - Vector3 position = _attachRoot.transform.position; - Quaternion quaternion = Quaternion.Euler(RotateOffset); - _effectInstance.transform.localRotation = _attachRoot.transform.rotation * quaternion; - Vector3 vector = _effectInstance.transform.rotation * Offset; - _effectInstance.transform.localPosition = position + vector; - } - } - - public void DestroyEffect() - { - if (_effectInstance != null) - { - UnityEngine.Object.Destroy(_effectInstance); - } - } - - public void LoadEffectInstance(Effect3dInformation info) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (!(_effectInstance == null) || !(EffectPath != "") || _isLoad) - { - return; - } - if (EffectPath.Contains(_testResoucePath)) - { - EffectPath = EffectPath.Replace(_testResoucePath, ""); - } - if (EffectPath.Contains(_testEffectResoucePath)) - { - EffectPath = EffectPath.Replace(_testEffectResoucePath, ""); - } - if (EffectPath.Contains(_resoucePath)) - { - EffectPath = EffectPath.Replace(_resoucePath, ""); - } - if (EffectPath.Contains(_effectResoucePath)) - { - EffectPath = EffectPath.Replace(_effectResoucePath, ""); - } - if (EffectPath.Contains(".prefab")) - { - EffectPath = EffectPath.Replace(".prefab", ""); - } - _ = _effectResoucePath + EffectPath; - Toolbox.ResourcesManager.GetAssetTypePath(EffectPath, ResourcesManager.AssetLoadPathType.Effect2D); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (info.IsLoad && !(_effectInstance != null)) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(EffectPath, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true); - UnityEngine.Object original = Toolbox.ResourcesManager.LoadObject(assetTypePath); - _effectInstance = UnityEngine.Object.Instantiate(original, info.transform.parent) as GameObject; - Effect = _effectInstance; - _effectInstance.SetLayer(0, isSetChildren: true); - _isPlay = true; - } - })); - sequentialVfxPlayer.Register(WaitVfx.Create(0.1f)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (!(_effectInstance == null)) - { - _effectInstance.SetActive(value: false); - _isPlay = false; - _isLoad = true; - } - })); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(sequentialVfxPlayer); - } - - public void SetParticleShader(GameObject effectObj) - { - if (!_isLoadMaterial) - { - return; - } - Renderer[] componentsInChildren = effectObj.transform.GetComponentsInChildren(includeInactive: true); - for (int i = 0; i < componentsInChildren.Length; i++) - { - if (componentsInChildren[i].name.Contains("skn_") || componentsInChildren[i].name.Contains("emitter") || componentsInChildren[i].name.Contains("null")) - { - continue; - } - ParticleSystemRenderer particleSystemRenderer = componentsInChildren[i] as ParticleSystemRenderer; - if (particleSystemRenderer != null) - { - string[] array = componentsInChildren[i].name.Split('&'); - if (particleSystemRenderer.trailMaterial != null || array.Length > 1) - { - particleSystemRenderer.trailMaterial = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(array[1], ResourcesManager.AssetLoadPathType.Effect2DMaterials, isfetch: true)) as Material; - particleSystemRenderer.trailMaterial.shader = Shader.Find(particleSystemRenderer.trailMaterial.shader.name); - } - componentsInChildren[i].material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(array[0], ResourcesManager.AssetLoadPathType.Effect2DMaterials, isfetch: true)) as Material; - componentsInChildren[i].material.shader = Shader.Find(componentsInChildren[i].material.shader.name); - } - else - { - componentsInChildren[i].material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(componentsInChildren[i].name, ResourcesManager.AssetLoadPathType.Effect2DMaterials, isfetch: true)) as Material; - componentsInChildren[i].material.shader = Shader.Find(componentsInChildren[i].material.shader.name); - } - } - } - - private void SetMaterial(Renderer renderer) - { - if (renderer.name.Contains("&")) - { - string[] array = renderer.name.Split('&'); - for (int i = 0; i < array.Length; i++) - { - Toolbox.ResourcesManager.GetAssetTypePath(array[i], ResourcesManager.AssetLoadPathType.Effect2DMaterials); - renderer.material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(renderer.name, ResourcesManager.AssetLoadPathType.Effect2DMaterials, isfetch: true)) as Material; - renderer.materials[i].shader = Shader.Find(renderer.materials[i].shader.name); - } - } - else - { - Toolbox.ResourcesManager.GetAssetTypePath(renderer.name, ResourcesManager.AssetLoadPathType.Effect2DMaterials); - renderer.material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(renderer.name, ResourcesManager.AssetLoadPathType.Effect2DMaterials, isfetch: true)) as Material; - renderer.material.shader = Shader.Find(renderer.material.shader.name); - } - } - - public void LoadParticleMaterials(GameObject effectObj) - { - List list = new List(); - Renderer[] componentsInChildren = effectObj.transform.GetComponentsInChildren(includeInactive: true); - for (int i = 0; i < componentsInChildren.Length; i++) - { - if (componentsInChildren[i].name.Contains("skn_") || componentsInChildren[i].name.Contains("emitter") || componentsInChildren[i].name.Contains("null")) - { - continue; - } - if (componentsInChildren[i].name.Contains("&")) - { - string[] array = componentsInChildren[i].name.Split('&'); - for (int j = 0; j < array.Length; j++) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(array[j], ResourcesManager.AssetLoadPathType.Effect2DMaterials); - if (assetTypePath.IsNotNullOrEmpty() && !list.Contains(assetTypePath)) - { - list.Add(assetTypePath); - } - } - } - else - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(componentsInChildren[i].name, ResourcesManager.AssetLoadPathType.Effect2DMaterials); - list.Add(assetTypePath2); - } - } - BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(list, delegate - { - _isLoadMaterial = true; - })); - } - - public void UpdateInformation(ClassCharaPrm.MotionType type) - { - if (_effectInstance != null && PlayMotionType != type && _nowMotionType != type && _isPlay) - { - _effectInstance.SetActive(value: false); - } - _nowMotionType = type; - } - - public void Play(Effect3dInformation info) - { - if (DelayTime > 0f) - { - if (_effectInstance == null) - { - Debug.LogError("Play effect play error! " + EffectPath); - } - else - { - info.StartCoroutine(PlayEffect(info)); - } - } - else if (!(_effectInstance == null)) - { - _effectInstance.SetActive(value: true); - _isPlay = true; - if (PlayTime > 0f) - { - info.StartCoroutine(StopEffect()); - } - } - } - - private IEnumerator PlayEffect(Effect3dInformation info) - { - yield return new WaitForSeconds(DelayTime); - _effectInstance.SetActive(value: true); - _isPlay = true; - if (PlayTime > 0f) - { - info.StartCoroutine(StopEffect()); - } - } - - private IEnumerator StopEffect() - { - yield return new WaitForSeconds(PlayTime); - _effectInstance.SetActive(value: false); - _isPlay = false; - } - } - - [Serializable] - public class EffectList - { - public EffectData[] _effectData; - } - - public GameObject ModelRoot; - - public GameObject FaceRoot; - - public GameObject PropRoot; - - private Dictionary _boneList; - - public EffectList EffectsList; - - public bool FixedEffect; - - public bool SaveButton; - - public bool LoadButton; - - private string _number = ""; - - public bool IsLoad; - - public bool IsTestScene; - - private void Start() - { - _boneList = new Dictionary(); - _boneList.Add(ModelBone.None, ModelRoot); - for (int i = 0; i < 18; i++) - { - ModelBone key = (ModelBone)i; - string text = key.ToString(); - GameObject children = GetChildren(ModelRoot.transform, text); - if (children == null) - { - children = GetChildren(FaceRoot.transform, text); - if (PropRoot != null && children == null) - { - string boneName = text.Replace("Prop_", ""); - children = GetChildren(PropRoot.transform, boneName); - } - } - if (children != null) - { - _boneList.Add(key, children.gameObject); - } - } - if (IsTestScene) - { - IsLoad = true; - return; - } - List list = new List(); - EffectData[] effectData = EffectsList._effectData; - foreach (EffectData effectData2 in effectData) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(effectData2.EffectPath, ResourcesManager.AssetLoadPathType.Effect2D)); - } - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(list, delegate - { - IsLoad = true; - })); - } - - public void UpdateInfo(ClassCharaPrm.MotionType type) - { - if (IsLoad && EffectsList._effectData.Length != 0) - { - EffectData[] effectData = EffectsList._effectData; - for (int i = 0; i < effectData.Length; i++) - { - effectData[i].UpdateInformation(type); - } - } - } - - public void PlayEffect(ClassCharaPrm.MotionType type) - { - if (EffectsList._effectData.Length == 0) - { - return; - } - EffectData[] effectData = EffectsList._effectData; - foreach (EffectData effectData2 in effectData) - { - if (effectData2.PlayMotionType == type) - { - effectData2.Play(this); - } - } - } - - private void LateUpdate() - { - if (EffectsList._effectData.Length != 0) - { - EffectData[] effectData = EffectsList._effectData; - for (int i = 0; i < effectData.Length; i++) - { - effectData[i].UpdatePosition(this); - } - } - } - - public void DestroyEffect() - { - if (EffectsList._effectData != null) - { - EffectData[] effectData = EffectsList._effectData; - for (int i = 0; i < effectData.Length; i++) - { - effectData[i]?.DestroyEffect(); - } - EffectsList._effectData = null; - } - } - - private GameObject GetChildren(Transform t, string boneName) - { - if (t.gameObject.name.Contains(boneName)) - { - return t.gameObject; - } - if (t.childCount == 0) - { - return null; - } - for (int i = 0; i < t.childCount; i++) - { - GameObject children = GetChildren(t.GetChild(i), boneName); - if (children != null) - { - return children; - } - } - return null; - } - - public void SaveInfo() - { - } - - public void LoadInfo(string number = "3604") - { - EffectData[] effectData = EffectsList._effectData; - for (int i = 0; i < effectData.Length; i++) - { - effectData[i].LoadEffectInstance(this); - } - _number = number; - } -} diff --git a/SVSim.BattleEngine/Engine/EffectBattle.cs b/SVSim.BattleEngine/Engine/EffectBattle.cs index ae42b228..8ca1fedd 100644 --- a/SVSim.BattleEngine/Engine/EffectBattle.cs +++ b/SVSim.BattleEngine/Engine/EffectBattle.cs @@ -1,34 +1,7 @@ -using System; -using CriWare; -using UnityEngine; - -public class EffectBattle : EffectIdx -{ - [HideInInspector] - public EffectMgr.MoveType moveType; - - [HideInInspector] - public CriAtomSource ECriAtomSource; - - private Vector3 FromPos; - - public Animation AnimationObj; - - [HideInInspector] - public EffectMgr.EngineType engineType { get; set; } - - [Obsolete] - public void PlaySummon(BattleCardBase card, Vector3 p0) - { - FromPos = p0; - base.gameObject.transform.position = FromPos; - } - - private void Start() - { - if (engineType == EffectMgr.EngineType.SOLID && AnimationObj == null) - { - AnimationObj = base.transform.GetComponentInChildren(); - } - } -} +using UnityEngine; + +public class EffectBattle : EffectIdx +{ + [HideInInspector] + public EffectMgr.EngineType engineType { get; set; } +} diff --git a/SVSim.BattleEngine/Engine/EffectSetUp.cs b/SVSim.BattleEngine/Engine/EffectSetUp.cs index 460ba7c9..c27bb5ba 100644 --- a/SVSim.BattleEngine/Engine/EffectSetUp.cs +++ b/SVSim.BattleEngine/Engine/EffectSetUp.cs @@ -4,28 +4,6 @@ using UnityEngine; public class EffectSetUp : MonoBehaviour { - public bool isBattle; - - public bool isField; public bool isFinished; - - private List _loadAssetList = new List(); - - private void Start() - { - if (GameMgr.GetIns() != null) - { - base.gameObject.SetActive(value: true); - _loadAssetList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(base.gameObject, delegate - { - isFinished = true; - }, isBattle, isField)); - } - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadAssetList); - } } diff --git a/SVSim.BattleEngine/Engine/EmblemInfoDetail.cs b/SVSim.BattleEngine/Engine/EmblemInfoDetail.cs index 2041e268..3e8de7e5 100644 --- a/SVSim.BattleEngine/Engine/EmblemInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/EmblemInfoDetail.cs @@ -2,5 +2,4 @@ using System.Collections.Generic; public class EmblemInfoDetail { - public List user_emblem_list; } diff --git a/SVSim.BattleEngine/Engine/EmitHandUtility.cs b/SVSim.BattleEngine/Engine/EmitHandUtility.cs index d4387c54..58333e6a 100644 --- a/SVSim.BattleEngine/Engine/EmitHandUtility.cs +++ b/SVSim.BattleEngine/Engine/EmitHandUtility.cs @@ -5,65 +5,10 @@ using Wizard.Battle.Phase; public static class EmitHandUtility { - public static void SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION skillSelectOperation, BattleManagerBase battleMgr, BattleCardBase cardInfoToSend, bool isEvolveSelect, List compInfoToSend = null, List activeSelectSkills = null, bool isBurialRite = false, bool isChoiceBrave = false) - { - NetworkStandardBattleMgr networkStandardBattleMgr = ConvertToStandardNetworkBattleMgr(battleMgr); - if (networkStandardBattleMgr == null) - { - return; - } - string text = string.Empty; - List list = new List(); - switch (skillSelectOperation) - { - case NetworkBattleSender.SELECT_SKILL_OPERATION.StartSelect: - case NetworkBattleSender.SELECT_SKILL_OPERATION.StartFusionSelect: - text = cardInfoToSend.Index.ToString(); - if (activeSelectSkills != null) - { - list.AddRange(from s in activeSelectSkills - where RegisterSkillConditionCheck.IsSkillConditionCheck(s, isNotHandCheck: true) - select s.SkillPrm.ownerCard.Skills.IndexOf(s)); - } - break; - case NetworkBattleSender.SELECT_SKILL_OPERATION.SelectCard: - case NetworkBattleSender.SELECT_SKILL_OPERATION.CompleteSelect: - case NetworkBattleSender.SELECT_SKILL_OPERATION.SelectFusionIngredient: - text = (cardInfoToSend.IsPlayer ? "1" : "0") + ConvertToThreeDigitCardIndex(cardInfoToSend.Index); - break; - case NetworkBattleSender.SELECT_SKILL_OPERATION.CompleteFusionSelect: - text = cardInfoToSend.Index.ToString(); - break; - case NetworkBattleSender.SELECT_SKILL_OPERATION.StartChoiceSelect: - text = cardInfoToSend.Index.ToString(); - break; - case NetworkBattleSender.SELECT_SKILL_OPERATION.CancelSelect: - case NetworkBattleSender.SELECT_SKILL_OPERATION.CancelChoiceSelect: - text = string.Empty; - break; - case NetworkBattleSender.SELECT_SKILL_OPERATION.SelectChoiceCard: - case NetworkBattleSender.SELECT_SKILL_OPERATION.CompleteChoiceSelect: - { - for (int i = 0; i < compInfoToSend.Count; i++) - { - if (i > 0) - { - text += ","; - } - text += compInfoToSend[i].Index; - } - break; - } - default: - Debug.LogError("Invalid Select Skill Operation"); - return; - } - networkStandardBattleMgr.NetworkSender.SendSelectSkill(skillSelectOperation, isEvolveSelect, text, list, isBurialRite, isChoiceBrave); - } public static void SendSelectObject(BattleManagerBase battleMgr, BattleCardBase selectedCard) { - if (!GameMgr.GetIns().GetDataMgr().IsRoomBattleType()) + if (true /* Pre-Phase-5b: no room battle type headless; always fall through */) { return; } @@ -91,22 +36,12 @@ public static class EmitHandUtility ConvertToStandardNetworkBattleMgr(battleMgr)?.NetworkSender.SendSlideObject(slideObjectType, selectedCard, attackingCard); } - public static void ResetSelectedSlideCard(BattleManagerBase battleMgr) - { - ConvertToStandardNetworkBattleMgr(battleMgr)?.NetworkSender.ResetSelectedSlideCard(); - } - private static NetworkStandardBattleMgr ConvertToStandardNetworkBattleMgr(BattleManagerBase battleMgr) { - if (ToolboxGame.RealTimeNetworkAgent == null) + if (battleMgr?.InstanceNetworkAgent == null) { return null; } return battleMgr as NetworkStandardBattleMgr; } - - private static string ConvertToThreeDigitCardIndex(int cardIndex) - { - return cardIndex.ToString().PadLeft(3, '0'); - } } diff --git a/SVSim.BattleEngine/Engine/EnemyAICoroutine.cs b/SVSim.BattleEngine/Engine/EnemyAICoroutine.cs index f895252c..8340d53c 100644 --- a/SVSim.BattleEngine/Engine/EnemyAICoroutine.cs +++ b/SVSim.BattleEngine/Engine/EnemyAICoroutine.cs @@ -33,20 +33,4 @@ public class EnemyAICoroutine { _coroutineObject.StopAllCoroutines(); } - - public void StopCoroutine(IEnumerator enumerator) - { - if (enumerator != null) - { - _coroutineObject.StopCoroutine(enumerator); - } - } - - public void StopCoroutine(Coroutine enumerator) - { - if (enumerator != null) - { - _coroutineObject.StopCoroutine(enumerator); - } - } } diff --git a/SVSim.BattleEngine/Engine/EnemyChoiceBraveButtonUI.cs b/SVSim.BattleEngine/Engine/EnemyChoiceBraveButtonUI.cs deleted file mode 100644 index 8d0f6359..00000000 --- a/SVSim.BattleEngine/Engine/EnemyChoiceBraveButtonUI.cs +++ /dev/null @@ -1,129 +0,0 @@ -using UnityEngine; - -public class EnemyChoiceBraveButtonUI : UIBase -{ - private const int CHOICE_BRAVE_BUTTON_HEIGHT = 135; - - private const int CHOICE_BRAVE_BUTTON_WEIGHT = 135; - - private const string CHOICE_BRAVE_BUTTON_ON_SPRITE_NAME = "battle_icon_hero_enemy_on"; - - private const string CHOICE_BRAVE_BUTTON_OFF_SPRITE_NAME = "battle_icon_hero_enemy_off"; - - [SerializeField] - private UISprite _choiceBraveButtonSprite; - - [SerializeField] - private UILabel _bpLabel; - - private const float HIDE_OFFSET = 450f; - - private const float SHOW_OFFSET = 350f; - - public Vector3 BPLabelPosition - { - get - { - if (!(_bpLabel != null)) - { - return Vector3.zero; - } - return _bpLabel.transform.position; - } - } - - public void ShowButton(bool isNewReplay) - { - if (isNewReplay) - { - MoveHbpButtonAnchor(Global.ENEMY_CHOICE_BRAVE_BUTTON_POSITION.y); - return; - } - MoveHbpButtonAnchor(200f); - base.gameObject.SetActive(value: true); - iTween.ValueTo(base.gameObject, iTween.Hash("from", 200, "to", Global.ENEMY_CHOICE_BRAVE_BUTTON_POSITION.y, "time", 0.5f, "delay", 0.1f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo)); - } - - public void HideButton() - { - UpdateSprite(); - iTween.ValueTo(base.gameObject, iTween.Hash("from", Global.ENEMY_CHOICE_BRAVE_BUTTON_POSITION.y, "to", 200, "time", 0.5f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo)); - } - - public void UpdateSprite() - { - if (BattleManagerBase.GetIns().BattleEnemy.CanChoiceBraveThisTurn) - { - EnablePulsateEffectAndSprite(); - _choiceBraveButtonSprite.spriteName = "battle_icon_hero_enemy_on"; - } - else - { - DisablePulsateEffectAndSprite(); - _choiceBraveButtonSprite.spriteName = "battle_icon_hero_enemy_off"; - } - } - - public void EnablePulsateEffectAndSprite() - { - GameMgr ins = GameMgr.GetIns(); - _choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_on"; - if (!ins.IsAdminWatch || !BattleManagerBase.GetIns().BattleEnemy.CanChoiceBrave) - { - ins.GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1); - return; - } - Effect effect = ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_HEROSKILL_1, base.transform.position, base.gameObject); - if (effect != null) - { - effect.gameObject.SetLayer(base.gameObject.layer, isSetChildren: true); - } - } - - public void DisablePulsateEffectAndSprite() - { - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1); - _choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_off"; - } - - private int SetYtoBottomAnchor(int posY) - { - int num = Mathf.FloorToInt(67f); - return posY - num; - } - - private int SetYtoTopAnchor(int posY) - { - int num = 67; - return posY + num; - } - - public void SetHbpButtonAnchor(float posX, float posY, float posZ, GameObject container) - { - base.transform.localPosition = new Vector3(posX, posY, posZ); - UIWidget component = GetComponent(); - component.bottomAnchor.target = container.transform; - component.topAnchor.target = container.transform; - component.bottomAnchor.relative = 1f; - component.bottomAnchor.absolute = SetYtoBottomAnchor((int)posY); - component.topAnchor.relative = 1f; - component.topAnchor.absolute = SetYtoTopAnchor((int)posY); - component.UpdateAnchors(); - } - - public void MoveHbpButtonAnchor(float posY) - { - UIWidget component = GetComponent(); - int num = (int)posY; - component.bottomAnchor.relative = 1f; - component.bottomAnchor.absolute = SetYtoBottomAnchor(num); - component.topAnchor.relative = 1f; - component.topAnchor.absolute = SetYtoTopAnchor(num); - component.UpdateAnchors(); - } - - public void SetBp(int num) - { - _bpLabel.text = num.ToString(); - } -} diff --git a/SVSim.BattleEngine/Engine/EnemyClassBattleCard.cs b/SVSim.BattleEngine/Engine/EnemyClassBattleCard.cs index a7c194e8..aa424ef5 100644 --- a/SVSim.BattleEngine/Engine/EnemyClassBattleCard.cs +++ b/SVSim.BattleEngine/Engine/EnemyClassBattleCard.cs @@ -8,14 +8,6 @@ public class EnemyClassBattleCard : ClassBattleCardBase { } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - if (isNullView) - { - return NullCardVfxCreator.GetInstance(); - } - return new EnemyClassCardVfxCreator((ClassBattleCardViewBase)battleCardView, this, base.SelfBattlePlayer.BattleView, _buildInfo.ResourceMgr); - } protected override IBattleCardView CreateView(BattleCardView.BuildInfo buildInfo, bool isNullView) { diff --git a/SVSim.BattleEngine/Engine/EnemyStatusPanelControl.cs b/SVSim.BattleEngine/Engine/EnemyStatusPanelControl.cs deleted file mode 100644 index e58c031b..00000000 --- a/SVSim.BattleEngine/Engine/EnemyStatusPanelControl.cs +++ /dev/null @@ -1,428 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Battle.UI; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class EnemyStatusPanelControl : MonoBehaviour, IStatusPanelControl -{ - private BattleManagerBase _battleMgr; - - [SerializeField] - private GameObject StatusPanel; - - [SerializeField] - private GameObject PPPanel; - - [SerializeField] - private GameObject StatusPanelAllwaysDisp; - - [SerializeField] - private UISprite EpPanel; - - [SerializeField] - private UISprite DeckIconSprite; - - [SerializeField] - private UILabel DeckLabelAlwaysDisp; - - [SerializeField] - private UISprite GraveIconSprite; - - [SerializeField] - private UILabel GraveLabelAlwaysDisp; - - [SerializeField] - private UILabel DeckLabel; - - [SerializeField] - private UILabel GraveLabel; - - [SerializeField] - private UILabel PPLabel; - - [SerializeField] - private UILabel PPLineLabel; - - [SerializeField] - private UILabel PPMaxLabel; - - [SerializeField] - private UILabel EpLabel; - - [SerializeField] - private UISprite[] EpList; - - [SerializeField] - private UISprite EpIcon; - - [SerializeField] - private UILabel HandCountLabel; - - [SerializeField] - private UILabel HandCountLabelAlwaysDisp; - - [SerializeField] - private UISprite HandCountIconSpriteAlwaysDisp; - - private const float ALWAYS_STATUS_PANEL_SHOW_ANIMATION_OFFSET = 350f; - - private const float ALWAYS_STATUS_PANEL_SHOW_ANIMATION_SECOND = 0.5f; - - private readonly Vector3 EP_PANEL_POSITION = new Vector3(235f, -90f, 0f); - - private readonly Vector3 ANYA_EP_PANEL_POSITION = new Vector3(207f, -90f, 0f); - - private const float EP_PANEL_OFFSET = 350f; - - private const float PP_PANEL_OFFSET = 300f; - - private const int ANYA_HIGH_RANK_SKIN_ID = 4413; - - private ParticleSystem[] GaugeShiftEfcChild; - - private bool isPlayer; - - private IDictionary DefaultPosDict; - - private Vector3 EpPanelPosition - { - get - { - if (GameMgr.GetIns().GetDataMgr().GetEnemySkinId() != 4413) - { - return EP_PANEL_POSITION; - } - return ANYA_EP_PANEL_POSITION; - } - } - - public Vector3 EpPanelOffScreenPosition => EpPanelPosition + Vector3.up * 350f; - - public Vector3 BpPanelOffScreenPosition => DefaultPosDict["BPPanel"] + Vector3.up * 350f; - - private void Start() - { - string text = Toolbox.SavedataManager.GetString("LANG_SETTING", "Eng"); - if (text == Global.LANG_TYPE.Eng.ToString() || text == Global.LANG_TYPE.Ger.ToString()) - { - PPPanel.transform.Find("PPIcon/PPSprite").gameObject.SetActive(value: false); - Vector3 vector = new Vector3(0f, 11f, 0f); - PPLabel.transform.localPosition += vector; - PPLineLabel.transform.localPosition += vector; - PPMaxLabel.transform.localPosition += vector; - } - PPPanel.transform.parent = BattleManagerBase.GetIns().Battle3DContainer.transform; - DefaultPosDict = new Dictionary(); - DefaultPosDict["StatusPanel"] = StatusPanel.transform.localPosition; - DefaultPosDict["PPPanel"] = new Vector3(PPPanel.transform.localPosition.x, 460f, PPPanel.transform.localPosition.z); - DefaultPosDict["StatusPanelAllwaysDisp"] = StatusPanelAllwaysDisp.transform.localPosition; - SetPp(0, 0); - SetDeck(0); - SetGrave(0); - PPPanel.transform.localPosition = DefaultPosDict["PPPanel"] + Vector3.up * 300f; - EpPanel.transform.localPosition = EpPanelOffScreenPosition; - PPPanel.SetActive(value: false); - EpPanel.gameObject.SetActive(value: false); - PPPanel.SetActive(value: false); - EpPanel.gameObject.SetActive(value: false); - StatusPanelAllwaysDisp.gameObject.SetActive(value: false); - List list = new List(); - list.Add(base.gameObject); - list.Add(PPPanel); - list.Add(EpPanel.gameObject); - UIManager.GetInstance().AttachAtlas(list); - } - - public void ChangePPPanelParent(Transform parent, Vector3 position) - { - PPPanel.transform.parent = parent; - DefaultPosDict["PPPanel"] = position; - if (PPPanel.GetComponent() != null) - { - StartPPPanelAnimation(); - } - else - { - PPPanel.transform.localPosition = DefaultPosDict["PPPanel"] + Vector3.up * 300f; - } - } - - public void SetUp(BattleManagerBase battleMgr) - { - _battleMgr = battleMgr; - } - - public void ShowStatus(bool isNewReplayMoveTurn) - { - if (BattlePlayerViewBase.AlwaysShowStatusPanel && !isNewReplayMoveTurn) - { - ShowStatusPanelAlways(); - } - else - { - StatusPanel.SetActive(value: true); - } - } - - public void ShowStatusPanelOnBattle() - { - StatusPanelAllwaysDisp.gameObject.SetActive(BattlePlayerViewBase.AlwaysShowStatusPanel); - } - - public void ShowStatusPanelAlways() - { - if (BattlePlayerViewBase.AlwaysShowStatusPanel) - { - StatusPanelAllwaysDisp.gameObject.SetActive(value: true); - Vector3 localPosition = DefaultPosDict["StatusPanelAllwaysDisp"] + Vector3.up * 350f; - StatusPanelAllwaysDisp.transform.localPosition = localPosition; - iTween.MoveTo(StatusPanelAllwaysDisp, iTween.Hash("position", DefaultPosDict["StatusPanelAllwaysDisp"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - } - - public void HideStatusPanelAlways() - { - if (BattlePlayerViewBase.AlwaysShowStatusPanel) - { - StatusPanelAllwaysDisp.gameObject.SetActive(value: false); - } - } - - public void ShowPpEp(bool isNotEPMax3, bool fixDirection = false, bool isNewReplay = false, bool isBanmenkun = false) - { - if (fixDirection) - { - isNotEPMax3 = false; - } - EpPanel.spriteName = GetEvoPanelSprite(isNotEPMax3); - bool flag = GameMgr.GetIns().GetDataMgr().GetEnemySkinId() == 4413; - if (isNotEPMax3) - { - EpIcon.transform.localPosition = new Vector3(-7.5f, -3.6f, 0f); - EpList[0].spriteName = "battle_icon_evo_off_mini"; - EpList[1].spriteName = "battle_icon_evo_off_mini"; - EpList[2].spriteName = "battle_icon_evo_off_mini"; - EpList[0].transform.localPosition = new Vector3(5.1f, -59.2f, 0f); - EpList[1].transform.localPosition = new Vector3(23.8f, -59.2f, 0f); - EpList[2].gameObject.SetActive(value: false); - if (isNewReplay) - { - EpPanel.transform.localScale = new Vector3(Mathf.Abs(EpPanel.transform.localScale.x), EpPanel.transform.localScale.y, EpPanel.transform.localScale.z); - EpIcon.transform.localScale = new Vector3(Mathf.Abs(EpIcon.transform.localScale.x), EpIcon.transform.localScale.y, EpIcon.transform.localScale.z); - } - if (flag) - { - EpPanel.transform.localScale = new Vector3(0f - Mathf.Abs(EpPanel.transform.localScale.x), EpPanel.transform.localScale.y, EpPanel.transform.localScale.z); - EpIcon.transform.localScale = new Vector3(0f - Mathf.Abs(EpIcon.transform.localScale.x), EpIcon.transform.localScale.y, EpIcon.transform.localScale.z); - } - } - else - { - EpIcon.transform.localPosition = new Vector3(8f, -3.6f, 0f); - EpList[0].spriteName = "battle_icon_evo_off_mini"; - EpList[1].spriteName = "battle_icon_evo_off_mini"; - EpList[2].spriteName = "battle_icon_evo_off_mini"; - EpList[0].transform.localPosition = new Vector3(17.1f, -59.2f, 0f); - EpList[1].transform.localPosition = new Vector3(-1.6f, -59.2f, 0f); - EpList[2].transform.localPosition = new Vector3(-20.2f, -59.2f, 0f); - if (isNewReplay) - { - EpList[2].gameObject.SetActive(value: true); - } - float x = ((fixDirection || isNewReplay || isBanmenkun) ? (0f - Mathf.Abs(EpPanel.transform.localScale.x)) : (0f - EpPanel.transform.localScale.x)); - if (flag) - { - x = Mathf.Abs(EpPanel.transform.localScale.x); - } - EpPanel.transform.localScale = new Vector3(x, EpPanel.transform.localScale.y, EpPanel.transform.localScale.z); - float x2 = ((fixDirection || isNewReplay || isBanmenkun) ? (0f - Mathf.Abs(EpIcon.transform.localScale.x)) : (0f - EpIcon.transform.localScale.x)); - if (flag) - { - x2 = Mathf.Abs(EpIcon.transform.localScale.x); - } - EpIcon.transform.localScale = new Vector3(x2, EpIcon.transform.localScale.y, EpIcon.transform.localScale.z); - } - if (!isNewReplay) - { - StartPPPanelAnimation(); - EpPanel.transform.localPosition = EpPanelOffScreenPosition; - iTween.MoveTo(EpPanel.gameObject, iTween.Hash("position", EpPanelPosition, "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - else - { - PPPanel.transform.localPosition = DefaultPosDict["PPPanel"]; - EpPanel.transform.localPosition = EpPanelPosition; - } - EpPanel.gameObject.SetActive(value: true); - } - - private void StartPPPanelAnimation() - { - PPPanel.transform.localPosition = DefaultPosDict["PPPanel"] + Vector3.up * 300f; - iTween.MoveTo(PPPanel, iTween.Hash("position", DefaultPosDict["PPPanel"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - PPPanel.SetActive(value: true); - } - - public void HideUI() - { - iTween.MoveTo(PPPanel, iTween.Hash("position", DefaultPosDict["PPPanel"] + Vector3.up * 300f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.MoveTo(EpPanel.gameObject, iTween.Hash("position", EpPanelOffScreenPosition, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - - public void SetDeck(int num) - { - DeckLabel.text = num.ToString(); - DeckLabelAlwaysDisp.text = num.ToString(); - } - - public void SetGrave(int num) - { - GraveLabel.text = num.ToString(); - GraveLabelAlwaysDisp.text = num.ToString(); - } - - public void SetHandCount(int num) - { - HandCountLabelAlwaysDisp.text = num.ToString(); - UISprite handCountIconSpriteAlwaysDisp = HandCountIconSpriteAlwaysDisp; - Color color = (HandCountLabelAlwaysDisp.color = ClassInfomationUIBase.GetHandCardCountColor(num)); - handCountIconSpriteAlwaysDisp.color = color; - } - - public void SetPp(int num, int max, bool isNewReplayMoveTurn = false) - { - PPLabel.text = num.ToString(); - PPMaxLabel.text = max.ToString(); - } - - public void PlayIncreasePpAnimation(int oldPp, int newPp) - { - } - - public void SetEp(int evo, int cnt) - { - if (evo > 0) - { - EpIcon.spriteName = "battle_icon_evo_off"; - EpLabel.gameObject.SetActive(value: true); - EpLabel.text = evo.ToString(); - return; - } - if (!_battleMgr.BattleEnemy.IsEpEvolveThisTurn) - { - EpIcon.spriteName = "battle_icon_evo_on"; - } - else - { - EpIcon.spriteName = "battle_icon_evo_off"; - } - EpLabel.gameObject.SetActive(value: false); - bool flag = GameMgr.GetIns().GetDataMgr().GetEnemySkinId() == 4413; - for (int i = 0; i < 3; i++) - { - if (EpList[i] != null && EpList[i].gameObject.activeSelf) - { - if (flag) - { - EpList[i].spriteName = ((i < _battleMgr.BattleEnemy.EpTotal - cnt) ? "battle_icon_evo_off_mini" : "battle_icon_evo_on_mini"); - } - else - { - EpList[i].spriteName = ((i < cnt) ? "battle_icon_evo_on_mini" : "battle_icon_evo_off_mini"); - } - } - } - if (cnt <= 0) - { - EpIcon.spriteName = "battle_icon_evo_off"; - } - } - - public VfxBase PlayIncreaseMaxEpAnimation(int oldMaxEp, int newMaxEp) - { - return InstantVfx.Create(delegate - { - EpPanel.spriteName = GetEvoPanelSprite(isNotEpMax3: false); - EpIcon.transform.localPosition = new Vector3(8f, -3.6f, 0f); - EpList[0].transform.localPosition = new Vector3(17.1f, -59.2f, 0f); - EpList[1].transform.localPosition = new Vector3(-1.6f, -59.2f, 0f); - EpList[2].transform.localPosition = new Vector3(-20.2f, -59.2f, 0f); - EpList[2].gameObject.SetActive(value: true); - EpPanel.transform.localScale = new Vector3(0f - EpPanel.transform.localScale.x, EpPanel.transform.localScale.y, EpPanel.transform.localScale.z); - EpIcon.transform.localScale = new Vector3(0f - EpIcon.transform.localScale.x, EpIcon.transform.localScale.y, EpIcon.transform.localScale.z); - }); - } - - public VfxBase PlayIncreaseUsableEpAnimation(int oldUsableEpAmount, int amountOfUsableEpGained, int maxEp) - { - return InstantVfx.Create(delegate - { - bool flag = GameMgr.GetIns().GetDataMgr().GetEnemySkinId() == 4413; - for (int i = oldUsableEpAmount; i < oldUsableEpAmount + amountOfUsableEpGained; i++) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_EP_5, EpList[flag ? (_battleMgr.BattleEnemy.EpTotal - i - 1) : i].transform.position); - } - }); - } - - public VfxBase PlayDecreaseUsableEpAnimation(int oldUsableEpAmount, int usedEp) - { - return InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CMN_UI_EP_6); - int num = Mathf.Max(oldUsableEpAmount - usedEp, 0); - EffectMgr effectMgr = GameMgr.GetIns().GetEffectMgr(); - bool flag = GameMgr.GetIns().GetDataMgr().GetEnemySkinId() == 4413; - for (int i = num; i < oldUsableEpAmount; i++) - { - effectMgr.Start(EffectMgr.EffectType.CMN_UI_EP_6, EpList[flag ? (_battleMgr.BattleEnemy.EpTotal - i - 1) : i].transform.position); - } - }); - } - - public void ChangeColor(Color color, float time) - { - TweenColor.Begin(StatusPanel, time, color); - TweenColor.Begin(DeckLabel.gameObject, time, color); - TweenColor.Begin(GraveLabel.gameObject, time, color); - TweenColor.Begin(DeckIconSprite.gameObject, time, color); - TweenColor.Begin(GraveIconSprite.gameObject, time, color); - } - - public Transform GetClassInfoAnchor() - { - return base.gameObject.transform.Find("AnchorTR"); - } - - public GameObject GetPPPanel() - { - return PPPanel; - } - - public GameObject GetEPIcon() - { - return EpIcon.gameObject; - } - - private string GetEvoPanelSprite(bool isNotEpMax3) - { - string text = "battle_evo_"; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - int enemySkinId = dataMgr.GetEnemySkinId(); - if (dataMgr.IsHighRankSkinEnemy()) - { - text = text + enemySkinId + "_"; - } - else if (dataMgr.Is3DSkin(isPlayer: false)) - { - text += "uma_"; - } - else if (Global.IsSnCollabSkin(enemySkinId)) - { - text += "sn_"; - } - return text + "base_" + (isNotEpMax3 ? "02" : "01"); - } -} diff --git a/SVSim.BattleEngine/Engine/EventBattleResult.cs b/SVSim.BattleEngine/Engine/EventBattleResult.cs index 59740448..771af87b 100644 --- a/SVSim.BattleEngine/Engine/EventBattleResult.cs +++ b/SVSim.BattleEngine/Engine/EventBattleResult.cs @@ -1,6 +1,3 @@ public enum EventBattleResult { - Lose, - Win, - NoContest } diff --git a/SVSim.BattleEngine/Engine/EventDelegate.cs b/SVSim.BattleEngine/Engine/EventDelegate.cs index faeffd68..a264498b 100644 --- a/SVSim.BattleEngine/Engine/EventDelegate.cs +++ b/SVSim.BattleEngine/Engine/EventDelegate.cs @@ -208,31 +208,6 @@ public class EventDelegate } } - public bool isEnabled - { - get - { - if (!mCached) - { - Cache(); - } - if (mRawDelegate && mCachedCallback != null) - { - return true; - } - if (mTarget == null) - { - return false; - } - MonoBehaviour monoBehaviour = mTarget; - if (!(monoBehaviour == null)) - { - return monoBehaviour.enabled; - } - return true; - } - } - public EventDelegate() { } @@ -649,40 +624,4 @@ public class EventDelegate list.Add(eventDelegate2); } } - - public static bool Remove(List list, Callback callback) - { - if (list != null) - { - int i = 0; - for (int count = list.Count; i < count; i++) - { - EventDelegate eventDelegate = list[i]; - if (eventDelegate != null && eventDelegate.Equals(callback)) - { - list.RemoveAt(i); - return true; - } - } - } - return false; - } - - public static bool Remove(List list, EventDelegate ev) - { - if (list != null) - { - int i = 0; - for (int count = list.Count; i < count; i++) - { - EventDelegate eventDelegate = list[i]; - if (eventDelegate != null && eventDelegate.Equals(ev)) - { - list.RemoveAt(i); - return true; - } - } - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/ExecutionInfoCreatorBase.cs b/SVSim.BattleEngine/Engine/ExecutionInfoCreatorBase.cs index 34396e60..79132e17 100644 --- a/SVSim.BattleEngine/Engine/ExecutionInfoCreatorBase.cs +++ b/SVSim.BattleEngine/Engine/ExecutionInfoCreatorBase.cs @@ -124,7 +124,7 @@ public class ExecutionInfoCreatorBase if (!(_skill is Skill_select) && !(_skill is Skill_copy_skill)) { dictionary.Add(i, cards[i]); - sequentialVfxPlayer.Register(new OneShotHeavenlyAegisPlayVfx(cards[i].BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } else { diff --git a/SVSim.BattleEngine/Engine/FadeUtility.cs b/SVSim.BattleEngine/Engine/FadeUtility.cs index 2b86bbff..32d9295c 100644 --- a/SVSim.BattleEngine/Engine/FadeUtility.cs +++ b/SVSim.BattleEngine/Engine/FadeUtility.cs @@ -6,32 +6,6 @@ public class FadeUtility { private static readonly AnimationCurve FADE_ALPHA_ANIM_CURVE = AnimationCurve.Linear(0f, 0f, 1f, 1f); - private const float FADE_FROM_ALPHA = 1f; - - private const float FADE_TO_ALPHA = 0f; - - private const float FADE_DURATION = 0.3f; - - private const float FADE_DELAY = 0f; - - public static void FadeInGameObject(GameObject obj, Action onFinish = null) - { - FadeFinish(obj); - FadeInObject(obj.AddMissingComponent(), delegate - { - onFinish.Call(); - }); - } - - public static void FadeOutGameObject(GameObject obj, Action onFinish = null) - { - FadeFinish(obj); - FadeOut(obj, delegate - { - onFinish.Call(); - }); - } - public static void FadeOutObjectAndNonActive(GameObject obj) { FadeFinish(obj); @@ -65,26 +39,6 @@ public class FadeUtility }); } - public static void ShowSoon(GameObject obj) - { - FadeFinish(obj); - UISprite component = obj.GetComponent(); - if (component != null) - { - component.alpha = 1f; - } - obj.gameObject.SetActive(value: true); - } - - public static void RemoveFadeObject(GameObject obj) - { - UITweenAlpha component = obj.GetComponent(); - if (component != null) - { - UnityEngine.Object.Destroy(component); - } - } - public static void FadeFinish(GameObject obj) { UITweenAlpha component = obj.GetComponent(); @@ -115,26 +69,4 @@ public class FadeUtility tweenAlpha.PlayForward(isReset: true); } } - - public static void FadeInObject(UITweenAlpha tweenAlpha, Action onFinish = null) - { - if (!(tweenAlpha == null)) - { - if (tweenAlpha._curve == null) - { - tweenAlpha._curve = FADE_ALPHA_ANIM_CURVE; - tweenAlpha._curve.postWrapMode = WrapMode.Once; - tweenAlpha._curve.preWrapMode = WrapMode.Once; - } - tweenAlpha._from = 0f; - tweenAlpha._to = 1f; - tweenAlpha._endTime = 0.3f; - tweenAlpha._delayTime = 0f; - tweenAlpha._finishCallBack = delegate - { - onFinish.Call(); - }; - tweenAlpha.PlayForward(isReset: true); - } - } } diff --git a/SVSim.BattleEngine/Engine/FieldBattleCard.cs b/SVSim.BattleEngine/Engine/FieldBattleCard.cs index c20a3025..e3712a11 100644 --- a/SVSim.BattleEngine/Engine/FieldBattleCard.cs +++ b/SVSim.BattleEngine/Engine/FieldBattleCard.cs @@ -67,17 +67,9 @@ public class FieldBattleCard : BattleCardBase { base.StartPlayCard(); base.SelfBattlePlayer.HandCardToField(this); - return base.VfxCreator.CreatePick(); + return NullVfx.GetInstance(); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - if (isNullView) - { - return NullCardVfxCreator.GetInstance(); - } - return new FieldCardVfxCreator(isPlayer, this, battleCardView, _buildInfo.ResourceMgr); - } protected override IBattleCardView CreateView(BattleCardView.BuildInfo buildInfo, bool isNullView) { @@ -90,7 +82,7 @@ public class FieldBattleCard : BattleCardBase public override VfxBase RecoveryInPlay(int inPlayIndex, bool newReplayMoveTurn = false) { - return ParallelVfxPlayer.Create(base.RecoveryInPlay(inPlayIndex, newReplayMoveTurn), new FieldMaskCardInPlayVfx(base.BattleCardView)); + return ParallelVfxPlayer.Create(base.RecoveryInPlay(inPlayIndex, newReplayMoveTurn), NullVfx.GetInstance()); } public override BattleCardBase VirtualClone(BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer) diff --git a/SVSim.BattleEngine/Engine/FilterController.cs b/SVSim.BattleEngine/Engine/FilterController.cs index d4e76b68..b4dedda2 100644 --- a/SVSim.BattleEngine/Engine/FilterController.cs +++ b/SVSim.BattleEngine/Engine/FilterController.cs @@ -17,18 +17,9 @@ public class FilterController : MonoBehaviour private enum eFILTER_TYPE { - COST, - FAVORITE, - RARITY, - TYPE, - FOIL, CLASS, - FORMAT, ATTACK, - LIFE, - SPOT, - MAX - } + LIFE} [Serializable] public class ButtonArray @@ -50,30 +41,6 @@ public class FilterController : MonoBehaviour public int Length => array.Length; } - private const float MARGIN_CLASS_LINE = 50f; - - private const float MARGIN_PACK_LINE = 38f; - - private const int ALL_BTN_LABEL_HEIGHT = 26; - - private const string FILTER_BTN_LEFT_ON = "pilltab_02_left_on"; - - private const string FILTER_BTN_LEFT_OFF = "pilltab_02_left_off"; - - private const string FILTER_BTN_MIDDLE_ON = "pilltab_02_middle_on"; - - private const string FILTER_BTN_MIDDLE_OFF = "pilltab_02_middle_off"; - - private const string FILTER_BTN_RIGHT_ON = "pilltab_02_right_on"; - - private const string FILTER_BTN_RIGHT_OFF = "pilltab_02_right_off"; - - private const string FILTER_BTN_SINGLE_ON = "pilltab_02_single_on"; - - private const string FILTER_BTN_SINGLE_OFF = "pilltab_02_single_off"; - - private const int ALL_BUTTON_INDEX = 0; - private IFormatBehavior _formatBehavior; private int[] FlagsArray; @@ -90,87 +57,25 @@ public class FilterController : MonoBehaviour [SerializeField] private UIGrid _gridPack; - [SerializeField] - private Transform _linePack; - private List _packBtnList = new List(); private List _packButtonFlagList = new List(); - [SerializeField] - private UIButton ResetBtn; - - [SerializeField] - private UIGrid _gridClass; - - [SerializeField] - private Transform _lineClass; - - [SerializeField] - private UITable _tableRotationBtn; - - [SerializeField] - private UILabel _labelRotationBtn; - [SerializeField] private UISprite _spriteRotationBtn; - [SerializeField] - private UITable _tableUnlimitedBtn; - - [SerializeField] - private UILabel _labelUnlimitedBtn; - [SerializeField] private UISprite _spriteUnlimitedBtn; - [SerializeField] - private GameObject _basicFilterRoot; - - [SerializeField] - private FlexibleGrid _basicGrid; - - [SerializeField] - private UIButton _detailFilterEnableButton; - - [SerializeField] - private UIButton _detailFilterDisableButton; - - [SerializeField] - private GameObject _detailFilterRoot; - [SerializeField] private FlexibleGrid _detailGrid; - [SerializeField] - private GameObject _detailFilterPrefab; - - [SerializeField] - private UIButton _keywordButton; - - [SerializeField] - private UIButton _typeButton; - - [SerializeField] - private FlexibleGrid _kewordListGrid; - [SerializeField] private FlexibleGrid _typeListGrid; - [SerializeField] - private CardDetailFilterOffButton _filterOffButtonOriginal; - - [SerializeField] - private TypeFilterDialog _typeFilterDialogPrefab; - - [SerializeField] - private GameObject _characterVoiceSearchRoot; - [SerializeField] private UIInputWizard _characterVoiceSearchInput; - private CardDetailFilterDialog _keywordFilter; - private List _keywordFilterList; private List _filterTypeList = new List(); @@ -185,8 +90,6 @@ public class FilterController : MonoBehaviour private MyRotationInfo _myRotationInfo; - private static bool _isEnableDetailFilter; - private MyRotationFilterType _myRotationFilterType; private bool _isMyRotationAllPackVisible; @@ -199,18 +102,6 @@ public class FilterController : MonoBehaviour public bool IsShow { get; set; } - private bool EnableCharacterVoiceInput - { - get - { - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Jpn.ToString() || CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Cht.ToString() || CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Chs.ToString() || CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString()) - { - return true; - } - return false; - } - } - public event Action OnValidate; public void Initialize(IFormatBehavior formatBehavior) @@ -227,125 +118,6 @@ public class FilterController : MonoBehaviour } } - private void Start() - { - UIManager.GetInstance().AttachAtlas(base.gameObject, isTargetChildren: false); - _filterOffButtonOriginal.gameObject.SetActive(value: false); - for (int i = 0; i < BtnArray.Length; i++) - { - for (int j = 0; j < BtnArray[i].Length; j++) - { - SetEventOnClickBtn(BtnArray[i][j].gameObject, (eFILTER_TYPE)i, j); - } - } - UIEventListener.Get(ResetBtn.gameObject).onClick = OnClickResetBtn; - UIEventListener.Get(BtnArray[6][1].gameObject).onPress = delegate(GameObject g, bool isPress) - { - if (isPress) - { - _spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isPress); - } - else - { - UpdateFormatSprite(_spriteRotationBtn, BtnArray[6][1]); - } - }; - UIEventListener uIEventListener = UIEventListener.Get(BtnArray[6][1].gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, (UIEventListener.VectorDelegate)delegate - { - UpdateFormatSprite(_spriteRotationBtn, BtnArray[6][1]); - }); - UIEventListener uIEventListener2 = UIEventListener.Get(BtnArray[6][1].gameObject); - uIEventListener2.onDragOut = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onDragOut, (UIEventListener.VoidDelegate)delegate - { - UpdateFormatSprite(_spriteRotationBtn, BtnArray[6][1]); - }); - UIEventListener.Get(BtnArray[6][2].gameObject).onPress = delegate(GameObject g, bool isPress) - { - if (isPress) - { - _spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isPress); - } - else - { - UpdateFormatSprite(_spriteUnlimitedBtn, BtnArray[6][2]); - } - }; - UIEventListener uIEventListener3 = UIEventListener.Get(BtnArray[6][2].gameObject); - uIEventListener3.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener3.onDrag, (UIEventListener.VectorDelegate)delegate - { - UpdateFormatSprite(_spriteUnlimitedBtn, BtnArray[6][2]); - }); - UIEventListener uIEventListener4 = UIEventListener.Get(BtnArray[6][2].gameObject); - uIEventListener4.onDragOut = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onDragOut, (UIEventListener.VoidDelegate)delegate - { - UpdateFormatSprite(_spriteUnlimitedBtn, BtnArray[6][2]); - }); - UIEventListener.Get(_keywordButton.gameObject).onClick = delegate - { - OnClickKeyWord(); - }; - UIEventListener.Get(_typeButton.gameObject).onClick = delegate - { - OnClickTypeFilter(); - }; - _characterVoiceSearchInput.onSubmit.Add(new EventDelegate(delegate - { - OnInputCharacterVoiceSearch(); - })); - _characterVoiceSearchInput.onDeselect.Add(new EventDelegate(delegate - { - OnInputCharacterVoiceSearch(); - })); - RefreshDetailFilterToggleButton(_isEnableDetailFilter); - UIEventListener.Get(_detailFilterEnableButton.gameObject).onClick = delegate - { - OnChangeDetailFilterEnable(isEnableDetailFilter: true); - }; - UIEventListener.Get(_detailFilterDisableButton.gameObject).onClick = delegate - { - OnChangeDetailFilterEnable(isEnableDetailFilter: false); - }; - _characterVoiceSearchRoot.SetActive(EnableCharacterVoiceInput); - _detailGrid.Reposition(); - } - - private void UpdateFormatSprite(UISprite iconSprite, UIButton button) - { - iconSprite.spriteName = RenameSpriteString(iconSprite.spriteName, button.gameObject.GetComponent().spriteName.EndsWith("on")); - } - - private void OnDestroy() - { - UIManager.GetInstance().getUIBase_CardManager().ClearKeyWordCache(); - } - - private void RefreshDetailFilterToggleButton(bool isEnableDetailFilter) - { - RenameBtnSprite(_detailFilterEnableButton, isEnableDetailFilter); - RenameBtnSprite(_detailFilterDisableButton, !isEnableDetailFilter); - _detailFilterRoot.SetActive(isEnableDetailFilter); - _basicFilterRoot.SetActive(!isEnableDetailFilter); - if (isEnableDetailFilter) - { - _detailGrid.Reposition(); - } - else - { - ResetBasicFilterLinePosition(); - _basicGrid.Reposition(); - } - _scrollView.UpdateScrollbars(); - _scrollView.ResetPosition(); - } - - private void OnChangeDetailFilterEnable(bool isEnableDetailFilter) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - RefreshDetailFilterToggleButton(isEnableDetailFilter); - _isEnableDetailFilter = isEnableDetailFilter; - } - public UIBase_CardManager.FilterParameter GetFilterParameter(UIBase_CardManager.FilterParameter param) { param.Cost = FlagsArray[0] >> 1; @@ -516,65 +288,6 @@ public class FilterController : MonoBehaviour return 1 << (int)classType; } - public void Show() - { - base.gameObject.SetActive(value: true); - IsShow = true; - _scrollView.ResetPosition(); - IFormatBehavior formatBehavior = _formatBehavior; - SetFilterVisible(eFILTER_TYPE.FORMAT, formatBehavior.IsShowFormatFilter); - if (formatBehavior.IsShowFormatFilter) - { - _labelRotationBtn.text = Data.SystemText.Get("Common_0154"); - _labelUnlimitedBtn.text = Data.SystemText.Get("Common_0155"); - _tableRotationBtn.Reposition(); - _tableUnlimitedBtn.Reposition(); - } - SetFilterVisible(eFILTER_TYPE.FAVORITE, formatBehavior.IsShowFavoriteFilter); - SetFilterVisible(eFILTER_TYPE.SPOT, formatBehavior.IsShowSpotCardFilter); - if (ClassSet.MainClass != CardBasePrm.ClanType.ALL) - { - ButtonArray buttonArray = BtnArray[5]; - if (formatBehavior.UseSubClass) - { - for (int i = 2; i < buttonArray.Length; i++) - { - buttonArray[i].gameObject.SetActive(i == GetClassBtnIndex(ClassSet.MainClass) || i == GetClassBtnIndex(ClassSet.SubClass)); - } - } - else - { - for (int j = 2; j < buttonArray.Length; j++) - { - buttonArray[j].gameObject.SetActive(j == GetClassBtnIndex(ClassSet.MainClass)); - } - } - } - SetPackButtons(); - ResetBasicFilterLinePosition(); - _basicGrid.Reposition(); - _scrollView.ResetPosition(); - _detailGrid.Reposition(); - } - - private void ResetBasicFilterLinePosition() - { - RepositionLine(_linePack, _gridPack, 38f); - RepositionLine(_lineClass, _gridClass, 50f); - } - - private void RepositionLine(Transform lineTransform, UIGrid grid, float margin) - { - grid.Reposition(); - int num = 0; - if (grid.maxPerLine > 0 && grid.GetChildList().Count > 0) - { - num = (grid.GetChildList().Count - 1) / grid.maxPerLine; - } - float num2 = (float)num * grid.cellHeight + margin; - lineTransform.localPosition = new Vector3(lineTransform.localPosition.x, 0f - num2, lineTransform.localPosition.z); - } - public void Hide() { base.gameObject.SetActive(value: false); @@ -611,11 +324,6 @@ public class FilterController : MonoBehaviour _spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: false); } - private void SetFilterVisible(eFILTER_TYPE filterType, bool isVisible) - { - BtnArray[(int)filterType][0].transform.parent.gameObject.SetActive(isVisible); - } - private int GetClassBtnIndex(CardBasePrm.ClanType ClassType) { return (int)(ClassType + 1); @@ -645,102 +353,6 @@ public class FilterController : MonoBehaviour return result; } - private void OnClickResetBtn(GameObject obj) - { - Reset(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - } - - private void SetEventOnClickBtn(GameObject btn, eFILTER_TYPE type, int index) - { - UIEventListener.Get(btn).onClick = delegate - { - OnClickBtn(type, index); - }; - } - - private void OnClickBtn(eFILTER_TYPE type, int index) - { - if (type == eFILTER_TYPE.FORMAT) - { - OnClickRadioBtn(type, index); - UpdateFormatIconInBtn(GetFormatBtnState()); - } - else - { - if (index == 0) - { - FlagsArray[(int)type] = 1; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - } - else - { - DisableBit(ref FlagsArray[(int)type], 0); - InvertBit(ref FlagsArray[(int)type], index); - if (FlagsArray[(int)type] == 0) - { - FlagsArray[(int)type] = 1; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(IsEnableBit(ref FlagsArray[(int)type], index) ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - RenameSpriteArray(type, FlagsArray[(int)type]); - } - this.OnValidate.Call(); - } - - private void UpdateFormatIconInBtn(Format inFormat) - { - switch (inFormat) - { - case Format.Rotation: - _spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isEnable: true); - _spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: false); - break; - case Format.Unlimited: - _spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isEnable: false); - _spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: true); - break; - default: - _spriteRotationBtn.spriteName = RenameSpriteString(_spriteRotationBtn.spriteName, isEnable: false); - _spriteUnlimitedBtn.spriteName = RenameSpriteString(_spriteUnlimitedBtn.spriteName, isEnable: false); - break; - } - } - - private void OnClickRadioBtn(eFILTER_TYPE type, int index) - { - UpdateRadioBtn(type, index); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - } - - private void UpdateRadioBtn(eFILTER_TYPE type, int index) - { - if (!IsEnableBit(ref FlagsArray[(int)type], index)) - { - FlagsArray[(int)type] = 0; - InvertBit(ref FlagsArray[(int)type], index); - RenameSpriteArray(type, FlagsArray[(int)type]); - } - } - - private void EnableBit(ref int target, int index) - { - int num = 1 << index; - target |= num; - } - - private void DisableBit(ref int target, int index) - { - int num = 1 << index; - target &= ~num; - } - - private void InvertBit(ref int target, int index) - { - int num = 1 << index; - target ^= num; - } - private bool IsEnableBit(ref int target, int index) { int num = 1 << index; @@ -900,7 +512,7 @@ public class FilterController : MonoBehaviour if (index == 0) { ResetPackButtonFlags(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } else { @@ -911,7 +523,7 @@ public class FilterController : MonoBehaviour _packButtonFlagList[0] = true; } bool flag = _packButtonFlagList[index]; - GameMgr.GetIns().GetSoundMgr().PlaySe(flag ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + } UpdatePackButtonSprites(); this.OnValidate.Call(); @@ -939,69 +551,6 @@ public class FilterController : MonoBehaviour } } - private void OnClickKeyWord() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - _keywordFilter = CardDetailFilterDialog.Create(_detailFilterPrefab, _keywordFilterList, _existKeyWordList); - _keywordFilter.Dialog.OnClose = delegate - { - _keywordFilterList = _keywordFilter.GetFilterList(); - RefreshCurrentKeyWordList(); - _detailGrid.Reposition(); - }; - _keywordFilter.OnChange = delegate - { - _keywordFilterList = _keywordFilter.GetFilterList(); - this.OnValidate.Call(); - }; - } - - private void OnClickTypeFilter() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - TypeFilterDialog typeFilter = TypeFilterDialog.Create(_typeFilterDialogPrefab.gameObject, _filterTypeList, _typeFilterList); - typeFilter.Dialog.OnClose = delegate - { - RefreshCurrentTypeFilterList(); - }; - typeFilter.OnChange = delegate - { - _filterTypeList = typeFilter.GetAllSelectType(); - this.OnValidate.Call(); - }; - } - - private void RefreshCurrentKeyWordList() - { - RemoveCurrentKeyWordList(); - if (_keywordFilterList == null) - { - return; - } - foreach (string keywordFilter in _keywordFilterList) - { - GameObject gameObject = NGUITools.AddChild(_kewordListGrid.gameObject, _filterOffButtonOriginal.gameObject); - gameObject.name = keywordFilter; - _currentFilterList.Add(gameObject); - gameObject.SetActive(value: true); - CardDetailFilterOffButton offButton = gameObject.GetComponent(); - offButton.Initialize(keywordFilter); - offButton.OnClick = delegate(string keyword) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); - _currentFilterList.Remove(offButton.gameObject); - UnityEngine.Object.DestroyImmediate(offButton.gameObject); - _kewordListGrid.Reposition(); - _keywordFilterList.Remove(keyword); - this.OnValidate.Call(); - _detailGrid.Reposition(); - OnUpdateTypeOrKeyWordFilter(); - }; - } - _kewordListGrid.Reposition(); - OnUpdateTypeOrKeyWordFilter(); - } - private void RemoveCurrentKeyWordList() { foreach (GameObject currentFilter in _currentFilterList) @@ -1011,35 +560,6 @@ public class FilterController : MonoBehaviour _currentFilterList.Clear(); } - private void RefreshCurrentTypeFilterList() - { - RemoveCurrentTypeFilterList(); - foreach (CardBasePrm.TribeType type in _filterTypeList) - { - string tribeNameByKey = DataMgr.GetTribeNameByKey((int)type); - GameObject gameObject = NGUITools.AddChild(_typeListGrid.gameObject, _filterOffButtonOriginal.gameObject); - gameObject.name = tribeNameByKey; - _currentTypeFilterList.Add(gameObject); - gameObject.SetActive(value: true); - CardDetailFilterOffButton offButton = gameObject.GetComponent(); - offButton.Initialize(tribeNameByKey); - offButton.OnClick = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); - _currentTypeFilterList.Remove(offButton.gameObject); - _filterTypeList.Remove(type); - UnityEngine.Object.DestroyImmediate(offButton.gameObject); - this.OnValidate.Call(); - _typeListGrid.Reposition(); - _detailGrid.Reposition(); - OnUpdateTypeOrKeyWordFilter(); - }; - } - _typeListGrid.Reposition(); - _detailGrid.Reposition(); - OnUpdateTypeOrKeyWordFilter(); - } - private void OnUpdateTypeOrKeyWordFilter() { _scrollView.RestrictWithinBounds(instant: false); @@ -1129,25 +649,6 @@ public class FilterController : MonoBehaviour } } - public void InitializeFilterForAllCardList(MyRotationInfo myRotationInfo) - { - List cardPool = UIManager.GetInstance().getUIBase_CardManager().SortIDList(CardMaster.GetInstance(_formatBehavior.CardMasterId).GetAllCardIds(), _formatBehavior.CardMasterId); - cardPool = RemoveTokenCard(cardPool); - UIBase_CardManager.FilterParameter filterParameter = new UIBase_CardManager.FilterParameter(); - filterParameter.Craftable = 1; - filterParameter.TypeFilter = new List(); - ClassSet = new ClassSet(CardBasePrm.ClanType.ALL); - UpdateAllSelectableKeyWord(UIManager.GetInstance().getUIBase_CardManager().SelectCardIDInConditionMask(cardPool, filterParameter, _formatBehavior, myRotationInfo, alreadySorted: true)); - SetTypeFilterSetting(cardPool, filterParameter, MyRotationFilterType.None); - UIManager.GetInstance().getUIBase_CardManager().AddKeyWordCache(cardPool, _formatBehavior.CardMasterId); - } - - public void InitializeForCardDestruct(IFormatBehavior formatBehavior, MyRotationInfo myRotationInfo) - { - Initialize(formatBehavior); - InitializeFilterForAllCardList(myRotationInfo); - } - public void UpdateTypeFilterForDeckEdit(List cardPool, ClassSet classSet, Format format, MyRotationInfo myRotationInfo, MyRotationFilterType myRotationFilterType) { InitializeFilterForDeckEdit(cardPool, classSet, format, myRotationInfo, myRotationFilterType); @@ -1193,9 +694,4 @@ public class FilterController : MonoBehaviour } } } - - private void OnInputCharacterVoiceSearch() - { - this.OnValidate.Call(); - } } diff --git a/SVSim.BattleEngine/Engine/FinishTaskBase.cs b/SVSim.BattleEngine/Engine/FinishTaskBase.cs index 87baf7d9..2e4d2c1a 100644 --- a/SVSim.BattleEngine/Engine/FinishTaskBase.cs +++ b/SVSim.BattleEngine/Engine/FinishTaskBase.cs @@ -6,8 +6,6 @@ public class FinishTaskBase : BaseTask { protected int classId; - protected const string data_str = "data"; - public bool IsResponseDataExist(JsonData response) { JsonData jsonData = response["data"]; @@ -18,42 +16,6 @@ public class FinishTaskBase : BaseTask return true; } - public BattleFinishParam SettingFinishBattleParameter(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire) - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - classId = class_id; - BattleFinishParam battleFinishParam = CreateBattleFinishParam(class_id, total_turn, evolve_count, enemy_evolve_count, battle_result, is_retire); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG, 0f); - if (battle_result == 0 && dataMgr.RecoveryData == null && RecoveryRecordManagerBase.IsExistsAINetworkRecoveryFile()) - { - dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_ai_network.json")); - } - JsonData recoveryData = dataMgr.RecoveryData; - if (recoveryData != null) - { - battleFinishParam.recovery_data = recoveryData.ToJson(); - } - BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true); - BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class; - battleFinishParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass); - base.Params = battleFinishParam; - return battleFinishParam; - } - - protected virtual BattleFinishParam CreateBattleFinishParam(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire) - { - return new BattleFinishParam - { - class_id = class_id, - total_turn = total_turn, - evolve_count = evolve_count, - enemy_evolve_count = enemy_evolve_count, - battle_result = battle_result, - is_retire = is_retire - }; - } - protected bool IsEffectiveErrorCode(int code) { if (resultCode != 1 && resultCode != 3502) diff --git a/SVSim.BattleEngine/Engine/FlexibleGrid.cs b/SVSim.BattleEngine/Engine/FlexibleGrid.cs index 022649ce..be78012a 100644 --- a/SVSim.BattleEngine/Engine/FlexibleGrid.cs +++ b/SVSim.BattleEngine/Engine/FlexibleGrid.cs @@ -8,9 +8,7 @@ public class FlexibleGrid : MonoBehaviour { public enum Order { - Horizontal, - Vertical - } + Horizontal } public enum PivotOption { @@ -38,20 +36,6 @@ public class FlexibleGrid : MonoBehaviour private bool _repositionCalled; - private void Start() - { - if (!_repositionCalled) - { - Reposition(); - } - } - - [Conditional("ENABLE_FLEXIBLE_GRID_LOG")] - private static void DebugLog(string log) - { - UnityEngine.Debug.Log(log); - } - [ContextMenu("Execute")] public void Reposition() { diff --git a/SVSim.BattleEngine/Engine/FontChanger.cs b/SVSim.BattleEngine/Engine/FontChanger.cs index 9379d59d..586a2b8b 100644 --- a/SVSim.BattleEngine/Engine/FontChanger.cs +++ b/SVSim.BattleEngine/Engine/FontChanger.cs @@ -5,9 +5,6 @@ using UnityEngine; public class FontChanger { - public void Start() - { - } public static IEnumerator FontChange(Action callback) { @@ -36,54 +33,6 @@ public class FontChanger callback?.Invoke(); } - public static IEnumerator FontTryChangePersistant(Action callback) - { - string font = getFont(); - string text = "font_" + font + ".unity3d"; - bool isDone = false; - bool isHandle = false; - string filename = text.ToLower(); - Toolbox.AssetManager.CachePersistantAssetBeforeManifestLoad(filename, delegate - { - AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(filename); - if (assetHandle != null) - { - assetHandle.isMultipleHandleIgnorAsset = true; - Toolbox.ResourcesManager.RegistTemporaryAsset(filename); - isHandle = true; - } - isDone = true; - }); - while (!isDone) - { - yield return 0; - } - if (isHandle) - { - Global.GAME_FONT = Toolbox.ResourcesManager.LoadObject("Font/" + font); - } - else - { - Global.GAME_FONT = null; - } - if (Global.GAME_FONT != null) - { - Global.GAME_FONT_NAME = font; - } - else - { - Toolbox.AssetManager.ClearAssetCacheAssetBundle(); - Global.GAME_FONT_NAME = "A-OTF-KaiminTuStd-Bold"; - } - callback?.Invoke(); - } - - public static void FontReset() - { - Global.GAME_FONT = null; - Global.GAME_FONT_NAME = "A-OTF-KaiminTuStd-Bold"; - } - private static string getFont() { return Toolbox.SavedataManager.GetString("LANG_FONT", Global.GetFontLangType(Global.LANG_TYPE.Eng.ToString())); diff --git a/SVSim.BattleEngine/Engine/ForestField.cs b/SVSim.BattleEngine/Engine/ForestField.cs index 8a2e843d..1f2df3e9 100644 --- a/SVSim.BattleEngine/Engine/ForestField.cs +++ b/SVSim.BattleEngine/Engine/ForestField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class ForestField : BackGroundBase { public override int FieldId => 1; @@ -10,113 +11,4 @@ public class ForestField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_frst_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles01").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldObjDictionary.Add("mainTree_door", _fieldModel.transform.Find("md_bf_frst_01_mainTree_door").gameObject); - _fieldObjDictionary.Add("moveBranch_a", _fieldModel.transform.Find("md_bf_frst_01_moveBranch_a").gameObject); - _fieldObjDictionary.Add("moveBranch_b", _fieldModel.transform.Find("md_bf_frst_01_moveBranch_b").gameObject); - m_FieldAnimatorDictionary.Add("mainTree_door", _fieldObjDictionary["mainTree_door"].GetComponent()); - m_FieldAnimatorDictionary.Add("moveBranch_a", _fieldObjDictionary["moveBranch_a"].GetComponent()); - m_FieldAnimatorDictionary.Add("moveBranch_b", _fieldObjDictionary["moveBranch_b"].GetComponent()); - _fieldParticleSystemDictionary.Add("leaf", _fieldParticles.transform.Find("leaf").GetComponent()); - _fieldParticleSystemDictionary.Add("tree_gimic_1", _fieldParticles.transform.Find("tree_gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("tree_gimic_2", _fieldParticles.transform.Find("tree_gimic_2").GetComponent()); - _fieldParticleSystemDictionary.Add("fairy_opening", _fieldParticles.transform.Find("fairy_opening").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["fairy_opening"].Play(); - m_FieldAnimatorDictionary["mainTree_door"].SetTrigger("OpenFast"); - _battleCamera.Camera.transform.localPosition = new Vector3(-660f, 200f, -150f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-15f, -90f, 90f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-500f, 10f, -20f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-40f, -90f, 90f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - m_FieldAnimatorDictionary["mainTree_door"].SetTrigger("CloseFast"); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-150f, -50f, -100f), "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-30f, -20f, 25f), "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - m_FieldAnimatorDictionary["mainTree_door"].SetTrigger("Open"); - int rnd = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{rnd}", "se_field_" + _str3DFieldNo, 0f, 0L); - yield return new WaitForSeconds(1.5f); - switch (rnd) - { - case 1: - _fieldParticleSystemDictionary["tree_gimic_1"].Play(); - break; - case 2: - _fieldParticleSystemDictionary["tree_gimic_2"].Play(); - break; - } - yield return new WaitForSeconds(1f); - m_FieldAnimatorDictionary["mainTree_door"].SetTrigger("Close"); - yield return new WaitForSeconds(3f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["leaf"].Play(); - m_FieldAnimatorDictionary["moveBranch_a"].speed = 1f + Random.value * 0.5f; - m_FieldAnimatorDictionary["moveBranch_a"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["moveBranch_b"].speed = 1f + Random.value * 0.5f; - m_FieldAnimatorDictionary["moveBranch_b"].SetTrigger("Shake"); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/ForestNightField.cs b/SVSim.BattleEngine/Engine/ForestNightField.cs index 184d8e0f..4efda581 100644 --- a/SVSim.BattleEngine/Engine/ForestNightField.cs +++ b/SVSim.BattleEngine/Engine/ForestNightField.cs @@ -1,7 +1,11 @@ +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class ForestNightField : ForestField { public override int FieldId => 11; - public override int FieldEffectId => 1; public ForestNightField(string bgmId = "NONE") diff --git a/SVSim.BattleEngine/Engine/FramerateProfiler.cs b/SVSim.BattleEngine/Engine/FramerateProfiler.cs deleted file mode 100644 index 945cc516..00000000 --- a/SVSim.BattleEngine/Engine/FramerateProfiler.cs +++ /dev/null @@ -1,51 +0,0 @@ -using UnityEngine; - -internal class FramerateProfiler -{ - private float _lastTime; - - private int _lastFrame; - - private float _fps; - - private bool _hasValue; - - private const float MEASURE_RANGE = 5f; - - public const int FPS_GOOD = 30; - - public const int FPS_BAD = 20; - - public float? Fps - { - get - { - if (_hasValue) - { - return _fps; - } - return null; - } - } - - public void Init() - { - _lastTime = Time.realtimeSinceStartup; - _lastFrame = Time.frameCount; - _fps = 30f; - } - - public void Update() - { - float realtimeSinceStartup = Time.realtimeSinceStartup; - float num = realtimeSinceStartup - _lastTime; - if (num >= 5f) - { - int num2 = Time.frameCount - _lastFrame; - _fps = (float)num2 / num; - _lastTime = realtimeSinceStartup; - _lastFrame = Time.frameCount; - _hasValue = true; - } - } -} diff --git a/SVSim.BattleEngine/Engine/FreeMatchResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/FreeMatchResultAnimationAgent.cs deleted file mode 100644 index 38f0d859..00000000 --- a/SVSim.BattleEngine/Engine/FreeMatchResultAnimationAgent.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; - -public class FreeMatchResultAnimationAgent : ResultAnimationAgent -{ - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - if (ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - PlayWinVoice(); - } - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - bool battlePathUIFinish = false; - battleResultControl.SetBattlePassGauge(delegate - { - battlePathUIFinish = true; - }); - while (!battlePathUIFinish) - { - yield return null; - } - if (Data.RedEtherCampaignResultData != null) - { - bool isFinishRedEther = false; - RedEtherCampaignPanel.Create(battleResultControl.gameObject, Data.RedEtherCampaignResultData, battleResultControl, delegate - { - isFinishRedEther = true; - }); - while (!isFinishRedEther) - { - yield return null; - } - yield return ShowRewardDialog(Data.RedEtherCampaignResultData.RewardList); - } - battleResultControl.GreySpriteBGVisible = false; - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - } -} diff --git a/SVSim.BattleEngine/Engine/FreeMatchResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/FreeMatchResultAnimationHandler.cs deleted file mode 100644 index 1da3e13f..00000000 --- a/SVSim.BattleEngine/Engine/FreeMatchResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class FreeMatchResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly FreeMatchResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public FreeMatchResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/FreeMatchResultReporter.cs b/SVSim.BattleEngine/Engine/FreeMatchResultReporter.cs deleted file mode 100644 index 9e2fb3ad..00000000 --- a/SVSim.BattleEngine/Engine/FreeMatchResultReporter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard; -using Wizard.Lottery; - -public class FreeMatchResultReporter : IBattleResultReporter -{ - public bool IsEnd => Data.FreeMatchFinish.data != null; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => Data.FreeMatchFinish.data._missionRewards; - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => LotteryApplyData.EmptyData(); - - public MyPageHomeDialogData HomeDialogData => null; - - public bool IsDataExist - { - get - { - if (Data.FreeMatchFinish.data != null) - { - return Data.FreeMatchFinish.data.IsProcessed; - } - return false; - } - } - - public void Report(bool isWin) - { - } - - public void Destroy() - { - } - - public JsonData GetFinishResponseData() - { - return Data.FreeMatchFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.FreeMatchFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.FreeMatchFinish.data.achieved_mission_list; - } - - public int GetClassExp() - { - return Data.FreeMatchFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/FriendApply.cs b/SVSim.BattleEngine/Engine/FriendApply.cs deleted file mode 100644 index 7f72b8bb..00000000 --- a/SVSim.BattleEngine/Engine/FriendApply.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using LitJson; - -public class FriendApply : HeaderData -{ - public uint id; - - public int viewerId; - - public string name; - - public string countryCode; - - public int rank; - - public long emblemId; - - public int degreeId; - - public DateTime lastPlayTime; - - public DateTime applyedTime; - - public int MissionType { get; private set; } - - public FriendApply(JsonData data) - { - id = (uint)data["id"].ToLong(); - viewerId = data["viewer_id"].ToInt(); - name = (string)data["name"]; - countryCode = (string)data["country_code"]; - rank = data["rank"].ToInt(); - emblemId = data["emblem_id"].ToLong(); - degreeId = data["degree_id"].ToInt(); - lastPlayTime = DateTime.Parse(data["last_play_time"].ToString()); - applyedTime = DateTime.Parse(data["create_time"].ToString()); - if (data.Keys.Contains("mission_type")) - { - MissionType = data["mission_type"].ToInt(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/FriendInfoDetail.cs b/SVSim.BattleEngine/Engine/FriendInfoDetail.cs index d54a5f94..1302f993 100644 --- a/SVSim.BattleEngine/Engine/FriendInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/FriendInfoDetail.cs @@ -3,8 +3,4 @@ using System.Collections.Generic; public class FriendInfoDetail { public List friendList = new List(); - - public int friendCount; - - public int friendMaxCount; } diff --git a/SVSim.BattleEngine/Engine/GachaObj.cs b/SVSim.BattleEngine/Engine/GachaObj.cs deleted file mode 100644 index d203f1e3..00000000 --- a/SVSim.BattleEngine/Engine/GachaObj.cs +++ /dev/null @@ -1,34 +0,0 @@ -using UnityEngine; - -public class GachaObj : MonoBehaviour -{ - [SerializeField] - private Camera m_GachaCamera; - - [SerializeField] - private GameObject m_GachaLight; - - [SerializeField] - private GameObject m_GachaBox; - - [SerializeField] - private GameObject m_ClanLabels; - - [SerializeField] - private UITexture m_DarkSideTex; - - [SerializeField] - private UITexture m_BgBlackTex; - - public Camera GachaCamera => m_GachaCamera; - - public GameObject GachaLight => m_GachaLight; - - public GameObject GachaBox => m_GachaBox; - - public GameObject ClanLabels => m_ClanLabels; - - public UITexture DarkSideTex => m_DarkSideTex; - - public UITexture BgBlackTex => m_BgBlackTex; -} diff --git a/SVSim.BattleEngine/Engine/GachaUI.cs b/SVSim.BattleEngine/Engine/GachaUI.cs index e10431b8..cf551e49 100644 --- a/SVSim.BattleEngine/Engine/GachaUI.cs +++ b/SVSim.BattleEngine/Engine/GachaUI.cs @@ -11,7 +11,6 @@ public class GachaUI : UIBase public enum CardPackType { NONE, - CRYSTAL, CRYSTAL_MULTI, DAILY, TICKET, @@ -28,70 +27,6 @@ public class GachaUI : UIBase private static GachaUI _gachaUiInstance; - private const int DEPTH_REWARD_DIALOG_PANEL = 600; - - private const int DEPTH_REWARD_DIALOG_INNER = 610; - - private const int DEPTH_SELECT_BUY_NUM_DIALOG = 610; - - private const int DEPTH_TUTORIAL_BUY_CONFIRM = 1000; - - private const int DEPTH_TUTORIAL_LEGEND_PACK_DETAIL_MESSAGE_DIALOG = 1000; - - private const int SORTING_ORDER_TUTORIAL_LEGEND_PACK_DETAIL_MESSAGE_DIALOG = 37; - - private const int ORDER_REWARD_DIALOG = 2; - - public const int BASIC_PACK_ID_START = 10000; - - private const int BASIC_PACK_ID_END = 14999; - - public const int ADDITIONAL_PACK_ID_START = 15000; - - private const int ADDITIONAL_PACK_ID_END = 15999; - - private const int TS_SKIN_PICKUP_PACK_ID_START = 16000; - - private const int TS_SKIN_PICKUP_PACK_ID_END = 16999; - - private const int TS_ROTATION_TICKET_PACK_ID_START = 80000; - - private const int TS_ROTATION_TICKET_ID = 80001; - - private const int TS_ROTATION_TICKET_PACK_ID_END = 89001; - - public const int LEGEND_PACK_GACHA_ID = 90001; - - private const int TS_STEPUP_GACHA_FIRST_ID_START = 97000; - - private const int TS_STEPUP_GACHA_FIRST_ID_END = 97999; - - private const int TS_STEPUP_GACHA_SECOND_ID_START = 98000; - - private const int TS_STEPUP_GACHA_SECOND_ID_END = 98999; - - private const int TS_LEGEND_PACK_GACHA_ID = 99000; - - private const int DEFAULT_DRUMROLL_INDEX = 0; - - private const int MAX_CARD_PACK_NAM = 10; - - private const int DAILY_BUY_PACK_NAM = 1; - - public const int SPECIAL_CARD_PACK_NUM = 10; - - public const int ROTATION_STARTER_PACK_NUM = 10; - - private const string FORMAT_BTN_ROTATION_ON = "btn_gacha_timesliprotation_on"; - - private const string FORMAT_BTN_ROTATION_OFF = "btn_gacha_timesliprotation_off"; - - private const string FORMAT_BTN_UNLIMITED_ON = "btn_gacha_unlimited_on"; - - private const string FORMAT_BTN_UNLIMITED_OFF = "btn_gacha_unlimited_off"; - - public const string APPEAL_IMAGE = "card_pack_{0}_poster_sub"; - [SerializeField] private UIToggle _skipToggleBtn; @@ -192,11 +127,6 @@ public class GachaUI : UIBase public bool IsDuringPackOpen { get; private set; } - public static GachaUI GetInstance() - { - return _gachaUiInstance; - } - public override void onFirstStart() { _gachaUiInstance = this; @@ -246,7 +176,7 @@ public class GachaUI : UIBase if (!_isRotation) { SetFormat(Format.Rotation); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + TweenAlpha.Begin(_drumrollManager.gameObject, 0f, 0f); CreateCardPackTop(0, fade: false); } @@ -256,7 +186,7 @@ public class GachaUI : UIBase if (_isRotation) { SetFormat(Format.Unlimited); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + TweenAlpha.Begin(_drumrollManager.gameObject, 0f, 0f); CreateCardPackTop(0, fade: false); } @@ -370,13 +300,6 @@ public class GachaUI : UIBase })); } - private void BackToMyPage() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.NotWait(); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - private void StartLoadCardPack(PackInfoTask.PackFirstTransition packFirstTransition) { bool isTurorialEnd = _isTutorial && Data.Load.data._userTutorial.TutorialStep == 100; @@ -630,7 +553,7 @@ public class GachaUI : UIBase _isTutorial = false; UIManager.GetInstance().StartFirstTips(FirstTips.TipsType.ShopCardPack, delegate { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; + /* Pre-Phase-5b: headless has no InputMgr */ }); FirstTips.SaveFinishFirstTips(FirstTips.TipsType.GachaPointExchange); } @@ -712,7 +635,7 @@ public class GachaUI : UIBase { if (_isPackOpen) { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; + /* Pre-Phase-5b: headless has no InputMgr */ } UIManager.GetInstance().OnReadyViewScene(isFadein: true); } @@ -788,12 +711,12 @@ public class GachaUI : UIBase if (_skipToggleBtn.value) { _isSkipOpen = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } else { _isSkipOpen = false; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); + } } } @@ -842,19 +765,6 @@ public class GachaUI : UIBase return Data.PackInfo.dataList.FindAll((PackConfig data) => IsUnlimitedCardPackId(data.PackId)); } - private bool ContainsRotationCardSet(int parentGachaId) - { - if (Data.Load.data.RotationCardSetList.Contains(parentGachaId)) - { - return true; - } - if (Prerelease.Status == Prerelease.eStatus.PRE_ROTATION) - { - return Prerelease.Instance.RotationCardSetList.Contains(parentGachaId); - } - return false; - } - private bool IsBasicPackId(int packId) { if (10000 < packId) @@ -1022,7 +932,7 @@ public class GachaUI : UIBase private void OnPushExchangeGachaPoint(PackConfig packConfig) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + _gachaPointExchangeDialog.CreateGachaPointExchangeDialog(packConfig, GetPackInfoTask); } @@ -1034,7 +944,7 @@ public class GachaUI : UIBase private void OnClickPurchaseButton(PackConfig packConfig, PackChildGachaInfo gachaInfo) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + switch (gachaInfo.PackType) { case CardPackType.CRYSTAL_SPECIAL: @@ -1159,7 +1069,7 @@ public class GachaUI : UIBase PurchasePack(packConfig, gachaInfo, buyPackNum); })); dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_BuyCard_001_Title")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + dialogBase.ClickSe_Btn1 = 0; if (Data.Load.data._userTutorial.TutorialStep == 41) { dialogBase.SetButtonDisable(isEnableOK: false, isEnableCancel: true); @@ -1422,7 +1332,7 @@ public class GachaUI : UIBase { excludeCardIds = new int[0]; } - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; + /* Pre-Phase-5b: headless has no InputMgr */ UIManager.GetInstance().CreatFadeClose(delegate { UIManager.GetInstance().createInSceneLoading(); diff --git a/SVSim.BattleEngine/Engine/GameObjectExtensions.cs b/SVSim.BattleEngine/Engine/GameObjectExtensions.cs index bae925c4..f62d4dd9 100644 --- a/SVSim.BattleEngine/Engine/GameObjectExtensions.cs +++ b/SVSim.BattleEngine/Engine/GameObjectExtensions.cs @@ -11,8 +11,8 @@ public static class GameObjectExtensions } BattleCardBase battleCardBase = null; BattleCardBase battleCardBase2 = null; - battleCardBase = BattleManagerBase.GetIns().BattlePlayer.AllCards.FirstOrDefault((BattleCardBase s) => s.BattleCardView.GameObject == go); - battleCardBase2 = BattleManagerBase.GetIns().BattleEnemy.AllCards.FirstOrDefault((BattleCardBase s) => s.BattleCardView.GameObject == go); + battleCardBase = null; // Pre-Phase-5b: static lookup unreachable headless + battleCardBase2 = null; // Pre-Phase-5b: static lookup unreachable headless if (battleCardBase != null) { return battleCardBase; diff --git a/SVSim.BattleEngine/Engine/GateField.cs b/SVSim.BattleEngine/Engine/GateField.cs index 5d065fb0..def4ae32 100644 --- a/SVSim.BattleEngine/Engine/GateField.cs +++ b/SVSim.BattleEngine/Engine/GateField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class GateField : BackGroundBase { public override int FieldId => 8; @@ -10,74 +11,4 @@ public class GateField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_gate_01").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles08").gameObject; - _fieldParticleSystemDictionary.Add("plasma_gimic_1", _fieldParticles.transform.Find("plasma_gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_8, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_8_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-20f, 80f, 700f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-10f, 0f, 0f)); - yield return new WaitForSeconds(2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["plasma_gimic_1"].Play(); - yield return new WaitForSeconds(1.5f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Global.cs b/SVSim.BattleEngine/Engine/Global.cs index a75538d0..79a67111 100644 --- a/SVSim.BattleEngine/Engine/Global.cs +++ b/SVSim.BattleEngine/Engine/Global.cs @@ -11,20 +11,11 @@ public static class Global { public enum CHAR_TYPE { - PLAYER, ENEMY, - NONE, - MAX - } + NONE } public enum CardRarity { - MIN = 1, - BRONZE = 1, - SILVER = 2, - GOLD = 3, - LEGEND = 4, - MAX = 5 } public enum LANG_TYPE @@ -37,9 +28,7 @@ public static class Global Fre, Ita, Ger, - Spa, - Max - } + Spa } public struct LanguageProps { @@ -62,82 +51,6 @@ public static class Global public const int NONE = -1; - public const string NONE_TEXT = "NONE"; - - public const int GOBLIN_CARD_ID = 100011010; - - public const int FIGHTER_CARD_ID = 100011020; - - public const int EVOLVE_TO_OTHER_CARD_INITIAL_ID = 910; - - public const int CHOICE_BRAVE_CARD_INITIAL_ID = 930; - - public const int RITE_OF_THE_IGNORANT_ID = 900344060; - - public const int GHIOS_SPARKLING_PRISM_ID = 120341020; - - public const int ARAMIS_ID = 900241110; - - public const int WIELDER_OF_THE_COSMOS_ID = 123841020; - - public const int SLAUGHTERING_SAMURAI_ID = 130241030; - - public const int GOBLIN_MAGE_ID = 125021010; - - public const int ARCHANGEL_OF_EVOCATION_ID = 117031020; - - public const int PEERLESS_WARRIOR_ID = 129241020; - - public const int ELEANOR_TECHNIQUE_ID = 930344070; - - public const int VAIDI_SECRET_ART_ID = 930444050; - - public const int BRIARMAIDEN_ID = 132141010; - - public const int THUNDER_GOD_OF_THE_TEMPEST_ID = 123031020; - - public const int REAPER_CARD_IDX = -99; - - public const long ONE_SECOND = 10000000L; - - public const float BASE_SCREEN_WIDTH_SIZE = 1280f; - - public const float BASE_SCREEN_HEIGHT_SIZE = 640f; - - public const int STANDARD_DECK_CARD_NUM_MAX = 40; - - public const int TWO_PICK_DECK_MAX_NUM = 30; - - public const int WIND_FALL_DECK_MAX_NUM = 35; - - public const int STANDARD_DECK_SAVABLE_CARD_NUM_MAX = 50; - - public const int SAME_KIND_NUM_MAX_BASE = 3; - - public const int CARD_RARITY_MIN = 1; - - public const int CARD_RARITY_BRONZE = 1; - - public const int CARD_RARITY_SILVER = 2; - - public const int CARD_RARITY_GOLD = 3; - - public const int CARD_RARITY_LEGEND = 4; - - public const int CARD_RARITY_MAX = 5; - - public const int DAMAGE_EFFECT_MAX_NUM = 12; - - public const float MULLIGAN_TIME_LIMIT = 60f; - - public const float TURN_TIME_LIMIT = 90f; - - public const float TURN_TIME_EXTEND_ONPLAY = 3f; - - public const float TURN_TIME_EXTEND_MAX = 15f; - - public const float DRAG_DISTANCE = 40f; - public static Color CARD_SELECT_COLOR; public static Color CARD_PASSIVE_COLOR; @@ -234,22 +147,6 @@ public static class Global public static readonly Vector3 CLASS_BATTLE_POSITION_ENEMY; - public const int BATTLE_LAYER = 10; - - public const int SUB_PARTICLES_LAYER = 12; - - public const int HIGH_RANK_EVOLVE_LAYER = 13; - - public const int BATTLE_UNDER_LAYER = 15; - - public const int FRONT_UI_LAYER = 24; - - public const int SYSTEM_UI_LAYER = 22; - - public const int CUT_IN_LAYER = 31; - - public const int EMPTY_DECK_ID = -1; - public static readonly Vector3 EP_PANEL_POSITION_PLAYER; public static readonly Vector3 PLAYER_CHOICE_BRAVE_BUTTON_POSITION; @@ -258,10 +155,6 @@ public static class Global public static readonly Vector3 PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM; - public const int DEFAULT_EMBLEM_ID = 100000000; - - public const int DEFAULT_DEGREE_ID = 300003; - public static Vector2 WEBVIEW_NORMAL_SIZE; public static Vector3 POSITION_COST_ICON; @@ -286,14 +179,6 @@ public static class Global public static int WideFieldOfView; - public const float WideFieldOfViewAspectRatioThreshold = 1.5f; - - public const float ASPECT_RATIO_OVER_16_9 = 1.8f; - - public const string BASE_GAME_FONT_NAME = "A-OTF-KaiminTuStd-Bold"; - - public const string BASE_BITMAP_FONT_NAME = "FOT-TsukuAOldMinPr6-E"; - public static string GAME_FONT_NAME; public static string[] fontFileNames; @@ -302,36 +187,12 @@ public static class Global public static List SeSysSummonLandingDuplicateCheckId; - public const int ROTATION_SEASON_CHANGE_ERROR_FOR_BUY = 110; - - public const int ROTATION_SEASON_CHANGE_ERROR = 109; - - private const int CHINESE_TAIWAN_ID = 1028; - - private const int CHINESE_HONGKONG_ID = 3076; - - private const int CHINESE_MAKAO_ID = 5124; - - private const int CHINESE_SINGAPORE_ID = 4100; - - private const int CHINESE_CHINA_ID = 2052; - - public const int LANG_MAX = 9; - public static string jpn_font; - public const string CHS_FONT = "DFGBWB7-900"; - public static LanguageProps[] LanguagePropList; public static UnityEngine.Font GAME_FONT; - public const string CLONE_SUFFIX = "(Clone)"; - - private const string BBCodePattern = "(\\[[a-z0-9\\/\\-]*\\])"; - - public const string BBCodePatternName = "(\\[[a-z0-9\\/\\-]*(rub\\<[^\\>]*\\>)*\\])"; - private static Vector2 CARD_NAME_POS_SHORT; private static Vector2 CARD_NAME_POS_NORMAL; @@ -346,12 +207,6 @@ public static class Global private static int CARD_NAME_SIZE_ALPHABET_LANGUAGE; - public const int CARD_NAME_LIMIT_LENGTH_ENG = 11; - - public const int CARD_NAME_LIMIT_LENGTH_JPN = 5; - - private const char ZERO_WIDTH_MARKER = '\u200b'; - private static readonly LANG_TYPE[] WordBreakLanguages; private static readonly LANG_TYPE[] AlphabetLanguages; @@ -360,18 +215,6 @@ public static class Global private static readonly string[] AlphabetLanguageNames; - public static bool IsSnCollabSkin(int skinId) - { - if (4300 <= skinId) - { - return skinId <= 4399; - } - return false; - } - - [DllImport("__Internal")] - private static extern int GetUserDefaultLangID(); - static Global() { CARD_SELECT_COLOR = Color.cyan; @@ -661,38 +504,6 @@ public static class Global } } - public static List GetParentList(Transform t, bool isOwnContains) - { - List list = new List(); - if (isOwnContains) - { - list.Add(t.name); - } - Transform transform = null; - Transform transform2 = t; - while ((transform = transform2.parent) != null) - { - list.Insert(0, transform.name); - transform2 = transform; - } - return list; - } - - public static string GetParentListToString(Transform t, bool isOwnContains) - { - List parentList = GetParentList(t, isOwnContains); - string text = string.Empty; - for (int i = 0; i < parentList.Count; i++) - { - if (i != 0) - { - text += ":"; - } - text += parentList[i]; - } - return text; - } - public static bool IsAlphabetLanguage() { string textLanguage = CustomPreference.GetTextLanguage(); @@ -705,66 +516,6 @@ public static class Global return WordBreakLanguageNames.Contains(textLanguage); } - public static LANG_TYPE CastToLangType(string type) - { - foreach (LANG_TYPE item in Enum.GetValues(typeof(LANG_TYPE)).Cast()) - { - if (type == item.ToString()) - { - return item; - } - } - return LANG_TYPE.Max; - } - - public static bool IsSupportedLanguageType(string langType) - { - for (int i = 0; i < LanguagePropList.Count(); i++) - { - if (LanguagePropList[i].LangType == langType) - { - return true; - } - } - return false; - } - - public static bool IsSupportedSystemLanguage(string sysLang) - { - for (int i = 0; i < LanguagePropList.Count(); i++) - { - if (LanguagePropList[i].Name == sysLang) - { - return true; - } - } - return false; - } - - public static string GetDisplayLanguage(string type) - { - for (int i = 0; i < LanguagePropList.Count(); i++) - { - if (LanguagePropList[i].LangType == type) - { - return LanguagePropList[i].DisplayName; - } - } - return LanguagePropList[0].DisplayName; - } - - public static string GetLanguageType(string sysLang) - { - for (int i = 0; i < LanguagePropList.Count(); i++) - { - if (LanguagePropList[i].Name == sysLang) - { - return LanguagePropList[i].LangType; - } - } - return LanguagePropList[0].LangType; - } - public static string GetFontLangType(string type) { for (int i = 0; i < LanguagePropList.Count(); i++) @@ -776,22 +527,4 @@ public static class Global } return LanguagePropList[0].Font; } - - public static string GetSystemLanguage() - { - if (Application.systemLanguage == SystemLanguage.Chinese) - { - switch (GetUserDefaultLangID()) - { - case 2052: - case 4100: - return SystemLanguage.ChineseSimplified.ToString(); - case 1028: - case 3076: - case 5124: - return SystemLanguage.ChineseTraditional.ToString(); - } - } - return Application.systemLanguage.ToString(); - } } diff --git a/SVSim.BattleEngine/Engine/Gungnir.cs b/SVSim.BattleEngine/Engine/Gungnir.cs deleted file mode 100644 index 294ee474..00000000 --- a/SVSim.BattleEngine/Engine/Gungnir.cs +++ /dev/null @@ -1,303 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using BestHTTP.SocketIO; -using Cute; -using UnityEngine; -using Wizard; - -public class Gungnir : IDisposable -{ - private enum ConnectingStatus - { - ONLINE, - WAITING, - OFFLINE, - TIMEOUT - } - - public enum DisconnectStatus - { - NOT, - SELF_DISCONNECT, - OPPONENT_DISCONNECT - } - - public const string URI = "Gungnir"; - - public const string EMIT_ALIVE = "alive"; - - private const string CURRENT_SEQUENCE = "currentSeq"; - - public const string ACTION_SEQ = "actionSeq"; - - private const string OCS_KEY = "ocs"; - - private const string SCS_KEY = "scs"; - - private const string CLIENT_PUB_SEQ_KEY = "clientPubSeq"; - - private const string CLIENT_REQ_RESEND_KEY = "reqResend"; - - private const float REPORT_INTERVAL = 5f; - - private RealTimeNetworkAgent _agent; - - private ConnectionReporter _connectionReporter; - - public Action OnAlive; - - public Action OnOpponentAlive; - - public Action OnOpponentDisconnect; - - public Action OnOpponentOffLine; - - public Action OnOpponentTimeOut; - - public Action OnResendEmitData; - - public bool _isNotEmit; - - private int _receiveReSendZeroNum; - - public List _actionSeqPubSeqList = new List(); - - public int _actionSequenceNum; - - private float _gungnirLogWaitTimer; - - private Coroutine _gungnirAckCheckCoroutine; - - public const float SUCCESS_GUNGNIR_RECEIVE_LOG_TIME = 5f; - - public DisconnectStatus _DisconnectStatus { get; private set; } - - public long LastSuccessTime { get; private set; } - - public bool IsSendActionSequenceNum { get; private set; } - - public bool IsEnableTimeoutCallBack { get; set; } = true; - - public long GungnirReceiveCheckTime { get; private set; } - - public Gungnir(RealTimeNetworkAgent agent) - { - _agent = agent; - _connectionReporter = new ConnectionReporter(agent, EmitGungnir, 5f); - Tick(); - _DisconnectStatus = DisconnectStatus.NOT; - } - - private IEnumerator GungnirLogAckCheck() - { - while (true) - { - _gungnirLogWaitTimer += Time.deltaTime; - if (_gungnirLogWaitTimer >= 2f) - { - break; - } - yield return null; - } - if (!LocalLog._isSendGungnirLog) - { - _agent.NetworkLogger.LogInfo("OnGungnirLog"); - } - LocalLog._isSendGungnirLog = true; - } - - public void Start() - { - _agent.NetworkLogger.LogInfo("Gungnir: Start"); - _connectionReporter.StartReporter(); - LocalLog.InitGungnirLog(); - LocalLog.InitDisconnectLog(); - } - - public void Stop() - { - _connectionReporter.StopReporter(); - _agent.NetworkLogger.LogInfo("Gungnir: Stop"); - LocalLog.AddGungnirLog("GungnirStopReporter "); - } - - public void SetSendActionSequenceNumFlag(bool isActive) - { - if (!isActive && IsSendActionSequenceNum) - { - _agent.NetworkLogger.LogInfo("GungnirSendActionSeq:OFF"); - } - if (isActive && !IsSendActionSequenceNum) - { - _agent.NetworkLogger.LogInfo("GungnirSendActionSeq:ON"); - } - IsSendActionSequenceNum = isActive; - } - - public void EmitGungnir() - { - if (GameMgr.GetIns().IsWatchBattle || _isNotEmit) - { - return; - } - if (_agent.IsOpen()) - { - _agent.SocketManager.Socket.Emit("alive", OnAckPacket, CreateEmitData()); - if (IsRecordGungnirLog()) - { - _gungnirAckCheckCoroutine = _agent.StartCoroutine(GungnirLogAckCheck()); - } - LocalLog.AddGungnirLog("EmitGungnir"); - return; - } - LocalLog.AddGungnirLog("NotOpenEmitGungnir"); - if (!LocalLog._isSendGungnirLog) - { - _agent.NetworkLogger.LogInfo("OnGungnirLog"); - } - if (IsRecordGungnirLog()) - { - LocalLog._isSendGungnirLog = true; - } - } - - private bool IsRecordGungnirLog() - { - if (_agent == null || _agent.CurrentMatchingStatus != RealTimeNetworkAgent.MatchingStatus.Prepared || GameMgr.GetIns() == null || GameMgr.GetIns().IsWatchBattle) - { - return false; - } - return true; - } - - private byte[] CreateEmitData() - { - Dictionary dictionary = _agent.CreateEmitData("Gungnir", null, isTrySend: false); - dictionary.Add("currentSeq", _agent.MaxMessageSequenceNumber); - if (IsSendActionSequenceNum) - { - dictionary.Add("actionSeq", _actionSequenceNum); - } - return _agent.CreatePackEmitData(dictionary); - } - - private void OnAckPacket(Socket socket, Packet originalPacket, params object[] args) - { - Tick(); - OnAlive.Call(); - LocalLog.AddGungnirLog("GungnirOnAck"); - if (_gungnirAckCheckCoroutine != null) - { - _agent.StopCoroutine(_gungnirAckCheckCoroutine); - } - _gungnirLogWaitTimer = 0f; - } - - public void ReceiveGungnir(Packet originalPacket, params object[] args) - { - Dictionary dictionary = _agent.DeserializeEncryptedPacket(originalPacket); - if (dictionary.Count == 0) - { - LocalLog.AddGungnirLog("ReceiveGungnirDataZero"); - return; - } - string text = dictionary["uri"].ToString(); - if (text != NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Gungnir]) - { - LocalLog.AddGungnirLog("ReceiveGungnirNoUri[" + text + "]"); - } - else - { - if (_agent.HandleingNodeResultCodeIfNeeded(dictionary)) - { - return; - } - if (_agent.IsExistTitleReturnError) - { - LocalLog.AddGungnirLog("ReceiveGungnirIsExistTitleReturnError"); - return; - } - GungnirReceiveCheckTime = TimeUtil.GetAbsoluteTime().Ticks; - Tick(); - OnAlive.Call(); - if (dictionary.ContainsKey(NetworkBattleDefine.NetworkParameter.resultCode.ToString()) && int.Parse(dictionary[NetworkBattleDefine.NetworkParameter.resultCode.ToString()].ToString()) == 30002) - { - return; - } - if (dictionary.ContainsKey("reqResend")) - { - int num = int.Parse(dictionary["reqResend"].ToString()); - if (num == 0) - { - _receiveReSendZeroNum++; - } - if (num == 1 || _receiveReSendZeroNum >= 2) - { - _receiveReSendZeroNum = 0; - if (dictionary.ContainsKey("clientPubSeq")) - { - int arg = int.Parse(dictionary["clientPubSeq"].ToString()); - OnResendEmitData.Call(arg); - } - } - } - if ((ConnectingStatus)Enum.Parse(typeof(ConnectingStatus), dictionary["scs"].ToString()) == ConnectingStatus.OFFLINE) - { - _agent.NetworkLogger.LogInfo("Gungnir: Self Offline"); - if (_agent.IsBattleStart) - { - _DisconnectStatus = DisconnectStatus.SELF_DISCONNECT; - } - return; - } - switch ((ConnectingStatus)Enum.Parse(typeof(ConnectingStatus), dictionary["ocs"].ToString())) - { - case ConnectingStatus.ONLINE: - OnOpponentAlive.Call(); - break; - case ConnectingStatus.WAITING: - _agent.NetworkLogger.LogInfo("Gungnir: Opponent Disconnect"); - OnOpponentDisconnect.Call(); - break; - case ConnectingStatus.OFFLINE: - OpponentOffLine(); - _agent.NetworkLogger.LogInfo("Gungnir: Opponent Offline"); - OnOpponentOffLine.Call(); - break; - case ConnectingStatus.TIMEOUT: - OpponentOffLine(); - _agent.NetworkLogger.LogInfo("Gungnir: Opponent TimeOut"); - if (IsEnableTimeoutCallBack) - { - OnOpponentTimeOut.Call(); - } - break; - } - } - } - - private void OpponentOffLine() - { - if (_agent.IsBattleStart) - { - _DisconnectStatus = DisconnectStatus.OPPONENT_DISCONNECT; - } - } - - public void Tick() - { - LastSuccessTime = TimeUtil.GetAbsoluteTime().Ticks; - } - - public void Dispose() - { - if (_gungnirAckCheckCoroutine != null) - { - _agent.StopCoroutine(_gungnirAckCheckCoroutine); - } - _connectionReporter.StopReporter(); - _connectionReporter = null; - _agent = null; - } -} diff --git a/SVSim.BattleEngine/Engine/HandControl.cs b/SVSim.BattleEngine/Engine/HandControl.cs index d33ba160..add3c1f3 100644 --- a/SVSim.BattleEngine/Engine/HandControl.cs +++ b/SVSim.BattleEngine/Engine/HandControl.cs @@ -69,31 +69,10 @@ public abstract class HandControl } } - protected void RecalculateTRS(int cardNum) - { - for (int i = 0; i < cardNum; i++) - { - _TRSCalculator.CalcTRS(_handState, cardNum, i, ref _cardPos[i], ref _cardRot[i], ref _cardScale[i]); - } - } - - public void ChangeArrangeType(ArrangeType type, float time, List battleCardViewList) - { - _TRSCalculator = CreateHandCardTRSCalculator(type); - RearrangeHand(time, battleCardViewList); - } - protected abstract HandTRSCalculatorBase CreateHandCardTRSCalculator(ArrangeType type); public abstract void RearrangeHand(float time, List battleCardViewList, bool isNewReplayMoveTurn = false); - public abstract void HideHand(float time, List battleCardViewList); - - public void LockHandControlState() - { - IsHandStateLocked = true; - } - public void SetHandState(HandState state) { if (!IsHandStateLocked) @@ -102,36 +81,16 @@ public abstract class HandControl } } - public HandState GetHandState() - { - return _handState; - } - public bool IsHandStateFocus() { return _handState == HandState.Focus; } - public HandVisible GetHandVisible() - { - return _handVisible; - } - public bool IsVisibleHand() { return _handVisible == HandVisible.Visible; } - public Vector3 GetHandCardPos(int idx) - { - return _cardPos[idx]; - } - - public Vector3 GetHandCardRot(int idx) - { - return _cardRot[idx]; - } - public void SetHandPosition() { Transform.localPosition = BaseHandPos; diff --git a/SVSim.BattleEngine/Engine/HandTRSCalculatorBase.cs b/SVSim.BattleEngine/Engine/HandTRSCalculatorBase.cs index 477ee165..50ad17c5 100644 --- a/SVSim.BattleEngine/Engine/HandTRSCalculatorBase.cs +++ b/SVSim.BattleEngine/Engine/HandTRSCalculatorBase.cs @@ -2,9 +2,6 @@ using UnityEngine; public abstract class HandTRSCalculatorBase { - protected const float HAND_ALL_WIDTH = 700f; - - protected const float CARD_WIDTH = 200f; protected readonly Vector3 _handPos = Vector3.zero; @@ -12,11 +9,4 @@ public abstract class HandTRSCalculatorBase { _handPos = handPos; } - - public abstract void CalcTRS(HandControl.HandState state, int handMax, int handIndex, ref Vector3 retPos, ref Vector3 retRot, ref Vector3 retScale); - - protected float CalHandAllWidth(int handMax) - { - return Mathf.Min(200f * (float)(handMax - 1), 700f); - } } diff --git a/SVSim.BattleEngine/Engine/HandViewBase.cs b/SVSim.BattleEngine/Engine/HandViewBase.cs index 7676153e..2b1ca0e8 100644 --- a/SVSim.BattleEngine/Engine/HandViewBase.cs +++ b/SVSim.BattleEngine/Engine/HandViewBase.cs @@ -10,10 +10,6 @@ public abstract class HandViewBase protected readonly List _battleCardViewList; - protected const float REARRANGE_TIME = 0.2f; - - protected const float WATCH_REARRANGE_TIME = 0.1f; - public HandViewBase() { } @@ -24,10 +20,6 @@ public abstract class HandViewBase _battleCardViewList = new List(); } - public virtual void SetClassBattleCardView(IBattleCardView classBattleCardView) - { - } - protected abstract void RearrangeHand(float rearrangeTime, bool isNewReplayMoveTurn = false); protected abstract HandControl CreateHandControl(GameObject handGameObject, BattleCamera battleCamera); @@ -36,10 +28,7 @@ public abstract class HandViewBase { if (!(cardViewToAdd is NullBattleCardView)) { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } + // Pre-Phase-5b: IsRecovery guard zeroed deckRearrangeTime; see RemoveCardFromView. AddCardToViewWithoutRearrange(cardViewToAdd); RearrangeHand(deckRearrangeTime, isNewReplayMoveTurn); } @@ -53,26 +42,12 @@ public abstract class HandViewBase } } - public void AddCardsToView(List cardViewsToAdd, float deckRearrangeTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } - List list = cardViewsToAdd.FindAll((IBattleCardView cardView) => !_battleCardViewList.Contains(cardView)); - if (list.Any()) - { - _battleCardViewList.AddRange(list); - RearrangeHand(deckRearrangeTime); - } - } - public virtual void RemoveCardFromView(IBattleCardView cardViewToRemove, float deckRearrangeTime) { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } + // Headless has no view manager; the deckRearrangeTime tweak is a Unity3D iTween + // timing knob that never fires here. Preserving the pre-cull default (no zero-out) + // is a safe no-op because the enclosing methods' rearrange calls hit no-op views. + // Pre-Phase-5b: `if (BattleManagerBase.GetIns().IsRecovery) deckRearrangeTime = 0f;` if (_battleCardViewList.Contains(cardViewToRemove)) { RemoveCardFromViewWithoutRearrange(cardViewToRemove); @@ -93,34 +68,6 @@ public abstract class HandViewBase return NullVfx.GetInstance(); } - public void HideCardFromView(IBattleCardView cardViewToHide) - { - float rearrangeTime = (BattleManagerBase.GetIns().IsRecovery ? 0f : 0.2f); - if (_battleCardViewList.Contains(cardViewToHide)) - { - cardViewToHide.isHiddenFromHandView = true; - RearrangeHand(rearrangeTime); - } - } - - public void UnhideCardFromView(IBattleCardView cardViewToHide, float deckRearrangeTime = 0.2f) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } - if (_battleCardViewList.Contains(cardViewToHide)) - { - cardViewToHide.isHiddenFromHandView = false; - RearrangeHand(deckRearrangeTime); - } - } - - public void LockHandState() - { - _handControl.LockHandControlState(); - } - public virtual VfxBase HandUnfocus() { _handControl.SetHandState(HandControl.HandState.Unfocus); @@ -148,11 +95,6 @@ public abstract class HandViewBase return HandUnfocus(); } - public HandControl GetHandControl() - { - return _handControl; - } - public void ReplaceCardInView(IBattleCardView originalView, IBattleCardView newView) { ReplaceCardInViewWithoutRearrange(originalView, newView); @@ -164,29 +106,6 @@ public abstract class HandViewBase _battleCardViewList.RemoveAt(_battleCardViewList.IndexOf(originalView)); } - public int GetViewIndex(IBattleCardView viewCard) - { - return _battleCardViewList.IndexOf(viewCard); - } - - public static VfxBase CreateHideCardMeshesVfx(IEnumerable targetCards) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (!GameMgr.GetIns().IsAdmin) - { - foreach (BattleCardBase targetCard in targetCards) - { - parallelVfxPlayer.Register(new ShowCardNumberLabelVfx(targetCard.BattleCardView, isShow: false)); - } - } - return parallelVfxPlayer; - } - - public void ChangeArrangeType(HandControl.ArrangeType type) - { - _handControl.ChangeArrangeType(type, 0.3f, _battleCardViewList); - } - public virtual VfxBase AsyncTouchCard(GameObject card) { return NullVfx.GetInstance(); diff --git a/SVSim.BattleEngine/Engine/HeaderData.cs b/SVSim.BattleEngine/Engine/HeaderData.cs index 9d7bbd57..c689c27a 100644 --- a/SVSim.BattleEngine/Engine/HeaderData.cs +++ b/SVSim.BattleEngine/Engine/HeaderData.cs @@ -2,15 +2,9 @@ public class HeaderData { public int result_code; - public int resource_version; - - public string parameter_version; - public int servertime; public string udid; public int viewer_id; - - public string result_message; } diff --git a/SVSim.BattleEngine/Engine/HillField.cs b/SVSim.BattleEngine/Engine/HillField.cs index d8a7a389..3c3c5669 100644 --- a/SVSim.BattleEngine/Engine/HillField.cs +++ b/SVSim.BattleEngine/Engine/HillField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class HillField : BackGroundBase { public override int FieldId => 21; @@ -10,96 +11,4 @@ public class HillField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - switch (FieldId) - { - case 21: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_21, pos); - break; - case 23: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_23, pos); - break; - } - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (FieldId) - { - case 21: - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_21_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_21_2, pos); - break; - } - break; - case 23: - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_23_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_23_2, pos); - break; - } - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(-2050f, -1600f, -75f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-33f, 43f, -60f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(60f, -80f, -430f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-37f, 83f, -87f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1") - { - _ = _gimicCntDictionary[obj.tag]; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/HillRiotingField.cs b/SVSim.BattleEngine/Engine/HillRiotingField.cs index 3bdf32e0..0a4bf824 100644 --- a/SVSim.BattleEngine/Engine/HillRiotingField.cs +++ b/SVSim.BattleEngine/Engine/HillRiotingField.cs @@ -1,3 +1,8 @@ +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. internal class HillRiotingField : HillField { public override int FieldId => 23; diff --git a/SVSim.BattleEngine/Engine/IBattleResultReporter.cs b/SVSim.BattleEngine/Engine/IBattleResultReporter.cs deleted file mode 100644 index 2dc003b5..00000000 --- a/SVSim.BattleEngine/Engine/IBattleResultReporter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard; -using Wizard.Lottery; - -public interface IBattleResultReporter -{ - bool IsEnd { get; } - - List UserAchievement { get; } - - List UserMission { get; } - - List MissionRewards { get; } - - List VictoryRewards { get; } - - int ClassExp { get; } - - bool IsDataExist { get; } - - LotteryApplyData LotteryData { get; } - - MyPageHomeDialogData HomeDialogData { get; } - - void Report(bool isWin); - - void Destroy(); - - JsonData GetFinishResponseData(); -} diff --git a/SVSim.BattleEngine/Engine/IDInput.cs b/SVSim.BattleEngine/Engine/IDInput.cs index 428708ad..43c5e845 100644 --- a/SVSim.BattleEngine/Engine/IDInput.cs +++ b/SVSim.BattleEngine/Engine/IDInput.cs @@ -19,8 +19,6 @@ public class IDInput : MonoBehaviour [SerializeField] private UIButton m_InputClearBtn; - private UIButton m_InputOKBtn; - [SerializeField] private LayoutSet[] _layoutSet; @@ -35,8 +33,6 @@ public class IDInput : MonoBehaviour public DialogBase CurrentDialogBase; - private const string BrankText = "_"; - [HideInInspector] public string InputID { get; set; } @@ -45,21 +41,6 @@ public class IDInput : MonoBehaviour return NGUITools.AddChild(parentObj, UIManager.GetInstance().IdInputPrefab).GetComponent(); } - public static void StartInputDialog(string dialogTitle, int number, Action onDecide) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.XL); - dialogBase.SetTitleLabel(dialogTitle); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn); - IDInput input = Create(dialogBase.gameObject); - input.CurrentDialogBase = dialogBase; - input.InitInputID(number); - dialogBase.onPushButton1 = delegate - { - onDecide(input.InputID); - }; - } - public void InitInputID(int maxCount) { InputIndex = 0; @@ -113,7 +94,7 @@ public class IDInput : MonoBehaviour _currentLayout._label[InputIndex].text = text; JoinNums(); InputIndex++; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + if (InputIndex > _maxIndex) { CurrentDialogBase.SetButtonDisable(isEnableOK: false); @@ -127,7 +108,7 @@ public class IDInput : MonoBehaviour { InputIndex--; _currentLayout._label[InputIndex].text = "_"; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); + CurrentDialogBase.SetButtonDisable(isEnableOK: true); } } @@ -144,7 +125,7 @@ public class IDInput : MonoBehaviour private void Paste() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + string clipboard = ClipboardHelper.Clipboard; clipboard = Regex.Replace(clipboard, "[0-9]", (Match match) => ((char)(match.Value[0] - 65296 + 48)).ToString()); clipboard = Regex.Replace(clipboard, "\\s", ""); diff --git a/SVSim.BattleEngine/Engine/INextSceneSelector.cs b/SVSim.BattleEngine/Engine/INextSceneSelector.cs deleted file mode 100644 index fbe1360f..00000000 --- a/SVSim.BattleEngine/Engine/INextSceneSelector.cs +++ /dev/null @@ -1,8 +0,0 @@ -using UnityEngine; - -public interface INextSceneSelector -{ - void Setup(bool isWin, GameObject gameObject); - - void Show(); -} diff --git a/SVSim.BattleEngine/Engine/IPaymentCallback.cs b/SVSim.BattleEngine/Engine/IPaymentCallback.cs deleted file mode 100644 index 102ff388..00000000 --- a/SVSim.BattleEngine/Engine/IPaymentCallback.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; - -public interface IPaymentCallback -{ - void evInitializeSucceeded(); - - void evInitializeFailed(string error); - - void evPurchaseSucceeded(PaymentPurchase purchase); - - void evPurchaseFailed(string error); - - void evPurchaseCancelled(string error); - - void evGetProductListSucceeded(List infos); - - void evGetProductListFailed(string error); - - void evConsumePurchaseSucceeded(); - - void evConsumePurchaseSucceedediOS(); - - void evConsumePurchaseFailed(string error); -} diff --git a/SVSim.BattleEngine/Engine/IResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/IResultAnimationHandler.cs deleted file mode 100644 index ad6d6f30..00000000 --- a/SVSim.BattleEngine/Engine/IResultAnimationHandler.cs +++ /dev/null @@ -1,6 +0,0 @@ -public interface IResultAnimationHandler -{ - ResultAnimationAgent m_resultAnimationAgent { get; } - - void Destroy(); -} diff --git a/SVSim.BattleEngine/Engine/ISkillApplyInformation.cs b/SVSim.BattleEngine/Engine/ISkillApplyInformation.cs index f8202a95..8a603fb1 100644 --- a/SVSim.BattleEngine/Engine/ISkillApplyInformation.cs +++ b/SVSim.BattleEngine/Engine/ISkillApplyInformation.cs @@ -277,8 +277,6 @@ public interface ISkillApplyInformation void InitializeInformationWithoutLifeOffenseModifier(bool isReturnCard = false); - void ReSetupVfxCreator(ICardVfxCreator vfxCreator); - SkillBase CloneAttachSkill(SkillApplyInformation cloneTarget, SkillBase skill); SkillApplyInformation Clone(BattleCardBase card); diff --git a/SVSim.BattleEngine/Engine/InPlayCardControl.cs b/SVSim.BattleEngine/Engine/InPlayCardControl.cs index 2004cbcd..bc952e87 100644 --- a/SVSim.BattleEngine/Engine/InPlayCardControl.cs +++ b/SVSim.BattleEngine/Engine/InPlayCardControl.cs @@ -7,16 +7,8 @@ public class InPlayCardControl { private readonly GameObject m_gameObject; - private const int cMax = 5; - - private const float cBaseX = 215f; - private Vector3[] cPos; - private readonly Vector3 PLAYER_FIELDCARD_SPACE = new Vector3(0f, -110f, 0f); - - private readonly Vector3 ENEMY_FIELDCARD_SPACE = new Vector3(0f, 158f, 0f); - public Transform transform { get; private set; } public InPlayCardControl(GameObject gameObject) @@ -26,84 +18,6 @@ public class InPlayCardControl cPos = new Vector3[5]; } - private void SetInPlayPosition(List battleCardViewList) - { - int num = battleCardViewList.Count; - if (num >= 5) - { - num = 5; - } - for (int i = 0; i < num; i++) - { - switch (m_gameObject.name) - { - case "FieldCard": - m_gameObject.transform.localPosition = PLAYER_FIELDCARD_SPACE; - cPos[i] = new Vector3(215f * (float)i - 215f * (float)(num - 1) / 2f, 0f, 0f); - break; - case "EFieldCard": - m_gameObject.transform.localPosition = ENEMY_FIELDCARD_SPACE; - cPos[i] = new Vector3(-215f * (float)i + 215f * (float)(num - 1) / 2f, 0f, 0f); - break; - } - } - } - - public void RearrangePlayerInplay(float time, List battleCardViewList) - { - SetInPlayPosition(battleCardViewList); - int num = 0; - foreach (IBattleCardView battleCardView in battleCardViewList) - { - if (!battleCardView.isHiddenFromInPlayView) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - Transform transform = battleCardView.Transform; - transform.localPosition = new Vector3(cPos[num].x, transform.localPosition.y, transform.localPosition.z); - } - else - { - if (battleCardView._inPlayRearrangeCoroutine != null) - { - BattleCoroutine.GetInstance().StopCoroutine(battleCardView._inPlayRearrangeCoroutine); - } - battleCardView._inPlayRearrangeCoroutine = BattleCoroutine.GetInstance().StartCoroutine(MoveCardToNewPosition(battleCardView, cPos[num], time)); - } - } - num++; - } - } - - private IEnumerator MoveCardToNewPosition(IBattleCardView cardView, Vector3 targetPosition, float time) - { - Transform cardTransform = cardView.Transform; - float startTime = Time.time; - while (true) - { - float num = (Time.time - startTime) / time; - if (num > 1f) - { - break; - } - float x = Mathf.Lerp(cardTransform.localPosition.x, targetPosition.x, num); - cardTransform.localPosition = new Vector3(x, cardTransform.localPosition.y, cardTransform.localPosition.z); - yield return null; - } - cardTransform.localPosition = new Vector3(targetPosition.x, cardTransform.localPosition.y, cardTransform.localPosition.z); - } - - public Vector3 GetPosition(int index) - { - return cPos[index]; - } - - public Vector3 GetOverflowPosition(int index, bool isPlayer) - { - float num = (isPlayer ? 1f : (-1f)); - return new Vector3((430f + 215f * (float)(index + 1)) * num, 0f, 0f); - } - public static Vector3 CalcPosition(int cardCount, int index, bool isPlayer) { if (isPlayer) diff --git a/SVSim.BattleEngine/Engine/InPlayCardReflection.cs b/SVSim.BattleEngine/Engine/InPlayCardReflection.cs index 0fb4eba9..88715228 100644 --- a/SVSim.BattleEngine/Engine/InPlayCardReflection.cs +++ b/SVSim.BattleEngine/Engine/InPlayCardReflection.cs @@ -67,7 +67,7 @@ public class InPlayCardReflection : ReceivePlayActionsReflectionBase int playIndex = _playIndex; BattlePlayerBase battlePlayer = _battleMgr.GetBattlePlayer(isPlayer); BattleCardBase battleCardIdx = _battleMgr.GetBattleCardIdx(battlePlayer.ClassAndInPlayCardList, playIndex); - if (GameMgr.GetIns().IsReplayBattle && battleCardIdx == null) + if (_battleMgr.GameMgr.IsReplayBattle && battleCardIdx == null) { return; } diff --git a/SVSim.BattleEngine/Engine/InPlayViewBase.cs b/SVSim.BattleEngine/Engine/InPlayViewBase.cs index a1bb0cde..36b26eef 100644 --- a/SVSim.BattleEngine/Engine/InPlayViewBase.cs +++ b/SVSim.BattleEngine/Engine/InPlayViewBase.cs @@ -20,126 +20,8 @@ public abstract class InPlayViewBase battleCardViewList = new List(); } - protected abstract void RearrangeInplay(float rearrangeTime); - - public VfxBase OneTimeRearrangeInplay(float rearrangeTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - rearrangeTime = 0f; - } - return InstantVfx.Create(delegate - { - RearrangeInplay(rearrangeTime); - }); - } - - public void AddCardToView(IBattleCardView cardViewToAdd, float deckRearrangeTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } - if (!battleCardViewList.Contains(cardViewToAdd)) - { - battleCardViewList.Add(cardViewToAdd); - RearrangeInplay(deckRearrangeTime); - } - } - - public void AddCardsToView(List cardViewsToAdd, float deckRearrangeTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } - List source = cardViewsToAdd.FindAll((IBattleCardView cardView) => !battleCardViewList.Contains(cardView)); - if (source.Any()) - { - battleCardViewList.AddRange(source.ToList()); - RearrangeInplay(deckRearrangeTime); - } - } - - public virtual void RemoveCardFromView(IBattleCardView cardViewToRemove, float deckRearrangeTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } - if (battleCardViewList.Remove(cardViewToRemove)) - { - RearrangeInplay(deckRearrangeTime); - } - } - public virtual void RemoveCardFromView(IBattleCardView cardViewToRemove) { battleCardViewList.Remove(cardViewToRemove); } - - public virtual void RemoveCardsFromView(List cardViewsToRemove, float deckRearrangeTime) - { - if (BattleManagerBase.GetIns().IsRecovery) - { - deckRearrangeTime = 0f; - } - if (cardViewsToRemove.FindAll((IBattleCardView cardView) => battleCardViewList.Remove(cardView)).Any()) - { - RearrangeInplay(deckRearrangeTime); - } - } - - public virtual VfxBase CreateRemoveCardsFromViewVfx(List cardViewsToRemove, float deckRearrangeTime) - { - return InstantVfx.Create(delegate - { - RemoveCardsFromView(cardViewsToRemove, deckRearrangeTime); - }); - } - - public void Replacement(IBattleCardView originalView, IBattleCardView newView) - { - battleCardViewList.Insert(battleCardViewList.IndexOf(originalView), newView); - battleCardViewList.RemoveAt(battleCardViewList.IndexOf(originalView)); - if (BattleManagerBase.GetIns().IsRecovery) - { - RearrangeInplay(0f); - } - else - { - RearrangeInplay(0.1f); - } - } - - public void AttachCardView(IBattleCardView cardView) - { - cardView.Transform.parent = inPlayCardControl.transform; - } - - public int GetViewIndex(IBattleCardView viewCard) - { - return battleCardViewList.IndexOf(viewCard); - } - - public Vector3 GetPositionInView(IBattleCardView battleCardView, bool isGlobal) - { - int viewIndex = GetViewIndex(battleCardView); - return GetPositionInView(viewIndex, isGlobal); - } - - public Vector3 GetPositionInView(int viewIndex, bool isGlobal) - { - Vector3 vector = inPlayCardControl.GetPosition(viewIndex); - if (isGlobal) - { - vector = inPlayCardControl.transform.TransformPoint(vector); - } - return vector; - } - - public Vector3 GetPositionInOverflowList(int indexInOverflowList, bool isPlayer) - { - return inPlayCardControl.GetOverflowPosition(indexInOverflowList, isPlayer); - } } diff --git a/SVSim.BattleEngine/Engine/InitializeRoomBattle.cs b/SVSim.BattleEngine/Engine/InitializeRoomBattle.cs index c6dc94bf..2d209610 100644 --- a/SVSim.BattleEngine/Engine/InitializeRoomBattle.cs +++ b/SVSim.BattleEngine/Engine/InitializeRoomBattle.cs @@ -15,12 +15,5 @@ public class InitializeRoomBattle : HeaderData public class LotteryDataInRoom { - public bool IsShowTweetDialog { get; set; } - - public string BannerNameOnTweetDialog { get; set; } = string.Empty; } - - public LotteryDataInRoom LotteyDataInRoom { get; set; } = new LotteryDataInRoom(); - - public bool IsUsedDeck { get; set; } } diff --git a/SVSim.BattleEngine/Engine/InputDialog.cs b/SVSim.BattleEngine/Engine/InputDialog.cs index 11427f05..85b5ed77 100644 --- a/SVSim.BattleEngine/Engine/InputDialog.cs +++ b/SVSim.BattleEngine/Engine/InputDialog.cs @@ -7,71 +7,12 @@ public class InputDialog : MonoBehaviour [SerializeField] private UIToggle _toggle; - [SerializeField] - private UILabel _topLabel; - - [SerializeField] - private UILabel _inputAreaLabel; - - [SerializeField] - private UILabel _bottomLabel; - private bool _enableToggleSound = true; private bool _isFirstOnChange = true; public Action OnChangeToggleEvent; - public bool EnableToggleDisplay - { - set - { - _toggle.gameObject.SetActive(value: true); - } - } - - public string TopLabelText - { - set - { - _topLabel.text = value; - } - } - - public string InputAreaLabel - { - get - { - return _inputAreaLabel.text; - } - set - { - _inputAreaLabel.text = value; - } - } - - public string BottomLabelText - { - set - { - _bottomLabel.text = value; - } - } - - public bool ToggleChecked - { - get - { - return _toggle.value; - } - set - { - _enableToggleSound = false; - _toggle.value = value; - _enableToggleSound = true; - } - } - public static DialogBase Create(int charalimitinput, int charalimitfix, UIInput.KeyboardType keyboard = UIInput.KeyboardType.Default) { NguiObjs textInputDialogPrefab = UIManager.GetInstance().TextInputDialogPrefab; @@ -121,7 +62,7 @@ public class InputDialog : MonoBehaviour { if (_enableToggleSound && !_isFirstOnChange) { - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + } _isFirstOnChange = false; OnChangeToggleEvent.Call(); diff --git a/SVSim.BattleEngine/Engine/InputMgr.cs b/SVSim.BattleEngine/Engine/InputMgr.cs index b94f6adc..f815b91d 100644 --- a/SVSim.BattleEngine/Engine/InputMgr.cs +++ b/SVSim.BattleEngine/Engine/InputMgr.cs @@ -9,16 +9,12 @@ public class InputMgr NONE, PRESS, DOWN, - UP, - STAY, - MAX - } + UP} public enum LAYER_TYPE { NONE = 0, UI = 32, - PARTICLE = 256, GAME = 512, ALL = 65535 } @@ -26,8 +22,6 @@ public class InputMgr private enum ClickState { None, - Down, - LongPress, UpThisFrame, DownMoved } @@ -35,15 +29,9 @@ public class InputMgr private enum DoubleClickState { None, - FirstClickDown, - SecondClickDown, SecondClickUp } - private const float FLICK_SEC = 0.2f; - - private const string CHOICE_BUTTON_TAG = "ChoiceSelectButton"; - private Vector2 m_NonePos = new Vector2(-10000f, -10000f); private IList m_NowTypeList = new List(); @@ -64,50 +52,18 @@ public class InputMgr private IList m_DragEfcList = new List(); - private bool _isInputEnable = true; - private bool _isBackKeyEnable = true; public BattleCamera m_BattleCamera; - public BackGroundBase m_BackGround; - private bool _wentOverDrag; public static bool MouseControl; - public static bool KeyboardControl; - - public static bool KeyboardControlSpace; - - public static bool KeyboardControlEvolution; - - public bool KeyboardEnableControlSpace = true; - - public float _lastFirstClick; - private DoubleClickState _doubleClick; - private Vector2 _firstClickPosition; - - private const float DOUBLE_CLICK_TIME = 0.5f; - - private float _timeSincePress; - - private Vector2 _downPositionStart; - - private const float LONG_PRESS_TIME = 0.3f; - - private const float LONG_PRESS_THRESHOLD = 100f; - private ClickState _clickState; - public const int MOUSE_SHORTCUT_RIGHT_CLICK = 1; - - public const int MOUSE_SHORTCUT_DOUBLE_CLICK = 2; - - private float _KeyboardEmotionWaitTime; - public bool isBackKeyEnable { get @@ -152,341 +108,11 @@ public class InputMgr MouseControl = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.MOUSE_CONTROL); } - ~InputMgr() - { - } - - public void Update() - { - for (int i = 0; i < 1; i++) - { - m_NowTypeList[i] = TYPE.NONE; - } - if (_isInputEnable) - { - MouseClick(); - CheckFlick(); - } - } - - private void CheckFlick() - { - m_IsFlick = false; - if (IsUp()) - { - if (m_DraggingSec < 0.2f && 30f < Mathf.Abs(GetVec().x)) - { - m_IsFlick = true; - } - m_DraggingSec = 0f; - } - if (IsPress()) - { - m_DraggingSec += Time.deltaTime; - } - } - - public void SetInputEnable(bool isEnable) - { - _isInputEnable = isEnable; - StopDragEffect(); - } - - private void StopDragEffect() - { - GameMgr.GetIns().GetEffectMgr().FadeStop(m_DragEfcList[0]); - } - - private void MouseClick() - { - m_NowPosList[0] = Input.mousePosition; - m_FixedPosList[0] = ToolboxGame.UIManager.UIRootLoadingCamera.ScreenToWorldPoint(m_NowPosList[0]); - if (MouseControl) - { - if (_lastFirstClick > 0f && !Input.GetMouseButtonDown(0)) - { - if (_firstClickPosition != m_NowPosList[0]) - { - _lastFirstClick = 0f; - _doubleClick = DoubleClickState.None; - } - else - { - _lastFirstClick -= Time.deltaTime; - } - } - if (_doubleClick == DoubleClickState.SecondClickUp) - { - _doubleClick = DoubleClickState.None; - } - else if (_doubleClick == DoubleClickState.SecondClickDown && (_lastFirstClick <= 0f || _firstClickPosition != m_NowPosList[0])) - { - _doubleClick = DoubleClickState.None; - } - if (_clickState == ClickState.UpThisFrame) - { - _clickState = ClickState.None; - } - switch (_clickState) - { - case ClickState.None: - if (Input.GetMouseButtonDown(0)) - { - _timeSincePress = 0f; - _downPositionStart = m_NowPosList[0]; - _clickState = ClickState.Down; - if (Input.GetMouseButtonUp(0)) - { - _clickState = ClickState.UpThisFrame; - } - } - break; - case ClickState.Down: - if (Input.GetMouseButtonUp(0)) - { - _clickState = ClickState.UpThisFrame; - } - else if (Input.GetMouseButton(0)) - { - if (IsInThreshold()) - { - _timeSincePress += Time.unscaledDeltaTime; - if (_timeSincePress >= 0.3f) - { - _clickState = ClickState.LongPress; - } - } - else - { - _clickState = ClickState.DownMoved; - } - } - else - { - _clickState = ClickState.None; - } - break; - case ClickState.LongPress: - if (!Input.GetMouseButton(0)) - { - _clickState = ClickState.None; - } - else if (!IsInThreshold()) - { - _clickState = ClickState.DownMoved; - } - break; - case ClickState.DownMoved: - if (!Input.GetMouseButton(0)) - { - _clickState = ClickState.None; - } - break; - } - } - if (Input.GetMouseButtonDown(0)) - { - if (MouseControl) - { - if (_doubleClick == DoubleClickState.FirstClickDown && _lastFirstClick > 0f) - { - _doubleClick = DoubleClickState.SecondClickDown; - if (Input.GetMouseButtonUp(0)) - { - _doubleClick = DoubleClickState.SecondClickUp; - } - } - else - { - _doubleClick = DoubleClickState.FirstClickDown; - _lastFirstClick = 0.5f; - _firstClickPosition = m_NowPosList[0]; - m_FirstPosList[0] = m_NowPosList[0]; - m_NowTypeList[0] = TYPE.DOWN; - CheckTouchObject(0); - } - } - else - { - m_FirstPosList[0] = m_NowPosList[0]; - m_NowTypeList[0] = TYPE.DOWN; - CheckTouchObject(0); - } - } - else if (Input.GetMouseButtonUp(0)) - { - m_EndPosList[0] = m_NowPosList[0]; - m_NowTypeList[0] = TYPE.UP; - if (_doubleClick == DoubleClickState.SecondClickDown) - { - _doubleClick = DoubleClickState.SecondClickUp; - _lastFirstClick = 0f; - } - } - else if (Input.GetMouseButton(0)) - { - m_NowTypeList[0] = TYPE.PRESS; - if (m_DragEfcList[0] != null) - { - m_DragEfcList[0].transform.position = m_FixedPosList[0]; - } - } - else - { - StopDragEffect(); - } - if (m_NowTypeList[0] != TYPE.NONE && IsLayerMask()) - { - m_NowTypeList[0] = TYPE.NONE; - } - } - public void SetBattleCamera(BattleCamera battleCamera) { m_BattleCamera = battleCamera; } - public void SetBackGround(BackGroundBase backGround) - { - m_BackGround = backGround; - } - - private void CheckTouchObject(int touchId) - { - Ray ray; - if (!ToolboxGame.UIManager.IsCurrentScene(UIManager.ViewScene.Battle)) - { - ray = ToolboxGame.UIManager.UIRootLoadingCamera.ScreenPointToRay(m_NowPosList[touchId]); - } - else - { - if (BattleManagerBase.GetIns() == null || m_BattleCamera == null || m_BattleCamera.Get3DCamera() == null) - { - return; - } - ray = m_BattleCamera.Get3DCamera().ScreenPointToRay(m_NowPosList[touchId]); - } - RaycastHit hitInfo = default(RaycastHit); - if (ToolboxGame.UIManager.IsCurrentScene(UIManager.ViewScene.Battle)) - { - bool flag = false; - bool flag2 = false; - if (TouchControl.CastRayWithTags(m_NowPosList[touchId], new List { "BattleUI", "ChoiceSelectButton" })) - { - flag = true; - } - else - { - RaycastHit[] array = Physics.RaycastAll(ray.origin, ray.direction, float.PositiveInfinity); - float num = float.PositiveInfinity; - float num2 = float.PositiveInfinity; - Collider collider = null; - Collider collider2 = null; - for (int i = 0; i < array.Length; i++) - { - float distance = array[i].distance; - if (distance < num) - { - num = distance; - collider = array[i].collider; - } - switch (array[i].collider.tag) - { - case "Player": - case "Enemy": - case "PlayerToken": - case "EnemyToken": - case "DetailPanel": - case "ClassBtn": - case "CardHolder": - case "ECardHolder": - case "EpPanel": - flag = true; - break; - case "Detail": - { - int layer = array[i].collider.gameObject.layer; - if (UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Battle) - { - if (layer == 14) - { - flag2 = true; - } - } - else if (layer == 14) - { - flag = true; - } - break; - } - case "Untappable": - if (distance < num2) - { - num2 = distance; - collider2 = array[i].collider; - } - break; - } - } - if (collider == collider2) - { - return; - } - } - if (flag2) - { - Transform transform = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_INPUT_TOUCH_2, m_FixedPosList[touchId].x, m_FixedPosList[touchId].y) - .transform; - UIManager.GetInstance().SetLayerRecursive(transform, 14); - } - else if (flag) - { - Transform transform2 = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_INPUT_TOUCH_2, m_FixedPosList[touchId].x, m_FixedPosList[touchId].y) - .transform; - UIManager.GetInstance().SetLayerRecursive(transform2, 22); - } - } - else if (Physics.Raycast(ray.origin, ray.direction, out hitInfo, float.PositiveInfinity)) - { - Transform transform3 = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_INPUT_TOUCH_2, m_FixedPosList[touchId].x, m_FixedPosList[touchId].y) - .transform; - UIManager.GetInstance().SetLayerRecursive(transform3, 22); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_INPUT_TOUCH_1, m_FixedPosList[touchId].x, m_FixedPosList[touchId].y); - } - if (m_DragEfcList[touchId] == null) - { - if (GameMgr.GetIns().GetEffectMgr().IsPreInEffectReady) - { - m_DragEfcList[touchId] = GameMgr.GetIns().GetEffectMgr().StartTouchEffect(EffectMgr.EffectType.CMN_INPUT_DRAG_1, m_FixedPosList[touchId].x, m_FixedPosList[touchId].y) - .GetGameObjIns(); - } - } - else - { - GameMgr.GetIns().GetEffectMgr().FadePlay(m_DragEfcList[touchId], m_FixedPosList[touchId].x, m_FixedPosList[touchId].y); - } - } - - private bool IsLayerMask() - { - if (m_LayerMask == 0) - { - return false; - } - if (m_NowTypeList[0] != TYPE.DOWN) - { - return false; - } - if (Physics2D.GetRayIntersection(ToolboxGame.UIManager.UIRootLoadingCamera.ScreenPointToRay(m_NowPosList[0]), float.PositiveInfinity, m_LayerMask).collider != null) - { - return true; - } - return false; - } - public bool IsNone() { if (m_NowTypeList[0] == TYPE.NONE) @@ -523,79 +149,21 @@ public class InputMgr return false; } - public bool IsStay() - { - if (m_NowTypeList[0] == TYPE.STAY) - { - return true; - } - return false; - } - - public void InitLayerMask() - { - m_LayerMask = 0; - } - - public void SetLayerMask(int LayerMask) - { - m_LayerMask = LayerMask; - } - public Vector2 GetFirstPos() { return m_FirstPosList[0]; } - public Vector2 GetEndPos() - { - return m_EndPosList[0]; - } - public Vector2 GetPos() { return m_NowPosList[0]; } - public Vector2 GetFixedPos() - { - if (m_NowTypeList[0] == TYPE.NONE) - { - return m_NonePos; - } - return m_FixedPosList[0]; - } - - public Vector2 GetVec() - { - return m_NowPosList[0] - m_FirstPosList[0]; - } - - public float GetAngle() - { - return Mathf.Atan2(m_FirstPosList[0].y - m_NowPosList[0].y, m_FirstPosList[0].x - m_NowPosList[0].x) * 57.29578f + 180f; - } - - public bool IsFlick() - { - return m_IsFlick; - } - - public Vector2 GetFlickVec() - { - return GetVec(); - } - public bool IsDoubleClick() { return _doubleClick == DoubleClickState.SecondClickUp; } - public bool IsLongPress() - { - return _clickState == ClickState.LongPress; - } - public bool IsClick() { return _clickState == ClickState.UpThisFrame; @@ -606,196 +174,8 @@ public class InputMgr return _clickState == ClickState.DownMoved; } - private bool IsInThreshold() - { - return (_downPositionStart - m_NowPosList[0]).sqrMagnitude <= 100f; - } - - public bool IsOverDragDistanceHandPlay(Vector2? firstPosition = null) - { - if (!firstPosition.HasValue) - { - firstPosition = GetFirstPos(); - } - bool flag = !(GetPos().y - firstPosition.Value.y < 40f); - _wentOverDrag |= flag; - return flag; - } - - public bool IsOverDragDistanceInPlay() - { - if (!(Mathf.Abs(GetPos().y - GetFirstPos().y) > 40f)) - { - return Mathf.Abs(GetPos().x - GetFirstPos().x) > 40f; - } - return true; - } - public bool IsOverDragDistanceMulligan() { return Vector2.Distance(GetPos(), GetFirstPos()) > 40f; } - - public bool IsKeyboardUpArrow() - { - if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) - { - return true; - } - return false; - } - - public bool IsKeyboardDownArrow() - { - if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow)) - { - return true; - } - return false; - } - - public bool IsKeyboardRightArrow() - { - if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow)) - { - return true; - } - return false; - } - - public bool IsKeyboardLeftArrow() - { - if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow)) - { - return true; - } - return false; - } - - public bool IsKeyboardEnter() - { - if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.Return)) - { - return true; - } - return false; - } - - public bool IsKeyboardSpace() - { - if (Input.GetKeyDown(KeyCode.Space)) - { - return true; - } - return false; - } - - public bool IsKeyboardShift() - { - if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightShift)) - { - return true; - } - return false; - } - - public bool IsKeyboardCancel() - { - if (Input.GetKeyDown(KeyCode.Backspace) || Input.GetKeyDown(KeyCode.C)) - { - return true; - } - return false; - } - - public bool IsKeyboardEvolve() - { - if (Input.GetKeyDown(KeyCode.E)) - { - return true; - } - return false; - } - - public void SetKeyboardEmotionWaitTime(float wait) - { - _KeyboardEmotionWaitTime = wait; - } - - public bool IsKeyboardEmotion() - { - if (_KeyboardEmotionWaitTime > 0f) - { - _KeyboardEmotionWaitTime -= Time.deltaTime; - return false; - } - if (Input.GetKeyDown(KeyCode.Alpha1)) - { - return true; - } - return false; - } - - public bool IsKeyboardBattleLog() - { - if (Input.GetKeyDown(KeyCode.B)) - { - return true; - } - return false; - } - - public bool IsKeyboardBattleMenu() - { - if (Input.GetKeyDown(KeyCode.Escape)) - { - return true; - } - return false; - } - - public bool IsKeyboardDeckNextPage() - { - if (Input.GetKeyDown(KeyCode.X) || Input.GetKeyDown(KeyCode.Period)) - { - return true; - } - return false; - } - - public bool IsKeyboardDeckPrevPage() - { - if (Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.Comma)) - { - return true; - } - return false; - } - - public bool IsKeyboardClassInfomation() - { - if (Input.GetKey(KeyCode.Tab)) - { - return true; - } - return false; - } - - public bool IsKeyboardAny() - { - if (!IsKeyboardUpArrow() && !IsKeyboardDownArrow() && !IsKeyboardRightArrow() && !IsKeyboardLeftArrow() && !IsKeyboardEnter() && !IsKeyboardSpace() && !IsKeyboardShift() && !IsKeyboardCancel() && !IsKeyboardEvolve() && !IsKeyboardEmotion() && !IsKeyboardBattleLog() && !IsKeyboardBattleMenu()) - { - return IsKeyboardClassInfomation(); - } - return true; - } - - public bool IsAnyMouse() - { - if (!MouseControl || _clickState == ClickState.None) - { - return !IsNone(); - } - return true; - } } diff --git a/SVSim.BattleEngine/Engine/IronField.cs b/SVSim.BattleEngine/Engine/IronField.cs index 3b0acb47..fc5b67ce 100644 --- a/SVSim.BattleEngine/Engine/IronField.cs +++ b/SVSim.BattleEngine/Engine/IronField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class IronField : BackGroundBase { public override int FieldId => 30; @@ -10,76 +11,4 @@ public class IronField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_iron_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles30").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake_1", _fieldParticles.transform.Find("shake_1").GetComponent()); - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_30, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_30_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(2128f, -71f, 238f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-4f, -85.5f, 92f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-210f, -63.4f, 270f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-3.6f, -117.4f, 95f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_1"].Play(); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - yield return new WaitForSeconds(4f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake_1"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/JsonDataExtension.cs b/SVSim.BattleEngine/Engine/JsonDataExtension.cs index 8071cf8f..533aebbc 100644 --- a/SVSim.BattleEngine/Engine/JsonDataExtension.cs +++ b/SVSim.BattleEngine/Engine/JsonDataExtension.cs @@ -35,24 +35,6 @@ public static class JsonDataExtension return value.ToInt(); } - public static long GetValueOrDefault(this JsonData data, string key, long defaultValue) - { - if (!data.TryGetValue(key, out var value)) - { - return defaultValue; - } - return value.ToLong(); - } - - public static double GetValueOrDefault(this JsonData data, string key, double defaultValue) - { - if (!data.TryGetValue(key, out var value)) - { - return defaultValue; - } - return value.ToDouble(); - } - public static bool GetValueOrDefault(this JsonData data, string key, bool defaultValue) { if (!data.TryGetValue(key, out var value)) diff --git a/SVSim.BattleEngine/Engine/JudgeResultFailedToRetryChecker.cs b/SVSim.BattleEngine/Engine/JudgeResultFailedToRetryChecker.cs index f1f7b779..047d02e1 100644 --- a/SVSim.BattleEngine/Engine/JudgeResultFailedToRetryChecker.cs +++ b/SVSim.BattleEngine/Engine/JudgeResultFailedToRetryChecker.cs @@ -3,7 +3,6 @@ using Cute; public class JudgeResultFailedToRetryChecker : NetworkBattleIntervalCheckerBase { - private const int JUDGE_RESULT_RETRY_TIMER = 35; public event Action OnRetry; diff --git a/SVSim.BattleEngine/Engine/LaboratoryField.cs b/SVSim.BattleEngine/Engine/LaboratoryField.cs index 690e3235..a01accf2 100644 --- a/SVSim.BattleEngine/Engine/LaboratoryField.cs +++ b/SVSim.BattleEngine/Engine/LaboratoryField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class LaboratoryField : BackGroundBase { public override int FieldId => 7; @@ -10,100 +11,4 @@ public class LaboratoryField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_labo_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles07").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldObjDictionary.Add("golem", _fieldModel.transform.Find("md_bf_labo_01_golem").gameObject); - _fieldObjDictionary.Add("bookfall_1", _fieldModel.transform.Find("md_bf_labo_01_bookfall_1").gameObject); - _fieldObjDictionary.Add("bookfall_2", _fieldModel.transform.Find("md_bf_labo_01_bookfall_2").gameObject); - m_FieldAnimatorDictionary.Add("golem", _fieldObjDictionary["golem"].GetComponent()); - m_FieldAnimatorDictionary.Add("bookfall_1", _fieldObjDictionary["bookfall_1"].GetComponent()); - m_FieldAnimatorDictionary.Add("bookfall_2", _fieldObjDictionary["bookfall_2"].GetComponent()); - _fieldParticleSystemDictionary.Add("book_1", _fieldParticles.transform.Find("book_1").GetComponent()); - _fieldParticleSystemDictionary.Add("book_2", _fieldParticles.transform.Find("book_2").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_7, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_7_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["golem"].SetTrigger("Threat01"); - _battleCamera.Camera.transform.localPosition = new Vector3(-525f, 125f, -230f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-25f, -105f, 98f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-240f, -60f, 20f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-30f, -105f, 98f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{num}", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 1: - m_FieldAnimatorDictionary["golem"].SetTrigger("Threat01"); - yield return new WaitForSeconds(7.5f); - break; - case 2: - m_FieldAnimatorDictionary["golem"].SetTrigger("Threat02"); - yield return new WaitForSeconds(2f); - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["golem"].SetTrigger("Shake"); - if (FieldId == 7) - { - m_FieldAnimatorDictionary["bookfall_1"].SetTrigger("Fall"); - m_FieldAnimatorDictionary["bookfall_2"].SetTrigger("Fall"); - yield return new WaitForSeconds(0.5f); - _fieldParticleSystemDictionary["book_1"].Play(); - _fieldParticleSystemDictionary["book_2"].Play(); - } - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/LaboratoryNightField.cs b/SVSim.BattleEngine/Engine/LaboratoryNightField.cs index b253727e..fc168acf 100644 --- a/SVSim.BattleEngine/Engine/LaboratoryNightField.cs +++ b/SVSim.BattleEngine/Engine/LaboratoryNightField.cs @@ -1,7 +1,11 @@ +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class LaboratoryNightField : LaboratoryField { public override int FieldId => 17; - public override int FieldEffectId => 7; public LaboratoryNightField(string bgmId = "NONE") diff --git a/SVSim.BattleEngine/Engine/LitJson/JsonData.cs b/SVSim.BattleEngine/Engine/LitJson/JsonData.cs index da5c9879..eb5627b0 100644 --- a/SVSim.BattleEngine/Engine/LitJson/JsonData.cs +++ b/SVSim.BattleEngine/Engine/LitJson/JsonData.cs @@ -52,15 +52,6 @@ public class JsonData : IJsonWrapper, IList, ICollection, IEnumerable, IOrderedD } } - public ICollection Values - { - get - { - EnsureDictionary(); - return inst_object.Values; - } - } - int ICollection.Count => Count; bool ICollection.IsSynchronized => EnsureCollection().IsSynchronized; diff --git a/SVSim.BattleEngine/Engine/LitJson/JsonMapper.cs b/SVSim.BattleEngine/Engine/LitJson/JsonMapper.cs index 0fb17ed6..c514e644 100644 --- a/SVSim.BattleEngine/Engine/LitJson/JsonMapper.cs +++ b/SVSim.BattleEngine/Engine/LitJson/JsonMapper.cs @@ -666,50 +666,11 @@ public class JsonMapper } } - public static void ToJson(object obj, JsonWriter writer) - { - WriteValue(obj, writer, writer_is_private: false, 0); - } - - public static JsonData ToObject(JsonReader reader) - { - return (JsonData)ToWrapper(() => new JsonData(), reader); - } - - public static JsonData ToObject(TextReader reader) - { - JsonReader reader2 = new JsonReader(reader); - return (JsonData)ToWrapper(() => new JsonData(), reader2); - } - public static JsonData ToObject(string json) { return (JsonData)ToWrapper(() => new JsonData(), json); } - public static T ToObject(JsonReader reader) - { - return (T)ReadValue(typeof(T), reader); - } - - public static T ToObject(TextReader reader) - { - JsonReader reader2 = new JsonReader(reader); - return (T)ReadValue(typeof(T), reader2); - } - - public static T ToObject(string json) - { - JsonReader reader = new JsonReader(json); - return (T)ReadValue(typeof(T), reader); - } - - public static object ToObject(Type toType, string json) - { - JsonReader reader = new JsonReader(json); - return ReadValue(toType, reader); - } - public static IJsonWrapper ToWrapper(WrapperFactory factory, JsonReader reader) { return ReadValue(factory, reader); @@ -720,29 +681,4 @@ public class JsonMapper JsonReader reader = new JsonReader(json); return ReadValue(factory, reader); } - - public static void RegisterExporter(ExporterFunc exporter) - { - ExporterFunc value = delegate(object obj, JsonWriter writer) - { - exporter((T)obj, writer); - }; - custom_exporters_table[typeof(T)] = value; - } - - public static void RegisterImporter(ImporterFunc importer) - { - ImporterFunc importer2 = (object input) => importer((TJson)input); - RegisterImporter(custom_importers_table, typeof(TJson), typeof(TValue), importer2); - } - - public static void UnregisterExporters() - { - custom_exporters_table.Clear(); - } - - public static void UnregisterImporters() - { - custom_importers_table.Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/LitJson/JsonReader.cs b/SVSim.BattleEngine/Engine/LitJson/JsonReader.cs index 5a39f8aa..89c91921 100644 --- a/SVSim.BattleEngine/Engine/LitJson/JsonReader.cs +++ b/SVSim.BattleEngine/Engine/LitJson/JsonReader.cs @@ -36,30 +36,6 @@ public class JsonReader private JsonToken token; - public bool AllowComments - { - get - { - return lexer.AllowComments; - } - set - { - lexer.AllowComments = value; - } - } - - public bool AllowSingleQuotedStrings - { - get - { - return lexer.AllowSingleQuotedStrings; - } - set - { - lexer.AllowSingleQuotedStrings = value; - } - } - public bool SkipNonMembers { get @@ -72,10 +48,6 @@ public class JsonReader } } - public bool EndOfInput => end_of_input; - - public bool EndOfJson => end_of_json; - public JsonToken Token => token; public object Value => token_value; diff --git a/SVSim.BattleEngine/Engine/LitJson/JsonWriter.cs b/SVSim.BattleEngine/Engine/LitJson/JsonWriter.cs index 1db0098c..ac8831e8 100644 --- a/SVSim.BattleEngine/Engine/LitJson/JsonWriter.cs +++ b/SVSim.BattleEngine/Engine/LitJson/JsonWriter.cs @@ -30,31 +30,6 @@ public class JsonWriter private TextWriter writer; - public int IndentValue - { - get - { - return indent_value; - } - set - { - indentation = indentation / indent_value * value; - indent_value = value; - } - } - - public bool PrettyPrint - { - get - { - return pretty_print; - } - set - { - pretty_print = value; - } - } - public TextWriter TextWriter => writer; public bool Validate diff --git a/SVSim.BattleEngine/Engine/LitJson/Lexer.cs b/SVSim.BattleEngine/Engine/LitJson/Lexer.cs index 53e90f67..57c4606e 100644 --- a/SVSim.BattleEngine/Engine/LitJson/Lexer.cs +++ b/SVSim.BattleEngine/Engine/LitJson/Lexer.cs @@ -36,30 +36,6 @@ internal class Lexer private int unichar; - public bool AllowComments - { - get - { - return allow_comments; - } - set - { - allow_comments = value; - } - } - - public bool AllowSingleQuotedStrings - { - get - { - return allow_single_quoted_strings; - } - set - { - allow_single_quoted_strings = value; - } - } - public bool EndOfInput => end_of_input; public int Token => token; diff --git a/SVSim.BattleEngine/Engine/LitJson/ParserToken.cs b/SVSim.BattleEngine/Engine/LitJson/ParserToken.cs index 9ebbc517..6c63baf1 100644 --- a/SVSim.BattleEngine/Engine/LitJson/ParserToken.cs +++ b/SVSim.BattleEngine/Engine/LitJson/ParserToken.cs @@ -3,12 +3,6 @@ namespace LitJson; internal enum ParserToken { None = 65536, - Number, - True, - False, - Null, - CharSeq, - Char, Text, Object, ObjectPrime, @@ -18,7 +12,4 @@ internal enum ParserToken ArrayPrime, Value, ValueRest, - String, - End, - Epsilon -} + String} diff --git a/SVSim.BattleEngine/Engine/LoadDetail.cs b/SVSim.BattleEngine/Engine/LoadDetail.cs index 1dd4bf00..3d174eba 100644 --- a/SVSim.BattleEngine/Engine/LoadDetail.cs +++ b/SVSim.BattleEngine/Engine/LoadDetail.cs @@ -7,9 +7,6 @@ using Wizard.UI.LoginBonus; public class LoadDetail { - private const string ARENA_INFO_KEY = "arena_info"; - - public int RotationFirstCardPackId; public int RotationLatestCardPackId; @@ -33,12 +30,8 @@ public class LoadDetail public UserConfig _userConfig = new UserConfig(); - public ChallengeConfig _challengeConfig = new ChallengeConfig(); - public Dictionary _userRank = new Dictionary(); - public List _classCharaExpList = new List(); - public Dictionary _userItemDict = new Dictionary(); public DateTime _masterResetNextTime; @@ -55,422 +48,16 @@ public class LoadDetail public bool[] LootBoxReguration { get; private set; } = new bool[6]; - public JsonData UserDeckListRotation { get; private set; } - - public JsonData UserDeckListUnlimited { get; private set; } - - public JsonData UserDeckListPreRotation { get; private set; } - - public JsonData UserDeckListCrossover { get; private set; } - - public JsonData UserDeckListMyRotation { get; private set; } - - public List AcquiredSkinList { get; private set; } = new List(); - public List AcquiredMyPageBGList { get; private set; } = new List(); - public List UserCardList { get; private set; } = new List(); - - public List RankInfoList { get; private set; } = new List(); - - public Dictionary BattlePassLevelInfoList { get; private set; } = new Dictionary(); - - public List LoadingExclusionCardList { get; private set; } = new List(); - - public int BattleRecoveryStatus { get; private set; } - - public int RoomRecoveryStatus { get; private set; } - public long DefaultEmblemId { get; private set; } public int DefaultDegreeId { get; private set; } - public NormalData NormalLoginBonusData { get; private set; } - - public ContinuousData ContinuousLoginBonusData { get; private set; } - - public List SpecialLoginBonusDataList { get; private set; } = new List(); - - public FreeCardPackBoxData FreeCardPackData { get; private set; } - - public Dictionary UserItemExpireTimeDictionary { get; set; } = new Dictionary(); - - public List UserItemNotStartList { get; set; } = new List(); - public List ReprintedBaseCardIds { get; private set; } = new List(); - public CardMaster.UpdateInfo CardMasterUpdateInfo { get; private set; } - - public int ResourceDlViewID { get; private set; } - public List OpenBattleFieldIdList { get; private set; } - public void ConvertJsonData(JsonData responseData) - { - JsonData jsonData = responseData["data"]; - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(jsonData["maintenance_card_list"]); - JsonData jsonData2 = jsonData["unlimited_restricted_base_card_id_list"]; - if (jsonData2.IsObject) - { - foreach (string key2 in jsonData2.Keys) - { - if (int.TryParse(key2, out var result)) - { - UnlimitedRestrictedCardList.Add(new UnlimitedRestrictedCard(result, jsonData2[key2].ToInt())); - } - } - } - JsonData jsonData3 = jsonData["rotation_card_set_id_list"]; - for (int i = 0; i < jsonData3.Count; i++) - { - RotationCardSetList.Add(jsonData3[i]["card_set_id"].ToInt()); - } - RotationLatestCardPackId = RotationCardSetList[RotationCardSetList.Count - 1]; - RotationFirstCardPackId = RotationCardSetList[1]; - JsonData jsonData4 = jsonData["red_ether_overwrite_list"]; - for (int j = 0; j < jsonData4.Count; j++) - { - string key = jsonData4[j]["card_id"].ToString(); - if (jsonData4[j].Keys.Contains("get_red_ether")) - { - int value = jsonData4[j]["get_red_ether"].ToInt(); - OverwriteGetRedEtherDict.Add(key, value); - } - if (jsonData4[j].Keys.Contains("use_red_ether")) - { - int value2 = jsonData4[j]["use_red_ether"].ToInt(); - OverwriteUseRedEtherDict.Add(key, value2); - } - } - UserInfo userInfo = _userInfo; - JsonData jsonData5 = jsonData["user_info"]; - userInfo.name = jsonData5["name"].ToString(); - userInfo.birth_day = jsonData5["birth"].ToString(); - userInfo.selected_emblem_id = jsonData5["selected_emblem_id"].ToLong(); - userInfo.selected_degree_id = jsonData5["selected_degree_id"].ToInt(); - JsonData jsonData6 = jsonData5["country_code"]; - userInfo.country_code = ((jsonData6 == null) ? string.Empty : jsonData6.ToString()); - PlayerStaticData.IsOfficialUser = jsonData5["is_official"].ToInt() == 1; - PlayerStaticData.IsOfficialUserDisplay = jsonData5["is_official_mark_displayed"].ToInt() == 1; - _userRank[0] = new UserRank(); - _userRank[1] = new UserRank(); - _userRank[104] = new UserRank(); - _userRank[5] = new UserRank(); - _userRank[39] = new UserRank(); - JsonData jsonData7 = jsonData["loot_box_regulation"]; - if (jsonData7.Count > 0) - { - LootBoxReguration[0] = jsonData7["pack"].ToInt() == 1; - LootBoxReguration[1] = jsonData7["arena_2pick"].ToInt() == 1; - LootBoxReguration[2] = jsonData7["arena_sealed"].ToInt() == 1; - LootBoxReguration[3] = jsonData7["arena_colosseum"].ToInt() == 1; - LootBoxReguration[4] = jsonData7["arena_competition"].ToInt() == 1; - LootBoxReguration[5] = jsonData7["special_shop"].ToInt() == 1; - } - else - { - for (int k = 0; k < 6; k++) - { - LootBoxReguration[k] = false; - } - } - _userCrystalCount.SetUserCrystalCount(jsonData["user_crystal_count"]); - _userCrystalCount.ParseSpecialCrystal(responseData); - JsonData jsonData8 = jsonData["user_item_list"]; - for (int l = 0; l < jsonData8.Count; l++) - { - PlayerStaticData.InitializeItemNum(jsonData8[l]["item_id"].ToInt(), jsonData8[l]["number"].ToInt()); - } - Data.Load.data.UserItemExpireTimeDictionary = new Dictionary(); - Data.Load.data.UserItemNotStartList = new List(); - if (jsonData.Keys.Contains("item_expire_date")) - { - JsonData jsonData9 = jsonData["item_expire_date"]; - for (int m = 0; m < jsonData9.Count; m++) - { - JsonData jsonData10 = jsonData9[m]; - int num = jsonData10["item_id"].ToInt(); - string text = jsonData10["expire_date"].ToString(); - if (jsonData10.TryGetValue("start_date", out var value3) && new RemainTime(value3.ToString(), responseData["data_headers"]["servertime"].ToDouble()).Second > 1) - { - Data.Load.data.UserItemNotStartList.Add(num); - } - if (!string.IsNullOrEmpty(text)) - { - Data.Load.data.UserItemExpireTimeDictionary[num] = ConvertTime.ToLocal(text); - } - } - } - PlayerStaticData.UserSpotCardPointCount = jsonData["spot_point"].ToInt(); - if (jsonData.Keys.Contains("arena_info")) - { - Data.ArenaData = new ArenaData(jsonData["arena_info"]); - Data.ArenaData.ColosseumData.IsFreeEntry = jsonData["is_available_colosseum_free_entry"].ToBoolean(); - } - _receiveInviteCount = jsonData["friend_battle_invite_count"].ToInt(); - _userTutorial.Update(jsonData["user_tutorial"]); - UserDeckListRotation = jsonData["user_deck_rotation"]["user_deck_list"]; - UserDeckListUnlimited = jsonData["user_deck_unlimited"]["user_deck_list"]; - if (jsonData.Keys.Contains("user_deck_pre_rotation")) - { - UserDeckListPreRotation = jsonData["user_deck_pre_rotation"]["user_deck_list"]; - } - if (jsonData.Keys.Contains("user_deck_crossover")) - { - UserDeckListCrossover = jsonData["user_deck_crossover"]["user_deck_list"]; - } - if (jsonData.Keys.Contains("user_deck_my_rotation")) - { - UserDeckListMyRotation = jsonData["user_deck_my_rotation"]["user_deck_list"]; - } - if (Data.Master.isMasterDataLoaded) - { - DeckListUtility.SetDeckListDataWithLodeIndex(); - } - DefaultEmblemId = jsonData["default_setting"]["default_emblem_id"].ToInt(); - JsonData jsonData11 = jsonData["user_emblem_list"]; - for (int n = 0; n < jsonData11.Count; n++) - { - long num2 = jsonData11[n]["emblem_id"].ToLong(); - if (Data.Master.EmblemMgr != null) - { - Data.Master.EmblemMgr.Acquired(num2); - Data.Master.EmblemMgr.UnsetNew(num2); - } - else - { - _acquiredEmblemList.Add(num2); - } - } - if (jsonData.TryGetValue("user_favorite_emblem_list", out var value4)) - { - for (int num3 = 0; num3 < value4.Count; num3++) - { - long num4 = value4[num3].ToLong(); - if (Data.Master.EmblemMgr != null) - { - Data.Master.EmblemMgr.SetFavorite(num4, favorite: true); - } - else - { - _favoriteEmblemList.Add(num4); - } - } - } - DefaultDegreeId = jsonData["default_setting"]["default_degree_id"].ToInt(); - JsonData jsonData12 = jsonData["user_degree_list"]; - for (int num5 = 0; num5 < jsonData12.Count; num5++) - { - int num6 = (int)jsonData12[num5]["degree_id"]; - if (Data.Master.DegreeMgr != null) - { - Data.Master.DegreeMgr.Acquired(num6); - Data.Master.DegreeMgr.UnsetNew(num6); - } - else - { - _acquiredDegreeList.Add(num6); - } - } - if (jsonData.TryGetValue("user_favorite_degree_list", out var value5)) - { - for (int num7 = 0; num7 < value5.Count; num7++) - { - int num8 = value5[num7].ToInt(); - if (Data.Master.DegreeMgr != null) - { - Data.Master.DegreeMgr.SetFavorite(num8, favorite: true); - } - else - { - _favoriteDegreeList.Add(num8); - } - } - } - JsonData jsonData13 = jsonData["user_leader_skin_list"]; - for (int num9 = 0; num9 < jsonData13.Count; num9++) - { - JsonData jsonData14 = jsonData13[num9]; - if (jsonData14["is_owned"].ToBoolean()) - { - AcquiredSkinList.Add(jsonData14["leader_skin_id"].ToInt()); - } - } - JsonData jsonData15 = jsonData["user_sleeve_list"]; - for (int num10 = 0; num10 < jsonData15.Count; num10++) - { - long num11 = jsonData15[num10]["sleeve_id"].ToLong(); - if (Data.Master.SleeveMgr != null) - { - Data.Master.SleeveMgr.Acquired(num11); - Data.Master.SleeveMgr.UnsetNew(num11); - } - else - { - _acquiredSleeveList.Add(num11); - } - } - if (jsonData.TryGetValue("user_favorite_sleeve_list", out var value6)) - { - for (int num12 = 0; num12 < value6.Count; num12++) - { - long num13 = value6[num12].ToLong(); - if (Data.Master.SleeveMgr != null) - { - Data.Master.SleeveMgr.SetFavorite(num13, b: true); - } - else - { - _favoriteSleeveList.Add(num13); - } - } - } - JsonData jsonData16 = jsonData["user_mypage_list"]; - AcquiredMyPageBGList = new List(); - for (int num14 = 0; num14 < jsonData16.Count; num14++) - { - AcquiredMyPageBGList.Add(jsonData16[num14].ToString()); - } - JsonData jsonData17 = jsonData["user_card_list"]; - List favoriteCardList = GameMgr.GetIns().GetDataMgr().FavoriteCardList; - for (int num15 = 0; num15 < jsonData17.Count; num15++) - { - JsonData jsonData18 = jsonData17[num15]; - UserCard userCard = new UserCard(); - int item = (userCard.card_id = jsonData18["card_id"].ToInt()); - userCard.number = jsonData18["number"].ToInt(); - if (jsonData18["is_protected"].ToInt() != 0) - { - favoriteCardList.Add(item); - } - UserCardList.Add(userCard); - } - JsonData userClassCharaList = jsonData["user_class_list"]; - JsonData userRankMatchList = jsonData["user_rank_match_list"]; - GameMgr.GetIns().GetDataMgr().SetClassPrm(userClassCharaList, userRankMatchList); - ParseUserRank(jsonData); - JsonData jsonData19 = jsonData["rank_info"]; - int num16 = 0; - for (int num17 = 0; num17 < jsonData19.Count; num17++) - { - JsonData jsonData20 = jsonData19[num17]; - RankInfo rankInfo = new RankInfo(jsonData20); - if (num17 >= 24) - { - int num18 = jsonData20["accumulate_master_point"].ToInt(); - rankInfo._necessaryMasterPoint = num18 - num16; - num16 = num18; - } - RankInfoList.Add(rankInfo); - } - JsonData jsonData21 = jsonData["class_exp"]; - for (int num19 = 0; num19 < jsonData21.Count; num19++) - { - JsonData jsonData22 = jsonData21[num19]; - ClassCharaExp classCharaExp = new ClassCharaExp(); - classCharaExp.level = jsonData22["level"].ToInt(); - classCharaExp.necessary_exp = jsonData22["necessary_exp"].ToInt(); - classCharaExp.accumulate_exp = jsonData22["accumulate_exp"].ToInt(); - _classCharaExpList.Add(classCharaExp); - } - if (jsonData.TryGetValue("battle_pass_level_info", out var value7)) - { - foreach (JsonData value13 in value7.Values) - { - BattlePassLevelInfo battlePassLevelInfo = new BattlePassLevelInfo(value13); - BattlePassLevelInfoList.Add(battlePassLevelInfo.Level, battlePassLevelInfo); - } - } - JsonData jsonData23 = jsonData["loading_exclusion_card_list"]; - for (int num20 = 0; num20 < jsonData23.Count; num20++) - { - LoadingExclusionCardList.Add(Convert.ToInt32(jsonData23[num20].ToString())); - } - SettingRecoveryStatus(jsonData["battle_recovery_status"].ToInt(), jsonData["room_recovery_status"].ToInt()); - NormalLoginBonusData = null; - ContinuousLoginBonusData = null; - SpecialLoginBonusDataList.Clear(); - if (jsonData.Keys.Contains("daily_login_bonus")) - { - ParseLoginBonusInfo(jsonData["daily_login_bonus"]); - } - FreeCardPackData = null; - if (jsonData.TryGetValue("free_card_pack_box_campaign", out var value8)) - { - FreeCardPackData = new FreeCardPackBoxData(value8); - } - JsonData jsonData24 = jsonData["reprinted_base_card_ids"]; - ReprintedBaseCardIds.Clear(); - for (int num21 = 0; num21 < jsonData24.Count; num21++) - { - ReprintedBaseCardIds.Add(jsonData24[num21].ToInt()); - } - SpotCardData spotCardData = new SpotCardData(); - if (jsonData.Keys.Contains("spot_cards")) - { - spotCardData.SetSpotCardData(jsonData["spot_cards"]); - } - GameMgr.GetIns().GetDataMgr().SpotCardData = spotCardData; - CardMasterUpdateInfo = new CardMaster.UpdateInfo(jsonData); - if (jsonData.Keys.Contains("pre_release_info")) - { - Prerelease.Create(jsonData["pre_release_info"]); - } - if (jsonData.Keys.Contains("gathering_info")) - { - Data.MyPageNotifications.data.IsInviteGathering = jsonData["gathering_info"]["has_invite"].ToInt() != 0; - } - Data.User.ConnectTimeForMasterReset = ConvertTime.UnixTimeToDateTime(responseData["data_headers"]["servertime"].ToInt()); - Data.User.ConnectSinceStartUp = Time.realtimeSinceStartup; - _masterResetNextTime = DateTime.MinValue; - Data.Load.data._challengeConfig.UseTwoPickPremiumCard = responseData["data"]["challenge_config"]["use_challenge_two_pick_premium_card"].ToInt() == 1; - Data.Load.data._challengeConfig.TwoPickSleeveId = responseData["data"]["challenge_config"]["challenge_two_pick_sleeve_id"].ToLong(); - Data.ParseIsBattlePassPeriod(responseData["data"]); - Data.ParseMaintenance(jsonData["feature_maintenance_list"]); - ResourceDlViewID = jsonData.GetValueOrDefault("card_set_id_for_resource_dl_view", 1); - if (jsonData.Keys.Contains("open_battle_field_id_list") && jsonData.TryGetValue("open_battle_field_id_list", out var value9)) - { - OpenBattleFieldIdList = new List(); - for (int num22 = 0; num22 < value9.Count; num22++) - { - OpenBattleFieldIdList.Add(value9[num22].ToString()); - } - PlayerPrefsWrapper.TurnOnFirsStageIfStageIdListAllOff(); - } - if (jsonData.TryGetValue("crossover_info", out var value10)) - { - Data.Crossover.Parse(value10); - } - if (jsonData.TryGetValue("my_rotation_info", out var value11)) - { - bool isFinishInitializeText = Data.MyRotationAllInfo.IsFinishInitializeText; - Data.MyRotationAllInfo = new MyRotationAllInfo(); - Data.MyRotationAllInfo.Parse(value11, responseData["data_headers"]); - if (isFinishInitializeText) - { - Data.MyRotationAllInfo.InitializeText(); - } - } - if (jsonData.TryGetValue("avatar_info", out var value12)) - { - Data.AvatarBattleAllInfo = new AvatarBattleAllInfo(); - Data.AvatarBattleAllInfo.Parse(value12, responseData["data_headers"]); - } - } - - public void ParseUserRank(JsonData data) - { - if (data["user_rank"] != null) - { - for (int i = 0; i < data["user_rank"].Count; i++) - { - JsonData jsonData = data["user_rank"][i]; - Format format = Data.ParseApiFormat(jsonData["deck_format"].ToInt()); - _userRank[(int)format].Initialize(jsonData, format); - } - } - } - public bool IsAcquiredSleeve(long sleeveId) { return _acquiredSleeveList.Contains(sleeveId); @@ -500,95 +87,4 @@ public class LoadDetail { return _favoriteDegreeList.Contains(degreeId); } - - public bool IsExistLoginBonusData() - { - return NormalLoginBonusData != null; - } - - public bool IsExistFreeCardPackBoxData() - { - return FreeCardPackData != null; - } - - public void SettingRecoveryStatus(int battleRecovery, int roomRecovery) - { - BattleRecoveryStatus = battleRecovery; - RoomRecoveryStatus = roomRecovery; - } - - public void InitRecoveryStatus() - { - BattleRecoveryStatus = 0; - RoomRecoveryStatus = 0; - } - - public List GetRankInfoRawList(Format format) - { - if (format == Format.Crossover) - { - return Data.Crossover.GetRankInfoRawList(); - } - return RankInfoList; - } - - public RankInfo GetRankInfo(Format format, int rankId) - { - if (format == Format.Crossover) - { - return Data.Crossover.GetRankInfo(rankId); - } - return RankInfoList[rankId - 1]; - } - - public bool IsStartRank(Format format, int rankId) - { - if (format == Format.Crossover) - { - return Data.Crossover.IsStartRank(rankId); - } - return RankInfoList[0].RankId == rankId; - } - - private void ParseLoginBonusInfo(JsonData info) - { - if (info == null) - { - return; - } - ICollection keys = info.Keys; - if (keys.Contains("normal")) - { - JsonData jsonData = info["normal"]; - if (jsonData != null && jsonData.Count > 0) - { - NormalLoginBonusData = new NormalData(jsonData); - } - } - if (keys.Contains("total")) - { - JsonData jsonData2 = info["total"]; - if (jsonData2 != null && jsonData2.Count > 0) - { - ContinuousLoginBonusData = new ContinuousData(jsonData2); - } - } - if (!keys.Contains("campaign")) - { - return; - } - JsonData jsonData3 = info["campaign"]; - if (jsonData3 != null) - { - for (int i = 0; i < jsonData3.Count; i++) - { - SpecialLoginBonusDataList.Add(new SpecialData(jsonData3[i])); - } - } - } - - public void InitializeAfterMasterLoading() - { - Data.MyRotationAllInfo.InitializeText(); - } } diff --git a/SVSim.BattleEngine/Engine/LoadingBase.cs b/SVSim.BattleEngine/Engine/LoadingBase.cs deleted file mode 100644 index c4d881ac..00000000 --- a/SVSim.BattleEngine/Engine/LoadingBase.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System.Collections; -using Cute; -using UnityEngine; -using Wizard; - -public class LoadingBase : UIBase -{ - [SerializeField] - private GameObject mainObj; - - [SerializeField] - private UILabel ParLabel; - - [SerializeField] - private UIGauge LoadingBar; - - [SerializeField] - protected UILabel LoadTitleLabel; - - [SerializeField] - protected UILabel LoadTextLabel; - - [SerializeField] - private UITexture BGTexture; - - private int loadIndex; - - private string comment = ""; - - private Coroutine coroutine; - - protected bool isLabelUpdate = true; - - private float loadAssetsMaxNum; - - public bool IsOpponentWait; - - public float CurrentProgress { get; private set; } - - public bool MaximumValueFixedMode { get; set; } - - private void Awake() - { - MaximumValueFixedMode = false; - CurrentProgress = 0f; - } - - protected virtual void Start() - { - if ((bool)LoadTextLabel) - { - comment = Data.SystemText.Get("System_0001"); - } - if ((bool)ParLabel) - { - ParLabel.text = "0%"; - } - if ((bool)mainObj) - { - mainObj.SetActive(value: false); - mainObj.GetComponent().uiCamera = UIManager.GetInstance().UIRootLoadingCamera; - } - OnEnable(); - } - - public virtual void fadeOutLoading() - { - } - - public void closeLoading() - { - if (base.gameObject != null) - { - Object.Destroy(base.gameObject); - } - } - - private void OnEnable() - { - if (coroutine == null) - { - setParLabelActive(isactive: true); - coroutine = StartCoroutine(lodingAnimation()); - } - } - - private void OnDisable() - { - if (coroutine != null) - { - StopCoroutine(coroutine); - coroutine = null; - } - IsOpponentWait = false; - } - - public void setMaxAssetsNum(bool enable, float num) - { - MaximumValueFixedMode = enable; - loadAssetsMaxNum = num; - } - - public void setLoadingComment(string comment) - { - this.comment = comment; - } - - public void setParLabelActive(bool isactive) - { - if ((bool)ParLabel && ParLabel.gameObject.activeSelf != isactive) - { - ParLabel.gameObject.SetActive(isactive); - } - } - - public IEnumerator lodingAnimation() - { - if ((bool)mainObj) - { - mainObj.SetActive(value: false); - } - WaitForSeconds waitTime = new WaitForSeconds(0.05f); - while (true) - { - float num = ((!MaximumValueFixedMode) ? (Toolbox.ResourcesManager.GetDownloadMaxSize() + (float)Toolbox.ResourcesManager.GetLoadingMax()) : loadAssetsMaxNum); - float num2 = CalculateProgress(); - CurrentProgress = ((num == 0f) ? 0f : (num2 / num)); - if (CurrentProgress > 1f) - { - CurrentProgress = 1f; - } - if ((bool)ParLabel) - { - ParLabel.text = $"{CurrentProgress * 100f:f1}%"; - } - if ((bool)LoadingBar) - { - LoadingBar.Value = CurrentProgress; - } - string str = ""; - for (int i = 0; i < loadIndex; i++) - { - str += "."; - } - if (Data.SystemText == null) - { - yield return 0; - } - if (isLabelUpdate && (bool)LoadTextLabel) - { - LoadTextLabel.text = comment + str; - } - loadIndex++; - if (loadIndex >= 4) - { - loadIndex = 0; - } - yield return waitTime; - if ((bool)mainObj && !mainObj.activeSelf) - { - mainObj.SetActive(value: true); - mainObj.GetComponent().enabled = true; - } - if (IsOpponentWait) - { - if (CurrentProgress >= 1f) - { - setLoadingComment(Data.SystemText.Get("Battle_0408")); - setParLabelActive(isactive: false); - } - else - { - setLoadingComment(Data.SystemText.Get("System_0001")); - setParLabelActive(isactive: true); - } - } - } - } - - protected virtual float CalculateProgress() - { - return Toolbox.ResourcesManager.GetLoadingCompleted(); - } -} diff --git a/SVSim.BattleEngine/Engine/LoadingDownLoad.cs b/SVSim.BattleEngine/Engine/LoadingDownLoad.cs deleted file mode 100644 index dfe5df8e..00000000 --- a/SVSim.BattleEngine/Engine/LoadingDownLoad.cs +++ /dev/null @@ -1,399 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class LoadingDownLoad : LoadingBase -{ - private class ClassDetail - { - public Texture TextureBase; - - public string strName; - } - - private class ClassPack - { - public int ID = -1; - - public ClassDetail Detail; - } - - private enum eCharacterObjsIndex - { - Character - } - - public enum eType - { - CardDetail, - CharacterDetail, - StoryDetail - } - - private enum eSide - { - Left, - Right - } - - [SerializeField] - private BoxCollider[] _flickColliderArray; - - [SerializeField] - private LoadingDownLoadCardView _cardView; - - [SerializeField] - private LoadingDownLoadStoryView _storyView; - - [SerializeField] - private NguiObjs CharacterDetailObjs; - - [SerializeField] - private TweenPosition TweenPosCloseUpTexture; - - [SerializeField] - private TweenAlpha TweenAlphaName; - - [SerializeField] - private TweenAlpha TweenAlphaDescription; - - [SerializeField] - private UILabel LabelClassName; - - [SerializeField] - private UILabel LabelClassDesc; - - private readonly string[] CharacterTexturePath = new string[8] { "class_01_base", "class_02_base", "class_03_base", "class_04_base", "class_05_base", "class_06_base", "class_07_base", "class_08_base" }; - - private const string PREFIX_FILE_TARGET = "class_03_base"; - - [SerializeField] - private NguiObjs CharacterSelectCircle; - - public const string loadPrefix = "Images/Loading/"; - - private Dictionary m_DicPack; - - private Vector3 m_CharacterDefaultPos = new Vector3(0f, 0f, 0f); - - private Vector3 m_CharacterLeftFromPos = new Vector3(-50f, 0f, 0f); - - private Vector3 m_CharacterRightFromPos = new Vector3(50f, 0f, 0f); - - private int m_SelectCharacterIndex; - - private float _defaultEvoLineRootY; - - private const float CHARACTER_TWEEN_TIME = 0.1f; - - private const int CHARACTER_MAX = 9; - - private const int CHARACTER_ID_START = 1; - - private const int CHARACTER_ID_END = 8; - - [SerializeField] - private UIButton[] CursorButton; - - private eType Type; - - public eType LoadingDownLoadImageType; - - private bool _isAnimatingNowCharacterView; - - private bool _canFlick = true; - - protected override void Start() - { - setMaxAssetsNum(enable: true, Toolbox.ResourcesManager.GetDownloadMaxSize()); - base.Start(); - if (!Data.Load.data._userTutorial.NeedAllResource) - { - Type = eType.CharacterDetail; - } - else - { - Type = LoadingDownLoadImageType; - } - if (Type == eType.CardDetail && !_cardView.CanView()) - { - Type = eType.CharacterDetail; - } - isLabelUpdate = false; - LoadTitleLabel.text = Data.SystemText.Get("Load_0001"); - LoadTextLabel.text = Data.SystemText.Get("Load_0002"); - CursorButton[0].onClick.Add(new EventDelegate(delegate - { - ChangeInfoView(eSide.Left); - })); - CursorButton[1].onClick.Add(new EventDelegate(delegate - { - ChangeInfoView(eSide.Right); - })); - BoxCollider[] flickColliderArray = _flickColliderArray; - foreach (BoxCollider obj in flickColliderArray) - { - UIEventListener uIEventListener = UIEventListener.Get(obj.gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDrag)); - UIEventListener uIEventListener2 = UIEventListener.Get(obj.gameObject); - uIEventListener2.onDragEnd = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onDragEnd, new UIEventListener.VoidDelegate(OnDragEnd)); - } - CharacterDetailObjs.gameObject.SetActive(value: false); - _storyView.gameObject.SetActive(value: false); - _cardView.gameObject.SetActive(value: false); - if (CustomPreference.GetTextLanguage() != Global.LANG_TYPE.Jpn.ToString() && Type == eType.CardDetail) - { - Type = eType.StoryDetail; - } - switch (Type) - { - case eType.CardDetail: - _cardView.gameObject.SetActive(value: true); - _cardView.Initialize(delegate - { - base.gameObject.SetActive(value: true); - }); - break; - case eType.CharacterDetail: - CharacterDetailObjs.gameObject.SetActive(value: true); - InitializeCharacterView(); - break; - case eType.StoryDetail: - _storyView.gameObject.SetActive(value: true); - _storyView.Initialize(); - break; - } - } - - private void OnDrag(GameObject g, Vector2 dir) - { - if (_canFlick && !_isAnimatingNowCharacterView && !_cardView.IsAnimatingNow) - { - if (dir.x >= 70f) - { - ChangeInfoView(eSide.Left); - _canFlick = false; - } - else if (dir.x <= -70f) - { - ChangeInfoView(eSide.Right); - _canFlick = false; - } - } - } - - private void OnDragEnd(GameObject go) - { - _canFlick = true; - } - - private void InitializeCharacterView() - { - m_SelectCharacterIndex = 1; - IList list = new List(); - for (int i = 1; i < 9; i++) - { - list.Add(i); - } - if (m_DicPack == null) - { - m_DicPack = new Dictionary(); - foreach (int item in list) - { - ClassPack classPack = new ClassPack(); - classPack.ID = item; - classPack.Detail = null; - m_DicPack.Add(item, classPack); - } - foreach (KeyValuePair item2 in m_DicPack) - { - ClassPack value = item2.Value; - ClassDetail classDetail = new ClassDetail - { - TextureBase = null, - strName = null - }; - int key = item2.Key; - string text = CharacterTexturePath[key - 1]; - if (text == "class_03_base") - { - text += "_1"; - } - classDetail.TextureBase = Resources.Load("Images/Loading/" + text); - classDetail.strName = getTextCharacterName(key); - value.Detail = classDetail; - } - } - SetCharacterDisp(m_DicPack[1]); - } - - protected override float CalculateProgress() - { - return Toolbox.ResourcesManager.GetDownloadCompletedSize() + (float)Toolbox.ResourcesManager.GetLoadingCompleted(); - } - - public override void fadeOutLoading() - { - base.fadeOutLoading(); - _cardView.FadeOutLoading(); - } - - protected override void OnDestroy() - { - base.OnDestroy(); - } - - private void ChangeInfoView(eSide side) - { - if (!UIManager.GetInstance().isOpenDialog()) - { - switch (Type) - { - case eType.CardDetail: - ChangeCardView(side); - break; - case eType.CharacterDetail: - ChangeCharacterView(side); - break; - case eType.StoryDetail: - ChangeStoryView(side); - break; - } - } - } - - private void ChangeCardView(eSide side) - { - switch (side) - { - case eSide.Right: - _cardView.Next(); - break; - case eSide.Left: - _cardView.Prev(); - break; - } - } - - private void ChangeStoryView(eSide side) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - _storyView.ChangeStoryImage(side == eSide.Right); - } - - private void ChangeCharacterView(eSide side) - { - bool isRight = side == eSide.Right; - StartCoroutine(ChangeCharacterAnm(isRight)); - } - - private IEnumerator ChangeCharacterAnm(bool isRight = true) - { - _isAnimatingNowCharacterView = true; - float time = 0f; - if (!isRight) - { - if (m_SelectCharacterIndex > 1) - { - m_SelectCharacterIndex--; - } - else - { - m_SelectCharacterIndex = 8; - } - } - else if (m_SelectCharacterIndex < 8) - { - m_SelectCharacterIndex++; - } - else - { - m_SelectCharacterIndex = 1; - } - ClassPack characterDisp = m_DicPack[m_SelectCharacterIndex]; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - SetCharacterDisp(characterDisp); - TweenPosition tweenPosCloseUpTexture = TweenPosCloseUpTexture; - if (isRight) - { - tweenPosCloseUpTexture.from = m_CharacterRightFromPos; - } - else - { - tweenPosCloseUpTexture.from = m_CharacterLeftFromPos; - } - tweenPosCloseUpTexture.to = m_CharacterDefaultPos; - tweenPosCloseUpTexture.duration = 0.1f; - tweenPosCloseUpTexture.ResetToBeginning(); - tweenPosCloseUpTexture.PlayForward(); - TweenAlpha tweenAlphaName = TweenAlphaName; - tweenAlphaName.from = 0f; - tweenAlphaName.to = 1f; - tweenAlphaName.duration = 0.1f; - tweenAlphaName.ResetToBeginning(); - tweenAlphaName.PlayForward(); - TweenAlpha tweenAlphaDescription = TweenAlphaDescription; - tweenAlphaDescription.from = 0f; - tweenAlphaDescription.to = 1f; - tweenAlphaDescription.duration = 0.1f; - tweenAlphaDescription.ResetToBeginning(); - tweenAlphaDescription.PlayForward(); - StartCoroutine(assetSetting()); - yield return null; - do - { - time += Time.deltaTime; - } - while (!(time >= 0.1f)); - _isAnimatingNowCharacterView = false; - } - - private void SetCharacterDisp(ClassPack in_Pack) - { - for (int i = 0; i < CharacterSelectCircle.objs.Count; i++) - { - CharacterSelectCircle.objs[i].SetActive(value: false); - } - CharacterSelectCircle.objs[m_SelectCharacterIndex - 1].SetActive(value: true); - CharacterDetailObjs.textures[0].mainTexture = in_Pack.Detail.TextureBase; - LabelClassName.text = in_Pack.Detail.strName; - LabelClassDesc.SetWrapText(getTextClassDescription(m_SelectCharacterIndex)); - } - - private string getTextClassDescription(int classID) - { - SystemText systemText = Data.SystemText; - return classID switch - { - 1 => systemText.Get("Load_0010"), - 2 => systemText.Get("Load_0011"), - 3 => systemText.Get("Load_0012"), - 4 => systemText.Get("Load_0013"), - 5 => systemText.Get("Load_0014"), - 6 => systemText.Get("Load_0015"), - 7 => systemText.Get("Load_0016"), - 8 => systemText.Get("Load_0018"), - _ => null, - }; - } - - private string getTextCharacterName(int classID) - { - SystemText systemText = Data.SystemText; - return classID switch - { - 1 => systemText.Get("Load_0003"), - 2 => systemText.Get("Load_0004"), - 3 => systemText.Get("Load_0005"), - 4 => systemText.Get("Load_0006"), - 5 => systemText.Get("Load_0007"), - 6 => systemText.Get("Load_0008"), - 7 => systemText.Get("Load_0009"), - 8 => systemText.Get("Load_0017"), - _ => null, - }; - } -} diff --git a/SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs b/SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs deleted file mode 100644 index a4205847..00000000 --- a/SVSim.BattleEngine/Engine/LoadingDownLoadCardView.cs +++ /dev/null @@ -1,447 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; - -public class LoadingDownLoadCardView : MonoBehaviour -{ - private class LoadSceneCardDataAccessor - { - public readonly int CardNum; - - private List _loadSceneCardDataList; - - public int CurrentIndex { get; private set; } - - public LoadSceneCardData CurrentCardData => _loadSceneCardDataList[CurrentIndex]; - - public LoadSceneCardDataAccessor(List cardIdList) - { - CardNum = cardIdList.Count; - _loadSceneCardDataList = new List(); - for (int i = 0; i < CardNum; i++) - { - _loadSceneCardDataList.Add(new LoadSceneCardData(i, cardIdList[i])); - } - } - - public void UpdateIndexToNext() - { - if (CurrentIndex < CardNum - 1) - { - CurrentIndex++; - } - else - { - CurrentIndex = 0; - } - } - - public void UpdateIndexToPrev() - { - if (CurrentIndex > 0) - { - CurrentIndex--; - } - else - { - CurrentIndex = CardNum - 1; - } - } - } - - private class LoadSceneCardData - { - private static readonly Color DEFAULT_EFFECT_COLOR = Color.white; - - public const string FORMAT_DESC_NORMAL = "CardDescN_{0}"; - - public const string FORMAT_DESC_EVO = "CardDescE_{0}"; - - private const string FORMAT_EFFECT_COLOR = "CardColor_{0}"; - - private Color _cardEffectColor; - - public CardParameter CardParam { get; private set; } - - public string CardName { get; private set; } - - public string CardNormalDesc { get; private set; } - - public string CardEvolDesc { get; private set; } - - public Color CardEffectColor => _cardEffectColor; - - public LoadSceneCardData(int index, int cardId) - { - SystemText systemText = Data.SystemText; - _ = Data.Load.data.ResourceDlViewID; - CardParam = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId); - bool num = CardParam.CharType == CardBasePrm.CharaType.NORMAL; - CardName = systemText.Get($"LoadCard_{cardId}"); - CardNormalDesc = systemText.Get($"CardDescN_{cardId}"); - if (num) - { - CardEvolDesc = systemText.Get($"CardDescE_{cardId}"); - } - else - { - CardEvolDesc = ""; - } - if (!ColorUtility.TryParseHtmlString(systemText.Get($"CardColor_{(int)CardParam.Clan}"), out _cardEffectColor)) - { - _cardEffectColor = DEFAULT_EFFECT_COLOR; - } - } - } - - private static readonly Vector3 CARD_SCALE = new Vector3(0.022f, 0.017f, 1f); - - [SerializeField] - private Transform CardObjectTransform; - - [SerializeField] - private ParticleSystem[] LoadingEffects; - - [SerializeField] - private UIScrollView _cardDetailScrollView; - - [SerializeField] - private UILabel _cardNameLabel; - - [SerializeField] - private GameObject _followerDetailObjctRoot; - - [SerializeField] - private GameObject _spellOrAmuletDetailObjctRoot; - - [SerializeField] - private UILabel _followerNormalSkillLabel; - - [SerializeField] - private UILabel _followerNormalAtkLabel; - - [SerializeField] - private UILabel _followerNormalLifeLabel; - - [SerializeField] - private UILabel _followerEvoSkillLabel; - - [SerializeField] - private UILabel _followerEvoAtkLabel; - - [SerializeField] - private UILabel _followerEvoLifeLabel; - - [SerializeField] - private GameObject _followerEvoTopRootObj; - - [SerializeField] - private UILabel _spellOrAmuletSkillLabel; - - [SerializeField] - private UILabel _cardTypeLabel; - - [SerializeField] - private ResourceDownloadCardFactory _cardFactory; - - [SerializeField] - private UIPanel _cardPanel; - - [SerializeField] - private TextLineCreater _normalTextLineCreater; - - [SerializeField] - private TextLineCreater _evoTextLineCreater; - - [SerializeField] - private TextLineCreater _spellOrAmuletSkillTextLineCreater; - - [SerializeField] - private UIToggle indicatorBase; - - [SerializeField] - private GameObject _blackPanel; - - private Vector3 _defaultPosCardSprite = Vector3.zero; - - private Quaternion _defaultRotCardSprite = Quaternion.identity; - - private List _indicatorList = new List(); - - private LoadSceneCardDataAccessor _cardDataAccessor; - - private List _cardIdList; - - private List _cardList; - - public const string FORMAT_CARD_NAME = "LoadCard_{0}"; - - public bool IsAnimatingNow { get; private set; } - - public void Initialize(Action onReady) - { - LoadingEffects[2].gameObject.SetActive(value: false); - LoadingEffects[3].gameObject.SetActive(value: false); - LoadingEffects[4].gameObject.SetActive(value: false); - LoadingEffects[0].gameObject.SetActive(value: false); - LoadCardResource(delegate - { - _blackPanel.SetActive(value: false); - LoadingEffects[0].gameObject.SetActive(value: true); - TweenAlpha.Begin(CardObjectTransform.gameObject, 0f, 1f); - _cardDataAccessor = new LoadSceneCardDataAccessor(GetCardIdList()); - ChangeLoadCardInfo(_cardDataAccessor.CurrentCardData, _cardDataAccessor.CurrentIndex); - GameObject gameObject = indicatorBase.transform.parent.gameObject; - _indicatorList.Add(indicatorBase); - for (int i = 1; i < _cardDataAccessor.CardNum; i++) - { - _indicatorList.Add(NGUITools.AddChild(gameObject, indicatorBase.gameObject).GetComponent()); - } - gameObject.GetComponent().Reposition(); - UpdateIndicator(_cardDataAccessor.CurrentIndex); - onReady.Call(); - }); - } - - private List CreateCardIdList() - { - Dictionary> dictionary = LoadCardIdList(); - if (dictionary.TryGetValue(Data.Load.data.RotationLatestCardPackId, out var value)) - { - return value; - } - Debug.LogError($"カードパックID[{Data.Load.data.RotationLatestCardPackId}]が見つかりません"); - return dictionary.FirstOrDefault().Value; - } - - private Dictionary> LoadCardIdList() - { - List list = Utility.ConvertCSV_Array((Resources.Load("CSV/load_card") as TextAsset).ToString()); - Dictionary> dictionary = new Dictionary>(); - foreach (string[] item in list) - { - if (!int.TryParse(item[0], out var result)) - { - continue; - } - List list2 = new List(list.Count); - for (int i = 1; i < item.Length; i++) - { - if (int.TryParse(item[i], out var result2)) - { - list2.Add(result2); - } - } - dictionary[result] = list2; - } - return dictionary; - } - - private List GetCardIdList() - { - if (_cardIdList == null) - { - _cardIdList = CreateCardIdList(); - } - return _cardIdList; - } - - public bool CanView() - { - return _cardFactory.CanView(GetCardIdList()); - } - - private void LoadCardResource(Action onFinish) - { - _cardFactory.Load(GetCardIdList(), _cardPanel.gameObject, delegate(List cardList) - { - OnFinishCardLoad(cardList); - onFinish(); - }); - } - - private void OnFinishCardLoad(List cardList) - { - for (int i = 0; i < cardList.Count; i++) - { - CardListTemplate cardListTemplate = cardList[i]; - cardListTemplate.gameObject.SetActive(i == 0); - cardListTemplate.HideNum(); - cardListTemplate.transform.localScale = CARD_SCALE; - } - _cardList = cardList; - } - - public void FadeOutLoading() - { - TweenAlpha.Begin(CardObjectTransform.gameObject, 1f, 0f); - for (int i = 0; i < LoadingEffects.Length; i++) - { - LoadingEffects[i].Stop(); - LoadingEffects[i].Clear(); - } - } - - public void Next() - { - StartCoroutine(ChangeCardAnm(isRight: true)); - } - - public void Prev() - { - StartCoroutine(ChangeCardAnm(isRight: false)); - } - - private void ChangeLoadCardInfo(LoadSceneCardData cardData, int index) - { - foreach (CardListTemplate card in _cardList) - { - card.gameObject.SetActive(value: false); - } - _cardList[index].gameObject.SetActive(value: true); - SetCardDetailLabels(cardData, index); - ParticleSystem[] componentsInChildren = LoadingEffects[0].gameObject.GetComponentsInChildren(); - foreach (ParticleSystem obj in componentsInChildren) - { - ParticleSystem.MainModule main = obj.main; - main.startColor = cardData.CardEffectColor; - obj.Stop(); - obj.Play(); - } - componentsInChildren = LoadingEffects[1].gameObject.GetComponentsInChildren(); - foreach (ParticleSystem obj2 in componentsInChildren) - { - ParticleSystem.MainModule main2 = obj2.main; - main2.startColor = cardData.CardEffectColor; - obj2.Stop(); - obj2.Play(); - } - UpdateIndicator(_cardDataAccessor.CurrentIndex); - } - - private void SetCardDetailLabels(LoadSceneCardData cardData, int index) - { - _cardNameLabel.text = cardData.CardName; - _cardTypeLabel.text = GetCardTypeText(cardData); - SetCardSkillText(cardData, index); - _cardDetailScrollView.ResetPosition(); - _cardDetailScrollView.UpdateScrollbars(recalculateBounds: true); - } - - private string GetCardTypeText(LoadSceneCardData cardData) - { - return cardData.CardParam.CharType switch - { - CardBasePrm.CharaType.FIELD => Data.SystemText.Get("Card_0046"), - CardBasePrm.CharaType.SPELL => Data.SystemText.Get("Card_0045"), - _ => string.Empty, - }; - } - - private void SetCardSkillText(LoadSceneCardData cardData, int index) - { - int cardId = GetCardIdList()[index]; - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId); - if (cardParameterFromId.CharType == CardBasePrm.CharaType.NORMAL) - { - _followerDetailObjctRoot.SetActive(value: true); - _spellOrAmuletDetailObjctRoot.SetActive(value: false); - _followerNormalAtkLabel.text = cardParameterFromId.Atk.ToString(); - _followerNormalLifeLabel.text = cardParameterFromId.Life.ToString(); - _followerEvoAtkLabel.text = cardParameterFromId.EvoAtk.ToString(); - _followerEvoLifeLabel.text = cardParameterFromId.EvoLife.ToString(); - SetFollowerText(_cardDataAccessor.CurrentCardData, index); - } - else - { - _followerDetailObjctRoot.SetActive(value: false); - _spellOrAmuletDetailObjctRoot.SetActive(value: true); - SetViewCardText(cardData.CardNormalDesc, _spellOrAmuletSkillLabel, _spellOrAmuletSkillTextLineCreater); - } - } - - private void SetFollowerText(LoadSceneCardData cardData, int index) - { - if (_cardList != null) - { - SetViewCardText(cardData.CardNormalDesc, _followerNormalSkillLabel, _normalTextLineCreater); - SetViewCardText(cardData.CardEvolDesc, _followerEvoSkillLabel, _evoTextLineCreater); - float y = _followerNormalSkillLabel.transform.localPosition.y - (float)_followerNormalSkillLabel.height - 44f; - _followerEvoTopRootObj.transform.localPosition = new Vector3(_followerEvoTopRootObj.transform.localPosition.x, y); - } - } - - private void SetViewCardText(string cardText, UILabel textLabel, TextLineCreater lineCreater) - { - textLabel.overflowMethod = UILabel.Overflow.ResizeHeight; - textLabel.ProcessText(); - int textLineCount = Global.GetTextLineCount(Global.GetConvertWrapText(textLabel, cardText)); - lineCreater.ShowLines(textLineCount); - textLabel.SetWrapText(cardText); - } - - private IEnumerator ChangeCardAnm(bool isRight) - { - IsAnimatingNow = true; - CardListTemplate currentCard = _cardList[_cardDataAccessor.CurrentIndex]; - if (!isRight) - { - _cardDataAccessor.UpdateIndexToPrev(); - } - else - { - _cardDataAccessor.UpdateIndexToNext(); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - TweenPosition tp = CardObjectTransform.GetComponent(); - TweenRotation tr = CardObjectTransform.GetComponent(); - _defaultPosCardSprite = CardObjectTransform.transform.localPosition; - _defaultRotCardSprite = CardObjectTransform.transform.localRotation; - tp.enabled = false; - tr.enabled = false; - LoadingEffects[1].gameObject.SetActive(value: false); - LoadingEffects[2].gameObject.SetActive(value: false); - LoadingEffects[2].gameObject.SetActive(value: true); - TweenAlpha.Begin(CardObjectTransform.gameObject, 0.2f, 0f); - TweenAlpha.Begin(currentCard._nameLabel.gameObject, 0.2f, 0f); - if (isRight) - { - iTween.MoveTo(CardObjectTransform.gameObject, iTween.Hash("position", _defaultPosCardSprite + Vector3.left * 50f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - } - else - { - iTween.MoveTo(CardObjectTransform.gameObject, iTween.Hash("position", _defaultPosCardSprite + Vector3.right * 50f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - } - yield return new WaitForSeconds(0.2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DL_CARD_APPEAR); - LoadingEffects[1].gameObject.SetActive(value: true); - ChangeLoadCardInfo(_cardDataAccessor.CurrentCardData, _cardDataAccessor.CurrentIndex); - LoadingEffects[3].gameObject.SetActive(value: false); - LoadingEffects[3].gameObject.SetActive(value: true); - LoadingEffects[4].gameObject.SetActive(value: false); - LoadingEffects[4].gameObject.SetActive(value: true); - TweenAlpha.Begin(CardObjectTransform.gameObject, 0.2f, 1f); - TweenAlpha.Begin(currentCard._nameLabel.gameObject, 0.2f, 1f); - CardObjectTransform.transform.localPosition = _defaultPosCardSprite + Vector3.down * 20f; - CardObjectTransform.transform.localRotation = Quaternion.Euler(new Vector3(0f, 90f, 10f)); - iTween.MoveTo(CardObjectTransform.gameObject, iTween.Hash("position", _defaultPosCardSprite, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.RotateTo(CardObjectTransform.gameObject, iTween.Hash("rotation", _defaultRotCardSprite.eulerAngles, "time", 0.2f, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.2f); - CardObjectTransform.transform.localPosition = _defaultPosCardSprite; - tp.enabled = true; - tr.enabled = true; - IsAnimatingNow = false; - } - - private void UpdateIndicator(int index) - { - if (_indicatorList.Count > 1) - { - _indicatorList[index].value = true; - } - } -} diff --git a/SVSim.BattleEngine/Engine/LoadingInScene.cs b/SVSim.BattleEngine/Engine/LoadingInScene.cs index 1cf69ace..6dd9f2c9 100644 --- a/SVSim.BattleEngine/Engine/LoadingInScene.cs +++ b/SVSim.BattleEngine/Engine/LoadingInScene.cs @@ -7,422 +7,7 @@ using Wizard; public class LoadingInScene : MonoBehaviour { - private const string LOAD_TITLE = "Load_Title"; - - private const string LOAD_DESC = "Load_Desc"; - - private const string CARD_MASK_PATH = "loading_battle_mask"; - - public const int LOADING_TIPS_INDEX_MIN = 1; - - private static int loadingTipsIndexMax; - - [SerializeField] - private UILabel LoadingLabel; - - [SerializeField] - private UIAnchor Anchor; - - [SerializeField] - private LoadingBase Progress; - - [SerializeField] - private bool Matching; [SerializeField] private bool Battle; - - [SerializeField] - private bool ShowProgress; - - [SerializeField] - private NguiObjs LoadingTextObj; - - [SerializeField] - private UILabel LoadingCountLabel; - - [SerializeField] - private bool notText; - - [SerializeField] - private UITexture BGTexture; - - [SerializeField] - private UIPanel _fadeBlackPanel; - - private int DotCnt; - - private Coroutine _coroutineTextAnimation; - - private Texture2D cardMask; - - private List resourcePathList; - - public static int LoadingTipsIndexMax - { - get - { - if (loadingTipsIndexMax == 0) - { - loadingTipsIndexMax = Data.SystemText.Count("Load_Title"); - } - return loadingTipsIndexMax; - } - } - - public bool IsFadeout { get; set; } - - public LoadingBase ProgressObj => Progress; - - public void SetShowProgress(bool enable, bool immediate = false) - { - ShowProgress = enable; - float num = (enable ? 1f : 0f); - if (immediate) - { - if ((bool)Anchor) - { - UISprite component = Anchor.GetComponent(); - if ((bool)component) - { - component.alpha = 1f - num; - } - } - if ((bool)Progress) - { - UISprite component2 = Progress.GetComponent(); - if ((bool)component2) - { - component2.alpha = num; - } - } - } - else - { - if ((bool)Anchor) - { - TweenAlpha.Begin(Anchor.gameObject, 0.5f, 1f - num); - } - if ((bool)Progress) - { - TweenAlpha.Begin(Progress.gameObject, 0.5f, num); - } - } - } - - private void Start() - { - IsFadeout = false; - DotCnt = 0; - float num = (ShowProgress ? 1f : 0f); - if ((bool)Anchor) - { - TweenAlpha.Begin(Anchor.gameObject, 0f, 1f - num); - } - if ((bool)Progress) - { - TweenAlpha.Begin(Progress.gameObject, 0f, num); - } - } - - private IEnumerator SetLoadingText() - { - if (Battle) - { - List allCardIds = CardMaster.GetInstanceForBattle().GetAllCardIds(); - int count = allCardIds.Count; - CardParameter cardParameterFromId; - int cardID; - ResourcesManager.AssetLoadPathType pathType; - while (true) - { - cardID = ((Data.Load.data._userTutorial.tutorial_step == 100) ? allCardIds[UnityEngine.Random.Range(0, count)] : (UnityEngine.Random.Range(0, 10) switch - { - 1 => 101111070, - 2 => 101011010, - 3 => 100011030, - 4 => 101121020, - 5 => 101111020, - 6 => 101121040, - 7 => 101021020, - 8 => 101014010, - 9 => 101014030, - _ => 101114040, - })); - cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardID); - cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardParameterFromId.BaseCardId); - cardID = cardParameterFromId.BaseCardId; - if (!ReLotteryCheck(cardID)) - { - pathType = ResourcesManager.AssetLoadPathType.UnitCardTextures; - switch (cardParameterFromId.CharType) - { - case CardBasePrm.CharaType.CLASS: - case CardBasePrm.CharaType.EVOLUTION: - continue; - case CardBasePrm.CharaType.NORMAL: - pathType = ResourcesManager.AssetLoadPathType.UnitCardTextures; - break; - case CardBasePrm.CharaType.SPELL: - pathType = ResourcesManager.AssetLoadPathType.SpellCardTextures; - break; - case CardBasePrm.CharaType.FIELD: - case CardBasePrm.CharaType.CHANT_FIELD: - pathType = ResourcesManager.AssetLoadPathType.SpellCardTextures; - break; - } - break; - } - } - ResourcesManager resMgr = Toolbox.ResourcesManager; - LoadingTextObj.labels[0].text = cardParameterFromId.CardName; - LoadingTextObj.labels[1].SetWrapText(cardParameterFromId.Description); - resourcePathList = new List - { - resMgr.GetAssetTypePath(cardID.ToString(), pathType), - resMgr.GetAssetTypePath("class_base_common", ResourcesManager.AssetLoadPathType.ClassCharaMaterialMain), - resMgr.GetAssetTypePath("loading_battle_mask", ResourcesManager.AssetLoadPathType.UiOtherTexture) - }; - yield return StartCoroutine(resMgr.LoadAssetGroupAsync(resourcePathList, null)); - Texture value = resMgr.LoadObject(resMgr.GetAssetTypePath(cardID + "0", pathType, isfetch: true)); - Texture value2 = resMgr.LoadObject(resMgr.GetAssetTypePath("loading_battle_mask", ResourcesManager.AssetLoadPathType.UiOtherTexture, isfetch: true)); - LoadingTextObj.textures[0].mainTexture = null; - LoadingTextObj.textures[0].material = resMgr.LoadObject(resMgr.GetAssetTypePath("class_base_common", ResourcesManager.AssetLoadPathType.ClassCharaMaterialMain, isfetch: true)); - LoadingTextObj.textures[0].material.SetTexture("_MainTex", value); - LoadingTextObj.textures[0].material.SetTexture("_MaskTex", value2); - LoadingTextObj.textures[0].gameObject.SetActive(value: false); - LoadingTextObj.textures[0].gameObject.SetActive(value: true); - } - else - { - int num = UnityEngine.Random.Range(1, LoadingTipsIndexMax + 1); - LoadingTextObj.labels[0].SetWrapText(Data.SystemText.Get(string.Format("{0}{1}", "Load_Title", num.ToString("0000")))); - LoadingTextObj.labels[1].SetWrapText(Data.SystemText.Get(string.Format("{0}{1}", "Load_Desc", num.ToString("0000")))); - } - } - - private bool ReLotteryCheck(int id) - { - if (CardMaster.GetInstanceForBattle().GetCardParameterFromId(id).ResourceCardId != id || Data.Load.data.LoadingExclusionCardList.Contains(id) || CardMaster.IsMutationCardCheck(id) || (id > 800000000 && id % 800000000 < 100000000) || CardMaster.IsChoiceBraveCardCheck(id)) - { - return true; - } - return false; - } - - private void Update() - { - if ((bool)Anchor && !Anchor.gameObject.activeSelf) - { - Anchor.enabled = true; - Anchor.gameObject.SetActive(value: true); - } - } - - private void StartLoadingTextAnimation(string overrideLoadingText = null) - { - string loadingText = ((overrideLoadingText != null) ? overrideLoadingText : ((!Matching) ? Data.SystemText.Get("System_0001") : Data.SystemText.Get("Battle_0008"))); - StopLoadingTextAnimation(); - _coroutineTextAnimation = StartCoroutine(LoadingTextAnimation(loadingText)); - } - - private void StopLoadingTextAnimation() - { - if (_coroutineTextAnimation != null) - { - StopCoroutine(_coroutineTextAnimation); - _coroutineTextAnimation = null; - } - } - - private IEnumerator LoadingTextAnimation(string loadingText) - { - while (true) - { - if ((bool)LoadingLabel) - { - LoadingLabel.text = loadingText; - DotCnt++; - if (DotCnt > 3) - { - DotCnt = 0; - } - if (LoadingCountLabel != null) - { - LoadingCountLabel.text = ""; - } - for (int i = 0; i < DotCnt; i++) - { - if (LoadingCountLabel != null) - { - LoadingCountLabel.text += "."; - } - else - { - LoadingLabel.text += "."; - } - } - } - if (notText) - { - if (LoadingLabel != null) - { - LoadingLabel.text = ""; - } - if (LoadingCountLabel != null) - { - LoadingCountLabel.text = ""; - } - } - yield return new WaitForSeconds(0.05f); - } - } - - public void FadeIn(bool notBlack = false, bool notCollider = false, float alphe = 1f, float panelFadeInDuration = 0.5f, string overrideText = null) - { - StartCoroutine(FadeInAndLoad(notBlack, notCollider, alphe, panelFadeInDuration)); - StartLoadingTextAnimation(overrideText); - } - - private IEnumerator FadeInAndLoad(bool notBlack = false, bool notCollider = false, float alphe = 1f, float panelFadeInDuration = 0.5f) - { - if (notCollider) - { - GetComponent().enabled = false; - } - else - { - GetComponent().enabled = true; - } - if ((bool)Anchor) - { - Anchor.gameObject.SetActive(value: false); - } - StartFadeInUI(panelFadeInDuration); - CancelInvoke("HideObj"); - IsFadeout = false; - GameObject bgObj = base.transform.Find("Bg").gameObject; - if (notBlack) - { - bgObj.SetActive(value: false); - yield break; - } - if (LoadingTextObj != null) - { - yield return StartCoroutine(SetLoadingText()); - } - bgObj.SetActive(value: true); - bgObj.GetComponent().color = new Color(0f, 0f, 0f, alphe); - if (null != BGTexture) - { - BGTexture.alpha = 0f; - TweenAlpha.Begin(BGTexture.gameObject, 0.5f, 1f); - } - } - - public void FadeOut(bool disableCollider = false) - { - int num = 0; - try - { - num = 1; - if (null != BGTexture) - { - TweenAlpha.Begin(BGTexture.gameObject, 0.25f, 0f); - } - num = 2; - StartFadeOutUI(); - num = 3; - Invoke("HideObj", 0.5f); - num = 4; - IsFadeout = true; - if (disableCollider) - { - GetComponent().enabled = false; - } - num = 5; - } - catch (Exception ex) - { - string text = ""; - if (base.gameObject == null) - { - text += "obj null "; - } - if (BGTexture == null) - { - text += "BGTexture null "; - } - else if (BGTexture.gameObject == null) - { - text += "BGTextureObj null "; - } - LocalLog.AccumulateTraceLog("#580304 FadeOut " + num + " disableCollider " + disableCollider + text); - throw ex; - } - } - - private void StartFadeInUI(float panelFadeInDuration = 0.5f) - { - if (_fadeBlackPanel != null) - { - _fadeBlackPanel.alpha = 1f; - TweenAlpha.Begin(_fadeBlackPanel.gameObject, panelFadeInDuration, 0f); - return; - } - UIPanel component = GetComponent(); - if ((bool)component) - { - component.alpha = 0.01f; - } - TweenAlpha.Begin(base.gameObject, panelFadeInDuration, 1f); - } - - private void StartFadeOutUI(float panelFadeOutDuration = 0.5f) - { - if (_fadeBlackPanel != null) - { - _fadeBlackPanel.alpha = 0f; - TweenAlpha.Begin(_fadeBlackPanel.gameObject, panelFadeOutDuration, 1f); - } - else - { - TweenAlpha.Begin(base.gameObject, panelFadeOutDuration, 0f); - } - } - - private void HideObj() - { - int num = 0; - try - { - num = 1; - StopLoadingTextAnimation(); - num = 2; - if (cardMask != null) - { - UnityEngine.Object.Destroy(cardMask); - } - num = 3; - if (resourcePathList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(resourcePathList); - num = 4; - resourcePathList.Clear(); - resourcePathList = null; - } - num = 5; - base.gameObject.SetActive(value: false); - } - catch (Exception ex) - { - string text = ""; - if (base.gameObject == null) - { - text += "obj null "; - } - LocalLog.AccumulateTraceLog("#580304 HideObj " + num + text); - throw ex; - } - } } diff --git a/SVSim.BattleEngine/Engine/LocalNotificationPriority.cs b/SVSim.BattleEngine/Engine/LocalNotificationPriority.cs deleted file mode 100644 index 1d1c518b..00000000 --- a/SVSim.BattleEngine/Engine/LocalNotificationPriority.cs +++ /dev/null @@ -1,5 +0,0 @@ -public enum LocalNotificationPriority -{ - High = 1, - Normal -} diff --git a/SVSim.BattleEngine/Engine/Localization.cs b/SVSim.BattleEngine/Engine/Localization.cs deleted file mode 100644 index 6557f9f5..00000000 --- a/SVSim.BattleEngine/Engine/Localization.cs +++ /dev/null @@ -1,527 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -public static class Localization -{ - public delegate byte[] LoadFunction(string path); - - public delegate void OnLocalizeNotification(); - - public static LoadFunction loadFunction; - - public static OnLocalizeNotification onLocalize; - - public static bool localizationHasBeenSet = false; - - private static string[] mLanguages = null; - - private static Dictionary mOldDictionary = new Dictionary(); - - private static Dictionary mDictionary = new Dictionary(); - - private static Dictionary mReplacement = new Dictionary(); - - private static int mLanguageIndex = -1; - - private static string mLanguage; - - private static bool mMerging = false; - - public static Dictionary dictionary - { - get - { - if (!localizationHasBeenSet) - { - LoadDictionary(PlayerPrefs.GetString("Language", "English")); - } - return mDictionary; - } - set - { - localizationHasBeenSet = value != null; - mDictionary = value; - } - } - - public static string[] knownLanguages - { - get - { - if (!localizationHasBeenSet) - { - LoadDictionary(PlayerPrefs.GetString("Language", "English")); - } - return mLanguages; - } - } - - public static string language - { - get - { - if (string.IsNullOrEmpty(mLanguage)) - { - mLanguage = PlayerPrefs.GetString("Language", "English"); - LoadAndSelect(mLanguage); - } - return mLanguage; - } - set - { - if (mLanguage != value) - { - mLanguage = value; - LoadAndSelect(value); - } - } - } - - [Obsolete("Localization is now always active. You no longer need to check this property.")] - public static bool isActive => true; - - private static bool LoadDictionary(string value) - { - byte[] array = null; - if (!localizationHasBeenSet) - { - if (loadFunction == null) - { - TextAsset textAsset = Resources.Load("Localization"); - if (textAsset != null) - { - array = textAsset.bytes; - } - } - else - { - array = loadFunction("Localization"); - } - localizationHasBeenSet = true; - } - if (LoadCSV(array)) - { - return true; - } - if (string.IsNullOrEmpty(value)) - { - value = mLanguage; - } - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (loadFunction == null) - { - TextAsset textAsset2 = Resources.Load(value); - if (textAsset2 != null) - { - array = textAsset2.bytes; - } - } - else - { - array = loadFunction(value); - } - if (array != null) - { - Set(value, array); - return true; - } - return false; - } - - private static bool LoadAndSelect(string value) - { - if (!string.IsNullOrEmpty(value)) - { - if (mDictionary.Count == 0 && !LoadDictionary(value)) - { - return false; - } - if (SelectLanguage(value)) - { - return true; - } - } - if (mOldDictionary.Count > 0) - { - return true; - } - mOldDictionary.Clear(); - mDictionary.Clear(); - if (string.IsNullOrEmpty(value)) - { - PlayerPrefs.DeleteKey("Language"); - } - return false; - } - - public static void Load(TextAsset asset) - { - ByteReader byteReader = new ByteReader(asset); - Set(asset.name, byteReader.ReadDictionary()); - } - - public static void Set(string languageName, byte[] bytes) - { - ByteReader byteReader = new ByteReader(bytes); - Set(languageName, byteReader.ReadDictionary()); - } - - public static void ReplaceKey(string key, string val) - { - if (!string.IsNullOrEmpty(val)) - { - mReplacement[key] = val; - } - else - { - mReplacement.Remove(key); - } - } - - public static void ClearReplacements() - { - mReplacement.Clear(); - } - - public static bool LoadCSV(TextAsset asset, bool merge = false) - { - return LoadCSV(asset.bytes, asset, merge); - } - - public static bool LoadCSV(byte[] bytes, bool merge = false) - { - return LoadCSV(bytes, null, merge); - } - - private static bool HasLanguage(string languageName) - { - int i = 0; - for (int num = mLanguages.Length; i < num; i++) - { - if (mLanguages[i] == languageName) - { - return true; - } - } - return false; - } - - private static bool LoadCSV(byte[] bytes, TextAsset asset, bool merge = false) - { - if (bytes == null) - { - return false; - } - ByteReader byteReader = new ByteReader(bytes); - BetterList betterList = byteReader.ReadCSV(); - if (betterList.size < 2) - { - return false; - } - betterList.RemoveAt(0); - string[] array = null; - if (string.IsNullOrEmpty(mLanguage)) - { - localizationHasBeenSet = false; - } - if (!localizationHasBeenSet || (!merge && !mMerging) || mLanguages == null || mLanguages.Length == 0) - { - mDictionary.Clear(); - mLanguages = new string[betterList.size]; - if (!localizationHasBeenSet) - { - mLanguage = PlayerPrefs.GetString("Language", betterList[0]); - localizationHasBeenSet = true; - } - for (int i = 0; i < betterList.size; i++) - { - mLanguages[i] = betterList[i]; - if (mLanguages[i] == mLanguage) - { - mLanguageIndex = i; - } - } - } - else - { - array = new string[betterList.size]; - for (int j = 0; j < betterList.size; j++) - { - array[j] = betterList[j]; - } - for (int k = 0; k < betterList.size; k++) - { - if (HasLanguage(betterList[k])) - { - continue; - } - int num = mLanguages.Length + 1; - Array.Resize(ref mLanguages, num); - mLanguages[num - 1] = betterList[k]; - Dictionary dictionary = new Dictionary(); - foreach (KeyValuePair item in mDictionary) - { - string[] array2 = item.Value; - Array.Resize(ref array2, num); - array2[num - 1] = array2[0]; - dictionary.Add(item.Key, array2); - } - mDictionary = dictionary; - } - } - Dictionary dictionary2 = new Dictionary(); - for (int l = 0; l < mLanguages.Length; l++) - { - dictionary2.Add(mLanguages[l], l); - } - while (true) - { - BetterList betterList2 = byteReader.ReadCSV(); - if (betterList2 == null || betterList2.size == 0) - { - break; - } - if (!string.IsNullOrEmpty(betterList2[0])) - { - AddCSV(betterList2, array, dictionary2); - } - } - if (!mMerging && onLocalize != null) - { - mMerging = true; - OnLocalizeNotification onLocalizeNotification = onLocalize; - onLocalize = null; - onLocalizeNotification(); - onLocalize = onLocalizeNotification; - mMerging = false; - } - return true; - } - - private static void AddCSV(BetterList newValues, string[] newLanguages, Dictionary languageIndices) - { - if (newValues.size < 2) - { - return; - } - string text = newValues[0]; - if (string.IsNullOrEmpty(text)) - { - return; - } - string[] value = ExtractStrings(newValues, newLanguages, languageIndices); - if (mDictionary.ContainsKey(text)) - { - mDictionary[text] = value; - return; - } - try - { - mDictionary.Add(text, value); - } - catch (Exception ex) - { - Debug.LogError("Unable to add '" + text + "' to the Localization dictionary.\n" + ex.Message); - } - } - - private static string[] ExtractStrings(BetterList added, string[] newLanguages, Dictionary languageIndices) - { - if (newLanguages == null) - { - string[] array = new string[mLanguages.Length]; - int i = 1; - for (int num = Mathf.Min(added.size, array.Length + 1); i < num; i++) - { - array[i - 1] = added[i]; - } - return array; - } - string key = added[0]; - if (!mDictionary.TryGetValue(key, out var value)) - { - value = new string[mLanguages.Length]; - } - int j = 0; - for (int num2 = newLanguages.Length; j < num2; j++) - { - string key2 = newLanguages[j]; - int num3 = languageIndices[key2]; - value[num3] = added[j + 1]; - } - return value; - } - - private static bool SelectLanguage(string language) - { - mLanguageIndex = -1; - if (mDictionary.Count == 0) - { - return false; - } - int i = 0; - for (int num = mLanguages.Length; i < num; i++) - { - if (mLanguages[i] == language) - { - mOldDictionary.Clear(); - mLanguageIndex = i; - mLanguage = language; - PlayerPrefs.SetString("Language", mLanguage); - if (onLocalize != null) - { - onLocalize(); - } - UIRoot.Broadcast("OnLocalize"); - return true; - } - } - return false; - } - - public static void Set(string languageName, Dictionary dictionary) - { - mLanguage = languageName; - PlayerPrefs.SetString("Language", mLanguage); - mOldDictionary = dictionary; - localizationHasBeenSet = true; - mLanguageIndex = -1; - mLanguages = new string[1] { languageName }; - if (onLocalize != null) - { - onLocalize(); - } - UIRoot.Broadcast("OnLocalize"); - } - - public static void Set(string key, string value) - { - if (mOldDictionary.ContainsKey(key)) - { - mOldDictionary[key] = value; - } - else - { - mOldDictionary.Add(key, value); - } - } - - public static string Get(string key) - { - if (!localizationHasBeenSet) - { - LoadDictionary(PlayerPrefs.GetString("Language", "English")); - } - if (mLanguages == null) - { - Debug.LogError("No localization data present"); - return null; - } - string text = language; - if (mLanguageIndex == -1) - { - for (int i = 0; i < mLanguages.Length; i++) - { - if (mLanguages[i] == text) - { - mLanguageIndex = i; - break; - } - } - } - if (mLanguageIndex == -1) - { - mLanguageIndex = 0; - mLanguage = mLanguages[0]; - } - string value; - string[] value2; - switch (UICamera.currentScheme) - { - case UICamera.ControlScheme.Touch: - { - string key3 = key + " Mobile"; - if (mReplacement.TryGetValue(key3, out value)) - { - return value; - } - if (mLanguageIndex != -1 && mDictionary.TryGetValue(key3, out value2) && mLanguageIndex < value2.Length) - { - return value2[mLanguageIndex]; - } - if (mOldDictionary.TryGetValue(key3, out value)) - { - return value; - } - break; - } - case UICamera.ControlScheme.Controller: - { - string key2 = key + " Controller"; - if (mReplacement.TryGetValue(key2, out value)) - { - return value; - } - if (mLanguageIndex != -1 && mDictionary.TryGetValue(key2, out value2) && mLanguageIndex < value2.Length) - { - return value2[mLanguageIndex]; - } - if (mOldDictionary.TryGetValue(key2, out value)) - { - return value; - } - break; - } - } - if (mReplacement.TryGetValue(key, out value)) - { - return value; - } - if (mLanguageIndex != -1 && mDictionary.TryGetValue(key, out value2)) - { - if (mLanguageIndex < value2.Length) - { - string text2 = value2[mLanguageIndex]; - if (string.IsNullOrEmpty(text2)) - { - text2 = value2[0]; - } - return text2; - } - return value2[0]; - } - if (mOldDictionary.TryGetValue(key, out value)) - { - return value; - } - return key; - } - - public static string Format(string key, params object[] parameters) - { - return string.Format(Get(key), parameters); - } - - [Obsolete("Use Localization.Get instead")] - public static string Localize(string key) - { - return Get(key); - } - - public static bool Exists(string key) - { - if (!localizationHasBeenSet) - { - language = PlayerPrefs.GetString("Language", "English"); - } - if (!mDictionary.ContainsKey(key)) - { - return mOldDictionary.ContainsKey(key); - } - return true; - } -} diff --git a/SVSim.BattleEngine/Engine/Mail.cs b/SVSim.BattleEngine/Engine/Mail.cs index da4b557f..ab338204 100644 --- a/SVSim.BattleEngine/Engine/Mail.cs +++ b/SVSim.BattleEngine/Engine/Mail.cs @@ -63,12 +63,8 @@ public class Mail : UIBase [SerializeField] private UIScrollView ScrollView; - private const int SCROLL_ITEM_COUNT = 5; - private List _scrollItems = new List(); - private const int MaxMailObjIndex = 100; - private int _readMailID; private List _currentList; @@ -79,8 +75,6 @@ public class Mail : UIBase private MAIL_ACTION_TYPE _mailActionType = MAIL_ACTION_TYPE.READ; - private const int HISTORY_MAX = 500; - private int _lastHistoryCount; private List _assetList = new List(); @@ -110,14 +104,14 @@ public class Mail : UIBase HistoryButton.buttons[0].onClick.Clear(); HistoryButton.buttons[0].onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + GiftInfoLabel.text = Wizard.Data.SystemText.Get("Mail_0028", 100.ToString()); ChangeHistory(); })); GiftButton.buttons[0].onClick.Clear(); GiftButton.buttons[0].onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + GiftInfoLabel.text = Wizard.Data.SystemText.Get("Mail_0027", 100.ToString()); ChangeGift(); })); @@ -135,12 +129,12 @@ public class Mail : UIBase private void LoadTutorialResource() { + // Pre-Phase-5b: async-loaded EffectTutorialData JSON via EffectMgr and paired the + // UIManager view-change lock. Headless has no EffectMgr; the increment/decrement + // pair collapses cleanly since headless never triggers view changes here. UIManager uiManager = UIManager.GetInstance(); uiManager.Force_Increment_LockCountChangeView(); - _assetList.AddRange(GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectTutorialData", isBattle: true, isField: false, isBattleEffect: false, delegate - { - uiManager.Force_Decrement_LockCountChangeView(); - })); + uiManager.Force_Decrement_LockCountChangeView(); } private void ShowTutorialDialog() @@ -220,11 +214,8 @@ public class Mail : UIBase } if (_tabType == TAB_TYPE.GIFT) { - MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask(); - if (Wizard.Data.MyPage.data.unread_mail_count > mailTopTask.LastPageRead * 100) - { - LoadNextPage(); - } + // Pre-Phase-5b: reached MailTopTask.LastPageRead to decide whether to fetch the + // next mail page. Headless has no MailTopTask; skip the mail-fetch branch entirely. } else if (_tabType == TAB_TYPE.HISTORY) { @@ -373,7 +364,7 @@ public class Mail : UIBase private void OnReadMail(int mail_index, int mail_id) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + _mailActionType = MAIL_ACTION_TYPE.READ; PrepareReceiveSingleMail(mail_index, mail_id); StartReadRequest(); @@ -381,7 +372,7 @@ public class Mail : UIBase private void OnReadAllMail(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + _mailActionType = MAIL_ACTION_TYPE.READALL; OpenReadAllDialog(g); } @@ -464,22 +455,12 @@ public class Mail : UIBase public static string GetTimeLeft(long seconds_since_unix) { + // Pre-Phase-5b: computed remaining time using GameMgr's MailTopTask server-time delta. + // Headless has no MailTopTask; return the "expires in N minutes" default with 0 minutes + // to indicate no known time-remaining. TimeLeftUpdate is the only external caller and + // only reads the returned string for UI label text. SystemText systemText = Wizard.Data.SystemText; - MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask(); - long num = (long)Time.realtimeSinceStartup - mailTopTask.RequestTime; - long num2 = mailTopTask.ServerTime + num; - TimeSpan timeSpan = TimeSpan.FromSeconds(seconds_since_unix - num2); - if (timeSpan.TotalDays >= 1.0) - { - return systemText.Get("Mail_0047", ((int)timeSpan.TotalDays).ToString()); - } - if (timeSpan.TotalHours >= 1.0) - { - return systemText.Get("Mail_0046", ((int)timeSpan.TotalHours).ToString()); - } - int num3 = (int)timeSpan.TotalMinutes; - num3 = ((num3 > 0) ? ((num3 <= 1) ? 1 : num3) : 0); - return systemText.Get("Mail_0048", num3.ToString()); + return systemText.Get("Mail_0048", "0"); } private void OnRequestMailList(NetworkTask.ResultCode error) @@ -501,23 +482,16 @@ public class Mail : UIBase { _lastHistoryCount = count; } - if (GameMgr.GetIns().GetMailTopTask().LastPageRead == 1) - { - ResetScrollWrap(); - } - else - { - UpdateScrollSize(); - } + // Pre-Phase-5b: checked MailTopTask.LastPageRead == 1 to reset the scroll wrap. + // Headless has no MailTopTask; fall through to UpdateScrollSize (the general path). + UpdateScrollSize(); UIManager.GetInstance().closeInSceneCenterLoading(); } private void LoadNextPage() { - UIManager.GetInstance().createInSceneCenterLoading(); - MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask(); - mailTopTask.SetParameterToNextPage(); - StartCoroutine(Toolbox.NetworkManager.Connect(mailTopTask, OnRequestMailList, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); + // Pre-Phase-5b: fetched next-page mail via MailTopTask. Headless has no mail service; + // method becomes a no-op (the scroll wrap paths above handle empty results cleanly). } private void UpdateScrollSize() @@ -558,9 +532,8 @@ public class Mail : UIBase private static bool IsExpired(long seconds_since_unix) { - MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask(); - long num = (long)Time.realtimeSinceStartup - mailTopTask.RequestTime; - long num2 = mailTopTask.ServerTime + num; - return TimeSpan.FromSeconds(seconds_since_unix - num2).TotalSeconds <= 0.0; + // Pre-Phase-5b: computed expiration via MailTopTask server-time delta. Headless + // has no MailTopTask; treat everything as not-yet-expired. + return false; } } diff --git a/SVSim.BattleEngine/Engine/MailResult.cs b/SVSim.BattleEngine/Engine/MailResult.cs deleted file mode 100644 index fc11a309..00000000 --- a/SVSim.BattleEngine/Engine/MailResult.cs +++ /dev/null @@ -1,4 +0,0 @@ -public class MailResult : Reward -{ - public int mail_id; -} diff --git a/SVSim.BattleEngine/Engine/MatchFinishBase.cs b/SVSim.BattleEngine/Engine/MatchFinishBase.cs index 09ef4cfc..4c632492 100644 --- a/SVSim.BattleEngine/Engine/MatchFinishBase.cs +++ b/SVSim.BattleEngine/Engine/MatchFinishBase.cs @@ -20,10 +20,6 @@ public class MatchFinishBase public List achieved_achievement_list => AchievedInfo._achievements; - public List _missionRewards => AchievedInfo._rewards; - - public List _victoryRewards => AchievedInfo._victoryRewards; - public AchievedInfo AchievedInfo { get; private set; } public TreasureBoxCpResultInfo TreasureBoxCpResultInfo { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Matching.cs b/SVSim.BattleEngine/Engine/Matching.cs deleted file mode 100644 index 873e3688..00000000 --- a/SVSim.BattleEngine/Engine/Matching.cs +++ /dev/null @@ -1,905 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.ErrorDialog; -using Wizard.RoomMatch; - -public class Matching : MatchingBase -{ - public enum DoMatchingResult - { - NONE = 0, - RC_BATTLE_MATCHING_ILLEGAL = 3001, - RC_BATTLE_MATCHING_RETRY = 3002, - RC_BATTLE_MATCHING_WAITING = 3003, - RC_BATTLE_MATCHING_SUCCEEDED = 3004, - RC_BATTLE_MATCHING_RETRY_PERIOD_ERROR = 3005, - RC_BATTLE_MATCHING_INIT = 3006, - RC_BATTLE_MATCHING_SUCCEEDED_OWNER = 3007, - COLOSSEUM_BATTLE_MATCHING_RETRY = 3008, - RC_BATTLE_MATCHING_IN_BATTLE_PHASE = 3009, - AI_BATTLE_MATCHING_SUCCEEDED = 3011, - COMPETITION_BATTLE_MATCHING_RETRY = 3012, - RC_BATTLE_MATCHING_NOT_JOINED_GATHERING = 5304, - RC_BATTLE_MATCHING_GATHERING_BATTLE_END = 5311, - RC_BATTLE_MATCHING_NOT_ROOM_ID = 5316, - RC_BATTLE_MATCHING_DISABLE_ROOM_ID = 5315 - } - - public enum DO_MATCHING_LOG - { - TEST, - FIRST, - RETRY, - DEBUG - } - - private bool _isStartBattleLoad; - - protected bool _goTitleOnTimeout; - - protected bool _receivedMatchingTimeout; - - protected int selectDeckID; - - private List _doMatchingAPICoroutineList = new List(); - - private const int GAMESTART_MATCHING = 30; - - public const int CONNECT_TRY_COUNT = 4; - - private const int WAIT_AI_BATTLE_START = 4; - - private const int LOADED_TIMEOUT_TIMER = 25; - - protected const int CONNECT_ERROR_CODE = 12; - - public bool isDisplayCancelButton = true; - - public bool isOffViewAllEnable = true; - - private bool _isStopDoMatching; - - private bool _isDisconnect; - - private DialogBase _errorDialog; - - protected bool isGoBattle; - - private List _matchingIntervalActionBaseList = new List(); - - protected MatchingRetryDomatching _retryDomatching; - - public MatchingNetworkConnectChecker _matchingNetworkConnectCheker; - - protected MatchingTimeChecker _matchingTimeCheker; - - protected MatchingRetryLoaded _matchingRetryLoaded; - - protected DoMatchingResult _doMatchingResultKind; - - private bool _isDomatchingReceiveFirstFlag; - - private int _doMatchingTimeoutPeriod; - - protected string errorDialogReturnText = Wizard.Data.SystemText.Get("Battle_0414"); - - private GameObject _coroutineObject; - - private DateTime _battleStartDate; - - protected bool isOwner; - - private NetworkTask _connectAPITask; - - public bool IsStopNetWorkWithErrorCode { get; private set; } - - public MonoBehaviour CoroutineMonoBehaviour { get; private set; } - - private bool _isRecovery - { - get - { - if (BattleManagerBase.GetIns() == null || !BattleManagerBase.GetIns().IsRecovery) - { - return false; - } - return true; - } - } - - public Matching() - { - _coroutineObject = new GameObject("MatchingCoroutine"); - _coroutineObject.AddComponent(); - CoroutineMonoBehaviour = _coroutineObject.GetComponent(); - _matchingIntervalActionBaseList = new List(); - _retryDomatching = new MatchingRetryDomatching(this); - MatchingRetryDomatching retryDomatching = _retryDomatching; - retryDomatching.OnDoMatchingSuccess = (Action)Delegate.Combine(retryDomatching.OnDoMatchingSuccess, new Action(OnFinishedDoMatching)); - _matchingIntervalActionBaseList.Add(_retryDomatching); - _matchingNetworkConnectCheker = new MatchingNetworkConnectChecker(this); - _matchingIntervalActionBaseList.Add(_matchingNetworkConnectCheker); - _matchingTimeCheker = new MatchingTimeChecker(this); - _matchingIntervalActionBaseList.Add(_matchingTimeCheker); - _matchingRetryLoaded = new MatchingRetryLoaded(this); - _matchingIntervalActionBaseList.Add(_matchingRetryLoaded); - if (ToolboxGame.RealTimeNetworkAgent != null) - { - SettingRealTimeNetworkEvent(); - ToolboxGame.RealTimeNetworkAgent.SettingMatchingClass(this); - } - } - - public virtual void FirstSetting(int classId, int selDeck, bool isRecovery = false) - { - RealTimeNetworkAgent.FinishTaskBase = GetBattleFinishTask(); - if (ToolboxGame.RealTimeNetworkAgent != null) - { - ToolboxGame.RealTimeNetworkAgent.InitCurrentMatchingStatus(); - } - if (isRecovery) - { - selectDeckID = selDeck; - StartBattleLoad(); - _matchingTimeCheker.Stop(); - return; - } - _isStartBattleLoad = false; - selectDeckID = selDeck; - isOwner = false; - _isDomatchingReceiveFirstFlag = true; - _isStopDoMatching = false; - _isDisconnect = false; - DoMatching(OnFinishedDoMatching, 1, DO_MATCHING_LOG.FIRST); - _matchingTimeCheker.Start(); - _matchingTimeCheker.SetTimeLimitSecond(30, "do_matchingTimeOut"); - } - - public void UpdateOffLineMatching() - { - if (ToolboxGame.RealTimeNetworkAgent == null) - { - UpdateMatching(); - } - } - - public void UpdateMatching() - { - foreach (MatchingIntervalActionBase matchingIntervalActionBase in _matchingIntervalActionBaseList) - { - matchingIntervalActionBase.Update(); - } - LocalLog.SubmitAccumulateLastTraceLog(); - } - - public void StopMatchingAction() - { - foreach (MatchingIntervalActionBase matchingIntervalActionBase in _matchingIntervalActionBaseList) - { - matchingIntervalActionBase.Stop(); - } - } - - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - } - - protected void DoMatchingResultSetting() - { - _doMatchingResultKind = (DoMatchingResult)Wizard.Data.DoMatchingDetail.data.matchingState; - _doMatchingTimeoutPeriod = Wizard.Data.DoMatchingDetail.data.timeoutPeriod; - _retryDomatching.SettingRetryPeriod(Wizard.Data.DoMatchingDetail.data.retryPeriod); - CustomPreference.SetNodeServerURL(Wizard.Data.DoMatchingDetail.data.nodeServerUrl); - } - - protected virtual void OnFinishedDoMatching() - { - if (_isStopDoMatching) - { - return; - } - if (_isDomatchingReceiveFirstFlag) - { - _matchingTimeCheker.Start(); - _matchingTimeCheker.SetTimeLimitSecond(_doMatchingTimeoutPeriod, "do_matchingReceiveTimeOut"); - _isDomatchingReceiveFirstFlag = false; - } - switch (_doMatchingResultKind) - { - case DoMatchingResult.RC_BATTLE_MATCHING_ILLEGAL: - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Error_3001"), Wizard.Data.SystemText.Get("ErrorHeader_3001"), Wizard.Data.SystemText.Get("Common_0132")); - break; - case DoMatchingResult.RC_BATTLE_MATCHING_RETRY: - case DoMatchingResult.RC_BATTLE_MATCHING_WAITING: - case DoMatchingResult.COLOSSEUM_BATTLE_MATCHING_RETRY: - case DoMatchingResult.COMPETITION_BATTLE_MATCHING_RETRY: - _retryDomatching.Start(); - _retryDomatching.SetNeedInit(0); - break; - case DoMatchingResult.RC_BATTLE_MATCHING_SUCCEEDED: - StopDomatchingAPICoroutine(); - _matchingNetworkConnectCheker.SetBattleId(Wizard.Data.DoMatchingDetail.data.battleId); - StartConnect(); - isOwner = false; - break; - case DoMatchingResult.RC_BATTLE_MATCHING_RETRY_PERIOD_ERROR: - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Error_3005"), Wizard.Data.SystemText.Get("ErrorHeader_3005"), Wizard.Data.SystemText.Get("Common_0132")); - break; - case DoMatchingResult.RC_BATTLE_MATCHING_INIT: - _retryDomatching.Start(); - _retryDomatching.SetNeedInit(1); - break; - case DoMatchingResult.RC_BATTLE_MATCHING_SUCCEEDED_OWNER: - StopDomatchingAPICoroutine(); - _retryDomatching.SettingRetryPeriod(Wizard.Data.DoMatchingDetail.data.retryPeriod); - _matchingNetworkConnectCheker.SetBattleId(Wizard.Data.DoMatchingDetail.data.battleId); - StartConnect(); - isOwner = true; - break; - case DoMatchingResult.AI_BATTLE_MATCHING_SUCCEEDED: - StopDomatchingAPICoroutine(); - _matchingNetworkConnectCheker.SetBattleId(Wizard.Data.DoMatchingDetail.data.battleId); - isOwner = true; - GameMgr.GetIns().IsAINetwork = true; - SafeStartBattleCoroutine(CreateAIBattleStart()); - break; - case DoMatchingResult.RC_BATTLE_MATCHING_IN_BATTLE_PHASE: - if (ToolboxGame.RealTimeNetworkAgent == null || ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus <= RealTimeNetworkAgent.MatchingStatus.StartLoad) - { - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Battle_0513"), Wizard.Data.SystemText.Get("Battle_0412"), Wizard.Data.SystemText.Get("Battle_0414")); - } - break; - case (DoMatchingResult)3010: - break; - } - } - - public void StartConnect() - { - _matchingNetworkConnectCheker.Start(); - _matchingNetworkConnectCheker.OnTimeoutInitNetwork = OnTimeoutInitNetworkToTimeOutAction; - _matchingNetworkConnectCheker.OnConnectError = ConnectError; - } - - private void ConnectError() - { - TimeOutAction("MatchingNetworkConnectCheker ConnectFailed", MatchingNetworkConnectChecker.IsOpenIpv6Dialog()); - } - - private IEnumerator CreateAIBattleStart() - { - yield return new WaitForSeconds(4f); - AIBattleStartTask task = new AIBattleStartTask(); - SafeStartBattleCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - if (CoroutineMonoBehaviour != null) - { - StartConnect(); - } - })); - } - - private void StopDomatchingAPICoroutine() - { - for (int i = 0; i < _doMatchingAPICoroutineList.Count; i++) - { - CoroutineMonoBehaviour.StopCoroutine(_doMatchingAPICoroutineList[i]); - _doMatchingAPICoroutineList[i] = null; - } - _doMatchingAPICoroutineList = new List(); - Toolbox.NetworkManager.StopConnectCoroutine(); - } - - public void MatchingInitBattle() - { - _matchingTimeCheker.Start(); - _matchingTimeCheker.SetTimeLimitSecond(30, "matchedStart"); - ToolboxGame.RealTimeNetworkAgent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.Connect); - ToolboxGame.RealTimeNetworkAgent.OnResultCodeError = ReceiveResultCodeError; - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(GetInitBattleUri()); - if (GameMgr.GetIns().IsAINetwork) - { - ToolboxGame.RealTimeNetworkAgent.SetbattleId(Wizard.Data.DoMatchingDetail.data.battleId); - StartBattleLoad(); - isGoBattle = true; - GotoBattle(); - } - } - - protected virtual NetworkBattleDefine.NetworkBattleURI GetInitBattleUri() - { - return NetworkBattleDefine.NetworkBattleURI.InitBattle; - } - - protected override void SettingOwnerToMatchingState() - { - } - - protected void StartBattleLoad() - { - ToolboxGame.UIManager.CloseInSceneLoadingMatching(); - LoadingInScene loadingInScene = ToolboxGame.UIManager.createInSceneLoadingBattle(); - if (!_isRecovery) - { - loadingInScene.ProgressObj.IsOpponentWait = true; - } - if (_isStartBattleLoad) - { - return; - } - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - _isStartBattleLoad = true; - GameMgr.GetIns().IsNetworkBattle = true; - dataMgr.Load(); - NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData(); - if (GameMgr.GetIns().IsAINetwork) - { - if (!_isRecovery) - { - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = Wizard.Data.AIBattleStartData.TurnState; - GameMgr.GetIns().SettingSelfInfo(Wizard.Data.AIBattleStartData.Data.SelfInfo.DataDictionary, isWatchReplayRecovery: false); - GameMgr.GetIns().SettingBattleStartSelfInfo(Wizard.Data.AIBattleStartData.Data.SelfInfo.DataDictionary); - GameMgr.GetIns().SettingOpponentInfo(Wizard.Data.AIBattleStartData.Data.OppoInfo.DataDictionary, isWatchReplayRecovery: false); - GameMgr.GetIns().SettingBattleStartOpponentInfo(Wizard.Data.AIBattleStartData.Data.OppoInfo.DataDictionary); - dataMgr.SetEnemySleeveId(Convert.ToInt64(Wizard.Data.AIBattleStartData.Data.OppoInfo.DataDictionary["sleeveId"])); - } - } - else - { - long opponentSleeveId = networkUserInfoData.GetOpponentSleeveId(); - List opponentDeck = networkUserInfoData.GetOpponentDeck(); - dataMgr.SetCurrentEnemyDeckData(opponentDeck.Select((CardDataModel x) => x.CardId).ToList()); - dataMgr.SetEnemySleeveId(opponentSleeveId); - List selfDeck = networkUserInfoData.GetSelfDeck(); - if (GameMgr.GetIns().IsWatchBattle) - { - ClassCharacterMasterData classCharacterMasterData = dataMgr.GetCharaPrmByCharaId(networkUserInfoData.GetSelfCharaId()); - if (classCharacterMasterData == null) - { - classCharacterMasterData = dataMgr.GetCharaPrmByClassId(networkUserInfoData.GetSelfClassId(), isCurrentChara: false); - } - dataMgr.SetPlayerCharaId(classCharacterMasterData.chara_id); - dataMgr.SetPlayerSubClassID(networkUserInfoData.GetSelfSubClassId()); - dataMgr.SetPlayerMyRotationInfo(networkUserInfoData.GetSelfMyRotationId()); - dataMgr.SetPlayerSleeveId(networkUserInfoData.GetSelfSleeveId()); - Wizard.Data.RoomTwoPickBeforeBattleInfo.SelfInfoDeckCopyTwoPickDraftData(); - } - dataMgr.SetCurrentDeckData(selfDeck.Select((CardDataModel x) => x.CardId).ToList()); - dataMgr.LoadEnemyClassData(); - } - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.NotWait(); - if (!GameMgr.GetIns().IsReplayBattle) - { - changeViewSceneParam.IsInactive_AllView = false; - changeViewSceneParam.IsDestroy_AllDialog = false; - } - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle, changeViewSceneParam); - _matchingTimeCheker.Stop(); - } - - public virtual void SettingRealTimeNetworkEvent() - { - ToolboxGame.RealTimeNetworkAgent.OnMatchingReceiveUri = null; - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnMatchingReceiveUri = (Action>)Delegate.Combine(realTimeNetworkAgent.OnMatchingReceiveUri, new Action>(ReactionReceiveUri)); - ToolboxGame.RealTimeNetworkAgent.OnEmit = null; - RealTimeNetworkAgent realTimeNetworkAgent2 = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent2.OnEmit = (Action)Delegate.Combine(realTimeNetworkAgent2.OnEmit, new Action(SettingLoadedTimeOutCoroutine)); - } - - private void ReactionReceiveUri(NetworkBattleDefine.NetworkBattleURI uri, Dictionary synchronizeData) - { - switch (uri) - { - case NetworkBattleDefine.NetworkBattleURI.Matched: - if (ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus == RealTimeNetworkAgent.MatchingStatus.Connect) - { - SettingOwnerToMatchingState(); - ToolboxGame.RealTimeNetworkAgent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.StartLoad); - StartBattleLoad(); - } - break; - case NetworkBattleDefine.NetworkBattleURI.Retry: - { - string value = synchronizeData[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.targetUri]].ToString(); - if (Enum.IsDefined(typeof(NetworkBattleDefine.NetworkBattleURI), value) && (NetworkBattleDefine.NetworkBattleURI)Enum.Parse(typeof(NetworkBattleDefine.NetworkBattleURI), value) == NetworkBattleDefine.NetworkBattleURI.Loaded) - { - _matchingRetryLoaded.Start(); - } - break; - } - case NetworkBattleDefine.NetworkBattleURI.BattleStart: - if (synchronizeData.ContainsKey(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.battleStartDate])) - { - _battleStartDate = TimeUtil.MicroTimeToFromUnixTime(long.Parse(synchronizeData[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.battleStartDate]].ToString())); - } - else - { - _battleStartDate = DateTime.Now; - } - ToolboxGame.RealTimeNetworkAgent.SetNetworkInfo(synchronizeData, ref uri); - ToolboxGame.RealTimeNetworkAgent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.Prepared); - SafeStartBattleCoroutine(CheckNetworkInfo(delegate - { - isGoBattle = true; - _matchingTimeCheker.Stop(); - GotoBattle(); - })); - break; - } - } - - private IEnumerator CheckNetworkInfo(Action callback) - { - while (!BattleManagerBase.GetIns().BattleStartControl.IsReady) - { - yield return null; - } - callback.Call(); - } - - private void SettingLoadedTimeOutCoroutine(NetworkBattleDefine.NetworkBattleURI uri) - { - if (uri == NetworkBattleDefine.NetworkBattleURI.Loaded) - { - _goTitleOnTimeout = true; - _matchingTimeCheker.Start(); - _matchingTimeCheker.SetTimeLimitSecond(25, "loadedTimeout"); - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnEmit = (Action)Delegate.Remove(realTimeNetworkAgent.OnEmit, new Action(SettingLoadedTimeOutCoroutine)); - } - } - - private void RemoveRealTimeNetworkEvent() - { - ToolboxGame.RealTimeNetworkAgent.OnMatchingReceiveUri = null; - ToolboxGame.RealTimeNetworkAgent.OnEmit = null; - _matchingNetworkConnectCheker.OnConnectError = null; - _matchingNetworkConnectCheker.OnTimeoutInitNetwork = null; - } - - public virtual void GotoBattle() - { - SettingOpponentClassDataAndLoadObject(); - RemoveRealTimeNetworkEvent(); - if (!GameMgr.GetIns().IsAINetwork) - { - BattleManagerBase.GetIns().SetupReplayBattleInfoFilter(); - } - if ((bool)ToolboxGame.RealTimeNetworkAgent && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != RealTimeNetworkAgent.MatchingStatus.Prepared) - { - ToolboxGame.RealTimeNetworkAgent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.Prepared); - } - if (!GameMgr.GetIns().IsAINetwork) - { - if ((bool)ToolboxGame.RealTimeNetworkAgent) - { - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; - networkBattleManagerBase.SettingOpponentAliveEvent(); - if (!_isRecovery) - { - networkBattleManagerBase.IsStopIntervalCheck = false; - } - ToolboxGame.RealTimeNetworkAgent.StartPreparedStartTimer(_battleStartDate); - ToolboxGame.RealTimeNetworkAgent.StartRecoveryRecording(); - } - UIManager.GetInstance().OffViewAllOutside(UIManager.ViewScene.Battle); - if (!_isRecovery) - { - ToolboxGame.UIManager.CloseInSceneLoadingBattle(); - } - } - DestroyCoroutineObject(); - } - - protected void SettingOpponentClassDataAndLoadObject() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData(); - ClassCharacterMasterData classCharacterMasterData = dataMgr.GetCharaPrmByCharaId(networkUserInfoData.GetOpponentCharaId()); - bool flag = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_OPPONENT_DEFAULT_SKIN); - if (flag && networkUserInfoData.GetOpponentChaosId() != -1 && (GameMgr.GetIns().IsNetworkBattle || GameMgr.GetIns().IsReplayBattle) && !networkUserInfoData.GetOpponentChaosOverrideSkin()) - { - flag = false; - } - if (classCharacterMasterData == null || flag) - { - classCharacterMasterData = dataMgr.GetCharaPrmByClassId(networkUserInfoData.GetOpponentClassId(), isCurrentChara: false); - } - dataMgr.SetEnemyCharaId(classCharacterMasterData.chara_id); - dataMgr.SetEnemySubClassID(networkUserInfoData.GetOpponentSubClassId()); - dataMgr.SetEnemyMyRotationInfo(networkUserInfoData.GetOpponentMyRotationId()); - dataMgr.SetEnemyAvatarBattleInfo(networkUserInfoData.GetOpponentAvatarBattleId()); - } - - public virtual FinishTaskBase GetBattleFinishTask() - { - return new FinishTaskBase(); - } - - public bool GetMatchingDataReady() - { - return _isStartBattleLoad; - } - - public void DisConnect(Action onDisconnected) - { - if (!_isDisconnect) - { - _isDisconnect = true; - string text = "matchingDisconnect"; - DestroyCoroutineObject(); - if ((bool)ToolboxGame.RealTimeNetworkAgent) - { - text += ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus; - ToolboxGame.RealTimeNetworkAgent.DestroyObj(RealTimeNetworkAgent.DESTROY_OBJECT_LOG.MatchingDisconnect); - } - text += StackTraceUtility.ExtractStackTrace(); - LocalLog.AccumulateLastTraceLog(text); - _isStopDoMatching = true; - onDisconnected.Call(); - } - } - - protected void DestroyCoroutineObject() - { - StopMatchingAction(); - if (CoroutineMonoBehaviour != null) - { - CoroutineMonoBehaviour.StopAllCoroutines(); - CoroutineMonoBehaviour = null; - } - if (_coroutineObject != null) - { - UnityEngine.Object.Destroy(_coroutineObject); - _coroutineObject = null; - } - } - - public void ReturnScene() - { - if (!_isStartBattleLoad && isOffViewAllEnable) - { - UIManager.GetInstance().OffViewAll(); - } - ToolboxGame.DestroyNetworkAgent(); - GameMgr.GetIns().IsAINetwork = false; - if (GetMatchingDataReady() && GameMgr.GetIns().GetBattleCtrl() != null) - { - UIManager.GetInstance().StartCoroutine(BattleEndCoroutin(GotoHomeScene)); - return; - } - UIManager.GetInstance().CloseInSceneLoadingMatching(); - if (GetMatchingDataReady()) - { - GotoHomeScene(); - } - else - { - GotoDeckSelectScene(); - } - } - - protected virtual void GotoHomeScene() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 0; - changeViewSceneParam.IsCutCardMotion = true; - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - protected override void GotoDeckSelectScene() - { - } - - private void OnSelectDeck(DialogBase dialogDeckList, DeckData deck) - { - if (deck == null || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.None) - { - return; - } - if (!deck.IsUsable()) - { - InCompleteDeckDecideDialog.Create(dialogDeckList, deck); - return; - } - CompleteDeckDecideDialog completeDeckDecideDialog = CompleteDeckDecideDialog.CreateForSingleDeck(dialogDeckList, deck, showSimpleStageOption: false, null); - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.RoomBattle || GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.RoomTwoPick) - { - RoomBase.DeckConfirmDialog = completeDeckDecideDialog.Dialog; - } - } - - public void QuitMatching(bool isReturnScene = true) - { - if (ToolboxGame.RealTimeNetworkAgent != null) - { - LocalLog.AccumulateLastTraceLog("Matching_QuitMatching" + ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus); - } - DisConnect(delegate - { - if (isReturnScene) - { - ReturnScene(); - } - }); - } - - public void ReceiveResultCodeError(int code) - { - if (!IsStopNetWorkWithErrorCode) - { - IsStopNetWorkWithErrorCode = true; - _matchingTimeCheker.Stop(); - switch (code) - { - case 30201: - _receivedMatchingTimeout = true; - TimeOutAction("ReceiveResultCodeError"); - break; - case 30212: - TimeOutAction("NodeErrorDisconnect"); - break; - case 30001: - case 30002: - case 30213: - case 30302: - DisConnect(null); - break; - } - } - } - - private void OnTimeoutInitNetworkToTimeOutAction() - { - _matchingNetworkConnectCheker.OnTimeoutInitNetwork = null; - TimeOutAction("OnTimeoutInitNetwork"); - } - - public virtual void TimeOutAction(string log, bool isIpv6Dialog = false) - { - LocalLog.AccumulateLastTraceLog("TimeOutAction " + log); - if (ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus >= RealTimeNetworkAgent.MatchingStatus.Prepared && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != RealTimeNetworkAgent.MatchingStatus.RoomReady && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != RealTimeNetworkAgent.MatchingStatus.Room) - { - LocalLog.AccumulateLastTraceLog("Matching_TimeOutActionIgnore" + ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus); - } - else if (isIpv6Dialog) - { - ErrorDialogWithRetry("", Wizard.Data.SystemText.Get("ErrorHeader_0016"), isIpv6Dialog); - } - else if (_goTitleOnTimeout && !_receivedMatchingTimeout) - { - ErrorDialogGoToTitle(Wizard.Data.SystemText.Get("Battle_0508"), Wizard.Data.SystemText.Get("Battle_0412")); - } - else if (_isStartBattleLoad || _receivedMatchingTimeout) - { - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Battle_0404"), Wizard.Data.SystemText.Get("Battle_0412"), Wizard.Data.SystemText.Get("Common_0132")); - } - else - { - TimeOutMessageToRetry(); - } - } - - protected virtual void TimeOutMessageToRetry() - { - if (ToolboxGame.RealTimeNetworkAgent != null) - { - LocalLog.AccumulateLastTraceLog("Matching_TimeOutMessageToRetry" + ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus); - } - ErrorDialogWithRetry(Wizard.Data.SystemText.Get("Battle_0405"), Wizard.Data.SystemText.Get("Battle_0412")); - } - - protected int GetLastResultCode() - { - return _connectAPITask.GetResultCode(); - } - - protected void ConnectAPI(NetworkTask task, Action callbackOnSuccess = null) - { - string text = "Matching_ConnectAPI " + task; - if ((bool)ToolboxGame.RealTimeNetworkAgent) - { - text += ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus; - } - text += StackTraceUtility.ExtractStackTrace(); - LocalLog.AccumulateLastTraceLog(text); - _connectAPITask = task; - task.SkipAllCuteResultCodeCheckErrorPopup(); - task.SkipCuteTimeOutPopup(); - task.SkipCuteHttpStatusErrorPopup(); - _doMatchingAPICoroutineList.Add(SafeStartBattleCoroutine(Toolbox.NetworkManager.Connect(task, callbackOnSuccess, delegate(NetworkTask.ResultCode result) - { - if (task.GetResultCode() == 109) - { - LocalLog.AccumulateLastTraceLog("Matching_TimeSlipRotation SeasonChangeError"); - Dialog.Create(task.GetResultCode()); - } - else - { - OnFailed((int)result); - } - }, OnErrorAPI))); - } - - protected virtual void OnFailed(int code) - { - string text = "Matching_ConnectAPIOnFailed"; - if (ToolboxGame.RealTimeNetworkAgent != null) - { - text += ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus; - } - LocalLog.AccumulateLastTraceLog(text); - int num = code; - if (code == 4) - { - UIManager.GetInstance().closeInSceneLoading(); - DisConnect(null); - } - else - { - num = 12; - OnErrorAPI(num); - } - } - - private void OnErrorAPI(int code) - { - if (code == 9999) - { - DisConnect(delegate - { - Dialog.Create(code); - }); - } - else - { - if (_connectAPITask != null && _connectAPITask.GetResultCode() == 109) - { - return; - } - string text = "Matching_OnErrorAPI"; - if (ToolboxGame.RealTimeNetworkAgent != null) - { - text += ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus; - } - LocalLog.AccumulateLastTraceLog(text); - UIManager.GetInstance().closeInSceneLoading(); - TaskManager.GetErrorMsgFromCode(code, out var msg, out var title); - if (code != 317) - { - bool num = code == 101 || (code >= 2000 && code <= 2999); - bool flag = code >= 2000 && code <= 2999; - if (num) - { - NetworkUI.GetInstance().OpenGoToTitleErrorPopUp(title, Wizard.Data.SystemText.Get("Battle_0409"), code.ToString()); - } - else if (flag) - { - ErrorDialogWithReturn(msg, title, Wizard.Data.SystemText.Get("Common_0132")); - } - else if (code == 3010) - { - ErrorDialogGoToTitle(msg, title); - } - else - { - ErrorDialogWithRetry(msg, title); - } - } - } - } - - protected DialogBase CreateDialogBase() - { - DialogBase dialogBase = null; - return (_errorDialog != null) ? _errorDialog : (_errorDialog = UIManager.GetInstance().CreateDialogClose()); - } - - protected void ErrorDialogWithReturn(string text, string title, string buttonMsg) - { - DisConnect(delegate - { - DialogBase dialogBase = CreateDialogBase(); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(text); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialogBase.SetButtonText(buttonMsg); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetPanelDepth(5400); - dialogBase.OnClose = ReturnScene; - }); - } - - protected void ErrorDialogGoToTitle(string text, string title) - { - DisConnect(delegate - { - DialogBase dialogBase = CreateDialogBase(); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(text); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BackToTitleBtn); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetPanelDepth(5400); - }); - } - - protected void ErrorDialogWithRetry(string text, string title, bool isIpv6Dialog = false) - { - DisConnect(delegate - { - ErrorDialog(text, title, isIpv6Dialog); - }); - } - - protected virtual void ErrorDialog(string text, string title, bool isIPv6Dialog) - { - DialogBase dialogBase = CreateDialogBase(); - if (isIPv6Dialog) - { - MatchingIPv6Toggle.AddMatchingIPv6Toggle(dialogBase); - } - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(text); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dialogBase.SetButtonText(Wizard.Data.SystemText.Get("System_0012"), errorDialogReturnText); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetPanelDepth(5400); - dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - EventDelegate method_btn = new EventDelegate(delegate - { - ToolboxGame.DestroyNetworkAgent(); - Action action = delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - OnChange = delegate - { - UIManager.GetInstance().CloseInSceneLoadingBattle(); - } - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.RankMatch, param); - }; - if (_isStartBattleLoad) - { - UIManager.GetInstance().StartCoroutine(BattleEndCoroutin(action)); - } - else - { - action(); - } - }); - EventDelegate eventDelegate = new EventDelegate(ReturnScene); - dialogBase.SetButtonDelegate(method_btn, eventDelegate, eventDelegate, eventDelegate); - } - - protected IEnumerator BattleEndCoroutin(Action callback) - { - yield return null; - SBattleLoad battleLoad = BattleManagerBase.GetIns().SBattleLoad; - while (!battleLoad.isLoadEnd) - { - yield return null; - } - yield return GameMgr.GetIns().GetBattleCtrl().BattleEnd(); - callback(); - } - - public Coroutine SafeStartBattleCoroutine(IEnumerator routine) - { - if (CoroutineMonoBehaviour == null) - { - return null; - } - return CoroutineMonoBehaviour.StartCoroutine(routine); - } -} diff --git a/SVSim.BattleEngine/Engine/MatchingBase.cs b/SVSim.BattleEngine/Engine/MatchingBase.cs deleted file mode 100644 index bd04af41..00000000 --- a/SVSim.BattleEngine/Engine/MatchingBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -public abstract class MatchingBase -{ - public abstract void DoMatching(Action onFinished, int need_init, Matching.DO_MATCHING_LOG log); - - protected abstract void GotoDeckSelectScene(); - - protected abstract void SettingOwnerToMatchingState(); -} diff --git a/SVSim.BattleEngine/Engine/MatchingCoroutine.cs b/SVSim.BattleEngine/Engine/MatchingCoroutine.cs deleted file mode 100644 index 2e8b4e1b..00000000 --- a/SVSim.BattleEngine/Engine/MatchingCoroutine.cs +++ /dev/null @@ -1,5 +0,0 @@ -using UnityEngine; - -public class MatchingCoroutine : MonoBehaviour -{ -} diff --git a/SVSim.BattleEngine/Engine/MatchingIPv6Toggle.cs b/SVSim.BattleEngine/Engine/MatchingIPv6Toggle.cs deleted file mode 100644 index f671d07f..00000000 --- a/SVSim.BattleEngine/Engine/MatchingIPv6Toggle.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Cute; -using UnityEngine; -using Wizard; - -public class MatchingIPv6Toggle : MonoBehaviour -{ - [SerializeField] - private UIToggle _networkLineChangeToggle; - - private const string TOGGLE_PATH = "UI/layoutParts/MatchingIPv6Toggle"; - - public static void AddMatchingIPv6Toggle(DialogBase dialog) - { - MatchingIPv6Toggle matchingIPv6Toggle = Object.Instantiate(Toolbox.ResourcesManager.LoadObject("UI/layoutParts/MatchingIPv6Toggle", isServerResources: false)); - dialog.SetObj(matchingIPv6Toggle.gameObject); - matchingIPv6Toggle.SettingToggle(); - } - - public void SettingToggle() - { - _networkLineChangeToggle.onChange.Add(new EventDelegate(OnClickToggle)); - _networkLineChangeToggle.value = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_IPV6); - } - - private void OnClickToggle() - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_SELECT_IPV6, _networkLineChangeToggle.value); - GameMgr.GetIns().GetSoundMgr().PlaySe(_networkLineChangeToggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } -} diff --git a/SVSim.BattleEngine/Engine/MatchingIntervalActionBase.cs b/SVSim.BattleEngine/Engine/MatchingIntervalActionBase.cs deleted file mode 100644 index 37300d69..00000000 --- a/SVSim.BattleEngine/Engine/MatchingIntervalActionBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using Cute; - -public class MatchingIntervalActionBase -{ - protected DateTime _startTimer; - - protected Matching _matching; - - protected bool _isActive; - - public MatchingIntervalActionBase(Matching matching) - { - _matching = matching; - } - - public virtual void Start() - { - _startTimer = TimeUtil.GetAbsoluteTime(); - _isActive = true; - } - - public virtual void Stop() - { - _isActive = false; - } - - public virtual void Update() - { - } -} diff --git a/SVSim.BattleEngine/Engine/MatchingNetworkConnectChecker.cs b/SVSim.BattleEngine/Engine/MatchingNetworkConnectChecker.cs deleted file mode 100644 index b5bd7e1d..00000000 --- a/SVSim.BattleEngine/Engine/MatchingNetworkConnectChecker.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using Wizard; - -public class MatchingNetworkConnectChecker : MatchingIntervalActionBase -{ - public Action OnConnectError; - - public Action OnTimeoutInitNetwork; - - private int _connectFailCount; - - private string _doMatchingBattleId; - - private int _initNetworkSendNum; - - private long _initNetworkTimer; - - private bool _isConnectOnly; - - private bool _isNotInitBattle; - - private bool _isBeforeBattleStartRetry; - - private int _phase; - - private const int NETWORKOBJECT_CREATE_PHASE = 0; - - private const int CONNECT_NETWORK_PHASE = 1; - - private const int WAIT_OPEN_NETWORK_PHASE = 2; - - private const int SEND_INIT_NETWORK_PHASE = 3; - - private const float INIT_NETWORK_EMIT_INTERVAL = 3f; - - private const float RECEIVE_WAIT_INIT_NETWORK_TIMER = 15f; - - private const float MAX_INIT_NETWORK_EMIT_NUM = 5f; - - public static int InitNetworkErrorNum; - - private const int INIT_NETWORK_ERROR_NUM_TO_IPV_DIALOG_OPEN = 2; - - public MatchingNetworkConnectChecker(Matching matching) - : base(matching) - { - } - - public void SetBattleId(string battleId) - { - _doMatchingBattleId = battleId; - } - - public void SetConnectOnly() - { - _isConnectOnly = true; - } - - public void SetNotInitBattle() - { - _isNotInitBattle = true; - } - - public void SetBeforeBattleStartRetry() - { - _isBeforeBattleStartRetry = true; - } - - public override void Update() - { - if (!_isActive) - { - return; - } - switch (_phase) - { - case 0: - if (Global.IS_LOAD_ALLDONE || !(ToolboxGame.RealTimeNetworkAgent != null)) - { - _matching.SafeStartBattleCoroutine(ToolboxGame.CreateRealTimeNetworkBattleAgent(_matching)); - _phase = 1; - } - break; - case 1: - if (!(ToolboxGame.RealTimeNetworkAgent == null)) - { - if (GameMgr.GetIns().IsAINetwork) - { - RealTimeNetworkAgent.FinishTaskBase = _matching.GetBattleFinishTask(); - } - _connectFailCount = 0; - ToolboxGame.RealTimeNetworkAgent.Connect(PlayerStaticData.UserViewerID, _doMatchingBattleId, delegate - { - _connectFailCount++; - }, _matching, _isBeforeBattleStartRetry); - _phase = 2; - } - break; - case 2: - if (_connectFailCount >= 4) - { - LocalLog.AccumulateTraceLog("FailConnectNodejs"); - InitNetworkErrorNum++; - OnConnectError.Call(); - _isActive = false; - } - else if (!(ToolboxGame.RealTimeNetworkAgent == null) && ToolboxGame.RealTimeNetworkAgent.IsOpen()) - { - if (_isConnectOnly) - { - _isActive = false; - break; - } - OnConnectError = null; - _phase = 3; - LocalLog.AccumulateLastTraceLog("MatchingNetworkConnectChecker_StartInitNetwork"); - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.InitNetwork, new Dictionary(), null, isGetableAck: false, -1, isStockData: false); - _initNetworkTimer = TimeUtil.GetAbsoluteTime().Ticks; - } - break; - case 3: - if (ToolboxGame.RealTimeNetworkAgent.IsInitNetworkSuccess()) - { - OnTimeoutInitNetwork = null; - _isActive = false; - if (!_isNotInitBattle) - { - _matching.MatchingInitBattle(); - } - _matching.SettingRealTimeNetworkEvent(); - ToolboxGame.RealTimeNetworkAgent.StartGungnir(); - } - else if ((float)NetworkUtility.GetTimeSpanSecond(_initNetworkTimer) >= 3f) - { - _initNetworkTimer = TimeUtil.GetAbsoluteTime().Ticks; - _initNetworkSendNum++; - if ((float)_initNetworkSendNum >= 5f) - { - _isActive = false; - LocalLog.AccumulateTraceLog("FailInitNetwork"); - OnTimeoutInitNetwork.Call(); - } - else - { - Dictionary dictionary = new Dictionary(); - dictionary["try"] = _initNetworkSendNum; - LocalLog.AccumulateLastTraceLog("MatchingNetworkConnectChecker_ResendInitNetwork"); - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.InitNetwork, dictionary, null, isGetableAck: false, -1, isStockData: false); - } - } - break; - } - } - - public static bool IsOpenIpv6Dialog() - { - if (InitNetworkErrorNum >= 2 && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_IPV6)) - { - return true; - } - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/MatchingRetryDomatching.cs b/SVSim.BattleEngine/Engine/MatchingRetryDomatching.cs deleted file mode 100644 index 2b790371..00000000 --- a/SVSim.BattleEngine/Engine/MatchingRetryDomatching.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using UnityEngine; -using Wizard; - -public class MatchingRetryDomatching : MatchingIntervalActionBase -{ - private int _retryPeriodSecond; - - private int _needInit; - - public Action OnDoMatchingSuccess; - - public MatchingRetryDomatching(Matching matching) - : base(matching) - { - } - - public void SetNeedInit(int need_Init) - { - _needInit = need_Init; - } - - public void SettingRetryPeriod(int retryPeriodSeconds) - { - _retryPeriodSecond = retryPeriodSeconds; - } - - public override void Start() - { - base.Start(); - string text = "do_matchingRetryStart "; - if ((bool)ToolboxGame.RealTimeNetworkAgent) - { - text += ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus; - } - text += StackTraceUtility.ExtractStackTrace(); - LocalLog.AccumulateLastTraceLog(text); - } - - public override void Update() - { - if (_isActive && NetworkUtility.GetTimeSpanSecond(_startTimer.Ticks) >= _retryPeriodSecond) - { - _isActive = false; - _matching.DoMatching(OnDoMatchingSuccess, _needInit, Matching.DO_MATCHING_LOG.RETRY); - } - } -} diff --git a/SVSim.BattleEngine/Engine/MatchingRetryLoaded.cs b/SVSim.BattleEngine/Engine/MatchingRetryLoaded.cs deleted file mode 100644 index 11b51284..00000000 --- a/SVSim.BattleEngine/Engine/MatchingRetryLoaded.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Wizard; - -public class MatchingRetryLoaded : MatchingIntervalActionBase -{ - public MatchingRetryLoaded(Matching matching) - : base(matching) - { - } - - public override void Update() - { - if (_isActive && (float)NetworkUtility.GetTimeSpanSecond(_startTimer.Ticks) >= 1f) - { - _isActive = false; - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.Loaded); - } - } -} diff --git a/SVSim.BattleEngine/Engine/MatchingTimeChecker.cs b/SVSim.BattleEngine/Engine/MatchingTimeChecker.cs deleted file mode 100644 index 49f41267..00000000 --- a/SVSim.BattleEngine/Engine/MatchingTimeChecker.cs +++ /dev/null @@ -1,26 +0,0 @@ -public class MatchingTimeChecker : MatchingIntervalActionBase -{ - private int _timeLimitSecond; - - private string _timeoutlog; - - public MatchingTimeChecker(Matching matching) - : base(matching) - { - } - - public void SetTimeLimitSecond(int timeLimitSecond, string log) - { - _timeLimitSecond = timeLimitSecond; - _timeoutlog = log; - } - - public override void Update() - { - if (_isActive && NetworkUtility.GetTimeSpanSecond(_startTimer.Ticks) >= _timeLimitSecond) - { - _isActive = false; - _matching.TimeOutAction(_timeoutlog); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Matching_Colosseum.cs b/SVSim.BattleEngine/Engine/Matching_Colosseum.cs deleted file mode 100644 index 7c90f527..00000000 --- a/SVSim.BattleEngine/Engine/Matching_Colosseum.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Cute; -using Wizard; - -public class Matching_Colosseum : Matching -{ - public Matching_Colosseum() - { - errorDialogReturnText = Data.SystemText.Get("Battle_0489"); - } - - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, need_init, log); - ColosseumDoMatchingTask colosseumDoMatchingTask = new ColosseumDoMatchingTask(); - colosseumDoMatchingTask.SetParameter(selectDeckID, need_init, (int)log); - ConnectAPI(colosseumDoMatchingTask, delegate - { - if (Data.DoMatchingDetail.data.matchingState != 3009) - { - DoMatchingResultSetting(); - onFinished.Call(); - } - }); - } - - protected override void TimeOutMessageToRetry() - { - ErrorDialogWithRetry(Data.SystemText.Get("Battle_0461"), Data.SystemText.Get("Battle_0412")); - Data.ArenaData.ColosseumData.IsRankMatching = false; - } - - public override FinishTaskBase GetBattleFinishTask() - { - return new ColosseumBattleFinishTask(); - } - - protected override void OnFailed(int code) - { - if (code != 3) - { - base.OnFailed(code); - } - } - - protected override void GotoDeckSelectScene() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.OnFinishChangeView = delegate - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Colosseum, changeViewSceneParam); - } -} diff --git a/SVSim.BattleEngine/Engine/Matching_Free.cs b/SVSim.BattleEngine/Engine/Matching_Free.cs deleted file mode 100644 index 588088e9..00000000 --- a/SVSim.BattleEngine/Engine/Matching_Free.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Cute; -using Wizard; - -public class Matching_Free : Matching -{ - public const int PRE_ROTATION_PERIOD_ERROR = 3010; - - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, need_init, log); - FreeBattleDoMatchingTask freeBattleDoMatchingTask = new FreeBattleDoMatchingTask(); - freeBattleDoMatchingTask.SetParameter(selectDeckID, need_init, (int)log); - ConnectAPI(freeBattleDoMatchingTask, delegate - { - if (Data.DoMatchingDetail.data.matchingState != 3009) - { - DoMatchingResultSetting(); - onFinished.Call(); - } - }); - } - - protected override void OnFailed(int code) - { - if (GetLastResultCode() != 3010) - { - base.OnFailed(code); - } - } - - public override FinishTaskBase GetBattleFinishTask() - { - return new FreeBattleFinishTask(); - } - - protected override void GotoDeckSelectScene() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 2; - changeViewSceneParam.OnFinishChangeView = delegate - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - MyPageMenu.Instance.ChangeMenu(2); - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Data.CurrentFormat); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - DeckSelectUIDialog.Create(Data.SystemText.Get("Battle_0005"), task.DeckGroupListData, Data.CurrentFormat, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, delegate(DialogBase dialog, DeckData deckData) - { - FreeAndRankMatchDeckSelectConfirmDialog.Create(dialog, deckData, isBattleEnd: false); - }); - })); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } -} diff --git a/SVSim.BattleEngine/Engine/Matching_RankMatch.cs b/SVSim.BattleEngine/Engine/Matching_RankMatch.cs deleted file mode 100644 index c3584ff8..00000000 --- a/SVSim.BattleEngine/Engine/Matching_RankMatch.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using Cute; -using Wizard; - -public class Matching_RankMatch : Matching -{ - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, need_init, log); - RankBattleDoMatchingTask rankBattleDoMatchingTask = new RankBattleDoMatchingTask(); - rankBattleDoMatchingTask.SetParameter(selectDeckID, need_init, (int)log); - ConnectAPI(rankBattleDoMatchingTask, delegate - { - if (Data.DoMatchingDetail.data.matchingState != 3009) - { - DoMatchingResultSetting(); - onFinished.Call(); - } - }); - } - - public override FinishTaskBase GetBattleFinishTask() - { - return new RankBattleFinishTask(); - } - - protected override void GotoDeckSelectScene() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 2; - changeViewSceneParam.OnFinishChangeView = delegate - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - MyPageMenu.Instance.ChangeMenu(2); - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Data.CurrentFormat); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - DeckSelectUIDialog.Create(Data.SystemText.Get("Battle_0006"), task.DeckGroupListData, Data.CurrentFormat, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, delegate(DialogBase dialog, DeckData deckData) - { - FreeAndRankMatchDeckSelectConfirmDialog.Create(dialog, deckData, isBattleEnd: false); - }); - })); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } -} diff --git a/SVSim.BattleEngine/Engine/Matching_Room.cs b/SVSim.BattleEngine/Engine/Matching_Room.cs deleted file mode 100644 index 2162dd5c..00000000 --- a/SVSim.BattleEngine/Engine/Matching_Room.cs +++ /dev/null @@ -1,256 +0,0 @@ -using System; -using Cute; -using Wizard; -using Wizard.ErrorDialog; -using Wizard.RoomMatch; - -public class Matching_Room : Matching -{ - public enum GAME_STATE - { - WAIT, - LOADING, - BATTLE, - RESULT - } - - private BattleParameter _battleParameter; - - private bool _isConvention; - - private bool _isGathering; - - private bool _isInitRoomBattle; - - private GAME_STATE _gameState; - - public const int RESULT_CODE_ROOM_NOT_FOUND = 1751; - - public const int RESULT_CODE_GATHERING_NOT_JOIN = 5304; - - public const int RESULT_CODE_GATHERING_EXPIRE = 5311; - - public bool IsStopChangeScene { get; set; } - - public override void FirstSetting(int classId, int selDeck, bool isRecovery = false) - { - _isInitRoomBattle = false; - errorDialogReturnText = Wizard.Data.SystemText.Get("Battle_0202"); - base.FirstSetting(classId, selDeck, isRecovery); - } - - public void SetBattleParameter(BattleParameter battleParameter) - { - _battleParameter = battleParameter; - } - - public Matching_Room(bool isConvention, bool isGathering) - { - _isConvention = isConvention; - _isGathering = isGathering; - errorDialogReturnText = Wizard.Data.SystemText.Get("Battle_0434"); - isDisplayCancelButton = false; - IsStopChangeScene = false; - } - - public override void DoMatching(Action onFinished, int init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, 0, log); - RoomBattleDoMatchingTask roomBattleDoMatchingTask = ((_battleParameter.DeckFormat == Format.Hof) ? new RoomBattleDoMatchingTaskHOF() : ((_battleParameter.DeckFormat == Format.Windfall) ? new RoomBattleDoMatchingTaskWindFall() : ((_battleParameter.DeckFormat == Format.Avatar) ? new RoomBattleDoMatchingTaskAvatar(_isGathering) : ((!RoomConnectController.IsNormalMatchingAPI(_battleParameter)) ? new RoomBattle2PickDoMatchingTask(_battleParameter.TwoPickFormat, _battleParameter.Rule) : new RoomBattleDoMatchingTask(_isConvention, _isGathering))))); - roomBattleDoMatchingTask.SetParameter(selectDeckID, 0, (int)log, includeCardMasterHash: true); - ConnectAPI(roomBattleDoMatchingTask, delegate - { - if (Wizard.Data.RoomBattleMatching.data.matching_state != 3009) - { - _gameState = (GAME_STATE)Wizard.Data.RoomBattleMatching.data.battle_state; - _doMatchingResultKind = (DoMatchingResult)Wizard.Data.RoomBattleMatching.data.matching_state; - onFinished.Call(); - RoomBase.IsMatchingFinish = true; - } - }); - } - - protected override void OnFinishedDoMatching() - { - if (ToolboxGame.RealTimeNetworkAgent == null) - { - return; - } - switch (_doMatchingResultKind) - { - case DoMatchingResult.RC_BATTLE_MATCHING_NOT_JOINED_GATHERING: - OpenErrorDialog((int)_doMatchingResultKind, UIManager.ViewScene.MyPage); - return; - case DoMatchingResult.RC_BATTLE_MATCHING_GATHERING_BATTLE_END: - OpenErrorDialog((int)_doMatchingResultKind, UIManager.ViewScene.Gathering); - return; - case DoMatchingResult.RC_BATTLE_MATCHING_NOT_ROOM_ID: - OpenErrorDialog((int)_doMatchingResultKind, UIManager.ViewScene.Gathering); - return; - } - switch (_gameState) - { - case GAME_STATE.LOADING: - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Battle_0401"), Wizard.Data.SystemText.Get("Battle_0411"), Wizard.Data.SystemText.Get("Common_0132")); - break; - case GAME_STATE.BATTLE: - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Battle_0402"), Wizard.Data.SystemText.Get("Battle_0411"), Wizard.Data.SystemText.Get("Common_0132")); - break; - case GAME_STATE.RESULT: - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Battle_0403"), Wizard.Data.SystemText.Get("Battle_0411"), Wizard.Data.SystemText.Get("Common_0132")); - break; - default: - MatchingInitBattle(); - break; - } - } - - protected override void SettingOwnerToMatchingState() - { - _isInitRoomBattle = true; - errorDialogReturnText = Wizard.Data.SystemText.Get("Battle_0434"); - base.SettingOwnerToMatchingState(); - switch (_doMatchingResultKind) - { - case DoMatchingResult.RC_BATTLE_MATCHING_SUCCEEDED_OWNER: - isOwner = true; - break; - case DoMatchingResult.RC_BATTLE_MATCHING_SUCCEEDED: - isOwner = false; - break; - default: - ErrorDialogWithReturn(Wizard.Data.SystemText.Get("Battle_0404"), Wizard.Data.SystemText.Get("Error_0002"), Wizard.Data.SystemText.Get("Common_0132")); - break; - case DoMatchingResult.RC_BATTLE_MATCHING_IN_BATTLE_PHASE: - break; - } - } - - protected override NetworkBattleDefine.NetworkBattleURI GetInitBattleUri() - { - return NetworkBattleDefine.NetworkBattleURI.InitRoomBattle; - } - - protected override void GotoHomeScene() - { - RoomBase.IsMatchingFinish = false; - bool isInitRoomBattle = _isInitRoomBattle; - if (IsStopChangeScene) - { - return; - } - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.OnChange = delegate - { - UIManager.GetInstance().CloseInSceneLoadingBattle(); - }; - if (isInitRoomBattle) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Room, changeViewSceneParam); - return; - } - changeViewSceneParam.IsCutCardMotion = true; - changeViewSceneParam.OnFinishChangeView = delegate - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - protected override void GotoDeckSelectScene() - { - GotoHomeScene(); - } - - public override FinishTaskBase GetBattleFinishTask() - { - if (_battleParameter.DeckFormat == Format.Hof) - { - return new RoomBattleFinishTaskHOF(); - } - if (_battleParameter.DeckFormat == Format.Windfall) - { - return new RoomBattleFinishTaskWindFall(); - } - if (_battleParameter.DeckFormat == Format.Avatar) - { - return new RoomBattleFinishTaskAvatar(_isGathering); - } - if (RoomConnectController.IsNormalMatchingAPI(_battleParameter)) - { - return new RoomBattleFinishTask(_isConvention, _isGathering); - } - return new RoomBattle2PickFinishTask(_battleParameter.TwoPickFormat, _battleParameter.Rule); - } - - protected override void ErrorDialog(string text, string title, bool isFailedInitNetwork) - { - DialogBase dialogBase = CreateDialogBase(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(text); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetButtonText(errorDialogReturnText); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetPanelDepth(5400); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - EventDelegate method_btn = new EventDelegate(base.ReturnScene); - dialogBase.SetButtonDelegate(method_btn); - } - - public override void TimeOutAction(string log, bool isInitNetworkFailed) - { - if (!_goTitleOnTimeout && _isGathering) - { - ErrorDialogGoToTitle(Wizard.Data.SystemText.Get("Battle_0508"), Wizard.Data.SystemText.Get("Battle_0412")); - return; - } - if (_goTitleOnTimeout && !_receivedMatchingTimeout) - { - ErrorDialogGoToTitle(Wizard.Data.SystemText.Get("Battle_0508"), Wizard.Data.SystemText.Get("Battle_0412")); - return; - } - LocalLog.AccumulateLastTraceLog("TimeOutAction " + log); - ErrorDialogGoToTitle(Wizard.Data.SystemText.Get("Error_0006"), Wizard.Data.SystemText.Get("ErrorHeader_0006")); - } - - public override void GotoBattle() - { - base.GotoBattle(); - RoomConnectController.IsAlreadyStartBattle = true; - } - - private void OnPushErrorDialogButton(UIManager.ViewScene scene) - { - bool matchingDataReady = GetMatchingDataReady(); - if (!matchingDataReady && isOffViewAllEnable) - { - UIManager.GetInstance().OffViewAll(); - } - ToolboxGame.DestroyNetworkAgent(); - if (matchingDataReady && GameMgr.GetIns().GetBattleCtrl() != null) - { - UIManager.GetInstance().StartCoroutine(BattleEndCoroutin(delegate - { - UIManager.GetInstance().ChangeViewScene(scene); - })); - } - else - { - UIManager.GetInstance().ChangeViewScene(scene); - } - } - - private void OpenErrorDialog(int errorCode, UIManager.ViewScene scene) - { - DialogBase dialogBase = CreateDialogBase(); - Dialog.Setup(dialogBase, errorCode.ToString()); - dialogBase.SetPanelDepth(5400); - dialogBase.onPushButton1 = delegate - { - OnPushErrorDialogButton(scene); - }; - _matchingTimeCheker.Stop(); - } -} diff --git a/SVSim.BattleEngine/Engine/Matching_TwoPick.cs b/SVSim.BattleEngine/Engine/Matching_TwoPick.cs deleted file mode 100644 index cc6886a4..00000000 --- a/SVSim.BattleEngine/Engine/Matching_TwoPick.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using Cute; -using Wizard; -using Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class Matching_TwoPick : Matching -{ - public Matching_TwoPick() - { - errorDialogReturnText = Data.SystemText.Get("Battle_0429"); - } - - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, need_init, log); - TwoPickDoMatchingTask twoPickDoMatchingTask = new TwoPickDoMatchingTask(); - twoPickDoMatchingTask.SetParameter(selectDeckID, need_init, (int)log); - ConnectAPI(twoPickDoMatchingTask, delegate - { - if (Data.DoMatchingDetail.data.matchingState != 3009) - { - DoMatchingResultSetting(); - onFinished.Call(); - } - }); - } - - protected override void TimeOutMessageToRetry() - { - ErrorDialogWithRetry(Data.SystemText.Get("Battle_0461"), Data.SystemText.Get("Battle_0412")); - } - - public override FinishTaskBase GetBattleFinishTask() - { - return new TwoPickFinishBattleTask(); - } - - protected override void GotoDeckSelectScene() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.OnFinishChangeView = delegate - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.TwoPick, changeViewSceneParam); - } -} diff --git a/SVSim.BattleEngine/Engine/MecanimSceneBase.cs b/SVSim.BattleEngine/Engine/MecanimSceneBase.cs index 30414cce..e6aaf1d0 100644 --- a/SVSim.BattleEngine/Engine/MecanimSceneBase.cs +++ b/SVSim.BattleEngine/Engine/MecanimSceneBase.cs @@ -4,11 +4,6 @@ using UnityEngine; public class MecanimSceneBase : UIBase { - public const string SCENE_FIRST_START = "FirstStart"; - - public const string SCENE_OPEN = "Open"; - - public const string SCENE_CLOSE = "Close"; protected Animator m_animator; @@ -214,22 +209,4 @@ public class MecanimSceneBase : UIBase m_state.onMove(); } } - - protected void CreateLoading(bool notBlack) - { - UIManager.GetInstance().createInSceneLoading(notBlack); - } - - protected void CloseLoading() - { - UIManager.GetInstance().closeInSceneLoading(); - } - - protected void onNotify(int value) - { - if ((bool)m_state) - { - m_state.onNotify(value); - } - } } diff --git a/SVSim.BattleEngine/Engine/Mission.cs b/SVSim.BattleEngine/Engine/Mission.cs index 9edc97c4..38c0fef8 100644 --- a/SVSim.BattleEngine/Engine/Mission.cs +++ b/SVSim.BattleEngine/Engine/Mission.cs @@ -13,10 +13,6 @@ public class Mission : UIBase BattlePassMission } - public const int ONE_DAY_HOURS = 24; - - public const double CAN_CHANGE_MISSION_CHECK_MARGIN_SECONDS = 10.0; - private static readonly Vector3 POS_SOLO_PLAY_MISSION_LABEL_CHANGE_ENABLE = new Vector3(990f, -31f, 0f); private static readonly Vector3 POS_SOLO_PLAY_MISSION_LABEL_CHANGE_DISABLE = new Vector3(990f, -21f, 0f); @@ -129,7 +125,7 @@ public class Mission : UIBase _btnTransitionBattlePass.onClick.Add(new EventDelegate(delegate { UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.BattlePass); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + })); UIEventListener uIEventListener = UIEventListener.Get(_soloPlayMissionEventListener.gameObject); uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate @@ -144,7 +140,7 @@ public class Mission : UIBase if (_currentViewTab != viewTab) { UpdateMissionView(viewTab); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } } @@ -154,13 +150,13 @@ public class Mission : UIBase string text; if (Data.MissionInfo.data._missionReceiveType == MissionInfoDetail.eMissionReceiveType.normal) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + receiveType = MissionInfoDetail.eMissionReceiveType.solo; text = Data.SystemText.Get("Mission_0083"); } else { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); + receiveType = MissionInfoDetail.eMissionReceiveType.normal; text = Data.SystemText.Get("Mission_0084"); } @@ -187,7 +183,7 @@ public class Mission : UIBase TimeSpan timeSpan = default(TimeSpan); if (!flag) { - timeSpan = TimeSpan.FromSeconds(Data.MissionInfo.data.WaitTimeCanChangeReceiveType - GameMgr.GetIns().GetMissionInfoTask().NowUnixTime()); + timeSpan = TimeSpan.FromSeconds(Data.MissionInfo.data.WaitTimeCanChangeReceiveType - 0L /* headless UI stub: no mission time */); flag = timeSpan.TotalSeconds < -10.0; } _soloPlayMssionChangeWaitTime.gameObject.SetActive(!flag); @@ -267,7 +263,7 @@ public class Mission : UIBase _soloPlayMissionToggleUI.gameObject.SetActive(value: true); SetMissionTypeToggleBtn(Data.MissionInfo.data._missionReceiveType); bool flag = Data.MissionInfo.data._isChangeMission; - long num = GameMgr.GetIns().GetMissionInfoTask().NowUnixTime(); + long num = 0L /* headless UI stub: no mission time */; TimeSpan timeSpan = TimeSpan.FromSeconds(Data.MissionInfo.data._canChangeMissionTime - num); if (!flag) { @@ -357,7 +353,7 @@ public class Mission : UIBase ReceiveButton.onClick.Clear(); ReceiveButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ReceiveAllAchievementRewards(); })); goAchievementWindowBase.SetActive(value: false); @@ -383,7 +379,7 @@ public class Mission : UIBase DateTime? dateTime = ConvertTime.GetDateTime(monthlyMission.EndDate); if (dateTime.HasValue) { - string remainingTime = ConvertTime.GetRemainingTime(ConvertTime.GetTimeSpan(GameMgr.GetIns().GetMissionInfoTask().NowUnixTime(), dateTime.Value)); + string remainingTime = ConvertTime.GetRemainingTime(ConvertTime.GetTimeSpan(0L /* headless UI stub: no mission time */, dateTime.Value)); _battlePassMontlyMissionPeriodLabel.text = remainingTime; _battlePassMontlyMissionPeriodLabel.fontSize = PERIOD_TEXT_SIZE_BIG; _battlePassMontlyMissionPeriodLabel.color = LabelDefine.TEXT_COLOR_ORANGE; diff --git a/SVSim.BattleEngine/Engine/MissionInfoDetail.cs b/SVSim.BattleEngine/Engine/MissionInfoDetail.cs index c399d7f3..18f03d28 100644 --- a/SVSim.BattleEngine/Engine/MissionInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/MissionInfoDetail.cs @@ -20,8 +20,6 @@ public class MissionInfoDetail public long _canChangeMissionTime; - private const string REWARDS = "total_receive_count_list"; - public BattlePassMonthlyMission BattlePassMonthlyMissionData { get; private set; } public eMissionReceiveType _missionReceiveType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/MotionUtils.cs b/SVSim.BattleEngine/Engine/MotionUtils.cs index 261d26f9..2fa4ac97 100644 --- a/SVSim.BattleEngine/Engine/MotionUtils.cs +++ b/SVSim.BattleEngine/Engine/MotionUtils.cs @@ -182,41 +182,6 @@ public class MotionUtils return array; } - public static Vector3[] GetCatmullRomSpline(Vector3[] p, int div, bool closed = false) - { - int num = p.Length; - List list = new List(); - List list2 = new List(); - if (closed) - { - list.Add(p[num - 1]); - list.AddRange(p); - list.Add(p[0]); - list.Add(p[1]); - num++; - } - else - { - list.Add(p[0]); - list.AddRange(p); - list.Add(p[num - 1]); - } - list2.Add(p[0]); - for (int i = 1; i < num; i++) - { - Vector3 vector = -1f * list[i - 1] + 3f * list[i] - 3f * list[i + 1] + 1f * list[i + 2]; - Vector3 vector2 = 2f * list[i - 1] - 5f * list[i] + 4f * list[i + 1] - 1f * list[i + 2]; - Vector3 vector3 = -1f * list[i - 1] + 0f * list[i] + 1f * list[i + 1] + 0f * list[i + 2]; - Vector3 vector4 = 0f * list[i - 1] + 2f * list[i] + 0f * list[i + 1] + 0f * list[i + 2]; - for (int j = 1; j <= div; j++) - { - float num2 = (float)j / (float)div; - list2.Add((vector * num2 * num2 * num2 + vector2 * num2 * num2 + vector3 * num2 + vector4) * 0.5f); - } - } - return list2.ToArray(); - } - public static void SetLayerAll(GameObject obj, int layer) { obj.layer = layer; @@ -269,33 +234,8 @@ public class MotionUtils } } - public static float GetAim(Vector2 p0, Vector2 p1) - { - float x = p1.x - p0.x; - return Mathf.Atan2(p1.y - p0.y, x) * 57.29578f - 90f; - } - - public static Quaternion GetAimRotation(Vector3 p0, Vector3 p1) - { - return Quaternion.FromToRotation(Vector3.up, p1 - p0); - } - - public static Vector2 GetPositionByAngle(float rot) - { - return new Vector2(Mathf.Cos(rot / 180f * (float)Math.PI), Mathf.Sin(rot / 180f * (float)Math.PI)); - } - public static float CalculateFrameRateIndependantDampingConstant(float smoothingAmount, float decayMultiplier) { return 1f - Mathf.Pow(smoothingAmount, Time.smoothDeltaTime * decayMultiplier); } - - public static int GetDigit(int value) - { - if (value == 0) - { - return 1; - } - return (int)Mathf.Log10(Mathf.Abs(value)) + 1; - } } diff --git a/SVSim.BattleEngine/Engine/MyPageBanner.cs b/SVSim.BattleEngine/Engine/MyPageBanner.cs index 111c2d36..aa5956f0 100644 --- a/SVSim.BattleEngine/Engine/MyPageBanner.cs +++ b/SVSim.BattleEngine/Engine/MyPageBanner.cs @@ -8,9 +8,7 @@ public class MyPageBanner : MyPageBannerBase { protected enum MoveSide { - Left, - Right - } +} [SerializeField] protected UICenterOnChild _uiCenterOnChild; @@ -27,15 +25,6 @@ public class MyPageBanner : MyPageBannerBase [SerializeField] protected GameObject _buttonBase; - [SerializeField] - protected GameObject _buttonLeftObject; - - [SerializeField] - protected GameObject _buttonRightObject; - - [SerializeField] - private GameObject _bgObject; - protected bool _isAnimation; protected bool _isCanSlide; @@ -48,59 +37,8 @@ public class MyPageBanner : MyPageBannerBase protected List _pagerSpriteList; - protected float _updateTimer; - protected GameObject _centerObject; - protected bool _isLeftButtonPressed; - - protected bool _isRightButtonPressed; - - private const int SLIDE_LIMIT_VALUE = 30; - - private const string PAGER_OFF_SPRITE_NAME = "carousel_marker_off"; - - private const string PAGER_ON_SPRITE_NAME = "carousel_marker_on"; - - private const string CSV_NAME = "banner"; - - private void Start() - { - UIEventListener.Get(_buttonLeftObject).onPress = LeftButtonOnPress; - UIEventListener.Get(_buttonRightObject).onPress = RightButtonOnPress; - } - - private void Update() - { - if (!base.IsCreateEnd) - { - return; - } - slideMoveUpdate(); - if (_bannerList.Count > 1 && _isCanSlide) - { - _updateTimer += Time.deltaTime; - float changeTime = _bannerList[_bannerNo]._changeTime; - if (_updateTimer >= changeTime) - { - SlideStartSetting(MoveSide.Right); - } - } - if (_isCanSlide) - { - if (_isLeftButtonPressed) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - SlideStartSetting(MoveSide.Left); - } - else if (_isRightButtonPressed) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - SlideStartSetting(MoveSide.Right); - } - } - } - protected override IEnumerator CreateBannerImage() { _bannerList = new List(Data.MyPage.data._bannerList); @@ -163,74 +101,6 @@ public class MyPageBanner : MyPageBannerBase } } - private void slideMoveUpdate() - { - if (!_isAnimation) - { - _isCanSlide = true; - } - if (_isClickStart && Input.GetMouseButton(0) && _isCanSlide) - { - if (Input.mousePosition.x < _touchPoint.x - 30f) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - SlideStartSetting(MoveSide.Right); - } - else if (Input.mousePosition.x > _touchPoint.x + 30f) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - SlideStartSetting(MoveSide.Left); - } - } - } - - protected void LeftButtonOnPress(GameObject inObject, bool isPressed) - { - _isLeftButtonPressed = isPressed; - _OnFinishedCenterChild(); - } - - protected void RightButtonOnPress(GameObject inObject, bool isPressed) - { - _isRightButtonPressed = isPressed; - _OnFinishedCenterChild(); - } - - protected void SlideStartSetting(MoveSide inMoveSide) - { - _isAnimation = true; - _isCanSlide = false; - _isClickStart = false; - _touchPoint = Input.mousePosition; - _updateTimer = 0f; - if (inMoveSide == MoveSide.Left) - { - _bannerNo = ((_bannerNo - 1 < 0) ? (_bannerList.Count - 1) : (_bannerNo - 1)); - } - else - { - _bannerNo = (_bannerNo + 1) % _bannerList.Count; - } - if (_bannerList.Count == 2) - { - GameObject gameObject = _uiWrapContent.transform.Find(_bannerNo.ToString()).gameObject; - Vector3 localPosition = _centerObject.transform.localPosition; - if (inMoveSide == MoveSide.Left) - { - localPosition.x -= _uiWrapContent.itemSize; - gameObject.transform.localPosition = localPosition; - } - else - { - localPosition.x += _uiWrapContent.itemSize; - gameObject.transform.localPosition = localPosition; - } - } - _centerObject = _uiWrapContent.transform.Find(_bannerNo.ToString()).gameObject; - _uiCenterOnChild.CenterOn(_centerObject.transform); - _PagerUpDate(); - } - protected void _OnInitializeItem(GameObject go, int wrapIndex, int realIndex) { int index = wrapIndex; @@ -281,14 +151,4 @@ public class MyPageBanner : MyPageBannerBase tweenScaleComponent.PlayReverse(); } } - - protected void OnDisable() - { - _isClickStart = false; - } - - public void SetChild(GameObject obj) - { - obj.transform.parent = _bgObject.transform; - } } diff --git a/SVSim.BattleEngine/Engine/MyPageBannerBase.cs b/SVSim.BattleEngine/Engine/MyPageBannerBase.cs index 165ee626..1708dd40 100644 --- a/SVSim.BattleEngine/Engine/MyPageBannerBase.cs +++ b/SVSim.BattleEngine/Engine/MyPageBannerBase.cs @@ -45,30 +45,6 @@ public abstract class MyPageBannerBase : MonoBehaviour { return ImageName.GetHashCode() ^ Click.GetHashCode() ^ Status.GetHashCode(); } - - public void Parse(JsonData json) - { - ImageName = json["image_name"].ToString(); - Click = json["click"].ToString(); - Status = json["status"].ToString(); - if (json.Keys.Contains("image_paths") && json["image_paths"] != null && json["image_paths"].Count != 0) - { - ImagePaths = new List(); - JsonData jsonData = json["image_paths"]; - for (int i = 0; i < jsonData.Count; i++) - { - ImagePaths.Add(jsonData[i].ToString()); - } - } - if (json.Keys.Contains("change_time")) - { - _changeTime = (float)json["change_time"].ToDouble(); - } - if (json.Keys.Contains("has_reward")) - { - NeedBadge = json["has_reward"].ToInt() == 1; - } - } } [SerializeField] @@ -92,10 +68,6 @@ public abstract class MyPageBannerBase : MonoBehaviour private Coroutine _createCoroutine; - private const int BANNER_IMAGE_DEPTH = 5; - - public bool IsCreateEnd => _isCreateEnd; - public bool _isFirstTips { private get; set; } public bool IsEnableBanner @@ -132,11 +104,6 @@ public abstract class MyPageBannerBase : MonoBehaviour } } - private void Start() - { - _loadAssetList = new List(); - } - public void Show() { if (!_isFirstTips) @@ -145,14 +112,6 @@ public abstract class MyPageBannerBase : MonoBehaviour } } - public void Hide() - { - if (!_isFirstTips) - { - base.gameObject.SetActive(value: false); - } - } - public void SetActive(bool inActive) { _isActive = inActive; @@ -195,11 +154,11 @@ public abstract class MyPageBannerBase : MonoBehaviour switch (click) { case "announce": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().WebViewHelper.OpenAnnounceWebView(status); return; case "colosseum": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OpenColosseumRound(); return; case "dialog_text": @@ -212,15 +171,15 @@ public abstract class MyPageBannerBase : MonoBehaviour OnClickBeginnerMission(); return; case "webview": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().WebViewHelper.OpenWebviewWithPageId(status); return; case "webview_limited": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().WebViewHelper.OpenWebViewDirectly(status, isLimited: true); return; case "battle_pass_buy": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + BattlePassPurchaseDialog.Create(); return; case "browser": @@ -235,20 +194,20 @@ public abstract class MyPageBannerBase : MonoBehaviour case "mypage_battle": if (MyPageMenu.Instance != null) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + MyPageMenu.Instance.ChangeMenu(2); } return; case "mypage_deck": if (MyPageMenu.Instance != null) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + MyPageMenu.Instance.ChangeMenu(4); MyPageMenu.Instance.GoToCardDeck(); } return; case "competition": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OnClickCompetitionBanner(); return; case "bingo": @@ -258,11 +217,11 @@ public abstract class MyPageBannerBase : MonoBehaviour OnClickTreasureBoxCpDialog(); return; case "red_ether": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.RedEtherCampaignLobby); return; case "ts_rotation_deck": - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DeckListUI.ChangeSceneToDeckList(Format.Rotation); return; case "account_transition_with_two": @@ -284,7 +243,7 @@ public abstract class MyPageBannerBase : MonoBehaviour { transitionData.Status = result; } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + SceneTransition.ChangeScene(transitionData, null); } } @@ -356,7 +315,7 @@ public abstract class MyPageBannerBase : MonoBehaviour } if (kind == "speed_challenge_clear") { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); dialogBase.SetTitleLabel(systemText.Get("SpeedChallenge_0001")); @@ -374,7 +333,7 @@ public abstract class MyPageBannerBase : MonoBehaviour component.SetTexture("banner_000764"); return; } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(); dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); dialogBase2.SetTitleLabel(systemText.Get("SpeedChallenge_0001")); @@ -479,50 +438,47 @@ public abstract class MyPageBannerBase : MonoBehaviour private void OnClickDeckIntroduction(string status, Format format) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + int seriesId = int.Parse(status); DeckIntroduction.Create(_deckIntroductionPrefab, MyPageMenu.Instance.HomeMenu.ContentsRoot, seriesId, format); } private static void OnClickTreasureBoxCpDialog() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + TreasureBoxCpDialog.CreateDialog(); } private static void OnClickIncentiveCampaign(int no) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - LotteryPage.ChangeSceneLotteryPage(no); + + // LotteryPage removed (DEAD-COLD engine cleanup Task 12) } private static void OnClickBingoEvent() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - BingoPage.ChangeSceneBingoPage(); + + // BingoPage removed (DEAD-COLD engine cleanup Task 12) } private static void OnClickBeginnerMission() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ChangeScene(UIManager.ViewScene.BeginnerMission); } private static void ChangeScene(UIManager.ViewScene scene) { - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(scene); - } - else - { - UIManager.GetInstance().ChangeViewScene(scene); - } + // Pre-Phase-5b: Battle scene routed through GameMgr.GetBattleCtrl().BattleEnd. BattleControl + // was stubbed in chunk 7 — its BattleEnd is a no-op that just invokes the callback. + // Fall straight through to the else branch; UIManager scene change is the only real + // side effect and it applies in either path. + UIManager.GetInstance().ChangeViewScene(scene); } private void OnClickDialogInfo(BannerInfo bannerInfo) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + List listBannerName = bannerInfo.ImagePaths; List listImagePaths = new List(); for (int i = 0; i < listBannerName.Count; i++) @@ -553,7 +509,7 @@ public abstract class MyPageBannerBase : MonoBehaviour private void OnClickDialog(BannerInfo bannerInfo) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + VoteDataTask voteDataTask = new VoteDataTask(); int voteId = int.Parse(bannerInfo.Status); voteDataTask.SetParameter(voteId); @@ -568,48 +524,16 @@ public abstract class MyPageBannerBase : MonoBehaviour { dialog.SetText(string.Format(Data.VoteInfo.after_content_text, Data.VoteInfo.vote_name)); } - else - { - GameMgr.GetIns().GetPrefabMgr().Load("UI/layoutParts/Dialog/DialogWinnerPost"); - GameObject gameObject = GameMgr.GetIns().GetPrefabMgr().Get("UI/layoutParts/Dialog/DialogWinnerPost"); - GameObject gameObject2 = gameObject.GetComponent().objs[1]; - Action OnFinishPost = delegate - { - dialog.Close(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetPanelDepth(0); - dialogBase.SetTitleLabel(Data.VoteInfo.title_text); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetFadeButtonEnabled(flag: true); - dialogBase.SetText(Data.SystemText.Get("Dia_Vote_002")); - }; - gameObject = NGUITools.AddChild(dialog.gameObject, gameObject); - NguiObjs component = gameObject.GetComponent(); - GameObject gameObject3 = component.objs[0]; - component.labels[0].text = Data.VoteInfo.before_content_text; - foreach (KeyValuePair item in Data.VoteInfo.vote_target_list) - { - GameObject postButton = UnityEngine.Object.Instantiate(gameObject2); - NguiObjs component2 = postButton.GetComponent(); - postButton.transform.parent = gameObject3.transform; - postButton.transform.localScale = gameObject2.transform.localScale; - postButton.name = item.Key.ToString(); - component2.labels[0].text = item.Value; - postButton.gameObject.SetActive(value: true); - component2.buttons[0].onClick.Add(new EventDelegate(delegate - { - OnSelectPost(voteId, postButton, OnFinishPost); - })); - } - gameObject3.GetComponent().ResetPosition(); - } + // Pre-Phase-5b: vote-not-yet path built a DialogWinnerPost prefab + attached per-target + // buttons via GetPrefabMgr. Purely UI dialog composition, unreachable headless. + // Stubbed to a no-op; the enclosing "already voted" branch above handles the display path + // that any surviving caller would render. })); } private static void OnClickDialogText(string status) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + SystemText systemText = Data.SystemText; DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); @@ -639,13 +563,6 @@ public abstract class MyPageBannerBase : MonoBehaviour dialogBase.SetOnClickUrl(); } - private static void OnClickLegendCrystal(string status) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SpecialCrystalDialog.SetDefaultOpenPage(status); - SpecialCrystalDialog.Create(UIManager.GetInstance().LegendCrystalBuyDialogPrefab, null, null, null); - } - private void OnSelectPost(int voteId, GameObject cardObject, Action callback) { int voteTargetId = int.Parse(cardObject.name); @@ -734,16 +651,4 @@ public abstract class MyPageBannerBase : MonoBehaviour dialogBase.SetText(systemText.Get("BeyondHandover_0011")); dialogBase.SetSize(DialogBase.Size.M); } - - protected void OnDestroy() - { - if (_loadAssetList != null && _loadAssetList.Count != 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadAssetList); - } - if (_createCoroutine != null) - { - UIManager.GetInstance().StopCoroutine(_createCoroutine); - } - } } diff --git a/SVSim.BattleEngine/Engine/MyPageBattleCampaign.cs b/SVSim.BattleEngine/Engine/MyPageBattleCampaign.cs index 2085daaa..06c27f31 100644 --- a/SVSim.BattleEngine/Engine/MyPageBattleCampaign.cs +++ b/SVSim.BattleEngine/Engine/MyPageBattleCampaign.cs @@ -22,20 +22,6 @@ public class MyPageBattleCampaign : MonoBehaviour [SerializeField] private UISprite _specialBoxSprite; - private const int SECONDS_PER_MINUTE = 60; - - private const string BOX_SPRITE_NAME = "box_campaign_"; - - private const int BOX_NONE_LABEL_WIDTH = 50; - - private const int BOX_LABEL_WIDTH = 150; - - private const float NORMAL_BOXROOT_ORIGIN_POSITION = -5.8f; - - private const float NORMAL_BOXROOT_POSITION = -90f; - - private float _updateTimer; - public IEnumerator Init() { base.gameObject.SetActive(value: false); @@ -74,32 +60,4 @@ public class MyPageBattleCampaign : MonoBehaviour base.gameObject.SetActive(value: false); } } - - public void RedrawAfterSpecialWinRewardOpened() - { - _ = Data.MyPageNotifications.data.CampaignBattleWin; - _specialBoxLabel.gameObject.SetActive(value: false); - _specialBoxSprite.gameObject.SetActive(value: false); - _boxRoot.transform.localPosition = new Vector3(-5.8f, _boxRoot.transform.localPosition.y, _boxRoot.transform.localPosition.z); - } - - private void Update() - { - if (Data.MyPage.data == null) - { - return; - } - _updateTimer -= Time.deltaTime; - if (_updateTimer < 0f) - { - CampaignBattleWin campaignBattleWin = Data.MyPageNotifications.data.CampaignBattleWin; - double num = Data.MyPage.data.ServerUnixTime + (double)Time.realtimeSinceStartup - (double)Data.MyPage.data.SinceTime; - _updateTimer = (float)(60.0 - num % 60.0); - if (num > (double)Data.MyPageNotifications.data.CampaignBattleWin.EndUnixTime) - { - campaignBattleWin.OnFinishCanpaignTime(); - base.gameObject.SetActive(value: false); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/MyPageCardDetail.cs b/SVSim.BattleEngine/Engine/MyPageCardDetail.cs deleted file mode 100644 index 2cc8dad7..00000000 --- a/SVSim.BattleEngine/Engine/MyPageCardDetail.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; -using UnityEngine; -using Wizard; - -public class MyPageCardDetail : MonoBehaviour -{ - private const float POSITION_Y = -88f; - - private const float CARD_ROTATION = 100f; - - private const float CARD_ROTATION_MIN_X = -65f; - - private const float CARD_ROTATION_MAX_X = 35f; - - private const float CARD_ROTATION_MIN_Y = -50f; - - private const float CARD_ROTATION_MAX_Y = 50f; - - [SerializeField] - private GameObject prefabCardDetailWindow; - - [SerializeField] - private GameObject m_CardObj; - - [SerializeField] - private UIEventListener m_TouchEventListener; - - [SerializeField] - private UIEventListener _touchColliderBG; - - private bool m_IsDrag; - - private Vector3 m_CardViewPortPoint = Vector3.zero; - - public MyPageMenu MyPageMenuClass; - - private int _cardId; - - public SimpleCardDetail CardDetailWindow { get; private set; } - - public bool IsCardObjRotateTween { get; private set; } - - private void Start() - { - CardDetailWindow = NGUITools.AddChild(base.gameObject, prefabCardDetailWindow).GetComponent(); - CardDetailWindow.SetLocalOffset(Vector3.up * -88f); - CardDetailWindow.ActiveCraftPanel(isActive: false); - CardDetailWindow.ActiveCloseCollider(isActive: false); - SetTouchEvent(); - } - - private void Update() - { - if (IsCardObjRotateTween && m_CardObj.transform.localEulerAngles.magnitude < 3f) - { - ResetAngleCardObj(); - IsCardObjRotateTween = false; - } - } - - public void UpdateCardData(int cardId) - { - _cardId = cardId; - if (CardDetailWindow != null && CardDetailWindow.IsVisible) - { - CardDetailWindow.ChangeDetail(_cardId, CardMaster.CardMasterId.Default); - } - } - - public void ResetAngleCardObj() - { - iTween.Stop(m_CardObj); - m_CardObj.transform.localEulerAngles = Vector3.zero; - } - - private void SetTouchEvent() - { - UIEventListener touchColliderBG = _touchColliderBG; - touchColliderBG.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(touchColliderBG.onClick, new UIEventListener.VoidDelegate(OnClickBG)); - UIEventListener touchEventListener = m_TouchEventListener; - touchEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(touchEventListener.onClick, new UIEventListener.VoidDelegate(OnClick)); - UIEventListener touchEventListener2 = m_TouchEventListener; - touchEventListener2.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(touchEventListener2.onDrag, new UIEventListener.VectorDelegate(OnDrag)); - UIEventListener touchEventListener3 = m_TouchEventListener; - touchEventListener3.onDragStart = (UIEventListener.VoidDelegate)Delegate.Combine(touchEventListener3.onDragStart, new UIEventListener.VoidDelegate(OnDragStart)); - UIEventListener touchEventListener4 = m_TouchEventListener; - touchEventListener4.onDragEnd = (UIEventListener.VoidDelegate)Delegate.Combine(touchEventListener4.onDragEnd, new UIEventListener.VoidDelegate(OnDragEnd)); - } - - private void OnClickBG(GameObject gameObj) - { - if (CardDetailWindow.IsVisible) - { - CardDetailWindow.HideDetail(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO_CANCEL); - MyPageMenuClass.ShowBanner(); - } - } - - private void OnClick(GameObject gameObj) - { - if (CardDetailWindow.IsVisible) - { - CardDetailWindow.HideDetail(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO_CANCEL); - MyPageMenuClass.ShowBanner(); - } - else - { - CardDetailWindow.ChangeDetail(_cardId, CardMaster.CardMasterId.Default); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO_SMALL); - MyPageMenuClass.HideBanner(); - } - } - - private void OnDrag(GameObject g, Vector2 delta) - { - if (m_IsDrag) - { - Vector3 vector = m_CardViewPortPoint - UICamera.currentCamera.ScreenToViewportPoint(UICamera.lastEventPosition); - Vector3 vector2 = new Vector3(0f - vector.y, vector.x, 0f) * 100f; - vector2 = new Vector3(Mathf.Clamp(vector2.x, -65f, 35f), Mathf.Clamp(vector2.y, -50f, 50f), 0f); - m_CardObj.transform.localEulerAngles = vector2; - } - } - - private void OnDragStart(GameObject gameObj) - { - iTween component = m_CardObj.GetComponent(); - if (null != component) - { - component.enabled = false; - } - m_CardViewPortPoint = UICamera.currentCamera.WorldToViewportPoint(m_CardObj.transform.position); - m_IsDrag = true; - } - - private void OnDragEnd(GameObject gameObj) - { - iTween component = m_CardObj.GetComponent(); - if (null != component) - { - component.enabled = true; - } - IsCardObjRotateTween = true; - iTween.RotateTo(m_CardObj, iTween.Hash("rotation", Vector3.zero, "islocal", true, "time", 0.5f)); - m_IsDrag = false; - } - - private void OnApplicationPause(bool paused) - { - if (!paused) - { - ResetAngleCardObj(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/MyPageCardPanel.cs b/SVSim.BattleEngine/Engine/MyPageCardPanel.cs index d340fb56..049628ce 100644 --- a/SVSim.BattleEngine/Engine/MyPageCardPanel.cs +++ b/SVSim.BattleEngine/Engine/MyPageCardPanel.cs @@ -5,14 +5,6 @@ using Wizard; public class MyPageCardPanel : MonoBehaviour { - [SerializeField] - private UITexture _texture; - - [SerializeField] - private string _filePath; - - [SerializeField] - private UILabel _titleLabel; [SerializeField] private GameObject _effect; @@ -30,12 +22,6 @@ public class MyPageCardPanel : MonoBehaviour private Vector3? _savedPosition; - public UITexture Texture => _texture; - - public string FilePath => _filePath; - - protected UILabel TitleLabel => _titleLabel; - public int Index { get; set; } public bool EffectActive @@ -49,29 +35,6 @@ public class MyPageCardPanel : MonoBehaviour } } - public NetworkDefine.MAINTENANCE_TYPE MaintenanceType - { - get - { - return maintenanceType; - } - set - { - enableMaintenanceCheck = true; - maintenanceType = value; - } - } - - public virtual string GetResourcePath(bool isfetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(FilePath, ResourcesManager.AssetLoadPathType.CardMenu, isfetch); - } - - public void AttachCardPanelTexture() - { - Texture.mainTexture = Toolbox.ResourcesManager.LoadObject(GetResourcePath(isfetch: true)) as Texture; - } - public virtual void CheckMaintenanceType() { if (!enableMaintenanceCheck) @@ -114,7 +77,7 @@ public class MyPageCardPanel : MonoBehaviour { if (_maintenancePlate == null) { - GameObject prefab = GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Menu/CardPanelMaintenancePlate"); + GameObject prefab = null; // Pre-Phase-5b: no PrefabMgr headless _maintenancePlate = NGUITools.AddChild(base.gameObject, prefab).GetComponent(); } _maintenancePlate.gameObject.SetActive(value: true); @@ -131,11 +94,6 @@ public class MyPageCardPanel : MonoBehaviour UIManager.SetObjectToGrey(base.gameObject, b: false); } - public void SetDisableForTutorial(bool isGrey) - { - UIManager.SetObjectToGrey(base.gameObject, isGrey); - } - public Vector3 SavePosition() { _savedPosition = base.transform.localPosition; @@ -146,11 +104,4 @@ public class MyPageCardPanel : MonoBehaviour { base.transform.localPosition = _savedPosition.Value; } - - public IEnumerator DisablePanel(string text) - { - ShowMaintenance(); - yield return null; - _maintenancePlate.SetText(text); - } } diff --git a/SVSim.BattleEngine/Engine/MyPageCardPanelAnimation.cs b/SVSim.BattleEngine/Engine/MyPageCardPanelAnimation.cs index 8e3b7de9..989e3fef 100644 --- a/SVSim.BattleEngine/Engine/MyPageCardPanelAnimation.cs +++ b/SVSim.BattleEngine/Engine/MyPageCardPanelAnimation.cs @@ -5,39 +5,9 @@ public class MyPageCardPanelAnimation : MonoBehaviour public enum State { Start, - Move, - Color, End } - private const float RANDOM_TIMER_RANGE = 0.3f; - - private const float ORIGINAL_POS_X = -22100f; - - private const float COLOR_TIME = 0.6f; - - private const float START_WAIT_TIMER = 0.05f; - - private static readonly float[] ANGLES_3 = new float[3] { 5f, 0f, -5f }; - - private static readonly float[] ANGLES_2 = new float[2] { 5f, -5f }; - - private static readonly float[] ANGLES_1 = new float[1]; - - private const float CARD_ORIGINAL_POS_X = -1000f; - - private const float CARD_DELAY_FACTOR = 0.03f; - - private const float CARD_TIME_MOTION = 0.0001f; - - private const float CARD_TIME_BASE = 0.2f; - - private const float CARD_TIME_FACTOR = 0.03f; - - private const float RANDOM_FACTOR = 5f; - - private const float ALPHA_FACTOR = 4f; - private float ClickRotateTimeTotal; private float ClickRotateTime; @@ -93,11 +63,6 @@ public class MyPageCardPanelAnimation : MonoBehaviour _defaultPosition = newPosition; } - public void PanelClear() - { - _panel = null; - } - private void InitializePanel() { if (_panel == null) @@ -128,115 +93,6 @@ public class MyPageCardPanelAnimation : MonoBehaviour } } - public void SkipMoveAnimation() - { - _state = State.End; - ColorChange(isForceOpacity: true); - } - - private void Update() - { - if (_panel != null) - { - UpdateCard(); - } - } - - private void UpdateCard() - { - float[] array = (new float[4][] { null, ANGLES_1, ANGLES_2, ANGLES_3 })[_cardPanel.Length]; - if (_panel == null) - { - return; - } - switch (_state) - { - case State.Start: - { - ClickRotateTime = 0f; - _timer += Time.deltaTime; - for (int k = 0; k < _cardPanel.Length; k++) - { - GameObject obj = _cardPanel[k]; - Vector3 localPosition = obj.transform.transform.localPosition; - localPosition.x = -1000f; - localPosition.y = _defaultPosition[k].y; - obj.transform.transform.localPosition = localPosition; - obj.transform.transform.localEulerAngles = new Vector3(0f, 0f, array[k]); - } - for (int l = 0; l < _cardPanel.Length; l++) - { - _panel[l].alpha = 0f; - } - if (_timer >= 0.05f) - { - _state++; - } - break; - } - case State.Move: - { - for (int j = 0; j < _cardPanel.Length; j++) - { - float x = _defaultPosition[j].x; - iTween.MoveTo(_cardPanel[j], iTween.Hash("x", x, "time", _isCutCardMotion ? 0.0001f : (0.2f + (float)j * 0.03f), "delay", (float)j * 0.03f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - if (!_isCutCardMotion) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SWITCH_MENU_CARD); - } - _state++; - break; - } - case State.Color: - _timer += Time.deltaTime; - ColorChange(); - if (_timer >= 0.6f) - { - ColorChange(isForceOpacity: true); - _state++; - _timer = 0f; - InitRandom(); - } - break; - case State.End: - { - for (int i = 0; i < _cardPanel.Length; i++) - { - float num = 0f; - if ((float)i == ClickIndex && ClickRotateTime > 0f) - { - ClickRotateTime -= Time.deltaTime; - if (ClickRotateTime < 0f) - { - ClickRotateTime = 0f; - _state = State.End; - } - float num2 = (ClickRotateTimeTotal - ClickRotateTime) / ClickRotateTimeTotal; - num2 -= 1f; - num2 = 0f - (num2 * num2 * num2 * num2 - 1f); - num = 720f * num2; - } - _randomTimer[i] += Time.deltaTime; - if (_randomTimer[i] >= 0f) - { - _cardPanel[i].transform.localEulerAngles = new Vector3(0f, num + (float)_randomDir[i] * 5f * Mathf.Sin(_randomTimer[i] / 2f), array[i] + (float)_randomDir[i] * Mathf.Sin(_randomTimer[i])); - } - } - break; - } - } - } - - public void SetCardPanelAngle() - { - float[] array = (new float[4][] { null, ANGLES_1, ANGLES_2, ANGLES_3 })[_cardPanel.Length]; - for (int i = 0; i < _cardPanel.Length; i++) - { - _cardPanel[i].transform.transform.localEulerAngles = new Vector3(0f, 0f, array[i]); - } - } - private void ColorChange(bool isForceOpacity = false) { if (_panel == null) @@ -269,7 +125,7 @@ public class MyPageCardPanelAnimation : MonoBehaviour ClickIndex = i; if (isPlaySe) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_MENU_CARD); + } } diff --git a/SVSim.BattleEngine/Engine/MyPageCenterCard.cs b/SVSim.BattleEngine/Engine/MyPageCenterCard.cs index ced619b7..2f4582ed 100644 --- a/SVSim.BattleEngine/Engine/MyPageCenterCard.cs +++ b/SVSim.BattleEngine/Engine/MyPageCenterCard.cs @@ -9,81 +9,9 @@ using Wizard; public class MyPageCenterCard : MonoBehaviour { - private const int CARD_VIEW_STATE_FIRST = 0; - - private const int CARD_VIEW_STATE_LOAD_WAIT = 1; - - private const int CARD_VIEW_STATE_CREATE_WAIT = 2; - - private const int CARD_VIEW_STATE_FINISH = 3; private readonly string CIRCLE_VIEW_LAYER_NAME = "MyPageCardList"; - private const float CARD_ROTATION_ANIM_ANGLE_Y = 90f; - - private const float CARD_ROTATION_ANIM_TIME = 1.5f; - - private const float TRANSITIONAL_BGM_DELAY_TIME = 0.5f; - - private readonly Vector3 CARD_SCALE_NORMAL = new Vector3(80f, 80f, 64f); - - private readonly Vector3 CARD_SCALE_BIG = new Vector3(100f, 100f, 64f); - - public GameObject CardOyaObj; - - public GameObject CardDetailOya; - - [SerializeField] - private GameObject CardDetailTweenObj; - - [SerializeField] - private MyPageCardDetail m_CardDetail; - - private List _cardList; - - private List _cardListAssetPath = new List(); - - private CardBasePrm.CharaType _currentCardType = CardBasePrm.CharaType.MAX; - - private GameObject _followerCardObj; - - private GameObject _spellCardObj; - - private GameObject _amuletCardObj; - - private Transform _followerTransform; - - private Transform _spellCardTransform; - - private Transform _amuletCardTransform; - - private UILabel _followerCostLabel; - - private UILabel _followerLifeLabel; - - private UILabel _followerAtkLabel; - - private UILabel _followerNameLabel; - - private UILabel _spellNameLabel; - - private UILabel _spellCostLabel; - - private UILabel _amuletNameLabel; - - private UILabel _amuletCostLabel; - - private GameObject _followerRotationOnlyIcon; - - private GameObject _spellRotationOnlyIcon; - - private GameObject _amuletRotationOnlyIcon; - - private bool _isAfterEvo; - - [SerializeField] - private MyPageCharaMenu cardMoveManager; - [SerializeField] private GameObject CameraCard; @@ -95,18 +23,6 @@ public class MyPageCenterCard : MonoBehaviour private int _circleCardLayer; - private IList _circleViewCardList = new List(); - - private int _scene = -1; - - private int _oldIndex; - - private int _previousCenterCardId = -1; - - private DeckGroupListData _deckGroupListData; - - public MyPageCardDetail CardDetail => m_CardDetail; - public bool CardLoadFinish => _cardViewState >= 2; private void Awake() @@ -114,14 +30,6 @@ public class MyPageCenterCard : MonoBehaviour _circleCardLayer = LayerMask.NameToLayer(CIRCLE_VIEW_LAYER_NAME); } - private void Start() - { - Vector3 localPosition = CardDetailTweenObj.transform.localPosition; - localPosition.y = 800f; - CardDetailTweenObj.transform.localPosition = localPosition; - SaveCameraFirstPosition(); - } - private void SaveCameraFirstPosition() { if (!_cameraPositionInitializeEnd) @@ -131,636 +39,10 @@ public class MyPageCenterCard : MonoBehaviour } } - private void initCard() - { - if (_cardList != null) - { - CardAllDelete(); - } - _cardList = UIManager.GetInstance().getCardListObjs(); - _isAfterEvo = false; - if (_followerCardObj != null) - { - UnityEngine.Object.Destroy(_followerCardObj.gameObject); - } - if (_spellCardObj != null) - { - UnityEngine.Object.Destroy(_spellCardObj.gameObject); - } - if (_amuletCardObj != null) - { - UnityEngine.Object.Destroy(_amuletCardObj.gameObject); - } - _scene = 0; - _previousCenterCardId = -1; - InstantiateCards(); - } - - private void InstantiateCards() - { - for (int i = 0; i < _cardList.Count; i++) - { - GameObject cardObj = _cardList[i].CardObj; - BoxCollider[] componentsInChildren = cardObj.GetComponentsInChildren(); - for (int j = 0; j < componentsInChildren.Length; j++) - { - componentsInChildren[j].enabled = false; - } - cardObj.transform.parent = CardOyaObj.transform; - cardObj.transform.localPosition = new Vector3(0f, 0f, 0f); - cardObj.transform.localPosition = MoveAngle(cardObj.transform.localPosition, i * (360 / _cardList.Count) + -90, 2650f); - cardObj.transform.LookAt(CardOyaObj.transform); - cardObj.SetActive(value: true); - } - SetCardTransform(); - _scene++; - } - - private IEnumerator DetailInit(int cardIndex = 0) - { - while (UIManager.GetInstance().getSelectCardListObjs() == null) - { - yield return null; - } - while (!CardLoadFinish) - { - yield return null; - } - while (MyPageMenu.Instance == null) - { - yield return null; - } - List selectCardListObjs = UIManager.GetInstance().getSelectCardListObjs(); - _cardListAssetPath.AddRange(Toolbox.ResourcesManager.CardListAssetPathList); - Toolbox.ResourcesManager.CardListAssetPathList.Clear(); - Material uIBaseSleeveTexture = UIManager.GetInstance().getUIBase_CardManager().GetUIBaseSleeveTexture(); - for (int i = 0; i < selectCardListObjs.Count; i++) - { - _currentCardType = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(selectCardListObjs[i].ids).CharType; - if (_amuletCardObj == null && (_currentCardType == CardBasePrm.CharaType.FIELD || _currentCardType == CardBasePrm.CharaType.CHANT_FIELD)) - { - CardInitAmulet(i, selectCardListObjs, uIBaseSleeveTexture); - } - if (_spellCardObj == null && _currentCardType == CardBasePrm.CharaType.SPELL) - { - CardInitSpell(i, selectCardListObjs, uIBaseSleeveTexture); - } - if (_followerCardObj == null && _currentCardType == CardBasePrm.CharaType.NORMAL) - { - CardInitFollower(i, selectCardListObjs, uIBaseSleeveTexture); - } - if (_followerCardObj != null && _spellCardObj != null && _amuletCardObj != null) - { - break; - } - } - for (int j = 0; j < selectCardListObjs.Count; j++) - { - UnityEngine.Object.Destroy(selectCardListObjs[j].CardObj); - selectCardListObjs[j] = null; - } - settingCard(cardIndex); - } - - private GameObject CardBaseInit(Transform card) - { - card.transform.localPosition = new Vector3(0f, 0f, 0f); - card.transform.localScale = new Vector3(510f, 510f, 200f); - card.transform.localEulerAngles = Vector3.zero; - Transform obj = card.Find("CardBase"); - obj.localPosition = Global.CARD_BASE_POS; - obj.localRotation = Quaternion.Euler(Global.CARD_BASE_ROT); - obj.localScale = new Vector3(1f, 1f, 1f); - Transform transform = card.Find("RotationOnlyIcon"); - if (transform != null) - { - return transform.gameObject; - } - GameObject prefab = Resources.Load("Prefab/CardDeco/RotationOnlyIcon") as GameObject; - return NGUITools.AddChild(card.gameObject, prefab); - } - - private void CardInitAmulet(int i, List detailCards, Material BaseTexture) - { - GameObject gameObject = null; - GameObject gameObject2 = null; - Material material = null; - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - Texture texture = null; - Texture texture2 = null; - _amuletCardObj = NGUITools.AddChild(CardDetailTweenObj, detailCards[i].CardObj.gameObject); - gameObject = _amuletCardObj; - gameObject.gameObject.SetActive(value: true); - gameObject.name = "AmmuletCard"; - _amuletCardTransform = gameObject.transform; - _amuletCostLabel = _amuletCardTransform.Find("Cost(Clone)/CostLabel").GetComponent(); - _amuletCardTransform.Find("Cost(Clone)").gameObject.SetActive(value: true); - _amuletNameLabel = _amuletCardTransform.Find("Name(Clone)/NameLabel").GetComponent(); - _amuletCardTransform.Find("Name(Clone)").gameObject.SetActive(value: true); - MeshRenderer component = _amuletCardTransform.Find("CardBase").GetComponent(); - component.material = BaseTexture; - component.material.SetFloat("_CullMode", 2f); - component.material.SetFloat("_ZWriteMode", 1f); - _amuletRotationOnlyIcon = CardBaseInit(_amuletCardTransform); - gameObject2 = _amuletCardTransform.Find("SpecularField").gameObject; - material = resourcesManager.LoadObject(resourcesManager.GetAssetTypePath("FieldCardFrameSpecularMat", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus, isfetch: true)); - texture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Field_a_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon, isfetch: true)); - texture2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Field_n_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon, isfetch: true)); - CardInitSpecular(gameObject2, material, texture, texture2); - } - - private void CardInitSpell(int i, List detailCards, Material BaseTexture) - { - GameObject gameObject = null; - GameObject gameObject2 = null; - Material material = null; - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - Texture texture = null; - Texture texture2 = null; - _spellCardObj = NGUITools.AddChild(CardDetailTweenObj, detailCards[i].CardObj.gameObject); - gameObject = _spellCardObj; - gameObject.gameObject.SetActive(value: true); - gameObject.name = "SpellCard"; - _spellCardTransform = gameObject.transform; - _spellCostLabel = _spellCardTransform.Find("Cost(Clone)/CostLabel").GetComponent(); - _spellCardTransform.Find("Cost(Clone)").gameObject.SetActive(value: true); - _spellNameLabel = _spellCardTransform.Find("Name(Clone)/NameLabel").GetComponent(); - _spellCardTransform.Find("Name(Clone)").gameObject.SetActive(value: true); - MeshRenderer component = _spellCardTransform.Find("CardBase").GetComponent(); - component.material = BaseTexture; - component.material.SetFloat("_CullMode", 2f); - component.material.SetFloat("_ZWriteMode", 1f); - _spellRotationOnlyIcon = CardBaseInit(_spellCardTransform); - gameObject2 = _spellCardTransform.Find("SpecularSpell").gameObject; - material = resourcesManager.LoadObject(resourcesManager.GetAssetTypePath("SpellCardFrameSpecularMat", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus, isfetch: true)); - texture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Spell_a_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon, isfetch: true)); - texture2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Spell_n_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon, isfetch: true)); - CardInitSpecular(gameObject2, material, texture, texture2); - } - - private void CardInitFollower(int i, List detailCards, Material BaseTexture) - { - GameObject gameObject = null; - GameObject gameObject2 = null; - Material material = null; - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - Texture texture = null; - Texture texture2 = null; - _followerCardObj = NGUITools.AddChild(CardDetailTweenObj, detailCards[i].CardObj.gameObject); - gameObject = _followerCardObj; - gameObject.gameObject.SetActive(value: true); - gameObject.name = "FollowerCard"; - _followerTransform = gameObject.transform; - _followerAtkLabel = _followerTransform.Find("Atk(Clone)/AtkLabel").GetComponent(); - _followerAtkLabel.gameObject.SetActive(value: true); - _followerTransform.Find("Atk(Clone)").gameObject.SetActive(value: true); - _followerLifeLabel = _followerTransform.Find("Life(Clone)/LifeLabel").GetComponent(); - _followerTransform.Find("Life(Clone)").gameObject.SetActive(value: true); - _followerCostLabel = _followerTransform.Find("Cost(Clone)/CostLabel").GetComponent(); - _followerTransform.Find("Cost(Clone)").gameObject.SetActive(value: true); - _followerNameLabel = _followerTransform.Find("Name(Clone)/NameLabel").GetComponent(); - _followerTransform.Find("Name(Clone)").gameObject.SetActive(value: true); - MeshRenderer component = _followerTransform.Find("CardBase").GetComponent(); - component.material = BaseTexture; - component.material.SetFloat("_CullMode", 2f); - component.material.SetFloat("_ZWriteMode", 1f); - _followerRotationOnlyIcon = CardBaseInit(_followerTransform); - gameObject2 = _followerTransform.Find("SpecularUnit").gameObject; - material = resourcesManager.LoadObject(resourcesManager.GetAssetTypePath("UnitCardFrameSpecularMat", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus, isfetch: true)); - texture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Unit_a_4", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon, isfetch: true)); - texture2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Unit_n_4", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon, isfetch: true)); - CardInitSpecular(gameObject2, material, texture, texture2); - } - - private void CardInitSpecular(GameObject specularObj, Material specularMaterial, Texture specularTexture0, Texture specularTexture1) - { - if (specularObj != null) - { - specularObj.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); - specularMaterial.shader = Shader.Find(specularMaterial.shader.name); - specularObj.GetComponent().material = specularMaterial; - specularObj.GetComponent().material.SetTexture("_AOREFSPEC", specularTexture0); - specularObj.GetComponent().material.SetTexture("_BumpMap", specularTexture1); - specularObj.SetActive(value: true); - specularObj.layer = 18; - } - } - - public bool canMyPageCardMove() - { - if (_followerCardObj == null && _spellCardObj == null && _amuletCardObj == null) - { - return false; - } - return true; - } - - public void UpdateSelectCard() - { - if (_scene == 1) - { - int nowSelIndex = cardMoveManager.getNowSelIndex(); - if (nowSelIndex > -1 && _oldIndex != nowSelIndex) - { - bool forceGraphicChange = IsAfterEvolution(_oldIndex); - _oldIndex = nowSelIndex; - settingCard(nowSelIndex, forceGraphicChange); - } - } - } - - private void settingCard(int nowIndex, bool forceGraphicChange = false) - { - if (nowIndex >= _cardList.Count) - { - return; - } - int ids = _cardList[nowIndex].ids; - if (_previousCenterCardId == ids && !forceGraphicChange) - { - return; - } - _previousCenterCardId = ids; - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(ids); - CardDetail.UpdateCardData(cardParameterFromId.NormalCardId); - _currentCardType = cardParameterFromId.CharType; - if (_currentCardType == CardBasePrm.CharaType.NORMAL) - { - _isAfterEvo = false; - _followerAtkLabel.text = _cardList[nowIndex].Atks; - _followerLifeLabel.text = _cardList[nowIndex].lifes; - _followerCostLabel.text = _cardList[nowIndex].Cost; - _followerNameLabel.text = _cardList[nowIndex].Names; - Global.SetRepositionNameLabel(_followerNameLabel, _cardList[nowIndex].Names, is2D: false); - _followerCardObj.gameObject.SetActive(value: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(_followerAtkLabel, _cardList[nowIndex].isPremiere); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(_followerCostLabel, _cardList[nowIndex].isPremiere); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(_followerLifeLabel, _cardList[nowIndex].isPremiere); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(_followerNameLabel, _cardList[nowIndex].isPremiere); - _followerCardObj.gameObject.SetActive(value: true); - if (_spellCardObj != null) - { - _spellCardObj.gameObject.SetActive(value: false); - } - if (_amuletCardObj != null) - { - _amuletCardObj.gameObject.SetActive(value: false); - } - _followerRotationOnlyIcon.SetActive(cardParameterFromId.IsResurgentCard); - } - else if (_currentCardType == CardBasePrm.CharaType.SPELL) - { - _spellNameLabel.text = _cardList[nowIndex].Names; - Global.SetRepositionNameLabel(_spellNameLabel, _cardList[nowIndex].Names, is2D: false); - _spellCostLabel.text = _cardList[nowIndex].Cost; - _spellCardObj.gameObject.SetActive(value: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(_spellCostLabel, _cardList[nowIndex].isPremiere); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(_spellNameLabel, _cardList[nowIndex].isPremiere); - _spellCardObj.gameObject.SetActive(value: true); - if (_followerCardObj != null) - { - _followerCardObj.gameObject.SetActive(value: false); - } - if (_amuletCardObj != null) - { - _amuletCardObj.gameObject.SetActive(value: false); - } - _spellRotationOnlyIcon.SetActive(cardParameterFromId.IsResurgentCard); - } - else if (_currentCardType == CardBasePrm.CharaType.FIELD || _currentCardType == CardBasePrm.CharaType.CHANT_FIELD) - { - _amuletNameLabel.text = _cardList[nowIndex].Names; - Global.SetRepositionNameLabel(_amuletNameLabel, _cardList[nowIndex].Names, is2D: false); - _amuletCostLabel.text = _cardList[nowIndex].Cost; - _amuletCardObj.gameObject.SetActive(value: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(_amuletCostLabel, _cardList[nowIndex].isPremiere); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(_amuletNameLabel, _cardList[nowIndex].isPremiere); - _amuletCardObj.gameObject.SetActive(value: true); - if (_followerCardObj != null) - { - _followerCardObj.gameObject.SetActive(value: false); - } - if (_spellCardObj != null) - { - _spellCardObj.gameObject.SetActive(value: false); - } - _amuletRotationOnlyIcon.SetActive(cardParameterFromId.IsResurgentCard); - } - Transform transform = _cardList[nowIndex].CardObj.transform; - GameObject gameObject = null; - LODGroup lODGroup = null; - LODGroup lODGroup2 = null; - switch (_currentCardType) - { - case CardBasePrm.CharaType.FIELD: - case CardBasePrm.CharaType.CHANT_FIELD: - gameObject = _amuletCardObj.gameObject; - lODGroup = transform.GetComponent(); - lODGroup2 = _amuletCardTransform.GetComponent(); - break; - case CardBasePrm.CharaType.NORMAL: - gameObject = _followerCardObj.gameObject; - lODGroup = transform.GetComponent(); - lODGroup2 = _followerTransform.GetComponent(); - break; - case CardBasePrm.CharaType.SPELL: - gameObject = _spellCardObj.gameObject; - lODGroup = transform.GetComponent(); - lODGroup2 = _spellCardTransform.GetComponent(); - break; - } - LOD[] lODs = lODGroup2.GetLODs(); - LOD[] lODs2 = lODGroup.GetLODs(); - int num = lODs.Length; - for (int i = 0; i < num; i++) - { - LOD lOD = lODs[i]; - LOD lOD2 = lODs2[i]; - lOD.renderers[0].sharedMaterials = lOD2.renderers[0].sharedMaterials; - } - gameObject.transform.localPosition = Vector3.zero; - } - - public void SetCardTransform() - { - for (int i = 0; i < _cardList.Count; i++) - { - float num = ((!(_cardList[i].CardObj.transform.position.z < -7.3f)) ? 0f : MotionUtils.GetEase(Mathf.Abs(_cardList[i].CardObj.transform.position.z + 7.3f), MotionUtils.EaseType.easeInExpo)); - _cardList[i].CardObj.transform.localPosition = new Vector3(_cardList[i].CardObj.transform.localPosition.x, 100f * num, _cardList[i].CardObj.transform.localPosition.z); - _cardList[i].CardObj.transform.localScale = CARD_SCALE_NORMAL + (CARD_SCALE_BIG - CARD_SCALE_NORMAL) * num; - } - } - - public void PlayCardRotationAnime(int index, bool isRightRotate) - { - StartCoroutine(RunCardRotationAnime(index, isRightRotate)); - } - - private IEnumerator RunCardRotationAnime(int index, bool isRightRotate) - { - CardDetail.ResetAngleCardObj(); - yield return null; - if (isRightRotate) - { - CardDetailTweenObj.transform.rotation = Quaternion.Euler(new Vector3(CardDetailTweenObj.transform.rotation.x, -90f, CardDetailTweenObj.transform.rotation.z)); - iTween.RotateTo(CardDetailTweenObj.gameObject, iTween.Hash("y", 0f, "time", 1.5f, "easetype", iTween.EaseType.easeOutExpo)); - } - else - { - CardDetailTweenObj.transform.rotation = Quaternion.Euler(new Vector3(CardDetailTweenObj.transform.rotation.x, 90f, CardDetailTweenObj.transform.rotation.z)); - iTween.RotateTo(CardDetailTweenObj.gameObject, iTween.Hash("y", 0f, "time", 1.5f, "easetype", iTween.EaseType.easeOutExpo)); - } - } - - public void ChangeEvoDisplay(int index) - { - if (isEvo(index) && index < _cardList.Count && index > -1) - { - LOD[] lODs = _followerTransform.GetComponent().GetLODs(); - Material[] materials = lODs[0].renderers[0].materials; - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(_cardList[index].ids); - if (!_isAfterEvo) - { - _isAfterEvo = true; - _followerCostLabel.text = _cardList[index].Evo_Costs; - _followerLifeLabel.text = _cardList[index].Evo_lifes; - _followerAtkLabel.text = _cardList[index].Evo_Atks; - _followerNameLabel.text = _cardList[index].Evo_Names; - materials[1] = Toolbox.ResourcesManager.FindCardMaterial(cardParameterFromId.ResourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial, isEvol: true); - } - else - { - _isAfterEvo = false; - _followerCostLabel.text = _cardList[index].Cost; - _followerLifeLabel.text = _cardList[index].lifes; - _followerAtkLabel.text = _cardList[index].Atks; - _followerNameLabel.text = _cardList[index].Names; - materials[1] = Toolbox.ResourcesManager.FindCardMaterial(cardParameterFromId.ResourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial); - } - materials[2] = CardCreatorBase.GetSharedClassIconMaterial(_cardList[index].clan); - LOD[] array = lODs; - for (int i = 0; i < array.Length; i++) - { - Renderer renderer = array[i].renderers[0]; - materials[0] = renderer.materials[0]; - renderer.sharedMaterials = materials; - } - } - } - - public bool IsAfterEvolution(int index) - { - return _isAfterEvo; - } - - public bool isEvo(int index) - { - if (_cardList == null || index >= _cardList.Count || index <= -1) - { - return false; - } - return _cardList[index].EvolOk; - } - - private Vector3 MoveAngle(Vector3 my, float angle, float speed) - { - float num = Mathf.Cos(angle * (float)Math.PI / 180f) * speed; - float num2 = Mathf.Sin(angle * (float)Math.PI / 180f) * speed; - return new Vector3(my.x + num, my.y, my.z + num2); - } - - public List getCardList() - { - return _cardList; - } - - private void OnDestroy() - { - CardAllDelete(); - } - - private void CardAllDelete() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_cardListAssetPath); - _cardListAssetPath.Clear(); - foreach (UIBase_CardManager.CardObjData card in _cardList) - { - UnityEngine.Object.Destroy(card.CardObj); - } - for (int i = 0; i < _cardList.Count; i++) - { - _cardList[i] = null; - } - _cardList = new List(); - UnityEngine.Object.Destroy(_followerCardObj); - _followerCardObj = null; - UnityEngine.Object.Destroy(_spellCardObj); - _spellCardObj = null; - } - public void MoveInCameraCard() { SaveCameraFirstPosition(); CameraCard.transform.localPosition = _cameraCardPos + Vector3.up * 2000f; iTween.MoveTo(CameraCard.gameObject, iTween.Hash("position", _cameraCardPos, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); } - - private DeckData GetLastBattleDeck(out Format format) - { - bool num = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.LAST_BATTLE_IS_DEFAULT_DECK_FOR_MYPAGE); - int lastDeckId = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_ID_FOR_MYPAGE); - Format format2 = (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_FORMAT_FOR_MYPAGE); - if (format2 == Format.Max || format2 == Format.Hof || format2 == Format.Avatar) - { - format2 = Format.Unlimited; - } - if (num) - { - format = Format.Max; - DeckData deckData = _deckGroupListData.GetDeckListByAttribute(DeckAttributeType.DefaultDeck).FirstOrDefault((DeckData deck) => deck.GetDeckID() == lastDeckId); - if (deckData != null) - { - return deckData; - } - int classOffsetId = lastDeckId + 90; - deckData = _deckGroupListData.GetDeckListByAttribute(DeckAttributeType.DefaultDeck).FirstOrDefault((DeckData deck) => deck.GetDeckID() == classOffsetId); - if (deckData != null) - { - return deckData; - } - } - else - { - format = format2; - List list = JsonMapper.ToObject>(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_CARD_LIST)); - long result; - bool flag = long.TryParse(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_SLEEVE_ID), out result); - bool flag2 = false; - if (list != null && list.Count == 40 && flag) - { - flag2 = true; - } - DeckData deckData2 = _deckGroupListData.GetDeckListByAttribute(DeckAttributeType.CustomDeck, format2).FirstOrDefault((DeckData deck) => deck.GetDeckID() == lastDeckId); - if (deckData2 != null && deckData2.IsDisplayable()) - { - if (flag2) - { - long.TryParse(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_DECK_SLEEVE_ID), out result); - list = UIManager.GetInstance().getUIBase_CardManager().SortIDList(list, CardMaster.CardMasterId.Default); - deckData2.SetCardIdList(list); - deckData2.SetDeckSleeveID(result); - deckData2.SetDeckIsComplete(isComplete: true); - } - return deckData2; - } - } - return null; - } - - public int GetDetailCardCount() - { - return _circleViewCardList.Count; - } - - private void Update() - { - switch (_cardViewState) - { - case 0: - { - UIManager.GetInstance().CreatFadeBlack(); - if (!UIManager.GetInstance().IsWizardSetupFinish() || _deckGroupListData == null) - { - break; - } - UIManager.GetInstance().Force_Increment_LockCountChangeView(); - _cardViewState++; - DeckData lastBattleDeck = GetLastBattleDeck(out var format); - if (lastBattleDeck != null) - { - UIManager.GetInstance().MyPageHomeCardLoadDeck(base.gameObject, lastBattleDeck, _circleCardLayer); - break; - } - lastBattleDeck = _deckGroupListData.GetDeckListByAttribute(DeckAttributeType.CustomDeck, format).FirstOrDefault(); - if (lastBattleDeck != null && lastBattleDeck.IsDisplayable()) - { - UIManager.GetInstance().MyPageHomeCardLoadDeck(base.gameObject, lastBattleDeck, _circleCardLayer); - } - else - { - UIManager.GetInstance().MyPageHomeCardLoadDeck(base.gameObject, _deckGroupListData.GetDeckListByAttribute(DeckAttributeType.DefaultDeck).First(), _circleCardLayer); - } - break; - } - case 1: - { - if (!UIManager.GetInstance().isCardCreatEnd()) - { - break; - } - _cardViewState++; - initCard(); - List cardListObjs = UIManager.GetInstance().getCardListObjs(); - _circleViewCardList = new List(); - bool flag = false; - bool flag2 = false; - bool flag3 = false; - for (int i = 0; i < cardListObjs.Count; i++) - { - CardBasePrm.CharaType charType = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardListObjs[i].ids).CharType; - if (!flag && charType == CardBasePrm.CharaType.SPELL) - { - _circleViewCardList.Add(cardListObjs[i].ids); - flag = true; - } - if (!flag2 && charType == CardBasePrm.CharaType.NORMAL) - { - _circleViewCardList.Add(cardListObjs[i].ids); - flag2 = true; - } - if (!flag3 && (charType == CardBasePrm.CharaType.FIELD || charType == CardBasePrm.CharaType.CHANT_FIELD)) - { - _circleViewCardList.Add(cardListObjs[i].ids); - flag3 = true; - } - if (flag2 && flag && flag3) - { - break; - } - } - UIManager.GetInstance().CardLoadSelect(base.gameObject, _circleViewCardList, _circleCardLayer, is2D: false, null, isDefaultSleeve: true); - break; - } - case 2: - if (UIManager.GetInstance().isCardCreatEnd()) - { - _cardViewState++; - UIManager.GetInstance().Force_Decrement_LockCountChangeView(); - StartCoroutine(DetailInit(cardMoveManager.getNowSelIndex())); - } - break; - } - } - - public void LoadDeckInfo(Action onFinish = null) - { - _deckGroupListData = null; - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Format.All); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _deckGroupListData = task.DeckGroupListData; - onFinish.Call(); - })); - } - - public void ReloadCardCircle() - { - if (_cardViewState == 3) - { - LoadDeckInfo(); - CardAllDelete(); - _cardViewState = 0; - } - } } diff --git a/SVSim.BattleEngine/Engine/MyPageCharaMenu.cs b/SVSim.BattleEngine/Engine/MyPageCharaMenu.cs index cf6f92b3..92e61511 100644 --- a/SVSim.BattleEngine/Engine/MyPageCharaMenu.cs +++ b/SVSim.BattleEngine/Engine/MyPageCharaMenu.cs @@ -18,353 +18,8 @@ public class MyPageCharaMenu : MonoBehaviour } } - private readonly Vector3 RIGHT_BASE_NO_CUSTOM_BG_POSITION = new Vector3(505f, 0f, -50f); - [SerializeField] private UIButton sinkaButton; - [SerializeField] - private UILabel labelSinkaButton; - - [SerializeField] - private UITexture originalTex; - - [SerializeField] - private GameObject texBase; - - private UITexture[] caharaTex; - - [SerializeField] - private GameObject _rightBase; - - private Vector3 _rightBaseDefaultPosition; - - private bool _isFirstCallOnEnable = true; - - [SerializeField] - private MyPageCenterCard cardManager; - - [SerializeField] - private GameObject CardMainObj; - - [SerializeField] - private UIScrollView scroll; - - [SerializeField] - private GameObject scrollColliderObj; - - [SerializeField] - private UICenterOnChild scrollCenterOnChild; - - private const float SCROLL_X_SIZE = 100f; - - private float _beforeCircleAngle; - - [SerializeField] - private float InitialSpeed = 22f; - - [SerializeField] - private float DecelerationBase = 3.5f; - - [SerializeField] - private float DecelerationAdd = 10f; - - [SerializeField] - private float DragSpeed = 2.1f; - - [SerializeField] - private float DragSpeed2 = 0.1f; - - private bool _isClockwise; - - private float _currentSpeed; - - private float _currentDeceleration; - - private bool _isOnEnable; - - private IList _dragInfoList; - - private int _currentIndex; - - private int _oldIndex = -1; - - private float _soundTimer; - - private bool _isFirstUpdate = true; - - private const string LABEL_BUTTON_EVO_TEXT = "Card_0030"; - - private const string LABEL_BUTTON_RETURN_TEXT = "Card_0067"; - - public bool IsForceActive { get; set; } - public UIButton EvolutionButton => sinkaButton; - - private void Start() - { - caharaTex = new UITexture[40]; - for (int i = 0; i < 40; i++) - { - caharaTex[i] = UnityEngine.Object.Instantiate(originalTex); - caharaTex[i].transform.parent = texBase.transform; - caharaTex[i].transform.localScale = new Vector3(0.35f, 0.35f, 1f); - caharaTex[i].transform.transform.localPosition = new Vector3((float)i * 100f, 0f, 0f); - caharaTex[i].gameObject.name = i.ToString(); - } - originalTex.gameObject.SetActive(value: false); - LoadCenterCardIndex(); - sinkaButton.onClick.Clear(); - sinkaButton.onClick.Add(new EventDelegate(delegate - { - if (!cardManager.CardDetail.IsCardObjRotateTween) - { - cardManager.ChangeEvoDisplay(_currentIndex); - cardManager.PlayCardRotationAnime(_currentIndex, cardManager.IsAfterEvolution(_currentIndex)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_MYPAGE_EVOLVE); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_MYPAGE_EVO_1); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_MYPAGE_EVO_1, new Vector3(0f, 0.3f, 0f)); - ChangeStateSinkaButton(_currentIndex); - } - })); - ChangeStateSinkaButton(_currentIndex); - if (_dragInfoList == null) - { - _dragInfoList = new List(); - } - UIEventListener uIEventListener = UIEventListener.Get(scrollColliderObj); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate - { - _currentSpeed = 0f; - }); - UIEventListener uIEventListener2 = UIEventListener.Get(scrollColliderObj); - uIEventListener2.onDragStart = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onDragStart, (UIEventListener.VoidDelegate)delegate - { - _dragInfoList.Clear(); - _dragInfoList.Add(new DragInfo(Time.time, GetLastTouchPos().x)); - }); - UIEventListener uIEventListener3 = UIEventListener.Get(scrollColliderObj); - uIEventListener3.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener3.onDrag, (UIEventListener.VectorDelegate)delegate(GameObject g, Vector2 delta) - { - if (_isClockwise == delta.x < 0f) - { - _dragInfoList.Add(new DragInfo(Time.time, GetLastTouchPos().x)); - } - else - { - _currentSpeed = 0f; - _isClockwise = !_isClockwise; - _dragInfoList.Clear(); - _dragInfoList.Add(new DragInfo(Time.time, GetLastTouchPos().x)); - } - }); - UIEventListener uIEventListener4 = UIEventListener.Get(scrollColliderObj); - uIEventListener4.onDragEnd = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onDragEnd, (UIEventListener.VoidDelegate)delegate - { - _dragInfoList.Add(new DragInfo(Time.time, GetLastTouchPos().x)); - int num = _dragInfoList.Count - 1; - _currentSpeed = 0f; - float num2 = Mathf.Abs(_dragInfoList[num].time - _dragInfoList[0].time); - if (!(num2 <= float.Epsilon)) - { - float num3 = Mathf.Abs(_dragInfoList[num].posX - _dragInfoList[0].posX); - if (!(num3 <= float.Epsilon)) - { - float num4 = num3 / num2; - if (!(num4 < DragSpeed)) - { - int num5 = 2; - if (num >= num5) - { - num2 = Mathf.Abs(_dragInfoList[num].time - _dragInfoList[num - num5].time); - if (num2 <= float.Epsilon) - { - return; - } - num3 = Mathf.Abs(_dragInfoList[num].posX - _dragInfoList[num - num5].posX); - if (num3 <= float.Epsilon) - { - return; - } - num4 = num3 / num2; - if (num4 < DragSpeed2) - { - return; - } - } - _currentSpeed = InitialSpeed * num4 * 0.1f; - _currentDeceleration = DecelerationBase; - } - } - } - }); - } - - private bool IsAbleUpdate() - { - if (!UIManager.GetInstance().getUIBase_CardManager().getCreateEndFlag()) - { - return false; - } - if (!MyPageMenu.Instance.IsCardLoadFinish) - { - return false; - } - if (!cardManager.canMyPageCardMove()) - { - return false; - } - return true; - } - - private void Update() - { - if (!IsAbleUpdate()) - { - return; - } - if (_isFirstUpdate) - { - _isFirstUpdate = false; - ScrollCenterOn(_currentIndex, 100f); - return; - } - if (_soundTimer > 0f) - { - _soundTimer -= Time.deltaTime; - } - if (_isOnEnable) - { - _isOnEnable = false; - ChangeStateSinkaButton(_currentIndex); - } - Vector3 localPosition = scroll.gameObject.transform.localPosition; - float num = -4000f; - float num2 = num / 360f; - float num3 = localPosition.x / num2; - float num4; - for (num4 = localPosition.x - 50f; num4 >= 0f; num4 += num) - { - } - while (num4 < num) - { - num4 -= num; - } - int num5 = (int)Mathf.Abs(num4 / 100f); - if (_oldIndex != num5) - { - if (!UIManager.GetInstance().isFading() && _soundTimer <= 0f) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_SCROLL); - _soundTimer = 0.1f; - } - _currentIndex = num5; - _oldIndex = _currentIndex; - cardManager.UpdateSelectCard(); - ChangeStateSinkaButton(_currentIndex); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_MYPAGE_EVO_1); - } - if (_beforeCircleAngle != num3) - { - _beforeCircleAngle = num3; - CardMainObj.transform.eulerAngles = new Vector3(0f, num3, 0f); - cardManager.SetCardTransform(); - } - if (_currentSpeed > 0f) - { - float deltaTime = Time.deltaTime; - _currentDeceleration += DecelerationAdd * deltaTime; - _currentSpeed -= _currentDeceleration * deltaTime; - if (_currentSpeed > 0f) - { - float num6 = _currentSpeed * deltaTime * (_isClockwise ? 1f : (-1f)); - num6 /= 10f; - scroll.Scroll(num6); - } - else - { - ScrollCenterOn(num5, 1f); - } - } - } - - private void ChangeStateSinkaButton(int index) - { - if (!cardManager.isEvo(index)) - { - sinkaButton.gameObject.SetActive(value: false); - return; - } - sinkaButton.gameObject.SetActive(value: true); - if (cardManager.IsAfterEvolution(index)) - { - labelSinkaButton.text = Data.SystemText.Get("Card_0067"); - } - else - { - labelSinkaButton.text = Data.SystemText.Get("Card_0030"); - } - } - - private void OnEnable() - { - if (_isFirstCallOnEnable) - { - _isFirstCallOnEnable = false; - _rightBaseDefaultPosition = _rightBase.transform.localPosition; - } - if (Data.Load.data.AcquiredMyPageBGList.Count == 0) - { - _rightBase.transform.localPosition = RIGHT_BASE_NO_CUSTOM_BG_POSITION; - } - else - { - _rightBase.transform.localPosition = _rightBaseDefaultPosition; - } - _currentSpeed = 0f; - _isOnEnable = true; - cardManager.CardDetail.ResetAngleCardObj(); - scrollColliderObj.SetActive(!IsForceActive); - } - - private void OnDisable() - { - if (!(cardManager.CardDetail.CardDetailWindow == null)) - { - cardManager.CardDetail.CardDetailWindow.HideDetail(); - } - } - - private void LoadCenterCardIndex() - { - _currentIndex = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.HOME_CENTER_CARD_INDEX); - } - - public void SaveCenterCardIndex() - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.HOME_CENTER_CARD_INDEX, _currentIndex); - } - - public int getNowSelIndex() - { - return _currentIndex; - } - - private Vector2 GetLastTouchPos() - { - return UICamera.currentCamera.ScreenToWorldPoint(UICamera.lastEventPosition); - } - - private void ScrollCenterOn(int index) - { - scrollCenterOnChild.CenterOn(caharaTex[index].transform); - } - - private void ScrollCenterOn(int index, float springStrength) - { - float springStrength2 = scrollCenterOnChild.springStrength; - scrollCenterOnChild.springStrength = springStrength; - scrollCenterOnChild.CenterOn(caharaTex[index].transform); - scrollCenterOnChild.springStrength = springStrength2; - } } diff --git a/SVSim.BattleEngine/Engine/MyPageHomeStatic.cs b/SVSim.BattleEngine/Engine/MyPageHomeStatic.cs index bc3580a3..4b9f48bf 100644 --- a/SVSim.BattleEngine/Engine/MyPageHomeStatic.cs +++ b/SVSim.BattleEngine/Engine/MyPageHomeStatic.cs @@ -9,15 +9,9 @@ public class MyPageHomeStatic : MonoBehaviour [SerializeField] private MyPageCharaMenu _charaMenu; - [SerializeField] - private MyPageCardDetail _cardDetail; - [SerializeField] private GameObject _contentsRoot; - [SerializeField] - private MyPageMenu _myPageMenu; - public bool CardLoadFinish => _centerCardMove.CardLoadFinish; public void SetActive(bool isActive) @@ -25,19 +19,6 @@ public class MyPageHomeStatic : MonoBehaviour _contentsRoot.SetActive(isActive); } - public void CenterCardCreateStart(Action onFinish) - { - _centerCardMove.LoadDeckInfo(onFinish); - } - - public void OnDestroy() - { - if (_charaMenu != null) - { - _charaMenu.SaveCenterCardIndex(); - } - } - public void Show() { _contentsRoot.SetActive(value: true); @@ -49,40 +30,13 @@ public class MyPageHomeStatic : MonoBehaviour _centerCardMove.MoveInCameraCard(); } - public void StartCardUpAnimation() - { - _centerCardMove.MoveInCameraCard(); - } - public void Hide() { _contentsRoot.SetActive(value: false); } - public int GetDetailCardCount() - { - return _centerCardMove.GetDetailCardCount(); - } - - public void Initialize() - { - _cardDetail.MyPageMenuClass = _myPageMenu; - } - public void SetTutorialMode() { UIManager.SetObjectToGrey(_charaMenu.EvolutionButton.gameObject, b: true); } - - public void FinishFirstTips() - { - bool activeSelf = _charaMenu.EvolutionButton.gameObject.activeSelf; - UIManager.SetObjectToGrey(_charaMenu.EvolutionButton.gameObject, b: false); - _charaMenu.EvolutionButton.gameObject.SetActive(activeSelf); - } - - public void ReloadCardCircle() - { - _centerCardMove.ReloadCardCircle(); - } } diff --git a/SVSim.BattleEngine/Engine/MyPageItem.cs b/SVSim.BattleEngine/Engine/MyPageItem.cs index 76d718ba..0741f4fd 100644 --- a/SVSim.BattleEngine/Engine/MyPageItem.cs +++ b/SVSim.BattleEngine/Engine/MyPageItem.cs @@ -5,17 +5,6 @@ using UnityEngine; public class MyPageItem : MonoBehaviour { - protected const float APPEAR_ANIMATION_DISTANCE_X = 1000f; - - protected const float APPEAR_ANIMATION_TIME = 0.3f; - - protected const float APPEAR_ANIMATION_DELAY = 0.1f; - - protected const float TWEEN_MOVE_TIME = 0.3f; - - protected const float TWEEN_DELAY_TIME = 0.1f; - - private const float CARD_PANEL_LEFT_X = -328f; [SerializeField] private MyPageCardPanelAnimation _cardMove; @@ -27,12 +16,8 @@ public class MyPageItem : MonoBehaviour private Dictionary _defaultPosition = new Dictionary(); - private bool _isAttachAtlasEnd; - private bool cardAnimationInitialized; - public MyPageCardPanel[] CardPanelList => _cardPanelList; - protected bool IsCardMoving { get @@ -53,11 +38,6 @@ public class MyPageItem : MonoBehaviour public bool IsEnableFooterCurrentMenu { get; set; } - public void SetCardPanelList(MyPageCardPanel[] myPageCardPanels) - { - _cardPanelList = myPageCardPanels; - } - public virtual void Initialize(MyPageMenu parent) { _parent = parent; @@ -93,15 +73,6 @@ public class MyPageItem : MonoBehaviour { } - public void AttachAtlas() - { - if (!_isAttachAtlasEnd) - { - _isAttachAtlasEnd = true; - UIManager.GetInstance().AttachAtlas(base.gameObject); - } - } - protected void StartCardPanelAppearAnimation() { if (_cardMove != null) @@ -178,12 +149,6 @@ public class MyPageItem : MonoBehaviour iTween.MoveTo(obj, iTween.Hash("x", x, "time", 0.3f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); } - protected void TweenMoveTo(GameObject obj, float x, float y) - { - RemoveITween(obj); - iTween.MoveTo(obj, iTween.Hash("x", x, "y", y, "time", 0.3f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - protected void MoveCardPanelLeftPosition(GameObject moveObj) { CardAnimation.StopMove(); @@ -220,12 +185,6 @@ public class MyPageItem : MonoBehaviour FadeUtility.FadeOutObject(tweenAlpha, onFinish); } - protected static void FadeInObject(UITweenAlpha tweenAlpha, Action onFinish = null) - { - tweenAlpha.End(); - FadeUtility.FadeInObject(tweenAlpha, onFinish); - } - protected void ResetAlphaAndRemoveTween(UISprite spriteObj) { UITweenAlpha component = spriteObj.GetComponent(); @@ -242,7 +201,7 @@ public class MyPageItem : MonoBehaviour { if (currentPlate == null) { - GameObject prefab = GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Menu/CardPanelMaintenancePlate"); + GameObject prefab = null; // Pre-Phase-5b: no PrefabMgr headless currentPlate = NGUITools.AddChild(button.gameObject, prefab).GetComponent(); currentPlate.SetDepth(buttonLabelDepth + 1); } @@ -278,37 +237,4 @@ public class MyPageItem : MonoBehaviour obj.transform.localPosition = _defaultPosition[obj.GetInstanceID()]; } } - - protected void ShowMenu(MyPageCardPanel selectedPanel, GameObject menuRoot, bool isAnimate) - { - int index = selectedPanel.Index; - selectedPanel.RestoreSavedPosition(); - MoveCardPanelLeftPosition(selectedPanel.gameObject); - if (isAnimate) - { - CardAnimation.OnClicked(index); - } - for (int i = 0; i < CardPanelList.Length; i++) - { - if (i == index) - { - continue; - } - MyPageCardPanel myPageCardPanel = CardPanelList[i]; - if (myPageCardPanel.gameObject.activeSelf) - { - if (isAnimate) - { - FadeOutCardPanelAndNonActive(myPageCardPanel); - } - else - { - myPageCardPanel.gameObject.SetActive(value: false); - } - } - } - menuRoot.SetActive(value: true); - RestoreDefaultPosition(menuRoot); - AppearAnimationFromRight(menuRoot); - } } diff --git a/SVSim.BattleEngine/Engine/MyPageItemArena.cs b/SVSim.BattleEngine/Engine/MyPageItemArena.cs deleted file mode 100644 index f88ae14d..00000000 --- a/SVSim.BattleEngine/Engine/MyPageItemArena.cs +++ /dev/null @@ -1,1280 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Convention; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.ErrorDialog; -using Wizard.RoomMatch; - -public class MyPageItemArena : MyPageItem -{ - private enum StartMenu - { - CARD_PANEL, - COLOSSEUM, - CONVENTION, - CHALLENGE, - GATHERING, - COMPETITION - } - - private enum CONVENTION_START_BUTTON - { - HOLDING, - ENTRY, - HISTORY - } - - private enum CONVENTION_JOING_BUTTON - { - JOING, - HISTORY - } - - private readonly Vector3 CARD_POS_LEFT = new Vector3(-203f, 0f, 0f); - - private readonly Vector3 CARD_POS_RIGHT = new Vector3(203f, 0f, 0f); - - private readonly Vector3 CARD_POS_3_LEFT = new Vector3(-367f, 0f, 0f); - - private readonly Vector3 CARD_POS_CENTER = new Vector3(0f, 20f, 0f); - - private readonly Vector3 CARD_POS_3_RIGHT = new Vector3(367f, 0f, 0f); - - private readonly Vector2 CARD_PANEL_LEFT_POS = new Vector2(-328f, 0f); - - private const int HEROES_SKIP_PAGE = 2; - - public const int ARENA_CONFIG_DIALOG_DEPTH = 100; - - private List _conventionMenuStartBackEvent; - - private List _panelResources = new List(); - - private bool _isSetConventionListMenuBackEvent; - - private const int GATHERING_CREATE_OLD_TIME_ERROR = 5317; - - private bool _goColosseumStartTask; - - private StartMenu _startMenu; - - private ConventionInfo _goConventionInfo; - - [SerializeField] - private UIButton _conventionRoomJoinButton; - - [SerializeField] - private UIButton _conventionRoomCreateButton; - - [SerializeField] - private UIButton _conventionDeckViewButton; - - [SerializeField] - private GameObject _conventionButtonBase; - - [SerializeField] - private GameObject cardPanelRoot; - - [SerializeField] - private GameObject conventionMenuRoot; - - [SerializeField] - private MyPageCardPanel _challengeCardPanel; - - [SerializeField] - public MyPageCardPanel _colosseumCardPanel; - - [SerializeField] - private MyPageCardPanel _conventionCardPanel; - - [SerializeField] - private MyPageCardPanel _competitonCardPanel; - - [SerializeField] - private MyPageBattleCampaign _battleCampaignClass; - - [SerializeField] - private GameObject _conventionBadge; - - [SerializeField] - private UIButton _challengeCardPanelButton; - - [SerializeField] - private GameObject _challengeMenuRoot; - - [SerializeField] - private ArenaConfigDialog _arenaConfigDialog; - - [SerializeField] - private GameObject _colosseumRoot; - - [SerializeField] - private GameObject _colosseumEntryRoot; - - [SerializeField] - private GameObject _competitionRoot; - - [SerializeField] - private GameObject _competitionEntryRoot; - - private bool _isPanelResourceLoaded; - - [SerializeField] - private GameObject _conventionModeSelectRoot; - - [SerializeField] - private UIButton _officialConventionButton; - - [SerializeField] - private GameObject _conventionSelectGatheringInviteBadge; - - [SerializeField] - private UIButton _gatheringButton; - - [SerializeField] - private GameObject _gatheringActionSelectRoot; - - [SerializeField] - private UIButton _gatheringCreateButton; - - [SerializeField] - private UIButton _gatheringEntryButton; - - [SerializeField] - private GameObject _gatheringRunnninRoot; - - [SerializeField] - private GameObject _gatheringRunningBadge; - - [SerializeField] - private UIButton _moveGatheringPageButton; - - [SerializeField] - private GameObject _gatheringCreateDialogPrefab; - - [SerializeField] - private GameObject _gatheringEntryBadge; - - private bool _isCompetitionEntry; - - [SerializeField] - private UILabel _conventionCardButtonTitle; - - [SerializeField] - private UILabel _conventionCardButtonSubTitle; - - [SerializeField] - private GameObject _deckEntryLimitRoot; - - [SerializeField] - private UILabel _deckEntryLimitLabel; - - [SerializeField] - private GameObject _gatheringEntryLimitRoot; - - [SerializeField] - private UILabel _gatheringEntryLimitLabel; - - [SerializeField] - private ConventionListUI _conventionListPrefab; - - private ConventionListUI _conventionList; - - private CardPanelMaintenancePlate _gatheringAllMaintenancePlate; - - private CardPanelMaintenancePlate _gatheringCreateMaintenancePlate; - - private MyPageMenu _myPageMenu; - - private bool _firstCompetitionInitialize; - - private bool IsEnableOfficialConvention - { - get - { - if (!Wizard.Data.MyPage.data._isJoinConvention) - { - return Wizard.Data.MyPage.data._isAdminWatcher; - } - return true; - } - } - - public override void Initialize(MyPageMenu parent) - { - _myPageMenu = parent; - cardPanelRoot.SetActive(value: true); - SaveDefaultPosition(_challengeMenuRoot); - SaveDefaultPosition(_colosseumRoot); - SaveDefaultPosition(_competitionRoot); - SaveDefaultPosition(_conventionButtonBase); - SaveDefaultPosition(_conventionModeSelectRoot); - SaveDefaultPosition(_gatheringActionSelectRoot); - SaveDefaultPosition(_gatheringRunnninRoot); - _colosseumCardPanel.GetComponent().MyPageFreeEntryIcon = _colosseumEntryRoot.GetComponent()._freeEntryIcon; - _gatheringEntryLimitRoot.SetActive(value: false); - } - - public void CardPanelInitialize() - { - ArenaCompetition competitionData = Wizard.Data.ArenaData.CompetitionData; - if (competitionData.IsCompetitionPeriod) - { - if (!_firstCompetitionInitialize) - { - _firstCompetitionInitialize = true; - _isCompetitionEntry = competitionData.IsEntry; - } - SetCardPanelList(new MyPageCardPanel[3] { _challengeCardPanel, _competitonCardPanel, _conventionCardPanel }); - CompetitionCardPanel competitionCardPanel = _competitonCardPanel.GetComponent(); - competitionCardPanel.IsEntry = competitionData.IsEntry; - _competitionEntryRoot.GetComponent().EntryAction = delegate - { - _isCompetitionEntry = true; - competitionCardPanel.IsEntry = _isCompetitionEntry; - competitionCardPanel.PanelImageUpdate(callEntryMenuUpdate: false); - }; - } - else if (Wizard.Data.ArenaData.ColosseumData.IsColosseumPeriod) - { - SetCardPanelList(new MyPageCardPanel[3] { _challengeCardPanel, _colosseumCardPanel, _conventionCardPanel }); - } - else - { - SetCardPanelList(new MyPageCardPanel[2] { _challengeCardPanel, _conventionCardPanel }); - } - base.Initialize(_myPageMenu); - } - - public override void Show(bool skipCardAnimation = false) - { - base.Show(skipCardAnimation); - if (_conventionList != null) - { - _conventionList.gameObject.SetActive(value: false); - } - conventionMenuRoot.SetActive(value: false); - _conventionCardPanel.gameObject.SetActive(value: false); - _competitionEntryRoot.gameObject.SetActive(value: false); - _conventionModeSelectRoot.gameObject.SetActive(value: false); - _gatheringActionSelectRoot.gameObject.SetActive(value: false); - _gatheringRunnninRoot.gameObject.SetActive(value: false); - _conventionBadge.gameObject.SetActive(value: false); - UIManager.GetInstance().StartCoroutine(ShowCoroutine()); - } - - private IEnumerator ShowCoroutine() - { - _challengeMenuRoot.SetActive(value: false); - _colosseumEntryRoot.SetActive(value: false); - _competitionEntryRoot.SetActive(value: false); - while (!MyPageMenu.IsMyPageRequestEnd) - { - yield return null; - } - CardPanelInitialize(); - while (UIManager.GetInstance().IsLocked()) - { - yield return null; - } - MyPageCardPanel[] cardPanelList; - if (!_isPanelResourceLoaded) - { - _isPanelResourceLoaded = true; - UIManager.GetInstance().createInSceneCenterLoading(); - cardPanelList = base.CardPanelList; - foreach (MyPageCardPanel myPageCardPanel in cardPanelList) - { - _panelResources.Add(myPageCardPanel.GetResourcePath(isfetch: false)); - } - yield return Toolbox.ResourcesManager.LoadAssetGroupSync(_panelResources, null); - cardPanelList = base.CardPanelList; - for (int i = 0; i < cardPanelList.Length; i++) - { - cardPanelList[i].AttachCardPanelTexture(); - } - UIManager.GetInstance().closeInSceneCenterLoading(); - } - cardPanelList = base.CardPanelList; - for (int i = 0; i < cardPanelList.Length; i++) - { - cardPanelList[i].gameObject.SetActive(value: false); - } - base.Show(); - if (!IsEnableOfficialConvention) - { - _conventionCardPanel.MaintenanceType = NetworkDefine.MAINTENANCE_TYPE.GATHERING_ALL; - } - _conventionButtonBase.SetActive(value: false); - StartMenu saveStartMenu = _startMenu; - if (_startMenu == StartMenu.CHALLENGE) - { - _startMenu = StartMenu.CARD_PANEL; - SetCardPanelAnimation(); - ShowChallengInfo(); - } - else if (_startMenu == StartMenu.COLOSSEUM) - { - _startMenu = StartMenu.CARD_PANEL; - UITweenAlpha component = _colosseumCardPanel.gameObject.GetComponent(); - if (component != null) - { - component.End(); - } - if (_goColosseumStartTask) - { - ColosseumEntryInfoTask task = new ColosseumEntryInfoTask(); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, ColosseumEntryInfoTaskSuccess)); - } - else - { - ColosseumEntryInfoTaskSuccess(NetworkTask.ResultCode.Success); - } - SetCardPanelAnimation(); - base.CardAnimation.SetCardPanelAngle(); - for (int j = 0; j < base.CardPanelList.Length; j++) - { - base.CardPanelList[j].gameObject.SetActive(value: false); - } - _colosseumCardPanel.gameObject.SetActive(value: true); - _colosseumCardPanel.gameObject.transform.localPosition = new Vector3(CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - _colosseumCardPanel.GetComponent().alpha = 0f; - MyPageItem.FadeInObject(_colosseumCardPanel.gameObject.AddMissingComponent(), delegate - { - _colosseumCardPanel.EffectActive = true; - }); - } - else if (_startMenu == StartMenu.CONVENTION) - { - _startMenu = StartMenu.CARD_PANEL; - ConventionInfoTask task2 = new ConventionInfoTask(); - Action callbackOnSuccess = delegate - { - if (_goConventionInfo == null) - { - ShowConventionListMenu(task2); - UpdateConventionCardPanelLabelOnConventionSelect(); - } - else - { - ShowConventionRoomMenu(task2, _goConventionInfo); - } - conventionMenuRoot.SetActive(value: true); - _conventionCardPanel.gameObject.SetActive(value: true); - TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - base.IsEnableFooterCurrentMenu = true; - base.Parent.SetBackButtonEnable(); - }; - yield return StartCoroutine(Toolbox.NetworkManager.Connect(task2, callbackOnSuccess)); - } - else if (_startMenu == StartMenu.GATHERING) - { - _startMenu = StartMenu.CARD_PANEL; - conventionMenuRoot.SetActive(value: true); - _conventionCardPanel.gameObject.SetActive(value: true); - base.IsEnableFooterCurrentMenu = true; - base.Parent.SetBackButtonEnable(); - if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsEntry) - { - ShowGatheringActiveMenu(); - } - else - { - ShowGatheringCreateOrEntry(); - } - base.CardAnimation.StopMove(); - TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - } - else if (_startMenu == StartMenu.COMPETITION) - { - _startMenu = StartMenu.CARD_PANEL; - CompetitionDirectShow(); - } - else - { - ShowCardPanel(); - _conventionCardPanel.GetComponent().onClick.Clear(); - _conventionCardPanel.GetComponent().onClick.Add(new EventDelegate(delegate - { - OnClickConventionCardPanel(); - })); - } - ShowGatheringBadge(); - Offline.IsConventionMode = false; - if (saveStartMenu != StartMenu.CONVENTION) - { - UpdateConventionCardPanelLabelOnConventionSelect(); - } - StartCoroutine(_battleCampaignClass.Init()); - } - - public void CompetitionShow() - { - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Competition_0006")); - } - - public void CompetitionDirectShow() - { - CompetitionShow(); - UITweenAlpha component = _competitonCardPanel.gameObject.GetComponent(); - if (component != null) - { - component.End(); - } - base.IsEnableFooterCurrentMenu = true; - base.Parent.SetBackButtonEnable(); - FadeOutCardPanelAndNonActive(_competitonCardPanel); - _competitionEntryRoot.SetActive(value: true); - RestoreDefaultPosition(_competitionRoot); - AppearAnimation(_competitionRoot); - MyPageMenu.Instance.SetDefaultBackButtonHandler(); - for (int i = 0; i < base.CardPanelList.Length; i++) - { - base.CardPanelList[i].gameObject.SetActive(value: false); - } - _competitonCardPanel.gameObject.SetActive(value: true); - RemoveITween(_competitonCardPanel.gameObject); - _competitonCardPanel.transform.localPosition = new Vector3(CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - _competitonCardPanel.GetComponent().alpha = 0f; - MyPageItem.FadeInObject(_competitonCardPanel.gameObject.AddMissingComponent(), delegate - { - _competitonCardPanel.EffectActive = true; - }); - } - - private void OnClickConventionCardPanel() - { - if (base.CardAnimation.IsCardMoving) - { - return; - } - if (Wizard.Data.MyPage.data._isAdminWatcher) - { - OnClickConventionCardPanelForAdmin(); - return; - } - conventionMenuRoot.SetActive(value: true); - base.Parent.SetDefaultBackButtonHandler(); - base.Parent.SetBackButtonEnable(); - base.IsEnableFooterCurrentMenu = true; - base.CardAnimation.OnClicked(_conventionCardPanel.Index); - _conventionCardPanel.GetComponent().onClick.Clear(); - AllClickEventClear(); - FadeOutCardPanelAndNonActive(_challengeCardPanel); - FadeOutCardPanelAndNonActive(_colosseumCardPanel); - FadeOutCardPanelAndNonActive(_competitonCardPanel); - TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - if (Wizard.Data.MyPage.data._isJoinConvention) - { - ShowConventionSelectMenu(); - } - else - { - OnClickGathering(playSe: false); - } - } - - private void ShowConventionSelectMenu() - { - FadeUtility.ShowSoon(_gatheringButton.gameObject); - FadeUtility.ShowSoon(_officialConventionButton.gameObject); - RestoreDefaultPosition(_conventionModeSelectRoot); - AppearAnimationFromRight(_conventionModeSelectRoot); - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("MyPage_0024")); - _conventionSelectGatheringInviteBadge.SetActive(Wizard.Data.MyPageNotifications.data.IsInviteGathering || Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification); - _gatheringButton.onClick.Clear(); - _gatheringButton.onClick.Add(new EventDelegate(delegate - { - OnClickGathering(playSe: true); - })); - _officialConventionButton.onClick.Clear(); - _officialConventionButton.onClick.Add(new EventDelegate(delegate - { - OnClickOfficialConvention(); - })); - bool isMaintenance = Wizard.Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_ALL); - _gatheringAllMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _gatheringButton, _gatheringAllMaintenancePlate, _gatheringButton.GetComponentInChildren().depth + 1); - } - - private void FadeOutConventionGatheringSelect() - { - FadeUtility.FadeOutObjectAndNonActive(_gatheringButton.gameObject); - FadeUtility.FadeOutObjectAndNonActive(_officialConventionButton.gameObject); - } - - public void ShowGatheringBadge() - { - _conventionBadge.SetActive(Wizard.Data.MyPageNotifications.data.IsInviteGathering || Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification); - _gatheringEntryBadge.SetActive(Wizard.Data.MyPageNotifications.data.IsInviteGathering); - _gatheringRunningBadge.SetActive(Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification); - } - - private void OnClickOfficialConvention() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - FadeOutConventionGatheringSelect(); - _conventionCardPanel.GetComponent().onClick.Clear(); - OnClickConventionCardButtonNew(); - } - - private void OnClickGathering(bool playSe) - { - if (playSe) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - } - base.IsEnableFooterCurrentMenu = true; - _gatheringButton.onClick.Clear(); - FadeOutConventionGatheringSelect(); - if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsEntry) - { - ShowGatheringActiveMenu(); - } - else - { - ShowGatheringCreateOrEntry(); - } - } - - private void ShowGatheringCreateOrEntry() - { - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Gathering_0002")); - _gatheringActionSelectRoot.SetActive(value: true); - RestoreDefaultPosition(_gatheringActionSelectRoot); - AppearAnimationFromRight(_gatheringActionSelectRoot); - FadeUtility.ShowSoon(_gatheringCreateButton.gameObject); - FadeUtility.ShowSoon(_gatheringEntryButton.gameObject); - _gatheringCreateButton.onClick.Clear(); - _gatheringCreateButton.onClick.Add(new EventDelegate(delegate - { - OnClickGatheringCreate(); - })); - _gatheringEntryButton.onClick.Clear(); - _gatheringEntryButton.onClick.Add(new EventDelegate(delegate - { - OnClickGatheringEntry(); - })); - bool isMaintenance = Wizard.Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_CREATE); - _gatheringCreateMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _gatheringCreateButton, _gatheringCreateMaintenancePlate, _gatheringCreateButton.GetComponentInChildren().depth + 1); - if (IsEnableOfficialConvention) - { - SetBackButtonHandler(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - FadeUtility.FadeOutObjectAndNonActive(_gatheringCreateButton.gameObject); - FadeUtility.FadeOutObjectAndNonActive(_gatheringEntryButton.gameObject); - ShowConventionSelectMenu(); - }); - } - else - { - base.Parent.SetDefaultBackButtonHandler(); - } - } - - private void ShowGatheringActiveMenu() - { - _gatheringRunnninRoot.SetActive(value: true); - RestoreDefaultPosition(_gatheringRunnninRoot); - AppearAnimationFromRight(_gatheringRunnninRoot); - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Gathering_0002")); - FadeUtility.ShowSoon(_moveGatheringPageButton.gameObject); - _moveGatheringPageButton.onClick.Clear(); - _moveGatheringPageButton.onClick.Add(new EventDelegate(delegate - { - OnClickMoveGatheringPageButton(); - })); - if (IsEnableOfficialConvention) - { - SetBackButtonHandler(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - FadeOutRunningGatheringActionMenu(); - ShowConventionSelectMenu(); - }); - } - } - - private void SetBackButtonHandler(Action onBackButton) - { - List originalBackEvent = new List(base.TopBar.BackButton.onClick); - base.TopBar.SetBackButtonEvent(null, UIManager.ViewScene.None, new EventDelegate(delegate - { - onBackButton(); - base.TopBar.BackButton.onClick = originalBackEvent; - })); - } - - private void FadeOutRunningGatheringActionMenu() - { - FadeUtility.FadeOutObjectAndNonActive(_moveGatheringPageButton.gameObject); - } - - private void OnClickMoveGatheringPageButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering); - } - - private void OnClickGatheringCreate() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GatheringCreateDialog.Create(_gatheringCreateDialogPrefab).OnDecideRule = OnDecideGatheringRule; - } - - private void OnDecideGatheringRule(GatheringRule rule) - { - if (rule.IsOwnerEntryBattle && rule.IsEntryDeckOnly) - { - ShowConfirmCreateDeck(rule); - } - else - { - CreateGathering(rule, null); - } - } - - private void ShowConfirmCreateDeck(GatheringRule rule) - { - SystemText systemText = Wizard.Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Gathering_0021")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("Gathering_0025")); - dialogBase.SetButtonText(systemText.Get("Gathering_0022")); - dialogBase.onPushButton1 = delegate - { - ShowDeckListDialog(rule); - }; - } - - private void ShowDeckListDialog(GatheringRule rule) - { - string deckListHeader = Wizard.Data.SystemText.Get("Gathering_0026"); - MultiDeckSelectDialog.Create(RoomConnectController.RuleSelectDeckCount(rule.BattleParameterInstance.Rule), rule.BattleParameterInstance.DeckFormat, deckListHeader).OnDecide = delegate(List deckList) - { - OnDecideGatheringDeck(deckList, rule); - }; - } - - private void OnDecideGatheringDeck(List deckList, GatheringRule rule) - { - CreateGathering(rule, deckList); - } - - private void CreateGathering(GatheringRule rule, List deckList) - { - if (rule.Type == GatheringRule.eType.FREE_BATTLE) - { - GatheringCreateTask gatheringCreateTask = new GatheringCreateTask(); - gatheringCreateTask.SetParameter(rule, deckList); - gatheringCreateTask.AddSkipCuteCheckResultCode(5317); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringCreateTask, delegate - { - OnSuccessCreateGathering(); - }, null, delegate(int errorCode) - { - OnCreateGatheringError(errorCode); - })); - } - else if (rule.Type == GatheringRule.eType.TOURNAMENT) - { - GatheringTornamentCreateTask gatheringTornamentCreateTask = new GatheringTornamentCreateTask(); - gatheringTornamentCreateTask.SetParameter(rule, deckList); - gatheringTornamentCreateTask.AddSkipCuteCheckResultCode(5317); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringTornamentCreateTask, delegate - { - OnSuccessCreateGathering(); - }, null, delegate(int errorCode) - { - OnCreateGatheringError(errorCode); - })); - } - else - { - Debug.LogError("大会方式が不正です " + rule.Type); - } - } - - private void OnCreateGatheringError(int errorCode) - { - if (errorCode == 5317) - { - Dialog.Create(errorCode).OnClose = delegate - { - GatheringCreateDialog.Create(_gatheringCreateDialogPrefab).OnDecideRule = OnDecideGatheringRule; - }; - } - } - - private void OnSuccessCreateGathering() - { - GatheringChat.ResetLatestReadChatMessageId(); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering); - } - - private void OnClickGatheringEntry() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering); - } - - private void UpdateConventionCardPanelLabelOnConventionSelect() - { - SystemText systemText = Wizard.Data.SystemText; - if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsEntry && Wizard.Data.MyPage.data._conventionBattleStartTime == null) - { - UpdateConventionCardPanelLabelGathering(); - return; - } - _gatheringEntryLimitRoot.SetActive(value: false); - if (Wizard.Data.MyPage.data._conventionBattleStartTime != null && !Wizard.Data.MyPage.data._isAdminWatcher) - { - _deckEntryLimitRoot.SetActive(value: true); - _deckEntryLimitLabel.text = systemText.Get("Arena_0070", Wizard.Data.MyPage.data._conventionBattleStartTime); - } - else - { - _deckEntryLimitRoot.SetActive(value: false); - } - if (Wizard.Data.MyPage.data._isAdminWatcher) - { - _conventionCardButtonTitle.text = systemText.Get("Arena_0128"); - _conventionCardButtonSubTitle.text = systemText.Get("Arena_0129"); - } - else - { - _conventionCardButtonTitle.text = systemText.Get("MyPage_0024"); - _conventionCardButtonSubTitle.text = systemText.Get("Arena_0127"); - } - } - - private void UpdateConventionCardPanelLabelGathering() - { - _deckEntryLimitRoot.SetActive(value: false); - _gatheringEntryLimitRoot.SetActive(value: true); - SystemText systemText = Wizard.Data.SystemText; - _conventionCardButtonTitle.text = systemText.Get("MyPage_0024"); - _conventionCardButtonSubTitle.text = systemText.Get("Arena_0127"); - if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsDeckEntry) - { - _gatheringEntryLimitLabel.text = systemText.Get("Gathering_0023", Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.DeckEntryFinishTime); - } - else if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsOpening) - { - _gatheringEntryLimitLabel.text = systemText.Get("Gathering_0032"); - } - else - { - _gatheringEntryLimitLabel.text = systemText.Get("Gathering_0024", Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.FinishTime); - } - if (Wizard.Data.MyPageNotifications.data.GatheringMyPageInfo.IsBattleFinish) - { - _gatheringEntryLimitRoot.SetActive(value: false); - } - } - - protected void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_panelResources); - _panelResources.Clear(); - } - - private void ShowCardPanel() - { - FadeUtility.RemoveFadeObject(_conventionCardPanel.gameObject); - FadeUtility.RemoveFadeObject(_colosseumCardPanel.gameObject); - FadeUtility.RemoveFadeObject(_challengeCardPanel.gameObject); - _colosseumCardPanel.GetComponent().SetIconDisplayPermission(isPermission: true); - UIButton component = _colosseumCardPanel.GetComponent(); - _challengeCardPanelButton.onClick.Clear(); - _challengeCardPanelButton.onClick.Add(new EventDelegate(delegate - { - OnClickChallengeCardPanel(); - })); - component.onClick.Clear(); - component.onClick.Add(new EventDelegate(delegate - { - OnClickColosseumCardButton(); - })); - _colosseumRoot.SetActive(value: false); - UIButton component2 = _competitonCardPanel.GetComponent(); - component2.onClick.Clear(); - component2.onClick.Add(new EventDelegate(delegate - { - OnClickCompetitionCardButton(); - })); - _competitionRoot.SetActive(value: false); - _conventionCardPanel.GetComponent().enabled = true; - _challengeMenuRoot.SetActive(value: false); - SetCardPanelAnimation(); - StartCardPanelAppearAnimation(); - } - - private void SetCardPanelAnimation() - { - for (int i = 0; i < base.CardPanelList.Length; i++) - { - MyPageCardPanel obj = base.CardPanelList[i]; - obj.gameObject.SetActive(value: true); - obj.EffectActive = false; - obj.EffectActive = true; - obj.CheckMaintenanceType(); - } - if (base.CardPanelList.Length == 2) - { - base.CardPanelList[0].transform.localPosition = CARD_POS_LEFT; - base.CardPanelList[1].transform.localPosition = CARD_POS_RIGHT; - } - else if (base.CardPanelList.Length == 3) - { - base.CardPanelList[0].transform.localPosition = CARD_POS_3_LEFT; - base.CardPanelList[1].transform.localPosition = CARD_POS_CENTER; - base.CardPanelList[2].transform.localPosition = CARD_POS_3_RIGHT; - } - List list = new List(); - for (int j = 0; j < base.CardPanelList.Length; j++) - { - MyPageCardPanel myPageCardPanel = base.CardPanelList[j]; - if (myPageCardPanel.isActiveAndEnabled) - { - list.Add(myPageCardPanel.gameObject); - } - } - SaveCardPanelDefaultPosition(); - base.CardAnimation.PanelClear(); - base.CardAnimation.SetCardPanelList(list.ToArray()); - base.CardAnimation.SetCardPanelAngle(); - } - - public void GoToColosseum(bool isColosseumTask) - { - _startMenu = StartMenu.COLOSSEUM; - _goColosseumStartTask = isColosseumTask; - AllClickEventClear(); - MyPageMenu.Instance.SetDefaultBackButtonHandler(); - base.CardAnimation.SkipMoveAnimation(); - } - - public void GoToCompetition() - { - _startMenu = StartMenu.COMPETITION; - AllClickEventClear(); - MyPageMenu.Instance.SetDefaultBackButtonHandler(); - base.CardAnimation.SkipMoveAnimation(); - UIManager.GetInstance().CheckFirstTips(CompetitionUtility.GetCompetitionTipsType(Wizard.Data.ArenaData.CompetitionData.Rule)); - } - - public void GoToConventionListMenu() - { - _startMenu = StartMenu.CONVENTION; - _goConventionInfo = null; - } - - public void GoToConventionActionMenu(ConventionInfo conventionInfo) - { - _startMenu = StartMenu.CONVENTION; - _goConventionInfo = conventionInfo; - } - - public void GoToGatheringMenu() - { - _startMenu = StartMenu.GATHERING; - _goConventionInfo = null; - } - - public void AppearAnimation(GameObject obj, string completeMessage = "") - { - obj.gameObject.SetActive(value: true); - iTween component = obj.gameObject.GetComponent(); - if (component != null) - { - UnityEngine.Object.Destroy(component); - } - Hashtable hashtable = new Hashtable(); - hashtable.Add("x", obj.transform.localPosition.x + 1000f); - hashtable.Add("time", 0.3f); - hashtable.Add("delay", 0.1f); - hashtable.Add("islocal", true); - hashtable.Add("easetype", iTween.EaseType.easeOutExpo); - if (completeMessage != "") - { - hashtable.Add("oncomplete", completeMessage); - hashtable.Add("oncompletetarget", _colosseumEntryRoot); - } - iTween.MoveFrom(obj, hashtable); - } - - private void OnClickColosseumCardButton() - { - AllClickEventClear(); - base.CardAnimation.OnClicked(_colosseumCardPanel.Index); - ColosseumEntryInfoTask task = new ColosseumEntryInfoTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, ColosseumEntryInfoTaskSuccess)); - } - - private void OnClickCompetitionCardButton() - { - AllClickEventClear(); - base.CardAnimation.OnClicked(_competitonCardPanel.Index); - CompetitionEntryInfo(); - } - - private void ColosseumEntryInfoTaskSuccess(NetworkTask.ResultCode inResult) - { - base.IsEnableFooterCurrentMenu = true; - _colosseumCardPanel.GetComponent().SetIconDisplayPermission(isPermission: false); - _colosseumEntryRoot.SetActive(value: true); - base.Parent.SetBackButtonEnable(); - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Colosseum_0001")); - TweenMoveTo(_colosseumCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - _challengeCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_challengeCardPanel); - if (_conventionCardPanel.gameObject.activeSelf) - { - _conventionCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_conventionCardPanel); - } - RestoreDefaultPosition(_colosseumRoot); - if (Wizard.Data.ArenaData.ColosseumData.IsDeckDeleted) - { - AppearAnimation(_colosseumRoot, "ColosseumDeckDeletedDialogMessageReceiver"); - } - else - { - AppearAnimation(_colosseumRoot); - } - _colosseumCardPanel.GetComponent().NowUpdate(); - MyPageMenu.Instance.SetDefaultBackButtonHandler(); - if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.Avatar) - { - CheckFirstTips(FirstTips.TipsType.HeroesGrandPrix, Wizard.Data.ArenaData.ColosseumData); - } - else if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.WindFall) - { - CheckFirstTips(FirstTips.TipsType.ColosseumWindFall, Wizard.Data.ArenaData.ColosseumData); - } - else if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.TwoPickChaos) - { - CheckFirstTips(FirstTips.TipsType.Colosseum2PickChaos, Wizard.Data.ArenaData.ColosseumData); - } - else - { - CheckFirstTips(FirstTips.TipsType.Colosseum, Wizard.Data.ArenaData.ColosseumData); - } - } - - private void CheckFirstTips(FirstTips.TipsType tipsType, ArenaColosseum colosseumData) - { - if (!FirstTips.IsFirstTipsOpen(tipsType) && (!colosseumData.NeedsFirstTips || colosseumData.ColosseumId <= PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.FIRST_TIPS_COLOSSEUM_ID))) - { - return; - } - int startPage = 0; - if (Wizard.Data.ArenaData.ColosseumData.Rule == ArenaColosseum.eRule.Avatar) - { - if (!FirstTips.IsFirstTipsOpen(FirstTips.TipsType.HeroesFreeMatch)) - { - startPage = 2; - } - FirstTips.SaveFinishFirstTips(FirstTips.TipsType.HeroesFreeMatch); - } - UIManager.GetInstance().StartFirstTips(tipsType, null, startPage, Wizard.Data.ArenaData.ColosseumData.ChaoseTipsId); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.FIRST_TIPS_COLOSSEUM_ID, colosseumData.ColosseumId); - } - - public void CompetitionEntryInfo() - { - base.IsEnableFooterCurrentMenu = true; - _competitionEntryRoot.SetActive(value: true); - base.Parent.SetBackButtonEnable(); - CompetitionShow(); - TweenMoveTo(_competitonCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - _challengeCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_challengeCardPanel); - _conventionCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_conventionCardPanel); - MyPageMenu.Instance.SetDefaultBackButtonHandler(); - AppearAnimation(_competitionRoot); - UIManager.GetInstance().CheckFirstTips(CompetitionUtility.GetCompetitionTipsType(Wizard.Data.ArenaData.CompetitionData.Rule)); - } - - private void SetFade(bool inDisp, GameObject inFadeObject, Action inFinishAction) - { - UITweenAlpha uITweenAlpha = inFadeObject.AddMissingComponent(); - uITweenAlpha._from = 0f; - uITweenAlpha._to = 1f; - uITweenAlpha._curve = AnimationCurve.Linear(0f, 0f, 1f, 1f); - uITweenAlpha._endTime = 0.1f; - if (inDisp) - { - uITweenAlpha._finishCallBack = delegate - { - inFadeObject.SetActive(value: true); - if (inFinishAction != null) - { - inFinishAction(); - } - }; - inFadeObject.SetActive(value: true); - uITweenAlpha.PlayForward(isReset: true); - return; - } - uITweenAlpha._finishCallBack = delegate - { - inFadeObject.SetActive(value: false); - if (inFinishAction != null) - { - inFinishAction(); - } - }; - uITweenAlpha.PlayReverse(isReset: true); - } - - private void DetailStart() - { - ColosseumEntry component = _colosseumEntryRoot.GetComponent(); - _challengeCardPanel.gameObject.SetActive(value: false); - _colosseumCardPanel.gameObject.SetActive(value: false); - _conventionCardPanel.gameObject.SetActive(value: false); - _colosseumRoot.SetActive(value: true); - _colosseumEntryRoot.SetActive(value: false); - component.OpenDetail(); - base.Parent.SetBackButtonEnable(); - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Colosseum_0001")); - } - - private void OnClickConventionCardPanelForAdmin() - { - IDInput.StartInputDialog(Wizard.Data.SystemText.Get("Arena_0130"), 5, OnDecideConventionId); - } - - private void OnDecideConventionId(string conventionId) - { - Action onDecide = delegate(string roomId) - { - OnDecideConventionWatch(conventionId, roomId); - }; - IDInput.StartInputDialog(Wizard.Data.SystemText.Get("RoomBattle_0006"), 5, onDecide); - } - - private void OnDecideConventionWatch(string conventionId, string roomId) - { - RoomConnectController.InitializeParameter initializeParameter = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.WATCHER, new BattleParameter(NetworkDefine.ServerBattleType.Free, Format.Max, TwoPickFormat.None, RoomConnectController.BattleRule.Bo1, isOpenDeckRoom: false), roomId); - ConventionInfo conventionInfo = new ConventionInfo(conventionId); - initializeParameter.ConventionInfo = conventionInfo; - StartCoroutine(base.Parent.BattleMenu.JoinRoom(initializeParameter, isInvite: false)); - } - - private void OnClickConventionCardButtonNew() - { - AllClickEventClear(); - FadeOutCardPanelAndNonActive(_challengeCardPanel); - FadeOutCardPanelAndNonActive(_colosseumCardPanel); - TweenMoveTo(_conventionCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - ConventionInfoTask task = new ConventionInfoTask(); - Action callbackOnSuccess = delegate - { - ShowConventionListMenu(task); - }; - StartCoroutine(Toolbox.NetworkManager.Connect(task, callbackOnSuccess)); - } - - private void ShowConventionListMenu(ConventionInfoTask task) - { - if (_conventionList != null) - { - UnityEngine.Object.Destroy(_conventionList.gameObject); - } - _conventionCardButtonTitle.text = Wizard.Data.SystemText.Get("MyPage_0024"); - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Gathering_0001")); - base.IsEnableFooterCurrentMenu = true; - _conventionList = NGUITools.AddChild(base.gameObject, _conventionListPrefab.gameObject).GetComponent(); - _conventionList.Show(task.OfflineConventionList); - AppearAnimationFromRight(_conventionList.gameObject); - _conventionList.OnSelect = delegate(ConventionInfo convention) - { - OnClickConvention(task, convention); - }; - if (_isSetConventionListMenuBackEvent) - { - return; - } - _isSetConventionListMenuBackEvent = true; - SetBackButtonHandler(delegate - { - _isSetConventionListMenuBackEvent = false; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (_conventionList != null) - { - UnityEngine.Object.Destroy(_conventionList.gameObject); - } - ShowConventionSelectMenu(); - }); - } - - private void OnClickConvention(ConventionInfoTask task, ConventionInfo convention) - { - if (convention.Status == ConventionInfo.ConventionStatus.GameStart) - { - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().CreatFadeOpen(); - ShowConventionRoomMenu(task, convention); - if (_conventionList != null) - { - _conventionList.Hide(); - } - }); - } - else - { - Offline.IsConventionMode = true; - DeckListUI.ChangeSceneToDeckList(convention.BattleParameterInstance.DeckFormat, null, convention); - } - } - - private void ShowConventionRoomMenu(ConventionInfoTask task, ConventionInfo data) - { - AllClickEventClear(); - Wizard.Data.CurrentFormat = data.BattleParameterInstance.DeckFormat; - SystemText systemText = Wizard.Data.SystemText; - base.TopBar.SetTitleLabel(systemText.Get("MyPage_0042") + " " + UIUtil.GetFormatName(data.BattleParameterInstance.DeckFormat)); - _conventionCardButtonTitle.text = systemText.Get("MyPage_0042"); - _conventionCardButtonSubTitle.text = systemText.Get("MyPage_0044"); - if (data.Status == ConventionInfo.ConventionStatus.DeckEntry) - { - _deckEntryLimitLabel.text = systemText.Get("Arena_0070", Wizard.Data.MyPage.data._conventionBattleStartTime); - _deckEntryLimitRoot.SetActive(value: true); - } - else - { - _deckEntryLimitRoot.SetActive(value: false); - } - _conventionButtonBase.SetActive(value: true); - _conventionCardPanel.GetComponent().onClick.Clear(); - RestoreDefaultPosition(_conventionButtonBase); - AppearAnimation(_conventionButtonBase); - GameObject[] array = new GameObject[3] { _conventionRoomCreateButton.gameObject, _conventionRoomJoinButton.gameObject, _conventionRoomJoinButton.gameObject }; - for (int i = 0; i < array.Length; i++) - { - array[i].SetActive(value: true); - ResetAlphaAndRemoveTween(array[i].GetComponent()); - } - _conventionRoomCreateButton.onClick.Clear(); - _conventionRoomCreateButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - RoomConnectController.InitializeParameter param = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.OWNER, data.BattleParameterInstance, "") - { - IsEnableTurnSelect = data.IsSelectableTurn, - ConventionInfo = data - }; - StartCoroutine(base.Parent.BattleMenu.JoinRoom(param, isInvite: false)); - })); - _conventionRoomJoinButton.onClick.Clear(); - _conventionRoomJoinButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - base.Parent.BattleMenu.StartRoomIDInput(isWatch: false, data); - })); - _conventionDeckViewButton.onClick.Clear(); - _conventionDeckViewButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - Offline.IsConventionMode = true; - DeckListUI.ChangeSceneToDeckList(data.BattleParameterInstance.DeckFormat, null, data); - })); - SetBackButtonHandler(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().CreatFadeOpen(); - ShowConventionListMenu(task); - UpdateConventionCardPanelLabelOnConventionSelect(); - _conventionButtonBase.SetActive(value: false); - }); - }); - } - - private void AllClickEventClear() - { - MyPageCardPanel[] cardPanelList = base.CardPanelList; - for (int i = 0; i < cardPanelList.Length; i++) - { - cardPanelList[i].GetComponent().onClick.Clear(); - } - } - - public void GoToChallengeMenu() - { - _startMenu = StartMenu.CHALLENGE; - } - - private void OnClickChallengeCardPanel() - { - if (!base.IsCardMoving) - { - AllClickEventClear(); - base.CardAnimation.OnClicked(_challengeCardPanel.Index); - ShowChallengInfo(); - } - } - - private void ShowChallengInfo() - { - base.IsEnableFooterCurrentMenu = true; - base.Parent.SetBackButtonEnable(); - base.TopBar.SetTitleLabel(Wizard.Data.SystemText.Get("Arena_NewMode")); - TweenMoveTo(_challengeCardPanel.gameObject, CARD_PANEL_LEFT_POS.x, CARD_PANEL_LEFT_POS.y); - if (_conventionCardPanel.gameObject.activeSelf) - { - _conventionCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_conventionCardPanel); - } - if (_competitonCardPanel.gameObject.activeSelf) - { - _competitonCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_competitonCardPanel); - } - if (_colosseumCardPanel.gameObject.activeSelf) - { - _colosseumCardPanel.EffectActive = false; - FadeOutCardPanelAndNonActive(_colosseumCardPanel); - } - RestoreDefaultPosition(_challengeMenuRoot); - AppearAnimation(_challengeMenuRoot); - MyPageMenu.Instance.SetDefaultBackButtonHandler(); - UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.Challenge); - } - - private void OnClickArenaConfigButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - CreateArenaConfigDialog(); - } - - private void CreateArenaConfigDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Colosseum_0120")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - ArenaConfigDialog arenaConfigDialog = UnityEngine.Object.Instantiate(_arenaConfigDialog); - arenaConfigDialog.Initialize(); - dialogBase.SetObj(arenaConfigDialog.gameObject); - dialogBase.SetPanelDepth(100); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - arenaConfigDialog.Final(); - }); - } - - public void RedrawBattleCampaign() - { - _battleCampaignClass.RedrawAfterSpecialWinRewardOpened(); - } -} diff --git a/SVSim.BattleEngine/Engine/MyPageItemBattle.cs b/SVSim.BattleEngine/Engine/MyPageItemBattle.cs index 8b549665..8172885f 100644 --- a/SVSim.BattleEngine/Engine/MyPageItemBattle.cs +++ b/SVSim.BattleEngine/Engine/MyPageItemBattle.cs @@ -101,20 +101,6 @@ public class MyPageItemBattle : MyPageItem } } - private const int FREE_MATCH_TOP_BUTTON_Y_NORMAL = 57; - - private const int FREE_MATCH_TOP_BUTTON_Y_PRE_ROTATION = 163; - - private readonly Vector3 RANK_ROTATION_POSITION_WITH_REWARD = new Vector3(215f, 106f, 0f); - - private readonly Vector3 RANK_UNLIMITED_POSITION_WITH_REWARD = new Vector3(215f, -44f, 0f); - - private const int CARD_INDEX_FREE_MATCH = 0; - - private const int CARD_INDEX_RANK_MATCH = 1; - - private const int CARD_INDEX_ROOM_MATCH = 2; - [SerializeField] private UIButton _freeMatchButton; @@ -561,7 +547,7 @@ public class MyPageItemBattle : MyPageItem private void OnClickFormatFreeMatch(Format type) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ShowMatchDeckSelect(type, DataMgr.BattleType.FreeBattle); } @@ -709,7 +695,7 @@ public class MyPageItemBattle : MyPageItem private void OnClickFormatRankMatch(Format format) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ShowMatchDeckSelect(format, DataMgr.BattleType.RankBattle); } @@ -744,7 +730,7 @@ public class MyPageItemBattle : MyPageItem private void OnClickWinReward() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + _rewardDetailCamera.SetActive(value: true); DialogBase obj = PurchaseRewardDialog.Create(GetWinnarRewardDialogData(), attachBottomObj: MyPageRewardDialogBoxCount.Create(_winRewardDialogBoxPrefab, Data.MyPageNotifications.data.CampaignBattleWin), cardDetail: _cardDetail, useLargeDetailDialog: true, layout: PurchaseRewardDialog.Layout.TITLE_BOTTOM, detailDialogTitleOverride: Data.SystemText.Get("Mission_0025")); obj.SetTitleLabel(Data.SystemText.Get("MyPage_0081")); @@ -757,7 +743,7 @@ public class MyPageItemBattle : MyPageItem private void OnClickSpecialWinReward() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + _rewardDetailCamera.SetActive(value: true); GetWinnarRewardDialogData(); GameObject obj = MyPageSpecialWinRewardDialog.Create(_specialWinRewardDialogBoxPrefab, base.Parent.GetNotTouchMypageCollider()); @@ -777,12 +763,12 @@ public class MyPageItemBattle : MyPageItem public void ShowMatchDeckSelect(Format format, DataMgr.BattleType battleType) { Data.CurrentFormat = format; - GameMgr.GetIns().GetDataMgr().m_BattleType = battleType; + // Pre-Phase-5b: set the ambient DataMgr.m_BattleType; UI-driven state, no headless effect. DeckInfoTask task = new DeckInfoTask(); task.SetParameter(format); UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate { - DeckSelectUIDialog.Create(DeckSelectUIDialog.GetTitleByBattleType(GameMgr.GetIns().GetDataMgr().m_BattleType), task.DeckGroupListData, format, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, delegate(DialogBase dialog, DeckData deckData) + DeckSelectUIDialog.Create(DeckSelectUIDialog.GetTitleByBattleType(battleType), task.DeckGroupListData, format, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, delegate(DialogBase dialog, DeckData deckData) { FreeAndRankMatchDeckSelectConfirmDialog.Create(dialog, deckData, isBattleEnd: false); }); @@ -854,13 +840,13 @@ public class MyPageItemBattle : MyPageItem _roomCreateButton.onClick.Add(new EventDelegate(delegate { SetRoomActionButtonEnable(isEnabled: false); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OnPushRoomCreateButton(isFadeOut: true); })); _roomJoinButton.onClick.Clear(); _roomJoinButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + if (base.Parent.IsEnableRoomInvite) { SetRoomActionButtonEnable(isEnabled: false); @@ -875,7 +861,7 @@ public class MyPageItemBattle : MyPageItem _roomWatchButton.onClick.Clear(); _roomWatchButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + StartRoomIDInput(isWatch: true); })); base.TopBar.SetTitleLabel(Data.SystemText.Get("RoomBattle_0001")); @@ -927,7 +913,7 @@ public class MyPageItemBattle : MyPageItem private void BackOnRoomCreateMenu(List tempBackButtonEvent) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + _roomCreateButton.gameObject.SetActive(value: true); UISprite roomCreateButtonSprite = _roomCreateButton.GetComponent(); ResetAlphaAndRemoveTween(roomCreateButtonSprite); @@ -981,7 +967,7 @@ public class MyPageItemBattle : MyPageItem _roomCreateNormalBattleButton.onClick.Clear(); _roomCreateNormalBattleButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OnClickRoomCreateNormalRule(); })); bool isMaintenance = false; @@ -995,7 +981,7 @@ public class MyPageItemBattle : MyPageItem _roomCreate2PickBattleButton.onClick.Clear(); _roomCreate2PickBattleButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OnClickRoomCreateTwoPick(); })); bool isMaintenance2 = false; @@ -1046,13 +1032,13 @@ public class MyPageItemBattle : MyPageItem _roomIdInputButtonInInvite.onClick.Clear(); _roomIdInputButtonInInvite.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + StartRoomIDInput(isWatch: false); })); _roomInviteReceiveButton.onClick.Clear(); _roomInviteReceiveButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + InviteGetListTask inviteGetListTask = new InviteGetListTask(); inviteGetListTask.SetParameter(); inviteGetListTask.SkipAllCuteResultCodeCheckErrorPopup(); @@ -1089,19 +1075,9 @@ public class MyPageItemBattle : MyPageItem _roomInput.InitInputID(5); } - public void SpecialWinRewardIconActive(bool active) - { - _rankMatchLayouts.SpecialWinRewardIcon.SetActive(active); - } - - public void RedrawBattleCampaign() - { - _battleCampaignClass.RedrawAfterSpecialWinRewardOpened(); - } - public IEnumerator JoinRoom(RoomConnectController.InitializeParameter param, bool isInvite) { - bool oldBackKeyEnable = GameMgr.GetIns().GetInputMgr().isBackKeyEnable; + bool oldBackKeyEnable = false; // Pre-Phase-5b: headless has no InputMgr base.TopBar.SetBackButtonEnable(enable: false); _isStopSendMyPageRefreshTask = true; yield return JoinRoomSub(param, isInvite); @@ -1112,7 +1088,7 @@ public class MyPageItemBattle : MyPageItem private IEnumerator JoinRoomSub(RoomConnectController.InitializeParameter param, bool isInvite) { UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle; + // Pre-Phase-5b: set the ambient DataMgr.m_BattleType for room battle. RoomConnectControllerInstance = new RoomConnectController(param); yield return UIManager.GetInstance().StartCoroutine(RoomConnectControllerInstance.StartConnect()); if (RoomConnectControllerInstance.ConnectRoomResultType == RoomConnectController.ConnectRoomResult.SUCCESS) @@ -1140,35 +1116,4 @@ public class MyPageItemBattle : MyPageItem Data.Load.data._receiveInviteCount = 0; } } - - public void GoToFreeMatch() - { - ShowCardPanelMenu(); - RestoreCardPanelPosition(); - MoveCardPanelLeftPosition(_freeMatchCardPanel.gameObject); - ShowFreeMatchFormatSelect(isPlaySe: true); - base.CardAnimation.SkipMoveAnimation(); - } - - public void GoToRoomMatch() - { - ShowCardPanelMenu(); - RestoreCardPanelPosition(); - MoveCardPanelLeftPosition(_cardPanelRoomMatch); - ShowRoomActionMenu(cutCardPanelAnimation: true); - base.CardAnimation.SkipMoveAnimation(); - } - - public bool IsStopSendMyPageRefreshTask() - { - if (!_isStopSendMyPageRefreshTask) - { - if (RoomConnectControllerInstance != null) - { - return RoomConnectControllerInstance.IsExistNodeErrorDialog(); - } - return false; - } - return true; - } } diff --git a/SVSim.BattleEngine/Engine/MyPageItemCard.cs b/SVSim.BattleEngine/Engine/MyPageItemCard.cs deleted file mode 100644 index 2f58367e..00000000 --- a/SVSim.BattleEngine/Engine/MyPageItemCard.cs +++ /dev/null @@ -1,371 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; - -public class MyPageItemCard : MyPageItem -{ - private enum DeckMenuType - { - Default, - WithDeckIntroduction, - CrossoverWithDeckIntroduction - } - - private readonly int DECK_MENU_TOP_BUTTON_POSITION_Y_PREROTATION = 145; - - private readonly int DECK_MENU_TOP_BUTTON_POSITION_Y = 49; - - [SerializeField] - private UIButton _deckButton; - - [SerializeField] - private UIButton _cardListButton; - - [SerializeField] - private GameObject _deckEditMenuRoot; - - [SerializeField] - private GameObject[] _deckEditMenuTypeRoots; - - [SerializeField] - private UIButton[] _deckUnlimitedButtons; - - [SerializeField] - private UIButton[] _deckRotationButtons; - - [SerializeField] - private UILabel[] _rotationPeriodLabel; - - [SerializeField] - private UIButton _deckPreRotationButton; - - [SerializeField] - private UIButton _deckCrossoverButton; - - [SerializeField] - private UIButton _deckMyRotationButton; - - [SerializeField] - private UIButton[] _deckIntroductionButtons; - - [SerializeField] - private GameObject _deckIntroductionPrefab; - - [SerializeField] - private Transform[] _firstTipsPositions; - - [SerializeField] - private UILabel _preReleaseTimeLimitLabel; - - private Effect _firstTipsEffect; - - private List _loadAssetList = new List(); - - private bool _tipsCrystalChanged; - - private DeckMenuType _deckMenuType; - - private const int CARD_INDEX_DECK = 0; - - private const int CARD_INDEX_CARD_LIST = 1; - - public override void Initialize(MyPageMenu parent) - { - base.Initialize(parent); - UIButton[] deckUnlimitedButtons = _deckUnlimitedButtons; - for (int i = 0; i < deckUnlimitedButtons.Length; i++) - { - deckUnlimitedButtons[i].onClick.Add(new EventDelegate(OnPushDeckEditUnlimited)); - } - deckUnlimitedButtons = _deckRotationButtons; - for (int i = 0; i < deckUnlimitedButtons.Length; i++) - { - deckUnlimitedButtons[i].onClick.Add(new EventDelegate(OnPushDeckEditRotation)); - } - deckUnlimitedButtons = _deckIntroductionButtons; - for (int i = 0; i < deckUnlimitedButtons.Length; i++) - { - deckUnlimitedButtons[i].onClick.Add(new EventDelegate(OnPushDeckIntroduction)); - } - _deckPreRotationButton.onClick.Add(new EventDelegate(OnClickDeckEditPreRotation)); - _deckCrossoverButton.onClick.Add(new EventDelegate(OnClickDeckEditCrossover)); - _deckMyRotationButton.onClick.Add(new EventDelegate(OnClickDeckEditMyRotation)); - InitializeRotationPeriodLabel(); - SaveDefaultPosition(_deckEditMenuRoot); - } - - public override void Show(bool skipCardAnimation = false) - { - base.Show(skipCardAnimation); - _deckEditMenuRoot.SetActive(value: false); - _deckCrossoverButton.gameObject.SetActive(IsEnableSpecialFormat(Format.Crossover)); - _deckMyRotationButton.gameObject.SetActive(IsEnableSpecialFormat(Format.MyRotation)); - _deckMenuType = GetDeckMenuType(); - SetupDeckMenuType(); - RestoreCardPanelPosition(); - StartCardPanelAppearAnimation(); - _deckButton.onClick.Clear(); - _deckButton.onClick.Add(new EventDelegate(delegate - { - OnPushDeckButton(); - })); - _cardListButton.onClick.Clear(); - _cardListButton.onClick.Add(new EventDelegate(delegate - { - OnPushCardListButton(); - })); - RestoreDefaultPosition(_deckEditMenuRoot); - switch (Prerelease.Status) - { - case Prerelease.eStatus.PRE_ROTATION: - _preReleaseTimeLimitLabel.text = Data.SystemText.Get("MyPage_0048", ConvertTime.ToLocal(Prerelease.Instance.EndTime)); - break; - case Prerelease.eStatus.DISPLAY_DECK_ONLY: - _preReleaseTimeLimitLabel.text = Data.SystemText.Get("MyPage_0070"); - break; - } - if (_deckMenuType == DeckMenuType.Default) - { - bool flag = Prerelease.Status != Prerelease.eStatus.NONE; - _deckPreRotationButton.gameObject.SetActive(flag); - int num = (flag ? DECK_MENU_TOP_BUTTON_POSITION_Y_PREROTATION : DECK_MENU_TOP_BUTTON_POSITION_Y); - UIButton[] deckRotationButtons = _deckRotationButtons; - foreach (UIButton obj in deckRotationButtons) - { - Vector3 localPosition = obj.transform.localPosition; - obj.transform.localPosition = new Vector3(localPosition.x, num, localPosition.z); - } - } - UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.Card); - } - - private void InitializeRotationPeriodLabel() - { - string shortName = Data.Master.CardSetNameMgr.Get(Data.Load.data.RotationFirstCardPackId.ToString()).ShortName; - string shortName2 = Data.Master.CardSetNameMgr.Get(Data.Load.data.RotationLatestCardPackId.ToString()).ShortName; - int num = Data.Load.data.RotationFirstCardPackId - 10000; - int num2 = Data.Load.data.RotationLatestCardPackId - 10000; - string text = Data.SystemText.Get("MyPage_0115", shortName, shortName2, num.ToString(), num2.ToString()); - UILabel[] rotationPeriodLabel = _rotationPeriodLabel; - for (int i = 0; i < rotationPeriodLabel.Length; i++) - { - rotationPeriodLabel[i].text = text; - } - } - - private void OnDisable() - { - if (_firstTipsEffect != null) - { - _firstTipsEffect.Stop(); - } - if (_tipsCrystalChanged) - { - _tipsCrystalChanged = false; - } - } - - private void OnPushDeckButton() - { - if (base.IsCardMoving) - { - return; - } - _deckMenuType = GetDeckMenuType(); - SetupDeckMenuType(); - base.Parent.SetDefaultBackButtonHandler(); - base.CardAnimation.OnClicked(0); - ShowDeckMenu(); - if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FIRST_TIPS_AFTER_ROTATION_USER_FLAG)) - { - if (FirstTips.IsFirstTipsOpen(FirstTips.TipsType.DeckAfterFormatUser)) - { - FirstTips.TipsType tipsType = FirstTips.TipsType.DeckAfterFormatUser; - FirstTips firstTips = UIManager.GetInstance().CheckFirstTips(tipsType); - if (firstTips != null) - { - firstTips.IsEnableBackKeyChange = false; - } - UIManager.SetObjectToGrey(base.TopBar.BuyCrystalButton.gameObject, b: true); - base.TopBar.BuyCrystalButton.isEnabled = false; - StartCoroutine(FirstTipsCoroutine(tipsType)); - FirstTips.SaveFinishFirstTips(FirstTips.TipsType.DeckBeforeFormatUser); - SetDeckTutorialMode(isTutorial: true); - } - } - else if (FirstTips.IsFirstTipsOpen(FirstTips.TipsType.DeckBeforeFormatUser)) - { - UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.DeckBeforeFormatUser); - } - _deckEditMenuRoot.SetActive(value: false); - _deckEditMenuRoot.SetActive(value: true); - } - - private IEnumerator FirstTipsCoroutine(FirstTips.TipsType type) - { - bool finishLoad = false; - _loadAssetList.AddRange(GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectTutorialData", isBattle: true, isField: false, isBattleEffect: false, delegate - { - finishLoad = true; - })); - while (FirstTips.IsFirstTipsOpen(type)) - { - yield return null; - } - while (!finishLoad) - { - yield return null; - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_Home_001_Title")); - dialogBase.SetText(Data.SystemText.Get("FirstTips_0035")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(3000); - dialogBase.OnClose = delegate - { - Vector3 pos = _firstTipsPositions[(int)_deckMenuType].TransformPoint(0f, 0f, 0f); - _firstTipsEffect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_TUTORIAL_TAP_1, pos, MyPageItemSoroPlay.EFFECT_ROTATION); - _firstTipsEffect.Play(pos, MyPageItemSoroPlay.EFFECT_ROTATION); - _firstTipsEffect.transform.parent = _firstTipsPositions[(int)_deckMenuType]; - }; - } - - private void SetDeckTutorialMode(bool isTutorial) - { - Footer footer = UIManager.GetInstance()._Footer; - for (int i = 0; i < footer._underButtons.Length; i++) - { - footer.SetButtonEnableColorChange(i, !isTutorial); - } - UIButton[] deckUnlimitedButtons = _deckUnlimitedButtons; - for (int j = 0; j < deckUnlimitedButtons.Length; j++) - { - UIManager.SetObjectToGrey(deckUnlimitedButtons[j].gameObject, isTutorial); - } - deckUnlimitedButtons = _deckIntroductionButtons; - for (int j = 0; j < deckUnlimitedButtons.Length; j++) - { - UIManager.SetObjectToGrey(deckUnlimitedButtons[j].gameObject, isTutorial); - } - UIManager.SetObjectToGrey(_deckPreRotationButton.gameObject, isTutorial); - UIManager.SetObjectToGrey(_deckCrossoverButton.gameObject, isTutorial); - UIManager.SetObjectToGrey(_deckMyRotationButton.gameObject, isTutorial); - base.TopBar.SetBackButtonEnable(!isTutorial); - } - - private void SetupDeckMenuType() - { - foreach (DeckMenuType value in Enum.GetValues(typeof(DeckMenuType))) - { - GameObject gameObject = _deckEditMenuTypeRoots[(int)value]; - if (!(gameObject == null)) - { - gameObject.SetActive(value == _deckMenuType); - } - } - } - - private bool IsEnableSpecialFormat(Format format) - { - if (!DeckListUI.CheckSpecialFormatPeriod(format)) - { - return false; - } - return DeckListUtility.DeckGroupDataBaseClone().Any((DeckGroup deckgroup) => deckgroup.DeckFormat == format); - } - - private DeckMenuType GetDeckMenuType() - { - if (Prerelease.Status != Prerelease.eStatus.NONE) - { - return DeckMenuType.Default; - } - if (IsEnableSpecialFormat(Format.Crossover) || IsEnableSpecialFormat(Format.MyRotation)) - { - return DeckMenuType.CrossoverWithDeckIntroduction; - } - if (!Data.MyPage.data._bannerList.Any((MyPageBannerBase.BannerInfo info) => info.Click == "deck_intro_rotation" || info.Click == "deck_intro_unlimited")) - { - return DeckMenuType.Default; - } - return DeckMenuType.WithDeckIntroduction; - } - - private void OnPushCardListButton() - { - if (!base.IsCardMoving) - { - base.CardAnimation.OnClicked(1); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.CardAllList); - } - } - - private void ShowDeckMenu() - { - base.IsEnableFooterCurrentMenu = true; - base.Parent.SetBackButtonEnable(); - _deckButton.onClick.Clear(); - base.TopBar.SetTitleLabel(Data.SystemText.Get("MyPage_0014")); - MoveCardPanelLeftPosition(_deckButton.gameObject); - FadeOutCardPanelAndNonActive(_cardListButton.GetComponent()); - _deckEditMenuRoot.SetActive(value: true); - AppearAnimationFromRight(_deckEditMenuRoot); - } - - private void OnPushDeckEditUnlimited() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckListUI.ChangeSceneToDeckList(Format.Unlimited); - } - - private void OnPushDeckEditRotation() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckListUI.ChangeSceneToDeckList(Format.Rotation); - if (_firstTipsEffect != null) - { - UnityEngine.Object.Destroy(_firstTipsEffect.gameObject); - } - } - - private void OnClickDeckEditPreRotation() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckListUI.ChangeSceneToDeckList(Format.PreRotation); - } - - private void OnClickDeckEditCrossover() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckListUI.ChangeSceneToDeckList(Format.Crossover); - } - - private void OnClickDeckEditMyRotation() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckListUI.ChangeSceneToDeckList(Format.MyRotation); - } - - private void OnPushDeckIntroduction() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckIntroduction.Create(_deckIntroductionPrefab, base.gameObject, -1, Format.Rotation); - } - - public void GoToCardDeck() - { - ShowDeckMenu(); - } - - private void OnDestroy() - { - if (_loadAssetList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadAssetList); - } - } -} diff --git a/SVSim.BattleEngine/Engine/MyPageItemHome.cs b/SVSim.BattleEngine/Engine/MyPageItemHome.cs index aeec28f6..32917502 100644 --- a/SVSim.BattleEngine/Engine/MyPageItemHome.cs +++ b/SVSim.BattleEngine/Engine/MyPageItemHome.cs @@ -9,20 +9,10 @@ public class MyPageItemHome : MyPageItem { private enum Notification { - Info, - Max - } - - private const string TEXTURE_ROOM_CAMPAIGN = "campaign_banner_mypage"; + Info } public static readonly Vector3 TUTORIAL_OFFSET_FOOTER = new Vector3(0f, 19f, 0f); - [SerializeField] - private GameObject _bannerPrefab; - - [SerializeField] - private GameObject _subBannerPrefab; - private GameObject _bannerObject; private GameObject _subBannerObject; @@ -54,9 +44,6 @@ public class MyPageItemHome : MyPageItem [SerializeField] private UILabel _guildNotificationLabel; - [SerializeField] - private GameObject _cardDetailObj; - [SerializeField] private GameObject _contentsRoot; @@ -86,24 +73,12 @@ public class MyPageItemHome : MyPageItem private MyPageHomeStatic _homeStatic; - private const int GIFT_MAX_COUNT = 99; - - public const int MISSION_MAX_COUNT = 99; - - private bool _isFinishInitialize; - private int _notificationMask; public GameObject ContentsRoot => _contentsRoot; public bool IsCustomMyPage => Data.MyPage.data.BGInfo.BGType != MyPageDetail.BGType.Deck; - public void SetHomeStatic(MyPageHomeStatic homeDeck) - { - _homeStatic = homeDeck; - CreateBanner(); - } - public override void Initialize(MyPageMenu parent) { base.Initialize(parent); @@ -280,12 +255,6 @@ public class MyPageItemHome : MyPageItem } } - public void OnReadGift() - { - _giftCount--; - SetUnreadGiftCount(_giftCount); - } - private void CheckNotify(Action onFinish) { if (!_contentsRoot.activeSelf || Data.Load.data._userTutorial.TutorialStep != 100) @@ -293,9 +262,11 @@ public class MyPageItemHome : MyPageItem return; } DateTime last_announce_time = Data.MyPage.data.last_announce_time; - if (last_announce_time > GameMgr.GetIns().AnnounceTime) + // Pre-Phase-5b: gated on ambient GameMgr.AnnounceTime cursor to avoid + // re-showing the same announcement. Headless has no announcement UI to display; + // always fall through to the else branch below. + if (false) { - GameMgr.GetIns().AnnounceTime = last_announce_time; _notificationMask |= 1; if (_notificationMask != 0) { @@ -350,31 +321,11 @@ public class MyPageItemHome : MyPageItem } } - public void OnMyPageFadeOpen(bool isHomeActive) - { - OnUpdateCustomMyPageEnable(isHomeActive); - _restoreUIButton.gameObject.SetActive(value: false); - } - - private void Update() - { - if (!_isFinishInitialize && _homeStatic.CardLoadFinish) - { - _isFinishInitialize = true; - GameObject obj = _giftButton.gameObject.transform.parent.gameObject; - bool activeSelf = obj.activeSelf; - obj.SetActive(value: false); - obj.SetActive(value: true); - obj.SetActive(activeSelf); - } - } - private void OnPushGiftButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask(); - mailTopTask.SetParameter(Data.Load.data._userTutorial.TutorialStep != 100); - StartCoroutine(Toolbox.NetworkManager.Connect(mailTopTask, OnRequestGift)); + // Pre-Phase-5b: fired MailTopTask via NetworkManager. Headless has no wire tasks; + // short-circuit to the success callback so the UI scene-change still fires. + OnRequestGift(default(NetworkTask.ResultCode)); } private void OnRequestGift(NetworkTask.ResultCode error) @@ -384,10 +335,8 @@ public class MyPageItemHome : MyPageItem private void OnPushMissionButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); - missionInfoTask.SetParameter(); - StartCoroutine(Toolbox.NetworkManager.Connect(missionInfoTask, OpenMission)); + // Pre-Phase-5b: fired MissionInfoTask via NetworkManager. See OnPushGiftButton. + OpenMission(default(NetworkTask.ResultCode)); } private void OpenMission(NetworkTask.ResultCode error) @@ -415,19 +364,19 @@ public class MyPageItemHome : MyPageItem private void OnPushBattlePassButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.BattlePass); } private void OnPushBGCustomButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + MyPageBGCustomDialog.Create(OnDecideMyPageBG); } private void OnPushHideUIButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ToggleUIVisible(visible: false); } @@ -466,35 +415,9 @@ public class MyPageItemHome : MyPageItem return randomIdList[random.Next(0, randomIdList.Count)]; } - public void ShowBanner() - { - if (Data.Load.data._userTutorial.TutorialStep == 100) - { - _banner.Show(); - _subBanner.Show(); - } - } - - public void HideBanner() - { - _banner.Hide(); - _subBanner.Hide(); - } - - private void CreateBanner() - { - _bannerObject = NGUITools.AddChild(_contentsRoot, _bannerPrefab); - _banner = _bannerObject.GetComponent(); - _homeStatic.Initialize(); - _subBannerObject = NGUITools.AddChild(_contentsRoot, _subBannerPrefab); - _subBanner = _subBannerObject.GetComponent(); - _banner._isFirstTips = false; - _subBanner._isFirstTips = false; - } - private void OnPushGuildButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Guild); } @@ -525,38 +448,6 @@ public class MyPageItemHome : MyPageItem return false; } - public void SetFirstTips() - { - _banner._isFirstTips = true; - _banner.SetActive(inActive: false); - _subBanner._isFirstTips = true; - _subBanner.SetActive(inActive: false); - _homeStatic.SetTutorialMode(); - } - - public void SetGuideEffectToGiftButton() - { - base.Parent.SetGuideEffect(_giftButton.transform, new Vector3(-14f, 0f, 0f), -90f); - } - - public void SetGiftReceiveTutorialMode() - { - UIManager.SetObjectToGrey(_missionButton.gameObject, b: true); - UIManager.SetObjectToGrey(_guildButton.gameObject, b: true); - UIManager.SetObjectToGrey(_battlePassButton.gameObject, b: true); - UIManager.SetObjectToGrey(_bgCustomButton.gameObject, b: true); - } - - public void FinishFirstTips() - { - UIManager.SetObjectToGrey(_giftButton.gameObject, b: false); - UIManager.SetObjectToGrey(_missionButton.gameObject, b: false); - UIManager.SetObjectToGrey(_guildButton.gameObject, b: false); - UIManager.SetObjectToGrey(_battlePassButton.gameObject, b: false); - UIManager.SetObjectToGrey(_bgCustomButton.gameObject, b: false); - _homeStatic.FinishFirstTips(); - } - public void SetUnreadGiftCount(int count) { if (!(_giftNumberRoot.gameObject == null)) diff --git a/SVSim.BattleEngine/Engine/MyPageItemShop.cs b/SVSim.BattleEngine/Engine/MyPageItemShop.cs deleted file mode 100644 index 8067eaaf..00000000 --- a/SVSim.BattleEngine/Engine/MyPageItemShop.cs +++ /dev/null @@ -1,443 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class MyPageItemShop : MyPageItem -{ - private const float SET_ACTIVE_APPEAL_OBJ_DELAY_TIME = 0.15f; - - [SerializeField] - private ShopSupplyCardPanel _supplyCardPanel; - - [SerializeField] - private ShopPanelAppealItem _supplyAppealItem; - - [SerializeField] - private MyPageCardPanel _cardPackCardPanel; - - [SerializeField] - private ShopPanelAppealItem _cardPackAppealItem; - - [SerializeField] - private MyPageCardPanel _crystalCardPanel; - - [SerializeField] - private UIButton _supplyButton; - - [SerializeField] - private UIButton _buyCardSleeveButton; - - [SerializeField] - private ShopPanelAppealItem _sleeveAppealItem; - - [SerializeField] - private UIButton _buyLeaderSkinButton; - - [SerializeField] - private ShopPanelAppealItem _skinAppealItem; - - [SerializeField] - private UIButton _buyItemButton; - - [SerializeField] - private DialogItemPurchase _itemPurchaseDialog; - - [SerializeField] - private SpotCardExchangeDialog _dialogSpotCardExchange; - - [SerializeField] - private GameObject _supplyMenuRoot; - - [SerializeField] - private UIButton _cardButton; - - [SerializeField] - private GameObject _cardMenuRoot; - - [SerializeField] - private UIButton _buyCardPackButton; - - [SerializeField] - private ShopPanelAppealItem _packAppealItem; - - [SerializeField] - private UIButton _buyDeckButton; - - [SerializeField] - private ShopPanelAppealItem _deckAppealItem; - - [SerializeField] - private UIButton _exchangeSpotCardButton; - - [SerializeField] - private GameObject _cardPackMenuRoot; - - [SerializeField] - private UIButton _crystalButton; - - [SerializeField] - private UILabel _supplyMaintenanceBaseLabel; - - [SerializeField] - private MyPageShopCrystalApeal _crystalAppeal; - - [SerializeField] - private GameObject _cardBuyCampaignRoot; - - [SerializeField] - private UILabel _cardBuyCampaignLabel; - - private CardPanelMaintenancePlate _buyCardSleeveMaintenancePlate; - - private CardPanelMaintenancePlate _buyLeaderSkinMaintenancePlate; - - private CardPanelMaintenancePlate _buyItemMaintenancePlate; - - private CardPanelMaintenancePlate _buyCardPackMaintenancePlate; - - private CardPanelMaintenancePlate _buyBuildDeckMaintenancePlate; - - private CardPanelMaintenancePlate _exchangeSpotCardMaintenancePlate; - - private const string SLEEVE_BTN_SPRITE_NAME_BASE = "btn_supply_sleeve"; - - private const string SKIN_BTN_SPRITE_NAME_BASE = "btn_supply_skin"; - - private List _shopCardPanelResource = new List(); - - private const int CARD_INDEX_SUPPLY = 0; - - private const int CARD_INDEX_CARD = 1; - - private const int CARD_INDEX_CRYSTAL = 2; - - private bool IsSpecialSleeveMode => Data.MyPageNotifications.data.ShopNotification.AppealSleeve.IsCollaborationPanel; - - private bool IsSpecialSkinMode => Data.MyPageNotifications.data.ShopNotification.AppealLeaderSkin.IsCollaborationPanel; - - public MyPageShopCrystalApeal CrystalAppeal => _crystalAppeal; - - private bool IsTutorial => Data.Load.data._userTutorial.TutorialStep == 41; - - public override void Initialize(MyPageMenu parent) - { - base.Initialize(parent); - _buyCardSleeveButton.onClick.Add(new EventDelegate(delegate - { - OnPushBuyCardSleeve(); - })); - _buyLeaderSkinButton.onClick.Add(new EventDelegate(delegate - { - OnPushBuyLeaderSkin(); - })); - _buyItemButton.onClick.Add(new EventDelegate(delegate - { - OnPushBuyItem(); - })); - _buyCardPackButton.onClick.Add(new EventDelegate(delegate - { - OnPusBuyCardPack(); - })); - _buyDeckButton.onClick.Add(new EventDelegate(delegate - { - OnPushBuyBuildDeck(); - })); - _exchangeSpotCardButton.onClick.Add(new EventDelegate(delegate - { - OnPushExchangeSpotCard(); - })); - SaveDefaultPosition(_cardPackMenuRoot); - SaveDefaultPosition(_cardPackMenuRoot); - SaveDefaultPosition(_supplyMenuRoot); - } - - public override void Show(bool skipCardAnimation = false) - { - base.Show(skipCardAnimation); - _supplyMenuRoot.SetActive(value: false); - _cardPackMenuRoot.SetActive(value: false); - RestoreCardPanelPosition(); - StartCardPanelAppearAnimation(); - _supplyButton.onClick.Clear(); - _supplyButton.onClick.Add(new EventDelegate(delegate - { - OnPushSupplyButton(); - })); - _cardButton.onClick.Clear(); - _cardButton.onClick.Add(new EventDelegate(delegate - { - OnPushCardButton(); - })); - RestoreDefaultPosition(_cardPackMenuRoot); - RestoreDefaultPosition(_supplyMenuRoot); - if (IsTutorial) - { - SetTutorial(); - UIManager.GetInstance()._Footer.SetButtonEnableColorChange(5, btnIsEnable: false); - } - ShowCardPanelAppeal(); - UIManager.GetInstance().StartCoroutine(_crystalCardPanel.DisablePanel(Data.SystemText.Get("System_0074"))); - UIManager.GetInstance().StartCoroutine(LoadCardPanelCoroutine()); - } - - private IEnumerator LoadCardPanelCoroutine() - { - ShopNotification shopNotification = Data.MyPageNotifications.data.ShopNotification; - bool flag = shopNotification.AppealSleeve.IsCollaborationPanel || shopNotification.AppealLeaderSkin.IsCollaborationPanel; - if ((flag && !_supplyCardPanel.IsLoadedSpecialCardPanelResource) || (!flag && !_supplyCardPanel.IsLoadedDefaultCardPanelResource)) - { - _shopCardPanelResource.Add(_supplyCardPanel.GetResourcePath(isfetch: false)); - yield return Toolbox.ResourcesManager.LoadAssetGroupSync(_shopCardPanelResource, null); - _supplyCardPanel.AttachCardPanelTexture(); - } - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_shopCardPanelResource); - _shopCardPanelResource.Clear(); - } - - public override void OnMyPageInfoReceive() - { - base.OnMyPageInfoReceive(); - if (IsTutorial) - { - SetTutorial(); - } - } - - private void SetCardPanelTutorialMode() - { - UIManager.SetObjectToGrey(_supplyCardPanel.gameObject, b: true); - UIManager.SetObjectToGrey(_crystalButton.gameObject, b: true); - } - - private void SetTutorial() - { - SetCardPanelTutorialMode(); - UIManager.SetObjectToGrey(base.TopBar.BackButton.gameObject, b: true); - UIManager.SetObjectToGrey(base.TopBar.BuyCrystalButton.gameObject, b: true); - base.TopBar.BuyCrystalButton.isEnabled = false; - Footer footer = UIManager.GetInstance()._Footer; - for (int i = 0; i < footer._underButtons.Length; i++) - { - if (i == 5) - { - footer.SetButtonEnableColorChange(i, !base.gameObject.activeInHierarchy); - } - else - { - footer.SetButtonEnableColorChange(i, btnIsEnable: false); - } - } - if (base.gameObject.activeInHierarchy) - { - base.Parent.SetGuideEffect(_cardPackCardPanel.transform, new Vector3(-40f, 0f, 0f), -45f); - } - } - - private void OnPushCardButton() - { - if (!base.IsCardMoving) - { - base.Parent.SetDefaultBackButtonHandler(); - base.CardAnimation.OnClicked(1); - ShowCardMenu(); - if (IsTutorial) - { - base.Parent.SetGuideEffect(_buyCardPackButton.transform, Vector3.zero, -45f); - } - } - } - - private void OnPushSupplyButton() - { - if (!IsTutorial && !base.IsCardMoving) - { - base.Parent.SetDefaultBackButtonHandler(); - ShowSupplyMenu(); - base.CardAnimation.OnClicked(0); - } - } - - private void ShowSupplyMenu() - { - base.IsEnableFooterCurrentMenu = true; - base.Parent.SetBackButtonEnable(); - _supplyButton.onClick.Clear(); - base.TopBar.SetTitleLabel(Data.SystemText.Get("MyPage_0017")); - SetSpriteSpecialBtn(_buyCardSleeveButton, "btn_supply_sleeve", IsSpecialSleeveMode); - SetSpriteSpecialBtn(_buyLeaderSkinButton, "btn_supply_skin", IsSpecialSkinMode); - _supplyAppealItem.DelaySetActiveAppealObj(isActive: false, 0.15f); - MoveCardPanelLeftPosition(_supplyCardPanel.gameObject); - FadeOutCardPanelAndNonActive(_cardPackCardPanel); - FadeOutCardPanelAndNonActive(_crystalCardPanel); - _supplyMenuRoot.SetActive(value: true); - AppearAnimationFromRight(_supplyMenuRoot); - bool isMaintenance = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_SLEEVE_MAINTENANCE); - bool isMaintenance2 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_SKIN_MAINTENANCE); - bool isMaintenance3 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_ITEM_MAINTENANCE); - _buyCardSleeveMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _buyCardSleeveButton, _buyCardSleeveMaintenancePlate, _supplyMaintenanceBaseLabel.depth); - _buyLeaderSkinMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance2, _buyLeaderSkinButton, _buyLeaderSkinMaintenancePlate, _supplyMaintenanceBaseLabel.depth); - _buyItemMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance3, _buyItemButton, _buyItemMaintenancePlate, _supplyMaintenanceBaseLabel.depth); - } - - private void SetSpriteSpecialBtn(UIButton button, string buttonSpriteNameBase, bool isSpecial) - { - button.normalSprite = (isSpecial ? (buttonSpriteNameBase + "_special") : buttonSpriteNameBase); - } - - public void GoToShopSupply() - { - ShowSupplyMenu(); - } - - public void GoToShopCard() - { - ShowCardMenu(); - } - - private void OnPushBuyCardSleeve() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.CardSleevePurchasePage); - } - - private void OnPushBuyLeaderSkin() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.ClassSkinPurchasePage); - } - - private void OnPushBuyItem() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _itemPurchaseDialog.CreateItemPurcahseDialog(); - } - - private void ShowCardMenu() - { - if (!IsTutorial) - { - base.IsEnableFooterCurrentMenu = true; - } - base.Parent.SetBackButtonEnable(); - _cardButton.onClick.Clear(); - base.TopBar.SetTitleLabel(Data.SystemText.Get("MyPage_0016")); - _cardPackAppealItem.DelaySetActiveAppealObj(isActive: false, 0.15f); - RestoreCardPanelPosition(); - MoveCardPanelLeftPosition(_cardPackCardPanel.gameObject); - FadeOutCardPanelAndNonActive(_supplyCardPanel); - FadeOutCardPanelAndNonActive(_crystalCardPanel); - _cardPackMenuRoot.SetActive(value: true); - AppearAnimationFromRight(_cardPackMenuRoot); - bool isMaintenance = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_CARDPACK_MAINTENANCE); - bool isMaintenance2 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_BUILDDECK_MAINTENANCE); - bool isMaintenance3 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SPOTCARD_EXCHANGE); - _buyCardPackMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _buyCardPackButton, _buyCardPackMaintenancePlate, _supplyMaintenanceBaseLabel.depth); - _buyBuildDeckMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance2, _buyDeckButton, _buyBuildDeckMaintenancePlate, _supplyMaintenanceBaseLabel.depth); - _exchangeSpotCardMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance3, _exchangeSpotCardButton, _exchangeSpotCardMaintenancePlate, _supplyMaintenanceBaseLabel.depth); - if (IsTutorial) - { - UIManager.SetObjectToGrey(_buyDeckButton.gameObject, b: true); - UIManager.SetObjectToGrey(_exchangeSpotCardButton.gameObject, b: true); - SetCardPanelTutorialMode(); - } - } - - private void OnPusBuyCardPack() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gacha, null, new GachaUIParam()); - if (IsTutorial) - { - base.Parent.SetGuideEffect(base.Parent.transform, Vector3.zero, 0f); - base.Parent.FirstGuidEffect.gameObject.SetActive(value: false); - } - } - - private void OnPushBuyBuildDeck() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.BuildDeckPurchasePage); - } - - private void OnPushExchangeSpotCard() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _dialogSpotCardExchange.CreateSpotCardExchangeDialog(); - } - - private void OnPushBuyCrystal() - { - } - - private void ShowCardPanelAppeal() - { - if (IsTutorial) - { - _supplyAppealItem.SetActiveAppealObj(isActive: false); - _cardPackAppealItem.SetActiveAppealObj(isActive: false); - _sleeveAppealItem.SetActiveAppealObj(isActive: false); - _skinAppealItem.SetActiveAppealObj(isActive: false); - _packAppealItem.SetActiveAppealObj(isActive: false); - _deckAppealItem.SetActiveAppealObj(isActive: false); - _crystalAppeal.gameObject.SetActive(value: false); - _cardBuyCampaignRoot.SetActive(value: false); - return; - } - bool flag = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_SLEEVE_MAINTENANCE); - bool flag2 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_SKIN_MAINTENANCE); - bool flag3 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_CARDPACK_MAINTENANCE); - bool flag4 = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_BUILDDECK_MAINTENANCE); - ShopNotification shopNotification = Data.MyPageNotifications.data.ShopNotification; - ShopNotification.ShopAppealInfo appeal = PriorizeAppealInfo(new List { shopNotification.AppealSleeve, shopNotification.AppealLeaderSkin }); - _supplyAppealItem.SetAppeal(appeal); - ShopNotification.ShopAppealInfo appeal2 = PriorizeAppealInfo(new List { shopNotification.AppealCardPack, shopNotification.AppealBuildDeck }); - _cardPackAppealItem.SetAppeal(appeal2); - _sleeveAppealItem.SetAppeal(shopNotification.AppealSleeve); - _skinAppealItem.SetAppeal(shopNotification.AppealLeaderSkin); - _packAppealItem.SetAppeal(shopNotification.AppealCardPack); - _deckAppealItem.SetAppeal(shopNotification.AppealBuildDeck); - _supplyAppealItem.SetActiveAppealObj(!flag && !flag2); - _cardPackAppealItem.SetActiveAppealObj(!flag3 && !flag4); - _sleeveAppealItem.SetActiveAppealObj(!flag); - _skinAppealItem.SetActiveAppealObj(!flag2); - _packAppealItem.SetActiveAppealObj(!flag3); - _deckAppealItem.SetActiveAppealObj(!flag4); - if (!flag3 && Prerelease.Status == Prerelease.eStatus.PRE_ROTATION) - { - _cardBuyCampaignRoot.SetActive(value: true); - _cardBuyCampaignLabel.text = Data.SystemText.Get("MyPage_0048", ConvertTime.ToLocal(Prerelease.Instance.EndTime)); - _cardPackAppealItem.SetActiveAppealObj(isActive: false); - } - else - { - _cardBuyCampaignRoot.SetActive(value: false); - } - _crystalAppeal.gameObject.SetActive(value: false); - } - - private ShopNotification.ShopAppealInfo PriorizeAppealInfo(List appealInfoList) - { - List list = appealInfoList.FindAll((ShopNotification.ShopAppealInfo info) => info.NeedsCampaignDisplay); - if (list.Count > 0) - { - return list[0]; - } - List list2 = appealInfoList.FindAll((ShopNotification.ShopAppealInfo info) => info.RemainTime != null); - if (list2.Count > 0) - { - return list2.FindMin((ShopNotification.ShopAppealInfo info) => info.RemainTime.Second); - } - ShopNotification.ShopAppealInfo shopAppealInfo = appealInfoList.Find((ShopNotification.ShopAppealInfo info) => info.IsNew); - if (shopAppealInfo == null) - { - return new ShopNotification.ShopAppealInfo(); - } - return shopAppealInfo; - } -} diff --git a/SVSim.BattleEngine/Engine/MyPageItemSoroPlay.cs b/SVSim.BattleEngine/Engine/MyPageItemSoroPlay.cs deleted file mode 100644 index feed2aa0..00000000 --- a/SVSim.BattleEngine/Engine/MyPageItemSoroPlay.cs +++ /dev/null @@ -1,244 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Story; - -public class MyPageItemSoroPlay : MyPageItem -{ - private readonly Vector3 CARD_POS_LEFT = new Vector3(-203f, 0f, 0f); - - private readonly Vector3 CARD_POS_RIGHT = new Vector3(203f, 0f, 0f); - - private readonly Vector3 CARD_POS_QUEST_EXIST_LEFT = new Vector3(-367f, 0f, 0f); - - private readonly Vector3 CARD_POS_QUEST_EXIST_CENTER = new Vector3(0f, 20f, 0f); - - private readonly Vector3 CARD_POS_QUEST_EXIST_RIGHT = new Vector3(367f, 0f, 0f); - - [SerializeField] - private UIButton _storyButton; - - [SerializeField] - private UIButton _practiceButton; - - [SerializeField] - private UIButton _questButton; - - [SerializeField] - private StoryCardPanel _storyCardPanel; - - [SerializeField] - private MyPageCardPanel _practiceCardPanel; - - [SerializeField] - private GameObject _practiceTypeSelectRoot; - - [SerializeField] - private UIButton _practiceBattleButton; - - [SerializeField] - private UIButton _practiceBattlePazzle; - - [SerializeField] - private UILabel _practiceTypePuzzleLabel; - - [SerializeField] - private MyPageCardPanel _questCardPanel; - - [SerializeField] - private GameObject _questExtraIcon; - - [SerializeField] - private GameObject _questBand; - - [SerializeField] - private UILabel _questBandLabel; - - [SerializeField] - private GameObject _questEndTimeRoot; - - [SerializeField] - private UILabel _questEndTimeLabel; - - [SerializeField] - private GameObject _practiceBadge; - - [SerializeField] - private GameObject _puzzleBadge; - - public static readonly Quaternion EFFECT_ROTATION = Quaternion.Euler(0f, 0f, -38f); - - private CardPanelMaintenancePlate _puzzleMaintenancePlate; - - private void Start() - { - _storyButton.onClick.Add(new EventDelegate(delegate - { - OnPushMainStory(); - })); - _questButton.onClick.Add(new EventDelegate(delegate - { - OnPushQuest(); - })); - _practiceBattleButton.onClick.Add(new EventDelegate(delegate - { - OnClickPracticeTypeBattle(); - })); - _practiceBattlePazzle.onClick.Add(new EventDelegate(delegate - { - OnClickPracticeTypePuzzle(); - })); - } - - public override void Initialize(MyPageMenu parent) - { - base.Initialize(parent); - SaveDefaultPosition(_practiceTypeSelectRoot); - } - - public override void Show(bool skipCardAnimation = false) - { - base.Show(skipCardAnimation); - SetCardPanelAnimation(); - StartCardPanelAppearAnimation(); - _practiceButton.onClick.Clear(); - _practiceButton.onClick.Add(new EventDelegate(delegate - { - OnPushPractive(); - })); - UpdateQuestBadgeIcon(); - _questBandLabel.text = Data.MyPageNotifications.data.QuestOpenInfo.QuestPanelBandText; - _questBand.SetActive(value: true); - _questEndTimeRoot.SetActive(value: true); - _practiceTypeSelectRoot.SetActive(value: false); - _storyCardPanel.DispAppealRibbon(Data.MyPageNotifications.data.StoryNotification.IsDisplayRibbon); - _storyCardPanel.DispAppealBadge(Data.MyPageNotifications.data.StoryNotification.IsDisplayBadge); - _practiceBadge.SetActive(Data.MyPageNotifications.data.IsPracticePuzzleBadgeEnable); - _puzzleBadge.SetActive(Data.MyPageNotifications.data.IsPracticePuzzleBadgeEnable); - UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.SoroPlay2); - } - - private void SetCardPanelAnimation() - { - for (int i = 0; i < base.CardPanelList.Length; i++) - { - MyPageCardPanel obj = base.CardPanelList[i]; - obj.gameObject.SetActive(value: true); - obj.EffectActive = false; - obj.EffectActive = true; - obj.CheckMaintenanceType(); - } - if (Data.MyPageNotifications.data.QuestOpenInfo.IsOpen) - { - _questCardPanel.gameObject.SetActive(value: true); - _storyCardPanel.transform.localPosition = CARD_POS_QUEST_EXIST_LEFT; - _questCardPanel.transform.localPosition = CARD_POS_QUEST_EXIST_CENTER; - _practiceCardPanel.transform.localPosition = CARD_POS_QUEST_EXIST_RIGHT; - _questEndTimeLabel.text = Data.SystemText.Get("MyPage_0048", ConvertTime.ToLocal(Data.MyPageNotifications.data.QuestOpenInfo.EndTime)); - } - else - { - _questCardPanel.gameObject.SetActive(value: false); - _storyCardPanel.transform.localPosition = CARD_POS_LEFT; - _practiceCardPanel.transform.localPosition = CARD_POS_RIGHT; - } - List list = new List(); - for (int j = 0; j < base.CardPanelList.Length; j++) - { - MyPageCardPanel myPageCardPanel = base.CardPanelList[j]; - if (myPageCardPanel.isActiveAndEnabled) - { - list.Add(myPageCardPanel.gameObject); - } - } - SaveCardPanelDefaultPosition(); - base.CardAnimation.PanelClear(); - base.CardAnimation.SetCardPanelList(list.ToArray()); - base.CardAnimation.SetCardPanelAngle(); - } - - private void OnPushMainStory() - { - if (!base.IsCardMoving) - { - base.CardAnimation.OnClicked(_storyCardPanel.Index); - Data.SelectedStoryInfo = new SelectedStoryInfo(StoryEntranceType.AllStory); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.StorySelectionWorld); - } - } - - public void GotoPracticeTypeSelect() - { - ShowPracticeTypeSelect(); - } - - private void OnPushPractive() - { - if (!base.IsCardMoving) - { - base.CardAnimation.OnClicked(_practiceCardPanel.Index); - ShowPracticeTypeSelect(); - } - } - - private void ShowPracticeTypeSelect() - { - _practiceButton.onClick.Clear(); - bool isMaintenance = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.PRACTICE_PUZZLE); - _puzzleMaintenancePlate = MyPageItem.SetMaintenanceVisible(isMaintenance, _practiceBattlePazzle, _puzzleMaintenancePlate, _practiceTypePuzzleLabel.depth); - base.TopBar.SetTitleLabel(Data.SystemText.Get("MyPage_0009")); - base.IsEnableFooterCurrentMenu = true; - FadeOutCardPanel(_storyCardPanel, null); - if (Data.MyPageNotifications.data.QuestOpenInfo.IsOpen) - { - FadeOutCardPanel(_questCardPanel, null); - } - MoveCardPanelLeftPosition(_practiceCardPanel.gameObject); - _practiceTypeSelectRoot.SetActive(value: true); - RestoreDefaultPosition(_practiceTypeSelectRoot.gameObject); - AppearAnimationFromRight(_practiceTypeSelectRoot); - base.Parent.SetBackButtonEnable(); - } - - private void OnClickPracticeTypeBattle() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.Practice; - PracticeDeckInfoTask task = new PracticeDeckInfoTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Format value = (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_SELECT_DECK_FORMAT); - DeckSelectUIDialog.Create(Data.SystemText.Get("Story_0017"), task.DeckGroupListData, value, DeckSelectUIDialog.eFormatChangeUIType.UseOtherCategory, isVisibleCreateNew: true, delegate(DialogBase dialog, DeckData deck) - { - PracticeDeckSelectConfirmDialog.Create(dialog, deck, isBattleAgain: false); - }); - })); - } - - private void OnClickPracticeTypePuzzle() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.PracticePuzzle); - } - - private void OnPushQuest() - { - if (!base.IsCardMoving) - { - _questExtraIcon.SetActive(value: false); - base.CardAnimation.OnClicked(_questCardPanel.Index); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.QuestSelectionPage); - } - } - - public void UpdateQuestBadgeIcon() - { - bool active = false; - if (Data.Load.data._userTutorial.TutorialStep == 100) - { - active = Data.MyPageNotifications.data.QuestOpenInfo.IsDisplayBadge; - } - _questExtraIcon.SetActive(active); - } -} diff --git a/SVSim.BattleEngine/Engine/MyPageMenu.cs b/SVSim.BattleEngine/Engine/MyPageMenu.cs index 981ff9f0..95911a6a 100644 --- a/SVSim.BattleEngine/Engine/MyPageMenu.cs +++ b/SVSim.BattleEngine/Engine/MyPageMenu.cs @@ -1,1321 +1,58 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Convention; -using Cute; -using UnityEngine; -using Wizard; - -public class MyPageMenu : UIBase -{ - private const float TRANSITIONAL_BGM_DELAY_TIME = 0.5f; - - private static readonly string MYPAGE_LAYER_NAME = "MyPage"; - - private const int TUTORIAL_DIALOG_DEPTH = 3000; - - private static MyPageMenu _instance; - - public const int HOME_INDEX = 0; - - public const int STORY_INDEX = 1; - - public const int BATTLE_INDEX = 2; - - public const int ARENA_INDEX = 3; - - public const int DECK_INDEX = 4; - - public const int SHOP_INDEX = 5; - - public const int OTHER_INDEX = 6; - - private const int MYPAGE_ITEM_MAX = 7; - - private const float TWEEN_DISTANCE_X_MOVE_NAME_FRAME = 450f; - - private const float TWEEN_DELAY_MOVE_NAME_FRAME = 0f; - - private const float TWEEN_DISTANCE_Y_BACK_BUTTON = 500f; - - private const float TWEEN_DELAY_BACK_BUTTON = 0.1f; - - private const float TWEEN_TIME_TOP_BAR = 0.3f; - - private GameObject[] _pagePrefab; - - private const int MYPAGE_TREASURE_CP_REWARD_DIALOG = 37; - - private const int BG_REMAKE_RELEASE_MEMORY_COUNT = 50; - - [SerializeField] - private GameObject _pagePrefabHome; - - [SerializeField] - private GameObject _pagePrefabSoroPlay; - - [SerializeField] - private GameObject _pagePrefabBattle; - - [SerializeField] - private GameObject _pagePrefabArena; - - [SerializeField] - private GameObject _pagePrefabCard; - - [SerializeField] - private GameObject _pagePrefabShop; - - [SerializeField] - private GameObject _pagePrefabOther; - - [SerializeField] - private GameObject _myPageLayerRoot; - - [SerializeField] - private MyPageHomeStatic _homeStatic; - - [SerializeField] - private MyPageCustomBGControl _customBGControlOriginal; - - private MyPageCustomBGControl _customBGControl; - - [SerializeField] - private RewardBase _rewardBase; - - [SerializeField] - private BoxCollider _notTouchMypageCollider; - - [SerializeField] - private MyPageMaintenanceNotification _maintenanceNotificationPrefab; - - private MyPageMaintenanceNotification _maintenanceNotification; - - private GameObject[] _pageInstance; - - private MyPageItem[] _pageItem; - - private int _currentIndex; - - private List _loadFileList = new List(); - - private MyPageItemBattle _pageItemBattle; - - private MyPageItemHome _pageItemHome; - - private MyPageItemSoroPlay _pageItemSoroPlay; - - private MyPageItemShop _pageItemShop; - - private MyPageItemArena _pageItemArena; - - private MyPageItemCard _pageItemCard; - - private bool _isEnableRoomInvite; - - private float _nameWindowDefaultX; - - private bool _changeMenuCalled; - - private bool _isSetupFinish; - - private bool _isFirstLoad = true; - - private Transform _firstGuidEffectParent; - - private GameObject _boxOpenEffectObj; - - private GameObject _treasureEffectObj; - - private int _remakeCustomBgCount; - - private bool _loadResourceFinish; - - private bool _isFirstChangeMenuCall = true; - - private bool _isStopMyPageRefreshOnce; - - public static bool IsMyPageRequestEnd { get; set; } - - public static MyPageMenu Instance => _instance; - - public bool _treasureBoxCpRewardDialogClosed { get; private set; } = true; - - public bool IsEnableRoomInvite => _isEnableRoomInvite; - - public TopBar TopBar { get; set; } - - public MyPageItemHome HomeMenu => _pageItemHome; - - public MyPageItemBattle BattleMenu => _pageItemBattle; - - public MyPageCustomBGControl CustomBGControl => _customBGControl; - - public bool IsCardLoadFinish => _homeStatic.CardLoadFinish; - - public bool IsFirstGuid => Data.Load.data._userTutorial.TutorialStep != 100; - - public Effect FirstGuidEffect { get; private set; } - - public bool IsEnableFooterCurrentMenu => _pageItem[_currentIndex].IsEnableFooterCurrentMenu; - - public int currentIndex => _currentIndex; - - public bool IsVisible => _myPageLayerRoot.activeInHierarchy; - - public bool IsSetupComplete { get; private set; } - - public bool IsFadeoutEnd { get; private set; } - - public List WinnerRewardInfoCopy { get; private set; } = new List(); - - private void Awake() - { - _instance = this; - _pagePrefab = new GameObject[7]; - _pagePrefab[0] = _pagePrefabHome; - _pagePrefab[1] = _pagePrefabSoroPlay; - _pagePrefab[2] = _pagePrefabBattle; - _pagePrefab[3] = _pagePrefabArena; - _pagePrefab[4] = _pagePrefabCard; - _pagePrefab[5] = _pagePrefabShop; - _pagePrefab[6] = _pagePrefabOther; - _pageInstance = new GameObject[_pagePrefab.Length]; - _pageItem = new MyPageItem[_pagePrefab.Length]; - TopBar = UIManager.GetInstance().CreateTopBar(base.gameObject, ""); - UIManager.GetInstance().SetLayerRecursive(TopBar.transform, LayerMask.NameToLayer("MyPage")); - TopBar.BackButtonLabel.text = Data.SystemText.Get("Common_0137"); - TopBar.transform.parent = _myPageLayerRoot.transform; - UIManager.SetObjectToGrey(TopBar.BuyCrystalButton.gameObject, b: true); - TopBar.BuyCrystalButton.isEnabled = false; - UIEventListener.Get(TopBar.NameWindowBg).onClick = delegate - { - OnClickNameWindow(); - }; - _nameWindowDefaultX = TopBar.NameWindowObject.transform.localPosition.x; - _customBGControlOriginal.gameObject.SetActive(value: false); - } - - public override void onFirstStart() - { - _instance = this; - base.onFirstStart(); - } - - protected override void onOpen() - { - base.onOpen(); - LocalLog.AddRoomCreateLog("onOpen "); - _myPageLayerRoot.SetActive(value: true); - if (!_isSetupFinish) - { - _isSetupFinish = true; - IsSetupComplete = false; - IsFadeoutEnd = false; - OpenSetup(); - StartCoroutine(Setup()); - CommonBackGround.Instance.ChangeMyPageBG(); - assetSetting(); - } - _notTouchMypageCollider.enabled = false; - } - - protected override void onClose() - { - base.onClose(); - _myPageLayerRoot.SetActive(value: false); - DestroyMyPageItem(); - if (CommonBackGround.Instance != null) - { - CommonBackGround.Instance.EffectVisible = true; - } - _isSetupFinish = false; - } - - public void OpenSetup() - { - CreateMyPageItem(); - MyPageItem[] pageItem = _pageItem; - for (int i = 0; i < pageItem.Length; i++) - { - pageItem[i].AttachAtlas(); - } - } - - public static IEnumerator OnMyPageOpen(UIManager uiManager, UIManager.ChangeViewSceneParam param) - { - IsMyPageRequestEnd = false; - while (!IsMyPageRequestEnd) - { - yield return null; - } - if (Data.MyPage.CardUpdateFlag) - { - if (Instance != null) - { - Instance.ReloadCardCircle(); - } - Data.MyPage.CardUpdateFlag = false; - } - if (Instance != null) - { - Instance.ChangeMenu(param.MyPageMenuIndex, param.IsCutCardMotion); - if (param.MyPageMenuIndex != 0 && Instance._customBGControl != null) - { - Instance._customBGControl.SetEnable(enable: false); - } - } - else - { - uiManager._Footer.UpdateCurrentIndex(param.MyPageMenuIndex); - } - } - - private void CreateMyPageItem() - { - for (int i = 0; i < _pagePrefab.Length; i++) - { - if (!(_pageItem[i] != null)) - { - _pageInstance[i] = UnityEngine.Object.Instantiate(_pagePrefab[i]); - _pageInstance[i].transform.parent = _myPageLayerRoot.transform; - _pageInstance[i].transform.localPosition = Vector3.zero; - _pageInstance[i].transform.localScale = Vector3.one; - _pageInstance[i].transform.localRotation = Quaternion.identity; - _pageItem[i] = _pageInstance[i].GetComponent(); - _pageItem[i].Initialize(this); - _pageInstance[i].SetActive(value: false); - } - } - _pageItemHome = _pageInstance[0].GetComponent(); - _pageItemBattle = _pageInstance[2].GetComponent(); - _pageItemShop = _pageInstance[5].GetComponent(); - _pageItemArena = _pageInstance[3].GetComponent(); - _pageItemCard = _pageInstance[4].GetComponent(); - _pageItemSoroPlay = _pageInstance[1].GetComponent(); - _pageItemHome.SetHomeStatic(_homeStatic); - if (_loadResourceFinish) - { - AttachCardPanelTexture(); - } - } - - public void ChangeMyPageBG(MyPageDetail.BGType type, string id) - { - if (type == MyPageDetail.BGType.Deck) - { - _pageItemHome.OnUpdateCustomMyPageEnable(isHomeActive: true); - if (_customBGControl != null) - { - _customBGControl.FadeOutDestroy(); - _customBGControl = null; - _homeStatic.StartCardUpAnimation(); - } - } - else - { - ChangeBGToCustomBG(id); - } - } - - private void ChangeBGToCustomBG(string id) - { - string text = ((_customBGControl != null) ? _customBGControl.Id : string.Empty); - if (id == text) - { - return; - } - MyPageCustomBGControl oldControl = _customBGControl; - if (oldControl != null) - { - oldControl.FadeoutStandby(); - } - _customBGControl = NGUITools.AddChild(_customBGControlOriginal.transform.parent.gameObject, _customBGControlOriginal.gameObject).GetComponent(); - _customBGControl.gameObject.SetActive(value: true); - _customBGControl.Load(id, isDisplaySoon: true, delegate - { - _pageItemHome.OnUpdateCustomMyPageEnable(isHomeActive: true); - if (oldControl != null) - { - oldControl.FadeOutDestroy(); - } - OnRemakeCustomBg(); - }); - } - - private void DestroyMyPageItem() - { - if (FirstGuidEffect != null) - { - FirstGuidEffect.transform.parent = _firstGuidEffectParent; - } - for (int i = 0; i < _pageItem.Length; i++) - { - if (_pageItem[i] != null) - { - _pageItem[i].OnClose(); - UnityEngine.Object.Destroy(_pageItem[i].gameObject); - _pageItem[i] = null; - } - } - _pageItemHome = null; - _pageItemBattle = null; - _pageItemShop = null; - _pageItemArena = null; - _pageItemCard = null; - if (_customBGControl != null) - { - UnityEngine.Object.Destroy(_customBGControl.gameObject); - } - _customBGControl = null; - _remakeCustomBgCount = 0; - ReleaseMemory(runGCCollect: true); - } - - private IEnumerator Setup() - { - LocalLog.AddRoomCreateLog("Setup1 "); - Offline.IsConventionMode = false; - if (UIManager.GetInstance() != null) - { - TopBar.SetBackButtonEnable(enable: true); - if (UIManager.GetInstance()._Footer != null) - { - UIManager.GetInstance()._Footer.ShowFooterMenu(isShow: true); - } - } - bool finishTutorialResouce = true; - if (Data.Load.data._userTutorial.TutorialStep != 100) - { - finishTutorialResouce = false; - _loadFileList.AddRange(GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectTutorialData", isBattle: true, isField: false, isBattleEffect: false, delegate - { - finishTutorialResouce = true; - FirstGuidEffect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_TUTORIAL_TAP_1, Vector3.zero, Quaternion.identity); - FirstGuidEffect.gameObject.SetActive(value: false); - })); - } - while (!finishTutorialResouce) - { - yield return null; - } - LocalLog.AddRoomCreateLog("Setup2 "); - GameMgr.GetIns().GetPrefabMgr().Load("Prefab/UI/Menu/CardPanelMaintenancePlate"); - RefreshStaticData(); - yield return StartCoroutine(GetMyPageInfo()); - if (Data.MyPage.data.BGInfo.BGType != MyPageDetail.BGType.Deck) - { - _customBGControl = NGUITools.AddChild(_customBGControlOriginal.transform.parent.gameObject, _customBGControlOriginal.gameObject).GetComponent(); - _customBGControl.gameObject.SetActive(value: true); - CommonBackGround.Instance.EffectVisible = false; - if (!_customBGControl.IsLoadRequestEnd) - { - string id = Data.MyPage.data.BGInfo.Id; - if (Data.MyPage.data.BGInfo.BGType == MyPageDetail.BGType.RandomBG) - { - id = MyPageItemHome.DecideRandomBG(Data.MyPage.data.BGInfo.RandomIdList); - } - _customBGControl.Load(id, isDisplaySoon: false, null); - } - } - if (!_loadResourceFinish) - { - LoadResource(); - } - while (!_loadResourceFinish || (_customBGControl != null && _customBGControl.IsLoading)) - { - yield return null; - } - LocalLog.AddRoomCreateLog("Setup3 "); - if (Data.Load.data._userTutorial.TutorialStep == 31) - { - StartCoroutine(OpenFirstTipsAndGuid(FirstTips.TipsType.MyPage)); - } - while (!IsCardLoadFinish) - { - yield return null; - } - while (!CommonBackGround.Instance.IsFinishLod) - { - yield return null; - } - LocalLog.AddRoomCreateLog("Setup4 "); - yield return StartCoroutine(SetupFinish()); - } - - private void RefreshStaticData() - { - GameMgr.GetIns().GetDataMgr().SetQuestBattleData(null); - PracticePuzzleUI.ClearInMyPageScene(); - GameMgr.GetIns().GetDataMgr().QuestFirstSelectType = QuestSelectionPage.FirstSelectType.NONE; - Data.RedEtherCampaignResultData = null; - } - - private IEnumerator SetupFinish() - { - LocalLog.AddRoomCreateLog("SetupFinish "); - if (_isFirstLoad) - { - _isFirstLoad = false; - GameMgr.GetIns().GetSoundMgr().Stop_Play_BGM(Bgm.BGM_TYPE.HOME, null, 0.5f); - ParticleSystem bgEffect = CommonBackGround.Instance.GetBgEffectNow(CommonBackGround.Instance.BGType); - while (!bgEffect.GetComponent().isFinished) - { - yield return null; - } - UIManager.GetInstance().DestroyView(UIManager.ViewScene.Title); - if (0 == 0) - { - FadeOpen(); - } - } - else - { - FadeOpen(); - } - } - - private void FadeOpen() - { - LocalLog.AddRoomCreateLog("FadeOpen "); - IsSetupComplete = true; - _pageItemHome.OnMyPageFadeOpen(_currentIndex == 0); - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.HOME); - UIManager.GetInstance().OnReadyViewScene(isFadein: true, null, delegate - { - IsFadeoutEnd = true; - }); - } - - protected override void OnDestroy() - { - base.OnDestroy(); - UnloadResource(); - DestroyMyPageItem(); - resetAssetBaundleSetting(); - } - - private void Update() - { - } - - private void BackKeyCheck() - { - } - - private IEnumerator OpenFirstTipsAndGuid(FirstTips.TipsType type) - { - SetTutorialMode(); - _pageItemHome.SetGiftReceiveTutorialMode(); - bool finishTips = false; - UIManager.GetInstance().StartFirstTips(type, delegate - { - finishTips = true; - }); - while (!finishTips) - { - yield return null; - } - DialogBase dialogBase = CreateDialogForTutorial(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_Home_001_Title")); - dialogBase.SetText(Data.SystemText.Get("Tutorial_0010")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.OnClose = delegate - { - _pageItemHome.SetGuideEffectToGiftButton(); - }; - SetGuideToOkOnlyDialog(dialogBase); - _pageItemHome.SetFirstTips(); - } - - private IEnumerator FirstGuideDelay(DialogBase dialog, float delayTime) - { - yield return new WaitForSeconds(delayTime); - if (dialog != null) - { - SetGuideToOkOnlyDialog(dialog); - } - } - - public void SetGuideToOkOnlyDialog(DialogBase dialog) - { - SetGuideEffect(dialog.Btn1GameObject.transform, new Vector3(-95f, 0f, 0f), -90f); - dialog.OnCloseStart = (Action)Delegate.Combine(dialog.OnCloseStart, (Action)delegate - { - FirstGuidEffect.transform.parent = base.transform.parent; - FirstGuidEffect.gameObject.SetActive(value: false); - }); - } - - public void SetTutorialMode() - { - Footer footer = UIManager.GetInstance()._Footer; - for (int i = 0; i < footer._underButtons.Length; i++) - { - footer.SetButtonEnableColorChange(i, btnIsEnable: false); - } - UIManager.SetObjectToGrey(TopBar.BuyCrystalButton.gameObject, b: true); - TopBar.BuyCrystalButton.isEnabled = false; - _homeStatic.SetTutorialMode(); - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - UIManager.GetInstance()._Footer.SoloPlayIconDisp(inDisp: false); - } - - public void FinishTutorialMode() - { - _homeStatic.FinishFirstTips(); - } - - public static DialogBase CreateDialogForTutorial() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - int num = LayerMask.NameToLayer(MYPAGE_LAYER_NAME); - dialogBase.SetPanelDepth(3000); - dialogBase.gameObject.SetLayer(num, isSetChildren: true); - dialogBase.SetBackViewLayer(num); - return dialogBase; - } - - public void FinishFirstTips() - { - if (IsFirstGuid) - { - ResetFirstGuide(); - Footer footer = UIManager.GetInstance()._Footer; - for (int i = 0; i < footer._underButtons.Length; i++) - { - footer.SetButtonEnableColorChange(i); - } - _pageItemHome.FinishFirstTips(); - } - } - - public void ResetFirstGuide() - { - if (FirstGuidEffect != null) - { - FirstGuidEffect.Stop(); - FirstGuidEffect.transform.parent = _firstGuidEffectParent; - } - } - - private IEnumerator GetMyPageInfo() - { - LocalLog.AddRoomCreateLog("GetMyPageInfo1 "); - while (Toolbox.NetworkManager == null && !Global.IS_LOAD_ALLDONE) - { - yield return null; - } - TopBar.NameLabel.text = PlayerStaticData.UserName; - TopBar.RupyLabel.gameObject.SetActive(value: false); - TopBar.CrystalLabel.gameObject.SetActive(value: false); - TopBar.RankTexture.gameObject.SetActive(value: false); - TopBar.SetActiveBattlePoint(isActive: false); - UIManager uiMgr = UIManager.GetInstance(); - uiMgr.createInSceneCenterLoading(); - if (TaskManager.GetInstance().IsMyPageSend()) - { - LocalLog.SendLastTraceLog(null); - } - LocalLog.AddRoomCreateLog("GetMyPageInfo2 "); - yield return StartCoroutine(MasterResetMonthTask.MasterReset()); - MyPageTask task = GameMgr.GetIns().GetMyPageTask(); - task.SetParameter(); - yield return StartCoroutine(Toolbox.NetworkManager.Connect(task, OnRequestMyPageLoad)); - while (!task.isServerResultCodeOK() || task.IsResourceVersionUpError) - { - yield return null; - } - LocalLog.AddRoomCreateLog("GetMyPageInfo3 "); - WinnerRewardInfoCopy.Clear(); - foreach (CampaignRewardInfo reward in Data.MyPageNotifications.data.CampaignBattleWin.RewardList) - { - WinnerRewardInfoCopy.Add(reward); - } - bool finishDeckInfoTask = false; - _homeStatic.CenterCardCreateStart(delegate - { - finishDeckInfoTask = true; - }); - while (!finishDeckInfoTask) - { - yield return null; - } - yield return StartCoroutine(_pageItemShop.CrystalAppeal.Initialize(Data.MyPage.data.ServerUnixTime)); - TopBar.RupyLabel.gameObject.SetActive(value: true); - TopBar.CrystalLabel.gameObject.SetActive(value: true); - LocalLog.AddRoomCreateLog("GetMyPageInfo4 "); - if (Data.MyPage.data.IsExistUnfinishedBattle) - { - DateTime startTime = DateTime.Now; - while ((DateTime.Now - startTime).TotalMilliseconds < (double)Data.MyPage.data.BattleFinishWaitTime) - { - yield return null; - } - MyPageFinishBattleTask myPageFinishBattleTask = new MyPageFinishBattleTask(); - myPageFinishBattleTask.SetParameter(); - if (Data.TreasureBoxCp.IsReceivable) - { - _treasureBoxCpRewardDialogClosed = false; - myPageFinishBattleTask.UnfinishedBattleDialogCloseCallBack = delegate - { - UIManager.GetInstance().StartCoroutine(OpenTreasureBoxCpTreasureBox()); - }; - } - yield return StartCoroutine(Toolbox.NetworkManager.Connect(myPageFinishBattleTask)); - while (!task.isServerResultCodeOK()) - { - yield return null; - } - } - else - { - _ = Data.MyPage.data.IsExistUnfinishedRoom; - } - if (Data.TreasureBoxCp.IsReceivable && !Data.MyPage.data.CanGiveDailyLoginBonus && !Data.MyPage.data.IsExistUnfinishedBattle) - { - _treasureBoxCpRewardDialogClosed = false; - UIManager.GetInstance().StartCoroutine(OpenTreasureBoxCpTreasureBox()); - } - LocalLog.AddRoomCreateLog("GetMyPageInfo5 "); - uiMgr.closeInSceneCenterLoading(); - TopBar.RankTexture.gameObject.SetActive(value: true); - TopBar.SetActiveBattlePoint(isActive: true); - Format inFormat = PlayerStaticData.HighRankFormat(); - PlayerStaticData.LoadUserRankTexture(inFormat); - PlayerStaticData.AttachUserEmblemTexture(TopBar.EmblemTexture, PlayerStaticData.EmblemTexSize.M); - PlayerStaticData.AttachUserRankTexture(TopBar.RankTexture, PlayerStaticData.RankTexSize.S); - if (PlayerStaticData.IsMasterRank(inFormat)) - { - TopBar.SetBattlePoint(PlayerStaticData.UserMasterPointHighAllFormat(), PlayerStaticData.IsMasterRank(inFormat)); - } - else - { - TopBar.SetBattlePoint(PlayerStaticData.UserBattlePointHighFormat(), PlayerStaticData.IsMasterRank(inFormat)); - } - while (!_changeMenuCalled) - { - yield return null; - } - _changeMenuCalled = false; - MyPageItem[] pageItem = _pageItem; - for (int num = 0; num < pageItem.Length; num++) - { - pageItem[num].OnMyPageInfoReceive(); - } - } - - private IEnumerator OpenTreasureBoxCpTreasureBox() - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; - int rupyNumBeforeOpenTreasureBox = PlayerStaticData.UserRupyCount; - MypageTreasureBoxCpOpenTask treasureBoxCpOpentask = new MypageTreasureBoxCpOpenTask(); - treasureBoxCpOpentask.SetParameter(); - yield return StartCoroutine(Toolbox.NetworkManager.Connect(treasureBoxCpOpentask, delegate - { - string atlasName = UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.Arena, null); - _loadFileList.Add(atlasName); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(atlasName, delegate - { - atlasName = UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.Arena, null, isload: true); - UIAtlas component = Toolbox.ResourcesManager.LoadObject(atlasName).GetComponent(); - UIManager.GetInstance().StartCoroutine(RunOpenBoxEffect(treasureBoxCpOpentask.Result, component, rupyNumBeforeOpenTreasureBox, delegate - { - CreateTreasureBoxCpRewardDialog(treasureBoxCpOpentask.Result, delegate - { - RunHideBoxEffect(); - UIManager.GetInstance().UpDateRupyNum(); - }); - })); - })); - })); - } - - private void OnRequestMyPageLoad(NetworkTask.ResultCode error) - { - if (Data.Load.data._receiveInviteCount > 0) - { - _isEnableRoomInvite = true; - } - else - { - _isEnableRoomInvite = false; - } - bool flag = false; - if (Data.MyPageNotifications.data.CampaignBattleWin.SpecialTreasureInfo != null) - { - flag = Data.MyPageNotifications.data.CampaignBattleWin.SpecialTreasureInfo.IsTreasureBoxReadyToOpen; - } - UIManager.GetInstance()._Footer.InviteIconDisp(_isEnableRoomInvite || flag); - UpdateCrystalCount(); - UpdateRupyCount(); - IsMyPageRequestEnd = true; - } - - private void LoadResource() - { - UIManager uiManager = UIManager.GetInstance(); - ResourcesManager resourceManager = Toolbox.ResourcesManager; - List cardPanelList = new List(); - MyPageItem[] pageItem = _pageItem; - for (int i = 0; i < pageItem.Length; i++) - { - MyPageCardPanel[] cardPanelList2 = pageItem[i].CardPanelList; - foreach (MyPageCardPanel myPageCardPanel in cardPanelList2) - { - if (!string.IsNullOrEmpty(myPageCardPanel.FilePath) && !(myPageCardPanel.Texture == null)) - { - string resourcePath = myPageCardPanel.GetResourcePath(isfetch: false); - _loadFileList.Add(resourcePath); - cardPanelList.Add(myPageCardPanel); - uiManager.Force_Increment_LockCountChangeView(); - } - } - } - resourceManager.StartCoroutine_LoadAssetGroupSync(_loadFileList, delegate - { - _loadResourceFinish = true; - int k = 0; - for (int count = cardPanelList.Count; k < count; k++) - { - MyPageCardPanel myPageCardPanel2 = cardPanelList[k]; - myPageCardPanel2.Texture.mainTexture = resourceManager.LoadObject(myPageCardPanel2.GetResourcePath(isfetch: true)) as Texture; - uiManager.Force_Decrement_LockCountChangeView(); - } - }); - } - - private void AttachCardPanelTexture() - { - MyPageItem[] pageItem = _pageItem; - for (int i = 0; i < pageItem.Length; i++) - { - MyPageCardPanel[] cardPanelList = pageItem[i].CardPanelList; - foreach (MyPageCardPanel myPageCardPanel in cardPanelList) - { - if (!string.IsNullOrEmpty(myPageCardPanel.FilePath) && !(myPageCardPanel.Texture == null)) - { - myPageCardPanel.AttachCardPanelTexture(); - } - } - } - } - - private void UnloadResource() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - } - - public void ReloadCardCircle() - { - _homeStatic.ReloadCardCircle(); - } - - public static void SetEnableReloadCard() - { - if (!(Instance == null)) - { - Data.MyPage.CardUpdateFlag = true; - } - } - - public int GetDetailCardCount() - { - return _homeStatic.GetDetailCardCount(); - } - - private void HideNameWindow() - { - iTween.MoveTo(TopBar.NameWindowObject, iTween.Hash("x", TopBar.NameWindowObject.transform.localPosition.x - 450f, "time", 0.3f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void RemoveTween(GameObject obj) - { - iTween component = obj.GetComponent(); - if (component != null) - { - UnityEngine.Object.Destroy(component); - } - } - - public void SetBackButtonEnable() - { - HideNameWindow(); - TopBar.SetBackButtonActive(inActive: true); - RemoveTween(TopBar.TitleObject.gameObject); - RemoveTween(TopBar.BackButton.gameObject); - TopBar.RestorePosition(); - iTween.MoveFrom(TopBar.TitleObject, iTween.Hash("y", TopBar.TitleObject.transform.localPosition.y + 500f, "time", 0.3f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveFrom(TopBar.BackButton.gameObject, iTween.Hash("y", TopBar.BackButton.transform.localPosition.y + 500f, "time", 0.3f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void SetNameBarEnable() - { - iTween.MoveTo(TopBar.NameWindowObject, iTween.Hash("x", _nameWindowDefaultX, "time", 0.3f, "delay", 0, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TopBar.SetBackButtonActive(inActive: false); - TopBar.ChangeNameWindowMode(); - } - - public void ChangeMenu(int index, bool isCutCardMotion = false) - { - UIManager.GetInstance()._Footer.UpdateCurrentIndex(index); - SetNameBarEnable(); - SetDefaultBackButtonHandler(); - if (!_isFirstChangeMenuCall && _currentIndex >= 0 && _currentIndex < _pageItem.Length) - { - _pageItem[_currentIndex].Hide(); - if (_currentIndex == 0 && _currentIndex != index) - { - OnChangeFromHome(); - } - } - _currentIndex = index; - if (index >= 0 && index < _pageItem.Length) - { - _pageItem[index].Show(isCutCardMotion); - } - bool flag = index == 0; - CommonBackGround.Instance.SetMagicCircle(!flag); - Offline.IsConventionMode = false; - _changeMenuCalled = true; - _isFirstChangeMenuCall = false; - } - - private void OnChangeFromHome() - { - if (!(_customBGControl == null)) - { - if (Data.MyPage.data.BGInfo.BGType == MyPageDetail.BGType.RandomBG) - { - RemakeCustomBgForRandom(); - } - if (Data.MyPage.data.BGInfo.BGType == MyPageDetail.BGType.CustomBG) - { - _customBGControl.FadeOut(); - } - CommonBackGround.Instance.EffectVisible = true; - } - } - - private void OnRemakeCustomBg() - { - _remakeCustomBgCount++; - if (_remakeCustomBgCount >= 50) - { - _remakeCustomBgCount = 0; - ReleaseMemory(runGCCollect: true); - } - } - - private static void ReleaseMemory(bool runGCCollect) - { - UIManager.GetInstance().StartCoroutine(ReleaseMemoryBody(runGCCollect)); - } - - private static IEnumerator ReleaseMemoryBody(bool runGCCollect) - { - yield return Resources.UnloadUnusedAssets(); - if (runGCCollect) - { - GC.Collect(); - } - } - - private void RemakeCustomBgForRandom() - { - string text = MyPageItemHome.DecideRandomBG(Data.MyPage.data.BGInfo.RandomIdList); - if (_customBGControl != null && text == _customBGControl.Id) - { - _customBGControl.FadeOut(); - return; - } - _customBGControl.FadeOutDestroy(); - _customBGControl = null; - _customBGControl = NGUITools.AddChild(_customBGControlOriginal.transform.parent.gameObject, _customBGControlOriginal.gameObject).GetComponent(); - _customBGControl.gameObject.SetActive(value: true); - UIManager.GetInstance().OpenNotTouch(); - _customBGControl.Load(text, isDisplaySoon: false, delegate - { - UIManager.GetInstance().offNotTouch(); - OnRemakeCustomBg(); - }); - } - - public void SetDefaultBackButtonHandler() - { - TopBar.SetBackButtonEvent(null, UIManager.ViewScene.None, new EventDelegate(delegate - { - _pageItem[_currentIndex].Show(); - SetNameBarEnable(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SWITCH_MENU); - })); - } - - public void GoToFreeMatch() - { - SetBackButtonEnable(); - _pageItemBattle.GoToFreeMatch(); - } - - public void GoToRoomMatch() - { - SetBackButtonEnable(); - _pageItemBattle.GoToRoomMatch(); - } - - public void SetAfterSpecialWinRewardOpened() - { - _pageItemBattle.SpecialWinRewardIconActive(active: false); - _pageItemBattle.RedrawBattleCampaign(); - _pageItemArena.RedrawBattleCampaign(); - } - - public void GoToPracticeTypeSelect() - { - _pageItemSoroPlay.GotoPracticeTypeSelect(); - } - - public void GoToChallengeMenu() - { - _pageItemArena.GoToChallengeMenu(); - } - - public void GoToColosseum(bool isColosseumTask = true) - { - _pageItemArena.GoToColosseum(isColosseumTask); - } - - public void GoToCompetition() - { - _pageItemArena.GoToCompetition(); - } - - public void GoToConventionListMenu() - { - _pageItemArena.GoToConventionListMenu(); - } - - public void GoToConventionActionMenu(ConventionInfo conventionInfo) - { - _pageItemArena.GoToConventionActionMenu(conventionInfo); - } - - public void GoToGatheringActionMenu() - { - _pageItemArena.GoToGatheringMenu(); - } - - public void GoToShopSupply() - { - _pageItemShop.GoToShopSupply(); - } - - public void GoToShopCard() - { - _pageItemShop.GoToShopCard(); - } - - public void GoToCardDeck() - { - _pageItemCard.GoToCardDeck(); - } - - private static UIManager.ChangeViewSceneParam CreateMyPageChangeParam(int index, bool isCutCard) - { - return new UIManager.ChangeViewSceneParam - { - MyPageMenuIndex = index, - IsCutCardMotion = isCutCard, - IsUpdateFooterMenuTexture = true - }; - } - - public static void ChangeSceneAndBuyCard(Action onChange) - { - UIManager.ChangeViewSceneParam changeViewSceneParam = CreateMyPageChangeParam(5, isCutCard: true); - changeViewSceneParam.OnFinishChangeView = delegate - { - Instance.GoToShopCard(); - onChange.Call(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - public static void ChangeSceneAndBuySupply(Action onChange) - { - UIManager.GetInstance()._Footer.UpdateCurrentIndex(5); - UIManager.ChangeViewSceneParam changeViewSceneParam = CreateMyPageChangeParam(5, isCutCard: true); - changeViewSceneParam.OnFinishChangeView = delegate - { - Instance.GoToShopSupply(); - onChange.Call(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - public void ShowBanner() - { - if (_pageItemHome != null) - { - _pageItemHome.ShowBanner(); - } - } - - public void HideBanner() - { - if (_pageItemHome != null) - { - _pageItemHome.HideBanner(); - } - } - - public void RoomInviteClear() - { - _isEnableRoomInvite = false; - } - - public void OnReadGift() - { - if (_pageItemHome != null) - { - _pageItemHome.OnReadGift(); - } - } - - private void OnClickCrystalBuyButton() - { - } - - private void OnClickNameWindow() - { - if (!IsFirstGuid) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.IsUpdateFooterMenuTexture = true; - changeViewSceneParam.OnChange = delegate - { - CommonBackGround.Instance.SetMagicCircle(isVisible: true); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Profile, changeViewSceneParam); - } - } - - public void UpdateCrystalCount() - { - UIManager.GetInstance().UpDateCrystalNum(); - } - - public void UpdateRupyCount() - { - UIManager.GetInstance().UpDateRupyNum(); - } - - public void UpdateMissionCount() - { - if (_pageItemHome != null) - { - _pageItemHome.UpdateMissionNumber(); - } - } - - public void ShowNotification(List notifications) - { - if (notifications.Count != 0) - { - if (_maintenanceNotification != null) - { - UnityEngine.Object.Destroy(_maintenanceNotification.gameObject); - _maintenanceNotification = null; - } - _maintenanceNotification = NGUITools.AddChild(base.gameObject, _maintenanceNotificationPrefab.gameObject).GetComponent(); - _maintenanceNotification.gameObject.layer = LayerMask.NameToLayer("SystemUI"); - StartCoroutine(_maintenanceNotification.Show(notifications)); - } - } - - private IEnumerator RunOpenBoxEffect(MypageTreasureBoxCpOpenTask.MypageTreasureBoxCpOpenTaskData result, UIAtlas arenaAtlas, int rupyNumBeforeOpenTreasureBox, Action endAction) - { - UIManager.GetInstance().UpdateLastRupyNum(rupyNumBeforeOpenTreasureBox); - while (!IsFadeoutEnd) - { - yield return null; - } - UIManager.GetInstance().OpenNotTouch(); - _notTouchMypageCollider.enabled = true; - yield return new WaitForSeconds(1f); - _boxOpenEffectObj = NGUITools.AddChild(base.gameObject, Resources.Load("UI/layoutParts/RankWinnerRewardResultPanel") as GameObject); - NguiObjs component = _boxOpenEffectObj.GetComponent(); - UISprite bg = component.sprites[0]; - UISprite window = component.sprites[1]; - UISprite box = component.sprites[2]; - box.atlas = arenaAtlas; - UILabel label = component.labels[0]; - label.text = Data.SystemText.Get("TreasureBoxCp_0026"); - UIPanel panel = _boxOpenEffectObj.GetComponent(); - panel.alpha = 0f; - box.spriteName = $"box_2pick_0{TreasureBoxCp.GRADE_TO_TREASURE_BOX_ID[result.Grade]}_close"; - string loadEffectName = $"cmn_arena_treasure_{TreasureBoxCp.GRADE_TO_TREASURE_BOX_ID[result.Grade] + 1}"; - List list = new List(); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D)); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(list, null)); - _treasureEffectObj = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _treasureEffectObj.transform.parent = _boxOpenEffectObj.transform; - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_treasureEffectObj, null); - _boxOpenEffectObj.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); - bg.alpha = 0f; - box.alpha = 0f; - label.alpha = 0f; - panel.alpha = 1f; - TweenAlpha.Begin(bg.gameObject, 0.5f, 0.65f); - TweenAlpha.Begin(label.gameObject, 0.5f, 1f); - TweenAlpha.Begin(box.gameObject, 0.5f, 1f); - label.transform.localPosition = new Vector3(100f, 0f, 0f); - window.transform.localScale = new Vector3(1f, 0.01f, 1f); - box.transform.localPosition = new Vector3(180f, 0f, 0f); - iTween.MoveTo(label.gameObject, iTween.Hash("x", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(window.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.MoveTo(box.gameObject, iTween.Hash("y", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.8f); - TweenAlpha.Begin(label.gameObject, 0.5f, 0f); - iTween.MoveTo(box.gameObject, iTween.Hash("x", 0f, "time", 0.7f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_BOX_OPEN); - yield return new WaitForSeconds(1f); - _treasureEffectObj.transform.localPosition = box.transform.localPosition; - _treasureEffectObj.transform.localScale = Vector3.one * 320f * 1.75f; - _treasureEffectObj.SetActive(value: true); - box.gameObject.SetActive(value: false); - yield return new WaitForSeconds(1.2f); - endAction.Call(); - } - - private void CreateTreasureBoxCpRewardDialog(MypageTreasureBoxCpOpenTask.MypageTreasureBoxCpOpenTaskData result, Action endAction) - { - if (result == null || result.RewardDataList.Count() <= 0) - { - _treasureBoxCpRewardDialogClosed = true; - endAction.Call(); - return; - } - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(1000, isSetBackViewDepthImmediately: true); - dialogBase.SetTitleLabel(Data.SystemText.Get("TreasureBoxCp_0001")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelSortingOrder(37); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - _treasureBoxCpRewardDialogClosed = true; - }); - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, _rewardBase.gameObject).GetComponent(); - for (int num = 0; num < result.RewardDataList.Count; num++) - { - component.AddReward(result.RewardDataList[num]); - } - UIPanel component2 = component.gameObject.GetComponent(); - component2.sortingOrder = 37; - component2.depth = 1005; - component.EndCreate(); - endAction.Call(); - } - - private void RunHideBoxEffect() - { - _treasureEffectObj.SetActive(value: false); - _boxOpenEffectObj.SetActive(value: false); - UnityEngine.Object.Destroy(_boxOpenEffectObj); - UnityEngine.Object.Destroy(_treasureEffectObj); - UIManager.GetInstance().offNotTouch(); - _notTouchMypageCollider.enabled = false; - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - } - - public static void SetMyPageRefreshDisableOnce() - { - if (!(Instance == null)) - { - Instance._isStopMyPageRefreshOnce = true; - } - } - - protected void OnApplicationFocus(bool focusStatus) - { - if (focusStatus && _isStopMyPageRefreshOnce) - { - _isStopMyPageRefreshOnce = false; - } - else if (!UIManager.GetInstance().IsCrystalDialogExe && UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.MyPage && focusStatus && !BattleMenu.IsStopSendMyPageRefreshTask() && !Toolbox.NetworkManager.isConnect && !Toolbox.NetworkManager.isTimeOut && !Toolbox.NetworkManager.isError && Data.MyPage != null && Data.MyPage.data != null) - { - MyPageRefreshTask myPageRefreshTask = new MyPageRefreshTask(); - myPageRefreshTask.SetParameter(); - StartCoroutine(Toolbox.NetworkManager.Connect(myPageRefreshTask, delegate - { - RefreshInviteIcon(); - RefreshGatheringNotification(); - })); - } - } - - private void RefreshInviteIcon() - { - bool isInvite = false; - if (Data.Load.data._receiveInviteCount > 0) - { - isInvite = true; - } - bool isTreasureBoxReadyToOpen = false; - if (Data.MyPageNotifications.data.CampaignBattleWin.SpecialTreasureInfo != null) - { - isTreasureBoxReadyToOpen = Data.MyPageNotifications.data.CampaignBattleWin.SpecialTreasureInfo.IsTreasureBoxReadyToOpen; - } - ReceivedInvite(isInvite, isTreasureBoxReadyToOpen); - } - - private void RefreshGatheringNotification() - { - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - if (_pageItemArena != null) - { - _pageItemArena.ShowGatheringBadge(); - } - } - - public void ReceivedInvite(bool isInvite, bool isTreasureBoxReadyToOpen = false) - { - _isEnableRoomInvite = isInvite; - UIManager.GetInstance()._Footer.InviteIconDisp(isInvite || isTreasureBoxReadyToOpen); - } - - public void SpecialWinRewardOpened() - { - bool isEnableRoomInvite = _isEnableRoomInvite; - UIManager.GetInstance()._Footer.InviteIconDisp(isEnableRoomInvite); - } - - public BoxCollider GetNotTouchMypageCollider() - { - return _notTouchMypageCollider; - } - - public void SetGatheringPush(bool isNotification) - { - Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification = isNotification; - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - } - - public void SetGuideEffect(Transform parent, Vector3 localPosition, float rotation) - { - if (!(FirstGuidEffect == null)) - { - FirstGuidEffect.gameObject.SetActive(value: true); - FirstGuidEffect.transform.parent = parent; - FirstGuidEffect.transform.localPosition = localPosition; - FirstGuidEffect.transform.localRotation = Quaternion.Euler(0f, 0f, rotation); - FirstGuidEffect.gameObject.SetLayer(parent.gameObject.layer, isSetChildren: true); - } - } -} +using System.Collections.Generic; +using UnityEngine; +using Wizard; + +// PASS-8/Phase-1 STUB: 1,066-line client-side mypage hub reduced to its compile-time +// surface. Nothing constructs a MyPageMenu in the headless node; the ~50 external +// callers reach `MyPageMenu.Instance.Foo()` from UI event handlers that never fire on +// the node's IsRecovery=true receive path. `Instance` returns null so those chains +// NRE at read-time if they ever ran — they don't. The three genuinely-static members +// (IsMyPageRequestEnd flag, SetEnableReloadCard, CreateDialogForTutorial) return +// defaults that match the "no UI ran" state. +public class MyPageMenu : UIBase +{ + public static MyPageMenu Instance => null; + + public MyPageItemHome HomeMenu => null; + public MyPageItemBattle BattleMenu => null; + public bool IsEnableFooterCurrentMenu => false; + public bool IsVisible => false; + + public bool _treasureBoxCpRewardDialogClosed => true; + public bool IsEnableRoomInvite => false; + public bool IsFirstGuid => false; + public TopBar TopBar { get; set; } + public MyPageCustomBGControl CustomBGControl => null; + public List WinnerRewardInfoCopy => new List(); + + public static void SetEnableReloadCard() { } + public static DialogBase CreateDialogForTutorial() => null; + + public void ChangeMenu(int index, bool isCutCardMotion = false) { } + public void ChangeMyPageBG(MyPageDetail.BGType type, string id) { } + public void SetBackButtonEnable() { } + public void RoomInviteClear() { } + public BoxCollider GetNotTouchMypageCollider() => null; + public void SetDefaultBackButtonHandler() { } + public void FinishTutorialMode() { } + public void ResetFirstGuide() { } + public void OnReadGift() { } + public void SpecialWinRewardOpened() { } + public void SetAfterSpecialWinRewardOpened() { } + public void SetGuideEffect(Transform parent, Vector3 localPosition, float rotation) { } + public void SetGuideToOkOnlyDialog(DialogBase dialog) { } + public void UpdateMissionCount() { } + public void UpdateCrystalCount() { } + public void UpdateRupyCount() { } + + public void GoToCardDeck() { } + public void GoToChallengeMenu() { } + public void GoToColosseum(bool isColosseumTask = true) { } + public void GoToCompetition() { } + public void GoToConventionActionMenu(ConventionInfo conventionInfo) { } + public void GoToConventionListMenu() { } + public void GoToFreeMatch() { } + public void GoToPracticeTypeSelect() { } + public void GoToShopCard() { } + public void GoToShopSupply() { } +} diff --git a/SVSim.BattleEngine/Engine/MyPageShopCrystalApeal.cs b/SVSim.BattleEngine/Engine/MyPageShopCrystalApeal.cs deleted file mode 100644 index 6199f95f..00000000 --- a/SVSim.BattleEngine/Engine/MyPageShopCrystalApeal.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; - -public class MyPageShopCrystalApeal : MonoBehaviour -{ - private enum State - { - INIT, - SUCCESS, - ERROR - } - - private const int TIME_LIMIT_BORDER_SECOND = 172800; - - [SerializeField] - private UILabel _timeLimit; - - [SerializeField] - private GameObject _newIcon; - - private State _state; - - public IEnumerator Initialize(double serverTime) - { - _state = State.INIT; - PaymentPC paymentImpl = PaymentPC.GetInstance(); - paymentImpl.initialize(); - paymentImpl.ProductListSucceeded += OnSuccessGetProductList; - paymentImpl.ProductListFailed += OnFailedGetProductList; - while (_state == State.INIT) - { - yield return null; - } - ClearPaymentHandler(); - if (_state == State.ERROR) - { - yield break; - } - RemainTime remainTime = null; - foreach (string productId in paymentImpl.ProductIdList) - { - if (paymentImpl.ProductCurrentPurchaseCount.ContainsKey(productId)) - { - int num = paymentImpl.ProductCurrentPurchaseCount[productId]; - int num2 = paymentImpl.ProductPurchaseLimitCount[productId]; - if (num >= num2) - { - continue; - } - } - RemainTime remainTime2 = new RemainTime(paymentImpl.ProductEndTime[productId], serverTime); - if (remainTime2.Second <= 172800 && remainTime2.Second > 0) - { - if (remainTime == null) - { - remainTime = remainTime2; - } - else if (remainTime2.Second < remainTime.Second) - { - remainTime = remainTime2; - } - } - } - if (remainTime != null) - { - _timeLimit.gameObject.SetActive(value: true); - _timeLimit.text = remainTime.GetShowText(); - } - else - { - _timeLimit.gameObject.SetActive(value: false); - } - _newIcon.SetActive(Data.Load.data._userCrystalCount.NeedNewIcon); - } - - private void OnSuccessGetProductList() - { - _state = State.SUCCESS; - } - - private void OnFailedGetProductList() - { - _state = State.ERROR; - } - - private void ClearPaymentHandler() - { - PaymentPC instance = PaymentPC.GetInstance(); - instance.ProductListSucceeded -= OnSuccessGetProductList; - instance.ProductListFailed -= OnFailedGetProductList; - } -} diff --git a/SVSim.BattleEngine/Engine/MyPageSubBanner.cs b/SVSim.BattleEngine/Engine/MyPageSubBanner.cs index 9918affb..4c61ded3 100644 --- a/SVSim.BattleEngine/Engine/MyPageSubBanner.cs +++ b/SVSim.BattleEngine/Engine/MyPageSubBanner.cs @@ -5,7 +5,6 @@ using Wizard; public class MyPageSubBanner : MyPageBannerBase { - private const int BANNER_VERTICAL_SPACING = 73; [SerializeField] private GameObject _bannerRoot; diff --git a/SVSim.BattleEngine/Engine/NGUIDebug.cs b/SVSim.BattleEngine/Engine/NGUIDebug.cs deleted file mode 100644 index 349d1f9a..00000000 --- a/SVSim.BattleEngine/Engine/NGUIDebug.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -[AddComponentMenu("NGUI/Internal/Debug")] -public class NGUIDebug : MonoBehaviour -{ - private static bool mRayDebug = false; - - private static List mLines = new List(); - - private static NGUIDebug mInstance = null; - - public static bool debugRaycast - { - get - { - return mRayDebug; - } - set - { - mRayDebug = value; - if (value && Application.isPlaying) - { - CreateInstance(); - } - } - } - - public static void CreateInstance() - { - if (mInstance == null) - { - GameObject obj = new GameObject("_NGUI Debug"); - mInstance = obj.AddComponent(); - Object.DontDestroyOnLoad(obj); - } - } - - private static void LogString(string text) - { - if (Application.isPlaying) - { - if (mLines.Count > 20) - { - mLines.RemoveAt(0); - } - mLines.Add(text); - CreateInstance(); - } - } - - public static void Log(params object[] objs) - { - string text = ""; - for (int i = 0; i < objs.Length; i++) - { - text = ((i != 0) ? (text + ", " + objs[i].ToString()) : (text + objs[i].ToString())); - } - LogString(text); - } - - public static void Clear() - { - mLines.Clear(); - } - - public static void DrawBounds(Bounds b) - { - _ = b.center; - _ = b.center - b.extents; - _ = b.center + b.extents; - } - - private void OnGUI() - { - Rect position = new Rect(5f, 5f, 1000f, 22f); - if (mRayDebug) - { - string text = "Scheme: " + UICamera.currentScheme; - GUI.color = Color.black; - GUI.Label(position, text); - position.y -= 1f; - position.x -= 1f; - GUI.color = Color.white; - GUI.Label(position, text); - position.y += 18f; - position.x += 1f; - text = "Hover: " + NGUITools.GetHierarchy(UICamera.hoveredObject).Replace("\"", ""); - GUI.color = Color.black; - GUI.Label(position, text); - position.y -= 1f; - position.x -= 1f; - GUI.color = Color.white; - GUI.Label(position, text); - position.y += 18f; - position.x += 1f; - text = "Selection: " + NGUITools.GetHierarchy(UICamera.selectedObject).Replace("\"", ""); - GUI.color = Color.black; - GUI.Label(position, text); - position.y -= 1f; - position.x -= 1f; - GUI.color = Color.white; - GUI.Label(position, text); - position.y += 18f; - position.x += 1f; - text = "Controller: " + NGUITools.GetHierarchy(UICamera.controllerNavigationObject).Replace("\"", ""); - GUI.color = Color.black; - GUI.Label(position, text); - position.y -= 1f; - position.x -= 1f; - GUI.color = Color.white; - GUI.Label(position, text); - position.y += 18f; - position.x += 1f; - text = "Active events: " + UICamera.CountInputSources(); - if (UICamera.disableController) - { - text += ", disabled controller"; - } - if (UICamera.inputHasFocus) - { - text += ", input focus"; - } - GUI.color = Color.black; - GUI.Label(position, text); - position.y -= 1f; - position.x -= 1f; - GUI.color = Color.white; - GUI.Label(position, text); - position.y += 18f; - position.x += 1f; - } - int i = 0; - for (int count = mLines.Count; i < count; i++) - { - GUI.color = Color.black; - GUI.Label(position, mLines[i]); - position.y -= 1f; - position.x -= 1f; - GUI.color = Color.white; - GUI.Label(position, mLines[i]); - position.y += 18f; - position.x += 1f; - } - } -} diff --git a/SVSim.BattleEngine/Engine/NGUIMath.cs b/SVSim.BattleEngine/Engine/NGUIMath.cs index 18171339..ba0220c8 100644 --- a/SVSim.BattleEngine/Engine/NGUIMath.cs +++ b/SVSim.BattleEngine/Engine/NGUIMath.cs @@ -10,21 +10,6 @@ public static class NGUIMath return from * (1f - factor) + to * factor; } - [DebuggerHidden] - [DebuggerStepThrough] - public static int ClampIndex(int val, int max) - { - if (val >= 0) - { - if (val >= max) - { - return max - 1; - } - return val; - } - return 0; - } - [DebuggerHidden] [DebuggerStepThrough] public static int RepeatIndex(int val, int max) @@ -44,28 +29,6 @@ public static class NGUIMath return val; } - [DebuggerHidden] - [DebuggerStepThrough] - public static float WrapAngle(float angle) - { - while (angle > 180f) - { - angle -= 360f; - } - while (angle < -180f) - { - angle += 360f; - } - return angle; - } - - [DebuggerHidden] - [DebuggerStepThrough] - public static float Wrap01(float val) - { - return val - (float)Mathf.FloorToInt(val); - } - [DebuggerHidden] [DebuggerStepThrough] public static int HexToDecimal(char ch) @@ -115,29 +78,6 @@ public static class NGUIMath } } - [DebuggerHidden] - [DebuggerStepThrough] - public static char DecimalToHexChar(int num) - { - if (num > 15) - { - return 'F'; - } - if (num < 10) - { - return (char)(48 + num); - } - return (char)(65 + num - 10); - } - - [DebuggerHidden] - [DebuggerStepThrough] - public static string DecimalToHex8(int num) - { - num &= 0xFF; - return num.ToString("X2"); - } - [DebuggerHidden] [DebuggerStepThrough] public static string DecimalToHex24(int num) @@ -160,43 +100,6 @@ public static class NGUIMath return 0 | (Mathf.RoundToInt(c.r * 255f) << 24) | (Mathf.RoundToInt(c.g * 255f) << 16) | (Mathf.RoundToInt(c.b * 255f) << 8) | Mathf.RoundToInt(c.a * 255f); } - [DebuggerHidden] - [DebuggerStepThrough] - public static Color IntToColor(int val) - { - float num = 0.003921569f; - Color black = Color.black; - black.r = num * (float)((val >> 24) & 0xFF); - black.g = num * (float)((val >> 16) & 0xFF); - black.b = num * (float)((val >> 8) & 0xFF); - black.a = num * (float)(val & 0xFF); - return black; - } - - [DebuggerHidden] - [DebuggerStepThrough] - public static string IntToBinary(int val, int bits) - { - string text = ""; - int num = bits; - while (num > 0) - { - if (num == 8 || num == 16 || num == 24) - { - text += " "; - } - text += (((val & (1 << --num)) != 0) ? '1' : '0'); - } - return text; - } - - [DebuggerHidden] - [DebuggerStepThrough] - public static Color HexToColor(uint val) - { - return IntToColor((int)val); - } - public static Rect ConvertToTexCoords(Rect rect, int width, int height) { Rect result = rect; @@ -230,25 +133,6 @@ public static class NGUIMath return result; } - public static Rect MakePixelPerfect(Rect rect) - { - rect.xMin = Mathf.RoundToInt(rect.xMin); - rect.yMin = Mathf.RoundToInt(rect.yMin); - rect.xMax = Mathf.RoundToInt(rect.xMax); - rect.yMax = Mathf.RoundToInt(rect.yMax); - return rect; - } - - public static Rect MakePixelPerfect(Rect rect, int width, int height) - { - rect = ConvertToPixels(rect, width, height, round: true); - rect.xMin = Mathf.RoundToInt(rect.xMin); - rect.yMin = Mathf.RoundToInt(rect.yMin); - rect.xMax = Mathf.RoundToInt(rect.xMax); - rect.yMax = Mathf.RoundToInt(rect.yMax); - return ConvertToTexCoords(rect, width, height); - } - public static Vector2 ConstrainRect(Vector2 minRect, Vector2 maxRect, Vector2 minArea, Vector2 maxArea) { Vector2 zero = Vector2.zero; @@ -483,138 +367,6 @@ public static class NGUIMath return vector * 0.06f; } - public static Vector2 SpringDampen(ref Vector2 velocity, float strength, float deltaTime) - { - if (deltaTime > 1f) - { - deltaTime = 1f; - } - float f = 1f - strength * 0.001f; - int num = Mathf.RoundToInt(deltaTime * 1000f); - float num2 = Mathf.Pow(f, num); - Vector2 vector = velocity * ((num2 - 1f) / Mathf.Log(f)); - velocity *= num2; - return vector * 0.06f; - } - - public static float SpringLerp(float strength, float deltaTime) - { - if (deltaTime > 1f) - { - deltaTime = 1f; - } - int num = Mathf.RoundToInt(deltaTime * 1000f); - deltaTime = 0.001f * strength; - float num2 = 0f; - for (int i = 0; i < num; i++) - { - num2 = Mathf.Lerp(num2, 1f, deltaTime); - } - return num2; - } - - public static float SpringLerp(float from, float to, float strength, float deltaTime) - { - if (deltaTime > 1f) - { - deltaTime = 1f; - } - int num = Mathf.RoundToInt(deltaTime * 1000f); - deltaTime = 0.001f * strength; - for (int i = 0; i < num; i++) - { - from = Mathf.Lerp(from, to, deltaTime); - } - return from; - } - - public static Vector2 SpringLerp(Vector2 from, Vector2 to, float strength, float deltaTime) - { - return Vector2.Lerp(from, to, SpringLerp(strength, deltaTime)); - } - - public static Vector3 SpringLerp(Vector3 from, Vector3 to, float strength, float deltaTime) - { - return Vector3.Lerp(from, to, SpringLerp(strength, deltaTime)); - } - - public static Quaternion SpringLerp(Quaternion from, Quaternion to, float strength, float deltaTime) - { - return Quaternion.Slerp(from, to, SpringLerp(strength, deltaTime)); - } - - public static float RotateTowards(float from, float to, float maxAngle) - { - float num = WrapAngle(to - from); - if (Mathf.Abs(num) > maxAngle) - { - num = maxAngle * Mathf.Sign(num); - } - return from + num; - } - - private static float DistancePointToLineSegment(Vector2 point, Vector2 a, Vector2 b) - { - float sqrMagnitude = (b - a).sqrMagnitude; - if (sqrMagnitude == 0f) - { - return (point - a).magnitude; - } - float num = Vector2.Dot(point - a, b - a) / sqrMagnitude; - if (num < 0f) - { - return (point - a).magnitude; - } - if (num > 1f) - { - return (point - b).magnitude; - } - Vector2 vector = a + num * (b - a); - return (point - vector).magnitude; - } - - public static float DistanceToRectangle(Vector2[] screenPoints, Vector2 mousePos) - { - bool flag = false; - int val = 4; - for (int i = 0; i < 5; i++) - { - Vector3 vector = screenPoints[RepeatIndex(i, 4)]; - Vector3 vector2 = screenPoints[RepeatIndex(val, 4)]; - if (vector.y > mousePos.y != vector2.y > mousePos.y && mousePos.x < (vector2.x - vector.x) * (mousePos.y - vector.y) / (vector2.y - vector.y) + vector.x) - { - flag = !flag; - } - val = i; - } - if (!flag) - { - float num = -1f; - for (int j = 0; j < 4; j++) - { - Vector3 vector3 = screenPoints[j]; - Vector3 vector4 = screenPoints[RepeatIndex(j + 1, 4)]; - float num2 = DistancePointToLineSegment(mousePos, vector3, vector4); - if (num2 < num || num < 0f) - { - num = num2; - } - } - return num; - } - return 0f; - } - - public static float DistanceToRectangle(Vector3[] worldPoints, Vector2 mousePos, Camera cam) - { - Vector2[] array = new Vector2[4]; - for (int i = 0; i < 4; i++) - { - array[i] = cam.WorldToScreenPoint(worldPoints[i]); - } - return DistanceToRectangle(array, mousePos); - } - public static Vector2 GetPivotOffset(UIWidget.Pivot pv) { Vector2 zero = Vector2.zero; @@ -690,11 +442,6 @@ public static class NGUIMath return UIWidget.Pivot.Center; } - public static void MoveWidget(UIRect w, float x, float y) - { - MoveRect(w, x, y); - } - public static void MoveRect(UIRect rect, float x, float y) { int num = Mathf.FloorToInt(x + 0.5f); @@ -727,70 +474,11 @@ public static class NGUIMath } } - public static void ResizeWidget(UIWidget w, UIWidget.Pivot pivot, float x, float y, int minWidth, int minHeight) - { - ResizeWidget(w, pivot, x, y, 2, 2, 100000, 100000); - } - - public static void ResizeWidget(UIWidget w, UIWidget.Pivot pivot, float x, float y, int minWidth, int minHeight, int maxWidth, int maxHeight) - { - if (pivot == UIWidget.Pivot.Center) - { - int num = Mathf.RoundToInt(x - (float)w.width); - int num2 = Mathf.RoundToInt(y - (float)w.height); - num -= num & 1; - num2 -= num2 & 1; - if ((num | num2) != 0) - { - num >>= 1; - num2 >>= 1; - AdjustWidget(w, -num, -num2, num, num2, minWidth, minHeight); - } - return; - } - Vector3 vector = new Vector3(x, y); - vector = Quaternion.Inverse(w.cachedTransform.localRotation) * vector; - switch (pivot) - { - case UIWidget.Pivot.BottomLeft: - AdjustWidget(w, vector.x, vector.y, 0f, 0f, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.Left: - AdjustWidget(w, vector.x, 0f, 0f, 0f, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.TopLeft: - AdjustWidget(w, vector.x, 0f, 0f, vector.y, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.Top: - AdjustWidget(w, 0f, 0f, 0f, vector.y, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.TopRight: - AdjustWidget(w, 0f, 0f, vector.x, vector.y, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.Right: - AdjustWidget(w, 0f, 0f, vector.x, 0f, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.BottomRight: - AdjustWidget(w, 0f, vector.y, vector.x, 0f, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.Bottom: - AdjustWidget(w, 0f, vector.y, 0f, 0f, minWidth, minHeight, maxWidth, maxHeight); - break; - case UIWidget.Pivot.Center: - break; - } - } - public static void AdjustWidget(UIWidget w, float left, float bottom, float right, float top) { AdjustWidget(w, left, bottom, right, top, 2, 2, 100000, 100000); } - public static void AdjustWidget(UIWidget w, float left, float bottom, float right, float top, int minWidth, int minHeight) - { - AdjustWidget(w, left, bottom, right, top, minWidth, minHeight, 100000, 100000); - } - public static void AdjustWidget(UIWidget w, float left, float bottom, float right, float top, int minWidth, int minHeight, int maxWidth, int maxHeight) { Vector2 pivotOffset = w.pivotOffset; @@ -960,74 +648,4 @@ public static class NGUIMath } return num2; } - - public static Vector2 ScreenToPixels(Vector2 pos, Transform relativeTo) - { - Camera camera = NGUITools.FindCameraForLayer(relativeTo.gameObject.layer); - if (camera == null) - { - return pos; - } - Vector3 position = camera.ScreenToWorldPoint(pos); - return relativeTo.InverseTransformPoint(position); - } - - public static Vector2 ScreenToParentPixels(Vector2 pos, Transform relativeTo) - { - int layer = relativeTo.gameObject.layer; - if (relativeTo.parent != null) - { - relativeTo = relativeTo.parent; - } - Camera camera = NGUITools.FindCameraForLayer(layer); - if (camera == null) - { - return pos; - } - Vector3 vector = camera.ScreenToWorldPoint(pos); - return (relativeTo != null) ? relativeTo.InverseTransformPoint(vector) : vector; - } - - public static Vector3 WorldToLocalPoint(Vector3 worldPos, Camera worldCam, Camera uiCam, Transform relativeTo) - { - worldPos = worldCam.WorldToViewportPoint(worldPos); - worldPos = uiCam.ViewportToWorldPoint(worldPos); - if (relativeTo == null) - { - return worldPos; - } - relativeTo = relativeTo.parent; - if (relativeTo == null) - { - return worldPos; - } - return relativeTo.InverseTransformPoint(worldPos); - } - - public static void OverlayPosition(this Transform trans, Vector3 worldPos, Camera worldCam, Camera myCam) - { - worldPos = worldCam.WorldToViewportPoint(worldPos); - worldPos = myCam.ViewportToWorldPoint(worldPos); - Transform parent = trans.parent; - trans.localPosition = ((parent != null) ? parent.InverseTransformPoint(worldPos) : worldPos); - } - - public static void OverlayPosition(this Transform trans, Vector3 worldPos, Camera worldCam) - { - Camera camera = NGUITools.FindCameraForLayer(trans.gameObject.layer); - if (camera != null) - { - trans.OverlayPosition(worldPos, worldCam, camera); - } - } - - public static void OverlayPosition(this Transform trans, Transform target) - { - Camera camera = NGUITools.FindCameraForLayer(trans.gameObject.layer); - Camera camera2 = NGUITools.FindCameraForLayer(target.gameObject.layer); - if (camera != null && camera2 != null) - { - trans.OverlayPosition(target.position, camera2, camera); - } - } } diff --git a/SVSim.BattleEngine/Engine/NGUIText.cs b/SVSim.BattleEngine/Engine/NGUIText.cs index d19c3a0e..b32aa369 100644 --- a/SVSim.BattleEngine/Engine/NGUIText.cs +++ b/SVSim.BattleEngine/Engine/NGUIText.cs @@ -95,8 +95,6 @@ public static class NGUIText public static bool useSymbols = false; - private static Color mInvisible = new Color(0f, 0f, 0f, 0f); - private static BetterList mColors = new BetterList(); private static float mAlpha = 1f; @@ -105,12 +103,6 @@ public static class NGUIText private static BetterList mSizes = new BetterList(); - private static Color32 s_c0; - - private static Color32 s_c1; - - private static float[] mBoldOffset = new float[8] { -0.25f, 0f, 0.25f, 0f, 0f, -0.25f, 0f, 0.25f }; - public static void Update(UIWidget.Pivot piv) { Update(request: true, piv); @@ -288,20 +280,6 @@ public static class NGUIText return glyph; } - [DebuggerHidden] - [DebuggerStepThrough] - public static float ParseAlpha(string text, int index) - { - return Mathf.Clamp01((float)((NGUIMath.HexToDecimal(text[index + 1]) << 4) | NGUIMath.HexToDecimal(text[index + 2])) / 255f); - } - - [DebuggerHidden] - [DebuggerStepThrough] - public static Color ParseColor(string text, int offset) - { - return ParseColor24(text, offset); - } - [DebuggerHidden] [DebuggerStepThrough] public static Color ParseColor24(string text, int offset) @@ -332,20 +310,6 @@ public static class NGUIText return EncodeColor24(c); } - [DebuggerHidden] - [DebuggerStepThrough] - public static string EncodeColor(string text, Color c) - { - return "[c][" + EncodeColor24(c) + "]" + text + "[-][/c]"; - } - - [DebuggerHidden] - [DebuggerStepThrough] - public static string EncodeAlpha(float a) - { - return NGUIMath.DecimalToHex8(Mathf.Clamp(Mathf.RoundToInt(a * 255f), 0, 255)); - } - [DebuggerHidden] [DebuggerStepThrough] public static string EncodeColor24(Color c) @@ -386,184 +350,6 @@ public static class NGUIText return true; } - public static bool ParseSymbol(string text, ref int index, BetterList colors, bool premultiply, ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike, ref bool ignoreColor) - { - int length = text.Length; - if (index + 3 > length || text[index] != '[') - { - return false; - } - if (text[index + 2] == ']') - { - if (text[index + 1] == '-') - { - if (colors != null && colors.size > 1) - { - colors.RemoveAt(colors.size - 1); - } - index += 3; - return true; - } - switch (text.Substring(index, 3)) - { - case "[b]": - bold = true; - index += 3; - return true; - case "[i]": - italic = true; - index += 3; - return true; - case "[u]": - underline = true; - index += 3; - return true; - case "[s]": - strike = true; - index += 3; - return true; - case "[c]": - ignoreColor = true; - index += 3; - return true; - } - } - if (index + 4 > length) - { - return false; - } - if (text[index + 3] == ']') - { - switch (text.Substring(index, 4)) - { - case "[/b]": - bold = false; - index += 4; - return true; - case "[/i]": - italic = false; - index += 4; - return true; - case "[/u]": - underline = false; - index += 4; - return true; - case "[/s]": - strike = false; - index += 4; - return true; - case "[/c]": - ignoreColor = false; - index += 4; - return true; - } - char ch = text[index + 1]; - char ch2 = text[index + 2]; - if (IsHex(ch) && IsHex(ch2)) - { - mAlpha = (float)((NGUIMath.HexToDecimal(ch) << 4) | NGUIMath.HexToDecimal(ch2)) / 255f; - index += 4; - return true; - } - } - if (index + 5 > length) - { - return false; - } - if (text[index + 4] == ']') - { - switch (text.Substring(index, 5)) - { - case "[sub]": - sub = 1; - index += 5; - return true; - case "[sup]": - sub = 2; - index += 5; - return true; - } - } - if (index + 6 > length) - { - return false; - } - if (text[index + 5] == ']') - { - switch (text.Substring(index, 6)) - { - case "[/sub]": - sub = 0; - index += 6; - return true; - case "[/sup]": - sub = 0; - index += 6; - return true; - case "[/url]": - index += 6; - return true; - } - } - if (text[index + 1] == 'u' && text[index + 2] == 'r' && text[index + 3] == 'l' && text[index + 4] == '=') - { - int num = text.IndexOf(']', index + 4); - if (num != -1) - { - index = num + 1; - return true; - } - index = text.Length; - return true; - } - if (index + 8 > length) - { - return false; - } - if (text[index + 7] == ']') - { - Color color = ParseColor24(text, index + 1); - if (EncodeColor24(color) != text.Substring(index + 1, 6).ToUpper()) - { - return false; - } - if (colors != null) - { - color.a = colors[colors.size - 1].a; - if (premultiply && color.a != 1f) - { - color = Color.Lerp(mInvisible, color, color.a); - } - colors.Add(color); - } - index += 8; - return true; - } - if (index + 10 > length) - { - return false; - } - if (text[index + 9] == ']') - { - Color color2 = ParseColor32(text, index + 1); - if (EncodeColor32(color2) != text.Substring(index + 1, 8).ToUpper()) - { - return false; - } - if (colors != null) - { - if (premultiply && color2.a != 1f) - { - color2 = Color.Lerp(mInvisible, color2, color2.a); - } - colors.Add(color2); - } - index += 10; - return true; - } - return false; - } - public static string StripSymbols(string text) { if (text != null) @@ -738,36 +524,6 @@ public static class NGUIText return indices[i]; } - public static int GetNearCharacterIndex(BetterList verts, BetterList indices, Vector2 pos, List rangeList) - { - int i = 0; - float num = float.MaxValue; - bool flag = false; - for (int j = 0; j < verts.size; j++) - { - flag = false; - for (int k = 0; k < rangeList.Count; k++) - { - if (rangeList[k][0] <= indices[j] && rangeList[k][1] >= indices[j]) - { - flag = true; - break; - } - } - if (flag) - { - Vector2 vector = new Vector2(verts[j].x, verts[j].y); - float sqrMagnitude = (pos - vector).sqrMagnitude; - if (sqrMagnitude < num) - { - num = sqrMagnitude; - i = j; - } - } - } - return indices[i]; - } - [DebuggerHidden] [DebuggerStepThrough] private static bool IsSpace(int ch) @@ -937,13 +693,6 @@ public static class NGUIText return num4; } - public static string GetEndOfLineThatFits(string text) - { - int length = text.Length; - int num = CalculateOffsetToFit(text); - return text.Substring(num, length - num); - } - public static bool WrapText(string text, out string finalText, bool wrapLineColors = false) { return WrapText(text, out finalText, keepCharCount: false, wrapLineColors); @@ -1257,433 +1006,6 @@ public static class NGUIText return false; } - public static void Print(string text, BetterList verts, BetterList uvs, BetterList cols) - { - if (string.IsNullOrEmpty(text)) - { - return; - } - int size = verts.size; - Prepare(text); - mColors.Add(Color.white); - mAlpha = 1f; - int num = 0; - int prev = 0; - float num2 = 0f; - float num3 = 0f; - float num4 = 0f; - float num5 = finalSize; - Color a = tint * gradientBottom; - Color b = tint * gradientTop; - Color32 color = tint; - int length = text.Length; - Rect rect = default(Rect); - float num6 = 0f; - float num7 = 0f; - float num8 = num5 * pixelDensity; - bool flag = false; - int sub = 0; - bool bold = false; - bool italic = false; - bool underline = false; - bool strike = false; - bool ignoreColor = false; - float num9 = 0f; - if (bitmapFont != null) - { - rect = bitmapFont.uvRect; - num6 = rect.width / (float)bitmapFont.texWidth; - num7 = rect.height / (float)bitmapFont.texHeight; - } - for (int i = 0; i < length; i++) - { - num = text[i]; - num9 = num2; - if (num == 10) - { - if (num2 > num4) - { - num4 = num2; - } - if (alignment != Alignment.Left) - { - Align(verts, size, num2 - finalSpacingX); - size = verts.size; - } - num2 = 0f; - num3 += finalLineHeight; - prev = 0; - continue; - } - if (num < 32) - { - prev = num; - continue; - } - if (encoding && RubyText.ParseSymbol(text, ref i, mColors, premultiply, ref sub, ref bold, ref italic, ref underline, ref strike, ref ignoreColor)) - { - Color color2; - if (ignoreColor) - { - color2 = mColors[mColors.size - 1]; - color2.a *= mAlpha * tint.a; - } - else - { - color2 = tint * mColors[mColors.size - 1]; - color2.a *= mAlpha; - } - color = color2; - int j = 0; - for (int num10 = mColors.size - 2; j < num10; j++) - { - color2.a *= mColors[j].a; - } - if (gradient) - { - a = gradientBottom * color2; - b = gradientTop * color2; - } - i--; - continue; - } - BMSymbol bMSymbol = (useSymbols ? GetSymbol(text, i, length) : null); - float num11; - float num12; - float num14; - float num13; - if (bMSymbol != null) - { - num11 = num2 + (float)bMSymbol.offsetX * fontScale; - num12 = num11 + (float)bMSymbol.width * fontScale; - num13 = 0f - (num3 + (float)bMSymbol.offsetY * fontScale); - num14 = num13 - (float)bMSymbol.height * fontScale; - if (Mathf.RoundToInt(num2 + (float)bMSymbol.advance * fontScale) > regionWidth) - { - if (num2 == 0f) - { - return; - } - if (alignment != Alignment.Left && size < verts.size) - { - Align(verts, size, num2 - finalSpacingX); - size = verts.size; - } - num11 -= num2; - num12 -= num2; - num14 -= finalLineHeight; - num13 -= finalLineHeight; - num2 = 0f; - num3 += finalLineHeight; - num9 = 0f; - } - verts.Add(new Vector3(num11, num14)); - verts.Add(new Vector3(num11, num13)); - verts.Add(new Vector3(num12, num13)); - verts.Add(new Vector3(num12, num14)); - num2 += finalSpacingX + (float)bMSymbol.advance * fontScale; - i += bMSymbol.length - 1; - prev = 0; - if (uvs != null) - { - Rect uvRect = bMSymbol.uvRect; - float xMin = uvRect.xMin; - float yMin = uvRect.yMin; - float xMax = uvRect.xMax; - float yMax = uvRect.yMax; - uvs.Add(new Vector2(xMin, yMin)); - uvs.Add(new Vector2(xMin, yMax)); - uvs.Add(new Vector2(xMax, yMax)); - uvs.Add(new Vector2(xMax, yMin)); - } - if (cols == null) - { - continue; - } - if (symbolStyle == SymbolStyle.Colored) - { - for (int k = 0; k < 4; k++) - { - cols.Add(color); - } - continue; - } - Color32 item = Color.white; - item.a = color.a; - for (int l = 0; l < 4; l++) - { - cols.Add(item); - } - continue; - } - GlyphInfo glyphInfo = GetGlyph(num, prev); - if (glyphInfo == null) - { - continue; - } - prev = num; - if (sub != 0) - { - glyphInfo.v0.x *= 0.75f; - glyphInfo.v0.y *= 0.75f; - glyphInfo.v1.x *= 0.75f; - glyphInfo.v1.y *= 0.75f; - if (sub == 1) - { - glyphInfo.v0.y -= fontScale * (float)fontSize * 0.4f; - glyphInfo.v1.y -= fontScale * (float)fontSize * 0.4f; - } - else - { - glyphInfo.v0.y += fontScale * (float)fontSize * 0.05f; - glyphInfo.v1.y += fontScale * (float)fontSize * 0.05f; - } - } - num11 = glyphInfo.v0.x + num2; - num14 = glyphInfo.v0.y - num3; - num12 = glyphInfo.v1.x + num2; - num13 = glyphInfo.v1.y - num3; - float num15 = glyphInfo.advance; - if (finalSpacingX < 0f) - { - num15 += finalSpacingX; - } - if (Mathf.RoundToInt(num2 + num15) > regionWidth) - { - if (num2 == 0f) - { - return; - } - if (alignment != Alignment.Left && size < verts.size) - { - Align(verts, size, num2 - finalSpacingX); - size = verts.size; - } - num11 -= num2; - num12 -= num2; - num14 -= finalLineHeight; - num13 -= finalLineHeight; - num2 = 0f; - num3 += finalLineHeight; - num9 = 0f; - } - if (IsSpace(num)) - { - if (underline) - { - num = 95; - } - else if (strike) - { - num = 45; - } - } - num2 += ((sub == 0) ? (finalSpacingX + glyphInfo.advance) : ((finalSpacingX + glyphInfo.advance) * 0.75f)); - if (IsSpace(num)) - { - continue; - } - if (uvs != null) - { - if (bitmapFont != null) - { - glyphInfo.u0.x = rect.xMin + num6 * glyphInfo.u0.x; - glyphInfo.u2.x = rect.xMin + num6 * glyphInfo.u2.x; - glyphInfo.u0.y = rect.yMax - num7 * glyphInfo.u0.y; - glyphInfo.u2.y = rect.yMax - num7 * glyphInfo.u2.y; - glyphInfo.u1.x = glyphInfo.u0.x; - glyphInfo.u1.y = glyphInfo.u2.y; - glyphInfo.u3.x = glyphInfo.u2.x; - glyphInfo.u3.y = glyphInfo.u0.y; - } - int m = 0; - for (int num16 = ((!bold) ? 1 : 4); m < num16; m++) - { - uvs.Add(glyphInfo.u0); - uvs.Add(glyphInfo.u1); - uvs.Add(glyphInfo.u2); - uvs.Add(glyphInfo.u3); - } - } - if (cols != null) - { - if (glyphInfo.channel == 0 || glyphInfo.channel == 15) - { - if (gradient) - { - float num17 = num8 + glyphInfo.v0.y / fontScale; - float num18 = num8 + glyphInfo.v1.y / fontScale; - num17 /= num8; - num18 /= num8; - s_c0 = Color.Lerp(a, b, num17); - s_c1 = Color.Lerp(a, b, num18); - int n = 0; - for (int num19 = ((!bold) ? 1 : 4); n < num19; n++) - { - cols.Add(s_c0); - cols.Add(s_c1); - cols.Add(s_c1); - cols.Add(s_c0); - } - } - else - { - int num20 = 0; - for (int num21 = (bold ? 16 : 4); num20 < num21; num20++) - { - cols.Add(color); - } - } - } - else - { - Color color3 = color; - color3 *= 0.49f; - switch (glyphInfo.channel) - { - case 1: - color3.b += 0.51f; - break; - case 2: - color3.g += 0.51f; - break; - case 4: - color3.r += 0.51f; - break; - case 8: - color3.a += 0.51f; - break; - } - Color32 item2 = color3; - int num22 = 0; - for (int num23 = (bold ? 16 : 4); num22 < num23; num22++) - { - cols.Add(item2); - } - } - } - if (!bold) - { - if (!italic) - { - verts.Add(new Vector3(num11, num14)); - verts.Add(new Vector3(num11, num13)); - verts.Add(new Vector3(num12, num13)); - verts.Add(new Vector3(num12, num14)); - } - else - { - float num24 = (float)fontSize * 0.1f * ((num13 - num14) / (float)fontSize); - verts.Add(new Vector3(num11 - num24, num14)); - verts.Add(new Vector3(num11 + num24, num13)); - verts.Add(new Vector3(num12 + num24, num13)); - verts.Add(new Vector3(num12 - num24, num14)); - } - } - else - { - for (int num25 = 0; num25 < 4; num25++) - { - float num26 = mBoldOffset[num25 * 2]; - float num27 = mBoldOffset[num25 * 2 + 1]; - float num28 = (italic ? ((float)fontSize * 0.1f * ((num13 - num14) / (float)fontSize)) : 0f); - verts.Add(new Vector3(num11 + num26 - num28, num14 + num27)); - verts.Add(new Vector3(num11 + num26 + num28, num13 + num27)); - verts.Add(new Vector3(num12 + num26 + num28, num13 + num27)); - verts.Add(new Vector3(num12 + num26 - num28, num14 + num27)); - } - } - if (!(underline || strike)) - { - continue; - } - GlyphInfo glyphInfo2 = GetGlyph(strike ? 45 : 95, prev); - if (glyphInfo2 == null) - { - continue; - } - if (uvs != null) - { - if (bitmapFont != null) - { - glyphInfo2.u0.x = rect.xMin + num6 * glyphInfo2.u0.x; - glyphInfo2.u2.x = rect.xMin + num6 * glyphInfo2.u2.x; - glyphInfo2.u0.y = rect.yMax - num7 * glyphInfo2.u0.y; - glyphInfo2.u2.y = rect.yMax - num7 * glyphInfo2.u2.y; - } - float x = (glyphInfo2.u0.x + glyphInfo2.u2.x) * 0.5f; - int num29 = 0; - for (int num30 = ((!bold) ? 1 : 4); num29 < num30; num29++) - { - uvs.Add(new Vector2(x, glyphInfo2.u0.y)); - uvs.Add(new Vector2(x, glyphInfo2.u2.y)); - uvs.Add(new Vector2(x, glyphInfo2.u2.y)); - uvs.Add(new Vector2(x, glyphInfo2.u0.y)); - } - } - if (flag && strike) - { - num14 = (0f - num3 + glyphInfo2.v0.y) * 0.75f; - num13 = (0f - num3 + glyphInfo2.v1.y) * 0.75f; - } - else - { - num14 = 0f - num3 + glyphInfo2.v0.y; - num13 = 0f - num3 + glyphInfo2.v1.y; - } - if (bold) - { - for (int num31 = 0; num31 < 4; num31++) - { - float num32 = mBoldOffset[num31 * 2]; - float num33 = mBoldOffset[num31 * 2 + 1]; - verts.Add(new Vector3(num9 + num32, num14 + num33)); - verts.Add(new Vector3(num9 + num32, num13 + num33)); - verts.Add(new Vector3(num2 + num32, num13 + num33)); - verts.Add(new Vector3(num2 + num32, num14 + num33)); - } - } - else - { - verts.Add(new Vector3(num9, num14)); - verts.Add(new Vector3(num9, num13)); - verts.Add(new Vector3(num2, num13)); - verts.Add(new Vector3(num2, num14)); - } - if (gradient) - { - float num34 = num8 + glyphInfo2.v0.y / fontScale; - float num35 = num8 + glyphInfo2.v1.y / fontScale; - num34 /= num8; - num35 /= num8; - s_c0 = Color.Lerp(a, b, num34); - s_c1 = Color.Lerp(a, b, num35); - int num36 = 0; - for (int num37 = ((!bold) ? 1 : 4); num36 < num37; num36++) - { - cols.Add(s_c0); - cols.Add(s_c1); - cols.Add(s_c1); - cols.Add(s_c0); - } - } - else - { - int num38 = 0; - for (int num39 = (bold ? 16 : 4); num38 < num39; num38++) - { - cols.Add(color); - } - } - } - if (alignment != Alignment.Left && size < verts.size) - { - Align(verts, size, num2 - finalSpacingX); - size = verts.size; - } - mColors.Clear(); - } - public static void PrintApproximateCharacterPositions(string text, BetterList verts, BetterList indices) { if (string.IsNullOrEmpty(text)) diff --git a/SVSim.BattleEngine/Engine/NGUITools.cs b/SVSim.BattleEngine/Engine/NGUITools.cs index e65695f0..59e9667f 100644 --- a/SVSim.BattleEngine/Engine/NGUITools.cs +++ b/SVSim.BattleEngine/Engine/NGUITools.cs @@ -6,281 +6,11 @@ using UnityEngine; public static class NGUITools { - private static AudioListener mListener; - - private static bool mLoaded = false; - - private static float mGlobalVolume = 1f; - - private static float mLastTimestamp = 0f; - - private static AudioClip mLastClip; private static Vector3[] mSides = new Vector3[4]; - public static KeyCode[] keys = new KeyCode[145] - { - KeyCode.Backspace, - KeyCode.Tab, - KeyCode.Clear, - KeyCode.Return, - KeyCode.Pause, - KeyCode.Escape, - KeyCode.Space, - KeyCode.Exclaim, - KeyCode.DoubleQuote, - KeyCode.Hash, - KeyCode.Dollar, - KeyCode.Ampersand, - KeyCode.Quote, - KeyCode.LeftParen, - KeyCode.RightParen, - KeyCode.Asterisk, - KeyCode.Plus, - KeyCode.Comma, - KeyCode.Minus, - KeyCode.Period, - KeyCode.Slash, - KeyCode.Alpha0, - KeyCode.Alpha1, - KeyCode.Alpha2, - KeyCode.Alpha3, - KeyCode.Alpha4, - KeyCode.Alpha5, - KeyCode.Alpha6, - KeyCode.Alpha7, - KeyCode.Alpha8, - KeyCode.Alpha9, - KeyCode.Colon, - KeyCode.Semicolon, - KeyCode.Less, - KeyCode.Equals, - KeyCode.Greater, - KeyCode.Question, - KeyCode.At, - KeyCode.LeftBracket, - KeyCode.Backslash, - KeyCode.RightBracket, - KeyCode.Caret, - KeyCode.Underscore, - KeyCode.BackQuote, - KeyCode.A, - KeyCode.B, - KeyCode.C, - KeyCode.D, - KeyCode.E, - KeyCode.F, - KeyCode.G, - KeyCode.H, - KeyCode.I, - KeyCode.J, - KeyCode.K, - KeyCode.L, - KeyCode.M, - KeyCode.N, - KeyCode.O, - KeyCode.P, - KeyCode.Q, - KeyCode.R, - KeyCode.S, - KeyCode.T, - KeyCode.U, - KeyCode.V, - KeyCode.W, - KeyCode.X, - KeyCode.Y, - KeyCode.Z, - KeyCode.Delete, - KeyCode.Keypad0, - KeyCode.Keypad1, - KeyCode.Keypad2, - KeyCode.Keypad3, - KeyCode.Keypad4, - KeyCode.Keypad5, - KeyCode.Keypad6, - KeyCode.Keypad7, - KeyCode.Keypad8, - KeyCode.Keypad9, - KeyCode.KeypadPeriod, - KeyCode.KeypadDivide, - KeyCode.KeypadMultiply, - KeyCode.KeypadMinus, - KeyCode.KeypadPlus, - KeyCode.KeypadEnter, - KeyCode.KeypadEquals, - KeyCode.UpArrow, - KeyCode.DownArrow, - KeyCode.RightArrow, - KeyCode.LeftArrow, - KeyCode.Insert, - KeyCode.Home, - KeyCode.End, - KeyCode.PageUp, - KeyCode.PageDown, - KeyCode.F1, - KeyCode.F2, - KeyCode.F3, - KeyCode.F4, - KeyCode.F5, - KeyCode.F6, - KeyCode.F7, - KeyCode.F8, - KeyCode.F9, - KeyCode.F10, - KeyCode.F11, - KeyCode.F12, - KeyCode.F13, - KeyCode.F14, - KeyCode.F15, - KeyCode.Numlock, - KeyCode.CapsLock, - KeyCode.ScrollLock, - KeyCode.RightShift, - KeyCode.LeftShift, - KeyCode.RightControl, - KeyCode.LeftControl, - KeyCode.RightAlt, - KeyCode.LeftAlt, - KeyCode.Mouse3, - KeyCode.Mouse4, - KeyCode.Mouse5, - KeyCode.Mouse6, - KeyCode.JoystickButton0, - KeyCode.JoystickButton1, - KeyCode.JoystickButton2, - KeyCode.JoystickButton3, - KeyCode.JoystickButton4, - KeyCode.JoystickButton5, - KeyCode.JoystickButton6, - KeyCode.JoystickButton7, - KeyCode.JoystickButton8, - KeyCode.JoystickButton9, - KeyCode.JoystickButton10, - KeyCode.JoystickButton11, - KeyCode.JoystickButton12, - KeyCode.JoystickButton13, - KeyCode.JoystickButton14, - KeyCode.JoystickButton15, - KeyCode.JoystickButton16, - KeyCode.JoystickButton17, - KeyCode.JoystickButton18, - KeyCode.JoystickButton19 - }; - - public static float soundVolume - { - get - { - if (!mLoaded) - { - mLoaded = true; - mGlobalVolume = PlayerPrefs.GetFloat("Sound", 1f); - } - return mGlobalVolume; - } - set - { - if (mGlobalVolume != value) - { - mLoaded = true; - mGlobalVolume = value; - PlayerPrefs.SetFloat("Sound", value); - } - } - } - - public static string clipboard - { - get - { - TextEditor textEditor = new TextEditor(); - textEditor.Paste(); - return textEditor.content.text; - } - set - { - TextEditor textEditor = new TextEditor(); - textEditor.content = new GUIContent(value); - textEditor.OnFocus(); - textEditor.Copy(); - } - } - public static Vector2 screenSize => new Vector2(Screen.width, Screen.height); - public static AudioSource PlaySound(AudioClip clip) - { - return PlaySound(clip, 1f, 1f); - } - - public static AudioSource PlaySound(AudioClip clip, float volume) - { - return PlaySound(clip, volume, 1f); - } - - public static AudioSource PlaySound(AudioClip clip, float volume, float pitch) - { - float time = RealTime.time; - if (mLastClip == clip && mLastTimestamp + 0.1f > time) - { - return null; - } - mLastClip = clip; - mLastTimestamp = time; - volume *= soundVolume; - if (clip != null && volume > 0.01f) - { - if (mListener == null || !GetActive(mListener)) - { - if (UnityEngine.Object.FindObjectsOfType(typeof(AudioListener)) is AudioListener[] array) - { - for (int i = 0; i < array.Length; i++) - { - if (GetActive(array[i])) - { - mListener = array[i]; - break; - } - } - } - if (mListener == null) - { - Camera camera = Camera.main; - if (camera == null) - { - camera = UnityEngine.Object.FindObjectOfType(typeof(Camera)) as Camera; - } - if (camera != null) - { - mListener = camera.gameObject.AddComponent(); - } - } - } - if (mListener != null && mListener.enabled && GetActive(mListener.gameObject)) - { - AudioSource audioSource = mListener.GetComponent(); - if (audioSource == null) - { - audioSource = mListener.gameObject.AddComponent(); - } - audioSource.priority = 50; - audioSource.pitch = pitch; - audioSource.PlayOneShot(clip, volume); - return audioSource; - } - } - return null; - } - - public static int RandomRange(int min, int max) - { - if (min == max) - { - return min; - } - return UnityEngine.Random.Range(min, max + 1); - } - public static string GetHierarchy(GameObject obj) { if (obj == null) @@ -331,61 +61,6 @@ public static class NGUITools return null; } - public static void AddWidgetCollider(GameObject go) - { - AddWidgetCollider(go, considerInactive: false); - } - - public static void AddWidgetCollider(GameObject go, bool considerInactive) - { - if (!(go != null)) - { - return; - } - Collider component = go.GetComponent(); - BoxCollider boxCollider = component as BoxCollider; - if (boxCollider != null) - { - UpdateWidgetCollider(boxCollider, considerInactive); - } - else - { - if (component != null) - { - return; - } - BoxCollider2D component2 = go.GetComponent(); - if (component2 != null) - { - UpdateWidgetCollider(component2, considerInactive); - return; - } - UICamera uICamera = UICamera.FindCameraForLayer(go.layer); - if (uICamera != null && (uICamera.eventType == UICamera.EventType.World_2D || uICamera.eventType == UICamera.EventType.UI_2D)) - { - component2 = go.AddComponent(); - component2.isTrigger = true; - UIWidget component3 = go.GetComponent(); - if (component3 != null) - { - component3.autoResizeBoxCollider = true; - } - UpdateWidgetCollider(component2, considerInactive); - } - else - { - boxCollider = go.AddComponent(); - boxCollider.isTrigger = true; - UIWidget component4 = go.GetComponent(); - if (component4 != null) - { - component4.autoResizeBoxCollider = true; - } - UpdateWidgetCollider(boxCollider, considerInactive); - } - } - } - public static void UpdateWidgetCollider(GameObject go) { UpdateWidgetCollider(go, considerInactive: false); @@ -477,28 +152,6 @@ public static class NGUITools return text; } - public static string GetTypeName(UnityEngine.Object obj) - { - if (obj == null) - { - return "Null"; - } - string text = obj.GetType().ToString(); - if (text.StartsWith("UI")) - { - text = text.Substring(2); - } - else if (text.StartsWith("UnityEngine.")) - { - text = text.Substring(12); - } - return text; - } - - public static void RegisterUndo(UnityEngine.Object obj, string name) - { - } - public static void SetDirty(UnityEngine.Object obj) { } @@ -542,30 +195,6 @@ public static class NGUITools return gameObject; } - public static int CalculateRaycastDepth(GameObject go) - { - UIWidget component = go.GetComponent(); - if (component != null) - { - return component.raycastDepth; - } - UIWidget[] componentsInChildren = go.GetComponentsInChildren(); - if (componentsInChildren.Length == 0) - { - return 0; - } - int num = int.MaxValue; - int i = 0; - for (int num2 = componentsInChildren.Length; i < num2; i++) - { - if (componentsInChildren[i].enabled) - { - num = Mathf.Min(num, componentsInChildren[i].raycastDepth); - } - } - return num; - } - public static int CalculateNextDepth(GameObject go) { if ((bool)go) @@ -582,159 +211,6 @@ public static class NGUITools return 0; } - public static int CalculateNextDepth(GameObject go, bool ignoreChildrenWithColliders) - { - if ((bool)go && ignoreChildrenWithColliders) - { - int num = -1; - UIWidget[] componentsInChildren = go.GetComponentsInChildren(); - int i = 0; - for (int num2 = componentsInChildren.Length; i < num2; i++) - { - UIWidget uIWidget = componentsInChildren[i]; - if (!(uIWidget.cachedGameObject != go) || (!(uIWidget.GetComponent() != null) && !(uIWidget.GetComponent() != null))) - { - num = Mathf.Max(num, uIWidget.depth); - } - } - return num + 1; - } - return CalculateNextDepth(go); - } - - public static int AdjustDepth(GameObject go, int adjustment) - { - if (go != null) - { - UIPanel component = go.GetComponent(); - if (component != null) - { - UIPanel[] componentsInChildren = go.GetComponentsInChildren(includeInactive: true); - for (int i = 0; i < componentsInChildren.Length; i++) - { - componentsInChildren[i].depth += adjustment; - } - return 1; - } - component = FindInParents(go); - if (component == null) - { - return 0; - } - UIWidget[] componentsInChildren2 = go.GetComponentsInChildren(includeInactive: true); - int j = 0; - for (int num = componentsInChildren2.Length; j < num; j++) - { - UIWidget uIWidget = componentsInChildren2[j]; - if (!(uIWidget.panel != component)) - { - uIWidget.depth += adjustment; - } - } - return 2; - } - return 0; - } - - public static void BringForward(GameObject go) - { - switch (AdjustDepth(go, 1000)) - { - case 1: - NormalizePanelDepths(); - break; - case 2: - NormalizeWidgetDepths(); - break; - } - } - - public static void PushBack(GameObject go) - { - switch (AdjustDepth(go, -1000)) - { - case 1: - NormalizePanelDepths(); - break; - case 2: - NormalizeWidgetDepths(); - break; - } - } - - public static void NormalizeDepths() - { - NormalizeWidgetDepths(); - NormalizePanelDepths(); - } - - public static void NormalizeWidgetDepths() - { - NormalizeWidgetDepths(FindActive()); - } - - public static void NormalizeWidgetDepths(GameObject go) - { - NormalizeWidgetDepths(go.GetComponentsInChildren()); - } - - public static void NormalizeWidgetDepths(UIWidget[] list) - { - int num = list.Length; - if (num <= 0) - { - return; - } - Array.Sort(list, UIWidget.FullCompareFunc); - int num2 = 0; - int depth = list[0].depth; - for (int i = 0; i < num; i++) - { - UIWidget uIWidget = list[i]; - if (uIWidget.depth == depth) - { - uIWidget.depth = num2; - continue; - } - depth = uIWidget.depth; - num2 = (uIWidget.depth = num2 + 1); - } - } - - public static void NormalizePanelDepths() - { - UIPanel[] array = FindActive(); - int num = array.Length; - if (num <= 0) - { - return; - } - Array.Sort(array, UIPanel.CompareFunc); - int num2 = 0; - int depth = array[0].depth; - for (int i = 0; i < num; i++) - { - UIPanel uIPanel = array[i]; - if (uIPanel.depth == depth) - { - uIPanel.depth = num2; - continue; - } - depth = uIPanel.depth; - num2 = (uIPanel.depth = num2 + 1); - } - } - - public static UIPanel CreateUI(bool advanced3D) - { - return CreateUI(null, advanced3D, -1); - } - - public static UIPanel CreateUI(bool advanced3D, int layer) - { - return CreateUI(null, advanced3D, layer); - } - public static UIPanel CreateUI(Transform trans, bool advanced3D, int layer) { UIRoot uIRoot = ((trans != null) ? FindInParents(trans.gameObject) : null); @@ -897,31 +373,6 @@ public static class NGUITools return val; } - public static UISprite AddSprite(GameObject go, UIAtlas atlas, string spriteName, int depth = int.MaxValue) - { - UISpriteData uISpriteData = ((atlas != null) ? atlas.GetSprite(spriteName) : null); - UISprite uISprite = AddWidget(go, depth); - uISprite.type = ((uISpriteData != null && uISpriteData.hasBorder) ? UIBasicSprite.Type.Sliced : UIBasicSprite.Type.Simple); - uISprite.atlas = atlas; - uISprite.spriteName = spriteName; - return uISprite; - } - - public static GameObject GetRoot(GameObject go) - { - Transform transform = go.transform; - while (true) - { - Transform parent = transform.parent; - if (parent == null) - { - break; - } - transform = parent; - } - return transform.gameObject; - } - public static T FindInParents(GameObject go) where T : Component { if (go == null) @@ -1027,26 +478,6 @@ public static class NGUITools } } - public static void Broadcast(string funcName) - { - GameObject[] array = UnityEngine.Object.FindObjectsOfType(typeof(GameObject)) as GameObject[]; - int i = 0; - for (int num = array.Length; i < num; i++) - { - array[i].SendMessage(funcName, SendMessageOptions.DontRequireReceiver); - } - } - - public static void Broadcast(string funcName, object param) - { - GameObject[] array = UnityEngine.Object.FindObjectsOfType(typeof(GameObject)) as GameObject[]; - int i = 0; - for (int num = array.Length; i < num; i++) - { - array[i].SendMessage(funcName, param, SendMessageOptions.DontRequireReceiver); - } - } - public static bool IsChild(Transform parent, Transform child) { if (parent == null || child == null) @@ -1064,11 +495,6 @@ public static class NGUITools return false; } - private static void Activate(Transform t) - { - Activate(t, compatibilityMode: false); - } - private static void Activate(Transform t, bool compatibilityMode) { SetActiveSelf(t.gameObject, state: true); @@ -1133,37 +559,6 @@ public static class NGUITools } } - public static void SetActiveChildren(GameObject go, bool state) - { - Transform transform = go.transform; - if (state) - { - int i = 0; - for (int childCount = transform.childCount; i < childCount; i++) - { - Activate(transform.GetChild(i)); - } - } - else - { - int j = 0; - for (int childCount2 = transform.childCount; j < childCount2; j++) - { - Deactivate(transform.GetChild(j)); - } - } - } - - [Obsolete("Use NGUITools.GetActive instead")] - public static bool IsActive(Behaviour mb) - { - if (mb != null && mb.enabled) - { - return mb.gameObject.activeInHierarchy; - } - return false; - } - [DebuggerHidden] [DebuggerStepThrough] public static bool GetActive(Behaviour mb) @@ -1231,42 +626,6 @@ public static class NGUITools } } - public static bool Save(string fileName, byte[] bytes) - { - string path = Application.persistentDataPath + "/" + fileName; - if (bytes == null) - { - if (File.Exists(path)) - { - File.Delete(path); - } - return true; - } - FileStream fileStream = null; - try - { - fileStream = File.Create(path); - } - catch (Exception ex) - { - Debug.LogError(ex.Message); - return false; - } - fileStream.Write(bytes, 0, bytes.Length); - fileStream.Close(); - return true; - } - - public static byte[] Load(string fileName) - { - string path = Application.persistentDataPath + "/" + fileName; - if (File.Exists(path)) - { - return File.ReadAllBytes(path); - } - return null; - } - public static Color ApplyPMA(Color c) { if (c.a != 1f) @@ -1288,24 +647,6 @@ public static class NGUITools } } - [Obsolete("Use NGUIText.EncodeColor instead")] - public static string EncodeColor(Color c) - { - return NGUIText.EncodeColor24(c); - } - - [Obsolete("Use NGUIText.ParseColor instead")] - public static Color ParseColor(string text, int offset) - { - return NGUIText.ParseColor24(text, offset); - } - - [Obsolete("Use NGUIText.StripSymbols instead")] - public static string StripSymbols(string text) - { - return NGUIText.StripSymbols(text); - } - public static T AddMissingComponent(this GameObject go) where T : Component { T val = go.GetComponent(); @@ -1316,11 +657,6 @@ public static class NGUITools return val; } - public static Vector3[] GetSides(this Camera cam) - { - return cam.GetSides(Mathf.Lerp(cam.nearClipPlane, cam.farClipPlane, 0.5f), null); - } - public static Vector3[] GetSides(this Camera cam, float depth) { return cam.GetSides(depth, null); @@ -1386,22 +722,11 @@ public static class NGUITools return mSides; } - public static Vector3[] GetWorldCorners(this Camera cam) - { - float depth = Mathf.Lerp(cam.nearClipPlane, cam.farClipPlane, 0.5f); - return cam.GetWorldCorners(depth, null); - } - public static Vector3[] GetWorldCorners(this Camera cam, float depth) { return cam.GetWorldCorners(depth, null); } - public static Vector3[] GetWorldCorners(this Camera cam, Transform relativeTo) - { - return cam.GetWorldCorners(Mathf.Lerp(cam.nearClipPlane, cam.farClipPlane, 0.5f), relativeTo); - } - public static Vector3[] GetWorldCorners(this Camera cam, float depth, Transform relativeTo) { if (cam.orthographic) @@ -1442,25 +767,6 @@ public static class NGUITools return mSides; } - public static string GetFuncName(object obj, string method) - { - if (obj == null) - { - return ""; - } - string text = obj.GetType().ToString(); - int num = text.LastIndexOf('/'); - if (num > 0) - { - text = text.Substring(num + 1); - } - if (!string.IsNullOrEmpty(method)) - { - return text + "/" + method; - } - return text; - } - public static void Execute(GameObject go, string funcName) where T : Component { T[] components = go.GetComponents(); @@ -1484,170 +790,4 @@ public static class NGUITools ExecuteAll(transform.GetChild(i).gameObject, funcName); } } - - public static void ImmediatelyCreateDrawCalls(GameObject root) - { - ExecuteAll(root, "Start"); - ExecuteAll(root, "Start"); - ExecuteAll(root, "Update"); - ExecuteAll(root, "Update"); - ExecuteAll(root, "LateUpdate"); - } - - public static string KeyToCaption(KeyCode key) - { - return key switch - { - KeyCode.None => null, - KeyCode.Backspace => "BS", - KeyCode.Tab => "Tab", - KeyCode.Clear => "Clr", - KeyCode.Return => "NT", - KeyCode.Pause => "PS", - KeyCode.Escape => "Esc", - KeyCode.Space => "SP", - KeyCode.Exclaim => "!", - KeyCode.DoubleQuote => "\"", - KeyCode.Hash => "#", - KeyCode.Dollar => "$", - KeyCode.Ampersand => "&", - KeyCode.Quote => "'", - KeyCode.LeftParen => "(", - KeyCode.RightParen => ")", - KeyCode.Asterisk => "*", - KeyCode.Plus => "+", - KeyCode.Comma => ",", - KeyCode.Minus => "-", - KeyCode.Period => ".", - KeyCode.Slash => "/", - KeyCode.Alpha0 => "0", - KeyCode.Alpha1 => "1", - KeyCode.Alpha2 => "2", - KeyCode.Alpha3 => "3", - KeyCode.Alpha4 => "4", - KeyCode.Alpha5 => "5", - KeyCode.Alpha6 => "6", - KeyCode.Alpha7 => "7", - KeyCode.Alpha8 => "8", - KeyCode.Alpha9 => "9", - KeyCode.Colon => ":", - KeyCode.Semicolon => ";", - KeyCode.Less => "<", - KeyCode.Equals => "=", - KeyCode.Greater => ">", - KeyCode.Question => "?", - KeyCode.At => "@", - KeyCode.LeftBracket => "[", - KeyCode.Backslash => "\\", - KeyCode.RightBracket => "]", - KeyCode.Caret => "^", - KeyCode.Underscore => "_", - KeyCode.BackQuote => "`", - KeyCode.A => "A", - KeyCode.B => "B", - KeyCode.C => "C", - KeyCode.D => "D", - KeyCode.E => "E", - KeyCode.F => "F", - KeyCode.G => "G", - KeyCode.H => "H", - KeyCode.I => "I", - KeyCode.J => "J", - KeyCode.K => "K", - KeyCode.L => "L", - KeyCode.M => "M", - KeyCode.N => "N0", - KeyCode.O => "O", - KeyCode.P => "P", - KeyCode.Q => "Q", - KeyCode.R => "R", - KeyCode.S => "S", - KeyCode.T => "T", - KeyCode.U => "U", - KeyCode.V => "V", - KeyCode.W => "W", - KeyCode.X => "X", - KeyCode.Y => "Y", - KeyCode.Z => "Z", - KeyCode.Delete => "Del", - KeyCode.Keypad0 => "K0", - KeyCode.Keypad1 => "K1", - KeyCode.Keypad2 => "K2", - KeyCode.Keypad3 => "K3", - KeyCode.Keypad4 => "K4", - KeyCode.Keypad5 => "K5", - KeyCode.Keypad6 => "K6", - KeyCode.Keypad7 => "K7", - KeyCode.Keypad8 => "K8", - KeyCode.Keypad9 => "K9", - KeyCode.KeypadPeriod => ".", - KeyCode.KeypadDivide => "/", - KeyCode.KeypadMultiply => "*", - KeyCode.KeypadMinus => "-", - KeyCode.KeypadPlus => "+", - KeyCode.KeypadEnter => "NT", - KeyCode.KeypadEquals => "=", - KeyCode.UpArrow => "UP", - KeyCode.DownArrow => "DN", - KeyCode.RightArrow => "LT", - KeyCode.LeftArrow => "RT", - KeyCode.Insert => "Ins", - KeyCode.Home => "Home", - KeyCode.End => "End", - KeyCode.PageUp => "PU", - KeyCode.PageDown => "PD", - KeyCode.F1 => "F1", - KeyCode.F2 => "F2", - KeyCode.F3 => "F3", - KeyCode.F4 => "F4", - KeyCode.F5 => "F5", - KeyCode.F6 => "F6", - KeyCode.F7 => "F7", - KeyCode.F8 => "F8", - KeyCode.F9 => "F9", - KeyCode.F10 => "F10", - KeyCode.F11 => "F11", - KeyCode.F12 => "F12", - KeyCode.F13 => "F13", - KeyCode.F14 => "F14", - KeyCode.F15 => "F15", - KeyCode.Numlock => "Num", - KeyCode.CapsLock => "Cap", - KeyCode.ScrollLock => "Scr", - KeyCode.RightShift => "RS", - KeyCode.LeftShift => "LS", - KeyCode.RightControl => "RC", - KeyCode.LeftControl => "LC", - KeyCode.RightAlt => "RA", - KeyCode.LeftAlt => "LA", - KeyCode.Mouse0 => "M0", - KeyCode.Mouse1 => "M1", - KeyCode.Mouse2 => "M2", - KeyCode.Mouse3 => "M3", - KeyCode.Mouse4 => "M4", - KeyCode.Mouse5 => "M5", - KeyCode.Mouse6 => "M6", - KeyCode.JoystickButton0 => "(A)", - KeyCode.JoystickButton1 => "(B)", - KeyCode.JoystickButton2 => "(X)", - KeyCode.JoystickButton3 => "(Y)", - KeyCode.JoystickButton4 => "(RB)", - KeyCode.JoystickButton5 => "(LB)", - KeyCode.JoystickButton6 => "(Back)", - KeyCode.JoystickButton7 => "(Start)", - KeyCode.JoystickButton8 => "(LS)", - KeyCode.JoystickButton9 => "(RS)", - KeyCode.JoystickButton10 => "J10", - KeyCode.JoystickButton11 => "J11", - KeyCode.JoystickButton12 => "J12", - KeyCode.JoystickButton13 => "J13", - KeyCode.JoystickButton14 => "J14", - KeyCode.JoystickButton15 => "J15", - KeyCode.JoystickButton16 => "J16", - KeyCode.JoystickButton17 => "J17", - KeyCode.JoystickButton18 => "J18", - KeyCode.JoystickButton19 => "J19", - _ => null, - }; - } } diff --git a/SVSim.BattleEngine/Engine/Nat2Field.cs b/SVSim.BattleEngine/Engine/Nat2Field.cs index 53905b76..1c634847 100644 --- a/SVSim.BattleEngine/Engine/Nat2Field.cs +++ b/SVSim.BattleEngine/Engine/Nat2Field.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Nat2Field : NateField { public override int FieldId => 32; @@ -9,42 +11,4 @@ public class Nat2Field : NateField : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_nat2_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles" + FieldId).gameObject; - _fieldParticleSystemDictionary.Add("gimic_on1", _fieldParticles.transform.Find("gimic_on1").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_on2", _fieldParticles.transform.Find("gimic_on2").GetComponent()); - _fieldParticleSystemDictionary.Add("shake_1", _fieldParticles.transform.Find("shake_1").GetComponent()); - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_32, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_32_1, pos); - } } diff --git a/SVSim.BattleEngine/Engine/Nat3Field.cs b/SVSim.BattleEngine/Engine/Nat3Field.cs index 072f9b58..8c4b5f13 100644 --- a/SVSim.BattleEngine/Engine/Nat3Field.cs +++ b/SVSim.BattleEngine/Engine/Nat3Field.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Nat3Field : NateField { public override int FieldId => 33; @@ -10,79 +11,4 @@ public class Nat3Field : NateField : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_nat3_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles33").gameObject; - _fieldObjDictionary.Add("lid", _fieldModel.transform.Find("md_bf_nat3_01_pipemove_lid").gameObject); - _fieldObjDictionary.Add("big", _fieldModel.transform.Find("md_bf_nat3_01_pipemove_big").gameObject); - m_FieldAnimatorDictionary.Add("big", _fieldObjDictionary["big"].GetComponent()); - m_FieldAnimatorDictionary.Add("lid", _fieldObjDictionary["lid"].GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_33, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_33_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_33_2, pos); - break; - } - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - if (Random.Range(0, 2) == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["lid"].SetTrigger("Open"); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(8f); - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["big"].SetTrigger("Impact"); - m_FieldAnimatorDictionary["lid"].SetTrigger("Impact"); - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Nat4Field.cs b/SVSim.BattleEngine/Engine/Nat4Field.cs index b271d0c4..a9ac8a0a 100644 --- a/SVSim.BattleEngine/Engine/Nat4Field.cs +++ b/SVSim.BattleEngine/Engine/Nat4Field.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Nat4Field : NateField { public override int FieldId => 34; @@ -10,71 +11,4 @@ public class Nat4Field : NateField : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_nat4_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles34").gameObject; - _fieldObjDictionary.Add("lid", _fieldModel.transform.Find("md_bf_nat4_01_pipemove_lid").gameObject); - _fieldObjDictionary.Add("big", _fieldModel.transform.Find("md_bf_nat4_01_pipemove_big").gameObject); - m_FieldAnimatorDictionary.Add("big", _fieldObjDictionary["big"].GetComponent()); - m_FieldAnimatorDictionary.Add("lid", _fieldObjDictionary["lid"].GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_34, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_34_1, pos); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - if (Random.Range(0, 2) == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["lid"].SetTrigger("Open"); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(8f); - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["big"].SetTrigger("Impact"); - m_FieldAnimatorDictionary["lid"].SetTrigger("Impact"); - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/NateField.cs b/SVSim.BattleEngine/Engine/NateField.cs index 003bcb32..d7be332d 100644 --- a/SVSim.BattleEngine/Engine/NateField.cs +++ b/SVSim.BattleEngine/Engine/NateField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class NateField : BackGroundBase { public override int FieldId => 31; @@ -10,101 +11,4 @@ public class NateField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_nate_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles" + FieldId).gameObject; - _fieldParticleSystemDictionary.Add("gimic_on1", _fieldParticles.transform.Find("gimic_on1").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_on2", _fieldParticles.transform.Find("gimic_on2").GetComponent()); - _fieldParticleSystemDictionary.Add("shake_1", _fieldParticles.transform.Find("shake_1").GetComponent()); - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_31, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_31_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_31_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(1680f, -475f, -226f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-16f, -63f, 82f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(57f, -54f, 30f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-20f, -110f, 98f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1") - { - switch (_gimicCntDictionary[obj.tag]) - { - case 0: - case 1: - case 2: - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_on1"].transform.GetChild(_gimicCntDictionary[obj.tag] - 1).GetComponent().Play(); - _fieldParticleSystemDictionary["gimic_on2"].transform.GetChild(_gimicCntDictionary[obj.tag] - 1).GetComponent().Play(); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - break; - case 3: - { - _gimicCntDictionary[obj.tag]++; - for (int i = 0; i < _fieldParticleSystemDictionary["gimic_on1"].transform.childCount; i++) - { - _fieldParticleSystemDictionary["gimic_on1"].transform.GetChild(i).GetComponent().Stop(); - } - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_2", "se_field_" + _str3DFieldNo, 0f, 0L); - yield return new WaitForSeconds(2f); - _gimicCntDictionary[obj.tag] = 0; - break; - } - } - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake_1"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/NetworkAIBattleSetupCardEvent.cs b/SVSim.BattleEngine/Engine/NetworkAIBattleSetupCardEvent.cs deleted file mode 100644 index 79e716a0..00000000 --- a/SVSim.BattleEngine/Engine/NetworkAIBattleSetupCardEvent.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; - -public class NetworkAIBattleSetupCardEvent : NetworkBattleSetupCardEvent -{ - public NetworkAIBattleSetupCardEvent(BattleManagerBase manager, RegisterActionManager registerCardList, NetworkBattleData data) - : base(manager, registerCardList, data) - { - } - - public override void SetupCardEvent(BattleManagerBase mgr, RegisterActionManager actionManager, BattleCardBase card, List registerUnapprovedList) - { - } - - public override void SetupCardSkillEvent(BattleCardBase card) - { - } -} diff --git a/SVSim.BattleEngine/Engine/NetworkBattleData.cs b/SVSim.BattleEngine/Engine/NetworkBattleData.cs index 2319a9e2..3889ee84 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleData.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleData.cs @@ -45,7 +45,7 @@ public class NetworkBattleData protected void SetEnemyFirstTurn() { - if (receiveData.dataUri == NetworkBattleDefine.NetworkBattleURI.Ready && ToolboxGame.RealTimeNetworkAgent.GetIsFirstPlayer() == 1) + if (receiveData.dataUri == NetworkBattleDefine.NetworkBattleURI.Ready && _battleMgr.InstanceNetworkAgent.GetIsFirstPlayer() == 1) { isEnemyFirstTurn = true; } diff --git a/SVSim.BattleEngine/Engine/NetworkBattleDefine.cs b/SVSim.BattleEngine/Engine/NetworkBattleDefine.cs index ffe5e8db..e0d7cec2 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleDefine.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleDefine.cs @@ -32,12 +32,7 @@ public class NetworkBattleDefine public enum NetworkBattleURI { None, - Resume, Retry, - InitNetwork, - InitBattle, - InitRoomBattle, - Matched, Loaded, Deal, Swap, @@ -47,10 +42,8 @@ public class NetworkBattleDefine TurnEnd, TurnEndFinal, PlayActions, - BattleStart, BattleFinish, ChatStamp, - Gungnir, Echo, Retire, OppoDisconnect, @@ -66,7 +59,6 @@ public class NetworkBattleDefine JudgeResult, Maintenance, ReplayFinish, - Kill, Watch } @@ -126,11 +118,9 @@ public class NetworkBattleDefine spin, resultCode, isWin, - errorType, pos, self, oppo, - battleStartDate, time, cards, touch, @@ -147,37 +137,7 @@ public class NetworkBattleDefine public enum ReceiveNodeResultCode { None = 0, - Success = 1, - RoomStatusInfoError = 30101, - RoomCreateError = 30102, - RoomEntryError = 30103, - RoomKickError = 30104, - RoomLeaveError = 30105, - RoomReleaseError = 30106, - RoomForceReleaseError = 30107, - RoomReenterError = 30108, - RoomBattleReadeError = 30109, - RoomTournamentDeckError = 30110, - RoomTournamentError = 30111, - RoomSetupLock = 30112, - SwapTimeoutError = 31001, - MatchingTimeOut = 30201, - FoundRemovedUserErrorSelf = 32101, - FoundRemovedUserErrorOppo = 32102, - FoundRemovedUserErrorWatcher = 32103, - RoomTimeEndError = 32104, - WatcherInRemovedOwnerRoomError = 32105, - RoomTornamentOwnTimeEndError = 32106, - RoomTornamentOppoTimeEndError = 32107, - BattleFinishTimeEnd = 32108, - Different_UUID = 30001, - RedisReplyError = 30002, - WatchError = 30302, - CurrentBattleError = 30212, - UnexpectedPhaseError = 30213, - UnexistUserinfoError = 30003, - UnmatchedError = 30211 - } + CurrentBattleError = 30212 } public static readonly Dictionary NetworkURINames; diff --git a/SVSim.BattleEngine/Engine/NetworkBattleGenericTool.cs b/SVSim.BattleEngine/Engine/NetworkBattleGenericTool.cs index 3bd97542..1930ed22 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleGenericTool.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleGenericTool.cs @@ -136,34 +136,6 @@ public class NetworkBattleGenericTool return list; } - public static bool IsAttachedSkill(SkillBase skill) - { - ISkillApplyInformation skillApplyInformation = skill.SkillPrm.ownerCard.SkillApplyInformation; - if (skillApplyInformation != null && skillApplyInformation.AttachedSkillsInfo != null && skillApplyInformation.AttachedSkillsInfo.AttachedSkills != null && skillApplyInformation.AttachedSkillsInfo.AttachedSkills.ToList().Count > 0) - { - foreach (SkillBase attachedSkill in skillApplyInformation.AttachedSkillsInfo.AttachedSkills) - { - if (attachedSkill == skill) - { - return true; - } - } - } - return false; - } - - public static SkillBase SearchPublishedSkillCountToSkill(BattleCardBase card, int skillId) - { - foreach (SkillBase skill in card.Skills) - { - if (GetPublishSkillCount(skill) == skillId) - { - return skill; - } - } - return null; - } - public static int GetSkillIndex(SkillBase skill) { int num = 0; @@ -373,7 +345,7 @@ public class NetworkBattleGenericTool public static int GetSkillMovementNum(SkillBase skillBase) { - if (GameMgr.GetIns().IsAINetwork) + if (skillBase.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork) { return -1; } @@ -383,7 +355,7 @@ public class NetworkBattleGenericTool public static int GetPublishSkillCount(SkillBase skill) { int result = -1; - if (GameMgr.GetIns().IsAINetwork) + if (skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork) { return result; } @@ -393,7 +365,7 @@ public class NetworkBattleGenericTool if (skill.PublishedActiveSkillCount == -1) { BattleCardBase skillCard = skill.SkillPrm.ownerCard; - SkillBase skillBase = BattleManagerBase.GetIns().PublishedSkillList.FindAll((SkillBase x) => x.GetType() == skill.GetType() && x.SkillTimingText == skill.SkillTimingText).FindLast((SkillBase x) => x.SkillPrm.ownerCard.Index == skillCard.Index && x.SkillPrm.ownerCard.IsPlayer == skillCard.IsPlayer); + SkillBase skillBase = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.PublishedSkillList.FindAll((SkillBase x) => x.GetType() == skill.GetType() && x.SkillTimingText == skill.SkillTimingText).FindLast((SkillBase x) => x.SkillPrm.ownerCard.Index == skillCard.Index && x.SkillPrm.ownerCard.IsPlayer == skillCard.IsPlayer); if (skillBase != null) { result = skillBase.PublishedActiveSkillCount; @@ -495,15 +467,6 @@ public class NetworkBattleGenericTool return true; } - private static bool IsTargetDeckOrHand(ISkillTargetFilter applyingTargetFilter) - { - if (!(applyingTargetFilter is SkillTargetDeckFilter) && !(applyingTargetFilter is SkillTargetHandFilter)) - { - return applyingTargetFilter is SkillTargetHandOtherSelfFilter; - } - return true; - } - private static bool IsOnlyAllCardFilter(List applyCardFilterList) { for (int i = 0; i < applyCardFilterList.Count; i++) @@ -518,7 +481,7 @@ public class NetworkBattleGenericTool public static void SettingRegisterTargetGroupAndInsert() { - List registerDataList = (BattleManagerBase.GetIns() as NetworkBattleManagerBase).RegisterActionManager.RegisterDataList; + List registerDataList = new List(); // Pre-Phase-5b: SettingRegisterTargetGroupAndInsert is unreachable headless foreach (RegisterLotCardBase item in registerDataList.FindAll((RegisterActionBase x) => x is RegisterLotCardBase).ConvertAll((RegisterActionBase x) => x as RegisterLotCardBase)) { RegisterActionBase registerActionBase = null; @@ -582,7 +545,7 @@ public class NetworkBattleGenericTool public static RegisterLotCardBase MakeRegisterLotAndRandomAdvance(SkillBase skillBase, IEnumerable cards, SkillConditionCheckerOption checkerOption) { - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + NetworkBattleManagerBase networkBattleManagerBase = skillBase.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; List unapprovedList = networkBattleManagerBase.networkBattleData.GetReceiveData().unapprovedList; NetworkExecutionInfoCreator networkExec = skillBase._executionInfoCreator as NetworkExecutionInfoCreator; int num = 0; @@ -650,7 +613,7 @@ public class NetworkBattleGenericTool { return NullVfx.GetInstance(); } - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + NetworkBattleManagerBase networkBattleManagerBase = skillBase.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; int skillMovementNum = GetSkillMovementNum(skillBase); foreach (BattleCardBase card in cards) { @@ -761,92 +724,4 @@ public class NetworkBattleGenericTool } return false; } - - public static string FindDictionaryURI(Dictionary data) - { - if (data.ContainsKey("uri")) - { - return data["uri"].ToString(); - } - return ""; - } - - public static void CreateLoadAndPlayEffectVfxLastTurnLog() - { - CreateLoadAndPlayEffectVfxCheckLog(isLastTurn: true); - } - - public static void CreateLoadAndPlayEffectVfxClientInfoLog() - { - CreateLoadAndPlayEffectVfxCheckLog(isLastTurn: false); - } - - private static void CreateLoadAndPlayEffectVfxCheckLog(bool isLastTurn) - { - try - { - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins == null) - { - return; - } - foreach (LoadAndPlayEffectVfx item in ins.VfxMgr.GetSequentialVfxQueues().ToList().FindAll((VfxBase x) => x is LoadAndPlayEffectVfx) - .ConvertAll((VfxBase x) => x as LoadAndPlayEffectVfx)) - { - if (item.LoadingVfx != null && item.LoadingVfx is SkillBase.WaitEffectLoadVfx) - { - SkillBase.WaitEffectLoadVfx waitEffectLoadVfx = item.LoadingVfx as SkillBase.WaitEffectLoadVfx; - if (waitEffectLoadVfx.LoadVfx != null) - { - string log = "LoadVfxIsEnd=" + waitEffectLoadVfx.LoadVfx.IsEnd; - if (isLastTurn) - { - LocalLog.AccumulateLastTraceLog(log); - } - else - { - LocalLog.AccumulateTraceLog(log); - } - } - } - string log2 = "loadEffect.LoadFileName=" + item.LoadFileName; - if (isLastTurn) - { - LocalLog.AccumulateLastTraceLog(log2); - } - else - { - LocalLog.AccumulateTraceLog(log2); - } - if (item.WaitLoadEffectAndSetSeVfxData != null) - { - string log3 = "WaitLoadEffectAndSetSeVfxData Step" + item.WaitLoadEffectAndSetSeVfxData.NowStep; - if (isLastTurn) - { - LocalLog.AccumulateLastTraceLog(log3); - } - else - { - LocalLog.AccumulateTraceLog(log3); - } - } - if (item.PlayEffectAndSeVfxData != null) - { - string log4 = "PlayEffectAndSeVfxData Step" + item.PlayEffectAndSeVfxData.NowStep; - if (isLastTurn) - { - LocalLog.AccumulateLastTraceLog(log4); - } - else - { - LocalLog.AccumulateTraceLog(log4); - } - } - } - } - catch - { - LocalLog.AccumulateLastTraceLog("VfxCheckLog Error"); - } - } } diff --git a/SVSim.BattleEngine/Engine/NetworkBattleIntervalCheckerBase.cs b/SVSim.BattleEngine/Engine/NetworkBattleIntervalCheckerBase.cs index 40ef8e13..47fff283 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleIntervalCheckerBase.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleIntervalCheckerBase.cs @@ -8,7 +8,7 @@ public class NetworkBattleIntervalCheckerBase protected bool isEnd; - private NetworkBattleManagerBase _networkBattleManagerBase; + protected NetworkBattleManagerBase _networkBattleManagerBase; protected long startTick { get; private set; } @@ -16,7 +16,7 @@ public class NetworkBattleIntervalCheckerBase public NetworkBattleIntervalCheckerBase() { - _networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + _networkBattleManagerBase = null; // Pre-Phase-5b: interval checker is UI-only; NRE on invocation acceptable headless } public virtual void StartChecker(string log = "") @@ -33,14 +33,6 @@ public class NetworkBattleIntervalCheckerBase } } - public void StartCheckerIfNotStarted() - { - if (!IsStarted()) - { - StartChecker(); - } - } - public virtual void FinishChecker() { StopChecker(); @@ -61,15 +53,6 @@ public class NetworkBattleIntervalCheckerBase return coroutine != null; } - public float GetTimeSpanSecondFromStarted() - { - if (IsStarted()) - { - return NetworkUtility.GetTimeSpanSecond(startTick); - } - return -1f; - } - protected void InitTimer() { startTick = TimeUtil.GetAbsoluteTime().Ticks; diff --git a/SVSim.BattleEngine/Engine/NetworkBattleManagerBase.cs b/SVSim.BattleEngine/Engine/NetworkBattleManagerBase.cs index cc099fe6..030de81d 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleManagerBase.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleManagerBase.cs @@ -81,8 +81,6 @@ public class NetworkBattleManagerBase : BattleManagerBase private int judgeResult_NotFinishNum; - private const int NOTFINISH_RETRYNUM = 5; - public NetworkBattleReceiver.RESULT_CODE JudgeResultReceiveCode; protected ReceiveIntervalTrigger receiveIntervalTrigger; @@ -169,11 +167,6 @@ public class NetworkBattleManagerBase : BattleManagerBase private List LastCheckInplayWhiteRitualStackPair { get; set; } = new List { 0, 0 }; - public void SetIsSkillSelectTiming(bool val) - { - IsSkillSelectTiming = val; - } - public override void Update(float dt) { base.Update(dt); @@ -225,7 +218,7 @@ public class NetworkBattleManagerBase : BattleManagerBase public override int GetMaxDeckCount(bool isSelf) { - return GameMgr.GetIns().GetDataMgr().GetDeckMaxCount(isSelf); + return this.GameMgr.GetDataMgr().GetDeckMaxCount(isSelf); } public NetworkBattleManagerBase(IBattleMgrContentsCreator contentsCreator) @@ -234,6 +227,13 @@ public class NetworkBattleManagerBase : BattleManagerBase NetworkBattleManagerSetup(); } + // Phase-5 chunk 45: overload accepting a pre-seeded GameMgr. + public NetworkBattleManagerBase(IBattleMgrContentsCreator contentsCreator, GameMgr gameMgr) + : base(contentsCreator, gameMgr) + { + NetworkBattleManagerSetup(); + } + protected override void FirstRecoverySetting() { } @@ -250,15 +250,16 @@ public class NetworkBattleManagerBase : BattleManagerBase TouchControl = new NetworkTouchControl(this, _battleCamera, _backGround); networkTouchControl = TouchControl as NetworkTouchControl; JudgeResultReceiveCode = NetworkBattleReceiver.RESULT_CODE.NotFinish; - if (base.IsRecovery || GameMgr.GetIns().IsReplayBattle) + // IsReplayBattle is const-false in headless (Phase-4 target): only IsRecovery can enter + // this branch, and its selfIdxSeed always uses the RecoveryManager path. + if (base.IsRecovery) { networkTouchControl.SetDisableTouch(); networkBattleData = new NetworkRecoveryBattleData(this); networkReceiver = new NetworkReplayBattleReceiver(this); OperateReceive = new RecoveryOperateReceive(this, RegisterActionManager, OperateMgr, networkBattleData); - int selfIdxSeed = (base.IsRecovery ? _contentsCreator.RecoveryManager.IdxChangeSeed : Data.ReplayBattleInfo.IdxChangeSeed); - int oppIdxSeed = (GameMgr.GetIns().IsReplayBattle ? Data.ReplayBattleInfo.OppoIdxChangeSeed : (-1)); - CreateXorShift(selfIdxSeed, oppIdxSeed); + int selfIdxSeed = _contentsCreator.RecoveryManager.IdxChangeSeed; + CreateXorShift(selfIdxSeed, -1); } else { @@ -356,18 +357,6 @@ public class NetworkBattleManagerBase : BattleManagerBase }; } - public void SetPublishedActiveSkillCount(SkillCollectionBase skills) - { - for (int i = 0; i < skills.Count(); i++) - { - if (!skills.Get(i).SkillPrm.selfBattlePlayer.BattleMgr.IsVirtualBattle && !(skills.Get(i) is Skill_none)) - { - skills.Get(i).SetPublishedActiveSkillCount(skills.Get(i).SkillPrm.selfBattlePlayer.BattleMgr.AllPublishedActiveSkillCount + base.TemporaryPublishedAddCount); - base.TemporaryPublishedAddCount++; - } - } - } - protected void SetupCreateBattleCardFunc(bool createCardWithoutGameObject) { if (createCardWithoutGameObject) @@ -385,69 +374,6 @@ public class NetworkBattleManagerBase : BattleManagerBase } } - public virtual void RecoveryEnd() - { - base.IsRecovery = false; - networkTouchControl.SetEnableTouch(); - NetworkBattleData networkBattleData = this.networkBattleData; - this.networkBattleData = new NetworkBattleData(this); - this.networkBattleData.isPlayerMulliganEnd = networkBattleData.isPlayerMulliganEnd; - this.networkBattleData.isOppoMulliganEnd = networkBattleData.isOppoMulliganEnd; - this.networkBattleData.SetReceiveData(networkBattleData.GetReceiveData()); - this.networkBattleData.isEnemyFirstTurn = networkBattleData.isEnemyFirstTurn; - _networkBattleSetupCardEventBase.OverwriteNetworkBattleData(this.networkBattleData); - SetupCreateBattleCardFunc(createCardWithoutGameObject: false); - OperateMgr operateMgr = OperateMgr; - OperateMgr = CreateOperateMgr(); - OperateMgr.SetUpRecoveryEvent(operateMgr); - operateMgr = null; - OperateReceive = new OperateReceive(this, RegisterActionManager, OperateMgr, this.networkBattleData); - if (_phase is NetworkMulliganPhase) - { - (_phase as NetworkMulliganPhase).MulliganEventSetting(); - } - operateReceiveChecker = new OperateReceiveChecker(this, this.networkBattleData); - networkReceiver = new NetworkBattleReceiver(this); - SetupNetworkEvent(isRecovery: true); - SetupReplayRecordingEvent(); - if (_specialWinVfx == null) - { - ClearRegisterCardList(); - } - } - - private void SetupReplayRecordingEvent() - { - _contentsCreator.ReplayRecordManager.SetupOperateMgrEvents(this); - } - - public virtual void RecoveryTimeOutSetting(float extendTime, bool isMulliganEnd, long startTime = -1L) - { - if (!isMulliganEnd) - { - if (MulliganMgr != null) - { - MulliganMgr.GetMulliganInfo().SetExtendTime(extendTime); - } - return; - } - if (!BattlePlayer.IsSelfTurn) - { - opponentNotTurnEndToWinChecker.StartChecker(); - return; - } - if (turnEndTimeController == null) - { - TurnEndButtonUI component = SBattleLoad.m_TurnEndBtnUI.GetComponent(); - turnEndTimeController = new TurnEndTimeController(this, BattlePlayer, component); - } - if (!turnEndTimeController.IsCountdownRunning()) - { - turnEndTimeController.StartCountDown("SetTimeoutSetting"); - } - turnEndTimeController.SetExtendTime(extendTime); - } - public void SetTimeDecrementFlag(bool isDecrement) { if (turnEndTimeController != null) @@ -456,76 +382,6 @@ public class NetworkBattleManagerBase : BattleManagerBase } } - public virtual void SetupFieldAndHandAfterRecovery(Action onEndRecoveryCallback, RecoveryOperationInfo aiBattleRecoveryData = null) - { - if (!Data.BattleRecoveryInfo.IsMulliganEnd) - { - SequentialVfxPlayer vfx = SequentialVfxPlayer.Create(MulliganMgr.RecoverMulligan(networkBattleData.isPlayerMulliganEnd, this), InstantVfx.Create(onEndRecoveryCallback)); - base.VfxMgr.RegisterSequentialVfx(vfx); - return; - } - BattlePlayer.PlayerBattleView.ClearPlayQueue(); - BattleEnemy.BattleEnemyView.ClearPlayQueue(); - RecreateCardViews(BattlePlayer.InPlayCards); - RecreateCardViews(BattlePlayer.HandCardList); - RecreateCardViews(BattlePlayer.DeckCardList); - RecreateCardViews(BattlePlayer.ReservedCardList); - RecreateCardViews(BattleEnemy.InPlayCards); - RecreateCardViews(BattleEnemy.HandCardList); - RecreateCardViews(BattleEnemy.DeckCardList); - RecreateCardViews(BattleEnemy.ReservedCardList); - RefreshHealthVfx refreshHealthVfx = new RefreshHealthVfx(BattlePlayer); - RefreshHealthVfx refreshHealthVfx2 = new RefreshHealthVfx(BattleEnemy); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(BattlePlayer.BattleView.RecoveryInPlayCards(), BattlePlayer.BattleView.RecoveryInHandCards(), BattlePlayer.BattleView.RecoveryClassAndInPlayCardAttachSkillEffect(), BattleEnemy.BattleView.RecoveryInPlayCards(), BattleEnemy.BattleView.RecoveryInHandCards(), BattleEnemy.BattleView.RecoveryClassAndInPlayCardAttachSkillEffect(), refreshHealthVfx, refreshHealthVfx2); - ReinitializeTurnPanelControl(); - VfxBase vfxBase = (BattlePlayer.IsSelfTurn ? BattlePlayer.BattleView.RecoveryTurnStart() : BattleEnemy.BattleEnemyView.RecoveryTurnStart()); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(BattlePlayer.BattleView.RecoveryBattleUI(), BattleEnemy.BattleView.RecoveryBattleUI(), InstantVfx.Create(delegate - { - BattlePlayer.PlayerBattleView.ForceShowTurnEndButton(); - }), vfxBase, RecoveryAfterMulliganPhase.RestoreUI(this)); - VfxBase vfxBase2 = (BattleEnemy.IsSelfTurn ? BattleEnemy.CreateThinkingVfx(this) : NullVfx.GetInstance()); - SequentialVfxPlayer vfx2 = SequentialVfxPlayer.Create(parallelVfxPlayer2, parallelVfxPlayer, HandViewBase.CreateHideCardMeshesVfx(BattleEnemy.HandCardList), vfxBase2, InstantVfx.Create(onEndRecoveryCallback), InstantVfx.Create(delegate - { - ResetLeaderAnimation(BattlePlayer, BattleEnemy); - })); - base.VfxMgr.RegisterSequentialVfx(vfx2); - } - - protected void ResetLeaderAnimation(BattlePlayer battlePlayer, BattleEnemy battleEnemy) - { - PlayerClassBattleCardView playerClassBattleCardView = battlePlayer.Class.BattleCardView as PlayerClassBattleCardView; - playerClassBattleCardView.ClassCharacter.SetAnimationEnable(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION)); - if (battlePlayer.IsSkinEvolved) - { - playerClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle); - } - EnemyClassBattleCardView enemyClassBattleCardView = battleEnemy.Class.BattleCardView as EnemyClassBattleCardView; - enemyClassBattleCardView.ClassCharacter.SetAnimationEnable(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION)); - if (battleEnemy.IsSkinEvolved) - { - enemyClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle); - } - } - - public void SendEchoRecovery(NetworkBattleReceiver.ReceiveData receiveData) - { - NetworkSender.SendEcho(-1, receiveData.actionType, sendKeyActionDataManager); - } - - protected void RecreateCardViews(IEnumerable cardList) - { - foreach (BattleCardBase card in cardList) - { - if (card.BattleCardView.IsNullView) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(card.CardId); - GameObject cardGameObject = CreateBaseCardGameObject(cardParameterFromId, card.IsPlayer, card.Index); - SetupCardObjectMaterials(cardGameObject, card); - card.RecreateView(cardGameObject); - } - } - } - protected override int CreateBackgroundId() { if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SIMPLE_STAGE)) @@ -537,7 +393,7 @@ public class NetworkBattleManagerBase : BattleManagerBase { return backGroundId; } - return GameMgr.GetIns().GetNetworkUserInfoData().GetFieldId(); + return this.GameMgr.GetNetworkUserInfoData().GetFieldId(); } protected override OperateMgr CreateOperateMgr() @@ -558,10 +414,9 @@ public class NetworkBattleManagerBase : BattleManagerBase { base.StartOpening(FirstAttack); TurnEndButtonUI component = SBattleLoad.m_TurnEndBtnUI.GetComponent(); - if (!GameMgr.GetIns().IsAINetwork || turnEndTimeController == null) - { - turnEndTimeController = new TurnEndTimeController(this, BattlePlayer, component); - } + // IsAINetwork is const-false in headless — the guard `!false || X` is a tautology, so + // turnEndTimeController is always re-constructed on StartOpening. + turnEndTimeController = new TurnEndTimeController(this, BattlePlayer, component); } protected override void SetupEvent() @@ -648,9 +503,9 @@ public class NetworkBattleManagerBase : BattleManagerBase BattlePlayer.OnTurnEndStart += delegate { _isNoLimitJudgeResult = true; - if (ToolboxGame.RealTimeNetworkAgent != null) + if (this.InstanceNetworkAgent != null) { - ToolboxGame.RealTimeNetworkAgent.ResetDisconnectLogNum(); + this.InstanceNetworkAgent.ResetDisconnectLogNum(); } }; BattleEnemy.OnTurnEndStart += delegate @@ -861,12 +716,12 @@ public class NetworkBattleManagerBase : BattleManagerBase protected virtual bool isNetworkOepn() { - return ToolboxGame.RealTimeNetworkAgent.IsOpen(); + return this.InstanceNetworkAgent.IsOpen(); } private IEnumerator WaitNetworkBattleLoading() { - while (ToolboxGame.RealTimeNetworkAgent == null) + while (this.InstanceNetworkAgent == null) { yield return null; } @@ -875,7 +730,7 @@ public class NetworkBattleManagerBase : BattleManagerBase yield return null; } FirstSettingRealTimeNetworkBattle(); - int randomSeed = GameMgr.GetIns().GetNetworkUserInfoData().GetRandomSeed(); + int randomSeed = this.GameMgr.GetNetworkUserInfoData().GetRandomSeed(); LocalLog.AccumulateLastTraceLog("657699SetSeed " + randomSeed); _stableRandom = new System.Random(randomSeed); _stableRandomOnlySelf = new System.Random(randomSeed); @@ -883,16 +738,16 @@ public class NetworkBattleManagerBase : BattleManagerBase protected void FirstSettingRealTimeNetworkBattle() { - ToolboxGame.RealTimeNetworkAgent.SetNetworkBattleMgr(this); + this.InstanceNetworkAgent.SetNetworkBattleMgr(this); } public virtual void SettingOpponentAliveEvent() { - NetworkStatus playerNetworkStatus = ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus; + NetworkStatus playerNetworkStatus = this.InstanceNetworkAgent.PlayerNetworkStatus; playerNetworkStatus.OnAlive = (Action)Delegate.Combine(playerNetworkStatus.OnAlive, new Action(OnPlayerAlive)); - NetworkStatus opponentNetworkStatus = ToolboxGame.RealTimeNetworkAgent.OpponentNetworkStatus; + NetworkStatus opponentNetworkStatus = this.InstanceNetworkAgent.OpponentNetworkStatus; opponentNetworkStatus.OnAlive = (Action)Delegate.Combine(opponentNetworkStatus.OnAlive, new Action(OpponentAliveCallback)); - NetworkStatus opponentNetworkStatus2 = ToolboxGame.RealTimeNetworkAgent.OpponentNetworkStatus; + NetworkStatus opponentNetworkStatus2 = this.InstanceNetworkAgent.OpponentNetworkStatus; opponentNetworkStatus2.OnDisconnect = (Action)Delegate.Combine(opponentNetworkStatus2.OnDisconnect, new Action(OpponentDisconnectCallback)); } @@ -921,7 +776,6 @@ public class NetworkBattleManagerBase : BattleManagerBase }; operateMgr.OnSetCard += delegate(BattleCardBase card) { - NetworkBattleSender.PlayActionLogMsg += "OnSetCard \n"; NowPlayCard = card; }; if (base.IsRecovery) @@ -930,57 +784,46 @@ public class NetworkBattleManagerBase : BattleManagerBase } operateMgr.OnSetCardSuccess += delegate(BattleCardBase originalCard, BattleCardBase card, IEnumerable selectedCard) { - NetworkBattleSender.PlayActionLogMsg += "OnSetCardSuccess \n"; SettingPlaySelectCard(card.IsChoiceBraveSkillCard ? originalCard : card, selectedCard); }; operateMgr.OnSetCardComplete += delegate { - NetworkBattleSender.PlayActionLogMsg += "OnSetCardComplete \n"; if (_operatePlayCard != null && _operatePlayCard.IsPlayer) { SendPlayCard(_operatePlayCard, _operatePlaySelectCard, sendKeyActionDataManager); initSelectData(); - NetworkBattleSender.PlayActionLogMsg = ""; } IsCardPlayToTurnEndTimeoutStop = false; return NullVfx.GetInstance(); }; operateMgr.OnEvolveSuccess += delegate(BattleCardBase originalCard, BattleCardBase card, IEnumerable selectedCard) { - NetworkBattleSender.PlayActionLogMsg += "OnEvolveSuccess \n"; SettingPlaySelectCard(card, selectedCard); }; operateMgr.OnEvoleComplete += delegate { - NetworkBattleSender.PlayActionLogMsg += "OnEvoleComplete \n"; if (_operatePlayCard != null && _operatePlayCard.IsPlayer) { SendEvolveData(_operatePlayCard, _operatePlaySelectCard, sendKeyActionDataManager); initSelectData(); - NetworkBattleSender.PlayActionLogMsg = ""; } return NullVfx.GetInstance(); }; operateMgr.OnPlayerAttack += delegate(BattleCardBase attackCard, BattleCardBase targetCard) { - NetworkBattleSender.PlayActionLogMsg += "OnPlayerAttack \n"; SendAttackData(attackCard, targetCard); - NetworkBattleSender.PlayActionLogMsg = ""; return NullVfx.GetInstance(); }; operateMgr.OnBeforeFusion += delegate(BattleCardBase card, IEnumerable selectedCard) { - NetworkBattleSender.PlayActionLogMsg += "OnFusionSuccess \n"; SettingPlaySelectCard(card, selectedCard); }; operateMgr.OnAfterFusion += delegate { - NetworkBattleSender.PlayActionLogMsg += "OnFusionComplete \n"; if (_operatePlayCard != null && _operatePlayCard.IsPlayer) { SendFusionData(_operatePlayCard, _operatePlaySelectCard, sendKeyActionDataManager); initSelectData(); - NetworkBattleSender.PlayActionLogMsg = ""; } return NullVfx.GetInstance(); }; @@ -1033,13 +876,13 @@ public class NetworkBattleManagerBase : BattleManagerBase base.DisposeBattleGameObj(); BattleFinishToEffectClear(); BattleFinishToStopIntervalChecker(); - ToolboxGame.DestroyNetworkAgent(); + if (this.InstanceNetworkAgent is { } _agentToDestroy) { UnityEngine.Object.DestroyImmediate(_agentToDestroy.gameObject); this.InstanceNetworkAgent = null; } StopJudgeResultCoroutine(); StopReconnectCorutine(); - GameMgr.GetIns().IsNetworkBattle = false; - GameMgr.GetIns().IsWatchBattle = false; - GameMgr.GetIns().IsReplayBattle = false; - GameMgr.GetIns().IsNewReplayBattle = false; + // End-of-battle GameMgr flag resets dropped in Phase-3: three of the four flags are + // const-false in Phase-4 (IsWatchBattle / IsReplayBattle / IsNewReplayBattle) and can't + // be assigned; IsNetworkBattle stays true for the node's whole lifetime (the node IS a + // network battle) so resetting it here would be wrong for a subsequent battle anyway. SettingNetworkBattleEnd(); } @@ -1076,7 +919,8 @@ public class NetworkBattleManagerBase : BattleManagerBase { bool flag = false; BattleCardBase battleCardBase = null; - if (!isPlayer && NetworkBattleGenericTool.GetCardPlaceState(BattleEnemy, index) == NetworkBattleDefine.NetworkCardPlaceState.Hand && !GameMgr.GetIns().IsAdmin) + // IsAdmin is const-false in headless — `!IsAdmin` is a tautology; dropped from the guard. + if (!isPlayer && NetworkBattleGenericTool.GetCardPlaceState(BattleEnemy, index) == NetworkBattleDefine.NetworkCardPlaceState.Hand) { flag = true; battleCardBase = NetworkBattleGenericTool.GetIndexToCardBase(this, BattleEnemy, index); @@ -1122,7 +966,7 @@ public class NetworkBattleManagerBase : BattleManagerBase { RegisterActionManager.Add(new RegisterSpecialWin(winPlayer.IsPlayer)); BattleFinishToEffectClear(); - base.VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); + base.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); _isSendSpecialWin = true; bool playerDead = !winPlayer.IsPlayer; _isSpecialWin = winPlayer.IsPlayer; @@ -1134,7 +978,7 @@ public class NetworkBattleManagerBase : BattleManagerBase if (battlePlayer.IsShortageDeckWin) { BattleFinishToEffectClear(); - base.VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); + base.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); _isSendSpecialWin = true; _isSpecialWin = battlePlayer.IsPlayer; } @@ -1254,8 +1098,8 @@ public class NetworkBattleManagerBase : BattleManagerBase base.VfxMgr.RegisterImmediateVfx(vfx2); } SelfDisconnectOffTouchRelease(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.OffNotHideAndNotCreate(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.HideAlertDialogue(); + BattlePlayer.PlayerBattleView.OffNotHideAndNotCreate(); + BattlePlayer.PlayerBattleView.HideAlertDialogue(); IsShowDisconnectPanel = false; } } @@ -1264,78 +1108,6 @@ public class NetworkBattleManagerBase : BattleManagerBase } } - public virtual void FinishBattleEffect(bool classDead) - { - BATTLE_RESULT_TYPE bATTLE_RESULT_TYPE = _finishEffectType; - if (_isNodeErrorToNocontest) - { - switch (BattleResultType) - { - case BATTLE_RESULT_TYPE.CONSISTENCY: - BattleResultControl.SetSpecialResultTypeText(Data.SystemText.Get("Battle_0481")); - break; - case BATTLE_RESULT_TYPE.WIN: - bATTLE_RESULT_TYPE = BATTLE_RESULT_TYPE.LOSE; - SettingResultUI_SpecialResultTypeText(bATTLE_RESULT_TYPE); - break; - case BATTLE_RESULT_TYPE.LOSE: - bATTLE_RESULT_TYPE = BATTLE_RESULT_TYPE.WIN; - SettingResultUI_SpecialResultTypeText(bATTLE_RESULT_TYPE); - break; - } - _isNodeErrorToNocontest = false; - } - bool isPlayer = false; - switch (bATTLE_RESULT_TYPE) - { - case BATTLE_RESULT_TYPE.WIN: - isPlayer = true; - break; - case BATTLE_RESULT_TYPE.LOSE: - isPlayer = false; - break; - case BATTLE_RESULT_TYPE.CONSISTENCY: - BattleResultControl.SetBattleFinishConsistency(); - isPlayer = true; - classDead = false; - break; - } - if (classDead) - { - BattleCardBase battleCardBase = GetBattlePlayer(isPlayer).Class; - if (battleCardBase.Life >= 1 && !battleCardBase.IsDead) - { - battleCardBase.FlagCardAsDestroyedByKiller(); - FINISH_TYPE finishTypeByStatus = GetFinishTypeByStatus(); - base.VfxMgr.RegisterSequentialVfx(DeadClass(isPlayer, finishTypeByStatus)); - } - } - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - InitiateGameEndSequence(!isPlayer); - })); - } - - public FINISH_TYPE GetFinishTypeByStatus() - { - FINISH_TYPE fINISH_TYPE = FINISH_TYPE.NORMAL; - switch (JudgeResultReceiveCode) - { - case NetworkBattleReceiver.RESULT_CODE.RetireWin: - case NetworkBattleReceiver.RESULT_CODE.RetireLose: - return FINISH_TYPE.RETIRE; - case NetworkBattleReceiver.RESULT_CODE.SpecialWin: - case NetworkBattleReceiver.RESULT_CODE.SpecialLose: - return FINISH_TYPE.SPECIAL_WIN; - default: - return FINISH_TYPE.NORMAL; - } - } - - public void DebugFinishSend() - { - } - protected virtual void FinishBattleSend(NetworkBattleSender.JUDGE_RESULT_STATUS judgeResultStatus, bool isWin = false, bool isNotRetry = false) { LocalLog.AccumulateLastTraceLog("FinishSend " + judgeResultStatus); @@ -1356,10 +1128,6 @@ public class NetworkBattleManagerBase : BattleManagerBase } } - public void DebugJudgeResult() - { - } - private IEnumerator WaitToReconnectSocket() { WaitForSeconds wait = new WaitForSeconds(16f); @@ -1395,7 +1163,7 @@ public class NetworkBattleManagerBase : BattleManagerBase public virtual void SendFinishBattleTask() { BattlePlayer.BattleView.HideTurnEndButton(); - ToolboxGame.RealTimeNetworkAgent.FinishBattleTask(); + this.InstanceNetworkAgent.FinishBattleTask(); } private IEnumerator SendJudgeResultRetry() @@ -1487,13 +1255,6 @@ public class NetworkBattleManagerBase : BattleManagerBase } } - public void NodeErrorToNocontest() - { - _isNodeErrorToNocontest = true; - _finishEffectType = BATTLE_RESULT_TYPE.CONSISTENCY; - ToolboxGame.RealTimeNetworkAgent.FinishBattleTask(); - } - private void StopJudgeResultCoroutine() { if (_checkJudgeResultToDisconnectCoroutine != null) @@ -1515,7 +1276,7 @@ public class NetworkBattleManagerBase : BattleManagerBase UIManager instance = UIManager.GetInstance(); instance.dialogAllClear(); SettingNetworkBattleEnd(); - ToolboxGame.DestroyNetworkAgent(); + if (this.InstanceNetworkAgent is { } _agentToDestroy) { UnityEngine.Object.DestroyImmediate(_agentToDestroy.gameObject); this.InstanceNetworkAgent = null; } DialogBase dialogBase = instance.CreateDialogClose(isSystem: true); dialogBase.SetSize(DialogBase.Size.M); if (isError) @@ -1533,16 +1294,16 @@ public class NetworkBattleManagerBase : BattleManagerBase dialogBase.SetFadeButtonEnabled(flag: false); BattleFinishToStopIntervalChecker(); instance.closeInSceneCenterLoading(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.OffNotHideAndNotCreate(); - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.HideAlertDialogue(); + BattlePlayer.PlayerBattleView.OffNotHideAndNotCreate(); + BattlePlayer.PlayerBattleView.HideAlertDialogue(); } } protected void BeforeDisconnectLose() { - if (ToolboxGame.RealTimeNetworkAgent != null) + if (this.InstanceNetworkAgent != null) { - ToolboxGame.RealTimeNetworkAgent.ReconnectSocket(); + this.InstanceNetworkAgent.ReconnectSocket(); } } @@ -1619,15 +1380,6 @@ public class NetworkBattleManagerBase : BattleManagerBase return NetworkBattleReceiver.RESULT_CODE.NotFinish; } - private bool IsDisconnectLose() - { - if (disconnectToLoseChecker.IsSelfDisconnectLose()) - { - return true; - } - return false; - } - private bool IsBackTitleOnDisconnect() { if (disconnectToLoseChecker.IsSelfDisConnectOnTimeout()) @@ -1647,7 +1399,7 @@ public class NetworkBattleManagerBase : BattleManagerBase } if (JudgeCurrentFinishStatus() != NetworkBattleReceiver.RESULT_CODE.NotFinish) { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; + RealTimeNetworkAgent realTimeNetworkAgent = this.InstanceNetworkAgent; realTimeNetworkAgent.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent.OnAck, new Action>(AckEmitBattleFinish)); } } @@ -1665,7 +1417,7 @@ public class NetworkBattleManagerBase : BattleManagerBase protected virtual void AckEmitBattleFinish(Dictionary objs) { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; + RealTimeNetworkAgent realTimeNetworkAgent = this.InstanceNetworkAgent; realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckEmitBattleFinish)); BattleFinishToTurnEndFinal(isSelfTurn: true); } @@ -1761,16 +1513,6 @@ public class NetworkBattleManagerBase : BattleManagerBase networkBattleData.AfterSettingReceiveData(); } - public void ConductReplayReceiveData(NetworkBattleReceiver.ReplayReceiveData receiveData) - { - networkBattleData.SetReceiveData(receiveData); - if (!_isJudgeResultReceive) - { - NewReplayOperationCollection networkOperationCollection = new NewReplayOperationCollection(this as NetworkReplayBattleMgr, receiveData, networkBattleData); - (OperateReceive as NewReplayOperateReceive).StartReplayOperate(networkOperationCollection, receiveData); - } - } - protected virtual NetworkOperationCollectionBase CreateNetworkOperationCollection(NetworkBattleReceiver.ReceiveData receivedData, bool isPlayer) { if (base.IsRecovery) @@ -1919,10 +1661,8 @@ public class NetworkBattleManagerBase : BattleManagerBase bool flag3 = skillConditionCheck.IsInvoked == skill.IsInvoked; if (flag && skillConditionCheck.Index == index && flag2 && flag3) { - if (GameMgr.GetIns().IsWatchBattle && skillConditionCheck.isOpponent == isPlayer) - { - return false; - } + // IsWatchBattle const-false in headless — the guarded `return false` was watch-mode + // dead code. return skillConditionCheck.activate == 1; } } @@ -1982,10 +1722,8 @@ public class NetworkBattleManagerBase : BattleManagerBase networkTouchControl.notEvolCardFlag = true; isStopOperateFlag = true; BattlePlayer.PlayerBattleView.TurnEndButtonUI.HideBtn(); - if (!GameMgr.GetIns().IsWatchBattle) - { - MenuButtonObject.SetActive(value: false); - } + // IsWatchBattle const-false — `!IsWatchBattle` is a tautology. + MenuButtonObject.SetActive(value: false); BattlePlayer.PlayerBattleView.AllClear(popUpClose: true); BattleCardBase hitCard = networkTouchControl._hitCard; if (hitCard != null && hitCard.IsOnMove) @@ -2033,11 +1771,6 @@ public class NetworkBattleManagerBase : BattleManagerBase } } - public bool IsEchoWait() - { - return networkBattleData.isEchoWait; - } - private void OnPlayerAlive() { ConnectionReportTrigger.ConnectionReport(this); @@ -2050,7 +1783,7 @@ public class NetworkBattleManagerBase : BattleManagerBase public IEnumerable RecoverySkillTarget(IEnumerable skillTargets, int targetCount) { - if (GameMgr.GetIns().IsNetworkBattle) + if (this.GameMgr.IsNetworkBattle) { return skillTargets; } @@ -2128,31 +1861,4 @@ public class NetworkBattleManagerBase : BattleManagerBase } return -1; } - - public void ReplaceDeckCardOnWatch(bool isPlayer, int idx, int id) - { - BattlePlayerBase battlePlayer = GetBattlePlayer(isPlayer); - BattleCardBase battleCardBase = battlePlayer.DeckCardList.FirstOrDefault((BattleCardBase c) => c.Index == idx); - if (CardMaster.GetInstanceForBattle().GetCardParameterFromId(id).CharType != CardBasePrm.CharaType.NORMAL) - { - int index = battlePlayer.DeckCardList.IndexOf(battleCardBase); - battleCardBase.GetBuildInfo.CardId = id; - battleCardBase = (battlePlayer.DeckCardList[index] = CardCreatorBase.CreateToken(battleCardBase.GetBuildInfo, createNullView: true)); - } - battleCardBase.ReplaceParameterAndSkillOnDeck(id); - if (battleCardBase.HasDeckSelfSkill) - { - battlePlayer.AddDeckSkillCard(battleCardBase); - } - } - - public void RecordSelectSkillInRecovery(NetworkBattleReceiver.ReceiveData receiveData) - { - OperateReceive.RecordSelectSkillInRecovery(receiveData); - } - - public void CheckLatestReplayInfoInRecovery() - { - OperateReceive.CheckLatestReplayInfoInRecovery(); - } } diff --git a/SVSim.BattleEngine/Engine/NetworkBattleReceiver.cs b/SVSim.BattleEngine/Engine/NetworkBattleReceiver.cs index cb40d2b0..fe986258 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleReceiver.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleReceiver.cs @@ -51,10 +51,6 @@ public class NetworkBattleReceiver public bool isWin; - public bool IsPlayerDead; - - public bool IsEnemyDead; - public bool _isBurialRiteSelect; public bool IsChoiceBraveSelect; @@ -113,8 +109,6 @@ public class NetworkBattleReceiver public bool IsChoice => keyActionType.Exists((SendKeyActionDataManager.KeyActionType x) => x == SendKeyActionDataManager.KeyActionType.Choice || x == SendKeyActionDataManager.KeyActionType.HaveBeforeSkillChoice); - public bool IsChoiceEvolution => keyActionType.Exists((SendKeyActionDataManager.KeyActionType x) => x == SendKeyActionDataManager.KeyActionType.ChoiceEvolution); - public bool IsChoiceBrave => keyActionType.Exists((SendKeyActionDataManager.KeyActionType x) => x == SendKeyActionDataManager.KeyActionType.ChoiceBrave); public bool IsBurialRate => keyActionType.Exists((SendKeyActionDataManager.KeyActionType x) => x == SendKeyActionDataManager.KeyActionType.BurialRate); @@ -125,406 +119,91 @@ public class NetworkBattleReceiver public List GetReceiveCardList() { - if (!GameMgr.GetIns().IsWatchBattle && !BattleManagerBase.GetIns().IsRecovery) - { - return knownCardList; - } + // Pre-Phase-5b: gated on mgr.IsRecovery to choose between known vs. watch card lists. + // Headless PVP relay stays in the "recovery" state throughout (per Phase 3 notes on + // HeadlessNetworkBattleMgr.IsRecovery = true), so the else-branch is the safe default. return watchCardList; } } public class ReplayReceiveData : ReceiveData { - public ReplayOperationType Operation; - - public int AddPpTotalCount; - - public int Pp; - - public int Bp; - - public int Ep; - - public int CardIndex; - - public List CardIndexList; - - public List TargetIndexList; - - public List CardIdList; - - public string SelectCard; - - public string OwnerCardName; - - public List CardNameList = new List(); - - public List DestroyCardNameList = new List(); - - public List BanishCardNameList = new List(); - - public List IndestructibleCardNameList = new List(); - - public List EffectTargetCardNameList = new List(); - - public string PlayVoiceOnDeathCard = string.Empty; public CardInfo CardInfo; - public List CardInfoList; - - public EffectInfo EffectInfo; - - public int Attack; - public int Life; - public int MultiplyAttack; - - public int MultiplyLife; - public int MaxLife; - public List RemoveCostChangeList; - - public List DepriveOffenseBuffList; - - public List DepriveLifeBuffList; - public int Cost; - public List AddCostList; - - public List SetCostList; - - public List AddSpellChargeList; - - public int TransformCardId; - - public BattleCardBase.TransformType TransformType; - - public bool IsOpen; - - public bool IsOpenDrawSkill; - - public bool IsReserved; - - public List DealDamageList; - - public List IsReflectionDamage; - - public List HealList; - - public bool IsAttackerDead; - - public bool IsTargetDead; - - public int ReceiveDamage; - - public bool IsEvolve; - - public bool IsActive; - - public bool IsNotConsumeEp; - - public int EvolveMeWhenAttackIndex; - - public bool IsDeckSelf; - - public bool IsBurialRite; - - public int ChangeCount; - - public bool IsDestroy; - - public bool IsChange; - - public List IsCostUpList; - - public bool IsSpellCharge; - - public bool IsOpenCard; - - public bool IsHalf; - - public bool IsAdd; - - public bool IsTransformSelect; - - public bool IsFusionNecromance; - - public bool IsFusionMetamorphose; - - public int FusionMetamorphoseCardId; - - public int SkillHashCode; - - public bool IsOnSummonSkill; - - public bool IsInvoked; - - public string SkillVoice; - - public bool IsLastDrawOpenCard; - - public bool IsOwnerEffect; - - public bool IsIgnoreVoice; - - public bool IsRandomVoice; - - public bool IsEvoVoice; - - public bool IsImmediate; - - public bool BySkill; - - public bool OnlyEffect; - - public bool OnlyAttackEffect; - - public bool UpdateAttackEffect; - - public bool UseRecordAttackEffect; - public CardBasePrm.ClanType Clan; public CardBasePrm.TribeInfo Tribe; - - public ClassCharaPrm.EmotionType EmoteType; - - public List DestroyTypeList; - - public SkillCollectionBase.WhenPlayEffectType WhenPlayEffectType; - - public int BattleLogIndex; - - public List SideLogSkillInfoList; - - public StatusPanelInfo PlayerStatusPanelInfo; - - public StatusPanelInfo EnemyStatusPanelInfo; - - public ClassInfoUiInfo PlayerClassInfo; - - public ClassInfoUiInfo EnemyClassInfo; - - public List MyRotationBonusInfoList = new List(); - - public AvatarBattleDescriptionValueInfo PlayerAvatarBattleDescInfo; - - public AvatarBattleDescriptionValueInfo EnemyAvatarBattleDescInfo; - - public BattleManagerBase.FINISH_TYPE FinishType; - - public RESULT_CODE ResultCode; - - public int MaxSelectCount; - - public bool CanFusionMetamorphose; - - public bool IsChoiceBraveData; } public class CardInfo { - public int Id; - - public int Index; - - public bool IsSelf; public int Cost; - public bool IsEvolution; - - public int ExecutedFixedUseCostIndex = -1; - - public List ParameterModifierList = new List(); - - public List UnionBurstModifierValueList = new List(); - - public List SkyboundArtModifierValueList = new List(); - - public List SuperSkyboundArtModifierValueList = new List(); - - public List FusionIngredientIdxList = new List(); - - public HandCardFrameEffectType HandCardFrameEffectType; - - public bool IsHandEffectActive; - public List InplaySkillEffectList; public int InductionNumber; - public bool Attackable; - - public bool IsCantAttackClass; - public int AttackableCount; - public bool ForceHideAttackEffect; - - public List SkillDescriptionValueList; - - public List EvoSkillDescriptionValueList; - - public List BuffInfoList = new List(); - - public List NoConsumeEpBuffInfoNameList = new List(); - - public List BuffInfoLabelList = new List(); - public List Tribe = new List(); - public bool IsSameBuff; - - public bool IsOverflow; - - public int SpellChargeCount = -1; - public int ChantCount; - public int WhiteRitualCount = -1; - public int MaxAttackableCount = -1; - - public int MetamorphoseCount; } public class ReplayBuffInfo { - public BuffCardInfo OwnerCardInfo; - - public BuffCardInfo PreviousOwnerCardInfo; - - public ReplayBuffType BuffType; - - public int CardIdFrom; - - public bool IsEvolutionSkill; - - public bool IsPlayer; - - public string DivergenceIdList; - - public List CopiedSkillDescriptionValueList = new List(); - - public List CopiedEvoSkillDescriptionValueList = new List(); } public class BuffCardInfo { - public string CardName; public int CardId; - - public int MetamorphoseCount; } public class EffectInfo { - public string EffectPath; - - public EffectMgr.EngineType EngineType; - - public string SePath; - - public EffectMgr.MoveType EffectMoveType; - - public EffectMgr.TargetType EffectTargetType; - - public float EffectTime; - - public bool IsFollowInHand; - - public bool IsTargetPosition; - - public bool IsWhenFusioned; } public class SideLogSkillInfo { - public int Index; - - public bool IsSelf; public int CardId; - public int SkillHashCode; - - public bool IsEvolve; - - public bool IsOnSummonSkill; - - public bool IsInvoked; - - public bool IsPrivate; - - public bool IsInDeck; - public CardInfo CardInfo; } public class StatusPanelInfo { - public int HandCount; - - public int CemetaryCount; - - public int DeckCount; - - public bool IsDrew; } public class ClassInfoUiInfo { - public int TurnPlayCount; - - public int CemetaryCount; public int Life; - - public bool IsForceBerserk; - - public bool IsEnterForceBerserk; - - public bool IsChangeResonance; } public class MyRotationBonusInfo { - public string AbilityId; - - public bool IsSelf; - - public int RemainingIncreaseAddPptotalTurn; - - public bool IsRemainIncreaseAddPptotalTurn; - - public int RemainingSkillCount; - - public bool IsRemainSkill; } public class AvatarBattleDescriptionValueInfo { - public List PassiveSkillDescriotionValueList = new List(); - - public List> ChoiceBraveDescriotionValueListList = new List>(); } public enum DestroyType { None, - BurialRite, - WhiteRitual, - ChantCount, - WhenDestroy, - Killer, - WhenDestroyAndKiller - } + ChantCount } public enum InplaySkillEffect { @@ -550,382 +229,44 @@ public class NetworkBattleReceiver public enum ReplayReceiveDataType { - Operation, - IsSelf, - SelfCards, - OppoCards, - AddPpTotalCount, - Pp, - Bp, - EpCount, - CardIndexList, - Index, - TargetIndexList, CardInfo, - CardInfoList, - AddCostList, - SetCostList, - AddSpellChargeList, Cost, - Attack, Life, - MultiplyAttack, - MultiplyLife, MaxLife, - RemoveCostChangeList, - DepriveOffenseBuffList, - DepriveLifeBuffList, CardId, - CardIdList, - IsOpen, - IsOpenDrawSkill, - IsReserved, - DealDamageList, - ReceiveDamage, - IsReflectionDamage, - HealList, - IsAttackerDead, - IsTargetDead, - SelectCard, - OwnerCardName, - CardNameList, - DestroyCardNameList, - BanishCardNameList, - IndestructibleCardNameList, - EffectTargetCardNameList, - SkillSideLogList, - PlayVoiceOnDeathCard, - IsEvolve, - IsActive, - IsNotConsumeEp, - EvolveMeWhenAttackIndex, - TransformCardId, - TransformType, - IsDeckSelf, - IsInDeck, - IsPrivate, - IsBurialRite, - ChangeCount, - IsDestroy, - IsChange, - IsCostUpList, - IsSpellCharge, - IsOpenCard, - IsHalf, - IsAdd, - IsTransformSelect, - IsFusionNecromance, - IsFusionMetamorphose, - FusionMetamorphoseCardId, - EffectInfo, - DestroyTypeList, - WhenPlayEffectType, - AttachedCardList, - PlayerStatusPanelInfo, - EnemyStatusPanelInfo, - PlayerBattleInfo, - EnemyBattleInfo, - PlayerClassInfo, - EnemyClassInfo, - MyRotationBonusList, - PlayerAvatarBattleDescInfo, - EnemyAvatarBattleDescInfo, - BattleLogIndex, - IsWin, - IsPlayerDead, - IsEnemyDead, - FinishType, - ResultCode, - SkillHashCode, - IsOnSummonSkill, - IsInvoked, - SkillVoice, - IsLastDrawOpenCard, - IsOwnerEffect, - IsIgnoreVoice, - IsRandomVoice, - IsEvoVoice, - IsImmediate, - BySkill, - OnlyEffect, - OnlyAttackEffect, - UpdateAttackEffect, - UseRecordAttackEffect, Clan, - Tribe, - TribeType, - TribeChangeType, - EmoteType, - EnemyTurnNum, - MaxSelectCount, - CanFusionMetamorphose, - IsChoiceBrave - } + Tribe } public enum ReplayOperationType { - MulliganStart, - MulliganEnd, TurnStart, - TurnStartFinish, - TurnEnd, - TurnEndFinish, - AddPpTotal, - AddPp, - AddBp, - AddEp, - SetEp, - Draw, - TokenDraw, - Play, - ShowWhenPlayEffect, - SummonToken, - SummonCard, - AttackStart, - Attack, - CostChange, - RemoveCostChange, - PowerUp, GainPowerDown, - SetPowerDown, - DepriveBuff, - SpellCharge, - Damage, - Heal, - Discard, - DestroyOrBanish, - Evolve, - SkillEvolve, - Return, - StartSelect, - Select, - CompSelect, - CancelSelect, - StartChoice, - CompChoice, - CancelChoice, - StartFusion, - SelectFusion, - CompFusion, - CancelFusion, - ChantCountChange, - ChangeWhiteRitualStack, - Necromance, - ChangeMaxAttackableCount, - UpdateDeck, - IndexChange, - Metamorphose, - Geton, - Getoff, - Unite, - OpenCard, - CreateReservedCard, - AttachSkill, - ShowSkillEffect, - ShowSkillInductionEffect, - ShowIndependentEffect, - ChangeAffiliation, - OnChangeUnionBurstAndSkyboundArt, - ShowRepeatSkillEffect, - GiveCantActivateFanfare, - DepriveCantActivateFanfare, - LoseSkill, - UpdateHandInfo, - UpdateInplayInfo, - UpdateDeckInfo, - UpdateAttachedCardInfo, - UpdateFusionCardInfo, - UpdateStatusPanel, - UpdateBattleInfo, - UpdateClassInfoUi, - UpdateMyRotationBonus, - UpdateAvatarBattleDescInfo, - UpdateAttackableEffect, - UpdateChoiceBraveButtonEffet, - SkillProcessStart, - SkillVfxStart, - SkillVfxEnd, - ClearSideLog, - ClearDestroyedCardList, - PlayEmotion, - AttachShortageDeckWin, - ShortageDeckWin, - ShortageDeckLose, - SpecialWin, - SpecialLose, - BattleFinish - } + Necromance } public enum ReplayItemType { - Id, - Index, - IsSelf, Turn, Cost, Atk, Life, MaxLife, - IsEvolution, - ExecutedFixedUseCostIndex, - ParameterModifierList, - UnionBurstModifierValueList, - SkyboundArtModifierValueList, - SuperSkyboundArtModifierValueList, - FusionIngredientIdxList, - HandEffect, - IsHandEffectActive, - InplaySkillEffect, - InductionNumber, - Attackable, - IsCantAttackClass, MaxAttackableCount, AttackableCount, - ForceHideAttackEffect, - SkillDescriptionValueList, - EvoSkillDescriptionValueList, - PassiveSkillDescriptionValueList, - ChoiceBraveDescriptionValueListList, - BuffInfoList, - EffectPath, - EngineType, - SePath, - EffectMoveType, - EffectTargetType, - EffectTime, - IsFollowInHand, - IsTargetPosition, - IsWhenFusioned, - MaxPp, - Pp, - Bp, - Ep, - EpTotal, - CemetaryCount, - DeckCount, - HandCard, - InplayCard, - HandCount, - PlayCount, Player, Enemy, - IsDrew, - DeckCard, - CemetaryCard, - NecromanceZoneCard, - BanishCard, - FusionIngredientCard, - GetonCard, - UniteCard, - ReservedCard, - BlackHole, - ChoiceBraveCardList, - CardTotalNum, - Name, - LogType, - RightValue, - CardWithCount, - RandomArray, - LogItemType, - IsMinus, - IsNecromance, - IsDead, - IsDrain, - IsForceBerserk, - IsEnterForceBerserk, - IsChangeResonance, - BuffInfo, - BuffOwnerCardInfo, - PreviousBuffOwnerCardInfo, - CardName, - BuffType, - NoConsumeEpCardName, - BuffTextLabel, - BuffTextType, - BuffTextValue, - PreviousOwner, - DivergenceId, - CopiedSkillDescriptionValueList, - CopiedEvoSkillDescriptionValueList, - IsSameBuff, - IsOverFlow, - SpellChargeCount, Tribe, - ChantCount, - WhiteRitualCount, - IsShortageDeckWin, - IsEpEvolveThisTurn, - CantActivateFanfareCount, - CumulativeEvolutionCount, - IsEvolutionSkill, - TextureOption, - PlayedCardList, - PlayedCardIdList, - DestroyedCardList, - FusionCardList, - IsPlayerSideTurn, - MulliganChangedCount, - CardIdFrom, - AbilityId, - RemainingIncreaseAddPptotalTurn, - IsRemainIncreaseAddPptotalTurn, - RemainingSkillCount, - IsRemainSkill, - Priority, - BattleInfoValue, - BattleInfoTargetCardList, - BattleInfoTargetCardIdList, - ParameterModifierType, - ParameterModifierValue, - MetamorphoseCount - } + ChantCount} public enum ReplayBuffType { - None, - Copied, - SaveBurialRite, - Geton, - IsReserveTokenDrawSkill, - IsHiddenClassLogSkill - } + None } public enum ReplayBuffInfoTextType { - Cost, - StatusBuff, - Quick, - Rush, - Killer, - Drain, - AttackCount, - IgnoreGuard, - ConsumeEpModifier, - AllDamageShield, - NextDamageShield, - SkillDamageShield, - SpellDamageShield, - AllDamageCut, - NextDamageCut, - SkillDamageCut, - DamageClipping - } + Cost } public enum ReplayParameterModifierType { - OffenseAddModifier, - OffenseMultiplyModifier, - OffenseSetModifier, - LifeAddModifier, - LifeMultiplyModifier, - LifeSetModifier, - MaxLifeAddModifier, - MaxLifeSetModifier, - DamageCardParameterModifier, - HealCardParameterModifier, - CostHalfRoundUpModifier, - CostAddModifier, - CostSetModifier } public class TargetData @@ -989,12 +330,8 @@ public class NetworkBattleReceiver protected ReceiveData _receiveData; - protected ReplayReceiveData _replayReceiveData; - protected bool receiveStop; - public Action OnFinishSetupVirtualCard; - public NetworkBattleReceiver(NetworkBattleManagerBase battlemgr) { networkBattleMgr = battlemgr; @@ -1022,15 +359,6 @@ public class NetworkBattleReceiver return true; } - public void ReceivedReplayMessage(Dictionary data) - { - ConvertReplayReceiveDataToMakeData(data); - if (!receiveStop) - { - networkBattleMgr.ConductReplayReceiveData(_replayReceiveData); - } - } - public virtual void ReceivedTouchData(NetworkBattleDefine.NetworkBattleURI uri, bool isHaveSequence, Dictionary data, bool isPlayer = false, WatchDataHandler handler = null) { } @@ -1202,7 +530,7 @@ public class NetworkBattleReceiver _receiveData.choiceIdList = ConvertToListInt(dictionary2[SendKeyActionDataManager.KeyActionParameter.selectCard.ToString()]); } CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(_receiveData.transformBeforeCardId); - BattleCardBase battleCardBase = BattleManagerBase.GetIns().CreateBattleCard(cardParameterFromId.BaseCardId, isPlayer: false, null, cardParameterFromId, BattleManagerBase.GetIns().BattlePlayer, 0); + BattleCardBase battleCardBase = networkBattleMgr.CreateBattleCard(cardParameterFromId.BaseCardId, isPlayer: false, null, cardParameterFromId, networkBattleMgr.BattlePlayer, 0); UnityEngine.Object.DestroyImmediate(battleCardBase.BattleCardView.GameObject); bool isEvol = _receiveData.actionType == NetworkBattleDefine.PlayActionType.EVOLUTION || _receiveData.actionType == NetworkBattleDefine.PlayActionType.EVOLUTION_SELECT; if (!(NetworkBattleGenericTool.GetChoiceSkill(battleCardBase, isEvol) is Skill_transform)) @@ -1260,890 +588,6 @@ public class NetworkBattleReceiver } } - protected virtual void ConvertReplayReceiveDataToMakeData(Dictionary data, bool isPlayer = false) - { - _replayReceiveData = new ReplayReceiveData(); - try - { - for (int i = 0; i < data.Keys.Count; i++) - { - string text = data.Keys.ElementAt(i); - switch ((ReplayReceiveDataType)int.Parse(text)) - { - case ReplayReceiveDataType.Operation: - _replayReceiveData.Operation = (ReplayOperationType)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.IsSelf: - _replayReceiveData.isSelf = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.SelfCards: - { - List list5 = data[text] as List; - _replayReceiveData.CardInfoList = new List(); - for (int num4 = 0; num4 < list5.Count; num4++) - { - _replayReceiveData.CardInfoList.Add(CreateCardInfo(list5[num4] as JsonData)); - } - _replayReceiveData.selfIdxList = _replayReceiveData.CardInfoList.Select((CardInfo c) => c.Index).ToList(); - break; - } - case ReplayReceiveDataType.OppoCards: - _replayReceiveData.oppoIdxList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.AddPpTotalCount: - _replayReceiveData.AddPpTotalCount = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.Pp: - _replayReceiveData.Pp = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.Bp: - _replayReceiveData.Bp = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.EpCount: - _replayReceiveData.Ep = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.CardIndexList: - _replayReceiveData.CardIndexList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.Index: - _replayReceiveData.CardIndex = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.TargetIndexList: - _replayReceiveData.TargetIndexList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.CardInfo: - _replayReceiveData.CardInfo = CreateCardInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.CardInfoList: - { - List list3 = data[text] as List; - _replayReceiveData.CardInfoList = new List(); - for (int num2 = 0; num2 < list3.Count; num2++) - { - _replayReceiveData.CardInfoList.Add(CreateCardInfo(list3[num2] as JsonData)); - } - break; - } - case ReplayReceiveDataType.RemoveCostChangeList: - _replayReceiveData.RemoveCostChangeList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.DepriveOffenseBuffList: - _replayReceiveData.DepriveOffenseBuffList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.DepriveLifeBuffList: - _replayReceiveData.DepriveLifeBuffList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.AddCostList: - _replayReceiveData.AddCostList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.SetCostList: - _replayReceiveData.SetCostList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.AddSpellChargeList: - _replayReceiveData.AddSpellChargeList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.Cost: - _replayReceiveData.Cost = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.Attack: - _replayReceiveData.Attack = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.Life: - _replayReceiveData.Life = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.MultiplyAttack: - _replayReceiveData.MultiplyAttack = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.MultiplyLife: - _replayReceiveData.MultiplyLife = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.MaxLife: - _replayReceiveData.MaxLife = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.CardIdList: - _replayReceiveData.CardIdList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.IsOpen: - _replayReceiveData.IsOpen = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsOpenDrawSkill: - _replayReceiveData.IsOpenDrawSkill = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsReserved: - _replayReceiveData.IsReserved = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.DealDamageList: - _replayReceiveData.DealDamageList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.ReceiveDamage: - _replayReceiveData.ReceiveDamage = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.IsReflectionDamage: - { - List list6 = data[text] as List; - _replayReceiveData.IsReflectionDamage = new List(); - for (int num5 = 0; num5 < list6.Count; num5++) - { - _replayReceiveData.IsReflectionDamage.Add(ConvertToInt(list6[num5]) == 1); - } - break; - } - case ReplayReceiveDataType.HealList: - _replayReceiveData.HealList = (data[text] as List).Select((object o) => ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.IsAttackerDead: - _replayReceiveData.IsAttackerDead = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsTargetDead: - _replayReceiveData.IsTargetDead = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.SelectCard: - _replayReceiveData.SelectCard = data[text].ToString(); - break; - case ReplayReceiveDataType.OwnerCardName: - _replayReceiveData.OwnerCardName = data[text].ToString(); - break; - case ReplayReceiveDataType.CardNameList: - _replayReceiveData.CardNameList = (data[text] as List).Select((object o) => o.ToString()).ToList(); - break; - case ReplayReceiveDataType.DestroyCardNameList: - _replayReceiveData.DestroyCardNameList = (data[text] as List).Select((object o) => o.ToString()).ToList(); - break; - case ReplayReceiveDataType.BanishCardNameList: - _replayReceiveData.BanishCardNameList = (data[text] as List).Select((object o) => o.ToString()).ToList(); - break; - case ReplayReceiveDataType.IndestructibleCardNameList: - _replayReceiveData.IndestructibleCardNameList = (data[text] as List).Select((object o) => o.ToString()).ToList(); - break; - case ReplayReceiveDataType.EffectTargetCardNameList: - _replayReceiveData.EffectTargetCardNameList = (data[text] as List).Select((object o) => o.ToString()).ToList(); - break; - case ReplayReceiveDataType.SkillSideLogList: - { - List list4 = data[text] as List; - _replayReceiveData.SideLogSkillInfoList = new List(); - for (int num3 = 0; num3 < list4.Count; num3++) - { - _replayReceiveData.SideLogSkillInfoList.Add(CreateSideLogSkillInfo(list4[num3] as JsonData)); - } - break; - } - case ReplayReceiveDataType.PlayVoiceOnDeathCard: - _replayReceiveData.PlayVoiceOnDeathCard = data[text].ToString(); - break; - case ReplayReceiveDataType.IsEvolve: - _replayReceiveData.IsEvolve = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsActive: - _replayReceiveData.IsActive = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsNotConsumeEp: - _replayReceiveData.IsNotConsumeEp = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.EvolveMeWhenAttackIndex: - _replayReceiveData.EvolveMeWhenAttackIndex = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.TransformCardId: - _replayReceiveData.TransformCardId = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.TransformType: - _replayReceiveData.TransformType = (BattleCardBase.TransformType)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.IsDeckSelf: - _replayReceiveData.IsDeckSelf = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsBurialRite: - _replayReceiveData.IsBurialRite = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.ChangeCount: - _replayReceiveData.ChangeCount = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.IsDestroy: - _replayReceiveData.IsDestroy = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsChange: - _replayReceiveData.IsChange = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsCostUpList: - _replayReceiveData.IsCostUpList = (data[text] as List).Select((object o) => ConvertToInt(o) == 1).ToList(); - break; - case ReplayReceiveDataType.IsSpellCharge: - _replayReceiveData.IsSpellCharge = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsOpenCard: - _replayReceiveData.IsOpenCard = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsHalf: - _replayReceiveData.IsHalf = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsAdd: - _replayReceiveData.IsAdd = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsTransformSelect: - _replayReceiveData.IsTransformSelect = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsFusionNecromance: - _replayReceiveData.IsFusionNecromance = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsFusionMetamorphose: - _replayReceiveData.IsFusionMetamorphose = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.FusionMetamorphoseCardId: - _replayReceiveData.FusionMetamorphoseCardId = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.EffectInfo: - _replayReceiveData.EffectInfo = CreateEffectInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.DestroyTypeList: - _replayReceiveData.DestroyTypeList = (data[text] as List).Select((object o) => (DestroyType)ConvertToInt(o)).ToList(); - break; - case ReplayReceiveDataType.WhenPlayEffectType: - _replayReceiveData.WhenPlayEffectType = (SkillCollectionBase.WhenPlayEffectType)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.PlayerStatusPanelInfo: - _replayReceiveData.PlayerStatusPanelInfo = CreateStatusPanelInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.EnemyStatusPanelInfo: - _replayReceiveData.EnemyStatusPanelInfo = CreateStatusPanelInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.PlayerBattleInfo: - UpdateBattleInfo(data[text] as List, isPlayer: true); - break; - case ReplayReceiveDataType.EnemyBattleInfo: - UpdateBattleInfo(data[text] as List, isPlayer: false); - break; - case ReplayReceiveDataType.PlayerClassInfo: - _replayReceiveData.PlayerClassInfo = CreateClassInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.EnemyClassInfo: - _replayReceiveData.EnemyClassInfo = CreateClassInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.MyRotationBonusList: - { - List list2 = data[text] as List; - _replayReceiveData.MyRotationBonusInfoList = new List(); - for (int num = 0; num < list2.Count; num++) - { - _replayReceiveData.MyRotationBonusInfoList.Add(CreateMyRotationBonusInfo(list2[num] as JsonData)); - } - break; - } - case ReplayReceiveDataType.PlayerAvatarBattleDescInfo: - _replayReceiveData.PlayerAvatarBattleDescInfo = CreateAvatarBattleDescriotionValueInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.EnemyAvatarBattleDescInfo: - _replayReceiveData.EnemyAvatarBattleDescInfo = CreateAvatarBattleDescriotionValueInfo(data[text] as JsonData); - break; - case ReplayReceiveDataType.BattleLogIndex: - _replayReceiveData.BattleLogIndex = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.IsWin: - _replayReceiveData.isWin = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsPlayerDead: - _replayReceiveData.IsPlayerDead = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsEnemyDead: - _replayReceiveData.IsEnemyDead = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.FinishType: - _replayReceiveData.FinishType = (BattleManagerBase.FINISH_TYPE)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.ResultCode: - _replayReceiveData.ResultCode = (RESULT_CODE)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.SkillHashCode: - _replayReceiveData.SkillHashCode = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.IsOnSummonSkill: - _replayReceiveData.IsOnSummonSkill = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsInvoked: - _replayReceiveData.IsInvoked = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.SkillVoice: - _replayReceiveData.SkillVoice = data[text].ToString(); - break; - case ReplayReceiveDataType.IsLastDrawOpenCard: - _replayReceiveData.IsLastDrawOpenCard = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsOwnerEffect: - _replayReceiveData.IsOwnerEffect = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsIgnoreVoice: - _replayReceiveData.IsIgnoreVoice = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsRandomVoice: - _replayReceiveData.IsRandomVoice = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsEvoVoice: - _replayReceiveData.IsEvoVoice = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsImmediate: - _replayReceiveData.IsImmediate = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.BySkill: - _replayReceiveData.BySkill = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.OnlyEffect: - _replayReceiveData.OnlyEffect = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.OnlyAttackEffect: - _replayReceiveData.OnlyAttackEffect = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.UpdateAttackEffect: - _replayReceiveData.UpdateAttackEffect = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.UseRecordAttackEffect: - _replayReceiveData.UseRecordAttackEffect = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.Clan: - _replayReceiveData.Clan = (CardBasePrm.ClanType)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.Tribe: - { - JsonData jsonData = data[text] as JsonData; - List list = new List(); - JsonData jsonData2 = jsonData[103.ToString()]; - for (int j = 0; j < jsonData2.Count; j++) - { - list.Add((CardBasePrm.TribeType)ConvertToInt(jsonData2[j])); - } - _replayReceiveData.Tribe = new CardBasePrm.TribeInfo(list, (CardBasePrm.TribeChangeType)ConvertToInt(jsonData[104.ToString()])); - break; - } - case ReplayReceiveDataType.EmoteType: - _replayReceiveData.EmoteType = (ClassCharaPrm.EmotionType)ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.MaxSelectCount: - _replayReceiveData.MaxSelectCount = ConvertToInt(data[text]); - break; - case ReplayReceiveDataType.CanFusionMetamorphose: - _replayReceiveData.CanFusionMetamorphose = ConvertToInt(data[text]) == 1; - break; - case ReplayReceiveDataType.IsChoiceBrave: - _replayReceiveData.IsChoiceBraveData = ConvertToInt(data[text]) == 1; - break; - } - } - } - catch - { - LocalLog.AccumulateLastTraceLog("ConvertReciveDataToMakeData Error"); - Debug.LogError("ConvertReciveDataToMakeData Error"); - } - } - - public void UpdateBattleInfo(JsonData battleInfoData, bool isPlayer) - { - List list = new List(); - for (int i = 0; i < battleInfoData.Count; i++) - { - list.Add(battleInfoData[i]); - } - UpdateBattleInfo(list, isPlayer); - } - - public void UpdateBattleInfo(List battleInfoData, bool isPlayer) - { - List list = (isPlayer ? (networkBattleMgr as NewReplayBattleMgr).PlayerBattleInfoData : (networkBattleMgr as NewReplayBattleMgr).EnemyBattleInfoData); - list.Clear(); - for (int i = 0; i < battleInfoData.Count; i++) - { - JsonData jsonData = battleInfoData[i] as JsonData; - list.Add(CreateBattleInfoData(jsonData)); - } - } - - public NewReplayBattleMgr.BattleInfoData CreateBattleInfoData(JsonData jsonData) - { - NewReplayBattleMgr.BattleInfoData battleInfoData = new NewReplayBattleMgr.BattleInfoData(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.Priority: - battleInfoData.Priority = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.BattleInfoValue: - battleInfoData.Value = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.BattleInfoTargetCardList: - { - battleInfoData.DisplayCardIndexList = new List(); - JsonData jsonData3 = jsonData[text]; - for (int k = 0; k < jsonData3.Count; k++) - { - battleInfoData.DisplayCardIndexList.Add(ConvertToInt(jsonData3[k])); - } - break; - } - case ReplayItemType.BattleInfoTargetCardIdList: - { - battleInfoData.DisplayCardIdList = new List(); - JsonData jsonData2 = jsonData[text]; - for (int j = 0; j < jsonData2.Count; j++) - { - battleInfoData.DisplayCardIdList.Add(ConvertToInt(jsonData2[j])); - } - break; - } - } - } - return battleInfoData; - } - - public CardInfo CreateCardInfo(JsonData jsonData) - { - CardInfo cardInfo = new CardInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.Id: - cardInfo.Id = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.Index: - cardInfo.Index = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsSelf: - cardInfo.IsSelf = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.Cost: - cardInfo.Cost = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsEvolution: - cardInfo.IsEvolution = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.ExecutedFixedUseCostIndex: - cardInfo.ExecutedFixedUseCostIndex = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.ParameterModifierList: - { - cardInfo.ParameterModifierList = new List(); - JsonData jsonData14 = jsonData[text]; - for (int num7 = 0; num7 < jsonData14.Count; num7++) - { - NewReplayBattleMgr.ParameterModifierInfo item2 = new NewReplayBattleMgr.ParameterModifierInfo((ReplayParameterModifierType)ConvertToInt(jsonData14[num7][117.ToString()]), ConvertToInt(jsonData14[num7][118.ToString()])); - cardInfo.ParameterModifierList.Add(item2); - } - break; - } - case ReplayItemType.UnionBurstModifierValueList: - { - cardInfo.UnionBurstModifierValueList = new List(); - JsonData jsonData12 = jsonData[text]; - for (int num5 = 0; num5 < jsonData12.Count; num5++) - { - cardInfo.UnionBurstModifierValueList.Add(ConvertToInt(jsonData12[num5])); - } - break; - } - case ReplayItemType.SkyboundArtModifierValueList: - { - cardInfo.SkyboundArtModifierValueList = new List(); - JsonData jsonData11 = jsonData[text]; - for (int num4 = 0; num4 < jsonData11.Count; num4++) - { - cardInfo.SkyboundArtModifierValueList.Add(ConvertToInt(jsonData11[num4])); - } - break; - } - case ReplayItemType.SuperSkyboundArtModifierValueList: - { - cardInfo.SuperSkyboundArtModifierValueList = new List(); - JsonData jsonData10 = jsonData[text]; - for (int num3 = 0; num3 < jsonData10.Count; num3++) - { - cardInfo.SuperSkyboundArtModifierValueList.Add(ConvertToInt(jsonData10[num3])); - } - break; - } - case ReplayItemType.FusionIngredientIdxList: - { - cardInfo.FusionIngredientIdxList = new List(); - JsonData jsonData3 = jsonData[text]; - for (int k = 0; k < jsonData3.Count; k++) - { - cardInfo.FusionIngredientIdxList.Add(ConvertToInt(jsonData3[k])); - } - break; - } - case ReplayItemType.HandEffect: - cardInfo.HandCardFrameEffectType = (HandCardFrameEffectType)ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsHandEffectActive: - cardInfo.IsHandEffectActive = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.InplaySkillEffect: - { - cardInfo.InplaySkillEffectList = new List(); - JsonData jsonData16 = jsonData[text]; - for (int num9 = 0; num9 < jsonData16.Count; num9++) - { - cardInfo.InplaySkillEffectList.Add((InplaySkillEffect)ConvertToInt(jsonData16[num9])); - } - break; - } - case ReplayItemType.InductionNumber: - cardInfo.InductionNumber = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.Attackable: - cardInfo.Attackable = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.IsCantAttackClass: - cardInfo.IsCantAttackClass = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.AttackableCount: - cardInfo.AttackableCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.ForceHideAttackEffect: - cardInfo.ForceHideAttackEffect = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.SkillDescriptionValueList: - { - cardInfo.SkillDescriptionValueList = new List(); - JsonData jsonData15 = jsonData[text]; - for (int num8 = 0; num8 < jsonData15.Count; num8++) - { - cardInfo.SkillDescriptionValueList.Add(ConvertToInt(jsonData15[num8])); - } - break; - } - case ReplayItemType.EvoSkillDescriptionValueList: - { - cardInfo.EvoSkillDescriptionValueList = new List(); - JsonData jsonData13 = jsonData[text]; - for (int num6 = 0; num6 < jsonData13.Count; num6++) - { - cardInfo.EvoSkillDescriptionValueList.Add(ConvertToInt(jsonData13[num6])); - } - break; - } - case ReplayItemType.BuffInfoList: - { - JsonData jsonData4 = jsonData[text]; - if (jsonData4.Keys.Contains(89.ToString())) - { - cardInfo.IsSameBuff = true; - break; - } - JsonData jsonData5 = jsonData4[76.ToString()]; - for (int l = 0; l < jsonData5.Count; l++) - { - ReplayBuffInfo replayBuffInfo = new ReplayBuffInfo(); - replayBuffInfo.OwnerCardInfo = CreateBuffCardInfo(jsonData5[l][77.ToString()]); - if (jsonData5[l].Keys.Contains(78.ToString())) - { - replayBuffInfo.PreviousOwnerCardInfo = CreateBuffCardInfo(jsonData5[l][78.ToString()]); - } - replayBuffInfo.BuffType = (ReplayBuffType)jsonData5[l][80.ToString()].ToInt(); - replayBuffInfo.CardIdFrom = jsonData5[l][107.ToString()].ToInt(); - replayBuffInfo.IsEvolutionSkill = jsonData5[l][99.ToString()].ToBoolean(); - replayBuffInfo.IsPlayer = jsonData5[l][2.ToString()].ToBoolean(); - replayBuffInfo.DivergenceIdList = jsonData5[l][86.ToString()].ToString(); - if (jsonData5[l].Keys.Contains(87.ToString())) - { - new List(); - JsonData jsonData6 = jsonData5[l][87.ToString()]; - for (int m = 0; m < jsonData6.Count; m++) - { - replayBuffInfo.CopiedSkillDescriptionValueList.Add(ConvertToInt(jsonData6[m])); - } - } - if (jsonData5[l].Keys.Contains(88.ToString())) - { - new List(); - JsonData jsonData7 = jsonData5[l][88.ToString()]; - for (int n = 0; n < jsonData7.Count; n++) - { - replayBuffInfo.CopiedEvoSkillDescriptionValueList.Add(ConvertToInt(jsonData7[n])); - } - } - cardInfo.BuffInfoList.Add(replayBuffInfo); - } - JsonData jsonData8 = jsonData4[81.ToString()]; - for (int num = 0; num < jsonData8.Count; num++) - { - cardInfo.NoConsumeEpBuffInfoNameList.Add(jsonData8[num].ToString()); - } - JsonData jsonData9 = jsonData4[82.ToString()]; - for (int num2 = 0; num2 < jsonData9.Count; num2++) - { - ReplayBuffInfoLabel item = new ReplayBuffInfoLabel - { - Type = (ReplayBuffInfoTextType)jsonData9[num2][83.ToString()].ToInt() - }; - if (jsonData9[num2].Keys.Contains(84.ToString())) - { - item.Value = jsonData9[num2][84.ToString()].ToInt(); - } - cardInfo.BuffInfoLabelList.Add(item); - } - break; - } - case ReplayItemType.IsOverFlow: - cardInfo.IsOverflow = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.SpellChargeCount: - cardInfo.SpellChargeCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.Tribe: - { - cardInfo.Tribe = new List(); - JsonData jsonData2 = jsonData[text]; - for (int j = 0; j < jsonData2.Count; j++) - { - cardInfo.Tribe.Add(ConvertToInt(jsonData2[j])); - } - break; - } - case ReplayItemType.ChantCount: - cardInfo.ChantCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.WhiteRitualCount: - cardInfo.WhiteRitualCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.MaxAttackableCount: - cardInfo.MaxAttackableCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.MetamorphoseCount: - cardInfo.MetamorphoseCount = ConvertToInt(jsonData[text]); - break; - } - } - return cardInfo; - } - - private BuffCardInfo CreateBuffCardInfo(JsonData jsonData) - { - BuffCardInfo buffCardInfo = new BuffCardInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.CardName: - buffCardInfo.CardName = jsonData[text].ToString(); - break; - case ReplayItemType.Id: - buffCardInfo.CardId = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.MetamorphoseCount: - buffCardInfo.MetamorphoseCount = ConvertToInt(jsonData[text]); - break; - } - } - return buffCardInfo; - } - - private EffectInfo CreateEffectInfo(JsonData jsonData) - { - EffectInfo effectInfo = new EffectInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.EffectPath: - effectInfo.EffectPath = jsonData[text].ToString(); - effectInfo.SePath = "se_" + effectInfo.EffectPath; - break; - case ReplayItemType.EngineType: - effectInfo.EngineType = (EffectMgr.EngineType)ConvertToInt(jsonData[text]); - break; - case ReplayItemType.EffectMoveType: - effectInfo.EffectMoveType = (EffectMgr.MoveType)ConvertToInt(jsonData[text]); - break; - case ReplayItemType.EffectTargetType: - effectInfo.EffectTargetType = (EffectMgr.TargetType)ConvertToInt(jsonData[text]); - break; - case ReplayItemType.EffectTime: - effectInfo.EffectTime = float.Parse(jsonData[text].ToString()); - break; - case ReplayItemType.IsFollowInHand: - effectInfo.IsFollowInHand = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.IsTargetPosition: - effectInfo.IsTargetPosition = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.IsWhenFusioned: - effectInfo.IsWhenFusioned = ConvertToInt(jsonData[text]) == 1; - break; - } - } - return effectInfo; - } - - private SideLogSkillInfo CreateSideLogSkillInfo(JsonData jsonData) - { - SideLogSkillInfo sideLogSkillInfo = new SideLogSkillInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayReceiveDataType)int.Parse(text)) - { - case ReplayReceiveDataType.Index: - sideLogSkillInfo.Index = ConvertToInt(jsonData[text]); - break; - case ReplayReceiveDataType.IsSelf: - sideLogSkillInfo.IsSelf = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayReceiveDataType.CardId: - sideLogSkillInfo.CardId = ConvertToInt(jsonData[text]); - break; - case ReplayReceiveDataType.SkillHashCode: - sideLogSkillInfo.SkillHashCode = ConvertToInt(jsonData[text]); - break; - case ReplayReceiveDataType.IsEvolve: - sideLogSkillInfo.IsEvolve = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayReceiveDataType.IsOnSummonSkill: - sideLogSkillInfo.IsOnSummonSkill = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayReceiveDataType.IsInvoked: - sideLogSkillInfo.IsInvoked = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayReceiveDataType.IsInDeck: - sideLogSkillInfo.IsInDeck = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayReceiveDataType.IsPrivate: - sideLogSkillInfo.IsPrivate = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayReceiveDataType.CardInfo: - sideLogSkillInfo.CardInfo = CreateCardInfo(jsonData[text]); - break; - } - } - return sideLogSkillInfo; - } - - private StatusPanelInfo CreateStatusPanelInfo(JsonData jsonData) - { - StatusPanelInfo statusPanelInfo = new StatusPanelInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.HandCount: - statusPanelInfo.HandCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.CemetaryCount: - statusPanelInfo.CemetaryCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.DeckCount: - statusPanelInfo.DeckCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsDrew: - statusPanelInfo.IsDrew = ConvertToInt(jsonData[text]) == 1; - break; - } - } - return statusPanelInfo; - } - - public ClassInfoUiInfo CreateClassInfo(JsonData jsonData) - { - ClassInfoUiInfo classInfoUiInfo = new ClassInfoUiInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.PlayCount: - classInfoUiInfo.TurnPlayCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.CemetaryCount: - classInfoUiInfo.CemetaryCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.Life: - classInfoUiInfo.Life = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsForceBerserk: - classInfoUiInfo.IsForceBerserk = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.IsEnterForceBerserk: - classInfoUiInfo.IsEnterForceBerserk = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.IsChangeResonance: - classInfoUiInfo.IsChangeResonance = ConvertToInt(jsonData[text]) == 1; - break; - } - } - return classInfoUiInfo; - } - - public MyRotationBonusInfo CreateMyRotationBonusInfo(JsonData jsonData) - { - MyRotationBonusInfo myRotationBonusInfo = new MyRotationBonusInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.AbilityId: - myRotationBonusInfo.AbilityId = jsonData[text].ToString(); - break; - case ReplayItemType.IsSelf: - myRotationBonusInfo.IsSelf = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.RemainingIncreaseAddPptotalTurn: - myRotationBonusInfo.RemainingIncreaseAddPptotalTurn = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsRemainIncreaseAddPptotalTurn: - myRotationBonusInfo.IsRemainIncreaseAddPptotalTurn = ConvertToInt(jsonData[text]) == 1; - break; - case ReplayItemType.RemainingSkillCount: - myRotationBonusInfo.RemainingSkillCount = ConvertToInt(jsonData[text]); - break; - case ReplayItemType.IsRemainSkill: - myRotationBonusInfo.IsRemainSkill = ConvertToInt(jsonData[text]) == 1; - break; - } - } - return myRotationBonusInfo; - } - - public AvatarBattleDescriptionValueInfo CreateAvatarBattleDescriotionValueInfo(JsonData jsonData) - { - AvatarBattleDescriptionValueInfo avatarBattleDescriptionValueInfo = new AvatarBattleDescriptionValueInfo(); - for (int i = 0; i < jsonData.Keys.Count; i++) - { - string text = jsonData.Keys.ElementAt(i); - switch ((ReplayItemType)int.Parse(text)) - { - case ReplayItemType.PassiveSkillDescriptionValueList: - { - JsonData jsonData4 = jsonData[text]; - for (int l = 0; l < jsonData4.Count; l++) - { - avatarBattleDescriptionValueInfo.PassiveSkillDescriotionValueList.Add(ConvertToInt(jsonData4[l])); - } - break; - } - case ReplayItemType.ChoiceBraveDescriptionValueListList: - { - JsonData jsonData2 = jsonData[text]; - for (int j = 0; j < jsonData2.Count; j++) - { - JsonData jsonData3 = jsonData2[j]; - List list = new List(); - for (int k = 0; k < jsonData3.Count; k++) - { - list.Add(ConvertToInt(jsonData3[k])); - } - avatarBattleDescriptionValueInfo.ChoiceBraveDescriotionValueListList.Add(list); - } - break; - } - } - } - return avatarBattleDescriptionValueInfo; - } - protected void CreateSlideObjectReceiveData(string startPoint, string endPoint) { _receiveData._slideObjectType = (NetworkBattleSender.SLIDE_OBJECT_TYPE)Enum.Parse(typeof(NetworkBattleSender.SLIDE_OBJECT_TYPE), startPoint[0].ToString()); @@ -2183,7 +627,10 @@ public class NetworkBattleReceiver if (dictionary.ContainsKey(key)) { num = ConvertToInt(dictionary[key].ToString()); - isSelf = ((!networkBattleMgr.IsRecovery) ? (!handler.isOwner(dictionary[key].ToString())) : ((num != PlayerStaticData.UserViewerID) ? true : false)); + // Phase-5 chunk 39: dropped ambient PlayerStaticData.UserViewerID fallback in favor + // of the mgr's InstanceViewerId — recovery branch compares wire vid to the mgr's + // bound viewer id, live branch stays on handler.isOwner. + isSelf = ((!networkBattleMgr.IsRecovery) ? (!handler.isOwner(dictionary[key].ToString())) : ((num != networkBattleMgr.InstanceViewerId) ? true : false)); } } else @@ -2480,7 +927,7 @@ public class NetworkBattleReceiver if (receivedObject is Dictionary dictionary && dictionary.Keys.Contains("vid") && dictionary.Keys.Contains("value")) { int num = int.Parse(dictionary["vid"].ToString()); - if (GameMgr.GetIns().GetNetworkUserInfoData().GetSelfViewerId() == num) + if (networkBattleMgr.GameMgr.GetNetworkUserInfoData().GetSelfViewerId() == num) { return int.Parse(dictionary["value"].ToString()); } @@ -2498,35 +945,4 @@ public class NetworkBattleReceiver } return list; } - - public void RecordReplayInfoInRecoveryExceptUriList(NetworkBattleDefine.NetworkBattleURI uri, bool isHaveSequence, Dictionary data, bool isPlayer) - { - if (uri != NetworkBattleDefine.NetworkBattleURI.ChatStamp && uri != NetworkBattleDefine.NetworkBattleURI.SelectSkill) - { - return; - } - ConvertReceiveDataToMakeData(uri, isHaveSequence, data, isPlayer); - switch (_receiveData.dataUri) - { - case NetworkBattleDefine.NetworkBattleURI.ChatStamp: - { - if (Enum.TryParse(isPlayer ? _receiveData.playChatStamp.ToString() : _receiveData.oppoChatStamp.ToString(), out var result) && !ClassCharaPrm.IsEvolutionEmotionType(result)) - { - networkBattleMgr.GetBattlePlayer(isPlayer).CallOnEmotion(result); - } - break; - } - case NetworkBattleDefine.NetworkBattleURI.SelectSkill: - if (isPlayer) - { - networkBattleMgr.RecordSelectSkillInRecovery(_receiveData); - } - break; - } - } - - public void CheckLatestReplayInfoInRecoveryExceptUriList() - { - networkBattleMgr.CheckLatestReplayInfoInRecovery(); - } } diff --git a/SVSim.BattleEngine/Engine/NetworkBattleSender.cs b/SVSim.BattleEngine/Engine/NetworkBattleSender.cs index ed5e9357..b88b0d0f 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleSender.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleSender.cs @@ -26,7 +26,6 @@ public class NetworkBattleSender public enum JUDGE_RESULT_STATUS { BattleFinishToJudge = 100, - RecoveryBattleFinishToJudge = 110, RetrySend = 200, FailedToRetryJudgeResult = 201, OppoDisconnectVictory = 300, @@ -40,14 +39,9 @@ public class NetworkBattleSender MulliganLose = 601, BattleStopToJudgeResult = 700, ReceiveRetire = 800, - ReplayRetireDiff = 801, ReceiveConsistencyLose = 900, Invalid = 901, - WatchJudgeResult = 1000, - RecoveryError = 1100, - SwapTimeoutError = 1200, - Debug = 9999 - } + WatchJudgeResult = 1000} public enum SELECT_SKILL_OPERATION { @@ -79,13 +73,9 @@ public class NetworkBattleSender public enum HAND_URI_TYPE { - TOUCH_URI = 1, - SELECT_SKILL_URI = 2, SELECT_OBJECT_URI = 3, TURN_END_READY_URI = 4, - SLIDE_OBJECT_URI = 5, - HAND_NODE_ERROR = 99 - } + SLIDE_OBJECT_URI = 5 } private NetworkBattleManagerBase _battleMgr; @@ -95,14 +85,8 @@ public class NetworkBattleSender private List _alreadyEmitList = new List(); - public const float RETRY_INTERVAL = 0.5f; - private bool _isEmitStop_OutsideJudgeResult; - public static string PlayActionLogMsg = ""; - - private int _lastTouchIndex; - private BattleCardBase _lastSelectedCard; private BattleCardBase _selectedSlideCard; @@ -111,8 +95,6 @@ public class NetworkBattleSender private DateTime _oldSlideCurrentLocalTime; - private DateTime _oldSelectCurrentLocalTime; - public NetworkBattleSender(NetworkBattleManagerBase battlemgr, RegisterActionManager registerList, List unapprovedList, NetworkConsistency consistency) { _battleMgr = battlemgr; @@ -141,7 +123,7 @@ public class NetworkBattleSender public void SendTurnStart() { Dictionary dictionary = _sendCardDataMaker.MakePlayActionsSendCardData(null, null, null, isEvol: false, null, isTurnStart: true); - dictionary.Add("actionSeq", ToolboxGame.RealTimeNetworkAgent.GetTurnSequence()); + dictionary.Add("actionSeq", _battleMgr.InstanceNetworkAgent.GetTurnSequence()); EmitMsg(NetworkBattleDefine.NetworkBattleURI.TurnStart, dictionary); } @@ -171,7 +153,7 @@ public class NetworkBattleSender public void SendTurnEnd(bool isNextTurnTimeDecrement, bool isNowTurnTimeDecrement, bool final) { - if (final || ToolboxGame.RealTimeNetworkAgent.GetTurnState()) + if (final || _battleMgr.InstanceNetworkAgent.GetTurnState()) { Dictionary dictionary = new Dictionary(); _networkConsistency.SetupConsistency(); @@ -180,7 +162,7 @@ public class NetworkBattleSender List list = new List(); list.Add(_battleMgr.GetBattlePlayer(isPlayer: true).CemeteryList.Count); list.Add(_battleMgr.GetBattlePlayer(isPlayer: false).CemeteryList.Count); - dictionary.Add("actionSeq", ToolboxGame.RealTimeNetworkAgent.GetTurnSequence()); + dictionary.Add("actionSeq", _battleMgr.InstanceNetworkAgent.GetTurnSequence()); dictionary.Add("cemetery", list); if (final) { @@ -199,11 +181,6 @@ public class NetworkBattleSender SendTurnEnd(isNextTurnTimeDecrement: false, isNowTurnTimeDecrement: false, final: true); } - public void SendRecoveryEnd() - { - EmitMsg(NetworkBattleDefine.NetworkBattleURI.RecoveryEnd); - } - public void SendJudge() { Dictionary dictionary = new Dictionary(); @@ -216,64 +193,7 @@ public class NetworkBattleSender { Dictionary dictionary = new Dictionary(); dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.stamp]] = stamp; - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.ChatStamp, dictionary, null, isGetableAck: false); - } - - public void SendTouch(int idx, bool isSelf) - { - if (_lastTouchIndex != idx) - { - _lastTouchIndex = idx; - _emitHandParameterList.Clear(); - _emitHandParameterList.Add(_lastTouchIndex); - _emitHandParameterList.Add(isSelf ? 1 : 0); - ToolboxGame.RealTimeNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.TOUCH_URI); - } - } - - public void SendSelectSkill(SELECT_SKILL_OPERATION selectSkillOperation, bool isEvolveTargetSelect, string operationNum, List activeSelectSkillIndexList, bool isBurialRite, bool isChoiceBrave) - { - bool flag = selectSkillOperation != SELECT_SKILL_OPERATION.SelectChoiceCard; - if (operationNum.IsNotNullOrEmpty() && !flag) - { - DateTime now = DateTime.Now; - TimeSpan elapsedTimeByTimeSpan = TimeUtil.GetElapsedTimeByTimeSpan(now, _oldSelectCurrentLocalTime); - float num = (float)elapsedTimeByTimeSpan.Milliseconds / 1000f; - if (elapsedTimeByTimeSpan.Seconds == 0 && num < 0.5f) - { - return; - } - _oldSelectCurrentLocalTime = now; - } - List list = new List(); - list.Add((int)selectSkillOperation); - list.Add(isEvolveTargetSelect); - list.Add(isBurialRite); - if (!string.IsNullOrEmpty(operationNum)) - { - list.Add(operationNum); - } - if (isChoiceBrave) - { - if (string.IsNullOrEmpty(operationNum)) - { - list.Add("0"); - } - list.Add("1"); - } - if (activeSelectSkillIndexList.Count > 0) - { - if (!isChoiceBrave) - { - if (string.IsNullOrEmpty(operationNum)) - { - list.Add("0"); - } - list.Add("0"); - } - list.Add(activeSelectSkillIndexList); - } - ToolboxGame.RealTimeNetworkAgent.EmitHandData(list, HAND_URI_TYPE.SELECT_SKILL_URI, flag); + _battleMgr.InstanceNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.ChatStamp, dictionary, null, isGetableAck: false); } public void SendSelectObject(BattleCardBase selectedCard) @@ -294,7 +214,7 @@ public class NetworkBattleSender } _emitHandParameterList.Clear(); _emitHandParameterList.Add(empty); - ToolboxGame.RealTimeNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.SELECT_OBJECT_URI); + _battleMgr.InstanceNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.SELECT_OBJECT_URI); } } @@ -302,7 +222,7 @@ public class NetworkBattleSender { _emitHandParameterList.Clear(); _emitHandParameterList.Add(isShortenedTurn); - ToolboxGame.RealTimeNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.TURN_END_READY_URI); + _battleMgr.InstanceNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.TURN_END_READY_URI); } public void SendSlideObject(SLIDE_OBJECT_TYPE slideObjectType, BattleCardBase selectedCard, BattleCardBase attackingCard) @@ -342,12 +262,7 @@ public class NetworkBattleSender _emitHandParameterList.Clear(); _emitHandParameterList.Add(item); _emitHandParameterList.Add(item2); - ToolboxGame.RealTimeNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.SLIDE_OBJECT_URI); - } - - public void ResetSelectedSlideCard() - { - _selectedSlideCard = null; + _battleMgr.InstanceNetworkAgent.EmitHandData(_emitHandParameterList, HAND_URI_TYPE.SLIDE_OBJECT_URI); } public void EmitRetry(NetworkBattleDefine.NetworkBattleURI uri) @@ -409,7 +324,7 @@ public class NetworkBattleSender } else { - LocalLog.AccumulateLastTraceLog("NotEchoData isVirtual" + BattleManagerBase.GetIns().IsVirtualBattle + " " + StackTraceUtility.ExtractStackTrace()); + LocalLog.AccumulateLastTraceLog("NotEchoData isVirtual" + _battleMgr.IsVirtualBattle + " " + StackTraceUtility.ExtractStackTrace()); } } @@ -444,7 +359,7 @@ public class NetworkBattleSender } if (uri == NetworkBattleDefine.NetworkBattleURI.PlayActions && !_battleMgr.GetBattlePlayer(isPlayer: true).IsSelfTurn) { - LocalLog.AccumulateTraceLog("588157NotMyturnPlay" + PlayActionLogMsg); + LocalLog.AccumulateTraceLog("588157NotMyturnPlay"); return false; } Dictionary dictionary = new Dictionary(); @@ -455,8 +370,8 @@ public class NetworkBattleSender dictionary.Add(data.Key, data.Value); } } - _alreadyEmitList.Add(new EmitData(uri.ToString(), dictionary, ToolboxGame.RealTimeNetworkAgent.LastEmitSeqNumber)); - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(uri, dataList, null, isGetableAck, -1, isStockData: true, isNotActiveSeq); + _alreadyEmitList.Add(new EmitData(uri.ToString(), dictionary, _battleMgr.InstanceNetworkAgent.LastEmitSeqNumber)); + _battleMgr.InstanceNetworkAgent.EmitMsgPack(uri, dataList, null, isGetableAck, -1, isStockData: true, isNotActiveSeq); _battleMgr.SendIntervalTriggerMain.SendDataCheck(_battleMgr, uri); return true; } diff --git a/SVSim.BattleEngine/Engine/NetworkBattleSetupCardEvent.cs b/SVSim.BattleEngine/Engine/NetworkBattleSetupCardEvent.cs index 7ad00264..28f5290e 100644 --- a/SVSim.BattleEngine/Engine/NetworkBattleSetupCardEvent.cs +++ b/SVSim.BattleEngine/Engine/NetworkBattleSetupCardEvent.cs @@ -27,11 +27,6 @@ public class NetworkBattleSetupCardEvent _networkBattleSetupValidateEvent = new NetworkBattleSetupValidateEvent(_battleMgr as NetworkBattleManagerBase, this); } - public void OverwriteNetworkBattleData(NetworkBattleData data) - { - networkBattleData = data; - } - public virtual void SetupCardEvent(BattleManagerBase mgr, RegisterActionManager actionManager, BattleCardBase card, List registerUnapprovedList) { _registerUnapprovedList = registerUnapprovedList; @@ -387,7 +382,7 @@ public class NetworkBattleSetupCardEvent public void SetSkillTargetsConditionCheckUList(SkillBase skill, IEnumerable cards, SkillConditionCheckerOption option) { - List unapprovedList = (BattleManagerBase.GetIns() as NetworkBattleManagerBase).networkBattleData.GetReceiveData().unapprovedList; + List unapprovedList = (_battleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData().unapprovedList; NetworkExecutionInfoCreator networkExec = skill._executionInfoCreator as NetworkExecutionInfoCreator; foreach (BattleCardBase carddata in cards) { @@ -619,18 +614,6 @@ public class NetworkBattleSetupCardEvent return NullVfx.GetInstance(); } - protected void Event_ChangeUnapprovedFromsState(SkillBase skill, IEnumerable unapprovedCards) - { - List unapprovedCardList = GetUnapprovedCardList(skill); - foreach (CardDataModel unapprovedCard in networkBattleData.GetReceiveData().unapprovedList) - { - if (unapprovedCardList.Find((BattleCardBase x) => x.Index == unapprovedCard.Index) != null) - { - unapprovedCard.fromState = NetworkBattleGenericTool.GetCardPlaceState(skill.SkillPrm.ownerCard.SelfBattlePlayer, unapprovedCard.Index); - } - } - } - private void Event_RegisterFilterStop(SkillBase skillBase, List cards, SkillProcessor skillProcessor) { if (!skillBase.SkillPrm.ownerCard.IsSkillLost) @@ -863,7 +846,7 @@ public class NetworkBattleSetupCardEvent { if (skillBase.IsLastTargetDiscardOrBanishSkill(option) && RegisterSkillConditionCheck.CheckLastTargetFilter(skillBase)) { - (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.Event_SkillConditionCheck(skillBase, cards, option); + (_battleMgr as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.Event_SkillConditionCheck(skillBase, cards, option); } } @@ -871,7 +854,7 @@ public class NetworkBattleSetupCardEvent { if (option.SelectedCards.Any((SkillConditionCheckerOption.SkillAndSelectTarget s) => s.SelectSkill.ApplyingTargetFilter is SkillTargetHandFilter || s.SelectSkill.ApplyingTargetFilter is SkillTargetHandOtherSelfFilter || s.SelectSkill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.TargetFilter is SkillTargetHandFilter || f.TargetFilter is SkillTargetHandOtherSelfFilter))) { - (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.Event_SkillConditionCheck(skillBase, cards, option); + (_battleMgr as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.Event_SkillConditionCheck(skillBase, cards, option); } } @@ -879,7 +862,7 @@ public class NetworkBattleSetupCardEvent { if (RegisterSkillConditionCheck.IsPreprocessConditionCheck(skillBase)) { - (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.Event_SkillConditionCheck(skillBase, cards, option); + (_battleMgr as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.Event_SkillConditionCheck(skillBase, cards, option); } } @@ -1168,11 +1151,6 @@ public class NetworkBattleSetupCardEvent movementSkillList.Clear(); } - private List GetUnapprovedCardList(SkillBase skill) - { - return (_battleMgr as NetworkBattleManagerBase).GetUnapprovedCardObj(movement: NetworkBattleGenericTool.GetSkillMovementNum(skill), player: skill.SkillPrm.ownerCard.SelfBattlePlayer, skillCardIndex: skill.SkillPrm.ownerCard.Index, publishedActiveCount: NetworkBattleGenericTool.GetPublishSkillCount(skill), skill: skill); - } - private void CheckToAddScanList(BattleCardBase card, bool evol) { if (evol || !card.IsCantActivateFanfare) @@ -1198,7 +1176,7 @@ public class NetworkBattleSetupCardEvent } else { - _registerActionManager.Add(new RegisterOpenMyCards(BattleManagerBase.GetIns().BattlePlayer.HandCardList, notBuff: true)); + _registerActionManager.Add(new RegisterOpenMyCards(_battleMgr.BattlePlayer.HandCardList, notBuff: true)); } } diff --git a/SVSim.BattleEngine/Engine/NetworkExecutionInfoCreator.cs b/SVSim.BattleEngine/Engine/NetworkExecutionInfoCreator.cs index aba019b0..829e89ae 100644 --- a/SVSim.BattleEngine/Engine/NetworkExecutionInfoCreator.cs +++ b/SVSim.BattleEngine/Engine/NetworkExecutionInfoCreator.cs @@ -32,8 +32,6 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase private bool _notNetwrokConditionCheck; - public const int SIDEN_NO_KOKUHYOU = 112241030; - public bool IsNotCheckBuriaRiteCondition { get; private set; } public NetworkExecutionInfoCreator(SkillBase skill) @@ -118,11 +116,11 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase } return true; } - if ((_skill.IsUserSelectType || _skill.IsBurialRite) && ((GameMgr.GetIns().IsWatchBattle && _skill.SkillPrm.ownerCard.IsPlayer) || GameMgr.GetIns().IsAdminWatch)) + if ((_skill.IsUserSelectType || _skill.IsBurialRite) && ((_networkBattleMgr.GameMgr.IsWatchBattle && _skill.SkillPrm.ownerCard.IsPlayer) || _networkBattleMgr.GameMgr.IsAdminWatch)) { return result; } - if (RegisterSkillConditionCheck.IsSkillConditionCheck(_skill, GameMgr.GetIns().IsAdmin)) + if (RegisterSkillConditionCheck.IsSkillConditionCheck(_skill, _networkBattleMgr.GameMgr.IsAdmin)) { return false; } @@ -175,7 +173,7 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase return enumerable.Cast().ToList(); } return (from c in base.GetSelectableCards(playerInfoPair, option, isSkipForceSelect, selectedCards) - select (!GameMgr.GetIns().IsAdminWatch && !GameMgr.GetIns().IsReplayBattle && !c.IsPlayer && !c.IsInplay && !c.Card.IsInplay && !_skill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.TargetFilter is SkillTargetTurnPlayCardsOtherSelfFilter) && !_skill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.BattlePlayerFilter is OpponentBattlePlayerFilter && f.TargetFilter is SkillTargetGamePlayCardsOtherSelfFilter)) ? c.Card : c).ToList(); + select (!_networkBattleMgr.GameMgr.IsAdminWatch && !_networkBattleMgr.GameMgr.IsReplayBattle && !c.IsPlayer && !c.IsInplay && !c.Card.IsInplay && !_skill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.TargetFilter is SkillTargetTurnPlayCardsOtherSelfFilter) && !_skill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.BattlePlayerFilter is OpponentBattlePlayerFilter && f.TargetFilter is SkillTargetGamePlayCardsOtherSelfFilter)) ? c.Card : c).ToList(); } public override IEnumerable CalcApplyTargets(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, ref int targetCount, bool isCheckInHand = false) @@ -215,7 +213,7 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase public override VfxWith, Dictionary> FixedSkillApplyTarget(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, ref int targetCount) { VfxWith, Dictionary> vfxWith; - if ((_skill.SkillPrm.ownerCard.IsPlayer && (!GameMgr.GetIns().IsWatchBattle || _networkBattleMgr.IsRecovery)) || GameMgr.GetIns().IsReplayBattle) + if ((_skill.SkillPrm.ownerCard.IsPlayer && (!_networkBattleMgr.GameMgr.IsWatchBattle || _networkBattleMgr.IsRecovery)) || _networkBattleMgr.GameMgr.IsReplayBattle) { IEnumerable source = CalcApplyTargets(playerInfoPair, option, ref targetCount); vfxWith = NotIndependentCardFiltering(source.ToList()); @@ -278,7 +276,7 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase private bool IsUnapprovedSkill() { - if (GameMgr.GetIns().IsWatchBattle) + if (_networkBattleMgr.GameMgr.IsWatchBattle) { if (_isUseUListOnlySelfTurnWhenAdmin) { @@ -307,11 +305,6 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase _isAllDeckCardTarget = true; } - public void SetUseUListOnlySelfTurn() - { - _isUseUListOnlySelfTurnWhenAdmin = true; - } - public void SetValidateConditionCheckSkill() { _validateSkillCheckFlag = true; @@ -352,11 +345,6 @@ public class NetworkExecutionInfoCreator : ExecutionInfoCreatorBase return _skillMovementNum; } - public void SetNotNetwrokConditionCheck(bool flag) - { - _notNetwrokConditionCheck = flag; - } - private List CalculationUnapprovedCardList(int skillIndex) { BattlePlayerBase selfBattlePlayer = _skill.SkillPrm.ownerCard.SelfBattlePlayer; diff --git a/SVSim.BattleEngine/Engine/NetworkLog.cs b/SVSim.BattleEngine/Engine/NetworkLog.cs index 614cef81..760eb21e 100644 --- a/SVSim.BattleEngine/Engine/NetworkLog.cs +++ b/SVSim.BattleEngine/Engine/NetworkLog.cs @@ -4,12 +4,7 @@ public class NetworkLog { public enum LogLevel { - Info, - Warning, - Error - } - - private const string FORMAT = "{0}:[{1}]{2}"; + Info } public LogLevel Level { get; } diff --git a/SVSim.BattleEngine/Engine/NetworkMatchNextSceneSelector.cs b/SVSim.BattleEngine/Engine/NetworkMatchNextSceneSelector.cs deleted file mode 100644 index b92272fd..00000000 --- a/SVSim.BattleEngine/Engine/NetworkMatchNextSceneSelector.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard; - -public class NetworkMatchNextSceneSelector : INextSceneSelector -{ - private BattleResultUIController m_battleResultNewControl; - - private bool _movingToMyPage; - - public NetworkMatchNextSceneSelector(BattleResultUIController battleResultControl) - { - m_battleResultNewControl = battleResultControl; - _movingToMyPage = false; - } - - public void Setup(bool isWin, GameObject gameObject) - { - if (m_battleResultNewControl.ResultMsgReportBtnFlag) - { - m_battleResultNewControl.ReportBtnObj.labels[0].text = Data.SystemText.Get("Con_Management_001_Button"); - m_battleResultNewControl.ReportBtnObj.gameObject.SetActive(value: true); - m_battleResultNewControl.ReportBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.ReportBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - ConsistencyReportButtonAction.CreateReportConfirmWindow(); - })); - } - m_battleResultNewControl.MissionBtnObj.labels[0].text = Data.SystemText.Get("Battle_0200"); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().createInSceneCenterLoading(); - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); - missionInfoTask.SetParameter(); - m_battleResultNewControl.StartCoroutine(Toolbox.NetworkManager.Connect(missionInfoTask, delegate - { - m_battleResultNewControl.CreateMissionList(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - })); - m_battleResultNewControl.HomeBtnObj.labels[0].text = Data.SystemText.Get("Battle_0202"); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MoveToMyPage(); - })); - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0204"); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Data.CurrentFormat); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Action onUpdateDeckUICustomize = delegate(DeckUI deckUI) - { - if (deckUI.Deck.Format == GameMgr.GetIns().GetDataMgr().GetSelectDeckFormat() && deckUI.Deck.GetDeckID() == GameMgr.GetIns().GetDataMgr().GetSelectDeckId()) - { - deckUI.SetTextAppealLabelLeft(Data.SystemText.Get("Card_0235")); - } - }; - DeckSelectUIDialog.Create(DeckSelectUIDialog.GetTitleByBattleType(GameMgr.GetIns().GetDataMgr().m_BattleType), task.DeckGroupListData, Data.CurrentFormat, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, delegate(DialogBase dialog, DeckData deckData) - { - FreeAndRankMatchDeckSelectConfirmDialog.Create(dialog, deckData, isBattleEnd: true); - }, new DeckSelectUI.InitOptions - { - OnUpdateDeckUICustomize = onUpdateDeckUICustomize - }); - })); - })); - } - - public void Show() - { - iTween.MoveTo(m_battleResultNewControl.ButtonGrid.gameObject, iTween.Hash("position", m_battleResultNewControl.DefaultPosDict["ButtonGrid"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void MoveToMyPage() - { - if (!_movingToMyPage) - { - _movingToMyPage = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.MyPage); - } - } -} diff --git a/SVSim.BattleEngine/Engine/NetworkOperationCollection.cs b/SVSim.BattleEngine/Engine/NetworkOperationCollection.cs index c5e8d01a..7047d143 100644 --- a/SVSim.BattleEngine/Engine/NetworkOperationCollection.cs +++ b/SVSim.BattleEngine/Engine/NetworkOperationCollection.cs @@ -9,8 +9,6 @@ public class NetworkOperationCollection : NetworkOperationCollectionBase private bool _isTurnStart; - public const int NOT_ECHO_PLAY_CARD_INDEX = -1; - private int _playCardIndexToEcho = -1; private NetworkBattleDefine.PlayActionType _actionTypeToEcho; @@ -45,7 +43,7 @@ public class NetworkOperationCollection : NetworkOperationCollectionBase public override void TurnStartOperation(NetworkBattleDefine.NetworkBattleURI lastReceivedUri, int lastReceivedTime) { - if (ToolboxGame.RealTimeNetworkAgent.GetTurnState() || _networkBattleMgr.BattleEnemy.IsExtraTurn || _networkBattleData.isEnemyFirstTurn) + if (_networkBattleMgr.InstanceNetworkAgent.GetTurnState() || _networkBattleMgr.BattleEnemy.IsExtraTurn || _networkBattleData.isEnemyFirstTurn) { if (_networkBattleMgr.BattleEnemy.IsExtraTurn) { @@ -186,7 +184,6 @@ public class NetworkOperationCollection : NetworkOperationCollectionBase if (!ClassCharaPrm.IsEvolutionEmotionType(oppoChatStamp)) { VfxBase vfx = _networkBattleMgr.BattleEnemy.Emotion.PlayEmotion(oppoChatStamp, 1.5f); - ImmediateVfxMgr.GetInstance().Register(vfx); } } diff --git a/SVSim.BattleEngine/Engine/NetworkReplayBattleMgr.cs b/SVSim.BattleEngine/Engine/NetworkReplayBattleMgr.cs index 8426f6c7..8a982c3c 100644 --- a/SVSim.BattleEngine/Engine/NetworkReplayBattleMgr.cs +++ b/SVSim.BattleEngine/Engine/NetworkReplayBattleMgr.cs @@ -1,205 +1,13 @@ -using System.Collections; -using UnityEngine; -using Wizard; -using Wizard.BattleMgr; -using Wizard.Replay; - -public class NetworkReplayBattleMgr : NetworkWatchBattleMgr -{ - public UIButton StopReplayBtn; - - public UIButton ReplayForwardBtn; - - public UIButton ReplaySkipBtn; - - private UISprite ReplaySkipBtnSprite; - - private const int NORMAL_SPEED = 1; - - private const int SKIP_SPEED = 5; - - protected const string PLAY_BUTTON_NAME = "btn_replay_play"; - - protected const string PAUSE_BUTTON_NAME = "btn_replay_pause"; - - private const string SKIP_BUTTON_NAME = "btn_replay_turn_end"; - - private const string NEW_SKIP_BUTTON_NAME = "btn_replay_new"; - - private const int REPLAY_SKIP_BUTTON_ICON_WIDTH = 32; - - private const int NEW_REPLAY_SKIP_BUTTON_ICON_WIDTH = 46; - - public ReplayController ReplayController; - - public bool isStopReplay { get; protected set; } - - public bool isForwardReplay { get; set; } - - public bool isSkipReplay { get; private set; } - - public NetworkReplayBattleMgr(IBattleMgrContentsCreator contentsCreator) - : base(contentsCreator) - { - networkReceiver = new NetworkReplayBattleReceiver(this); - _networkBattleSetupCardEventBase = new NetworkReplayBattleSetupCardEvent(this, RegisterActionManager, base.networkBattleData); - GameMgr.GetIns().GetPrefabMgr().Load("Prefab/UI/Replay/BtnStopReplay"); - StopReplayBtn = NGUITools.AddChild(UIManager.GetInstance().getCamera().gameObject, GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Replay/BtnStopReplay")).GetComponent(); - UISprite StopReplayBtnSprite = StopReplayBtn.transform.GetChild(0).GetComponent(); - StopReplayBtn.GetComponent().uiCamera = GameMgr.GetIns().GetGameObjMgr().GetUIContainerCam(); - StopReplayBtn.gameObject.SetActive(value: false); - StopReplayBtn.onClick.Clear(); - StopReplayBtn.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - isStopReplay = !isStopReplay; - if (isStopReplay) - { - StopReplayBtnSprite.spriteName = "btn_replay_play"; - UIManager.SetObjectToGrey(ReplayForwardBtn.gameObject, b: false); - } - else - { - StopReplayBtnSprite.spriteName = "btn_replay_pause"; - UIManager.SetObjectToGrey(ReplayForwardBtn.gameObject, b: true); - } - })); - GameMgr.GetIns().GetPrefabMgr().Load("Prefab/UI/Replay/BtnReplayForward"); - ReplayForwardBtn = NGUITools.AddChild(UIManager.GetInstance().getCamera().gameObject, GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Replay/BtnReplayForward")).GetComponent(); - ReplayForwardBtn.GetComponent().container = StopReplayBtn.gameObject; - ReplayForwardBtn.gameObject.SetActive(value: false); - ReplayForwardBtn.onClick.Clear(); - ReplayForwardBtn.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - isForwardReplay = true; - })); - UIManager.SetObjectToGrey(ReplayForwardBtn.gameObject, b: true); - UIManager.GetInstance().StartCoroutine(WaitTillTurnEndUIReady()); - } - - private IEnumerator WaitTillTurnEndUIReady() - { - while (!BattlePlayer.PlayerBattleView.TurnEndBtn) - { - yield return null; - } - GameMgr.GetIns().GetPrefabMgr().Load("Prefab/UI/Replay/BtnSkipReplay"); - ReplaySkipBtn = NGUITools.AddChild(BattlePlayer.PlayerBattleView.TurnEndButtonUI.GetTurnEndButton(), GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Replay/BtnSkipReplay")).GetComponent(); - ReplaySkipBtnSprite = ReplaySkipBtn.transform.GetChild(0).GetComponent(); - ReplaySkipBtnSprite.width = (GameMgr.GetIns().IsNewReplayBattle ? 46 : 32); - ReplaySkipBtn.gameObject.SetActive(value: false); - ReplaySkipBtn.onClick.Clear(); - ReplaySkipBtn.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - isSkipReplay = !isSkipReplay; - if (isSkipReplay) - { - ReplaySkipBtnSprite.spriteName = "btn_replay_pause"; - ReplaySkipBtnSprite.width = 32; - Time.timeScale = 5f; - } - else - { - ResetSkipStatus(); - } - })); - } - - protected override void SetUpDisconnectCheck() - { - } - - public void ResetSkipStatus() - { - isSkipReplay = false; - ReplaySkipBtnSprite.spriteName = (GameMgr.GetIns().IsNewReplayBattle ? "btn_replay_new" : "btn_replay_turn_end"); - ReplaySkipBtnSprite.width = (GameMgr.GetIns().IsNewReplayBattle ? 46 : 32); - Time.timeScale = 1f; - } - - public void SetActiveReplayButton(bool isActive) - { - StopReplayBtn.gameObject.SetActive(isActive); - ReplayForwardBtn.gameObject.SetActive(isActive); - ReplaySkipBtn.gameObject.SetActive(isActive); - if (!isActive) - { - isStopReplay = false; - isForwardReplay = false; - } - } - - protected override void SetUpRetireEvent() - { - BattlePlayer.PlayerBattleView.OnRetire += delegate - { - if (!(ToolboxGame.RealTimeNetworkAgent == null)) - { - ResetSkipStatus(); - ReplayController._replayDataHandler.Stop(); - BattleCoroutine.GetInstance().StopAllCoroutines(); - ToolboxGame.RealTimeNetworkAgent.DestroyObj(RealTimeNetworkAgent.DESTROY_OBJECT_LOG.Replay); - UIManager.GetInstance().StartCoroutine(GameMgr.GetIns().GetBattleCtrl().BattleEnd(delegate - { - UIManager.ViewScene replayEndBackScene = Data.ReplayBattleInfo.ReplayEndBackScene; - UIManager.ChangeViewSceneParam replayEndBackSceneParam = Data.ReplayBattleInfo.ReplayEndBackSceneParam; - UIManager.GetInstance().ChangeViewScene(replayEndBackScene, replayEndBackSceneParam); - })); - } - }; - } - - public override void DisposeBattleGameObj() - { - base.DisposeBattleGameObj(); - ReplayController = null; - Time.timeScale = 1f; - Object.Destroy(StopReplayBtn.gameObject); - Object.Destroy(ReplayForwardBtn.gameObject); - } - - protected override NetworkOperationCollectionBase CreateNetworkOperationCollection(NetworkBattleReceiver.ReceiveData receivedData, bool isPlayer) - { - return new ReplayOperationCollection(this, OperateMgr, receivedData, base.networkBattleData, isPlayer); - } - - public override void ReceiveRetire(bool isWin) - { - if (isWin == Data.ReplayBattleInfo.is_win) - { - FinishBattleSend(NetworkBattleSender.JUDGE_RESULT_STATUS.ReplayRetireDiff, Data.ReplayBattleInfo.is_win); - } - else - { - base.ReceiveRetire(isWin); - } - } - - protected override void FinishBattleSend(NetworkBattleSender.JUDGE_RESULT_STATUS log, bool isWin = false, bool isNotRetry = false) - { - isWin = Data.ReplayBattleInfo.is_win; - base.FinishBattleSend(log, isWin, isNotRetry); - } - - protected override bool isNetworkOepn() - { - return true; - } - - protected override OperateReceive CreateOperateReceive() - { - return new ReplayOperateReceive(this, RegisterActionManager, OperateMgr, base.networkBattleData); - } - - protected override BattlePlayer CreateBattlePlayer() - { - return new BattlePlayer(this, _battleCamera, _backGround, CreatePlayerInnerOptionsBuilder()); - } - - protected override BattleEnemy CreateBattleEnemy() - { - return new BattleEnemy(this, _battleCamera, _backGround, CreateEnemyInnerOptionsBuilder()); - } -} +using Wizard.BattleMgr; + +// PASS-6 STUB: 177-line body dropped. NetworkReplayBattleMgr is the intermediate +// class between NetworkWatchBattleMgr and NewReplayBattleMgr — replay-specific +// UI buttons (stop / forward / skip) and playback state. Never constructed in +// headless; sits only for the inheritance chain NewReplayBattleMgr : NetworkReplay- +// BattleMgr : NetworkWatchBattleMgr : NetworkBattleManagerBase. Grep confirmed +// zero external member accesses to its public surface (StopReplayBtn / ReplayController / +// isStopReplay etc.). +public class NetworkReplayBattleMgr : NetworkWatchBattleMgr +{ + public NetworkReplayBattleMgr(IBattleMgrContentsCreator contentsCreator) : base(contentsCreator) { } +} diff --git a/SVSim.BattleEngine/Engine/NetworkReplayBattleSetupCardEvent.cs b/SVSim.BattleEngine/Engine/NetworkReplayBattleSetupCardEvent.cs deleted file mode 100644 index eabd58fb..00000000 --- a/SVSim.BattleEngine/Engine/NetworkReplayBattleSetupCardEvent.cs +++ /dev/null @@ -1,37 +0,0 @@ -public class NetworkReplayBattleSetupCardEvent : NetworkBattleSetupCardEvent -{ - public NetworkReplayBattleSetupCardEvent(BattleManagerBase manager, RegisterActionManager registerCardList, NetworkBattleData data) - : base(manager, registerCardList, data) - { - } - - public override void SetupCardSkillEvent(BattleCardBase card) - { - SetupPreAndPostEvolutionSkillEvents(card); - } - - protected override bool IsSendUnapprovedList(SkillBase skill) - { - return false; - } - - protected override bool IsCheckValidateCard() - { - return false; - } - - protected override bool IsCheckSkillConditionCard(BattleCardBase card) - { - return false; - } - - public override bool IsSettingUnapprovedCard(SkillBase skill) - { - return false; - } - - protected override bool IsSetNotCheckSelectSkillCard() - { - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/NetworkSkillPreprocessConditionCheck.cs b/SVSim.BattleEngine/Engine/NetworkSkillPreprocessConditionCheck.cs index c248f76b..fd51a541 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkillPreprocessConditionCheck.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkillPreprocessConditionCheck.cs @@ -9,7 +9,7 @@ public class NetworkSkillPreprocessConditionCheck : SkillPreprocessConditionChec public NetworkSkillPreprocessConditionCheck(SkillBase skill, string condition) : base(skill, condition) { - _networkBattleSetupCardEvent = (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase; + _networkBattleSetupCardEvent = (_skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase)._networkBattleSetupCardEventBase; if (_skill != null) { _skill.OnSkillStart -= _networkBattleSetupCardEvent.EventPreprocessConditionCheck; @@ -27,8 +27,8 @@ public class NetworkSkillPreprocessConditionCheck : SkillPreprocessConditionChec return true; } BattleCardBase ownerCard = _skill.SkillPrm.ownerCard; - GameMgr ins = GameMgr.GetIns(); - if (!ownerCard.IsPlayer && !ins.IsAdminWatch && RegisterFilter.IsFilterPreprocessCondition(_skill) && !GameMgr.GetIns().IsReplayBattle) + GameMgr ins = _skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr; + if (!ownerCard.IsPlayer && !ins.IsAdminWatch && RegisterFilter.IsFilterPreprocessCondition(_skill) && !_skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle) { if (preexecutionCheck && _filter.VariableCompareFilter.Any((SkillVariableComareFilter c) => c.Text.Contains(SkillFilterCreator.ContentKeyword.last_target.ToString()))) { diff --git a/SVSim.BattleEngine/Engine/NetworkSkillTargetLastTargetFilter.cs b/SVSim.BattleEngine/Engine/NetworkSkillTargetLastTargetFilter.cs index f2e2340a..20fec044 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkillTargetLastTargetFilter.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkillTargetLastTargetFilter.cs @@ -11,7 +11,7 @@ public class NetworkSkillTargetLastTargetFilter : SkillTargetLastTargetFilter : base(option) { _skill = skill; - _networkBattleSetupCardEvent = (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase; + _networkBattleSetupCardEvent = (skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase)._networkBattleSetupCardEventBase; if (_skill != null) { _skill.OnSkillStart -= _networkBattleSetupCardEvent.EventDiscardOrBanishSkillConditionCheck; diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_change_affiliation.cs b/SVSim.BattleEngine/Engine/NetworkSkill_change_affiliation.cs index b2edbffe..b522b532 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_change_affiliation.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_change_affiliation.cs @@ -19,7 +19,7 @@ public class NetworkSkill_change_affiliation : Skill_change_affiliation public override void RegisterStop(BattleCardBase card) { RegisterAttach register = new RegisterAttach(new List { card }, this, isDelete: true); - (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.AddRegisterActionManager(register); + (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase)._networkBattleSetupCardEventBase.AddRegisterActionManager(register); } public override void SkillCreateEnd() diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_change_super_skybound_art_count.cs b/SVSim.BattleEngine/Engine/NetworkSkill_change_super_skybound_art_count.cs index a425b4a5..d7bc611c 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_change_super_skybound_art_count.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_change_super_skybound_art_count.cs @@ -12,7 +12,7 @@ public class NetworkSkill_change_super_skybound_art_count : Skill_change_super_s public override VfxWithLoading Start(CallParameter parameter) { VfxWithLoading result = base.Start(parameter); - List targetCards = parameter.targetCards.Where((BattleCardBase t) => t.HasSuperSkyboundArt && (t.IsPlayer || GameMgr.GetIns().IsAdminWatch)).ToList(); + List targetCards = parameter.targetCards.Where((BattleCardBase t) => t.HasSuperSkyboundArt && (t.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)).ToList(); base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnChangeUnionBurstAndSkyboundArt(targetCards); return result; } diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_change_union_burst_count.cs b/SVSim.BattleEngine/Engine/NetworkSkill_change_union_burst_count.cs index 09c59e1b..7f8f8f4b 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_change_union_burst_count.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_change_union_burst_count.cs @@ -25,7 +25,7 @@ public class NetworkSkill_change_union_burst_count : Skill_change_union_burst_co public override VfxWithLoading Start(CallParameter parameter) { VfxWithLoading result = base.Start(parameter); - List source = parameter.targetCards.Where((BattleCardBase t) => t.HasUnionBurst && (t.IsPlayer || GameMgr.GetIns().IsAdminWatch)).ToList(); + List source = parameter.targetCards.Where((BattleCardBase t) => t.HasUnionBurst && (t.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)).ToList(); base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnChangeUnionBurstAndSkyboundArt(source.ToList()); return result; } diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_cost_change.cs b/SVSim.BattleEngine/Engine/NetworkSkill_cost_change.cs index 246c66b1..6e396c7a 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_cost_change.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_cost_change.cs @@ -123,12 +123,12 @@ public class NetworkSkill_cost_change : Skill_cost_change { if (cards != null && cards.Count() >= 1) { - PublicTargetRegister(BattleManagerBase.GetIns() as NetworkBattleManagerBase, CreateCostModifier(), cards); + PublicTargetRegister(SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase, CreateCostModifier(), cards); return NetworkBattleGenericTool.Event_SetupPlayerUnapprovedAddEvent(skillBase, cards, checkerOption, skillProcessor); } if (cards == null || cards.Count() == 0) { - (BattleManagerBase.GetIns() as NetworkBattleManagerBase).StableRandomDouble(); + (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase).StableRandomDouble(); } return NullVfx.GetInstance(); } @@ -136,7 +136,7 @@ public class NetworkSkill_cost_change : Skill_cost_change private VfxBase PrivateAnytimeRandomTargetRegister(SkillBase skillBase, IEnumerable cards, SkillConditionCheckerOption checkerOption, SkillProcessor skillProcessor) { RegisterLotCardBase registerLotCardBase = null; - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + NetworkBattleManagerBase networkBattleManagerBase = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; if (skillBase.SkillPrm.ownerCard.SelfBattlePlayer.IsSelfTurn && cards != null && cards.Count() >= 1) { registerLotCardBase = NetworkBattleGenericTool.MakeRegisterLotAndRandomAdvance(skillBase, cards, checkerOption); @@ -223,8 +223,8 @@ public class NetworkSkill_cost_change : Skill_cost_change protected override bool IsUnconditionalCostChange() { BattleCardBase ownerCard = base.SkillPrm.ownerCard; - GameMgr ins = GameMgr.GetIns(); - if (!ownerCard.IsPlayer && !ins.IsAdminWatch && !GameMgr.GetIns().IsReplayBattle && RegisterFilter.IsFilterPreprocessCondition(this)) + GameMgr ins = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr; + if (!ownerCard.IsPlayer && !ins.IsAdminWatch && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle && RegisterFilter.IsFilterPreprocessCondition(this)) { return !IsRightSkillPreprocessConditionCheck(); } diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_extra_turn.cs b/SVSim.BattleEngine/Engine/NetworkSkill_extra_turn.cs index 7837d040..7ac82bf8 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_extra_turn.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_extra_turn.cs @@ -8,7 +8,7 @@ public class NetworkSkill_extra_turn : Skill_extra_turn { base.OnSkillStart += delegate { - (BattleManagerBase.GetIns() as NetworkBattleManagerBase).RegisterActionManager.Add(new RegisterExtraTurn(GetAddTurn(), base.SkillPrm.ownerCard.IsPlayer)); + (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase).RegisterActionManager.Add(new RegisterExtraTurn(GetAddTurn(), base.SkillPrm.ownerCard.IsPlayer)); }; } diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_generic_value_modifier.cs b/SVSim.BattleEngine/Engine/NetworkSkill_generic_value_modifier.cs index 16443171..75536822 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_generic_value_modifier.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_generic_value_modifier.cs @@ -36,7 +36,7 @@ public class NetworkSkill_generic_value_modifier : Skill_generic_value_modifier public override void InsertTargetInfo(CallParameter parameter) { - if (base.SkillPrm.ownerCard.IsPlayer && !GameMgr.GetIns().IsWatchBattle) + if (base.SkillPrm.ownerCard.IsPlayer && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsWatchBattle) { base.InsertTargetInfo(parameter); return; diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_invoke_skill.cs b/SVSim.BattleEngine/Engine/NetworkSkill_invoke_skill.cs index 650871eb..c20d328d 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_invoke_skill.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_invoke_skill.cs @@ -11,7 +11,7 @@ internal class NetworkSkill_invoke_skill : Skill_invoke_skill public override VfxWithLoading Start(CallParameter parameter) { - if (GameMgr.GetIns().IsUseUnapprovedList(base.SkillPrm.ownerCard.IsPlayer)) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsUseUnapprovedList(base.SkillPrm.ownerCard.IsPlayer)) { string invokeType = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.invoke_type); NetworkBattleManagerBase obj = base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_powerup.cs b/SVSim.BattleEngine/Engine/NetworkSkill_powerup.cs index a0ecd8db..5a86a187 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_powerup.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_powerup.cs @@ -26,8 +26,8 @@ public class NetworkSkill_powerup : Skill_powerup protected override VfxBase GiveCombatModifier(BattleCardBase card, ICardOffenseModifier offenseModifier, ICardLifeModifier lifeModifier, CallParameter parameter) { - bool flag = !GameMgr.GetIns().IsReplayBattle && (!base.SkillPrm.ownerCard.IsPlayer || GameMgr.GetIns().IsWatchBattle); - if (card.IsInDeck && flag && (BattleManagerBase.GetIns() as NetworkBattleManagerBase).networkBattleData.GetReceiveData().GetReceiveCardList().Any(delegate(CardDataModel c) + bool flag = !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle && (!base.SkillPrm.ownerCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsWatchBattle); + if (card.IsInDeck && flag && (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData().GetReceiveCardList().Any(delegate(CardDataModel c) { bool flag2 = c.ToStateList.Contains(NetworkBattleDefine.NetworkCardPlaceState.Deck); return c.Index == card.Index && !flag2; diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_random_array.cs b/SVSim.BattleEngine/Engine/NetworkSkill_random_array.cs index 103d280b..263da156 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_random_array.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_random_array.cs @@ -7,7 +7,7 @@ public class NetworkSkill_random_array : Skill_random_array : base(skillPrm, option) { NetworkSkill_random_array networkSkill_random_array = this; - if (GameMgr.GetIns().IsAdminWatch || base.SkillPrm.ownerCard.IsPlayer) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch || base.SkillPrm.ownerCard.IsPlayer) { return; } diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_special_lose.cs b/SVSim.BattleEngine/Engine/NetworkSkill_special_lose.cs index 06357d19..c3faa841 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_special_lose.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_special_lose.cs @@ -10,9 +10,9 @@ public class NetworkSkill_special_lose : Skill_special_lose public override VfxWithLoading Start(CallParameter parameter) { VfxWithLoading vfxWithLoading = base.Start(parameter); - if (BattleManagerBase.GetIns().IsRecovery) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { - ((NetworkBattleManagerBase)BattleManagerBase.GetIns())._specialWinVfx = vfxWithLoading; + ((NetworkBattleManagerBase)SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr)._specialWinVfx = vfxWithLoading; } base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnSpecialLose(base.SkillPrm.ownerCard); return vfxWithLoading; diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_special_win.cs b/SVSim.BattleEngine/Engine/NetworkSkill_special_win.cs index 54ddea61..cc2bba19 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_special_win.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_special_win.cs @@ -10,9 +10,9 @@ public class NetworkSkill_special_win : Skill_special_win public override VfxWithLoading Start(CallParameter parameter) { VfxWithLoading vfxWithLoading = base.Start(parameter); - if (BattleManagerBase.GetIns().IsRecovery) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { - ((NetworkBattleManagerBase)BattleManagerBase.GetIns())._specialWinVfx = vfxWithLoading; + ((NetworkBattleManagerBase)SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr)._specialWinVfx = vfxWithLoading; } base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnSpecialWin(base.SkillPrm.ownerCard); return vfxWithLoading; diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_token_draw.cs b/SVSim.BattleEngine/Engine/NetworkSkill_token_draw.cs index a1638a7a..20addce2 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_token_draw.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_token_draw.cs @@ -60,12 +60,12 @@ public class NetworkSkill_token_draw : Skill_token_draw protected override BattleCardBase CreateTokenCard(BattlePlayerBase player, int id, int index, NetworkBattleDefine.NetworkCardPlaceState toState, bool isCopy = false) { BattleManagerBase.CardCreateInfo info = new BattleManagerBase.CardCreateInfo(id, player.IsPlayer, base.ApplyingTargetFilter is SkillTargetChosenCardsFilter, toState, base.IsOpponentHandCopy, this); - return BattleManagerBase.GetIns().CreateBattleCardWithGameObject(info, new BattleManagerBase.IndexInfo(-1, -1, isCopy, index)); + return SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.CreateBattleCardWithGameObject(info, new BattleManagerBase.IndexInfo(-1, -1, isCopy, index)); } public override bool IsVisibleDrawSkillTarget(BattlePlayerBase selfBattlePlayer, CallParameter parameter) { - if (!selfBattlePlayer.IsPlayer && !GameMgr.GetIns().IsAdminWatch) + if (!selfBattlePlayer.IsPlayer && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { if (DrawList.Count <= 0) { diff --git a/SVSim.BattleEngine/Engine/NetworkSkill_update_deck.cs b/SVSim.BattleEngine/Engine/NetworkSkill_update_deck.cs index 055e40bf..7dd56f50 100644 --- a/SVSim.BattleEngine/Engine/NetworkSkill_update_deck.cs +++ b/SVSim.BattleEngine/Engine/NetworkSkill_update_deck.cs @@ -2,7 +2,6 @@ using System.Linq; public class NetworkSkill_update_deck : Skill_update_deck { - private const int ADD_DECK_TRIGGER = 1; public NetworkSkill_update_deck(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -11,7 +10,7 @@ public class NetworkSkill_update_deck : Skill_update_deck protected override BattleCardBase CreateTokenCard(CallParameter parameter, int tokenId, int repeatCount, int tokenIdIndex, BattlePlayerBase targetPlayer) { - if (BattleManagerBase.IsForecast) + if (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { return targetPlayer.CreateNextIndexCard(tokenId); } @@ -30,15 +29,15 @@ public class NetworkSkill_update_deck : Skill_update_deck { skillCopy = true; } - if (!_isReferenceOpponentCard && !_isReferenceFusionedCard && _isUsingTargetCards && !base.IsOpen && (GameMgr.GetIns().IsWatchBattle || !targetPlayer.IsPlayer)) + if (!_isReferenceOpponentCard && !_isReferenceFusionedCard && _isUsingTargetCards && !base.IsOpen && (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsWatchBattle || !targetPlayer.IsPlayer)) { - CardDataModel cardDataModel = (targetPlayer.BattleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData().GetReceiveCardList().FirstOrDefault((CardDataModel c) => c.CardId > 0 && c.Index == targetPlayer.cardTotalNum && c.ToStateList.Any((NetworkBattleDefine.NetworkCardPlaceState s) => s == NetworkBattleDefine.NetworkCardPlaceState.Field) && (!GameMgr.GetIns().IsWatchBattle || c.isOpponent != targetPlayer.IsPlayer)); + CardDataModel cardDataModel = (targetPlayer.BattleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData().GetReceiveCardList().FirstOrDefault((CardDataModel c) => c.CardId > 0 && c.Index == targetPlayer.cardTotalNum && c.ToStateList.Any((NetworkBattleDefine.NetworkCardPlaceState s) => s == NetworkBattleDefine.NetworkCardPlaceState.Field) && (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsWatchBattle || c.isOpponent != targetPlayer.IsPlayer)); if (cardDataModel != null) { tokenId = cardDataModel.CardId; } } BattleManagerBase.CardCreateInfo info = new BattleManagerBase.CardCreateInfo(tokenId, targetPlayer.IsPlayer, base.IsTargetChoiceSelectSkill, NetworkBattleDefine.NetworkCardPlaceState.Deck, _isReferenceOpponentCard, this); - return BattleManagerBase.GetIns().CreateBattleCardWithGameObject(info, new BattleManagerBase.IndexInfo(-1, targetIndex, skillCopy, copySelectIndex), repeatCount, _updateType == "change"); + return SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.CreateBattleCardWithGameObject(info, new BattleManagerBase.IndexInfo(-1, targetIndex, skillCopy, copySelectIndex), repeatCount, _updateType == "change"); } } diff --git a/SVSim.BattleEngine/Engine/NetworkStandardBattleMgr.cs b/SVSim.BattleEngine/Engine/NetworkStandardBattleMgr.cs index a984f1e2..3f66491c 100644 --- a/SVSim.BattleEngine/Engine/NetworkStandardBattleMgr.cs +++ b/SVSim.BattleEngine/Engine/NetworkStandardBattleMgr.cs @@ -23,7 +23,13 @@ public class NetworkStandardBattleMgr : NetworkBattleManagerBase public BattleStopChecker battleStopChecker { get; private set; } public NetworkStandardBattleMgr(IBattleMgrContentsCreator contentsCreator) - : base(contentsCreator) + : this(contentsCreator, new GameMgr()) + { + } + + // Phase-5 chunk 45: overload accepting a pre-seeded GameMgr. + public NetworkStandardBattleMgr(IBattleMgrContentsCreator contentsCreator, GameMgr gameMgr) + : base(contentsCreator, gameMgr) { if (!base.IsRecovery) { @@ -98,9 +104,9 @@ public class NetworkStandardBattleMgr : NetworkBattleManagerBase public override void SettingOpponentAliveEvent() { base.SettingOpponentAliveEvent(); - NetworkStatus opponentNetworkStatus = ToolboxGame.RealTimeNetworkAgent.OpponentNetworkStatus; + NetworkStatus opponentNetworkStatus = this.InstanceNetworkAgent.OpponentNetworkStatus; opponentNetworkStatus.OnOffLine = (Action)Delegate.Combine(opponentNetworkStatus.OnOffLine, new Action(base.OppoDisconnectVictory)); - NetworkStatus opponentNetworkStatus2 = ToolboxGame.RealTimeNetworkAgent.OpponentNetworkStatus; + NetworkStatus opponentNetworkStatus2 = this.InstanceNetworkAgent.OpponentNetworkStatus; opponentNetworkStatus2.OnTimeOut = (Action)Delegate.Combine(opponentNetworkStatus2.OnTimeOut, new Action(base.OppoDisconnectVictory)); } @@ -114,12 +120,12 @@ public class NetworkStandardBattleMgr : NetworkBattleManagerBase protected override void SendTurnEndAction() { - if (!base.IsRecovery && !(ToolboxGame.RealTimeNetworkAgent == null) && !IsVirtualBattle) + if (!base.IsRecovery && !(this.InstanceNetworkAgent == null) && !IsVirtualBattle) { base.NetworkSender.SendTurnEndAction(); if (!IsBattleGameFinishStatus()) { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; + RealTimeNetworkAgent realTimeNetworkAgent = this.InstanceNetworkAgent; realTimeNetworkAgent.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent.OnAck, new Action>(AckEmitTurnEndAction)); } } @@ -127,7 +133,7 @@ public class NetworkStandardBattleMgr : NetworkBattleManagerBase public override void SendTurnEnd() { - if (!base.IsRecovery && !(ToolboxGame.RealTimeNetworkAgent == null) && !IsVirtualBattle) + if (!base.IsRecovery && !(this.InstanceNetworkAgent == null) && !IsVirtualBattle) { bool isNextTurnTimeDecrement = false; bool isNowTurnTimeDecrement = false; @@ -375,7 +381,7 @@ public class NetworkStandardBattleMgr : NetworkBattleManagerBase private void AckEmitTurnEndAction(Dictionary objs) { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; + RealTimeNetworkAgent realTimeNetworkAgent = this.InstanceNetworkAgent; realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckEmitTurnEndAction)); BattleCoroutine.GetInstance().StartCoroutine(WaitToSendTurnEnd()); } diff --git a/SVSim.BattleEngine/Engine/NetworkStatus.cs b/SVSim.BattleEngine/Engine/NetworkStatus.cs index 9bc9f051..8af562eb 100644 --- a/SVSim.BattleEngine/Engine/NetworkStatus.cs +++ b/SVSim.BattleEngine/Engine/NetworkStatus.cs @@ -7,8 +7,6 @@ public class NetworkStatus : IDisposable { None, Alive, - Disconnect, - OffLine, TimeOut } @@ -29,30 +27,6 @@ public class NetworkStatus : IDisposable Current = Status.None; } - public void ToKeepAlive() - { - OnAlive.Call(); - Current = Status.Alive; - } - - public void ToDisconnect() - { - OnDisconnect.Call(); - Current = Status.Disconnect; - } - - public void ToOffLine() - { - OnOffLine.Call(); - Current = Status.OffLine; - } - - public void ToTimeOut() - { - OnTimeOut.Call(); - Current = Status.TimeOut; - } - public void Dispose() { OnAlive = null; diff --git a/SVSim.BattleEngine/Engine/NetworkTouchControl.cs b/SVSim.BattleEngine/Engine/NetworkTouchControl.cs index c2f0f4b6..be76b941 100644 --- a/SVSim.BattleEngine/Engine/NetworkTouchControl.cs +++ b/SVSim.BattleEngine/Engine/NetworkTouchControl.cs @@ -2,13 +2,6 @@ using UnityEngine; public class NetworkTouchControl : TouchControl { - private const float IDLE_TIME = 20f; - - private const int IDLE_EMOTE_KIND = 3; - - private Coroutine idleTimeCoroutine; - - private ClassCharaPrm.EmotionType _previousEmotionType; public bool notAttackFlag { private get; set; } @@ -35,14 +28,6 @@ public class NetworkTouchControl : TouchControl notEvolCardFlag = true; } - public void SetEnableTouch() - { - notAttackFlag = false; - notEmoteFlag = false; - notDragPlayCardFlag = false; - notEvolCardFlag = false; - } - protected override bool IsFeasibleAttack() { if (notAttackFlag) diff --git a/SVSim.BattleEngine/Engine/NetworkUserInfoData.cs b/SVSim.BattleEngine/Engine/NetworkUserInfoData.cs index 9d113e7b..ef610472 100644 --- a/SVSim.BattleEngine/Engine/NetworkUserInfoData.cs +++ b/SVSim.BattleEngine/Engine/NetworkUserInfoData.cs @@ -49,39 +49,17 @@ public class NetworkUserInfoData private Dictionary _oppoInfo = new Dictionary(); - private List _selfDeck; - - private List _oppoDeck; - - public const int DUMMY_CARD_ID = 100011010; - - public const string KEY_IS_OFFICIAL_USER = "isOfficial"; - - private const string KEY_OPPO_DECK_COUNT = "oppoDeckCount"; - - public const string KEY_DECK_COUNT = "deckCount"; - public int TurnState { get; set; } public NetworkUserInfo SelfBattleStartInfo { get; private set; } public NetworkUserInfo OppoBattleStartInfo { get; private set; } - public List _selfFirstCards { get; set; } - - public List _oppoFirstCards { get; set; } - public NetworkUserInfoData() { TurnState = -1; } - public void InitializeSelfInfo() - { - SelfBattleStartInfo = null; - _selfDeck = null; - } - public void SetSelfInfo(Dictionary info, bool isWatchReplayRecovery) { _selfInfo = info; @@ -95,6 +73,12 @@ public class NetworkUserInfoData } } + // SetNetworkSelfInfo used to fan the received chara/skin/rotation info out to the + // process-wide GameMgr.DataMgr (production-only path). In the current headless world + // the only call site is the isWatchReplayRecovery=true branch of SetSelfInfo, which + // is never taken in either test seeder — so this is dead in every code path we run. + // Body preserved as documentation until a live-network path revives it, but the + // GameMgr/Data reach has been dropped so it can't ambient-race anymore. public void SetNetworkSelfInfo(Dictionary info) { if (SelfBattleStartInfo == null) @@ -102,88 +86,15 @@ public class NetworkUserInfoData SelfBattleStartInfo = new NetworkUserInfo(); } SelfBattleStartInfo.SetParameter(info); - GameMgr.GetIns().GetDataMgr().SetPlayerCharaId(GetSelfCharaId()); - GameMgr.GetIns().GetDataMgr().SetPlayerSubClassID(GetSelfSubClassId()); - GameMgr.GetIns().GetDataMgr().SetPlayerMyRotationInfo(GetSelfMyRotationId()); - GameMgr.GetIns().GetDataMgr().SetPlayerAvatarBattleInfo(GetSelfAvatarBattleId()); - Data.RoomTwoPickBeforeBattleInfo.ReceiveBackDraftCharaId(GetSelfCharaId()); + // TODO(post-Phase-5b, revive-live-network): thread a mgr param through and fan out + // GetSelfCharaId/GetSelfSubClassId/GetSelfMyRotationId/GetSelfAvatarBattleId into + // mgr.GameMgr.GetDataMgr() + Data.RoomTwoPickBeforeBattleInfo once a caller exists. if (_selfInfo != null && _selfInfo.ContainsKey("seed")) { LocalLog.AccumulateLastTraceLog("SetNetworkSelfInfo seed" + Convert.ToInt32(_selfInfo["seed"])); } } - private int GetDeckMaxNum(bool isSelf) - { - if (isSelf && _selfInfo.ContainsKey("deckCount")) - { - return Convert.ToInt32(_selfInfo["deckCount"]); - } - if (!isSelf && _oppoInfo.ContainsKey("deckCount")) - { - return Convert.ToInt32(_oppoInfo["deckCount"]); - } - return GameMgr.GetIns().GetDataMgr().GetDeckMaxCount(isSelf); - } - - public void SetSelfDeck(List deckDatas) - { - if (GameMgr.GetIns().IsReplayBattle || !GameMgr.GetIns().IsWatchBattle) - { - int deckMaxNum = GetDeckMaxNum(isSelf: true); - _selfDeck = new List(deckMaxNum); - List list = new List(); - for (int i = 0; i < deckMaxNum; i++) - { - CardDataModel cardDataModel = new CardDataModel(); - Dictionary dictionary = deckDatas[i] as Dictionary; - cardDataModel.Index = Convert.ToInt32(dictionary[NetworkBattleDefine.NetworkParameter.idx.ToString()]); - cardDataModel.CardId = Convert.ToInt32(dictionary[NetworkBattleDefine.NetworkParameter.cardId.ToString()]); - _selfDeck.Add(cardDataModel); - list.Add(cardDataModel.CardId); - } - Data.RoomTwoPickBeforeBattleInfo.ReceiveBackDraftCardIdList(list); - } - } - - public void SetOppoDeck(List deckDatas) - { - int deckMaxNum = GetDeckMaxNum(isSelf: false); - _oppoDeck = new List(deckMaxNum); - for (int i = 0; i < deckMaxNum; i++) - { - CardDataModel cardDataModel = new CardDataModel(); - Dictionary dictionary = deckDatas[i] as Dictionary; - cardDataModel.Index = Convert.ToInt32(dictionary[NetworkBattleDefine.NetworkParameter.idx.ToString()]); - cardDataModel.CardId = Convert.ToInt32(dictionary[NetworkBattleDefine.NetworkParameter.cardId.ToString()]); - _oppoDeck.Add(cardDataModel); - } - } - - public void SetOpponentInfo(Dictionary info, bool isWatchReplayRecovery) - { - OppoBattleStartInfo = null; - if (!GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle) - { - _oppoDeck = null; - } - _oppoInfo = info; - if (isWatchReplayRecovery) - { - SetOpponentNetworkInfo(info); - } - if (_oppoInfo.Keys.Contains("oppoDeckCount")) - { - GameMgr.GetIns().GetDataMgr().SetDeckMaxCount(Convert.ToInt32(_oppoInfo["oppoDeckCount"]), isSelf: false); - } - } - - public void SetOpponentNetworkInfo(Dictionary info) - { - OppoBattleStartInfo = new NetworkUserInfo(); - OppoBattleStartInfo.SetParameter(info); - } - public int GetFieldId() { return Convert.ToInt32(_selfInfo["fieldId"]); @@ -213,38 +124,6 @@ public class NetworkUserInfoData return Convert.ToInt32(_selfInfo["viewerId"]); } - public string GetSelfName() - { - return _selfInfo["userName"].ToString(); - } - - public int GetSelfBattlePoint() - { - if (SelfBattleStartInfo == null) - { - return 0; - } - return SelfBattleStartInfo.BattlePoint; - } - - public int GetSelfMasterPoint() - { - if (SelfBattleStartInfo == null) - { - return 0; - } - return SelfBattleStartInfo.MasterPoint; - } - - public int GetSelfClassId() - { - if (SelfBattleStartInfo == null) - { - return 0; - } - return SelfBattleStartInfo.ClassId; - } - public int GetSelfSubClassId() { if (SelfBattleStartInfo == null) @@ -281,46 +160,11 @@ public class NetworkUserInfoData return SelfBattleStartInfo.AvatarBattleId; } - public long GetSelfSleeveId() - { - return Convert.ToInt64(_selfInfo["sleeveId"]); - } - - public long GetSelfEmblemId() - { - return Convert.ToInt64(_selfInfo["emblemId"]); - } - - public int GetSelfDegreeId() - { - return Convert.ToInt32(_selfInfo["degreeId"]); - } - - public int GetSelfRank() - { - if (SelfBattleStartInfo == null) - { - return 0; - } - return SelfBattleStartInfo.Rank; - } - - public string GetSelfCountryCode() - { - return _selfInfo["country_code"].ToString(); - } - - public bool GetSelfIsOfficialUser() - { - return Convert.ToBoolean(_selfInfo["isOfficial"]); - } - public int GetSelfChaosId() { - if (!GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsReplayBattle) - { - return -1; - } + // The `!IsNetworkBattle` guard is redundant with the dict-lookup below: in single-player + // paths `_selfInfo` is empty (no network setup), so the dict never contains "chaosId" + // and this returns -1 anyway. Removing the ambient reach. if (_selfInfo.ContainsKey("chaosId")) { return Convert.ToInt32(_selfInfo["chaosId"]); @@ -328,65 +172,6 @@ public class NetworkUserInfoData return -1; } - public string GetOpponentName() - { - return _oppoInfo["userName"].ToString(); - } - - public int GetOpponentBattlePoint() - { - if (OppoBattleStartInfo == null) - { - return 0; - } - return OppoBattleStartInfo.BattlePoint; - } - - public int GetOpponentMasterPoint() - { - if (OppoBattleStartInfo == null) - { - return 0; - } - return OppoBattleStartInfo.MasterPoint; - } - - public int GetOpponentClassId() - { - if (OppoBattleStartInfo == null) - { - return 0; - } - return OppoBattleStartInfo.ClassId; - } - - public int GetOpponentSubClassId() - { - if (OppoBattleStartInfo == null) - { - return 10; - } - return OppoBattleStartInfo.SubClassId; - } - - public int GetOpponentCharaId() - { - if (OppoBattleStartInfo == null) - { - return 0; - } - return OppoBattleStartInfo.CharaId; - } - - public string GetOpponentMyRotationId() - { - if (OppoBattleStartInfo == null) - { - return ""; - } - return OppoBattleStartInfo.MyRotationId; - } - public string GetOpponentAvatarBattleId() { if (SelfBattleStartInfo == null) @@ -396,137 +181,14 @@ public class NetworkUserInfoData return OppoBattleStartInfo.AvatarBattleId; } - public long GetOpponentSleeveId() - { - return Convert.ToInt64(_oppoInfo["sleeveId"]); - } - - public long GetOpponentEmblemId() - { - return Convert.ToInt64(_oppoInfo["emblemId"]); - } - - public int GetOpponentDegreeId() - { - return Convert.ToInt32(_oppoInfo["degreeId"]); - } - - public int GetOpponentRank() - { - if (OppoBattleStartInfo == null) - { - return 0; - } - return OppoBattleStartInfo.Rank; - } - - public int GetOpponentUserID() - { - if (GameMgr.GetIns().IsWatchBattle) - { - return Convert.ToInt32(_oppoInfo["viewerId"]); - } - return Convert.ToInt32(_selfInfo["oppoId"]); - } - - public bool GetOpponentIsMasterRank() - { - if (OppoBattleStartInfo == null) - { - return false; - } - return OppoBattleStartInfo.IsMasterRank; - } - - public string GetOpponentCountryCode() - { - return _oppoInfo["country_code"].ToString(); - } - - public bool GetOpponentIsOfficialUser() - { - return Convert.ToBoolean(_oppoInfo["isOfficial"]); - } - public int GetOpponentChaosId() { - if (!GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsReplayBattle) - { - return -1; - } + // See GetSelfChaosId — same rationale, the `!IsNetworkBattle` guard is redundant with + // the dict-lookup fallthrough (single-player paths never populate `_oppoInfo`). if (_oppoInfo.ContainsKey("chaosId")) { return Convert.ToInt32(_oppoInfo["chaosId"]); } return -1; } - - public bool GetOpponentChaosOverrideSkin() - { - if (!GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsReplayBattle) - { - return false; - } - if (_oppoInfo.ContainsKey("isChaosSkinOverride")) - { - return Convert.ToBoolean(_oppoInfo["isChaosSkinOverride"]); - } - return false; - } - - public List GetSelfDeck() - { - if (GameMgr.GetIns().IsWatchBattle && _selfDeck == null) - { - int deckMaxNum = GetDeckMaxNum(isSelf: true); - _selfDeck = IdListConvertToModelList(Enumerable.Repeat(100011010, deckMaxNum).ToList()); - } - return _selfDeck; - } - - public List GetOpponentDeck() - { - if (_oppoDeck == null) - { - int deckMaxNum = GetDeckMaxNum(isSelf: false); - _oppoDeck = IdListConvertToModelList(Enumerable.Repeat(100011010, deckMaxNum).ToList()); - } - return _oppoDeck; - } - - private List IdListConvertToModelList(List idList) - { - List list = new List(idList.Count); - for (int i = 0; i < idList.Count; i++) - { - CardDataModel cardDataModel = new CardDataModel(); - cardDataModel.Index = i + 1; - cardDataModel.CardId = idList[i]; - list.Add(cardDataModel); - } - return list; - } - - public void ReplaceFirstCardData() - { - List list = new List(); - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; - for (int i = 0; i < _selfFirstCards.Count; i++) - { - ReplaceReceivedCard replaceReceivedCard = new ReplaceReceivedCard(networkBattleManagerBase, _selfFirstCards[i]); - list.Add(replaceReceivedCard.ReplaceCard(networkBattleManagerBase.BattlePlayer)); - } - if (GameMgr.GetIns().IsAdmin) - { - for (int j = 0; j < _oppoFirstCards.Count; j++) - { - ReplaceReceivedCard replaceReceivedCard2 = new ReplaceReceivedCard(networkBattleManagerBase, _oppoFirstCards[j]); - list.Add(replaceReceivedCard2.ReplaceCard(networkBattleManagerBase.BattleEnemy)); - } - } - if (!networkBattleManagerBase.IsRecovery && list.Count > 0) - { - networkBattleManagerBase.VfxMgr.RegisterSequentialVfx(networkBattleManagerBase.LoadCardResources(list)); - } - } } diff --git a/SVSim.BattleEngine/Engine/NetworkUtility.cs b/SVSim.BattleEngine/Engine/NetworkUtility.cs index a504dec7..295e9dd4 100644 --- a/SVSim.BattleEngine/Engine/NetworkUtility.cs +++ b/SVSim.BattleEngine/Engine/NetworkUtility.cs @@ -12,14 +12,4 @@ public static class NetworkUtility long ticks = TimeUtil.GetAbsoluteTime().Ticks - oldTimer; return (int)new TimeSpan(ticks).TotalSeconds; } - - public static float GetTimeSpanMilliSecond(long oldTimer) - { - if (oldTimer == 0L) - { - return 0f; - } - long ticks = DateTime.Now.Ticks - oldTimer; - return (float)new TimeSpan(ticks).TotalSeconds; - } } diff --git a/SVSim.BattleEngine/Engine/NetworkWatchBattleData.cs b/SVSim.BattleEngine/Engine/NetworkWatchBattleData.cs index 3b67994f..12549ba7 100644 --- a/SVSim.BattleEngine/Engine/NetworkWatchBattleData.cs +++ b/SVSim.BattleEngine/Engine/NetworkWatchBattleData.cs @@ -26,7 +26,7 @@ public class NetworkWatchBattleData : NetworkBattleData public override void BeforeSettingReceiveData() { - if (GameMgr.GetIns().IsReplayBattle) + if (_battleMgr.GameMgr.IsReplayBattle) { return; } @@ -56,7 +56,7 @@ public class NetworkWatchBattleData : NetworkBattleData } continue; } - if (GameMgr.GetIns().IsAdmin || !card.isOpponent) + if (_battleMgr.GameMgr.IsAdmin || !card.isOpponent) { if (receiveData.IsFusion && card.fromState == NetworkBattleDefine.NetworkCardPlaceState.Hand) { @@ -87,7 +87,7 @@ public class NetworkWatchBattleData : NetworkBattleData } if (!card.isOpponent) { - if (!GameMgr.GetIns().IsReplayBattle && !_battleMgr.IsRecovery) + if (!_battleMgr.GameMgr.IsReplayBattle && !_battleMgr.IsRecovery) { list2.Add(replaceReceivedCard.ReplaceCard(_battleMgr.BattlePlayer)); } diff --git a/SVSim.BattleEngine/Engine/NetworkWatchBattleMgr.cs b/SVSim.BattleEngine/Engine/NetworkWatchBattleMgr.cs index 29d77fa7..b1a4b7f3 100644 --- a/SVSim.BattleEngine/Engine/NetworkWatchBattleMgr.cs +++ b/SVSim.BattleEngine/Engine/NetworkWatchBattleMgr.cs @@ -1,601 +1,27 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard; -using Wizard.Battle.View.Vfx; -using Wizard.BattleMgr; -using Wizard.RoomMatch; - -public class NetworkWatchBattleMgr : NetworkBattleManagerBase -{ - private class SelectObjectHandCard - { - private const float SELECT_CARD_MOVE_POS_Y = 45f; - - private Vector3 _selectedPos; - - public BattleCardBase CardBase { get; private set; } - - public SelectObjectHandCard(BattleCardBase cardBase, bool isOwner) - { - CardBase = cardBase; - if (isOwner) - { - _selectedPos = new Vector3(0f, 45f, 0f); - } - else - { - _selectedPos = new Vector3(0f, -45f, 0f); - } - } - - public VfxBase CreateVfxSelectMove() - { - return CreateVfxMoveHandCard(CardBase.BattleCardView.CardWrapObject, _selectedPos); - } - - public VfxBase CreateVfxResetPos() - { - return CreateVfxMoveHandCard(CardBase.BattleCardView.CardWrapObject, Vector3.zero); - } - - public void ResetOriginalPosition() - { - iTween.Stop(CardBase.BattleCardView.CardWrapObject); - CardBase.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero; - } - - private VfxBase CreateVfxMoveHandCard(GameObject cardObj, Vector3 position) - { - return InstantVfx.Create(delegate - { - if (!(cardObj == null)) - { - iTween.MoveTo(cardObj, iTween.Hash("position", position, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - }); - } - } - - public WatcherDisconnectChecker watcherDisconnectChecker; - - public WatcherLeaveChecker watcherLeaveChecker; - - public DialogBase disconnectDialog; - - public bool IsHandCardInvisible; - - private SelectObjectHandCard _cardSelectedByOwner; - - private SelectObjectHandCard _cardSelectedByGuest; - - private bool _isConventionWatch; - - private bool _isGathering; - - protected bool isResultDone; - - private int MyPageReturnIndex - { - get - { - if (!_isConventionWatch) - { - return 2; - } - return 3; - } - } - - public NetworkWatchBattleMgr(IBattleMgrContentsCreator contentsCreator) - : base(contentsCreator) - { - TouchControl = new WatchTouchControl(this, _battleCamera, _backGround); - OperateMgr.SetTouchControl(TouchControl); - base.networkBattleData = new NetworkWatchBattleData(this); - networkReceiver = new NetworkWatchBattleReceiver(this); - _networkBattleSetupCardEventBase = new NetworkWatchBattleSetupCardEvent(this, RegisterActionManager, base.networkBattleData); - base.recoveryToDispChecker = new RecoveryToDispChecker(); - OperateReceive = (GameMgr.GetIns().IsNewReplayBattle ? new NewReplayOperateReceive(this, RegisterActionManager, OperateMgr, base.networkBattleData) : CreateOperateReceive()); - base.disconnectToDispChecker.OnDisp += delegate - { - ControlDisconnectOffTouchAndView(flag: true); - }; - base.disconnectToDispChecker.OnErase += delegate - { - ControlDisconnectOffTouchAndView(flag: false); - }; - BattleFinishToStopIntervalChecker(); - IsHandCardInvisible = GameMgr.GetIns().IsWatchHandInvisible; - GameMgr.GetIns().IsWatchHandInvisible = false; - RoomConnectController connectController = RoomBase.ConnectController; - if (connectController != null) - { - _isConventionWatch = connectController.IsConvention; - _isGathering = connectController.IsGathering; - } - SetUpDisconnectCheck(); - } - - protected override void OpponentAliveCallback() - { - base.OpponentAliveCallback(); - watcherLeaveChecker.FinishChecker(); - } - - protected override void OpponentDisconnectCallback() - { - base.OpponentDisconnectCallback(); - watcherLeaveChecker.StartCheckerIfNotStarted(); - } - - protected override void ControlDisconnectOffTouchAndView(bool flag) - { - } - - public override void DisposeBattleGameObj() - { - base.DisposeBattleGameObj(); - BattleCoroutine.GetInstance().StopAllCoroutines(); - if (watcherDisconnectChecker != null) - { - watcherDisconnectChecker.FinishChecker(); - } - if (watcherLeaveChecker != null) - { - watcherLeaveChecker.FinishChecker(); - } - IsHandCardInvisible = false; - } - - protected virtual void SetUpDisconnectCheck() - { - watcherDisconnectChecker = new WatcherDisconnectChecker(); - watcherDisconnectChecker.OnDisp += delegate - { - StartWatcherDisconnect(flag: true); - }; - watcherDisconnectChecker.OnErase += delegate - { - StartWatcherDisconnect(flag: false); - }; - watcherLeaveChecker = new WatcherLeaveChecker(); - watcherLeaveChecker.SetBattleMgr(this); - watcherLeaveChecker.OnDisp += delegate - { - StartCompetitorLeave(flag: true); - }; - watcherLeaveChecker.OnErase += delegate - { - StartCompetitorLeave(flag: false); - }; - } - - private UIManager.ChangeViewSceneParam GetMyPageReturnParam() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = MyPageReturnIndex; - changeViewSceneParam.IsCutCardMotion = true; - if (MyPageReturnIndex == 2) - { - changeViewSceneParam.OnFinishChangeView = delegate - { - MyPageMenu.Instance.GoToRoomMatch(); - }; - } - return changeViewSceneParam; - } - - private void StartWatcherDisconnect(bool flag) - { - watcherDisconnectChecker.StopChecker(); - if (flag) - { - base.BattleUIContainer.ButtonControl.HideAllMenu(isWithoutSE: true); - disconnectDialog = UIManager.GetInstance().CreateDialogClose(isSystem: true); - disconnectDialog.SetSize(DialogBase.Size.M); - disconnectDialog.SetTitleLabel(Data.SystemText.Get("Common_0021")); - disconnectDialog.SetText(Data.SystemText.Get("RoomBattle_0049")); - disconnectDialog.AddButton(DialogBase.ButtonType.OK); - disconnectDialog.SetPanelDepth(6000); - disconnectDialog.SetFadeButtonEnabled(flag: false); - DialogBase dialogBase = disconnectDialog; - dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate - { - UIManager.GetInstance().StartCoroutine(GetBattleControl().BattleEnd(delegate - { - UIManager.ChangeViewSceneParam myPageReturnParam = GetMyPageReturnParam(); - if (_isGathering) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering); - } - else - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, myPageReturnParam); - } - })); - RoomBase.DestroyMyRoomInfo(); - }); - } - else if (disconnectDialog != null) - { - disconnectDialog.Close(); - disconnectDialog = null; - } - } - - private void StartCompetitorLeave(bool flag) - { - watcherLeaveChecker.StopChecker(); - if (flag) - { - base.BattleUIContainer.ButtonControl.HideAllMenu(isWithoutSE: true); - disconnectDialog = UIManager.GetInstance().CreateDialogClose(isSystem: true); - disconnectDialog.SetSize(DialogBase.Size.M); - disconnectDialog.SetTitleLabel(Data.SystemText.Get("Common_0021")); - disconnectDialog.SetText(Data.SystemText.Get("RoomBattle_0098")); - disconnectDialog.AddButton(DialogBase.ButtonType.OK); - disconnectDialog.SetPanelDepth(6000); - disconnectDialog.SetFadeButtonEnabled(flag: false); - DialogBase dialogBase = disconnectDialog; - dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate - { - UIManager.GetInstance().StartCoroutine(GetBattleControl().BattleEnd(delegate - { - UIManager.ChangeViewSceneParam myPageReturnParam = GetMyPageReturnParam(); - if (_isGathering) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering); - } - else - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, myPageReturnParam); - } - })); - RoomBase.DestroyMyRoomInfo(); - }); - } - else if (disconnectDialog != null) - { - disconnectDialog.Close(); - disconnectDialog = null; - } - } - - protected override void FirstRecoverySetting() - { - } - - public override void RecoveryRecordSkillTarget(IEnumerable targetCards) - { - } - - protected override int CreateBackgroundId() - { - return GameMgr.GetIns().GetNetworkUserInfoData().GetFieldId(); - } - - public override void SetBattleMenuBtnVisibility() - { - } - - public override void StartOpening(int FirstAttack) - { - base.StartOpening(FirstAttack); - ITurnEndButtonUI turnEndButtonUI = BattlePlayer.PlayerBattleView.TurnEndButtonUI; - turnEndButtonUI._isButtonForcedOff = true; - turnEndButtonUI.DisableButton(); - turnEndTimeController = new WatchTurnEndTimeController(this, BattlePlayer, turnEndButtonUI); - if (GameMgr.GetIns().IsAdminWatch) - { - ESelectSkillSideLog.SetActive(value: true); - } - } - - protected override void SetupEvent() - { - base.SetupEvent(); - } - - public override void SendTurnEnd() - { - } - - public override void SetupCardEvent(BattleCardBase card) - { - base.SetupCardEvent(card); - card.OnPlay += delegate - { - if (card.HasSpellCharge) - { - GameObject child = card.BattleCardView.GetChild("SpellBoostCount"); - if (child != null) - { - child.SetActive(value: false); - } - } - ResetPositionHandCard(card); - return NullVfx.GetInstance(); - }; - card.OnDestroy += CreateVfxResetPositionByCardBase; - card.OnBanish += CreateVfxResetPositionByCardBase; - card.OnReturnCard += CreateVfxResetPositionByCardBase; - card.OnMetamorphose += CreateVfxResetPositionByCardBase; - card.OnGetOn += CreateVfxResetPositionByCardBase; - } - - private void ResetPositionHandCard(BattleCardBase card) - { - if (_cardSelectedByOwner != null && card == _cardSelectedByOwner.CardBase) - { - _cardSelectedByOwner.ResetOriginalPosition(); - } - if (_cardSelectedByGuest != null && card == _cardSelectedByGuest.CardBase) - { - _cardSelectedByGuest.ResetOriginalPosition(); - } - } - - public VfxBase CreateVfxResetPositionByCardBase(BattleCardBase card, SkillProcessor skill) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (_cardSelectedByOwner != null && _cardSelectedByOwner.CardBase == card) - { - parallelVfxPlayer.Register(_cardSelectedByOwner.CreateVfxResetPos()); - } - else if (_cardSelectedByGuest != null && _cardSelectedByGuest.CardBase == card) - { - parallelVfxPlayer.Register(_cardSelectedByGuest.CreateVfxResetPos()); - } - return parallelVfxPlayer; - } - - public void ToggleSelectHandCardMove(BattleCardBase selectedCard, bool isOwner) - { - if (selectedCard == null) - { - SelectObjectHandCard selectObjectHandCard = null; - if (isOwner) - { - selectObjectHandCard = _cardSelectedByOwner; - _cardSelectedByOwner = null; - } - else - { - selectObjectHandCard = _cardSelectedByGuest; - _cardSelectedByGuest = null; - } - if (selectObjectHandCard != null) - { - base.VfxMgr.RegisterSequentialVfx(selectObjectHandCard.CreateVfxResetPos()); - } - return; - } - if (BattleManagerBase.GetIns().GetBattlePlayer(isOwner).IsSelfTurn) - { - base.SlideObjectReceiveCtrl.CancelSlide(); - } - if (isOwner) - { - if (_cardSelectedByOwner != null) - { - if (_cardSelectedByOwner.CardBase == selectedCard) - { - return; - } - base.VfxMgr.RegisterSequentialVfx(_cardSelectedByOwner.CreateVfxResetPos()); - } - _cardSelectedByOwner = new SelectObjectHandCard(selectedCard, isOwner); - base.VfxMgr.RegisterSequentialVfx(_cardSelectedByOwner.CreateVfxSelectMove()); - return; - } - if (_cardSelectedByGuest != null) - { - if (_cardSelectedByGuest.CardBase == selectedCard) - { - return; - } - base.VfxMgr.RegisterSequentialVfx(_cardSelectedByGuest.CreateVfxResetPos()); - } - _cardSelectedByGuest = new SelectObjectHandCard(selectedCard, isOwner); - base.VfxMgr.RegisterSequentialVfx(_cardSelectedByGuest.CreateVfxSelectMove()); - } - - public override void SetupBattlePlayersEvent() - { - base.SetupBattlePlayersEvent(); - SetUpRetireEvent(); - } - - protected virtual void SetUpRetireEvent() - { - BattlePlayer.PlayerBattleView.OnRetire += delegate - { - base.VfxMgr.Clear(); - if (RoomBase.ConnectController.IsGathering) - { - GetBattleControl().BattleEnd(UIManager.ViewScene.Gathering, null, delegate(UIManager.ChangeViewSceneParam param) - { - param.IsUpdateFooterMenuTexture = true; - }); - RoomBase.DestroyMyRoomInfo(); - } - else - { - GetBattleControl().BattleEnd(UIManager.ViewScene.MyPage, delegate - { - if (MyPageMenu.Instance != null) - { - MyPageMenu.Instance.ChangeMenu(MyPageReturnIndex); - if (MyPageReturnIndex == 2) - { - MyPageMenu.Instance.GoToRoomMatch(); - } - } - }); - RoomBase.DestroyMyRoomInfo(); - } - }; - } - - public override VfxBase StartBattle() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(ChangePhase(base.PhaseCreator.CreateMainPhase())); - return sequentialVfxPlayer; - } - - protected override NetworkOperationCollectionBase CreateNetworkOperationCollection(NetworkBattleReceiver.ReceiveData receivedData, bool isPlayer) - { - return new WatchOperationCollection(this, OperateMgr, receivedData, base.networkBattleData, isPlayer); - } - - protected override bool IsOperateReceiveCheck() - { - return true; - } - - public override void ReceiveRetire(bool isWin) - { - if (isWin) - { - JudgeResultReceiveCode = NetworkBattleReceiver.RESULT_CODE.RetireWin; - SettingResultUI_SpecialResultTypeText(BATTLE_RESULT_TYPE.WIN); - FinishBattleEffect(classDead: true); - } - else - { - JudgeResultReceiveCode = NetworkBattleReceiver.RESULT_CODE.RetireLose; - SettingResultUI_SpecialResultTypeText(BATTLE_RESULT_TYPE.LOSE); - FinishBattleEffect(classDead: true); - } - } - - protected override void FinishBattleSend(NetworkBattleSender.JUDGE_RESULT_STATUS log, bool isWin = false, bool isNotRetry = false) - { - if (isResultDone) - { - return; - } - isResultDone = true; - if (JudgeResultReceiveCode == NetworkBattleReceiver.RESULT_CODE.NotFinish) - { - JudgeResultReceiveCode = JudgeCurrentFinishStatus(); - if (JudgeResultReceiveCode == NetworkBattleReceiver.RESULT_CODE.NotFinish) - { - LocalLog.AccumulateLastTraceLog("FinishBattleSend NotStatus" + isWin); - if (isWin) - { - JudgeResultReceiveCode = NetworkBattleReceiver.RESULT_CODE.DisconnectWin; - } - else - { - JudgeResultReceiveCode = NetworkBattleReceiver.RESULT_CODE.DisconnectLose; - } - } - } - switch (JudgeResultReceiveCode) - { - case NetworkBattleReceiver.RESULT_CODE.NoContest: - case NetworkBattleReceiver.RESULT_CODE.Invalid: - SettingResultUI_SpecialResultTypeText(BATTLE_RESULT_TYPE.CONSISTENCY); - FinishBattleEffect(classDead: false); - break; - case NetworkBattleReceiver.RESULT_CODE.LifeLose: - case NetworkBattleReceiver.RESULT_CODE.DeckoutLose: - case NetworkBattleReceiver.RESULT_CODE.SpecialLose: - case NetworkBattleReceiver.RESULT_CODE.MaxTurnLose: - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon: false); - })); - break; - case NetworkBattleReceiver.RESULT_CODE.RetireLose: - case NetworkBattleReceiver.RESULT_CODE.DisconnectLose: - case NetworkBattleReceiver.RESULT_CODE.FirstcardLose: - case NetworkBattleReceiver.RESULT_CODE.TurnendLose: - case NetworkBattleReceiver.RESULT_CODE.TurnstartLose: - RegisterDestryoy(isPlayer: true); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon: false); - })); - break; - case NetworkBattleReceiver.RESULT_CODE.LifeWin: - case NetworkBattleReceiver.RESULT_CODE.DeckoutWin: - case NetworkBattleReceiver.RESULT_CODE.SpecialWin: - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon: true); - })); - break; - case NetworkBattleReceiver.RESULT_CODE.RetireWin: - case NetworkBattleReceiver.RESULT_CODE.DisconnectWin: - case NetworkBattleReceiver.RESULT_CODE.FirstcardWin: - case NetworkBattleReceiver.RESULT_CODE.TurnendWin: - case NetworkBattleReceiver.RESULT_CODE.TurnstartWin: - RegisterDestryoy(isPlayer: false); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon: true); - })); - break; - } - } - - protected void RegisterDestryoy(bool isPlayer) - { - BattleCardBase battleCardBase = GetBattlePlayer(isPlayer).Class; - if (battleCardBase.Life >= 1) - { - battleCardBase.FlagCardAsDestroyedByKiller(); - FINISH_TYPE finishTypeByStatus = GetFinishTypeByStatus(); - base.VfxMgr.RegisterSequentialVfx(DeadClass(isPlayer, finishTypeByStatus)); - } - } - - public void FinishBattleSpecialEffect(BATTLE_RESULT_TYPE battleResult) - { - bool isPlayer = true; - switch (battleResult) - { - case BATTLE_RESULT_TYPE.WIN: - isPlayer = true; - break; - case BATTLE_RESULT_TYPE.LOSE: - isPlayer = false; - break; - case BATTLE_RESULT_TYPE.CONSISTENCY: - BattleResultControl.SetBattleFinishConsistency(); - isPlayer = true; - break; - } - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - InitiateGameEndSequence(isPlayer); - })); - } - - protected virtual OperateReceive CreateOperateReceive() - { - return new WatchOperateReceive(this, RegisterActionManager, OperateMgr, base.networkBattleData); - } - - public override bool IsSkillConditionCheckSkill(int cardIdx) - { - if (!base.IsSkillConditionCheckSkill(cardIdx)) - { - return base.networkBattleData.GetReceiveData().ActiveSelectSkillIndexList.Count > 0; - } - return true; - } - - public override bool IsReceivedSkillConditionCheck(int movement, SkillBase skill) - { - if (base.networkBattleData.GetReceiveData().ActiveSelectSkillIndexList.Count > 0) - { - return base.networkBattleData.GetReceiveData().ActiveSelectSkillIndexList.Contains(skill.SkillPrm.ownerCard.Skills.IndexOf(skill)); - } - return base.IsReceivedSkillConditionCheck(movement, skill); - } -} +using Wizard.Battle.View.Vfx; +using Wizard.BattleMgr; + +// PASS-6 STUB: 578-line body dropped. NetworkWatchBattleMgr is the client-side +// spectator battle manager (watch-touch-control, watcher-leave/disconnect checkers, +// select-object-hand-card VFX). Never constructed in headless — the node uses +// HeadlessNetworkBattleMgr : NetworkStandardBattleMgr, a sibling subtree. +// NetworkWatchBattleReceiver (which IS on the headless path via +// NetworkReplayBattleReceiver's inheritance) does NOT cast its mgr ref to +// NetworkWatchBattleMgr — it works through NetworkBattleManagerBase, so the mgr +// body's absence is invisible to the receive path. +// +// The three surface members below are compile-load-bearing: +// - disconnectDialog: field read by WatcherLeaveChecker (only constructed from +// within this class — dies in the analyzer cascade). +// - CreateVfxResetPositionByCardBase: called from WatchPlayCardAction via +// `(_battleMgr as NetworkWatchBattleMgr).…` — cast returns null in headless. +// - ToggleSelectHandCardMove: called from WatchOperationCollection. +// SelectObjectOperation on `_watchBattleMgr`. The recovery path takes the +// NetworkBattleManagerBase ctor overload that leaves `_watchBattleMgr` null, +// so this method's only would-be invocation NREs; safe as a signature stub. +public class NetworkWatchBattleMgr : NetworkBattleManagerBase +{ + + public NetworkWatchBattleMgr(IBattleMgrContentsCreator contentsCreator) : base(contentsCreator) { } + public void ToggleSelectHandCardMove(BattleCardBase selectedCard, bool isOwner) { } +} diff --git a/SVSim.BattleEngine/Engine/NetworkWatchBattleReceiver.cs b/SVSim.BattleEngine/Engine/NetworkWatchBattleReceiver.cs index ef2c40c7..975b4b5d 100644 --- a/SVSim.BattleEngine/Engine/NetworkWatchBattleReceiver.cs +++ b/SVSim.BattleEngine/Engine/NetworkWatchBattleReceiver.cs @@ -249,7 +249,7 @@ public class NetworkWatchBattleReceiver : NetworkBattleReceiver } if (dictionary.ContainsKey(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.vid])) { - item.isOpponent = ((handler != null) ? (!handler.isOwner(dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.vid]].ToString())) : (ConvertToInt(dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.vid]].ToString()) != PlayerStaticData.UserViewerID)); + item.isOpponent = ((handler != null) ? (!handler.isOwner(dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.vid]].ToString())) : (ConvertToInt(dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.vid]].ToString()) != networkBattleMgr.InstanceViewerId)); } if (dictionary.ContainsKey(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.is_open])) { diff --git a/SVSim.BattleEngine/Engine/NetworkWatchBattleSetupCardEvent.cs b/SVSim.BattleEngine/Engine/NetworkWatchBattleSetupCardEvent.cs deleted file mode 100644 index 2b378dec..00000000 --- a/SVSim.BattleEngine/Engine/NetworkWatchBattleSetupCardEvent.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System.Linq; - -public class NetworkWatchBattleSetupCardEvent : NetworkBattleSetupCardEvent -{ - public NetworkWatchBattleSetupCardEvent(BattleManagerBase manager, RegisterActionManager registerCardList, NetworkBattleData data) - : base(manager, registerCardList, data) - { - } - - protected override void SkillEventSetting(BattleCardBase card, SkillBase skill) - { - if (skill is Skill_none && !skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessBurialRite)) - { - return; - } - NetworkExecutionInfoCreator networkExecutionInfoCreator = skill._executionInfoCreator as NetworkExecutionInfoCreator; - bool flag = RegisterValidate.IsValidateCard(skill); - NetworkBattleReceiver.ReceiveData receiveData = base.networkBattleData.GetReceiveData(); - if (!GameMgr.GetIns().IsAdmin) - { - SettingConditionValidateCard(skill, card, networkExecutionInfoCreator); - } - if (!IsSettingUnapprovedCard(skill) || IsNotSettingUnapproved(skill)) - { - return; - } - if (RegisterFilter.IsFilterCard(skill)) - { - if (!card.IsPlayer && RegisterFilter.IsHandAllSelect(skill) && !GameMgr.GetIns().IsAdmin) - { - networkExecutionInfoCreator.SetHandAllSelect(); - } - else if (RegisterFilter.IsDeckAllSelect(skill)) - { - networkExecutionInfoCreator.SetUseUListOnlySelfTurn(); - if (!card.IsPlayer && !GameMgr.GetIns().IsAdmin) - { - networkExecutionInfoCreator.SetDeckAllSelect(); - } - } - if (RegisterFilter.IsFilterCardUnapproved(skill)) - { - networkExecutionInfoCreator.SetUnapproved(); - if (RegisterFilter.IsSkillUpdateDeckCard(skill)) - { - networkExecutionInfoCreator.SetUseUListOnlySelfTurn(); - } - } - return; - } - if ((!GameMgr.GetIns().IsAdmin || (GameMgr.GetIns().IsAdminWatch && skill.ApplyingTargetFilter is SkillTargetDeckSelfFilter)) && flag && !(skill.ApplyingTargetFilter is SkillTargetDiscardThisTurnCardListFilter)) - { - if (!NetworkBattleGenericTool.IsBurialRite(skill)) - { - if (!RegisterValidate.IsOpenMyHandSkill(skill) && !RegisterValidate.IsSendOpenMyCardsSkill(skill)) - { - networkExecutionInfoCreator.SetUnapproved(); - } - } - else if (!card.IsPlayer) - { - networkExecutionInfoCreator.SetNotCheckBuriaRiteCondition(value: true); - } - } - if (!GameMgr.GetIns().IsAdmin && !card.IsPlayer && receiveData != null) - { - _networkBattleSetupValidateEvent.OpponentPlayerIncludedValidateSkillToNotPlay(skill); - } - SettingUnapprovedRegisterLotEvent(skill, networkExecutionInfoCreator); - bool flag2 = (GameMgr.GetIns().IsAdmin || card.IsPlayer) && RegisterSkillConditionCheck.IsGameAddDeckCardsNumInvestigationSkill(skill); - SettingReplaceSkillOption(skill, card, networkExecutionInfoCreator, !RegisterSkillConditionCheck.DoesSkillUsePrivateCount(skill, notHandCheck: true) && !flag2); - if (!card.IsPlayer && !GameMgr.GetIns().IsAdmin) - { - SettingBurialRiteSkillPlayOrNotPlay(skill, networkExecutionInfoCreator); - CheckApplySelectFilter(skill, networkExecutionInfoCreator); - } - } - - protected override bool IsSendUnapprovedList(SkillBase skill) - { - return false; - } - - protected override bool IsCheckValidateCard() - { - return false; - } - - protected override bool IsCheckSkillConditionCard(BattleCardBase card) - { - return true; - } - - protected override bool CheckSkillCondition(SkillBase skill) - { - if (skill.SkillPrm.ownerCard.IsPlayer) - { - return RegisterSkillConditionCheck.IsSkillConditionCheck(skill, isNotHandCheck: true); - } - if (!RegisterSkillConditionCheck.IsSkillConditionCheck(skill, GameMgr.GetIns().IsAdmin)) - { - if (!GameMgr.GetIns().IsAdmin) - { - return RegisterSkillConditionCheck.IsSelectedCardSkillConditionCheck(skill); - } - return false; - } - return true; - } - - public override bool IsSettingUnapprovedCard(SkillBase skill) - { - return true; - } - - protected override bool IsSetNotCheckSelectSkillCard() - { - return true; - } -} diff --git a/SVSim.BattleEngine/Engine/NewReplayBattleMgr.cs b/SVSim.BattleEngine/Engine/NewReplayBattleMgr.cs index 59c7613d..4d475853 100644 --- a/SVSim.BattleEngine/Engine/NewReplayBattleMgr.cs +++ b/SVSim.BattleEngine/Engine/NewReplayBattleMgr.cs @@ -1,3896 +1,66 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Cute; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Battle; -using Wizard.Battle.UI; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -using Wizard.BattleMgr; - -public class NewReplayBattleMgr : NetworkReplayBattleMgr -{ - public class ParameterModifierInfo - { - public NetworkBattleReceiver.ReplayParameterModifierType ModifierType; - - public int ModifierValue; - - public ParameterModifierInfo(NetworkBattleReceiver.ReplayParameterModifierType modifierType, int modifierValue) - { - ModifierType = modifierType; - ModifierValue = modifierValue; - } - } - - private class BattleLogInfo - { - public string IndexName; - - public int CardId; - - public bool IsSelf; - - public bool IsPlayerSideTurn; - - public int Turn; - - public Wizard.Battle.UI.LogType Type; - - public string RightValueText; - - public int CardWithCount; - - public int[] RandomArray; - - public BattleLogItemType ItemType; - - public bool IsMinus; - - public bool IsNecromance; - - public bool IsDead; - - public BattleLogItem.CardTextureOption TextureOption; - - public int MulliganChangedCount; - - public BattleLogInfo(string indexName, int cardId, bool isSelf, bool isPlayerSideTurn, int turn, Wizard.Battle.UI.LogType type, string rightValueText, int cardWithCount, int[] randomArray, BattleLogItemType itemType, bool isMinus, bool isNecromance, bool isDead, BattleLogItem.CardTextureOption textureOption, int mulliganCount) - { - IndexName = indexName; - CardId = cardId; - IsSelf = isSelf; - IsPlayerSideTurn = isPlayerSideTurn; - Turn = turn; - Type = type; - RightValueText = rightValueText; - CardWithCount = cardWithCount; - RandomArray = randomArray; - ItemType = itemType; - IsMinus = isMinus; - IsNecromance = isNecromance; - IsDead = isDead; - TextureOption = textureOption; - MulliganChangedCount = mulliganCount; - } - } - - public enum BattleLogItemType - { - Turn, - Inner, - SkillTiming, - Damage, - Heal, - SkillTarget - } - - public class BattleInfoData - { - public int Priority; - - public int Value; - - public List DisplayCardIndexList = new List(); - - public List DisplayCardIdList = new List(); - } - - public class BattleLogTextureInfo - { - public string TexturePath { get; private set; } - - public string LogHeaderAssetPath { get; private set; } - - public UITexture HeaderUITexture { get; private set; } - - public Action OnLoad { get; private set; } - - public BattleLogTextureInfo(string texturePath, string logHeaderAssetPath, UITexture headerUITexture, Action onLoad) - { - TexturePath = texturePath; - LogHeaderAssetPath = logHeaderAssetPath; - HeaderUITexture = headerUITexture; - OnLoad = onLoad; - } - } - - private GameObject _moveTurnDialog; - - private ReplayMoveTurnButton _moveTurnButton; - - private UILabel _moveTurnButtonLabel; - - private List _turnStartIndexList; - - private JsonData _turnStartInfoList; - - private JsonData _preLoadResourceList; - - private List _battleLogInfoList; - - private int _lastBattleLogIndex; - - private List _lastCardInfoList; - - public List PlayerBattleInfoData = new List(); - - public List EnemyBattleInfoData = new List(); - - private ReplaySkipAnimation _replaySkipAnimation; - - public List StopEffectObjectList = new List(); - - public bool IsDuringSkillProcess; - - public Stack SkillVfxStack = new Stack(); - - public const string REPLAY_FILE_DIRECTORY_NAME = "NewReplay"; - - public const string REPLAY_NETWORK_FILE_NAME = "replay_network.json"; - - public const string REPLAY_INFO_FILE_NAME = "replay_info.json"; - - public const string REPLAY_TURN_START_INFO_FILE_NAME = "replay_turn_start.json"; - - public const string REPLAY_BATTLE_LOG_INFO_FILE_NAME = "replay_battle_log.json"; - - public const string REPLAY_LOAD_RESOURCES_INFO_FILE_NAME = "replay_load_resources.json"; - - public const string PRE_LOAD_RESOURCES_NAME = "pre_load_resource_list"; - - private const string EFFECT_FILE_NAME = "stt_act_costdown_1"; - - private const string SE_FILE_NAME = "se_stt_act_costdown_1"; - - public bool IsSelecting { get; set; } - - public bool IsChoiceSelecting { get; set; } - - public bool IsFusionSelecting { get; set; } - - public BattleCardBase ActCard { get; set; } - - public bool IsEvolve { get; set; } - - public bool IsRightAfterMoveTurn { get; set; } - - public bool IsMoveTurnScheduled { get; private set; } - - public static void DeleteReplayFiles() - { - string path = Application.persistentDataPath + "/NewReplay"; - if (Directory.Exists(path)) - { - Directory.Delete(path, recursive: true); - } - } - - public static JsonData ReadJson(string fileName) - { - using StreamReader streamReader = new StreamReader(fileName); - return JsonMapper.ToObject(CryptAES.decryptForNode(streamReader.ReadToEnd())); - } - - public NewReplayBattleMgr(IBattleMgrContentsCreator contentsCreator) - : base(contentsCreator) - { - _turnStartIndexList = Data.ReplayBattleInfo.TurnStartIndexList; - string replayDataDirectoryPath = Application.persistentDataPath + "/NewReplay"; - string[] files = Directory.GetFiles((from d in Directory.GetDirectories(replayDataDirectoryPath, "*", SearchOption.TopDirectoryOnly) - select d.Replace("\\", "/")).FirstOrDefault((string f) => f == replayDataDirectoryPath + "/" + GameMgr.GetIns().GetDataMgr().BattleId), "*", SearchOption.AllDirectories); - string fileName = files.FirstOrDefault((string x) => x.Contains("replay_turn_start.json")); - _turnStartInfoList = ReadJson(fileName); - _battleLogInfoList = new List(); - JsonData jsonData = ReadJson(files.FirstOrDefault((string x) => x.Contains("replay_battle_log.json"))); - for (int num = 0; num < jsonData.Count; num++) - { - int[] array = null; - if (jsonData[num].Keys.Contains(67.ToString())) - { - JsonData jsonData2 = jsonData[num][67.ToString()]; - array = new int[jsonData2.Count]; - for (int num2 = 0; num2 < jsonData2.Count; num2++) - { - array[num2] = Convert.ToInt32(jsonData2[num2].ToString()); - } - } - _battleLogInfoList.Add(new BattleLogInfo(jsonData[num][63.ToString()].ToString(), jsonData[num][0.ToString()].ToInt(), jsonData[num][2.ToString()].ToInt() == 1, jsonData[num][105.ToString()].ToInt() == 1, jsonData[num][3.ToString()].ToInt(), (Wizard.Battle.UI.LogType)jsonData[num][64.ToString()].ToInt(), jsonData[num][65.ToString()].ToString(), jsonData[num][66.ToString()].ToInt(), array, (BattleLogItemType)jsonData[num][68.ToString()].ToInt(), jsonData[num][69.ToString()].ToInt() == 1, jsonData[num][70.ToString()].ToInt() == 1, jsonData[num][71.ToString()].ToInt() == 1, (BattleLogItem.CardTextureOption)jsonData[num][100.ToString()].ToInt(), jsonData[num][106.ToString()].ToInt())); - } - } - - public override void StartOpening(int FirstAttack) - { - base.StartOpening(FirstAttack); - _moveTurnDialog = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Replay/ReplayMoveTurnDialog")); - _moveTurnDialog.transform.parent = BtlUIContainer.transform; - _moveTurnDialog.transform.localScale = Vector3.one; - ReplayMoveTurnPanel component = _moveTurnDialog.GetComponent().InnerPanel.GetComponent(); - UnityEngine.Object itemObject = Resources.Load("Prefab/UI/Replay/ReplayMoveTurnItem"); - for (int i = 0; i < _turnStartInfoList.Count; i++) - { - CreateMoveTurnItem(itemObject, component.LogGrid.transform, i + 1); - } - component.LogGrid.Reposition(); - component.ScrollView.ResetPosition(); - _moveTurnDialog.SetActive(value: false); - _moveTurnButton = ((GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Replay/ReplayMoveTurnButton"))).GetComponent(); - _moveTurnButton.transform.parent = BtlUIContainer.transform; - _moveTurnButton.transform.localScale = Vector3.one; - UpdateMoveTurnButton(0); - _moveTurnButton.gameObject.SetActive(value: false); - _moveTurnButtonLabel = _moveTurnButton.GetComponentInChildren(); - _moveTurnButtonLabel.text = Data.SystemText.Get("Battle_0519", "1"); - _moveTurnButton.MenuButton.onClick.Add(new EventDelegate(delegate - { - PauseReplay(); - SetActiveMoveTurnDialog(isActive: true); - })); - _moveTurnButton.BackButton.onClick.Add(new EventDelegate(delegate - { - int num2 = (IsRightAfterMoveTurn ? (BattlePlayer.Turn + 1) : BattlePlayer.Turn); - if (num2 > 1) - { - DisableMoveTurnButton(); - OperateMgr.BattleLogManager.DisableButton(); - base.BattleUIContainer.DisableMenu(isForceDisable: true); - MoveTurn(num2 - 1); - } - })); - _moveTurnButton.ForwardButton.GetComponent().IsNewReplayForwardButton = true; - _moveTurnButton.ForwardButton.onClick.Add(new EventDelegate(delegate - { - int num2 = (IsRightAfterMoveTurn ? (BattlePlayer.Turn + 1) : BattlePlayer.Turn); - if (num2 < _turnStartInfoList.Count) - { - DisableMoveTurnButton(); - OperateMgr.BattleLogManager.DisableButton(); - base.BattleUIContainer.DisableMenu(isForceDisable: true); - MoveTurn(num2 + 1); - } - })); - UISprite stopReplayBtnSprite = _moveTurnButton.StopReplayButton.transform.GetChild(0).GetComponent(); - _moveTurnButton.StopReplayButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - base.isStopReplay = !base.isStopReplay; - if (base.isStopReplay) - { - stopReplayBtnSprite.spriteName = "btn_replay_play"; - UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: false); - } - else - { - stopReplayBtnSprite.spriteName = "btn_replay_pause"; - UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: true); - } - })); - _moveTurnButton.ForwardReplayButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - base.isForwardReplay = true; - })); - UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: true); - StopReplayBtn.onClick.Add(new EventDelegate(delegate - { - if (base.isStopReplay) - { - stopReplayBtnSprite.spriteName = "btn_replay_play"; - UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: false); - } - else - { - stopReplayBtnSprite.spriteName = "btn_replay_pause"; - UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: true); - } - })); - GameObject gameObject = NGUITools.AddChild(base.BattleUIContainer.gameObject, LoadPrefab("Prefab/UI/Replay/ReplaySkipAnimation")); - _replaySkipAnimation = gameObject.GetComponent(); - _replaySkipAnimation.SetUp(); - string replayDataDirectoryPath = Application.persistentDataPath + "/NewReplay"; - string text = Directory.GetFiles((from d in Directory.GetDirectories(replayDataDirectoryPath, "*", SearchOption.TopDirectoryOnly) - select d.Replace("\\", "/")).FirstOrDefault((string f) => f == replayDataDirectoryPath + "/" + GameMgr.GetIns().GetDataMgr().BattleId), "*", SearchOption.AllDirectories).FirstOrDefault((string x) => x.Contains("replay_info.json")); - if (!string.IsNullOrEmpty(text)) - { - _preLoadResourceList = ReadJson(text); - } - List list = new List(); - for (int num = 0; num < _preLoadResourceList["pre_load_resource_list"].Count; num++) - { - string text2 = _preLoadResourceList["pre_load_resource_list"][num].ToString(); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(text2, ResourcesManager.AssetLoadPathType.Effect2D)); - list.Add("s/se_" + text2 + ".acb"); - } - ImmediateVfxMgr.GetInstance().Register(new WaitLoadResourceVfx(list)); - } - - private GameObject LoadPrefab(string path) - { - PrefabMgr prefabMgr = GameMgr.GetIns().GetPrefabMgr(); - prefabMgr.Load(path); - return prefabMgr.Get(path); - } - - private void CreateMoveTurnItem(UnityEngine.Object itemObject, Transform table, int turn) - { - ReplayMoveTurnItem component = ((GameObject)UnityEngine.Object.Instantiate(itemObject)).GetComponent(); - component.transform.parent = table; - component.transform.localScale = Vector3.one; - component.transform.localPosition = Vector3.zero; - component.gameObject.SetActive(value: true); - component.Label.text = Data.SystemText.Get("Battle_0519", turn.ToString()); - component.Button.onClick.Add(new EventDelegate(delegate - { - SetActiveMoveTurnDialog(isActive: false); - DisableMoveTurnButton(); - OperateMgr.BattleLogManager.DisableButton(); - base.BattleUIContainer.DisableMenu(isForceDisable: true); - MoveTurn(turn); - })); - } - - public void SetActiveMoveTurnDialog(bool isActive) - { - _moveTurnDialog.SetActive(isActive); - if (isActive) - { - _moveTurnDialog.GetComponent().AdjustScrollPosition(IsRightAfterMoveTurn ? (BattlePlayer.Turn + 1) : BattlePlayer.Turn, _turnStartInfoList.Count); - } - } - - public void SetActiveMoveTurnButton(bool isActive) - { - _moveTurnButton.gameObject.SetActive(isActive); - } - - private void EnableMoveTurnButton() - { - _moveTurnButton.MenuButton.isEnabled = true; - _moveTurnButton.BackButton.isEnabled = true; - _moveTurnButton.ForwardButton.isEnabled = true; - } - - private void DisableMoveTurnButton() - { - _moveTurnButton.MenuButton.isEnabled = false; - _moveTurnButton.BackButton.isEnabled = false; - _moveTurnButton.ForwardButton.isEnabled = false; - } - - private void UpdateMoveTurnButton(int turn) - { - _moveTurnButton.BackButton.isEnabled = turn > 1; - _moveTurnButton.ForwardButton.isEnabled = turn < _turnStartInfoList.Count; - } - - protected override BattlePlayer CreateBattlePlayer() - { - return new ReplayBattlePlayer(this, _battleCamera, _backGround, CreatePlayerInnerOptionsBuilder()); - } - - protected override BattleEnemy CreateBattleEnemy() - { - return new ReplayBattleEnemy(this, _battleCamera, _backGround, CreateEnemyInnerOptionsBuilder()); - } - - public override void DisposeBattleGameObj() - { - _replaySkipAnimation.Unload(); - base.DisposeBattleGameObj(); - } - - private void PauseReplay() - { - base.isStopReplay = true; - _moveTurnButton.StopReplayButton.transform.GetChild(0).GetComponent().spriteName = "btn_replay_play"; - UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: false); - } - - public void MoveTurn(int turn) - { - PauseReplay(); - IsMoveTurnScheduled = true; - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - StartMoveTurn(turn); - })); - } - - private void StartMoveTurn(int turn) - { - IsMoveTurnScheduled = false; - int num = turn - 1; - if (num >= _turnStartInfoList.Count || BattlePlayer.Class.IsDead || BattleEnemy.Class.IsDead) - { - base.isStopReplay = false; - StopReplayBtn.transform.GetChild(0).GetComponent().spriteName = "btn_replay_pause"; - UIManager.SetObjectToGrey(ReplayForwardBtn.gameObject, b: true); - return; - } - JsonData jsonData = _turnStartInfoList[num]; - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - _replaySkipAnimation.Run(); - })); - base.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(0.1f)); - List inPlayCard = BattlePlayer.InPlayCards.ToList(); - inPlayCard.AddRange(BattleEnemy.InPlayCards.ToList()); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - for (int i = 0; i < inPlayCard.Count; i++) - { - inPlayCard[i].BattleCardView.StopVoice(); - } - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - soundMgr.VoiceMute(isMute: true); - soundMgr.SetRejectNewSound(isMute: true); - })); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - for (int i = 0; i < StopEffectObjectList.Count; i++) - { - if (StopEffectObjectList[i] != null) - { - StopEffectObjectList[i].SetActive(value: false); - } - } - })); - if (IsSelecting) - { - base.VfxMgr.RegisterSequentialVfx((BattlePlayer as ReplayBattlePlayer).CancelSelect(ActCard, IsEvolve, isChoiceBrave: false, isMoveTurn: true)); - } - if (IsFusionSelecting) - { - base.VfxMgr.RegisterSequentialVfx((BattlePlayer as ReplayBattlePlayer).CancelFusion(ActCard, isMoveTurn: true)); - } - if (IsChoiceSelecting) - { - base.VfxMgr.RegisterSequentialVfx((BattlePlayer as ReplayBattlePlayer).CancelChoice(ActCard, IsEvolve, isMoveTurn: true)); - } - base.VfxMgr.RegisterSequentialVfx(new ThinkIconHideVfx(base.BattleResourceMgr)); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(GenerateBothField(jsonData)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - EnableMoveTurnButton(); - UpdateMoveTurnButton(turn); - OperateMgr.BattleLogManager.EnableButton(); - base.BattleUIContainer.EnableMenu(); - })); - base.VfxMgr.RegisterSequentialVfx(UIManager.GetInstance().CreateNowLoadingVfx(sequentialVfxPlayer)); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - _replaySkipAnimation.End(); - })); - base.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(0.1f)); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - _replaySkipAnimation.Hide(); - })); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)) - { - soundMgr.VoiceMute(isMute: false); - } - soundMgr.SetRejectNewSound(isMute: false); - })); - BattlePlayer.Turn = turn - 1; - BattleEnemy.Turn = jsonData[106.ToString()].ToInt(); - BattlePlayer.IsSelfTurn = false; - BattleEnemy.IsSelfTurn = true; - base.isForwardReplay = false; - IsRightAfterMoveTurn = true; - BattlePlayer.EvolveWaitTurnCount = (BattlePlayer.IsGameFirst ? 5 : 4) - BattlePlayer.Turn; - BattleEnemy.EvolveWaitTurnCount = (BattlePlayer.IsGameFirst ? 4 : 5) - BattleEnemy.Turn; - TurnPanelControl.Initialize(BattlePlayer.EvolveWaitTurnCount > 0, BattleEnemy.EvolveWaitTurnCount > 0); - ReplayController._replayDataHandler.SetOperationIndex(_turnStartIndexList[num]); - _moveTurnButtonLabel.text = Data.SystemText.Get("Battle_0519", turn.ToString()); - } - - private VfxBase GenerateBothField(JsonData info) - { - List destroyCardList = new List(); - JsonData playerInfo = info[49.ToString()]; - JsonData enemyInfo = info[50.ToString()]; - JsonData playerBattleInfo = info[73.ToString()]; - JsonData enemyBattleInfo = info[74.ToString()]; - JsonData playerClassInfo = info[75.ToString()]; - JsonData enemyClassInfo = info[76.ToString()]; - List myRotationBonusInfoList = new List(); - for (int i = 0; i < info[77.ToString()].Count; i++) - { - myRotationBonusInfoList.Add(GetNetworkBattleReceiver().CreateMyRotationBonusInfo(info[77.ToString()][i])); - } - NetworkBattleReceiver.AvatarBattleDescriptionValueInfo playerAvatarBattleDescinfo = null; - NetworkBattleReceiver.AvatarBattleDescriptionValueInfo enemyAvatarBattleDescinfo = null; - if (Data.CurrentFormat == Format.Avatar) - { - playerAvatarBattleDescinfo = GetNetworkBattleReceiver().CreateAvatarBattleDescriotionValueInfo(info[78.ToString()]); - enemyAvatarBattleDescinfo = GetNetworkBattleReceiver().CreateAvatarBattleDescriotionValueInfo(info[79.ToString()]); - } - List battleLogTextureInfoList = new List(); - VfxBase vfxBase = GenerateField(playerInfo, BattlePlayer, destroyCardList, isPlayer: true, battleLogTextureInfoList); - VfxBase vfxBase2 = GenerateField(enemyInfo, BattleEnemy, destroyCardList, isPlayer: false, battleLogTextureInfoList); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List list = new List(); - for (int j = 0; j < playerInfo[45.ToString()].Count; j++) - { - NetworkBattleReceiver.CardInfo item = networkReceiver.CreateCardInfo(playerInfo[45.ToString()][j]); - list.Add(item); - } - for (int k = 0; k < enemyInfo[45.ToString()].Count; k++) - { - NetworkBattleReceiver.CardInfo item2 = networkReceiver.CreateCardInfo(enemyInfo[45.ToString()][k]); - list.Add(item2); - } - parallelVfxPlayer.Register(UpdateHandInfo(BattlePlayer.HandCardList, BattleEnemy.HandCardList, list, BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient)); - List list2 = new List(); - for (int l = 0; l < playerInfo[46.ToString()].Count; l++) - { - NetworkBattleReceiver.CardInfo item3 = networkReceiver.CreateCardInfo(playerInfo[46.ToString()][l]); - list2.Add(item3); - } - for (int m = 0; m < enemyInfo[46.ToString()].Count; m++) - { - NetworkBattleReceiver.CardInfo item4 = networkReceiver.CreateCardInfo(enemyInfo[46.ToString()][m]); - list2.Add(item4); - } - parallelVfxPlayer.Register(UpdateInplayInfo(BattlePlayer.ClassAndInPlayCardList, BattleEnemy.ClassAndInPlayCardList, list2, BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient, isSelfTurn: true, isInitialize: true)); - List list3 = new List(); - for (int n = 0; n < info[70.ToString()].Count; n++) - { - NetworkBattleReceiver.CardInfo item5 = networkReceiver.CreateCardInfo(info[70.ToString()][n]); - list3.Add(item5); - } - UpdateAttachedCardInfo(BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient, list3); - BattlePlayer.IsChoiceBraveEffectTiming = false; - BattleEnemy.IsChoiceBraveEffectTiming = false; - return ParallelVfxPlayer.Create(new RefreshHealthVfx(BattlePlayer, isNewReplayMoveTurn: true), new RefreshHealthVfx(BattleEnemy, isNewReplayMoveTurn: true), new DummyDeckChangeCardVfx(isPlayer: true, BattlePlayer.DeckCardList.Count), new DummyDeckChangeCardVfx(isPlayer: false, BattleEnemy.DeckCardList.Count), vfxBase, vfxBase2, parallelVfxPlayer, RecoveryInPlayAndHandCards(), UpdateEvolveSkin(), OpeningVfx.ShowBattleUIImmediatelyVfx(BattlePlayer, fixDirection: false, isNewReplay: true), OpeningVfx.ShowBattleUIImmediatelyVfx(BattleEnemy, fixDirection: false, isNewReplay: true), BattlePlayer.UsePp(0, isNewReplayMoveTurn: true), BattleEnemy.UsePp(0, isNewReplayMoveTurn: true), InstantVfx.Create(BattlePlayer.BattleView.HideCommonPanel), InstantVfx.Create(BattleEnemy.BattleView.HideCommonPanel), InstantVfx.Create(delegate - { - BattlePlayer.UpdateStatusPanel(BattlePlayer.HandCardList.Count, playerInfo[43.ToString()].ToInt(), BattlePlayer.DeckCardList.Count); - }), InstantVfx.Create(delegate - { - BattleEnemy.UpdateStatusPanel(BattleEnemy.HandCardList.Count, enemyInfo[43.ToString()].ToInt(), BattleEnemy.DeckCardList.Count); - }), InstantVfx.Create(delegate - { - GetNetworkBattleReceiver().UpdateBattleInfo(playerBattleInfo, isPlayer: true); - }), InstantVfx.Create(delegate - { - GetNetworkBattleReceiver().UpdateBattleInfo(enemyBattleInfo, isPlayer: false); - }), InstantVfx.Create(delegate - { - BattlePlayer.ClassInformationUIController.NewReplayUpdateInfomation(GetNetworkBattleReceiver().CreateClassInfo(playerClassInfo)); - }), InstantVfx.Create(delegate - { - BattleEnemy.ClassInformationUIController.NewReplayUpdateInfomation(GetNetworkBattleReceiver().CreateClassInfo(enemyClassInfo)); - }), InstantVfx.Create(delegate - { - UpdateMyRotationBonus(myRotationBonusInfoList); - }), InstantVfx.Create(delegate - { - UpdateAvatarBattleDescValueList(playerAvatarBattleDescinfo, enemyAvatarBattleDescinfo); - }), InstantVfx.Create(delegate - { - BattlePlayer.ClassInformationUIController.HideAllInfomation(); - }), InstantVfx.Create(delegate - { - BattleEnemy.ClassInformationUIController.HideAllInfomation(); - }), InstantVfx.Create(delegate - { - BattlePlayer.PlayerBattleView.AllClear(); - }), BattlePlayer.BattleView.GetSideLogControl(isSkillTargetSelect: false).ClearLastShowLogCard(), BattleEnemy.BattleView.GetSideLogControl(isSkillTargetSelect: false).ClearLastShowLogCard(), UpdateBattleLog(BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient, (int)info[80.ToString()], battleLogTextureInfoList), InstantVfx.Create(delegate - { - for (int num = 0; num < destroyCardList.Count; num++) - { - UnityEngine.Object.Destroy(destroyCardList[num].BattleCardView.GameObject); - } - })); - } - - private VfxBase UpdateEvolveSkin() - { - return InstantVfx.Create(delegate - { - PlayerClassBattleCardView playerClassBattleCardView = BattlePlayer.Class.BattleCardView as PlayerClassBattleCardView; - if (GameMgr.GetIns().GetDataMgr().IsEvolveSkin(isPlayer: true) && BattlePlayer.IsSkinEvolved) - { - playerClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle); - } - else - { - playerClassBattleCardView.ClassCharacter.ResetMotion(); - } - EnemyClassBattleCardView enemyClassBattleCardView = BattleEnemy.Class.BattleCardView as EnemyClassBattleCardView; - if (GameMgr.GetIns().GetDataMgr().IsEvolveSkin(isPlayer: false) && BattleEnemy.IsSkinEvolved) - { - enemyClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle); - } - else - { - enemyClassBattleCardView.ClassCharacter.ResetMotion(); - } - }); - } - - private VfxBase GenerateField(JsonData info, BattlePlayerBase player, List destroyCardList, bool isPlayer, List battleLogTextureInfoList) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - player.PpTotal = info[38.ToString()].ToInt(); - player.Pp = info[39.ToString()].ToInt(); - player.SetCurrentEpCount(info[41.ToString()].ToInt()); - player.EpTotal = info[42.ToString()].ToInt(); - player.IsEpEvolveThisTurn = info[96.ToString()].ToInt() == 1; - player.Class.SkillApplyInformation.SetCantActivateFanfareCount(info[97.ToString()].ToInt()); - player.SetCumulativeEvolutionCount(info[98.ToString()].ToInt()); - parallelVfxPlayer.Register(player.SetBp(info[40.ToString()].ToInt())); - SetShortageDeckWin(player.IsPlayer, info[95.ToString()].ToInt() == 1); - player.DeckSkillCardList.Clear(); - List list = player.AllCardsWithSkillIngredient.ToList(); - int cardTotalNum = player.cardTotalNum; - BattleLogManager.GetInstance().ResetFusionIngredients(isPlayer); - OperateMgr.BattleLogManager.ClearDestroyedCardList(isPlayer); - OperateMgr.BattleLogManager.ClearPlayedCardList(isPlayer); - BattlePlayer.BattleView.SetNotCancelCollider(list.Where((BattleCardBase c) => !(c is ClassBattleCardBase)).ToList(), isEnable: false); - List list2 = new List(); - List list3 = new List(); - List list4 = new List(); - List list5 = GenerateUndisplayedCards(info[56.ToString()], cardTotalNum, list, null, player, parallelVfxPlayer); - for (int num = 0; num < list5.Count && num < info[56.ToString()].Count; num++) - { - NetworkBattleReceiver.CardInfo cardInfo = networkReceiver.CreateCardInfo(info[56.ToString()][num]); - UpdateFusionIngredients(list5[num], cardInfo, list5); - } - for (int num2 = 0; num2 < info[45.ToString()].Count; num2++) - { - NetworkBattleReceiver.CardInfo cardInfo2 = networkReceiver.CreateCardInfo(info[45.ToString()][num2]); - BattleCardBase orCreateBattleCard = GetOrCreateBattleCard(cardInfo2.Index, cardTotalNum, list, player, cardInfo2.Id); - UnitBattleCard unitCard = orCreateBattleCard as UnitBattleCard; - if (unitCard != null) - { - unitCard.Evolution(cardInfo2.IsEvolution); - if (unitCard.IsInplay) - { - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - unitCard.BattleCardView.HideAttackFinished(); - })); - } - } - iTween.Stop(orCreateBattleCard.BattleCardView.CardWrapObject); - orCreateBattleCard.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero; - orCreateBattleCard.BattleCardView.CardWrapObject.transform.localEulerAngles = Vector3.zero; - bool isInHand = orCreateBattleCard.IsInHand; - bool isBuffed = orCreateBattleCard.IsUnit && (orCreateBattleCard.Atk > orCreateBattleCard.BaseAtk || orCreateBattleCard.MaxLife > orCreateBattleCard.BaseMaxLife || orCreateBattleCard.SkillApplyInformation.BuffCount > 0); - bool isDebuffed = orCreateBattleCard.IsUnit && (orCreateBattleCard.Atk < orCreateBattleCard.BaseAtk || orCreateBattleCard.MaxLife < orCreateBattleCard.BaseMaxLife); - orCreateBattleCard.ResetCardParameterInHand(); - orCreateBattleCard.DeathTypeInfo.Reset(); - UpdateParameterModifierAndCostView(orCreateBattleCard, cardInfo2); - parallelVfxPlayer.Register(orCreateBattleCard.StopSpellCharge()); - orCreateBattleCard.SetSpellChargeCount(cardInfo2.SpellChargeCount); - orCreateBattleCard.SkillApplyInformation.ForceDepriveChantCount(); - UpdateSkillDescriptionValueList(orCreateBattleCard, cardInfo2); - UpdateUnionBurstAndSkyboundArtModifier(orCreateBattleCard, cardInfo2); - RemoveCard(player, orCreateBattleCard, isBuffed, isDebuffed); - list2.Add(orCreateBattleCard); - if (!isInHand && !orCreateBattleCard.IsSpell) - { - orCreateBattleCard.BattleCardView.ResetCardView(orCreateBattleCard.BaseParameter); - CardTemplate cardTemplate = orCreateBattleCard.BattleCardView.CardTemplate; - if (orCreateBattleCard.IsUnit) - { - cardTemplate.FieldEvolMeshTemp.gameObject.SetActive(value: false); - cardTemplate.AtkLabelTemp.transform.parent.gameObject.SetActive(value: false); - cardTemplate.LifeLabelTemp.transform.parent.gameObject.SetActive(value: false); - cardTemplate.NormalAtkLabelTemp.gameObject.SetActive(value: true); - cardTemplate.NormalLifeLabelTemp.gameObject.SetActive(value: true); - } - cardTemplate.FieldNormalMeshTemp.gameObject.SetActive(value: false); - cardTemplate.CardNormalTemp.gameObject.SetActive(value: true); - if (orCreateBattleCard.BattleCardView.BattleCardIconAnimations != null) - { - orCreateBattleCard.BattleCardView.BattleCardIconAnimations.DeleteSkillIcons(); - } - cardTemplate.SkillIconTemp.gameObject.SetActive(value: false); - if (orCreateBattleCard.BattleCardView is FieldBattleCardView fieldBattleCardView && fieldBattleCardView.ChantCountIcon != null) - { - fieldBattleCardView.ChantCountIcon.SetActive(value: false); - } - orCreateBattleCard.SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier(); - } - CardBasePrm.TribeInfo tribeInfo = new CardBasePrm.TribeInfo(cardInfo2.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE); - orCreateBattleCard.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo, showEffect: false); - if (!orCreateBattleCard.IsSpell) - { - parallelVfxPlayer.Register(orCreateBattleCard.BattleCardView.ShowHandCardInfo(isRecovery: true)); - } - UpdateFusionIngredients(orCreateBattleCard, cardInfo2, list5); - orCreateBattleCard.BattleCardView.HideCanPlayEffect(); - orCreateBattleCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - orCreateBattleCard.ResetReplayBuffInfo(); - } - for (int num3 = 0; num3 < info[46.ToString()].Count; num3++) - { - NetworkBattleReceiver.CardInfo cardInfo3 = networkReceiver.CreateCardInfo(info[46.ToString()][num3]); - BattleCardBase orCreateBattleCard2 = GetOrCreateBattleCard(cardInfo3.Index, cardTotalNum, list, player, cardInfo3.Id); - orCreateBattleCard2.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - if (orCreateBattleCard2 is ClassBattleCardBase) - { - ClearAndUpdateParameterModifier(orCreateBattleCard2, cardInfo3); - player.ClassAndInPlayCardList.Remove(orCreateBattleCard2); - list3.Add(orCreateBattleCard2); - continue; - } - UnitBattleCard unitCard2 = orCreateBattleCard2 as UnitBattleCard; - if (unitCard2 != null) - { - unitCard2.Evolution(cardInfo3.IsEvolution); - if (unitCard2.IsInplay) - { - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - unitCard2.BattleCardView.HideAttackFinished(); - })); - } - } - iTween.Stop(orCreateBattleCard2.BattleCardView.CardWrapObject); - orCreateBattleCard2.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero; - orCreateBattleCard2.BattleCardView.CardWrapObject.transform.localEulerAngles = Vector3.zero; - bool isInplay = orCreateBattleCard2.IsInplay; - bool isBuffed2 = orCreateBattleCard2.IsUnit && (orCreateBattleCard2.Atk > orCreateBattleCard2.BaseAtk || orCreateBattleCard2.MaxLife > orCreateBattleCard2.BaseMaxLife || orCreateBattleCard2.SkillApplyInformation.BuffCount > 0); - bool isDebuffed2 = orCreateBattleCard2.IsUnit && (orCreateBattleCard2.Atk < orCreateBattleCard2.BaseAtk || orCreateBattleCard2.MaxLife < orCreateBattleCard2.BaseMaxLife); - orCreateBattleCard2.ResetCardParameter(); - orCreateBattleCard2.DeathTypeInfo.Reset(); - UpdateParameterModifierAndCostView(orCreateBattleCard2, cardInfo3); - CardBasePrm.TribeInfo tribeInfo2 = new CardBasePrm.TribeInfo(cardInfo3.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE); - orCreateBattleCard2.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo2, showEffect: false); - if (cardInfo3.ChantCount != -1) - { - orCreateBattleCard2.SkillApplyInformation.ForceDepriveChantCount(); - orCreateBattleCard2.SkillApplyInformation.GiveChantCount(new ChantCountAddModifier(cardInfo3.ChantCount - orCreateBattleCard2.BaseParameter.ChantCount)); - } - if (cardInfo3.WhiteRitualCount != -1) - { - orCreateBattleCard2.SkillApplyInformation.FourceDepriveWhiteRitualCount(); - orCreateBattleCard2.SkillApplyInformation.GiveWhiteRitualCount(cardInfo3.WhiteRitualCount); - } - if (cardInfo3.MaxAttackableCount != -1) - { - orCreateBattleCard2.SkillApplyInformation.ForceDepriveAttackCount(); - orCreateBattleCard2.attackCountinfo.Add(new BattleCardBase.SetAttackCountInfo(null, cardInfo3.MaxAttackableCount)); - } - if (orCreateBattleCard2.IsChoiceEvolutionCard) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(orCreateBattleCard2.BaseParameter.BaseCardId); - orCreateBattleCard2.UpdateChoiceEvolutionBeforeCard(cardParameterFromId.NormalCardId, cardParameterFromId.CardName); - } - UpdateSkillDescriptionValueList(orCreateBattleCard2, cardInfo3); - UpdateUnionBurstAndSkyboundArtModifier(orCreateBattleCard2, cardInfo3); - UpdateFusionIngredients(orCreateBattleCard2, cardInfo3, list5); - RemoveCard(player, orCreateBattleCard2, isBuffed2, isDebuffed2); - list3.Add(orCreateBattleCard2); - if (!isInplay) - { - parallelVfxPlayer.Register(orCreateBattleCard2.StopSpellCharge()); - parallelVfxPlayer.Register(new ShowCardNumberLabelVfx(orCreateBattleCard2.BattleCardView, isShow: true)); - } - orCreateBattleCard2.BattleCardView.HideCanPlayEffect(); - orCreateBattleCard2.ResetReplayBuffInfo(); - } - for (int num4 = 0; num4 < info[52.ToString()].Count; num4++) - { - NetworkBattleReceiver.CardInfo cardInfo4 = networkReceiver.CreateCardInfo(info[52.ToString()][num4]); - BattleCardBase orCreateBattleCard3 = GetOrCreateBattleCard(cardInfo4.Index, cardTotalNum, list, player, cardInfo4.Id); - UnitBattleCard unitCard3 = orCreateBattleCard3 as UnitBattleCard; - if (unitCard3 != null) - { - unitCard3.Evolution(cardInfo4.IsEvolution); - if (unitCard3.IsInplay) - { - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - unitCard3.BattleCardView.HideAttackFinished(); - })); - } - } - iTween.Stop(orCreateBattleCard3.BattleCardView.CardWrapObject); - orCreateBattleCard3.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero; - orCreateBattleCard3.BattleCardView.CardWrapObject.transform.localEulerAngles = Vector3.zero; - bool isInDeck = orCreateBattleCard3.IsInDeck; - bool isBuffed3 = orCreateBattleCard3.IsUnit && (orCreateBattleCard3.Atk > orCreateBattleCard3.BaseAtk || orCreateBattleCard3.MaxLife > orCreateBattleCard3.BaseMaxLife || orCreateBattleCard3.SkillApplyInformation.BuffCount > 0); - bool isDebuffed3 = orCreateBattleCard3.IsUnit && (orCreateBattleCard3.Atk < orCreateBattleCard3.BaseAtk || orCreateBattleCard3.MaxLife < orCreateBattleCard3.BaseMaxLife); - orCreateBattleCard3.DeathTypeInfo.Reset(); - UpdateParameterModifierAndCostView(orCreateBattleCard3, cardInfo4); - orCreateBattleCard3.SetSpellChargeCount(cardInfo4.SpellChargeCount); - orCreateBattleCard3.SkillApplyInformation.ForceDepriveChantCount(); - UpdateSkillDescriptionValueList(orCreateBattleCard3, cardInfo4); - UpdateFusionIngredients(orCreateBattleCard3, cardInfo4, list5); - RemoveCard(player, orCreateBattleCard3, isBuffed3, isDebuffed3); - list4.Add(orCreateBattleCard3); - if (orCreateBattleCard3.HasDeckSelfSkill) - { - player.AddDeckSkillCard(orCreateBattleCard3); - } - if (!isInDeck) - { - orCreateBattleCard3.BattleCardView.CardWrapObject.SetActive(value: true); - orCreateBattleCard3.BattleCardView.GameObject.SetActive(value: false); - orCreateBattleCard3.BattleCardView.Transform.SetParent(PCardPlace.transform); - orCreateBattleCard3.BattleCardView.Transform.position = (isPlayer ? CardHolder.transform.position : ECardHolder.transform.position); - orCreateBattleCard3.BattleCardView.Transform.localScale = Global.CARD_BATTLE_SCALE; - orCreateBattleCard3.BattleCardView.Transform.rotation = Quaternion.Euler(0f, -90f, 90f); - if (!orCreateBattleCard3.IsSpell) - { - orCreateBattleCard3.BattleCardView.ResetCardView(orCreateBattleCard3.BaseParameter); - CardTemplate cardTemplate2 = orCreateBattleCard3.BattleCardView.CardTemplate; - if (orCreateBattleCard3.IsUnit) - { - cardTemplate2.FieldEvolMeshTemp.gameObject.SetActive(value: false); - cardTemplate2.AtkLabelTemp.transform.parent.gameObject.SetActive(value: false); - cardTemplate2.LifeLabelTemp.transform.parent.gameObject.SetActive(value: false); - cardTemplate2.NormalAtkLabelTemp.gameObject.SetActive(value: true); - cardTemplate2.NormalLifeLabelTemp.gameObject.SetActive(value: true); - } - cardTemplate2.FieldNormalMeshTemp.gameObject.SetActive(value: false); - cardTemplate2.CardNormalTemp.gameObject.SetActive(value: true); - } - parallelVfxPlayer.Register(orCreateBattleCard3.StopSpellCharge()); - if (orCreateBattleCard3.BattleCardView.BattleCardIconAnimations != null) - { - orCreateBattleCard3.BattleCardView.BattleCardIconAnimations.DeleteSkillIcons(); - } - orCreateBattleCard3.BattleCardView.CardTemplate.SkillIconTemp.gameObject.SetActive(value: false); - if (orCreateBattleCard3.BattleCardView is FieldBattleCardView fieldBattleCardView2 && fieldBattleCardView2.ChantCountIcon != null) - { - fieldBattleCardView2.ChantCountIcon.SetActive(value: false); - } - orCreateBattleCard3.SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier(); - orCreateBattleCard3.SkillApplyInformation.ClearUnionBurstAndSkyboundArtModifier(); - } - CardBasePrm.TribeInfo tribeInfo3 = new CardBasePrm.TribeInfo(cardInfo4.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE); - orCreateBattleCard3.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo3, showEffect: false); - orCreateBattleCard3.BattleCardView.HideCanPlayEffect(); - orCreateBattleCard3.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - } - List collection = GenerateUndisplayedCards(info[53.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer); - List collection2 = GenerateUndisplayedCards(info[54.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer); - List collection3 = GenerateUndisplayedCards(info[55.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer, isReservedCard: false, isBanish: true); - List collection4 = GenerateUndisplayedCards(info[57.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer); - List collection5 = GenerateUndisplayedCards(info[58.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer); - List collection6 = GenerateUndisplayedCards(info[59.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer, isReservedCard: true); - List collection7 = GenerateUndisplayedCards(info[60.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer); - List list6 = GenerateUndisplayedCards(info[61.ToString()], cardTotalNum, player.ChoiceBraveCardList, list5, player, parallelVfxPlayer); - player.cardTotalNum = info[62.ToString()].ToInt(); - for (int num5 = 0; num5 < list.Count; num5++) - { - if (list[num5].Index >= player.cardTotalNum) - { - RemoveCard(player, list[num5], isBuffed: false, isDebuffed: false); - destroyCardList.Add(list[num5]); - } - } - for (int num6 = 0; num6 < player.ChoiceBraveCardList.Count; num6++) - { - if (!list6.Contains(player.ChoiceBraveCardList[num6])) - { - destroyCardList.Add(player.ChoiceBraveCardList[num6]); - } - } - player.HandCardList.Clear(); - player.HandCardList.AddRange(list2); - player.ClassAndInPlayCardList.Clear(); - player.ClassAndInPlayCardList.AddRange(list3); - player.DeckCardList.Clear(); - player.DeckCardList.AddRange(list4); - player.CemeteryList.Clear(); - player.CemeteryList.AddRange(collection); - player.NecromanceZoneList.Clear(); - player.NecromanceZoneList.AddRange(collection2); - player.BanishList.Clear(); - player.BanishList.AddRange(collection3); - player.FusionIngredientList.Clear(); - player.FusionIngredientList.AddRange(list5); - player.GetOnList.Clear(); - player.GetOnList.AddRange(collection4); - player.UniteList.Clear(); - player.UniteList.AddRange(collection5); - player.ReservedCardList.Clear(); - player.ReservedCardList.AddRange(collection6); - player.BlackHole.Clear(); - player.BlackHole.AddRange(collection7); - player.ChoiceBraveCardList.Clear(); - player.ChoiceBraveCardList.AddRange(list6); - list = player.AllCardsWithSkillIngredient.ToList(); - JsonData playedCardList = info[101.ToString()]; - JsonData jsonData = info[102.ToString()]; - int i; - for (i = 0; i < playedCardList.Count; i++) - { - BattleCardBase battleCardBase = list.FirstOrDefault((BattleCardBase c) => c.Index == playedCardList[i].ToInt()); - int num7 = jsonData[i].ToInt(); - if (battleCardBase.CardId != num7) - { - CardParameter cardParameterFromId2 = CardMaster.GetInstanceForBattle().GetCardParameterFromId(num7); - battleCardBase = CreateBattleCard(num7, battleCardBase.IsPlayer, null, cardParameterFromId2, battleCardBase.SelfBattlePlayer, -1); - } - OperateMgr.BattleLogManager.AddLogDestFollower(BattleLogWindow.BattleLogType.PlayCardLog, battleCardBase, battleLogTextureInfoList); - } - JsonData destroyedCardList = info[103.ToString()]; - int i2; - for (i2 = 0; i2 < destroyedCardList.Count; i2++) - { - OperateMgr.BattleLogManager.AddLogDestFollower(BattleLogWindow.BattleLogType.Destruction, list.FirstOrDefault((BattleCardBase c) => c.Index == destroyedCardList[i2].ToInt()), battleLogTextureInfoList); - } - JsonData jsonData2 = info[104.ToString()]; - for (int num8 = 0; num8 < jsonData2.Count; num8++) - { - NetworkBattleReceiver.CardInfo cardInfo5 = networkReceiver.CreateCardInfo(jsonData2[num8]); - BattleCardBase battleCardBase2 = list.FirstOrDefault((BattleCardBase c) => c.Index == cardInfo5.Index); - bool flag = battleCardBase2.CardId != cardInfo5.Id; - if (flag) - { - CardParameter cardParameterFromId3 = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardInfo5.Id); - battleCardBase2 = CreateBattleCard(cardInfo5.Id, battleCardBase2.IsPlayer, null, cardParameterFromId3, battleCardBase2.SelfBattlePlayer, cardInfo5.Index); - } - BattleLogManager.GetInstance().AddFusionIngredients(battleCardBase2, !flag); - UpdateFusionCardInfo(cardInfo5, list5); - } - return parallelVfxPlayer; - } - - private void UpdateFusionIngredients(BattleCardBase fusionCard, NetworkBattleReceiver.CardInfo cardInfo, List fusionIngredientList) - { - fusionCard.SkillApplyInformation.FusionIngredients.Clear(); - if (cardInfo.FusionIngredientIdxList.Count <= 0) - { - return; - } - for (int i = 0; i < cardInfo.FusionIngredientIdxList.Count; i++) - { - BattleCardBase battleCardIdx = GetBattleCardIdx(fusionIngredientList, cardInfo.FusionIngredientIdxList[i]); - if (battleCardIdx != null) - { - fusionCard.SkillApplyInformation.AddFusionIngredientCard(battleCardIdx); - } - } - } - - private List GenerateUndisplayedCards(JsonData jsonData, int defaultCardTotalNum, List allCards, List fusionIngredientList, BattlePlayerBase player, ParallelVfxPlayer parallelVfx, bool isReservedCard = false, bool isBanish = false) - { - List list = new List(); - for (int i = 0; i < jsonData.Count; i++) - { - NetworkBattleReceiver.CardInfo cardInfo = networkReceiver.CreateCardInfo(jsonData[i]); - int index = cardInfo.Index; - if (index == -1) - { - continue; - } - BattleCardBase battleCardBase = GetOrCreateBattleCard(CardMaster.IsChoiceBraveCardCheck(cardInfo.Id) ? i : index, defaultCardTotalNum, allCards, player, cardInfo.Id); - if (fusionIngredientList != null) - { - UpdateFusionIngredients(battleCardBase, cardInfo, fusionIngredientList); - } - if (index < defaultCardTotalNum) - { - if (battleCardBase.IsInHand) - { - parallelVfx.Register(battleCardBase.SkillApplyInformation.AllSkillEffectStop()); - parallelVfx.Register(battleCardBase.StopSpellCharge()); - player.BattleView.HandView.RemoveCardFromViewWithoutRearrange(battleCardBase.BattleCardView); - battleCardBase.BattleCardView.GameObject.SetActive(value: false); - parallelVfx.Register(battleCardBase.UnloadResource()); - } - else if (battleCardBase.IsInplay) - { - parallelVfx.Register(battleCardBase.SkillApplyInformation.AllSkillEffectStop()); - player.BattleView.InPlayView.RemoveCardFromView(battleCardBase.BattleCardView); - battleCardBase.BattleCardView.GameObject.SetActive(value: false); - parallelVfx.Register(battleCardBase.UnloadResource()); - } - if (isReservedCard) - { - battleCardBase = player.CreateCard(cardInfo.Id, index); - } - } - if (isReservedCard) - { - UpdateSkillDescriptionValueList(battleCardBase, cardInfo); - } - if (isBanish) - { - battleCardBase.DeathTypeInfo.BanishDestroy = true; - } - list.Add(battleCardBase); - } - return list; - } - - public void SetSkillDescriptionValueList(List allCards, List cardInfoList) - { - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase battleCardIdx = GetBattleCardIdx(allCards, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardIdx, cardInfoList[i]); - } - } - - public void UpdateSkillDescriptionValueList(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - if (cardInfo.SkillDescriptionValueList != null) - { - card.ReplaySkillDescriptionValueList = cardInfo.SkillDescriptionValueList; - DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent(); - } - if (cardInfo.EvoSkillDescriptionValueList != null) - { - card.ReplayEvoSkillDescriptionValueList = cardInfo.EvoSkillDescriptionValueList; - DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent(); - } - } - - private void UpdateBuffDetailSkillDescriptionValueList(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - if (cardInfo.SkillDescriptionValueList != null) - { - card.ReplayBuffDetailSkillDescriptionValueList = cardInfo.SkillDescriptionValueList; - } - if (cardInfo.EvoSkillDescriptionValueList != null) - { - card.ReplayBuffDetailEvoSkillDescriptionValueList = cardInfo.EvoSkillDescriptionValueList; - } - if ((cardInfo.SkillDescriptionValueList != null || cardInfo.EvoSkillDescriptionValueList != null) && card.IsBuffDetail) - { - DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent(); - } - } - - public void UpdateParameterModifierAndCostView(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - int cost = card.Cost; - ClearAndUpdateParameterModifier(card, cardInfo); - int cost2 = (card.IsSelectedDuringSelectingBurialRiteTarget ? cost : card.Cost); - card.BattleCardView.UpdateCost(card.BattleCardView.GetUseCostList(cost2), isGenerateInHand: true, playEffect: false, isForceUpdate: true); - } - - public void ClearAndUpdateParameterModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - card.SkillApplyInformation.ClearParameterModifier(); - card.ClearCostModifier(); - UpdateParameterModifier(card, cardInfo); - } - - public void UpdateExecutedFixedUseCostIndex(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - card.ExecutedFixedUseCostIndex = cardInfo.ExecutedFixedUseCostIndex; - } - - public void UpdateUnionBurstAndSkyboundArtModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - card.SkillApplyInformation.ClearUnionBurstAndSkyboundArtModifier(); - UpdateUnionBurstModifier(card, cardInfo); - UpdateSkyboundArtModifier(card, cardInfo); - UpdateSuperSkyboundArtModifier(card, cardInfo); - } - - private void UpdateParameterModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - for (int i = 0; i < cardInfo.ParameterModifierList.Count; i++) - { - switch (cardInfo.ParameterModifierList[i].ModifierType) - { - case NetworkBattleReceiver.ReplayParameterModifierType.OffenseAddModifier: - card.SkillApplyInformation.AddOffenseModifier(new OffenseAddModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.OffenseSetModifier: - card.SkillApplyInformation.AddOffenseModifier(new OffenseSetModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.OffenseMultiplyModifier: - card.SkillApplyInformation.AddOffenseModifier(new OffenseMultiplyModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.LifeAddModifier: - card.SkillApplyInformation.AddLifeModifier(new LifeAddModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.LifeSetModifier: - card.SkillApplyInformation.AddLifeModifier(new LifeSetModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.LifeMultiplyModifier: - card.SkillApplyInformation.AddLifeModifier(new LifeMultiplyModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.MaxLifeAddModifier: - card.SkillApplyInformation.AddLifeModifier(new MaxLifeAddModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.MaxLifeSetModifier: - card.SkillApplyInformation.AddLifeModifier(new MaxLifeSetModifier(cardInfo.ParameterModifierList[i].ModifierValue)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.DamageCardParameterModifier: - card.SkillApplyInformation.AddLifeModifier(new DamageCardParameterModifier(cardInfo.ParameterModifierList[i].ModifierValue, -1, isSelfTurn: false)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.HealCardParameterModifier: - card.SkillApplyInformation.AddLifeModifier(new HealCardParameterModifier(cardInfo.ParameterModifierList[i].ModifierValue, -1, isSelfTurn: false)); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.CostHalfRoundUpModifier: - card.AddCostModifier(new CostHalfRoundUpModifier(isResidentModifier: false), null); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.CostAddModifier: - card.AddCostModifier(new CostAddModifier(cardInfo.ParameterModifierList[i].ModifierValue), null); - break; - case NetworkBattleReceiver.ReplayParameterModifierType.CostSetModifier: - card.AddCostModifier(new CostSetModifier(cardInfo.ParameterModifierList[i].ModifierValue), null); - break; - } - } - } - - private void UpdateUnionBurstModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - if (card.SkillApplyInformation is SkillApplyInformation skillApplyInformation) - { - for (int i = 0; i < cardInfo.UnionBurstModifierValueList.Count; i++) - { - skillApplyInformation.UnionBurstCountModifierList.Add(new UnionBurstCountAddModifier(cardInfo.UnionBurstModifierValueList[i])); - } - } - } - - private void UpdateSkyboundArtModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - if (card.SkillApplyInformation is SkillApplyInformation skillApplyInformation) - { - for (int i = 0; i < cardInfo.SkyboundArtModifierValueList.Count; i++) - { - skillApplyInformation.SkyboundArtCountModifierList.Add(new SkyboundArtCountAddModifier(cardInfo.SkyboundArtModifierValueList[i])); - } - } - } - - private void UpdateSuperSkyboundArtModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - if (card.SkillApplyInformation is SkillApplyInformation skillApplyInformation) - { - for (int i = 0; i < cardInfo.SuperSkyboundArtModifierValueList.Count; i++) - { - skillApplyInformation.SuperSkyboundArtCountModifierList.Add(new SuperSkyboundArtCountAddModifier(cardInfo.SuperSkyboundArtModifierValueList[i])); - } - } - } - - private void RemoveCard(BattlePlayerBase player, BattleCardBase card, bool isBuffed, bool isDebuffed) - { - player.DeckCardList.Remove(card); - if (player.HandCardList.Remove(card)) - { - ImmediateVfxMgr.GetInstance().Register(card.SkillApplyInformation.AllSkillEffectStop(isEvolve: false, isReturn: false, isBuffed, isDebuffed)); - player.BattleView.HandView.RemoveCardFromViewWithoutRearrange(card.BattleCardView); - card.BattleCardView.GameObject.SetActive(value: false); - } - if (player.ClassAndInPlayCardList.Remove(card)) - { - ImmediateVfxMgr.GetInstance().Register(card.SkillApplyInformation.AllSkillEffectStop(isEvolve: false, isReturn: false, isBuffed, isDebuffed)); - player.BattleView.InPlayView.RemoveCardFromView(card.BattleCardView); - card.BattleCardView.GameObject.SetActive(value: false); - } - player.CemeteryList.Remove(card); - player.BanishList.Remove(card); - player.FusionIngredientList.Remove(card); - player.NecromanceZoneList.Remove(card); - player.UniteList.Remove(card); - player.GetOnList.Remove(card); - player.BlackHole.Remove(card); - player.ChoiceBraveCardList.Remove(card); - } - - private BattleCardBase GetOrCreateBattleCard(int index, int defaultCardTotalNum, List allCards, BattlePlayerBase player, int cardId) - { - int cardIndex = index; - if (CardMaster.IsChoiceBraveCardCheck(cardId)) - { - if (allCards.Count() > index) - { - return allCards[index]; - } - cardIndex = 0; - } - else if (index < defaultCardTotalNum) - { - BattleCardBase battleCardBase = GetBattleCardIdx(allCards, index); - if (battleCardBase.CardId != cardId && battleCardBase.CardId != 0) - { - RemoveCard(player, battleCardBase, isBuffed: false, isDebuffed: false); - UnityEngine.Object.DestroyImmediate(battleCardBase.BattleCardView.GameObject); - battleCardBase = player.CreateCard(cardId, index); - } - return battleCardBase; - } - return player.CreateCard(cardId, cardIndex); - } - - private BattleCardBase CreateCardAndSetCardTotalNum(BattlePlayerBase player, int cardId, int index) - { - BattleCardBase result = player.CreateCard(cardId, index); - if (player.cardTotalNum <= index) - { - player.cardTotalNum = index + 1; - } - return result; - } - - public void TurnStart(BattlePlayerBase player) - { - player.IsSelfTurn = true; - if (player.IsPlayer) - { - _moveTurnButtonLabel.text = Data.SystemText.Get("Battle_0519", player.Turn.ToString()); - UpdateMoveTurnButton(player.Turn); - } - } - - public VfxBase TurnEnd() - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(new ThinkIconHideVfx(base.BattleResourceMgr)); - for (int i = 0; i < BattlePlayer.HandCardList.Count; i++) - { - BattleCardBase card = BattlePlayer.HandCardList[i]; - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView.HideCanPlayEffect(); - })); - } - for (int num = 0; num < BattlePlayer.InPlayCards.Count(); num++) - { - BattleCardBase card2 = BattlePlayer.InPlayCards.ElementAt(num); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - card2.BattleCardView.HideAttackFinished(); - })); - } - BattlePlayer.IsChoiceBraveEffectTiming = false; - BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - BattleEnemy.IsChoiceBraveEffectTiming = false; - BattleEnemy.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - return parallelVfxPlayer; - } - - public VfxBase AddPpTotal(BattleCardBase ownerCard, BattlePlayerBase player, int addPpTotalCount, int pp, bool playEffect = false) - { - int ppTotal = player.PpTotal; - player.PpTotal += addPpTotalCount; - int ppTotal2 = player.PpTotal; - player.Pp = pp; - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (playEffect) - { - parallelVfxPlayer.Register(new PpIncreaseVfx(player, ppTotal, ppTotal2)); - } - parallelVfxPlayer.Register(new PpChangeVfx(player)); - return parallelVfxPlayer; - } - - public VfxBase AddPp(BattleCardBase ownerCard, BattlePlayerBase player, int addPpCount) - { - player.Pp += addPpCount; - if (player.Pp < 0) - { - player.Pp = 0; - } - else if (player.Pp > 10) - { - player.Pp = 10; - } - if (player.PpTotal < player.Pp) - { - player.Pp = player.PpTotal; - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(new PpChangeVfx(player)); - return parallelVfxPlayer; - } - - public VfxBase AddBp(BattleCardBase ownerCard, BattlePlayerBase player, int addBpCount, bool isSelf) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(player.AddBp(addBpCount)); - if (addBpCount > 0) - { - parallelVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_ui_hbp_2", null, () => player.BattleView.GetBPLabelPosition(), 0f, Battle3DContainer.layer)); - if (isSelf) - { - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HBP_UP); - })); - } - } - else - { - parallelVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_ui_hbp_1", null, () => player.BattleView.GetBPLabelPosition(), 0f, Battle3DContainer.layer)); - } - return parallelVfxPlayer; - } - - public VfxBase EpModifier(BattleCardBase ownerCard, BattlePlayerBase player, int epCount, bool isAdd, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - int currentEpCount = player.CurrentEpCount; - if (isAdd) - { - if (epCount < 0) - { - epCount *= -1; - if (player.CurrentEpCount < epCount) - { - epCount = player.CurrentEpCount; - } - player.UseEpCount(epCount); - } - else - { - player.AddCurrentEpCount(epCount); - } - if (player.CurrentEpCount > player.EpTotal) - { - player.SetCurrentEpCount(player.EpTotal); - } - } - else - { - player.SetCurrentEpCount(epCount); - if (player.CurrentEpCount > player.EpTotal) - { - if (player.EpTotal == BattleManagerBase.FIRST_PLAYER_EP_NUM) - { - player.EpTotal = BattleManagerBase.SECOND_PLAYER_EP_NUM; - player.SetCurrentEpCount(BattleManagerBase.SECOND_PLAYER_EP_NUM); - parallelVfxPlayer.Register(player.StatusPanelControl.PlayIncreaseMaxEpAnimation(currentEpCount, player.CurrentEpCount)); - } - else - { - player.SetCurrentEpCount(player.EpTotal); - } - } - } - int currentEpCount2 = player.CurrentEpCount; - int epTotal = player.EpTotal; - parallelVfxPlayer.Register(new EpChangeVfx(player, currentEpCount, currentEpCount2, epTotal)); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, new List { player.Class }, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxWithLoadingSequential DrawCard(BattlePlayerBase player, List drawList, List cardInfoList) - { - for (int i = 0; i < drawList.Count; i++) - { - player.DeckCardList.Remove(drawList[i]); - if (player.HandCardList.Count >= 9) - { - player.CemeteryList.Add(drawList[i]); - } - else - { - player.HandCardList.Add(drawList[i]); - } - UpdateSkillDescriptionValueList(drawList[i], cardInfoList[i]); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(VfxWithLoading.Create(LoadCardResources(drawList))); - return vfxWithLoadingSequential; - } - - public VfxWithLoading TokenDrawCard(BattlePlayerBase player, BattleCardBase ownerCard, List cardInfoList, List targets, bool isOpen, bool isReserved, NetworkBattleReceiver.EffectInfo effectInfo) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - List list = new List(); - int i; - for (i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase battleCardBase = null; - if (isReserved) - { - battleCardBase = player.ReservedCardList.FirstOrDefault((BattleCardBase c) => c.Index == cardInfoList[i].Index); - player.ReservedCardList.Remove(battleCardBase); - } - if (battleCardBase == null) - { - battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index); - } - UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - battleCardBase.SetOnDraw(draw: true); - if (player.HandCardList.Count >= 9) - { - player.CemeteryList.Add(battleCardBase); - } - else - { - player.HandCardList.Add(battleCardBase); - } - list.Add(battleCardBase); - } - vfxWithLoadingSequential.RegisterVfxWithLoading(VfxWithLoading.Create(LoadCardResources(list))); - if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT)) - { - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targets, effectInfo)); - } - VfxWithLoading vfxWithLoading = player.CreateTokenSpawnVfx(list[0]); - vfxWithLoadingSequential.RegisterToMainVfx(new DrawTokenVfx(list, vfxWithLoading.MainVfx, player, isOpen)); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - return vfxWithLoadingSequential; - } - - public VfxWithLoading CreateReservedCard(BattlePlayerBase player, BattleCardBase ownerCard, List cardInfoList) - { - List list = new List(); - int i; - for (i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase battleCardBase = player.AllCardsWithSkillIngredient.FirstOrDefault((BattleCardBase c) => c.Index == cardInfoList[i].Index); - if (battleCardBase != null) - { - UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - list.Add(battleCardBase); - continue; - } - battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - list.Add(battleCardBase); - player.ReservedCardList.Add(battleCardBase); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list)); - return vfxWithLoadingSequential; - } - - public VfxWith ReplaceReceivedCard(BattleCardBase originalCard, NetworkBattleReceiver.CardInfo cardInfo, BattlePlayerBase player, bool isFusion, bool isSideLog = false) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (originalCard.CardId == cardInfo.Id) - { - ReflectCardInfoData(originalCard, cardInfo, isSideLog); - return new VfxWith(vfxWithLoadingSequential, originalCard); - } - BattleCardBase battleCardBase = CreateBattleCardWithGameObject(player, cardInfo.Id, cardInfo.Cost, originalCard.Index); - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(new List { battleCardBase })); - ReflectCardInfoData(battleCardBase, cardInfo, isSideLog); - battleCardBase.SkillApplyInformation.AddFusionIngredients(originalCard.SkillApplyInformation.FusionIngredients); - CardBasePrm.TribeInfo tribeInfo = new CardBasePrm.TribeInfo(cardInfo.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE); - battleCardBase.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo, showEffect: false); - if (originalCard.IsInHand) - { - player.HandCardList[player.HandCardList.IndexOf(originalCard)] = battleCardBase; - sequentialVfxPlayer.Register(CreateReplaceDummyCardVfx(originalCard, battleCardBase, player, isFusion)); - } - else if (originalCard.IsInDeck) - { - player.DeckCardList[player.DeckCardList.IndexOf(originalCard)] = battleCardBase; - } - else if (originalCard.IsInCemetery) - { - player.CemeteryList[player.CemeteryList.IndexOf(originalCard)] = battleCardBase; - } - vfxWithLoadingSequential.RegisterToMainVfx(sequentialVfxPlayer); - return new VfxWith(vfxWithLoadingSequential, battleCardBase); - } - - public void ReflectCardInfoData(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo, bool isSideLog) - { - if (!isSideLog) - { - UpdateSkillDescriptionValueList(card, cardInfo); - } - card.SetSpellChargeCount(cardInfo.SpellChargeCount); - card.SkillApplyInformation.ClearParameterModifier(); - UpdateParameterModifier(card, cardInfo); - UpdateExecutedFixedUseCostIndex(card, cardInfo); - UpdateUnionBurstAndSkyboundArtModifier(card, cardInfo); - } - - private BattleCardBase CreateBattleCardWithGameObject(BattlePlayerBase battlePlayer, int id, int cost, int index) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(id); - int cardIndex = SetupCardIndex(battlePlayer, index); - GameObject cardGameObject = CreateBaseCardGameObject(cardParameterFromId, battlePlayer.IsPlayer, cardIndex); - BattleCardBase battleCardBase = CreateBattleCard(id, battlePlayer.IsPlayer, cardGameObject, cardParameterFromId, battlePlayer, cardIndex, cost); - SetupCardObjectMaterials(cardGameObject, battleCardBase); - return battleCardBase; - } - - private VfxBase CreateReplaceDummyCardVfx(BattleCardBase originalDummyCard, BattleCardBase receivedCard, BattlePlayerBase battlePlayer, bool isFusion) - { - IBattleCardView dummyCardView = originalDummyCard.BattleCardView; - if (isFusion) - { - ReplaceDummyCard(dummyCardView, receivedCard, battlePlayer); - } - return InstantVfx.Create(delegate - { - if (!isFusion) - { - ReplaceDummyCard(dummyCardView, receivedCard, battlePlayer); - } - UnityEngine.Object.DestroyImmediate(dummyCardView.GameObject); - }); - } - - private void ReplaceDummyCard(IBattleCardView dummyCardView, BattleCardBase receivedCard, BattlePlayerBase battlePlayer) - { - receivedCard.BattleCardView.GameObject.transform.parent = dummyCardView.GameObject.transform.parent; - receivedCard.BattleCardView.GameObject.transform.localPosition = dummyCardView.GameObject.transform.localPosition; - receivedCard.BattleCardView.GameObject.transform.localScale = dummyCardView.GameObject.transform.localScale; - receivedCard.BattleCardView.GameObject.transform.localRotation = dummyCardView.GameObject.transform.localRotation; - battlePlayer.BattleView.HandView.ReplaceCardInViewWithoutRearrange(dummyCardView, receivedCard.BattleCardView); - receivedCard.BattleCardView.GameObject.SetActive(value: true); - receivedCard.BattleCardView.GameObject.GetComponent().CardNormalTemp.gameObject.SetActive(value: true); - } - - public BattleCardBase CreateTransformCard(BattlePlayerBase player, BattleCardBase playCard, int transformCardId, SequentialVfxPlayer sequentialVfx, bool isMutation) - { - BattleCardBase transformCard = player.CreateCard(transformCardId, playCard.Index); - transformCard.ReplaySkillDescriptionValueList = playCard.ReplaySkillDescriptionValueList; - transformCard.ReplayEvoSkillDescriptionValueList = playCard.ReplayEvoSkillDescriptionValueList; - transformCard.ReplayBuffDetailSkillDescriptionValueList = playCard.ReplayBuffDetailSkillDescriptionValueList; - transformCard.ReplayBuffDetailEvoSkillDescriptionValueList = playCard.ReplayBuffDetailEvoSkillDescriptionValueList; - base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - transformCard.BattleCardView.GameObject.SetActive(value: false); - })); - sequentialVfx.Register(InstantVfx.Create(delegate - { - Transform transform = transformCard.BattleCardView.Transform; - Transform transform2 = playCard.BattleCardView.Transform; - transform.position = transform2.position; - transform.rotation = transform2.rotation; - transform.parent = player.BattleView.HandDeck.transform; - transform.localScale = transform2.localScale; - transform.SetSiblingIndex(transform2.GetSiblingIndex()); - if (!isMutation) - { - transformCard.BattleCardView.CardTemplate.DynamicSetupMaterials(transformCard, base.BattleResourceMgr); - playCard.BattleCardView.GameObject.SetActive(value: false); - transformCard.BattleCardView.GameObject.SetActive(value: true); - } - })); - transformCard.SetOnDraw(draw: false); - return transformCard; - } - - public VfxBase SetupTransformCard(BattleCardBase playCard, BattleCardBase originalCard, bool isMutation, bool isLoadResource = false) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (isMutation || isLoadResource) - { - sequentialVfxPlayer.Register(LoadCardResources(new List { playCard })); - } - base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - originalCard.SelfBattlePlayer.BattleView.HandView.RemoveCardFromView(originalCard.BattleCardView, 0.3f); - })); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - playCard.SelfBattlePlayer.BattleView.PlayQueueView.RemoveCardFromView(originalCard.BattleCardView, isMutation); - if (isMutation) - { - playCard.BattleCardView.CardTemplate.DynamicSetupMaterials(playCard, base.BattleResourceMgr); - } - })); - if (!isMutation) - { - sequentialVfxPlayer.Register(OperateMgr.InitSetCard(playCard, playCard.SelfBattlePlayer.IsPlayer, isSelect: false, isRecovery: false, isChoiceSelect: true)); - } - else - { - bool isChoice = playCard.Skills.Any((SkillBase s) => s is Skill_choice); - sequentialVfxPlayer.Register(playCard.SelfBattlePlayer.BattleView.PlayQueueView.InstantAddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isChoice)); - if (isMutation) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - Vector3 position = originalCard.BattleCardView.GameObject.transform.position; - position += ActionProcessor.ACCELERATE_POSITION_OFFSET; - Quaternion rot = originalCard.BattleCardView.GameObject.transform.rotation; - if (!playCard.IsSpell && playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView)) - { - Vector3 localEulerAngles = originalCard.BattleCardView.GameObject.transform.localEulerAngles; - rot = Quaternion.Euler(localEulerAngles.x, 0f, localEulerAngles.z); - } - GameMgr.GetIns().GetEffectMgr().Start(playCard.IsSpell ? EffectMgr.EffectType.CMN_CARD_ACCELERATE_1 : EffectMgr.EffectType.CMN_CARD_CRYSTALLIZE_1, playCard.IsSpell ? position : originalCard.BattleCardView.GameObject.transform.position, rot, 31); - })); - sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.2f)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - CardTemplate cardTemplate = originalCard.BattleCardView.CardTemplate; - cardTemplate.SetEffectStyle(UILabel.Effect.None); - if (originalCard is UnitBattleCard) - { - cardTemplate.NormalAtkLabelTemp.effectStyle = UILabel.Effect.None; - cardTemplate.NormalLifeLabelTemp.effectStyle = UILabel.Effect.None; - } - })); - sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0f)); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (isMutation) - { - Transform transform = playCard.BattleCardView.Transform; - Transform transform2 = originalCard.BattleCardView.Transform; - if (playCard.IsSpell || playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView)) - { - MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 31); - playCard.BattleCardView.Transform.SetParent(CutInContainer.transform, worldPositionStays: false); - } - if (playCard.IsSpell) - { - transform.position = transform2.position; - transform.localScale = transform2.localScale; - originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); - originalCard.BattleCardView.GameObject.SetActive(value: false); - playCard.BattleCardView.GameObject.SetActive(value: true); - playCard.BattleCardView.ShowInHandFrameEffect(enable: true, HandCardFrameEffectType.LIGHT_BLUE); - originalCard.BattleCardView.CardTemplate.SetEffectStyle(UILabel.Effect.None); - } - else - { - transform.position = transform2.position; - transform.localScale = transform2.localScale; - originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); - originalCard.BattleCardView.GameObject.SetActive(value: false); - playCard.BattleCardView.GameObject.SetActive(value: true); - originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); - } - } - })); - if (isMutation) - { - sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.3f)); - if (!playCard.IsSpell) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - originalCard.BattleCardView.GameObject.SetActive(value: false); - MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 10); - })); - } - } - } - return sequentialVfxPlayer; - } - - public List CreateChoiceTokenCards(BattleCardBase actCard, List choiceCardIdList, IBattlePlayerView playerBattleView) - { - List list = new List(); - for (int i = 0; i < choiceCardIdList.Count; i++) - { - BattleCardBase battleCardBase = CreateTransformCardRegisterVfx(actCard, choiceCardIdList[i], isPlayer: true); - list.Add(battleCardBase); - Transform transform = battleCardBase.BattleCardView.GameObject.transform; - transform.localPosition = Vector3.zero; - transform.localEulerAngles = Vector3.zero; - } - playerBattleView.RegisterPlayCard(actCard); - return list; - } - - public VfxBase CreatePick(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo) - { - if (card is SpellBattleCard) - { - return new StartPlaySpellVfx(card.BattleCardView, card); - } - return new StartSummonCardVfx(card.BattleCardView, base.BattleResourceMgr, card, cardInfo); - } - - public void DeckCardToField(BattlePlayerBase player, BattleCardBase targetCard) - { - player.ClassAndInPlayCardList.Add(targetCard); - player.DeckCardList.Remove(targetCard); - } - - public void HandCardToField(BattlePlayerBase player, BattleCardBase targetCard) - { - player.ClassAndInPlayCardList.Add(targetCard); - player.HandCardList.Remove(targetCard); - } - - public void HandCardToCemetery(BattlePlayerBase player, BattleCardBase targetCard) - { - player.HandCardList.Remove(targetCard); - player.CemeteryList.Add(targetCard); - } - - private VfxBase CardToCemetery(BattlePlayerBase player, BattleCardBase targetCard) - { - if (player.ClassAndInPlayCardList.Contains(targetCard)) - { - player.ClassAndInPlayCardList.Remove(targetCard); - } - else if (player.HandCardList.Contains(targetCard)) - { - player.HandCardList.Remove(targetCard); - } - player.CemeteryList.Add(targetCard); - return SequentialVfxPlayer.Create(targetCard.UnloadResource()); - } - - private VfxBase CardToBanishZone(BattlePlayerBase player, BattleCardBase targetCard) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (targetCard.IsInplay) - { - player.ClassAndInPlayCardList.Remove(targetCard); - } - else if (targetCard.IsInHand) - { - player.HandCardList.Remove(targetCard); - } - else if (targetCard.IsInDeck) - { - player.DeckCardList.Remove(targetCard); - sequentialVfxPlayer.Register(new DeckChangeVfx(player)); - sequentialVfxPlayer.Register(new DummyDeckRemoveCardVfx(player.IsPlayer, 1)); - } - player.BanishList.Add(targetCard); - sequentialVfxPlayer.Register(targetCard.UnloadResource()); - return sequentialVfxPlayer; - } - - private VfxBase CardToVehicleZone(BattlePlayerBase player, BattleCardBase targetCard) - { - player.ClassAndInPlayCardList.Remove(targetCard); - player.GetOnList.Add(targetCard); - return SequentialVfxPlayer.Create(targetCard.UnloadResource()); - } - - private void FieldCardToHand(BattlePlayerBase player, BattleCardBase targetCard) - { - player.ClassAndInPlayCardList.Remove(targetCard); - player.InHandCards.Add(targetCard); - player.HandCardList.Add(targetCard); - } - - private VfxBase CardToUniteZone(BattleCardBase targetCard) - { - targetCard.SelfBattlePlayer.ClassAndInPlayCardList.Remove(targetCard); - targetCard.SelfBattlePlayer.BanishList.Add(targetCard); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(targetCard.UnloadResource()); - return sequentialVfxPlayer; - } - - private void DestroyCard(ParallelVfxPlayer parallelVfx, BattleCardBase card, NetworkBattleReceiver.DestroyType destroyType) - { - SetDestroyType(card, destroyType); - if (card.IsUnit) - { - BattleLogManager.GetInstance().AddLogDestFollower(BattleLogWindow.BattleLogType.Destruction, card); - } - parallelVfx.Register(CardToCemetery(card.SelfBattlePlayer, card)); - parallelVfx.Register(DestroyCard(card)); - if (card.IsChoiceEvolutionCard) - { - parallelVfx.Register(InstantVfx.Create(delegate - { - card.UpdateBuildInfoAndSkillCollection(card.BaseParameter.BaseCardId, card.BaseParameter.IsFoil, isNotUpdateAtkLife: true); - })); - } - } - - private void BanishCard(ParallelVfxPlayer parallelVfx, BattleCardBase card) - { - card.DeathTypeInfo.BanishDestroy = true; - parallelVfx.Register(CreateBanish(card)); - parallelVfx.Register(CardToBanishZone(card.SelfBattlePlayer, card)); - if (card.IsChoiceEvolutionCard) - { - parallelVfx.Register(InstantVfx.Create(delegate - { - card.UpdateBuildInfoAndSkillCollection(card.BaseParameter.BaseCardId, card.BaseParameter.IsFoil, isNotUpdateAtkLife: true); - })); - } - } - - public void ReplaceInHand(BattlePlayerBase player, BattleCardBase originalCard, BattleCardBase newCard) - { - player.HandCardList.Insert(player.HandCardList.IndexOf(originalCard), newCard); - player.HandCardList.Remove(originalCard); - } - - public VfxBase ReplaceInPlay(BattlePlayerBase player, BattleCardBase originalCard, BattleCardBase newCard) - { - player.ClassAndInPlayCardList.Insert(player.ClassAndInPlayCardList.IndexOf(originalCard), newCard); - player.ClassAndInPlayCardList.Remove(originalCard); - return originalCard.RemoveFromInPlay(); - } - - public VfxWithLoading SummonToken(BattlePlayerBase player, BattleCardBase ownerCard, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo, bool isOwnerEffect, bool isIgnoreVoice, bool isRandomVoice, bool isEvoVoice) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList(); - List list = new List(); - for (int i = 0; i < cardInfoList.Count; i++) - { - if (!cardInfoList[i].IsOverflow) - { - BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - player.ClassAndInPlayCardList.Add(battleCardBase); - sequentialVfxPlayer.Register(battleCardBase.SetUpInplay()); - summonedCardsList.AddCardToSummonedCards(battleCardBase, isOwnerEffect); - list.Add(battleCardBase); - } - else - { - BattleCardBase battleCardBase2 = player.CreateCard(cardInfoList[i].Id, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardBase2, cardInfoList[i]); - summonedCardsList.AddCardToOverflowCards(battleCardBase2, isOwnerEffect); - list.Add(battleCardBase2); - } - } - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list)); - if (effectInfo != null) - { - VfxWithLoading vfxWithLoadingToRegister = (effectInfo.IsTargetPosition ? CreateOwnerSummonSkillEffect(ownerCard, summonedCardsList, effectInfo) : CreateSkillEffect(ownerCard, summonedCardsList, effectInfo)); - vfxWithLoadingSequential.RegisterVfxWithLoading(vfxWithLoadingToRegister); - } - bool isSeSysSummonLandingDuplicateCheck = Global.SeSysSummonLandingDuplicateCheckId.Contains(ownerCard.BaseParameter.BaseCardId); - StartPickMultiCardVfx vfxToRegister = new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true, isIgnoreVoice, isRandomVoice, isGetoff: false, isEvoVoice, -1f, null, isSeSysSummonLandingDuplicateCheck); - vfxWithLoadingSequential.RegisterToMainVfx(vfxToRegister); - vfxWithLoadingSequential.RegisterToMainVfx(sequentialVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxWithLoading SummonCard(BattlePlayerBase player, BattleCardBase ownerCard, List targets, bool isDeckSelf, bool isBurialRite, NetworkBattleReceiver.EffectInfo effectInfo, bool isIgnoreVoice, List cardInfoList) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList(); - for (int i = 0; i < targets.Count; i++) - { - if (isBurialRite) - { - sequentialVfxPlayer.Register(targets[i].SkillApplyInformation.AllSkillEffectStop()); - targets.ElementAt(i).SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier(); - } - if (targets[i].IsInHand) - { - HandCardToField(player, targets[i]); - sequentialVfxPlayer.Register(Skill_summon_card.RemoveHandCardFromViewVfx(targets[i], player, isBurialRite: false)); - sequentialVfxPlayer.Register(targets[i].StopSpellCharge()); - } - else if (targets[i].IsInDeck) - { - DeckCardToField(player, targets[i]); - sequentialVfxPlayer2.Register(new DeckChangeVfx(player)); - sequentialVfxPlayer2.Register(new DummyDeckRemoveCardVfx(player.IsPlayer, 1)); - } - summonedCardsList.AddCardToSummonedCards(targets[i], !isDeckSelf); - sequentialVfxPlayer2.Register(targets[i].SetUpInplay()); - targets[i].BattleCardView.SetNormalLabelEnable(isEnable: true); - if (cardInfoList != null) - { - UpdateSkillDescriptionValueList(targets[i], cardInfoList[i]); - } - } - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(targets)); - VfxWithLoading vfxWithLoading = VfxWithLoadingSequential.Create(); - if (effectInfo != null) - { - vfxWithLoading = (effectInfo.IsTargetPosition ? CreateOwnerSummonSkillEffect(ownerCard, summonedCardsList, effectInfo) : CreateSkillEffect(ownerCard, summonedCardsList, effectInfo)); - } - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true, isIgnoreVoice, isRandomVoice: false, isGetoff: false, isEvoVoice: false, -1f, cardInfoList)); - if (isDeckSelf) - { - BattleCardBase battleCardBase = targets.First(); - sequentialVfxPlayer.Register(new DeckSelfSummonVfx(battleCardBase, base.BattleResourceMgr)); - parallelVfxPlayer.Register(new SummonCardShakeCameraVfx(battleCardBase)); - } - sequentialVfxPlayer.Register(vfxWithLoading.MainVfx); - sequentialVfxPlayer.Register(parallelVfxPlayer); - sequentialVfxPlayer.Register(sequentialVfxPlayer2); - vfxWithLoadingSequential.RegisterToMainVfx(sequentialVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxBase AttackStart(BattlePlayerBase player, BattleCardBase attackCard, BattleCardBase targetCard) - { - attackCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - AttackSelectControl attackSelectControl = player.BattleView.AttackSelectControl; - AttackSelectControl.AttackPair attackPair = new AttackSelectControl.AttackPair(attackCard.BattleCardView, targetCard.BattleCardView); - attackPair._attackTarget._isReady = !attackSelectControl.IsCardTranslatable(targetCard.BattleCardView); - attackSelectControl.RegisterAttackPair(attackPair); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new AttackSelectControl.WaitUntilAttackPairIsReadyVfx(attackPair)); - sequentialVfxPlayer.Register(attackCard.SelfBattlePlayer.BattleView.CreateStopAttackFloatVfx(attackCard.BattleCardView)); - sequentialVfxPlayer.Register(targetCard.SelfBattlePlayer.BattleView.CreateStopAttackFloatVfx(targetCard.BattleCardView)); - return sequentialVfxPlayer; - } - - public VfxBase Attack(BattlePlayerBase player, BattleCardBase attackCard, BattleCardBase targetCard, int dealDamage, int receiveDamage, List destroyList, List destroyTypeList, List banishList, int drain, NetworkBattleReceiver.CardInfo attackCardInfo, List sideLogSkillInfoList, bool isAttackerDead, bool isTargetDead) - { - AttackSelectControl attackSelectControl = player.BattleView.AttackSelectControl; - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(attackSelectControl.RemoveAttackPairVfx(attackCard.BattleCardView, targetCard.BattleCardView)); - if (isAttackerDead || isTargetDead || attackCard.SelfBattlePlayer.Class.IsDead || targetCard.SelfBattlePlayer.Class.IsDead || !attackCard.IsInplay || !targetCard.IsInplay) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (!isAttackerDead && attackCard.IsInplay) - { - IBattleCardView battleCardView = attackCard.BattleCardView; - parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView)); - } - if (!isTargetDead && targetCard.IsInplay) - { - IBattleCardView battleCardView2 = targetCard.BattleCardView; - parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView2)); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - return sequentialVfxPlayer; - } - targetCard.SkillApplyInformation.DamageLife(dealDamage, base.CurrentTurn, player.IsSelfTurn); - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - if (attackCard.SkillApplyInformation.IsSneak) - { - sequentialVfxPlayer2.Register(attackCard.SkillApplyInformation.FourceDepriveSneak()); - } - sequentialVfxPlayer2.Register(attackCard.VfxCreator.CreateAttack(attackCard.BattleCardView, targetCard.BattleCardView)); - SequentialVfxPlayer sequentialVfxPlayer3 = SequentialVfxPlayer.Create(sequentialVfxPlayer2, targetCard.VfxCreator.CreateDamage(dealDamage, targetCard.Life, targetCard.MaxLife, targetCard.BaseMaxLife, isReflectedDamage: false, IsSkillDamage: false)); - if (targetCard is UnitBattleCard) - { - attackCard.SkillApplyInformation.DamageLife(receiveDamage, base.CurrentTurn, player.IsSelfTurn); - } - SequentialVfxPlayer sequentialVfxPlayer4 = SequentialVfxPlayer.Create(WaitVfx.Create(0.4f), (targetCard is UnitBattleCard) ? targetCard.VfxCreator.CreateAttack(targetCard.BattleCardView, attackCard.BattleCardView) : NullVfx.GetInstance()); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create((targetCard is UnitBattleCard) ? attackCard.VfxCreator.CreateDamage(receiveDamage, attackCard.Life, attackCard.MaxLife, attackCard.BaseMaxLife, isReflectedDamage: false, IsSkillDamage: false) : NullVfx.GetInstance()); - if (drain != -1) - { - BattleCardBase target = attackCard.SelfBattlePlayer.Class; - SequentialVfxPlayer sequentialVfxPlayer5 = SequentialVfxPlayer.Create(); - sequentialVfxPlayer5.Register(WaitVfx.Create(0.3f)); - target.SkillApplyInformation.HealLife(drain, base.CurrentTurn, BattlePlayer.IsSelfTurn); - sequentialVfxPlayer5.Register(target.VfxCreator.CreateHealing(drain, target.Life, target.MaxLife, target.BaseMaxLife)); - EffectBattle effectBattle = null; - Vector3 effectPosition = target.BattleCardView.CardWrapObject.transform.position; - sequentialVfxPlayer5.Register(new SkillBase.WaitEffectLoadVfx("btl_magic_cure_1", EffectMgr.EngineType.SHURIKEN, "se_btl_magic_cure_1", base.BattleResourceMgr, delegate(EffectBattle eb) - { - effectBattle = eb; - })); - sequentialVfxPlayer5.Register(new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, target.BattleCardView, base.BattleResourceMgr, () => effectPosition, () => effectPosition, 0f, 0.2f, EffectMgr.MoveType.NONE, target.SelfBattlePlayer.IsPlayer, Color.clear))); - parallelVfxPlayer2.Register(sequentialVfxPlayer5); - } - sequentialVfxPlayer4.Register(parallelVfxPlayer2); - sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(sequentialVfxPlayer3, sequentialVfxPlayer4)); - ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer4 = ParallelVfxPlayer.Create(); - int num = destroyList.IndexOf(attackCard); - if (num > -1 || banishList.IndexOf(attackCard) > -1) - { - if (attackCard.Life > 0) - { - attackCard.FlagCardAsDestroyedByKiller(); - } - if (num > -1) - { - DestroyCard(parallelVfxPlayer4, attackCard, destroyTypeList[num]); - } - else - { - BanishCard(parallelVfxPlayer4, attackCard); - } - if (!destroyList.Contains(targetCard)) - { - attackCard.BattleCardView.playVoiceOnDeath = true; - attackCard.BattleCardView.VoiceInfo.SetDestroyCardId(targetCard.BaseParameter.BaseCardId); - } - parallelVfxPlayer3.Register(player.BattleView.CreateStopAttackFloatVfx(attackCard.BattleCardView)); - } - else - { - parallelVfxPlayer3.Register(attackSelectControl.ResetCardAfterAttack(attackCard.BattleCardView)); - } - int num2 = destroyList.IndexOf(targetCard); - if (num2 > -1 || banishList.IndexOf(targetCard) > -1) - { - if (targetCard.Life > 0) - { - targetCard.FlagCardAsDestroyedByKiller(); - } - if (num2 > -1) - { - DestroyCard(parallelVfxPlayer4, targetCard, destroyTypeList[num2]); - } - else - { - BanishCard(parallelVfxPlayer4, targetCard); - } - targetCard.BattleCardView.playVoiceOnDeath = true; - targetCard.BattleCardView.VoiceInfo.SetDestroyCardId(attackCard.BaseParameter.BaseCardId); - parallelVfxPlayer3.Register(targetCard.SelfBattlePlayer.BattleView.CreateStopAttackFloatVfx(attackCard.BattleCardView)); - } - else - { - parallelVfxPlayer3.Register(attackSelectControl.ResetCardAfterAttack(targetCard.BattleCardView)); - } - sequentialVfxPlayer.Register(CreateSkillSideLog(sideLogSkillInfoList)); - sequentialVfxPlayer.Register(SequentialVfxPlayer.Create(parallelVfxPlayer3, parallelVfxPlayer4)); - attackCard.AttackableOnReplay = attackCardInfo.Attackable; - attackCard.IsCantAttackClassOnReplay = attackCardInfo.IsCantAttackClass; - attackCard.AttackableCount = attackCardInfo.AttackableCount; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - attackCard.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); - })); - bool num3 = attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl.IsShow && attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl._card == attackCard; - bool flag = attackCard.SelfBattlePlayer.IsSelfTurn && attackCard.IsPlayer && attackCard.IsInplay && attackCard.AttackableCount <= 0; - if (num3 && flag) - { - sequentialVfxPlayer.Register(attackCard.BattleCardView.ShowAttackFinished()); - } - return sequentialVfxPlayer; - } - - public VfxBase SkillEvolve(BattleCardBase ownerCard, List allCards, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo, int evolveMeWhenAttackIndex) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create(); - float num = 0f; - for (int i = 0; i < cardInfoList.Count; i++) - { - NetworkBattleReceiver.CardInfo cardInfo = cardInfoList[i]; - BattleCardBase targetCard = GetBattleCardIdx(allCards, cardInfoList[i].Index); - VfxWith> vfxWith = SkillEvolveVfx.LoadCardEvolveResources(targetCard, base.BattleResourceMgr); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(WaitVfx.Create(num)); - VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCard.AsIEnumerable(), effectInfo); - parallelVfxPlayer.Register(vfxWithLoading.LoadingVfx); - sequentialVfxPlayer.Register(vfxWithLoading.MainVfx); - sequentialVfxPlayer.Register(targetCard.SkillApplyInformation.AllSkillEffectStop(isEvolve: true)); - parallelVfxPlayer3.Register(InstantVfx.Create(delegate - { - targetCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - })); - (targetCard as UnitBattleCard).Evolution(); - bool evolveMeWhenAttack = targetCard.Index == evolveMeWhenAttackIndex; - sequentialVfxPlayer.Register(new SkillEvolveVfx(targetCard, base.BattleResourceMgr, vfxWith.Value, ownerCard, evolveMeWhenAttack)); - sequentialVfxPlayer.Register(targetCard.SkillApplyInformation.UpdateAllSkillEffectInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true)); - sequentialVfxPlayer.Register(targetCard.SkillApplyInformation.AllSkillEffectRestart()); - targetCard.AttackableOnReplay = cardInfo.Attackable; - targetCard.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - targetCard.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); - })); - parallelVfxPlayer2.Register(sequentialVfxPlayer); - parallelVfxPlayer.Register(vfxWith.Vfx); - num += 0.05f; - } - VfxBase vfxToRegister = UIManager.GetInstance().CreateNowLoadingVfx(parallelVfxPlayer); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer3, parallelVfxPlayer2); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxToRegister); - return vfxWithLoadingSequential; - } - - public VfxBase ChoiceEvolve(BattleCardBase card, int choiceEvolutionId) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - UnitBattleCardView unitBattleCardView = card.BattleCardView as UnitBattleCardView; - parallelVfxPlayer.Register(base.BattleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: false))); - parallelVfxPlayer.Register(base.BattleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: true))); - card.UpdateBuildInfoAndSkillCollection(choiceEvolutionId, isFoil: false); - card.BattleCardView.InitializeVoiceInfo(card.CardId); - for (int i = 0; i < card.NormalSkills.Count(); i++) - { - card.NormalSkills.ElementAt(i).SetInductionVoiceIndex(); - } - for (int j = 0; j < card.EvolutionSkills.Count(); j++) - { - card.EvolutionSkills.ElementAt(j).SetInductionVoiceIndex(); - } - parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: false)); - parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: true)); - return parallelVfxPlayer; - } - - public VfxBase CostChange(BattleCardBase ownerCard, List targetCards, List addCostList, List setCostList, List isCostUpList, bool isHalf, bool isSpellCharge, bool isOpenCard, NetworkBattleReceiver.EffectInfo effectInfo) - { - List list = new List(); - if (isHalf) - { - list.Add(new CostHalfRoundUpModifier(isResidentModifier: false)); - } - else if (addCostList.Count > 0) - { - for (int i = 0; i < addCostList.Count; i++) - { - list.Add(new CostAddModifier(addCostList[i])); - } - } - else if (setCostList.Count > 0) - { - for (int j = 0; j < setCostList.Count; j++) - { - list.Add(new CostSetModifier(setCostList[j])); - } - } - for (int k = 0; k < targetCards.Count; k++) - { - BattleCardBase battleCardBase = targetCards[k]; - ICardCostModifier modifier = ((list.Count > k) ? list[k] : list.LastOrDefault()); - battleCardBase.AddCostModifier(modifier, null); - } - CostChangeVfx costChangeVfx = new CostChangeVfx(targetCards.ToList(), isSpellCharge, isCostUpList, isStop: false); - if (effectInfo != null && effectInfo.EffectMoveType == EffectMgr.MoveType.DIRECT_HAND) - { - if (ownerCard.IsPlayer) - { - targetCards = new List { ownerCard.OpponentBattlePlayer.Class }; - } - else - { - targetCards.Clear(); - } - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo)); - vfxWithLoadingSequential.RegisterToLoadingVfx(costChangeVfx.LoadingVfx); - vfxWithLoadingSequential.RegisterToMainVfx(costChangeVfx.MainVfx); - if (isOpenCard) - { - vfxWithLoadingSequential.RegisterToMainVfx((BattlePlayer as ReplayBattlePlayer).OpenCard(targetCards[0])); - } - return vfxWithLoadingSequential; - } - - public VfxBase RemoveCostChange(List targetCards, List removeCostChangeIndexList, bool isSpellCharge, bool isAdd) - { - List list = new List(); - List list2 = new List(); - for (int i = 0; i < targetCards.Count; i++) - { - if (removeCostChangeIndexList[i] >= 0 && targetCards[i] != null && removeCostChangeIndexList[i] < targetCards[i].CostModifierList.Count) - { - list.Add(targetCards[i].CostModifierList[removeCostChangeIndexList[i]]); - list2.Add(targetCards[i]); - } - } - for (int j = 0; j < list.Count; j++) - { - list2[j].CostModifierList.Remove(list[j]); - } - return new CostChangeVfx(list2, isSpellCharge, new List(), isStop: true).MainVfx; - } - - public VfxBase PowerUp(BattleCardBase ownerCard, List targetCards, int offense, int life, int multiplyAttack, int multiplyLife, int maxLife, List destroyList, List destroyTypeList, List banishList, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, List sideLogSkillInfoList) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List targetCards2 = targetCards.Where((BattleCardBase c) => (c.IsPlayer || !c.IsInHand) && !c.IsInCemetery).ToList(); - ICardOffenseModifier offenseModifier = ((offense != 0) ? new OffenseAddModifier(offense) : ((multiplyAttack == -1) ? ((ICardOffenseModifier)new OffenseAddModifier(0)) : ((ICardOffenseModifier)new OffenseMultiplyModifier(multiplyAttack)))); - ICardLifeModifier lifeModifier = ((life != 0) ? new LifeAddModifier(life) : ((multiplyLife != -1) ? ((ICardLifeModifier)new LifeMultiplyModifier(multiplyLife)) : ((ICardLifeModifier)((maxLife == -1) ? new LifeAddModifier(0) : new MaxLifeAddModifier(maxLife))))); - for (int num = 0; num < targetCards.Count; num++) - { - parallelVfxPlayer.Register(targetCards[num].SkillApplyInformation.GiveCombatValueModifier(offenseModifier, lifeModifier, new SkillProcessor())); - } - List list = new List(); - if (life < 0) - { - for (int num2 = 0; num2 < targetCards.Count; num2++) - { - int num3 = destroyList.IndexOf(targetCards[num2]); - if (num3 > -1) - { - DestroyCard(parallelVfxPlayer, targetCards[num2], destroyTypeList[num3]); - list.Add(targetCards[num2]); - } - if (banishList.IndexOf(targetCards[num2]) > -1) - { - BanishCard(parallelVfxPlayer, targetCards[num2]); - } - } - } - if (playVoiceOnDeathCard != null) - { - playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true; - playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards2, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxBase GainPowerDown(BattleCardBase ownerCard, List targetCards, int offense, int life, int maxLife, List destroyList, List destroyTypeList, List banishList, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, List sideLogSkillInfoList) - { - OffenseAddModifier offenseAddModifier = null; - LifeAddModifier lifeAddModifier = null; - if (offense < 0) - { - offenseAddModifier = new OffenseAddModifier(offense); - } - if (life < 0) - { - lifeAddModifier = new LifeAddModifier(life); - } - if (maxLife < 0) - { - lifeAddModifier = new MaxLifeAddModifier(maxLife); - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < targetCards.Count; i++) - { - if (offenseAddModifier != null && lifeAddModifier != null) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseAddModifier, lifeAddModifier, new SkillProcessor())); - } - if (offenseAddModifier != null && lifeAddModifier == null) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseAddModifier, null, new SkillProcessor())); - } - if (lifeAddModifier != null) - { - if (offenseAddModifier == null) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(null, lifeAddModifier, new SkillProcessor())); - } - int num = destroyList.IndexOf(targetCards[i]); - if (num > -1) - { - DestroyCard(parallelVfxPlayer, targetCards[i], destroyTypeList[num]); - list.Add(targetCards[i]); - } - if (banishList.IndexOf(targetCards[i]) > -1) - { - BanishCard(parallelVfxPlayer, targetCards[i]); - } - } - } - if (playVoiceOnDeathCard != null) - { - playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true; - playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxBase SetPowerDown(BattleCardBase ownerCard, List targetCards, int offense, int life, int maxLife, List destroyList, List destroyTypeList, List banishList, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, List sideLogSkillInfoList) - { - OffenseSetModifier offenseSetModifier = null; - LifeSetModifier lifeSetModifier = null; - if (offense != Skill_power_down.SETPRM_NONE) - { - offenseSetModifier = new OffenseSetModifier(offense); - } - if (life != Skill_power_down.SETPRM_NONE) - { - lifeSetModifier = new LifeSetModifier(life); - } - else if (maxLife != Skill_power_down.SETPRM_NONE) - { - lifeSetModifier = new MaxLifeSetModifier(maxLife); - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - if (offenseSetModifier != null && lifeSetModifier != null) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseSetModifier, lifeSetModifier, new SkillProcessor())); - } - if (offenseSetModifier != null && lifeSetModifier == null) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseSetModifier, null, new SkillProcessor())); - } - if (lifeSetModifier != null) - { - if (offenseSetModifier == null) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(null, lifeSetModifier, new SkillProcessor())); - } - int num = destroyList.IndexOf(targetCards[i]); - if (num > -1) - { - DestroyCard(parallelVfxPlayer, targetCards[i], destroyTypeList[num]); - } - if (banishList.IndexOf(targetCards[i]) > -1) - { - BanishCard(parallelVfxPlayer, targetCards[i]); - } - } - } - if (playVoiceOnDeathCard != null) - { - playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true; - playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxBase DepriveBuff(List targetCards, List depriveOffenseBuffList, List depriveLifeBuffList) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < targetCards.Count; i++) - { - list.Add(new Skill_powerup.PowerUpModifierContainer(targetCards[i], (depriveOffenseBuffList[i] >= 0) ? targetCards[i].SkillApplyInformation.OffenseModifierList[depriveOffenseBuffList[i]] : null, (depriveLifeBuffList[i] >= 0) ? targetCards[i].SkillApplyInformation.LifeModifierList[depriveLifeBuffList[i]] : null, null)); - } - for (int j = 0; j < list.Count; j++) - { - parallelVfxPlayer.Register(list[j].TargetCard.SkillApplyInformation.DepriveCombatValueModifire(list[j].OffenseModifier, list[j].LifeModifier)); - } - return parallelVfxPlayer; - } - - public VfxBase SpellCharge(BattleCardBase ownerCard, List targetCards, List addList, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - BattleCardBase battleCardBase = targetCards[i]; - if (battleCardBase.IsPlayer && !battleCardBase.IsInDeck) - { - parallelVfxPlayer.Register(battleCardBase.GetSpellChargeLoopEffect(addList[i])); - } - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - VfxWithLoadingSequential vfxWithLoadingSequential2 = ownerCard.SelfBattlePlayer.AddSpellChargeCountVfx(targetCards, addList); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoadingSequential2.LoadingVfx); - vfxWithLoadingSequential.RegisterToMainVfx(vfxWithLoadingSequential2.MainVfx); - return vfxWithLoadingSequential; - } - - public VfxBase Damage(BattleCardBase ownerCard, List targetCards, List damageList, List destroyList, List destroyTypeList, List banishList, NetworkBattleReceiver.EffectInfo effectInfo, List isReflectionDamage, BattleCardBase playVoiceOnDeathCard, List sideLogSkillInfoList, List effectTargetCards) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < targetCards.Count; i++) - { - targetCards[i].SkillApplyInformation.DamageLife(damageList[i], base.CurrentTurn, BattlePlayer.IsSelfTurn); - parallelVfxPlayer.Register(targetCards[i].VfxCreator.CreateDamage(damageList[i], targetCards[i].Life, targetCards[i].MaxLife, targetCards[i].BaseMaxLife, isReflectionDamage[i], IsSkillDamage: true)); - } - for (int j = 0; j < targetCards.Count; j++) - { - int num = destroyList.IndexOf(targetCards[j]); - if (num > -1 && (!(targetCards[j] is ClassBattleCardBase) || !list.Contains(targetCards[j]))) - { - DestroyCard(parallelVfxPlayer2, targetCards[j], destroyTypeList[num]); - list.Add(targetCards[j]); - } - if (banishList.IndexOf(targetCards[j]) > -1) - { - BanishCard(parallelVfxPlayer2, targetCards[j]); - } - } - if (playVoiceOnDeathCard != null) - { - playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true; - playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - List targetCards2 = (isReflectionDamage.Contains(item: true) ? effectTargetCards : targetCards); - VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCards2, effectInfo); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(vfxWithLoading.MainVfx, parallelVfxPlayer, CreateSkillSideLog(sideLogSkillInfoList), parallelVfxPlayer2); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - if (ownerCard.SkillApplyInformation.IsSneak) - { - vfxWithLoadingSequential.RegisterToMainVfx(ownerCard.SkillApplyInformation.FourceDepriveSneak()); - } - return vfxWithLoadingSequential; - } - - public VfxBase Heal(BattleCardBase ownerCard, List targetCards, List healAmountList, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - targetCards[i].SkillApplyInformation.HealLife(healAmountList[i], base.CurrentTurn, BattlePlayer.IsSelfTurn); - parallelVfxPlayer2.Register(targetCards[i].VfxCreator.CreateHealing(healAmountList[i], targetCards[i].Life, targetCards[i].MaxLife, targetCards[i].BaseMaxLife)); - if (targetCards[i] is ClassBattleCardBase) - { - parallelVfxPlayer.Register(targetCards[i].SelfBattlePlayer.BattleView.HandView.HandUnfocus()); - } - } - VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCards, effectInfo); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer, vfxWithLoading.MainVfx, parallelVfxPlayer2); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - return vfxWithLoadingSequential; - } - - public VfxBase Discard(List targetCards) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - targetCards[i].BattleCardView.HideCanPlayEffect(); - parallelVfxPlayer.Register(CardToCemetery(targetCards[i].SelfBattlePlayer, targetCards[i])); - parallelVfxPlayer.Register(targetCards[i].VfxCreator.CreateDestroyHand(targetCards[i].DeathTypeInfo, targetCards[i].SelfBattlePlayer)); - parallelVfxPlayer.Register(HideDetailPanel(targetCards[i])); - } - return parallelVfxPlayer; - } - - private VfxBase DestroyCard(BattleCardBase card) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(card.RemoveFromInPlay()); - sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectStop()); - sequentialVfxPlayer.Register(card.VfxCreator.CreateDestroy(card.DeathTypeInfo, card.SelfBattlePlayer)); - sequentialVfxPlayer.Register(HideDetailPanel(card)); - return sequentialVfxPlayer; - } - - public VfxBase DestroyOrBanish(BattleCardBase ownerCard, List destroyCards, List destroyTypeList, List banishCards, List indestructibleCards, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, bool isBurialRite, bool isOpen, List sideLogSkillInfoList) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < destroyCards.Count; i++) - { - if (isBurialRite) - { - parallelVfxPlayer.Register(destroyCards[i].SkillApplyInformation.AllSkillEffectStop()); - BattleCardBase destroyCard = destroyCards[i]; - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - destroyCard.IsSelectedDuringSelectingBurialRiteTarget = false; - })); - } - destroyCards[i].FlagCardAsDestroyedBySkill(); - DestroyCard(parallelVfxPlayer, destroyCards[i], destroyTypeList[i]); - list.Add(destroyCards[i]); - } - if (playVoiceOnDeathCard != null) - { - playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true; - playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - for (int num = 0; num < banishCards.Count; num++) - { - BattleCardBase banishCard = banishCards[num]; - if (isOpen && banishCard.IsInDeck) - { - if (banishCard.BattleCardView != null) - { - List costList = banishCard.BattleCardView.GetUseCostList(banishCard.Cost); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - banishCard.BattleCardView.UpdateCost(costList, isGenerateInHand: false, playEffect: false, isForceUpdate: true); - banishCard.BattleCardView.UpdateOffence(banishCard.Atk); - banishCard.BattleCardView.UpdateLife(banishCard.Life); - })); - } - parallelVfxPlayer.Register(new BanishDeckCardVfx(banishCard.BattleCardView)); - } - banishCard.FlagCardAsDestroyedBySkill(); - BanishCard(parallelVfxPlayer, banishCard); - list.Add(banishCard); - } - list.AddRange(indestructibleCards); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, list, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - private void SetDestroyType(BattleCardBase target, NetworkBattleReceiver.DestroyType destroyType) - { - switch (destroyType) - { - case NetworkBattleReceiver.DestroyType.BurialRite: - target.DeathTypeInfo.BurialRite = true; - break; - case NetworkBattleReceiver.DestroyType.WhiteRitual: - target.DeathTypeInfo.MysteriesDestroy = true; - break; - case NetworkBattleReceiver.DestroyType.ChantCount: - target.DeathTypeInfo.WhenDestroy = true; - target.DeathTypeInfo.ChantDestroy = true; - break; - case NetworkBattleReceiver.DestroyType.WhenDestroy: - target.DeathTypeInfo.WhenDestroy = true; - break; - case NetworkBattleReceiver.DestroyType.Killer: - target.DeathTypeInfo.DestroyedByKiller = true; - break; - case NetworkBattleReceiver.DestroyType.WhenDestroyAndKiller: - target.DeathTypeInfo.WhenDestroy = true; - target.DeathTypeInfo.DestroyedByKiller = true; - break; - } - } - - private VfxBase CreateBanish(BattleCardBase card) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(HideDetailPanel(card)); - if (card.IsInplay) - { - sequentialVfxPlayer.Register(card.RemoveFromInPlay()); - sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectStop()); - sequentialVfxPlayer.Register(card.VfxCreator.CreateBanish(card.DeathTypeInfo, card.SelfBattlePlayer)); - } - else if (card.IsInHand) - { - sequentialVfxPlayer.Register(card.VfxCreator.CreateBanishHand(card.DeathTypeInfo, card.SelfBattlePlayer)); - } - return sequentialVfxPlayer; - } - - public VfxBase Return(List targetCards, List banishCards, List destroyCards, List destroyTypeList, List sideLogSkillInfoList, BattleCardBase playVoiceOnDeathCard) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < targetCards.Count; i++) - { - BattleCardBase battleCardBase = targetCards[i]; - if (battleCardBase.IsChoiceEvolutionCard) - { - battleCardBase.ResetChoiceEvolutionCardBuildInfo(); - } - battleCardBase.SetSpellChargeCount(0); - battleCardBase.SkillApplyInformation.ForceDepriveChantCount(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(InstantVfx.Create(battleCardBase.BattleCardView._inPlayFrameEffect.HideFrameEffect)); - battleCardBase.BattleCardView.InitHandParameter(); - battleCardBase.UpdateCostViewStrategy(isForceUpdate: true); - sequentialVfxPlayer.Register(battleCardBase.SkillApplyInformation.AllSkillEffectStop(isEvolve: false, isReturn: true)); - sequentialVfxPlayer.Register(HideDetailPanel(battleCardBase)); - sequentialVfxPlayer.Register(battleCardBase.RemoveFromInPlay()); - battleCardBase.InitializeParameterOnWhenReturn(); - if (banishCards.Contains(targetCards[i])) - { - targetCards[i].DeathTypeInfo.BanishDestroy = true; - targetCards[i].SkillApplyInformation.GiveRemoveByBanish(); - sequentialVfxPlayer.Register(CardToBanishZone(battleCardBase.SelfBattlePlayer, battleCardBase)); - } - else if (battleCardBase.SelfBattlePlayer.HandCardList.Count >= 9) - { - sequentialVfxPlayer.Register(CardToCemetery(battleCardBase.SelfBattlePlayer, battleCardBase)); - } - else - { - FieldCardToHand(battleCardBase.SelfBattlePlayer, battleCardBase); - list.Add(battleCardBase); - } - parallelVfxPlayer.Register(sequentialVfxPlayer); - } - for (int j = 0; j < destroyCards.Count; j++) - { - destroyCards[j].FlagCardAsDestroyedBySkill(); - DestroyCard(parallelVfxPlayer, destroyCards[j], destroyTypeList[j]); - } - if (playVoiceOnDeathCard != null) - { - playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true; - playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - return VfxWithLoading.Create(LoadCardResources(list), SequentialVfxPlayer.Create(CreateSkillSideLog(sideLogSkillInfoList), parallelVfxPlayer, new ReturnCardVfx(targetCards.Where((BattleCardBase c) => c.IsPlayer).ToList(), targetCards.Where((BattleCardBase c) => !c.IsPlayer).ToList(), base.BattleResourceMgr))); - } - - public VfxBase Fusion(BattleCardBase card, List ingredientCards, BattlePlayerBase player, NetworkBattleReceiver.CardInfo cardInfo, bool isFusionMetamorphose, int fusionMetamorphoseCardId, List sideLogSkillInfoList) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(player.BattleView.CreateBeforeFusionVfx(card, ingredientCards)); - SkillProcessor skillProcessor = new SkillProcessor(); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - foreach (BattleCardBase ingredientCard in ingredientCards) - { - parallelVfxPlayer.Register(player.UseFusionIngredientManagement(ingredientCard, card, skillProcessor, isRandom: false, isFusionMetamorphose)); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - BattleLogManager.GetInstance().AddFusionIngredients(card, isCreateClone: true); - BattleCardBase originalCard = card; - if (isFusionMetamorphose) - { - sequentialVfxPlayer.Register(CreateSkillSideLog(sideLogSkillInfoList)); - VfxWith vfxWith = FusionMetamorphose(card, fusionMetamorphoseCardId); - sequentialVfxPlayer.Register(vfxWith.Vfx); - card = vfxWith.Value; - } - sequentialVfxPlayer.Register(player.BattleView.ReturnActCardAfterFusion(card.BattleCardView, isFusionMetamorphose)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - ShowSideLog(originalCard, player, isEvol: false, 3f, isSkillTargetSelect: true, cardInfo); - })); - return sequentialVfxPlayer; - } - - public VfxBase ChantCountChange(BattleCardBase ownerCard, List targetCards, int changeCount, NetworkBattleReceiver.EffectInfo effectInfo) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo)); - int i; - for (i = 0; i < targetCards.Count; i++) - { - targetCards[i].OnRemoveFromInPlayAfterOneTime += (bool flg, SkillProcessor skillProcessor) => new RemoveChantCountVfx(targetCards[i].BattleCardView); - targetCards[i].SkillApplyInformation.GiveChantCount(new ChantCountAddModifier(changeCount)); - vfxWithLoadingSequential.RegisterVfxWithLoading(new ChangeChantCountVfx(targetCards[i], targetCards[i].ChantCount, base.BattleResourceMgr)); - } - return vfxWithLoadingSequential; - } - - public VfxBase ChangeWhiteRitualStack(BattleCardBase target, int changeCount, bool isDestroy, NetworkBattleReceiver.CardInfo cardInfo) - { - target.SkillApplyInformation.GiveWhiteRitualCount(changeCount); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(isDestroy ? target.BattleCardView.UpdateStackWhiteRitualIconNumber() : new ChangeWhiteRitualCountVfx(target, changeCount)); - if (target.HasStackWhiteRitualAndOtherIconSkill() && target.BattleCardView.BattleCardIconAnimations.GetIconListCount() < 2) - { - sequentialVfxPlayer.Register(target.BattleCardView.BattleCardIconAnimations.UpdateSkillIconInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true, changeCount != 0)); - } - return sequentialVfxPlayer; - } - - public VfxBase Necromance(BattleCardBase card, bool isFusion) - { - if (!card.IsSpell && (!isFusion || card.IsPlayer)) - { - return new NecromanceSkillActivationVfx(card.BattleCardView); - } - return NullVfx.GetInstance(); - } - - public VfxBase UpdateDeck(BattlePlayerBase player, BattleCardBase ownerCard, List cardInfoList, bool isChange, bool isOpen, NetworkBattleReceiver.EffectInfo effectInfo) - { - List list = new List(); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - ParallelVfxPlayer skillOrDestroyVfx = ParallelVfxPlayer.Create(); - if (isChange) - { - player.BlackHole.AddRange(player.DeckCardList); - player.DeckCardList.Clear(); - } - List list2 = new List(); - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index); - player.DeckCardList.Add(battleCardBase); - list.Add(battleCardBase); - UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - if (battleCardBase.HasDeckSelfSkill) - { - player.AddDeckSkillCard(battleCardBase); - } - list2.Add(battleCardBase); - } - if (!isChange) - { - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list2)); - } - if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT)) - { - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, list, effectInfo)); - } - if (!isChange) - { - VfxWithLoading vfxWithLoading = player.CreateTokenSpawnVfx(list[0]); - vfxWithLoadingSequential.RegisterToMainVfx(new AddTokenDeckVfx(list, vfxWithLoading.MainVfx, player, skillOrDestroyVfx, isOpen)); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - } - vfxWithLoadingSequential.RegisterToMainVfx(new DummyDeckChangeCardVfx(player.IsPlayer, player.DeckCardList.Count)); - vfxWithLoadingSequential.RegisterToMainVfx(new DeckChangeVfx(player)); - return vfxWithLoadingSequential; - } - - public void IndexChange(BattlePlayerBase player, BattleCardBase addTarget, BattleCardBase changeTarget) - { - int index = addTarget.Index; - addTarget.SetIndex(changeTarget.Index); - changeTarget.SetIndex(index); - player.DeckCardList.Sort((BattleCardBase a, BattleCardBase b) => a.Index - b.Index); - } - - public VfxBase Metamorphose(BattleCardBase ownerCard, List targets, List idList, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer4 = ParallelVfxPlayer.Create(); - float num = 0f; - bool flag = false; - List canNotTouchCardVfxList = new List(); - List list = new List(); - for (int i = 0; i < targets.Count; i++) - { - BattleCardBase originalCard = targets[i]; - int cardId = idList[i]; - BattleCardBase metamorphosedCard = originalCard.SelfBattlePlayer.CreateCard(cardId, originalCard.Index); - metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false); - metamorphosedCard.TransformInfo = new BattleCardBase.TransformInformation(BattleCardBase.TransformType.Metamorphose, originalCard); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - metamorphosedCard.BattleCardView.GameObject.SetActive(value: true); - metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false); - metamorphosedCard.BattleCardView.Collider.enabled = false; - metamorphosedCard.SetOnDraw(draw: false); - })); - list.Add(metamorphosedCard); - parallelVfxPlayer3.Register(HideDetailPanel(originalCard)); - if (originalCard.IsInHand) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (originalCard.IsPlayer) - { - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); - base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); - canNotTouchCardVfxList.Add(canNotTouchCardVfx); - } - ReplaceInHand(originalCard.SelfBattlePlayer, originalCard, metamorphosedCard); - InstantVfx instantVfx = InstantVfx.Create(delegate - { - originalCard.SelfBattlePlayer.BattleView.HandView.ReplaceCardInView(originalCard.BattleCardView, metamorphosedCard.BattleCardView); - }); - if (originalCard.IsPlayer) - { - originalCard.BattleCardView.HideCanPlayEffect(); - VfxBase vfxBase = Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard); - ParallelVfxPlayer parallelVfxPlayer5 = ParallelVfxPlayer.Create(instantVfx, metamorphosedCard.BattleCardView.ShowHandCardInfo(), InstantVfx.Create(delegate - { - metamorphosedCard.BattleCardView.Transform.position = originalCard.BattleCardView.Transform.position; - metamorphosedCard.BattleCardView.Transform.rotation = originalCard.BattleCardView.Transform.rotation; - metamorphosedCard.BattleCardView.Transform.localScale = originalCard.BattleCardView.Transform.localScale; - Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard); - })); - GameObject effectGameObject = null; - WaitLoadEffectAndSetSeVfx loadingVfx = new WaitLoadEffectAndSetSeVfx(effectInfo.EffectPath, effectInfo.SePath, delegate(GameObject e) - { - effectGameObject = e; - }); - PlayEffectAndSeVfx mainVfx = new PlayEffectAndSeVfx(() => effectGameObject, metamorphosedCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true); - VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, mainVfx); - parallelVfxPlayer2.Register(vfxWithLoading.LoadingVfx); - SequentialVfxPlayer morphVfx = SequentialVfxPlayer.Create(vfxBase, vfxWithLoading.MainVfx, parallelVfxPlayer5); - sequentialVfxPlayer.Register(Skill_metamorphose.AttachMetamorphoseCardToOriginalCardVfx(originalCard, metamorphosedCard)); - sequentialVfxPlayer.Register(WaitVfx.Create(num)); - num += 0.1f; - sequentialVfxPlayer.Register(new MetamorphoseHandCardVfx(metamorphosedCard, morphVfx)); - } - else - { - sequentialVfxPlayer.Register(SequentialVfxPlayer.Create(Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard), new MetamorphoseHandCardVfx(metamorphosedCard, NullVfx.GetInstance()), InstantVfx.Create(delegate - { - Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard); - }), instantVfx)); - } - sequentialVfxPlayer.Register(Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard)); - if (originalCard.IsPlayer) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (canNotTouchCardVfxList.Count > 0) - { - canNotTouchCardVfxList.First().End(); - canNotTouchCardVfxList.RemoveAt(0); - } - })); - } - parallelVfxPlayer4.Register(sequentialVfxPlayer); - } - else if (originalCard.IsInplay) - { - ParallelVfxPlayer parallelVfxPlayer6 = ParallelVfxPlayer.Create(); - parallelVfxPlayer6.Register(Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard)); - parallelVfxPlayer6.Register(originalCard.SkillApplyInformation.AllSkillEffectStop()); - parallelVfxPlayer6.Register(ReplaceInPlay(metamorphosedCard.SelfBattlePlayer, originalCard, metamorphosedCard)); - parallelVfxPlayer6.Register(metamorphosedCard.SetUpInplay()); - metamorphosedCard.BattleCardView.GameObject.transform.rotation = Quaternion.identity; - VfxWithLoading vfxWithLoading2 = CreateSkillEffect(ownerCard, new BattleCardBase[1] { metamorphosedCard }, effectInfo); - parallelVfxPlayer2.Register(vfxWithLoading2.LoadingVfx); - parallelVfxPlayer6.Register(SequentialVfxPlayer.Create(new MetamorphoseInPlayCardVfx(originalCard, metamorphosedCard, vfxWithLoading2.MainVfx), Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard), metamorphosedCard.BattleCardView.InitializeBattleCardIcon(metamorphosedCard, metamorphosedCard.Skills))); - originalCard.FlagCardAsDestroyedBySkill(); - parallelVfxPlayer6.Register(originalCard.RemoveFromInPlay()); - parallelVfxPlayer4.Register(parallelVfxPlayer6); - } - if (i == 0) - { - flag = !metamorphosedCard.IsPlayer && metamorphosedCard.IsInHand; - } - } - parallelVfxPlayer2.Register(LoadCardResources(list)); - VfxBase vfxToRegister = parallelVfxPlayer2; - if (!flag) - { - vfxToRegister = UIManager.GetInstance().CreateNowLoadingVfx(parallelVfxPlayer2); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer, parallelVfxPlayer3, parallelVfxPlayer4); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxToRegister); - return vfxWithLoadingSequential; - } - - public VfxWith FusionMetamorphose(BattleCardBase originalCard, int metamorphoseCardId) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer4 = ParallelVfxPlayer.Create(); - float num = 0f; - List canNotTouchCardVfxList = new List(); - BattleCardBase metamorphosedCard = originalCard.SelfBattlePlayer.CreateCard(metamorphoseCardId, originalCard.Index); - metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false); - metamorphosedCard.TransformInfo = new BattleCardBase.TransformInformation(BattleCardBase.TransformType.Metamorphose, originalCard); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - metamorphosedCard.BattleCardView.GameObject.SetActive(value: true); - metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false); - metamorphosedCard.BattleCardView.Collider.enabled = false; - metamorphosedCard.SetOnDraw(draw: false); - })); - parallelVfxPlayer2.Register(LoadCardResources(new List { metamorphosedCard })); - parallelVfxPlayer3.Register(HideDetailPanel(originalCard)); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (originalCard.IsPlayer) - { - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); - base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); - canNotTouchCardVfxList.Add(canNotTouchCardVfx); - } - ReplaceInHand(originalCard.SelfBattlePlayer, originalCard, metamorphosedCard); - InstantVfx instantVfx = InstantVfx.Create(delegate - { - originalCard.SelfBattlePlayer.BattleView.HandView.ReplaceCardInView(originalCard.BattleCardView, metamorphosedCard.BattleCardView); - MotionUtils.SetLayerAll(metamorphosedCard.BattleCardView.GameObject, 31); - }); - originalCard.BattleCardView.HideCanPlayEffect(); - VfxBase vfxBase = Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard); - ParallelVfxPlayer parallelVfxPlayer5 = ParallelVfxPlayer.Create(instantVfx, InstantVfx.Create(delegate - { - metamorphosedCard.BattleCardView.Transform.position = originalCard.BattleCardView.Transform.position; - metamorphosedCard.BattleCardView.Transform.rotation = originalCard.BattleCardView.Transform.rotation; - metamorphosedCard.BattleCardView.Transform.localScale = originalCard.BattleCardView.Transform.localScale; - Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard); - })); - GameObject effectGameObject = null; - WaitLoadEffectAndSetSeVfx loadingVfx = new WaitLoadEffectAndSetSeVfx("cmn_card_fusionmetamorphose_2", "se_cmn_card_fusionmetamorphose_2", delegate(GameObject e) - { - effectGameObject = e; - }); - PlayEffectAndSeVfx playEffectAndSeVfx = new PlayEffectAndSeVfx(() => effectGameObject, metamorphosedCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true); - VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, playEffectAndSeVfx); - parallelVfxPlayer2.Register(vfxWithLoading.LoadingVfx); - SequentialVfxPlayer morphVfx = SequentialVfxPlayer.Create(vfxBase, vfxWithLoading.MainVfx, InstantVfx.Create(delegate - { - MotionUtils.SetLayerAll(playEffectAndSeVfx.GetLoadedGameObject(), 31); - }), WaitVfx.Create(0.5f), parallelVfxPlayer5); - sequentialVfxPlayer.Register(Skill_metamorphose.AttachMetamorphoseCardToOriginalCardVfx(originalCard, metamorphosedCard)); - sequentialVfxPlayer.Register(WaitVfx.Create(num)); - num += 0.1f; - sequentialVfxPlayer.Register(new MetamorphoseHandCardVfx(metamorphosedCard, morphVfx)); - sequentialVfxPlayer.Register(Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard)); - if (originalCard.IsPlayer) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (canNotTouchCardVfxList.Count > 0) - { - canNotTouchCardVfxList.First().End(); - canNotTouchCardVfxList.RemoveAt(0); - } - })); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - originalCard.SelfBattlePlayer.BattleView.PlayQueueView.ReplaceCard(metamorphosedCard.BattleCardView, originalCard.BattleCardView); - })); - parallelVfxPlayer4.Register(sequentialVfxPlayer); - VfxBase vfxBase2 = parallelVfxPlayer2; - vfxBase2 = UIManager.GetInstance().CreateNowLoadingVfx(parallelVfxPlayer2); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer, parallelVfxPlayer3, parallelVfxPlayer4); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxBase2); - return new VfxWith(vfxWithLoadingSequential, metamorphosedCard); - } - - public VfxBase Geton(BattleCardBase card, List targets, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targets.Count; i++) - { - targets[i].DeathTypeInfo.LeaveByGetOn = true; - targets[i].FlagCardAsDestroyedBySkill(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(targets[i].SkillApplyInformation.AllSkillEffectStop()); - sequentialVfxPlayer.Register(CardToVehicleZone(card.SelfBattlePlayer, targets[i])); - sequentialVfxPlayer.Register(HideDetailPanel(card)); - sequentialVfxPlayer.Register(targets[i].VfxCreator.CreateGeton(card.BattleCardView.Transform, card.BattleCardView, card.DeathTypeInfo, card.SelfBattlePlayer)); - parallelVfxPlayer.Register(sequentialVfxPlayer); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(card, targets, effectInfo)); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxBase Getoff(BattlePlayerBase player, BattleCardBase ownerCard, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList(); - List list = new List(); - for (int i = 0; i < cardInfoList.Count; i++) - { - if (!cardInfoList[i].IsOverflow) - { - BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - player.ClassAndInPlayCardList.Add(battleCardBase); - summonedCardsList.AddCardToSummonedCards(battleCardBase); - list.Add(battleCardBase); - } - else - { - BattleCardBase battleCardBase2 = player.CreateCard(cardInfoList[i].Id, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardBase2, cardInfoList[i]); - summonedCardsList.AddCardToOverflowCards(battleCardBase2); - list.Add(battleCardBase2); - } - } - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list)); - if (effectInfo != null) - { - VfxWithLoading vfxWithLoadingToRegister = (effectInfo.IsTargetPosition ? CreateOwnerSummonSkillEffect(ownerCard, summonedCardsList, effectInfo) : CreateSkillEffect(ownerCard, summonedCardsList, effectInfo)); - vfxWithLoadingSequential.RegisterVfxWithLoading(vfxWithLoadingToRegister); - } - vfxWithLoadingSequential.RegisterToMainVfx(new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true, isIgnoreVoice: false, isRandomVoice: false, isGetoff: true)); - return vfxWithLoadingSequential; - } - - public VfxBase Unite(BattlePlayerBase player, BattleCardBase card, List targetCards, int uniteCardId, int uniteCardIndex, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - targetCards[i].DeathTypeInfo.BanishDestroy = true; - targetCards[i].FlagCardAsDestroyedBySkill(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(CreateBanish(targetCards[i])); - sequentialVfxPlayer.Register(CardToUniteZone(targetCards[i])); - parallelVfxPlayer.Register(sequentialVfxPlayer); - } - SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList(); - BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, uniteCardId, uniteCardIndex); - player.ClassAndInPlayCardList.Add(battleCardBase); - summonedCardsList.AddCardToSummonedCards(battleCardBase); - VfxWithLoading vfxWithLoading = CreateSkillEffect(card, targetCards, effectInfo); - StartPickMultiCardVfx startPickMultiCardVfx = new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(vfxWithLoading.MainVfx, parallelVfxPlayer, startPickMultiCardVfx); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(new List { battleCardBase })); - return vfxWithLoadingSequential; - } - - public VfxBase ShowSkillEffect(BattleCardBase card, List targets, NetworkBattleReceiver.EffectInfo effectInfo) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(card, targets, effectInfo)); - return vfxWithLoadingSequential; - } - - private VfxWithLoading CreateSkillEffect(BattleCardBase ownerCard, IEnumerable targetCards, NetworkBattleReceiver.EffectInfo effectInfo) - { - if (effectInfo == null || effectInfo.EffectPath == string.Empty) - { - return NullVfxWithLoading.GetInstance(); - } - Func func = () => (!ownerCard.IsSpell && !effectInfo.IsWhenFusioned) ? ownerCard.BattleCardView.CardWrapObject.transform.position : ownerCard.SelfBattlePlayer.Class.BattleCardView.GameObject.transform.position; - switch (effectInfo.EffectTargetType) - { - case EffectMgr.TargetType.NONE: - return NullVfxWithLoading.GetInstance(); - case EffectMgr.TargetType.NONE_WAIT: - return VfxWithLoading.Create(WaitVfx.Create(effectInfo.EffectTime)); - case EffectMgr.TargetType.SINGLE: - if (effectInfo.IsFollowInHand) - { - return SkillBase.CreateSingleFollowInHandVfx(targetCards, effectInfo.EffectPath, effectInfo.SePath); - } - return SkillBase.CreateSingleVfx(base.BattleResourceMgr, func, targetCards, ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime); - case EffectMgr.TargetType.AREA_SELF: - return SkillBase.CreateAreaVfx(base.BattleResourceMgr, func, ownerCard.SelfBattlePlayer.GetFieldCenterPosition(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime); - case EffectMgr.TargetType.AREA_OPPONENT: - return SkillBase.CreateAreaVfx(base.BattleResourceMgr, func, ownerCard.OpponentBattlePlayer.GetFieldCenterPosition(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime); - case EffectMgr.TargetType.AREA_ALL: - return SkillBase.CreateAreaVfx(base.BattleResourceMgr, func, Vector3.zero, ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime); - case EffectMgr.TargetType.SINGLE_ONLY_OPPONENT: - return SkillBase.CreateSingleVfx(base.BattleResourceMgr, func, targetCards.Where((BattleCardBase s) => s.IsPlayer != ownerCard.IsPlayer).ToList(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime); - default: - return NullVfxWithLoading.GetInstance(); - } - } - - public VfxWithLoading CreateOwnerSummonSkillEffect(BattleCardBase ownerCard, SkillBaseSummon.SummonedCardsList summonedCardsList, NetworkBattleReceiver.EffectInfo effectInfo) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - for (int i = 0; i < summonedCardsList.cardEffectPairList.Count(); i++) - { - SkillBaseSummon.SummonedCardsList.CardEffectPair cardEffectPair = summonedCardsList.cardEffectPairList.ElementAt(i); - BattleCardBase target = cardEffectPair.card; - VfxWithLoading vfxWithLoading = SkillBase.CreateSingleVfx(base.BattleResourceMgr, () => target.BattleCardView.CardWrapObject.transform.position, target.AsIEnumerable(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime); - cardEffectPair.summonEffect = vfxWithLoading.MainVfx; - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - } - return vfxWithLoadingSequential; - } - - public VfxBase CreateWhenPlayEffect(SkillCollectionBase.WhenPlayEffectType whenPlayEffectType, IBattleCardView battleCardView, bool isInvoked) - { - return whenPlayEffectType switch - { - SkillCollectionBase.WhenPlayEffectType.Berserk => new BerserkSkillActivationVfx(battleCardView), - SkillCollectionBase.WhenPlayEffectType.Awake => new AwakeSkillActivationVfx(battleCardView), - SkillCollectionBase.WhenPlayEffectType.WhenPlay => new WhenPlaySkillActivationVfx(battleCardView), - SkillCollectionBase.WhenPlayEffectType.WhenDestroy => new LoadAndPlayEffectVfx("cmn_card_destroy_3", "se_cmn_card_destroy_3", battleCardView.Transform, 0f), - _ => NullVfxWithLoading.GetInstance(), - }; - } - - public VfxBase ShowSkillInductionEffect(BattleCardBase card, string skillVoice, bool isIgnoreVoice, NetworkBattleReceiver.CardInfo cardInfo) - { - IBattleCardView battleCardView = card.BattleCardView; - string text = battleCardView.VoiceInfo.VoiceId; - VfxBase vfxBase = NullVfx.GetInstance(); - if (!ReadOnlyVoiceInfo.IsInvalidFileName(skillVoice) && !isIgnoreVoice) - { - if (string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(skillVoice) && skillVoice != "NONE".ToLower()) - { - text = skillVoice.Split(new string[1] { "_" }, StringSplitOptions.None)[0]; - } - vfxBase = VfxWithLoading.Create(new WaitLoadVoiceResourceVfx(battleCardView, text), new PlayCRISoundVfx(battleCardView, skillVoice)); - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(vfxBase); - if (cardInfo != null) - { - parallelVfxPlayer.Register(card.BattleCardView.BattleCardIconAnimations.UpdateSkillIconInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true)); - } - parallelVfxPlayer.Register(new ReactiveSkillActivationVfx(card)); - return parallelVfxPlayer; - } - - public VfxBase ShowIndependentEffect(List cards) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - for (int i = 0; i < cards.Count; i++) - { - sequentialVfxPlayer.Register(new OneShotHeavenlyAegisPlayVfx(cards[i].BattleCardView)); - } - return sequentialVfxPlayer; - } - - public VfxBase ShowChangeAffiliation(BattleCardBase card, List targets, CardBasePrm.ClanType clan, CardBasePrm.TribeInfo tribe, NetworkBattleReceiver.EffectInfo effectInfo) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(card, targets.Where((BattleCardBase s) => s.IsPlayer || s.IsInplay), effectInfo)); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int num = 0; num < targets.Count; num++) - { - targets[num].SkillApplyInformation.GiveChangeAffiliation(clan, tribe, showEffect: true); - parallelVfxPlayer.Register(new ChangeAffiliationVfx(targets[num], clan)); - } - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - return vfxWithLoadingSequential; - } - - public VfxBase ShowChangeUnionBurstAndSkyboundArtEffect(List targets) - { - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - for (int i = 0; i < targets.Count; i++) - { - GameObject effectGameObject = null; - vfxWithLoadingSequential.RegisterToLoadingVfx(new WaitLoadEffectAndSetSeVfx("stt_act_costdown_1", "se_stt_act_costdown_1", delegate(GameObject e) - { - effectGameObject = e; - })); - vfxWithLoadingSequential.RegisterToMainVfx(new PlayEffectAndSeVfx(() => effectGameObject, targets[i].BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true)); - } - return vfxWithLoadingSequential; - } - - public VfxBase ShowRepeatSkillEffect(bool isSelf) - { - return new RepeatSkillEffectVfx(isSelf ? BattlePlayer.Class.BattleCardView : BattleEnemy.Class.BattleCardView, "when_destroy", isSelf); - } - - public VfxBase GiveCantActivateFanfare(BattleCardBase ownerCard, List targetCards, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - parallelVfxPlayer.Register(targetCards.ElementAt(i).SkillApplyInformation.GiveCantActivateFanfare("all")); - } - VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCards, effectInfo); - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(vfxWithLoading.MainVfx, parallelVfxPlayer, BattlePlayer.UpdateHandCardsCost(), BattleEnemy.UpdateHandCardsCost()); - vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); - return vfxWithLoadingSequential; - } - - public VfxBase DepriveCantActivateFanfare(BattleCardBase ownerCard, List targetCards) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - parallelVfxPlayer.Register(targetCards.ElementAt(i).SkillApplyInformation.DepriveCantActivateFanfare("all")); - } - parallelVfxPlayer.Register(ownerCard.SelfBattlePlayer.UpdateHandCardsCost()); - parallelVfxPlayer.Register(ownerCard.OpponentBattlePlayer.UpdateHandCardsCost()); - return VfxWithLoading.Create(parallelVfxPlayer); - } - - public VfxBase LoseSkill(BattleCardBase ownerCard, List targetCards, NetworkBattleReceiver.EffectInfo effectInfo) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < targetCards.Count; i++) - { - parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.AllSkillEffectStop()); - targetCards.ElementAt(i).SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier(); - } - VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo)); - return vfxWithLoadingSequential; - } - - public VfxBase ShowHandEffect() - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(UpdateHandEffect(BattlePlayer.HandCardList, _lastCardInfoList)); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - })); - return parallelVfxPlayer; - } - - public VfxBase UpdateHandInfo(List playerCards, List enemyCards, List cardInfoList, List playerAllCards, List enemyAllCards, bool isImmediate = false) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < cardInfoList.Count; i++) - { - bool isSelf = cardInfoList[i].IsSelf; - BattleCardBase battleCardIdx = GetBattleCardIdx(isSelf ? playerCards : enemyCards, cardInfoList[i].Index); - if (battleCardIdx != null) - { - UpdateSkillDescriptionValueList(battleCardIdx, cardInfoList[i]); - UpdateUnionBurstAndSkyboundArtModifier(battleCardIdx, cardInfoList[i]); - if (isSelf && !cardInfoList[i].IsSameBuff) - { - UpdateBuffInfo(battleCardIdx, cardInfoList[i], playerAllCards, enemyAllCards); - } - } - } - if (isImmediate) - { - base.VfxMgr.RegisterImmediateVfx(UpdateHandEffect(playerCards, cardInfoList.Where((NetworkBattleReceiver.CardInfo c) => c.IsSelf).ToList())); - } - parallelVfxPlayer.Register(UpdateHandEffect(playerCards, cardInfoList.Where((NetworkBattleReceiver.CardInfo c) => c.IsSelf).ToList())); - return parallelVfxPlayer; - } - - public VfxBase UpdateHandEffect(List playerCards, List cardInfoList, bool forceHide = false) - { - _lastCardInfoList = cardInfoList; - if (cardInfoList == null) - { - return NullVfx.GetInstance(); - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase card = GetBattleCardIdx(playerCards, cardInfoList[i].Index); - if (card == null) - { - continue; - } - HandCardFrameEffectType handCardFrameEffectType = cardInfoList[i].HandCardFrameEffectType; - bool isActive = cardInfoList[i].IsHandEffectActive; - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - if (isActive && !forceHide) - { - (card.BattleCardView as BattleCardView).HandFrameEffect.Show(card.BattleCardView.CardTemplate.FrameEffectHandCard, handCardFrameEffectType); - } - else - { - card.BattleCardView.HideCanPlayEffect(); - } - })); - } - return parallelVfxPlayer; - } - - public VfxBase UpdateChoiceBraveButtonEffet(bool canChoiceBrave, bool isImmediate) - { - if (BattlePlayer is ReplayBattlePlayer replayBattlePlayer) - { - replayBattlePlayer.CanChoiceBraveOnRecord = canChoiceBrave; - } - InstantVfx instantVfx = InstantVfx.Create(delegate - { - BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - }); - if (isImmediate) - { - base.VfxMgr.RegisterImmediateVfx(instantVfx); - } - return instantVfx; - } - - public VfxBase UpdateAttackableEffect(List playerCards, List enemyCards, List cardInfoList, bool isSelfTurn, bool useRecordAttackEffect = false) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase card = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index); - if (card is ClassBattleCardBase) - { - continue; - } - NetworkBattleReceiver.CardInfo cardInfo = cardInfoList[i]; - card.AttackableOnReplay = cardInfo.Attackable; - card.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass; - card.AttackableCount = cardInfo.AttackableCount; - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - if (useRecordAttackEffect) - { - card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(() => cardInfo.IsCantAttackClass, cardInfo.IsSelf == isSelfTurn); - } - else - { - card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(null, cardInfo.IsSelf == isSelfTurn); - } - })); - } - return parallelVfxPlayer; - } - - public VfxBase UpdateInplayInfo(List playerCards, List enemyCards, List cardInfoList, List playerAllCards, List enemyAllCards, bool isSelfTurn, bool isInitialize, bool onlyEffect = false, bool onlyAttackEffect = false, bool updateAttackEffect = true, bool useRecordAttackEffect = false) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase card = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index); - if (card == null) - { - continue; - } - if (!(card is ClassBattleCardBase) && updateAttackEffect) - { - NetworkBattleReceiver.CardInfo cardInfo = cardInfoList[i]; - card.AttackableOnReplay = cardInfo.Attackable; - card.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass; - card.AttackableCount = cardInfo.AttackableCount; - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - if (cardInfo.ForceHideAttackEffect) - { - card.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - } - else if (useRecordAttackEffect) - { - card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(() => cardInfo.IsCantAttackClass, cardInfo.IsSelf == isSelfTurn); - } - else - { - card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(null, cardInfo.IsSelf == isSelfTurn); - } - })); - } - parallelVfxPlayer.Register(card.SkillApplyInformation.UpdateAllSkillEffectInReplay(cardInfoList[i].InplaySkillEffectList, cardInfoList[i].InductionNumber, isInitialize, onlyAttackEffect)); - if (!onlyEffect) - { - UpdateSkillDescriptionValueList(card, cardInfoList[i]); - if (!cardInfoList[i].IsSameBuff) - { - UpdateBuffInfo(card, cardInfoList[i], playerAllCards, enemyAllCards); - } - } - } - return parallelVfxPlayer; - } - - public VfxBase UpdateDeckOrReservedInfo(List playerCards, List enemyCards, List cardInfoList) - { - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase battleCardIdx = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index); - UpdateSkillDescriptionValueList(battleCardIdx, cardInfoList[i]); - } - return NullVfx.GetInstance(); - } - - public void UpdateBuffInfo(BattleCardBase updateCard, NetworkBattleReceiver.CardInfo cardInfo, List playerAllCards, List enemyAllCards) - { - List list = CreateBuffInfoList(cardInfo, playerAllCards, enemyAllCards); - List list2 = new List(); - for (int i = 0; i < cardInfo.NoConsumeEpBuffInfoNameList.Count; i++) - { - List source = ((cardInfo.NoConsumeEpBuffInfoNameList[i].Substring(0, 1) == "p") ? playerAllCards : enemyAllCards); - BattleCardBase battleCardIdx = GetBattleCardIdx(source.ToList(), int.Parse(cardInfo.NoConsumeEpBuffInfoNameList[i].Substring(1))); - list2.Add(battleCardIdx); - } - updateCard.ReplayBuffInfoList = list; - updateCard.ReplayNoConsumeEpBuffInfoNameList = list2; - updateCard.ReplayBuffInfoLabelList = cardInfo.BuffInfoLabelList; - IDetailPanelControl detailPanelControl = DetailMgr.DetailPanelControl; - if (detailPanelControl.IsShow && detailPanelControl._card != null && detailPanelControl._card.IsClass && updateCard.IsClass && detailPanelControl._card.IsPlayer == updateCard.IsPlayer) - { - List bonusConditionList = updateCard.SelfBattlePlayer.BonusConditionList; - detailPanelControl.UpdateBuffInfo(updateCard, bonusConditionList); - } - else - { - if (!detailPanelControl.IsShow || detailPanelControl._card != updateCard || !list.Any((BuffInfo b) => b.IsCopied)) - { - return; - } - detailPanelControl.UpdateLogItemBuffInfo(updateCard); - if (DetailMgr.SubDetailPanelControl.IsShow) - { - BuffInfo buffInfo = list.FirstOrDefault((BuffInfo b) => b.IsCopied && DetailMgr.SubDetailPanelControl._card == b.PreviousOwner); - if (buffInfo != null) - { - DetailMgr.SubDetailPanelControl.SetBuff(buffInfo); - detailPanelControl.UpdateCardDescriptionOnEvent(); - } - } - } - } - - public void UpdateAttachedCardInfo(List playerCards, List enemyCards, List cardInfoList) - { - for (int i = 0; i < cardInfoList.Count; i++) - { - BattleCardBase battleCardBase = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index); - for (int j = 0; j < cardInfoList[i].MetamorphoseCount; j++) - { - if (battleCardBase.TransformInfo.OriginalCard == null) - { - break; - } - battleCardBase = battleCardBase.TransformInfo.OriginalCard; - } - if (battleCardBase.BaseParameter.BaseCardId != cardInfoList[i].Id && battleCardBase.ReplayBuffInfoCard != null && battleCardBase.ReplayBuffInfoCard.BaseParameter.BaseCardId == cardInfoList[i].Id) - { - battleCardBase = battleCardBase.ReplayBuffInfoCard; - } - UpdateBuffDetailSkillDescriptionValueList(battleCardBase, cardInfoList[i]); - } - } - - public void UpdateFusionCardInfo(NetworkBattleReceiver.CardInfo cardInfo, List fusionIngredientList = null) - { - bool isSelf = cardInfo.IsSelf; - BattleCardBase battleCardIdx = GetBattleCardIdx(isSelf ? BattleLogManager.GetInstance().PlayerFusionCard : BattleLogManager.GetInstance().EnemyFusionCard, cardInfo.Index); - if (battleCardIdx != null) - { - UpdateSkillDescriptionValueList(battleCardIdx, cardInfo); - if (fusionIngredientList != null) - { - UpdateFusionIngredients(battleCardIdx, cardInfo, fusionIngredientList); - } - } - } - - public void UpdateStatusPanel(NetworkBattleReceiver.StatusPanelInfo playerPanelInfo, NetworkBattleReceiver.StatusPanelInfo enemyPanelInfo) - { - UpdatePlayerStatusPanel(BattlePlayer, playerPanelInfo); - UpdatePlayerStatusPanel(BattleEnemy, enemyPanelInfo); - } - - private void UpdatePlayerStatusPanel(BattlePlayerBase player, NetworkBattleReceiver.StatusPanelInfo panelInfo) - { - if (panelInfo.IsDrew) - { - base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - player.UpdateStatusPanel(panelInfo.HandCount, panelInfo.CemetaryCount, panelInfo.DeckCount); - })); - return; - } - base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - player.StatusPanelControl.SetHandCount(panelInfo.HandCount); - player.StatusPanelControl.SetGrave(panelInfo.CemetaryCount); - })); - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - player.StatusPanelControl.SetDeck(panelInfo.DeckCount); - })); - } - - private List CreateBuffInfoList(NetworkBattleReceiver.CardInfo cardInfo, List playerAllCards, List enemyAllCards) - { - List list = new List(); - for (int i = 0; i < cardInfo.BuffInfoList.Count; i++) - { - NetworkBattleReceiver.ReplayBuffInfo replayBuffInfo = cardInfo.BuffInfoList[i]; - bool num = replayBuffInfo.BuffType == NetworkBattleReceiver.ReplayBuffType.Copied; - NetworkBattleReceiver.BuffCardInfo ownerCardInfo = replayBuffInfo.OwnerCardInfo; - BattleCardBase buffOwnerCard = GetBuffOwnerCard(ownerCardInfo, playerAllCards, enemyAllCards); - NetworkBattleReceiver.BuffCardInfo previousOwnerCardInfo = replayBuffInfo.PreviousOwnerCardInfo; - BuffInfo buffInfo; - if (previousOwnerCardInfo != null) - { - BattleCardBase buffOwnerCard2 = GetBuffOwnerCard(previousOwnerCardInfo, playerAllCards, enemyAllCards); - buffInfo = new BuffInfo(ownerCardInfo.CardId, replayBuffInfo.CardIdFrom, null, buffOwnerCard, replayBuffInfo.IsPlayer, replayBuffInfo.DivergenceIdList); - buffInfo.SetPreviousOwner(buffOwnerCard2); - } - else - { - buffInfo = new BuffInfo(ownerCardInfo.CardId, replayBuffInfo.CardIdFrom, null, buffOwnerCard, replayBuffInfo.IsPlayer, replayBuffInfo.DivergenceIdList); - } - if (num) - { - buffInfo.IsCopiedEvolutionSkill = replayBuffInfo.IsEvolutionSkill; - } - else - { - buffInfo.IsEvolutionSkill = replayBuffInfo.IsEvolutionSkill; - } - switch (replayBuffInfo.BuffType) - { - case NetworkBattleReceiver.ReplayBuffType.Copied: - buffInfo.IsCopied = true; - buffInfo.CopiedSkillDescriptionValueList = replayBuffInfo.CopiedSkillDescriptionValueList; - buffInfo.CopiedEvoSkillDescriptionValueList = replayBuffInfo.CopiedEvoSkillDescriptionValueList; - break; - case NetworkBattleReceiver.ReplayBuffType.SaveBurialRite: - buffInfo.IsSaveBurialRiteSkill = true; - buffInfo.TargetCard = buffOwnerCard; - break; - case NetworkBattleReceiver.ReplayBuffType.Geton: - buffInfo.IsGetonSkill = true; - buffInfo.TargetCard = buffOwnerCard; - break; - case NetworkBattleReceiver.ReplayBuffType.IsReserveTokenDrawSkill: - buffInfo.IsReserveTokenDrawSkill = true; - buffInfo.TargetCard = buffOwnerCard; - break; - case NetworkBattleReceiver.ReplayBuffType.IsHiddenClassLogSkill: - buffInfo.IsHiddenClassLogSkill = true; - break; - } - list.Add(buffInfo); - } - return list; - } - - public BattleCardBase GetBuffOwnerCard(NetworkBattleReceiver.BuffCardInfo buffCardInfo, List playerAllCards, List enemyAllCards) - { - List source = ((buffCardInfo.CardName.Substring(0, 1) == "p") ? playerAllCards : enemyAllCards); - BattleCardBase battleCardBase = GetBattleCardIdx(source.ToList(), int.Parse(buffCardInfo.CardName.Substring(1))); - for (int i = 0; i < buffCardInfo.MetamorphoseCount; i++) - { - if (battleCardBase.TransformInfo.OriginalCard == null) - { - break; - } - battleCardBase = battleCardBase.TransformInfo.OriginalCard; - } - if (battleCardBase.ReplayBuffInfoCard != null && battleCardBase.ReplayBuffInfoCard.CardId == buffCardInfo.CardId) - { - battleCardBase = battleCardBase.ReplayBuffInfoCard; - } - if (buffCardInfo.CardId != 0 && battleCardBase.BaseParameter.NormalCardId != buffCardInfo.CardId && battleCardBase.BaseParameter.BaseCardId != buffCardInfo.CardId) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(buffCardInfo.CardId); - BattleCardBase battleCardBase2 = (battleCardBase.ReplayBuffInfoCard = CreateBattleCard(buffCardInfo.CardId, battleCardBase.IsPlayer, null, cardParameterFromId, battleCardBase.SelfBattlePlayer, -1)); - battleCardBase = battleCardBase2; - } - return battleCardBase; - } - - public VfxBase UpdateBattleLog(List playerCards, List enemyCards, int battleLogIndex, List battleLogTextureInfoList) - { - if (_battleLogInfoList.Count == 0) - { - return NullVfx.GetInstance(); - } - if (battleLogIndex < _lastBattleLogIndex) - { - OperateMgr.BattleLogManager.RemoveAllBattleLogSet(); - _lastBattleLogIndex = 0; - } - for (int i = _lastBattleLogIndex; i < battleLogIndex; i++) - { - BattleLogInfo battleLogInfo = _battleLogInfoList[i]; - bool flag = battleLogInfo.IndexName.Substring(0, 1) == "p"; - BattleCardBase card = (CardMaster.IsChoiceBraveCardCheck(battleLogInfo.CardId) ? GetBattlePlayer(flag).ChoiceBraveCardList.First((BattleCardBase c) => c.CardId == battleLogInfo.CardId) : GetBattleCardIdx(flag ? playerCards : enemyCards, int.Parse(battleLogInfo.IndexName.Substring(1)))); - if (card.CardId != battleLogInfo.CardId) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(battleLogInfo.CardId); - card = CreateBattleCard(battleLogInfo.CardId, card.IsPlayer, null, cardParameterFromId, card.SelfBattlePlayer, -1); - } - BattleLogItem battleLogItem = null; - switch (battleLogInfo.ItemType) - { - case BattleLogItemType.Inner: - battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item) - { - item.SetInnerInReplay(battleLogInfo.Type, battleLogInfo.RightValueText, battleLogInfo.IsNecromance, battleLogInfo.MulliganChangedCount); - }, battleLogInfo.TextureOption, battleLogTextureInfoList); - break; - case BattleLogItemType.Turn: - battleLogItem = OperateMgr.BattleLogManager.AddLogTurn(battleLogInfo.IsSelf, battleLogInfo.Turn); - break; - case BattleLogItemType.SkillTiming: - battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item) - { - item.SetInnerOnSkillTimingInReplay(battleLogInfo.Type, battleLogInfo.IsNecromance); - }, battleLogInfo.TextureOption, battleLogTextureInfoList); - break; - case BattleLogItemType.Damage: - battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item) - { - item.SetInnerOnDamageInReplay(battleLogInfo.Type, card, battleLogInfo.RightValueText, battleLogInfo.IsDead); - }, battleLogInfo.TextureOption, battleLogTextureInfoList); - break; - case BattleLogItemType.Heal: - battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item) - { - item.SetInnerOnHealInReplay(battleLogInfo.Type, battleLogInfo.RightValueText); - }, battleLogInfo.TextureOption, battleLogTextureInfoList); - break; - case BattleLogItemType.SkillTarget: - { - string logText = null; - if (battleLogInfo.CardWithCount != -1) - { - logText = BattleLogUtility.GetCardWithCountText(card, battleLogInfo.CardWithCount); - } - else if (battleLogInfo.RandomArray != null) - { - logText = BattleLogUtility.BuildTextRandomArray(battleLogInfo.RandomArray); - } - battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item) - { - item.SetInnerOnSkillTargetInReplay(battleLogInfo.Type, battleLogInfo.IsMinus, logText, battleLogInfo.RightValueText, battleLogInfo.IsDead); - }, battleLogInfo.TextureOption, battleLogTextureInfoList); - break; - } - } - if (battleLogItem != null) - { - battleLogItem.SetupOnReplay(battleLogInfo.IsPlayerSideTurn, battleLogInfo.Turn); - } - } - _lastBattleLogIndex = battleLogIndex; - OperateMgr.BattleLogManager.ParentLogItemToGrid(); - List list = new List(); - Action action = delegate - { - }; - for (int num = 0; num < battleLogTextureInfoList.Count; num++) - { - BattleLogTextureInfo info = battleLogTextureInfoList[num]; - if (!list.Contains(info.TexturePath)) - { - list.Add(info.TexturePath); - } - action = (Action)Delegate.Combine(action, (Action)delegate - { - Texture texture = Toolbox.ResourcesManager.LoadObject(info.LogHeaderAssetPath); - info.HeaderUITexture.mainTexture = texture; - info.OnLoad.Call(texture); - }); - } - BattlePlayer.DeckSkillCardList.RemoveAll((BattleCardBase c) => !c.IsInDeck); - return SequentialVfxPlayer.Create(new WaitLoadResourceVfx(list, action)); - } - - public void UpdateClassInfoUi(NetworkBattleReceiver.ClassInfoUiInfo playerClassInfo, NetworkBattleReceiver.ClassInfoUiInfo enemyClassInfo) - { - if (playerClassInfo != null) - { - base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - BattlePlayer.ClassInformationUIController.NewReplayUpdateInfomation(playerClassInfo); - })); - } - if (enemyClassInfo != null) - { - base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - BattleEnemy.ClassInformationUIController.NewReplayUpdateInfomation(enemyClassInfo); - })); - } - } - - public void UpdateMyRotationBonus(List bonusInfoList) - { - int i; - for (i = 0; i < bonusInfoList.Count; i++) - { - (bonusInfoList[i].IsSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy)).BonusConditionList.FirstOrDefault((BattlePlayerBase.MyRotationBonusCondition b) => b.MyRotationBonus.AbilityId == bonusInfoList[i].AbilityId).SetConditionInReplay(bonusInfoList[i]); - } - } - - public void UpdateAvatarBattleDescValueList(NetworkBattleReceiver.AvatarBattleDescriptionValueInfo playerValueList, NetworkBattleReceiver.AvatarBattleDescriptionValueInfo enemyValueList) - { - if (playerValueList != null) - { - BattlePlayer.AvatarBattlePassiveSkillDescInfo.ReplaySkillDescriptionValueList = playerValueList.PassiveSkillDescriotionValueList; - for (int i = 0; i < BattlePlayer.ChoiceBraveSkillDescInfoList.Count; i++) - { - BattlePlayer.ChoiceBraveSkillDescInfoList[i].ReplaySkillDescriptionValueList = playerValueList.ChoiceBraveDescriotionValueListList[i]; - } - } - if (enemyValueList != null) - { - BattleEnemy.AvatarBattlePassiveSkillDescInfo.ReplaySkillDescriptionValueList = enemyValueList.PassiveSkillDescriotionValueList; - for (int j = 0; j < BattleEnemy.ChoiceBraveSkillDescInfoList.Count; j++) - { - BattleEnemy.ChoiceBraveSkillDescInfoList[j].ReplaySkillDescriptionValueList = enemyValueList.ChoiceBraveDescriotionValueListList[j]; - } - } - } - - public void ShowSideLog(BattleCardBase card, BattlePlayerBase player, bool isEvol, float time, bool isSkillTargetSelect, NetworkBattleReceiver.CardInfo cardInfo) - { - base.VfxMgr.RegisterImmediateVfx(CreateSideLog(card, player, isEvol, time, isSkillTargetSelect, cardInfo)); - } - - public VfxBase CreateSkillSideLog(List sideLogSkillInfoList) - { - if (sideLogSkillInfoList == null) - { - return NullVfx.GetInstance(); - } - ParallelVfxPlayer sideLogVfx = ParallelVfxPlayer.Create(); - List list = new List(); - for (int i = 0; i < sideLogSkillInfoList.Count; i++) - { - NetworkBattleReceiver.SideLogSkillInfo skillSideLogInfo = sideLogSkillInfoList[i]; - bool isSelf = skillSideLogInfo.IsSelf; - BattleCardBase battleCardBase = (CardMaster.IsChoiceBraveCardCheck(skillSideLogInfo.CardId) ? GetBattlePlayer(isSelf).ChoiceBraveCardList.First((BattleCardBase c) => c.CardId == skillSideLogInfo.CardId) : GetBattleCardIdx(isSelf ? BattlePlayer.AllCardsWithSkillIngredient.ToList() : BattleEnemy.AllCardsWithSkillIngredient.ToList(), skillSideLogInfo.Index)); - if (battleCardBase == null) - { - battleCardBase = list.FirstOrDefault((BattleCardBase c) => c.CardId == skillSideLogInfo.CardId && c.IsPlayer == skillSideLogInfo.IsSelf && c.Index == skillSideLogInfo.Index); - if (battleCardBase == null) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(skillSideLogInfo.CardId); - BattlePlayerBase battlePlayer = (skillSideLogInfo.IsSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy)); - battleCardBase = CreateBattleCard(skillSideLogInfo.CardId, skillSideLogInfo.IsSelf, null, cardParameterFromId, battlePlayer, skillSideLogInfo.Index); - list.Add(battleCardBase); - } - } - if (skillSideLogInfo.CardId != battleCardBase.CardId && battleCardBase.TransformInfo.OriginalCard != null && battleCardBase.TransformInfo.OriginalCard.CardId == skillSideLogInfo.CardId) - { - battleCardBase = battleCardBase.TransformInfo.OriginalCard; - } - if (skillSideLogInfo.IsPrivate) - { - VfxWith vfxWith = ReplaceReceivedCard(battleCardBase, skillSideLogInfo.CardInfo, isSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy), isFusion: false, isSideLog: true); - battleCardBase = vfxWith.Value; - base.VfxMgr.RegisterSequentialVfx(vfxWith.Vfx); - } - sideLogVfx.Register(CreateSideLog(battleCardBase, isSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy), isEvolSelect: false, 3f, isSkillTargetSelect: false, skillSideLogInfo.CardInfo, skillSideLogInfo)); - } - return InstantVfx.Create(delegate - { - ImmediateVfxMgr.GetInstance().Register(sideLogVfx); - }); - } - - public VfxBase CreateSideLog(BattleCardBase card, BattlePlayerBase player, bool isEvolSelect, float time, bool isSkillTargetSelect, NetworkBattleReceiver.CardInfo cardInfo, NetworkBattleReceiver.SideLogSkillInfo sideLogSkillInfo = null) - { - List sideLogDescriptionValueList = null; - List sideLogDescriptionValueList2 = null; - if (cardInfo != null) - { - sideLogDescriptionValueList = cardInfo.SkillDescriptionValueList; - sideLogDescriptionValueList2 = cardInfo.EvoSkillDescriptionValueList; - UpdateUnionBurstAndSkyboundArtModifier(card, cardInfo); - } - BattlePlayerBase.SideLogInfo sideLogInfo = new BattlePlayerBase.SideLogInfo(null); - string text; - if (sideLogSkillInfo?.IsEvolve ?? isEvolSelect) - { - text = card.EvoSkillDescription(sideLogInfo, isSkipOption: false, null, "", null, sideLogDescriptionValueList2); - if (card is UnitBattleCard && text == Data.SystemText.Get("Battle_0496")) - { - text = card.SkillDescription(sideLogInfo, isSkipOption: false, null, "", null, sideLogDescriptionValueList); - } - } - else - { - text = card.SkillDescription(sideLogInfo, isSkipOption: false, null, "", null, sideLogDescriptionValueList); - } - return new ShowSideLogVfx(card, null, player.BattleView.GetSideLogControl(isSkillTargetSelect), text, time, isEvolSelect, null, sideLogSkillInfo); - } - - private VfxBase HideDetailPanel(BattleCardBase card) - { - if (DetailMgr.DetailPanelControl._card == card) - { - return InstantVfx.Create(DetailMgr.DetailPanelControl.Hide); - } - return NullVfx.GetInstance(); - } - - public VfxBase AttachShortageDeckWin(BattleCardBase card, NetworkBattleReceiver.EffectInfo effectInfo) - { - return VfxWithLoadingSequential.Create(SkillBase.CreateSingleVfx(base.BattleResourceMgr, () => Vector3.zero, new List { card.SelfBattlePlayer.Class }, card.IsPlayer, card.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime), new SetShortageDeckWinVfx(card.SelfBattlePlayer.IsPlayer)); - } - - private void SetShortageDeckWin(bool isPlayer, bool isShortageDeckWin) - { - GameObject gameObject = (isPlayer ? CardHolder : ECardHolder); - if (gameObject.transform.childCount != 0) - { - GameObject gameObject2 = gameObject.transform.GetChild(GetMaxDeckCount(isPlayer)).gameObject; - string path = (isShortageDeckWin ? "sleeve_deckout_win" : "sleeve_deckout"); - gameObject2.GetComponent().material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.BattleTexture, isfetch: true)) as Texture; - } - } - - public VfxBase ShortageDeckWin(BattlePlayerBase player) - { - return new DeckOutWinVfx(player); - } - - public VfxBase ShortageDeckLose(bool isPlayer) - { - if (isPlayer) - { - return new PlayerDeckOutVfx(BattlePlayer, this); - } - return new EnemyDeckOutVfx(BattleEnemy, this); - } - - public VfxBase SpecialWin(BattleCardBase card, NetworkBattleReceiver.EffectInfo effectInfo) - { - int num = card.Skills.FindIndex(); - if (num != -1 && card.IsSpell && card.Skills.FirstOrDefault() is Skill_spell_charge) - { - num--; - } - string voice = card.BattleCardView.VoiceInfo.GetSkillVoice(card.IsEvolution, num).Voice; - return CreateSpecialBattleFinishEffect(card, new List { card.OpponentBattlePlayer.Class }, effectInfo, voice); - } - - public VfxBase SpecialLose(BattleCardBase card, NetworkBattleReceiver.EffectInfo effectInfo) - { - string voice = card.BattleCardView.VoiceInfo.GetSkillVoice(card.IsEvolution, card.Skills.FindIndex()).Voice; - return CreateSpecialBattleFinishEffect(card, new List { card.SelfBattlePlayer.Class }, effectInfo, voice); - } - - private VfxBase CreateSpecialBattleFinishEffect(BattleCardBase card, List effectTarget, NetworkBattleReceiver.EffectInfo effectInfo, string inductionSkillVoice) - { - SequentialVfxPlayer.Create(); - VfxWithLoading vfxWithLoading = CreateSkillEffect(card, effectTarget, effectInfo); - VfxBase vfxBase = SequentialVfxPlayer.Create(WaitVfx.Create(effectInfo.EffectTime), InstantVfx.Create(delegate - { - Skill_special_win.ShakeScreen(); - })); - VfxBase vfxBase2 = NullVfx.GetInstance(); - if (!ReadOnlyVoiceInfo.IsInvalidFileName(inductionSkillVoice)) - { - string text = card.BattleCardView.VoiceInfo.VoiceId; - if (string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(inductionSkillVoice) && inductionSkillVoice != "NONE".ToLower()) - { - text = inductionSkillVoice.Split(new string[1] { "_" }, StringSplitOptions.None)[0]; - } - vfxBase2 = VfxWithLoading.Create(new WaitLoadVoiceResourceVfx(card.BattleCardView, text), new PlayCRISoundVfx(card.BattleCardView, inductionSkillVoice)); - } - ParallelVfxPlayer mainVfx = ParallelVfxPlayer.Create(vfxWithLoading.MainVfx, vfxBase2, vfxBase); - return VfxWithLoading.Create(vfxWithLoading.LoadingVfx, mainVfx); - } - - public VfxBase BattleFinish(bool isWin, bool isPlayerDead, bool isEnemyDead, FINISH_TYPE type, NetworkBattleReceiver.RESULT_CODE resultCode) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - DisableMoveTurnButton(); - _moveTurnButton.ForwardReplayButton.isEnabled = false; - _moveTurnButton.StopReplayButton.isEnabled = false; - bool flag = BattlePlayer.Class.IsDead || BattleEnemy.Class.IsDead; - if (!(type == FINISH_TYPE.RETIRE && flag)) - { - if (BattlePlayer.Class.IsDead && BattleEnemy.Class.IsDead) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - BattlePlayer.Class.FlagCardAsDestroyedByKiller(); - BattleEnemy.Class.FlagCardAsDestroyedByKiller(); - parallelVfxPlayer.Register(DeadClass(PlayerDead: true, type)); - parallelVfxPlayer.Register(DeadClass(PlayerDead: false, type)); - sequentialVfxPlayer.Register(parallelVfxPlayer); - } - else if (isPlayerDead && isEnemyDead) - { - BattlePlayer.Class.FlagCardAsDestroyedByKiller(); - BattleEnemy.Class.FlagCardAsDestroyedByKiller(); - if (resultCode == NetworkBattleReceiver.RESULT_CODE.DisconnectWin) - { - sequentialVfxPlayer.Register(DeadClass(PlayerDead: true, type)); - sequentialVfxPlayer.Register(DeadClass(PlayerDead: false, type)); - } - else if (resultCode == NetworkBattleReceiver.RESULT_CODE.DisconnectLose) - { - sequentialVfxPlayer.Register(DeadClass(PlayerDead: false, type)); - sequentialVfxPlayer.Register(DeadClass(PlayerDead: true, type)); - } - } - else - { - GetBattlePlayer(!isWin).Class.FlagCardAsDestroyedByKiller(); - sequentialVfxPlayer.Register(DeadClass(!isWin, type)); - } - } - sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(BattlePlayer.BattleView.AttackSelectControl.ResetCardAfterAttackOnReplay(), BattleEnemy.BattleView.AttackSelectControl.ResetCardAfterAttackOnReplay())); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - SettingSpecialResultTypeText(isWin, resultCode); - InitiateGameEndSequence(isWin); - })); - base.VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); - for (int num = 0; num < BattlePlayer.HandCardList.Count; num++) - { - BattlePlayer.HandCardList[num].BattleCardView.HideCanPlayEffect(); - } - BattlePlayer.BattleView.HideChoiceBraveButtonPulsateEffect(); - return sequentialVfxPlayer; - } - - private void SettingSpecialResultTypeText(bool isWin, NetworkBattleReceiver.RESULT_CODE resultCode) - { - string text = string.Empty; - if (isWin) - { - switch (resultCode) - { - case NetworkBattleReceiver.RESULT_CODE.RetireWin: - text = Data.SystemText.Get("Battle_0418"); - break; - case NetworkBattleReceiver.RESULT_CODE.NotFinish: - case NetworkBattleReceiver.RESULT_CODE.DisconnectWin: - case NetworkBattleReceiver.RESULT_CODE.FirstcardWin: - case NetworkBattleReceiver.RESULT_CODE.TurnendWin: - case NetworkBattleReceiver.RESULT_CODE.TurnstartWin: - text = Data.SystemText.Get("Battle_0420"); - break; - } - } - else if (resultCode == NetworkBattleReceiver.RESULT_CODE.DisconnectLose || resultCode == NetworkBattleReceiver.RESULT_CODE.FirstcardLose || resultCode == NetworkBattleReceiver.RESULT_CODE.TurnendLose || resultCode == NetworkBattleReceiver.RESULT_CODE.TurnstartLose || resultCode == NetworkBattleReceiver.RESULT_CODE.NotFinish) - { - text = Data.SystemText.Get("Battle_0421"); - } - if (text.IsNotNullOrEmpty()) - { - BattleResultControl.SetSpecialResultTypeText(text); - } - } -} +using System; +using System.Collections.Generic; +using UnityEngine; +using Wizard.BattleMgr; + +// PASS-6 STUB: 1,606-line body dropped. NewReplayBattleMgr is the client-side new-replay +// battle manager (replay playback UI, move-turn buttons, per-frame battle-info panels). +// Nothing constructs a NewReplayBattleMgr in the headless node — the node uses +// HeadlessNetworkBattleMgr : NetworkStandardBattleMgr : NetworkBattleManagerBase, a +// sibling subtree. The three externally-touched surfaces below are all the outside +// world needs: +// 1. Nested types ParameterModifierInfo / BattleInfoData / BattleLogTextureInfo — +// NetworkBattleReceiver.cs references them as list-element and return types on +// the headless CreateBattleInfoData / UpdateBattleInfo path (the path itself is +// dead in headless — `networkBattleMgr as NewReplayBattleMgr` returns null so the +// Update calls NRE, but they never fire in a real headless message flow). +// DetailPanelControl.LoadCardHeaderTexture takes a List +// parameter (used to belong to the Wizard chain). BattleLogManager (Shim/Generated) +// also has List in two method signatures. +// 2. PlayerBattleInfoData / EnemyBattleInfoData — read via `(networkBattleMgr as +// NewReplayBattleMgr).PlayerBattleInfoData` from NetworkBattleReceiver:774. The +// cast is null in headless, so the deref NREs — this is the SAME class of NRE +// as the pass-5 RecoveryOperationCollection pin, but the code path never reaches +// NetworkBattleReceiver:774 in a real receive flow. Kept as empty lists so any +// degenerate test path returns safely. +// 3. SetActiveMoveTurnButton — called from MainPhase.cs:98 under `_battleManager is +// NewReplayBattleMgr` guard. In headless the guard is false so the call never +// fires; the no-op body is just for the compile-time signature. +public class NewReplayBattleMgr : NetworkReplayBattleMgr +{ + public class ParameterModifierInfo + { + public NetworkBattleReceiver.ReplayParameterModifierType ModifierType; + public int ModifierValue; + + public ParameterModifierInfo(NetworkBattleReceiver.ReplayParameterModifierType modifierType, int modifierValue) + { + ModifierType = modifierType; + ModifierValue = modifierValue; + } + } + + public class BattleInfoData + { + } + + public class BattleLogTextureInfo + { + public string TexturePath { get; private set; } + public string LogHeaderAssetPath { get; private set; } + public UITexture HeaderUITexture { get; private set; } + public Action OnLoad { get; private set; } + + public BattleLogTextureInfo(string texturePath, string logHeaderAssetPath, UITexture headerUITexture, Action onLoad) + { + TexturePath = texturePath; + LogHeaderAssetPath = logHeaderAssetPath; + HeaderUITexture = headerUITexture; + OnLoad = onLoad; + } + } + + public NewReplayBattleMgr(IBattleMgrContentsCreator contentsCreator) : base(contentsCreator) { } + + public void SetActiveMoveTurnButton(bool isActive) { } +} diff --git a/SVSim.BattleEngine/Engine/NewReplayOperateReceive.cs b/SVSim.BattleEngine/Engine/NewReplayOperateReceive.cs deleted file mode 100644 index bd21c641..00000000 --- a/SVSim.BattleEngine/Engine/NewReplayOperateReceive.cs +++ /dev/null @@ -1,312 +0,0 @@ -public class NewReplayOperateReceive : OperateReceive -{ - private bool _isFirstMulligan = true; - - public NewReplayOperateReceive(NetworkBattleManagerBase networkBattleMgr, RegisterActionManager registerCardList, OperateMgr operateMgr, NetworkBattleData networkBattleData) - : base(networkBattleMgr, registerCardList, operateMgr, networkBattleData) - { - } - - protected override PlayHandCardReflection CreateNetworkPlayCardAction() - { - return new ReplayPlayCardAction(_battleMgr, _operateMgr, _networkBattleData); - } - - protected override InPlayCardReflection CreateNetworkInPlayAction() - { - return new ReplayInPlayAction(_battleMgr, _operateMgr); - } - - public void StartReplayOperate(NewReplayOperationCollection networkOperationCollection, NetworkBattleReceiver.ReplayReceiveData receiveData) - { - switch (receiveData.Operation) - { - case NetworkBattleReceiver.ReplayOperationType.MulliganStart: - networkOperationCollection.DealOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.MulliganEnd: - if (_isFirstMulligan) - { - _isFirstMulligan = false; - networkOperationCollection.SwapOperation(OnReceiveOpponentMulligan, OnReceivePlayerMulligan); - } - else - { - _isFirstMulligan = true; - networkOperationCollection.SecondMulliganOperation(OnReceiveOpponentMulligan, OnReceivePlayerMulligan, OnEndMulligan); - } - break; - case NetworkBattleReceiver.ReplayOperationType.TurnStart: - networkOperationCollection.TurnStartOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.TurnStartFinish: - networkOperationCollection.TurnStartFinishOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.TurnEnd: - networkOperationCollection.TurnEndOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.TurnEndFinish: - networkOperationCollection.TurnEndFinishOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.AddPpTotal: - networkOperationCollection.AddPpTotalOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.AddPp: - networkOperationCollection.AddPpOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.AddBp: - networkOperationCollection.AddBpOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.AddEp: - networkOperationCollection.AddEpOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SetEp: - networkOperationCollection.SetEpOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Draw: - networkOperationCollection.DrawCardOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.TokenDraw: - networkOperationCollection.TokenDrawCardOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CreateReservedCard: - networkOperationCollection.CreateReservedCardOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Play: - if (receiveData.IsChoiceBraveData) - { - networkOperationCollection.PlayChoiceBraveCardOperation(); - } - else - { - networkOperationCollection.PlayHandCardOperation(); - } - break; - case NetworkBattleReceiver.ReplayOperationType.ShowWhenPlayEffect: - networkOperationCollection.ShowWhenPlayEffectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SummonToken: - networkOperationCollection.SummonTokenOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SummonCard: - networkOperationCollection.SummonCardOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.AttackStart: - networkOperationCollection.AttackStartOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Attack: - networkOperationCollection.AttackOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CostChange: - networkOperationCollection.CostChangeOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.RemoveCostChange: - networkOperationCollection.RemoveCostChangeOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.PowerUp: - networkOperationCollection.PowerUpOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.GainPowerDown: - networkOperationCollection.GainPowerDownOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SetPowerDown: - networkOperationCollection.SetPowerDownOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.DepriveBuff: - networkOperationCollection.DepriveBuffOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SpellCharge: - networkOperationCollection.SpellChargeOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Damage: - networkOperationCollection.DamageOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Heal: - networkOperationCollection.HealOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Discard: - networkOperationCollection.DiscardOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.DestroyOrBanish: - networkOperationCollection.DestroyOrBanishOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Evolve: - networkOperationCollection.EvolveOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SkillEvolve: - networkOperationCollection.SkillEvolveOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Return: - networkOperationCollection.ReturnOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.StartSelect: - networkOperationCollection.StartSelectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Select: - networkOperationCollection.SelectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CompSelect: - networkOperationCollection.CompleteSelectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CancelSelect: - networkOperationCollection.CancelSelectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.StartChoice: - networkOperationCollection.StartChoiceOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CompChoice: - networkOperationCollection.CompleteChoiceOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CancelChoice: - networkOperationCollection.CancelChoiceOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.StartFusion: - networkOperationCollection.StartFusionOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.SelectFusion: - networkOperationCollection.SelectFusionOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CompFusion: - networkOperationCollection.CompleteFusionOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.CancelFusion: - networkOperationCollection.CancelFusionOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.ChantCountChange: - networkOperationCollection.ChantCountChangeOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.ChangeWhiteRitualStack: - networkOperationCollection.ChangeWhiteRitualStackOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Necromance: - networkOperationCollection.Necromance(); - break; - case NetworkBattleReceiver.ReplayOperationType.ChangeMaxAttackableCount: - networkOperationCollection.ChangeMaxAttackableCountOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateDeck: - networkOperationCollection.UpdateDeckOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.IndexChange: - networkOperationCollection.IndexChangeOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Metamorphose: - networkOperationCollection.MetamorphoseOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Geton: - networkOperationCollection.GetonOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Getoff: - networkOperationCollection.GetoffOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.Unite: - networkOperationCollection.UniteOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.OpenCard: - networkOperationCollection.OpenCardOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.AttachSkill: - networkOperationCollection.ShowSkillEffectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.ShowSkillEffect: - networkOperationCollection.ShowSkillEffectOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.ShowSkillInductionEffect: - networkOperationCollection.ShowSkillInductionEffect(); - break; - case NetworkBattleReceiver.ReplayOperationType.ShowIndependentEffect: - networkOperationCollection.ShowIndependentEffect(); - break; - case NetworkBattleReceiver.ReplayOperationType.ChangeAffiliation: - networkOperationCollection.ChangeAffiliationOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.OnChangeUnionBurstAndSkyboundArt: - networkOperationCollection.ShowChangeUnionBurstAndSkyboundArtEffect(); - break; - case NetworkBattleReceiver.ReplayOperationType.ShowRepeatSkillEffect: - networkOperationCollection.ShowRepeatSkillEffect(); - break; - case NetworkBattleReceiver.ReplayOperationType.GiveCantActivateFanfare: - networkOperationCollection.GiveCantActivateFanfareOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.DepriveCantActivateFanfare: - networkOperationCollection.DepriveCantActivateFanfareOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.LoseSkill: - networkOperationCollection.LoseSkillOperation(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateHandInfo: - networkOperationCollection.UpdateHandInfo(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateChoiceBraveButtonEffet: - networkOperationCollection.UpdateChoiceBraveButtonEffet(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateInplayInfo: - networkOperationCollection.UpdateInplayInfo(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateDeckInfo: - networkOperationCollection.UpdateDeckInfo(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateAttachedCardInfo: - networkOperationCollection.UpdateAttachedCardInfo(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateFusionCardInfo: - networkOperationCollection.UpdateFusionCardInfo(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateStatusPanel: - networkOperationCollection.UpdateStatusPanel(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateBattleInfo: - networkOperationCollection.UpdateBattleLog(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateClassInfoUi: - networkOperationCollection.UpdateClassInfoUi(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateMyRotationBonus: - networkOperationCollection.UpdateMyRotationBonus(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateAvatarBattleDescInfo: - networkOperationCollection.UpdateAvatarBattleDescValueList(); - break; - case NetworkBattleReceiver.ReplayOperationType.UpdateAttackableEffect: - networkOperationCollection.UpdateAttackableEffect(); - break; - case NetworkBattleReceiver.ReplayOperationType.SkillProcessStart: - networkOperationCollection.SkillProcessStart(); - break; - case NetworkBattleReceiver.ReplayOperationType.SkillVfxStart: - networkOperationCollection.SkillVfxStart(); - break; - case NetworkBattleReceiver.ReplayOperationType.SkillVfxEnd: - networkOperationCollection.SkillVfxEnd(); - break; - case NetworkBattleReceiver.ReplayOperationType.ClearSideLog: - networkOperationCollection.ClearSideLog(); - break; - case NetworkBattleReceiver.ReplayOperationType.ClearDestroyedCardList: - networkOperationCollection.ClearDestroyedCardList(); - break; - case NetworkBattleReceiver.ReplayOperationType.PlayEmotion: - networkOperationCollection.PlayEmotion(); - break; - case NetworkBattleReceiver.ReplayOperationType.AttachShortageDeckWin: - networkOperationCollection.AttachShortageDeckWin(); - break; - case NetworkBattleReceiver.ReplayOperationType.ShortageDeckWin: - networkOperationCollection.ShortageDeckWin(); - break; - case NetworkBattleReceiver.ReplayOperationType.ShortageDeckLose: - networkOperationCollection.ShortageDeckLose(); - break; - case NetworkBattleReceiver.ReplayOperationType.SpecialWin: - networkOperationCollection.SpecialWin(); - break; - case NetworkBattleReceiver.ReplayOperationType.SpecialLose: - networkOperationCollection.SpecialLose(); - break; - case NetworkBattleReceiver.ReplayOperationType.BattleFinish: - networkOperationCollection.BattleFinish(); - break; - } - } -} diff --git a/SVSim.BattleEngine/Engine/NewReplayOperationCollection.cs b/SVSim.BattleEngine/Engine/NewReplayOperationCollection.cs deleted file mode 100644 index c97c7d6e..00000000 --- a/SVSim.BattleEngine/Engine/NewReplayOperationCollection.cs +++ /dev/null @@ -1,924 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Wizard.Battle.View.Vfx; - -public class NewReplayOperationCollection -{ - private readonly NetworkBattleReceiver.ReplayReceiveData _receivedData; - - private readonly NewReplayBattleMgr _networkReplayBattleMgr; - - private readonly NetworkBattleData _networkBattleData; - - private ReplayBattlePlayer ReplayBattlePlayer; - - private ReplayBattleEnemy ReplayBattleEnemy; - - public NewReplayOperationCollection(NetworkReplayBattleMgr networkReplayBattleMgr, NetworkBattleReceiver.ReplayReceiveData receiveData, NetworkBattleData networkBattleData) - { - _receivedData = receiveData; - _networkReplayBattleMgr = networkReplayBattleMgr as NewReplayBattleMgr; - _networkBattleData = networkBattleData; - ReplayBattlePlayer = _networkReplayBattleMgr.BattlePlayer as ReplayBattlePlayer; - ReplayBattleEnemy = _networkReplayBattleMgr.BattleEnemy as ReplayBattleEnemy; - } - - private void RegisterSequentialVfx(VfxBase operationVfx) - { - if (_networkReplayBattleMgr.IsDuringSkillProcess) - { - if (operationVfx is VfxWithLoading vfxWithLoadingToRegister) - { - _networkReplayBattleMgr.SkillVfxStack.Peek().RegisterVfxWithLoading(vfxWithLoadingToRegister); - } - else - { - _networkReplayBattleMgr.SkillVfxStack.Peek().RegisterToMainVfx(operationVfx); - } - } - else - { - _networkReplayBattleMgr.VfxMgr.RegisterSequentialVfx(operationVfx); - } - } - - public void DealOperation() - { - _networkReplayBattleMgr.SetSkillDescriptionValueList(ReplayBattlePlayer.AllCards.ToList(), _receivedData.CardInfoList); - _networkReplayBattleMgr.OperateReceive.OnReceiveDeal(_receivedData.selfIdxList, _receivedData.oppoIdxList); - RegisterSequentialVfx(WaitVfx.Create(0.2f)); - } - - public void SwapOperation(Func, VfxBase> OnReceiveOpponentMulligan, Func, VfxBase> OnReceivePlayerMulligan) - { - OperateMulligan(OnReceiveOpponentMulligan, OnReceivePlayerMulligan); - } - - public void SecondMulliganOperation(Func, VfxBase> OnReceiveOpponentMulligan, Func, VfxBase> OnReceivePlayerMulligan, Func OnEndMulligan) - { - OperateMulligan(OnReceiveOpponentMulligan, OnReceivePlayerMulligan); - RegisterSequentialVfx(OnEndMulligan.GetAllFuncVfxResults()); - } - - private void OperateMulligan(Func, VfxBase> OnReceiveOpponentMulligan, Func, VfxBase> OnReceivePlayerMulligan) - { - if (_receivedData.isSelf) - { - _networkReplayBattleMgr.SetSkillDescriptionValueList(ReplayBattlePlayer.AllCards.ToList(), _receivedData.CardInfoList); - } - RegisterSequentialVfx(_receivedData.isSelf ? OperatePlayerMulligan(_receivedData, OnReceivePlayerMulligan) : OperateOppoMulligan(_receivedData, OnReceiveOpponentMulligan)); - } - - private VfxBase OperatePlayerMulligan(NetworkBattleReceiver.ReplayReceiveData receiveData, Func, VfxBase> OnReceivePlayerMulligan) - { - if (_networkBattleData.isPlayerMulliganEnd) - { - return NullVfx.GetInstance(); - } - if (receiveData.selfIdxList != null && receiveData.selfIdxList.Count >= 1) - { - _networkBattleData.isPlayerMulliganEnd = true; - return OnReceivePlayerMulligan.GetAllFuncVfxResults(receiveData.selfIdxList); - } - return NullVfx.GetInstance(); - } - - protected virtual VfxBase OperateOppoMulligan(NetworkBattleReceiver.ReplayReceiveData receiveData, Func, VfxBase> OnReceiveOpponentMulligan) - { - if (_networkBattleData.isOppoMulliganEnd) - { - return NullVfx.GetInstance(); - } - if (receiveData.oppoIdxList != null && receiveData.oppoIdxList.Count >= 1) - { - _networkBattleData.isOppoMulliganEnd = true; - return OnReceiveOpponentMulligan.GetAllFuncVfxResults(receiveData.oppoIdxList); - } - return NullVfx.GetInstance(); - } - - public void TurnStartOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.StartTurnControl() : ReplayBattleEnemy.StartTurnControl()); - } - - public void TurnStartFinishOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.TurnStartFinish() : ReplayBattleEnemy.TurnStartFinish()); - } - - public void TurnEndOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.TurnEnd()); - } - - public void TurnEndFinishOperation() - { - if (_receivedData.isSelf) - { - ReplayBattlePlayer.IsSelfTurn = false; - } - else - { - ReplayBattleEnemy.IsSelfTurn = false; - } - } - - public void AddPpTotalOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.AddPpTotal(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.AddPpTotalCount, _receivedData.Pp, _receivedData.BySkill) : ReplayBattleEnemy.AddPpTotal(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.AddPpTotalCount, _receivedData.Pp)); - } - - public void AddPpOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.AddPp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Pp) : ReplayBattleEnemy.AddPp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Pp)); - } - - public void AddBpOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.AddBp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Bp) : ReplayBattleEnemy.AddBp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Bp)); - } - - public void AddEpOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.AddEp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Ep, _receivedData.EffectInfo) : ReplayBattleEnemy.AddEp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Ep, _receivedData.EffectInfo)); - } - - public void SetEpOperation() - { - RegisterSequentialVfx(_receivedData.isSelf ? ReplayBattlePlayer.SetEp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Ep, _receivedData.EffectInfo) : ReplayBattleEnemy.SetEp(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.Ep, _receivedData.EffectInfo)); - } - - public void DrawCardOperation() - { - if (_receivedData.isSelf) - { - List list = new List(); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < _receivedData.CardInfoList.Count; i++) - { - BattleCardBase drawCard = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.DeckCardList, _receivedData.CardInfoList[i].Index); - _networkReplayBattleMgr.ClearAndUpdateParameterModifier(drawCard, _receivedData.CardInfoList[i]); - int cost = drawCard.Cost; - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - drawCard.BattleCardView.UpdateCost(drawCard.BattleCardView.GetUseCostList(cost, useNomalCost: true), isGenerateInHand: true, playEffect: false, isForceUpdate: true); - })); - list.Add(drawCard); - } - RegisterSequentialVfx(parallelVfxPlayer); - RegisterSequentialVfx(ReplayBattlePlayer.DrawCard(list, _receivedData.CardInfoList, _receivedData.IsOpenDrawSkill)); - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateHandInfo(ReplayBattlePlayer.HandCardList, ReplayBattleEnemy.HandCardList, _receivedData.CardInfoList, ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient)); - return; - } - List list2 = new List(); - if (_receivedData.IsOpenDrawSkill) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - for (int num = 0; num < _receivedData.CardInfoList.Count; num++) - { - BattleCardBase battleCardIdx = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.DeckCardList, _receivedData.CardInfoList[num].Index); - VfxWith vfxWith = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardIdx, _receivedData.CardInfoList[num], ReplayBattleEnemy, isFusion: false); - BattleCardBase card = vfxWith.Value; - int cost2 = _receivedData.CardInfoList[num].Cost; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView.UpdateParameterView(card.Atk, card.Life, cost2, card.BaseParameter.CardName, card.IsInplay); - })); - list2.Add(card); - sequentialVfxPlayer.Register(vfxWith.Vfx); - } - RegisterSequentialVfx(sequentialVfxPlayer); - } - else - { - list2 = _receivedData.CardInfoList.Select((NetworkBattleReceiver.CardInfo cardInfo) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.DeckCardList, cardInfo.Index)).ToList(); - } - RegisterSequentialVfx(ReplayBattleEnemy.DrawCard(list2, _receivedData.CardInfoList, _receivedData.IsOpen, _receivedData.IsOpenDrawSkill)); - } - - public void TokenDrawCardOperation() - { - if (_receivedData.isSelf) - { - List targets = _receivedData.TargetIndexList.Select((int i) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.AllCardsWithSkillIngredient, i)).ToList(); - RegisterSequentialVfx(ReplayBattlePlayer.TokenDrawCard(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, targets, _receivedData.IsOpen, _receivedData.IsReserved, _receivedData.EffectInfo)); - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateHandInfo(ReplayBattlePlayer.HandCardList, ReplayBattleEnemy.HandCardList, _receivedData.CardInfoList, ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient)); - } - else - { - List targets2 = _receivedData.TargetIndexList.Select((int i) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.AllCardsWithSkillIngredient, i)).ToList(); - RegisterSequentialVfx(ReplayBattleEnemy.TokenDrawCard(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, targets2, _receivedData.IsOpen, _receivedData.IsReserved, _receivedData.EffectInfo)); - } - } - - public void CreateReservedCardOperation() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.CreateReservedCard(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.CreateReservedCard(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList)); - } - } - - public void PlayHandCardOperation() - { - if (ReplayBattlePlayer.IsSelfTurn) - { - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattlePlayer, _receivedData.CardInfo.Index); - _networkReplayBattleMgr.UpdateSkillDescriptionValueList(indexToCardBase, _receivedData.CardInfo); - _networkReplayBattleMgr.UpdateExecutedFixedUseCostIndex(indexToCardBase, _receivedData.CardInfo); - _networkReplayBattleMgr.UpdateUnionBurstAndSkyboundArtModifier(indexToCardBase, _receivedData.CardInfo); - RegisterSequentialVfx(ReplayBattlePlayer.PlayCard(indexToCardBase, _receivedData.Cost, _receivedData.TransformCardId, _receivedData.TransformType, _receivedData.CardInfo)); - return; - } - BattleCardBase battleCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattleEnemy, _receivedData.CardInfo.Index); - if (_receivedData.TransformCardId == -1 || _receivedData.TransformType == BattleCardBase.TransformType.Accelerate || _receivedData.TransformType == BattleCardBase.TransformType.Crystallize) - { - VfxWith vfxWith = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardBase, _receivedData.CardInfo, ReplayBattleEnemy, isFusion: false); - battleCardBase = vfxWith.Value; - RegisterSequentialVfx(vfxWith.Vfx); - } - RegisterSequentialVfx(ReplayBattleEnemy.PlayCard(battleCardBase, _receivedData.Cost, _receivedData.TransformCardId, _receivedData.TransformType, _receivedData.CardInfo)); - } - - public void PlayChoiceBraveCardOperation() - { - if (ReplayBattlePlayer.IsSelfTurn) - { - RegisterSequentialVfx(ReplayBattlePlayer.PlayChoiceBraveCard(_receivedData.Cost, _receivedData.TransformCardId, _receivedData.CardInfo)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.PlayChoiceBraveCard(_receivedData.Cost, _receivedData.TransformCardId, _receivedData.CardInfo)); - } - } - - public void ShowWhenPlayEffectOperation() - { - BattleCardBase battleCardBase = (_receivedData.isSelf ? NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattlePlayer, _receivedData.CardIndex) : NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattleEnemy, _receivedData.CardIndex)); - RegisterSequentialVfx(_networkReplayBattleMgr.CreateWhenPlayEffect(_receivedData.WhenPlayEffectType, battleCardBase.BattleCardView, _receivedData.IsInvoked)); - } - - public void SummonTokenOperation() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.SummonToken(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, _receivedData.EffectInfo, _receivedData.IsOwnerEffect, _receivedData.IsIgnoreVoice, _receivedData.IsRandomVoice, _receivedData.IsEvoVoice)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.SummonToken(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, _receivedData.EffectInfo, _receivedData.IsOwnerEffect, _receivedData.IsIgnoreVoice, _receivedData.IsRandomVoice, _receivedData.IsEvoVoice)); - } - } - - public void SummonCardOperation() - { - if (_receivedData.isSelf) - { - List list = new List(); - for (int i = 0; i < _receivedData.CardInfoList.Count; i++) - { - BattleCardBase battleCardIdx = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.AllCards.ToList(), _receivedData.CardInfoList[i].Index); - _networkReplayBattleMgr.UpdateParameterModifierAndCostView(battleCardIdx, _receivedData.CardInfoList[i]); - list.Add(battleCardIdx); - } - RegisterSequentialVfx(ReplayBattlePlayer.SummonCard(GetOwnerCard(_receivedData.OwnerCardName), list, _receivedData.IsDeckSelf, _receivedData.IsBurialRite, _receivedData.EffectInfo, _receivedData.IsIgnoreVoice, _receivedData.CardInfoList)); - return; - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - List list2 = new List(); - for (int j = 0; j < _receivedData.CardInfoList.Count; j++) - { - BattleCardBase battleCardIdx2 = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.AllCards.ToList(), _receivedData.CardInfoList[j].Index); - VfxWith vfxWith = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardIdx2, _receivedData.CardInfoList[j], ReplayBattleEnemy, isFusion: false); - list2.Add(vfxWith.Value); - sequentialVfxPlayer.Register(vfxWith.Vfx); - } - RegisterSequentialVfx(sequentialVfxPlayer); - RegisterSequentialVfx(ReplayBattleEnemy.SummonCard(GetOwnerCard(_receivedData.OwnerCardName), list2, _receivedData.IsDeckSelf, _receivedData.IsBurialRite, _receivedData.EffectInfo, _receivedData.IsIgnoreVoice, _receivedData.CardInfoList)); - } - - public void AttackStartOperation() - { - if (_receivedData.isSelf) - { - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattlePlayer, _receivedData.CardIndex); - BattleCardBase indexToCardBase2 = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattleEnemy, _receivedData.TargetIndexList[0]); - RegisterSequentialVfx(ReplayBattlePlayer.AttackStart(indexToCardBase, indexToCardBase2)); - } - else - { - BattleCardBase indexToCardBase3 = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattleEnemy, _receivedData.CardIndex); - BattleCardBase indexToCardBase4 = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattlePlayer, _receivedData.TargetIndexList[0]); - RegisterSequentialVfx(ReplayBattleEnemy.AttackStart(indexToCardBase3, indexToCardBase4)); - } - } - - public void AttackOperation() - { - List cardListFromCardNameList = GetCardListFromCardNameList(_receivedData.DestroyCardNameList); - List cardListFromCardNameList2 = GetCardListFromCardNameList(_receivedData.BanishCardNameList); - if (_receivedData.isSelf) - { - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattlePlayer, _receivedData.CardIndex); - BattleCardBase indexToCardBase2 = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattleEnemy, _receivedData.TargetIndexList[0]); - RegisterSequentialVfx(ReplayBattlePlayer.Attack(indexToCardBase, indexToCardBase2, _receivedData.DealDamageList[0], _receivedData.ReceiveDamage, cardListFromCardNameList, _receivedData.DestroyTypeList, cardListFromCardNameList2, _receivedData.HealList[0], _receivedData.CardInfo, _receivedData.SideLogSkillInfoList, _receivedData.IsAttackerDead, _receivedData.IsTargetDead)); - } - else - { - BattleCardBase indexToCardBase3 = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattleEnemy, _receivedData.CardIndex); - BattleCardBase indexToCardBase4 = NetworkBattleGenericTool.GetIndexToCardBase(_networkReplayBattleMgr, ReplayBattlePlayer, _receivedData.TargetIndexList[0]); - RegisterSequentialVfx(ReplayBattleEnemy.Attack(indexToCardBase3, indexToCardBase4, _receivedData.DealDamageList[0], _receivedData.ReceiveDamage, cardListFromCardNameList, _receivedData.DestroyTypeList, cardListFromCardNameList2, _receivedData.HealList[0], _receivedData.CardInfo, _receivedData.SideLogSkillInfoList, _receivedData.IsAttackerDead, _receivedData.IsTargetDead)); - } - } - - public void CostChangeOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.CostChange(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.AddCostList, _receivedData.SetCostList, _receivedData.IsCostUpList, _receivedData.IsHalf, _receivedData.IsSpellCharge, _receivedData.IsOpenCard, _receivedData.EffectInfo)); - } - - public void RemoveCostChangeOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.RemoveCostChange(GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.RemoveCostChangeList, _receivedData.IsSpellCharge, _receivedData.IsAdd)); - } - - public void PowerUpOperation() - { - List cardListFromCardNameList = GetCardListFromCardNameList(_receivedData.DestroyCardNameList); - List cardListFromCardNameList2 = GetCardListFromCardNameList(_receivedData.BanishCardNameList); - BattleCardBase playVoiceOnDeathCard = GetPlayVoiceOnDeathCard(_receivedData.PlayVoiceOnDeathCard); - RegisterSequentialVfx(_networkReplayBattleMgr.PowerUp(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.Attack, _receivedData.Life, _receivedData.MultiplyAttack, _receivedData.MultiplyLife, _receivedData.MaxLife, cardListFromCardNameList, _receivedData.DestroyTypeList, cardListFromCardNameList2, _receivedData.EffectInfo, playVoiceOnDeathCard, _receivedData.SideLogSkillInfoList)); - } - - public void GainPowerDownOperation() - { - List cardListFromCardNameList = GetCardListFromCardNameList(_receivedData.DestroyCardNameList); - List cardListFromCardNameList2 = GetCardListFromCardNameList(_receivedData.BanishCardNameList); - BattleCardBase playVoiceOnDeathCard = GetPlayVoiceOnDeathCard(_receivedData.PlayVoiceOnDeathCard); - RegisterSequentialVfx(_networkReplayBattleMgr.GainPowerDown(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.Attack, _receivedData.Life, _receivedData.MaxLife, cardListFromCardNameList, _receivedData.DestroyTypeList, cardListFromCardNameList2, _receivedData.EffectInfo, playVoiceOnDeathCard, _receivedData.SideLogSkillInfoList)); - } - - public void SetPowerDownOperation() - { - List cardListFromCardNameList = GetCardListFromCardNameList(_receivedData.DestroyCardNameList); - List cardListFromCardNameList2 = GetCardListFromCardNameList(_receivedData.BanishCardNameList); - BattleCardBase playVoiceOnDeathCard = GetPlayVoiceOnDeathCard(_receivedData.PlayVoiceOnDeathCard); - RegisterSequentialVfx(_networkReplayBattleMgr.SetPowerDown(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.Attack, _receivedData.Life, _receivedData.MaxLife, cardListFromCardNameList, _receivedData.DestroyTypeList, cardListFromCardNameList2, _receivedData.EffectInfo, playVoiceOnDeathCard, _receivedData.SideLogSkillInfoList)); - } - - public void DepriveBuffOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.DepriveBuff(GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.DepriveOffenseBuffList, _receivedData.DepriveLifeBuffList)); - } - - public void SpellChargeOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.SpellCharge(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.AddSpellChargeList, _receivedData.EffectInfo)); - } - - private BattleCardBase GetPlayVoiceOnDeathCard(string card) - { - if (string.IsNullOrEmpty(card)) - { - return null; - } - List source = (IsPlayerCardName(card) ? ReplayBattlePlayer.AllCardsWithCemeteryAndBanish : ReplayBattleEnemy.AllCardsWithCemeteryAndBanish); - return _networkReplayBattleMgr.GetBattleCardIdx(source.ToList(), Convert.ToInt32(card.Substring(1))); - } - - private List GetCardListFromCardNameList(List cardNameList) - { - List list = new List(); - for (int i = 0; i < cardNameList.Count; i++) - { - List list2 = (IsPlayerCardName(cardNameList[i]) ? ReplayBattlePlayer.AllCardsWithSkillIngredient : ReplayBattleEnemy.AllCardsWithSkillIngredient); - list.Add(_networkReplayBattleMgr.GetBattleCardIdx(list2, Convert.ToInt32(cardNameList[i].Substring(1)))); - } - return list; - } - - private BattleCardBase GetOwnerCard(string cardName) - { - if (string.IsNullOrEmpty(cardName)) - { - return null; - } - List list = (IsPlayerCardName(cardName) ? ReplayBattlePlayer.AllCardsWithSkillIngredient : ReplayBattleEnemy.AllCardsWithSkillIngredient); - return _networkReplayBattleMgr.GetBattleCardIdx(list, Convert.ToInt32(cardName.Substring(1))); - } - - private bool IsPlayerCardName(string name) - { - return name.Substring(0, 1) == "p"; - } - - public void DamageOperation() - { - List cardListFromCardNameList = GetCardListFromCardNameList(_receivedData.DestroyCardNameList); - List cardListFromCardNameList2 = GetCardListFromCardNameList(_receivedData.BanishCardNameList); - BattleCardBase playVoiceOnDeathCard = GetPlayVoiceOnDeathCard(_receivedData.PlayVoiceOnDeathCard); - RegisterSequentialVfx(_networkReplayBattleMgr.Damage(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.DealDamageList, cardListFromCardNameList, _receivedData.DestroyTypeList, cardListFromCardNameList2, _receivedData.EffectInfo, _receivedData.IsReflectionDamage, playVoiceOnDeathCard, _receivedData.SideLogSkillInfoList, GetCardListFromCardNameList(_receivedData.EffectTargetCardNameList))); - } - - public void HealOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.Heal(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.HealList, _receivedData.EffectInfo)); - } - - public void DiscardOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.Discard(GetCardListFromCardNameList(_receivedData.CardNameList))); - } - - public void DestroyOrBanishOperation() - { - BattleCardBase playVoiceOnDeathCard = GetPlayVoiceOnDeathCard(_receivedData.PlayVoiceOnDeathCard); - List list = new List(); - if (_receivedData.IsOpen) - { - if (_receivedData.CardInfoList != null) - { - if (_receivedData.isSelf) - { - for (int i = 0; i < _receivedData.CardInfoList.Count; i++) - { - BattleCardBase battleCardIdx = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.DeckCardList, _receivedData.CardInfoList[i].Index); - _networkReplayBattleMgr.ClearAndUpdateParameterModifier(battleCardIdx, _receivedData.CardInfoList[i]); - list.Add(battleCardIdx); - } - } - else - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int j = 0; j < _receivedData.CardInfoList.Count; j++) - { - BattleCardBase battleCardIdx2 = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.DeckCardList, _receivedData.CardInfoList[j].Index); - VfxWith vfxWith = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardIdx2, _receivedData.CardInfoList[j], ReplayBattleEnemy, isFusion: false); - list.Add(vfxWith.Value); - parallelVfxPlayer.Register(vfxWith.Vfx); - } - RegisterSequentialVfx(parallelVfxPlayer); - } - } - } - else - { - list = GetCardListFromCardNameList(_receivedData.BanishCardNameList); - } - RegisterSequentialVfx(_networkReplayBattleMgr.DestroyOrBanish(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.DestroyCardNameList), _receivedData.DestroyTypeList, list, GetCardListFromCardNameList(_receivedData.IndestructibleCardNameList), _receivedData.EffectInfo, playVoiceOnDeathCard, _receivedData.IsBurialRite, _receivedData.IsOpen, _receivedData.SideLogSkillInfoList)); - } - - public void EvolveOperation() - { - if (_receivedData.CardInfo.IsSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.Evolve(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardInfo.Index), !_receivedData.IsNotConsumeEp, _receivedData.TransformCardId, _receivedData.CardInfo, _receivedData.CardInfoList)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.Evolve(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.ClassAndInPlayCardList, _receivedData.CardInfo.Index), !_receivedData.IsNotConsumeEp, _receivedData.TransformCardId, _receivedData.CardInfo)); - } - } - - public void SkillEvolveOperation() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(_networkReplayBattleMgr.SkillEvolve(GetOwnerCard(_receivedData.OwnerCardName), ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardInfoList, _receivedData.EffectInfo, _receivedData.EvolveMeWhenAttackIndex)); - } - else - { - RegisterSequentialVfx(_networkReplayBattleMgr.SkillEvolve(GetOwnerCard(_receivedData.OwnerCardName), ReplayBattleEnemy.ClassAndInPlayCardList, _receivedData.CardInfoList, _receivedData.EffectInfo, _receivedData.EvolveMeWhenAttackIndex)); - } - } - - public void ReturnOperation() - { - BattleCardBase playVoiceOnDeathCard = GetPlayVoiceOnDeathCard(_receivedData.PlayVoiceOnDeathCard); - RegisterSequentialVfx(_networkReplayBattleMgr.Return(GetCardListFromCardNameList(_receivedData.CardNameList), GetCardListFromCardNameList(_receivedData.BanishCardNameList), GetCardListFromCardNameList(_receivedData.DestroyCardNameList), _receivedData.DestroyTypeList, _receivedData.SideLogSkillInfoList, playVoiceOnDeathCard)); - if (_receivedData.CardInfoList != null) - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateHandInfo(ReplayBattlePlayer.HandCardList, ReplayBattleEnemy.HandCardList, _receivedData.CardInfoList, ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient)); - } - } - - public void StartSelectOperation() - { - if (_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) - { - RegisterSequentialVfx(ReplayBattlePlayer.StartSelect(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardIndex), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.IsEvolve, _receivedData.CardInfo, _receivedData.IsChoiceBraveData)); - } - else - { - RegisterSequentialVfx(ReplayBattlePlayer.StartSelect(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.IsEvolve, _receivedData.CardInfo, isChoiceBrave: false)); - } - } - - public void SelectOperation() - { - IEnumerable source = (IsPlayerCardName(_receivedData.SelectCard) ? ReplayBattlePlayer.AllCards : ReplayBattleEnemy.AllCards); - BattleCardBase battleCardIdx = _networkReplayBattleMgr.GetBattleCardIdx(source.ToList(), Convert.ToInt32(_receivedData.SelectCard.Substring(1))); - if (_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) - { - RegisterSequentialVfx(ReplayBattlePlayer.Select(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardIndex), battleCardIdx, GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.IsEvolve, _receivedData.CardInfo, _receivedData.IsBurialRite)); - } - else - { - RegisterSequentialVfx(ReplayBattlePlayer.Select(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), battleCardIdx, GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.IsEvolve, _receivedData.CardInfo, _receivedData.IsBurialRite)); - } - } - - public void CompleteSelectOperation() - { - RegisterSequentialVfx(ReplayBattlePlayer.CompleteSelect(_networkReplayBattleMgr.GetBattleCardIdx((_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) ? ReplayBattlePlayer.ClassAndInPlayCardList : ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), GetCardListFromCardNameList(_receivedData.CardNameList)[0], _receivedData.IsEvolve, _receivedData.IsBurialRite, _receivedData.IsChoiceBraveData)); - } - - public void CancelSelectOperation() - { - if (_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) - { - RegisterSequentialVfx(ReplayBattlePlayer.CancelSelect(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardIndex), _receivedData.IsEvolve, _receivedData.IsChoiceBraveData)); - } - else - { - RegisterSequentialVfx(ReplayBattlePlayer.CancelSelect(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), _receivedData.IsEvolve, _receivedData.IsChoiceBraveData)); - } - } - - public void StartChoiceOperation() - { - if (_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) - { - RegisterSequentialVfx(ReplayBattlePlayer.StartChoice(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardIndex), _receivedData.CardInfoList, _receivedData.IsEvolve)); - } - else - { - RegisterSequentialVfx(ReplayBattlePlayer.StartChoice(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), _receivedData.CardInfoList, _receivedData.IsEvolve)); - } - } - - public void CompleteChoiceOperation() - { - RegisterSequentialVfx(ReplayBattlePlayer.SelectChoice(_receivedData.TargetIndexList, _receivedData.IsTransformSelect)); - RegisterSequentialVfx(ReplayBattlePlayer.CompleteChoice(_networkReplayBattleMgr.GetBattleCardIdx((_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) ? ReplayBattlePlayer.ClassAndInPlayCardList : ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), _receivedData.IsTransformSelect, _receivedData.IsEvolve, _receivedData.IsChoiceBraveData)); - } - - public void CancelChoiceOperation() - { - if (_receivedData.IsEvolve || _receivedData.IsChoiceBraveData) - { - RegisterSequentialVfx(ReplayBattlePlayer.CancelChoice(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, _receivedData.CardIndex), _receivedData.IsEvolve)); - } - else - { - RegisterSequentialVfx(ReplayBattlePlayer.CancelChoice(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), _receivedData.IsEvolve)); - } - } - - public void StartFusionOperation() - { - List selectableCards = _receivedData.TargetIndexList.Select((int i) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, i)).ToList(); - RegisterSequentialVfx(ReplayBattlePlayer.StartFusion(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex), selectableCards, _receivedData.CardInfo)); - } - - public void SelectFusionOperation() - { - RegisterSequentialVfx(ReplayBattlePlayer.SelectFusion(_receivedData.CardIndex, _receivedData.IsActive, _receivedData.MaxSelectCount, _receivedData.CanFusionMetamorphose)); - RegisterSequentialVfx(WaitVfx.Create(0.5f)); - } - - public void CompleteFusionOperation() - { - if (_receivedData.isSelf) - { - List ingredientCards = _receivedData.CardInfoList.Select((NetworkBattleReceiver.CardInfo i) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, i.Index)).ToList(); - RegisterSequentialVfx(ReplayBattlePlayer.CompleteFusion(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardInfo.Index), ingredientCards, _receivedData.CardInfo, _receivedData.IsFusionMetamorphose, _receivedData.FusionMetamorphoseCardId, _receivedData.SideLogSkillInfoList)); - return; - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase battleCardIdx = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.HandCardList, _receivedData.CardInfo.Index); - VfxWith vfxWith = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardIdx, _receivedData.CardInfo, ReplayBattleEnemy, isFusion: true); - battleCardIdx = vfxWith.Value; - battleCardIdx.BattleCardView.UpdateParameterView(battleCardIdx.Atk, battleCardIdx.Life, _receivedData.CardInfo.Cost, battleCardIdx.BaseParameter.CardName, battleCardIdx.IsInplay); - sequentialVfxPlayer.Register(vfxWith.Vfx); - List list = new List(); - for (int num = 0; num < _receivedData.CardInfoList.Count; num++) - { - BattleCardBase battleCardIdx2 = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.HandCardList, _receivedData.CardInfoList[num].Index); - VfxWith vfxWith2 = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardIdx2, _receivedData.CardInfoList[num], ReplayBattleEnemy, isFusion: true); - BattleCardBase value = vfxWith2.Value; - value.BattleCardView.UpdateParameterView(value.Atk, value.Life, _receivedData.CardInfoList[num].Cost, value.BaseParameter.CardName, value.IsInplay); - list.Add(value); - sequentialVfxPlayer.Register(vfxWith2.Vfx); - } - RegisterSequentialVfx(sequentialVfxPlayer); - RegisterSequentialVfx(ReplayBattleEnemy.CompleteFusion(battleCardIdx, list, _receivedData.CardInfo, _receivedData.IsFusionMetamorphose, _receivedData.FusionMetamorphoseCardId, _receivedData.SideLogSkillInfoList)); - } - - public void CancelFusionOperation() - { - RegisterSequentialVfx(ReplayBattlePlayer.CancelFusion(_networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardIndex))); - } - - public void ChantCountChangeOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ChantCountChange(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.ChangeCount, _receivedData.EffectInfo)); - } - - public void ChangeWhiteRitualStackOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ChangeWhiteRitualStack(GetCardListFromCardNameList(_receivedData.CardNameList).First(), _receivedData.ChangeCount, _receivedData.IsDestroy, _receivedData.CardInfo)); - } - - public void Necromance() - { - RegisterSequentialVfx(_networkReplayBattleMgr.Necromance(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.IsFusionNecromance)); - } - - public void ChangeMaxAttackableCountOperation() - { - List cardListFromCardNameList = GetCardListFromCardNameList(_receivedData.CardNameList); - for (int i = 0; i < cardListFromCardNameList.Count(); i++) - { - cardListFromCardNameList.ElementAt(i).attackCountinfo.Add(new BattleCardBase.SetAttackCountInfo(null, _receivedData.ChangeCount)); - } - } - - public void UpdateDeckOperation() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.UpdateDeck(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, _receivedData.IsChange, _receivedData.IsOpen, _receivedData.EffectInfo)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.UpdateDeck(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, _receivedData.IsChange, _receivedData.IsOpen, _receivedData.EffectInfo)); - } - } - - public void IndexChangeOperation() - { - if (_receivedData.isSelf) - { - _networkReplayBattleMgr.IndexChange(ReplayBattlePlayer, _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.DeckCardList, _receivedData.CardIndexList[0]), _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.DeckCardList, _receivedData.CardIndexList[1])); - } - else - { - _networkReplayBattleMgr.IndexChange(ReplayBattleEnemy, _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.DeckCardList, _receivedData.CardIndexList[0]), _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.DeckCardList, _receivedData.CardIndexList[1])); - } - } - - public void MetamorphoseOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.Metamorphose(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.CardIdList, _receivedData.EffectInfo)); - } - - public void GetonOperation() - { - if (_receivedData.isSelf) - { - List targets = _receivedData.TargetIndexList.Select((int i) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.ClassAndInPlayCardList, i)).ToList(); - RegisterSequentialVfx(_networkReplayBattleMgr.Geton(GetOwnerCard(_receivedData.OwnerCardName), targets, _receivedData.EffectInfo)); - } - else - { - List targets2 = _receivedData.TargetIndexList.Select((int i) => _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.ClassAndInPlayCardList, i)).ToList(); - RegisterSequentialVfx(_networkReplayBattleMgr.Geton(GetOwnerCard(_receivedData.OwnerCardName), targets2, _receivedData.EffectInfo)); - } - } - - public void GetoffOperation() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.Getoff(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, _receivedData.EffectInfo)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.Getoff(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.CardInfoList, _receivedData.EffectInfo)); - } - } - - public void UniteOperation() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.Unite(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.CardIdList[0], _receivedData.CardIndexList[0], _receivedData.EffectInfo)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.Unite(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.CardIdList[0], _receivedData.CardIndexList[0], _receivedData.EffectInfo)); - } - } - - public void OpenCardOperation() - { - if (_receivedData.isSelf) - { - BattleCardBase battleCardIdx = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattlePlayer.HandCardList, _receivedData.CardInfo.Index); - RegisterSequentialVfx(ReplayBattlePlayer.OpenCard(battleCardIdx)); - return; - } - BattleCardBase battleCardIdx2 = _networkReplayBattleMgr.GetBattleCardIdx(ReplayBattleEnemy.HandCardList, _receivedData.CardInfo.Index); - VfxWith vfxWith = _networkReplayBattleMgr.ReplaceReceivedCard(battleCardIdx2, _receivedData.CardInfo, ReplayBattleEnemy, isFusion: false); - battleCardIdx2 = vfxWith.Value; - RegisterSequentialVfx(vfxWith.Vfx); - RegisterSequentialVfx(ReplayBattleEnemy.OpenCard(battleCardIdx2, _receivedData.CardInfo.Cost, _receivedData.IsLastDrawOpenCard)); - } - - public void ShowSkillEffectOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShowSkillEffect(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.EffectInfo)); - } - - public void ShowSkillInductionEffect() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShowSkillInductionEffect(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.SkillVoice, _receivedData.IsIgnoreVoice, _receivedData.CardInfo)); - } - - public void ShowIndependentEffect() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShowIndependentEffect(GetCardListFromCardNameList(_receivedData.CardNameList))); - } - - public void ChangeAffiliationOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShowChangeAffiliation(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.Clan, _receivedData.Tribe, _receivedData.EffectInfo)); - } - - public void ShowChangeUnionBurstAndSkyboundArtEffect() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShowChangeUnionBurstAndSkyboundArtEffect(GetCardListFromCardNameList(_receivedData.CardNameList))); - } - - public void ShowRepeatSkillEffect() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShowRepeatSkillEffect(_receivedData.isSelf)); - } - - public void GiveCantActivateFanfareOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.GiveCantActivateFanfare(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.EffectInfo)); - } - - public void DepriveCantActivateFanfareOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.DepriveCantActivateFanfare(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList))); - } - - public void LoseSkillOperation() - { - RegisterSequentialVfx(_networkReplayBattleMgr.LoseSkill(GetOwnerCard(_receivedData.OwnerCardName), GetCardListFromCardNameList(_receivedData.CardNameList), _receivedData.EffectInfo)); - } - - public void UpdateHandInfo() - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateHandInfo(ReplayBattlePlayer.HandCardList, ReplayBattleEnemy.HandCardList, _receivedData.CardInfoList, ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient, _receivedData.IsImmediate)); - } - - public void UpdateChoiceBraveButtonEffet() - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateChoiceBraveButtonEffet(_receivedData.IsActive, _receivedData.IsImmediate)); - } - - public void UpdateInplayInfo() - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateInplayInfo(ReplayBattlePlayer.ClassAndInPlayCardList, ReplayBattleEnemy.ClassAndInPlayCardList, _receivedData.CardInfoList, ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient, ReplayBattlePlayer.IsSelfTurn, isInitialize: false, _receivedData.OnlyEffect, _receivedData.OnlyAttackEffect, _receivedData.UpdateAttackEffect, _receivedData.UseRecordAttackEffect)); - } - - public void UpdateDeckInfo() - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateDeckOrReservedInfo(ReplayBattlePlayer.DeckCardList, ReplayBattleEnemy.DeckCardList, _receivedData.CardInfoList)); - } - - public void UpdateAttachedCardInfo() - { - _networkReplayBattleMgr.UpdateAttachedCardInfo(ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient, _receivedData.CardInfoList); - } - - public void UpdateFusionCardInfo() - { - for (int i = 0; i < _receivedData.CardInfoList.Count; i++) - { - _networkReplayBattleMgr.UpdateFusionCardInfo(_receivedData.CardInfoList[i]); - } - } - - public void UpdateStatusPanel() - { - _networkReplayBattleMgr.UpdateStatusPanel(_receivedData.PlayerStatusPanelInfo, _receivedData.EnemyStatusPanelInfo); - } - - public void UpdateBattleLog() - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateBattleLog(ReplayBattlePlayer.AllCardsWithSkillIngredient, ReplayBattleEnemy.AllCardsWithSkillIngredient, _receivedData.BattleLogIndex, new List())); - } - - public void UpdateClassInfoUi() - { - _networkReplayBattleMgr.UpdateClassInfoUi(_receivedData.PlayerClassInfo, _receivedData.EnemyClassInfo); - } - - public void UpdateMyRotationBonus() - { - _networkReplayBattleMgr.UpdateMyRotationBonus(_receivedData.MyRotationBonusInfoList); - } - - public void UpdateAvatarBattleDescValueList() - { - _networkReplayBattleMgr.UpdateAvatarBattleDescValueList(_receivedData.PlayerAvatarBattleDescInfo, _receivedData.EnemyAvatarBattleDescInfo); - } - - public void UpdateAttackableEffect() - { - RegisterSequentialVfx(_networkReplayBattleMgr.UpdateAttackableEffect(ReplayBattlePlayer.ClassAndInPlayCardList, ReplayBattleEnemy.ClassAndInPlayCardList, _receivedData.CardInfoList, ReplayBattlePlayer.IsSelfTurn)); - } - - public void SkillProcessStart() - { - RegisterSequentialVfx(_networkReplayBattleMgr.CreateSkillSideLog(_receivedData.SideLogSkillInfoList)); - } - - public void SkillVfxStart() - { - _networkReplayBattleMgr.IsDuringSkillProcess = true; - _networkReplayBattleMgr.SkillVfxStack.Push(VfxWithLoadingSequential.Create()); - } - - public void SkillVfxEnd() - { - VfxWithLoadingSequential vfxWithLoadingSequential = _networkReplayBattleMgr.SkillVfxStack.Pop(); - if (_networkReplayBattleMgr.SkillVfxStack.Count > 0) - { - _networkReplayBattleMgr.SkillVfxStack.Peek().RegisterToMainVfx(vfxWithLoadingSequential); - return; - } - _networkReplayBattleMgr.IsDuringSkillProcess = false; - RegisterSequentialVfx(vfxWithLoadingSequential); - } - - public void ClearSideLog() - { - SideLogControl sideLogControl = (_receivedData.isSelf ? ReplayBattlePlayer.BattleView.GetSideLogControl(isSkillTargetSelect: false) : ReplayBattleEnemy.BattleView.GetSideLogControl(isSkillTargetSelect: false)); - RegisterSequentialVfx(sideLogControl.ClearLastShowLogCard()); - } - - public void ClearDestroyedCardList() - { - _networkReplayBattleMgr.OperateMgr.BattleLogManager.ClearDestroyedCardList(_receivedData.isSelf); - } - - public void PlayEmotion() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(ReplayBattlePlayer.PlayEmotion(_receivedData.EmoteType)); - } - else - { - RegisterSequentialVfx(ReplayBattleEnemy.PlayEmotion(_receivedData.EmoteType)); - } - } - - public void AttachShortageDeckWin() - { - RegisterSequentialVfx(_networkReplayBattleMgr.AttachShortageDeckWin(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.EffectInfo)); - } - - public void ShortageDeckWin() - { - if (_receivedData.isSelf) - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShortageDeckWin(ReplayBattlePlayer)); - } - else - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShortageDeckWin(ReplayBattleEnemy)); - } - } - - public void ShortageDeckLose() - { - RegisterSequentialVfx(_networkReplayBattleMgr.ShortageDeckLose(_receivedData.isSelf)); - } - - public void SpecialWin() - { - RegisterSequentialVfx(_networkReplayBattleMgr.SpecialWin(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.EffectInfo)); - } - - public void SpecialLose() - { - RegisterSequentialVfx(_networkReplayBattleMgr.SpecialLose(GetOwnerCard(_receivedData.OwnerCardName), _receivedData.EffectInfo)); - } - - public void BattleFinish() - { - RegisterSequentialVfx(_networkReplayBattleMgr.BattleFinish(_receivedData.isWin, _receivedData.IsPlayerDead, _receivedData.IsEnemyDead, _receivedData.FinishType, _receivedData.ResultCode)); - } -} diff --git a/SVSim.BattleEngine/Engine/NguiObjs.cs b/SVSim.BattleEngine/Engine/NguiObjs.cs index 1a787035..0bfd38e7 100644 --- a/SVSim.BattleEngine/Engine/NguiObjs.cs +++ b/SVSim.BattleEngine/Engine/NguiObjs.cs @@ -19,27 +19,6 @@ public class NguiObjs : MonoBehaviour [SerializeField] public UIButton[] buttons; - [SerializeField] - public BoxCollider[] Boxs; - - [SerializeField] - public UIToggle[] toggles; - - [SerializeField] - public UIPanel[] panels; - - [SerializeField] - public UIProgressBar[] progressBars; - - [SerializeField] - public TweenPosition tweenPosition; - - [SerializeField] - public TweenScale tweenScale; - [SerializeField] public TweenAlpha tweenAlpha; - - [NonSerialized] - public bool flag; } diff --git a/SVSim.BattleEngine/Engine/NotConsumeEpModifierInfo.cs b/SVSim.BattleEngine/Engine/NotConsumeEpModifierInfo.cs index 0a5935a9..ee89dac1 100644 --- a/SVSim.BattleEngine/Engine/NotConsumeEpModifierInfo.cs +++ b/SVSim.BattleEngine/Engine/NotConsumeEpModifierInfo.cs @@ -44,7 +44,7 @@ public class NotConsumeEpModifierInfo public bool CheckNotConsumedCard(BattleCardBase evoCard) { - if (TargetCard != null && (TargetCard == evoCard || (BattleManagerBase.GetIns().IsVirtualBattle && TargetCard.Index == evoCard.Index && TargetCard.IsPlayer == evoCard.IsPlayer))) + if (TargetCard != null && (TargetCard == evoCard || (TargetCard.SelfBattlePlayer.BattleMgr.IsVirtualBattle && TargetCard.Index == evoCard.Index && TargetCard.IsPlayer == evoCard.IsPlayer))) { return true; } diff --git a/SVSim.BattleEngine/Engine/NotMulliganEndToJudgeChecker.cs b/SVSim.BattleEngine/Engine/NotMulliganEndToJudgeChecker.cs index 2745f926..ec311d18 100644 --- a/SVSim.BattleEngine/Engine/NotMulliganEndToJudgeChecker.cs +++ b/SVSim.BattleEngine/Engine/NotMulliganEndToJudgeChecker.cs @@ -3,7 +3,6 @@ using Cute; public class NotMulliganEndToJudgeChecker : NetworkBattleIntervalCheckerBase { - private const float TURN_END_OPPONENT_INTERVAL = 95f; public event Action OnNotMulliganEndJudge; diff --git a/SVSim.BattleEngine/Engine/NotTurnEndToLoseChecker.cs b/SVSim.BattleEngine/Engine/NotTurnEndToLoseChecker.cs index efd02797..cc0ffe3c 100644 --- a/SVSim.BattleEngine/Engine/NotTurnEndToLoseChecker.cs +++ b/SVSim.BattleEngine/Engine/NotTurnEndToLoseChecker.cs @@ -5,8 +5,6 @@ public class NotTurnEndToLoseChecker : NetworkBattleIntervalCheckerBase { private NetworkBattleManagerBase networkBattleManager; - private const float NOT_TURNEND_TO_LOSE_INTERVAL = 125f; - public event Action OnNotTurnEndToLose; public NotTurnEndToLoseChecker(NetworkBattleManagerBase manager) diff --git a/SVSim.BattleEngine/Engine/NotTurnStartToLoseChecker.cs b/SVSim.BattleEngine/Engine/NotTurnStartToLoseChecker.cs index 049c6bec..3ea46d7c 100644 --- a/SVSim.BattleEngine/Engine/NotTurnStartToLoseChecker.cs +++ b/SVSim.BattleEngine/Engine/NotTurnStartToLoseChecker.cs @@ -3,7 +3,6 @@ using Cute; public class NotTurnStartToLoseChecker : NetworkBattleIntervalCheckerBase { - private const float NOT_TURNSTART_TO_LOSE_INTERVAL = 75f; public event Action OnNotTurnStartToLose; diff --git a/SVSim.BattleEngine/Engine/NtDataTranslate.cs b/SVSim.BattleEngine/Engine/NtDataTranslate.cs index 44b6c06c..75da33e5 100644 --- a/SVSim.BattleEngine/Engine/NtDataTranslate.cs +++ b/SVSim.BattleEngine/Engine/NtDataTranslate.cs @@ -3,57 +3,8 @@ using UnityEngine; public class NtDataTranslate : MonoBehaviour { - [SerializeField] - private TitleUI _titleUI; - - public GameObject BtnTranslate; public NtDataTranslateInput InputObj; - public UILabel TxtTranslate; - public static NtDataTranslate Instance; - - private void Start() - { - initUI(); - requestData(); - } - - private void initUI() - { - Instance = this; - initEventListener(); - } - - private void initEventListener() - { - UIEventListener.Get(BtnTranslate).onClick = onClickTranslate; - } - - private void requestData() - { - NtDataTranslateManager.GetInstance().GetTranslateInfo(); - } - - private void onClickTranslate(GameObject btn) - { - if (!_titleUI.IsEnableClickButton()) - { - return; - } - GetDataTranslateTask task = new GetDataTranslateTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - NtDataTranslateManager instance = NtDataTranslateManager.GetInstance(); - if (instance.isTranslate) - { - instance.ShowRebind(); - } - else - { - instance.ShowMainNotice(instance.HongKongMacaoUserConfirm); - } - })); - } } diff --git a/SVSim.BattleEngine/Engine/NtDataTranslateInfo.cs b/SVSim.BattleEngine/Engine/NtDataTranslateInfo.cs index bb1bdc5f..404fdf0e 100644 --- a/SVSim.BattleEngine/Engine/NtDataTranslateInfo.cs +++ b/SVSim.BattleEngine/Engine/NtDataTranslateInfo.cs @@ -5,67 +5,6 @@ using Wizard; public class NtDataTranslateInfo { - public const string TITLESTATEMENT = "titleStatement"; - - public const string CONTAINSTATEMENT = "containStatement"; - - public const string TITLEEMAIL = "titleEmail"; - - public const string EMAILADDRESS1 = "emailAddress1"; - - public const string EMAILADDRESS2 = "emailAddress2"; - - public const string EMAILADDRESSTIP1 = "emailAddressTip1"; - - public const string EMAILADDRESSTIP2 = "emailAddressTip2"; - - public const string TITLESUCCESS = "titleSuccess"; - - public const string CONTAINSUCCESS = "containSuccess"; - - public const string TITLETIP = "titleTip"; - - public const string CONTAINTIP = "containTip"; - - public const string TITLEREBIND = "titleRebind"; - - public const string CONTAINREBIND = "containRebind"; - - public const string ERRORID = "ERROR_ID"; - - public const string ERRORTITLE = "ERROR_TITLE"; - - public const string ERRORCONTAIN1 = "ERROR_CONTAIN1"; - - public const string ERRORCONTAIN2 = "ERROR_CONTAIN2"; - - public const string ERRORCONTAIN3 = "ERROR_CONTAIN3"; - - public const string ERRORCONTAIN4 = "ERROR_CONTAIN4"; - - public const string ERRORCONTAIN5 = "ERROR_CONTAIN5"; - - public const string ERRORCONTAIN6 = "ERROR_CONTAIN6"; - - public const string ERRORCONTAIN7 = "ERROR_CONTAIN7"; - - public const string SERVERURL = "serverUrl"; - - public const string BUTTONTEXT = "buttonTitle"; - - public const string BUTTONTEXT_ID1 = "buttonText_ID1"; - - public const string BUTTONTEXT_ID2 = "buttonText_ID2"; - - public const string BUTTONTEXT_ID3 = "buttonText_ID3"; - - public const string BUTTONTEXT_ID4 = "buttonText_ID4"; - - public const string BUTTONTEXT_ID5 = "buttonText_ID5"; - - public const string BUTTONTEXT_ID6 = "buttonText_ID6"; - - public const string BUTTONTEXT_ID7 = "buttonText_ID7"; public string titleStatement = ""; @@ -99,8 +38,6 @@ public class NtDataTranslateInfo public string ERROR_CONTAIN2 = ""; - public string ERROR_CONTAIN3 = ""; - public string ERROR_CONTAIN4 = ""; public string ERROR_CONTAIN5 = ""; @@ -163,50 +100,4 @@ public class NtDataTranslateInfo button_id7 = systemText.Get("Account_0136") }; } - - public static bool ContainsKey(JsonData json, string key) - { - if (((IDictionary)json).Contains((object)key)) - { - return true; - } - return false; - } - - public JsonData toJsonData() - { - return new JsonData - { - ["titleStatement"] = titleStatement, - ["containStatement"] = containStatement, - ["titleEmail"] = titleEmail, - ["emailAddress1"] = emailAddress1, - ["emailAddress2"] = emailAddress2, - ["emailAddressTip1"] = emailAddressTip1, - ["emailAddressTip2"] = emailAddressTip2, - ["titleSuccess"] = titleSuccess, - ["containSuccess"] = containSuccess, - ["titleTip"] = titleTip, - ["containTip"] = containTip, - ["titleRebind"] = titleRebind, - ["containRebind"] = containRebind, - ["ERROR_TITLE"] = ERROR_TITLE, - ["ERROR_CONTAIN1"] = ERROR_CONTAIN1, - ["ERROR_CONTAIN2"] = ERROR_CONTAIN2, - ["ERROR_CONTAIN3"] = ERROR_CONTAIN3, - ["ERROR_CONTAIN4"] = ERROR_CONTAIN4, - ["ERROR_CONTAIN5"] = ERROR_CONTAIN5, - ["ERROR_CONTAIN6"] = ERROR_CONTAIN6, - ["ERROR_CONTAIN7"] = ERROR_CONTAIN7, - ["serverUrl"] = serverUrl, - ["buttonTitle"] = buttonTitle, - ["buttonText_ID1"] = button_id1, - ["buttonText_ID2"] = button_id2, - ["buttonText_ID3"] = button_id3, - ["buttonText_ID4"] = button_id4, - ["buttonText_ID5"] = button_id5, - ["buttonText_ID6"] = button_id6, - ["buttonText_ID7"] = button_id7 - }; - } } diff --git a/SVSim.BattleEngine/Engine/NtDataTranslateInput.cs b/SVSim.BattleEngine/Engine/NtDataTranslateInput.cs index cba8d916..a404dade 100644 --- a/SVSim.BattleEngine/Engine/NtDataTranslateInput.cs +++ b/SVSim.BattleEngine/Engine/NtDataTranslateInput.cs @@ -9,55 +9,10 @@ public class NtDataTranslateInput : MonoBehaviour public UIInput InputEmail2; - public UILabel TxtEmailTitle1; - - public UILabel TxtEmailTitle2; - - public UILabel TxtEmailTip; - public string EmailAddress; private NtDataTranslateInfo info; - private void Start() - { - initUI(); - initEventListener(); - } - - private void initUI() - { - info = NtDataTranslateManager.GetInstance().TranslateInfo; - TxtEmailTitle1.text = info.emailAddress1; - TxtEmailTitle2.text = info.emailAddress2; - TxtEmailTip.text = string.Empty; - } - - private void initEventListener() - { - EventDelegate.Add(InputEmail1.onChange, onValueChange); - EventDelegate.Add(InputEmail2.onChange, onValueChange); - } - - private void onValueChange() - { - if (checkInput().Equals(info.emailAddressTip1)) - { - if (!string.IsNullOrEmpty(InputEmail2.value)) - { - TxtEmailTip.text = checkInput(); - } - else - { - TxtEmailTip.text = ""; - } - } - else - { - TxtEmailTip.text = checkInput(); - } - } - private string checkInput() { string result = string.Empty; diff --git a/SVSim.BattleEngine/Engine/NtDataTranslateManager.cs b/SVSim.BattleEngine/Engine/NtDataTranslateManager.cs index c55e9eab..707494f0 100644 --- a/SVSim.BattleEngine/Engine/NtDataTranslateManager.cs +++ b/SVSim.BattleEngine/Engine/NtDataTranslateManager.cs @@ -16,22 +16,6 @@ public class NtDataTranslateManager public const string FIRST_LOOK = "FIRST_LOOK"; - public const int RC_NETEASE_DATA_TRANSACTION_SAME_EMAIL = 99401; - - public const int RC_NETEASE_DATA_TRANSACTION_RESPONE_ERROR = 99402; - - public const int RC_NETEASE_DATA_TRANSACTION_MAIL_ERROR = 99403; - - public const int RC_NETEASE_DATA_TRANSACTION_FREQUENTCY = 99404; - - public const int RC_NETEASE_DATA_TRANSACTION_DAILY_MAX = 99405; - - public const int RC_NETEASE_DATA_TRANSACTION_SYS_ERROR = 99406; - - public const int RC_NETEASE_DATA_TRANSACTION_CURL_ERROR = 99407; - - public const int RC_NETEASE_DATA_TRANSACTION_UNKNOWN_ERROR = 99408; - private NtDataTranslateManager() { TranslateInfo = NtDataTranslateInfo.Init(); @@ -56,26 +40,6 @@ public class NtDataTranslateManager return string.Format("{0}{1}", TranslateInfo.serverUrl, "netease_data_transaction/set_email_address"); } - public bool CheckViewCanShow() - { - return false; - } - - public void GetTranslateInfo(Action callBack = null) - { - TranslateInfo = NtDataTranslateInfo.Init(); - NtDataTranslate.Instance.TxtTranslate.text = TranslateInfo.buttonTitle; - if (GetInstance().CheckViewCanShow()) - { - NtDataTranslate.Instance.BtnTranslate.SetActive(value: true); - } - else - { - NtDataTranslate.Instance.BtnTranslate.SetActive(value: false); - } - callBack.Call(); - } - public void ShowStatement() { DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); @@ -199,50 +163,4 @@ public class NtDataTranslateManager callback.Call(); }; } - - public void ShowCygamesStatement(Action callback, bool fromTitle = false) - { - if (CheckViewCanShow()) - { - NtDataTranslate.Instance.BtnTranslate.SetActive(value: true); - if (string.IsNullOrEmpty(Toolbox.SavedataManager.GetString("FIRST_LOOK"))) - { - ShowMainNotice(callback, fromTitle); - } - else - { - callback.Call(); - } - } - else - { - NtDataTranslate.Instance.BtnTranslate.SetActive(value: false); - callback.Call(); - } - } - - public void ShowMainNotice(Action callback, bool fromTitle = false) - { - if (fromTitle) - { - string text = Toolbox.SavedataManager.GetString("LANG_SETTING"); - if (!GameStartCheckTask.IsTutorialClear || (text != "Eng" && text != "Cht")) - { - callback.Call(); - return; - } - } - SystemText systemText = Wizard.Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Account_0111")); - dialogBase.SetText(systemText.Get("Account_0112")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetSize(DialogBase.Size.XL); - dialogBase.onPushButton1 = delegate - { - callback.Call(); - }; - dialogBase.SetOnClickUrl(); - Toolbox.SavedataManager.SetString("FIRST_LOOK", "1"); - } } diff --git a/SVSim.BattleEngine/Engine/NullBattleCard.cs b/SVSim.BattleEngine/Engine/NullBattleCard.cs index 53de0950..c9dc6589 100644 --- a/SVSim.BattleEngine/Engine/NullBattleCard.cs +++ b/SVSim.BattleEngine/Engine/NullBattleCard.cs @@ -55,10 +55,6 @@ public class NullBattleCard : BattleCardBase { } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } public override BattleCardBase VirtualClone(BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer) { @@ -83,7 +79,7 @@ public class NullBattleCard : BattleCardBase return _dummyView; } - protected override ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) + protected override ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card) { if (_dummySkillApplyInfo == null) { diff --git a/SVSim.BattleEngine/Engine/NullNextSceneSelector.cs b/SVSim.BattleEngine/Engine/NullNextSceneSelector.cs deleted file mode 100644 index c653a42c..00000000 --- a/SVSim.BattleEngine/Engine/NullNextSceneSelector.cs +++ /dev/null @@ -1,16 +0,0 @@ -using UnityEngine; - -public class NullNextSceneSelector : INextSceneSelector -{ - public NullNextSceneSelector(BattleResultUIController battleResultControl) - { - } - - public void Setup(bool isWin, GameObject gameObject) - { - } - - public void Show() - { - } -} diff --git a/SVSim.BattleEngine/Engine/NullNotMulliganEndToJudgeChecker.cs b/SVSim.BattleEngine/Engine/NullNotMulliganEndToJudgeChecker.cs deleted file mode 100644 index 27719bcc..00000000 --- a/SVSim.BattleEngine/Engine/NullNotMulliganEndToJudgeChecker.cs +++ /dev/null @@ -1,18 +0,0 @@ -public class NullNotMulliganEndToJudgeChecker : NotMulliganEndToJudgeChecker -{ - protected override void IntervalCheck() - { - } - - public override void StartChecker(string log = "") - { - } - - public override void FinishChecker() - { - } - - public override void StopChecker() - { - } -} diff --git a/SVSim.BattleEngine/Engine/NullNotTurnEndToLoseChecker.cs b/SVSim.BattleEngine/Engine/NullNotTurnEndToLoseChecker.cs deleted file mode 100644 index b01651d1..00000000 --- a/SVSim.BattleEngine/Engine/NullNotTurnEndToLoseChecker.cs +++ /dev/null @@ -1,23 +0,0 @@ -public class NullNotTurnEndToLoseChecker : NotTurnEndToLoseChecker -{ - public NullNotTurnEndToLoseChecker(NetworkBattleManagerBase manager) - : base(manager) - { - } - - public override void StopChecker() - { - } - - protected override void IntervalCheck() - { - } - - public override void StartChecker(string log = "") - { - } - - public override void FinishChecker() - { - } -} diff --git a/SVSim.BattleEngine/Engine/NullNotTurnStartToLoseChecker.cs b/SVSim.BattleEngine/Engine/NullNotTurnStartToLoseChecker.cs deleted file mode 100644 index 51d8f865..00000000 --- a/SVSim.BattleEngine/Engine/NullNotTurnStartToLoseChecker.cs +++ /dev/null @@ -1,18 +0,0 @@ -public class NullNotTurnStartToLoseChecker : NotTurnStartToLoseChecker -{ - public override void StopChecker() - { - } - - protected override void IntervalCheck() - { - } - - public override void FinishChecker() - { - } - - public override void StartChecker(string log = "") - { - } -} diff --git a/SVSim.BattleEngine/Engine/NullSkillApplyInformation.cs b/SVSim.BattleEngine/Engine/NullSkillApplyInformation.cs index 264eacd8..2574ef5e 100644 --- a/SVSim.BattleEngine/Engine/NullSkillApplyInformation.cs +++ b/SVSim.BattleEngine/Engine/NullSkillApplyInformation.cs @@ -63,8 +63,6 @@ public class NullSkillApplyInformation : ISkillApplyInformation public bool IsUntouchable => false; - public int UntouchableBySpellCount => 0; - public bool IsUntouchableBySpell => false; public int IgnoreGuardCount => 0; @@ -175,8 +173,6 @@ public class NullSkillApplyInformation : ISkillApplyInformation public bool IsTrigger => false; - public int NotConsumeEpCount => 0; - public bool IsNotConsumeEp => false; public int ShortageDeckWinCount => 0; @@ -297,10 +293,6 @@ public class NullSkillApplyInformation : ISkillApplyInformation { } - public void ReSetupVfxCreator(ICardVfxCreator vfxCreator) - { - } - public SkillBase CloneAttachSkill(SkillApplyInformation cloneTarget, SkillBase skill) { return null; diff --git a/SVSim.BattleEngine/Engine/NullTurnPanelControl.cs b/SVSim.BattleEngine/Engine/NullTurnPanelControl.cs deleted file mode 100644 index da6c46e5..00000000 --- a/SVSim.BattleEngine/Engine/NullTurnPanelControl.cs +++ /dev/null @@ -1,20 +0,0 @@ -using UnityEngine; -using Wizard.Battle.View.Vfx; - -public class NullTurnPanelControl : ITurnPanelControl -{ - public GameObject GameObject => null; - - public void Initialize(bool isEvoEnableP = true, bool isEvoEnableE = true) - { - } - - public void StartUI(int turn, int evo, bool isP) - { - } - - public VfxBase LoadResource() - { - return NullVfx.GetInstance(); - } -} diff --git a/SVSim.BattleEngine/Engine/OmoteLog.cs b/SVSim.BattleEngine/Engine/OmoteLog.cs deleted file mode 100644 index 371c0d3a..00000000 --- a/SVSim.BattleEngine/Engine/OmoteLog.cs +++ /dev/null @@ -1,46 +0,0 @@ -internal class OmoteLog -{ - private static bool mEnabled; - - protected OmoteLog() - { - } - - public static void SetEnable(bool enabled) - { - mEnabled = enabled; - } - - public static void Info(string format, params object[] args) - { - _ = mEnabled; - } - - public static void Warn(string format, params object[] args) - { - _ = mEnabled; - } - - public static void WarnUnless(bool assertion, string format, params object[] args) - { - if (!mEnabled) - { - } - } - - public static void Error(string format, params object[] args) - { - if (mEnabled) - { - Debug.LogError(string.Format(format, args)); - } - } - - public static void ErrorUnless(bool assertion, string format, params object[] args) - { - if (mEnabled && !assertion) - { - Debug.LogError(string.Format(format, args)); - } - } -} diff --git a/SVSim.BattleEngine/Engine/OmotePlugin.cs b/SVSim.BattleEngine/Engine/OmotePlugin.cs deleted file mode 100644 index de7a46d1..00000000 --- a/SVSim.BattleEngine/Engine/OmotePlugin.cs +++ /dev/null @@ -1,506 +0,0 @@ -using System; -using UnityEngine; - -public class OmotePlugin : MonoBehaviour -{ - public delegate void OnNotifyEnabledReceivedEventHandler(bool enabled); - - public delegate void OnUnregisterReceivedEventHandler(bool isSuccess); - - [Serializable] - private class OmotenashiFirebaseOptions - { - public string ApiKey; - - public string ProjectId; - - public string ApplicationId; - - public string SenderId; - } - - public delegate void OmoteEventHandler(object sender, TEventArgs e) where TEventArgs : EventArgs; - - public class RequestResultEventArgs : EventArgs - { - internal class RawData - { - public int type; - - public int result; - - public string body; - - public string endpoint; - - public int statusCode; - - public string reason; - } - - public int Type { get; private set; } - - public int Result { get; private set; } - - public string Body { get; private set; } - - public string EndPoint { get; private set; } - - public int StatusCode { get; private set; } - - public string Reason { get; private set; } - - internal RequestResultEventArgs(RawData data) - { - Type = data.type; - Result = data.result; - Body = data.body; - EndPoint = data.endpoint; - StatusCode = data.statusCode; - Reason = data.reason; - } - } - - public class LocalNotification - { - private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - - public string Message { get; private set; } - - public DateTime When { get; private set; } - - public string LabelId { get; private set; } - - public LocalNotificationPriority Priority { get; set; } - - public int NotificationId { get; set; } - - public string Title { get; set; } - - public string ExtraText { get; set; } - - public string ImagePath { get; set; } - - public LocalNotification(string message, DateTime when, string labelId) - { - if (message == null) - { - throw new ArgumentNullException("message"); - } - if (labelId == null) - { - throw new ArgumentNullException("labelId"); - } - Message = message; - When = when; - LabelId = labelId; - Priority = LocalNotificationPriority.Normal; - ExtraText = string.Empty; - } - - public void Schedule() - { - _ = (When.ToUniversalTime() - UnixEpoch).TotalSeconds; - } - - public void Cancel() - { - Cancel(LabelId); - } - - public static void Cancel(string labelId) - { - if (labelId == null) - { - OmoteLog.Error("labelId must not be null."); - } - } - - public static void CancelAll() - { - } - } - - public class RegistrationTokenEventArgs : EventArgs - { - public string RegistrationToken { get; set; } - } - - public class PushNotificationEventArgs : EventArgs - { - internal class RawData - { - public string id; - - public string message; - - public string extra; - } - - public string Id { get; private set; } - - public string Message { get; private set; } - - public string Extra { get; private set; } - - internal PushNotificationEventArgs(RawData data) - { - Id = data.id; - Message = data.message; - Extra = data.extra; - } - - public override string ToString() - { - return $"Id={Id}, Message={Message}, Extra={Extra}"; - } - } - - public class LocalNotificationEventArgs : EventArgs - { - internal class RawData - { - public string scheduleId; - - public string label; - - public string scheduled; - - public string message; - - public string extra; - } - - public string ScheduleId { get; private set; } - - public string LabelId { get; private set; } - - public DateTime ScheduledAt { get; private set; } - - public string MessageText { get; private set; } - - public string ExtraText { get; private set; } - - internal LocalNotificationEventArgs(RawData data) - { - ScheduleId = data.scheduleId; - LabelId = data.label; - ScheduledAt = DateTime.Parse(data.scheduled); - MessageText = data.message; - ExtraText = data.extra; - } - - public override string ToString() - { - return $"MessageText={MessageText}, ScheduledAt={ScheduledAt}, LabelId={LabelId}, ScheduleId={ScheduleId}, ExtraText={ExtraText}"; - } - } - - public class NotificationChangedEventArgs : EventArgs - { - internal class RawData - { - public bool result; - } - - public bool Result { get; private set; } - - internal NotificationChangedEventArgs(RawData data) - { - Result = data.result; - } - - public override string ToString() - { - return $"Result={Result}"; - } - } - - public delegate void OnRegistrationTokenReceivedEventHandler(object sender, RegistrationTokenEventArgs e); - - public delegate void OnFailToRegisterForRemoteNotificationsEventHandler(object sender, string e); - - [SerializeField] - private OmotenashiFirebaseOptions omotenashiFirebaseOptions; - - [SerializeField] - private bool IsAutomatic = true; - - public string country; - - public event OnNotifyEnabledReceivedEventHandler OnNotificationReceived; - - public event OnUnregisterReceivedEventHandler OnUnregisterReceived; - - public event OmoteEventHandler OnRequestResult; - - public event OnRegistrationTokenReceivedEventHandler OnRegistrationTokenReceived; - - public event OmoteEventHandler OnReceivedPushNotification; - - public event OmoteEventHandler OnReceivedLocalNotification; - - public event OmoteEventHandler OnLaunchFromPushNotification; - - public event OmoteEventHandler OnLaunchFromLocalNotification; - - public event OmoteEventHandler OnNotificationEnableChanged; - - public event OmoteEventHandler OnNotificationCountryChanged; - - public event OnFailToRegisterForRemoteNotificationsEventHandler OnFailToRegisterForRemoteNotifications; - - private void Awake() - { - } - - private void AwakePush(OmotenashiFirebaseOptions options, AndroidJavaObject baseObject) - { - } - - private void Start() - { - StartPush(); - } - - private void StartPush() - { - if (string.IsNullOrEmpty(country)) - { - OmoteLog.Error("Country code is not set."); - } - } - - public void SetSandbox(bool isSandbox) - { - OmoteLog.Info("setDebugMode(isDebuggable: {0}) called.", isSandbox); - } - - public void SetDebugLogEnabled(bool isEnabled) - { - OmoteLog.SetEnable(isEnabled); - OmoteLog.Info("setDebugLogEnabled(isEnabled: {0}) called.", isEnabled); - } - - public void SendConversion(string appViewerId) - { - if (string.IsNullOrEmpty(appViewerId)) - { - OmoteLog.Error("appViewerId is not set."); - return; - } - OmoteLog.Info("SendConversion(appViewerId: {0}) called.", appViewerId); - } - - public void SendSession(string userId, string deviceId) - { - OmoteLog.Info("SendSession({0}, {1}) called.", userId, deviceId); - } - - public void SetRequestEnabled(bool isEnabled) - { - } - - public bool IsRequestEnabled() - { - return true; - } - - public void CallbackUnregister(string isSuccess) - { - if (this.OnUnregisterReceived != null) - { - if (isSuccess.Equals("Success")) - { - OmoteLog.Info("Unregister: Success"); - this.OnUnregisterReceived(isSuccess: true); - } - else if (isSuccess.Equals("Fail")) - { - OmoteLog.Info("Unregister: Fail"); - this.OnUnregisterReceived(isSuccess: false); - } - else - { - OmoteLog.Info("Unregister: unknown {0}", isSuccess); - this.OnUnregisterReceived(isSuccess: false); - } - } - else - { - OmoteLog.Info("Unregister: delegate is null"); - } - } - - public void GetNotificationEnabled() - { - if (this.OnNotificationReceived != null) - { - this.OnNotificationReceived(enabled: true); - } - } - - private void InvokeFromJson(string json, Func argsCreator, OmoteEventHandler action) where TArg : EventArgs - { - OmoteLog.Info("{0}", json); - TRaw arg = JsonUtility.FromJson(json); - TArg val = argsCreator(arg); - OmoteLog.Info("{0}", val); - action?.Invoke(this, val); - } - - public void CallStartPush() - { - StartPush(); - } - - public void Unregister(bool isLocalOnly) - { - CallbackUnregister("Success"); - } - - private void CallbackOnRequestResult(string json) - { - OmoteLog.Info("CallbackOnRequestResult."); - InvokeFromJson(json, (RequestResultEventArgs.RawData raw) => new RequestResultEventArgs(raw), this.OnRequestResult); - } - - private void OnApplicationPause(bool pause) - { - } - - public bool CanScheduleExactAlarms() - { - return true; - } - - public void RescheduleLocalNotification() - { - } - - public void OpenExactAlarmSettings() - { - } - - [Obsolete("Use LocalNotificationBuilder.")] - public void ScheduleLocalNotification(string messageText, DateTime dateTime, string labelId, LocalNotificationPriority priority, int notificationId) - { - ScheduleLocalNotification(messageText, dateTime, labelId, priority, notificationId, string.Empty); - } - - [Obsolete("Use LocalNotificationBuilder.")] - public void ScheduleLocalNotification(string messageText, DateTime date, string labelId, LocalNotificationPriority priority, int notificationId, string extraText) - { - LocalNotification localNotification = new LocalNotification(messageText, date, labelId); - localNotification.Priority = priority; - localNotification.NotificationId = notificationId; - localNotification.ExtraText = extraText; - localNotification.Schedule(); - } - - [Obsolete("Use OmotePlugin.Localnotification.Cancel(string)")] - public void CancelLocalNotification(string labelId) - { - LocalNotification.Cancel(labelId); - } - - [Obsolete("Use OmotePlugin.Localnotificatin.CancelAll()")] - public void CancelAllLocalNotification() - { - LocalNotification.CancelAll(); - } - - private void OnApnsTokenReceived(string token) - { - } - - public void SetNotificationsEnabled(bool enabled) - { - } - - public bool IsNotificationsEnabled() - { - return false; - } - - public void UpdateCountry(string country) - { - if (string.IsNullOrEmpty(country)) - { - OmoteLog.Error("country must not be null nor empty."); - } - } - - public void RegisterForRemoteNotification() - { - } - - public bool isNotificationAuthorized() - { - return true; - } - - public void RequestNotificationPermission() - { - } - - private void CallbackOnTokenReceived(string token) - { - if (!string.IsNullOrEmpty(token)) - { - RegistrationTokenEventArgs e = new RegistrationTokenEventArgs - { - RegistrationToken = token - }; - if (this.OnRegistrationTokenReceived != null) - { - this.OnRegistrationTokenReceived(this, e); - } - } - } - - private void CallbackOnReceivedPushNotificationInForeground(string json) - { - OmoteLog.Info("CallbackOnReceivedPushNotificationInForeground."); - InvokeFromJson(json, (PushNotificationEventArgs.RawData raw) => new PushNotificationEventArgs(raw), this.OnReceivedPushNotification); - } - - private void CallbackOnReceivedLocalNotificationInForeground(string json) - { - OmoteLog.Info("CallbackOnReceivedLocalNotificationInForeground."); - InvokeFromJson(json, (LocalNotificationEventArgs.RawData raw) => new LocalNotificationEventArgs(raw), this.OnReceivedLocalNotification); - } - - private void CallbackOnLaunchFromPushNotification(string json) - { - OmoteLog.Info("CallbackOnLaunchFromPushNotification."); - InvokeFromJson(json, (PushNotificationEventArgs.RawData raw) => new PushNotificationEventArgs(raw), this.OnLaunchFromPushNotification); - } - - private void CallbackOnLaunchFromLocalNotification(string json) - { - OmoteLog.Info("CallbackOnLaunchFromLocalNotification."); - InvokeFromJson(json, (LocalNotificationEventArgs.RawData raw) => new LocalNotificationEventArgs(raw), this.OnLaunchFromLocalNotification); - } - - private void CallbackOnNotificationEnableChanged(string json) - { - OmoteLog.Info("CallbackOnNotificationEnableChanged."); - InvokeFromJson(json, (NotificationChangedEventArgs.RawData raw) => new NotificationChangedEventArgs(raw), this.OnNotificationEnableChanged); - } - - private void CallbackOnNotificationCountryChanged(string json) - { - OmoteLog.Info("CallbackOnNotificationCountryChanged"); - InvokeFromJson(json, (NotificationChangedEventArgs.RawData raw) => new NotificationChangedEventArgs(raw), this.OnNotificationCountryChanged); - } - - private void CallbackOnFailToRegisterForRemoteNotifications(string errorString) - { - OmoteLog.Info("CallbackOnFailToRegisterForRemoteNotifications."); - if (errorString != null && this.OnFailToRegisterForRemoteNotifications != null) - { - this.OnFailToRegisterForRemoteNotifications(this, errorString); - } - } -} diff --git a/SVSim.BattleEngine/Engine/OpenURLOnClick.cs b/SVSim.BattleEngine/Engine/OpenURLOnClick.cs index 5adb7b1a..ed1fad90 100644 --- a/SVSim.BattleEngine/Engine/OpenURLOnClick.cs +++ b/SVSim.BattleEngine/Engine/OpenURLOnClick.cs @@ -3,13 +3,4 @@ using UnityEngine; public class OpenURLOnClick : MonoBehaviour { public UILabel ClickedUrlLabel { private get; set; } - - private void OnClick() - { - string urlAtPosition = ClickedUrlLabel.GetUrlAtPosition(UICamera.lastHit.point); - if (!string.IsNullOrEmpty(urlAtPosition)) - { - UIManager.GetInstance().WebViewHelper.OpenUrl(urlAtPosition); - } - } } diff --git a/SVSim.BattleEngine/Engine/OperateMgr.cs b/SVSim.BattleEngine/Engine/OperateMgr.cs index 5c7a7baf..601c0c3a 100644 --- a/SVSim.BattleEngine/Engine/OperateMgr.cs +++ b/SVSim.BattleEngine/Engine/OperateMgr.cs @@ -58,8 +58,6 @@ public class OperateMgr public event Action OnAttackStart; - public event Action OnBeforeEvolve; - public event Action> OnEvolveSuccess; public event Action OnJustBeforeEvolve; @@ -116,22 +114,10 @@ public class OperateMgr public event Action OnClearSideLog; - public event Action OnCreateBattleLog; - - public event Action OnUpdateBattleLog; - - public event Action OnUpdateBattleLogType; - - public event Action OnUpdateBattleLogIsNecromance; - - public event Action OnRemoveLatestBattleLog; - public event Action, BattleCardBase> OnAttachSkill; public event Action OnCreateEffect; - public event Action OnCreateEffectWithoutBuildInfo; - public event Action> OnShowSkillEffect; public event Action OnSkillInductionEffect; @@ -160,16 +146,8 @@ public class OperateMgr public event Action OnSpecialLose; - public event Action OnEnterForceBerserk; - public event Action OnTurnEndFinish; - public void SetUpRecoveryEvent(OperateMgr recoveryOperateMgr) - { - this.OnBeforeAttack = recoveryOperateMgr.OnBeforeAttack; - this.OnTurnEnd_ButtonPush = recoveryOperateMgr.OnTurnEnd_ButtonPush; - } - public OperateMgr(BattleManagerBase battleMgr, TouchControl touchControl) { _battleMgr = battleMgr; @@ -195,8 +173,8 @@ public class OperateMgr { this.OnBeforeSetCard.Call(card); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - bool isSelectTarget = GameMgr.GetIns().IsAdminWatch && (isAccelerateSelect || card.Skills.CheckWhenPlaySelectTargetSkillCondition); - if (isPlayer || GameMgr.GetIns().IsAdminWatch) + bool isSelectTarget = _battleMgr.GameMgr.IsAdminWatch && (isAccelerateSelect || card.Skills.CheckWhenPlaySelectTargetSkillCondition); + if (isPlayer || _battleMgr.GameMgr.IsAdminWatch) { PlayQueueViewBase playQueueView = _battleMgr.GetBattlePlayer(isPlayer).BattleView.PlayQueueView; _battleMgr.VfxMgr.RegisterImmediateVfx(card.StopSpellCharge()); @@ -204,7 +182,7 @@ public class OperateMgr if (registerDirectlyToVfxManager) { _battleMgr.VfxMgr.RegisterImmediateVfx(vfx); - if (!isPlayer && GameMgr.GetIns().IsAdminWatch && !isSelect && !isAccelerateSelect && !isFusionWait) + if (!isPlayer && _battleMgr.GameMgr.IsAdminWatch && !isSelect && !isAccelerateSelect && !isFusionWait) { sequentialVfxPlayer.Register(WaitVfx.Create(0.5f)); } @@ -325,11 +303,6 @@ public class OperateMgr return actionProcessor; } - public void BeforeEvolutionCard(BattleCardBase card) - { - this.OnBeforeEvolve.Call(card); - } - public virtual VfxBase EvolutionCard(BattleCardBase card, bool isPlayer, List selectCards, List selectChoiceId = null) { if (selectCards != null) @@ -405,7 +378,7 @@ public class OperateMgr { _PlayerBattleView.UpdateTurnEndPulseEffect(); } - if (GameMgr.GetIns().IsWatchBattle) + if (_battleMgr.GameMgr.IsWatchBattle) { _battleMgr.GetBattlePlayer(isPlayer).BattleView.ClearSelectCardList(); } @@ -436,7 +409,7 @@ public class OperateMgr public virtual VfxBase BattleCardSelect(BattleCardBase actCard, List targets, bool isPlayer, bool registerEffectsDirectlyToVfxMgr = true, bool isTransformskill = false, bool isBurialRiteSkill = false, bool isComplete = true) { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (isPlayer || GameMgr.GetIns().IsAdminWatch || GameMgr.GetIns().IsReplayBattle) + if (isPlayer || _battleMgr.GameMgr.IsAdminWatch || _battleMgr.GameMgr.IsReplayBattle) { foreach (BattleCardBase target in targets) { @@ -469,8 +442,8 @@ public class OperateMgr { return InstantVfx.Create(delegate { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_SELECT_3, targetCard.BattleCardView.GameObject.transform.position); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CMN_CARD_SELECT_3); + _battleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_SELECT_3, targetCard.BattleCardView.GameObject.transform.position); + }); } @@ -478,7 +451,7 @@ public class OperateMgr { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); targetCard.IsSelectedDuringSelectingBurialRiteTarget = isBurialRiteSkill; - if (isPlayer || GameMgr.GetIns().IsAdminWatch || GameMgr.GetIns().IsReplayBattle) + if (isPlayer || _battleMgr.GameMgr.IsAdminWatch || _battleMgr.GameMgr.IsReplayBattle) { if (registerSelectStopVfxDirectlyToVfxMgr) { @@ -531,33 +504,17 @@ public class OperateMgr battlePlayer.HandControl.RearrangeHand(0.3f, battlePlayer.HandCardList.ConvertToViewList()); })); } - if (GameMgr.GetIns().IsWatchBattle) + if (_battleMgr.GameMgr.IsWatchBattle) { _battleMgr.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate { - BattleManagerBase.GetIns().GetBattlePlayer(isPlayer).ClassInformationUIController.SetIsSelect(isSelect: false); + _battleMgr.GetBattlePlayer(isPlayer).ClassInformationUIController.SetIsSelect(isSelect: false); })); battlePlayer.BattleView.ClearSelectCardList(); } this.OnSkillCardSelectSuccess = null; } - public void ChoiceCancel(BattleCardBase actCard) - { - _battleMgr.BattlePlayer.PlayerBattleView.RearrangeHand(); - if (_battleMgr.BattlePlayer.HandCardList.Contains(actCard)) - { - _battleMgr.BattlePlayer.HandControl.AttachCardView(actCard.BattleCardView); - actCard.BattleCardView.GameObject.SetActive(value: true); - } - _TouchControl._hitCard = null; - _PlayerBattleView.DisableSettingFlag(); - _PlayerBattleView.AllClear(); - _PlayerBattleView.StopShowSelect(actCard, isAct: false); - _battleMgr.VfxMgr.RegisterImmediateVfx(ParallelVfxPlayer.Create(actCard.StartHandEffect(), actCard.IsInHand ? actCard.BattleCardView.ShowHandCardInfo() : NullVfx.GetInstance())); - this.OnSkillCardSelectSuccess = null; - } - public void StartSelectCard(BattleCardBase card, bool isEvolve, List selectableCards, bool isChoiceBrave) { this.OnStartSelect.Call(card, isEvolve, selectableCards, isChoiceBrave); @@ -649,31 +606,6 @@ public class OperateMgr this.OnClearSideLog.Call(isSelf); } - public void CallOnCreateBattleLog(NetworkBattleReplayOperationRecorder.RecordBattleLogParameter recordParameter) - { - this.OnCreateBattleLog.Call(recordParameter); - } - - public void CallOnUpdateBattleLog(BattleCardBase card, bool isSelf, LogType type, string valueText, bool isSummon, bool isDead) - { - this.OnUpdateBattleLog.Call(card, isSelf, type, valueText, isSummon, isDead); - } - - public void CallOnUpdateBattleLogType(BattleCardBase card, bool isSelf, LogType oldType, LogType newType) - { - this.OnUpdateBattleLogType.Call(card, isSelf, oldType, newType); - } - - public void CallOnUpdateBattleLogIsNecromance(BattleCardBase card, bool isSelf, LogType type, bool isNecromance) - { - this.OnUpdateBattleLogIsNecromance.Call(card, isSelf, type, isNecromance); - } - - public void CallOnRemoveLatestBattleLog() - { - this.OnRemoveLatestBattleLog.Call(); - } - public void CallOnAttachSkill(SkillCreator.SkillBuildInfo buildInfo, List targetCards, BattleCardBase ownerCard) { this.OnAttachSkill.Call(buildInfo, targetCards, ownerCard); @@ -684,11 +616,6 @@ public class OperateMgr this.OnCreateEffect.Call(buildInfo, isFollowInHand, isTargetPosition, addToLastOperation, isWhenFusioned); } - public void CallOnEffect(string effectPath, EffectMgr.EngineType engineType, EffectMgr.MoveType effectMoveType, EffectMgr.TargetType effectTargetType, float effectTime) - { - this.OnCreateEffectWithoutBuildInfo.Call(effectPath, engineType, effectMoveType, effectTargetType, effectTime); - } - public void CallOnShowSkillEffect(BattleCardBase card, List targetCards) { this.OnShowSkillEffect.Call(card, targetCards); @@ -759,11 +686,6 @@ public class OperateMgr this.OnSpecialLose.Call(card); } - public void CallOnEnterForceBerserk(BattlePlayerBase player, BattlePlayerBase enemys, bool isPlayer) - { - this.OnEnterForceBerserk.Call(player, enemys, arg3: false, isPlayer, !isPlayer); - } - public void CallOnTurnEndFinish() { this.OnTurnEndFinish.Call(arg1: true, arg2: true); @@ -806,7 +728,7 @@ public class OperateMgr if (isPlayer) { this.OnBeforePlayerTurnEnd.Call(); - if (GameMgr.GetIns().IsWatchBattle) + if (_battleMgr.GameMgr.IsWatchBattle) { _battleMgr.BattlePlayer.IsChoiceBraveEffectTiming = false; _battleMgr.BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); @@ -820,7 +742,7 @@ public class OperateMgr { ((NetworkBattleManagerBase)_battleMgr).SetTimeDecrementFlag(isDecrement: true); } - if (GameMgr.GetIns().IsAdminWatch) + if (_battleMgr.GameMgr.IsAdminWatch) { _battleMgr.BattleEnemy.UpdateHandCardsPlayability(areArrowsForcedOff: true); } diff --git a/SVSim.BattleEngine/Engine/OperateReceive.cs b/SVSim.BattleEngine/Engine/OperateReceive.cs index 3d62b3dc..0daf0248 100644 --- a/SVSim.BattleEngine/Engine/OperateReceive.cs +++ b/SVSim.BattleEngine/Engine/OperateReceive.cs @@ -59,13 +59,6 @@ public class OperateReceive return new InPlayCardReflection(_battleMgr, _operateMgr); } - public void Reinitialize(NetworkBattleData networkBattleData, OperateMgr operateMgr) - { - _networkBattleData = networkBattleData; - _operateMgr = operateMgr; - _networkPlayCardAction.SetOperateMgr(_operateMgr); - } - public virtual void StartOperate(NetworkOperationCollectionBase networkOperationCollection, NetworkBattleReceiver.ReceiveData receivedData) { networkOperationCollection.WriteOperationToTraceLog(); diff --git a/SVSim.BattleEngine/Engine/OperateReceiveChecker.cs b/SVSim.BattleEngine/Engine/OperateReceiveChecker.cs index 5da72991..d9542ef6 100644 --- a/SVSim.BattleEngine/Engine/OperateReceiveChecker.cs +++ b/SVSim.BattleEngine/Engine/OperateReceiveChecker.cs @@ -198,7 +198,7 @@ public class OperateReceiveChecker if (receiveData.IsChoice) { CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(receiveData.transformBeforeCardId); - BattleCardBase battleCardBase = BattleManagerBase.GetIns().CreateBattleCard(cardParameterFromId.BaseCardId, cardBase.IsPlayer, null, cardParameterFromId, cardBase.SelfBattlePlayer, 0); + BattleCardBase battleCardBase = _battleMgr.CreateBattleCard(cardParameterFromId.BaseCardId, cardBase.IsPlayer, null, cardParameterFromId, cardBase.SelfBattlePlayer, 0); foreach (CardDataModel item in receiveData.SkillConditionCheckList.FindAll((CardDataModel x) => x.publishedActiveSkillCount != 0)) { if (item.publishedActiveSkillCount == -1) diff --git a/SVSim.BattleEngine/Engine/OpponentNotTurnEndToWinChecker.cs b/SVSim.BattleEngine/Engine/OpponentNotTurnEndToWinChecker.cs index 03f6dd17..320f0f14 100644 --- a/SVSim.BattleEngine/Engine/OpponentNotTurnEndToWinChecker.cs +++ b/SVSim.BattleEngine/Engine/OpponentNotTurnEndToWinChecker.cs @@ -5,10 +5,6 @@ public class OpponentNotTurnEndToWinChecker : NetworkBattleIntervalCheckerBase { private NetworkBattleManagerBase networkBattleManager; - private const float RECEIVE_TURNSTART_TO_VICTORY_INTERVAL = 125f; - - private const float RECEIVE_TURNSTART_TO_VICTORY_RECOVERY_INTERVAL = 150f; - private float _timeoutDisconnect; public event Action OnOpponentNotTurnEndToWin; diff --git a/SVSim.BattleEngine/Engine/OpponentNotTurnStartToWinChecker.cs b/SVSim.BattleEngine/Engine/OpponentNotTurnStartToWinChecker.cs index 295f173b..8c5f5b76 100644 --- a/SVSim.BattleEngine/Engine/OpponentNotTurnStartToWinChecker.cs +++ b/SVSim.BattleEngine/Engine/OpponentNotTurnStartToWinChecker.cs @@ -5,10 +5,6 @@ public class OpponentNotTurnStartToWinChecker : NetworkBattleIntervalCheckerBase { private NetworkBattleManagerBase networkBattleManager; - private const float SEND_TURN_END_TO_VICTORY_INTERVAL = 75f; - - private const float SEND_TURN_END_TO_VICTORY_RECOVERY_INTERVAL = 90f; - private float _timeoutDisconnect; public event Action OnOpponentNotTurnStartToWin; diff --git a/SVSim.BattleEngine/Engine/PanelMgr.cs b/SVSim.BattleEngine/Engine/PanelMgr.cs index 19b6abcf..ccc74ee2 100644 --- a/SVSim.BattleEngine/Engine/PanelMgr.cs +++ b/SVSim.BattleEngine/Engine/PanelMgr.cs @@ -8,480 +8,17 @@ public class PanelMgr : MonoBehaviour { public enum BattleAlertType { - CannotPlay, - InPlayIsFull, - NotEnoughPp, - NoInPlayTarget, - NotPassCondition, - GuardExisted, - EvoButDrunk, - CannotAttackNotHasGuard, - CannotAttackClass, - CannotAttackAmulet, - CannotAttackTarget, - AlreadyAttackedThisTurn, - CannotAttackOnSameTurn, - CannotAttackGeneric, EmoteLimit, - ContainRandomElement, - NoSelectedEvolutionTarget, - NoSelectedEmotionIcon, - SelectedEmotionIcon, - SelectTargetCard, - SelectTargetCardOver, SelectChoiceCard, - SelectChoiceBraveCard, - ElfInfomation, - RoyalInfomation, - WitchInfomation, - DragonInfomationNotAwake, - DragonInfomationAwake, - VampireInfomationNotRevenge, - VampireInfomationRevenge, - NecromanceInfomation, - BishopInfomation, DisconnectInfomation, DisconnectInfomationMulligan, None } - private const float AUTOSTOP_SEC_MAX = 3f; - - private const float SIZE_NORMAL = 1f; - - private const float SIZE_SMALL = 0.5f; - - private const int DEPTH_NORMAL = 42; - - private const int DEPTH_CHOICE = 30; - - private const float SELECT_POSITION_Y = 0.52f; - - private const float SELECT_OVER_POSITION_Y = 0.77f; - - private const float SELECT_CHOICE_Y = 0.65f; - - private float _autoStopSec; - - private Coroutine _autoStopCoroutine; - private BattleManagerBase _battleMgr; - private BattleAlertType _currentAlertType = BattleAlertType.None; - - private string _currentText = ""; - - private bool _notHideAndNotCreate; - - private static readonly string INPLAY_TEXT = SkillFilterCreator.ContentKeyword.inplay.ToString(); - - private static readonly string HAND_OTHER_SELF_TEXT = SkillFilterCreator.ContentKeyword.hand_other_self.ToString(); - - private static readonly string CONST_TEXT = SkillFilterCreator.ContentKeyword.count.ToString(); - - private static readonly string TURN_DAMAGE_CONST_TEXT = SkillFilterCreator.ContentKeyword.turn_damage_count.ToString(); - - private static readonly string TURN_HEAL_CONST_TEXT = SkillFilterCreator.ContentKeyword.turn_heal_count.ToString(); - - private static readonly string TURN_SKILL_RETURN_CARD_CONST_TEXT = SkillFilterCreator.ContentKeyword.turn_skill_return_card_count.ToString(); - - private static readonly string TURN_ENHANCE_CARD_COUNT_TEXT = SkillFilterCreator.ContentKeyword.turn_enhance_card_count.ToString(); - private void Awake() { - _battleMgr = BattleManagerBase.GetIns(); - } - - public void InfoAlertDialogueAction(BattleAlertType AlertType, int PanelWidth, bool anim, bool isClass, string text) - { - if ((_currentAlertType == BattleAlertType.EmoteLimit && (AlertType == BattleAlertType.NoSelectedEmotionIcon || AlertType == BattleAlertType.SelectedEmotionIcon)) || _notHideAndNotCreate) - { - return; - } - _currentAlertType = AlertType; - switch (AlertType) - { - case BattleAlertType.CannotPlay: - case BattleAlertType.InPlayIsFull: - case BattleAlertType.NotEnoughPp: - case BattleAlertType.NoInPlayTarget: - case BattleAlertType.NotPassCondition: - case BattleAlertType.EvoButDrunk: - case BattleAlertType.AlreadyAttackedThisTurn: - case BattleAlertType.CannotAttackOnSameTurn: - case BattleAlertType.CannotAttackGeneric: - case BattleAlertType.EmoteLimit: - case BattleAlertType.ElfInfomation: - case BattleAlertType.RoyalInfomation: - case BattleAlertType.WitchInfomation: - case BattleAlertType.DragonInfomationNotAwake: - case BattleAlertType.DragonInfomationAwake: - case BattleAlertType.VampireInfomationNotRevenge: - case BattleAlertType.VampireInfomationRevenge: - case BattleAlertType.NecromanceInfomation: - case BattleAlertType.BishopInfomation: - DialogueReposition(0f, 0f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim); - break; - case BattleAlertType.ContainRandomElement: - case BattleAlertType.NoSelectedEmotionIcon: - DialogueReposition(0f, 0f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim, isAutoStop: false, 0.5f); - break; - case BattleAlertType.NoSelectedEvolutionTarget: - DialogueReposition(0f, 0.15f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim, isAutoStop: false, 0.5f); - break; - case BattleAlertType.SelectedEmotionIcon: - DialogueReposition(0f, 0f, text, 0, PanelWidth, anim: false, isAutoStop: false, 0.5f); - break; - case BattleAlertType.SelectTargetCard: - DialogueReposition(0f, 0.52f, text, 0, PanelWidth, anim: false, isAutoStop: false, 0.5f); - break; - case BattleAlertType.SelectTargetCardOver: - DialogueReposition(0f, 0.77f, text, 0, PanelWidth, anim: false, isAutoStop: false, 0.5f); - break; - case BattleAlertType.SelectChoiceCard: - case BattleAlertType.SelectChoiceBraveCard: - DialogueReposition(0f, 0.65f, text, 0, PanelWidth, anim: false, isAutoStop: false, 0.5f, 30); - break; - case BattleAlertType.GuardExisted: - case BattleAlertType.CannotAttackNotHasGuard: - case BattleAlertType.CannotAttackClass: - case BattleAlertType.CannotAttackAmulet: - case BattleAlertType.CannotAttackTarget: - if (isClass) - { - DialogueReposition(-0.8f, 0.8f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim); - _battleMgr.AlertDialogueLabel.width = 400; - } - else - { - DialogueReposition(0.01f, 0.58f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim); - } - break; - case BattleAlertType.DisconnectInfomation: - DialogueReposition(0f, 0f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim, isAutoStop: false, 1f, 42, notHideAndCreate: true); - break; - case BattleAlertType.DisconnectInfomationMulligan: - DialogueReposition(0f, 0f, GetAlertTypeToText(AlertType), 0, PanelWidth, anim, isAutoStop: false); - break; - } - } - - public static string GetAlertTypeToText(BattleAlertType AlertType) - { - SystemText systemText = Data.SystemText; - switch (AlertType) - { - case BattleAlertType.CannotPlay: - return systemText.Get("Battle_0153"); - case BattleAlertType.InPlayIsFull: - return systemText.Get("Battle_0154"); - case BattleAlertType.NotEnoughPp: - return systemText.Get("Battle_0155"); - case BattleAlertType.GuardExisted: - return systemText.Get("Battle_0156"); - case BattleAlertType.NoInPlayTarget: - return systemText.Get("Battle_0157"); - case BattleAlertType.NotPassCondition: - return systemText.Get("Battle_0170"); - case BattleAlertType.AlreadyAttackedThisTurn: - return systemText.Get("Battle_0166"); - case BattleAlertType.CannotAttackOnSameTurn: - return systemText.Get("Battle_0167"); - case BattleAlertType.CannotAttackGeneric: - return systemText.Get("Battle_0168"); - case BattleAlertType.CannotAttackNotHasGuard: - case BattleAlertType.CannotAttackClass: - return systemText.Get("Battle_0159"); - case BattleAlertType.EvoButDrunk: - return systemText.Get("Battle_0160"); - case BattleAlertType.CannotAttackAmulet: - return systemText.Get("Battle_0169"); - case BattleAlertType.CannotAttackTarget: - return systemText.Get("Battle_0162"); - case BattleAlertType.EmoteLimit: - return systemText.Get("Battle_0165"); - case BattleAlertType.ElfInfomation: - return systemText.Get("Battle_0452"); - case BattleAlertType.RoyalInfomation: - return systemText.Get("Battle_0453"); - case BattleAlertType.WitchInfomation: - return systemText.Get("Battle_0454"); - case BattleAlertType.DragonInfomationNotAwake: - return systemText.Get("Battle_0455"); - case BattleAlertType.DragonInfomationAwake: - return systemText.Get("Battle_0456"); - case BattleAlertType.VampireInfomationNotRevenge: - return systemText.Get("Battle_0457"); - case BattleAlertType.VampireInfomationRevenge: - return systemText.Get("Battle_0458"); - case BattleAlertType.NecromanceInfomation: - return systemText.Get("Battle_0459"); - case BattleAlertType.BishopInfomation: - return systemText.Get("Battle_0460"); - case BattleAlertType.ContainRandomElement: - return systemText.Get("Battle_0449"); - case BattleAlertType.NoSelectedEvolutionTarget: - return systemText.Get("Battle_0447"); - case BattleAlertType.NoSelectedEmotionIcon: - return systemText.Get("Battle_0448"); - case BattleAlertType.DisconnectInfomation: - case BattleAlertType.DisconnectInfomationMulligan: - return systemText.Get("Battle_0492"); - default: - return "error not text"; - } - } - - private void DialogueReposition(float PanelX, float PanelY, string txt, int spacing, int PanelWidth, bool anim, bool isAutoStop = true, float size = 1f, int depth = 42, bool notHideAndCreate = false) - { - if (_currentText == txt) - { - return; - } - _currentText = txt; - _notHideAndNotCreate = notHideAndCreate; - NguiObjs component = _battleMgr.AlertDialogue.GetComponent(); - UILabel uILabel = component.labels[0]; - uILabel.text = txt; - uILabel.spacingX = spacing; - uILabel.width = PanelWidth; - uILabel.fontSize = ((size == 1f) ? 32 : 42); - component.gameObject.SetActive(value: true); - component.transform.position = new Vector3(PanelX, PanelY, 0f); - component.transform.localScale = new Vector3(size, size, 1f); - UIPanel componentInChildren = component.transform.GetComponentInChildren(); - if (componentInChildren != null) - { - componentInChildren.depth = depth; - } - if (anim) - { - component.transform.position = new Vector3(PanelX - 0.2f, PanelY, 0f); - iTween.MoveTo(component.gameObject, iTween.Hash("x", PanelX, "y", PanelY, "time", 0.2f, "easetype", iTween.EaseType.easeOutExpo)); - iTween component2 = component.sprites[0].GetComponent(); - if (component2 != null) - { - UnityEngine.Object.DestroyImmediate(component2); - } - component.sprites[0].transform.localScale = new Vector3(1f, 2f, 1f); - iTween.ScaleTo(component.sprites[0].gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "easetype", iTween.EaseType.easeOutBack)); - } - else - { - component.transform.position = new Vector3(PanelX, PanelY, 0f); - component.sprites[0].transform.localScale = new Vector3(1f, 1f, 1f); - } - uILabel.MarkAsChanged(); - if (isAutoStop) - { - AutoStopAlertDialogue(); - } - } - - public void AlertActionFalse() - { - if (!_notHideAndNotCreate) - { - iTween.Stop(_battleMgr.AlertDialogue, includechildren: true); - _battleMgr.AlertDialogue.SetActive(value: false); - _currentAlertType = BattleAlertType.None; - _currentText = ""; - } - } - - public void OffNotHideAndNotCreate() - { - _notHideAndNotCreate = false; - } - - public void Hide(BattleAlertType alertType) - { - if (_currentAlertType == alertType) - { - AlertActionFalse(); - } - } - - private void AutoStopAlertDialogue() - { - _autoStopSec = 0f; - if (_autoStopCoroutine != null) - { - StopCoroutine(_autoStopCoroutine); - _autoStopCoroutine = null; - } - _autoStopCoroutine = StartCoroutine(AutoStopAlertDialogueCoroutine()); - } - - private IEnumerator AutoStopAlertDialogueCoroutine() - { - while (_battleMgr.AlertDialogue.activeSelf) - { - if (!BattleManagerBase.UseCustomMouse && GameMgr.GetIns().GetInputMgr().IsDown()) - { - AlertActionFalse(); - break; - } - _autoStopSec += Time.deltaTime; - if (_autoStopSec >= 3f) - { - AlertActionFalse(); - break; - } - yield return null; - } - } - - public static BattleAlertType GetCannotAttackAlertType(BattleCardBase attackCard) - { - if (!attackCard.IsSelfTurn) - { - return BattleAlertType.None; - } - if (!attackCard.IsUnit) - { - return BattleAlertType.CannotAttackGeneric; - } - if (attackCard.AttackableCount <= 0) - { - return BattleAlertType.AlreadyAttackedThisTurn; - } - if (attackCard.IsSummonDrunkenness) - { - return BattleAlertType.CannotAttackOnSameTurn; - } - if (!attackCard.AreCanAttackConditionsFulfilled) - { - return BattleAlertType.None; - } - return BattleAlertType.CannotAttackGeneric; - } - - public void ShowAlert(BattleAlertType AlertType, bool isClass, string text = null) - { - if ((!GameMgr.GetIns().IsWatchBattle || AlertType == BattleAlertType.SelectChoiceCard) && AlertType != BattleAlertType.None) - { - int panelWidth = 0; - bool anim = true; - switch (AlertType) - { - case BattleAlertType.EvoButDrunk: - case BattleAlertType.CannotAttackClass: - case BattleAlertType.DisconnectInfomation: - case BattleAlertType.DisconnectInfomationMulligan: - panelWidth = 800; - break; - case BattleAlertType.NotEnoughPp: - case BattleAlertType.GuardExisted: - case BattleAlertType.CannotAttackNotHasGuard: - case BattleAlertType.CannotAttackAmulet: - case BattleAlertType.CannotAttackTarget: - case BattleAlertType.AlreadyAttackedThisTurn: - case BattleAlertType.CannotAttackOnSameTurn: - case BattleAlertType.CannotAttackGeneric: - panelWidth = 600; - break; - case BattleAlertType.CannotPlay: - case BattleAlertType.NoInPlayTarget: - case BattleAlertType.NotPassCondition: - case BattleAlertType.SelectedEmotionIcon: - panelWidth = 800; - break; - case BattleAlertType.InPlayIsFull: - panelWidth = 700; - anim = false; - break; - case BattleAlertType.SelectTargetCard: - case BattleAlertType.SelectTargetCardOver: - case BattleAlertType.SelectChoiceCard: - panelWidth = 900; - anim = false; - break; - case BattleAlertType.SelectChoiceBraveCard: - panelWidth = 960; - anim = false; - break; - case BattleAlertType.EmoteLimit: - case BattleAlertType.ContainRandomElement: - case BattleAlertType.NoSelectedEvolutionTarget: - case BattleAlertType.NoSelectedEmotionIcon: - case BattleAlertType.ElfInfomation: - case BattleAlertType.RoyalInfomation: - case BattleAlertType.WitchInfomation: - case BattleAlertType.DragonInfomationNotAwake: - case BattleAlertType.DragonInfomationAwake: - case BattleAlertType.VampireInfomationNotRevenge: - case BattleAlertType.VampireInfomationRevenge: - case BattleAlertType.NecromanceInfomation: - case BattleAlertType.BishopInfomation: - panelWidth = 1000; - break; - } - InfoAlertDialogueAction(AlertType, panelWidth, anim, isClass, text); - } - } - - public bool ShowAlertTouchCard(ref BattleCardBase hitCard, ref BattleManagerBase battleMgr) - { - BattleAlertType battleAlertType = BattleAlertType.None; - bool isClass = true; - int pp = _battleMgr.BattlePlayer.Pp; - Skill_pp_fixeduse mutationSkill = hitCard.GetAccelerateOrCrystallizeSkill(pp); - bool flag = mutationSkill != null; - if (hitCard.IsSpell || (flag && mutationSkill.OnWhenAccelerate != 0)) - { - bool flag2 = hitCard.SelfBattlePlayer.Class.SkillApplyInformation.HasCantPlaySpellFilter(); - if (pp < hitCard.Cost && !flag) - { - battleAlertType = BattleAlertType.NotEnoughPp; - isClass = false; - } - else if (hitCard.SelfBattlePlayer.Class.SkillApplyInformation.IsCantPlay(hitCard) || flag2) - { - battleAlertType = BattleAlertType.CannotPlay; - isClass = false; - } - else - { - BattleCardBase battleCardBase = hitCard; - Func isSelectCondition = (SkillVariableComareFilter f) => (f.Lhs.Contains(INPLAY_TEXT) || f.Lhs.Contains(HAND_OTHER_SELF_TEXT)) && f.Lhs.Contains(CONST_TEXT) && f.Compare == ">" && f.Rhs == "0"; - Func isExceptCondition = (SkillVariableComareFilter f) => !f.Lhs.Contains(TURN_DAMAGE_CONST_TEXT) && !f.Lhs.Contains(TURN_HEAL_CONST_TEXT) && !f.Lhs.Contains(TURN_SKILL_RETURN_CARD_CONST_TEXT) && !f.Lhs.Contains(TURN_ENHANCE_CARD_COUNT_TEXT); - if ((flag && mutationSkill._fixedUsePP == battleCardBase.CalcFixedUseCost(pp, skipCondition: true) && (mutationSkill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => (!isSelectCondition(f) || !isExceptCondition(f)) && !f.Filtering(mutationSkill.OptionValue)) || mutationSkill.ConditionFilterCollection.ConditionCheckerFilterList.Any((ISkillConditionChecker f) => f is SkillConditionWrath || f is SkillConditionEvolvableTurn))) || hitCard.Skills.Any((SkillBase s) => s is Skill_can_play_self)) - { - battleAlertType = BattleAlertType.NotPassCondition; - isClass = false; - } - else if (!hitCard.Skills.CheckWhenPlaySelectTargetSkillCondition) - { - battleAlertType = BattleAlertType.NoInPlayTarget; - isClass = false; - } - } - } - else if (flag && mutationSkill.OnWhenCrystallize != 0 && _battleMgr.BattlePlayer.ClassAndInPlayCardList.Count > 5) - { - battleAlertType = BattleAlertType.InPlayIsFull; - } - else if (flag && mutationSkill.OnWhenCrystallize != 0 && hitCard.SelfBattlePlayer.Class.SkillApplyInformation.IsCantPlay(hitCard)) - { - battleAlertType = BattleAlertType.CannotPlay; - isClass = false; - } - else if (pp < hitCard.Cost) - { - battleAlertType = BattleAlertType.NotEnoughPp; - isClass = false; - } - else if (_battleMgr.BattlePlayer.ClassAndInPlayCardList.Count > 5) - { - battleAlertType = BattleAlertType.InPlayIsFull; - } - else if (hitCard.SelfBattlePlayer.Class.SkillApplyInformation.IsCantPlay(hitCard)) - { - battleAlertType = BattleAlertType.CannotPlay; - isClass = false; - } - ShowAlert(battleAlertType, isClass); - return battleAlertType != BattleAlertType.None; + _battleMgr = _battleMgr; } } diff --git a/SVSim.BattleEngine/Engine/Payment.cs b/SVSim.BattleEngine/Engine/Payment.cs deleted file mode 100644 index 6df14037..00000000 --- a/SVSim.BattleEngine/Engine/Payment.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Wizard; - -public static class Payment -{ - private static bool initialized; - - public static void initialize(PaymentImpl callback, string productKey) - { - PaymentImpl.GetInstance().paymentUI.StartLoading(); - _ = initialized; - initialized = true; - } - - public static void finalize() - { - if (initialized) - { - initialized = false; - } - } - - public static void purchaseProduct(string productId, PaymentBase.RefundWarningType refundWarningType) - { - RefundWarningDialog.Start(refundWarningType, delegate - { - PaymentImpl.GetInstance().paymentUI.StartLoading(useTimeCount: true); - }); - } - - public static void getProductList(string[] productIds) - { - PaymentImpl.GetInstance().paymentUI.StartLoading(useTimeCount: true, forProductListInit: true); - } - - public static void consumePurchase(string[] productIds, string orderId) - { - PaymentImpl.GetInstance().paymentUI.StartLoading(useTimeCount: true); - } - - public static void UseDebugLog(bool useDebugLog) - { - } -} diff --git a/SVSim.BattleEngine/Engine/PaymentBase.cs b/SVSim.BattleEngine/Engine/PaymentBase.cs deleted file mode 100644 index 6010f4c7..00000000 --- a/SVSim.BattleEngine/Engine/PaymentBase.cs +++ /dev/null @@ -1,23 +0,0 @@ -using UnityEngine; - -public class PaymentBase : MonoBehaviour -{ - public enum RefundWarningType - { - NONE, - WARNING, - PENALTY - } - - protected bool IsAlertAgree; - - protected void CallPaymentStartFromAlert(string ProductId) - { - IsAlertAgree = true; - purchaceStart(ProductId, isFromAlert: true); - } - - public virtual void purchaceStart(string ProductId, bool isFromAlert = false) - { - } -} diff --git a/SVSim.BattleEngine/Engine/PaymentImpl.cs b/SVSim.BattleEngine/Engine/PaymentImpl.cs deleted file mode 100644 index 7b7e6b5b..00000000 --- a/SVSim.BattleEngine/Engine/PaymentImpl.cs +++ /dev/null @@ -1,585 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using Cute.Payment; -using UnityEngine; -using Wizard; - -public class PaymentImpl : PaymentBase, IPaymentCallback, IPaymentCommonCallback -{ - public enum PaymentOriginalScreen - { - SHOP_PLUS, - MYPAGE, - NONE - } - - public List ProductIdList; - - public List IdList; - - public Dictionary ProductPriceList; - - public Dictionary FormatProductPriceList; - - public Dictionary ProductNameList; - - public Dictionary ProductTextList; - - public Dictionary ProductPurchaseLimitList; - - public Dictionary ProductPurchaseNumberList; - - public Dictionary ProductCsvIdList; - - public Dictionary ProductImageNameList; - - public Dictionary ProductIsSpecialShop; - - public Dictionary ProductCurrentPurchaseCount; - - public Dictionary ProductPurchaseLimitCount; - - public Dictionary ProductEndTime; - - private string lastErrorMethod; - - private string lastErrorMessage; - - private long lastLogTimeTicks = DateTime.Now.Ticks; - - private int sameLogCount; - - public PaymentOriginalScreen PaymentFromScreen; - - public List skuInfos; - - public string selectedStoreProductId; - - public List lastSucceededPurchases = new List(); - - public int resumePurchaseTransactionCount; - - public bool inProcessingResumePurchaseTransaction; - - public bool inProcessingPurchaseTransaction; - - public bool isPaymentListErrorDialogOpen; - - private bool _receivePaymentSuccess; - - private bool _receivePaymentCancel; - - private static PaymentImpl instance; - - private bool isCountTime; - - private bool isCountTimeForProductListInit; - - private float timer; - - public string StoreProductCountryCode { get; private set; } - - public string StoreProductCurrencyCode { get; private set; } - - public bool IsRefundedReceipt { get; private set; } - - public PaymentUI paymentUI { get; private set; } - - public event Action ProductListSucceeded; - - public event Action ProductListFailed; - - public event Action FinishFailureEvent; - - public event Action purchaseFinishSuccessEvent; - - public event Action purchaseFinishHttpErrorEvent; - - public event Action purchaseFinishResultCodeErrorEvent; - - public event Action purchaseRetryResultEvent; - - public event Action ConsumePurchaseSucceeded; - - private void Awake() - { - if (paymentUI == null) - { - paymentUI = new PaymentUI(); - } - } - - private void Update() - { - if (isCountTime) - { - checkTimeOut(); - } - } - - public static PaymentImpl GetInstance() - { - if (instance == null) - { - GameObject obj = new GameObject("PaymentImpl"); - UnityEngine.Object.DontDestroyOnLoad(obj); - instance = obj.AddComponent(); - } - return instance; - } - - private void OnItemListFailure(NetworkTask.ResultCode code) - { - Debug.LogError("OnItemListFailure" + code); - Debug.LogError("プロダクトIDリストリクエストが失敗しました。やり直してください。"); - } - - private void OnItemListResultCodeError(int code) - { - Debug.LogError("OnItemListResultCodeError" + code); - this.ProductListFailed.Call(); - } - - private void OnFinishSuccess(NetworkTask.ResultCode code) - { - string[] array = new string[lastSucceededPurchases.Count]; - for (int i = 0; i < lastSucceededPurchases.Count; i++) - { - array[i] = lastSucceededPurchases[i].getProductId(); - } - string orderId = ((lastSucceededPurchases.Count > 0) ? lastSucceededPurchases[0].getOrderId() : ""); - Payment.consumePurchase(array, orderId); - } - - private void OnFinishFailure(NetworkTask.ResultCode code) - { - paymentUI.StopLoading(); - Debug.LogError("OnFinishFailure:" + code); - if (this.purchaseFinishHttpErrorEvent != null) - { - this.purchaseFinishHttpErrorEvent(code); - } - inProcessingPurchaseTransaction = false; - } - - private void OnFinishResultCodeError(int resultCode) - { - paymentUI.StopLoading(); - Debug.LogError("OnFinishResultCodeError" + resultCode); - Debug.LogError("チェック不正です。"); - if (this.purchaseFinishResultCodeErrorEvent != null) - { - this.purchaseFinishResultCodeErrorEvent(resultCode); - } - inProcessingPurchaseTransaction = false; - } - - public void OnPaymentCancelByRefundWarningDialog() - { - inProcessingPurchaseTransaction = false; - } - - public void evInitializeSucceeded() - { - paymentUI.StopLoading(); - Payment.getProductList(ProductIdList.ToArray()); - } - - public void OnInitializeSucceeded() - { - evInitializeSucceeded(); - } - - public void evInitializeFailed(string error) - { - paymentUI.StopLoading(); - if (BattleManagerBase.GetIns() == null) - { - sendPaymentErrorLog("evInitializeFailed", error); - this.ProductListFailed.Call(); - } - } - - public void OnInitializeFailed(int errorCode, string errorMessage) - { - evInitializeFailed(errorMessage); - } - - public void evPurchaseSucceeded(PaymentPurchase purchase) - { - if (BattleManagerBase.GetIns() == null) - { - paymentUI.StopLoading(); - _receivePaymentSuccess = true; - lastSucceededPurchases.Add(purchase); - selectedStoreProductId = purchase.getProductId(); - } - } - - public void OnPurchaseFailed(string error) - { - evPurchaseFailed(error); - } - - public void OnPurchaseFailed(int errorCode, string errorMessage) - { - evPurchaseFailed(errorCode + ":" + errorMessage); - } - - public void evPurchaseFailed(string error) - { - if (BattleManagerBase.GetIns() != null) - { - return; - } - paymentUI.StopLoading(); - string message = paymentUI.GetText("Shop_0072"); - if (_receivePaymentCancel) - { - return; - } - _receivePaymentCancel = true; - PaymentCancelTask paymentCancelTask = new PaymentCancelTask(); - paymentCancelTask.SetParameter(getSkuInfo(GetInstance().selectedStoreProductId), error); - StartCoroutine(Toolbox.NetworkManager.Connect(paymentCancelTask, delegate - { - if (!error.Contains("Received a pending purchase of SKU:") && !_receivePaymentSuccess) - { - if (this.FinishFailureEvent != null) - { - this.FinishFailureEvent(message); - } - else - { - paymentUI.PurchaseFailed(); - } - } - }, delegate - { - }, delegate(int code) - { - Debug.LogError("OnPurchaseFailedCancelTaskResultCodeError" + code); - })); - inProcessingPurchaseTransaction = false; - } - - public void OnPurchaseCancelled(string productId, string price, string currencyCode) - { - evPurchaseCancelled(""); - } - - public void evPurchaseCancelled(string error) - { - paymentUI.StopLoading(); - string message = paymentUI.GetText("Shop_0073"); - PaymentCancelTask paymentCancelTask = new PaymentCancelTask(); - paymentCancelTask.SetParameter(getSkuInfo(GetInstance().selectedStoreProductId), error); - StartCoroutine(Toolbox.NetworkManager.Connect(paymentCancelTask, delegate - { - if (this.FinishFailureEvent != null) - { - this.FinishFailureEvent(message); - } - else - { - paymentUI.PurchaseCancelled(); - } - }, delegate - { - }, delegate(int code) - { - Debug.LogError("OnCancelResultCodeError" + code); - })); - inProcessingPurchaseTransaction = false; - } - - public void OnGetProductListSucceeded(List productInfo, bool waitUnfinishedTransaction) - { - evGetProductListSucceeded(productInfo); - } - - public void evGetProductListSucceeded(List infos) - { - skuInfos = infos; - string text = "アイテムリストを取得しました" + Environment.NewLine; - ProductPriceList.Clear(); - FormatProductPriceList.Clear(); - int count = infos.Count; - for (int i = 0; i < count; i++) - { - ProductPriceList.Add(infos[i].productId, infos[i].price); - FormatProductPriceList.Add(infos[i].productId, infos[i].formattedPrice); - StoreProductCountryCode = infos[i].currencyCode; - StoreProductCurrencyCode = infos[i].currencyCode; - if (!string.IsNullOrEmpty(StoreProductCountryCode)) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.CURRENT_REGION_CODE, StoreProductCountryCode); - } - text = text + " " + infos[i].title + " : " + infos[i].formattedPrice + Environment.NewLine; - } - if (!inProcessingResumePurchaseTransaction) - { - paymentUI.StopLoading(); - } - } - - public void OnGetProductListFailed(int errorCode, string errorMessage) - { - evGetProductListFailed(errorCode + ":" + errorMessage); - } - - public void evGetProductListFailed(string error) - { - paymentUI.StopLoading(); - if (BattleManagerBase.GetIns() == null) - { - sendPaymentErrorLog("evGetProductListFailed", error); - this.ProductListFailed.Call(); - inProcessingPurchaseTransaction = false; - } - } - - public void OnConsumePurchaseSucceeded() - { - evConsumePurchaseSucceeded(); - } - - public void evConsumePurchaseSucceeded() - { - paymentUI.StopLoading(); - lastSucceededPurchases.Clear(); - this.ConsumePurchaseSucceeded.Call(); - inProcessingPurchaseTransaction = false; - } - - public void OnConsumePurchaseFailed(int errorCode, string errorMessage) - { - evConsumePurchaseFailed(errorCode + ":" + errorMessage); - } - - public void evConsumePurchaseFailed(string error) - { - paymentUI.StopLoading(); - sendPaymentErrorLog("evConsumePurchaseFailed", error); - inProcessingPurchaseTransaction = false; - } - - public void evConsumePurchaseSucceedediOS() - { - } - - public void TryToShowBuyResultPopUp(int amount, int sum, bool isRefundedReceipt = false) - { - IsRefundedReceipt = isRefundedReceipt; - if (this.purchaseFinishSuccessEvent != null) - { - this.purchaseFinishSuccessEvent(NetworkTask.ResultCode.Success); - return; - } - string value = ""; - ProductNameList.TryGetValue(selectedStoreProductId, out value); - paymentUI.PurchaseFinished(value, amount, sum, isRefundedReceipt); - } - - public void TryToShowBuyResultPopUpSecond(bool isRefundedReceipt = false) - { - IsRefundedReceipt = isRefundedReceipt; - string value = ""; - ProductNameList.TryGetValue(selectedStoreProductId, out value); - paymentUI.PurchaseFinished(value, 0, 0, isRefundedReceipt); - if (this.purchaseRetryResultEvent != null) - { - this.purchaseRetryResultEvent(); - } - } - - public override void purchaceStart(string storeProductId, bool isFromAlert = false) - { - if (inProcessingPurchaseTransaction) - { - return; - } - inProcessingPurchaseTransaction = true; - string message = ""; - if (false) - { - sendPaymentErrorLog("purchaceStart", message); - if (this.FinishFailureEvent != null) - { - string text = paymentUI.GetText("Shop_0072"); - this.FinishFailureEvent(string.Format(text, resumePurchaseTransactionCount)); - } - else - { - paymentUI.PurchaseFailed(); - } - inProcessingPurchaseTransaction = false; - return; - } - _receivePaymentSuccess = false; - _receivePaymentCancel = false; - bool isAlertOn = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.PURCHASE_ALERT); - if (!isFromAlert) - { - IsAlertAgree = false; - } - PaymentStartTask task = new PaymentStartTask(); - task.SetParameter(getSkuInfo(storeProductId), IsAlertAgree, isAlertOn); - task.SkipAllCuteResultCodeCheckErrorPopup(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Payment.purchaseProduct(storeProductId, task.NeedRefundWarningType); - }, delegate - { - inProcessingPurchaseTransaction = false; - }, delegate(int code) - { - inProcessingPurchaseTransaction = false; - if (code == 329) - { - if (isAlertOn) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetTitleLabel(systemText.Get("ErrorHeader_0329")); - dialogBase.SetText(systemText.Get("Error_0329")); - dialogBase.SetButtonText(systemText.Get("Shop_0082")); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetPanelDepth(6000); - dialogBase.SetPanelSortingOrder(2); - dialogBase.SetButtonDelegate(new EventDelegate(delegate - { - CallPaymentStartFromAlert(storeProductId); - })); - } - else - { - CallPaymentStartFromAlert(storeProductId); - } - } - else - { - Toolbox.NetworkManager.NetworkUI.OpenCloseOnlyErrorPopUp(code); - } - })); - selectedStoreProductId = storeProductId; - } - - public void initialize() - { - if (!inProcessingPurchaseTransaction) - { - this.ProductListSucceeded = null; - this.ProductListFailed = null; - this.FinishFailureEvent = null; - this.purchaseFinishSuccessEvent = null; - this.purchaseFinishHttpErrorEvent = null; - this.purchaseFinishResultCodeErrorEvent = null; - this.purchaseRetryResultEvent = null; - this.ConsumePurchaseSucceeded = null; - ProductIdList = new List(); - IdList = new List(); - ProductNameList = new Dictionary(); - ProductPriceList = new Dictionary(); - FormatProductPriceList = new Dictionary(); - ProductTextList = new Dictionary(); - ProductPurchaseLimitList = new Dictionary(); - ProductPurchaseNumberList = new Dictionary(); - ProductCsvIdList = new Dictionary(); - ProductImageNameList = new Dictionary(); - ProductIsSpecialShop = new Dictionary(); - ProductCurrentPurchaseCount = new Dictionary(); - ProductPurchaseLimitCount = new Dictionary(); - lastSucceededPurchases = new List(); - ProductEndTime = new Dictionary(); - PaymentItemListTask task = new PaymentItemListTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Payment.initialize(GetInstance(), ""); - }, OnItemListFailure, OnItemListResultCodeError)); - } - } - - public void finalize() - { - inProcessingPurchaseTransaction = false; - inProcessingResumePurchaseTransaction = false; - resumePurchaseTransactionCount = 0; - this.ProductListSucceeded = null; - this.ProductListFailed = null; - this.FinishFailureEvent = null; - this.purchaseFinishSuccessEvent = null; - this.purchaseFinishHttpErrorEvent = null; - this.purchaseFinishResultCodeErrorEvent = null; - this.purchaseRetryResultEvent = null; - this.ConsumePurchaseSucceeded = null; - Payment.finalize(); - } - - public void StartTimeCount(bool forProductListInit = false) - { - isCountTime = true; - isCountTimeForProductListInit = forProductListInit; - } - - public void StopTimeCount() - { - isCountTime = false; - timer = 0f; - } - - private void checkTimeOut() - { - timer += Time.deltaTime; - if (!(timer >= 30f)) - { - return; - } - timer = 0f; - paymentUI.StopLoading(); - if (isCountTimeForProductListInit) - { - if (PaymentFromScreen == PaymentOriginalScreen.SHOP_PLUS) - { - paymentUI.ProductListInitTimeOut(); - } - } - else - { - paymentUI.PurchaseTimeOut(); - } - } - - public PaymentSkuInfo getSkuInfo(PaymentPurchase purchase) - { - return skuInfos.Find((PaymentSkuInfo x) => x.productId == purchase.getProductId()); - } - - public PaymentSkuInfo getSkuInfo(string productId) - { - return skuInfos.Find((PaymentSkuInfo x) => x.productId == productId); - } - - public bool isGoogleReward(string productId) - { - return productId.EndsWith(".rew"); - } - - private void sendPaymentErrorLog(string method, string message) - { - long ticks = DateTime.Now.Ticks; - if (method == lastErrorMethod && message == lastErrorMessage && ticks - lastLogTimeTicks < 600000000) - { - sameLogCount++; - return; - } - LocalLog.AccumulateTraceLog(((sameLogCount > 0) ? $"same log : {sameLogCount}\n" : string.Empty) + "\n method:" + method + " message: " + message); - lastLogTimeTicks = ticks; - lastErrorMethod = method; - lastErrorMessage = message; - sameLogCount = 0; - } -} diff --git a/SVSim.BattleEngine/Engine/PaymentPC.cs b/SVSim.BattleEngine/Engine/PaymentPC.cs deleted file mode 100644 index 179d5a4c..00000000 --- a/SVSim.BattleEngine/Engine/PaymentPC.cs +++ /dev/null @@ -1,289 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using Steamworks; -using UnityEngine; -using Wizard; - -public class PaymentPC : PaymentBase -{ - public List ProductIdList; - - public List IdList; - - public Dictionary ProductPriceList; - - public Dictionary FormatProductPriceList; - - public Dictionary ProductNameList; - - public Dictionary ProductTextList; - - public Dictionary ProductPurchaseLimitList; - - public Dictionary ProductPurchaseNumberList; - - public Dictionary ProductCsvIdList; - - public Dictionary ProductImageNameList; - - public Dictionary ProductIsSpecialShop; - - public Dictionary ProductCurrentPurchaseCount; - - public Dictionary ProductPurchaseLimitCount; - - public Dictionary ProductEndTime; - - public string selectedStoreProductId; - - private static PaymentPC instance; - - private bool isCountTime; - - private float timer; - - protected Callback m_MicroTxnAuthorizationResponse; - - public PaymentUI paymentUI { get; private set; } - - public event Action ProductListSucceeded; - - public event Action ProductListFailed; - - public event Action FinishFailureEvent; - - public event Action purchaseFinishSuccessEvent; - - public event Action purchaseFinishHttpErrorEvent; - - public event Action purchaseFinishResultCodeErrorEvent; - - public event Action purchaseRetryResultEvent; - - public event Action ConsumePurchaseSucceeded; - - private void Awake() - { - if (paymentUI == null) - { - paymentUI = new PaymentUI(); - } - m_MicroTxnAuthorizationResponse = Callback.Create(OnMicroTxnAuthorizationResponse); - } - - private void OnMicroTxnAuthorizationResponse(MicroTxnAuthorizationResponse_t pCallback) - { - if (!Convert.ToBoolean(pCallback.m_bAuthorized)) - { - return; - } - PaymentPCFinishTask paymentPCFinishTask = new PaymentPCFinishTask(); - paymentPCFinishTask.SetParameter(selectedStoreProductId, pCallback.m_unAppID.ToString(), pCallback.m_ulOrderID.ToString()); - StartCoroutine(Toolbox.NetworkManager.Connect(paymentPCFinishTask, delegate - { - string value = ""; - ProductNameList.TryGetValue(selectedStoreProductId, out value); - if (!ProductIsSpecialShop[selectedStoreProductId]) - { - paymentUI.PurchaseFinished(value); - } - if (this.ConsumePurchaseSucceeded != null) - { - this.ConsumePurchaseSucceeded(); - } - }, paymentUI.PurchaseFailedPC)); - } - - private void Update() - { - if (isCountTime) - { - checkTimeOut(); - } - SteamAPI.RunCallbacks(); - } - - public static PaymentPC GetInstance() - { - if (instance == null) - { - GameObject obj = new GameObject("PaymentPC"); - UnityEngine.Object.DontDestroyOnLoad(obj); - instance = obj.AddComponent(); - } - return instance; - } - - private void OnItemListFailure(NetworkTask.ResultCode code) - { - Debug.LogError("OnItemListFailure" + code); - Debug.LogError("プロダクトIDリストリクエストが失敗しました。やり直してください。"); - } - - private void OnItemListResultCodeError(int code) - { - Debug.LogError("OnItemListResultCodeError" + code); - if (this.ProductListFailed != null) - { - this.ProductListFailed(); - } - } - - private void OnFinishResultCodeError(int resultCode) - { - Debug.LogError("OnFinishResultCodeError" + resultCode); - Debug.LogError("チェック不正です。"); - if (this.purchaseFinishResultCodeErrorEvent != null) - { - this.purchaseFinishResultCodeErrorEvent(resultCode); - } - } - - public override void purchaceStart(string ProductId, bool isFromAlert = false) - { - if (!isFromAlert) - { - IsAlertAgree = false; - } - bool isAlertOn = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.PURCHASE_ALERT); - PaymentPCStartTask task = new PaymentPCStartTask(); - task.SetParameter(ProductId, IsAlertAgree, isAlertOn); - task.SkipAllCuteResultCodeCheckErrorPopup(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - PurchasePC(ProductId, task); - }, delegate - { - }, delegate(int code) - { - if (code == 329) - { - if (isAlertOn) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetTitleLabel(systemText.Get("ErrorHeader_0329")); - dialogBase.SetText(systemText.Get("Error_0329")); - dialogBase.SetButtonText(systemText.Get("Shop_0082")); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetPanelDepth(6000); - dialogBase.SetPanelSortingOrder(2); - dialogBase.SetButtonDelegate(new EventDelegate(delegate - { - CallPaymentStartFromAlert(ProductId); - })); - } - else - { - CallPaymentStartFromAlert(ProductId); - } - } - else - { - Toolbox.NetworkManager.NetworkUI.OpenCloseOnlyErrorPopUp(code); - } - })); - selectedStoreProductId = ProductId; - } - - private void PurchasePC(string ProductId, PaymentPCStartTask task) - { - RefundWarningDialog.Start(task.NeedRefundWarningType, delegate - { - SteamMicroTxnInitTask steamMicroTxnInitTask = new SteamMicroTxnInitTask(); - steamMicroTxnInitTask.SetParameter(ProductId); - StartCoroutine(Toolbox.NetworkManager.Connect(steamMicroTxnInitTask)); - }); - } - - public void purchaceFinish(string ProductId) - { - PaymentPCFinishTask paymentPCFinishTask = new PaymentPCFinishTask(); - paymentPCFinishTask.SetParameter(ProductId); - paymentPCFinishTask.SkipCuteTimeOutPopup(); - StartCoroutine(Toolbox.NetworkManager.Connect(paymentPCFinishTask, delegate - { - string value = ""; - ProductNameList.TryGetValue(ProductId, out value); - if (!ProductIsSpecialShop[ProductId]) - { - paymentUI.PurchaseFinished(value); - } - if (this.ConsumePurchaseSucceeded != null) - { - this.ConsumePurchaseSucceeded(); - } - }, paymentUI.PurchaseFailedPC)); - } - - public void initialize() - { - this.ProductListSucceeded = null; - this.ProductListFailed = null; - this.FinishFailureEvent = null; - this.purchaseFinishSuccessEvent = null; - this.purchaseFinishHttpErrorEvent = null; - this.purchaseFinishResultCodeErrorEvent = null; - this.purchaseRetryResultEvent = null; - this.ConsumePurchaseSucceeded = null; - ProductIdList = new List(); - IdList = new List(); - ProductNameList = new Dictionary(); - ProductPriceList = new Dictionary(); - FormatProductPriceList = new Dictionary(); - ProductTextList = new Dictionary(); - ProductPurchaseLimitList = new Dictionary(); - ProductPurchaseNumberList = new Dictionary(); - ProductCsvIdList = new Dictionary(); - ProductImageNameList = new Dictionary(); - ProductIsSpecialShop = new Dictionary(); - ProductCurrentPurchaseCount = new Dictionary(); - ProductPurchaseLimitCount = new Dictionary(); - ProductEndTime = new Dictionary(); - PaymentPCItemListTask task = new PaymentPCItemListTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - if (this.ProductListSucceeded != null) - { - this.ProductListSucceeded(); - } - }, OnItemListFailure, OnItemListResultCodeError)); - } - - public void finalize() - { - this.ProductListSucceeded = null; - this.ProductListFailed = null; - this.FinishFailureEvent = null; - this.purchaseFinishSuccessEvent = null; - this.purchaseFinishHttpErrorEvent = null; - this.purchaseFinishResultCodeErrorEvent = null; - this.purchaseRetryResultEvent = null; - this.ConsumePurchaseSucceeded = null; - Payment.finalize(); - } - - public void StartTimeCount() - { - isCountTime = true; - } - - public void StopTimeCount() - { - isCountTime = false; - } - - private void checkTimeOut() - { - timer += Time.deltaTime; - if (timer >= 30f) - { - timer = 0f; - paymentUI.StopLoading(); - paymentUI.PurchaseTimeOut(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/PaymentPurchase.cs b/SVSim.BattleEngine/Engine/PaymentPurchase.cs deleted file mode 100644 index 019b3101..00000000 --- a/SVSim.BattleEngine/Engine/PaymentPurchase.cs +++ /dev/null @@ -1,12 +0,0 @@ -public class PaymentPurchase -{ - public string getProductId() - { - return ""; - } - - public string getOrderId() - { - return ""; - } -} diff --git a/SVSim.BattleEngine/Engine/PaymentSkuInfo.cs b/SVSim.BattleEngine/Engine/PaymentSkuInfo.cs deleted file mode 100644 index 50aee5dd..00000000 --- a/SVSim.BattleEngine/Engine/PaymentSkuInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections.Generic; - -public class PaymentSkuInfo -{ - public string title; - - public string price; - - public string description; - - public string productId; - - public string currencyCode; - - public string currencySymbol; - - public string formattedPrice; - - public double priceAmountMicros; - - public string countryCode; - - public string downloadContentVersion; - - public bool downloadable; - - public List downloadContentLengths = new List(); - - public string type; - - public PaymentSkuInfo(string strShopName, string strPrice, string strShopDescription, string strProductID) - { - title = strShopName; - price = strPrice; - description = strShopDescription; - productId = strProductID; - } -} diff --git a/SVSim.BattleEngine/Engine/PaymentUI.cs b/SVSim.BattleEngine/Engine/PaymentUI.cs deleted file mode 100644 index 46caa0b1..00000000 --- a/SVSim.BattleEngine/Engine/PaymentUI.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System.Collections; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.ErrorDialog; - -public class PaymentUI -{ - public IEnumerator GooglePlayPointRewardFinished(string message) - { - yield return new WaitForSeconds(0.5f); - while (Toolbox.NetworkManager.isConnect || Toolbox.NetworkManager.isTimeOut || Toolbox.NetworkManager.isError || UIManager.GetInstance().isOpenDialog()) - { - yield return 0; - } - createNewDialog(Wizard.Data.SystemText.Get("Common_0021"), message); - } - - public void PurchaseFinished(string name = "", int amount = 0, int sum = 0, bool isRefundedReceipt = false) - { - if (string.IsNullOrEmpty(name)) - { - name = Wizard.Data.SystemText.Get("Common_0201"); - } - string message = Wizard.Data.SystemText.Get("Shop_0022", name); - if (amount != 0) - { - } - if (!isRefundedReceipt) - { - createNewDialog("", message); - } - } - - public void PurchaseFailed(string name = "", int amount = 0, int sum = 0) - { - SystemText systemText = Wizard.Data.SystemText; - string title = systemText.Get("Shop_0025"); - string message = systemText.Get("Shop_0084"); - createNewDialog(title, message); - } - - public void PurchaseCancelled(string name = "", int amount = 0, int sum = 0) - { - SystemText systemText = Wizard.Data.SystemText; - string title = systemText.Get("Shop_0025"); - string message = systemText.Get("Shop_0085"); - createNewDialog(title, message); - } - - public void PurchaseTimeOut(string message = "", string title = "", DialogBase.Size size = DialogBase.Size.M) - { - if (BattleManagerBase.GetIns() == null) - { - SystemText systemText = Wizard.Data.SystemText; - if (string.IsNullOrEmpty(title)) - { - title = systemText.Get("Shop_0025"); - } - if (string.IsNullOrEmpty(message)) - { - message = systemText.Get("Shop_0086"); - } - createNewDialog(title, message, size); - } - } - - public void ProductListInitTimeOut() - { - if (BattleManagerBase.GetIns() == null) - { - SystemText systemText = Wizard.Data.SystemText; - string title = systemText.Get("Shop_0094"); - string message = systemText.Get("Shop_0093"); - createNewDialog(title, message, DialogBase.Size.M); - } - } - - public void StartLoading(bool useTimeCount = false, bool forProductListInit = false) - { - if (useTimeCount) - { - PaymentImpl.GetInstance().StartTimeCount(forProductListInit); - } - UIManager.GetInstance().createInSceneCenterLoading(); - } - - public void StopLoading() - { - PaymentImpl.GetInstance().StopTimeCount(); - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - private static void createNewDialog(string title, string message, DialogBase.Size size = DialogBase.Size.S) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - if (title != "") - { - dialogBase.SetTitleLabel(title); - } - dialogBase.SetText(message); - dialogBase.SetSize(size); - dialogBase.SetPanelDepth(3000); - } - - public string GetText(string text_id) - { - return Wizard.Data.SystemText.Get(text_id); - } - - public void PurchaseConfirm(string productId, string name = "", int amount = 0, int sum = 0) - { - if (string.IsNullOrEmpty(name)) - { - name = Wizard.Data.SystemText.Get("Common_0201"); - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - string text = ""; - if (amount <= sum) - { - text = Wizard.Data.SystemText.Get("Shop_0110", name, sum.ToString()); - dialogBase.SetButtonDelegate(new EventDelegate(delegate - { - PaymentPC.GetInstance().purchaceFinish(productId); - })); - } - else - { - text = Wizard.Data.SystemText.Get("Shop_0111", name, sum.ToString()); - dialogBase.SetButtonDelegate(new EventDelegate(delegate - { - BrowserURL.Open("https://point.dmm.com/choice/pay"); - })); - } - dialogBase.SetText(text); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Shop_0003")); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetPanelDepth(3000); - } - - public void PurchaseFailedPC(NetworkTask.ResultCode resultCode) - { - if (resultCode == NetworkTask.ResultCode.TimeOut) - { - DialogBase dialogBase = Dialog.Create("TIMEOUT_NORETRY"); - SystemText systemText = Wizard.Data.SystemText; - dialogBase.SetTitleLabel(systemText.Get("ErrorHeader_0012")); - dialogBase.SetText(systemText.Get("Error_0006")); - } - } -} diff --git a/SVSim.BattleEngine/Engine/PlayHandCardReflection.cs b/SVSim.BattleEngine/Engine/PlayHandCardReflection.cs index 715b5818..a8d0a9df 100644 --- a/SVSim.BattleEngine/Engine/PlayHandCardReflection.cs +++ b/SVSim.BattleEngine/Engine/PlayHandCardReflection.cs @@ -18,11 +18,6 @@ public class PlayHandCardReflection : ReceivePlayActionsReflectionBase _networkBattleData = networkBattleData; } - public void SetOperateMgr(OperateMgr operateMgr) - { - _operateMgr = operateMgr; - } - public void ReadySetting(int cardIndex, List targetDataList) { _cardIdx = cardIndex; @@ -108,16 +103,15 @@ public class PlayHandCardReflection : ReceivePlayActionsReflectionBase List list = null; list = ((!player.IsPlayer) ? NetworkBattleGenericTool.GetOpposingCardObjTarget(_battleMgr, _playHandTargetDataList) : NetworkBattleGenericTool.LookForActionDataToTargetCard(_battleMgr, _playHandTargetDataList)); ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if ((GameMgr.GetIns().IsWatchBattle && player.IsPlayer) || GameMgr.GetIns().IsAdminWatch) + if ((_battleMgr.GameMgr.IsWatchBattle && player.IsPlayer) || _battleMgr.GameMgr.IsAdminWatch) { - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); + VfxBase canNotTouchCardVfx = NullVfx.GetInstance(); _battleMgr.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); parallelVfxPlayer.Register(_actingCard.SelfBattlePlayer.BattleView.RemoveFusionSelectedCardFromHand(_selectedCards)); parallelVfxPlayer.Register(_actingCard.SelfBattlePlayer.BattleView.CreateStopShowSelectVfx(_actingCard, isAct: true, stopChoiceSelectUiImmediately: false)); parallelVfxPlayer.Register(_operateMgr.FusionCard(indexToCardBase, player.IsPlayer, list)); _battleMgr.VfxMgr.RegisterSequentialVfx(SequentialVfxPlayer.Create(parallelVfxPlayer, InstantVfx.Create(delegate { - canNotTouchCardVfx.End(); }))); } else @@ -132,19 +126,19 @@ public class PlayHandCardReflection : ReceivePlayActionsReflectionBase public void ChoiceBraveMove(BattlePlayerBase player, List choiceIdList) { BattleCardBase battleCardBase = player.Class; - if (!player.CanChoiceBraveThisTurn && !BattleManagerBase.GetIns().IsRecovery) + if (!player.CanChoiceBraveThisTurn && !_battleMgr.IsRecovery) { SendEcho(battleCardBase, _networkBattleData.GetReceiveData().actionType); return; } ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - GameMgr gameMgr = GameMgr.GetIns(); + GameMgr gameMgr = _battleMgr.GameMgr; if ((!gameMgr.IsWatchBattle || !player.IsPlayer) && !gameMgr.IsAdminWatch && !_battleMgr.IsRecovery) { parallelVfxPlayer.Register(InstantVfx.Create(delegate { gameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_SELECT_3, _battleMgr.BattleUIContainer.EnemyChoiceBraveBtn.position); - gameMgr.GetSoundMgr().PlaySe(Se.TYPE.SYS_CMN_CARD_SELECT_3); + player.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); })); } diff --git a/SVSim.BattleEngine/Engine/PlayQueueViewBase.cs b/SVSim.BattleEngine/Engine/PlayQueueViewBase.cs index 432f53ed..d81668bc 100644 --- a/SVSim.BattleEngine/Engine/PlayQueueViewBase.cs +++ b/SVSim.BattleEngine/Engine/PlayQueueViewBase.cs @@ -8,17 +8,6 @@ using Wizard.Battle.View.Vfx; public abstract class PlayQueueViewBase { - protected const float REARRANGE_TIME = 0.5f; - - protected const float ACCELERATE_REARRANGE_TIME = 0.2f; - - private const float queueUpdateSpeed = 10f; - - private const float aspectRatio_4_3 = 1.333f; - - private const float SMOOTHING_AMOUNT = 0.01f; - - private const float DECAY_MULTIPLIER = 5f; private Action _computeCorners; @@ -59,11 +48,6 @@ public abstract class PlayQueueViewBase _computeCorners(); } - public virtual void ForceClearPlayQueue() - { - queuedCards.Clear(); - } - public int QueueCount() { return queuedCards.Count; @@ -78,14 +62,6 @@ public abstract class PlayQueueViewBase } } - public virtual void InsertCardFromView(IBattleCardView originalView, IBattleCardView insertView) - { - if (queuedCards.Count > 0 && queuedCards[0] == originalView && queuedCards.Any((IBattleCardView c) => c == originalView)) - { - queuedCards.Insert(queuedCards.IndexOf(originalView), insertView); - } - } - public virtual void ReplaceCard(IBattleCardView cardViewToAdd, IBattleCardView cardViewToRemove) { cardViewToAdd._hasCardEnteredPlayQueue = true; @@ -98,18 +74,6 @@ public abstract class PlayQueueViewBase } } - public virtual void ForceRemoveCardFromView(IBattleCardView cardViewToRemove) - { - cardViewToRemove.ResetPlayQueueFlags(); - queuedCards.Remove(cardViewToRemove); - iTween.Stop(cardViewToRemove.GameObject); - } - - protected virtual bool IsCardPlayedInstantly(bool forceCardIntoPlayQueue) - { - return !forceCardIntoPlayQueue; - } - public bool IsCardInQueue(IBattleCardView battleCardView) { return queuedCards.Contains(battleCardView); @@ -138,51 +102,6 @@ public abstract class PlayQueueViewBase return new Vector3(delta.x * MotionUtils.GetEase(t, MotionUtils.EaseType.easeOutQuad), delta.y * MotionUtils.GetEase(t, MotionUtils.EaseType.linear), delta.z * MotionUtils.GetEase(t, MotionUtils.EaseType.linear)) + queueTopPosition; } - protected float CalculateAspectRatioMultiplier(float aspectRatio) - { - if (aspectRatio <= 1.333f) - { - aspectRatio = 1.333f; - } - return aspectRatio - 1f; - } - - protected float CalculateInverseAspectRatioMultiplier(float aspectRatio) - { - if (aspectRatio <= 1.333f) - { - aspectRatio = 1.333f; - } - return 1f / (aspectRatio - 1f); - } - - protected void AddCardToQueue(IBattleCardView playedCardView) - { - queuedCards.Add(playedCardView); - if (!BattleManagerBase.GetIns().IsRecovery) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_CENTER); - iTween.Stop(playedCardView.GameObject); - if (playedCardView.GameObject.activeSelf) - { - iTween.RotateAdd(playedCardView.GameObject, iTween.Hash("y", RotationAmount, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(playedCardView.GameObject, iTween.Hash("scale", Global.CARD_BATTLE_SCALE, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - } - } - - protected VfxBase WaitUntilCardIsInQueueVfx(IBattleCardView playedCardView) - { - if (!BattleManagerBase.GetIns().IsRecovery) - { - playedCardView._hasCardEnteredPlayQueue = true; - } - return InstantVfx.Create(delegate - { - playedCardView._waitUntilCardIsInQueueCoroutine = BattleCoroutine.GetInstance().StartCoroutine(WaitUntilCardIsInQueue(playedCardView)); - }); - } - private IEnumerator WaitUntilCardIsInQueue(IBattleCardView playedCardView) { yield return new WaitForSeconds(0.5f); @@ -196,9 +115,4 @@ public abstract class PlayQueueViewBase protected abstract Vector3 GetScreenTopCornerOffset(float aspectRatio); protected abstract Vector3 GetScreenBottomCornerOffset(float aspectRatio); - - protected void PlayPlayedCardEffect(IBattleCardView playedCardView) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_SET_1, playedCardView.GameObject.transform.position, playedCardView.GameObject.transform.rotation); - } } diff --git a/SVSim.BattleEngine/Engine/PlayerChoiceBraveButtonUI.cs b/SVSim.BattleEngine/Engine/PlayerChoiceBraveButtonUI.cs deleted file mode 100644 index a6b30b2d..00000000 --- a/SVSim.BattleEngine/Engine/PlayerChoiceBraveButtonUI.cs +++ /dev/null @@ -1,180 +0,0 @@ -using UnityEngine; - -public class PlayerChoiceBraveButtonUI : UIBase -{ - private const int CHOICE_BRAVE_BUTTON_HEIGHT = 155; - - private const int CHOICE_BRAVE_BUTTON_WEIGHT = 155; - - private const string CHOICE_BRAVE_BUTTON_ON_SPRITE_NAME = "battle_icon_hero_player_on"; - - private const string CHOICE_BRAVE_BUTTON_OFF_SPRITE_NAME = "battle_icon_hero_player_off"; - - [SerializeField] - private UISprite _choiceBraveButtonSprite; - - [SerializeField] - private UILabel _bpLabel; - - [SerializeField] - private UIWidget _choiceBraveButtonWidget; - - private bool isFocus; - - private const float HIDE_OFFSET = 450f; - - private const float SHOW_OFFSET_DOWN = 400f; - - private const float SHOW_OFFSET_FORWARD = 50f; - - public Vector3 BPLabelPosition - { - get - { - if (!(_bpLabel != null)) - { - return Vector3.zero; - } - return _bpLabel.transform.position; - } - } - - public void ShowButton(bool isNewReplay) - { - if (isNewReplay) - { - MoveHbpButtonAnchor(isFocus ? Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM.y : Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION.y); - return; - } - MoveHbpButtonAnchor(-200f); - base.gameObject.SetActive(value: true); - iTween.ValueTo(base.gameObject, iTween.Hash("from", -200, "to", Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION.y, "time", 0.5f, "delay", 0.1f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo)); - } - - public void HideButton() - { - Vector3 vector = (isFocus ? Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM : Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION); - iTween.ValueTo(base.gameObject, iTween.Hash("from", vector.y, "to", -200, "time", 0.5f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo)); - } - - public Transform GetButtonTransform() - { - return base.transform; - } - - public void EnablePulsateEffect() - { - GameMgr ins = GameMgr.GetIns(); - if (!BattleManagerBase.GetIns().BattlePlayer.CanChoiceBrave) - { - ins.GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1); - return; - } - Effect effect = ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_HEROSKILL_1, GetButtonTransform().position, base.gameObject); - if (effect != null) - { - effect.gameObject.SetLayer(base.gameObject.layer, isSetChildren: true); - } - } - - public void DisablePulsateEffect() - { - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1); - } - - public void UpdatePulsateEffectAndSprite() - { - if (BattleManagerBase.GetIns().BattlePlayer.CanChoiceBraveThisTurn) - { - _choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_on"; - EnablePulsateEffect(); - } - else - { - _choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_off"; - DisablePulsateEffect(); - } - } - - public void UpdateActivatingEffect(bool isActivating) - { - if (isActivating) - { - Effect effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_HEROSKILL_2, GetButtonTransform().position, base.gameObject); - if (effect != null) - { - effect.gameObject.SetLayer(base.gameObject.layer, isSetChildren: true); - } - } - else - { - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_2); - } - } - - private int SetYtoBottomAnchor(int posY) - { - int num = Mathf.FloorToInt(77f); - return posY - num; - } - - private int SetYtoTopAnchor(int posY) - { - int num = 77; - return posY + num; - } - - private float GetCenterAnchorPosY() - { - float num = 77f; - return (float)_choiceBraveButtonWidget.bottomAnchor.absolute + num; - } - - public void MoveFocus(float beforePosY, float afterPosY) - { - if (beforePosY < afterPosY) - { - if (isFocus) - { - return; - } - isFocus = true; - } - else - { - if (!isFocus) - { - return; - } - isFocus = false; - } - iTween.ValueTo(base.gameObject, iTween.Hash("from", GetCenterAnchorPosY(), "to", afterPosY, "time", 0.2f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeOutQuad)); - } - - public void SetHbpButtonAnchor(float posX, float posY, float posZ, GameObject container) - { - base.transform.localPosition = new Vector3(posX, posY, posZ); - _choiceBraveButtonWidget.bottomAnchor.target = container.transform; - _choiceBraveButtonWidget.topAnchor.target = container.transform; - _choiceBraveButtonWidget.bottomAnchor.relative = 0f; - _choiceBraveButtonWidget.bottomAnchor.absolute = SetYtoBottomAnchor((int)posY); - _choiceBraveButtonWidget.topAnchor.relative = 0f; - _choiceBraveButtonWidget.topAnchor.absolute = SetYtoTopAnchor((int)posY); - _choiceBraveButtonWidget.UpdateAnchors(); - } - - public void MoveHbpButtonAnchor(float posY) - { - int num = (int)posY; - _choiceBraveButtonWidget.bottomAnchor.relative = 0f; - _choiceBraveButtonWidget.bottomAnchor.absolute = SetYtoBottomAnchor(num); - _choiceBraveButtonWidget.topAnchor.relative = 0f; - _choiceBraveButtonWidget.topAnchor.absolute = SetYtoTopAnchor(num); - _choiceBraveButtonWidget.UpdateAnchors(); - } - - public void SetBp(int num) - { - _bpLabel.text = num.ToString(); - } -} diff --git a/SVSim.BattleEngine/Engine/PlayerClassBattleCard.cs b/SVSim.BattleEngine/Engine/PlayerClassBattleCard.cs index f8c4d833..39b6a3ac 100644 --- a/SVSim.BattleEngine/Engine/PlayerClassBattleCard.cs +++ b/SVSim.BattleEngine/Engine/PlayerClassBattleCard.cs @@ -8,14 +8,6 @@ public class PlayerClassBattleCard : ClassBattleCardBase { } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - if (isNullView) - { - return NullCardVfxCreator.GetInstance(); - } - return new PlayerClassCardVfxCreator((ClassBattleCardViewBase)battleCardView, this, base.SelfBattlePlayer.BattleView, _buildInfo.ResourceMgr); - } protected override IBattleCardView CreateView(BattleCardView.BuildInfo buildInfo, bool isNullView) { diff --git a/SVSim.BattleEngine/Engine/PlayerDrawCardToHandVfx.cs b/SVSim.BattleEngine/Engine/PlayerDrawCardToHandVfx.cs index 7d91a0df..0088b829 100644 --- a/SVSim.BattleEngine/Engine/PlayerDrawCardToHandVfx.cs +++ b/SVSim.BattleEngine/Engine/PlayerDrawCardToHandVfx.cs @@ -18,7 +18,7 @@ public class PlayerDrawCardToHandVfx : SequentialVfxPlayer { base.Play(); m_view.GameObject.SetActive(value: false); - m_view.GameObject.transform.parent = BattleManagerBase.GetIns().PCardPlace.transform; + /* Pre-Phase-5b: PCardPlace parent-reparent dropped; view is a null-view stub headless */ MotionUtils.SetLayerAll(m_view.GameObject, 10); m_view.GameObject.SetActive(value: true); IsEnd = true; @@ -27,8 +27,6 @@ public class PlayerDrawCardToHandVfx : SequentialVfxPlayer private readonly BattleCardBase _card; - private const float ADD_CARD_TIME = 0.25f; - public PlayerDrawCardToHandVfx(BattleCardBase drawCard) { _card = drawCard; @@ -46,7 +44,7 @@ public class PlayerDrawCardToHandVfx : SequentialVfxPlayer SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(InstantVfx.Create(delegate { - GameObject pCardPlace = BattleManagerBase.GetIns().PCardPlace; + GameObject pCardPlace = _card.SelfBattlePlayer.BattleMgr.PCardPlace; _card.BattleCardView.GameObject.SetActive(value: false); _card.BattleCardView.GameObject.transform.parent = pCardPlace.transform; MotionUtils.SetLayerAll(_card.BattleCardView.GameObject, 10); @@ -56,9 +54,9 @@ public class PlayerDrawCardToHandVfx : SequentialVfxPlayer { sequentialVfxPlayer.Register(InstantVfx.Create(delegate { - if (!BattleManagerBase.GetIns().IsRecovery) + if (!_card.SelfBattlePlayer.BattleMgr.IsRecovery) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SET_CARD_TO_HAND); + } _card.SelfBattlePlayer.BattleView.HandView.AddCardToView(_card.BattleCardView, 0.25f); _card.SelfBattlePlayer.HandControl.AttachCardView(_card.BattleCardView); @@ -77,9 +75,9 @@ public class PlayerDrawCardToHandVfx : SequentialVfxPlayer { return ParallelVfxPlayer.Create(_card.BattleCardView.ShowHandCardInfo(), _card.CalcHandCost(), InstantVfx.Create(delegate { - if (!BattleManagerBase.GetIns().IsRecovery) + if (!_card.SelfBattlePlayer.BattleMgr.IsRecovery) { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_DRAW_2, _card.BattleCardView.GameObject.transform.position) + _card.SelfBattlePlayer.BattleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_DRAW_2, _card.BattleCardView.GameObject.transform.position) .GetGameObjIns() .transform.rotation = _card.BattleCardView.GameObject.transform.rotation; } diff --git a/SVSim.BattleEngine/Engine/PlazField.cs b/SVSim.BattleEngine/Engine/PlazField.cs index cce7a4d9..58e11dbf 100644 --- a/SVSim.BattleEngine/Engine/PlazField.cs +++ b/SVSim.BattleEngine/Engine/PlazField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class PlazField : BackGroundBase { public override int FieldId => 10; @@ -10,105 +11,4 @@ public class PlazField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_plaz_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles10").gameObject; - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake_1", _fieldParticles.transform.Find("shake_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - switch (FieldId) - { - case 10: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_10, pos); - break; - case 20: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_20, pos); - break; - } - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (FieldId) - { - case 10: - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_10_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_10_2, pos); - break; - } - break; - case 20: - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_20_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_20_2, pos); - break; - } - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(-510f, 140f, -55f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-11f, -113f, 95f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(15f, -95f, -150f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-21f, -87f, 90f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(6f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake_1"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/PlazRiotingField.cs b/SVSim.BattleEngine/Engine/PlazRiotingField.cs index 38f4b7e0..4dfa1d4f 100644 --- a/SVSim.BattleEngine/Engine/PlazRiotingField.cs +++ b/SVSim.BattleEngine/Engine/PlazRiotingField.cs @@ -1,39 +1,15 @@ -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class PlazRiotingField : PlazField { public override int FieldId => 20; - public override int FieldEffectId => 20; public PlazRiotingField(string bgmId = "NONE") : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_plz2_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles20").gameObject; - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake_1", _fieldParticles.transform.Find("shake_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } } diff --git a/SVSim.BattleEngine/Engine/PracticeFinishDetail.cs b/SVSim.BattleEngine/Engine/PracticeFinishDetail.cs index cad588a7..b26c333e 100644 --- a/SVSim.BattleEngine/Engine/PracticeFinishDetail.cs +++ b/SVSim.BattleEngine/Engine/PracticeFinishDetail.cs @@ -15,8 +15,6 @@ public class PracticeFinishDetail public List achieved_achievement_list => AchievedInfo._achievements; - public List Rewards => AchievedInfo._rewards; - public AchievedInfo AchievedInfo { get; private set; } public PracticeFinishDetail() diff --git a/SVSim.BattleEngine/Engine/PracticeNextSceneSelector.cs b/SVSim.BattleEngine/Engine/PracticeNextSceneSelector.cs deleted file mode 100644 index c1097c01..00000000 --- a/SVSim.BattleEngine/Engine/PracticeNextSceneSelector.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard; - -public class PracticeNextSceneSelector : INextSceneSelector -{ - private BattleResultUIController m_battleResultNewControl; - - private bool _movingToMyPage; - - public PracticeNextSceneSelector(BattleResultUIController battleResultControl) - { - m_battleResultNewControl = battleResultControl; - _movingToMyPage = false; - } - - public void Setup(bool isWin, GameObject gameObject) - { - m_battleResultNewControl.MissionBtnObj.labels[0].text = Data.SystemText.Get("Battle_0200"); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().createInSceneCenterLoading(); - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); - missionInfoTask.SetParameter(); - m_battleResultNewControl.StartCoroutine(Toolbox.NetworkManager.Connect(missionInfoTask, delegate - { - m_battleResultNewControl.CreateMissionList(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - })); - m_battleResultNewControl.HomeBtnObj.labels[0].text = Data.SystemText.Get("Battle_0202"); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MoveToMyPage(); - })); - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0204"); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - PracticeDeckInfoTask task = new PracticeDeckInfoTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Format value = (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_SELECT_DECK_FORMAT); - Action onUpdateDeckUICustomize = delegate(DeckUI deckUI) - { - if (deckUI.Deck.Format == GameMgr.GetIns().GetDataMgr().GetSelectDeckFormat() && deckUI.Deck.GetDeckID() == GameMgr.GetIns().GetDataMgr().GetSelectDeckId()) - { - deckUI.SetTextAppealLabelLeft(Data.SystemText.Get("Card_0235")); - } - deckUI.SetSelectable(deckUI.Deck.IsUsable()); - }; - DeckSelectUIDialog.Create(Data.SystemText.Get("Story_0017"), task.DeckGroupListData, value, DeckSelectUIDialog.eFormatChangeUIType.UseOtherCategory, isVisibleCreateNew: false, delegate(DialogBase dialog, DeckData deck) - { - PracticeDeckSelectConfirmDialog.Create(dialog, deck, isBattleAgain: true); - }, new DeckSelectUI.InitOptions - { - OnUpdateDeckUICustomize = onUpdateDeckUICustomize - }); - })); - })); - } - - public void Show() - { - iTween.MoveTo(m_battleResultNewControl.ButtonGrid.gameObject, iTween.Hash("position", m_battleResultNewControl.DefaultPosDict["ButtonGrid"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void MoveToMyPage() - { - if (!_movingToMyPage) - { - _movingToMyPage = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.MyPage); - } - } -} diff --git a/SVSim.BattleEngine/Engine/PracticePuzzleFinishData.cs b/SVSim.BattleEngine/Engine/PracticePuzzleFinishData.cs index 70a4cb2b..3b735673 100644 --- a/SVSim.BattleEngine/Engine/PracticePuzzleFinishData.cs +++ b/SVSim.BattleEngine/Engine/PracticePuzzleFinishData.cs @@ -3,20 +3,11 @@ using LitJson; public class PracticePuzzleFinishData { - public JsonData _responseData; - - public int get_class_chara_experience; - - public int class_chara_experience; - - public int class_chara_level; public List achieved_mission_list => AchievedInfo._missions; public List achieved_achievement_list => AchievedInfo._achievements; - public List Rewards => AchievedInfo._rewards; - public AchievedInfo AchievedInfo { get; private set; } public PracticePuzzleFinishData() diff --git a/SVSim.BattleEngine/Engine/PracticePuzzleNextSceneSelector.cs b/SVSim.BattleEngine/Engine/PracticePuzzleNextSceneSelector.cs deleted file mode 100644 index 17e6ac4c..00000000 --- a/SVSim.BattleEngine/Engine/PracticePuzzleNextSceneSelector.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class PracticePuzzleNextSceneSelector : INextSceneSelector -{ - private BattleResultUIController _battleResultController; - - private bool _movingToMyPage; - - public PracticePuzzleNextSceneSelector(BattleResultUIController battleResultControl) - { - _battleResultController = battleResultControl; - _movingToMyPage = false; - } - - public void Setup(bool isWin, GameObject gameObject) - { - _battleResultController.RetryBtnObj.gameObject.SetActive(value: false); - _battleResultController.MissionBtnObj.labels[0].text = Data.SystemText.Get("Puzzle_QuestSelect_Button"); - _battleResultController.MissionBtnObj.buttons[0].onClick.Clear(); - _battleResultController.MissionBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - SelectOtherPuzzle(); - })); - _battleResultController.HomeBtnObj.labels[0].text = Data.SystemText.Get("Battle_0516"); - _battleResultController.HomeBtnObj.buttons[0].onClick.Clear(); - _battleResultController.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MovePuzleLobby(); - })); - } - - private void SelectOtherPuzzle() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().createInSceneCenterLoading(); - PracticePuzzleListTask task = new PracticePuzzleListTask(); - int practicePuzzleGroupId = GameMgr.GetIns().GetDataMgr().PracticePuzzleGroupId; - task.SetParameter(practicePuzzleGroupId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - List loadList = PuzzleQuestSelectDialog.CollectResourcePath(task.PuzzleQuestInfo.DisplayDatas); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - PuzzleQuestSelectDialog.CreateDialog(task.PuzzleQuestInfo, delegate(PuzzleQuestData puzzleData, int difficulty) - { - ChangeSceneOtherPuzzle(puzzleData, difficulty); - }).OnClose = delegate - { - Toolbox.ResourcesManager.RemoveAssetGroup(loadList); - }; - })); - })); - } - - private void ChangeSceneOtherPuzzle(PuzzleQuestData puzzleData, int difficulty) - { - int groupId = GameMgr.GetIns().GetDataMgr().PracticePuzzleGroupId; - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().StartCoroutine(BattleManagerBase.GetIns().GetBattleControl().BattleEnd(delegate - { - UIManager.GetInstance().CreatFadeOpen(); - PuzzleUtil.SetPracticePuzzleData(groupId, puzzleData, difficulty, DataMgr.BattleType.Practice); - PuzzleUtil.ChangeSceneToPracticePuzzle(puzzleData); - })); - }); - } - - public void Show() - { - iTween.MoveTo(_battleResultController.ButtonGrid.gameObject, iTween.Hash("position", _battleResultController.DefaultPosDict["ButtonGrid"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void MovePuzleLobby() - { - if (!_movingToMyPage) - { - _movingToMyPage = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.PracticePuzzle); - } - } -} diff --git a/SVSim.BattleEngine/Engine/PracticePuzzleReportEndAgent.cs b/SVSim.BattleEngine/Engine/PracticePuzzleReportEndAgent.cs deleted file mode 100644 index 03871198..00000000 --- a/SVSim.BattleEngine/Engine/PracticePuzzleReportEndAgent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -public class PracticePuzzleReportEndAgent : MonoBehaviour -{ - public bool IsEnd { get; private set; } - - public void Finished() - { - IsEnd = true; - } -} diff --git a/SVSim.BattleEngine/Engine/PracticePuzzleResultReporter.cs b/SVSim.BattleEngine/Engine/PracticePuzzleResultReporter.cs deleted file mode 100644 index 823f4e6a..00000000 --- a/SVSim.BattleEngine/Engine/PracticePuzzleResultReporter.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Lottery; - -public class PracticePuzzleResultReporter : IBattleResultReporter -{ - private readonly GameObject _reportEndAgentObj; - - private readonly PracticePuzzleReportEndAgent _reportEndAgent; - - public bool IsEnd => _reportEndAgent.IsEnd; - - public int RankExp => GetRankExp(); - - public int AfterRankExp => GetAfterRankExp(); - - public int ClassExp => GetClassExp(); - - public int WinCount => GetWinCount(); - - public int RankExpBonus => GetRankExpBonus(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => GetRewardsList(); - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => Data.PracticePuzzleFinishData.AchievedInfo._lotteryData; - - public MyPageHomeDialogData HomeDialogData => null; - - public bool IsDataExist => true; - - public PracticePuzzleResultReporter() - { - _reportEndAgentObj = new GameObject(); - _reportEndAgent = _reportEndAgentObj.AddComponent(); - } - - public void Report(bool isWin) - { - StartFinishPractice(isWin, delegate - { - _reportEndAgent.Finished(); - }); - } - - public void StartFinishPractice(bool isWin, Action callback) - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - NetworkManager networkManager = Toolbox.NetworkManager; - PracticePuzzleBattleFinish practicePuzzleBattleFinish = new PracticePuzzleBattleFinish(); - LocalLog.RecordCheckLog(LocalLog.RecordType.CERBERUS, isWin); - practicePuzzleBattleFinish.SetParameter(dataMgr.PuzzleQuestId, (BattleManagerBase.GetIns() as PuzzleBattleManager).RetryCount, isWin); - _reportEndAgent.StartCoroutine(networkManager.Connect(practicePuzzleBattleFinish, delegate - { - callback.Call(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - public void Destroy() - { - UnityEngine.Object.Destroy(_reportEndAgentObj); - } - - public JsonData GetFinishResponseData() - { - return Data.PracticePuzzleFinishData._responseData; - } - - public List GetUserAchievementList() - { - return Data.PracticePuzzleFinishData.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.PracticePuzzleFinishData.achieved_mission_list; - } - - public List GetRewardsList() - { - return Data.PracticePuzzleFinishData.Rewards; - } - - public int GetRankExp() - { - return 0; - } - - public int GetAfterRankExp() - { - return 0; - } - - public int GetClassExp() - { - return Data.PracticePuzzleFinishData.get_class_chara_experience; - } - - public int GetWinCount() - { - return 0; - } - - public int GetRankExpBonus() - { - return 0; - } -} diff --git a/SVSim.BattleEngine/Engine/PracticeReportEndAgent.cs b/SVSim.BattleEngine/Engine/PracticeReportEndAgent.cs deleted file mode 100644 index 020868e3..00000000 --- a/SVSim.BattleEngine/Engine/PracticeReportEndAgent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -public class PracticeReportEndAgent : MonoBehaviour -{ - public bool IsEnd { get; private set; } - - public void Finished() - { - IsEnd = true; - } -} diff --git a/SVSim.BattleEngine/Engine/PracticeResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/PracticeResultAnimationAgent.cs deleted file mode 100644 index df64515e..00000000 --- a/SVSim.BattleEngine/Engine/PracticeResultAnimationAgent.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System.Collections; -using UnityEngine; - -public class PracticeResultAnimationAgent : ResultAnimationAgent -{ - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); - } - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (BattleManagerBase.GetIns().IsPuzzleMgr && !isWin) - { - battleResultControl.SetBattlePassGauge(delegate - { - battleResultControl.FinishResult(); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.PracticePuzzle); - }); - yield break; - } - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); - } - if (ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - PlayWinVoice(); - } - GameMgr.GetIns().GetDataMgr().SetPlayerEmotionId(string.Empty); - GameMgr.GetIns().GetDataMgr().SetEnemyEmotionId(string.Empty); - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - battleResultControl.SetBattlePassGauge(delegate - { - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/PracticeResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/PracticeResultAnimationHandler.cs deleted file mode 100644 index 2179d48c..00000000 --- a/SVSim.BattleEngine/Engine/PracticeResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class PracticeResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly PracticeResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public PracticeResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/PracticeResultReporter.cs b/SVSim.BattleEngine/Engine/PracticeResultReporter.cs deleted file mode 100644 index 1a6396ce..00000000 --- a/SVSim.BattleEngine/Engine/PracticeResultReporter.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Lottery; - -public class PracticeResultReporter : IBattleResultReporter -{ - private readonly GameObject m_reportEndAgentObj; - - private readonly PracticeReportEndAgent m_reportEndAgent; - - public bool IsEnd => m_reportEndAgent.IsEnd; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => GetRewardsList(); - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => Data.PracticeFinish.data.AchievedInfo._lotteryData; - - public MyPageHomeDialogData HomeDialogData => null; - - public bool IsDataExist => true; - - public PracticeResultReporter() - { - m_reportEndAgentObj = new GameObject(); - m_reportEndAgent = m_reportEndAgentObj.AddComponent(); - } - - public void Report(bool isWin) - { - int is_win = (isWin ? 1 : 0); - StartFinishPractice(is_win, delegate - { - m_reportEndAgent.Finished(); - }); - } - - public void StartFinishPractice(int is_win, Action callback) - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - NetworkManager networkManager = Toolbox.NetworkManager; - PracticeFinishTask practiceFinishTask = new PracticeFinishTask(); - LocalLog.RecordCheckLog(LocalLog.RecordType.CERBERUS, is_win == 1); - practiceFinishTask.SetParameter(dataMgr.GetSelectDeckId(), is_win, BattleManagerBase.GetIns().BattlePlayer._cumulativeEvolutionCount, BattleManagerBase.GetIns().BattlePlayer.Turn, dataMgr.GetEnemyClassId(), dataMgr.m_EnemyAIDifficulty, dataMgr.GetSelectDeckFormat(), dataMgr.GetPlayerClassId()); - m_reportEndAgent.StartCoroutine(networkManager.Connect(practiceFinishTask, delegate - { - callback.Call(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - public void Destroy() - { - UnityEngine.Object.Destroy(m_reportEndAgentObj); - } - - public JsonData GetFinishResponseData() - { - return Data.PracticeFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.PracticeFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.PracticeFinish.data.achieved_mission_list; - } - - public List GetRewardsList() - { - return Data.PracticeFinish.data.Rewards; - } - - public int GetClassExp() - { - return Data.PracticeFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/Prediction.cs b/SVSim.BattleEngine/Engine/Prediction.cs index d5bc056b..124d6c3c 100644 --- a/SVSim.BattleEngine/Engine/Prediction.cs +++ b/SVSim.BattleEngine/Engine/Prediction.cs @@ -9,8 +9,6 @@ using Wizard.Battle.View.Vfx; public class Prediction { - public static bool _isFeatureEnabled; - protected VfxMgr _vfxMgr; protected IBattleResourceMgr _battleResourceManager; @@ -39,36 +37,22 @@ public class Prediction _selectCards.Clear(); } - private bool IsEnabled() - { - if (_isFeatureEnabled) - { - return PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_PREDICTION_ICONS); - } - return false; - } + // _isFeatureEnabled was a `public static bool` default-false with no writers anywhere in the + // codebase — dead in headless and never toggled by the client build we ported from. Collapsed + // to a constant-false so per-battle isolation isn't polluted by a process-wide flag. + private bool IsEnabled() => false; public void TurnEnd() { if (IsEnabled()) { - _pair = BattleManagerBase.GetIns().GetBattlePlayerPair(isPlayer: true); + _pair = _pair.Self.BattleMgr.GetBattlePlayerPair(isPlayer: true); BattlePlayerPair randomAll = TurnEnd(_pair, SimulationSelection.All); BattlePlayerPair randomNone = TurnEnd(_pair, SimulationSelection.None); Display(randomAll, randomNone); } } - public void Attack(BattleCardBase attackCard, BattleCardBase targetCard) - { - if (IsEnabled()) - { - _pair = BattleManagerBase.GetIns().GetBattlePlayerPair(isPlayer: true); - BattlePlayerPair forecastPair = OperationSimulator.Attack(_pair, attackCard, targetCard, isPrediction: true); - Simulate(forecastPair); - } - } - public void Clear() { if (IsEnabled()) @@ -92,79 +76,6 @@ public class Prediction } } - public void Evolve(BattleCardBase card) - { - if (IsEnabled() && !card.EvolutionSkills.HasEvolutionSkillWithSelection) - { - BattlePlayerPair randomAll = Evolve(_pair, card, null, SimulationSelection.All); - BattlePlayerPair randomNone = Evolve(_pair, card, null, SimulationSelection.None); - Display(randomAll, randomNone); - } - } - - public void AddSelectCard(BattleCardBase targetCard) - { - _selectCards.Add(targetCard); - } - - public void SkillSelect(BattleCardBase actCard, BattleCardBase targetCard, bool isEvolve) - { - if (IsEnabled()) - { - List list = _selectCards.ToList(); - list.Add(targetCard); - BattlePlayerPair randomAll; - BattlePlayerPair randomNone; - if (isEvolve) - { - randomAll = Evolve(_pair, actCard, list, SimulationSelection.All); - randomNone = Evolve(_pair, actCard, list, SimulationSelection.None); - } - else - { - randomAll = Play(_pair, actCard, list, SimulationSelection.All); - randomNone = Play(_pair, actCard, list, SimulationSelection.None); - } - Display(randomAll, randomNone); - } - } - - public void SkillSelectTransform(BattleCardBase actCard, BattleCardBase transformCard, BattleCardBase targetCard) - { - if (IsEnabled()) - { - List list = _selectCards.ToList(); - list.Add(targetCard); - list.Insert(0, transformCard); - BattlePlayerPair randomAll = Play(_pair, actCard, list, SimulationSelection.All); - BattlePlayerPair randomNone = Play(_pair, actCard, list, SimulationSelection.None); - Display(randomAll, randomNone); - } - } - - public void SkillSelectClear() - { - _selectCards.Clear(); - } - - private void Simulate(BattlePlayerPair forecastPair) - { - if (IsEnabled()) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(ClearView(_pair)); - if ((FindUsedRandomSkillOriginalCard(_pair.Self, forecastPair.Self) ?? FindUsedRandomSkillOriginalCard(_pair.Opponent, forecastPair.Opponent)) != null) - { - parallelVfxPlayer.Register(ForecastRandomSkillUseMessageVfx.Create(_battleResourceManager)); - } - AddCardToWarning(_pair.Self, forecastPair.Self); - AddCardToWarning(_pair.Opponent, forecastPair.Opponent); - parallelVfxPlayer.Register(UpdatePlayerView(_pair.Self, forecastPair.Self, _battleResourceManager)); - parallelVfxPlayer.Register(UpdatePlayerView(_pair.Opponent, forecastPair.Opponent, _battleResourceManager)); - _vfxMgr.RegisterSequentialVfx(parallelVfxPlayer); - } - } - private bool ShouldDisplayWarningMessage(BattlePlayerPair randomAll, BattlePlayerPair randomNone) { if (FindUsedRandomSkillOriginalCard(_pair.Self, randomAll.Self) != null) @@ -190,7 +101,7 @@ public class Prediction parallelVfxPlayer.Register(ClearView(_pair)); if (ShouldDisplayWarningMessage(randomAll, randomNone)) { - parallelVfxPlayer.Register(ForecastRandomSkillUseMessageVfx.Create(_battleResourceManager)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } AddCardToWarning(_pair.Self, randomAll.Self); AddCardToWarning(_pair.Opponent, randomAll.Opponent); @@ -211,18 +122,18 @@ public class Prediction BattleCardBase origin = classAndInPlayCardList[i]; if (randomAll.PredictionWarningCards.Any((BattleCardBase x) => x.EquelsID(origin)) || randomNone.PredictionWarningCards.Any((BattleCardBase x) => x.EquelsID(origin))) { - parallelVfxPlayer.Register(new ForecastRandomSkillUseCardVfx(origin.BattleCardView, _battleResourceManager)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (randomNone.CemeteryList.Any((BattleCardBase x) => x.EquelsID(origin))) { - parallelVfxPlayer.Register(new ForecastDeathIconAttachVfx(origin.BattleCardView, _battleResourceManager)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); continue; } if (randomNone.BanishList.Any((BattleCardBase x) => x.EquelsID(origin))) { if (!randomNone.ClassAndInPlayCardList.Any((BattleCardBase x) => x.EquelsID(origin))) { - parallelVfxPlayer.Register(new ForecastBanishIconAttachVfx(origin.BattleCardView, _battleResourceManager)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } continue; } @@ -232,56 +143,11 @@ public class Prediction int damage = origin.Life - battleCardBase.Life; if (battleCardBase.IsDead) { - parallelVfxPlayer.Register(new ForecastDeathIconAttachVfx(origin.BattleCardView, _battleResourceManager)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } else if (battleCardBase.HasMoreDamageThan(origin)) { - parallelVfxPlayer.Register(new ForecastDamageIconAttachVfx(damage, origin.BattleCardView, _battleResourceManager)); - } - } - } - return parallelVfxPlayer; - } - - private static VfxBase UpdatePlayerView(BattlePlayerBase originalBattlePlayer, BattlePlayerBase forecastedBattlePlayer, IBattleResourceMgr resourceMgr) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - List classAndInPlayCardList = originalBattlePlayer.ClassAndInPlayCardList; - for (int i = 0; i < classAndInPlayCardList.Count; i++) - { - BattleCardBase originalCard = classAndInPlayCardList[i]; - if (forecastedBattlePlayer.PredictionWarningCards.Any((BattleCardBase x) => x.EquelsID(originalCard))) - { - parallelVfxPlayer.Register(new ForecastRandomSkillUseCardVfx(originalCard.BattleCardView, resourceMgr)); - } - if (forecastedBattlePlayer.CemeteryList.FindFromCardId(originalCard) != null && forecastedBattlePlayer.PredictionCemeteryRandomCards.FindFromCardId(originalCard) == null) - { - parallelVfxPlayer.Register(new ForecastDeathIconAttachVfx(originalCard.BattleCardView, resourceMgr)); - continue; - } - if (forecastedBattlePlayer.BanishList.FindFromCardId(originalCard) != null) - { - if (forecastedBattlePlayer.ClassAndInPlayCardList.FindFromCardId(originalCard) != null) - { - continue; - } - if (forecastedBattlePlayer.PredictionBanishRandomCards.FindFromCardId(originalCard) == null) - { - parallelVfxPlayer.Register(new ForecastBanishIconAttachVfx(originalCard.BattleCardView, resourceMgr)); - continue; - } - } - BattleCardBase battleCardBase = forecastedBattlePlayer.ClassAndInPlayCardList.FindFromCardId(originalCard); - if (battleCardBase != null && forecastedBattlePlayer.PredictionDamageRandomCards.FindFromCardId(originalCard) == null) - { - int damage = originalCard.Life - battleCardBase.Life; - if (battleCardBase.IsDead) - { - parallelVfxPlayer.Register(new ForecastDeathIconAttachVfx(originalCard.BattleCardView, resourceMgr)); - } - else if (battleCardBase.HasMoreDamageThan(originalCard)) - { - parallelVfxPlayer.Register(new ForecastDamageIconAttachVfx(damage, originalCard.BattleCardView, resourceMgr)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } } } @@ -317,7 +183,7 @@ public class Prediction ClearCardListView(pair.Self.ClassAndInPlayCardList); ClearCardListView(pair.Self.HandCardList); ClearCardListView(pair.Opponent.ClassAndInPlayCardList); - return HideForecastRandomSkillUseMessageVfx.Create(); + return NullVfx.GetInstance(); } private static BattleCardBase FindUsedRandomSkillOriginalCard(BattlePlayerBase originalBattlePlayer, BattlePlayerBase forecastBattlePlayer) @@ -419,23 +285,23 @@ public class Prediction private static BattlePlayerPair TurnEnd(BattlePlayerPair sourcePair, SimulationSelection random) { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; + sourcePair.Self.BattleMgr.InstanceIsForecast = true; + bool isRecovery = sourcePair.Self.BattleMgr.IsRecovery; + sourcePair.Self.BattleMgr.IsRecovery = true; BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); ChangeFilters(battlePlayerPair, random); CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); battlePlayerPair.Self.GetTurnEndSkillProcess().Process(battlePlayerPair); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; + sourcePair.Self.BattleMgr.IsRecovery = isRecovery; + sourcePair.Self.BattleMgr.InstanceIsForecast = false; return battlePlayerPair; } private static BattlePlayerPair Play(BattlePlayerPair sourcePair, IBattleCardUniqueID playCardId, List skillTargets, SimulationSelection random) { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; + sourcePair.Self.BattleMgr.InstanceIsForecast = true; + bool isRecovery = sourcePair.Self.BattleMgr.IsRecovery; + sourcePair.Self.BattleMgr.IsRecovery = true; BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); ChangeFilters(battlePlayerPair, random); CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); @@ -447,26 +313,8 @@ public class Prediction battlePlayerPair.Self.SetupActionProcessorEvent(actionProcessor); battlePlayerPair.Opponent.SetupActionProcessorEvent(actionProcessor); actionProcessor.PlayCard(card, first, second); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; - return battlePlayerPair; - } - - private static BattlePlayerPair Evolve(BattlePlayerPair sourcePair, IBattleCardUniqueID evolutionCardId, List skillTargets, SimulationSelection random) - { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; - BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); - ChangeFilters(battlePlayerPair, random); - CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); - Tuple> tuple = OperationSimulator.Evolve_GetTargetsAndChoice(battlePlayerPair, skillTargets); - BattleCardBase[] first = tuple.first; - List second = tuple.second; - BattleCardBase card = battlePlayerPair.Self.ClassAndInPlayCardList.FindFromCardId(evolutionCardId); - new ActionProcessor(battlePlayerPair).Evolution(card, first, second); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; + sourcePair.Self.BattleMgr.IsRecovery = isRecovery; + sourcePair.Self.BattleMgr.InstanceIsForecast = false; return battlePlayerPair; } diff --git a/SVSim.BattleEngine/Engine/PrefabMgr.cs b/SVSim.BattleEngine/Engine/PrefabMgr.cs index f553d7fa..686b2ec6 100644 --- a/SVSim.BattleEngine/Engine/PrefabMgr.cs +++ b/SVSim.BattleEngine/Engine/PrefabMgr.cs @@ -21,44 +21,12 @@ public class PrefabMgr } } - public IEnumerator LoadAync(string str) - { - if (!m_PrefabData.ContainsKey(str) && !string.IsNullOrEmpty(str)) - { - ResourceRequest loadRequest = Resources.LoadAsync(str); - while (!loadRequest.isDone) - { - yield return null; - } - Object asset = loadRequest.asset; - m_PrefabData.Add(str, asset); - } - } - - public void UnLoad(string str) - { - if (m_PrefabData.ContainsKey(str)) - { - m_PrefabData.Remove(str); - Resources.UnloadUnusedAssets(); - } - } - public void AllUnLoad() { m_PrefabData.Clear(); Resources.UnloadUnusedAssets(); } - public GameObject CreateIns(string str) - { - if (m_PrefabData.ContainsKey(str)) - { - return Object.Instantiate(m_PrefabData[str]) as GameObject; - } - return null; - } - public GameObject Get(string str) { if (m_PrefabData.ContainsKey(str)) @@ -68,50 +36,6 @@ public class PrefabMgr return null; } - public Texture GetTexture(string str) - { - if (m_PrefabData.ContainsKey(str)) - { - return (Texture)m_PrefabData[str]; - } - return null; - } - - public Sprite GetSprite(string str) - { - if (m_PrefabData.ContainsKey(str)) - { - return (Sprite)m_PrefabData[str]; - } - return null; - } - - public AudioClip GetAudio(string str) - { - if (m_PrefabData.ContainsKey(str)) - { - return (AudioClip)m_PrefabData[str]; - } - return null; - } - - public Object GetObj(string str) - { - if (m_PrefabData.ContainsKey(str)) - { - return m_PrefabData[str]; - } - return null; - } - - public void DebugDraw() - { - foreach (string key in m_PrefabData.Keys) - { - _ = key; - } - } - public Dictionary GetPrefabData() { return m_PrefabData; @@ -129,7 +53,7 @@ public class PrefabMgr public GameObject CloneObjectToParent(string str, GameObject parentObject) { - GameObject gameObject = NGUITools.AddChild(parentObject, GameMgr.GetIns().GetPrefabMgr().Get(str)); + GameObject gameObject = null; // Pre-Phase-5b: no PrefabMgr headless m_AddedGameObj.Add(gameObject); return gameObject; } diff --git a/SVSim.BattleEngine/Engine/PriConnField.cs b/SVSim.BattleEngine/Engine/PriConnField.cs index 71179cdf..81e224de 100644 --- a/SVSim.BattleEngine/Engine/PriConnField.cs +++ b/SVSim.BattleEngine/Engine/PriConnField.cs @@ -1,69 +1,15 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class PriConnField : BackGroundBase { public override int FieldId => 1003; - public override int FieldEffectId => 1003; public PriConnField(string bgmId = "NONE") : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1003_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1003").gameObject; - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1003, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1003_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - _battleCamera.Camera.transform.localPosition = new Vector3(910f, -307f, -270f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-18.5f, -80f, 87f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(910f, -307f, -270f), new Vector3(48f, -18f, -18.5f), new Vector3(-211f, 57f, -95f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-17.5f, -108.5f, 95.5f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/PuzzleBattleManager.cs b/SVSim.BattleEngine/Engine/PuzzleBattleManager.cs index d808e29c..987d8481 100644 --- a/SVSim.BattleEngine/Engine/PuzzleBattleManager.cs +++ b/SVSim.BattleEngine/Engine/PuzzleBattleManager.cs @@ -81,7 +81,7 @@ public class PuzzleBattleManager : BattleManagerBase public override VfxBase Setup() { - GameMgr.GetIns().GetSoundMgr().SeMute(isMute: true); + return base.Setup(); } @@ -100,7 +100,7 @@ public class PuzzleBattleManager : BattleManagerBase public override VfxBase Setup() { - PuzzleGenerator puzzleGenerator = new PuzzleGenerator(); + PuzzleGenerator puzzleGenerator = new PuzzleGenerator(_battleMgr as PuzzleBattleManager); PuzzleQuestData puzzleQuestData = (_battleMgr as PuzzleBattleManager).PuzzleQuestData; return SequentialVfxPlayer.Create(new PuzzleOpeningVfx(_battleMgr.BackGround), InstantVfx.Create(delegate { @@ -110,12 +110,12 @@ public class PuzzleBattleManager : BattleManagerBase puzzleBattleManager.SetUpResetAndFailedAnimation(); puzzleBattleManager.SetReaperCard(); _battleMgr.VfxMgr.RegisterSequentialVfx(puzzleGenerator.Generate(puzzleQuestData)); - _battleMgr.VfxMgr.RegisterSequentialVfx(new BattleLoadingEndVfx(_battleMgr)); + _battleMgr.VfxMgr.RegisterSequentialVfx(NullVfx.GetInstance()); _battleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)) { - GameMgr.GetIns().GetSoundMgr().SeMute(isMute: false); + } _battleMgr.BackGround.PlayBgm(); })); @@ -167,12 +167,14 @@ public class PuzzleBattleManager : BattleManagerBase playerClass.SelfBattlePlayer.HandControl.SetHandPosition(); enemyClass.SelfBattlePlayer.HandControl.SetHandPosition(); })); - string path = GameMgr.GetIns().GetDataMgr().GetPlayerSkinId() + // Nested PuzzleOpeningVfx: no mgr in scope on the nested class; the outer mgr's leader-skin + // lookup routes through the players' BattleMgr chain instead of the static GameMgr.GetIns. + string path = playerClass.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().GetPlayerSkinId() .ToString("00"); - string path2 = GameMgr.GetIns().GetDataMgr().GetEnemySkinId() + string path2 = enemyClass.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().GetEnemySkinId() .ToString("00"); - Register(new WaitLoadResourceVfx(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.ClassCharaBase))); - Register(new WaitLoadResourceVfx(Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.ClassCharaBase))); + Register(NullVfx.GetInstance()); + Register(NullVfx.GetInstance()); } } @@ -212,10 +214,6 @@ public class PuzzleBattleManager : BattleManagerBase public bool IsClearDialogWaiting = true; - private const string RESET_BTN_NORMAL_SPRITE = "btn_common_02_s_off"; - - private const string RESET_BTN_PRESS_SPRITE = "btn_common_02_s_on"; - private PuzzleAnimation _puzzleResetAnimatinon; private PuzzleAnimation _puzzleFaledAnimatinon; @@ -249,8 +247,8 @@ public class PuzzleBattleManager : BattleManagerBase public PuzzleBattleManager() : base(new PuzzleBattleMgrContentsCreator()) { - PuzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == GameMgr.GetIns().GetDataMgr().PuzzleQuestId); - PuzzleDifficulty = GameMgr.GetIns().GetDataMgr().PuzzleDifficulty; + PuzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == this.GameMgr.GetDataMgr().PuzzleQuestId); + PuzzleDifficulty = this.GameMgr.GetDataMgr().PuzzleDifficulty; } protected override void SetupEvent() @@ -264,7 +262,7 @@ public class PuzzleBattleManager : BattleManagerBase base.BattleUIContainer.ForceDisableMenu(); BattlePlayer.PlayerBattleView.HideDetailPanel(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); + VfxBase canNotTouchCardVfx = NullVfx.GetInstance(); base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); sequentialVfxPlayer.Register(InstantVfx.Create(delegate { @@ -290,16 +288,15 @@ public class PuzzleBattleManager : BattleManagerBase }; } - private void ForceReset(CanNotTouchCardVfx canNotTouchCardVfx) + private void ForceReset(VfxBase canNotTouchCardVfx) { if (_isReseting || IsBattleEnd) { - canNotTouchCardVfx.End(); return; } RetryCount++; _isReseting = true; - PuzzleGenerator puzzleGenerator = new PuzzleGenerator(); + PuzzleGenerator puzzleGenerator = new PuzzleGenerator(this); base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { _puzzleFaledAnimatinon.Run(isReset: false); @@ -307,7 +304,7 @@ public class PuzzleBattleManager : BattleManagerBase base.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(_puzzleFaledAnimatinon.FadeOutDuration)); base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().SetRejectNewSound(isMute: true); + })); base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { @@ -316,15 +313,11 @@ public class PuzzleBattleManager : BattleManagerBase _puzzleFaledAnimatinon.End(); }), WaitVfx.Create(_puzzleFaledAnimatinon.FadeInDuration), InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().SetRejectNewSound(isMute: false); - canNotTouchCardVfx.End(); + MenuButtonObject.gameObject.SetActive(value: true); base.BattleUIContainer.ForceEnableMenu(); _isReseting = false; - if (!GameMgr.GetIns().GetSoundMgr().IsPlayBGM()) - { - base.BackGround.PlayBgm(); - } + base.BackGround.PlayBgm(); }))); })); } @@ -337,8 +330,8 @@ public class PuzzleBattleManager : BattleManagerBase } RetryCount++; _isReseting = true; - PuzzleGenerator puzzleGenerator = new PuzzleGenerator(); - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); + PuzzleGenerator puzzleGenerator = new PuzzleGenerator(this); + VfxBase canNotTouchCardVfx = NullVfx.GetInstance(); base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { @@ -347,7 +340,7 @@ public class PuzzleBattleManager : BattleManagerBase base.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(_puzzleResetAnimatinon.FadeOutDuration)); base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().SetRejectNewSound(isMute: true); + })); base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate { @@ -356,8 +349,7 @@ public class PuzzleBattleManager : BattleManagerBase _puzzleResetAnimatinon.End(); }), WaitVfx.Create(_puzzleResetAnimatinon.FadeInDuration), InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().SetRejectNewSound(isMute: false); - canNotTouchCardVfx.End(); + _isReseting = false; }))); })); @@ -409,7 +401,7 @@ public class PuzzleBattleManager : BattleManagerBase if (!CheckWinCondition() && (BattlePlayer.Class.IsDead || BattleEnemy.Class.IsDead)) { SequentialVfxPlayer.Create(); - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); + VfxBase canNotTouchCardVfx = NullVfx.GetInstance(); base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); BattlePlayer.PlayerBattleView.TurnEndButtonUI.HideBtn(); base.BattleUIContainer.ForceDisableMenu(); @@ -465,7 +457,7 @@ public class PuzzleBattleManager : BattleManagerBase private void CreateButton() { GameObject gameObject = NGUITools.AddChild(base.BattleUIContainer.gameObject, LoadPrefab("Prefab/UI/HintBtn")); - gameObject.GetComponent().uiCamera = GameMgr.GetIns().GetGameObjMgr().GetUIContainerCam(); + gameObject.GetComponent().uiCamera = this.GameMgr.GetGameObjMgr().GetUIContainerCam(); UISprite componentInChildren = gameObject.GetComponentInChildren(); componentInChildren.atlas = UIManager.GetInstance().GetAtlasList().FirstOrDefault((UIAtlas s) => s.name == "Battle"); componentInChildren.spriteName = "battle_btn_hint_off"; @@ -475,7 +467,7 @@ public class PuzzleBattleManager : BattleManagerBase HintButton.onClick.Clear(); HintButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetTitleLabel(Data.SystemText.Get("Puzzle_Hint_Title")); dialogBase.SetSize(DialogBase.Size.M); @@ -486,12 +478,12 @@ public class PuzzleBattleManager : BattleManagerBase dialogBase.SetObj(gameObject3); })); GameObject gameObject2 = NGUITools.AddChild(base.BattleUIContainer.gameObject, LoadPrefab("Prefab/UI/PuzzleResetBtn")); - gameObject2.GetComponent().uiCamera = GameMgr.GetIns().GetGameObjMgr().GetUIContainerCam(); + gameObject2.GetComponent().uiCamera = this.GameMgr.GetGameObjMgr().GetUIContainerCam(); ResetButton = gameObject2.GetComponentInChildren(); ResetButton.onClick.Clear(); ResetButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + BattlePlayer.PlayerBattleView.TurnEndButtonUI.HideBtn(); base.BattleUIContainer.SetEnableReset(isEnable: false); BattlePlayer.PlayerBattleView.HideDetailPanel(); @@ -516,11 +508,13 @@ public class PuzzleBattleManager : BattleManagerBase ReaperCard = CardHolder.transform.GetChild(GetMaxDeckCount(isSelf: true)).gameObject; } + // Static helper with no mgr in scope; must fall back to GameMgr.GetIns(). A per-instance + // LoadPrefab would need a mgr ref threaded through every static caller — deferred to a + // larger cleanup pass. private static GameObject LoadPrefab(string path) { - PrefabMgr prefabMgr = GameMgr.GetIns().GetPrefabMgr(); - prefabMgr.Load(path); - return prefabMgr.Get(path); + // Pre-Phase-5b: PrefabMgr is a UI-only shim headless + return null; } public void ShowResetAndHintButton() @@ -537,7 +531,7 @@ public class PuzzleBattleManager : BattleManagerBase public override void DisposeBattleGameObj() { - GameMgr.GetIns().IsPuzzleQuest = false; + // GameMgr.IsPuzzleQuest is const-false in headless (Phase 4) — write dropped. base.DisposeBattleGameObj(); } } diff --git a/SVSim.BattleEngine/Engine/PuzzleGenerator.cs b/SVSim.BattleEngine/Engine/PuzzleGenerator.cs index 5605d7b9..d8de55e5 100644 --- a/SVSim.BattleEngine/Engine/PuzzleGenerator.cs +++ b/SVSim.BattleEngine/Engine/PuzzleGenerator.cs @@ -8,11 +8,16 @@ using Wizard.Battle.View.Vfx; public class PuzzleGenerator { - private const int EVOLVED_PUZZLE_ID = 109; + private readonly PuzzleBattleManager _puzzleBattleMgr; + + public PuzzleGenerator(PuzzleBattleManager mgr) + { + _puzzleBattleMgr = mgr; + } public VfxBase Generate(PuzzleQuestData puzzleQuestData) { - PuzzleBattleManager obj = BattleManagerBase.GetIns() as PuzzleBattleManager; + PuzzleBattleManager obj = _puzzleBattleMgr; BattlePlayer battlePlayer = obj.BattlePlayer; BattleEnemy battleEnemy = obj.BattleEnemy; IEnumerable playerFieldCards = new List(battlePlayer.InPlayCards); @@ -42,9 +47,9 @@ public class PuzzleGenerator battleEnemy.Class.SkillApplyInformation.ForceDepriveForceWrath(); battlePlayer.Class.IsSkillLost = isSkillLost; battleEnemy.Class.IsSkillLost = isSkillLost2; - if (BattleManagerBase.GetIns().DetailMgr.DetailPanelControl.EvoTargetPanelColliderGameObject != null) + if (_puzzleBattleMgr.DetailMgr.DetailPanelControl.EvoTargetPanelColliderGameObject != null) { - BattleManagerBase.GetIns().DetailMgr.DetailPanelControl.EvoTargetPanelColliderGameObject.transform.parent = BattleManagerBase.GetIns().DetailMgr.DetailPanel.transform; + _puzzleBattleMgr.DetailMgr.DetailPanelControl.EvoTargetPanelColliderGameObject.transform.parent = _puzzleBattleMgr.DetailMgr.DetailPanel.transform; } SetUpField(battlePlayer, battleEnemy, puzzleQuestData); battlePlayer.EvolvedCards.Clear(); @@ -62,7 +67,7 @@ public class PuzzleGenerator DestroyCardAndCorutine(enemyDeckCards); DestroyCardAndCorutine(enemyHandCards); DestroyCardAndCorutine(enemyFieldCards); - }), RecoveryClassView(battlePlayer, battleEnemy), RecoveryInPlayAndHand(battlePlayer), RecoveryInPlayAndHand(battleEnemy), new DummyDeckChangeCardVfx(battlePlayer.IsPlayer, battlePlayer.DeckCardList.Count), new DummyDeckChangeCardVfx(battleEnemy.IsPlayer, battleEnemy.DeckCardList.Count), battlePlayer.StartBattleMainView(playEffect: false), battleEnemy.StartBattleMainView(playEffect: false)); + }), RecoveryClassView(battlePlayer, battleEnemy), RecoveryInPlayAndHand(battlePlayer), RecoveryInPlayAndHand(battleEnemy), NullVfx.GetInstance(), NullVfx.GetInstance(), battlePlayer.StartBattleMainView(playEffect: false), battleEnemy.StartBattleMainView(playEffect: false)); return ParallelVfxPlayer.Create(sequentialVfxPlayer); } @@ -117,7 +122,7 @@ public class PuzzleGenerator player.PpTotal = puzzleQuestData.BattleData.PlayerPPCount; if (player.IsShortageDeck) { - PuzzleBattleManager puzzleBattleManager = BattleManagerBase.GetIns() as PuzzleBattleManager; + PuzzleBattleManager puzzleBattleManager = _puzzleBattleMgr; player.ResetIsShortageDeck(); iTween.Stop(puzzleBattleManager.ReaperCard); puzzleBattleManager.ReaperCard.transform.SetParent(puzzleBattleManager.CardHolder.transform); @@ -207,7 +212,7 @@ public class PuzzleGenerator private VfxBase ClearInPlayAndHand(BattlePlayerBase player, IEnumerable fieldCardList, IEnumerable handCardList) { - if (BattleManagerBase.GetIns() == null) + if (_puzzleBattleMgr == null) { return NullVfx.GetInstance(); } @@ -241,7 +246,7 @@ public class PuzzleGenerator private VfxBase RecoveryInPlayAndHand(BattlePlayerBase player) { - return ParallelVfxPlayer.Create(new RefreshHealthVfx(player), player.Class.SkillApplyInformation.CreateVfxSkillProtection(), player.BattleView.RecoveryInPlayCards(), player.BattleView.RecoveryInHandCards(), OpeningVfx.ShowBattleUIImmediatelyVfx(player, fixDirection: true), player.UsePp(0), InstantVfx.Create(player.BattleView.HideCommonPanel)); + return ParallelVfxPlayer.Create(NullVfx.GetInstance(), player.Class.SkillApplyInformation.CreateVfxSkillProtection(), player.BattleView.RecoveryInPlayCards(), player.BattleView.RecoveryInHandCards(), OpeningVfx.ShowBattleUIImmediatelyVfx(player, fixDirection: true), player.UsePp(0), InstantVfx.Create(player.BattleView.HideCommonPanel)); } private void AddToDeckNoIndexChange(BattlePlayerBase player, BattleCardBase card) @@ -255,8 +260,8 @@ public class PuzzleGenerator private void FieldGenSetCard(BattlePlayerBase player, BattlePlayerBase enemy, CardPrm cardPrm) { - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; + bool isRecovery = _puzzleBattleMgr.IsRecovery; + _puzzleBattleMgr.IsRecovery = true; SkillProcessor skillProcessor = new SkillProcessor(); BattleCardBase battleCardBase = player.CreateNextIndexCard(cardPrm.Id); player.HandCardList.Add(battleCardBase); @@ -277,6 +282,6 @@ public class PuzzleGenerator battleCardBase.SkillApplyInformation.GiveChantCount(new ChantCountSetModifier(cardPrm.ChantCount)); } battleCardBase.BattleCardView.InitializeBattleCardIcon(battleCardBase, battleCardBase.Skills).Play(); - BattleManagerBase.GetIns().IsRecovery = isRecovery; + _puzzleBattleMgr.IsRecovery = isRecovery; } } diff --git a/SVSim.BattleEngine/Engine/QuestFinishDetail.cs b/SVSim.BattleEngine/Engine/QuestFinishDetail.cs index 8687f38c..daa16c14 100644 --- a/SVSim.BattleEngine/Engine/QuestFinishDetail.cs +++ b/SVSim.BattleEngine/Engine/QuestFinishDetail.cs @@ -6,9 +6,6 @@ public class QuestFinishDetail { public enum WinBonusStatus { - NotAchieved, - NowAchieved, - AlreadyAchieved } public class MissionClearInfo @@ -24,91 +21,16 @@ public class QuestFinishDetail } } - public JsonData _responseData; - - public int get_class_chara_experience; - - public int class_chara_experience; - - public int class_chara_level; - - public int CurrentPoint { get; set; } - - public int AddPoint { get; set; } - - public int ClassBonusPoint { get; set; } - - public int FormatBonusPoint { get; set; } - - public List NecessaryPointList { get; set; } - - public List CommonMissionClearInfoList { get; set; } - - public List CharacterMissionClearInfoList { get; set; } - - public int WinBonusPoint { get; set; } - - public int WinCount { get; set; } - - public int WinCountForWinBonusPoint { get; set; } - - public bool IsSpecialResult { get; set; } - - public bool IsSpecialEffect { get; set; } - - public int CurrentLife { get; set; } - public int MaxLife { get; set; } - public bool IsEnableBossRushShortestTurn { get; set; } - - public int BossRushShortestTurn { get; set; } - - public int BossRushTotalTurn { get; set; } - - public bool IsBossRushNewRecord { get; set; } - - public WinBonusStatus WinBonusPointStatus { get; set; } - public List achieved_mission_list => AchievedInfo._missions; public List achieved_achievement_list => AchievedInfo._achievements; - public List Rewards => AchievedInfo._rewards; - public AchievedInfo AchievedInfo { get; private set; } - public PuzzleQuestInfo PuzzleQuestInfo { get; set; } - - public MyPageHomeDialogData HomeDialogData { get; set; } - public QuestFinishDetail() { AchievedInfo = new AchievedInfo(); } - - public int GetTotalCommonMissionClearPoint() - { - int num = 0; - for (int i = 0; i < CommonMissionClearInfoList.Count; i++) - { - num += CommonMissionClearInfoList[i].MissionPoint; - } - return num; - } - - public int GetTotalCharacterMissionClearPoint() - { - int num = 0; - for (int i = 0; i < CharacterMissionClearInfoList.Count; i++) - { - num += CharacterMissionClearInfoList[i].MissionPoint; - } - return num; - } - - public int GetTotalBonusPoint() - { - return ClassBonusPoint + FormatBonusPoint; - } } diff --git a/SVSim.BattleEngine/Engine/QuestNextSceneSelector.cs b/SVSim.BattleEngine/Engine/QuestNextSceneSelector.cs deleted file mode 100644 index ce217927..00000000 --- a/SVSim.BattleEngine/Engine/QuestNextSceneSelector.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class QuestNextSceneSelector : INextSceneSelector -{ - private BattleResultUIController _battleResultNewControl; - - private bool _isMovingPage; - - private const float QUEST_RESULT_SHOW_TIME = 0.5f; - - private const int DECK_SELECT_UI_DEPTH = 40; - - public QuestNextSceneSelector(BattleResultUIController battleResultControl) - { - _battleResultNewControl = battleResultControl; - _isMovingPage = false; - } - - private void SetupSecretBoss() - { - _battleResultNewControl.QuestBattleResultObject.MyPageCamera.gameObject.SetActive(value: true); - _battleResultNewControl.MissionBtnObj.buttons[0].gameObject.SetActive(value: false); - _battleResultNewControl.gameObject.SetActive(value: true); - _battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0204"); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(OnClickSecretBossRetry)); - _battleResultNewControl.HomeBtnObj.labels[0].text = Data.SystemText.Get("Quest_0016"); - _battleResultNewControl.HomeBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MoveToQuestSelectionPage(); - })); - } - - private void OnClickSecretBossRetry() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - GameMgr.GetIns().GetDataMgr().QuestFirstSelectType = QuestSelectionPage.FirstSelectType.BOSS_RUSH; - BossRushClearDeckListTask task = new BossRushClearDeckListTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Format format = Format.Hof; - DeckGroupListData deckGroupListData = new DeckGroupListData(new DeckGroup(task.DeckList, format, DeckAttributeType.QuestSecretBoss)); - DeckSelectUIDialog deckSelectUIDialog = DeckSelectUIDialog.Create(Data.SystemText.Get("BossRush_0032"), deckGroupListData, format, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: false, delegate(DialogBase dialog, DeckData deck) - { - OnSelectDeck(deck, task.AbilityDictionary[deck.GetDeckID()]); - }); - deckSelectUIDialog.Dialog.SetLayer("MyPage"); - deckSelectUIDialog.Dialog.SetPanelDepth(40); - deckSelectUIDialog.SetPanelDepth(41); - })); - } - - private void OnSelectDeck(DeckData deck, List abilityList) - { - SecretBossDeckConfirmDialog.Create(deck, abilityList, isBattleAgain: true); - } - - public void Setup(bool isWin, GameObject gameObject) - { - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.SecretBossQuest) - { - SetupSecretBoss(); - return; - } - if (!BattleManagerBase.GetIns().IsPuzzleMgr && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.BossRushQuest) - { - _battleResultNewControl.MissionBtnObj.labels[0].text = Data.SystemText.Get("Quest_0005"); - _battleResultNewControl.MissionBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.MissionBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - _battleResultNewControl.QuestBattleResultObject.CreateQuestList(); - })); - } - else - { - _battleResultNewControl.MissionBtnObj.buttons[0].gameObject.SetActive(value: false); - } - _battleResultNewControl.HomeBtnObj.labels[0].text = Data.SystemText.Get("Quest_0016"); - _battleResultNewControl.HomeBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MoveToQuestSelectionPage(); - })); - if (BattleManagerBase.GetIns().IsPuzzleMgr) - { - _battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Puzzle_QuestSelect_Button"); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(OnClickPuzzleButton)); - return; - } - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.BossRushQuest) - { - _battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0203"); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - MoveToBossRushLobby(); - })); - return; - } - if (isWin && GameMgr.GetIns().GetDataMgr().QuestBattleData.IsExtra) - { - _battleResultNewControl.RetryBtnObj.buttons[0].gameObject.SetActive(value: false); - return; - } - _battleResultNewControl.gameObject.SetActive(value: true); - _battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0204"); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - _battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - QuestDeckListTask task = new QuestDeckListTask(); - task.SetParameter(GameMgr.GetIns().GetDataMgr().QuestBattleData.QuestStageId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - QuestSelectionPage.CreateQuestDeckDialog(task.DeckGroupListData, task.BonusFormatList, task.BonusClassList, isBattleAgain: true); - })); - })); - } - - public void Show() - { - iTween.MoveTo(_battleResultNewControl.ButtonGrid.gameObject, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["ButtonGrid"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void MoveToQuestSelectionPage() - { - if (!_isMovingPage) - { - _isMovingPage = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.QuestSelectionPage); - } - } - - private void MoveToBossRushLobby() - { - if (!_isMovingPage) - { - _isMovingPage = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.BossRushLobby); - } - } - - private void OnClickPuzzleButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().StartCoroutine(PuzzleUtil.OpenPuzzleSelectDialogCoroutine(OnDecidePuzzleQuest)); - } - - private void OnDecidePuzzleQuest(PuzzleQuestData data, int difficulty) - { - GameMgr.GetIns().GetSoundMgr().StopAllBGM(0.5f); - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().StartCoroutine(BattleManagerBase.GetIns().GetBattleControl().BattleEnd(delegate - { - UIManager.GetInstance().CreatFadeOpen(); - PuzzleUtil.SetPuzzleQuestData(data, difficulty, DataMgr.BattleType.Quest); - PuzzleUtil.ChangeSceneToPuzzleQuest(data); - })); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/QuestReportEndAgent.cs b/SVSim.BattleEngine/Engine/QuestReportEndAgent.cs deleted file mode 100644 index 060f1685..00000000 --- a/SVSim.BattleEngine/Engine/QuestReportEndAgent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -public class QuestReportEndAgent : MonoBehaviour -{ - public bool IsEnd { get; private set; } - - public void Finished() - { - IsEnd = true; - } -} diff --git a/SVSim.BattleEngine/Engine/QuestResultReporter.cs b/SVSim.BattleEngine/Engine/QuestResultReporter.cs deleted file mode 100644 index 3bba71df..00000000 --- a/SVSim.BattleEngine/Engine/QuestResultReporter.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Lottery; - -public class QuestResultReporter : IBattleResultReporter -{ - private readonly GameObject _reportEndAgentObj; - - private readonly QuestReportEndAgent _reportEndAgent; - - public bool IsEnd => _reportEndAgent.IsEnd; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => GetRewardsList(); - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => Data.QuestFinish.data.AchievedInfo._lotteryData; - - public MyPageHomeDialogData HomeDialogData => null; - - public bool IsDataExist => true; - - public QuestResultReporter() - { - _reportEndAgentObj = new GameObject(); - _reportEndAgent = _reportEndAgentObj.AddComponent(); - } - - public void Report(bool isWin) - { - StartFinishQuest(isWin, delegate - { - _reportEndAgent.Finished(); - }); - } - - public void StartFinishQuest(bool isWin, Action callback) - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - LocalLog.RecordCheckLog(LocalLog.RecordType.CERBERUS, isWin); - SkillOptionValue skillOptionValue = new SkillOptionValue(SkillCreator.ParseContentInfos("mission_info={me.main_place.class.turn}")); - SkillCollectionBase.SetupOptionValue(skillOptionValue, ins.GetBattlePlayerPair(isPlayer: true), ins.GetBattlePlayer(isPlayer: true).Class, null); - BaseTask baseTask = null; - if (BattleManagerBase.GetIns().IsPuzzleMgr) - { - int id = (BattleManagerBase.GetIns() as PuzzleBattleManager).PuzzleQuestData.Id; - baseTask = new QuestFinishTask(isPuzzle: true); - (baseTask as QuestFinishTask).SetParameterForPuzzle(id, isWin); - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest) - { - baseTask = new BossRushFinishTask(); - (baseTask as BossRushFinishTask).SetParameter(BattleManagerBase.GetIns().BattlePlayer.Class.Life, BattleManagerBase.GetIns().BattlePlayer.Class.MaxLife, dataMgr.BossRushBattleData.QuestStageId, dataMgr.GetSelectDeckId(), isWin, dataMgr.GetSelectDeckFormat(), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.BuildDeck), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.TrialDeck), ins.IsFirst, skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.mission_info, 0)); - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.SecretBossQuest) - { - baseTask = new BossRushHiddenBattleFinishTask(); - (baseTask as BossRushHiddenBattleFinishTask).SetParameter(dataMgr.BossRushBattleData.QuestStageId, dataMgr.GetSelectDeckId(), isWin, dataMgr.GetSelectDeckFormat(), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.BuildDeck), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.TrialDeck), ins.IsFirst, skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.mission_info, 0)); - } - else - { - baseTask = new QuestFinishTask(); - (baseTask as QuestFinishTask).SetParameter(dataMgr.QuestBattleData.QuestStageId, dataMgr.GetSelectDeckId(), isWin, dataMgr.GetSelectDeckFormat(), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.BuildDeck), dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.TrialDeck), ins.IsFirst, skillOptionValue.GetInt(SkillFilterCreator.ContentKeyword.mission_info, 0)); - } - _reportEndAgent.StartCoroutine(Toolbox.NetworkManager.Connect(baseTask, delegate - { - callback.Call(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - public void Destroy() - { - UnityEngine.Object.Destroy(_reportEndAgentObj); - } - - public JsonData GetFinishResponseData() - { - return Data.QuestFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.QuestFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.QuestFinish.data.achieved_mission_list; - } - - public List GetRewardsList() - { - return Data.QuestFinish.data.Rewards; - } - - public int GetClassExp() - { - return Data.QuestFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/QuestSpecialBattleResult.cs b/SVSim.BattleEngine/Engine/QuestSpecialBattleResult.cs deleted file mode 100644 index f1c01ac6..00000000 --- a/SVSim.BattleEngine/Engine/QuestSpecialBattleResult.cs +++ /dev/null @@ -1,731 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.QuestSpecialResult; - -public class QuestSpecialBattleResult : MonoBehaviour -{ - private const float CARD_SCALE = 0.86f; - - private const int CARD_DEPTH = 50; - - private const string BOSS_RUSH_EFFECT = "cmn_result_bossrush_1"; - - [SerializeField] - private BattleResultUIController _battleResultNewControl; - - [Header("クエスト情報")] - [SerializeField] - public GameObject _questPointInfo; - - [SerializeField] - private UIGauge _questPointGaugeBar; - - [SerializeField] - public ParticleSystem QuestPointGaugeEffect; - - [SerializeField] - private UILabel _questPointLabel; - - [SerializeField] - public UILabel _questPointAddLabel; - - [SerializeField] - public UILabel _questBonusPointAddLabel; - - [SerializeField] - public UILabel _questBonusTitleLabel; - - [SerializeField] - public UILabel _questBonusInfoLabel; - - [SerializeField] - public UILabel _questPointRestLabel; - - [SerializeField] - public List _questClearMissionTitleLabelList; - - [SerializeField] - public List _questClearMissionPointLabelList; - - [SerializeField] - private UISprite _bossrushFinishTitle; - - [SerializeField] - private CardImageHelpder _bossRushCardLoader; - - [SerializeField] - private GameObject _bossRushCardRoot; - - [SerializeField] - private UISprite _bossRushBG; - - [SerializeField] - private UIGrid _bossRushCardGrid; - - [SerializeField] - private GameObject _bossRushEmptyFrameOriginal; - - [SerializeField] - private UILabel _bossRushWinCountLabel; - - [SerializeField] - private GameObject _bossRushWinCountObj; - - [SerializeField] - private UIButton _bossRushTouchCollider; - - [SerializeField] - private GameObject _bossRushCardOriginal; - - private List _loadFileList = new List(); - - private bool _isNeedBossRushAtlasRemove; - - private const float QUEST_RESULT_LABEL_DURATION = 0.5f; - - private const float QUEST_RESULT_LABEL_DELAY = 0.1f; - - private const float QUEST_RESULT_LABEL_MOVE_DISTANCE = 50f; - - [SerializeField] - private QuestAllConfirmDialog _questAllConfirmDialogOriginal; - - [SerializeField] - private GameObject _winBonusRoot; - - [SerializeField] - private UILabel _winBonusLabel; - - [SerializeField] - private UILabel _winBonusTitleLabel; - - [SerializeField] - private UILabel _winBonusPointLabel; - - [SerializeField] - private UILabel _bossRushClearLife; - - [SerializeField] - private UILabel _bossRushClearLifeMax; - - [SerializeField] - private FlexibleGrid _bossRushClearLifeGrid; - - [SerializeField] - private UILabel _bossRushClearTurn; - - [SerializeField] - private UILabel _bossRushClearWinCount; - - [SerializeField] - private UILabel _bossRushShortestClearTurn; - - [SerializeField] - private UILabel _bossRushClearNewRecordLabel; - - [SerializeField] - private GameObject _bossRushAnimationRoot; - - [SerializeField] - private Camera _myPageCamera; - - private int _questLvPrev; - - private QuestAssetManager _assetManager; - - public bool IsBossRushTotalResultFinish { get; private set; } - - public Camera MyPageCamera => _myPageCamera; - - public void Init() - { - _assetManager = new QuestAssetManager(); - _battleResultNewControl.DefaultPosDict["QuestPointInfo"] = _questPointInfo.transform.localPosition; - _bossRushEmptyFrameOriginal.SetActive(value: false); - GameMgr.GetIns().GetDataMgr(); - _bossRushCardRoot.SetActive(value: false); - _bossRushCardOriginal.SetActive(value: false); - _myPageCamera.gameObject.SetActive(value: false); - } - - public void ResultSetupEnd(Format format) - { - _questPointInfo.transform.localPosition = _battleResultNewControl.DefaultPosDict["QuestPointInfo"] + Vector3.left * 2000f; - _questPointInfo.gameObject.SetActive(value: true); - _questPointAddLabel.alpha = 0f; - _questBonusPointAddLabel.alpha = 0f; - _questBonusTitleLabel.alpha = 0f; - _questBonusInfoLabel.alpha = 0f; - for (int i = 0; i < _questClearMissionTitleLabelList.Count; i++) - { - _questClearMissionTitleLabelList[i].alpha = 0f; - } - for (int j = 0; j < _questClearMissionPointLabelList.Count; j++) - { - _questClearMissionPointLabelList[j].alpha = 0f; - } - _winBonusTitleLabel.alpha = 0f; - _winBonusPointLabel.alpha = 0f; - } - - public void GetServerData(IBattleResultReporter resultReporter) - { - SetQuestPoint(0, isLvUpCheck: false); - QuestFinishDetail data = Data.QuestFinish.data; - if (data.WinBonusPointStatus == QuestFinishDetail.WinBonusStatus.AlreadyAchieved || data.WinCountForWinBonusPoint == 0) - { - _winBonusRoot.SetActive(value: false); - return; - } - _winBonusRoot.SetActive(value: true); - if (data.WinBonusPointStatus == QuestFinishDetail.WinBonusStatus.NotAchieved) - { - _winBonusLabel.text = string.Format(Data.SystemText.Get("Quest_0039"), data.WinCountForWinBonusPoint - data.WinCount); - } - else if (data.WinBonusPointStatus == QuestFinishDetail.WinBonusStatus.NowAchieved) - { - _winBonusLabel.text = Data.SystemText.Get("Quest_0041"); - } - } - - public void CreateQuestList() - { - _ = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Quest_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - QuestAllConfirmDialog questAllConfirmDialog = Object.Instantiate(_questAllConfirmDialogOriginal); - questAllConfirmDialog.CreateQuestAllConfirmDialog(); - dialogBase.SetObj(questAllConfirmDialog.gameObject); - _battleResultNewControl._missionDialog = dialogBase; - } - - public void SettingAddQuestPointTextAnimation() - { - QuestFinishDetail data = Data.QuestFinish.data; - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", data.AddPoint, "time", 0.5f, "delay", 0.5f, "onstart", "StartAddQuestPoint", "onupdate", "UpdateQuestPoint", "oncomplete", "CompleteQuestPoint", "easetype", iTween.EaseType.easeOutQuad)); - bool flag = data.AddPoint >= 0; - _questPointAddLabel.text = (flag ? "+" : string.Empty) + data.AddPoint; - _questPointAddLabel.color = (flag ? BattleResultUIController.PLUS_START_COLOR : BattleResultUIController.MINUS_START_COLOR); - TweenAlpha.Begin(_questPointAddLabel.gameObject, 0.3f, 1f); - iTween.MoveFrom(_questPointAddLabel.gameObject, iTween.Hash("y", _questPointAddLabel.transform.localPosition.y - 10f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void AddWinBonusQuestPoint() - { - QuestFinishDetail data = Data.QuestFinish.data; - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", data.WinBonusPoint, "time", 0.5f, "delay", 0.5f, "onstart", "StartAddQuestPoint", "onupdate", "UpdateWinBonusQuestPoint", "oncomplete", "CompleteWinBonusQuestPoint", "easetype", iTween.EaseType.easeOutQuad)); - _winBonusPointLabel.text = "+" + data.WinBonusPoint; - _winBonusPointLabel.color = BattleResultUIController.PLUS_END_COLOR; - _winBonusTitleLabel.alpha = 1f; - iTween.MoveFrom(_winBonusTitleLabel.gameObject, iTween.Hash("x", _winBonusTitleLabel.transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void SettingAddBounusQuestPointTextAnimation() - { - QuestFinishDetail data = Data.QuestFinish.data; - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", data.GetTotalBonusPoint(), "time", 0.5f, "delay", 0.5f, "onstart", "StartAddQuestPoint", "onupdate", "UpdateBonusQuestPoint", "oncomplete", "CompleteBonusQuestPoint", "easetype", iTween.EaseType.easeOutQuad)); - _questBonusPointAddLabel.text = ((data.GetTotalBonusPoint() >= 0) ? "+" : string.Empty) + data.GetTotalBonusPoint(); - _questBonusPointAddLabel.color = BattleResultUIController.PLUS_END_COLOR; - _questBonusTitleLabel.alpha = 1f; - iTween.MoveFrom(_questBonusTitleLabel.gameObject, iTween.Hash("x", _questBonusTitleLabel.transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(_questBonusInfoLabel.gameObject, 0.3f, 1f).delay = 0.1f; - iTween.MoveFrom(_questBonusInfoLabel.gameObject, iTween.Hash("x", _questBonusInfoLabel.transform.localPosition.x - 50f, "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void SettingAddCommonMissionQuestPointTextAnimation() - { - int totalCommonMissionClearPoint = Data.QuestFinish.data.GetTotalCommonMissionClearPoint(); - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", totalCommonMissionClearPoint, "time", 0.5f, "delay", 0.5f, "onstart", "StartAddQuestPoint", "onupdate", "UpdateCommonMissionQuestPoint", "oncomplete", (Data.QuestFinish.data.CharacterMissionClearInfoList.Count > 0) ? "CompleteCommonMissionQuestPointDisappearLabel" : "CompleteCommonMissionQuestPoint", "easetype", iTween.EaseType.easeOutQuad)); - List commonMissionClearInfoList = Data.QuestFinish.data.CommonMissionClearInfoList; - for (int i = 0; i < commonMissionClearInfoList.Count; i++) - { - _questClearMissionTitleLabelList[i].text = commonMissionClearInfoList[i].MissionText; - _questClearMissionPointLabelList[i].text = "+" + commonMissionClearInfoList[i].MissionPoint; - _questClearMissionTitleLabelList[i].alpha = 1f; - iTween.MoveFrom(_questClearMissionTitleLabelList[i].gameObject, iTween.Hash("x", _questClearMissionTitleLabelList[i].transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - _questClearMissionPointLabelList[i].alpha = 1f; - iTween.MoveFrom(_questClearMissionPointLabelList[i].gameObject, iTween.Hash("x", _questClearMissionPointLabelList[i].transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - } - - public void SettingAddCharacterMissionQuestPointTextAnimation() - { - int totalCharacterMissionClearPoint = Data.QuestFinish.data.GetTotalCharacterMissionClearPoint(); - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", totalCharacterMissionClearPoint, "time", 0.5f, "delay", 0.5f, "onstart", "StartAddQuestPoint", "onupdate", "UpdateCharacterMissionQuestPoint", "oncomplete", "CompleteCharacterMissionQuestPoint", "easetype", iTween.EaseType.easeOutQuad)); - List characterMissionClearInfoList = Data.QuestFinish.data.CharacterMissionClearInfoList; - for (int i = 0; i < characterMissionClearInfoList.Count; i++) - { - _questClearMissionTitleLabelList[i].text = characterMissionClearInfoList[i].MissionText; - _questClearMissionPointLabelList[i].text = "+" + characterMissionClearInfoList[i].MissionPoint; - _questClearMissionTitleLabelList[i].alpha = 1f; - iTween.MoveFrom(_questClearMissionTitleLabelList[i].gameObject, iTween.Hash("x", _questClearMissionTitleLabelList[i].transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - _questClearMissionPointLabelList[i].alpha = 1f; - iTween.MoveFrom(_questClearMissionPointLabelList[i].gameObject, iTween.Hash("x", _questClearMissionPointLabelList[i].transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - } - - private void StartAddQuestPoint() - { - QuestPointGaugeEffect.gameObject.SetActive(value: true); - QuestPointGaugeEffect.Play(); - } - - private void SetQuestPoint(int diffPoint, bool isLvUpCheck) - { - if (GameMgr.GetIns().GetDataMgr().IsQuestBattleType()) - { - QuestFinishDetail data = Data.QuestFinish.data; - int initPoint = data.CurrentPoint - data.AddPoint - data.WinBonusPoint - data.GetTotalBonusPoint() - data.GetTotalCommonMissionClearPoint() - data.GetTotalCharacterMissionClearPoint() + diffPoint; - int questLv = GetQuestLv(initPoint); - int questPointNow = GetQuestPointNow(initPoint); - int num = Mathf.Max(0, data.NecessaryPointList[questLv - 1] - questPointNow); - _questPointLabel.text = initPoint.ToString(); - _questPointAddLabel.text = "+" + (data.AddPoint - diffPoint); - _questPointRestLabel.text = num.ToString(); - _questPointGaugeBar.Value = (((float)data.NecessaryPointList[questLv - 1] > 0f) ? Mathf.Min((float)questPointNow / (float)data.NecessaryPointList[questLv - 1], 1f) : 1f); - if (isLvUpCheck && questLv > _questLvPrev) - { - GameMgr ins = GameMgr.GetIns(); - ins.GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, _questPointGaugeBar.GetTransformGaugeStartEdge().position); - _questLvPrev = questLv; - } - else - { - _questLvPrev = GetQuestLv(initPoint); - } - } - } - - private void SetWinBonusQuestPoint(int diffPoint) - { - if (GameMgr.GetIns().GetDataMgr().IsQuestBattleType()) - { - QuestFinishDetail data = Data.QuestFinish.data; - int initPoint = data.CurrentPoint - data.WinBonusPoint - data.GetTotalBonusPoint() - data.GetTotalCommonMissionClearPoint() - data.GetTotalCharacterMissionClearPoint() + diffPoint; - int questLv = GetQuestLv(initPoint); - int questPointNow = GetQuestPointNow(initPoint); - int num = data.NecessaryPointList[questLv - 1]; - int num2 = Mathf.Max(0, num - questPointNow); - _questPointLabel.text = initPoint.ToString(); - _winBonusPointLabel.text = "+" + (data.WinBonusPoint - diffPoint); - _questPointRestLabel.text = num2.ToString(); - _questPointGaugeBar.Value = ((num > 0) ? Mathf.Min((float)questPointNow / (float)num, 1f) : 1f); - if (questLv > _questLvPrev) - { - GameMgr ins = GameMgr.GetIns(); - ins.GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, _questPointGaugeBar.GetTransformGaugeStartEdge().position); - _questLvPrev = questLv; - } - else - { - _questLvPrev = GetQuestLv(initPoint); - } - } - } - - private void SetBonusQuestPoint(int diffPoint) - { - if (GameMgr.GetIns().GetDataMgr().IsQuestBattleType()) - { - QuestFinishDetail data = Data.QuestFinish.data; - int initPoint = data.CurrentPoint - data.GetTotalBonusPoint() - data.GetTotalCommonMissionClearPoint() - data.GetTotalCharacterMissionClearPoint() + diffPoint; - int questLv = GetQuestLv(initPoint); - int questPointNow = GetQuestPointNow(initPoint); - int num = Mathf.Max(0, data.NecessaryPointList[questLv - 1] - questPointNow); - _questPointLabel.text = initPoint.ToString(); - _questBonusPointAddLabel.text = "+" + (data.GetTotalBonusPoint() - diffPoint); - _questPointRestLabel.text = num.ToString(); - _questPointGaugeBar.Value = (((float)data.NecessaryPointList[questLv - 1] > 0f) ? Mathf.Min((float)questPointNow / (float)data.NecessaryPointList[questLv - 1], 1f) : 1f); - if (questLv > _questLvPrev) - { - GameMgr ins = GameMgr.GetIns(); - ins.GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, _questPointGaugeBar.GetTransformGaugeStartEdge().position); - _questLvPrev = questLv; - } - else - { - _questLvPrev = GetQuestLv(initPoint); - } - } - } - - private void SetCommonMissionQuestPoint(int diffPoint) - { - if (GameMgr.GetIns().GetDataMgr().IsQuestBattleType()) - { - QuestFinishDetail data = Data.QuestFinish.data; - int initPoint = data.CurrentPoint - data.GetTotalCommonMissionClearPoint() - data.GetTotalCharacterMissionClearPoint() + diffPoint; - int questLv = GetQuestLv(initPoint); - int questPointNow = GetQuestPointNow(initPoint); - int num = Mathf.Max(0, data.NecessaryPointList[questLv - 1] - questPointNow); - _questPointLabel.text = initPoint.ToString(); - _questPointRestLabel.text = num.ToString(); - _questPointGaugeBar.Value = (((float)data.NecessaryPointList[questLv - 1] > 0f) ? Mathf.Min((float)questPointNow / (float)data.NecessaryPointList[questLv - 1], 1f) : 1f); - if (questLv > _questLvPrev) - { - GameMgr ins = GameMgr.GetIns(); - ins.GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, _questPointGaugeBar.GetTransformGaugeStartEdge().position); - _questLvPrev = questLv; - } - else - { - _questLvPrev = GetQuestLv(initPoint); - } - } - } - - private void SetCharacterMissionQuestPoint(int diffPoint) - { - if (GameMgr.GetIns().GetDataMgr().IsQuestBattleType()) - { - QuestFinishDetail data = Data.QuestFinish.data; - int initPoint = data.CurrentPoint - data.GetTotalCharacterMissionClearPoint() + diffPoint; - int questLv = GetQuestLv(initPoint); - int questPointNow = GetQuestPointNow(initPoint); - int num = Mathf.Max(0, data.NecessaryPointList[questLv - 1] - questPointNow); - _questPointLabel.text = initPoint.ToString(); - _questPointRestLabel.text = num.ToString(); - _questPointGaugeBar.Value = (((float)data.NecessaryPointList[questLv - 1] > 0f) ? Mathf.Min((float)questPointNow / (float)data.NecessaryPointList[questLv - 1], 1f) : 1f); - if (questLv > _questLvPrev) - { - GameMgr ins = GameMgr.GetIns(); - ins.GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, _questPointGaugeBar.GetTransformGaugeStartEdge().position); - _questLvPrev = questLv; - } - else - { - _questLvPrev = GetQuestLv(initPoint); - } - } - } - - private void UpdateQuestPoint(int num) - { - SetQuestPoint(num, isLvUpCheck: true); - } - - private void UpdateWinBonusQuestPoint(int num) - { - SetWinBonusQuestPoint(num); - } - - private void UpdateBonusQuestPoint(int num) - { - SetBonusQuestPoint(num); - } - - private void UpdateCommonMissionQuestPoint(int num) - { - SetCommonMissionQuestPoint(num); - } - - private void UpdateCharacterMissionQuestPoint(int num) - { - SetCharacterMissionQuestPoint(num); - } - - private void CompleteQuestPoint() - { - QuestPointGaugeEffect.Stop(); - TweenAlpha.Begin(_questPointAddLabel.gameObject, 0.5f, 0f); - } - - private void CompleteWinBonusQuestPoint() - { - QuestPointGaugeEffect.Stop(); - TweenAlpha.Begin(_winBonusTitleLabel.gameObject, 0.5f, 0f); - TweenAlpha.Begin(_winBonusPointLabel.gameObject, 0.5f, 0f); - } - - private void CompleteBonusQuestPoint() - { - QuestPointGaugeEffect.Stop(); - TweenAlpha.Begin(_questBonusTitleLabel.gameObject, 0.5f, 0f); - TweenAlpha.Begin(_questBonusPointAddLabel.gameObject, 0.5f, 0f); - } - - private void CompleteCommonMissionQuestPointDisappearLabel() - { - CompleteCommonMissionQuestPoint(); - for (int i = 0; i < Data.QuestFinish.data.CommonMissionClearInfoList.Count; i++) - { - TweenAlpha.Begin(_questClearMissionTitleLabelList[i].gameObject, 0.5f, 0f); - TweenAlpha.Begin(_questClearMissionPointLabelList[i].gameObject, 0.5f, 0f); - } - } - - private void CompleteCommonMissionQuestPoint() - { - QuestPointGaugeEffect.Stop(); - } - - private void CompleteCharacterMissionQuestPoint() - { - QuestPointGaugeEffect.Stop(); - } - - private int GetQuestLv(int initPoint) - { - int num = 1; - int num2 = 0; - List necessaryPointList = Data.QuestFinish.data.NecessaryPointList; - for (int i = 0; i < necessaryPointList.Count; i++) - { - num2 += necessaryPointList[i]; - if (initPoint < num2) - { - break; - } - num++; - } - return Mathf.Min(num, necessaryPointList.Count); - } - - private int GetQuestPointNow(int initPoint) - { - int num = initPoint; - List necessaryPointList = Data.QuestFinish.data.NecessaryPointList; - for (int i = 0; i < necessaryPointList.Count && num >= necessaryPointList[i]; i++) - { - num -= necessaryPointList[i]; - } - return num; - } - - public IEnumerator LoadCoroutine() - { - yield return _assetManager.LoadAllCoroutine(); - } - - public void Unload() - { - if (_isNeedBossRushAtlasRemove) - { - UIManager.GetInstance().RemoveResidentAtlas(UIAtlasManager.AssetBundleNames.BossRush); - } - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - _assetManager.UnloadAll(); - } - - public IEnumerator PlayAnimationCoroutine() - { - while (!_assetManager.IsLoaded) - { - yield return null; - } - } - - private IEnumerator LoadBossRushResource() - { - List cardIdList = new List(); - BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - foreach (BossRushSpecialSkill playerSkill in bossRushBattleData.PlayerSkillList) - { - CardParameter cardParameterFromId = instance.GetCardParameterFromId(playerSkill.OriginalCardId); - if (playerSkill.IsFoil) - { - cardIdList.Add(cardParameterFromId.FoilCardId); - } - else - { - cardIdList.Add(playerSkill.OriginalCardId); - } - } - bool finish = false; - _isNeedBossRushAtlasRemove = true; - List loadList = new List { UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.BossRush) }; - string[] array = new string[1] { "cmn_result_bossrush_1" }; - foreach (string path in array) - { - loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.Effect2D)); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _loadFileList = loadList; - UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.BossRush); - _bossRushCardLoader.Load(cardIdList, 0.86f, 50, CardTemplateCustomize, delegate - { - finish = true; - }); - while (!finish) - { - yield return null; - } - } - - private void CardTemplateCustomize(CardListTemplate template) - { - template.SetBossRushSkillFrame(); - template.HideNum(); - template.HideLabelsForBossRushSkill(); - template.SetBossRushCardTexture(); - } - - private void InitializeCard() - { - BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; - for (int i = 0; i < bossRushBattleData.MaxBattleCount; i++) - { - if (i >= bossRushBattleData.PlayerSkillList.Count) - { - AddEmptyAbilityFrame(); - } - else - { - AddAbilityCardObj(i); - } - } - _bossRushCardGrid.Reposition(); - } - - private void AddEmptyAbilityFrame() - { - NGUITools.AddChild(_bossRushCardGrid.gameObject, _bossRushEmptyFrameOriginal).SetActive(value: true); - } - - private void AddAbilityCardObj(int index) - { - GameObject gameObject = NGUITools.AddChild(_bossRushCardGrid.gameObject, _bossRushCardOriginal); - gameObject.SetActive(value: true); - GameObject cardObj = _bossRushCardLoader.GetCardObjData(index).CardObj; - Vector3 localScale = cardObj.transform.localScale; - cardObj.transform.parent = gameObject.transform; - cardObj.transform.localPosition = Vector3.zero; - cardObj.transform.localScale = localScale; - BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; - UILabel componentInChildren = gameObject.GetComponentInChildren(); - componentInChildren.text = bossRushBattleData.PlayerSkillList[index].Name; - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(componentInChildren, bossRushBattleData.PlayerSkillList[index].IsFoil); - } - - private bool IsBossRushAllWin(bool isWin) - { - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.BossRushQuest) - { - BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; - if (isWin) - { - return bossRushBattleData.CurrentWinCount + 1 >= bossRushBattleData.MaxBattleCount; - } - return false; - } - return false; - } - - public IEnumerator SettingBossRushFinishResultAnimation(bool isWin) - { - BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; - Vector3 finishTitleDefaultPosition = _bossrushFinishTitle.transform.localPosition; - Vector3 winObjDefaultPosition = _bossRushWinCountObj.transform.localPosition; - Vector3 cardGridDefaultPosition = _bossRushCardGrid.transform.localPosition; - _bossrushFinishTitle.gameObject.SetActive(value: false); - _bossRushWinCountObj.gameObject.SetActive(value: false); - _bossRushCardGrid.gameObject.SetActive(value: false); - _bossRushBG.gameObject.SetActive(value: false); - UIWidget[] allWinCountWidget = _bossRushAnimationRoot.GetComponentsInChildren(); - UIWidget[] array = allWinCountWidget; - for (int i = 0; i < array.Length; i++) - { - array[i].alpha = 0f; - } - _bossrushFinishTitle.transform.localPosition = finishTitleDefaultPosition + Vector3.up * 500f; - _bossRushWinCountObj.transform.localPosition = winObjDefaultPosition + Vector3.down * 100f; - _bossRushCardGrid.transform.localPosition = cardGridDefaultPosition + Vector3.down * 500f; - new List(); - _ = GameMgr.GetIns().GetDataMgr().BossRushBattleData.PlayerSkillList; - _bossRushCardRoot.SetActive(value: true); - int num = (isWin ? (bossRushBattleData.CurrentWinCount + 1) : bossRushBattleData.CurrentWinCount); - _bossRushWinCountLabel.text = num.ToString(); - _bossRushClearWinCount.text = num.ToString(); - _bossRushClearLife.text = Data.QuestFinish.data.CurrentLife.ToString(); - _bossRushClearLifeMax.text = "/" + Data.QuestFinish.data.MaxLife; - _bossRushClearLife.ProcessText(); - _bossRushClearLifeMax.ProcessText(); - _bossRushClearLifeGrid.Reposition(); - if (Data.QuestFinish.data.IsEnableBossRushShortestTurn) - { - _bossRushShortestClearTurn.text = Data.QuestFinish.data.BossRushShortestTurn.ToString(); - } - else - { - _bossRushShortestClearTurn.text = Data.SystemText.Get("BossRush_0040"); - } - _bossRushClearTurn.text = Data.QuestFinish.data.BossRushTotalTurn.ToString(); - if (!isWin) - { - _bossRushClearTurn.text = Data.SystemText.Get("BossRush_0040"); - } - _bossRushClearNewRecordLabel.gameObject.SetActive(Data.QuestFinish.data.IsBossRushNewRecord && isWin); - yield return StartCoroutine(LoadBossRushResource()); - InitializeCard(); - _bossrushFinishTitle.spriteName = (isWin ? "result_text_clear" : "result_text_failed"); - _bossrushFinishTitle.alpha = 0f; - _bossRushBG.alpha = 0f; - _bossRushBG.gameObject.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BOSS_RUSH_RESULT_APPEAR); - TweenAlpha.Begin(_battleResultNewControl.Bg.gameObject, 0.2f, 0.5f); - TweenAlpha.Begin(_bossRushBG.gameObject, 0.2f, 1f); - yield return new WaitForSeconds(0.2f); - _bossrushFinishTitle.gameObject.SetActive(value: true); - _bossRushWinCountObj.gameObject.SetActive(value: true); - _bossRushCardGrid.gameObject.SetActive(value: true); - UIManager.GetInstance().AttachAtlas(_bossrushFinishTitle.gameObject, isTargetChildren: false); - TweenAlpha.Begin(_bossrushFinishTitle.gameObject, 0.2f, 1f); - array = allWinCountWidget; - for (int i = 0; i < array.Length; i++) - { - TweenAlpha.Begin(array[i].gameObject, 0.2f, 1f); - } - iTween.MoveTo(_bossrushFinishTitle.gameObject, iTween.Hash("position", finishTitleDefaultPosition, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(_bossRushWinCountObj.gameObject, iTween.Hash("position", winObjDefaultPosition, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(_bossRushCardGrid.gameObject, iTween.Hash("position", cardGridDefaultPosition, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.5f); - GameObject effectObject = null; - if (IsBossRushAllWin(isWin)) - { - effectObject = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_result_bossrush_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - effectObject.transform.SetParent(_bossRushWinCountObj.transform); - effectObject.transform.localPosition = Vector3.zero; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BOSS_RUSH_RESULT_CLEAR); - _loadFileList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectObject, null)); - effectObject.SetActive(value: true); - } - bool isTouchCollider = false; - _bossRushTouchCollider.onClick.Add(new EventDelegate(delegate - { - isTouchCollider = true; - })); - while (!isTouchCollider) - { - yield return null; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BOSS_RUSH_RESULT_MOVE); - if (effectObject != null) - { - Object.Destroy(effectObject); - } - iTween.MoveTo(_bossrushFinishTitle.gameObject, iTween.Hash("position", finishTitleDefaultPosition + Vector3.up * 500f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(_bossRushWinCountObj.gameObject, 0.5f, 0f); - TweenAlpha.Begin(_bossRushBG.gameObject, 0.5f, 0f); - array = allWinCountWidget; - for (int i = 0; i < array.Length; i++) - { - TweenAlpha.Begin(array[i].gameObject, 0.5f, 0f); - } - iTween.MoveTo(_bossRushCardGrid.gameObject, iTween.Hash("position", cardGridDefaultPosition + Vector3.down * 500f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.5f); - _bossRushTouchCollider.gameObject.SetActive(value: false); - IsBossRushTotalResultFinish = true; - } -} diff --git a/SVSim.BattleEngine/Engine/QuestSpecialResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/QuestSpecialResultAnimationAgent.cs deleted file mode 100644 index 7dc7db46..00000000 --- a/SVSim.BattleEngine/Engine/QuestSpecialResultAnimationAgent.cs +++ /dev/null @@ -1,282 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; - -public class QuestSpecialResultAnimationAgent : ResultAnimationAgent -{ - private bool IsBossRushTotalResult(bool isWin) - { - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.BossRushQuest) - { - BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; - bool flag = isWin && bossRushBattleData.CurrentWinCount + 1 >= bossRushBattleData.MaxBattleCount; - return !isWin || flag; - } - return false; - } - - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); - } - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - battleResultControl.SetBackGroundNeedBattlePoint(needBattlePoint: true); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); - } - if (BattleManagerBase.GetIns().IsPuzzleMgr && !isWin) - { - battleResultControl.SetBattlePassGauge(delegate - { - battleResultControl.FinishResult(); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.QuestSelectionPage); - }); - yield break; - } - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - if (ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.QuestBattleResultObject._questPointInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["QuestPointInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - PlayWinVoice(); - } - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - yield return PlayUpdateGaugeSe(); - } - yield return new WaitForSeconds(0.5f); - } - if (Data.QuestFinish.data.AddPoint != 0) - { - battleResultControl.QuestBattleResultObject.SettingAddQuestPointTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - yield return PlayUpdateGaugeSe(); - } - yield return new WaitForSeconds(0.5f); - } - if (Data.QuestFinish.data.WinBonusPoint > 0) - { - battleResultControl.QuestBattleResultObject.AddWinBonusQuestPoint(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - yield return PlayUpdateGaugeSe(); - } - yield return new WaitForSeconds(0.5f); - } - if (Data.QuestFinish.data.GetTotalBonusPoint() > 0) - { - battleResultControl.QuestBattleResultObject.SettingAddBounusQuestPointTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - yield return PlayUpdateGaugeSe(); - } - yield return new WaitForSeconds(0.5f); - } - if (Data.QuestFinish.data.CommonMissionClearInfoList.Count > 0) - { - battleResultControl.QuestBattleResultObject.SettingAddCommonMissionQuestPointTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - yield return PlayUpdateGaugeSe(); - } - yield return new WaitForSeconds(0.5f); - } - if (Data.QuestFinish.data.CharacterMissionClearInfoList.Count > 0) - { - battleResultControl.QuestBattleResultObject.SettingAddCharacterMissionQuestPointTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - yield return PlayUpdateGaugeSe(); - } - yield return new WaitForSeconds(0.5f); - } - if (IsBossRushTotalResult(isWin)) - { - StartCoroutine(battleResultControl.QuestBattleResultObject.SettingBossRushFinishResultAnimation(isWin)); - } - yield return battleResultControl.QuestBattleResultObject.PlayAnimationCoroutine(); - yield return PlayBattlePassGaugeCoroutine(battleResultControl); - yield return OpenHomeDialogCoroutine(Data.QuestFinish.data.HomeDialogData); - if (IsBossRushTotalResult(isWin)) - { - while (!battleResultControl.QuestBattleResultObject.IsBossRushTotalResultFinish) - { - yield return null; - } - } - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - GameMgr.GetIns().GetDataMgr().SetPlayerEmotionId(string.Empty); - GameMgr.GetIns().GetDataMgr().SetEnemyEmotionId(string.Empty); - } - - private IEnumerator PlayUpdateGaugeSe() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - - private IEnumerator PlayBattlePassGaugeCoroutine(BattleResultUIController controller) - { - bool isFinished = false; - controller.SetBattlePassGauge(delegate - { - isFinished = true; - }); - while (!isFinished) - { - yield return null; - } - } - - private IEnumerator OpenHomeDialogCoroutine(MyPageHomeDialogData dialogData) - { - if (dialogData != null && dialogData.IsEnable) - { - bool isClosed = false; - MyPageHomeDialog.Create(UIManager.GetInstance().HomeDialogPrefab, dialogData, delegate - { - isClosed = true; - }); - while (!isClosed) - { - yield return null; - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/QuestSpecialResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/QuestSpecialResultAnimationHandler.cs deleted file mode 100644 index c694e87b..00000000 --- a/SVSim.BattleEngine/Engine/QuestSpecialResultAnimationHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -using UnityEngine; - -public class QuestSpecialResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject _resultAnimationAgentObj; - - private readonly QuestSpecialResultAnimationAgent _resultAnimationAgentIns; - - private readonly QuestSpecialBattleResult _resultUI; - - public ResultAnimationAgent m_resultAnimationAgent => _resultAnimationAgentIns; - - public QuestSpecialResultAnimationHandler(BattleCamera battleCamera, QuestSpecialBattleResult resultUI) - { - _resultAnimationAgentObj = new GameObject(); - _resultAnimationAgentIns = _resultAnimationAgentObj.AddComponent(); - _resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - _resultUI = resultUI; - UIManager.GetInstance().StartCoroutine(resultUI.LoadCoroutine()); - } - - public void Destroy() - { - _resultUI.Unload(); - Object.Destroy(_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/QuestStageIdFilter.cs b/SVSim.BattleEngine/Engine/QuestStageIdFilter.cs index cbedc14d..69db2966 100644 --- a/SVSim.BattleEngine/Engine/QuestStageIdFilter.cs +++ b/SVSim.BattleEngine/Engine/QuestStageIdFilter.cs @@ -2,7 +2,7 @@ public class QuestStageIdFilter : ISkillEnvironmentalFilter { public int Filtering(IBattlePlayerReadOnlyInfo playerInfo, SkillConditionCheckerOption option) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr if (dataMgr.m_BattleType != DataMgr.BattleType.Quest) { return -1; @@ -12,7 +12,7 @@ public class QuestStageIdFilter : ISkillEnvironmentalFilter public int FilteringPrePlay(IBattlePlayerReadOnlyInfo playerInfo, SkillConditionCheckerOption option) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr if (dataMgr.m_BattleType != DataMgr.BattleType.Quest) { return -1; diff --git a/SVSim.BattleEngine/Engine/RandomValueFilter.cs b/SVSim.BattleEngine/Engine/RandomValueFilter.cs index e3182568..b90b0bb3 100644 --- a/SVSim.BattleEngine/Engine/RandomValueFilter.cs +++ b/SVSim.BattleEngine/Engine/RandomValueFilter.cs @@ -9,7 +9,7 @@ public class RandomValueFilter : ISkillEnvironmentalFilter public int Filtering(IBattlePlayerReadOnlyInfo playerInfo, SkillConditionCheckerOption option) { - return BattleManagerBase.GetIns().StableRandom(_range); + return 0; // Pre-Phase-5b: RandomValueFilter is skill-condition-checker only headless } public int FilteringPrePlay(IBattlePlayerReadOnlyInfo playerInfo, SkillConditionCheckerOption option) diff --git a/SVSim.BattleEngine/Engine/RankInfo.cs b/SVSim.BattleEngine/Engine/RankInfo.cs deleted file mode 100644 index 49bab1b4..00000000 --- a/SVSim.BattleEngine/Engine/RankInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -using LitJson; - -public class RankInfo : HeaderData -{ - public int RankId; - - public string rank_name; - - public int necessary_point; - - public int accumulate_point; - - public int match_count; - - public int necessary_win; - - public int reset_lose; - - public int _necessaryMasterPoint; - - public RankInfo(JsonData json) - { - RankId = json["rank_id"].ToInt(); - rank_name = json["rank_name"].ToString(); - necessary_point = json["necessary_point"].ToInt(); - accumulate_point = json["accumulate_point"].ToInt(); - match_count = json["match_count"].ToInt(); - necessary_win = json["necessary_win"].ToInt(); - reset_lose = json["reset_lose"].ToInt(); - } -} diff --git a/SVSim.BattleEngine/Engine/RankMatchBattleResult.cs b/SVSim.BattleEngine/Engine/RankMatchBattleResult.cs deleted file mode 100644 index 1b78cf00..00000000 --- a/SVSim.BattleEngine/Engine/RankMatchBattleResult.cs +++ /dev/null @@ -1,778 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class RankMatchBattleResult : MonoBehaviour -{ - protected enum RankMatchResultState - { - NONE, - RANK_UP_END, - RANK_DOWN_END, - TIER_UP_END - } - - [SerializeField] - private BattleResultUIController _battleResultNewControl; - - [SerializeField] - public UIButton BgBtn; - - [SerializeField] - public UISprite TitleFailed; - - [SerializeField] - public NguiObjs WinsObj; - - [Header("ランク情報")] - [SerializeField] - public GameObject RankInfo; - - [SerializeField] - protected UITexture RankIcon; - - [SerializeField] - protected GameObject RankGaugeParent; - - [SerializeField] - protected UIGauge RankGaugeBar; - - [SerializeField] - public ParticleSystem RankGaugeEfc; - - [SerializeField] - protected UILabel RankExpTitle; - - [SerializeField] - protected UILabel RankExpLabel; - - [SerializeField] - public UILabel RankExpAddLabel; - - [SerializeField] - protected UILabel RankExpNextTitle; - - [SerializeField] - protected UILabel RankExpNextLabel; - - [SerializeField] - public UILabel RankExpBonusTitle; - - [SerializeField] - public UILabel RankExpBonusLabel; - - [SerializeField] - public UILabel RankExpBonusInfo; - - [SerializeField] - protected UILabel _formatLabel; - - [Header("ランク昇格降格")] - [SerializeField] - protected UITexture DivRankIcon; - - [SerializeField] - protected UITexture TierRankIcon; - - [SerializeField] - protected UISprite TierUpFrontImg; - - [SerializeField] - public UISprite BlackBg; - - [SerializeField] - public GameObject DivPanel; - - [SerializeField] - protected UISprite DivPanelBg; - - [SerializeField] - protected UISprite RankUpImg; - - [SerializeField] - protected UISprite RankDownImg; - - [SerializeField] - public UISprite PromoTitle; - - [SerializeField] - public UITexture PromoRankIcon; - - [SerializeField] - public GameObject PromoPanel; - - [SerializeField] - protected UIGrid PromoOrbGrid; - - [SerializeField] - protected NguiObjs[] PromoOrbList; - - [SerializeField] - protected UISprite PromoOrbLine; - - protected RankMatchResultState resultState; - - private int _rankLv; - - private int _rankLvPrev; - - private int _rankLvMax; - - private int _rankExp; - - private int _nowRankExp; - - private int _nextRankExp; - - private int _beforeRankExp; - - private IList _rankExpList = new List(); - - private List _rankInfoList = new List(); - - private int _cumulativeBattlePointToMaster; - - private bool _isRankFix; - - private SystemText _wizardText; - - private const float WIN_LABEL_POSITION_Y = -11f; - - [NonSerialized] - public bool IsRunUIStop; - - public bool IsPromoNow { get; private set; } - - public bool IsPromoPrev { get; private set; } - - public int BeforeRankLv { get; private set; } - - public int WinCount { get; private set; } - - public int BasicExp_and_SuperiorBonus => Data.RankMatchFinish.data.BasicExp_and_SuperiorBonus; - - public int RankExpBonus { get; private set; } - - public void Init() - { - TitleFailed.alpha = 0f; - _wizardText = Data.SystemText; - _battleResultNewControl.DefaultPosDict["RankInfo"] = RankInfo.transform.localPosition; - _battleResultNewControl.DefaultPosDict["TierUpFrontImg"] = TierUpFrontImg.transform.localPosition; - _battleResultNewControl.DefaultPosDict["PromoTitle"] = PromoTitle.transform.localPosition; - _battleResultNewControl.DefaultPosDict["PromoRankIcon"] = PromoRankIcon.transform.localPosition; - _battleResultNewControl.DefaultPosDict["PromoPanel"] = PromoPanel.transform.localPosition; - _formatLabel.text = UIUtil.GetFormatName(Data.CurrentFormat); - if (Data.CurrentFormat == Format.Rotation) - { - _formatLabel.text = Data.SystemText.Get("Common_0187"); - } - DivRankIcon.alpha = 0f; - TierRankIcon.alpha = 0f; - TierUpFrontImg.alpha = 0f; - BlackBg.alpha = 0f; - BgBtn.onClick.Clear(); - BgBtn.onClick.Add(new EventDelegate(delegate - { - OnClickBgBtn(); - })); - BgBtn.gameObject.SetActive(value: false); - } - - public void ResultSetupEnd(Format format) - { - PromoTitle.transform.localPosition = _battleResultNewControl.DefaultPosDict["PromoTitle"] + Vector3.up * 500f; - PromoPanel.transform.localPosition = _battleResultNewControl.DefaultPosDict["PromoPanel"] + Vector3.down * 600f; - RankInfo.transform.localPosition = _battleResultNewControl.DefaultPosDict["RankInfo"] + Vector3.left * 2000f; - RankInfo.gameObject.SetActive(value: true); - BgBtn.gameObject.SetActive(value: true); - DivPanel.SetActive(value: false); - RankExpAddLabel.alpha = 0f; - RankExpBonusTitle.alpha = 0f; - RankExpBonusLabel.alpha = 0f; - RankExpBonusInfo.alpha = 0f; - WinsObj.labels[0].alpha = 0f; - WinsObj.labels[1].alpha = 0f; - BlackBg.alpha = 0f; - PromoRankIcon.alpha = 0f; - bool flag = !PlayerStaticData.IsMaxRank(format); - if (!UserRank.IsGrandMasterAvailability) - { - flag = !PlayerStaticData.IsMasterRank(format); - } - RankExpNextTitle.text = Data.SystemText.Get("Battle_0206"); - RankExpBonusTitle.text = Data.SystemText.Get("Battle_0208"); - WinsObj.labels[1].text = Data.SystemText.Get("Battle_0466"); - RankExpBonusInfo.text = Data.SystemText.Get("Battle_0465"); - RankExpTitle.text = Data.SystemText.Get(PlayerStaticData.IsMasterRank(format) ? "Common_0048" : "Common_0047"); - RankGaugeParent.SetActive(flag && !PlayerStaticData.IsGrandMasterRank(format)); - RankExpNextTitle.gameObject.SetActive(flag); - RankExpNextLabel.gameObject.SetActive(flag); - } - - public void GetServerData() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - RankMatchFinishDetail data = Data.RankMatchFinish.data; - BeforeRankLv = (_rankLvPrev = PlayerStaticData.UserRankCurrentFormat()); - IsPromoPrev = Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.match_count > 0; - Data.Load.data._userRank[(int)Data.CurrentFormat].rank = data.UserRank; - PlayerStaticData.UserPromotionFlag = Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.is_promotion; - IsPromoNow = PlayerStaticData.UserPromotionFlag; - if (!IsPromoPrev && IsPromoNow) - { - _isRankFix = true; - } - else if (IsPromoPrev && IsPromoNow) - { - _isRankFix = true; - } - else if (IsPromoPrev && !IsPromoNow) - { - if (_battleResultNewControl.IsWin) - { - _isRankFix = false; - } - else - { - _isRankFix = true; - } - } - else - { - _isRankFix = false; - } - if (BeforeRankLv != PlayerStaticData.UserRankCurrentFormat()) - { - PlayerStaticData.LoadUserRankTexture(Data.CurrentFormat); - } - WinCount = data.SuccessiveWinNumber; - WinsObj.labels[0].text = WinCount.ToString(); - WinsObj.GetComponent().Reposition(); - RankExpBonus = data.SuccessiveWinBonus; - Vector3 localPosition = WinsObj.labels[1].transform.localPosition; - localPosition.y = -11f; - WinsObj.labels[1].transform.localPosition = localPosition; - Format format = Data.CurrentFormat; - if (dataMgr.IsDipslayHighRankFormat()) - { - format = PlayerStaticData.HighRankFormat(); - } - if (format == Format.PreRotation) - { - format = Format.Rotation; - } - _beforeRankExp = (PlayerStaticData.IsMasterRank(format) ? PlayerStaticData.UserMasterPoint(format) : PlayerStaticData.UserBattlePoint(format)); - if (dataMgr.IsFormatEnableBattleType() && UserRank.IsGrandMasterAvailability && PlayerStaticData.IsMasterRank(format) && !PlayerStaticData.IsMaxRank(format)) - { - int num = PlayerStaticData.UserBattlePointEachRankCurrentFormat(); - int num2 = data.AfterMasterPoint - PlayerStaticData.UserMasterPointCurrentFormat(); - _beforeRankExp = num - num2; - } - _rankExpList.Clear(); - _rankInfoList = Data.Load.data.RankInfoList; - bool flag = true; - if (Data.CurrentFormat == Format.Crossover) - { - _rankInfoList = Data.Crossover.GetRankInfoRawList(); - flag = false; - } - if (dataMgr.IsFormatEnableBattleType()) - { - for (int i = 0; i < _rankInfoList.Count; i++) - { - if (flag && i >= 24) - { - _rankExpList.Add(_rankInfoList[i]._necessaryMasterPoint); - } - else - { - _rankExpList.Add(_rankInfoList[i].necessary_point); - } - } - } - _rankLvMax = _rankInfoList[_rankInfoList.Count - 1].RankId; - if (dataMgr.IsFormatEnableBattleType() && PlayerStaticData.IsMasterRankCurrentFormat()) - { - _cumulativeBattlePointToMaster = 0; - _cumulativeBattlePointToMaster = 0; - for (int j = 0; j < _rankInfoList.Count; j++) - { - _cumulativeBattlePointToMaster += _rankInfoList[j].necessary_point; - } - _rankExp += _cumulativeBattlePointToMaster; - } - SetRankExp(0, isLvUpCheck: false); - if (dataMgr.m_BattleType != DataMgr.BattleType.RankBattle) - { - return; - } - if (PlayerStaticData.IsMasterRankCurrentFormat()) - { - Data.Load.data._userRank[(int)Data.CurrentFormat].master_point = Data.RankMatchFinish.data.AfterMasterPoint; - if (Data.CurrentFormat == Format.Crossover) - { - Data.Load.data._userRank[(int)Data.CurrentFormat].grandMasterData.currentMasterPoint = Data.RankMatchFinish.data.AfterMasterPoint; - } - } - else - { - Data.Load.data._userRank[(int)Data.CurrentFormat].battle_point = Data.RankMatchFinish.data.AfterBattlePoint; - } - RankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(BeforeRankLv.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - } - - public IEnumerator RunTierUp() - { - RankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(PlayerStaticData.UserRankCurrentFormat().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - TierRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(BeforeRankLv.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - if (BeforeRankLv == 25) - { - RankGaugeParent.SetActive(value: false); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_SUCCES_2); - TweenAlpha.Begin(TierRankIcon.gameObject, 0.5f, 1f); - TierRankIcon.transform.localScale = Vector3.one * 0.05f; - iTween.ScaleTo(TierRankIcon.gameObject, iTween.Hash("scale", Vector3.one, "time", 1f, "easetype", iTween.EaseType.easeInExpo)); - iTween.RotateBy(TierRankIcon.gameObject, iTween.Hash("y", 360f, "time", 1f, "easetype", iTween.EaseType.linear)); - yield return new WaitForSeconds(1f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TIERUP_1, Vector3.back); - TierRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath((BeforeRankLv + 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - TweenAlpha.Begin(TierUpFrontImg.gameObject, 0.5f, 1f); - TierUpFrontImg.transform.localPosition = _battleResultNewControl.DefaultPosDict["TierUpFrontImg"] + Vector3.down * 60f; - iTween.MoveTo(TierUpFrontImg.gameObject, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["TierUpFrontImg"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(1f); - resultState = RankMatchResultState.TIER_UP_END; - } - - public IEnumerator RunMatchUI() - { - PromoRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath((BeforeRankLv + 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - int match_count = Data.Load.data.GetRankInfo(Data.CurrentFormat, BeforeRankLv).match_count; - for (int i = 0; i < PromoOrbList.Length; i++) - { - if (i < match_count) - { - PromoOrbList[i].gameObject.SetActive(value: true); - if (i < PlayerStaticData.UserPromotionMatchCount - 1) - { - if (PlayerStaticData.UserPromotionIsWin(i)) - { - PromoOrbList[i].sprites[0].spriteName = "orb_win"; - PromoOrbList[i].labels[1].gameObject.SetActive(value: true); - PromoOrbList[i].labels[2].gameObject.SetActive(value: false); - } - else - { - PromoOrbList[i].sprites[0].spriteName = "orb_lose"; - PromoOrbList[i].labels[1].gameObject.SetActive(value: false); - PromoOrbList[i].labels[2].gameObject.SetActive(value: true); - } - } - else - { - if (i != PlayerStaticData.UserPromotionMatchCount - 1) - { - PromoOrbList[i].sprites[0].width = 38; - } - PromoOrbList[i].sprites[0].spriteName = "orb_empty"; - PromoOrbList[i].labels[1].gameObject.SetActive(value: false); - PromoOrbList[i].labels[2].gameObject.SetActive(value: false); - } - PromoOrbList[i].labels[0].text = _wizardText.Get("Battle_0209", (i + 1).ToString()); - } - else - { - PromoOrbList[i].gameObject.SetActive(value: false); - } - PromoOrbGrid.cellWidth = 500f / (float)match_count; - PromoOrbGrid.Reposition(); - } - PromoOrbLine.rightAnchor.target = PromoOrbList[match_count - 1].transform; - PromoOrbLine.ResetAnchors(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE); - TweenAlpha.Begin(BlackBg.gameObject, 0.5f, 0.5f); - iTween.MoveTo(PromoTitle.gameObject, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["PromoTitle"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(PromoRankIcon.gameObject, 0.5f, 1f); - PromoRankIcon.transform.localPosition = _battleResultNewControl.DefaultPosDict["PromoRankIcon"] + Vector3.down * 40f; - iTween.MoveTo(PromoRankIcon.gameObject, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["PromoRankIcon"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.MoveTo(PromoPanel, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["PromoPanel"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (_battleResultNewControl.IsWin) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WIN); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_ORB_1, PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].sprites[0].transform.position); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_LOSE); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_ORB_2, PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].sprites[0].transform.position); - } - yield return new WaitForSeconds(0.5f); - if (_battleResultNewControl.IsWin) - { - PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].sprites[0].spriteName = "orb_win"; - PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[1].gameObject.SetActive(value: true); - PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[1].alpha = 0f; - iTween.MoveFrom(PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[1].gameObject, iTween.Hash("y", PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[1].transform.localPosition.y - 10f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - TweenAlpha.Begin(PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[1].gameObject, 0.5f, 1f); - } - else - { - PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].sprites[0].spriteName = "orb_lose"; - PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[2].gameObject.SetActive(value: true); - iTween.MoveFrom(PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[2].gameObject, iTween.Hash("y", PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[2].transform.localPosition.y + 10f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - TweenAlpha.Begin(PromoOrbList[PlayerStaticData.UserPromotionMatchCount - 1].labels[2].gameObject, 0.5f, 1f); - } - yield return new WaitForSeconds(1.5f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE); - TweenAlpha.Begin(BlackBg.gameObject, 0.5f, 0f); - TweenAlpha.Begin(PromoRankIcon.gameObject, 0.5f, 0f); - iTween.MoveTo(PromoTitle.gameObject, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["PromoTitle"] + Vector3.up * 500f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.MoveTo(PromoPanel, iTween.Hash("position", _battleResultNewControl.DefaultPosDict["PromoPanel"] + Vector3.down * 600f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - yield return new WaitForSeconds(1f); - } - - public IEnumerator RunRankUp() - { - DivRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(BeforeRankLv.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE); - DivPanel.SetActive(value: true); - RankUpImg.alpha = 0f; - RankDownImg.alpha = 0f; - TweenAlpha.Begin(BlackBg.gameObject, 0.5f, 0.5f); - DivPanelBg.transform.localScale = new Vector3(1f, 0.01f, 1f); - iTween.ScaleTo(DivPanelBg.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(DivRankIcon.gameObject, 0.5f, 1f); - DivRankIcon.transform.localPosition = new Vector3(0f, 60f, -200f); - iTween.MoveTo(DivRankIcon.gameObject, iTween.Hash("y", 80f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_SUCCESS); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_RANKUP_1, DivRankIcon.transform.position); - yield return new WaitForSeconds(0.5f); - DivRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath((BeforeRankLv + 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - TweenAlpha.Begin(RankUpImg.gameObject, 0.5f, 1f); - RankUpImg.transform.localPosition = new Vector3(0f, -140f, 0f); - iTween.MoveTo(RankUpImg.gameObject, iTween.Hash("y", -120f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - resultState = RankMatchResultState.RANK_UP_END; - } - - private IEnumerator EndRankUp() - { - resultState = RankMatchResultState.NONE; - GameMgr.GetIns().GetEffectMgr().FadeStop(EffectMgr.EffectType.CMN_RESULT_RANKUP_1); - TweenAlpha.Begin(DivRankIcon.gameObject, 0.5f, 0f); - TweenAlpha.Begin(RankUpImg.gameObject, 0.5f, 0f); - yield return new WaitForSeconds(0.2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE); - TweenAlpha.Begin(BlackBg.gameObject, 0.5f, 0f); - iTween.ScaleTo(DivPanelBg.gameObject, iTween.Hash("y", 0.01f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0.5f); - RankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath((BeforeRankLv + 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - RankIcon.transform.localScale = Vector3.one * 0.5f; - iTween.ScaleTo(RankIcon.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.5f, "easetype", iTween.EaseType.easeOutBack)); - DivPanel.SetActive(value: false); - IsRunUIStop = false; - } - - public IEnumerator RunRankDown() - { - DivRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(BeforeRankLv.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE); - DivPanel.SetActive(value: true); - RankUpImg.alpha = 0f; - RankDownImg.alpha = 0f; - TweenAlpha.Begin(BlackBg.gameObject, 0.5f, 0.5f); - DivPanelBg.transform.localScale = new Vector3(1f, 0.01f, 1f); - iTween.ScaleTo(DivPanelBg.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(DivRankIcon.gameObject, 0.5f, 1f); - DivRankIcon.transform.localPosition = new Vector3(0f, 60f, -200f); - iTween.MoveTo(DivRankIcon.gameObject, iTween.Hash("y", 80f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_RANK_DOWN); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_RANKDOWN_1, DivRankIcon.transform.position); - yield return new WaitForSeconds(0.5f); - DivRankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath((BeforeRankLv - 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - TweenAlpha.Begin(RankDownImg.gameObject, 0.5f, 1f); - RankDownImg.transform.localPosition = new Vector3(0f, -100f, 0f); - iTween.MoveTo(RankDownImg.gameObject, iTween.Hash("y", -120f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - resultState = RankMatchResultState.RANK_DOWN_END; - } - - private IEnumerator EndRankDown() - { - resultState = RankMatchResultState.NONE; - GameMgr.GetIns().GetEffectMgr().FadeStop(EffectMgr.EffectType.CMN_RESULT_RANKDOWN_1); - TweenAlpha.Begin(DivRankIcon.gameObject, 0.5f, 0f); - TweenAlpha.Begin(RankDownImg.gameObject, 0.5f, 0f); - yield return new WaitForSeconds(0.2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE); - TweenAlpha.Begin(BlackBg.gameObject, 0.5f, 0f); - iTween.ScaleTo(DivPanelBg.gameObject, iTween.Hash("y", 0.01f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0.5f); - RankIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath((BeforeRankLv - 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L, isfetch: true)); - RankIcon.transform.localScale = Vector3.one * 0.5f; - iTween.ScaleTo(RankIcon.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.5f, "easetype", iTween.EaseType.easeOutBack)); - DivPanel.SetActive(value: false); - IsRunUIStop = false; - } - - private IEnumerator EndTierUp() - { - resultState = RankMatchResultState.NONE; - GameMgr.GetIns().GetEffectMgr().FadeStop(EffectMgr.EffectType.CMN_RESULT_TIERUP_1); - TweenAlpha.Begin(TierRankIcon.gameObject, 0.5f, 0f); - TweenAlpha.Begin(TierUpFrontImg.gameObject, 0.5f, 0f); - yield return new WaitForSeconds(0.5f); - IsRunUIStop = false; - } - - public IEnumerator RunFailed() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_FAILED); - TweenAlpha.Begin(TitleFailed.gameObject, 0.5f, 1f); - TitleFailed.transform.localPosition = new Vector3(0f, 50f, 0f); - iTween.MoveTo(TitleFailed.gameObject, iTween.Hash("y", 0f, "time", 3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_FAILED_1, Vector3.back); - yield return new WaitForSeconds(2.5f); - TweenAlpha.Begin(TitleFailed.gameObject, 0.5f, 0f); - yield return new WaitForSeconds(0.5f); - } - - public void SetRankExp(int num, bool isLvUpCheck) - { - if (GameMgr.GetIns().GetDataMgr().IsFormatEnableBattleType()) - { - _rankExp = _beforeRankExp + num; - if (UserRank.IsGrandMasterAvailability && PlayerStaticData.IsMasterRankCurrentFormat()) - { - _rankExp += _cumulativeBattlePointToMaster; - } - _rankLv = GetRankLv(_rankExp); - int rankIndexFromRankID = GetRankIndexFromRankID(_rankLv); - _nowRankExp = GetRankExpNow(_rankExp); - CorrectGrandMasterRankLvAndExpNow(); - _nextRankExp = Mathf.Max(0, _rankExpList[rankIndexFromRankID] - _nowRankExp); - if (PlayerStaticData.IsMasterRankCurrentFormat()) - { - RankExpLabel.text = (_beforeRankExp + num).ToString(); - } - else - { - RankExpLabel.text = _rankExp.ToString(); - } - RankExpNextLabel.text = (IsMaxRank(_rankLv) ? "-" : _nextRankExp.ToString()); - if (BasicExp_and_SuperiorBonus >= 0) - { - RankExpAddLabel.text = ((BasicExp_and_SuperiorBonus - num >= 0) ? "+" : "") + (BasicExp_and_SuperiorBonus - num); - } - else - { - RankExpAddLabel.text = (BasicExp_and_SuperiorBonus - num).ToString(); - } - RankGaugeBar.Value = Mathf.Min((float)_nowRankExp / (float)_rankExpList[rankIndexFromRankID], 1f); - if (isLvUpCheck && _rankLv > _rankLvPrev) - { - PlayRankUpGaugeEffect(); - _rankLvPrev = _rankLv; - } - } - } - - private bool IsMaxRank(int rank) - { - if (Data.CurrentFormat == Format.Crossover) - { - return Data.Crossover.IsMaxRank(rank); - } - return rank >= Data.Load.data.RankInfoList.Count; - } - - private void SetRankExpBonus(int num) - { - _rankExp = Mathf.Min(_beforeRankExp + BasicExp_and_SuperiorBonus + num, Data.RankMatchFinish.data.AfterExp); - RankExpLabel.text = _rankExp.ToString(); - if (UserRank.IsGrandMasterAvailability && PlayerStaticData.IsMasterRankCurrentFormat()) - { - _rankExp += _cumulativeBattlePointToMaster; - } - _rankLv = GetRankLv(_rankExp); - _nowRankExp = GetRankExpNow(_rankExp); - int rankIndexFromRankID = GetRankIndexFromRankID(_rankLv); - CorrectGrandMasterRankLvAndExpNow(); - _nextRankExp = Mathf.Max(0, _rankExpList[rankIndexFromRankID] - _nowRankExp); - RankExpNextLabel.text = (PlayerStaticData.IsMaxRank(Data.CurrentFormat) ? "-" : _nextRankExp.ToString()); - RankExpBonusLabel.text = ((RankExpBonus - num >= 0) ? "+" : "") + (RankExpBonus - num); - RankGaugeBar.Value = Mathf.Min((float)_nowRankExp / (float)_rankExpList[rankIndexFromRankID], 1f); - if (_rankLv > _rankLvPrev) - { - PlayRankUpGaugeEffect(); - _rankLvPrev = _rankLv; - } - } - - private void CorrectGrandMasterRankLvAndExpNow() - { - if (UserRank.IsGrandMasterAvailability && PlayerStaticData.IsGrandMasterRankCurrentFormat() && _rankLv < _rankLvPrev) - { - for (int num = _rankLvPrev; num > _rankLv; num--) - { - _nowRankExp -= _rankExpList[num - 1]; - } - _rankLv = _rankLvPrev; - } - } - - private void PlayRankUpGaugeEffect() - { - if (!PlayerStaticData.IsGrandMasterRankCurrentFormat()) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_2, RankGaugeBar.GetTransformGaugeStartEdge().position); - } - } - - public void SettingAddRankExpTextAnimation() - { - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", BasicExp_and_SuperiorBonus, "time", 0.5f, "delay", 0.5f, "onstart", "StartRankExp", "onupdate", "UpdateRankExp", "oncomplete", "CompleteRankExp", "easetype", iTween.EaseType.easeOutQuad)); - bool flag = BasicExp_and_SuperiorBonus >= 0; - RankExpAddLabel.text = (flag ? "+" : string.Empty) + BasicExp_and_SuperiorBonus; - RankExpAddLabel.color = (flag ? BattleResultUIController.PLUS_START_COLOR : BattleResultUIController.MINUS_START_COLOR); - TweenAlpha.Begin(RankExpAddLabel.gameObject, 0.3f, 1f); - iTween.MoveFrom(RankExpAddLabel.gameObject, iTween.Hash("y", RankExpAddLabel.transform.localPosition.y - 10f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void AddRankExpBonus() - { - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", RankExpBonus, "time", 0.5f, "delay", 0.5f, "onstart", "StartRankExpBonus", "onupdate", "UpdateRankExpBonus", "oncomplete", "CompleteRankExpBonus", "easetype", iTween.EaseType.easeOutQuad)); - RankExpBonusTitle.alpha = 1f; - RankExpBonusLabel.text = ((RankExpBonus >= 0) ? "+" : "") + RankExpBonus; - RankExpBonusLabel.color = BattleResultUIController.PLUS_END_COLOR; - iTween.MoveFrom(RankExpBonusTitle.gameObject, iTween.Hash("x", RankExpBonusTitle.transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - TweenAlpha.Begin(RankExpBonusInfo.gameObject, 0.3f, 1f).delay = 0.1f; - iTween.MoveFrom(RankExpBonusInfo.gameObject, iTween.Hash("x", RankExpBonusInfo.transform.localPosition.x - 50f, "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private void StartRankExp() - { - RankGaugeEfc.gameObject.SetActive(value: true); - RankGaugeEfc.Play(); - } - - private void StartRankExpBonus() - { - RankGaugeEfc.gameObject.SetActive(value: true); - RankGaugeEfc.Play(); - } - - private void UpdateRankExp(int num) - { - SetRankExp(num, isLvUpCheck: true); - } - - private void UpdateRankExpBonus(int num) - { - SetRankExpBonus(num); - } - - private void CompleteRankExp() - { - RankGaugeEfc.Stop(); - TweenAlpha.Begin(RankExpAddLabel.gameObject, 0.5f, 0f).delay = 0.5f; - } - - private void CompleteRankExpBonus() - { - RankGaugeEfc.Stop(); - TweenAlpha.Begin(RankExpBonusTitle.gameObject, 0.5f, 0f).delay = 0.5f; - TweenAlpha.Begin(RankExpBonusLabel.gameObject, 0.5f, 0f).delay = 0.5f; - } - - private int GetRankIndexFromRankID(int rankID) - { - for (int i = 0; i < _rankInfoList.Count; i++) - { - if (_rankInfoList[i].RankId == rankID) - { - return i; - } - } - Debug.LogError("未知のランクID:" + rankID); - return 0; - } - - private int GetRankLv(int currentExp) - { - int num = 1; - int num2 = 0; - if (_isRankFix) - { - num = _rankLvPrev; - } - else - { - num = _rankInfoList[0].RankId; - for (int i = 0; i < _rankExpList.Count; i++) - { - num2 += _rankExpList[i]; - if (currentExp < num2) - { - break; - } - num = _rankInfoList[i].RankId + 1; - } - } - return Mathf.Min(num, _rankLvMax); - } - - private int GetRankExpNow(int currentExp) - { - int num2; - if (_isRankFix) - { - int num = _rankLv - 1; - if (Data.CurrentFormat == Format.Crossover) - { - num = _rankLv - Data.Crossover.GetRankInfoRawList()[0].RankId; - } - num2 = currentExp; - for (int i = 0; i < num; i++) - { - num2 -= _rankExpList[i]; - } - num2 = Mathf.Min(num2, _rankExpList[num]); - } - else - { - num2 = currentExp; - for (int j = 0; j < _rankExpList.Count && num2 >= _rankExpList[j]; j++) - { - num2 -= _rankExpList[j]; - } - } - return num2; - } - - private void OnClickBgBtn() - { - switch (resultState) - { - case RankMatchResultState.RANK_UP_END: - StartCoroutine(EndRankUp()); - break; - case RankMatchResultState.RANK_DOWN_END: - StartCoroutine(EndRankDown()); - break; - case RankMatchResultState.TIER_UP_END: - StartCoroutine(EndTierUp()); - break; - } - } -} diff --git a/SVSim.BattleEngine/Engine/RankMatchFinishDetail.cs b/SVSim.BattleEngine/Engine/RankMatchFinishDetail.cs index 6d13138b..4fb8c3da 100644 --- a/SVSim.BattleEngine/Engine/RankMatchFinishDetail.cs +++ b/SVSim.BattleEngine/Engine/RankMatchFinishDetail.cs @@ -4,44 +4,4 @@ using Wizard; public class RankMatchFinishDetail : MatchFinishBase { public MyPageHomeDialogData HomeDialogData; - - public int UserRank { get; set; } - - public int AfterBattlePoint { get; set; } - - public int AfterMasterPoint { get; set; } - - public int BasicBattlePoint_and_SuperiorBonus { private get; set; } - - public int BasicMasterPoint_and_SuperiorBonus { private get; set; } - - public int SuccessiveWinNumber { get; set; } - - public int SuccessiveWinBonus { get; set; } - - public int AfterExp - { - get - { - if (!PlayerStaticData.IsMasterRankCurrentFormat()) - { - return AfterBattlePoint; - } - return AfterMasterPoint; - } - } - - public int BasicExp_and_SuperiorBonus - { - get - { - if (!PlayerStaticData.IsMasterRankCurrentFormat()) - { - return BasicBattlePoint_and_SuperiorBonus; - } - return BasicMasterPoint_and_SuperiorBonus; - } - } - - public DateTime? SpeedChallengeAnnounceTime { get; set; } } diff --git a/SVSim.BattleEngine/Engine/RankMatchResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/RankMatchResultAnimationAgent.cs deleted file mode 100644 index 6aa7e3b2..00000000 --- a/SVSim.BattleEngine/Engine/RankMatchResultAnimationAgent.cs +++ /dev/null @@ -1,351 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; -using Wizard.UI.Dialog; - -public class RankMatchResultAnimationAgent : ResultAnimationAgent -{ - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); - } - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - RankMatchBattleResult rankMatchBattleResult = battleResultControl.RankMatchBattleResultObject; - RankInfo matchInfo = Data.Load.data.GetRankInfo(Data.CurrentFormat, rankMatchBattleResult.BeforeRankLv); - if (!rankMatchBattleResult.IsPromoPrev) - { - battleResultControl.SetBackGroundNeedBattlePoint(needBattlePoint: true); - } - else - { - bool backGroundNeedBattlePoint = PlayerStaticData.UserPromotionWinCount >= matchInfo.necessary_win || PlayerStaticData.UserPromotionLoseCount >= matchInfo.reset_lose; - battleResultControl.SetBackGroundNeedBattlePoint(backGroundNeedBattlePoint); - } - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); - } - RankWinnerReward winnerReward = GameMgr.GetIns()._rankWinnerReward; - if (winnerReward == null) - { - int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE); - string value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING); - if (value != 0 && value2 != "") - { - winnerReward = UIManager.GetInstance().createRankWinnerReward(); - GameMgr.GetIns()._rankWinnerReward = winnerReward; - winnerReward.SetInfomation(value, value2); - winnerReward.gameObject.SetActive(value: false); - } - } - if (winnerReward != null && isWin) - { - float seconds = 3f; - StartCoroutine(winnerReward.ResultWinnerReward()); - yield return new WaitForSeconds(seconds); - StartCoroutine(winnerReward.HideRewardObject()); - } - if (!battleResultControl.IsDraw && ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (Data.RankMatchFinish.data != null) - { - TreasureBoxCpResultInfo treasureBoxCpResultInfo = Data.RankMatchFinish.data.TreasureBoxCpResultInfo; - if (treasureBoxCpResultInfo.IsPlayGradeUpAnimation()) - { - yield return TreasureBoxCpOpenBoxAnimation(battleResultControl, treasureBoxCpResultInfo.AfterGrade); - } - if (treasureBoxCpResultInfo.IsBoxOpened()) - { - yield return CreateTreasureBoxCpRewardDialog(treasureBoxCpResultInfo); - } - } - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - if (winnerReward != null) - { - winnerReward.RemoveObject(); - GameMgr.GetIns()._rankWinnerReward = null; - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (!rankMatchBattleResult.IsPromoPrev) - { - iTween.MoveTo(rankMatchBattleResult.RankInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["RankInfo"], "time", 0.5f, "delay", 0.4f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - yield return new WaitForSeconds(1f); - if (rankMatchBattleResult.WinCount > 1) - { - TweenAlpha.Begin(rankMatchBattleResult.WinsObj.labels[0].gameObject, 0.3f, 1f); - TweenAlpha.Begin(rankMatchBattleResult.WinsObj.labels[1].gameObject, 0.3f, 1f); - iTween.MoveFrom(rankMatchBattleResult.WinsObj.gameObject, iTween.Hash("x", rankMatchBattleResult.WinsObj.transform.localPosition.x + 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - if (isWin) - { - PlayWinVoice(); - } - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - if (rankMatchBattleResult.IsPromoPrev) - { - StartCoroutine(rankMatchBattleResult.RunMatchUI()); - yield return new WaitForSeconds(3.5f); - bool isEndPromo = false; - if (PlayerStaticData.UserPromotionWinCount >= matchInfo.necessary_win) - { - isEndPromo = true; - StartCoroutine(rankMatchBattleResult.RunTierUp()); - battleResultControl.RankMatchBattleResultObject.IsRunUIStop = true; - while (battleResultControl.RankMatchBattleResultObject.IsRunUIStop) - { - yield return null; - } - yield return new WaitForSeconds(0.5f); - } - else if (PlayerStaticData.UserPromotionLoseCount >= matchInfo.reset_lose) - { - isEndPromo = true; - StartCoroutine(rankMatchBattleResult.RunFailed()); - yield return new WaitForSeconds(3f); - } - if (isEndPromo) - { - PlayerStaticData.UserPromotionMatchCount = 0; - iTween.MoveTo(rankMatchBattleResult.RankInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["RankInfo"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.5f); - } - } - if (!rankMatchBattleResult.IsPromoPrev || !rankMatchBattleResult.IsPromoNow) - { - if (rankMatchBattleResult.BasicExp_and_SuperiorBonus != 0) - { - rankMatchBattleResult.SettingAddRankExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - if (rankMatchBattleResult.RankExpBonus > 0) - { - rankMatchBattleResult.AddRankExpBonus(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - } - if (!rankMatchBattleResult.IsPromoPrev && !rankMatchBattleResult.IsPromoNow) - { - if (PlayerStaticData.UserRankCurrentFormat() > rankMatchBattleResult.BeforeRankLv) - { - StartCoroutine(rankMatchBattleResult.RunRankUp()); - battleResultControl.RankMatchBattleResultObject.IsRunUIStop = true; - while (battleResultControl.RankMatchBattleResultObject.IsRunUIStop) - { - yield return null; - } - yield return new WaitForSeconds(0.5f); - } - else if (PlayerStaticData.UserRankCurrentFormat() < rankMatchBattleResult.BeforeRankLv) - { - StartCoroutine(rankMatchBattleResult.RunRankDown()); - battleResultControl.RankMatchBattleResultObject.IsRunUIStop = true; - while (battleResultControl.RankMatchBattleResultObject.IsRunUIStop) - { - yield return null; - } - yield return new WaitForSeconds(0.5f); - } - } - if (!rankMatchBattleResult.IsPromoPrev && rankMatchBattleResult.IsPromoNow) - { - StartCoroutine(battleResultControl.RunMatch()); - yield return new WaitForSeconds(3f); - } - if (Data.RankMatchFinish.data != null && Data.RankMatchFinish.data.SpeedChallengeAnnounceTime.HasValue) - { - SystemText systemText = Data.SystemText; - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - dialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialog.SetTitleLabel(systemText.Get("SpeedChallenge_0001")); - dialog.SetSize(DialogBase.Size.M); - GameObject gameObject = Object.Instantiate(Resources.Load("UI/layoutParts/Dialog/DialogSpeedChallenge")) as GameObject; - dialog.SetObj(gameObject); - DialogSpeedChallenge component = gameObject.GetComponent(); - string text = string.Format(arg0: ConvertTime.ToLocal(Data.RankMatchFinish.data.SpeedChallengeAnnounceTime.Value, ConvertTime.FORMAT.TIME_DATE_LONG_SPECIAL), format: systemText.Get("SpeedChallenge_0002")); - component.SetText(text); - component.SetTexture("banner_000764"); - while (dialog.IsOpen()) - { - yield return null; - } - } - bool battlePathUIFinish = false; - battleResultControl.SetBattlePassGauge(delegate - { - battlePathUIFinish = true; - }); - while (!battlePathUIFinish) - { - yield return null; - } - if (Data.RedEtherCampaignResultData != null) - { - bool isFinishRedEther = false; - RedEtherCampaignPanel.Create(battleResultControl.gameObject, Data.RedEtherCampaignResultData, battleResultControl, delegate - { - isFinishRedEther = true; - }); - while (!isFinishRedEther) - { - yield return null; - } - yield return ShowRewardDialog(Data.RedEtherCampaignResultData.RewardList); - } - if (battleResultControl.ResultReporter.HomeDialogData != null && battleResultControl.ResultReporter.HomeDialogData.IsEnable) - { - bool homeDialogFinish = false; - MyPageHomeDialog.Create(UIManager.GetInstance().HomeDialogPrefab, battleResultControl.resultReporter.HomeDialogData, delegate - { - homeDialogFinish = true; - }); - while (!homeDialogFinish) - { - yield return null; - } - } - battleResultControl.GreySpriteBGVisible = false; - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - } -} diff --git a/SVSim.BattleEngine/Engine/RankMatchResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/RankMatchResultAnimationHandler.cs deleted file mode 100644 index a5bbfba7..00000000 --- a/SVSim.BattleEngine/Engine/RankMatchResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class RankMatchResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly RankMatchResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public RankMatchResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/RankMatchResultReporter.cs b/SVSim.BattleEngine/Engine/RankMatchResultReporter.cs deleted file mode 100644 index 780ccc9c..00000000 --- a/SVSim.BattleEngine/Engine/RankMatchResultReporter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard; -using Wizard.Lottery; - -public class RankMatchResultReporter : IBattleResultReporter -{ - public bool IsEnd => Data.RankMatchFinish.data != null; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => Data.RankMatchFinish.data._missionRewards; - - public List VictoryRewards => Data.RankMatchFinish.data._victoryRewards; - - public LotteryApplyData LotteryData => Data.RankMatchFinish.data.AchievedInfo._lotteryData; - - public MyPageHomeDialogData HomeDialogData => Data.RankMatchFinish.data.HomeDialogData; - - public bool IsDataExist - { - get - { - if (Data.RankMatchFinish.data != null) - { - return Data.RankMatchFinish.data.IsProcessed; - } - return false; - } - } - - public void Report(bool isWin) - { - } - - public void Destroy() - { - } - - public JsonData GetFinishResponseData() - { - return Data.RankMatchFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.RankMatchFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.RankMatchFinish.data.achieved_mission_list; - } - - public int GetClassExp() - { - return Data.RankMatchFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/ReadMailDetail.cs b/SVSim.BattleEngine/Engine/ReadMailDetail.cs index d7679ee7..81a69453 100644 --- a/SVSim.BattleEngine/Engine/ReadMailDetail.cs +++ b/SVSim.BattleEngine/Engine/ReadMailDetail.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; public class ReadMailDetail { - public List mail_result_list; public List total_recieve_count_list; diff --git a/SVSim.BattleEngine/Engine/RealTimeNetworkAgent.cs b/SVSim.BattleEngine/Engine/RealTimeNetworkAgent.cs index ad1d8439..a15cfa35 100644 --- a/SVSim.BattleEngine/Engine/RealTimeNetworkAgent.cs +++ b/SVSim.BattleEngine/Engine/RealTimeNetworkAgent.cs @@ -1,1788 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using BestHTTP.SocketIO; -using BestHTTP.SocketIO.Transports; -using Cute; -using LitJson; -using MessagePack; -using MiniJSON; -using PlatformSupport.Collections.ObjectModel; -using UnityEngine; -using Wizard; -using Wizard.Battle.Recovery; -using Wizard.ErrorDialog; -using Wizard.RoomMatch; - -public class RealTimeNetworkAgent : MonoBehaviour -{ - public enum EmitCategory - { - battle = 1, - matching = 2, - room = 3, - watch = 11, - general = 99 - } - - public enum MatchingStatus - { - OffLine = 0, - Connect = 10, - StartLoad = 30, - Loaded = 40, - Prepared = 50, - Disconnected = 80, - RoomReady = 90, - Room = 100 - } - - public enum DESTROY_OBJECT_LOG - { - BattleResult, - Maintenance, - NodeError, - ResultCode, - Room, - MatchingDisconnect, - WatchMaintenance, - Debug, - Replay, - HandleResultCode - } - - private DateTime _receiveWaitTime = DateTime.MinValue; - - private bool _isCheckReceiveWaitTime; - - private int _oldReceiveDataCount; - - private const float RECEIVE_WAIT_ERROR_LOG_TIME = 60f; - - protected NetworkBattleManagerBase _networkBattleManager; - - public Action> OnMatchingReceiveUri; - - public Action OnEmit; - - private BattleFinishSendBase _battleFinishSendBase; - - public static FinishTaskBase FinishTaskBase; - - private bool _initNetworkSuccess; - - protected bool _failedRecoveryToNotSendFinishTask; - - protected bool _isFinishResultSuccses; - - public List _serializeList = new List(); - - public List _trySerializeList = new List(); - - private int _currentTryNum; - - protected SocketManager _manager; - - private int viewerId; - - private string battleRoomId; - - protected string bid = ""; - - private Matching _matching; - - private Action _onEveryTimeFail; - - public const string SEND_SEQ_NAME = "pubSeq"; - - public const string RECEIVE_SEQ_NAME = "playSeq"; - - protected StockReceiveMgr stockReceiveMessageMgr; - - protected StockEmitMgr stockEmitMessageMgr; - - private Action _onFinishedEmit; - - protected Gungnir _gungnir; - - private bool _isAlreadyDestroyedGameObject; - - private static readonly string status_try = "try"; - - private string errorLog = ""; - - private const string EmitMsg = "msg"; - - private const string EmitHand = "hand"; - - private const string HAND_DATA_KEY = "StockHandData"; - - public const string CategoryParameter = "cat"; - - public Action OnResultCodeError; - - protected const int ERROR_MAINTENANCE = 5; - - private bool _notEmit; - - public Action> OnAck; - - public bool IsNotPlayReceivingData; - - public const string RECEIVE_URI = "uri"; - - public const string IS_RESUME = "isResume"; - - private long _battlePreparedStartTicks; - - private int _disconnectNum; - - private int _emitLogNum; - - private bool _isAddEmitLog; - - private string _emitLog = ""; - - private const int DISCONNECT_LOG_NUM = 5; - - private const int EMIT_LOG_NUM = 3; - - private int _connectNumToReconnect; - - private long _connectTicks; - - private const int CONNECT_TO_RECONNECT_MAX_NUM = 3; - - private const float CONNECT_TO_RECONNECT_TIMER = 30f; - - private long _stopPlayReceiveLogTime; - - private const float STOP_PLAY_RECEIVE_LOG_TIME = 60f; - - public bool IsRecovery { get; private set; } - - public bool IsBattleStart { get; private set; } - - public NetworkStatus OpponentNetworkStatus { get; protected set; } - - public bool IsOpponentDisconnected => !OpponentNetworkStatus.IsAlive; - - public SocketManager SocketManager => _manager; - - public int StockReceiveCount => stockReceiveMessageMgr.GetSequenceDataCount(); - - public int MaxMessageSequenceNumber => stockReceiveMessageMgr.GetMaxSequenceNumber(); - - public int StockEmitCount => stockEmitMessageMgr.GetSequenceDataCount(); - - public NetworkStatus PlayerNetworkStatus { get; private set; } - - public bool IsReceiveSelfDisconnect - { - get - { - if (_gungnir != null) - { - return _gungnir._DisconnectStatus == Gungnir.DisconnectStatus.SELF_DISCONNECT; - } - return false; - } - } - - public bool IsReceiveOpponentDisconnect - { - get - { - if (_gungnir != null) - { - return _gungnir._DisconnectStatus == Gungnir.DisconnectStatus.OPPONENT_DISCONNECT; - } - return false; - } - } - - public Action> OnReceivedEvent { get; set; } - - public MatchingStatus CurrentMatchingStatus { get; protected set; } - - public int LastEmitSeqNumber { get; private set; } - - public bool IsExistTitleReturnError { get; private set; } - - public INetworkLogger NetworkLogger { get; protected set; } - - public string NowSocketID { get; private set; } - - public void SetIsRecovery(bool flg) - { - IsRecovery = flg; - } - - public void SetIsBattleStart(bool flag) - { - IsBattleStart = flag; - } - - public int GetIsFirstPlayer() - { - return GameMgr.GetIns().GetNetworkUserInfoData().TurnState; - } - - public int GetViewId() - { - return viewerId; - } - - public long GetBattleId() - { - if (string.IsNullOrEmpty(bid)) - { - return -1L; - } - return long.Parse(bid); - } - - public void SetbattleId(string battleId) - { - bid = battleId; - } - - public int GetActionSequenceCount() - { - if (_gungnir != null) - { - return _gungnir._actionSequenceNum; - } - return -1; - } - - protected virtual void Awake() - { - UnityEngine.Object.DontDestroyOnLoad(base.gameObject); - GameMgr.GetIns().SetNetworkUserInfoData(new NetworkUserInfoData()); - stockReceiveMessageMgr = new StockReceiveMgr("playSeq"); - stockEmitMessageMgr = new StockEmitMgr("pubSeq"); - InitializeNetworkLogger(); - InitializePlayerNetworkStatus(); - InitializeGungnir(); - TaskManager.GetInstance().MyPageSend(); - } - - private void Update() - { - if (ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != MatchingStatus.Prepared && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != MatchingStatus.Disconnected && _matching != null) - { - _matching.UpdateMatching(); - } - if (BattleManagerBase.GetIns() == null) - { - LocalLog.SubmitAccumulateLastTraceLog(); - } - if (!IsNotPlayReceivingData) - { - PlayReceiveData(); - CheckLogStopPlayReceive(); - } - } - - protected virtual void InitializeNetworkLogger() - { - NetworkLogger = new NetworkNullLogger(); - } - - protected virtual void InitializePlayerNetworkStatus() - { - PlayerNetworkStatus = new NetworkStatus(); - } - - protected virtual void InitializeGungnir() - { - _gungnir = new Gungnir(this); - Gungnir gungnir = _gungnir; - gungnir.OnAlive = (Action)Delegate.Combine(gungnir.OnAlive, new Action(PlayerNetworkStatus.ToKeepAlive)); - Gungnir gungnir2 = _gungnir; - gungnir2.OnAlive = (Action)Delegate.Combine(gungnir2.OnAlive, (Action)delegate - { - LocalLog.AddGungnirLog("GungnirOnAlived"); - }); - Gungnir gungnir3 = _gungnir; - gungnir3.OnResendEmitData = (Action)Delegate.Combine(gungnir3.OnResendEmitData, new Action(ResendPubSeqData)); - } - - public void SetCurrentMatchingStatus(MatchingStatus status) - { - if (CurrentMatchingStatus != MatchingStatus.Disconnected) - { - if (CurrentMatchingStatus >= status) - { - LocalLog.AccumulateTraceLog("SetCurrentMatchingStatus Old" + CurrentMatchingStatus.ToString() + " " + status); - return; - } - CurrentMatchingStatus = status; - LocalLog.AccumulateLastTraceLog("SetStatus:" + CurrentMatchingStatus); - } - } - - public void SetNetworkBattleMgr(NetworkBattleManagerBase mgr) - { - _networkBattleManager = mgr; - } - - public void StartPreparedStartTimer(DateTime nowTimer) - { - _battlePreparedStartTicks = nowTimer.Ticks; - } - - public int GetPreparedStartTimer() - { - return (int)NetworkUtility.GetTimeSpanMilliSecond(_battlePreparedStartTicks); - } - - private void OnApplicationPause(bool appPause) - { - if (GameMgr.GetIns() != null && !GameMgr.GetIns().IsReplayBattle && appPause && _manager != null) - { - Dictionary dictionary = CreateEmitData(NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Kill], null); - dictionary.Add("state", "pause"); - _manager.Socket.Emit("msg", null, CreatePackEmitData(dictionary)); - } - } - - protected virtual void PlayReceiveData() - { - int sequenceDataCount = stockReceiveMessageMgr.GetSequenceDataCount(); - if (!_isCheckReceiveWaitTime) - { - _receiveWaitTime = TimeUtil.GetAbsoluteTime(); - } - _isCheckReceiveWaitTime = _oldReceiveDataCount == sequenceDataCount && sequenceDataCount != 0; - _oldReceiveDataCount = sequenceDataCount; - Dictionary dictionary = stockReceiveMessageMgr.FindData(stockReceiveMessageMgr.SequenceAlreadyNumber + 1); - string text = ""; - if (dictionary != null) - { - text = dictionary["uri"].ToString(); - } - if (!IsPlayReceiveDataOk(text)) - { - if (_isCheckReceiveWaitTime && (float)NetworkUtility.GetTimeSpanSecond(_receiveWaitTime.Ticks) >= 60f) - { - NetworkBattleGenericTool.CreateLoadAndPlayEffectVfxLastTurnLog(); - _isCheckReceiveWaitTime = false; - } - } - else if ((stockEmitMessageMgr.IsEmpty() || !(text == "BattleFinish")) && dictionary != null) - { - _stopPlayReceiveLogTime = TimeUtil.GetAbsoluteTime().Ticks; - bool flag = PlayReceiveData(dictionary); - flag |= IsFromResumeData(dictionary); - if (ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != MatchingStatus.Room && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus != MatchingStatus.RoomReady) - { - UpdateReciveSeqNumber(dictionary, flag); - } - } - } - - public static bool IsFromResumeData(Dictionary data) - { - if (data.ContainsKey("isResume")) - { - return (bool)data["isResume"]; - } - return false; - } - - private void CheckLogStopPlayReceive() - { - DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); - if (stockReceiveMessageMgr.GetStockDataList().Count == 0 || GameMgr.GetIns().IsAINetwork || GameMgr.GetIns().IsWatchBattle) - { - _stopPlayReceiveLogTime = absoluteTime.Ticks; - return; - } - int timeSpanSecond = NetworkUtility.GetTimeSpanSecond(_stopPlayReceiveLogTime); - if (!((float)timeSpanSecond >= 60f)) - { - return; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.AppendLine("SeqStopLog: \n"); - foreach (Dictionary stockData in stockReceiveMessageMgr.GetStockDataList()) - { - stringBuilder.AppendLine(stockData["uri"].ToString() + stockReceiveMessageMgr.GetSequenceNumber(stockData) + "|"); - } - stringBuilder.AppendLine("\n seqNum:" + stockReceiveMessageMgr.SequenceAlreadyNumber); - stringBuilder.AppendLine("\n matchingStatus:" + CurrentMatchingStatus); - stringBuilder.AppendLine("\n stopPlayReceiveTimeSpanSecond:" + timeSpanSecond); - if (_networkBattleManager != null) - { - stringBuilder.AppendLine("\n vfxEnd:" + _networkBattleManager.VfxMgr.IsEnd); - stringBuilder.AppendLine(" currentVfx:" + _networkBattleManager.VfxMgr.CurrentVfxName); - stringBuilder.AppendLine(" currentVfxTime:" + _networkBattleManager.VfxMgr.CurrentVfxTime); - stringBuilder.AppendLine("\n loadResourcePhase:" + LocalLog.GetLoadResourceLog()); - stringBuilder.AppendLine("\n isEchoWait:" + _networkBattleManager.IsEchoWait()); - } - string text = stringBuilder.ToString(); - Debug.LogError(text); - NetworkLogger.LogInfo(text); - LocalLog.AccumulateLastTraceLog("StopPlayReceive " + text); - LocalLog.RecordMemoryOnLastTurnLog(); - _stopPlayReceiveLogTime = absoluteTime.Ticks; - } - - public void UpdateReciveSeqNumber(Dictionary playData, bool isUpdateSequence = true) - { - if (playData != null) - { - LocalLog.AccumulateLastTraceLog("Front Uri " + playData["uri"]); - LocalLog.AccumulateLastTraceLog("UpdateReceiveSequenceBefore: Max " + stockReceiveMessageMgr.GetMaxSequenceNumber() + "Already" + stockReceiveMessageMgr.SequenceAlreadyNumber); - if (isUpdateSequence) - { - stockReceiveMessageMgr.UpdateSequenceAlreadyNumber(playData); - } - stockReceiveMessageMgr.RemoveSelectData(playData); - } - LocalLog.AccumulateLastTraceLog("UpdateReceiveSequence: Max " + stockReceiveMessageMgr.GetMaxSequenceNumber() + "Already" + stockReceiveMessageMgr.SequenceAlreadyNumber); - } - - public virtual bool IsPlayReceiveDataOk(string uri = null, bool isWatchCheck = false) - { - return true; - } - - public void Connect(int viewerId, string battleId, Action onEveryTimeFail, Matching matching, bool isBeforeBattleStartRetry = false) - { - SettingMatchingClass(matching); - this.viewerId = viewerId; - battleRoomId = battleId; - string value = CryptAES.encryptForNode(viewerId.ToString()); - _onEveryTimeFail = onEveryTimeFail; - SocketOptions socketOptions = new SocketOptions(); - socketOptions.ConnectWith = TransportTypes.WebSocket; - socketOptions.AutoConnect = true; - socketOptions.AdditionalQueryParams = new ObservableDictionary(); - socketOptions.AdditionalQueryParams.Add("User-Agent", SystemInfo.operatingSystem.ToString()); - socketOptions.AdditionalQueryParams.Add("BattleId", battleId); - socketOptions.AdditionalQueryParams.Add("viewerId", value); - _manager = new SocketManager(new Uri(CustomPreference.GetNodeServerURL()), socketOptions); - _manager.SettingRealtimeNetworkAgent(this); - ConnectSocket(); - if (isBeforeBattleStartRetry || (IsRecovery && matching != null)) - { - _initNetworkSuccess = true; - if (!IsRecovery) - { - StartGungnir(); - } - } - } - - public SocketManager.States Connect(int viewerId, string battleId, Action onEveryTimeFail) - { - this.viewerId = viewerId; - battleRoomId = battleId; - string value = CryptAES.encryptForNode(viewerId.ToString()); - _onEveryTimeFail = onEveryTimeFail; - SocketOptions socketOptions = new SocketOptions(); - socketOptions.ConnectWith = TransportTypes.WebSocket; - socketOptions.AutoConnect = true; - socketOptions.AdditionalQueryParams = new ObservableDictionary(); - socketOptions.AdditionalQueryParams.Add("User-Agent", SystemInfo.operatingSystem.ToString()); - socketOptions.AdditionalQueryParams.Add("BattleId", battleId); - socketOptions.AdditionalQueryParams.Add("viewerId", value); - _manager = new SocketManager(new Uri(CustomPreference.GetNodeServerURL()), socketOptions); - _manager.SettingRealtimeNetworkAgent(this); - return ConnectSocket(); - } - - public void SettingMatchingClass(Matching matching) - { - if (matching != null) - { - _matching = matching; - } - } - - public static void ReconnectSocketAndLogFlagOn() - { - ToolboxGame.RealTimeNetworkAgent.ReconnectSocket(); - if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.RankBattle && Wizard.Data.CurrentFormat == Format.Rotation) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG, 1f); - } - } - - public static bool IsNormalNetworkBattle() - { - if (ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus >= MatchingStatus.Prepared && GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle && !GameMgr.GetIns().IsAINetwork && BattleManagerBase.GetIns() != null) - { - return !BattleManagerBase.GetIns().IsRecovery; - } - return false; - } - - public SocketManager.States ReconnectSocket() - { - if (viewerId == 0 || _manager == null) - { - return SocketManager.States.Initial; - } - _manager.Close(); - return Connect(viewerId, battleRoomId, _onEveryTimeFail); - } - - private SocketManager.States ConnectSocket() - { - _manager.Socket.On("disconnect", OnDisconnect); - _manager.Socket.On("opponent_lost", OnOpponentLost); - _manager.Socket.On("synchronize", OnReceived); - _manager.Socket.On("hand", OnHandReceived); - _manager.Socket.On("reconnect_socket", OnReconnect); - _manager.Socket.On("alive", OnAlived); - _manager.Socket.On("connect_socket", OnConnect_Socket); - _manager.Socket.On("heartbeat_ping", OnHeartbeatPing); - _manager.Socket.On("heartbeat_pong", OnHeartbeatPong); - _manager.Socket.On("heartbeat_timeout", OnHeartbeatTimeOut); - _manager.Socket.On(SocketIOEventTypes.Error, delegate(Socket socket, Packet packet, object[] args) - { - _onEveryTimeFail.Call(); - if (args != null && args.Count() >= 1 && errorLog != args.First().ToString()) - { - errorLog = args.First().ToString(); - LocalLog.AccumulateTraceLog(errorLog); - } - }); - _manager.Open(); - return _manager.State; - } - - protected virtual void OnEmitAckCallback(Socket socket, Packet originalPacket, params object[] args) - { - if ((float)NetworkUtility.GetTimeSpanSecond(stockEmitMessageMgr.GetEmitTime()) < StockEmitMgr.WAIT_ACK_TIMEOUT) - { - int number = int.Parse(args[0].ToString()); - EmitSuccessToNextEmitData(number); - } - } - - public void EmitSuccessToNextEmitData(int number) - { - Dictionary selectData = stockEmitMessageMgr.GetSelectData(number); - OnAck.Call(selectData); - stockEmitMessageMgr.SetReceiveAck(); - if (selectData == null) - { - LocalLog.AccumulateLastTraceLog("OnAckCallback Null " + number); - return; - } - string text = ""; - bool flag = false; - if (selectData.ContainsKey("StockHandData")) - { - flag = true; - text = GetHandUri(selectData); - } - else - { - text = selectData["uri"].ToString(); - } - LocalLog.AccumulateLastTraceLog("OnAckCallback Uri " + text + " number" + number); - stockEmitMessageMgr.RemoveSelectData(selectData); - if (text == NetworkBattleDefine.NetworkBattleURI.TurnStart.ToString() && !_gungnir._actionSeqPubSeqList.Contains(number)) - { - if (text == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnStart]) - { - SetGungnirSendActionSequence(isActive: false); - } - _gungnir._actionSeqPubSeqList.Add(number); - LocalLog.AccumulateLastTraceLog("uri:" + text + " ActionSeq:" + GetActionSequenceCount() + " NotRecovery"); - AddActionSequence(); - } - EmitFrontStockData(); - NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase; - NetworkBattleDefine.NetworkBattleURI result = NetworkBattleDefine.NetworkBattleURI.None; - object value; - bool flag2 = selectData.TryGetValue("uri", out value); - bool flag3 = flag2 && Enum.TryParse(value.ToString(), out result); - if (networkBattleManagerBase != null && !flag && flag2 && flag3) - { - networkBattleManagerBase.SendIntervalTriggerMain.SendDataCheck(networkBattleManagerBase, result); - } - } - - public void SetGungnirSendActionSequence(bool isActive) - { - _gungnir.SetSendActionSequenceNumFlag(isActive); - } - - private void ResendPubSeqData(int resendOrderNum) - { - if ((float)NetworkUtility.GetTimeSpanSecond(stockEmitMessageMgr.GetEmitTime()) < StockEmitMgr.WAIT_ACK_TIMEOUT) - { - return; - } - List> sequenceAllData = stockEmitMessageMgr.GetSequenceAllData(); - if (sequenceAllData != null && sequenceAllData.Count > 0) - { - int num = int.Parse(sequenceAllData[0]["pubSeq"].ToString()); - if (num > resendOrderNum) - { - for (int i = 0; i < num - resendOrderNum; i++) - { - Dictionary allSelectData = stockEmitMessageMgr.GetAllSelectData(num - i); - if (allSelectData != null) - { - stockEmitMessageMgr.FirstAddSequenceDataList(allSelectData); - } - } - DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); - stockEmitMessageMgr.SetEmitTime(absoluteTime.Ticks); - EmitFrontStockData(); - } - else if (num == resendOrderNum && (float)NetworkUtility.GetTimeSpanSecond(stockEmitMessageMgr.GetEmitTime()) > StockEmitMgr.WAIT_ACK_TIMEOUT) - { - DateTime absoluteTime2 = TimeUtil.GetAbsoluteTime(); - stockEmitMessageMgr.SetEmitTime(absoluteTime2.Ticks); - EmitFrontStockData(); - } - else if (num < resendOrderNum) - { - LocalLog.AccumulateTraceLog("ClinentPubSeq < NodePubSeq"); - } - } - else - { - if (sequenceAllData == null || sequenceAllData.Count != 0) - { - return; - } - int sequenceNumber = stockEmitMessageMgr.SequenceNumber; - if (sequenceNumber <= resendOrderNum) - { - return; - } - for (int j = 0; j < sequenceNumber - resendOrderNum; j++) - { - Dictionary allSelectData2 = stockEmitMessageMgr.GetAllSelectData(sequenceNumber - j); - if (allSelectData2 != null) - { - stockEmitMessageMgr.FirstAddSequenceDataList(allSelectData2); - } - } - DateTime absoluteTime3 = TimeUtil.GetAbsoluteTime(); - stockEmitMessageMgr.SetEmitTime(absoluteTime3.Ticks); - EmitFrontStockData(); - } - } - - private void EmitFrontStockData() - { - if (!_notEmit) - { - List> sequenceAllData = stockEmitMessageMgr.GetSequenceAllData(); - if (sequenceAllData == null || sequenceAllData.Count == 0) - { - Action onFinishedEmit = _onFinishedEmit; - _onFinishedEmit = null; - onFinishedEmit.Call(); - } - else - { - EmitDataToAckCallBack(sequenceAllData[0]); - } - } - } - - private void EmitDataToAckCallBack(Dictionary frontData) - { - if (_manager != null && !GameMgr.GetIns().IsWatchBattle) - { - int num = Convert.ToInt32(frontData[status_try].ToString()); - CheckAndRemoveFirstSerializeLogData(num); - _currentTryNum = num; - num++; - frontData[status_try] = num; - EmitStockData(frontData); - AddSerializeLogData(); - } - } - - private void EmitStockData(Dictionary frontData) - { - if (!_notEmit) - { - string text = ""; - byte[] array = null; - string eventName = "msg"; - if (frontData.ContainsKey("StockHandData")) - { - eventName = "hand"; - List info = frontData["StockHandData"] as List; - text = GetHandUri(frontData); - array = CreatePackEmitHandData(info); - } - else - { - text = frontData["uri"].ToString(); - array = CreatePackEmitData(frontData); - } - int result = 0; - if (int.TryParse(text, out result)) - { - string text2 = "Emit Hand " + Enum.GetName(typeof(NetworkBattleSender.HAND_URI_TYPE), result); - NetworkLogger.LogInfo(text2); - LocalLog.AccumulateLastTraceLog(text2); - } - else - { - string text3 = "Emit Uri " + text; - LocalLog.AccumulateLastTraceLog(text3); - NetworkLogger.LogInfo(text3); - } - DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); - stockEmitMessageMgr.SetEmitTime(absoluteTime.Ticks); - if (text == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.InitNetwork]) - { - LocalLog.AccumulateLastTraceLog("EmitStockData_InitNetwork " + StackTraceUtility.ExtractStackTrace()); - } - _emitLog = ""; - if (isSendEmitLog()) - { - _isAddEmitLog = true; - _emitLogNum++; - LocalLog._isSendGungnirLog = true; - LocalLog._isSendSocketFrameLog = true; - } - _manager.Socket.Emit(eventName, OnEmitAckCallback, array); - if (_isAddEmitLog) - { - _isAddEmitLog = false; - LocalLog.AccumulateLastTraceLog("EmitLog:" + _emitLog); - } - } - } - - public bool isSendEmitLog() - { - if (_disconnectNum >= 5 && CurrentMatchingStatus == MatchingStatus.Prepared && _emitLogNum < 3 && (float)NetworkUtility.GetTimeSpanSecond(stockEmitMessageMgr.EmitToAckCheckTime) > StockEmitMgr.ACK_NOT_RECEIVE_LOG_TIME) - { - return (float)NetworkUtility.GetTimeSpanSecond(_gungnir.GungnirReceiveCheckTime) < 5f; - } - return false; - } - - public void AddEmitLog(string log) - { - if (_isAddEmitLog) - { - _emitLog += log; - } - } - - public byte[] CreatePackEmitData(Dictionary info) - { - byte[] array = MessagePackSerializer.Serialize(CryptAES.encryptForNode(JsonMapper.ToJson(info))); - if (BattleManagerBase.GetIns() != null) - { - KeyValuePair keyValuePair = info.SingleOrDefault((KeyValuePair s) => s.Key == "uri"); - if (!keyValuePair.Equals(default(KeyValuePair)) && keyValuePair.Value.ToString() != "Gungnir") - { - DateTime dateTime = DateTime.Now.ToUniversalTime(); - _serializeList.Add(string.Format("{0}/{1}:{2}:{3}:{4:000}:{5}", dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Millisecond.ToString("000"), "\n" + keyValuePair.Value?.ToString() + " serialize data = " + Convert.ToBase64String(array))); - } - } - return array; - } - - private void AddSerializeLogData() - { - if (_currentTryNum >= 1) - { - _trySerializeList.AddRange(_serializeList); - _serializeList.Clear(); - } - } - - private void CheckAndRemoveFirstSerializeLogData(int nowTryCount) - { - if (_currentTryNum == 0 && nowTryCount == 0 && _serializeList.Count > 2) - { - _serializeList.RemoveRange(0, _serializeList.Count - 1); - } - } - - private byte[] CreatePackEmitHandData(List info) - { - return MessagePackSerializer.Serialize(JsonMapper.ToJson(info)); - } - - protected void OnReceived(Socket socket, Packet packet, params object[] args) - { - if (_notEmit) - { - LocalLog.AccumulateLastTraceLog("OnReceivedNotEmit"); - return; - } - byte[] bytes = packet.Attachments[0]; - Dictionary dictionary = null; - string text = ""; - try - { - text = MessagePackSerializer.Deserialize(bytes); - } - catch (Exception ex) - { - LocalLog.AccumulateLastTraceLog("OnReceivedUnpack Error:" + ex); - return; - } - dictionary = Json.Deserialize(CryptAES.decryptForNode(text)) as Dictionary; - string text2 = dictionary["uri"].ToString(); - if (text2 == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.InitNetwork]) - { - _initNetworkSuccess = true; - } - if (text2 == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnStart]) - { - LocalLog.InitGungnirLog(); - LocalLog.InitDisconnectLog(); - LocalLog.InitSocketFrameLog(); - } - if (text2 != RoomParamKey.WatchUriNames[PlayerControllerForWatching.SEND_PARAMETER.Watch]) - { - string text3 = "OnReceived URI:" + text2; - NetworkLogger.LogInfo(text3); - LocalLog.AccumulateLastTraceLog(text3); - } - if (!HandleingNodeResultCodeIfNeeded(dictionary) && !CheckReceiveMaintenanceToDestroy(text2)) - { - if (text2 == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Resume]) - { - ResumeToStockReceive(dictionary); - } - else if (text2 == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Watch]) - { - PlayReceiveData(dictionary); - } - else - { - ProcessingRecivedData(dictionary); - } - } - } - - private bool CheckReceiveMaintenanceToDestroy(string uri) - { - if (uri == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Maintenance]) - { - StopNetworkBattle(); - ShowMaintenanceError(); - DestroyObj(DESTROY_OBJECT_LOG.Maintenance); - return true; - } - return false; - } - - protected void OnHandReceived(Socket socket, Packet packet, params object[] args) - { - if (!_notEmit) - { - byte[] bytes = packet.Attachments[0]; - List list = null; - try - { - list = Json.Deserialize(MessagePackSerializer.Deserialize(bytes)) as List; - } - catch (Exception ex) - { - Debug.LogError("Unpack Error:" + ex); - return; - } - if (int.Parse(list[0].ToString()) == 99) - { - int errorCode = int.Parse(list[1].ToString()); - HandleResultCode(errorCode, isMatching: false); - } - } - } - - protected void OnAlived(Socket socket, Packet packet, params object[] args) - { - _gungnir.ReceiveGungnir(packet, args); - } - - private void OnHeartbeatPing(Socket socket, Packet packet, params object[] args) - { - string log = DateTime.UtcNow.ToString() + DateTime.UtcNow.Millisecond + " [" + socket.Id + "] Ping->"; - if (_disconnectNum >= 5) - { - LocalLog.AccumulateLastTraceLog(log); - } - LocalLog.AddGungnirLog(" Ping->"); - } - - private void OnHeartbeatPong(Socket socket, Packet packet, params object[] args) - { - string log = DateTime.UtcNow.ToString() + DateTime.UtcNow.Millisecond + " [" + socket.Id + "] <- Pong "; - if (_disconnectNum >= 5) - { - LocalLog.AccumulateLastTraceLog(log); - } - LocalLog.AddGungnirLog(" <- Pong "); - } - - private void OnHeartbeatTimeOut(Socket socket, Packet packet, params object[] args) - { - LocalLog.AccumulateLastTraceLog(DateTime.UtcNow.ToString() + DateTime.UtcNow.Millisecond + " [" + socket.Id + "]× TIME OUT"); - } - - public Dictionary DeserializeEncryptedPacket(Packet packet) - { - byte[] bytes = packet.Attachments[0]; - string src; - try - { - src = MessagePackSerializer.Deserialize(bytes); - } - catch (Exception ex) - { - Debug.LogError("Unpack Error:" + ex); - return new Dictionary(); - } - return (Json.Deserialize(CryptAES.decryptForNode(src)) as Dictionary) ?? new Dictionary(); - } - - private void HandleResultCode(int errorCode, bool isMatching) - { - if (!isMatching && errorCode == 30002) - { - if (BattleManagerBase.GetIns() is NetworkBattleManagerBase networkBattleManagerBase) - { - networkBattleManagerBase.NodeErrorToNocontest(); - } - return; - } - if (errorCode == 30001 || errorCode == 30213) - { - IsExistTitleReturnError = true; - } - if (!isMatching) - { - CreateNetworkBattleErrorDialog(errorCode); - } - else if (errorCode != 30212) - { - Dialog.Create(errorCode); - } - } - - public void CreateNetworkBattleErrorDialog(int errorCode) - { - StopNetworkBattle(); - Dialog.Create(errorCode); - DestroyObj(DESTROY_OBJECT_LOG.HandleResultCode); - } - - public bool HandleingNodeResultCodeIfNeeded(Dictionary receivedMessage) - { - if (!receivedMessage.Keys.Contains(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.resultCode])) - { - return false; - } - int num = Convert.ToInt32(receivedMessage[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.resultCode]]); - bool flag = false; - if (Enum.IsDefined(typeof(NetworkBattleDefine.ReceiveNodeResultCode), num)) - { - NetworkBattleDefine.ReceiveNodeResultCode receiveNodeResultCode = (NetworkBattleDefine.ReceiveNodeResultCode)num; - switch (receiveNodeResultCode) - { - case NetworkBattleDefine.ReceiveNodeResultCode.Success: - return false; - case NetworkBattleDefine.ReceiveNodeResultCode.RoomCreateError: - LocalLog.AccumulateTraceLogAddRoomCreateLog(); - break; - case NetworkBattleDefine.ReceiveNodeResultCode.SwapTimeoutError: - (BattleManagerBase.GetIns() as NetworkBattleManagerBase).NetworkSender.SendJudgeResult(NetworkBattleSender.JUDGE_RESULT_STATUS.SwapTimeoutError); - return false; - case NetworkBattleDefine.ReceiveNodeResultCode.RoomSetupLock: - return false; - case NetworkBattleDefine.ReceiveNodeResultCode.FoundRemovedUserErrorSelf: - case NetworkBattleDefine.ReceiveNodeResultCode.FoundRemovedUserErrorOppo: - case NetworkBattleDefine.ReceiveNodeResultCode.FoundRemovedUserErrorWatcher: - case NetworkBattleDefine.ReceiveNodeResultCode.RoomTimeEndError: - case NetworkBattleDefine.ReceiveNodeResultCode.WatcherInRemovedOwnerRoomError: - case NetworkBattleDefine.ReceiveNodeResultCode.RoomTornamentOwnTimeEndError: - case NetworkBattleDefine.ReceiveNodeResultCode.RoomTornamentOppoTimeEndError: - case NetworkBattleDefine.ReceiveNodeResultCode.BattleFinishTimeEnd: - OnResultCodeError.Call(num); - return false; - case NetworkBattleDefine.ReceiveNodeResultCode.Different_UUID: - case NetworkBattleDefine.ReceiveNodeResultCode.RedisReplyError: - case NetworkBattleDefine.ReceiveNodeResultCode.CurrentBattleError: - case NetworkBattleDefine.ReceiveNodeResultCode.UnexpectedPhaseError: - case NetworkBattleDefine.ReceiveNodeResultCode.WatchError: - { - bool flag2 = ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus < MatchingStatus.Prepared && !IsRecovery; - if (!flag2 && receiveNodeResultCode == NetworkBattleDefine.ReceiveNodeResultCode.CurrentBattleError) - { - (BattleManagerBase.GetIns() as NetworkBattleManagerBase).NetworkSender.SendJudgeResult(NetworkBattleSender.JUDGE_RESULT_STATUS.RecoveryError); - return false; - } - switch (receiveNodeResultCode) - { - case NetworkBattleDefine.ReceiveNodeResultCode.RedisReplyError: - if (BattleManagerBase.GetIns() is NetworkBattleManagerBase networkBattleManagerBase) - { - networkBattleManagerBase.NodeErrorToNocontest(); - break; - } - return false; - case NetworkBattleDefine.ReceiveNodeResultCode.Different_UUID: - case NetworkBattleDefine.ReceiveNodeResultCode.UnexpectedPhaseError: - IsExistTitleReturnError = true; - break; - } - if (!flag2) - { - StopNetworkBattle(); - if (receiveNodeResultCode != NetworkBattleDefine.ReceiveNodeResultCode.RedisReplyError) - { - Dialog.Create(num.ToString()); - } - DestroyObj(DESTROY_OBJECT_LOG.NodeError); - return false; - } - if (receiveNodeResultCode != NetworkBattleDefine.ReceiveNodeResultCode.CurrentBattleError) - { - Dialog.Create(num.ToString()); - } - break; - } - case NetworkBattleDefine.ReceiveNodeResultCode.UnmatchedError: - _matching.StopMatchingAction(); - flag = true; - break; - default: - flag = true; - break; - case NetworkBattleDefine.ReceiveNodeResultCode.MatchingTimeOut: - break; - } - } - else - { - flag = true; - } - if (flag) - { - StopNetworkBattle(); - Dialog.Create(num); - } - OnResultCodeError.Call(num); - DestroyObj(DESTROY_OBJECT_LOG.ResultCode); - return true; - } - - private void OnReconnect(Socket socket, Packet packet, params object[] args) - { - NetworkLogger.LogInfo("OnReconnect"); - LocalLog.AccumulateLastTraceLog("OnReconnect Socket " + socket.Id); - ConnectToReconnect(); - } - - private void OnConnect_Socket(Socket socket, Packet packet, params object[] args) - { - Toolbox.DeviceManager.ClearIpAddress(); - LocalLog.AccumulateTraceLog("ipAddress" + Toolbox.DeviceManager.GetIpAddress()); - string text = "ConnectSocket Socket " + socket.Id; - NetworkLogger.LogInfo(text); - LocalLog.AccumulateLastTraceLog(text); - NowSocketID = socket.Id; - if (IsRecovery) - { - StartGungnir(); - } - ConnectToReconnect(); - } - - private void ConnectToReconnect() - { - DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); - if (_connectNumToReconnect == 0) - { - _connectTicks = absoluteTime.Ticks; - _connectNumToReconnect++; - return; - } - long ticks = TimeUtil.GetAbsoluteTime().Ticks - _connectTicks; - if ((float)new TimeSpan(ticks).Seconds <= 30f) - { - _connectNumToReconnect++; - if (_connectNumToReconnect >= 3) - { - ReconnectSocketAndLogFlagOn(); - _connectNumToReconnect = 0; - } - } - else - { - _connectNumToReconnect = 1; - _connectTicks = absoluteTime.Ticks; - } - } - - public void StartGungnir() - { - _gungnir.Start(); - } - - protected virtual void ProcessingRecivedData(Dictionary receivedMessage) - { - if (stockReceiveMessageMgr.IsNoStockData(receivedMessage)) - { - bool num = PlayReceiveData(receivedMessage); - receivedMessage["uri"].ToString(); - if ((num | IsFromResumeData(receivedMessage)) && stockReceiveMessageMgr.IsIncludedSequenceName(receivedMessage) && stockReceiveMessageMgr.GetSequenceNumber(receivedMessage) == stockReceiveMessageMgr.SequenceAlreadyNumber + 1) - { - stockReceiveMessageMgr.UpdateSequenceAlreadyNumber(receivedMessage); - } - } - else if (stockReceiveMessageMgr.CheckStockData(receivedMessage)) - { - string text = "StockData Uri " + receivedMessage["uri"]?.ToString() + ":seqNum " + stockReceiveMessageMgr.GetSequenceNumber(receivedMessage); - NetworkLogger.LogInfo(text); - LocalLog.AccumulateLastTraceLog(text); - stockReceiveMessageMgr.StockData(receivedMessage); - } - else - { - string text2 = "NotReceiveStock " + receivedMessage["uri"]; - NetworkLogger.LogInfo(text2); - LocalLog.AccumulateLastTraceLog(text2); - } - } - - private void ResumeToStockReceive(Dictionary receivedMessage) - { - object value = null; - if (!receivedMessage.TryGetValue("resume", out value)) - { - return; - } - List list = value as List; - for (int i = 0; i < list.Count; i++) - { - Dictionary dictionary = list[i] as Dictionary; - object obj = dictionary["uri"]; - if (CheckReceiveMaintenanceToDestroy(obj.ToString())) - { - break; - } - stockReceiveMessageMgr.SettingOppoDisconnectSequenceNumber(dictionary); - if (stockReceiveMessageMgr.CheckStockData(dictionary)) - { - dictionary["isResume"] = true; - string text = "Resume StockData Uri " + dictionary["uri"]?.ToString() + ":seqNum" + stockReceiveMessageMgr.GetSequenceNumber(dictionary); - NetworkLogger.LogInfo(text); - LocalLog.AccumulateLastTraceLog(text); - stockReceiveMessageMgr.StockData(dictionary); - } - } - } - - public virtual bool PlayReceiveData(Dictionary synchronizeData) - { - OnReceivedEvent.Call(synchronizeData); - return true; - } - - private void OnOpponentLost(Socket socket, Packet packet, params object[] args) - { - LocalLog.AccumulateLastTraceLog("OnOpponentLost Socket " + socket.Id); - } - - private void OnDisconnect(Socket socket, Packet packet, params object[] args) - { - _disconnectNum++; - string text = ""; - if (NowSocketID != socket.Id) - { - text += " differID "; - } - LocalLog.AccumulateLastTraceLog("OnDisconnect socket " + socket.Id + " " + text); - PlayerNetworkStatus.ToDisconnect(); - } - - protected virtual void OnDestroy() - { - LocalLog.AccumulateLastTraceLog("OnDestroy"); - ManagerClose(); - } - - public void ManagerClose() - { - if (_manager != null) - { - _manager.Close(); - LocalLog.AccumulateTraceLog("LastSocketID " + NowSocketID); - } - _manager = null; - } - - public bool IsOpen() - { - if (_manager == null) - { - return false; - } - if (_manager.State == SocketManager.States.Open) - { - return true; - } - return false; - } - - public bool IsInitNetworkSuccess() - { - if (_manager == null) - { - return false; - } - return _initNetworkSuccess; - } - - public void EmitMsgPack(string uri, EmitCategory emitCategory, Dictionary info, Action onFinishedSend = null, bool isGetableAck = true, bool isStockData = true, int fixedSeqNumber = -1) - { - if (info == null) - { - info = new Dictionary(); - } - info.Add("cat", (int)emitCategory); - _onFinishedEmit = onFinishedSend; - info = CreateEmitData(uri, info); - EmitMsgUriPack(info, isGetableAck, isStockData, fixedSeqNumber); - } - - public void EmitMsgPack(NetworkBattleDefine.NetworkBattleURI uri, Dictionary info = null, Action onFinishedSend = null, bool isGetableAck = true, int fixedSeqNumber = -1, bool isStockData = true, bool isNotActionSeq = false) - { - if (OnEmit != null) - { - OnEmit(uri); - } - if (uri != NetworkBattleDefine.NetworkBattleURI.BattleFinish && uri != NetworkBattleDefine.NetworkBattleURI.TurnEndFinal && CurrentMatchingStatus == MatchingStatus.Disconnected) - { - LocalLog.AccumulateLastTraceLog("EmitMsgPack Disconnected " + uri); - return; - } - EmitCategory emitCategory = EmitCategory.battle; - emitCategory = ((!IsMatchingURI(uri.ToString())) ? EmitCategory.battle : ((uri != NetworkBattleDefine.NetworkBattleURI.InitNetwork) ? EmitCategory.matching : EmitCategory.general)); - if (uri == NetworkBattleDefine.NetworkBattleURI.TurnStart) - { - LocalLog.InitGungnirLog(); - LocalLog.InitDisconnectLog(); - LocalLog.InitSocketFrameLog(); - } - if (!isNotActionSeq && (uri == NetworkBattleDefine.NetworkBattleURI.PlayActions || uri == NetworkBattleDefine.NetworkBattleURI.TurnEndActions || uri == NetworkBattleDefine.NetworkBattleURI.Echo)) - { - AddActionSequence(); - LocalLog.AccumulateLastTraceLog("uri:" + uri.ToString() + " ActionSeq:" + GetActionSequenceCount() + " NotRecovery"); - } - string uri2 = uri.ToString(); - EmitCategory emitCategory2 = emitCategory; - int fixedSeqNumber2 = fixedSeqNumber; - EmitMsgPack(uri2, emitCategory2, info, onFinishedSend, isGetableAck, isStockData, fixedSeqNumber2); - } - - public void EmitHandData(List parameters, NetworkBattleSender.HAND_URI_TYPE uri, bool isSkipDuplicateCheck = false) - { - if (_notEmit || GameMgr.GetIns().IsWatchBattle) - { - return; - } - List list = CreateEmitHandData(parameters, (int)uri); - if (_manager == null) - { - return; - } - if (uri == NetworkBattleSender.HAND_URI_TYPE.SELECT_SKILL_URI || uri == NetworkBattleSender.HAND_URI_TYPE.SLIDE_OBJECT_URI) - { - if ((uri != NetworkBattleSender.HAND_URI_TYPE.SLIDE_OBJECT_URI || !IsDuplicateSlideData(list)) && (isSkipDuplicateCheck || uri != NetworkBattleSender.HAND_URI_TYPE.SELECT_SKILL_URI || !IsDuplicateSelectSkillData(list))) - { - Dictionary dictionary = new Dictionary(); - dictionary.Add("StockHandData", list); - dictionary.Add(status_try, 0); - EmitMsgUriPack(dictionary, isGetableAck: true, isStockData: true, -1, isHandData: true); - } - } - else - { - _manager.Socket.Emit("hand", CreatePackEmitHandData(list)); - } - } - - private bool IsDuplicateSelectSkillData(List parameters) - { - if (parameters.Count == 5) - { - return false; - } - try - { - List> stockDataList = stockEmitMessageMgr.GetStockDataList(); - for (int i = 0; i < stockDataList.Count; i++) - { - Dictionary dictionary = stockDataList[i]; - if (!dictionary.ContainsKey("StockHandData")) - { - continue; - } - List list = dictionary["StockHandData"] as List; - if ((int)list[0] == 2) - { - string value = parameters[4].ToString(); - string value2 = parameters[5].ToString(); - string text = list[5].ToString(); - string text2 = list[6].ToString(); - if (text.Equals(value) && text2.Equals(value2)) - { - return true; - } - } - } - } - catch (Exception message) - { - Debug.LogError(message); - return false; - } - return false; - } - - private bool IsDuplicateSlideData(List parameters) - { - try - { - List> stockDataList = stockEmitMessageMgr.GetStockDataList(); - for (int i = 0; i < stockDataList.Count; i++) - { - Dictionary dictionary = stockDataList[i]; - if (!dictionary.ContainsKey("StockHandData")) - { - continue; - } - List list = dictionary["StockHandData"] as List; - if ((int)list[0] == 5) - { - string value = parameters[3].ToString(); - string value2 = parameters[4].ToString(); - string text = list[4].ToString(); - string text2 = list[5].ToString(); - if (text.Equals(value) && text2.Equals(value2)) - { - return true; - } - } - } - } - catch (Exception message) - { - Debug.LogError(message); - return false; - } - return false; - } - - public Dictionary CreateEmitData(string uri, Dictionary sendData, bool isTrySend = true) - { - if (sendData == null) - { - sendData = new Dictionary(); - } - if (!sendData.Any((KeyValuePair s) => s.Key == "uri")) - { - sendData.Add("uri", uri); - } - int num = viewerId; - sendData.Add("viewerId", num); - sendData.Add("uuid", Certification.Udid); - if (!string.IsNullOrEmpty(bid)) - { - sendData.Add("bid", bid.ToString()); - } - if (isTrySend && !sendData.Any((KeyValuePair s) => s.Key == status_try)) - { - sendData.Add(status_try, 0); - } - return sendData; - } - - private List CreateEmitHandData(List parameters, int uri) - { - List list = new List(); - list.Add(uri); - list.Add(viewerId); - list.Add(Certification.Udid); - list.AddRange(parameters); - return list; - } - - private string GetHandUri(Dictionary data) - { - return (data["StockHandData"] as List)[0].ToString(); - } - - private void EmitMsgUriPack(Dictionary info, bool isGetableAck, bool isStockData, int fixedSeqNumber, bool isHandData = false) - { - string text = ""; - text = (isHandData ? GetHandUri(info) : info["uri"].ToString()); - if (_notEmit) - { - LocalLog.AccumulateLastTraceLog("EmitMsgUriPack _notEmit " + text); - } - else if (isGetableAck) - { - int num = stockEmitMessageMgr.SequenceNumber + 1; - if (fixedSeqNumber == -1) - { - LastEmitSeqNumber = stockEmitMessageMgr.SequenceNumber + 1; - stockEmitMessageMgr.AddSequenceNumber(); - } - else - { - num = fixedSeqNumber; - } - info.Add("pubSeq", num); - if (isHandData) - { - (info["StockHandData"] as List).Insert(3, num); - } - if (isStockData) - { - stockEmitMessageMgr.StockData(info); - List> sequenceAllData = stockEmitMessageMgr.GetSequenceAllData(); - if (sequenceAllData != null && sequenceAllData.Count == 1) - { - EmitFrontStockData(); - } - else if (isHandData) - { - LocalLog.AccumulateLastTraceLog("Emit StockHand " + Enum.GetName(typeof(NetworkBattleSender.HAND_URI_TYPE), int.Parse(text))); - } - else - { - LocalLog.AccumulateLastTraceLog("Emit Stock " + text); - } - } - else - { - EmitDataToAckCallBack(info); - } - } - else - { - if (text == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.InitNetwork]) - { - LocalLog.AccumulateLastTraceLog("EmitMsgUriPack_InitNetwork " + StackTraceUtility.ExtractStackTrace()); - } - _manager.Socket.Emit("msg", CreatePackEmitData(info)); - if (text != RoomParamKey.WatchUriNames[PlayerControllerForWatching.SEND_PARAMETER.Watch]) - { - string text2 = "Emit NotWait Uri " + info["uri"]; - NetworkLogger.LogInfo(text2); - LocalLog.AccumulateLastTraceLog(text2); - } - } - } - - public bool GetTurnState() - { - if (GameMgr.GetIns().GetNetworkUserInfoData().TurnState != 0) - { - return false; - } - return true; - } - - public void SetNetworkInfo(Dictionary synchronizeData, ref NetworkBattleDefine.NetworkBattleURI receiveUri) - { - foreach (KeyValuePair synchronizeDatum in synchronizeData) - { - switch (synchronizeDatum.Key) - { - case "uri": - { - string text = synchronizeDatum.Value.ToString(); - if (Enum.IsDefined(typeof(NetworkBattleDefine.NetworkBattleURI), text)) - { - receiveUri = (NetworkBattleDefine.NetworkBattleURI)Enum.Parse(typeof(NetworkBattleDefine.NetworkBattleURI), text); - if (text == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Matched]) - { - GameMgr.GetIns().InitializeSelfInfo(); - } - break; - } - Enum.IsDefined(typeof(PlayerController.ROOM_URI), text); - return; - } - case "selfInfo": - { - Dictionary info2 = synchronizeDatum.Value as Dictionary; - if (receiveUri != NetworkBattleDefine.NetworkBattleURI.BattleStart) - { - IsBattleStart = true; - GameMgr.GetIns().SettingSelfInfo(info2, isWatchReplayRecovery: false); - } - else - { - GameMgr.GetIns().SettingBattleStartSelfInfo(info2); - Wizard.Data.RoomTwoPickBeforeBattleInfo.SelfInfoClasIdCopyTwoPickDraftData(); - } - break; - } - case "selfDeck": - { - GameMgr ins = GameMgr.GetIns(); - List list = synchronizeDatum.Value as List; - ins.GetDataMgr().SetDeckMaxCount(list.Count, isSelf: true); - ins.SettingSelfDeck(synchronizeDatum.Value as List); - break; - } - case "turnState": - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = Convert.ToInt32(synchronizeDatum.Value); - break; - case "oppoInfo": - { - Dictionary info = synchronizeDatum.Value as Dictionary; - if (receiveUri != NetworkBattleDefine.NetworkBattleURI.BattleStart) - { - GameMgr.GetIns().SettingOpponentInfo(info, isWatchReplayRecovery: false); - } - else - { - GameMgr.GetIns().SettingBattleStartOpponentInfo(info); - } - break; - } - case "bid": - bid = synchronizeDatum.Value.ToString(); - break; - } - } - } - - public void FinishBattleTask() - { - if (_failedRecoveryToNotSendFinishTask) - { - LocalLog.AccumulateLastTraceLog("Finsish BattleTask Error"); - return; - } - if (CurrentMatchingStatus == MatchingStatus.Disconnected) - { - LocalLog.AccumulateLastTraceLog("FinishBattleTask Disconnected"); - return; - } - StopNetworkBattle(isNotCloseWindow: true); - if (_battleFinishSendBase == null) - { - _battleFinishSendBase = new BattleFinishSendBase(_networkBattleManager); - } - _battleFinishSendBase.SendMatchingFinish(FinishTaskBase, FinishResultSuccses); - FinishTaskBase = null; - } - - public void FinishBattleTask(BattleManagerBase battleMgr) - { - if (_failedRecoveryToNotSendFinishTask) - { - LocalLog.AccumulateLastTraceLog("Finsish BattleTask Error"); - return; - } - if (CurrentMatchingStatus == MatchingStatus.Disconnected) - { - LocalLog.AccumulateLastTraceLog("FinishBattleTask Disconnected"); - return; - } - StopNetworkBattle(isNotCloseWindow: true); - if (_battleFinishSendBase == null) - { - _battleFinishSendBase = new BattleFinishSendBase(battleMgr); - } - _battleFinishSendBase.SendMatchingFinish(FinishTaskBase, FinishResultSuccses); - FinishTaskBase = null; - } - - protected virtual void FinishResultSuccses(NetworkTask.ResultCode result) - { - LocalLog.AccumulateLastTraceLog("FinishResultSuccses" + result); - if (_isFinishResultSuccses) - { - return; - } - _isFinishResultSuccses = true; - LocalLog.RecordCheckLog(LocalLog.RecordType.HADES, _networkBattleManager.BattleResultType == BattleManagerBase.BATTLE_RESULT_TYPE.WIN); - _networkBattleManager.SettingNetworkBattleEnd(); - UIManager.GetInstance().dialogAllClear(); - NetworkBattleReceiver.RESULT_CODE judgeResultReceiveCode = _networkBattleManager.JudgeResultReceiveCode; - bool classDead = false; - if ((uint)(judgeResultReceiveCode - 105) <= 1u || (uint)(judgeResultReceiveCode - 201) <= 7u) - { - classDead = true; - } - _networkBattleManager.FinishBattleEffect(classDead); - if (judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.NoContest && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.DisconnectWin && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.DisconnectLose && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.Invalid && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.TurnendWin && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.TurnendLose && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.TurnstartWin && judgeResultReceiveCode != NetworkBattleReceiver.RESULT_CODE.TurnstartLose) - { - TaskManager.GetInstance().NotMyPageSend(); - } - if (judgeResultReceiveCode == NetworkBattleReceiver.RESULT_CODE.NoContest) - { - LocalLog.SendLastTraceLog(null); - } - if (_trySerializeList.Any()) - { - string text = string.Empty; - for (int i = 0; i < _trySerializeList.Count; i++) - { - text += _trySerializeList[i]; - } - LocalLog.AccumulateTraceLog(text); - _trySerializeList.Clear(); - } - DestroyObj(DESTROY_OBJECT_LOG.BattleResult); - } - - public void InitCurrentMatchingStatus() - { - CurrentMatchingStatus = MatchingStatus.OffLine; - } - - public void CallMaintenanceError() - { - ShowMaintenanceError(); - } - - protected virtual void ShowMaintenanceError() - { - Dialog.Create(5); - } - - public virtual void StopNetworkBattle(bool isNotCloseWindow = false) - { - } - - public void DestroyObj(DESTROY_OBJECT_LOG log) - { - NetworkLogger.ClearLog(); - int num = (int)log; - LocalLog.AccumulateLastTraceLog("RealtimeNetwork DestroyObj" + num); - ManagerClose(); - _onEveryTimeFail = null; - _onFinishedEmit = null; - OnReceivedEvent = null; - OnResultCodeError = null; - OnAck = null; - if (!_isAlreadyDestroyedGameObject) - { - _isAlreadyDestroyedGameObject = true; - UnityEngine.Object.Destroy(base.gameObject); - } - if (_gungnir != null) - { - _gungnir.Dispose(); - _gungnir = null; - } - } - - public virtual void StartRecovery(string battleId, int maxSequenceNumber, int currentSequenceNumber) - { - SetIsRecovery(flg: true); - bid = battleId; - stockReceiveMessageMgr.Recovery(maxSequenceNumber); - stockEmitMessageMgr.Recovery(currentSequenceNumber); - } - - public virtual void EndRecovery() - { - if (RecoveryManagerBase.failedRecoveryFlag) - { - _notEmit = true; - } - SetIsRecovery(flg: false); - } - - public virtual void GetRecoveryInfo(out string battleId, out int maxSequenceNumber, out int currentSequenceNumber, out int turnState_) - { - battleId = bid; - maxSequenceNumber = stockReceiveMessageMgr.SequenceAlreadyNumber; - currentSequenceNumber = stockEmitMessageMgr.SequenceNumber; - turnState_ = -1; - } - - public int GetCurrentSequenceNumber() - { - return stockEmitMessageMgr.SequenceNumber; - } - - protected bool IsDataHaveSequenceNumber(Dictionary data) - { - if (stockReceiveMessageMgr.IsNoStockData(data)) - { - return false; - } - return true; - } - - public void UpdateLastGungnirSuccessTime() - { - if (_gungnir != null) - { - _gungnir.Tick(); - } - } - - protected bool IsMatchingURI(string uri) - { - if (uri == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.InitBattle] || uri == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.InitRoomBattle] || uri == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Matched] || uri == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.InitNetwork]) - { - return true; - } - return false; - } - - public void SetRoomWatchMode(bool isWatchRoom) - { - _gungnir._isNotEmit = isWatchRoom; - } - - public void ClearStockEmitData() - { - stockEmitMessageMgr.ClearSequenceDataList(); - } - - public virtual void StartRecoveryRecording() - { - _networkBattleManager.StartRecoveryRecording(); - } - - public void ResetDisconnectLogNum() - { - _disconnectNum = 0; - _emitLogNum = 0; - } - - public void AddActionSequence() - { - _gungnir._actionSequenceNum++; - NetworkLogger.LogInfo("ActionSeq" + _gungnir._actionSequenceNum); - } - - public void SetEnableTimeOutCallBack(bool enable) - { - _gungnir.IsEnableTimeoutCallBack = enable; - } - - public int GetTurnSequence() - { - return _gungnir._actionSequenceNum; - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Wizard; + +// PASS-7 STUB: 1,495-line body dropped. RealTimeNetworkAgent is the client-side +// Socket.IO transport singleton — connect / emit / handle-receive / disconnect / recovery- +// record / gungnir-heartbeat. In the headless node the same wire moves through +// SessionBattleEngine and SVSim.BattleNode; ToolboxGame.RealTimeNetworkAgent is +// ambient-backed and returns null when no scope has attached a real agent (which +// is always for headless). The type still has to exist because callers hold field +// references (`NetworkStandardBattleMgr._agent` etc.) and use static methods +// (`RealTimeNetworkAgent.IsFromResumeData`, `IsNormalNetworkBattle`). +// +// This stub keeps the ~30 members callers touch, all as no-ops / default returns. +// The MonoBehaviour base + enums stay so the type surface stays wire-compatible. +// Any actual RTA invocation in headless would be a call on a null instance — +// which is the CURRENT behavior in production; the null-guards / `?.` patterns +// in call sites already handle it. +public class RealTimeNetworkAgent : MonoBehaviour +{ + public enum EmitCategory + { +} + + public enum MatchingStatus + { + Loaded = 40, + Prepared = 50 } + + public enum DESTROY_OBJECT_LOG + { + WatchMaintenance } + + public static FinishTaskBase FinishTaskBase; + public Action OnEmit; + public Action> OnAck; + public NetworkStatus OpponentNetworkStatus { get; protected set; } + public NetworkStatus PlayerNetworkStatus { get; private set; } + public bool IsReceiveSelfDisconnect => false; + public int LastEmitSeqNumber => 0; + public INetworkLogger NetworkLogger { get; protected set; } + public string NowSocketID => string.Empty; + + public int GetIsFirstPlayer() => 0; + public int GetViewId() => 0; + public long GetBattleId() => 0L; + public void SetCurrentMatchingStatus(MatchingStatus status) { } + public void SetNetworkBattleMgr(NetworkBattleManagerBase mgr) { } + + public static bool IsFromResumeData(Dictionary data) => false; + public static void ReconnectSocketAndLogFlagOn() { } + public static bool IsNormalNetworkBattle() => false; + + public object ReconnectSocket() => null; + public bool IsOpen() => false; + // The URI overload fires OnEmit — the O1 liveness signal that the test-side + // HeadlessEngineEnv (M13 EmitPathReadOracle) subscribes to. Preserving this call + // was the entire reason RTA still exists as a stub rather than being deleted. + public void EmitMsgPack(NetworkBattleDefine.NetworkBattleURI uri, Dictionary info = null, Action onFinishedSend = null, bool isGetableAck = true, int fixedSeqNumber = -1, bool isStockData = true, bool isNotActionSeq = false) + { + OnEmit?.Invoke(uri); + } + public void EmitHandData(List parameters, NetworkBattleSender.HAND_URI_TYPE uri, bool isSkipDuplicateCheck = false) { } + + public bool GetTurnState() => false; + public void FinishBattleTask() { } + public void CallMaintenanceError() { } + public virtual void StopNetworkBattle(bool isNotCloseWindow = false) { } + public void DestroyObj(DESTROY_OBJECT_LOG log) { } + public void ResetDisconnectLogNum() { } + public int GetTurnSequence() => 0; +} diff --git a/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfo.cs b/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfo.cs index df65cfd8..707b8c54 100644 --- a/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfo.cs +++ b/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfo.cs @@ -1,9 +1,4 @@ public class ReceiveFriendApplyInfo : HeaderData { public ReceiveFriendApplyInfoDetail data; - - public void Initizalize() - { - data = new ReceiveFriendApplyInfoDetail(); - } } diff --git a/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfoDetail.cs b/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfoDetail.cs index a1d872a4..61b27c9c 100644 --- a/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/ReceiveFriendApplyInfoDetail.cs @@ -2,7 +2,4 @@ using System.Collections.Generic; public class ReceiveFriendApplyInfoDetail { - public List applyList = new List(); - - public int approveApplyCount; } diff --git a/SVSim.BattleEngine/Engine/ReceiveIntervalTrigger.cs b/SVSim.BattleEngine/Engine/ReceiveIntervalTrigger.cs index 90fb5fef..2f7898e9 100644 --- a/SVSim.BattleEngine/Engine/ReceiveIntervalTrigger.cs +++ b/SVSim.BattleEngine/Engine/ReceiveIntervalTrigger.cs @@ -2,7 +2,6 @@ using Wizard; public class ReceiveIntervalTrigger { - private const float RECOVER_INTERVAL_FROM_OPPODISCONNECT = 3f; public virtual void ReceiveDataCheck(NetworkBattleManagerBase networkBattleManager, NetworkBattleData networkBattleData, bool isPlayer, bool isExTurn) { @@ -36,7 +35,7 @@ public class ReceiveIntervalTrigger { case NetworkBattleDefine.NetworkBattleURI.Ready: networkBattleManager.notMulliganEndToJudgeChecker.StopChecker(); - if (!ToolboxGame.RealTimeNetworkAgent.GetTurnState()) + if (!networkBattleManager.InstanceNetworkAgent.GetTurnState()) { networkBattleManager.opponentNotTurnStartToWinChecker.StartChecker(); } diff --git a/SVSim.BattleEngine/Engine/ReceivePlayActionsReflectionBase.cs b/SVSim.BattleEngine/Engine/ReceivePlayActionsReflectionBase.cs index abe49804..1d0f33fc 100644 --- a/SVSim.BattleEngine/Engine/ReceivePlayActionsReflectionBase.cs +++ b/SVSim.BattleEngine/Engine/ReceivePlayActionsReflectionBase.cs @@ -41,16 +41,6 @@ public abstract class ReceivePlayActionsReflectionBase protected OperateMgr _operateMgr; - private const float WAIT_TIME_AFTER_START_SHOW_SELECT = 0.3f; - - private const float WAIT_TIME_BETWEEN_CONSECUTIVE_SELECTIONS = 0.2f; - - private const float WAIT_TIME_AFTER_START_SHOW_CHOICE = 0.5f; - - private const float WAIT_TIME_AFTER_EVOLVE_CHOICE_SELECT = 0.15f; - - private const float WAIT_TIME_BETWEEN_CONSECUTIVE_CHOICE_SELECTIONS = 0.5f; - protected BattleCardBase _actingCard; protected List _selectedCards = new List(); @@ -94,16 +84,6 @@ public abstract class ReceivePlayActionsReflectionBase return actingCard.GetSelectSkillsNoDuplication(actingCard.GetSelectTypeSkill(isEvolve).ToList()); } - private VfxBase CreatePlayNonTransformChoiceCardVfx(BattleCardBase playedCard, List choiceCards, Transform transformToPlayFrom, BattlePlayerBase battlePlayer, List selectedChoiceCardIds, VfxBase battleCardSelectVfx) - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(battleCardSelectVfx, CreateHideChoiceCardsVfx(playedCard, choiceCards), InstantVfx.Create(delegate - { - playedCard.BattleCardView.Transform.position = transformToPlayFrom.position; - playedCard.BattleCardView.GameObject.SetActive(value: true); - }), _operateMgr.InitSetCard(playedCard, battlePlayer.IsPlayer, isSelect: false, isRecovery: false, isChoiceSelect: true, isAccelerateSelect: false, registerDirectlyToVfxManager: false)); - return SequentialVfxPlayer.Create(parallelVfxPlayer, _operateMgr.PlayCard(playedCard, battlePlayer.IsPlayer, null, isRecovery: false, selectedChoiceCardIds)); - } - public static VfxBase CreateHideChoiceCardsVfx(BattleCardBase actingCard, List choiceCardsToHide, bool dontUnloadResources = false) { return InstantVfx.Create(delegate @@ -238,7 +218,7 @@ public abstract class ReceivePlayActionsReflectionBase { ChoiceUtility.SetupChoiceCardForSkillTargetSelect(selectedChoiceCard); })); - sequentialVfxPlayer2.Register(new DelaySetupVfx(() => _operateMgr.InitSetCard(selectedChoiceCard, isPlayer, isSelect: true))); + sequentialVfxPlayer2.Register(NullVfx.GetInstance()); sequentialVfxPlayer2.Register(CreateStartSelectVfx(selectedChoiceCard, isEvolve: false, isChoice: true)); parallelVfxPlayer.Register(sequentialVfxPlayer2); parallelVfxPlayer.Register(CreateHideChoiceCardsVfx(_actingChoiceCard, _choiceCards.FindAll((BattleCardBase card) => card != selectedChoiceCard), dontUnloadResources: true)); @@ -255,7 +235,7 @@ public abstract class ReceivePlayActionsReflectionBase })); } parallelVfxPlayer.Register(CreateHideChoiceCardsVfx(_actingChoiceCard, _choiceCards)); - CompleteChoiceDataIns.SetChoiceCardVfx(new DelaySetupVfx(() => _operateMgr.PlayCard(_actingChoiceCard, isPlayer, null, isRecovery: false, selectedChoiceCardIdList, isChoiceBrave))); + CompleteChoiceDataIns.SetChoiceCardVfx(NullVfx.GetInstance()); } } else if (isEvolve) @@ -266,7 +246,7 @@ public abstract class ReceivePlayActionsReflectionBase } else { - CompleteChoiceDataIns.SetChoiceCardVfx(new DelaySetupVfx(() => CreatePlayNonTransformChoiceCardVfx(_actingChoiceCard, _choiceCards, selectedChoiceCard.BattleCardView.Transform.parent, battlePlayer, selectedChoiceCardIdList, battleCardSelectVfx))); + CompleteChoiceDataIns.SetChoiceCardVfx(NullVfx.GetInstance()); } sequentialVfxPlayer.Register(parallelVfxPlayer); _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); @@ -318,7 +298,7 @@ public abstract class ReceivePlayActionsReflectionBase if (selectableCards.Count > 0) { sequentialVfxPlayer.Register(GetSelectAlertvfx(battlePlayer)); - sequentialVfxPlayer.Register(battlePlayer.BattleView.StartShowSelect(GameMgr.GetIns().IsReplayBattle ? battleCardBase : _actingCard, _currentSkill, selectableCards, isEvolve)); + sequentialVfxPlayer.Register(battlePlayer.BattleView.StartShowSelect(_battleMgr.GameMgr.IsReplayBattle ? battleCardBase : _actingCard, _currentSkill, selectableCards, isEvolve)); } else { @@ -366,46 +346,6 @@ public abstract class ReceivePlayActionsReflectionBase return sequentialVfxPlayer; } - protected VfxBase CreateStartFusionSelectVfx(BattleCardBase fusionCard) - { - _actingCard = fusionCard; - _selectSkills = fusionCard.Skills.Where((SkillBase s) => s is Skill_fusion).ToList(); - _fusionMetamorphoseSkill = fusionCard.Skills.FirstOrDefault((SkillBase s) => s is Skill_fusion_metamorphose) as Skill_fusion_metamorphose; - _currentSkill = _selectSkills.FirstOrDefault(); - _selectedChoiceCards.Clear(); - _isBurialRiteSelect = false; - _selectedCards.Clear(); - _selectableCards = GetSelectableCards(fusionCard.IsPlayer); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattlePlayerBase battlePlayerBase = _battleMgr.GetBattlePlayer(fusionCard.IsPlayer); - if (!fusionCard.HasNoSelectFusionSkill) - { - sequentialVfxPlayer.Register(GetSelectAlertvfx(battlePlayerBase)); - } - if (fusionCard.IsPlayer) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - fusionCard.BattleCardView.HideHandCardInfo(); - fusionCard.BattleCardView.GameObject.transform.localEulerAngles = FusionTargetSelectTouchProcessor.INIT_LOCAL_EULAR_ANGLE; - battlePlayerBase.BattleView.PlayQueueView.AddCardToViewVfx(fusionCard.BattleCardView, forceCardIntoPlayQueue: true, isSelectTarget: true, isChoice: false); - })); - } - else - { - fusionCard.BattleCardView.HideHandCardInfo(); - fusionCard.BattleCardView.GameObject.transform.localEulerAngles = FusionTargetSelectTouchProcessor.INIT_LOCAL_EULAR_ANGLE; - sequentialVfxPlayer.Register(battlePlayerBase.BattleView.PlayQueueView.AddCardToViewVfx(fusionCard.BattleCardView, forceCardIntoPlayQueue: true, isSelectTarget: true, isChoice: false)); - } - sequentialVfxPlayer.Register(battlePlayerBase.BattleView.StartShowSelect(fusionCard, _currentSkill, _selectableCards, isEvol: false)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - battlePlayerBase.BattleView.StartShowFusionUI(_actingCard, _selectableCards, 8, null); - battlePlayerBase.ClassInformationUIController.SetIsSelect(isSelect: true); - })); - return sequentialVfxPlayer; - } - public virtual void SelectFusionIngredientCard(int cardIndex, bool isPlayer = true) { BattlePlayerBase battlePlayer = _battleMgr.GetBattlePlayer(isPlayer); @@ -442,7 +382,7 @@ public abstract class ReceivePlayActionsReflectionBase { InstantVfx selectCardVfx = InstantVfx.Create(delegate { - BattleManagerBase.GetIns().GetBattlePlayer(isPlayer).ClassInformationUIController.SetIsSelect(isSelect: false); + _battleMgr.GetBattlePlayer(isPlayer).ClassInformationUIController.SetIsSelect(isSelect: false); }); _actingCard.SelfBattlePlayer.BattleView.StopFusionUI(); CompleteSelectDataIns = new CompleteSelectData(selectCardVfx); @@ -471,7 +411,7 @@ public abstract class ReceivePlayActionsReflectionBase return InstantVfx.Create(delegate { string text = ""; - if (GameMgr.GetIns().IsWatchBattle) + if (_battleMgr.GameMgr.IsWatchBattle) { SystemText systemText = Data.SystemText; text = (battlePlayer.IsPlayer ? systemText.Get("Battle_0501") : systemText.Get("Battle_0502")); @@ -483,23 +423,6 @@ public abstract class ReceivePlayActionsReflectionBase }); } - protected VfxBase CreateStartChoiceSelectVfx(BattleCardBase actingCard, SkillBase choiceSkill, bool isEvolve, BattleCardBase accelerateCard) - { - BattlePlayerBase battlePlayer = _battleMgr.GetBattlePlayer(actingCard.IsPlayer); - _actingChoiceCard = actingCard; - _choiceCards = ChoiceUtility.CreateChoiceTokenCards(actingCard, battlePlayer.BattleView, choiceSkill, _battleMgr); - _selectedChoiceCards.Clear(); - _choiceSkill = choiceSkill; - _numberOfChoiceCardsToSelect = ChoiceUtility.GetNumberOfCardsToSelect(choiceSkill); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (isEvolve) - { - parallelVfxPlayer.Register(new StopEvolutionTargetFocasVfx(actingCard.BattleCardView.GameObject)); - } - parallelVfxPlayer.Register(battlePlayer.BattleView.StartShowChoice(_actingChoiceCard, choiceSkill, _choiceCards, isEvolve, accelerateCard, isChoiceBrave: false)); - return parallelVfxPlayer; - } - private BattleCardBase GetSelectedChoiceCard(int selectedChoiceCardId, List choiceCards) { return choiceCards.Find((BattleCardBase card) => card.CardId == selectedChoiceCardId); diff --git a/SVSim.BattleEngine/Engine/ReceiveReward.cs b/SVSim.BattleEngine/Engine/ReceiveReward.cs index 2a321c5d..5cd35881 100644 --- a/SVSim.BattleEngine/Engine/ReceiveReward.cs +++ b/SVSim.BattleEngine/Engine/ReceiveReward.cs @@ -14,16 +14,6 @@ public class ReceiveReward : MonoBehaviour private List _allItem = new List(); - private const int RECEIVE_ITEM_CENTER_IF_LESS = 3; - - private const float ITEM_MOVE_TIME = 0.2f; - - private const float ITEM_MOVE_X = 800f; - - private const int OBJ_BUTTON_TABLE = 1; - - private const int LABEL_NOT_USABLE = 2; - public DialogBase ShowReadDialog(List texts, GameObject itemPrefab, GameObject current, ResourceHandler resourceHandler, DialogBase dialog = null) { if (texts == null) @@ -203,7 +193,7 @@ public class ReceiveReward : MonoBehaviour { itemPart.SetActive(value: false); }; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_GIFT_ALL); + RemoveITween(itemPart); iTween.MoveTo(itemPart, iTween.Hash("x", itemOriginalX + 800f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad, "oncomplete", "DoAction", "oncompletetarget", base.gameObject, "oncompleteparams", action)); expandButton.gameObject.SetActive(value: false); @@ -235,7 +225,7 @@ public class ReceiveReward : MonoBehaviour uIButton.transform.localScale = orig.transform.localScale; uIButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + action(); })); return uIButton; @@ -297,12 +287,6 @@ public class ReceiveReward : MonoBehaviour } } - public static string SetTicketTitle(int itemId, int count) - { - Item itemData = Item.GetItemData(UserGoods.Type.Item, itemId); - return string.Format(itemData.unitFormat, itemData.name, count); - } - public static void SetTexture(UserGoods.Type type, UITexture tex, ResourceHandler resourceHandler) { string texName = UserGoods.GetUserGoodsImageName(type, 0L); diff --git a/SVSim.BattleEngine/Engine/ReceivedReward.cs b/SVSim.BattleEngine/Engine/ReceivedReward.cs index d92fd492..2fb47147 100644 --- a/SVSim.BattleEngine/Engine/ReceivedReward.cs +++ b/SVSim.BattleEngine/Engine/ReceivedReward.cs @@ -106,11 +106,6 @@ public class ReceivedReward return receivedReward; } - public static ReceivedReward CreateFromBingoMissionReward(JsonData data) - { - return CreateFromCommonResponce(data); - } - private static ReceivedReward CreateFromCommonResponce(JsonData data) { return new ReceivedReward diff --git a/SVSim.BattleEngine/Engine/RecoveryOperationCollection.cs b/SVSim.BattleEngine/Engine/RecoveryOperationCollection.cs index 79a011dd..b171f537 100644 --- a/SVSim.BattleEngine/Engine/RecoveryOperationCollection.cs +++ b/SVSim.BattleEngine/Engine/RecoveryOperationCollection.cs @@ -12,7 +12,7 @@ public class RecoveryOperationCollection : WatchOperationCollection public override void SecondMulliganOperation(Func, VfxBase> OnReceiveOpponentMulligan, Func, VfxBase> OnReceivePlayerMulligan, Func OnEndMulligan) { OperateMulligan(OnReceiveOpponentMulligan, OnReceivePlayerMulligan); - BattleManagerBase.GetIns().BattlePlayer.IsTurnStartEffectNotFinished = true; + _networkBattleMgr.BattlePlayer.IsTurnStartEffectNotFinished = true; _networkBattleMgr.VfxMgr.RegisterSequentialVfx(OnEndMulligan.GetAllFuncVfxResults()); } diff --git a/SVSim.BattleEngine/Engine/RedShellUnity/RedShell.cs b/SVSim.BattleEngine/Engine/RedShellUnity/RedShell.cs deleted file mode 100644 index 35715cb3..00000000 --- a/SVSim.BattleEngine/Engine/RedShellUnity/RedShell.cs +++ /dev/null @@ -1,96 +0,0 @@ -using com.adjust.sdk; -using RedShellSDK; -using UnityEngine; - -namespace RedShellUnity; - -public class RedShell : MonoBehaviour -{ - private static RedShell instance; - - private static bool quitting; - - private static bool verboseLogs; - - public static void SetApiKey(string apiKey) - { - if (!Adjust.IsEditor()) - { - _ = verboseLogs; - setupInstance(); - global::RedShellSDK.RedShellSDK.SetApiKey(apiKey); - } - } - - public static void SetUserId(string userId) - { - if (!Adjust.IsEditor()) - { - _ = verboseLogs; - setupInstance(); - global::RedShellSDK.RedShellSDK.SetUserId(userId); - } - } - - public static void SetVerboseLogs(bool verboseLogs) - { - if (!Adjust.IsEditor()) - { - RedShell.verboseLogs = verboseLogs; - setupInstance(); - global::RedShellSDK.RedShellSDK.SetVerboseLogs(verboseLogs); - } - } - - public static void MarkConversion() - { - if (!Adjust.IsEditor()) - { - _ = verboseLogs; - setupInstance(); - instance.StartCoroutine(global::RedShellSDK.RedShellSDK.MarkConversion()); - } - } - - public static void LogEvent(string type) - { - if (!Adjust.IsEditor()) - { - _ = verboseLogs; - setupInstance(); - instance.StartCoroutine(global::RedShellSDK.RedShellSDK.LogEvent(type)); - } - } - - private void Awake() - { - if (!Adjust.IsEditor()) - { - if (instance != null) - { - Object.Destroy(base.gameObject.GetComponent()); - return; - } - instance = this; - Object.DontDestroyOnLoad(base.gameObject); - } - } - - private void OnDestroy() - { - if (!(instance != this)) - { - quitting = true; - instance = null; - } - } - - private static void setupInstance() - { - if (!Adjust.IsEditor() && !quitting && instance == null) - { - _ = verboseLogs; - instance = new GameObject("Red Shell").AddComponent(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/RegisterActionBase.cs b/SVSim.BattleEngine/Engine/RegisterActionBase.cs index c4f1518e..0ef6f6ef 100644 --- a/SVSim.BattleEngine/Engine/RegisterActionBase.cs +++ b/SVSim.BattleEngine/Engine/RegisterActionBase.cs @@ -18,7 +18,6 @@ public class RegisterActionBase EARTH_RITUAL = 1001, EARTH_MARK = 1002, SPELL_CHARGE_ALL = 1003, - NOT_SPELL_CHARGE_ALL = 2004, WHEN_DESTROY = 1004, NOT_WHEN_DESTROY = 1104, UNION_BURST = 1005, @@ -50,7 +49,6 @@ public class RegisterActionBase tribe, baseCardId, state, - skillTarget, condition, excludeList, rand, @@ -63,9 +61,7 @@ public class RegisterActionBase atk, life, baseAtk, - baseLife, hasBuffLife, - exec_order, group, conditions, includeList, @@ -80,7 +76,6 @@ public class RegisterActionBase add, del, attachTarget, - element, repeat, isBase, var, @@ -114,8 +109,6 @@ public class RegisterActionBase public bool IsSelf; - public string UriName = ""; - public int EffectSkillPublicCount; public int EffectSkillMovement; diff --git a/SVSim.BattleEngine/Engine/RegisterAlter.cs b/SVSim.BattleEngine/Engine/RegisterAlter.cs index 94db1414..d296afc4 100644 --- a/SVSim.BattleEngine/Engine/RegisterAlter.cs +++ b/SVSim.BattleEngine/Engine/RegisterAlter.cs @@ -6,7 +6,6 @@ public class RegisterAlter : RegisterActionBase public enum ChangeType { add, - set, half } diff --git a/SVSim.BattleEngine/Engine/RegisterAttach.cs b/SVSim.BattleEngine/Engine/RegisterAttach.cs index cf2c4881..498ff789 100644 --- a/SVSim.BattleEngine/Engine/RegisterAttach.cs +++ b/SVSim.BattleEngine/Engine/RegisterAttach.cs @@ -21,10 +21,6 @@ public class RegisterAttach : RegisterAlter private string _other = string.Empty; - private const string ON_OTHER = "o"; - - private const string ON_WHEN_DESTROY = "l"; - private bool _isBoard; private bool _isDelete; @@ -82,7 +78,7 @@ public class RegisterAttach : RegisterAlter { Skill_attach_skill skill_attach_skill = skill as Skill_attach_skill; _other = (skill_attach_skill.AttachWhenDestroy ? "l" : "o"); - NetworkBattleManagerBase networkBattleMgr = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + NetworkBattleManagerBase networkBattleMgr = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; Func, SkillConditionCheckerOption, SkillProcessor, VfxBase> value = delegate { RegisterAttach data = new RegisterAttach(cardList, skill, isDelete: true); @@ -141,7 +137,7 @@ public class RegisterAttach : RegisterAlter { dictionary.Add(ActionBaseParameter.forHandResident.ToString(), 1); } - if (BattleManagerBase.GetIns() is NetworkBattleManagerBase networkBattleManagerBase && networkBattleManagerBase.RegisterActionManager.RegisterDataList.Any((RegisterActionBase r) => r is RegisterMetamorphoseData) && _skill.OnWhenDrawOtherStart != 0 && _skill.IsHaveApplicableTargetFilter()) + if (_skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase networkBattleManagerBase && networkBattleManagerBase.RegisterActionManager.RegisterDataList.Any((RegisterActionBase r) => r is RegisterMetamorphoseData) && _skill.OnWhenDrawOtherStart != 0 && _skill.IsHaveApplicableTargetFilter()) { dictionary.Add(ActionBaseParameter.isForce.ToString(), 1); } diff --git a/SVSim.BattleEngine/Engine/RegisterChoiceAdd.cs b/SVSim.BattleEngine/Engine/RegisterChoiceAdd.cs index edc53a0c..f0e57ec1 100644 --- a/SVSim.BattleEngine/Engine/RegisterChoiceAdd.cs +++ b/SVSim.BattleEngine/Engine/RegisterChoiceAdd.cs @@ -50,15 +50,6 @@ public class RegisterChoiceAdd : RegisterToken return dictionary; } - public static bool IsChoiceTokenDrawSkill(SkillBase skill) - { - if (skill is Skill_token_draw && skill.ApplyingTargetFilter is SkillTargetChosenCardsFilter) - { - return true; - } - return false; - } - public override bool IsMatchData(RegisterToken baseToken, RegisterToken checkToken) { if (base.IsMatchData(baseToken, checkToken) && baseToken is RegisterChoiceAdd && checkToken is RegisterChoiceAdd) diff --git a/SVSim.BattleEngine/Engine/RegisterCostChangeCard.cs b/SVSim.BattleEngine/Engine/RegisterCostChangeCard.cs index 2c583daf..977f8133 100644 --- a/SVSim.BattleEngine/Engine/RegisterCostChangeCard.cs +++ b/SVSim.BattleEngine/Engine/RegisterCostChangeCard.cs @@ -23,12 +23,8 @@ public class RegisterCostChangeCard : RegisterAlter private ICardCostModifier _costModifier; - private const string FOR_HAND_RESIDENT = "forHandResident"; - public CostChangeType CostChangeTypeVal { get; private set; } - public int Index => base.IndexList[0]; - public RegisterCostChangeCard(BattleManagerBase mgr, RegisterActionManager registerActionManager, ICardCostModifier costModifier, List cards, SkillBase skill, SkillConditionCheckerOption option, RegisterTargetBase registerTarget = null, bool isNotCheckCard = false) : base(cards, skill) { diff --git a/SVSim.BattleEngine/Engine/RegisterDeckOut.cs b/SVSim.BattleEngine/Engine/RegisterDeckOut.cs index 2ddd0a1a..8436888b 100644 --- a/SVSim.BattleEngine/Engine/RegisterDeckOut.cs +++ b/SVSim.BattleEngine/Engine/RegisterDeckOut.cs @@ -1,6 +1,5 @@ public class RegisterDeckOut : RegisterActionBase { - private const string DECKOUT = "deckout"; public RegisterDeckOut(bool isSelf) { diff --git a/SVSim.BattleEngine/Engine/RegisterFilter.cs b/SVSim.BattleEngine/Engine/RegisterFilter.cs index c5a78a32..8bb7939e 100644 --- a/SVSim.BattleEngine/Engine/RegisterFilter.cs +++ b/SVSim.BattleEngine/Engine/RegisterFilter.cs @@ -118,14 +118,6 @@ public class RegisterFilter : RegisterTargetBase return null; } - public void SettingExecOrder(RegisterActionBase registerData) - { - if (registerData != null) - { - SettingGroupIndexMsg(registerData); - } - } - public static bool IsNeedFilter(BattleManagerBase mgr, bool isplayer, SkillBase skill, IEnumerable cardList, bool isStop) { if (!isStop && (skill.ApplyingTargetFilter is SkillTargetHandFilter || skill.ApplyingTargetFilter is SkillTargetHandOtherSelfFilter)) @@ -288,31 +280,14 @@ public class RegisterFilter : RegisterTargetBase return flag; } - public static bool IsSkillUpdateDeckCard(SkillBase skill) - { - if (!(skill is Skill_powerup)) - { - return false; - } - bool flag = skill.ApplyingTargetFilter is SkillTargetSkillUpdateDeckCardFilter; - if (skill.ApplyAndFilter.Count > 0) - { - for (int i = 0; i < skill.ApplyAndFilter.Count; i++) - { - flag |= skill.ApplyAndFilter[i].TargetFilter is SkillTargetSkillUpdateDeckCardFilter; - } - } - return flag; - } - public static bool IsFilterCardUnapproved(SkillBase skill) { if (skill.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter) { return false; } - bool isWatchBattle = GameMgr.GetIns().IsWatchBattle; - bool flag = GameMgr.GetIns().IsAdmin || (isWatchBattle && skill.SkillPrm.ownerCard.IsPlayer); + bool isWatchBattle = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsWatchBattle; + bool flag = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdmin || (isWatchBattle && skill.SkillPrm.ownerCard.IsPlayer); if (skill is Skill_spell_charge || skill is Skill_discard || skill is Skill_destroy || skill is Skill_banish || skill is Skill_powerup || skill is Skill_attach_skill || skill is Skill_update_deck || (skill is Skill_metamorphose && (!flag || !(skill.ApplyingTargetFilter is SkillTargetInHandCardFilter))) || (skill is Skill_change_affiliation && (!isWatchBattle || !skill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.TargetFilter is SkillTargetHandOtherSelfFilter || f.TargetFilter is SkillTargetDeckFilter)))) { return true; diff --git a/SVSim.BattleEngine/Engine/RegisterLotCardBase.cs b/SVSim.BattleEngine/Engine/RegisterLotCardBase.cs index 334b6f04..b5e07e78 100644 --- a/SVSim.BattleEngine/Engine/RegisterLotCardBase.cs +++ b/SVSim.BattleEngine/Engine/RegisterLotCardBase.cs @@ -83,11 +83,6 @@ public class RegisterLotCardBase : RegisterTargetBase TargetPlaceStateList.Add(new TargetPlaceData(nowGroupIndex, cardPlaceState)); } - public BattleCardBase GetLotSkillCard() - { - return LotSkillCard; - } - public override void SettingGroupIndexMsg(RegisterActionBase registerBase) { if (registerBase is RegisterStateChangeCard) diff --git a/SVSim.BattleEngine/Engine/RegisterShortageDeckWin.cs b/SVSim.BattleEngine/Engine/RegisterShortageDeckWin.cs index ca2d4632..0623d19b 100644 --- a/SVSim.BattleEngine/Engine/RegisterShortageDeckWin.cs +++ b/SVSim.BattleEngine/Engine/RegisterShortageDeckWin.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; public class RegisterShortageDeckWin : RegisterActionBase { - public int ExtraTurnNum { get; private set; } public RegisterShortageDeckWin(bool isSelf) { diff --git a/SVSim.BattleEngine/Engine/RegisterSkillConditionCheck.cs b/SVSim.BattleEngine/Engine/RegisterSkillConditionCheck.cs index 36be0fe7..91935182 100644 --- a/SVSim.BattleEngine/Engine/RegisterSkillConditionCheck.cs +++ b/SVSim.BattleEngine/Engine/RegisterSkillConditionCheck.cs @@ -85,32 +85,6 @@ public class RegisterSkillConditionCheck : RegisterActionBase private bool _isExcludePlayIdx; - private const string DECK_MSG = "deck"; - - private const string HAND_MSG = "hand"; - - private const string DISCARD_MSG = "discarded"; - - private const string DAMAGE_MSG = "damage"; - - private const string HEAL_MSG = "healing"; - - private const string ADD_OFFENSE_MSG = "add_offense"; - - private const string ADD_LIFE_MSG = "add_life"; - - private const string ADD_PP_MSG = "add_pp"; - - private const string REPEAT_COUNT_MG = "repeat_count"; - - private const string GAIN_COUNT_MSG = "gain_chant"; - - public const string HIGH_LANDER_MSG = "unique_base_card_id_card.count"; - - private const string UNIQUE_BASE_CARD_ID_CARD_MSG = "unique_base_card_id_card"; - - private const string EXCLUDE_TRIBE_MSG = "tribe!="; - private static List DeckKeywordList = new List { SkillFilterCreator.ContentKeyword.deck }; private static List HandKeywordList = new List @@ -868,7 +842,7 @@ public class RegisterSkillConditionCheck : RegisterActionBase dictionary.Add(ActionBaseParameter.skillIdx.ToString(), num); dictionary.Add(ActionBaseParameter.skillCount.ToString(), SkillPublishedCount); dictionary.Add(ActionBaseParameter.type.ToString(), ConditionType.ToString()); - int expectCount = ((NetworkStandardBattleMgr)BattleManagerBase.GetIns()).GetExpectCount(SkillPublishedCount); + int expectCount = ((NetworkStandardBattleMgr)Skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr).GetExpectCount(SkillPublishedCount); if (!IsSelf && expectCount != -1) { dictionary.Add(ActionBaseParameter.expect.ToString(), expectCount); diff --git a/SVSim.BattleEngine/Engine/RegisterTargetBase.cs b/SVSim.BattleEngine/Engine/RegisterTargetBase.cs index b1c013ce..e04258bd 100644 --- a/SVSim.BattleEngine/Engine/RegisterTargetBase.cs +++ b/SVSim.BattleEngine/Engine/RegisterTargetBase.cs @@ -97,8 +97,6 @@ public class RegisterTargetBase : RegisterActionBase protected int SkillMovementNum; - protected const string GroupeMsg = "g"; - protected BattleManagerBase BattleMgr; protected RegisterActionManager RegisterActionManagerData; diff --git a/SVSim.BattleEngine/Engine/RegisterTool.cs b/SVSim.BattleEngine/Engine/RegisterTool.cs index aa00a930..342e88a2 100644 --- a/SVSim.BattleEngine/Engine/RegisterTool.cs +++ b/SVSim.BattleEngine/Engine/RegisterTool.cs @@ -19,7 +19,6 @@ public class RegisterTool evolution, skillConditionCheck, scan, - playEnhance, reverseDeckOut, playCount, extract, @@ -27,21 +26,9 @@ public class RegisterTool openMyCards } - private const string GREATER_THAN = "gt"; - - private const string LESS_THAN = "lt"; - - public const string GREATER_THAN_OR_EQUAL = "ge"; - - public const string LESS_THAN_OR_EQUAL = "le"; - - public const string EQUAL = "eq"; - - public const string NOT_EQUAL = "ne"; - public static string MakeCostFromSkillDestroyed(BattleManagerBase mgr, bool isPlayer, int destroyCount, CardDataModel unapprovedCard) { - if (unapprovedCard == null || GameMgr.GetIns().IsWatchBattle) + if (unapprovedCard == null /* Pre-Phase-5b: IsWatchBattle const-false */) { return ""; } diff --git a/SVSim.BattleEngine/Engine/RegisterUnapproved.cs b/SVSim.BattleEngine/Engine/RegisterUnapproved.cs index 594b3d1d..8230b6c3 100644 --- a/SVSim.BattleEngine/Engine/RegisterUnapproved.cs +++ b/SVSim.BattleEngine/Engine/RegisterUnapproved.cs @@ -28,8 +28,6 @@ public class RegisterUnapproved public int Movement { get; private set; } - public int SkillAttachIdx { get; private set; } - public List RandomTargetIdx { get; private set; } public List SkillKeyCardIdxList { get; private set; } diff --git a/SVSim.BattleEngine/Engine/RegisterValidate.cs b/SVSim.BattleEngine/Engine/RegisterValidate.cs index cf463568..f12722ca 100644 --- a/SVSim.BattleEngine/Engine/RegisterValidate.cs +++ b/SVSim.BattleEngine/Engine/RegisterValidate.cs @@ -250,15 +250,6 @@ public class RegisterValidate : RegisterActionBase base.IndexList.Add(index); } - public static bool IsIncludesValidateCard(SkillBase skill) - { - if (skill.SkillPrm.ownerCard.Skills.ToList().Find((SkillBase x) => IsValidateCard(x)) == null) - { - return false; - } - return true; - } - public static bool IsValidateCard(SkillBase skill) { if (NetworkBattleGenericTool.IsTargetDeckSelf(skill)) @@ -335,20 +326,6 @@ public class RegisterValidate : RegisterActionBase return true; } - public static bool IsReferenceSelfStatusSkill(SkillBase skill) - { - List checkString = new List { "self.life" }; - int i; - for (i = 0; i < checkString.Count; i++) - { - if (skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains(checkString[i]))) - { - return true; - } - } - return false; - } - public override Dictionary MakeSendData() { Dictionary dictionary = new Dictionary(); diff --git a/SVSim.BattleEngine/Engine/RepeatSkillEffectVfx.cs b/SVSim.BattleEngine/Engine/RepeatSkillEffectVfx.cs index d9d2f3fb..a85568b2 100644 --- a/SVSim.BattleEngine/Engine/RepeatSkillEffectVfx.cs +++ b/SVSim.BattleEngine/Engine/RepeatSkillEffectVfx.cs @@ -3,15 +3,14 @@ using Wizard.Battle.View.Vfx; public class RepeatSkillEffectVfx : SequentialVfxPlayer { - private const float WAIT_REPEAT_TIME = 1f; - public RepeatSkillEffectVfx(IBattleCardView cardView, string repeatTiming, bool isSelf) + public RepeatSkillEffectVfx(BattleManagerBase mgr, IBattleCardView cardView, string repeatTiming, bool isSelf) { if (cardView != null && !(cardView.GameObject == null) && repeatTiming == "when_destroy") { - Register(new LoadAndPlayEffectVfx("btl_unique_twilightqueen_2", "se_btl_unique_twilightqueen_2", cardView.Transform, 0f)); + Register(VfxWithLoadingSequential.Create()); Register(WaitVfx.Create(1f)); - BattleManagerBase.GetIns().OperateMgr.CallOnShowRepeatSkillEffect(isSelf); + mgr.OperateMgr.CallOnShowRepeatSkillEffect(isSelf); } } } diff --git a/SVSim.BattleEngine/Engine/ReplaceReceivedCard.cs b/SVSim.BattleEngine/Engine/ReplaceReceivedCard.cs index 441e175b..b9f76754 100644 --- a/SVSim.BattleEngine/Engine/ReplaceReceivedCard.cs +++ b/SVSim.BattleEngine/Engine/ReplaceReceivedCard.cs @@ -115,7 +115,7 @@ public class ReplaceReceivedCard bool flag2 = _machineGoddessCardIdList.Contains(cardParameterFromId.BaseCardId); if (_originalDummyCard == null) { - if (!GameMgr.GetIns().IsWatchBattle && (flag || flag2)) + if (!_networkBattleMgr.GameMgr.IsWatchBattle && (flag || flag2)) { _networkBattleMgr.AddNotReplaceCardList(new CardIdAndIndex(CardId, CardIdx, battlePlayer.IsPlayer, _playCardCost)); return null; @@ -161,7 +161,7 @@ public class ReplaceReceivedCard protected virtual BattleCardBase CreateActualCard(BattlePlayerBase battlePlayer, bool isCardInDeck, bool isOpenDrawSkill) { BattleCardBase battleCardBase = _networkBattleMgr.CreateBattleCardWithGameObject(new BattleManagerBase.CardCreateInfo(CardId, battlePlayer.IsPlayer, isChoice: false, NetworkBattleDefine.NetworkCardPlaceState.None), new BattleManagerBase.IndexInfo(CardIdx), -1, isVirtual: false, isActualCard: true); - if (!GameMgr.GetIns().IsWatchBattle && _isOpen && _fromState == NetworkBattleDefine.NetworkCardPlaceState.Deck && _toStateList.Contains(NetworkBattleDefine.NetworkCardPlaceState.Banish) && battleCardBase.Skills.Any((SkillBase s) => s is Skill_banish && s.OnWhenDraw != 0 && s.ApplyingTargetFilter is SkillTargetSelfFilter)) + if (!_networkBattleMgr.GameMgr.IsWatchBattle && _isOpen && _fromState == NetworkBattleDefine.NetworkCardPlaceState.Deck && _toStateList.Contains(NetworkBattleDefine.NetworkCardPlaceState.Banish) && battleCardBase.Skills.Any((SkillBase s) => s is Skill_banish && s.OnWhenDraw != 0 && s.ApplyingTargetFilter is SkillTargetSelfFilter)) { return CardCreatorBase.GetDummyInstance(); } @@ -678,9 +678,9 @@ public class ReplaceReceivedCard InheritedAddParameter(cardBeforeChangeParameter); receivedCard.BattleCardView.UpdateParameterView(cardBeforeChangeParameter.Atk, cardBeforeChangeParameter.Life, (receivedCard.FixedUseCost != -1) ? receivedCard.FixedUseCost : cost, receivedCard.BaseParameter.CardName, receivedCard.IsInplay, isRecovery: false, useNormalCost: true); } - if (ToolboxGame.RealTimeNetworkAgent != null && !_networkBattleMgr.IsBattleEnd) + if (_networkBattleMgr.InstanceNetworkAgent != null && !_networkBattleMgr.IsBattleEnd) { - ToolboxGame.RealTimeNetworkAgent.StartCoroutine(WaitToReady(receivedCard, dummyCardView.GameObject)); + _networkBattleMgr.InstanceNetworkAgent.StartCoroutine(WaitToReady(receivedCard, dummyCardView.GameObject)); } else { diff --git a/SVSim.BattleEngine/Engine/ReplayBattleEnemy.cs b/SVSim.BattleEngine/Engine/ReplayBattleEnemy.cs deleted file mode 100644 index b4d3b823..00000000 --- a/SVSim.BattleEngine/Engine/ReplayBattleEnemy.cs +++ /dev/null @@ -1,264 +0,0 @@ -using System.Collections.Generic; -using Wizard; -using Wizard.Battle; -using Wizard.Battle.UI; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class ReplayBattleEnemy : BattleEnemy -{ - private NewReplayBattleMgr _replayBattleMgr; - - public ReplayBattleEnemy(BattleManagerBase battleMgr, BattleCamera battleCamera, BackGroundBase backGround, IInnerOptionsBuilder innerOptionsBuilder) - : base(battleMgr, battleCamera, backGround, innerOptionsBuilder) - { - _replayBattleMgr = battleMgr as NewReplayBattleMgr; - } - - public override VfxBase StartTurnControl(string log = "") - { - Turn++; - base.IsEpEvolveThisTurn = false; - SequentialVfxPlayer sequentialVfxPlayer = TurnEvolveControl(BattleView.EpIcon); - VfxBase vfx = TurnStart(); - sequentialVfxPlayer.Register(vfx); - return sequentialVfxPlayer; - } - - public override VfxBase TurnStart() - { - _opponentBattlePlayer.IsSelfTurn = false; - _replayBattleMgr.TurnStart(this); - base.IsAlreadyChoiceBraveInThisTurn = false; - return NullVfx.GetInstance(); - } - - public VfxBase TurnStartFinish() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(InstantVfx.Create(SetActive)); - sequentialVfxPlayer.Register(CreateThinkingVfx(base.BattleMgr)); - return sequentialVfxPlayer; - } - - public VfxBase AddPpTotal(BattleCardBase ownerCard, int addPpTotalCount, int pp) - { - return _replayBattleMgr.AddPpTotal(ownerCard, this, addPpTotalCount, pp); - } - - public VfxBase AddPp(BattleCardBase ownerCard, int addPpCount) - { - return _replayBattleMgr.AddPp(ownerCard, this, addPpCount); - } - - public VfxBase AddBp(BattleCardBase ownerCard, int addBpCount) - { - return _replayBattleMgr.AddBp(ownerCard, this, addBpCount, isSelf: false); - } - - public VfxBase AddEp(BattleCardBase ownerCard, int addEpCount, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.EpModifier(ownerCard, this, addEpCount, isAdd: true, effectInfo); - } - - public VfxBase SetEp(BattleCardBase ownerCard, int addEpCount, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.EpModifier(ownerCard, this, addEpCount, isAdd: false, effectInfo); - } - - public VfxWithLoading DrawCard(List drawList, List cardInfoList, bool isSkipShuffle, bool isOpenDrawSkill) - { - VfxWithLoadingSequential vfxWithLoadingSequential = _replayBattleMgr.DrawCard(this, drawList, cardInfoList); - vfxWithLoadingSequential.RegisterToMainVfx(CardDrawVfx(drawList, isSkipShuffle, isOpenDrawSkill)); - return vfxWithLoadingSequential; - } - - public VfxWithLoading TokenDrawCard(BattleCardBase ownerCard, List cardInfoList, List targets, bool isOpen, bool isReserved, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.TokenDrawCard(this, ownerCard, cardInfoList, targets, isOpen, isReserved, effectInfo); - } - - public VfxWithLoading CreateReservedCard(BattleCardBase ownerCard, List cardInfoList) - { - return _replayBattleMgr.CreateReservedCard(this, ownerCard, cardInfoList); - } - - public VfxBase PlayCard(BattleCardBase playCard, int cost, int transformCardId, BattleCardBase.TransformType transformType, NetworkBattleReceiver.CardInfo cardInfo) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - playCard.BattleCardView.HideHandCardInfo(); - IBattleCardView battleCardView = playCard.BattleCardView; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.HandView.RemoveCardFromView(battleCardView, 0.3f); - })); - playCard.BattleCardView.UpdateParameterView(playCard.Atk, playCard.Life, cost, playCard.BaseParameter.CardName, playCard.IsInplay, isRecovery: false, useNormalCost: true); - sequentialVfxPlayer.Register(BattleView.PlayQueueView.AddCardToViewVfx(playCard.BattleCardView, playCard.IsSpell, isSelectTarget: false, isChoice: false)); - if (transformCardId != -1) - { - BattleCardBase battleCardBase = playCard; - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - bool flag = transformType == BattleCardBase.TransformType.Accelerate || transformType == BattleCardBase.TransformType.Crystallize; - playCard = _replayBattleMgr.CreateTransformCard(this, playCard, transformCardId, sequentialVfxPlayer2, flag); - if (transformType == BattleCardBase.TransformType.Choice) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardInfo.Id); - BattleCardBase card = _replayBattleMgr.CreateBattleCard(cardInfo.Id, IsPlayer, null, cardParameterFromId, this, cardInfo.Index); - playCard.TransformInfo = new BattleCardBase.TransformInformation(transformType, card); - } - else - { - playCard.TransformInfo = new BattleCardBase.TransformInformation(transformType, battleCardBase); - } - if (flag) - { - sequentialVfxPlayer.Register(sequentialVfxPlayer2); - } - else - { - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(sequentialVfxPlayer2); - } - base.HandCardList.Insert(base.HandCardList.IndexOf(battleCardBase), playCard); - base.HandCardList.Remove(battleCardBase); - sequentialVfxPlayer.Register(_replayBattleMgr.SetupTransformCard(playCard, battleCardBase, flag, isLoadResource: true)); - } - VfxBase vfxBase = UsePp(cost); - if (playCard is UnitBattleCard || playCard is FieldBattleCard) - { - _replayBattleMgr.HandCardToField(this, playCard); - } - if (playCard is UnitBattleCard) - { - playCard.BattleCardView.ResetTemplate(); - } - BattleLogManager.GetInstance().AddLogDestFollower(BattleLogWindow.BattleLogType.PlayCardLog, playCard); - VfxBase vfxBase2 = _replayBattleMgr.CreatePick(playCard, cardInfo); - sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(vfxBase, vfxBase2)); - sequentialVfxPlayer.Register(playCard.SetUpInplay()); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - MotionUtils.SetLayerAll(playCard.BattleCardView.CardTemplate.CardNormalTemp.gameObject, 10); - })); - if (playCard is SpellBattleCard) - { - _replayBattleMgr.HandCardToCemetery(this, playCard); - } - return sequentialVfxPlayer; - } - - public VfxBase PlayChoiceBraveCard(int cost, int cardId, NetworkBattleReceiver.CardInfo cardInfo) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase playCard = _replayBattleMgr.ReplaceChoiceBraveCard(base.Class, cardId, null); - base.IsAlreadyChoiceBraveInThisTurn = true; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_SELECT_3, BattleManagerBase.GetIns().BattleUIContainer.EnemyChoiceBraveBtn.position); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CMN_CARD_SELECT_3); - BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - })); - sequentialVfxPlayer.Register(BattleView.PlayQueueView.AddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isSelectTarget: false, isChoice: true)); - sequentialVfxPlayer.Register(UseBp(cost, playCard.BaseParameter.IsVariableCost, isSelf: false)); - sequentialVfxPlayer.Register(_replayBattleMgr.CreatePick(playCard, cardInfo)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - MotionUtils.SetLayerAll(playCard.BattleCardView.CardTemplate.CardNormalTemp.gameObject, 10); - })); - base.ChoiceBraveCardList.Add(playCard); - sequentialVfxPlayer.Register(UpdateHandCardsCost()); - return sequentialVfxPlayer; - } - - public VfxWithLoading SummonToken(BattleCardBase ownerCard, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo, bool isOwnerEffect, bool isIgnoreVoice, bool isRandomVoice, bool isEvoVoice) - { - return _replayBattleMgr.SummonToken(this, ownerCard, cardInfoList, effectInfo, isOwnerEffect, isIgnoreVoice, isRandomVoice, isEvoVoice); - } - - public VfxWithLoading SummonCard(BattleCardBase ownerCard, List targets, bool isDeckSelf, bool isBurialRite, NetworkBattleReceiver.EffectInfo effectInfo, bool isIgnoreVoice, List cardInfoList) - { - return _replayBattleMgr.SummonCard(this, ownerCard, targets, isDeckSelf, isBurialRite, effectInfo, isIgnoreVoice, cardInfoList); - } - - public VfxBase AttackStart(BattleCardBase attackCard, BattleCardBase targetCard) - { - return _replayBattleMgr.AttackStart(this, attackCard, targetCard); - } - - public VfxBase Attack(BattleCardBase attackCard, BattleCardBase targetCard, int dealDamage, int receiveDamage, List destroyList, List destroyTypeList, List banishList, int drain, NetworkBattleReceiver.CardInfo attackCardInfo, List sideLogSkillInfoList, bool isAttackerDead, bool isTargetDead) - { - return _replayBattleMgr.Attack(this, attackCard, targetCard, dealDamage, receiveDamage, destroyList, destroyTypeList, banishList, drain, attackCardInfo, sideLogSkillInfoList, isAttackerDead, isTargetDead); - } - - public VfxBase Evolve(BattleCardBase card, bool isConsumeEp, int choiceEvolutionId, NetworkBattleReceiver.CardInfo cardInfo) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (choiceEvolutionId / 1000000 == 910) - { - sequentialVfxPlayer.Register(_replayBattleMgr.ChoiceEvolve(card, choiceEvolutionId)); - } - if (isConsumeEp) - { - GainCurrentEpCount(); - } - base._cumulativeEvolutionCount++; - sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectStop(isEvolve: true)); - (card as UnitBattleCard).Evolution(); - base.IsEpEvolveThisTurn = true; - sequentialVfxPlayer.Register(new EvolveVfx(card, _replayBattleMgr.BattleResourceMgr, !isConsumeEp)); - sequentialVfxPlayer.Register(card.SkillApplyInformation.UpdateAllSkillEffectInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true)); - sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectRestart()); - card.AttackableOnReplay = cardInfo.Attackable; - card.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); - })); - return sequentialVfxPlayer; - } - - public VfxBase CompleteFusion(BattleCardBase actCard, List ingredientCards, NetworkBattleReceiver.CardInfo cardInfo, bool isFusionMetamorphose, int fusionMetamorphoseCardId, List sideLogSkillInfoList) - { - return _replayBattleMgr.Fusion(actCard, ingredientCards, this, cardInfo, isFusionMetamorphose, fusionMetamorphoseCardId, sideLogSkillInfoList); - } - - public VfxBase UpdateDeck(BattleCardBase card, List cardInfoList, bool isChange, bool isOpen, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.UpdateDeck(this, card, cardInfoList, isChange, isOpen, effectInfo); - } - - public VfxBase Getoff(BattleCardBase ownerCard, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.Getoff(this, ownerCard, cardInfoList, effectInfo); - } - - public VfxBase Unite(BattleCardBase card, List targetCards, int uniteCardId, int uniteCardIndex, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.Unite(this, card, targetCards, uniteCardId, uniteCardIndex, effectInfo); - } - - public VfxBase OpenCard(BattleCardBase card, int cost, bool isLastDrawOpenCard) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - List costList = card.BattleCardView.GetUseCostList(cost, useNomalCost: true); - int atk = card.Atk; - int life = card.Life; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView.UpdateCost(costList, isGenerateInHand: false, playEffect: false, isForceUpdate: true); - card.BattleCardView.UpdateOffence(atk); - card.BattleCardView.UpdateLife(life); - })); - sequentialVfxPlayer.Register(new OpenCardFromHandVfx(card.BattleCardView, card.IsLegend)); - sequentialVfxPlayer.Register(new PlayerEndDrawVfx(new List { card })); - if (isLastDrawOpenCard) - { - sequentialVfxPlayer.Register(BattleView.HandView.ShuffleHand()); - } - return sequentialVfxPlayer; - } - - public VfxBase PlayEmotion(ClassCharaPrm.EmotionType emotionType) - { - return Emotion.PlayEmotion(emotionType, 1.5f); - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayBattlePlayer.cs b/SVSim.BattleEngine/Engine/ReplayBattlePlayer.cs deleted file mode 100644 index 65226430..00000000 --- a/SVSim.BattleEngine/Engine/ReplayBattlePlayer.cs +++ /dev/null @@ -1,779 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using Wizard; -using Wizard.Battle; -using Wizard.Battle.Touch; -using Wizard.Battle.UI; -using Wizard.Battle.View.Vfx; - -public class ReplayBattlePlayer : BattlePlayer -{ - private NewReplayBattleMgr _replayBattleMgr; - - private SkillBase _dummySelectSkill; - - private bool _isSelectComplete; - - private List _choiceCards = new List(); - - private List _chosenCards = new List(); - - private BattleCardBase _transformChoiceCard; - - private bool _isTransformSelect; - - public bool CanChoiceBraveOnRecord; - - public override bool CanChoiceBrave - { - get - { - if (CanChoiceBraveThisTurn) - { - return CanChoiceBraveOnRecord; - } - return false; - } - } - - public ReplayBattlePlayer(BattleManagerBase battleMgr, BattleCamera battleCamera, BackGroundBase backGround, IInnerOptionsBuilder innerOptionsBuilder) - : base(battleMgr, battleCamera, backGround, innerOptionsBuilder) - { - _replayBattleMgr = battleMgr as NewReplayBattleMgr; - } - - public override VfxBase StartTurnControl(string log = "") - { - if (_canNotTouchCardVfx == null) - { - _canNotTouchCardVfx = new CanNotTouchCardVfx(); - base.BattleMgr.VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx); - } - base.PlayerEmotion.ResetPlayCount(); - Turn++; - _replayBattleMgr.IsRightAfterMoveTurn = false; - base.IsEpEvolveThisTurn = false; - SequentialVfxPlayer sequentialVfxPlayer = TurnEvolveControl(PlayerBattleView.EpIcon); - VfxBase vfx = TurnStart(); - sequentialVfxPlayer.Register(vfx); - return sequentialVfxPlayer; - } - - public VfxBase TurnStartFinish() - { - return InstantVfx.Create(PlayerActive); - } - - public override VfxBase TurnStart() - { - for (int i = 0; i < base.HandCardList.Count; i++) - { - base.HandCardList[i].SetOnDraw(draw: true); - } - _opponentBattlePlayer.IsSelfTurn = false; - _replayBattleMgr.TurnStart(this); - base.IsAlreadyChoiceBraveInThisTurn = false; - for (int j = 0; j < base.HandCardList.Count; j++) - { - base.HandCardList[j].SetOnDraw(draw: false); - } - return NullVfx.GetInstance(); - } - - public VfxBase AddPpTotal(BattleCardBase ownerCard, int addPpTotalCount, int pp, bool bySkill) - { - return _replayBattleMgr.AddPpTotal(ownerCard, this, addPpTotalCount, pp, bySkill); - } - - public VfxBase AddPp(BattleCardBase ownerCard, int addPpCount) - { - return _replayBattleMgr.AddPp(ownerCard, this, addPpCount); - } - - public VfxBase AddBp(BattleCardBase ownerCard, int addBpCount) - { - return _replayBattleMgr.AddBp(ownerCard, this, addBpCount, isSelf: true); - } - - public VfxBase AddEp(BattleCardBase ownerCard, int addEpCount, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.EpModifier(ownerCard, this, addEpCount, isAdd: true, effectInfo); - } - - public VfxBase SetEp(BattleCardBase ownerCard, int addEpCount, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.EpModifier(ownerCard, this, addEpCount, isAdd: false, effectInfo); - } - - public VfxWithLoading DrawCard(List drawList, List cardInfoList, bool isOpenDrawSkill) - { - VfxWithLoadingSequential vfxWithLoadingSequential = _replayBattleMgr.DrawCard(this, drawList, cardInfoList); - vfxWithLoadingSequential.RegisterToMainVfx(CardDrawVfx(drawList, skipShuffle: false, isOpenDrawSkill)); - vfxWithLoadingSequential.RegisterToMainVfx(InstantVfx.Create(delegate - { - foreach (BattleCardBase draw in drawList) - { - draw.SetOnDraw(draw: false); - } - })); - return vfxWithLoadingSequential; - } - - public VfxWithLoading TokenDrawCard(BattleCardBase ownerCard, List cardInfoList, List targets, bool isOpen, bool isReserved, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.TokenDrawCard(this, ownerCard, cardInfoList, targets, isOpen, isReserved, effectInfo); - } - - public VfxWithLoading CreateReservedCard(BattleCardBase ownerCard, List cardInfoList) - { - return _replayBattleMgr.CreateReservedCard(this, ownerCard, cardInfoList); - } - - public VfxBase PlayCard(BattleCardBase playCard, int cost, int transformCardId, BattleCardBase.TransformType transformType, NetworkBattleReceiver.CardInfo cardInfo) - { - SequentialVfxPlayer sequentialVfx = SequentialVfxPlayer.Create(); - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(playCard.StopSpellCharge()); - if (playCard == PlayerBattleView.DetailOpenCard) - { - sequentialVfx.Register(InstantVfx.Create(delegate - { - PlayerBattleView.HideDetailPanel(); - })); - } - if (!_isSelectComplete) - { - sequentialVfx.Register(BattleView.PlayQueueView.AddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isSelectTarget: false, isChoice: false)); - } - else - { - _isSelectComplete = false; - } - playCard.BattleCardView.HideHandCardInfo(); - playCard.BattleCardView.HideCanPlayEffect(); - if (transformCardId != -1) - { - BattleCardBase battleCardBase = playCard; - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - bool flag = transformType == BattleCardBase.TransformType.Accelerate || transformType == BattleCardBase.TransformType.Crystallize; - playCard = _replayBattleMgr.CreateTransformCard(this, playCard, transformCardId, sequentialVfxPlayer, flag); - playCard.TransformInfo = new BattleCardBase.TransformInformation(transformType, battleCardBase); - if (flag) - { - sequentialVfx.Register(sequentialVfxPlayer); - } - else - { - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(sequentialVfxPlayer); - } - base.HandCardList.Insert(base.HandCardList.IndexOf(battleCardBase), playCard); - base.HandCardList.Remove(battleCardBase); - sequentialVfx.Register(_replayBattleMgr.SetupTransformCard(playCard, battleCardBase, flag)); - } - BattleView.HandView.RemoveCardFromView(playCard.BattleCardView, 0.3f); - VfxBase vfxBase = UsePp(cost); - if (playCard is UnitBattleCard || playCard is FieldBattleCard) - { - _replayBattleMgr.HandCardToField(this, playCard); - } - if (playCard is UnitBattleCard) - { - playCard.BattleCardView.ResetTemplate(); - } - BattleLogManager.GetInstance().AddLogDestFollower(BattleLogWindow.BattleLogType.PlayCardLog, playCard); - VfxBase vfxBase2 = _replayBattleMgr.CreatePick(playCard, cardInfo); - sequentialVfx.Register(ParallelVfxPlayer.Create(vfxBase, vfxBase2)); - sequentialVfx.Register(playCard.SetUpInplay()); - sequentialVfx.Register(InstantVfx.Create(delegate - { - if (base.HandCardList.Count <= 0) - { - sequentialVfx.Register(BattleView.HandUnfocus()); - } - })); - sequentialVfx.Register(InstantVfx.Create(delegate - { - MotionUtils.SetLayerAll(playCard.BattleCardView.CardTemplate.CardNormalTemp.gameObject, 10); - })); - if (playCard is SpellBattleCard) - { - _replayBattleMgr.HandCardToCemetery(this, playCard); - } - sequentialVfx.Register(UpdateHandCardsCost()); - return sequentialVfx; - } - - public VfxBase PlayChoiceBraveCard(int cost, int cardId, NetworkBattleReceiver.CardInfo cardInfo) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase selectSkillCard = (_isSelectComplete ? _transformChoiceCard : null); - BattleCardBase playCard = _replayBattleMgr.ReplaceChoiceBraveCard(base.Class, cardId, selectSkillCard); - base.IsAlreadyChoiceBraveInThisTurn = true; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - })); - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(BattleView.PlayQueueView.AddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isSelectTarget: false, isChoice: true, isChoiceBrave: true)); - _isSelectComplete = false; - _transformChoiceCard = null; - sequentialVfxPlayer.Register(UseBp(cost, playCard.BaseParameter.IsVariableCost, isSelf: true)); - sequentialVfxPlayer.Register(_replayBattleMgr.CreatePick(playCard, cardInfo)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - MotionUtils.SetLayerAll(playCard.BattleCardView.CardTemplate.CardNormalTemp.gameObject, 10); - })); - base.ChoiceBraveCardList.Add(playCard); - sequentialVfxPlayer.Register(UpdateHandCardsCost()); - return sequentialVfxPlayer; - } - - public VfxWithLoading SummonToken(BattleCardBase ownerCard, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo, bool isOwnerEffect, bool isIgnoreVoice, bool isRandomVoice, bool isEvoVoice) - { - return _replayBattleMgr.SummonToken(this, ownerCard, cardInfoList, effectInfo, isOwnerEffect, isIgnoreVoice, isRandomVoice, isEvoVoice); - } - - public VfxWithLoading SummonCard(BattleCardBase ownerCard, List targets, bool isDeckSelf, bool isBurialRite, NetworkBattleReceiver.EffectInfo effectInfo, bool isIgnoreVoice, List cardInfoList) - { - return _replayBattleMgr.SummonCard(this, ownerCard, targets, isDeckSelf, isBurialRite, effectInfo, isIgnoreVoice, cardInfoList); - } - - public VfxBase AttackStart(BattleCardBase attackCard, BattleCardBase targetCard) - { - return _replayBattleMgr.AttackStart(this, attackCard, targetCard); - } - - public VfxBase Attack(BattleCardBase attackCard, BattleCardBase targetCard, int dealDamage, int receiveDamage, List destroyList, List destroyTypeList, List banishList, int drain, NetworkBattleReceiver.CardInfo attackCardInfo, List sideLogSkillInfoList, bool isAttackerDead, bool isTargetDead) - { - return _replayBattleMgr.Attack(this, attackCard, targetCard, dealDamage, receiveDamage, destroyList, destroyTypeList, banishList, drain, attackCardInfo, sideLogSkillInfoList, isAttackerDead, isTargetDead); - } - - public VfxBase Evolve(BattleCardBase card, bool isConsumeEp, int choiceEvolutionId, NetworkBattleReceiver.CardInfo cardInfo, List handCardInfoList) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (choiceEvolutionId / 1000000 == 910) - { - sequentialVfxPlayer.Register(_replayBattleMgr.ChoiceEvolve(card, choiceEvolutionId)); - } - if (isConsumeEp) - { - GainCurrentEpCount(); - } - base._cumulativeEvolutionCount++; - sequentialVfxPlayer.Register(_replayBattleMgr.UpdateHandEffect(base.HandCardList, handCardInfoList, forceHide: true)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.HideChoiceBraveButtonPulsateEffect(); - })); - sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectStop(isEvolve: true)); - (card as UnitBattleCard).Evolution(); - base.IsEpEvolveThisTurn = true; - if (GameMgr.GetIns().GetDataMgr().Is3DSkin(isPlayer: true)) - { - sequentialVfxPlayer.Register(new Class3dEvolveVfx(card, _replayBattleMgr.BattleResourceMgr)); - } - else if (GameMgr.GetIns().GetDataMgr().IsHighRankSkinPlayer()) - { - sequentialVfxPlayer.Register(new HighRankEvolveVfx(card, _replayBattleMgr.BattleResourceMgr, !isConsumeEp)); - } - else - { - sequentialVfxPlayer.Register(new EvolveVfx(card, _replayBattleMgr.BattleResourceMgr, !isConsumeEp)); - } - sequentialVfxPlayer.Register(card.SkillApplyInformation.UpdateAllSkillEffectInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true)); - sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectRestart()); - card.AttackableOnReplay = cardInfo.Attackable; - card.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); - })); - sequentialVfxPlayer.Register(_replayBattleMgr.UpdateHandEffect(base.HandCardList, handCardInfoList)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - })); - return sequentialVfxPlayer; - } - - public VfxBase StartSelect(BattleCardBase actCard, List selectableCards, bool isEvolve, NetworkBattleReceiver.CardInfo cardInfo, bool isChoiceBrave) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (isChoiceBrave) - { - actCard = _transformChoiceCard; - } - if (!isEvolve) - { - if (actCard.IsInHand && actCard == PlayerBattleView.DetailOpenCard) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - PlayerBattleView.HideDetailPanel(); - })); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - actCard.BattleCardView.HideHandCardInfo(); - })); - if (!_isTransformSelect) - { - sequentialVfxPlayer.Register(_replayBattleMgr.OperateMgr.InitSetCard(actCard, isPlayer: true, isSelect: true, isRecovery: false, isChoiceSelect: false, isAccelerateSelect: true)); - } - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.ShowAlert(PanelMgr.BattleAlertType.SelectChoiceCard, isClass: false, Data.SystemText.Get("Battle_0501")); - base.ClassInformationUIController.SetIsSelect(isSelect: true); - })); - sequentialVfxPlayer.Register(StartShowSelect(actCard, selectableCards, isEvolve, isFusion: false, cardInfo)); - _replayBattleMgr.IsSelecting = true; - _replayBattleMgr.ActCard = actCard; - _replayBattleMgr.IsEvolve = isEvolve; - return sequentialVfxPlayer; - } - - private VfxBase StartShowSelect(BattleCardBase actCard, List selectableCards, bool isEvol, bool isFusion, NetworkBattleReceiver.CardInfo cardInfo) - { - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); - base.BattleMgr.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); - for (int i = 0; i < base.HandCardList.Count; i++) - { - if (!selectableCards.Contains(base.HandCardList[i])) - { - base.HandCardList[i].BattleCardView.HideCanPlayEffect(); - } - } - BattleView.HideChoiceBraveButtonPulsateEffect(); - if (actCard.IsInHand) - { - BattleView.HandView.HideCardFromView(actCard.BattleCardView); - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - _dummySelectSkill = CreateDummySkill(actCard); - BattleView.SetSelectCardList(selectableCards); - StartSkillSelectVfx startSkillSelectVfx = new StartSkillSelectVfx(actCard, _dummySelectSkill, selectableCards, selectableCards.First().IsInHand, isFusion); - startSkillSelectVfx.OnStart += delegate - { - canNotTouchCardVfx.End(); - canNotTouchCardVfx = null; - _replayBattleMgr.ShowSideLog(actCard, this, isEvol, 0f, isSkillTargetSelect: true, cardInfo); - }; - parallelVfxPlayer.Register(startSkillSelectVfx); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - UpdateHandCardsPlayability(areArrowsForcedOff: true); - })); - parallelVfxPlayer.Register(BattleView.HandView.HandUnfocus()); - parallelVfxPlayer.Register(WaitVfx.Create(1f)); - return parallelVfxPlayer; - } - - private SkillBase CreateDummySkill(BattleCardBase card) - { - return new Skill_none(new SkillParameter - { - selfBattlePlayer = card.SelfBattlePlayer, - opponentBattlePlayer = card.OpponentBattlePlayer, - ownerCard = card, - buildInfo = new SkillCreator.SkillBuildInfo("none", "none", "none", "none", "none", "none"), - resourceMgr = _replayBattleMgr.BattleResourceMgr - }, string.Empty); - } - - public VfxBase Select(BattleCardBase actCard, BattleCardBase selectedCard, List selectableCards, bool isEvolve, NetworkBattleReceiver.CardInfo cardInfo, bool isBurialRiteSkill) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(_replayBattleMgr.OperateMgr.BattleCardSelect(actCard, selectedCard, isPlayer: true, registerEffectsDirectlyToVfxMgr: false, isTransformskill: false, isBurialRiteSkill)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.ShowAlert(PanelMgr.BattleAlertType.SelectChoiceCard, isClass: false, Data.SystemText.Get("Battle_0501")); - })); - sequentialVfxPlayer.Register(StartShowSelect(actCard, selectableCards, isEvolve, isFusion: false, cardInfo)); - return sequentialVfxPlayer; - } - - public VfxBase CompleteSelect(BattleCardBase actCard, BattleCardBase selectedCard, bool isEvol, bool isBurialRiteSkill, bool isChoiceBrave) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (isChoiceBrave) - { - actCard = _transformChoiceCard; - } - if (_isTransformSelect) - { - ChoiceUtility.SetupActingChoiceCardToBePlayedFromQueue(actCard, _transformChoiceCard, this, isChoiceBrave); - } - sequentialVfxPlayer.Register(_replayBattleMgr.OperateMgr.BattleCardSelect(actCard, selectedCard, isPlayer: true, registerEffectsDirectlyToVfxMgr: false, isTransformskill: false, isBurialRiteSkill)); - _dummySelectSkill.SelectCompleteFlag = true; - if (!isEvol) - { - _isSelectComplete = true; - } - BattleView.ClearSelectCardList(); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.ClassInformationUIController.SetIsSelect(isSelect: false); - })); - _isTransformSelect = false; - _replayBattleMgr.IsSelecting = false; - if (!isChoiceBrave) - { - _transformChoiceCard = null; - } - return sequentialVfxPlayer; - } - - public VfxBase CancelSelect(BattleCardBase actCard, bool isEvolve, bool isChoiceBrave, bool isMoveTurn = false) - { - if (_isTransformSelect) - { - PlayerBattleView.SetCancelSkillChoiceTransformCards(actCard, _transformChoiceCard); - } - VfxBase result = CancelSelectVfx(_isTransformSelect ? _transformChoiceCard : actCard, isEvolve, isMoveTurn); - _dummySelectSkill = null; - BattleView.ClearSelectCardList(); - _isTransformSelect = false; - _transformChoiceCard = null; - _replayBattleMgr.IsSelecting = false; - _isSelectComplete = false; - return result; - } - - private VfxBase CancelSelectVfx(BattleCardBase actCard, bool isEvolve, bool isMoveTurn, bool isResetDetail = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleView.CancelPlayCard(actCard, isEvolve, isMoveTurn); - for (int i = 0; i < base.HandCardList.Count(); i++) - { - base.HandCardList[i].IsSelectedDuringSelectingBurialRiteTarget = false; - } - if (base.HandCardList.Contains(actCard)) - { - base.HandControl.AttachCardView(actCard.BattleCardView); - actCard.BattleCardView.GameObject.SetActive(value: true); - } - BattleView.DisableSettingFlag(); - BattleView.AllClear(popUpClose: false, isRemoveSideLog: true, isStopDrag: false, isResetDetail); - BattleView.StopShowSelect(actCard, isAct: false, isTransformskill: false, isMoveTurn); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (_replayBattleMgr.ActCard != null && _replayBattleMgr.ActCard.BattleCardView != null && _replayBattleMgr.ActCard.BattleCardView.GameObject != null) - { - _replayBattleMgr.ActCard.BattleCardView.ShowFusionMetamorphoseFrameEffect(enable: false); - } - parallelVfxPlayer.Register(actCard.StartHandEffect()); - if (!isMoveTurn) - { - parallelVfxPlayer.Register(actCard.IsInHand ? actCard.BattleCardView.ShowHandCardInfo() : NullVfx.GetInstance()); - } - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(parallelVfxPlayer); - if (actCard.IsInHand) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.HandControl.RearrangeHand(0.4f, base.HandCardList.ConvertToViewList()); - })); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.ClassInformationUIController.SetIsSelect(isSelect: false); - })); - if (!isMoveTurn) - { - sequentialVfxPlayer.Register(_replayBattleMgr.ShowHandEffect()); - } - return sequentialVfxPlayer; - } - - public VfxBase StartChoice(BattleCardBase actCard, List cardInfoList, bool isEvolve) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - List choiceCardIdList = cardInfoList.Select((NetworkBattleReceiver.CardInfo i) => i.Id).ToList(); - _choiceCards = _replayBattleMgr.CreateChoiceTokenCards(actCard, choiceCardIdList, PlayerBattleView); - for (int num = 0; num < cardInfoList.Count; num++) - { - _replayBattleMgr.UpdateSkillDescriptionValueList(_choiceCards[num], cardInfoList[num]); - } - sequentialVfxPlayer.Register(StartShowChoice(actCard, _choiceCards, isEvolve)); - CanNotTouchCardVfx canNotTouchVfx = new CanNotTouchCardVfx(); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(canNotTouchVfx); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - canNotTouchVfx.End(); - })); - _replayBattleMgr.IsChoiceSelecting = true; - _replayBattleMgr.ActCard = actCard; - _replayBattleMgr.IsEvolve = isEvolve; - return sequentialVfxPlayer; - } - - private VfxBase StartShowChoice(BattleCardBase actCard, List choiceCards, bool isEvolve) - { - BattleView.SetSelectCardList(choiceCards); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - for (int i = 0; i < base.HandCardList.Count; i++) - { - base.HandCardList[i].BattleCardView.HideCanPlayEffect(); - } - BattleView.HideChoiceBraveButtonPulsateEffect(); - if (actCard.IsInHand) - { - if (actCard == PlayerBattleView.DetailOpenCard) - { - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - PlayerBattleView.HideDetailPanel(); - })); - } - BattleView.HandView.HideCardFromView(actCard.BattleCardView); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.PlayQueueView.RemoveCardFromView(actCard.BattleCardView); - })); - } - _dummySelectSkill = CreateDummySkill(actCard); - parallelVfxPlayer.Register(new StartChoiceSelectVfx(actCard, choiceCards, _dummySelectSkill, null, actCard.IsInHand, isEvolve, isChoiceBrave: false)); - parallelVfxPlayer.Register(BattleView.HandView.HandUnfocus()); - return parallelVfxPlayer; - } - - public VfxBase SelectChoice(List chosenCardIndexList, bool hasSelectionSkill) - { - for (int i = 0; i < chosenCardIndexList.Count; i++) - { - _chosenCards.Add(_choiceCards[chosenCardIndexList[i]]); - if (chosenCardIndexList.Count > 1) - { - GameObject checkFromIndex = BattleView.GetCheckFromIndex(chosenCardIndexList[i]); - ChoiceUtility.ToggleChoiceButtonSprite(null, checkFromIndex, setActive: true, 0); - } - } - _isTransformSelect = hasSelectionSkill; - return WaitVfx.Create((chosenCardIndexList.Count > 1) ? 0.5f : 0f); - } - - public VfxBase CompleteChoice(BattleCardBase card, bool hasSelectionSkill, bool isEvolve, bool isChoiceBrave) - { - BattleCardBase transformCard = null; - card.BattleCardView.HideHandCardInfo(); - ChoiceUtility.StopChoiceEffects(_choiceCards); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(_replayBattleMgr.OperateMgr.BattleCardSelect(card, _chosenCards, isPlayer: true, registerEffectsDirectlyToVfxMgr: false)); - _dummySelectSkill.SelectCompleteFlag = true; - if (!isEvolve && !isChoiceBrave) - { - _isSelectComplete = true; - } - _replayBattleMgr.IsChoiceSelecting = false; - bool flag = ChoiceUtility.DoesDuplicateCardNotExistInHand(card); - ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create(); - bool flag2 = card.Skills.HaveChoiceTransformSkill() || isChoiceBrave; - for (int i = 0; i < _choiceCards.Count; i++) - { - BattleCardBase choiceCard = _choiceCards[i]; - if (_chosenCards.Contains(choiceCard)) - { - if (flag2) - { - if (!hasSelectionSkill && !isChoiceBrave) - { - card.BattleCardView.Transform.position = choiceCard.BattleCardView.Transform.position; - } - } - else if (card.IsInHand) - { - parallelVfxPlayer2.Register(InstantVfx.Create(delegate - { - card.BattleCardView.Transform.position = choiceCard.BattleCardView.Transform.parent.position; - card.BattleCardView.GameObject.SetActive(value: true); - })); - parallelVfxPlayer.Register(_replayBattleMgr.OperateMgr.InitSetCard(card, base.IsSelfTurn, isSelect: true, isRecovery: false, isChoiceSelect: true, isAccelerateSelect: false, registerDirectlyToVfxManager: false)); - } - _transformChoiceCard = choiceCard; - if (flag2 && hasSelectionSkill) - { - transformCard = choiceCard; - } - } - if (transformCard != choiceCard) - { - if (flag) - { - choiceCard.UnloadResource(); - } - parallelVfxPlayer2.Register(InstantVfx.Create(delegate - { - choiceCard.BattleCardView.GameObject.SetActive(value: false); - })); - } - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(parallelVfxPlayer2); - if (transformCard != null) - { - ChoiceUtility.SetupChoiceCardForSkillTargetSelect(transformCard); - parallelVfxPlayer.Register(_replayBattleMgr.OperateMgr.InitSetCard(transformCard, base.IsSelfTurn, isSelect: true)); - parallelVfxPlayer.Register(ReceivePlayActionsReflectionBase.CreateHideChoiceCardsVfx(card, _choiceCards.FindAll((BattleCardBase c) => c != transformCard), dontUnloadResources: true)); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.SetNotCancelCollider(new List { transformCard }, isEnable: false); - })); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - _choiceCards = new List(); - _chosenCards = new List(); - BattleView.ClearSelectCardList(); - return sequentialVfxPlayer; - } - - public VfxBase CancelChoice(BattleCardBase actCard, bool isEvolve, bool isMoveTurn = false) - { - if (!isEvolve) - { - PlayerBattleView.SetCancelPlayCardWithChoice(actCard, _choiceCards); - } - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(InstantVfx.Create(delegate - { - ChoiceUtility.StopChoiceEffects(_choiceCards); - if (isEvolve) - { - bool isResetDetail = isMoveTurn || (PlayerBattleView.DetailOpenCard != null && !PlayerBattleView.DetailOpenCard.IsClass); - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(CancelSelectVfx(actCard, isEvolve, isMoveTurn, isResetDetail)); - ChoiceUtility.PlayCancelEvolveChoiceAnimation(_choiceCards, _replayBattleMgr); - _replayBattleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - _choiceCards = new List(); - BattleView.ClearSelectCardList(); - })); - } - else - { - _choiceCards = new List(); - BattleView.ClearSelectCardList(); - } - })); - bool flag = isMoveTurn || (PlayerBattleView.DetailOpenCard != null && !PlayerBattleView.DetailOpenCard.IsClass); - if (!isEvolve) - { - parallelVfxPlayer.Register(CancelSelectVfx(actCard, isEvolve, isMoveTurn, flag)); - } - if (flag) - { - PlayerBattleView.HideDetailPanel(); - } - _dummySelectSkill = null; - _chosenCards = new List(); - _replayBattleMgr.IsChoiceSelecting = false; - return parallelVfxPlayer; - } - - public VfxBase StartFusion(BattleCardBase actCard, List selectableCards, NetworkBattleReceiver.CardInfo cardInfo) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - actCard.BattleCardView.HideHandCardInfo(); - actCard.BattleCardView.GameObject.transform.localEulerAngles = FusionTargetSelectTouchProcessor.INIT_LOCAL_EULAR_ANGLE; - BattleView.PlayQueueView.AddCardToViewVfx(actCard.BattleCardView, forceCardIntoPlayQueue: true, isSelectTarget: true, isChoice: false); - if (!actCard.HasNoSelectFusionSkill) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.ShowAlert(PanelMgr.BattleAlertType.SelectChoiceCard, isClass: false, Data.SystemText.Get("Battle_0501")); - })); - } - sequentialVfxPlayer.Register(StartShowSelect(actCard, selectableCards, isEvol: false, isFusion: true, cardInfo)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.StartShowFusionUI(actCard, selectableCards, 8, new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CMN_CARD_SELECT_3); - })); - base.ClassInformationUIController.SetIsSelect(isSelect: true); - })); - _replayBattleMgr.IsFusionSelecting = true; - _replayBattleMgr.ActCard = actCard; - return sequentialVfxPlayer; - } - - public VfxBase SelectFusion(int index, bool isActive, int maxSelectCount, bool canFusionMetamorphose) - { - return InstantVfx.Create(delegate - { - BattleView.SelectedFusionIngredientCard(index, isActive, maxSelectCount); - if (_replayBattleMgr.ActCard != null && _replayBattleMgr.ActCard.BattleCardView != null) - { - _replayBattleMgr.ActCard.BattleCardView.ShowFusionMetamorphoseFrameEffect(canFusionMetamorphose); - } - }); - } - - public VfxBase CompleteFusion(BattleCardBase actCard, List ingredientCards, NetworkBattleReceiver.CardInfo cardInfo, bool isFusionMetamorphose, int fusionMetamorphoseCardId, List sideLogSkillInfoList) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); - _replayBattleMgr.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); - sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(InstantVfx.Create(delegate - { - if (_replayBattleMgr.ActCard != null && _replayBattleMgr.ActCard.BattleCardView != null) - { - _replayBattleMgr.ActCard.BattleCardView.ShowFusionMetamorphoseFrameEffect(enable: false); - } - }), BattleView.RemoveFusionSelectedCardFromHand(ingredientCards), BattleView.CreateStopShowSelectVfx(actCard, isAct: true, stopChoiceSelectUiImmediately: false), _replayBattleMgr.Fusion(actCard, ingredientCards, this, cardInfo, isFusionMetamorphose, fusionMetamorphoseCardId, sideLogSkillInfoList))); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - canNotTouchCardVfx.End(); - })); - BattleView.StopFusionUI(); - BattleView.ClearSelectCardList(); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.ClassInformationUIController.SetIsSelect(isSelect: false); - })); - _replayBattleMgr.IsFusionSelecting = false; - return sequentialVfxPlayer; - } - - public VfxBase CancelFusion(BattleCardBase actCard, bool isMoveTurn = false) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(CancelSelectVfx(actCard, isEvolve: false, isMoveTurn)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattleView.StopFusionUI(); - })); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - PlayerBattleView.ForceStopShowSelect(); - })); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.ClassInformationUIController.SetIsSelect(isSelect: false); - })); - _replayBattleMgr.IsFusionSelecting = false; - return sequentialVfxPlayer; - } - - public VfxBase UpdateDeck(BattleCardBase card, List cardInfoList, bool isChange, bool isOpen, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.UpdateDeck(this, card, cardInfoList, isChange, isOpen, effectInfo); - } - - public VfxBase Getoff(BattleCardBase attackCard, List cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.Getoff(this, attackCard, cardInfoList, effectInfo); - } - - public VfxBase Unite(BattleCardBase card, List targetCards, int uniteCardId, int uniteCardIndex, NetworkBattleReceiver.EffectInfo effectInfo) - { - return _replayBattleMgr.Unite(this, card, targetCards, uniteCardId, uniteCardIndex, effectInfo); - } - - public VfxBase OpenCard(BattleCardBase card) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx(SkillPreprocessOpenCard.HAND_SKILL_1_EFFECT, SkillPreprocessOpenCard.HAND_SKILL_1_SE, card.BattleCardView.GameObject.transform, 0.5f, isFollowAll: true)); - return sequentialVfxPlayer; - } - - public VfxBase PlayEmotion(ClassCharaPrm.EmotionType emotionType) - { - return Emotion.PlayEmotion(emotionType, 1.5f); - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayDetailInfo.cs b/SVSim.BattleEngine/Engine/ReplayDetailInfo.cs index de799dd8..9f6d6204 100644 --- a/SVSim.BattleEngine/Engine/ReplayDetailInfo.cs +++ b/SVSim.BattleEngine/Engine/ReplayDetailInfo.cs @@ -9,8 +9,6 @@ public class ReplayDetailInfo public Format deck_format; - public bool is_two_pick; - public TwoPickFormat _twoPickFormat; public long battle_id; @@ -23,8 +21,6 @@ public class ReplayDetailInfo public Dictionary play_list; - public int _battleType; - public List TurnStartIndexList = new List(); public int viewer_id; @@ -91,110 +87,6 @@ public class ReplayDetailInfo public string OpponentMyRotationId = ""; - protected const string PLAYLIST_BATTLE_ID_KEY = "battleId"; - - protected const string PLAYLIST_SEED_KEY = "seed"; - - protected const string PLAYLIST_FIELD_ID_KEY = "fieldId"; - - protected const string PLAYLIST_FIRST_TURN_KEY = "firstTurn"; - - protected const string PLAYLIST_PLAYLIST_KEY = "playlist"; - - protected const string PLAYLIST_URI_KEY = "uri"; - - protected const string URI_WATCH_KEY = "Watch"; - - protected const string PARAM_PLAYER_VIEWER_ID_KEY = "vid1"; - - protected const string PARAM_PLAYER_NAME_KEY = "name1"; - - protected const string PARAM_PLAYER_CHARA_ID_KEY = "charaId1"; - - protected const string PARAM_PLAYER_CLASS_ID_KEY = "classId1"; - - protected const string PARAM_PLAYER_EMBLEM_ID_KEY = "emblemId1"; - - protected const string PARAM_PLAYER_DEGREE_ID_KEY = "degreeId1"; - - protected const string PARAM_PLAYER_COUNTRY_CODE_KEY = "countryCode1"; - - protected const string PARAM_PLAYER_SLEEVE_ID_KEY = "sleeveId1"; - - protected const string PARAM_PLAYER_BATTLE_POINT_KEY = "battlePoint1"; - - protected const string PARAM_PLAYER_MASTER_POINT_KEY = "masterPoint1"; - - protected const string PARAM_PLAYER_RANK_KEY = "rank1"; - - protected const string PARAM_PLAYER_IS_OFFICIAL_KEY = "isOfficial1"; - - protected const string PARAM_PLAYER_DECK_KEY = "deck1"; - - protected const string PARAM_PLAYER_CHAOS_ID_KEY = "chaosId1"; - - protected const string PARAM_PLAYER_SUB_CLASS_ID_KEY = "subclassId1"; - - protected const string PARAM_PLAYER_MY_ROTATION_ID_KEY = "rotationId1"; - - protected const string PARAM_ENEMY_VIEWER_ID_KEY = "vid2"; - - protected const string PARAM_ENEMY_NAME_KEY = "name2"; - - protected const string PARAM_ENEMY_CHARA_ID_KEY = "charaId2"; - - protected const string PARAM_ENEMY_CLASS_ID_KEY = "classId2"; - - protected const string PARAM_ENEMY_EMBLEM_ID_KEY = "emblemId2"; - - protected const string PARAM_ENEMY_DEGREE_ID_KEY = "degreeId2"; - - protected const string PARAM_ENEMY_COUNTRY_CODE_KEY = "countryCode2"; - - protected const string PARAM_ENEMY_SLEEVE_ID_KEY = "sleeveId2"; - - protected const string PARAM_ENEMY_BATTLE_POINT_KEY = "battlePoint2"; - - protected const string PARAM_ENEMY_MASTER_POINT_KEY = "masterPoint2"; - - protected const string PARAM_ENEMY_RANK_KEY = "rank2"; - - protected const string PARAM_ENEMY_IS_OFFICIAL_KEY = "isOfficial2"; - - protected const string PARAM_ENEMY_DECK_KEY = "deck2"; - - protected const string PARAM_ENEMY_OPPO_DECK_COUNT_KEY = "oppoDeckCount"; - - protected const string PARAM_ENEMY_CHAOS_ID_KEY = "chaosId2"; - - protected const string PARAM_ENEMY_SUB_CLASS_ID_KEY = "subclassId2"; - - protected const string PARAM_ENEMY_MY_ROTATION_ID_KEY = "rotationId2"; - - protected const string PARAM_COMMON_IDX_KEY = "idx"; - - protected const string PARAM_COMMON_CARD_ID_KEY = "cardId"; - - protected const string PARAM_COMMON_IS_WIN_KEY = "is_win"; - - protected const string PARAM_COMMON_DECK_FORMAT_KEY = "deck_format"; - - protected const string PARAM_COMMON_IDX_CHANGE_SEED_KEY = "idxChangeSeed"; - - protected const string PARAM_COMMON_OPPO_IDX_CHANGE_SEED_KEY = "oppoIdxChangeSeed"; - - protected const string PARAM_COMMON_IS_CHAOS_SKIN_OVERRIDE_KEY = "isChaosSkinOverride"; - - protected const string PARAM_COMMON_MISSION_PARAMETER = "mission_parameter"; - - protected const string PARAM_COMMON_TURN_START_INDEX_LIST = "turn_start_index_list"; - - protected const string PARAM_COMMON_TWOPICK_TYPE = "twoPickType"; - - public UIManager.ViewScene ReplayEndBackScene { get; private set; } - - public UIManager.ChangeViewSceneParam ReplayEndBackSceneParam { get; private set; } - public bool IsOfficialUser { get; set; } public bool IsOpponentOfficialUser { get; set; } @@ -205,7 +97,7 @@ public class ReplayDetailInfo { IdxChangeSeed = -1; OppoIdxChangeSeed = -1; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr battle_id = data["battleId"].ToLong(); seed = data["seed"].ToInt(); field_id = data["fieldId"].ToInt(); @@ -268,7 +160,7 @@ public class ReplayDetailInfo string text = "deck1"; if (data.Keys.Contains(text)) { - GameMgr.GetIns().GetDataMgr().SetDeckMaxCount(data[text].Count, isSelf: true); + /* Pre-Phase-5b: SetDeckMaxCount dropped */ } opponent_viewer_id = data["vid2"].ToInt(); opponent_name = data["name2"].ToString(); @@ -288,7 +180,7 @@ public class ReplayDetailInfo OpponentMyRotationId = (data.Keys.Contains("rotationId2") ? data["rotationId2"].ToString() : ""); if (data.Keys.Contains("oppoDeckCount")) { - GameMgr.GetIns().GetDataMgr().SetDeckMaxCount(data["oppoDeckCount"].ToInt(), isSelf: false); + /* Pre-Phase-5b: SetDeckMaxCount dropped */ } if (data.Keys.Contains("turn_start_index_list")) { @@ -300,12 +192,6 @@ public class ReplayDetailInfo } } - public void SetReplayEndBackScene(UIManager.ViewScene scene, UIManager.ChangeViewSceneParam param = null) - { - ReplayEndBackScene = scene; - ReplayEndBackSceneParam = param; - } - protected virtual void CheckMulliganFlags(JsonData data) { } diff --git a/SVSim.BattleEngine/Engine/ReplayInPlayAction.cs b/SVSim.BattleEngine/Engine/ReplayInPlayAction.cs deleted file mode 100644 index e5d7cdba..00000000 --- a/SVSim.BattleEngine/Engine/ReplayInPlayAction.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System.Collections.Generic; - -public class ReplayInPlayAction : WatchInPlayAction -{ - public ReplayInPlayAction(BattleManagerBase battleMgr, OperateMgr operateMgr) - : base(battleMgr, operateMgr) - { - } - - public override void StartSelect(int actingCardIndex, bool isPlayer = true) - { - if (isPlayer) - { - base.StartSelect(actingCardIndex, isPlayer); - } - } - - public override void StartChoiceSelect(int actingCardIndex, bool isPlayer = true) - { - if (isPlayer) - { - base.StartChoiceSelect(actingCardIndex, isPlayer); - } - } - - public override void CancelSelect(bool isPlayer = true) - { - if (isPlayer) - { - base.CancelSelect(isPlayer); - } - } - - public override void CancelChoiceSelect(bool isPlayer = true) - { - if (isPlayer) - { - base.CancelChoiceSelect(isPlayer); - } - } - - public override void SelectCard(int selectedCardIndex, bool isSelfCard, bool isEvolve, bool isPlayer = true, bool isBurialRite = false, bool isChoiceBrave = false, bool isComplete = true) - { - if (isPlayer) - { - base.SelectCard(selectedCardIndex, isSelfCard, isEvolve, isPlayer, isBurialRite); - } - } - - public override void CompleteSelectCard(int selectedCardIndex, bool isSelfCard, bool isEvolve, bool isPlayer, bool isBurialRite, bool isChoiceBrave) - { - if (isPlayer) - { - base.SelectCard(selectedCardIndex, isSelfCard, isEvolve, isPlayer, isBurialRite); - } - } - - public override void SelectChoiceCard(int selectedChoiceCardId, bool isEvolve = false, bool isPlayer = true, bool isComplete = false) - { - if (isPlayer && isComplete) - { - base.SelectChoiceCard(selectedChoiceCardId, isEvolve, isPlayer, isComplete); - } - } - - public override void WatchSelectChoiceCards(List selectedChoiceCardIds, bool isEvolve = false, bool isPlayer = true, bool isComplete = false) - { - if (isPlayer && isComplete) - { - base.WatchSelectChoiceCards(selectedChoiceCardIds, isEvolve, isPlayer, isComplete); - } - } - - public override void CompleteChoiceCard(List choiceIdList, bool isEvolveTargetSelect, bool isPlayer = true) - { - if (isPlayer) - { - CompleteChoiceDataIns = new CompleteChoiceData(); - OverrideChoicecard(isPlayer); - } - } - - public override void OverrideChoicecard(bool isPlayer) - { - if (isPlayer) - { - base.OverrideChoicecard(isPlayer); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayMoveTurnButton.cs b/SVSim.BattleEngine/Engine/ReplayMoveTurnButton.cs deleted file mode 100644 index ee3c8d14..00000000 --- a/SVSim.BattleEngine/Engine/ReplayMoveTurnButton.cs +++ /dev/null @@ -1,31 +0,0 @@ -using UnityEngine; - -public class ReplayMoveTurnButton : MonoBehaviour -{ - [SerializeField] - public UIButton BackButton; - - [SerializeField] - public UIButton MenuButton; - - [SerializeField] - public UIButton ForwardButton; - - [SerializeField] - public UIButton StopReplayButton; - - [SerializeField] - public UIButton ForwardReplayButton; - - private void Awake() - { - EventDelegate.Set(BackButton.onClick, OnClickButton); - EventDelegate.Set(MenuButton.onClick, OnClickButton); - EventDelegate.Set(ForwardButton.onClick, OnClickButton); - } - - private void OnClickButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayMoveTurnItem.cs b/SVSim.BattleEngine/Engine/ReplayMoveTurnItem.cs deleted file mode 100644 index dda1f53d..00000000 --- a/SVSim.BattleEngine/Engine/ReplayMoveTurnItem.cs +++ /dev/null @@ -1,20 +0,0 @@ -using UnityEngine; - -public class ReplayMoveTurnItem : MonoBehaviour -{ - [SerializeField] - public UILabel Label; - - [SerializeField] - public UIButton Button; - - private void Awake() - { - EventDelegate.Set(Button.onClick, OnClickButton); - } - - private void OnClickButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayMoveTurnPanel.cs b/SVSim.BattleEngine/Engine/ReplayMoveTurnPanel.cs deleted file mode 100644 index 22876cfd..00000000 --- a/SVSim.BattleEngine/Engine/ReplayMoveTurnPanel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using UnityEngine; - -public class ReplayMoveTurnPanel : MonoBehaviour -{ - [SerializeField] - public UIScrollView ScrollView; - - [SerializeField] - public UIGrid LogGrid; -} diff --git a/SVSim.BattleEngine/Engine/ReplayOperateReceive.cs b/SVSim.BattleEngine/Engine/ReplayOperateReceive.cs deleted file mode 100644 index 089861df..00000000 --- a/SVSim.BattleEngine/Engine/ReplayOperateReceive.cs +++ /dev/null @@ -1,17 +0,0 @@ -public class ReplayOperateReceive : OperateReceive -{ - public ReplayOperateReceive(NetworkBattleManagerBase networkBattleMgr, RegisterActionManager registerCardList, OperateMgr operateMgr, NetworkBattleData networkBattleData) - : base(networkBattleMgr, registerCardList, operateMgr, networkBattleData) - { - } - - protected override PlayHandCardReflection CreateNetworkPlayCardAction() - { - return new ReplayPlayCardAction(_battleMgr, _operateMgr, _networkBattleData); - } - - protected override InPlayCardReflection CreateNetworkInPlayAction() - { - return new ReplayInPlayAction(_battleMgr, _operateMgr); - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayOperationCollection.cs b/SVSim.BattleEngine/Engine/ReplayOperationCollection.cs deleted file mode 100644 index ca8e01bc..00000000 --- a/SVSim.BattleEngine/Engine/ReplayOperationCollection.cs +++ /dev/null @@ -1,27 +0,0 @@ -public class ReplayOperationCollection : WatchOperationCollection -{ - public ReplayOperationCollection(NetworkReplayBattleMgr replayBattleMgr, OperateMgr operateMgr, NetworkBattleReceiver.ReceiveData receivedData, NetworkBattleData networkBattleData, bool isPlayer) - : base(replayBattleMgr, operateMgr, receivedData, networkBattleData, isPlayer) - { - } - - public override void SelectObjectOperation() - { - } - - protected override void CheckStateAndCancel(PlayHandCardReflection networkPlayCardAction, InPlayCardReflection networkInPlayAction, bool isPlayer) - { - if (isPlayer) - { - base.CheckStateAndCancel(networkPlayCardAction, networkInPlayAction, isPlayer); - } - } - - public override void TurnEndReady() - { - } - - public override void SlideObject() - { - } -} diff --git a/SVSim.BattleEngine/Engine/ReplayPlayCardAction.cs b/SVSim.BattleEngine/Engine/ReplayPlayCardAction.cs deleted file mode 100644 index 8e40fbfc..00000000 --- a/SVSim.BattleEngine/Engine/ReplayPlayCardAction.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System.Collections.Generic; - -public class ReplayPlayCardAction : WatchPlayCardAction -{ - public ReplayPlayCardAction(BattleManagerBase battleMgr, OperateMgr operateMgr, NetworkBattleData networkBattleData) - : base(battleMgr, operateMgr, networkBattleData) - { - } - - public override void StartSelect(int actingCardIndex, bool isPlayer = true) - { - if (isPlayer) - { - base.StartSelect(actingCardIndex, isPlayer); - } - } - - public override void StartChoiceSelect(int actingCardIndex, bool isPlayer = true) - { - if (isPlayer) - { - base.StartChoiceSelect(actingCardIndex, isPlayer); - } - } - - public override void StartSelectFusion(int actingCardIndex, bool isPlayer = true) - { - if (isPlayer) - { - base.StartSelectFusion(actingCardIndex, isPlayer); - } - } - - public override void SelectFusionIngredientCard(int cardIndex, bool isPlayer = true) - { - if (isPlayer) - { - base.SelectFusionIngredientCard(cardIndex, isPlayer); - } - } - - public override void CompleteSelectFusionIngredientCard(bool isPlayer) - { - if (isPlayer) - { - base.CompleteSelectFusionIngredientCard(isPlayer); - } - } - - public override void CancelSelect(bool isPlayer = true) - { - if (isPlayer) - { - base.CancelSelect(isPlayer); - } - } - - public override void CancelChoiceSelect(bool isPlayer = true) - { - if (isPlayer) - { - base.CancelChoiceSelect(isPlayer); - } - } - - public override void SelectCard(int selectedCardIndex, bool isSelfCard, bool isEvolve, bool isPlayer = true, bool isBurialRite = false, bool isChoiceBrave = false, bool isComplete = true) - { - if (isPlayer) - { - base.SelectCard(selectedCardIndex, isSelfCard, isEvolve, isPlayer, isBurialRite, isChoiceBrave: false, isComplete); - } - } - - public override void CompleteSelectCard(int selectedCardIndex, bool isSelfCard, bool isEvolve, bool isPlayer, bool isBurialRite, bool isChoiceBrave) - { - if (isPlayer) - { - base.SelectCard(selectedCardIndex, isSelfCard, isEvolve, isPlayer, isBurialRite, isChoiceBrave); - } - } - - public override void SelectChoiceCard(int selectedChoiceCardId, bool isEvolve = false, bool isPlayer = true, bool isComplete = false) - { - if (isPlayer && isComplete) - { - base.SelectChoiceCard(selectedChoiceCardId, isEvolve, isPlayer, isComplete); - } - } - - public override void WatchSelectChoiceCards(List selectedChoiceCardIds, bool isEvolve = false, bool isPlayer = true, bool isComplete = false) - { - if (isPlayer && isComplete) - { - base.WatchSelectChoiceCards(selectedChoiceCardIds, isEvolve, isPlayer, isComplete); - } - } - - public override void CompleteChoiceCard(List choiceIdList, bool isEvolveTargetSelect, bool isPlayer = true) - { - if (isPlayer) - { - CompleteChoiceDataIns = new CompleteChoiceData(); - OverrideChoicecard(isPlayer); - } - } - - public override void OverrideChoicecard(bool isPlayer) - { - if (isPlayer) - { - base.OverrideChoicecard(isPlayer); - } - } -} diff --git a/SVSim.BattleEngine/Engine/ResourceHandler.cs b/SVSim.BattleEngine/Engine/ResourceHandler.cs index b1e84360..7466a0df 100644 --- a/SVSim.BattleEngine/Engine/ResourceHandler.cs +++ b/SVSim.BattleEngine/Engine/ResourceHandler.cs @@ -45,9 +45,4 @@ public class ResourceHandler : MonoBehaviour Toolbox.ResourcesManager.RemoveAssetGroup(new List(_loaded)); _loaded.Clear(); } - - public void OnDestroy() - { - UnloadAll(); - } } diff --git a/SVSim.BattleEngine/Engine/ResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/ResultAnimationAgent.cs deleted file mode 100644 index ddd4ed1c..00000000 --- a/SVSim.BattleEngine/Engine/ResultAnimationAgent.cs +++ /dev/null @@ -1,347 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Lottery; - -public class ResultAnimationAgent : MonoBehaviour -{ - private class DialogReward - { - public DialogBase _dialog; - - public RewardBase _reward; - - public DialogReward(DialogBase dia, RewardBase reward) - { - _dialog = dia; - _reward = reward; - } - } - - protected BattleCamera m_BattleCamera; - - private const float DIALOG_AUTO_CLOSE_TIME = 5f; - - private string _loadPath = string.Empty; - - private GameObject _boxOpenEffectObj; - - private GameObject _treasureEffectObj; - - private GameObject _treasureCpBoxTextPanel; - - public void SetBattleCamera(BattleCamera battleCamera) - { - m_BattleCamera = battleCamera; - } - - public virtual IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - yield break; - } - - protected bool ShowRewardDialog(BattleResultUIController battleResultControl, bool addStoryReward = false, bool hasSkippedStorySpecialBattleResult = false, bool isNoBattleStoryResult = false) - { - if (GameMgr.GetIns().IsWatchBattle) - { - return false; - } - DialogReward dialogReward = HandleVictoryRewards(battleResultControl); - if (dialogReward != null) - { - dialogReward._dialog.OnClose = delegate - { - DialogReward dialogReward2 = HandleStoryAndMissionRewards(battleResultControl, addStoryReward, hasSkippedStorySpecialBattleResult, isNoBattleStoryResult); - if (dialogReward2 != null) - { - dialogReward2._dialog.OnClose = battleResultControl.RewardCheck; - } - else - { - battleResultControl.RewardCheck(); - } - }; - } - else - { - dialogReward = HandleStoryAndMissionRewards(battleResultControl, addStoryReward, hasSkippedStorySpecialBattleResult, isNoBattleStoryResult); - if (dialogReward != null) - { - dialogReward._dialog.OnClose = battleResultControl.RewardCheck; - } - } - if (dialogReward != null) - { - battleResultControl.IsRewardWait = true; - } - return dialogReward != null; - } - - protected void HideEmotionMessage() - { - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.HideAlertDialogue(PanelMgr.BattleAlertType.SelectedEmotionIcon); - Transform[] componentsInChildren = BattleManagerBase.GetIns().BattleUIContainer.gameObject.GetComponentsInChildren(includeInactive: false); - foreach (Transform transform in componentsInChildren) - { - if (transform.name.Contains("EmotionMessage")) - { - transform.gameObject.SetActive(value: false); - } - } - } - - private DialogReward HandleVictoryRewards(BattleResultUIController battleResultControl) - { - DialogReward dialogReward = null; - List list = ((battleResultControl.ResultReporter != null) ? battleResultControl.ResultReporter.VictoryRewards : null); - if (list != null && list.Count > 0) - { - SystemText systemText = Data.SystemText; - dialogReward = CreateDialogContent(systemText.Get("Battle_0477")); - for (int i = 0; i < list.Count; i++) - { - dialogReward._reward.AddReward(list[i]); - if (!string.IsNullOrEmpty(list[i].reward_message)) - { - dialogReward._dialog.SetTitleLabel(list[i].reward_message); - } - } - dialogReward._reward.EndCreate(); - } - return dialogReward; - } - - private DialogReward HandleStoryAndMissionRewards(BattleResultUIController battleResultControl, bool addStoryReward = false, bool hasSkippedStorySpecialBattleResult = false, bool isNoBattleStoryResult = false) - { - DialogReward dialogReward = null; - if (addStoryReward) - { - IReadOnlyList storyClearRewards = Data.StoryFinish.data.StoryClearRewards; - if (storyClearRewards.Count > 0) - { - dialogReward = CreateDialogContent(Data.SystemText.Get("Story_0029")); - foreach (ReceivedReward item in storyClearRewards) - { - dialogReward._reward.AddReward(item); - } - } - } - if ((hasSkippedStorySpecialBattleResult || isNoBattleStoryResult) && Data.StoryFinish.data.Rewards.Count > 0) - { - if (dialogReward == null) - { - SystemText systemText = Data.SystemText; - dialogReward = CreateDialogContent(systemText.Get("Story_0029")); - } - foreach (ReceivedReward reward in Data.StoryFinish.data.Rewards) - { - dialogReward._reward.AddReward(reward); - } - } - List list = ((battleResultControl.ResultReporter != null) ? battleResultControl.ResultReporter.MissionRewards : null); - if (list != null && list.Count > 0) - { - if (dialogReward == null) - { - SystemText systemText2 = Data.SystemText; - dialogReward = CreateDialogContent(systemText2.Get("Story_0029")); - if (GameMgr.GetIns().GetDataMgr().IsRoomBattleType()) - { - dialogReward._dialog.AutoClose(5f); - } - } - for (int i = 0; i < list.Count; i++) - { - dialogReward._reward.AddReward(list[i]); - } - } - dialogReward?._reward.EndCreate(); - return dialogReward; - } - - private DialogReward CreateRewardDialog(List rewardList) - { - SystemText systemText = Data.SystemText; - DialogReward dialogReward = CreateDialogContent(systemText.Get("Story_0029")); - if (GameMgr.GetIns().GetDataMgr().IsRoomBattleType()) - { - dialogReward._dialog.AutoClose(5f); - } - foreach (ReceivedReward reward in rewardList) - { - dialogReward._reward.AddReward(reward); - } - dialogReward._reward.EndCreate(); - return dialogReward; - } - - public IEnumerator ShowRewardDialog(List rewardList) - { - if (rewardList != null && rewardList.Count != 0) - { - bool isFinishDialog = false; - CreateRewardDialog(rewardList)._dialog.OnClose = delegate - { - isFinishDialog = true; - }; - while (!isFinishDialog) - { - yield return null; - } - } - } - - private DialogReward CreateDialogContent(string title) - { - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetLayer("MyPage"); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(title); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(105); - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent(); - component.SetActiveMyPageLayerCamera(isActive: true); - return new DialogReward(dialogBase, component); - } - - protected IEnumerator LoadLotteryImage(LotteryApplyData data) - { - string assetName = (_loadPath = LotteryApplyDialog.GetLotteryTexturePath(data, isFetch: false)); - yield return Toolbox.ResourcesManager.LoadAssetAsync(assetName, null); - } - - private void DisposeLotteryImage() - { - if (!string.IsNullOrEmpty(_loadPath)) - { - Toolbox.ResourcesManager.RemoveAsset(_loadPath); - _loadPath = string.Empty; - } - } - - protected IEnumerator CreateLotteryDialog(LotteryApplyData data) - { - DialogBase dialogBase = LotteryApplyDialog.Create(data); - bool finishLotteryDialog = false; - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - finishLotteryDialog = true; - }); - while (!finishLotteryDialog) - { - yield return null; - } - DisposeLotteryImage(); - } - - public void PlayWinVoice() - { - List battleListAssetPathList = Toolbox.ResourcesManager.BattleListAssetPathList; - string voiceId = string.Empty; - bool isSkinEvolved = BattleManagerBase.GetIns().BattlePlayer.IsSkinEvolved; - if (BattleManagerBase.GetIns().IsPuzzleMgr) - { - voiceId = (BattleManagerBase.GetIns() as PuzzleBattleManager).PuzzleQuestData.ClearVoiceId; - } - GameMgr.GetIns().GetSoundMgr().PlayVoice(ClassCharaPrm.EmotionType.WIN, GameMgr.GetIns().GetDataMgr().GetPlayerSkinId(), battleListAssetPathList, voiceId, isSkinEvolved); - } - - protected IEnumerator TreasureBoxCpOpenBoxAnimation(BattleResultUIController battleResultUIController, int grade) - { - _boxOpenEffectObj = NGUITools.AddChild(battleResultUIController.gameObject, Resources.Load("UI/layoutParts/RankWinnerRewardResultPanel") as GameObject); - _treasureCpBoxTextPanel = NGUITools.AddChild(battleResultUIController.gameObject, Resources.Load("UI/layoutParts/TreasureCpBoxTextPanel") as GameObject); - _treasureCpBoxTextPanel.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); - NguiObjs component = _boxOpenEffectObj.GetComponent(); - UISprite bg = component.sprites[0]; - UISprite obj = component.sprites[1]; - UISprite uISprite = component.sprites[2]; - UISprite treasureCpBoxText = _treasureCpBoxTextPanel.GetComponent()._treasureCpBoxText; - treasureCpBoxText.atlas = UIManager.GetInstance().GetAtlasList().FirstOrDefault((UIAtlas s) => s.name == "BattleLang"); - treasureCpBoxText.spriteName = TreasureBoxCp.GetTreasureSpriteName(grade); - UIManager.GetInstance().AttachAtlas(uISprite.gameObject); - UILabel label = component.labels[0]; - UIPanel component2 = _boxOpenEffectObj.GetComponent(); - label.text = string.Empty; - bg.alpha = 0f; - uISprite.alpha = 0f; - label.alpha = 0f; - component2.alpha = 1f; - treasureCpBoxText.alpha = 0f; - treasureCpBoxText.gameObject.SetActive(value: true); - obj.gameObject.SetActive(value: false); - string loadEffectName = $"cmn_treasure_gradeup_gp_{grade}"; - List list = new List(); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D)); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(list, null)); - TweenAlpha.Begin(bg.gameObject, 0.5f, 0.65f); - TweenAlpha.Begin(label.gameObject, 0.5f, 1f); - _treasureEffectObj = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _treasureEffectObj.transform.parent = _boxOpenEffectObj.transform; - _treasureEffectObj.SetActive(value: false); - bool particleShaderLoaded = false; - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_treasureEffectObj, delegate - { - particleShaderLoaded = true; - }); - _treasureEffectObj.SetLayer(LayerMask.NameToLayer("FrontUI"), isSetChildren: true); - _treasureEffectObj.transform.localPosition = Vector3.zero; - _treasureEffectObj.transform.localScale = Vector3.one * 320f * 1.75f; - yield return new WaitForSeconds(0.8f); - while (!particleShaderLoaded) - { - yield return null; - } - _treasureEffectObj.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySe(TreasureBoxCp.GetGradeSE(grade)); - TweenAlpha.Begin(treasureCpBoxText.gameObject, 0.5f, 1f); - treasureCpBoxText.transform.localPosition = new Vector3(0f, -192f, 0f); - iTween.MoveTo(treasureCpBoxText.gameObject, iTween.Hash("y", -172, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(TreasureBoxCp.OPEN_TREASURE_BOX_TIME[grade - 1] + 0.5f); - TweenAlpha.Begin(treasureCpBoxText.gameObject, 0.5f, 0f); - UIManager.GetInstance().StartCoroutine(RunHideBoxEffect(0.5f)); - } - - private IEnumerator RunHideBoxEffect(float delayTime) - { - yield return new WaitForSeconds(delayTime); - _treasureEffectObj.SetActive(value: false); - _boxOpenEffectObj.SetActive(value: false); - _treasureCpBoxTextPanel.SetActive(value: false); - UnityEngine.Object.Destroy(_boxOpenEffectObj); - UnityEngine.Object.Destroy(_treasureCpBoxTextPanel); - UnityEngine.Object.Destroy(_treasureEffectObj); - UIManager.GetInstance().offNotTouch(); - } - - protected IEnumerator CreateTreasureBoxCpRewardDialog(TreasureBoxCpResultInfo info) - { - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(105, isSetBackViewDepthImmediately: true); - dialogBase.SetTitleLabel(Data.SystemText.Get("TreasureBoxCp_0026")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - bool dialogClosed = false; - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - dialogClosed = true; - }); - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, Resources.Load("UI/layoutParts/StoryRewardPanel")).GetComponent(); - for (int num = 0; num < info.RewardDataList.Count; num++) - { - component.AddReward(info.RewardDataList[num]); - } - component.SetActiveMyPageLayerCamera(isActive: true); - component.EndCreate(); - while (!dialogClosed) - { - yield return null; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Reward.cs b/SVSim.BattleEngine/Engine/Reward.cs deleted file mode 100644 index b9299543..00000000 --- a/SVSim.BattleEngine/Engine/Reward.cs +++ /dev/null @@ -1,12 +0,0 @@ -public class Reward : HeaderData -{ - public int crystal; - - public int red_ether; - - public string create_time; - - public string update_time; - - public string delete_time; -} diff --git a/SVSim.BattleEngine/Engine/RivayleBackalleyField.cs b/SVSim.BattleEngine/Engine/RivayleBackalleyField.cs index 5bf7d8ea..dec2b275 100644 --- a/SVSim.BattleEngine/Engine/RivayleBackalleyField.cs +++ b/SVSim.BattleEngine/Engine/RivayleBackalleyField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class RivayleBackalleyField : BackGroundBase { public override int FieldId => 42; @@ -10,63 +11,4 @@ public class RivayleBackalleyField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0042_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles42").gameObject; - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_42, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_42_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(-1252f, -1507f, -155f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-78f, 60f, -60f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-394f, 340f, -273f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInSine)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-90f, 0f, 0f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInSine)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/RivayleField.cs b/SVSim.BattleEngine/Engine/RivayleField.cs index b9479b55..0b2e87c0 100644 --- a/SVSim.BattleEngine/Engine/RivayleField.cs +++ b/SVSim.BattleEngine/Engine/RivayleField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class RivayleField : BackGroundBase { public override int FieldId => 41; @@ -10,91 +11,4 @@ public class RivayleField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0041_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles41").gameObject; - _fieldObjDictionary.Add("gate", _fieldModel.transform.Find("md_bf_0041_01_gate").gameObject); - m_FieldAnimatorDictionary.Add("gate", _fieldObjDictionary["gate"].GetComponent()); - _fieldObjDictionary.Add("tub", _fieldModel.transform.Find("md_bf_0041_01_tub").gameObject); - m_FieldAnimatorDictionary.Add("tub", _fieldObjDictionary["tub"].GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_2", _fieldParticles.transform.Find("gimic_2").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_41, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_41_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["gate"].SetTrigger("Open"); - _battleCamera.Camera.transform.localPosition = new Vector3(1742f, -485f, 51f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-12f, -90f, 90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(1742f, -485f, 51f), new Vector3(900f, -285f, 18f), new Vector3(184f, 81f, -14f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-8f, -97f, 90.5f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutSine)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{num}", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 1: - m_FieldAnimatorDictionary["tub"].SetTrigger("tap"); - yield return new WaitForSeconds(3f); - break; - case 2: - m_FieldAnimatorDictionary["tub"].SetTrigger("fall"); - _fieldParticleSystemDictionary["gimic_2"].Play(); - yield return new WaitForSeconds(6f); - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["tub"].SetTrigger("tap"); - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/RoomBattleMatching.cs b/SVSim.BattleEngine/Engine/RoomBattleMatching.cs deleted file mode 100644 index 10f38b97..00000000 --- a/SVSim.BattleEngine/Engine/RoomBattleMatching.cs +++ /dev/null @@ -1,4 +0,0 @@ -public class RoomBattleMatching : HeaderData -{ - public RoomBattleMatchingDetail data; -} diff --git a/SVSim.BattleEngine/Engine/RoomBattleMatchingDetail.cs b/SVSim.BattleEngine/Engine/RoomBattleMatchingDetail.cs deleted file mode 100644 index 0e9da490..00000000 --- a/SVSim.BattleEngine/Engine/RoomBattleMatchingDetail.cs +++ /dev/null @@ -1,8 +0,0 @@ -public class RoomBattleMatchingDetail -{ - public int battle_state; - - public int matching_state; - - public string battleId; -} diff --git a/SVSim.BattleEngine/Engine/RoomInviteFriendColum.cs b/SVSim.BattleEngine/Engine/RoomInviteFriendColum.cs index 7796c7c9..eb5ce502 100644 --- a/SVSim.BattleEngine/Engine/RoomInviteFriendColum.cs +++ b/SVSim.BattleEngine/Engine/RoomInviteFriendColum.cs @@ -13,18 +13,9 @@ public class RoomInviteFriendColum : FriendDataBase [SerializeField] private UISprite _friendIcon; - [SerializeField] - private UILabel ButtonLabel; - [SerializeField] public GameObject UnderLineObject; - protected int EmblemId; - - protected int DegreeId; - - protected int RankId; - public override void SetPlayerData(Friend.PlayerData inPlayerData, List inLoadList) { base.SetPlayerData(inPlayerData, inLoadList); diff --git a/SVSim.BattleEngine/Engine/RoomInviteReceiveDialog.cs b/SVSim.BattleEngine/Engine/RoomInviteReceiveDialog.cs index 5c4033bf..22132817 100644 --- a/SVSim.BattleEngine/Engine/RoomInviteReceiveDialog.cs +++ b/SVSim.BattleEngine/Engine/RoomInviteReceiveDialog.cs @@ -34,14 +34,10 @@ public class RoomInviteReceiveDialog : MonoBehaviour protected LoadQueue _loadQueue = new LoadQueue(); - protected int _choicePlayerIndex; - protected DialogBase _dialog; protected bool _isJoinRoom; - private const int LOAD_MIN = 6; - public MyPageMenu MyPageClass { get; set; } public void SetFriendList() @@ -219,7 +215,7 @@ public class RoomInviteReceiveDialog : MonoBehaviour protected void RoomJoin(int inPlayerIndex) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + InviteAcceptTask inviteAcceptTask = new InviteAcceptTask(); inviteAcceptTask.SetParameter(_playerList[inPlayerIndex].ViewerId); inviteAcceptTask.SkipAllCuteResultCodeCheckErrorPopup(); diff --git a/SVSim.BattleEngine/Engine/RoomMatchFinish.cs b/SVSim.BattleEngine/Engine/RoomMatchFinish.cs deleted file mode 100644 index a09e6def..00000000 --- a/SVSim.BattleEngine/Engine/RoomMatchFinish.cs +++ /dev/null @@ -1,4 +0,0 @@ -public class RoomMatchFinish : HeaderData -{ - public RoomMatchFinishDetail data; -} diff --git a/SVSim.BattleEngine/Engine/RoomMatchFinishDetail.cs b/SVSim.BattleEngine/Engine/RoomMatchFinishDetail.cs deleted file mode 100644 index 91b2c609..00000000 --- a/SVSim.BattleEngine/Engine/RoomMatchFinishDetail.cs +++ /dev/null @@ -1,3 +0,0 @@ -public class RoomMatchFinishDetail : MatchFinishBase -{ -} diff --git a/SVSim.BattleEngine/Engine/RoomMatchReportEndAgent.cs b/SVSim.BattleEngine/Engine/RoomMatchReportEndAgent.cs deleted file mode 100644 index e9b9c1f2..00000000 --- a/SVSim.BattleEngine/Engine/RoomMatchReportEndAgent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -public class RoomMatchReportEndAgent : MonoBehaviour -{ - public bool IsEnd { get; private set; } - - public void Finished() - { - IsEnd = true; - } -} diff --git a/SVSim.BattleEngine/Engine/RoomMatchResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/RoomMatchResultAnimationAgent.cs deleted file mode 100644 index f2426343..00000000 --- a/SVSim.BattleEngine/Engine/RoomMatchResultAnimationAgent.cs +++ /dev/null @@ -1,251 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; -using Wizard; -using Wizard.RoomMatch; - -public class RoomMatchResultAnimationAgent : ResultAnimationAgent -{ - private const float RED_ETHER_WAIT_TIME_MAX = 5f; - - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - bool needLottery = false; - if (!GameMgr.GetIns().IsWatchBattle) - { - needLottery = battleResultControl.ResultReporter.LotteryData.IsEnable; - } - if (needLottery) - { - yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); - } - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else - { - battleResultControl.PrepareAchievementLog(); - if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - yield return StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - else - { - yield return new WaitForSeconds(2f); - } - if (needLottery) - { - yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); - } - if (ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (Data.RoomMatchFinish.data != null && !GameMgr.GetIns().IsReplayBattle && !GameMgr.GetIns().IsWatchBattle) - { - TreasureBoxCpResultInfo treasureBoxCpResultInfo = Data.RoomMatchFinish.data.TreasureBoxCpResultInfo; - if (treasureBoxCpResultInfo.IsPlayGradeUpAnimation()) - { - yield return TreasureBoxCpOpenBoxAnimation(battleResultControl, treasureBoxCpResultInfo.AfterGrade); - } - if (treasureBoxCpResultInfo.IsBoxOpened()) - { - yield return CreateTreasureBoxCpRewardDialog(treasureBoxCpResultInfo); - } - } - bool isFinishBattlePass = false; - battleResultControl.SetBattlePassGauge(delegate - { - battleResultControl.FinishResult(); - isFinishBattlePass = true; - }); - while (!isFinishBattlePass) - { - yield return null; - } - if (Data.RedEtherCampaignResultData != null) - { - bool isFinishRedEther = false; - RedEtherCampaignPanel.Create(battleResultControl.gameObject, Data.RedEtherCampaignResultData, battleResultControl, delegate - { - isFinishRedEther = true; - }); - float time = 0f; - while (!isFinishRedEther) - { - time += Time.deltaTime; - if (time >= 5f) - { - break; - } - yield return null; - } - yield return ShowRewardDialog(Data.RedEtherCampaignResultData.RewardList); - } - battleResultControl.GreySpriteBGVisible = false; - returnRoom(); - } - - private void returnRoom() - { - if (GameMgr.GetIns().IsWatchBattle) - { - if (GameMgr.GetIns().IsReplayBattle) - { - UIManager.GetInstance().StartCoroutine(GameMgr.GetIns().GetBattleCtrl().BattleEnd(delegate - { - UIManager.ViewScene replayEndBackScene = Data.ReplayBattleInfo.ReplayEndBackScene; - UIManager.ChangeViewSceneParam replayEndBackSceneParam = Data.ReplayBattleInfo.ReplayEndBackSceneParam; - UIManager.GetInstance().ChangeViewScene(replayEndBackScene, replayEndBackSceneParam); - })); - } - else - { - PlayerControllerForWatching playerControllerForWatching = RoomBase.ConnectController.OwnCtrl as PlayerControllerForWatching; - PlayerControllerForWatching playerControllerForWatching2 = RoomBase.ConnectController.OppoCtrl as PlayerControllerForWatching; - playerControllerForWatching.ResetWatchHandler(); - playerControllerForWatching2.ResetWatchHandler(); - StartCoroutine(StartCheckState(playerControllerForWatching, playerControllerForWatching2)); - } - return; - } - if (RoomBase.IsConnectControllerActive()) - { - RoomBase.ConnectController.TotalBattleNum++; - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Room); - return; - } - PrepareRoom((!Data.BattleRecoveryInfo.is_owner) ? RoomConnectController.PositionMode.VISITOR : RoomConnectController.PositionMode.OWNER, Data.BattleRecoveryInfo.BattleParameterInstance, Data.BattleRecoveryInfo.roomId, PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.ROOM_MATCH_FRIEND_WATCH_PERMIT), PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.ROOM_MATCH_GUILD_WATCH_PERMIT), Data.BattleRecoveryInfo.ConventionInfo, Data.BattleRecoveryInfo.IsGatheringRoom, Data.BattleRecoveryInfo.CanUseNonPossessionCard, delegate - { - RoomBase.OnAlreadySetup(); - RoomBase.ConnectController.TotalBattleNum++; - RoomBase.ConnectController.OppoCtrl.Target.ViewerId = Data.BattleRecoveryInfo.opponent_viewer_id; - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Room, delegate - { - RoomBase.GetInstance().IsRecoveryRoom = true; - }); - }); - } - - public void PrepareRoom(RoomConnectController.PositionMode mode, BattleParameter battleParameter, string roomId, bool isPermitFriendWatch, bool isPermitGuildWatch, ConventionInfo conventionInfo, bool isGathering, bool canUseNonPossessionCard, Action callback) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - RoomConnectController.InitializeParameter initializeParameter = new RoomConnectController.InitializeParameter(mode, battleParameter, roomId); - initializeParameter.IsPermitFriendWatch = isPermitFriendWatch; - initializeParameter.IsPermitGuildWatch = isPermitGuildWatch; - initializeParameter.ConventionInfo = conventionInfo; - initializeParameter.IsGathering = isGathering; - if (conventionInfo != null) - { - initializeParameter.IsEnableTurnSelect = conventionInfo.IsSelectableTurn; - } - RoomConnectController roomConnectController = new RoomConnectController(initializeParameter); - roomConnectController.InitPlayerController(); - roomConnectController.IsEnableGuildInviteButton = Data.BattleRecoveryInfo.IsEnableGuildInviteButton; - if (conventionInfo != null) - { - roomConnectController.DisplayRoomID = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.ROOM_MATCH_DISPLAY_ID); - } - if (isGathering) - { - roomConnectController.DisplayRoomID = ((roomId.Length > 5) ? roomId.Substring(roomId.Length - 5, 5) : roomId); - } - roomConnectController.CanUseNonPossessionCard = canUseNonPossessionCard; - UIManager.GetInstance().closeInSceneCenterLoading(); - callback(); - } - - private IEnumerator StartCheckState(PlayerControllerForWatching pcontroller, PlayerControllerForWatching ocontroller) - { - while (RoomBase.ConnectController.TotalWatchBattleNum == RoomBase.ConnectController.TotalBattleNum && !RoomBase.ConnectController.IsRelease) - { - yield return null; - } - RoomBase.ConnectController.TotalWatchBattleNum = RoomBase.ConnectController.TotalBattleNum; - pcontroller.ResetReceiveEvent(); - ocontroller.ResetReceiveEvent(); - RoomBase.ConnectController.RemoveWatchEventDispath(isOwn: true); - RoomBase.ConnectController.RemoveWatchEventDispath(isOwn: false); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Room); - } -} diff --git a/SVSim.BattleEngine/Engine/RoomMatchResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/RoomMatchResultAnimationHandler.cs deleted file mode 100644 index dfe9f67e..00000000 --- a/SVSim.BattleEngine/Engine/RoomMatchResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class RoomMatchResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly RoomMatchResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public RoomMatchResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/RoomMatchResultReporter.cs b/SVSim.BattleEngine/Engine/RoomMatchResultReporter.cs deleted file mode 100644 index 30990925..00000000 --- a/SVSim.BattleEngine/Engine/RoomMatchResultReporter.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Lottery; - -public class RoomMatchResultReporter : IBattleResultReporter -{ - private readonly GameObject m_reportEndAgentObj; - - private readonly RoomMatchReportEndAgent m_reportEndAgent; - - public bool IsEnd => m_reportEndAgent.IsEnd; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => Data.RoomMatchFinish.data._missionRewards; - - public List VictoryRewards => null; - - public bool IsDataExist => Data.RoomMatchFinish.data != null; - - public MyPageHomeDialogData HomeDialogData => null; - - public LotteryApplyData LotteryData => Data.RoomMatchFinish.data.AchievedInfo._lotteryData; - - public RoomMatchResultReporter() - { - m_reportEndAgentObj = new GameObject(); - m_reportEndAgent = m_reportEndAgentObj.AddComponent(); - } - - public void Report(bool isWin) - { - m_reportEndAgent.Finished(); - } - - public JsonData GetFinishResponseData() - { - return Data.RoomMatchFinish.data._responseData; - } - - public List GetUserAchievementList() - { - return Data.RoomMatchFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.RoomMatchFinish.data.achieved_mission_list; - } - - public void Destroy() - { - Object.Destroy(m_reportEndAgentObj); - } - - public int GetClassExp() - { - return 0; - } -} diff --git a/SVSim.BattleEngine/Engine/RoomTwoPickBeforeBattleInfo.cs b/SVSim.BattleEngine/Engine/RoomTwoPickBeforeBattleInfo.cs index c2673f17..58aaddeb 100644 --- a/SVSim.BattleEngine/Engine/RoomTwoPickBeforeBattleInfo.cs +++ b/SVSim.BattleEngine/Engine/RoomTwoPickBeforeBattleInfo.cs @@ -11,40 +11,8 @@ public class RoomTwoPickBeforeBattleInfo receiveDeck.cardIds = new int[0]; } - public void ReceiveBackDraftCardIdList(List list) - { - receiveDeck.cardIds = list.ToArray(); - } - public void ReceiveBackDraftCharaId(int id) { receiveDeck.skinId = id; } - - public void SetClassId(int classId) - { - receiveDeck.classId = classId; - } - - public void SelfInfoClasIdCopyTwoPickDraftData() - { - SetClassId(GameMgr.GetIns().GetNetworkUserInfoData().GetSelfClassId()); - } - - public void SetSelfClassIdTwoPickDraftData(int classId) - { - SetClassId(classId); - } - - public void SelfInfoDeckCopyTwoPickDraftData() - { - List selfDeck = GameMgr.GetIns().GetNetworkUserInfoData().GetSelfDeck(); - List list = new List(selfDeck.Count); - foreach (CardDataModel item in selfDeck) - { - list.Add(item.CardId); - } - ReceiveBackDraftCardIdList(list); - ReceiveBackDraftCharaId(GameMgr.GetIns().GetNetworkUserInfoData().GetSelfCharaId()); - } } diff --git a/SVSim.BattleEngine/Engine/RoomTwoPickInfo.cs b/SVSim.BattleEngine/Engine/RoomTwoPickInfo.cs index 5aba3f36..86febcc7 100644 --- a/SVSim.BattleEngine/Engine/RoomTwoPickInfo.cs +++ b/SVSim.BattleEngine/Engine/RoomTwoPickInfo.cs @@ -3,9 +3,6 @@ using Wizard.Scripts.Network.Data.TaskData.Arena.TwoPick; public class RoomTwoPickInfo { - public int[] candidateClassIds; - - public CandidateCardInfo candidateCardInfo; public Deck deckData; diff --git a/SVSim.BattleEngine/Engine/RoyalPalaceField.cs b/SVSim.BattleEngine/Engine/RoyalPalaceField.cs index d87268d6..50e3243a 100644 --- a/SVSim.BattleEngine/Engine/RoyalPalaceField.cs +++ b/SVSim.BattleEngine/Engine/RoyalPalaceField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class RoyalPalaceField : BackGroundBase { public override int FieldId => 4; @@ -10,137 +11,4 @@ public class RoyalPalaceField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_plce_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles04").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldObjDictionary.Add("chandelier", _fieldModel.transform.Find("md_bf_plce_01_chandelier").gameObject); - _fieldObjDictionary.Add("armor", _fieldModel.transform.Find("md_bf_plce_01_armor").gameObject); - _fieldObjDictionary.Add("tapestry_a", _fieldModel.transform.Find("md_bf_plce_01_tapestry_a").gameObject); - _fieldObjDictionary.Add("tapestry_b", _fieldModel.transform.Find("md_bf_plce_01_tapestry_b").gameObject); - m_FieldAnimatorDictionary.Add("armor", _fieldObjDictionary["armor"].GetComponent()); - m_FieldAnimatorDictionary.Add("chandelier", _fieldObjDictionary["chandelier"].GetComponent()); - m_FieldAnimatorDictionary.Add("tapestry_a", _fieldObjDictionary["tapestry_a"].GetComponent()); - m_FieldAnimatorDictionary.Add("tapestry_b", _fieldObjDictionary["tapestry_b"].GetComponent()); - _fieldParticleSystemDictionary.Add("armor_threat", _fieldParticles.transform.Find("armor_threat").GetComponent()); - _fieldParticleSystemDictionary.Add("armor_demo", _fieldParticles.transform.Find("armor_demo").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_4, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_4_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_4_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["tapestry_a"].speed = 0.4f + Random.value * 0.2f; - m_FieldAnimatorDictionary["tapestry_b"].speed = 0.4f + Random.value * 0.2f; - m_RandomActionTime = 20f; - _battleCamera.Camera.transform.localPosition = new Vector3(-460f, 85f, -100f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-25f, -97f, 93f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(880f, -545f, -50f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-25f, -97f, 93f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(0.5f); - m_FieldAnimatorDictionary["armor"].SetTrigger("Threat"); - _fieldParticleSystemDictionary["armor_threat"].Play(); - yield return new WaitForSeconds(1.5f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(240f, -250f, -400f), "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-5f, -5f, 40f), "time", 1f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 1f, "delay", 1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - _fieldObjDictionary["chandelier"].SetActive(value: false); - yield return new WaitForSeconds(0.2f); - _fieldObjDictionary["chandelier"].SetActive(value: true); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{num}", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 1: - m_FieldAnimatorDictionary["armor"].SetTrigger("Threat"); - _fieldParticleSystemDictionary["armor_threat"].Play(); - yield return new WaitForSeconds(1f); - break; - case 2: - m_FieldAnimatorDictionary["armor"].SetTrigger("Demo"); - _fieldParticleSystemDictionary["armor_demo"].Play(); - yield return new WaitForSeconds(7.1f); - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["armor"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["chandelier"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["tapestry_a"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["tapestry_b"].speed = 0.8f + Random.value * 0.4f; - m_FieldAnimatorDictionary["tapestry_a"].SetTrigger("Shake"); - m_FieldAnimatorDictionary["tapestry_b"].SetTrigger("Shake"); - yield return new WaitForSeconds(3f); - m_FieldAnimatorDictionary["tapestry_a"].speed = 0.4f + Random.value * 0.2f; - m_FieldAnimatorDictionary["tapestry_b"].speed = 0.4f + Random.value * 0.2f; - yield return new WaitForSeconds(0f); - } - - public override void UpdateFieldRandom() - { - if (IsFieldRandom) - { - m_RandomActionTime -= Time.deltaTime; - if (m_RandomActionTime <= 0f) - { - m_FieldAnimatorDictionary["tapestry_a"].SetTrigger("LoopRandom"); - m_FieldAnimatorDictionary["tapestry_b"].SetTrigger("LoopRandom"); - m_RandomActionTime = Random.value * 20f + 20f; - } - } - } } diff --git a/SVSim.BattleEngine/Engine/RoyalPalaceNightField.cs b/SVSim.BattleEngine/Engine/RoyalPalaceNightField.cs index 452776a6..a4619f77 100644 --- a/SVSim.BattleEngine/Engine/RoyalPalaceNightField.cs +++ b/SVSim.BattleEngine/Engine/RoyalPalaceNightField.cs @@ -1,7 +1,11 @@ +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class RoyalPalaceNightField : RoyalPalaceField { public override int FieldId => 14; - public override int FieldEffectId => 4; public RoyalPalaceNightField(string bgmId = "NONE") diff --git a/SVSim.BattleEngine/Engine/SBattleLoad.cs b/SVSim.BattleEngine/Engine/SBattleLoad.cs index dc3edddd..d5b40389 100644 --- a/SVSim.BattleEngine/Engine/SBattleLoad.cs +++ b/SVSim.BattleEngine/Engine/SBattleLoad.cs @@ -1,1385 +1,290 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle.Player.ClassCharacter; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class SBattleLoad : MonoBehaviour -{ - public class CardFrameMaterialHolder - { - public static Material GetHandUnitFrame(int rarity) - { - string text = null; - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch - { - 0 => "CardFrame_F_Bronze", - 1 => "CardFrame_F_Bronze", - 2 => "CardFrame_F_Silver", - 3 => "CardFrame_F_Gold", - 4 => "CardFrame_F_Legend", - _ => "CardFrame_F_Bronze", - }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - material.shader = Shader.Find(material.shader.name); - return material; - } - - public static Material GetInPlayNormalUnitFrame(int rarity) - { - string text = null; - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch - { - 2 => "CardFrame_BTL_Silver", - 3 => "CardFrame_BTL_Gold", - 4 => "CardFrame_BTL_Legend", - _ => "CardFrame_BTL_Bronze", - }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - material.shader = Shader.Find(material.shader.name); - return material; - } - - public static Material GetInPlayEvolveUnitFrame(int rarity) - { - string text = null; - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch - { - 2 => "CardFrame_BTL_Silver", - 3 => "CardFrame_BTL_Gold", - 4 => "CardFrame_BTL_Legend", - _ => "CardFrame_BTL_Bronze", - }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - material.shader = Shader.Find(material.shader.name); - return material; - } - - public static Material GetHandFieldFrame(int rarity) - { - string text = null; - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch - { - 0 => "CardFrame_SF_Bronze", - 1 => "CardFrame_SF_Bronze", - 2 => "CardFrame_SF_Silver", - 3 => "CardFrame_SF_Gold", - 4 => "CardFrame_SF_Legend", - _ => "CardFrame_SF_Bronze", - }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - material.shader = Shader.Find(material.shader.name); - return material; - } - } - - private static readonly Vector3 CARDHOLDER_COLL_SIZE = new Vector3(70f, 90f, 50f); - - private static readonly Vector3 PLAYER_CARDHOLDER_POS = new Vector3(950f, -190f, 0f); - - private static readonly Vector3 PLAYER_CARDHOLDER_ROT = new Vector3(0f, 0f, 80f); - - private static readonly Vector3 ENEMY_CARDHOLDER_POS = new Vector3(965f, 180f, 0f); - - private static readonly Vector3 ENEMY_CARDHOLDER_ROT = new Vector3(0f, 0f, 100f); - - private static readonly Vector3 NOT_CANCEL_COLIDER_SCALE = new Vector3(5f, 4.4f, 25f); - - private GameMgr _gameMgr; - - private DataMgr _dataMgr; - - private BattleManagerBase _btlMgr; - - [SerializeField] - private GameObject m_BtlContainer; - - [SerializeField] - private GameObject m_BtlUIContainer; - - [SerializeField] - private GameObject m_SubParticleContainer; - - [SerializeField] - private GameObject m_CutInContainer; - - [SerializeField] - private GameObject m_AnimationMgr; - - [SerializeField] - private GameObject m_PanelMgr; - - public CardTemplate UnitCardTemplate; - - public CardTemplate SpellCardTemplate; - - public CardTemplate FieldCardTemplate; - - public Material[] m_RarelityFrameSkillList = new Material[5]; - - public Material[] _choiceBraveCardFrame = new Material[5]; - - private Material _sharedMaterialNormal; - - private GameObject UnitGameObj; - - private GameObject SpellGameObj; - - private GameObject FieldGameObj; - - public GameObject LifePoolIcon; - - private GameObject AtkPoolIcon; - - private GameObject CostPoolIcon; - - private GameObject NamePoolIcon; - - private GameObject SkillDescPool; - - private GameObject CardBasePool; - - private bool isAnimDone; - - private NetworkManager networkManager; - - private List unitCardEffectObjs = new List(); - - private List spellCardEffectObjs = new List(); - - private List fieldCardEffectObjs = new List(); - - public bool isDbgEnableEnemyHandView = true; - - private int _playerSkinId = -1; - - public bool isLoadEnd; - - public TurnEndButtonUI m_TurnEndBtnUI { get; private set; } - - public event Action OnEndWaitCallBack; - - public void WaitCallBack() - { - if (networkManager == null) - { - networkManager = Toolbox.NetworkManager; - } - isAnimDone = false; - if (_gameMgr == null) - { - _gameMgr = GameMgr.GetIns(); - } - _dataMgr = _gameMgr.GetDataMgr(); - _btlMgr = BattleManagerBase.GetIns(); - _btlMgr.SBattleLoad = this; - foreach (Transform item in _gameMgr.GetGameObjMgr().GetUIContainer().transform) - { - UnityEngine.Object.Destroy(item.gameObject); - } - _gameMgr.GetGameObjMgr().GetUIContainer().SetActive(value: true); - if (_gameMgr.IsNetworkBattle) - { - StartLoadNetworkBattle(); - } - else - { - StartLoadQuest(); - } - } - - public void Dispoose() - { - if (UnitCardTemplate != null) - { - UnityEngine.Object.Destroy(UnitCardTemplate.gameObject); - } - if (SpellCardTemplate != null) - { - UnityEngine.Object.Destroy(SpellCardTemplate.gameObject); - } - if (FieldCardTemplate != null) - { - UnityEngine.Object.Destroy(FieldCardTemplate.gameObject); - } - UnitCardTemplate = null; - SpellCardTemplate = null; - FieldCardTemplate = null; - m_RarelityFrameSkillList = null; - _choiceBraveCardFrame = null; - _sharedMaterialNormal = null; - UnitGameObj = null; - SpellGameObj = null; - FieldGameObj = null; - LifePoolIcon = null; - AtkPoolIcon = null; - CostPoolIcon = null; - NamePoolIcon = null; - SkillDescPool = null; - CardBasePool = null; - unitCardEffectObjs = null; - spellCardEffectObjs = null; - fieldCardEffectObjs = null; - this.OnEndWaitCallBack = null; - m_TurnEndBtnUI = null; - } - - private void StartLoadQuest() - { - Init(); - } - - private void StartLoadNetworkBattle() - { - Init(); - } - - private void Init() - { - _gameMgr.GetPrefabMgr().Load("Prefab/Game/_NetworkBattleManager"); - StartCoroutine(CreateVSObjects()); - } - - private IEnumerator InitLoad() - { - while (UnitCardTemplate == null || SpellCardTemplate == null || FieldCardTemplate == null) - { - yield return null; - } - yield return StartCoroutine(Loading()); - CardVoiceInfoCache.ClearCardVoiceInfo(); - InitPlayer(); - InitEnemy(); - } - - private void CreateUnitCardTemplate() - { - GameObject gameObject = _gameMgr.GetPrefabMgr().CloneObjectToParent(UnitGameObj, _btlMgr.Battle3DContainer); - UnitCardTemplate = gameObject.AddComponent(); - UnitCardTemplate.CardWrapObjTemp = gameObject.transform.Find("CardObj").gameObject; - UnitCardTemplate.CardNormalTemp = UnitCardTemplate.CardWrapObjTemp.transform.Find("Normal"); - UnitCardTemplate.CardNormalLodGroup = UnitCardTemplate.CardNormalTemp.GetComponent(); - UnitCardTemplate.FieldNormalMeshTemp = UnitCardTemplate.CardWrapObjTemp.transform.Find("NormalField").GetComponent(); - UnitCardTemplate.FieldEvolMeshTemp = UnitCardTemplate.CardWrapObjTemp.transform.Find("EvolField").GetComponent(); - UnitCardTemplate.Collider = gameObject.transform.Find("Collider").GetComponent(); - UnitCardTemplate.NotCancelCollider = gameObject.transform.Find("NotCancelCollider").GetComponent(); - UnitCardTemplate.FieldNormalMeshTemp.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Card_Unit_n", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - UnitCardTemplate.FieldEvolMeshTemp.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Card_Unit_e", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - MeshFilter[] componentsInChildren = UnitCardTemplate.CardNormalTemp.GetComponentsInChildren(); - Mesh sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren[0].sharedMesh = sharedMesh; - componentsInChildren[1].sharedMesh = sharedMesh2; - GameObject gameObject2 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_char_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject2.transform.parent = UnitCardTemplate.CardWrapObjTemp.transform; - gameObject2.transform.localPosition = new Vector3(0f, 0f, 0f); - gameObject2.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject2.AddComponent(); - UnitCardTemplate.FrameEffectNormal = gameObject2; - GameObject gameObject3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_char_2", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject3.transform.parent = UnitCardTemplate.CardWrapObjTemp.transform; - gameObject3.transform.localPosition = new Vector3(0f, 0f, 0f); - gameObject3.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject3.AddComponent(); - UnitCardTemplate.FrameEffectEvolve = gameObject3; - GameObject gameObject4 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject4.transform.parent = UnitCardTemplate.CardWrapObjTemp.transform; - gameObject4.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject4.AddComponent(); - UnitCardTemplate.FrameEffectHandCard = gameObject4; - UnitCardTemplate.FrameEffectHandRenderer = gameObject4.GetComponentsInChildren(includeInactive: true); - GameObject gameObject5 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("stt_loop_spellcharge_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject5.transform.parent = UnitCardTemplate.CardWrapObjTemp.transform; - gameObject5.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject5.AddComponent(); - UnitCardTemplate._spellBoostFrameEffect = gameObject5; - unitCardEffectObjs.Add(gameObject2); - unitCardEffectObjs.Add(gameObject3); - unitCardEffectObjs.Add(gameObject5); - unitCardEffectObjs.Add(gameObject4); - GameObject gameObject6 = _gameMgr.GetPrefabMgr().CloneObjectToParent(CardBasePool, _btlMgr.Battle3DContainer); - gameObject6.transform.localPosition = Global.CARD_BASE_POS; - gameObject6.transform.localRotation = Quaternion.Euler(Global.CARD_BASE_ROT); - gameObject6.transform.parent = UnitCardTemplate.CardNormalTemp; - gameObject6.transform.localScale = Global.CARD_BASE_SCALE; - gameObject6.layer = 10; - GameObject cardBasePool = CardBasePool; - cardBasePool.transform.localPosition = Global.CARD_BASE_POS; - cardBasePool.transform.localRotation = Quaternion.Euler(Global.CARD_BASE_ROT); - cardBasePool.transform.localScale = Global.CARD_BASE_SCALE; - cardBasePool.layer = 10; - UnitCardTemplate.CardWrapObjTemp.transform.localScale = new Vector3(3.2f, 3.2f, 25f); - UnitCardTemplate.Collider.transform.localScale = new Vector3(3.2f, 3.2f, 25f); - UnitCardTemplate.NotCancelCollider.transform.localScale = NOT_CANCEL_COLIDER_SCALE; - UnitCardTemplate.NormalCardBaseMeshTemp = gameObject6.GetComponent(); - UnitCardTemplate.NormalCardBaseMeshTemp.sharedMaterial = _sharedMaterialNormal; - UnitCardTemplate.EvolCardBaseMeshTemp = cardBasePool.GetComponent(); - UnitCardTemplate.EvolCardBaseMeshTemp.sharedMaterial = _sharedMaterialNormal; - GameObject obj = _gameMgr.GetPrefabMgr().CloneObjectToParent(LifePoolIcon, _btlMgr.Battle3DContainer); - obj.transform.parent = UnitCardTemplate.CardWrapObjTemp.transform; - obj.transform.localPosition = new Vector3(22f, -24.5f, -0.1f); - obj.transform.localScale = new Vector3(9f, 9f, 0.5f); - obj.SetActive(value: false); - UILabel component = obj.transform.Find("LifeLabel").GetComponent(); - UnitCardTemplate.LifeLabelTemp = component; - GameObject obj2 = _gameMgr.GetPrefabMgr().CloneObjectToParent(LifePoolIcon, _btlMgr.Battle3DContainer); - obj2.transform.parent = UnitCardTemplate.CardNormalTemp; - UILabel component2 = obj2.transform.Find("LifeLabel").GetComponent(); - Color color = (component.color = Global.CARD_DEFAULT_COLOR); - component2.color = color; - obj2.transform.localPosition = new Vector3(-1.61f, -2.14f, 0.2f); - obj2.transform.localScale = Global.SCALE_CARD_ICON; - obj2.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); - UnitCardTemplate.NormalLifeLabelTemp = component2; - GameObject gameObject7 = _gameMgr.GetPrefabMgr().CloneObjectToParent(CostPoolIcon, _btlMgr.Battle3DContainer); - gameObject7.transform.parent = UnitCardTemplate.CardNormalTemp; - gameObject7.transform.localPosition = new Vector3(1.68f, 2.12f, 0.12f); - gameObject7.transform.localScale = Global.SCALE_CARD_ICON; - SetNormalCostLabel(UnitCardTemplate, gameObject7); - GameObject gameObject8 = _gameMgr.GetPrefabMgr().CloneObjectToParent(NamePoolIcon, _btlMgr.Battle3DContainer); - gameObject8.transform.parent = UnitCardTemplate.CardNormalTemp; - gameObject8.transform.localPosition = new Vector3(0f, 2f, 0.2f); - gameObject8.transform.localScale = Global.SCALE_NAME_TEXT; - SetNormalNameLabel(UnitCardTemplate, gameObject8); - GameObject gameObject9 = _gameMgr.GetPrefabMgr().CloneObjectToParent(SkillDescPool, _btlMgr.Battle3DContainer); - gameObject9.transform.parent = gameObject.transform.Find("CardObj").transform; - gameObject9.transform.localPosition = new Vector3(1.3f, 1f, 0.1f); - gameObject9.transform.localScale = new Vector3(0.01f, 0.01f, 0f); - UnitCardTemplate.SkillIconTemp = gameObject9.GetComponent(); - UILabel component3 = gameObject9.transform.Find("SkillIconLabel").GetComponent(); - gameObject9.gameObject.SetActive(value: false); - UnitCardTemplate.SkillIconLabelTemp = component3; - GameObject obj3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(AtkPoolIcon, _btlMgr.Battle3DContainer); - obj3.transform.parent = UnitCardTemplate.CardWrapObjTemp.transform; - obj3.transform.localPosition = new Vector3(-22f, -24.5f, -0.1f); - obj3.transform.localScale = new Vector3(9f, 9f, 0.5f); - UILabel component4 = obj3.transform.Find("AtkLabel").GetComponent(); - obj3.SetActive(value: false); - UnitCardTemplate.AtkLabelTemp = component4; - GameObject obj4 = _gameMgr.GetPrefabMgr().CloneObjectToParent(AtkPoolIcon, _btlMgr.Battle3DContainer); - obj4.transform.parent = UnitCardTemplate.CardNormalTemp; - UILabel component5 = obj4.transform.Find("AtkLabel").GetComponent(); - component5.text = component4.text; - color = (component4.color = Global.CARD_DEFAULT_COLOR); - component5.color = color; - obj4.transform.localPosition = new Vector3(1.63f, -2.14f, 0.2f); - obj4.transform.localScale = Global.SCALE_CARD_ICON; - UnitCardTemplate.NormalAtkLabelTemp = component5; - UnitCardTemplate.transform.localScale = Global.CARD_BATTLE_SCALE; - UnitCardTemplate.transform.parent = base.transform; - UnitCardTemplate.gameObject.SetActive(value: false); - _gameMgr.GetEffectMgr().SetUIParticleShader(unitCardEffectObjs, delegate - { - for (int i = 0; i < unitCardEffectObjs.Count; i++) - { - unitCardEffectObjs[i].SetActive(value: false); - } - unitCardEffectObjs.Clear(); - unitCardEffectObjs = null; - CreateSpellCardTemplate(); - }); - } - - private void CreateSpellCardTemplate() - { - GameObject gameObject = _gameMgr.GetPrefabMgr().CloneObjectToParent(SpellGameObj, _btlMgr.Battle3DContainer); - SpellCardTemplate = gameObject.AddComponent(); - SpellCardTemplate.CardWrapObjTemp = gameObject.transform.Find("CardObj").gameObject; - SpellCardTemplate.CardNormalTemp = SpellCardTemplate.CardWrapObjTemp.transform.Find("Skill"); - SpellCardTemplate.CardNormalLodGroup = SpellCardTemplate.CardNormalTemp.GetComponent(); - SpellCardTemplate.FieldNormalMeshTemp = SpellCardTemplate.CardWrapObjTemp.transform.Find("NormalField").GetComponent(); - SpellCardTemplate.Collider = gameObject.transform.Find("Collider").GetComponent(); - SpellCardTemplate.NotCancelCollider = gameObject.transform.Find("NotCancelCollider").GetComponent(); - SpellCardTemplate.FieldNormalMeshTemp.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_n", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - MeshFilter[] componentsInChildren = SpellCardTemplate.CardNormalTemp.GetComponentsInChildren(); - Mesh sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren[0].sharedMesh = sharedMesh; - componentsInChildren[1].sharedMesh = sharedMesh2; - GameObject gameObject2 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_3", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject2.transform.parent = SpellCardTemplate.CardWrapObjTemp.transform; - gameObject2.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject2.AddComponent(); - SpellCardTemplate.FrameEffectHandCard = gameObject2; - SpellCardTemplate.FrameEffectHandRenderer = gameObject2.GetComponentsInChildren(includeInactive: true); - GameObject gameObject3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("stt_loop_spellcharge_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject3.transform.parent = SpellCardTemplate.CardWrapObjTemp.transform; - gameObject3.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject3.AddComponent(); - SpellCardTemplate._spellBoostFrameEffect = gameObject3; - spellCardEffectObjs.Add(gameObject2); - spellCardEffectObjs.Add(gameObject3); - GameObject gameObject4 = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab(CardBasePool); - gameObject4.transform.localPosition = Global.CARD_BASE_POS; - gameObject4.transform.localRotation = Quaternion.Euler(Global.CARD_BASE_ROT); - gameObject4.transform.parent = SpellCardTemplate.CardNormalTemp; - gameObject4.transform.localScale = Global.CARD_BASE_SCALE; - gameObject4.layer = 10; - SpellCardTemplate.NormalCardBaseMeshTemp = gameObject4.GetComponent(); - SpellCardTemplate.NormalCardBaseMeshTemp.sharedMaterial = _sharedMaterialNormal; - spellCardEffectObjs.Add(gameObject2); - spellCardEffectObjs.Add(gameObject3); - GameObject gameObject5 = null; - gameObject5 = _gameMgr.GetPrefabMgr().CloneObjectToParent(SkillDescPool, _btlMgr.Battle3DContainer); - gameObject5.transform.parent = gameObject.transform.Find("CardObj").transform; - gameObject5.transform.localPosition = new Vector3(1.3f, 1f, 0.1f); - gameObject5.transform.localScale = new Vector3(0.01f, 0.01f, 0f); - SpellCardTemplate.SkillIconTemp = gameObject5.GetComponent(); - UILabel component = gameObject5.transform.Find("SkillIconLabel").GetComponent(); - SpellCardTemplate.SkillIconTemp.gameObject.SetActive(value: false); - SpellCardTemplate.SkillIconLabelTemp = component; - GameObject gameObject6 = _gameMgr.GetPrefabMgr().CloneObjectToParent(CostPoolIcon, _btlMgr.Battle3DContainer); - gameObject6.transform.parent = SpellCardTemplate.CardNormalTemp; - gameObject6.transform.localPosition = new Vector3(1.68f, 2.12f, 0.1f); - gameObject6.transform.localScale = Global.SCALE_CARD_ICON; - SetNormalCostLabel(SpellCardTemplate, gameObject6); - GameObject gameObject7 = _gameMgr.GetPrefabMgr().CloneObjectToParent(NamePoolIcon, _btlMgr.Battle3DContainer); - gameObject7.transform.parent = SpellCardTemplate.CardNormalTemp; - gameObject7.transform.localPosition = new Vector3(0f, 2f, 0.2f); - gameObject7.transform.localScale = Global.SCALE_NAME_TEXT; - SetNormalNameLabel(SpellCardTemplate, gameObject7); - SpellCardTemplate.transform.localScale = Global.CARD_BATTLE_SCALE; - SpellCardTemplate.transform.parent = base.transform; - SpellCardTemplate.gameObject.SetActive(value: false); - SpellCardTemplate.CardWrapObjTemp.transform.localScale = new Vector3(3.2f, 3.2f, 25f); - SpellCardTemplate.Collider.transform.localScale = new Vector3(3.2f, 3.2f, 25f); - SpellCardTemplate.NotCancelCollider.transform.localScale = NOT_CANCEL_COLIDER_SCALE; - m_RarelityFrameSkillList[0] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - m_RarelityFrameSkillList[1] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - m_RarelityFrameSkillList[2] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - m_RarelityFrameSkillList[3] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - m_RarelityFrameSkillList[4] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - if (Data.CurrentFormat == Format.Avatar) - { - _choiceBraveCardFrame[0] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - _choiceBraveCardFrame[1] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - _choiceBraveCardFrame[2] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - _choiceBraveCardFrame[3] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - _choiceBraveCardFrame[4] = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); - } - _gameMgr.GetEffectMgr().SetUIParticleShader(spellCardEffectObjs, delegate - { - for (int i = 0; i < spellCardEffectObjs.Count; i++) - { - spellCardEffectObjs[i].SetActive(value: false); - } - spellCardEffectObjs.Clear(); - spellCardEffectObjs = null; - CreateFieldCardTemplate(); - }); - } - - private void CreateFieldCardTemplate() - { - GameObject gameObject = _gameMgr.GetPrefabMgr().CloneObjectToParent(FieldGameObj, _btlMgr.Battle3DContainer); - FieldCardTemplate = gameObject.AddComponent(); - FieldCardTemplate.CardWrapObjTemp = gameObject.transform.Find("CardObj").gameObject; - FieldCardTemplate.CardNormalTemp = FieldCardTemplate.CardWrapObjTemp.transform.Find("Normal"); - FieldCardTemplate.CardNormalLodGroup = FieldCardTemplate.CardNormalTemp.GetComponent(); - FieldCardTemplate.FieldNormalMeshTemp = FieldCardTemplate.CardWrapObjTemp.transform.Find("NormalField").GetComponent(); - FieldCardTemplate.Collider = gameObject.transform.Find("Collider").GetComponent(); - FieldCardTemplate.NotCancelCollider = gameObject.transform.Find("NotCancelCollider").GetComponent(); - FieldCardTemplate.FieldNormalMeshTemp.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_n", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - MeshFilter[] componentsInChildren = FieldCardTemplate.CardNormalTemp.GetComponentsInChildren(); - Mesh sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren[0].sharedMesh = sharedMesh; - componentsInChildren[1].sharedMesh = sharedMesh2; - GameObject gameObject2 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_field_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject2.transform.parent = FieldCardTemplate.CardWrapObjTemp.transform; - gameObject2.transform.localPosition = new Vector3(0f, 0f, 0f); - gameObject2.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject2.AddComponent(); - FieldCardTemplate.FrameEffectNormal = gameObject2; - GameObject gameObject3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_2", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject3.transform.parent = FieldCardTemplate.CardWrapObjTemp.transform; - gameObject3.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject3.AddComponent(); - FieldCardTemplate.FrameEffectHandCard = gameObject3; - FieldCardTemplate.FrameEffectHandRenderer = gameObject3.GetComponentsInChildren(includeInactive: true); - GameObject gameObject4 = _gameMgr.GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("stt_loop_spellcharge_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), _btlMgr.Battle3DContainer); - gameObject4.transform.parent = FieldCardTemplate.CardWrapObjTemp.transform; - gameObject4.transform.localScale = new Vector3(160f, 160f, 20.48f); - gameObject4.AddComponent(); - FieldCardTemplate._spellBoostFrameEffect = gameObject4; - fieldCardEffectObjs.Add(gameObject2); - fieldCardEffectObjs.Add(gameObject3); - fieldCardEffectObjs.Add(gameObject4); - GameObject gameObject5 = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab(CardBasePool); - gameObject5.transform.localPosition = Global.CARD_BASE_POS; - gameObject5.transform.localRotation = Quaternion.Euler(Global.CARD_BASE_ROT); - gameObject5.transform.parent = FieldCardTemplate.CardNormalTemp; - gameObject5.transform.localScale = Global.CARD_BASE_SCALE; - gameObject5.layer = 10; - FieldCardTemplate.NormalCardBaseMeshTemp = gameObject5.GetComponent(); - FieldCardTemplate.NormalCardBaseMeshTemp.sharedMaterial = _sharedMaterialNormal; - GameObject gameObject6 = null; - gameObject6 = _gameMgr.GetPrefabMgr().CloneObjectToParent(SkillDescPool, _btlMgr.Battle3DContainer); - gameObject6.transform.parent = gameObject.transform.Find("CardObj").transform; - gameObject6.transform.localPosition = new Vector3(1.3f, 1f, 0.1f); - gameObject6.transform.localScale = new Vector3(0.01f, 0.01f, 0f); - FieldCardTemplate.SkillIconTemp = gameObject6.GetComponent(); - UILabel component = FieldCardTemplate.SkillIconTemp.transform.Find("SkillIconLabel").GetComponent(); - FieldCardTemplate.SkillIconTemp.gameObject.SetActive(value: false); - FieldCardTemplate.SkillIconLabelTemp = component; - GameObject gameObject7 = _gameMgr.GetPrefabMgr().CloneObjectToParent(CostPoolIcon, _btlMgr.Battle3DContainer); - gameObject7.transform.parent = FieldCardTemplate.CardNormalTemp; - gameObject7.transform.localPosition = new Vector3(1.68f, 2.12f, 0.1f); - gameObject7.transform.localScale = Global.SCALE_CARD_ICON; - SetNormalCostLabel(FieldCardTemplate, gameObject7); - GameObject gameObject8 = _gameMgr.GetPrefabMgr().CloneObjectToParent(NamePoolIcon, _btlMgr.Battle3DContainer); - gameObject8.transform.parent = FieldCardTemplate.CardNormalTemp; - gameObject8.transform.localPosition = new Vector3(0f, 2f, 0.2f); - gameObject8.transform.localScale = Global.SCALE_NAME_TEXT; - SetNormalNameLabel(FieldCardTemplate, gameObject8); - FieldCardTemplate.transform.localScale = Global.CARD_BATTLE_SCALE; - FieldCardTemplate.transform.parent = base.transform; - FieldCardTemplate.gameObject.SetActive(value: false); - FieldCardTemplate.CardWrapObjTemp.transform.localScale = new Vector3(3.2f, 3.2f, 25f); - FieldCardTemplate.Collider.transform.localScale = new Vector3(3.2f, 3.2f, 25f); - FieldCardTemplate.NotCancelCollider.transform.localScale = NOT_CANCEL_COLIDER_SCALE; - _gameMgr.GetEffectMgr().SetUIParticleShader(fieldCardEffectObjs, delegate - { - for (int i = 0; i < fieldCardEffectObjs.Count; i++) - { - fieldCardEffectObjs[i].SetActive(value: false); - } - fieldCardEffectObjs.Clear(); - fieldCardEffectObjs = null; - StartCoroutine(InitLoad()); - }); - } - - private void SetNormalCostLabel(CardTemplate cardTemplate, GameObject costIconNormal) - { - (cardTemplate.NormalCostLabelTemp = costIconNormal.transform.Find("CostLabel").GetComponent()).color = Global.CARD_DEFAULT_COLOR; - (cardTemplate.NormalZeroCostLabelTemp = costIconNormal.transform.Find("ZeroCostLabel").GetComponent()).color = Global.CARD_DEFAULT_COLOR; - (cardTemplate.NormalSignLabelTemp = costIconNormal.transform.Find("SignLabel").GetComponent()).color = Global.CARD_DEFAULT_COLOR; - (cardTemplate.NormalSignedCostLabelTemp = costIconNormal.transform.Find("SignedCostLabel").GetComponent()).color = Global.CARD_DEFAULT_COLOR; - } - - private void SetNormalNameLabel(CardTemplate cardTemplate, GameObject nameNormal) - { - UILabel component = nameNormal.transform.Find("NameLabel").GetComponent(); - cardTemplate.NormalNameLabelTemp = component; - UILabel component2 = nameNormal.transform.Find("ChoiceBraveNameLabel").GetComponent(); - cardTemplate.NormalChoiceBraveNameLabelTemp = component2; - } - - private void LoadWithoutResources() - { - _btlMgr.BtlUIContainer = _gameMgr.GetGameObjMgr().AddUIManagerRootChildPrefab(m_BtlUIContainer); - _btlMgr.BattleUIContainer = _btlMgr.BtlUIContainer.GetComponent(); - _btlMgr.DetailMgr.DetailPanelControl = new NullDetailPanelControl(); - _btlMgr.TurnPanelControl = new NullTurnPanelControl(); - _gameMgr.GetPrefabMgr().Load("Prefab/Container/_Battle3DContainer"); - _btlMgr.Battle3DContainer = GameMgr.GetIns().GetPrefabMgr().CreateIns("Prefab/Container/_Battle3DContainer"); - _btlMgr.Battle3DContainer.transform.parent = _gameMgr.m_GameManagerObj.transform; - _btlMgr.BattlePlayer.BattleView.Setup(_gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/StatusPanelP"), _btlMgr.BtlUIContainer, _btlMgr.BtlContainer, _btlMgr.Battle3DContainer); - _btlMgr.BattleEnemy.BattleView.Setup(_gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/StatusPanelE"), _btlMgr.BtlUIContainer, _btlMgr.BtlContainer, _btlMgr.Battle3DContainer); - InitPlayer(); - InitEnemy(); - _btlMgr.CardHolder = new GameObject(); - _btlMgr.ECardHolder = new GameObject(); - _btlMgr.PSideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogP"); - _btlMgr.PSideLogControl = _btlMgr.PSideLog.AddMissingComponent(); - } - - private List GetHighRankPrefabPathList(int id) - { - List list = new List(); - string key = "class_" + id; - if (Data.Master.HighRankEffect.ContainsKey(key)) - { - List list2 = Data.Master.HighRankEffect[key]; - for (int i = 0; i < list2.Count; i++) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(list2[i].Prefab, ResourcesManager.AssetLoadPathType.Effect2D)); - } - } - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_" + id + "_Frame", ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_" + id + "_Frame", ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_" + id + "_mask", ResourcesManager.AssetLoadPathType.ClassCharaTexture)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_" + id + "_Base", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_" + id + "_Outside", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - return list; - } - - private List Get3dSkinPrefabPathList() - { - return new List - { - Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_uma_Frame", ResourcesManager.AssetLoadPathType.ClassCharaMaterial), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_uma_Frame", ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_uma_mask", ResourcesManager.AssetLoadPathType.ClassCharaTexture), - Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_uma_Base", ResourcesManager.AssetLoadPathType.ClassCharaMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_uma_Outside", ResourcesManager.AssetLoadPathType.ClassCharaMesh) - }; - } - - private List GetSnCollabPrefabPathList(int skinId) - { - List list = new List(); - if (!Global.IsSnCollabSkin(skinId)) - { - return list; - } - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_sn_Frame", ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_sn_Frame", ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_sn_mask", ResourcesManager.AssetLoadPathType.ClassCharaTexture)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_sn_Base", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_sn_Outside", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - return list; - } - - private IEnumerator CreateVSObjects() - { - _gameMgr.GetEffectMgr().InitCommonEffect("Json/EffectBattleData", isBattle: true, isField: false, isBattleEffect: true); - List cardPrefabPathList = new List(); - _playerSkinId = _gameMgr.GetDataMgr().GetPlayerSkinId(); - if (_gameMgr.GetDataMgr().IsHighRankSkinPlayer()) - { - cardPrefabPathList.AddRange(GetHighRankPrefabPathList(_playerSkinId)); - } - if (_gameMgr.GetDataMgr().Is3DSkin(isPlayer: true)) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_playerSkinId.ToString(), ResourcesManager.AssetLoadPathType.ClassChara3D)); - cardPrefabPathList.AddRange(Get3dSkinPrefabPathList()); - } - else - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_playerSkinId.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaSpine)); - cardPrefabPathList.AddRange(GetSnCollabPrefabPathList(_playerSkinId)); - } - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_encampment_mask", ResourcesManager.AssetLoadPathType.ClassCharaTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_encampment_mask_out", ResourcesManager.AssetLoadPathType.ClassCharaTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("mt_encampment_mask", ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetPlayerClassId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaIconLevel)); - int num; - if (_gameMgr.IsNetworkBattle && !_gameMgr.GetDataMgr().IsDipslayHighRankFormat()) - { - num = PlayerStaticData.UserRankCurrentFormat(); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(num.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S)); - } - else - { - num = PlayerStaticData.UserRankHighAllFormat(); - } - if (num > 1) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath((num - 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L)); - } - if (num < Data.Load.data.RankInfoList.Max((RankInfo x) => x.RankId)) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath((num + 1).ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L)); - } - if (_gameMgr.IsNetworkBattle) - { - if (_gameMgr.IsWatchBattle || _btlMgr.IsRecovery) - { - NetworkUserInfoData networkUserInfoData = _gameMgr.GetNetworkUserInfoData(); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(networkUserInfoData.GetSelfDegreeId(), DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(networkUserInfoData.GetSelfDegreeId(), DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfCountryCode().ToString(), ResourcesManager.AssetLoadPathType.Country_M)); - } - if (!_gameMgr.IsWatchBattle) - { - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - } - cardPrefabPathList.AddRange(LoadOpponentAssets(null)); - } - else if (_btlMgr.IsPuzzleMgr) - { - PuzzleQuestData puzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == GameMgr.GetIns().GetDataMgr().PuzzleQuestId); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.EnemyEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(puzzleQuestData.EnemyDegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(puzzleQuestData.EnemyDegreeId, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.PlayerEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(puzzleQuestData.PlayerDegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(puzzleQuestData.PlayerDegreeId, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - } - else if (_gameMgr.GetDataMgr().m_BattleType == DataMgr.BattleType.Quest) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_dataMgr.QuestBattleData.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(_dataMgr.QuestBattleData.DegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(_dataMgr.QuestBattleData.DegreeId, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - } - else if (_gameMgr.GetDataMgr().m_BattleType == DataMgr.BattleType.BossRushQuest || _gameMgr.GetDataMgr().m_BattleType == DataMgr.BattleType.SecretBossQuest) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_dataMgr.BossRushBattleData.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(_dataMgr.BossRushBattleData.DegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(_dataMgr.BossRushBattleData.DegreeId, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - } - else - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(100000000.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(_dataMgr.PracticeDifficultyDegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(_dataMgr.PracticeDifficultyDegreeId, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.SMALL, isFetch: false)); - cardPrefabPathList.AddRange(DegreeHelper.GetDegreeResourceList(PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - } - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_Frame", ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_encampment_Base", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_encampment_Outside", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_Frame", ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - cardPrefabPathList.Add("s/se_battle.acb"); - ClassCharacterMasterData playerCharaData = _gameMgr.GetDataMgr().GetPlayerCharaData(); - string path = playerCharaData.path; - string path2 = "mt_Encampment_Chara_1"; - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(((int)playerCharaData.ClassColorId).ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaEncampment)); - string path3 = "mt_Encampment_Chara_1_Rev"; - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(path3, ResourcesManager.AssetLoadPathType.ClassCharaMaterial)); - if (!cardPrefabPathList.Contains(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetPlayerSleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial))) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetPlayerSleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetPlayerSleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial)); - if (Data.Master.SleeveMgr.Get(DataMgr.GetAbleSleeveId(_gameMgr.GetDataMgr().GetPlayerSleeveId())).IsPremiumSleeve) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetPlayerSleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureMask)); - } - } - if (!cardPrefabPathList.Contains(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetEnemySleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial))) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetEnemySleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetEnemySleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial)); - if (Data.Master.SleeveMgr.Get(_gameMgr.GetDataMgr().GetEnemySleeveId()).IsPremiumSleeve) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(_gameMgr.GetDataMgr().GetEnemySleeveId().ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureMask)); - } - } - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("UnitCard", ResourcesManager.AssetLoadPathType.CardFrame)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("SpellCard", ResourcesManager.AssetLoadPathType.CardFrame)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("FieldCard", ResourcesManager.AssetLoadPathType.CardFrame)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_char_1", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_char_2", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Card_Unit", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_low", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Card_Unit_n", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_Card_Unit_e", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_F_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_F_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_F_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_F_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_BTL_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_BTL_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_BTL_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_BTL_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_low", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_n", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - if (Data.CurrentFormat == Format.Avatar) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_heroskill", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_heroskill_low", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - } - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_S_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - if (Data.CurrentFormat == Format.Avatar) - { - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_HS_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - } - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_low", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_n", ResourcesManager.AssetLoadPathType.CardFrameMesh)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_SF_Bronze", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_SF_Silver", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_SF_Gold", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrame_SF_Legend", ResourcesManager.AssetLoadPathType.CardFrameMaterial)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_CardBase", ResourcesManager.AssetLoadPathType.CardDeco)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_field_1", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_1", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_2", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_3", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_class_1", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("stt_loop_spellcharge_1", ResourcesManager.AssetLoadPathType.Effect2D)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_md_Card", ResourcesManager.AssetLoadPathType.CardFrame)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_deckout_M", ResourcesManager.AssetLoadPathType.BattleTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_deckout", ResourcesManager.AssetLoadPathType.BattleTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_deckout_win_M", ResourcesManager.AssetLoadPathType.BattleTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_deckout_win", ResourcesManager.AssetLoadPathType.BattleTexture)); - cardPrefabPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrameClassIcon", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus)); - List emotionCsvLoadPath = new List(); - List emotionIds = new List(); - if (_gameMgr.GetDataMgr().GetPlayerEmotionId().Contains("_")) - { - string playerEmotionId = _gameMgr.GetDataMgr().GetPlayerEmotionId(); - emotionIds.Add(playerEmotionId); - cardPrefabPathList.Add(Data.Master.GetEmotionTypePath(playerEmotionId, ref emotionCsvLoadPath)); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(cardPrefabPathList, delegate - { - Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(cardPrefabPathList); - _btlMgr.BtlUIContainer = _gameMgr.GetGameObjMgr().AddUIManagerRootChildPrefab(m_BtlUIContainer); - _btlMgr.BattleUIContainer = _btlMgr.BtlUIContainer.GetComponent(); - _btlMgr.SubParticleContainer = UnityEngine.Object.Instantiate(m_SubParticleContainer); - _btlMgr.SubParticleContainer.transform.parent = _gameMgr.m_GameManagerObj.transform; - _gameMgr.GetPrefabMgr().Load("Prefab/Container/_Battle3DContainer"); - _btlMgr.Battle3DContainer = GameMgr.GetIns().GetPrefabMgr().CreateIns("Prefab/Container/_Battle3DContainer"); - _btlMgr.Battle3DContainer.transform.parent = _gameMgr.m_GameManagerObj.transform; - _btlMgr.CutInContainer = UnityEngine.Object.Instantiate(m_CutInContainer); - _btlMgr.CutInContainer.transform.parent = _gameMgr.m_GameManagerObj.transform; - _btlMgr.BtlContainer = _gameMgr.GetPrefabMgr().CloneObjectToParent(m_BtlContainer, _btlMgr.Battle3DContainer); - CardBasePool = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_CardBase", ResourcesManager.AssetLoadPathType.CardDeco, isfetch: true)) as GameObject; - CardBasePool.name = "CardBase"; - CardBasePool.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_md_Card", ResourcesManager.AssetLoadPathType.SleeveMesh, isfetch: true)); - _btlMgr.CardHolder = InitCardHolderObject("CardHolder", "CardHolder", PLAYER_CARDHOLDER_POS, PLAYER_CARDHOLDER_ROT, CARDHOLDER_COLL_SIZE); - InitHandDeckObject("HandDeck"); - _btlMgr.ECardHolder = InitCardHolderObject("ECardHolder", "ECardHolder", ENEMY_CARDHOLDER_POS, ENEMY_CARDHOLDER_ROT, CARDHOLDER_COLL_SIZE); - InitHandDeckObject("EHandDeck"); - _btlMgr.ChoiceCardHolder = _btlMgr.BtlContainer.transform.Find("ChoiceHolder").gameObject; - _btlMgr.EvolveCardHolder = _btlMgr.BtlContainer.transform.Find("EvolveCardHolder").gameObject; - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_deckout_M", ResourcesManager.AssetLoadPathType.BattleTexture, isfetch: true)) as Material; - material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_deckout", ResourcesManager.AssetLoadPathType.BattleTexture, isfetch: true)) as Texture; - material.shader = Shader.Find(material.shader.name); - if (Global.PreLoadSkinId.Contains(_playerSkinId)) - { - LoadHighRankSkinEffectResources(_playerSkinId); - } - Material material2 = LoadSleeveMaterial(_gameMgr.GetDataMgr().GetPlayerSleeveId()); - int count = _gameMgr.GetDataMgr().GetCurrentDeckData().Count; - if (_gameMgr.IsWatchBattle) - { - _dataMgr.SetDeckMaxCount(count, isSelf: true); - } - for (int i = 0; i < count + 1; i++) - { - Material texture = ((i < count) ? material2 : material); - Vector3 scale = ((i < count) ? Global.CARD_BASE_STAY_SCALE : (Global.CARD_BASE_STAY_SCALE * 0.95f)); - AddDeckCard(i, texture, scale, isPlayer: true); - } - Material material3 = LoadSleeveMaterial(_gameMgr.GetDataMgr().GetEnemySleeveId()); - int count2 = _gameMgr.GetDataMgr().GetCurrentEnemyDeckData().Count; - if (_gameMgr.IsWatchBattle) - { - _dataMgr.SetDeckMaxCount(count2, isSelf: false); - } - for (int j = 0; j < count2 + 1; j++) - { - Material texture2 = ((j < count2) ? material3 : material); - Vector3 scale2 = ((j < count2) ? Global.CARD_BASE_STAY_SCALE : (Global.CARD_BASE_STAY_SCALE * 0.95f)); - AddDeckCard(j, texture2, scale2, isPlayer: false); - } - _btlMgr.PCardPlace = _btlMgr.BtlContainer.transform.Find("PlayerCardPlace").gameObject; - UnitGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("UnitCard", ResourcesManager.AssetLoadPathType.CardFrame, isfetch: true)); - SpellGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("SpellCard", ResourcesManager.AssetLoadPathType.CardFrame, isfetch: true)); - FieldGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("FieldCard", ResourcesManager.AssetLoadPathType.CardFrame, isfetch: true)); - CostPoolIcon = Resources.Load("Prefab/CardDeco/Cost") as GameObject; - AtkPoolIcon = Resources.Load("Prefab/CardDeco/Atk") as GameObject; - LifePoolIcon = Resources.Load("Prefab/CardDeco/Life") as GameObject; - _gameMgr.GetPrefabMgr().Load("Prefab/CardDeco/Name"); - NamePoolIcon = _gameMgr.GetPrefabMgr().Get("Prefab/CardDeco/Name"); - NamePoolIcon.name = "Name"; - SkillDescPool = _gameMgr.GetPrefabMgr().Get("Prefab/CardDeco/SkillIcon"); - SkillDescPool.name = "SkillIcon"; - Data.Master.DynamicLoadEmoteData(emotionCsvLoadPath, emotionIds); - StartCoroutine(StartVS()); - _gameMgr.GetEffectMgr().SetupEffectContainer(); - _gameMgr.GetEffectMgr().InitEnemyBattleEffect(); - _gameMgr.GetEffectMgr().InitBattleEffect(); - if (null == _sharedMaterialNormal) - { - _sharedMaterialNormal = new Material(Shader.Find("Custom/Card/Unlit Diffuse")); - } - _btlMgr.CreateBattleField(); - CreateUnitCardTemplate(); - this.OnEndWaitCallBack.Call(); - })); - } - - private void LoadHighRankSkinEffectResources(int skinId) - { - string key = "class_" + skinId; - if (!Data.Master.HighRankEffect.ContainsKey(key)) - { - return; - } - foreach (HighRankEffectInfo item in Data.Master.HighRankEffect[key]) - { - if (!(item.Prefab != "")) - { - continue; - } - UnityEngine.Object original = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(item.Prefab, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - EffectBattle effObject = (UnityEngine.Object.Instantiate(original) as GameObject).AddComponent(); - effObject.gameObject.SetActive(value: false); - if (BattleManagerBase.GetIns() != null) - { - GameMgr.GetIns().GetEffectMgr().LoadUIParticleShader(effObject.gameObject, delegate - { - UnityEngine.Object.Destroy(effObject.gameObject); - }, isBattle: true); - } - } - } - - public List LoadOpponentAssets(Action callback) - { - List list = new List(); - NetworkUserInfoData networkUserInfoData = _gameMgr.GetNetworkUserInfoData(); - if (networkUserInfoData.OppoBattleStartInfo != null) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S)); - list.AddRange(DegreeHelper.GetDegreeResourceList(networkUserInfoData.GetOpponentDegreeId(), DegreeHelper.DegreeType.MIDDLE, isFetch: false)); - list.AddRange(DegreeHelper.GetDegreeResourceList(networkUserInfoData.GetOpponentDegreeId(), DegreeHelper.DegreeType.SMALL, isFetch: false)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentCountryCode().ToString(), ResourcesManager.AssetLoadPathType.Country_M)); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(list, delegate - { - callback.Call(); - })); - } - return list; - } - - private List GetDelayMaterialPath() - { - List list = new List(); - ClassBattleCardBase classBattleCardBase = _btlMgr.BattlePlayer.Class as ClassBattleCardBase; - bool flag = _gameMgr.GetDataMgr().IsHighRankSkinPlayer(); - bool flag2 = _gameMgr.GetDataMgr().Is3DSkin(isPlayer: true); - if (flag != classBattleCardBase.ClassBattleCardView.ClassCharacter is HighRankSpineClassCharacter || flag2 != classBattleCardBase.ClassBattleCardView.ClassCharacter is Class3dCharacterBase) - { - classBattleCardBase.Setup(); - _btlMgr.BattlePlayer.PlayerBattleView.HandView.SetClassBattleCardView(classBattleCardBase.ClassBattleCardView); - classBattleCardBase.SkillApplyInformation.ReSetupVfxCreator(classBattleCardBase.VfxCreator); - } - int playerSkinId = _gameMgr.GetDataMgr().GetPlayerSkinId(); - if (_playerSkinId != playerSkinId) - { - if (flag2) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId.ToString(), ResourcesManager.AssetLoadPathType.ClassChara3D)); - list.AddRange(Get3dSkinPrefabPathList()); - } - else - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaSpine)); - list.AddRange(GetSnCollabPrefabPathList(playerSkinId)); - } - ClassCharacterMasterData playerCharaData = _gameMgr.GetDataMgr().GetPlayerCharaData(); - string path = playerCharaData.path; - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(((int)playerCharaData.ClassColorId).ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaEncampment)); - if (flag) - { - list.AddRange(GetHighRankPrefabPathList(playerSkinId)); - } - } - int enemySkinId = _gameMgr.GetDataMgr().GetEnemySkinId(); - bool flag3 = _gameMgr.GetDataMgr().IsHighRankSkinEnemy(); - bool flag4 = _gameMgr.GetDataMgr().Is3DSkin(isPlayer: false); - ClassBattleCardBase classBattleCardBase2 = _btlMgr.BattleEnemy.Class as ClassBattleCardBase; - if (flag3 != classBattleCardBase2.ClassBattleCardView.ClassCharacter is HighRankSpineClassCharacter || flag4 != classBattleCardBase2.ClassBattleCardView.ClassCharacter is Class3dCharacterBase) - { - classBattleCardBase2.Setup(); - _btlMgr.BattleEnemy.BattleView.HandView.SetClassBattleCardView(classBattleCardBase2.ClassBattleCardView); - classBattleCardBase2.SkillApplyInformation.ReSetupVfxCreator(classBattleCardBase2.VfxCreator); - } - if (_playerSkinId != enemySkinId) - { - if (flag4) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId.ToString(), ResourcesManager.AssetLoadPathType.ClassChara3D)); - list.AddRange(Get3dSkinPrefabPathList()); - } - else - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaSpine)); - list.AddRange(GetSnCollabPrefabPathList(enemySkinId)); - } - ClassCharacterMasterData enemyCharaData = _gameMgr.GetDataMgr().GetEnemyCharaData(); - string path2 = enemyCharaData.path; - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.ClassCharaMesh)); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(((int)enemyCharaData.ClassColorId).ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaEncampment)); - if (flag3) - { - list.AddRange(GetHighRankPrefabPathList(enemySkinId)); - } - } - return list; - } - - public VfxBase NetworkBattleStartToLoadOpponentObjects(Action onLoaded) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - List delayMaterialPath = GetDelayMaterialPath(); - List emotionCsvLoadPath = new List(); - List emotionIds = new List(); - if (_gameMgr.GetDataMgr().GetEnemyEmotionId().Contains("_")) - { - string enemyEmotionId = _gameMgr.GetDataMgr().GetEnemyEmotionId(); - emotionIds.Add(enemyEmotionId); - delayMaterialPath.Add(Data.Master.GetEmotionTypePath(enemyEmotionId, ref emotionCsvLoadPath)); - } - foreach (string item in delayMaterialPath) - { - sequentialVfxPlayer.Register(new WaitLoadResourceVfx(item)); - } - if (_playerSkinId != _gameMgr.GetDataMgr().GetPlayerSkinId() && _gameMgr.GetDataMgr().IsHighRankSkinPlayer()) - { - int playerSkinId = _gameMgr.GetDataMgr().GetPlayerSkinId(); - if (Global.PreLoadSkinId.Contains(playerSkinId)) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - LoadHighRankSkinEffectResources(playerSkinId); - })); - } - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - Data.Master.DynamicLoadEmoteData(emotionCsvLoadPath, emotionIds); - onLoaded.Call(); - })); - return sequentialVfxPlayer; - } - - private Vector3 GetDeckCardLocalPosition(int idx) - { - return new Vector3(-0.1f, 0.4f, 0.1f) * idx; - } - - public void AddDeckCard(int idx, Material texture, Vector3 scale, bool isPlayer) - { - GameObject gameObject = _gameMgr.GetPrefabMgr().CloneObjectToParent(CardBasePool, _btlMgr.Battle3DContainer); - gameObject.GetComponent().enabled = false; - gameObject.transform.SetParent(isPlayer ? _btlMgr.CardHolder.transform : _btlMgr.ECardHolder.transform); - IList holderCards = _btlMgr.GetCardParameterListInfo(isPlayer).HolderCards; - gameObject.name = holderCards.Count.ToString(); - holderCards.Insert(idx, gameObject); - gameObject.transform.localPosition = GetDeckCardLocalPosition(idx + 1); - gameObject.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); - MeshRenderer component = gameObject.GetComponent(); - component.material = texture; - component.material.SetFloat("_CullMode", 2f); - component.material.SetFloat("_ZWriteMode", 1f); - gameObject.transform.localScale = scale; - } - - public void AddDeckCards(int addNum, bool isPlayer) - { - for (int i = 0; i < addNum; i++) - { - Material texture = (isPlayer ? LoadSleeveMaterial(_gameMgr.GetDataMgr().GetPlayerSleeveId()) : LoadSleeveMaterial(_gameMgr.GetDataMgr().GetEnemySleeveId())); - int idx = _btlMgr.GetCardParameterListInfo(isPlayer).HolderCards.Count - 1; - AddDeckCard(idx, texture, Global.CARD_BASE_STAY_SCALE, isPlayer); - } - IList holderCards = _btlMgr.GetCardParameterListInfo(isPlayer).HolderCards; - Vector3 localPosition = holderCards[holderCards.Count - 1].transform.localPosition; - for (int j = 1; j < holderCards.Count; j++) - { - int index = holderCards.Count - 1 - j; - holderCards[index].transform.localPosition = localPosition - GetDeckCardLocalPosition(j); - } - } - - private GameObject InitCardHolderObject(string cardHolderName, string tagName, Vector3 pos, Vector3 rot, Vector3 colliderSize) - { - GameObject obj = _btlMgr.BtlContainer.transform.Find(cardHolderName).gameObject; - obj.GetComponent().size = colliderSize; - obj.tag = tagName; - obj.GetComponent().enabled = false; - obj.SetActive(value: true); - obj.transform.localPosition = pos; - obj.transform.eulerAngles = rot; - obj.GetComponent().enabled = false; - return obj; - } - - private void InitHandDeckObject(string handDeckName) - { - _btlMgr.BtlContainer.transform.Find(handDeckName).GetComponent().uiCamera = _btlMgr.Battle3DContainer.transform.Find("Camera").GetComponent(); - } - - public IEnumerator StartVS() - { - yield return new WaitForSeconds(0.4f); - RunVS(); - } - - private void RunVS() - { - isAnimDone = true; - } - - private IEnumerator Loading() - { - TweenAlpha component = _btlMgr.Battle3DContainer.transform.Find("OverBG").GetComponent(); - m_TurnEndBtnUI = _btlMgr.BtlUIContainer.transform.Find("TurnEndBtn").GetComponent(); - m_TurnEndBtnUI.gameObject.SetActive(value: false); - _btlMgr.BtlUIContainer.transform.Find("PlayerChoiceBraveBtn").gameObject.SetActive(value: false); - _btlMgr.BtlUIContainer.transform.Find("EnemyChoiceBraveBtn").gameObject.SetActive(value: false); - _btlMgr.ChangeCameraFieldOfView(_gameMgr.ScreenAspect); - component.PlayReverse(); - GameObject gameObject = UnityEngine.Object.Instantiate(m_PanelMgr); - gameObject.transform.parent = _gameMgr.m_GameManagerObj.transform; - _btlMgr.PanelMgr = gameObject.GetComponent(); - BattlePlayer battlePlayer = _btlMgr.BattlePlayer; - BattleEnemy battleEnemy = _btlMgr.BattleEnemy; - yield return null; - battlePlayer.BattleView.Setup(_gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/StatusPanelP"), _btlMgr.BtlUIContainer, _btlMgr.BtlContainer, _btlMgr.Battle3DContainer); - battleEnemy.BattleView.Setup(_gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/StatusPanelE"), _btlMgr.BtlUIContainer, _btlMgr.BtlContainer, _btlMgr.Battle3DContainer); - _gameMgr.GetPrefabMgr().Load("Prefab/UI/Arrow"); - _btlMgr.Arrow = _gameMgr.GetPrefabMgr().CloneObjectToParent(_gameMgr.GetPrefabMgr().Get("Prefab/UI/Arrow"), _btlMgr.Battle3DContainer); - _btlMgr.Arrow.transform.parent = _btlMgr.BtlContainer.transform; - _btlMgr.Arrow.transform.Find("ArrowHead").localScale = Vector3.one * 512f; - _btlMgr.ArrowControl = _btlMgr.Arrow.GetComponent(); - _btlMgr.AttackArrowHead = _gameMgr.GetPrefabMgr().CloneObjectToParent("Prefab/UI/ArrowHead", _btlMgr.Battle3DContainer); - _btlMgr.AttackArrowHead.transform.parent = _btlMgr.BtlContainer.transform; - _btlMgr.EvolutionArrowHead = _gameMgr.GetPrefabMgr().CloneObjectToParent("Prefab/UI/ArrowEvo", _btlMgr.Battle3DContainer); - _btlMgr.EvolutionArrowHead.transform.parent = _btlMgr.BtlContainer.transform; - _btlMgr.AlertDialogue = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/AlertDialogue"); - _btlMgr.AlertDialogue.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.AlertDialogue.SetActive(value: false); - _btlMgr.AlertDialogueLabel = _btlMgr.AlertDialogue.transform.Find("Panel/DialogueLabel").GetComponent(); - _btlMgr.DetailMgr.DetailPanel = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/DetailPanel"); - _btlMgr.DetailMgr.DetailPanel.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.DetailMgr.SubDetailPanel = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/DetailPanel"); - _btlMgr.DetailMgr.SubDetailPanel.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.DetailMgr.SubDetailPanelControl = _btlMgr.DetailMgr.SubDetailPanel.GetComponent(); - _btlMgr.DetailMgr.SubDetailPanelControl.CreateNextPanel(); - _btlMgr.DetailMgr.DetailPanelControl = _btlMgr.DetailMgr.DetailPanel.GetComponent(); - _btlMgr.DetailMgr.DetailPanelControl.CreateNextPanel(); - _btlMgr.PSideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogP"); - _btlMgr.PSideLog.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.PSideLogControl = _btlMgr.PSideLog.GetComponent(); - _btlMgr.ESideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogE"); - _btlMgr.ESideLog.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.ESideLogControl = _btlMgr.ESideLog.GetComponent(); - _btlMgr.ESelectSkillSideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogESelectSkill"); - _btlMgr.ESelectSkillSideLog.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.ESelectSkillSideLogControl = _btlMgr.ESelectSkillSideLog.GetComponent(); - _btlMgr.ESelectSkillSideLog.SetActive(value: false); - yield return null; - _btlMgr.SubUI = _gameMgr.GetGameObjMgr().AddUIManagerRootChildPrefab("Prefab/Container/BattleSubUI").transform; - _btlMgr.SubUIOverLayBG = _btlMgr.SubUI.Find("BattleMenuOverLay").GetComponent(); - _btlMgr.SetBattleMenuBtn(); - GameObject gameObject2 = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/TurnPanel"); - gameObject2.transform.parent = _btlMgr.BtlUIContainer.transform; - gameObject2.layer = LayerMask.NameToLayer("Loading"); - _btlMgr.TurnPanelControl = gameObject2.GetComponent(); - DataMgr dataMgr = _gameMgr.GetDataMgr(); - if (dataMgr.IsQuestBattleType()) - { - _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/QuestSpecialBattleResultUI"); - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.RankBattle) - { - _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/RankMatchBattleResultUI"); - } - else if (dataMgr.m_BattleType == DataMgr.BattleType.ColosseumNormal || dataMgr.m_BattleType == DataMgr.BattleType.ColosseumTwoPick || dataMgr.m_BattleType == DataMgr.BattleType.ColosseumWindFall || dataMgr.m_BattleType == DataMgr.BattleType.ColosseumHof) - { - _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/ColosseumBattleResultUI"); - } - else - { - _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/BattleResultUI"); - } - _btlMgr.BattleResult.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.BattleResultControl = _btlMgr.BattleResult.GetComponent(); - Vector3 zero = Vector3.zero; - zero.z = -200f; - _btlMgr.BattleResult.transform.localPosition = zero; - _btlMgr.BattleStart = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleStart"); - _btlMgr.BattleStart.transform.parent = _btlMgr.BtlUIContainer.transform; - _btlMgr.BattleStartControl = _btlMgr.BattleStart.GetComponent(); - _btlMgr.BattleStartControl.SetUp(this); - GameObject gobj = _gameMgr.GetPrefabMgr().CloneObjectToParent(UnitCardTemplate.gameObject, _btlMgr.Battle3DContainer).GetComponent() - .CardNormalTemp.gameObject; - GameObject gameObject3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(gobj, _btlMgr.SubParticleContainer); - gameObject3.transform.parent = _btlMgr.CutInContainer.transform; - gameObject3.GetComponent().enabled = true; - gameObject3.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); - gameObject3.transform.localScale = new Vector3(50f, 50f, 8f); - gameObject3.transform.Find("CardBase(Clone)").GetComponent(); - _btlMgr.DetailMgr.DetailNormal = gameObject3; - _btlMgr.DetailMgr.DetailNormalLodGroup = gameObject3.GetComponent(); - _btlMgr.DetailMgr.DetailNormalBaseMesh = gameObject3.transform.Find("CardBase(Clone)").GetComponent(); - _btlMgr.DetailMgr.DetailNormalCostLabel = gameObject3.transform.Find("Cost(Clone)").Find("CostLabel").GetComponent(); - _btlMgr.DetailMgr.DetailNormalAtkLabel = gameObject3.transform.Find("Atk(Clone)").Find("AtkLabel").GetComponent(); - _btlMgr.DetailMgr.DetailNormalLifeLabel = gameObject3.transform.Find("Life(Clone)").Find("LifeLabel").GetComponent(); - _btlMgr.DetailMgr.DetailNormalNameLabel = gameObject3.transform.Find("Name(Clone)").Find("NameLabel").GetComponent(); - _btlMgr.DetailMgr.DetailNormalBaseMesh.gameObject.tag = "DetailCard"; - UIAnchor uIAnchor = gameObject3.AddComponent(); - uIAnchor.side = UIAnchor.Side.Left; - uIAnchor.relativeOffset = new Vector2(0.11f, 0.1f); - MotionUtils.SetLayerAll(gameObject3, 31); - gameObject3.SetActive(value: false); - GameObject gobj2 = _gameMgr.GetPrefabMgr().CloneObjectToParent(SpellCardTemplate.gameObject, _btlMgr.Battle3DContainer).GetComponent() - .CardNormalTemp.gameObject; - GameObject gameObject4 = _gameMgr.GetPrefabMgr().CloneObjectToParent(gobj2, _btlMgr.SubParticleContainer); - gameObject4.transform.parent = _btlMgr.CutInContainer.transform; - gameObject4.GetComponent().enabled = true; - gameObject4.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); - gameObject4.transform.localScale = new Vector3(50f, 50f, 8f); - _btlMgr.DetailMgr.DetailSkill = gameObject4; - _btlMgr.DetailMgr.DetailSkillLodGroup = gameObject4.GetComponent(); - _btlMgr.DetailMgr.DetailSkillBaseMesh = gameObject4.transform.Find("CardBase(Clone)").GetComponent(); - _btlMgr.DetailMgr.DetailSkillCostLabel = gameObject4.transform.Find("Cost(Clone)").Find("CostLabel").GetComponent(); - _btlMgr.DetailMgr.DetailSkillNameLabel = gameObject4.transform.Find("Name(Clone)").Find("NameLabel").GetComponent(); - gameObject4.transform.Find("CardBase(Clone)").tag = "DetailCard"; - UIAnchor uIAnchor2 = gameObject4.AddComponent(); - uIAnchor2.side = UIAnchor.Side.Left; - uIAnchor2.relativeOffset = new Vector2(0.11f, 0.1f); - MotionUtils.SetLayerAll(gameObject4, 31); - gameObject4.SetActive(value: false); - GameObject gobj3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(FieldCardTemplate.gameObject, _btlMgr.Battle3DContainer).GetComponent() - .CardNormalTemp.gameObject; - GameObject gameObject5 = _gameMgr.GetPrefabMgr().CloneObjectToParent(gobj3, _btlMgr.SubParticleContainer); - gameObject5.transform.parent = _btlMgr.CutInContainer.transform; - gameObject5.GetComponent().enabled = true; - gameObject5.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); - gameObject5.transform.localScale = new Vector3(50f, 50f, 8f); - _btlMgr.DetailMgr.DetailField = gameObject5; - _btlMgr.DetailMgr.DetailFieldLodGroup = gameObject5.GetComponent(); - _btlMgr.DetailMgr.DetailFieldBaseMesh = gameObject5.transform.Find("CardBase(Clone)").GetComponent(); - _btlMgr.DetailMgr.DetailFieldCostLabel = gameObject5.transform.Find("Cost(Clone)").Find("CostLabel").GetComponent(); - _btlMgr.DetailMgr.DetailFieldNameLabel = gameObject5.transform.Find("Name(Clone)").Find("NameLabel").GetComponent(); - gameObject5.transform.Find("CardBase(Clone)").tag = "DetailCard"; - UIAnchor uIAnchor3 = gameObject5.AddComponent(); - uIAnchor3.side = UIAnchor.Side.Left; - uIAnchor3.relativeOffset = new Vector2(0.11f, 0.1f); - MotionUtils.SetLayerAll(gameObject5, 31); - gameObject5.SetActive(value: false); - } - - private static Material LoadSleeveMaterial(long sleeveId) - { - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(sleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial, isfetch: true)) as Material; - if (material != null) - { - material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(sleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture, isfetch: true)); - if (Data.Master.SleeveMgr.Get(sleeveId).IsPremiumSleeve) - { - Texture value = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(sleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureMask, isfetch: true)); - material.SetTexture("_MaskTex", value); - } - material.shader = Shader.Find(material.shader.name); - } - return material; - } - - public void InitPlayer() - { - BattlePlayer battlePlayer = _btlMgr.BattlePlayer; - _btlMgr.BattleResourceMgr.LoadSleeveMaterial(_gameMgr.GetDataMgr().GetPlayerSleeveId(), isPlayer: true).Play(); - IList currentDeckData = _gameMgr.GetDataMgr().GetCurrentDeckData(); - CardVoiceInfoCache.CacheCardVoiceInfoForBattle(currentDeckData); - for (int i = 0; i < currentDeckData.Count; i++) - { - BattleCardBase card = CardCreatorBase.CreateCard(currentDeckData[i], isPlayer: true, i + 1, this, _btlMgr, _btlMgr.BattleResourceMgr, _btlMgr.CreatePlayerInnerOptionsBuilder()); - battlePlayer.AddToDeck(card); - } - battlePlayer.BattleStartDeckCardList = new List(battlePlayer.DeckCardList); - battlePlayer.cardTotalNum = currentDeckData.Count + 1; - } - - public void InitEnemy() - { - BattleEnemy battleEnemy = _btlMgr.BattleEnemy; - _btlMgr.BattleResourceMgr.LoadSleeveMaterial(_gameMgr.GetDataMgr().GetEnemySleeveId(), isPlayer: false).Play(); - IList currentEnemyDeckData = _gameMgr.GetDataMgr().GetCurrentEnemyDeckData(); - CardVoiceInfoCache.CacheCardVoiceInfoForBattle(currentEnemyDeckData); - for (int i = 0; i < currentEnemyDeckData.Count; i++) - { - BattleCardBase card = CardCreatorBase.CreateCard(currentEnemyDeckData[i], isPlayer: false, i + 1, this, _btlMgr, _btlMgr.BattleResourceMgr, _btlMgr.CreateEnemyInnerOptionsBuilder()); - battleEnemy.AddToDeck(card); - } - battleEnemy.BattleStartDeckCardList = new List(battleEnemy.DeckCardList); - battleEnemy.cardTotalNum = currentEnemyDeckData.Count + 1; - StartCoroutine(LoadComplete()); - } - - private IEnumerator LoadComplete() - { - while (!isAnimDone || !_btlMgr.IsBackGroundLoad || !_gameMgr.GetEffectMgr().IsEnemyBattleEffectReady || !_gameMgr.GetEffectMgr().IsPlayerBattleEffectReady) - { - yield return null; - } - StopAllCoroutines(); - if (_btlMgr is SingleBattleMgr) - { - ((SingleBattleMgr)_btlMgr).SingleBattleFirstRecoverySetting(); - } - ReadyFPS(); - } - - private IEnumerator CheckPlayerStatus() - { - while (true) - { - if (!ToolboxGame.RealTimeNetworkAgent) - { - yield break; - } - if (ToolboxGame.RealTimeNetworkAgent.CurrentMatchingStatus == RealTimeNetworkAgent.MatchingStatus.Prepared) - { - break; - } - yield return null; - } - UIManager.GetInstance().CreatFadeBlack(); - yield return new WaitForSeconds(1f); - while (!BattleManagerBase.GetIns().BattleStartControl.IsReady) - { - yield return null; - } - StartBattleScene(); - } - - private void ReadyFPS() - { - if (_gameMgr.IsNetworkBattle) - { - if (ToolboxGame.RealTimeNetworkAgent != null && !_btlMgr.IsRecovery) - { - ToolboxGame.RealTimeNetworkAgent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.Loaded); - StartCoroutine(CheckPlayerStatus()); - if (!_gameMgr.IsAINetwork) - { - (_btlMgr as NetworkBattleManagerBase).IsStopIntervalCheck = true; - } - if (!GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle) - { - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.Loaded); - } - } - } - else - { - StartBattleScene(); - } - isLoadEnd = true; - } - - public void StartBattleScene() - { - StopAllCoroutines(); - if (_gameMgr.IsNetworkBattle && ToolboxGame.RealTimeNetworkAgent == null) - { - LocalLog.AccumulateLastTraceLog("StartBattleScene NotNetworkObject"); - } - else - { - _gameMgr.GetBattleCtrl().Init(); - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Cute; +using UnityEngine; +using Wizard; +using Wizard.Battle.Player.ClassCharacter; +using Wizard.Battle.View; +using Wizard.Battle.View.Vfx; + +public class SBattleLoad : MonoBehaviour +{ + public class CardFrameMaterialHolder + { + public static Material GetHandUnitFrame(int rarity) + { + string text = null; + Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch + { + 0 => "CardFrame_F_Bronze", + 1 => "CardFrame_F_Bronze", + 2 => "CardFrame_F_Silver", + 3 => "CardFrame_F_Gold", + 4 => "CardFrame_F_Legend", + _ => "CardFrame_F_Bronze", + }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); + material.shader = Shader.Find(material.shader.name); + return material; + } + + public static Material GetInPlayNormalUnitFrame(int rarity) + { + string text = null; + Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch + { + 2 => "CardFrame_BTL_Silver", + 3 => "CardFrame_BTL_Gold", + 4 => "CardFrame_BTL_Legend", + _ => "CardFrame_BTL_Bronze", + }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); + material.shader = Shader.Find(material.shader.name); + return material; + } + + public static Material GetHandFieldFrame(int rarity) + { + string text = null; + Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(rarity switch + { + 0 => "CardFrame_SF_Bronze", + 1 => "CardFrame_SF_Bronze", + 2 => "CardFrame_SF_Silver", + 3 => "CardFrame_SF_Gold", + 4 => "CardFrame_SF_Legend", + _ => "CardFrame_SF_Bronze", + }, ResourcesManager.AssetLoadPathType.CardFrameMaterial, isfetch: true)); + material.shader = Shader.Find(material.shader.name); + return material; + } + } + + private GameMgr _gameMgr; + + private BattleManagerBase _btlMgr; + + [SerializeField] + private GameObject m_PanelMgr; + + public CardTemplate UnitCardTemplate; + + public CardTemplate SpellCardTemplate; + + public CardTemplate FieldCardTemplate; + + public Material[] m_RarelityFrameSkillList = new Material[5]; + + public Material[] _choiceBraveCardFrame = new Material[5]; + + private Material _sharedMaterialNormal; + + private GameObject UnitGameObj; + + private GameObject SpellGameObj; + + private GameObject FieldGameObj; + + public GameObject LifePoolIcon; + + private GameObject AtkPoolIcon; + + private GameObject CostPoolIcon; + + private GameObject NamePoolIcon; + + private GameObject SkillDescPool; + + private GameObject CardBasePool; + + private List unitCardEffectObjs = new List(); + + private List spellCardEffectObjs = new List(); + + private List fieldCardEffectObjs = new List(); + + public bool isDbgEnableEnemyHandView = true; + + public bool isLoadEnd; + + public TurnEndButtonUI m_TurnEndBtnUI { get; private set; } + + public event Action OnEndWaitCallBack; + + public void Dispoose() + { + if (UnitCardTemplate != null) + { + UnityEngine.Object.Destroy(UnitCardTemplate.gameObject); + } + if (SpellCardTemplate != null) + { + UnityEngine.Object.Destroy(SpellCardTemplate.gameObject); + } + if (FieldCardTemplate != null) + { + UnityEngine.Object.Destroy(FieldCardTemplate.gameObject); + } + UnitCardTemplate = null; + SpellCardTemplate = null; + FieldCardTemplate = null; + m_RarelityFrameSkillList = null; + _choiceBraveCardFrame = null; + _sharedMaterialNormal = null; + UnitGameObj = null; + SpellGameObj = null; + FieldGameObj = null; + LifePoolIcon = null; + AtkPoolIcon = null; + CostPoolIcon = null; + NamePoolIcon = null; + SkillDescPool = null; + CardBasePool = null; + unitCardEffectObjs = null; + spellCardEffectObjs = null; + fieldCardEffectObjs = null; + this.OnEndWaitCallBack = null; + m_TurnEndBtnUI = null; + } + + private IEnumerator Loading() + { + TweenAlpha component = _btlMgr.Battle3DContainer.transform.Find("OverBG").GetComponent(); + m_TurnEndBtnUI = _btlMgr.BtlUIContainer.transform.Find("TurnEndBtn").GetComponent(); + m_TurnEndBtnUI.gameObject.SetActive(value: false); + _btlMgr.BtlUIContainer.transform.Find("PlayerChoiceBraveBtn").gameObject.SetActive(value: false); + _btlMgr.BtlUIContainer.transform.Find("EnemyChoiceBraveBtn").gameObject.SetActive(value: false); + _btlMgr.ChangeCameraFieldOfView(_gameMgr.ScreenAspect); + component.PlayReverse(); + GameObject gameObject = UnityEngine.Object.Instantiate(m_PanelMgr); + gameObject.transform.parent = _gameMgr.m_GameManagerObj.transform; + _btlMgr.PanelMgr = gameObject.GetComponent(); + BattlePlayer battlePlayer = _btlMgr.BattlePlayer; + BattleEnemy battleEnemy = _btlMgr.BattleEnemy; + yield return null; + battlePlayer.BattleView.Setup(_gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/StatusPanelP"), _btlMgr.BtlUIContainer, _btlMgr.BtlContainer, _btlMgr.Battle3DContainer); + battleEnemy.BattleView.Setup(_gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/StatusPanelE"), _btlMgr.BtlUIContainer, _btlMgr.BtlContainer, _btlMgr.Battle3DContainer); + _gameMgr.GetPrefabMgr().Load("Prefab/UI/Arrow"); + _btlMgr.Arrow = _gameMgr.GetPrefabMgr().CloneObjectToParent(_gameMgr.GetPrefabMgr().Get("Prefab/UI/Arrow"), _btlMgr.Battle3DContainer); + _btlMgr.Arrow.transform.parent = _btlMgr.BtlContainer.transform; + _btlMgr.Arrow.transform.Find("ArrowHead").localScale = Vector3.one * 512f; + _btlMgr.ArrowControl = _btlMgr.Arrow.GetComponent(); + _btlMgr.AttackArrowHead = _gameMgr.GetPrefabMgr().CloneObjectToParent("Prefab/UI/ArrowHead", _btlMgr.Battle3DContainer); + _btlMgr.AttackArrowHead.transform.parent = _btlMgr.BtlContainer.transform; + _btlMgr.EvolutionArrowHead = _gameMgr.GetPrefabMgr().CloneObjectToParent("Prefab/UI/ArrowEvo", _btlMgr.Battle3DContainer); + _btlMgr.EvolutionArrowHead.transform.parent = _btlMgr.BtlContainer.transform; + _btlMgr.AlertDialogue = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/AlertDialogue"); + _btlMgr.AlertDialogue.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.AlertDialogue.SetActive(value: false); + _btlMgr.AlertDialogueLabel = _btlMgr.AlertDialogue.transform.Find("Panel/DialogueLabel").GetComponent(); + _btlMgr.DetailMgr.DetailPanel = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/DetailPanel"); + _btlMgr.DetailMgr.DetailPanel.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.DetailMgr.SubDetailPanel = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/DetailPanel"); + _btlMgr.DetailMgr.SubDetailPanel.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.DetailMgr.SubDetailPanelControl = _btlMgr.DetailMgr.SubDetailPanel.GetComponent(); + _btlMgr.DetailMgr.SubDetailPanelControl.CreateNextPanel(); + _btlMgr.DetailMgr.DetailPanelControl = _btlMgr.DetailMgr.DetailPanel.GetComponent(); + _btlMgr.DetailMgr.DetailPanelControl.CreateNextPanel(); + _btlMgr.PSideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogP"); + _btlMgr.PSideLog.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.PSideLogControl = _btlMgr.PSideLog.GetComponent(); + _btlMgr.ESideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogE"); + _btlMgr.ESideLog.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.ESideLogControl = _btlMgr.ESideLog.GetComponent(); + _btlMgr.ESelectSkillSideLog = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/SideLogESelectSkill"); + _btlMgr.ESelectSkillSideLog.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.ESelectSkillSideLogControl = _btlMgr.ESelectSkillSideLog.GetComponent(); + _btlMgr.ESelectSkillSideLog.SetActive(value: false); + yield return null; + _btlMgr.SubUI = _gameMgr.GetGameObjMgr().AddUIManagerRootChildPrefab("Prefab/Container/BattleSubUI").transform; + _btlMgr.SubUIOverLayBG = _btlMgr.SubUI.Find("BattleMenuOverLay").GetComponent(); + _btlMgr.SetBattleMenuBtn(); + GameObject gameObject2 = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/TurnPanel"); + gameObject2.transform.parent = _btlMgr.BtlUIContainer.transform; + gameObject2.layer = LayerMask.NameToLayer("Loading"); + _btlMgr.TurnPanelControl = gameObject2.GetComponent(); + DataMgr dataMgr = _gameMgr.GetDataMgr(); + if (dataMgr.IsQuestBattleType()) + { + _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/QuestSpecialBattleResultUI"); + } + else if (dataMgr.m_BattleType == DataMgr.BattleType.RankBattle) + { + _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/RankMatchBattleResultUI"); + } + else if (dataMgr.m_BattleType == DataMgr.BattleType.ColosseumNormal || dataMgr.m_BattleType == DataMgr.BattleType.ColosseumTwoPick || dataMgr.m_BattleType == DataMgr.BattleType.ColosseumWindFall || dataMgr.m_BattleType == DataMgr.BattleType.ColosseumHof) + { + _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/ColosseumBattleResultUI"); + } + else + { + _btlMgr.BattleResult = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleResult/BattleResultUI"); + } + _btlMgr.BattleResult.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.BattleResultControl = _btlMgr.BattleResult.GetComponent(); + Vector3 zero = Vector3.zero; + zero.z = -200f; + _btlMgr.BattleResult.transform.localPosition = zero; + _btlMgr.BattleStart = _gameMgr.GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/BattleStart"); + _btlMgr.BattleStart.transform.parent = _btlMgr.BtlUIContainer.transform; + _btlMgr.BattleStartControl = _btlMgr.BattleStart.GetComponent(); + _btlMgr.BattleStartControl.SetUp(this); + GameObject gobj = _gameMgr.GetPrefabMgr().CloneObjectToParent(UnitCardTemplate.gameObject, _btlMgr.Battle3DContainer).GetComponent() + .CardNormalTemp.gameObject; + GameObject gameObject3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(gobj, _btlMgr.SubParticleContainer); + gameObject3.transform.parent = _btlMgr.CutInContainer.transform; + gameObject3.GetComponent().enabled = true; + gameObject3.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); + gameObject3.transform.localScale = new Vector3(50f, 50f, 8f); + gameObject3.transform.Find("CardBase(Clone)").GetComponent(); + _btlMgr.DetailMgr.DetailNormal = gameObject3; + _btlMgr.DetailMgr.DetailNormalLodGroup = gameObject3.GetComponent(); + _btlMgr.DetailMgr.DetailNormalBaseMesh = gameObject3.transform.Find("CardBase(Clone)").GetComponent(); + _btlMgr.DetailMgr.DetailNormalCostLabel = gameObject3.transform.Find("Cost(Clone)").Find("CostLabel").GetComponent(); + _btlMgr.DetailMgr.DetailNormalAtkLabel = gameObject3.transform.Find("Atk(Clone)").Find("AtkLabel").GetComponent(); + _btlMgr.DetailMgr.DetailNormalLifeLabel = gameObject3.transform.Find("Life(Clone)").Find("LifeLabel").GetComponent(); + _btlMgr.DetailMgr.DetailNormalNameLabel = gameObject3.transform.Find("Name(Clone)").Find("NameLabel").GetComponent(); + _btlMgr.DetailMgr.DetailNormalBaseMesh.gameObject.tag = "DetailCard"; + UIAnchor uIAnchor = gameObject3.AddComponent(); + uIAnchor.side = UIAnchor.Side.Left; + uIAnchor.relativeOffset = new Vector2(0.11f, 0.1f); + MotionUtils.SetLayerAll(gameObject3, 31); + gameObject3.SetActive(value: false); + GameObject gobj2 = _gameMgr.GetPrefabMgr().CloneObjectToParent(SpellCardTemplate.gameObject, _btlMgr.Battle3DContainer).GetComponent() + .CardNormalTemp.gameObject; + GameObject gameObject4 = _gameMgr.GetPrefabMgr().CloneObjectToParent(gobj2, _btlMgr.SubParticleContainer); + gameObject4.transform.parent = _btlMgr.CutInContainer.transform; + gameObject4.GetComponent().enabled = true; + gameObject4.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); + gameObject4.transform.localScale = new Vector3(50f, 50f, 8f); + _btlMgr.DetailMgr.DetailSkill = gameObject4; + _btlMgr.DetailMgr.DetailSkillLodGroup = gameObject4.GetComponent(); + _btlMgr.DetailMgr.DetailSkillBaseMesh = gameObject4.transform.Find("CardBase(Clone)").GetComponent(); + _btlMgr.DetailMgr.DetailSkillCostLabel = gameObject4.transform.Find("Cost(Clone)").Find("CostLabel").GetComponent(); + _btlMgr.DetailMgr.DetailSkillNameLabel = gameObject4.transform.Find("Name(Clone)").Find("NameLabel").GetComponent(); + gameObject4.transform.Find("CardBase(Clone)").tag = "DetailCard"; + UIAnchor uIAnchor2 = gameObject4.AddComponent(); + uIAnchor2.side = UIAnchor.Side.Left; + uIAnchor2.relativeOffset = new Vector2(0.11f, 0.1f); + MotionUtils.SetLayerAll(gameObject4, 31); + gameObject4.SetActive(value: false); + GameObject gobj3 = _gameMgr.GetPrefabMgr().CloneObjectToParent(FieldCardTemplate.gameObject, _btlMgr.Battle3DContainer).GetComponent() + .CardNormalTemp.gameObject; + GameObject gameObject5 = _gameMgr.GetPrefabMgr().CloneObjectToParent(gobj3, _btlMgr.SubParticleContainer); + gameObject5.transform.parent = _btlMgr.CutInContainer.transform; + gameObject5.GetComponent().enabled = true; + gameObject5.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); + gameObject5.transform.localScale = new Vector3(50f, 50f, 8f); + _btlMgr.DetailMgr.DetailField = gameObject5; + _btlMgr.DetailMgr.DetailFieldLodGroup = gameObject5.GetComponent(); + _btlMgr.DetailMgr.DetailFieldBaseMesh = gameObject5.transform.Find("CardBase(Clone)").GetComponent(); + _btlMgr.DetailMgr.DetailFieldCostLabel = gameObject5.transform.Find("Cost(Clone)").Find("CostLabel").GetComponent(); + _btlMgr.DetailMgr.DetailFieldNameLabel = gameObject5.transform.Find("Name(Clone)").Find("NameLabel").GetComponent(); + gameObject5.transform.Find("CardBase(Clone)").tag = "DetailCard"; + UIAnchor uIAnchor3 = gameObject5.AddComponent(); + uIAnchor3.side = UIAnchor.Side.Left; + uIAnchor3.relativeOffset = new Vector2(0.11f, 0.1f); + MotionUtils.SetLayerAll(gameObject5, 31); + gameObject5.SetActive(value: false); + } +} diff --git a/SVSim.BattleEngine/Engine/Se.cs b/SVSim.BattleEngine/Engine/Se.cs deleted file mode 100644 index 8a932a26..00000000 --- a/SVSim.BattleEngine/Engine/Se.cs +++ /dev/null @@ -1,415 +0,0 @@ -using System; -using System.Collections.Generic; -using CriWare; -using Cute; -using Wizard; - -public class Se -{ - public enum TYPE - { - NONE, - MAX, - BREAKCARD, - SYS_CARD_SCROLL, - SYS_COMMON_BUTTON, - SYS_COMMON_CANCEL, - SYS_COMMON_DECIDE, - SYS_TITLE_START, - SYS_BTN_DECIDE, - SYS_BTN_DECIDE_TRANS, - SYS_BTN_CANCEL, - SYS_BTN_CANCEL_TRANS, - SYS_SWITCH_MENU, - SYS_MENU_CARD, - SYS_SWITCH_MENU_CARD, - SYS_TOGGLE_ON, - SYS_TOGGLE_OFF, - SYS_SLIDE_BTN, - SYS_CARD_INFO, - SYS_MYPAGE_EVOLVE, - SYS_DRAG_CARD, - SYS_DECK_CARD_MOVE_IN, - SYS_DECK_CARD_MOVE_OUT, - SYS_USE_RED_ETHER, - SYS_GET_RED_ETHER, - SYS_CARDLIST_REVERSE, - SYS_DECK_IN, - SYS_DECK_OUT, - SYS_GIFT_ALL, - SYS_DIALOG_OPEN, - SYS_DL_CARD_APPEAR, - SYS_CARD_INFO_SMALL, - SYS_CARD_INFO_CANCEL, - SYS_FEED_TEXT, - SYS_SCROLL, - SYS_BAR_SLIDE, - SYS_CARD_TOUCH, - SYS_CARD_MOVE_SINGLE_1, - SYS_CARD_MOVE_SINGLE_2, - SYS_CARD_MOVE_SINGLE_3, - SYS_2PICK_SELECT, - SYS_2PICK_BOX_OPEN, - SYS_WINDOW_MOVE, - SYS_ROOM_IN, - SYS_ROOM_OUT, - SYS_LOTTERY_BOX_TOUCH, - SYS_BOX_OPEN_SP, - SE_BATTLE_MIN, - BATTLE_START_VS, - BATTLE_START_VS_ST2, - DRAW, - DRAW_CARD_OPEN_LG, - DRAW_CARD_OPEN, - MULLIGAN_SELECT_REPLACE_CARD, - MULLIGAN_CANCEL_REPLACE_CARD, - MULLIGAN_DECIDE, - MULLIGAN_CARD_RETURN, - SET_CARD_TO_HAND, - SYS_BREAK_CHARACTER, - SYS_TURN_END, - SYS_TURN_END_CONFIRM, - SYS_BATTLE_EVOLVE, - SYS_BATTLE_EVOLVE_DRAG, - SYS_BATTLE_EVOLVE_CUTIN, - SYS_BATTLE_EVOLVE_SKILL, - SYS_SPELL_CAST, - SYS_SUMMON_FALL, - SYS_SUMMON_CARD_DROP, - SYS_CAMERA_ZOOM_OUT, - SYS_ACTUVATE_TURNEND_BUTTON, - SYS_YOURTURN, - SYS_SUMMON_LANDING, - SYS_ENEMY_CARD_OPEN, - SYS_ENEMY_SET_CARD_TO_HAND, - SYS_ARROW_DRAG, - SYS_ARROW_SELECT, - SYS_DRAG_SLIDE, - SYS_RESULT_GAUGEUP, - SYS_RESULT_LEVELUP, - SYS_RESULT_RANKUP, - SYS_RESULT_WINDOW_APPER, - SYS_RESULT_YOUWIN, - SYS_RESULT_YOULOSE, - SYS_RESULT_PUZZLE_RESET, - SYS_RANK_UP_MACH_BEGIN, - SYS_RANK_UP_MACH_WINDOW_MOVE, - SYS_RANK_UP_MACH_WIN, - SYS_RANK_UP_MACH_SUCCESS, - SYS_RANK_UP_MACH_LOSE, - SYS_RANK_UP_MACH_FAILED, - SYS_RANK_UP_MACH_RANK_DOWN, - SYS_RANK_UP_MACH_SUCCES_2, - SYS_BOSS_RUSH_RESULT_APPEAR, - SYS_BOSS_RUSH_RESULT_CLEAR, - SYS_BOSS_RUSH_RESULT_MOVE, - SYS_OPEN_SEQUENCE_CARD, - SYS_CMN_CARD_DRAW_4, - SYS_CMN_CARD_SELECT_3, - SYS_CMN_CARD_RETURN_1, - SYS_ATTACK_ICON_1, - SYS_ATTACK_ICON_2, - SYS_ATTACK_ICON_3, - SYS_HAND_MOVE_CENTER, - SYS_HAND_MOVE_RIGHT, - SYS_BREAK_LEADER, - SYS_BREAK_LEADER_ST1, - SYS_BREAK_LEADER_ST2, - SYS_APPEAR_MANA, - SYS_APPEAR_LEADER, - SYS_CMN_CLASS_DECKOUT_1, - SYS_REPLAY_TURN_SKIPPING, - SE_SYS_WIN_REWARD_BOX_SMALL, - SE_SYS_WIN_REWARD_BOX_BIG, - SYS_CMN_UI_EP_6, - SYS_HBP_BUTTON, - SYS_HBP_UP, - SE_SYS_UPGRADE_TREASURE_BOX_01, - SE_SYS_UPGRADE_TREASURE_BOX_02, - SE_SYS_UPGRADE_TREASURE_BOX_03, - SE_SYS_UPGRADE_TREASURE_BOX_04, - SE_BATTLE_MAX, - SE_BATTLE_JINGLE_MIN, - SYS_JINGLE_WIN, - SYS_JINGLE_LOSE, - SE_BATTLE_JINGLE_MAX, - SE_GACHA_MIN, - SYS_GACHA_LEGEND, - SYS_GACHA_EPIC, - SYS_GACHA_RARE, - SYS_GACHA_COMMON, - SYS_GACHA_OPEN, - SYS_GACHA_APPEAR, - SYS_GACHA_MOVE, - SYS_GACHA_CHOICE, - SYS_GACHA_BACK, - SYS_GACHA_RARE_LOOP, - SYS_GACHA_EPIC_LOOP, - SYS_GACHA_LEGEND_LOOP, - SYS_GACHA_CARD_OUT, - SYS_GACHA_CARD_IN, - SE_GACHA_MAX, - SE_PROLOGUE_MIN, - SYS_PROLOGUE_CHAR_APPEAR, - SYS_PROLOGUE_CHAR_APPEAR_EFFECT, - SYS_PROLOGUE_CHAR_LEAVE, - SE_PROLOGUE_MAX, - SE_MAP_MIN, - SYS_MAP_CLEAR, - SYS_MAP_CAMERA_MOVE, - SYS_MAP_NEW_AREA_RELEASE, - SYS_MAP_CUTIN_TEXT, - SE_MAP_TREE_EFFECT, - SE_MAP_SECTION9_CHAPTER1, - SE_MAP_SECTION9_CHAPTER2, - SE_MAP_SECTION9_CHANGE_CHAPTER, - SE_MAP_BACKGROUND_CHANGE_FIRST_CLEAR_604, - SE_MAP_BACKGROUND_CHANGE_604, - SE_MAP_BACKGROUND_CHANGE_FIRST_CLEAR_614, - SE_MAP_CHAPTER_SELECT_FOCUS_CHANGE, - SE_MAP_CHAPTER_SELECT_CLEAR, - SE_MAP_CHAPTER_SELECT_CHAPTER_RELEASE, - SE_MAP_CHAPTER_SELECT_LOCKED_CHAPTER_RELEASE, - SE_MAP_CHAPTER_SELECT_UNLOCK, - SE_MAP_SECTION20_CHANGE_CHAPTER1, - SE_MAP_MAX, - SE_LOGIN_BONUS_MIN, - LOGIN_BONUS_STAMP_1, - LOGIN_BONUS_STAMP_2, - LOGIN_BONUS_STAMP_NEXT, - SE_LOGIN_BONUS_MAX - } - - public class BtlSmnSEPlayTimeAndSeName - { - public DateTime PlayTime { get; private set; } - - public string SeName { get; private set; } - - public BtlSmnSEPlayTimeAndSeName() - { - PlayTime = DateTime.Now; - SeName = "NONE"; - } - - public void SetValue(DateTime playTime, string seName) - { - PlayTime = playTime; - SeName = seName; - } - } - - private CriAtomSource m_SeAudioSource; - - private CriAtomSource m_SeAudioSourcLoop; - - private const string CATEGORY_NAME = "SE"; - - public const string CUESHEETNAME_LOGINBONUS = "se_login"; - - private Dictionary m_AudioData; - - private float m_volume; - - private bool m_isMuted; - - private const int BTL_SMN_SE_DUPLICATE_CHECK_MILLISECOND = 180; - - private BtlSmnSEPlayTimeAndSeName _btlSmnSEPlayTimeAndSeName; - - private BtlSmnSEPlayTimeAndSeName _sysSEPlayTimeAndSeName; - - public Se() - { - CriAtom.AttachDspBusSetting("DspBusSetting_0"); - m_SeAudioSource = GameMgr.GetIns().GetGameObjMgr().GetGameObj() - .AddComponent(); - m_SeAudioSource.loop = false; - m_SeAudioSource.playOnStart = false; - m_SeAudioSource.use3dPositioning = false; - m_SeAudioSourcLoop = GameMgr.GetIns().GetGameObjMgr().GetGameObj() - .AddComponent(); - m_SeAudioSourcLoop.loop = true; - m_SeAudioSourcLoop.playOnStart = false; - m_SeAudioSourcLoop.use3dPositioning = false; - m_SeAudioSourcLoop.player.AttachFader(); - m_SeAudioSourcLoop.player.SetFadeOutTime(150); - m_AudioData = new Dictionary(); - _btlSmnSEPlayTimeAndSeName = new BtlSmnSEPlayTimeAndSeName(); - _sysSEPlayTimeAndSeName = new BtlSmnSEPlayTimeAndSeName(); - SetVolume(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.SE_VOLUME)); - Mute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - } - - public void Load(TYPE SeType, string Path) - { - if (!m_AudioData.ContainsKey(SeType)) - { - m_AudioData.Add(SeType, Path); - } - } - - public void UnLoad(TYPE SeType) - { - if (m_AudioData.ContainsKey(SeType)) - { - m_AudioData.Remove(SeType); - } - } - - public void SetVolume(float Prm) - { - CriAtomExCategory.SetVolume("SE", Prm); - m_volume = Prm; - } - - public float GetVolume() - { - return m_volume; - } - - public void Mute(bool isMute) - { - CriAtomExCategory.Mute("SE", isMute); - m_isMuted = isMute; - } - - public bool IsMuted() - { - return m_isMuted; - } - - public void SetAisac(string cuename, string param, float num) - { - Toolbox.AudioManager.SetAisac(cuename, param, num); - } - - public void SetAisac(TYPE SeType, string param, float num) - { - Toolbox.AudioManager.SetAisac(m_AudioData[SeType], param, num); - } - - private void AddSeCueSheetPlay(TYPE SeType, bool isSeSysSummonLandingDuplicateCheck = false) - { - string acbName = "preinstall"; - if (SeType >= TYPE.SE_BATTLE_MIN && SeType <= TYPE.SE_BATTLE_MAX) - { - acbName = "se_battle"; - } - else if (SeType >= TYPE.SE_BATTLE_JINGLE_MIN && SeType <= TYPE.SE_BATTLE_JINGLE_MAX) - { - acbName = "bgm_btl_jingle"; - } - else if (SeType >= TYPE.SE_GACHA_MIN && SeType <= TYPE.SE_GACHA_MAX) - { - acbName = "se_gacha"; - } - else if (SeType >= TYPE.SE_PROLOGUE_MIN && SeType <= TYPE.SE_PROLOGUE_MAX) - { - acbName = "se_st_prologue"; - } - else if (SeType >= TYPE.SE_MAP_MIN && SeType <= TYPE.SE_MAP_MAX) - { - acbName = "se_st_map"; - } - else if (SeType >= TYPE.SE_LOGIN_BONUS_MIN && SeType <= TYPE.SE_LOGIN_BONUS_MAX) - { - acbName = "se_login"; - } - string text = m_AudioData[SeType]; - if (isSeSysSummonLandingDuplicateCheck && SeType == TYPE.SYS_SUMMON_LANDING) - { - DateTime now = DateTime.Now; - if ((now - _sysSEPlayTimeAndSeName.PlayTime).TotalMilliseconds < 180.0 && _sysSEPlayTimeAndSeName.SeName == text) - { - return; - } - _sysSEPlayTimeAndSeName.SetValue(now, text); - } - Toolbox.AudioManager.PlaySeFromName(acbName, text, loop: false, 0f, 0L); - } - - public void Play(TYPE SeType, bool isSeSysSummonLandingDuplicateCheck) - { - if (SeType == TYPE.NONE) - { - return; - } - try - { - AddSeCueSheetPlay(SeType, isSeSysSummonLandingDuplicateCheck); - } - catch - { - Debug.LogError("SE ERR " + SeType); - } - } - - public void PlayByStr(string SeStr, string AcbName, float fadeInTime, long startTime) - { - try - { - if (SeStr.Contains("btl") || SeStr.Contains("smn")) - { - DateTime now = DateTime.Now; - if ((now - _btlSmnSEPlayTimeAndSeName.PlayTime).TotalMilliseconds < 180.0 && _btlSmnSEPlayTimeAndSeName.SeName == SeStr) - { - return; - } - _btlSmnSEPlayTimeAndSeName.SetValue(now, SeStr); - } - Toolbox.AudioManager.PlaySeFromName(AcbName, SeStr, loop: false, fadeInTime, startTime); - } - catch - { - Debug.LogError("SE ERR " + SeStr); - } - } - - public void PlayLoop(TYPE SeType) - { - try - { - AddSeCueSheetPlay(SeType); - } - catch - { - Debug.LogError("SE ERR " + SeType); - } - } - - public void PlayLoopByStr(string SeStr, float fadeInTime, long startTime) - { - try - { - Toolbox.AudioManager.PlaySeFromName(SeStr, SeStr, loop: true, fadeInTime, startTime); - } - catch - { - Debug.LogError("SE ERR " + SeStr); - } - } - - public void AisacChange(float aisacnum) - { - if (m_SeAudioSourcLoop.status == CriAtomSource.Status.Playing) - { - m_SeAudioSourcLoop.SetAisacControl("Speed", aisacnum); - } - } - - public void Stop(string cuename, float fadeOutTime) - { - Toolbox.AudioManager.StopSe(cuename, fadeOutTime); - } - - public void Stop(TYPE setype, float fadetime = 0f) - { - Toolbox.AudioManager.StopSe(m_AudioData[setype], fadetime); - } - - public void StopAll(float fadeOutTime) - { - Toolbox.AudioManager.StopSeAll(fadeOutTime); - } -} diff --git a/SVSim.BattleEngine/Engine/SearchUserInfo.cs b/SVSim.BattleEngine/Engine/SearchUserInfo.cs index 2400b026..d2ee1fbc 100644 --- a/SVSim.BattleEngine/Engine/SearchUserInfo.cs +++ b/SVSim.BattleEngine/Engine/SearchUserInfo.cs @@ -1,9 +1,4 @@ public class SearchUserInfo : HeaderData { public SearchUserInfoDetail data; - - public void Initizalize() - { - data = new SearchUserInfoDetail(); - } } diff --git a/SVSim.BattleEngine/Engine/SearchUserInfoDetail.cs b/SVSim.BattleEngine/Engine/SearchUserInfoDetail.cs index 97b23854..4e60bc93 100644 --- a/SVSim.BattleEngine/Engine/SearchUserInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/SearchUserInfoDetail.cs @@ -1,4 +1,3 @@ public class SearchUserInfoDetail { - public UserFriend user; } diff --git a/SVSim.BattleEngine/Engine/SendCardDataMaker.cs b/SVSim.BattleEngine/Engine/SendCardDataMaker.cs index 62a8da93..fd22e46f 100644 --- a/SVSim.BattleEngine/Engine/SendCardDataMaker.cs +++ b/SVSim.BattleEngine/Engine/SendCardDataMaker.cs @@ -10,8 +10,6 @@ public class SendCardDataMaker private List _registerUnapprovedList; - public const int NOT_PLAY_INDEX = -1; - public SendCardDataMaker(NetworkBattleManagerBase battlemgr, RegisterActionManager registerList, List unapprovedList) { _battleMgr = battlemgr; @@ -153,19 +151,6 @@ public class SendCardDataMaker _battleMgr.ClearRegisterCardList(); } - public bool IsExistSendObj() - { - if (_registerActionManager.RegisterDataList.Count >= 1) - { - return true; - } - if (_registerUnapprovedList.Count >= 1) - { - return true; - } - return false; - } - private List MakeUList(List moveObjs) { int num = moveObjs.Count; diff --git a/SVSim.BattleEngine/Engine/SendFriendApplyInfo.cs b/SVSim.BattleEngine/Engine/SendFriendApplyInfo.cs index 77429ced..a20cf23e 100644 --- a/SVSim.BattleEngine/Engine/SendFriendApplyInfo.cs +++ b/SVSim.BattleEngine/Engine/SendFriendApplyInfo.cs @@ -1,9 +1,4 @@ public class SendFriendApplyInfo : HeaderData { public SendFriendApplyInfoDetail data; - - public void Initizalize() - { - data = new SendFriendApplyInfoDetail(); - } } diff --git a/SVSim.BattleEngine/Engine/SendFriendApplyInfoDetail.cs b/SVSim.BattleEngine/Engine/SendFriendApplyInfoDetail.cs index ee590ac0..ee541beb 100644 --- a/SVSim.BattleEngine/Engine/SendFriendApplyInfoDetail.cs +++ b/SVSim.BattleEngine/Engine/SendFriendApplyInfoDetail.cs @@ -2,9 +2,4 @@ using System.Collections.Generic; public class SendFriendApplyInfoDetail { - public List applyList = new List(); - - public int remainingApplyCount; - - public int sendApplyMaxCount; } diff --git a/SVSim.BattleEngine/Engine/SetShaderGlobalColorBG.cs b/SVSim.BattleEngine/Engine/SetShaderGlobalColorBG.cs index efd44f74..1fcf69c0 100644 --- a/SVSim.BattleEngine/Engine/SetShaderGlobalColorBG.cs +++ b/SVSim.BattleEngine/Engine/SetShaderGlobalColorBG.cs @@ -13,24 +13,12 @@ public class SetShaderGlobalColorBG : MonoBehaviour public bool IsFadeIn { get; private set; } - public void Start() - { - interpolateGlobalShaderColor = InterpolateGlobalShaderColor(FROM_COLOR, TO_COLOR, 0f); - Shader.SetGlobalColor("_ColorBG", new Color(1f, 1f, 1f, 1f)); - } - public void ChangeGlobalShaderColorFadeIn() { ChangeGlobalShaderColor(FROM_COLOR, TO_COLOR); IsFadeIn = true; } - public void ChangeGlobalShaderColorFadeOut() - { - ChangeGlobalShaderColor(TO_COLOR, FROM_COLOR); - IsFadeIn = false; - } - private void ChangeGlobalShaderColor(Color baseColor, Color changeColor) { StopCoroutine(interpolateGlobalShaderColor); diff --git a/SVSim.BattleEngine/Engine/ShopSupplyCardPanel.cs b/SVSim.BattleEngine/Engine/ShopSupplyCardPanel.cs deleted file mode 100644 index ca6f8a5a..00000000 --- a/SVSim.BattleEngine/Engine/ShopSupplyCardPanel.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Cute; -using Wizard; - -internal class ShopSupplyCardPanel : MyPageCardPanel -{ - private const string SPECIAL_SUPPLY_CARD_PANEL_TEXTURE = "menu_shop_sleeve_special"; - - public bool IsLoadedDefaultCardPanelResource { get; private set; } - - public bool IsLoadedSpecialCardPanelResource { get; private set; } - - public override string GetResourcePath(bool isfetch) - { - ShopNotification shopNotification = Data.MyPageNotifications.data.ShopNotification; - if (shopNotification.AppealSleeve.IsCollaborationPanel || shopNotification.AppealLeaderSkin.IsCollaborationPanel) - { - if (!isfetch) - { - IsLoadedSpecialCardPanelResource = true; - } - return Toolbox.ResourcesManager.GetAssetTypePath("menu_shop_sleeve_special", ResourcesManager.AssetLoadPathType.UiDownLoad, isfetch); - } - if (!isfetch) - { - IsLoadedDefaultCardPanelResource = true; - } - return base.GetResourcePath(isfetch); - } -} diff --git a/SVSim.BattleEngine/Engine/SideLogControl.cs b/SVSim.BattleEngine/Engine/SideLogControl.cs index 35b71477..1e6eb63c 100644 --- a/SVSim.BattleEngine/Engine/SideLogControl.cs +++ b/SVSim.BattleEngine/Engine/SideLogControl.cs @@ -17,8 +17,6 @@ public class SideLogControl : MonoBehaviour public BattleCardBase Card { get; private set; } - public bool IsPlayer => Card.IsPlayer; - public bool IsSelect { get; private set; } public SideLog(BattleCardBase card, SkillBase skill, bool isSelect) @@ -45,120 +43,18 @@ public class SideLogControl : MonoBehaviour } return false; } - - public bool CheckShowSideLogNewReplay(int skillHashCode, BattleCardBase ownerCard) - { - _skillHashCodes.Add(skillHashCode); - int num = _skillHashCodes.Where((int s) => skillHashCode == s).Count(); - if (num > _repeatCount) - { - _repeatCount = num; - return true; - } - if (ownerCard.BaseParameter.BaseCardId == 900241110) - { - return true; - } - return false; - } - - public bool IsContain(BattleCardBase card, bool isTransformSelect = false) - { - if (isTransformSelect) - { - BattleCardBase battleCardBase = ((Card.TransformInfo.Type != BattleCardBase.TransformType.Metamorphose) ? Card.TransformInfo.OriginalCard : null); - if (IsSelect && battleCardBase != null) - { - return battleCardBase.BaseParameter.BaseCardId == card.BaseParameter.BaseCardId; - } - return false; - } - return Card == card; - } } - private const int PANEL_MAX = 6; - - private const int LABEL_INDEX_CARDNAME = 0; - - private const int LABEL_INDEX_SKILLDESC = 1; - - private static readonly int DEFAULT_SPACING_Y = 12; - - private static readonly int SPACING_START_LINE = 4; - - private static readonly int SPACING_Y_MARGIN = 4; - private IList PanelList; private IList PanelOnList; private IList PanelOnFlagList; - private Vector3 BasePos; - - private Vector2 PanelSize; - private List LogShowingList; private SideLog _lastSideLog; - private void Start() - { - PanelList = new List(); - PanelOnList = new List(); - PanelOnFlagList = new List(); - LogShowingList = new List(); - for (int i = 0; i < 6; i++) - { - GameObject gameObject; - if (i == 0) - { - gameObject = base.transform.Find("Panel").gameObject; - } - else - { - gameObject = UnityEngine.Object.Instantiate(PanelList[0].gameObject); - if (null == gameObject) - { - continue; - } - gameObject.transform.parent = base.transform; - gameObject.transform.localScale = Vector3.one; - } - PanelList.Add(gameObject.GetComponent()); - LogShowingList.Add(null); - PanelList[i].gameObject.SetActive(value: false); - } - BasePos = PanelList[0].transform.localPosition; - PanelSize = PanelList[0].sprites[0].localSize; - } - - private void Update() - { - for (int i = 0; i < PanelOnList.Count; i++) - { - int index = PanelList.IndexOf(PanelOnList[i]); - if (LogShowingList[index] != null) - { - Vector3 vector = (LogShowingList[index].IsPlayer ? ((!PanelOnFlagList[i]) ? (new Vector3(0f - PanelSize.x, (PanelSize.y + 10f) * (float)i, 0f) + BasePos) : (new Vector3(0f, (PanelSize.y + 10f) * (float)i, 0f) + BasePos)) : ((!PanelOnFlagList[i]) ? (new Vector3(PanelSize.x, (0f - (PanelSize.y + 10f)) * (float)i, 0f) + BasePos) : (new Vector3(0f, (0f - (PanelSize.y + 10f)) * (float)i, 0f) + BasePos))); - PanelOnList[i].transform.localPosition += (vector - PanelOnList[i].transform.localPosition) * 0.5f; - } - } - } - - public void SetWrapTextForSideLog(UILabel label, string s) - { - label.spacingY = DEFAULT_SPACING_Y; - label.SetWrapText(s); - int num = label.text.Length - label.text.Replace("\n", "").Length + 1; - if (num >= SPACING_START_LINE) - { - label.spacingY = Math.Max(DEFAULT_SPACING_Y - (num - SPACING_START_LINE + 1) * SPACING_Y_MARGIN, 0); - label.SetWrapText(s); - } - } - public bool IsOnSummonOrReturnTimingSkill(SkillBase skill) { if (skill == null) @@ -184,120 +80,6 @@ public class SideLogControl : MonoBehaviour }); } - public bool ShowLog(BattleCardBase card, SkillBase skill, string skillDesc, string cardName, bool isEvolSelect, bool isSelect, NetworkBattleReceiver.SideLogSkillInfo newReplaySkillInfo) - { - NguiObjs nguiObjs = null; - int index = 0; - SideLog sideLog = null; - if (!isSelect) - { - if (LogShowingList.Any((SideLog l) => l?.IsContain(card) ?? false) && !isEvolSelect) - { - SideLog sideLog2 = LogShowingList.Where((SideLog l) => l?.IsContain(card) ?? false).First(); - if (!((newReplaySkillInfo != null) ? sideLog2.CheckShowSideLogNewReplay(newReplaySkillInfo.SkillHashCode, card) : sideLog2.CheckShowSideLog(skill))) - { - return false; - } - sideLog = sideLog2; - } - if (IsOnSummonOrReturnTimingSkill(skill) || (newReplaySkillInfo != null && newReplaySkillInfo.IsOnSummonSkill)) - { - bool flag = newReplaySkillInfo?.IsInvoked ?? skill.IsInvoked; - if (_lastSideLog != null && _lastSideLog.Card.EquelsID(card) && _lastSideLog.Card.CardId == card.CardId && !_lastSideLog.IsSelect && !flag) - { - return false; - } - } - } - for (int num = 0; num < PanelList.Count; num++) - { - if (!PanelList[num].gameObject.activeSelf) - { - nguiObjs = PanelList[num]; - index = num; - break; - } - } - if (nguiObjs == null) - { - nguiObjs = PanelOnList[PanelOnList.Count - 1]; - RemoveLog(PanelOnList.Count - 1); - for (int num2 = 0; num2 < PanelList.Count; num2++) - { - if (nguiObjs == PanelList[num2]) - { - index = num2; - break; - } - } - } - nguiObjs.labels[0].text = cardName; - SetWrapTextForSideLog(nguiObjs.labels[1], skillDesc); - if (card.IsPlayer) - { - nguiObjs.transform.localPosition = new Vector3(0f - PanelSize.x, 0f, 0f) + BasePos; - } - else - { - nguiObjs.transform.localPosition = new Vector3(PanelSize.x, 0f, 0f) + BasePos; - } - if (sideLog == null) - { - sideLog = new SideLog(card, skill, isSelect); - if (newReplaySkillInfo != null) - { - sideLog.CheckShowSideLogNewReplay(newReplaySkillInfo.SkillHashCode, card); - } - } - _lastSideLog = sideLog; - LogShowingList[index] = sideLog; - nguiObjs.gameObject.SetActive(value: true); - PanelOnList.Insert(0, nguiObjs); - PanelOnFlagList.Insert(0, item: true); - return true; - } - - public void HideLog(BattleCardBase card, bool isTransformSelect) - { - for (int num = PanelOnList.Count - 1; num >= 0; num--) - { - int index = PanelList.IndexOf(PanelOnList[num]); - if (LogShowingList[index] != null && LogShowingList[index].IsContain(card, isTransformSelect)) - { - PanelOnFlagList[num] = false; - break; - } - } - } - - public void RemoveLog(BattleCardBase card, bool isTransformSelect) - { - for (int num = PanelOnList.Count - 1; num >= 0; num--) - { - int index = PanelList.IndexOf(PanelOnList[num]); - if (LogShowingList[index] != null && LogShowingList[index].IsContain(card, isTransformSelect)) - { - PanelOnList[num].gameObject.SetActive(value: false); - PanelOnList.RemoveAt(num); - PanelOnFlagList.RemoveAt(num); - LogShowingList[index] = null; - break; - } - } - } - - public void RemoveLog(int idx) - { - if (PanelOnList.Count >= 1) - { - int index = PanelList.IndexOf(PanelOnList[idx]); - PanelOnList[idx].gameObject.SetActive(value: false); - PanelOnList.RemoveAt(idx); - PanelOnFlagList.RemoveAt(idx); - LogShowingList[index] = null; - } - } - public void RemoveAllLog() { if (PanelOnList.Count >= 1) diff --git a/SVSim.BattleEngine/Engine/SimpleCardDetail.cs b/SVSim.BattleEngine/Engine/SimpleCardDetail.cs index 6877ce39..5310b409 100644 --- a/SVSim.BattleEngine/Engine/SimpleCardDetail.cs +++ b/SVSim.BattleEngine/Engine/SimpleCardDetail.cs @@ -7,13 +7,9 @@ using Wizard.Battle.View; public class SimpleCardDetail : CardDetailBase { - private const string EVO_EFFECT_PATH = "cmn_deckedit_evo_1"; private int _cardID; - [SerializeField] - private Transform _offset; - [SerializeField] private UILabel _attackLabel; @@ -23,9 +19,6 @@ public class SimpleCardDetail : CardDetailBase [SerializeField] private BoxCollider _skillCollider; - [SerializeField] - private UISprite _evoPanel; - [SerializeField] private UILabel _evoAttackLabel; @@ -56,16 +49,9 @@ public class SimpleCardDetail : CardDetailBase [SerializeField] private BoxCollider _closeCollider; - [SerializeField] - private PurchaseConfirm _purchaseConfirmPrefab; - [SerializeField] private UITweener[] _openTween; - private CardMake _cardMaker; - - private List _buffList; - private BoxCollider _craftPanelCollider; private DetailPanelInfo _currentPanel; @@ -116,71 +102,6 @@ public class SimpleCardDetail : CardDetailBase _currentPanel = _followerPanel; } - private void Start() - { - _cardMaker = base.gameObject.AddComponent(); - _cardMaker.OnCardBuy = delegate - { - UpdateCraftPanel(); - this.OnClickCreateButton.Call(); - }; - _cardMaker.OnCardSellId = delegate(int cardId) - { - UpdateCraftPanel(); - this.OnClickLiquefyButton.Call(cardId); - }; - if ((bool)_closeCollider) - { - UIEventListener.Get(_closeCollider.gameObject).onClick = delegate - { - this.OnClickCloseButton.Call(); - }; - } - Action onClickCreateBtn = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OpenCraftDialog(delegate - { - _cardMaker.StartCardCraft(CardID); - }, buy: true); - }; - Action onClickDestructBtn = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OpenCraftDialog(delegate - { - _cardMaker.StartCardDestruct(CardID); - }, buy: false); - }; - _craftPanel.Init(onClickCreateBtn, onClickDestructBtn); - UIEventListener.Get(_followerPanel.DiscCollider.gameObject).onClick = delegate - { - if (UIManager.GetInstance().IsTouchable) - { - OpenSkillInfo(_followerPanel.DiscLabel, isEvol: false); - } - }; - BattlePlayerView.SetKeyWordColor(_followerPanel.DiscCollider.gameObject, _followerPanel.DiscLabel); - UIEventListener.Get(_followerEvoPanel.DiscCollider.gameObject).onClick = delegate - { - if (UIManager.GetInstance().IsTouchable) - { - OpenSkillInfo(_followerEvoPanel.DiscLabel, isEvol: true); - } - }; - BattlePlayerView.SetKeyWordColor(_followerEvoPanel.DiscCollider.gameObject, _followerEvoPanel.DiscLabel); - UIEventListener.Get(_nonFollowerPanel.DiscCollider.gameObject).onClick = delegate - { - OpenSkillInfo(_nonFollowerPanel.DiscLabel, isEvol: false); - }; - BattlePlayerView.SetKeyWordColor(_nonFollowerPanel.DiscCollider.gameObject, _nonFollowerPanel.DiscLabel); - _followerPanel.Initialize(); - _nonFollowerPanel.Initialize(); - _followerEvoPanel.Initialize(); - _craftPanelCollider = _craftPanel.GetComponent(); - HideDetail(); - } - public void ChangeDetail(int id, CardMaster.CardMasterId cardMasterId, MyRotationInfo myRotationInfo = null) { if (!IsVisible || CardID != id) @@ -236,22 +157,12 @@ public class SimpleCardDetail : CardDetailBase IsDetailPanelDragging = false; } - public void SetLocalOffset(Vector3 pos) - { - _offset.localPosition = pos; - } - public void ActiveCraftPanel(bool isActive) { _craftPanel.gameObject.SetActive(isActive); UpdateCraftPanel(); } - public void ActiveCloseCollider(bool isActive) - { - _closeCollider.enabled = isActive; - } - private void ActivePanelColliders(bool isActive) { _skillColliderEvo.enabled = isActive; @@ -281,7 +192,7 @@ public class SimpleCardDetail : CardDetailBase { SetDescLabelText(_currentPanel, CardParam.ConvertedSkillDescription); } - _currentPanel._classLabel.text = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)CardParam.Clan); + _currentPanel._classLabel.text = ((int)CardParam.Clan).ToString(); // Pre-Phase-5b: no clan-name lookup if (CardParam.TribeName != "ALL") { UILabel classLabel = _currentPanel._classLabel; @@ -306,18 +217,6 @@ public class SimpleCardDetail : CardDetailBase } } - private void SetDragEvent(BoxCollider dragCollider) - { - UIEventListener.Get(dragCollider.gameObject).onDragStart = delegate - { - IsDetailPanelDragging = true; - }; - UIEventListener.Get(dragCollider.gameObject).onDragEnd = delegate - { - IsDetailPanelDragging = false; - }; - } - private void UpdateCraftPanel() { if (CardParam != null && !(_craftPanel == null) && _craftPanel.gameObject.activeInHierarchy) @@ -363,43 +262,6 @@ public class SimpleCardDetail : CardDetailBase } } - private void OpenSkillInfo(UILabel label, bool isEvol) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(CardID); - if (cardParameterFromId != null && (isEvol ? cardParameterFromId.EvoSkillDescription : cardParameterFromId.SkillDescription).Length > 0 && BattlePlayerView.HasKeyword(cardParameterFromId) && !UIManager.GetInstance().isOpenDialog()) - { - BattlePlayerView.CreateKeyPanel(cardParameterFromId.ConvertedSkillDescription + cardParameterFromId.ConvertedEvoSkillDescription, label, _cardMasterId); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - } - } - - private void OpenCraftDialog(Action onOk, bool buy) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - PurchaseConfirm purchaseConfirm = UnityEngine.Object.Instantiate(_purchaseConfirmPrefab); - dialogBase.SetObj(purchaseConfirm.gameObject); - int userRedEtherCount = PlayerStaticData.UserRedEtherCount; - SystemText systemText = Data.SystemText; - CardParameter cardParameterFromId = CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(CardID); - if (buy) - { - dialogBase.SetTitleLabel(systemText.Get("Card_0081")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Dia_CardList_003_Button")); - int useRedEther = cardParameterFromId.UseRedEther; - purchaseConfirm.SetCardBuy(systemText.Get("Common_0205"), userRedEtherCount, useRedEther, cardParameterFromId); - } - else - { - dialogBase.SetTitleLabel(systemText.Get("Card_0080")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Dia_CardList_002_Button")); - int getRedEther = cardParameterFromId.GetRedEther; - purchaseConfirm.SetCardSell(systemText.Get("Common_0205"), userRedEtherCount, getRedEther, cardParameterFromId.CardName, cardParameterFromId.IsFoil); - } - dialogBase.onPushButton1 = onOk; - } - private string GetIllustPath(int id, bool isFetch) { CardMaster instance = CardMaster.GetInstance(_cardMasterId); diff --git a/SVSim.BattleEngine/Engine/SingleBattleMgr.cs b/SVSim.BattleEngine/Engine/SingleBattleMgr.cs index cd5849b6..5b953f5f 100644 --- a/SVSim.BattleEngine/Engine/SingleBattleMgr.cs +++ b/SVSim.BattleEngine/Engine/SingleBattleMgr.cs @@ -12,8 +12,6 @@ public class SingleBattleMgr : BattleManagerBase { private bool? _isPlayerFirstTurn; - public IBattleMgrContentsCreator ContentsCreator => _contentsCreator; - public AIBattleInfoReceiver BattleInfoReceiver { get; protected set; } public event Action OnBattleRetire; @@ -23,6 +21,13 @@ public class SingleBattleMgr : BattleManagerBase { } + // Phase-5 chunk 45: overload accepting a pre-seeded GameMgr so test fixtures can construct + // with a chara-id/net-user-seeded GameMgr without going through the ambient bridge. + public SingleBattleMgr(IBattleMgrContentsCreator contentsCreator, GameMgr gameMgr) + : base(contentsCreator, gameMgr) + { + } + public override IInnerOptionsBuilder CreateEnemyInnerOptionsBuilder() { return new EnemyAIInnerOptionsBuilder(); @@ -60,7 +65,7 @@ public class SingleBattleMgr : BattleManagerBase { SetUpStoryPlayerTurnStartEmote(); } - switch (GameMgr.GetIns().GetDataMgr().m_BattleType) + switch (this.GameMgr.GetDataMgr().m_BattleType) { case DataMgr.BattleType.BossRushQuest: case DataMgr.BattleType.SecretBossQuest: @@ -75,7 +80,7 @@ public class SingleBattleMgr : BattleManagerBase private void SetUpBossRushSpecialSkill() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); DataMgr.SpecialBattleSetting specialBattleSettingInfo = dataMgr.SpecialBattleSettingInfo; BossRushBattleData bossRushBattleData = dataMgr.BossRushBattleData; if (specialBattleSettingInfo == null || bossRushBattleData == null) @@ -202,7 +207,7 @@ public class SingleBattleMgr : BattleManagerBase private void SetUpStorySpecialBattle() { - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; + DataMgr.SpecialBattleSetting specialBattleSettingInfo = this.GameMgr.GetDataMgr().SpecialBattleSettingInfo; if (specialBattleSettingInfo != null) { _isPlayerFirstTurn = specialBattleSettingInfo.IsPlayerFirstTurn; @@ -243,11 +248,6 @@ public class SingleBattleMgr : BattleManagerBase return list; } - public void SingleBattleFirstRecoverySetting() - { - StartRecoveryRecording(); - } - protected override void FirstRecoverySetting() { EmotionDataSetting(); @@ -255,7 +255,7 @@ public class SingleBattleMgr : BattleManagerBase private void EmotionDataSetting() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); if (dataMgr.m_BattleType != DataMgr.BattleType.Story) { if (dataMgr.m_BattleType == DataMgr.BattleType.Quest) @@ -316,7 +316,7 @@ public class SingleBattleMgr : BattleManagerBase public override void SetupEnemyAI() { - EnemyAI enemyAI = new SoloBattleEnemyAI(); + EnemyAI enemyAI = new SoloBattleEnemyAI(this); enemyAI.LoadBufferedBattleState(); EnemyAI = enemyAI; BattleInfoReceiver = new AIBattleInfoReceiver(EnemyAI); @@ -330,8 +330,8 @@ public class SingleBattleMgr : BattleManagerBase public override void SetupInitialGameState(bool isPlayerFirstTurn, bool isRandomDraw, int playerMaxLife, int enemyMaxLife) { - enemyMaxLife = AITestGlobal.AI_MAX_LIFE; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = this.GameMgr.GetDataMgr(); + enemyMaxLife = dataMgr.m_EnemyAIMaxLife; DataMgr.SpecialBattleSetting specialBattleSettingInfo = dataMgr.SpecialBattleSettingInfo; if ((dataMgr.m_BattleType == DataMgr.BattleType.Story || dataMgr.IsQuestBattleType()) && specialBattleSettingInfo != null) { @@ -363,12 +363,11 @@ public class SingleBattleMgr : BattleManagerBase BattlePlayer.Class.ApplyDamage(null, new BattleCardBase.DamageParam(specialBattleSettingInfo.PlayerStartMaxLife - specialBattleSettingInfo.PlayerStartLife, BattlePlayer.Class), doesAttackerPossessKiller: false, isReflectedDamage: false, null, null); } } - AITestGlobal.AI_MAX_LIFE = 20; } public override void FinishBattle() { - GameMgr.GetIns().GetDataMgr().ClearSpecialBattleSettingInfo(); + this.GameMgr.GetDataMgr().ClearSpecialBattleSettingInfo(); EnemyAI.StopEnemyAI(); } @@ -389,9 +388,9 @@ public class SingleBattleMgr : BattleManagerBase public override void PlayRetire() { - if (RecoveryRecordManagerBase.IsExistsSingleRecoveryFile() && GameMgr.GetIns().GetDataMgr().BossRushBattleData == null) + if (RecoveryRecordManagerBase.IsExistsSingleRecoveryFile() && this.GameMgr.GetDataMgr().BossRushBattleData == null) { - GameMgr.GetIns().GetDataMgr().SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); + this.GameMgr.GetDataMgr().SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); RecoveryRecordManagerBase.DeleteRecoveryFile(); } base.PlayRetire(); diff --git a/SVSim.BattleEngine/Engine/SingletonMonoBehaviour.cs b/SVSim.BattleEngine/Engine/SingletonMonoBehaviour.cs index 0d079ae6..06b3b532 100644 --- a/SVSim.BattleEngine/Engine/SingletonMonoBehaviour.cs +++ b/SVSim.BattleEngine/Engine/SingletonMonoBehaviour.cs @@ -4,8 +4,6 @@ public class SingletonMonoBehaviour : MonoBehaviour where T : MonoBehaviour { private static T _instance; - protected bool _isRedy; - public static T instance { get @@ -22,13 +20,6 @@ public class SingletonMonoBehaviour : MonoBehaviour where T : MonoBehaviour } } - public bool isRedy => _isRedy; - - public static bool IsInstanceEmpty() - { - return _instance == null; - } - private void Awake() { if (_instance == null) diff --git a/SVSim.BattleEngine/Engine/SkillAbilitySneakFilter.cs b/SVSim.BattleEngine/Engine/SkillAbilitySneakFilter.cs index 0168dacb..224ee866 100644 --- a/SVSim.BattleEngine/Engine/SkillAbilitySneakFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillAbilitySneakFilter.cs @@ -3,7 +3,6 @@ using Wizard.Battle; public class SkillAbilitySneakFilter : ISkillCardFilter { - private readonly string _parameterText; private readonly string _parameterOptionText; diff --git a/SVSim.BattleEngine/Engine/SkillApplyInformation.cs b/SVSim.BattleEngine/Engine/SkillApplyInformation.cs index 46b2866c..20c98de9 100644 --- a/SVSim.BattleEngine/Engine/SkillApplyInformation.cs +++ b/SVSim.BattleEngine/Engine/SkillApplyInformation.cs @@ -10,9 +10,6 @@ public class SkillApplyInformation : ISkillApplyInformation { protected BattleCardBase _card; - protected ICardVfxCreator _vfxCreator; - - public const int DAMAGE_MAX_CLIPPING_NULL = int.MaxValue; protected BattlePlayerBase Player => _card.SelfBattlePlayer; @@ -398,10 +395,9 @@ public class SkillApplyInformation : ISkillApplyInformation IsDamageCutProtection = ShieldInfos.Count > 0 || IsDamageCut || ((_card is ClassBattleCardBase) ? (DamageMaxClippingInfo.Where((DamageClippingInfo i) => i.LifeLowerLimit == -1).ToList().Count > 0) : (DamageMaxClippingInfo.Count > 0)); } - public SkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) + public SkillApplyInformation(BattleCardBase card) { _card = card; - _vfxCreator = vfxCreator; CantPlayFilterList = new List(); DamageMaxClippingInfo = new List(); ClanSkinInfo = new List(); @@ -575,13 +571,6 @@ public class SkillApplyInformation : ISkillApplyInformation TurnBuffCountList.Clear(); } - public void ReSetupVfxCreator(ICardVfxCreator vfxCreator) - { - if (vfxCreator != null) - { - _vfxCreator = vfxCreator; - } - } public SkillBase CloneAttachSkill(SkillApplyInformation cloneTarget, SkillBase skill) { @@ -909,27 +898,24 @@ public class SkillApplyInformation : ISkillApplyInformation { if (!_card.IsDead && ((!isOldAtkBuff && isNowAtkBuff && ((!isOldMaxLifeBuff && !isNowMaxLifeBuff) || (!isOldMaxLifeBuff && isNowMaxLifeBuff))) || (!isOldMaxLifeBuff && isNowMaxLifeBuff && ((!isOldAtkBuff && !isNowAtkBuff) || (!isOldAtkBuff && isNowAtkBuff))))) { - sequentialVfxPlayer.Register(_vfxCreator.CreateBuffStart(_card.CreateParameterChangeInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } if ((isOldAtkBuff && !isNowAtkBuff && !isNowMaxLifeBuff) || (isOldMaxLifeBuff && !isNowMaxLifeBuff && !isNowAtkBuff)) { - sequentialVfxPlayer.Register(_vfxCreator.CreateBuffStop(_card.CreateParameterChangeInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } if (!_card.IsDead && ((!isOldAtkDebuff && isNowAtkDebuff && ((!isOldMaxLifeDebuff && !isNowMaxLifeDebuff) || (!isOldMaxLifeDebuff && isNowMaxLifeDebuff))) || (!isOldMaxLifeDebuff && isNowMaxLifeDebuff && ((!isOldAtkDebuff && !isNowAtkDebuff) || (!isOldAtkDebuff && isNowAtkDebuff))))) { - sequentialVfxPlayer.Register(_vfxCreator.CreateDebuffStart(_card.CreateParameterChangeInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } if ((isOldAtkDebuff && !isNowAtkDebuff && !isNowMaxLifeDebuff) || (isOldMaxLifeDebuff && !isNowMaxLifeDebuff && !isNowAtkDebuff)) { - sequentialVfxPlayer.Register(_vfxCreator.CreateDebuffStop(_card.CreateParameterChangeInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } } if (_card.IsInHand && !isNoBuff) { - ICardVfxCreator vfxCreator = _vfxCreator; - BattleCardBase.ParameterChangeInformation parameterChangeInfo = _card.CreateParameterChangeInfo(); - bool isDebuff2 = isDebuff; - return vfxCreator.CreateBuffStartInHand(parameterChangeInfo, !skipWait, isDebuff2); + return NullVfx.GetInstance(); } return sequentialVfxPlayer; } @@ -975,7 +961,7 @@ public class SkillApplyInformation : ISkillApplyInformation } LifeModifierList.Add(lifeModifier); } - bool skipWait = !_card.IsPlayer && _card.IsInHand && !GameMgr.GetIns().IsAdminWatch; + bool skipWait = !_card.IsPlayer && _card.IsInHand && !_card.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch; bool isOldAtkBuff = num > _card.BaseAtk; bool isNowAtkBuff = num2 > _card.BaseAtk; bool isOldMaxLifeBuff = num3 > _card.BaseMaxLife; @@ -1005,7 +991,7 @@ public class SkillApplyInformation : ISkillApplyInformation bool flag = (byte)num6 != 0; bool isNoBuff = num5 == 0 && !flag; sequentialVfxPlayer.Register(CombatModifierChangeCalc(isOldAtkBuff, isNowAtkBuff, isOldMaxLifeBuff, isNowMaxLifeBuff, isOldAtkDebuff, isNowAtkDebuff, isOldMaxLifeDebuff, isNowMaxLifeDebuff, flag, isNoBuff, skipWait)); - sequentialVfxPlayer.Register(_vfxCreator.CreateParameterChange(_card.CreateParameterChangeInfo(), isDead: false, isEvolve: false, skipWait)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(this.OnGiveCombatValueModifire.GetAllFuncVfxResults(arg1: false)); return sequentialVfxPlayer; } @@ -1044,18 +1030,18 @@ public class SkillApplyInformation : ISkillApplyInformation bool isOldMaxLifeDebuff = num3 < _card.BaseMaxLife; bool isNowMaxLifeDebuff = num4 < _card.BaseMaxLife; parallelVfxPlayer.Register(CombatModifierChangeCalc(isOldAtkBuff, isNowAtkBuff, isOldMaxLifeBuff, isNowMaxLifeBuff, isOldAtkDebuff, isNowAtkDebuff, isOldMaxLifeDebuff, isNowMaxLifeDebuff)); - parallelVfxPlayer.Register(_vfxCreator.CreateParameterChange(_card.CreateParameterChangeInfo())); + parallelVfxPlayer.Register(NullVfx.GetInstance()); return parallelVfxPlayer; } public virtual VfxBase ForceDepriveCombatValueModifire() { ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register((_card.Atk > _card.BaseAtk || _card.MaxLife > _card.BaseMaxLife) ? _vfxCreator.CreateBuffStop(_card.CreateParameterChangeInfo(), useWait: false) : NullVfx.GetInstance()); - parallelVfxPlayer.Register((_card.Atk < _card.BaseAtk || _card.MaxLife < _card.BaseMaxLife) ? _vfxCreator.CreateDebuffStop(_card.CreateParameterChangeInfo(), useWait: false) : NullVfx.GetInstance()); + parallelVfxPlayer.Register((_card.Atk > _card.BaseAtk || _card.MaxLife > _card.BaseMaxLife) ? NullVfx.GetInstance() : NullVfx.GetInstance()); + parallelVfxPlayer.Register((_card.Atk < _card.BaseAtk || _card.MaxLife < _card.BaseMaxLife) ? NullVfx.GetInstance() : NullVfx.GetInstance()); if (_card.Atk > _card.BaseAtk || _card.MaxLife > _card.BaseMaxLife || _card.Atk < _card.BaseAtk || _card.MaxLife < _card.BaseMaxLife) { - _vfxCreator.CreateParameterChange(_card.CreateParameterChangeInfo(), _card.IsDead || _card.MetamorphoseCard != null); + NullVfx.GetInstance(); } return parallelVfxPlayer; } @@ -1069,14 +1055,6 @@ public class SkillApplyInformation : ISkillApplyInformation OffenseModifierList.Add(modifier); } - private void RemoveOffenseModifier(ICardOffenseModifier modifier) - { - if (!_card.IsDead) - { - OffenseModifierList.Remove(modifier); - } - } - public void AddLifeModifier(ICardLifeModifier modifier) { if (modifier.IsClearBeforeModifier) @@ -1086,14 +1064,6 @@ public class SkillApplyInformation : ISkillApplyInformation LifeModifierList.Add(modifier); } - private void RemoveLifeModifier(ICardLifeModifier modifier) - { - if (!_card.IsDead) - { - LifeModifierList.Remove(modifier); - } - } - public void ClearParameterModifier() { OffenseModifierList.Clear(); @@ -1367,7 +1337,7 @@ public class SkillApplyInformation : ISkillApplyInformation public virtual int GetSpecificTurnHealCountOnlySelf(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo) { - if (cardInfo.IsPlayer != BattleManagerBase.GetIns().BattlePlayer.IsSelfTurn) + if (cardInfo.IsPlayer != _card.SelfBattlePlayer.BattleMgr.BattlePlayer.IsSelfTurn) { return 0; } @@ -1401,7 +1371,7 @@ public class SkillApplyInformation : ISkillApplyInformation public virtual int GetSpecificTurnAcceleratedCardCountOnlySelf(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo) { - if (cardInfo.IsPlayer != BattleManagerBase.GetIns().BattlePlayer.IsSelfTurn) + if (cardInfo.IsPlayer != _card.SelfBattlePlayer.BattleMgr.BattlePlayer.IsSelfTurn) { return 0; } @@ -1412,7 +1382,7 @@ public class SkillApplyInformation : ISkillApplyInformation { bool flag = cardInfo.IsPlayer == turnPlayerInfo.IsSelfPlayer; int referenceTurn = GetReferenceTurn(flag, turnPlayerInfo.TurnOffset); - BattlePlayerBase obj = (flag ? ((BattlePlayerBase)BattleManagerBase.GetIns().BattlePlayer) : ((BattlePlayerBase)BattleManagerBase.GetIns().BattleEnemy)); + BattlePlayerBase obj = (flag ? ((BattlePlayerBase)_card.SelfBattlePlayer.BattleMgr.BattlePlayer) : ((BattlePlayerBase)_card.SelfBattlePlayer.BattleMgr.BattleEnemy)); List list = new List(); foreach (IReadOnlyBattleCardInfo skillInfoGamePlayCard in obj.SkillInfoGamePlayCards) { @@ -1436,7 +1406,7 @@ public class SkillApplyInformation : ISkillApplyInformation public int GetReferenceTurn(bool isCheckSelf, int turnOffset) { - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _card.SelfBattlePlayer.BattleMgr; return (isCheckSelf ? ins.BattlePlayer.Turn : ins.BattleEnemy.Turn) - turnOffset; } @@ -1531,7 +1501,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateGuardStart(); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveGuard(GuardInfo info) @@ -1542,7 +1512,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateGuardStop(); + return NullVfx.GetInstance(); } public virtual VfxBase ForceDepriveGuard() @@ -1552,7 +1522,7 @@ public class SkillApplyInformation : ISkillApplyInformation GuardInfo.Clear(); IsGuard = false; } - return _vfxCreator.CreateGuardStop(); + return NullVfx.GetInstance(); } public virtual VfxBase GiveDrain() @@ -1563,7 +1533,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateDrainStart(); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveDrain() @@ -1574,7 +1544,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateDrainStop(); + return NullVfx.GetInstance(); } public virtual VfxBase FourceDepriveDrain() @@ -1584,7 +1554,7 @@ public class SkillApplyInformation : ISkillApplyInformation DrainCount = 0; IsDrain = false; } - return _vfxCreator.CreateDrainStop(); + return NullVfx.GetInstance(); } public virtual VfxBase GiveKiller() @@ -1595,7 +1565,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateKillerStart(); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveKiller() @@ -1606,7 +1576,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateKillerStop(); + return NullVfx.GetInstance(); } public virtual VfxBase FourceDepriveKiller() @@ -1616,7 +1586,7 @@ public class SkillApplyInformation : ISkillApplyInformation KillerCount = 0; IsKiller = false; } - return _vfxCreator.CreateKillerStop(); + return NullVfx.GetInstance(); } public virtual VfxBase GiveShield(ShieldInfo shield) @@ -1707,7 +1677,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateSneakStart(); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveSneak() @@ -1717,7 +1687,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateSneakStop(); + return NullVfx.GetInstance(); } public virtual VfxBase FourceDepriveSneak() @@ -1726,7 +1696,7 @@ public class SkillApplyInformation : ISkillApplyInformation { SneakCount = 0; } - return _vfxCreator.CreateSneakStop(); + return NullVfx.GetInstance(); } public virtual VfxBase GiveNotBeAttacked(NotBeAttackedInfo info) @@ -1737,7 +1707,7 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateNotBeAttackedStart(); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveNotBeAttacked(NotBeAttackedInfo info) @@ -1748,14 +1718,14 @@ public class SkillApplyInformation : ISkillApplyInformation { return NullVfx.GetInstance(); } - return _vfxCreator.CreateNotBeAttackedStop(); + return NullVfx.GetInstance(); } public virtual VfxBase FourceDepriveNotBeAttacked() { NotBeAttackedInfoList.Clear(); IsNotBeAttacked = false; - return _vfxCreator.CreateNotBeAttackedStop(); + return NullVfx.GetInstance(); } public virtual VfxBase GiveUntouchable(string cardType) @@ -1778,7 +1748,7 @@ public class SkillApplyInformation : ISkillApplyInformation return NullVfx.GetInstance(); } } - return _vfxCreator.CreateUntouchableStart(); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveUntouchable(string cardType) @@ -1801,7 +1771,7 @@ public class SkillApplyInformation : ISkillApplyInformation return NullVfx.GetInstance(); } } - return _vfxCreator.CreateUntouchableStop(); + return NullVfx.GetInstance(); } public virtual VfxBase FourceDepriveUntouchable(string cardType) @@ -1816,7 +1786,7 @@ public class SkillApplyInformation : ISkillApplyInformation UntouchableCount = 0; IsUntouchable = false; } - return _vfxCreator.CreateUntouchableStop(); + return NullVfx.GetInstance(); } public virtual VfxBase GiveAttackByLife(string type) @@ -1906,7 +1876,7 @@ public class SkillApplyInformation : ISkillApplyInformation return ParallelVfxPlayer.Create(InstantVfx.Create(delegate { _card.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - }), _vfxCreator.CreateForceCantAttackStart()); + }), NullVfx.GetInstance()); } return InstantVfx.Create(delegate { @@ -1948,7 +1918,7 @@ public class SkillApplyInformation : ISkillApplyInformation _card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); })); } - parallelVfxPlayer.Register(_vfxCreator.CreateForceCantAttackStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); return parallelVfxPlayer; } return NullVfx.GetInstance(); @@ -1976,7 +1946,7 @@ public class SkillApplyInformation : ISkillApplyInformation } })); } - parallelVfxPlayer.Register(_vfxCreator.CreateForceCantAttackStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); return parallelVfxPlayer; } @@ -1998,7 +1968,7 @@ public class SkillApplyInformation : ISkillApplyInformation } })); } - parallelVfxPlayer.Register(_vfxCreator.CreateForceCantAttackStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); return parallelVfxPlayer; } @@ -2090,7 +2060,7 @@ public class SkillApplyInformation : ISkillApplyInformation _card.AttackableCount = Math.Min(_card.MaxAttackableCount, _card.AttackableCount); if (_card.MaxAttackableCount <= 0 && maxAttackableCount > 0) { - return _vfxCreator.CreateForceCantAttackStart(); + return NullVfx.GetInstance(); } return NullVfx.GetInstance(); } @@ -2328,7 +2298,7 @@ public class SkillApplyInformation : ISkillApplyInformation IsIndependent = IndependentCount > 0; if (IndependentCount == 1) { - sequentialVfxPlayer.Register(_vfxCreator.CreateHeavenlyAegisStart()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } return sequentialVfxPlayer; } @@ -2340,7 +2310,7 @@ public class SkillApplyInformation : ISkillApplyInformation IsIndependent = IndependentCount > 0; if (IndependentCount == 0) { - sequentialVfxPlayer.Register(_vfxCreator.CreateHeavenlyAegisStop()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } return sequentialVfxPlayer; } @@ -2349,7 +2319,7 @@ public class SkillApplyInformation : ISkillApplyInformation { IndependentCount = 0; IsIndependent = false; - return _vfxCreator.CreateHeavenlyAegisStop(); + return NullVfx.GetInstance(); } public void GiveNotBeDebuffed() @@ -2469,8 +2439,8 @@ public class SkillApplyInformation : ISkillApplyInformation continue; } num = _card.Life - DamageMaxClippingInfo[i].LifeLowerLimit; - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; - if (lifeLowerLimitEffectVfx != null && !BattleManagerBase.GetIns().IsRecovery && specialBattleSettingInfo != null && specialBattleSettingInfo.Id == "42") + DataMgr.SpecialBattleSetting specialBattleSettingInfo = _card.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().SpecialBattleSettingInfo; + if (lifeLowerLimitEffectVfx != null && !_card.SelfBattlePlayer.BattleMgr.IsRecovery && specialBattleSettingInfo != null && specialBattleSettingInfo.Id == "42") { lifeLowerLimitEffectVfx.Register(SkillBase.CreateSingleVfx(_card.ResourceMgr, () => _card.BattleCardView.GameObject.transform.position, new List { _card }, _card.IsPlayer, _card.BattleCardView, "btl_nerva_2", EffectMgr.EngineType.SHURIKEN, "se_btl_nerva_2", EffectMgr.MoveType.DIRECT_LEADER, EffectMgr.TargetType.SINGLE, 0f)); } @@ -2551,7 +2521,7 @@ public class SkillApplyInformation : ISkillApplyInformation { TribeSkinInfo.Add(tribeInfo); } - return _vfxCreator.CreateChangeAffiliation(_card, clan, showEffect); + return NullVfx.GetInstance(); } public virtual VfxBase DepriveChangeAffiliation(CardBasePrm.ClanType clan, CardBasePrm.TribeInfo tribeInfo) @@ -2897,59 +2867,59 @@ public class SkillApplyInformation : ISkillApplyInformation if ((_card.Atk > _card.BaseAtk || _card.MaxLife > _card.BaseMaxLife || BuffCount > 0 || isBuffed) && _card.IsUnit) { flag = true; - parallelVfxPlayer.Register(_vfxCreator.CreateBuffStop(_card.CreateParameterChangeInfo(), useWait: false)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if ((_card.Atk < _card.BaseAtk || _card.MaxLife < _card.BaseMaxLife || isDebuffed) && _card.IsUnit) { flag = true; - parallelVfxPlayer.Register(_vfxCreator.CreateDebuffStop(_card.CreateParameterChangeInfo(), useWait: false)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (flag) { if (isReturn) { - parallelVfxPlayer.Register(_vfxCreator.CreateParameterChange(new BattleCardBase.ParameterChangeInformation(_card.BaseAtk, _card.BaseAtk, _card.BaseMaxLife, _card.BaseMaxLife, _card.BaseMaxLife), _card.IsDead, isEvolve)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } else { - parallelVfxPlayer.Register(_vfxCreator.CreateParameterChange(_card.CreateParameterChangeInfo(), _card.IsDead, isEvolve)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } } if (IsGuard) { - parallelVfxPlayer.Register(_vfxCreator.CreateGuardStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsKiller) { - parallelVfxPlayer.Register(_vfxCreator.CreateKillerStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsUntouchable) { - parallelVfxPlayer.Register(_vfxCreator.CreateUntouchableStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsUntouchableBySpell) { - parallelVfxPlayer.Register(_vfxCreator.CreateUntouchableStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsNotBeAttacked) { - parallelVfxPlayer.Register(_vfxCreator.CreateNotBeAttackedStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsSneak) { - parallelVfxPlayer.Register(_vfxCreator.CreateSneakStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsSkillCantAtkAll) { - parallelVfxPlayer.Register(_vfxCreator.CreateForceCantAttackStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsIndependent) { - parallelVfxPlayer.Register(_vfxCreator.CreateHeavenlyAegisStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsDamageCutProtection || IsIndestructible || IsReflectionClass) { - parallelVfxPlayer.Register(_vfxCreator.CreateProtectionStop()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } return parallelVfxPlayer; } @@ -2959,43 +2929,43 @@ public class SkillApplyInformation : ISkillApplyInformation ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); if ((_card.Atk > _card.BaseAtk || _card.MaxLife > _card.BaseMaxLife) && _card.IsUnit) { - parallelVfxPlayer.Register(_vfxCreator.CreateBuffStart(_card.CreateParameterChangeInfo(), useWait: false)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if ((_card.Atk < _card.BaseAtk || _card.MaxLife < _card.BaseMaxLife) && _card.IsUnit) { - parallelVfxPlayer.Register(_vfxCreator.CreateDebuffStart(_card.CreateParameterChangeInfo(), useWait: false)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsGuard) { - parallelVfxPlayer.Register(_vfxCreator.CreateGuardStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsKiller) { - parallelVfxPlayer.Register(_vfxCreator.CreateKillerStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsUntouchable) { - parallelVfxPlayer.Register(_vfxCreator.CreateUntouchableStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsUntouchableBySpell) { - parallelVfxPlayer.Register(_vfxCreator.CreateUntouchableStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsNotBeAttacked) { - parallelVfxPlayer.Register(_vfxCreator.CreateNotBeAttackedStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsSneak) { - parallelVfxPlayer.Register(_vfxCreator.CreateSneakStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsSkillCantAtkAll) { - parallelVfxPlayer.Register(_vfxCreator.CreateForceCantAttackStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsIndependent) { - parallelVfxPlayer.Register(_vfxCreator.CreateHeavenlyAegisStart()); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsDamageCutProtection || IsIndestructible || IsReflectionClass) { @@ -3013,15 +2983,15 @@ public class SkillApplyInformation : ISkillApplyInformation bool flag3 = _card.BaseMaxLife > _card.MaxLife; if (num || flag2) { - parallelVfxPlayer.Register(_vfxCreator.CreateBuffStart(_card.CreateParameterChangeInfo(), useWait: false)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (flag || flag3) { - parallelVfxPlayer.Register(_vfxCreator.CreateDebuffStart(_card.CreateParameterChangeInfo(), useWait: false)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (IsBuff || IsDebuff || _card.Atk != _card.BaseAtk || _card.Life != _card.BaseMaxLife || _card.MaxLife != _card.BaseMaxLife) { - parallelVfxPlayer.Register(_vfxCreator.CreateParameterChange(_card.CreateParameterChangeInfo())); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } return parallelVfxPlayer; } @@ -3030,7 +3000,7 @@ public class SkillApplyInformation : ISkillApplyInformation { if (isForceStop) { - return _vfxCreator.CreateProtectionStop(); + return NullVfx.GetInstance(); } if (_card.IsInHand) { @@ -3038,21 +3008,21 @@ public class SkillApplyInformation : ISkillApplyInformation } if (IsReflectionClass) { - return _vfxCreator.CreateProtectionStart(ProtectionColorType.DamageReflection); + return NullVfx.GetInstance(); } if (IsDamageCutProtection && IsIndestructible) { - return _vfxCreator.CreateProtectionStart(ProtectionColorType.MultiInvalid); + return NullVfx.GetInstance(); } if (IsIndestructible) { - return _vfxCreator.CreateProtectionStart(ProtectionColorType.Indestructible); + return NullVfx.GetInstance(); } if (IsDamageCutProtection) { - return _vfxCreator.CreateProtectionStart(ProtectionColorType.DamageCut); + return NullVfx.GetInstance(); } - return _vfxCreator.CreateProtectionStop(); + return NullVfx.GetInstance(); } public virtual void AddTokenDrawModifier(TokenDrawModifier modifier) @@ -3169,7 +3139,7 @@ public class SkillApplyInformation : ISkillApplyInformation { IsSkillCantAtkClass = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.SkillCantAtkAll); IsSkillCantAtkUnit = IsSkillCantAtkClass; - parallelVfxPlayer.Register(IsSkillCantAtkAll ? _vfxCreator.CreateForceCantAttackStart() : _vfxCreator.CreateForceCantAttackStop()); + parallelVfxPlayer.Register(IsSkillCantAtkAll ? NullVfx.GetInstance() : NullVfx.GetInstance()); } if (isOnlyCantAtk) { @@ -3178,34 +3148,34 @@ public class SkillApplyInformation : ISkillApplyInformation if (IsGuard != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Guard)) { IsGuard = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Guard); - parallelVfxPlayer.Register(IsGuard ? _vfxCreator.CreateGuardStart() : _vfxCreator.CreateGuardStop()); + parallelVfxPlayer.Register(IsGuard ? NullVfx.GetInstance() : NullVfx.GetInstance()); } if (IsUntouchable != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Untouchable)) { IsUntouchable = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Untouchable); - parallelVfxPlayer.Register(IsUntouchable ? _vfxCreator.CreateUntouchableStart() : _vfxCreator.CreateUntouchableStop()); + parallelVfxPlayer.Register(IsUntouchable ? NullVfx.GetInstance() : NullVfx.GetInstance()); } if (IsNotBeAttacked != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.NotBeAttacked)) { IsNotBeAttacked = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.NotBeAttacked); - parallelVfxPlayer.Register(IsNotBeAttacked ? _vfxCreator.CreateNotBeAttackedStart() : _vfxCreator.CreateNotBeAttackedStop()); + parallelVfxPlayer.Register(IsNotBeAttacked ? NullVfx.GetInstance() : NullVfx.GetInstance()); } if (IsSneak != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Sneak)) { SneakCount = (inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Sneak) ? 1 : 0); - parallelVfxPlayer.Register(IsSneak ? _vfxCreator.CreateSneakStart() : _vfxCreator.CreateSneakStop()); + parallelVfxPlayer.Register(IsSneak ? NullVfx.GetInstance() : NullVfx.GetInstance()); } if (IsIndependent != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Independent)) { IsIndependent = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Independent); - parallelVfxPlayer.Register(IsIndependent ? _vfxCreator.CreateHeavenlyAegisStart() : _vfxCreator.CreateHeavenlyAegisStop()); + parallelVfxPlayer.Register(IsIndependent ? NullVfx.GetInstance() : NullVfx.GetInstance()); } if (IsDamageCutProtection != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.DamageCutProtection) || IsIndestructible != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Indestructible) || IsReflectionClass != inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.ReflectionClass)) { IsDamageCutProtection = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.DamageCutProtection); IsIndestructible = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.Indestructible); IsReflectionClass = inplaySkillEffectList.Contains(NetworkBattleReceiver.InplaySkillEffect.ReflectionClass); - parallelVfxPlayer.Register((IsDamageCutProtection || IsIndestructible || IsReflectionClass) ? CreateVfxSkillProtection() : _vfxCreator.CreateProtectionStop()); + parallelVfxPlayer.Register((IsDamageCutProtection || IsIndestructible || IsReflectionClass) ? CreateVfxSkillProtection() : NullVfx.GetInstance()); } if (_card.BattleCardView.BattleCardIconAnimations != null) { diff --git a/SVSim.BattleEngine/Engine/SkillBase.cs b/SVSim.BattleEngine/Engine/SkillBase.cs index 176d4561..03978c59 100644 --- a/SVSim.BattleEngine/Engine/SkillBase.cs +++ b/SVSim.BattleEngine/Engine/SkillBase.cs @@ -38,12 +38,6 @@ public abstract class SkillBase public ICardLifeModifier LifeModifier; - public const int INVALID_INT_VALUE = -1; - - public const int INVALID_DUPLICATE_VALUE = 0; - - public const string INVALID_STRING_VALUE = ""; - public BuffInfoContainer(BattleCardBase targetCard, BuffInfo buffInfo, int intValue = -1, string stringValue = "", SkillBase attachSkill = null, long duplicateBanNum = 0L, NotConsumeEpModifierInfo notConsumeEpModifierInfo = null, ICardCostModifier costModifire = null, ICardOffenseModifier offenseModifire = null, ICardLifeModifier lifeModifire = null) { _targetCard = targetCard; @@ -191,43 +185,28 @@ public abstract class SkillBase public WaitEffectLoadVfx(string effectPath, EffectMgr.EngineType engineType, string sePath, IBattleResourceMgr resourceMgr, Action loadEndCallback) { - if (!BattleManagerBase.GetIns().IsRecovery) + // Pre-Phase-5b: guarded on the mgr's IsRecovery. Headless has no visible EffectMgr; + // preserve the pre-cull default (register the LoadVfx) — resourceMgr is a null-shim + // in headless, so the register call is a no-op. + EffectPath = effectPath; + LoadVfx = resourceMgr.LoadAndCreateEffectBattleInstance(effectPath, engineType, sePath, delegate(EffectBattle eb) { - EffectPath = effectPath; - WaitCallbackVfx waitCallbackVfx = new WaitCallbackVfx(); - LoadVfx = resourceMgr.LoadAndCreateEffectBattleInstance(effectPath, engineType, sePath, delegate(EffectBattle eb) - { - loadEndCallback.Call(eb); - waitCallbackVfx.Callback(); - }); - Register(LoadVfx); - Register(waitCallbackVfx); - } + loadEndCallback.Call(eb); + }); + Register(LoadVfx); } } protected List buffInfoContainer; - public const int PUBLISHED_ACTIVE_SKILL_COUNT_DEFAULT = -1; - public bool IsNotAssignPublishedActiveSkillCount; - private uint _stopTiming; - - public const string PARAM_INDUCTION_ICON = "induction"; - - public const string OPTION_NULL = "_OPT_NULL_"; - private string _inductionSkillVoice; private string _inductionEvolutionSkillVoice; public string SkillTimingText; - public const uint CALL_NONE = 0u; - - public const uint CALL_START = 1u; - public uint OnWhenPlayStart; public uint OnWhenHandToNotPlayStart; @@ -400,8 +379,6 @@ public abstract class SkillBase private List _targetCards; - private const string SUPER_SKYBOUND_ART_TRUE_CONDITION = "{self.super_skybound_art_count}<={me.inplay.class.turn}"; - public Func, VfxBase> CreateInductionSkillActivationVfxFunc; protected bool? _isMakeFoil = false; @@ -456,8 +433,6 @@ public abstract class SkillBase public virtual bool IsAllowDestroyTarget => false; - public bool SelectCompleteFlag { get; set; } - public bool IsInvoked { get; protected set; } public ExecutionInfoCreatorBase _executionInfoCreator { get; protected set; } @@ -520,18 +495,6 @@ public abstract class SkillBase public ConditionSkillFilterCollection ConditionFilterCollection { get; private set; } - public ISkillBattlePlayerFilter ConditionBattlePlayerFilter - { - get - { - return ConditionFilterCollection.BattlePlayerFilter; - } - set - { - ConditionFilterCollection.BattlePlayerFilter = value; - } - } - public List ConditionCheckerList { get @@ -556,8 +519,6 @@ public abstract class SkillBase } } - public List ConditionCardFilterList => ConditionFilterCollection.CardFilterList; - public ApplySkillTargetFilterCollection ApplyFilterCollection { get; private set; } public ISkillBattlePlayerFilter ApplyBattlePlayerFilter @@ -620,18 +581,6 @@ public abstract class SkillBase public string DuplicateBanSkillNum { get; private set; } = string.Empty; - public string InductionSkillVoice - { - get - { - if (!SkillPrm.ownerCard.IsEvolution) - { - return _inductionSkillVoice; - } - return _inductionEvolutionSkillVoice; - } - } - public List PreprocessList { get; set; } public IEnumerable SkillDrewCards { get; private set; } @@ -678,7 +627,7 @@ public abstract class SkillBase { get { - if (!GameMgr.GetIns().IsAdmin && !SkillPrm.ownerCard.IsPlayer && SkillPrm.ownerCard.IsInHand && !PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessOpenCard) && OnWhenReturnStart == 0 && OnWhenLeave == 0) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdmin && !SkillPrm.ownerCard.IsPlayer && SkillPrm.ownerCard.IsInHand && !PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessOpenCard) && OnWhenReturnStart == 0 && OnWhenLeave == 0) { return OnWhenGetOff != 0; } @@ -727,18 +676,6 @@ public abstract class SkillBase } } - public bool IsNoSelectFusionSkill - { - get - { - if (this is Skill_fusion) - { - return GetSkillSelectCount() == 0; - } - return false; - } - } - public bool IsActivity { get; protected set; } public bool IsReferencePreviousSkill { get; protected set; } @@ -880,7 +817,7 @@ public abstract class SkillBase IDetailPanelControl detailPanelControl = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl; if (detailPanelControl.IsShow) { - GameMgr.GetIns().GetDataMgr(); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr(); List list = new List(); list.AddRange(target.SelfBattlePlayer.BonusConditionList); if (detailPanelControl._card != null && detailPanelControl._card.IsClass && detailPanelControl._card.IsPlayer == target.IsPlayer) @@ -1013,9 +950,9 @@ public abstract class SkillBase ConditionCheckerList = new List(); ApplyFilterCollection = new ApplySkillTargetFilterCollection(); PreprocessList = new List(); - if (skillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !GameMgr.GetIns().IsAINetwork) + if (skillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork) { - if (GameMgr.GetIns().IsReplayBattle) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle) { _executionInfoCreator = new ReplayExecutionInfoCreator(this); } @@ -1172,7 +1109,7 @@ public abstract class SkillBase protected VfxWithLoading CreateSkillEffect(IBattleResourceMgr resourceMgr, IEnumerable targetCards, bool isFollowInHand = false, bool addToLastOperation = false, bool skipCallOnEffect = false) { - if (!SkillPrm.ownerCard.IsPlayer && !GameMgr.GetIns().IsAdminWatch && ApplyingTargetFilter is SkillTargetHandSelfFilter) + if (!SkillPrm.ownerCard.IsPlayer && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch && ApplyingTargetFilter is SkillTargetHandSelfFilter) { return NullVfxWithLoading.GetInstance(); } @@ -1180,7 +1117,7 @@ public abstract class SkillBase { SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnEffect(SkillPrm.buildInfo, isFollowInHand, isTargetPosition: false, addToLastOperation, OnWhenFusioned != 0); } - if (BattleManagerBase.GetIns().IsRecovery) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { return NullVfxWithLoading.GetInstance(); } @@ -1232,7 +1169,7 @@ public abstract class SkillBase { effectBattle = eb; }); - DelaySetupVfx mainVfx = new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, SkillPrm.ownerCard.BattleCardView, SkillPrm.resourceMgr, getEffectStartPoint, getEffectEndPoint, 0f, animationTime, moveType, SkillPrm.ownerCard.IsPlayer, color)); + VfxBase mainVfx = NullVfx.GetInstance(); return VfxWithLoading.Create(loadingVfx, mainVfx); } @@ -1243,12 +1180,9 @@ public abstract class SkillBase foreach (BattleCardBase targetCard in targetCards) { GameObject effectGameObject = null; - WaitLoadEffectAndSetSeVfx vfx = new WaitLoadEffectAndSetSeVfx(effectPath, sePath, delegate(GameObject e) - { - effectGameObject = e; - }); + VfxBase vfx = NullVfx.GetInstance(); parallelVfxPlayer.Register(vfx); - PlayEffectAndSeVfx vfx2 = new PlayEffectAndSeVfx(() => effectGameObject, targetCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true); + VfxBase vfx2 = NullVfx.GetInstance(); parallelVfxPlayer2.Register(vfx2); } return VfxWithLoading.Create(parallelVfxPlayer, parallelVfxPlayer2); @@ -1272,7 +1206,7 @@ public abstract class SkillBase effectBattle = eb; })); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, getEffectStartPoint, resourceMgr, () => targetCard.BattleCardView.CardWrapObject.transform.position, 0f, isPlayer, battleCardView, effectMoveType, effectTargetType, effectTime, targetCard.BattleCardView))); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); parallelVfxPlayer2.Register(sequentialVfxPlayer); } return VfxWithLoading.Create(parallelVfxPlayer, parallelVfxPlayer2); @@ -1290,22 +1224,10 @@ public abstract class SkillBase { effectBattle = eb; }); - DelaySetupVfx mainVfx = new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, effectStartPoint, resourceMgr, () => effectEndPoint, 0f, isPlayer, battleCardView, effectMoveType, effectTargetType, effectTime, battleCardView)); + VfxBase mainVfx = NullVfx.GetInstance(); return VfxWithLoading.Create(loadingVfx, mainVfx); } - private VfxBase AttachEffectToCard(BattleCardBase targetCard, Func getEffectBattle) - { - return InstantVfx.Create(delegate - { - EffectBattle effectBattle = getEffectBattle(); - effectBattle.transform.localScale = targetCard.BattleCardView.Transform.localScale; - effectBattle.transform.SetParent(targetCard.BattleCardView.Transform); - effectBattle.transform.localPosition = Vector3.zero; - effectBattle.transform.localRotation = Quaternion.identity; - }); - } - public abstract VfxWithLoading Start(CallParameter parameter); public virtual VfxWithLoading Stop(SkillProcessor skillProcessor) @@ -1354,26 +1276,6 @@ public abstract class SkillBase return 0; } - protected string GetEachOption() - { - return OptionValue.GetString(SkillFilterCreator.ContentKeyword.each, string.Empty); - } - - protected int GetEachOptionValue(string getValueOption, BattleCardBase card) - { - return getValueOption switch - { - "life" => card.Life, - "attack" => card.Atk, - _ => -1, - }; - } - - public void SetStopTiming(uint stopTiming) - { - _stopTiming = stopTiming; - } - public void SetIsAttachSkill(bool flag, bool isInplay) { IsAttachedSkill = flag; @@ -1414,7 +1316,7 @@ public abstract class SkillBase num = Mathf.Clamp(num, 1, max); } VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - BattleManagerBase.GetIns().OperateMgr.CallOnSkillVfxStart(); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnSkillVfxStart(); for (int i = 0; i < num; i++) { if (SkillPrm.selfBattlePlayer.Class.IsDead || SkillPrm.opponentBattlePlayer.Class.IsDead) @@ -1433,7 +1335,7 @@ public abstract class SkillBase if (skill.SkillPrm.ownerCard.BaseParameter.SkillDescription.Contains("skill_activated_count") && skill.SkillPrm.ownerCard.HasSkillActivatedCountWrapValue) { skillDescription = skill.SkillPrm.ownerCard.GetCardSkillDescription(new BattlePlayerBase.SideLogInfo(skill), SkillPrm.ownerCard.IsEvolution); - sideLogCardData = BattleManagerBase.GetIns().OperateMgr.CallOnCreateSideLogCardData(skill.SkillPrm.ownerCard, skill, isDeckSelf, isInHand); + sideLogCardData = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnCreateSideLogCardData(skill.SkillPrm.ownerCard, skill, isDeckSelf, isInHand); } VfxBase vfxToRegister = skill.Preprocess(skillProcessor, checkerOption); checkerOption.IsRefPrev = true; @@ -1464,7 +1366,7 @@ public abstract class SkillBase if (IsPreviousGetSideLogText(skill.SkillPrm.ownerCard.BaseParameter.SkillDescription)) { skillDescription = skill.SkillPrm.ownerCard.GetCardSkillDescription(new BattlePlayerBase.SideLogInfo(skill), isEvolve); - sideLogCardData = BattleManagerBase.GetIns().OperateMgr.CallOnCreateSideLogCardData(skill.SkillPrm.ownerCard, skill, isDeckSelf, isInHand); + sideLogCardData = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnCreateSideLogCardData(skill.SkillPrm.ownerCard, skill, isDeckSelf, isInHand); } bool flag4 = true; if (callType == SkillProcessor.ProcessCallType.ResidentStop && ConditionCheckerList.Where((ISkillConditionChecker c) => c is SkillConditionTurn).Any((ISkillConditionChecker t) => !t.IsRight(playerInfoPair, checkerOption))) @@ -1478,7 +1380,7 @@ public abstract class SkillBase bool isOnSummonOrReturnTiming = sideLogControl != null && sideLogControl.IsOnSummonOrReturnTimingSkill(skill); skillProcessor.OnSkillStart += delegate { - BattleManagerBase.GetIns().OperateMgr.CallOnCreateSideLog(skill.SkillPrm.ownerCard, skill, isEvolve, isOnSummonOrReturnTiming, isDeckSelf, isInHand, sideLogCardData); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnCreateSideLog(skill.SkillPrm.ownerCard, skill, isEvolve, isOnSummonOrReturnTiming, isDeckSelf, isInHand, sideLogCardData); return skill.SkillPrm.ownerCard.CreateShowLogVfx(3f, skill, isEvolve, skillDescription); }; } @@ -1562,12 +1464,12 @@ public abstract class SkillBase } checkerOption.SetCheckerOptionTransientValue(SkillPrm.ownerCard.SelfBattlePlayer, SkillPrm.ownerCard.OpponentBattlePlayer); } - if (BattleManagerBase.GetIns() is NetworkBattleManagerBase && (SkillPrm.selfBattlePlayer.Class.IsDead || SkillPrm.opponentBattlePlayer.Class.IsDead)) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && (SkillPrm.selfBattlePlayer.Class.IsDead || SkillPrm.opponentBattlePlayer.Class.IsDead)) { - BattleManagerBase.GetIns().LethalPublishedActiveSkillCount = NetworkBattleGenericTool.GetPublishSkillCount(this); - BattleManagerBase.GetIns().LethalMovementCount = NetworkBattleGenericTool.GetSkillMovementNum(this); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.LethalPublishedActiveSkillCount = NetworkBattleGenericTool.GetPublishSkillCount(this); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.LethalMovementCount = NetworkBattleGenericTool.GetSkillMovementNum(this); } - BattleManagerBase.GetIns().OperateMgr.CallOnSkillVfxEnd(); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnSkillVfxEnd(); return vfxWithLoadingSequential; } @@ -1629,7 +1531,7 @@ public abstract class SkillBase } int num; IReadOnlyVoiceInfo readOnlyVoiceInfo; - if (BattleManagerBase.GetIns().IsRecovery) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { num = ((GetAttachSkill.SkillPrm.ownerCard.BattleCardView is NullBattleCardView) ? 1 : 0); if (num != 0) @@ -1703,7 +1605,7 @@ public abstract class SkillBase protected VfxBase CreateSkillActivationVoiceVfx() { - if (BattleManagerBase.GetIns().IsRecovery) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { return NullVfx.GetInstance(); } @@ -1718,7 +1620,7 @@ public abstract class SkillBase { text2 = text.Split(new string[1] { "_" }, StringSplitOptions.None)[0]; } - return VfxWithLoading.Create(new WaitLoadVoiceResourceVfx(battleCardView, text2), new PlayCRISoundVfx(battleCardView, text)); + return VfxWithLoading.Create(NullVfx.GetInstance(), NullVfx.GetInstance()); } private bool LightCheckAvailable(SkillBase skill, SkillConditionCheckerOption checkerOption) @@ -1797,7 +1699,7 @@ public abstract class SkillBase if (IsInductionSkill && !SkillPrm.ownerCard.IsDead && !SkillPrm.ownerCard.IsInHand) { VfxBase inductionVoiceVfx = CreateSkillActivationVoiceVfx(); - return ParallelVfxPlayer.Create(CreateInductionSkillActivationVfxFunc.GetAllFuncVfxResults(() => inductionVoiceVfx), new ReactiveSkillActivationVfx(SkillPrm.ownerCard)); + return ParallelVfxPlayer.Create(CreateInductionSkillActivationVfxFunc.GetAllFuncVfxResults(() => inductionVoiceVfx), NullVfx.GetInstance()); } return NullVfx.GetInstance(); } @@ -1874,25 +1776,6 @@ public abstract class SkillBase return true; } - public static T GetSkillLastOrDefaultBeforeTargetSkill(SkillBase targetSkill) where T : SkillBase - { - List list = targetSkill.SkillPrm.ownerCard.Skills.ToList(); - int num = list.FindIndex((SkillBase s) => s == targetSkill); - if (num <= -1) - { - return null; - } - list.RemoveRange(num, list.Count - num); - return (T)list.LastOrDefault((SkillBase s) => s is T); - } - - public List GetDrewCardInHand() - { - IEnumerable source = SkillDrewCards.Select((IReadOnlyBattleCardInfo c) => (BattleCardBase)c); - BattlePlayerBase owner = SkillPrm.ownerCard.SelfBattlePlayer; - return source.Where((BattleCardBase c) => owner.HandCardList.Any((BattleCardBase cc) => cc.EquelsID(c))).ToList(); - } - public bool IsNeedCheckConditionOnScan() { if (ConditionFilterCollection.ConditionCheckerFilterList.Count < 1) @@ -1999,28 +1882,6 @@ public abstract class SkillBase return result; } - public bool CheckConditionWithoutChosenCard(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool isPrePlay) - { - ISkillTargetFilter targetFilter = null; - List cardFilter = null; - bool flag = false; - if (ConditionFilterCollection.TargetFilter is SkillTargetChosenCardsFilter) - { - targetFilter = ConditionFilterCollection.TargetFilter; - ConditionFilterCollection.TargetFilter = new SkillTargetSelfFilter(SkillPrm.ownerCard); - cardFilter = ConditionFilterCollection.CardFilterList.ToList(); - ConditionFilterCollection.CardFilterList.Clear(); - flag = true; - } - bool result = _executionInfoCreator.CheckCondition(playerInfoPair, option, isPrePlay); - if (flag) - { - ConditionFilterCollection.TargetFilter = targetFilter; - ConditionFilterCollection.SetCardFilter(cardFilter); - } - return result; - } - public virtual void SetEventAfterReplace(BattleCardBase card, BuffInfo buff) { } @@ -2041,7 +1902,7 @@ public abstract class SkillBase protected void CallOnUpdateSkillEffect(List targetCards, bool updateAttackEffect = false) { - if (GameMgr.GetIns().IsNetworkBattle) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsNetworkBattle) { SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnUpdateSkillEffect(targetCards, updateAttackEffect); } diff --git a/SVSim.BattleEngine/Engine/SkillBaseCopy.cs b/SVSim.BattleEngine/Engine/SkillBaseCopy.cs index c26dd25e..b369f5f6 100644 --- a/SVSim.BattleEngine/Engine/SkillBaseCopy.cs +++ b/SVSim.BattleEngine/Engine/SkillBaseCopy.cs @@ -11,8 +11,6 @@ public abstract class SkillBaseCopy : SkillBase public List CopiedSkillList { get; private set; } = new List(); - public bool IsNeedDetail => IsSkillTypeNeedDetail(SkillType); - public SkillBaseCopy(SkillParameter skillPrm, string option) : base(skillPrm, option) { @@ -274,20 +272,6 @@ public abstract class SkillBaseCopy : SkillBase } } - private static bool IsSkillTypeNeedDetail(string skillType) - { - switch (skillType) - { - case "quick": - case "rush": - case "killer": - case "drain": - return true; - default: - return false; - } - } - public override VfxWithLoading Stop(SkillProcessor skillProcessor) { return NullVfxWithLoading.GetInstance(); diff --git a/SVSim.BattleEngine/Engine/SkillBaseSummon.cs b/SVSim.BattleEngine/Engine/SkillBaseSummon.cs index e945a97b..a6ff06a5 100644 --- a/SVSim.BattleEngine/Engine/SkillBaseSummon.cs +++ b/SVSim.BattleEngine/Engine/SkillBaseSummon.cs @@ -112,14 +112,6 @@ public abstract class SkillBaseSummon : SkillBase } } - public const string OPTION_SUMMONSIDE_NULL = "null"; - - protected const string OPTION_FALSE = "false"; - - protected const string OPTION_TRUE = "true"; - - protected const string OPTION_EVO_VOICE = "evo_voice"; - protected bool _isIgnoreVoice; protected bool _isRandomVoice; @@ -183,17 +175,17 @@ public abstract class SkillBaseSummon : SkillBase private BattleCardBase CreateSummonedToken(bool isPlayer, int tokenId, bool isGetoff = false, bool isCopy = false, int copyIndex = -1) { - if (GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsAINetwork && !BattleManagerBase.IsForecast) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsNetworkBattle && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork && !base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { NetworkBattleDefine.NetworkCardPlaceState placeStatus = (isGetoff ? NetworkBattleDefine.NetworkCardPlaceState.Riding : NetworkBattleDefine.NetworkCardPlaceState.Field); - return BattleManagerBase.GetIns().CreateBattleCardWithGameObject(new BattleManagerBase.CardCreateInfo(tokenId, isPlayer, base.ApplyingTargetFilter is SkillTargetChosenCardsFilter, placeStatus, isReferenceOpponentCard: false, this), new BattleManagerBase.IndexInfo(-1, -1, isCopy, copyIndex)); + return SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.CreateBattleCardWithGameObject(new BattleManagerBase.CardCreateInfo(tokenId, isPlayer, base.ApplyingTargetFilter is SkillTargetChosenCardsFilter, placeStatus, isReferenceOpponentCard: false, this), new BattleManagerBase.IndexInfo(-1, -1, isCopy, copyIndex)); } return ((base.SkillPrm.selfBattlePlayer.IsPlayer == isPlayer) ? base.SkillPrm.selfBattlePlayer : base.SkillPrm.opponentBattlePlayer).CreateNextIndexCard(tokenId); } private BattleCardBase CreateDummyToken(bool isPlayer, int tokenId) { - return CardCreatorBase.CreateCard(tokenId, isPlayer, 0, BattleManagerBase.GetIns().SBattleLoad, BattleManagerBase.GetIns(), BattleManagerBase.GetIns().BattleResourceMgr, NullInnerOptionsBuilder.GetInstance()); + return CardCreatorBase.CreateCard(tokenId, isPlayer, 0, SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.SBattleLoad, SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr, SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.BattleResourceMgr, NullInnerOptionsBuilder.GetInstance()); } protected virtual VfxWithLoading CreateSummonCardAnimation(bool isPlayer, SummonedCardsList summonedCardsList, bool isOwnerEffect = false) diff --git a/SVSim.BattleEngine/Engine/SkillBothClanFilter.cs b/SVSim.BattleEngine/Engine/SkillBothClanFilter.cs index 1c5852aa..365deedf 100644 --- a/SVSim.BattleEngine/Engine/SkillBothClanFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillBothClanFilter.cs @@ -26,6 +26,6 @@ public class SkillBothClanFilter : ISkillCardFilter { return enumerable; } - return cards.Where((IReadOnlyBattleCardInfo c) => _compareFunc(c.IsPlayer ? GameMgr.GetIns().GetDataMgr().GetPlayerSubClassId() : GameMgr.GetIns().GetDataMgr().GetEnemySubClassId(), (int)_clan, c, cards)); + return cards.Where((IReadOnlyBattleCardInfo c) => _compareFunc(c.IsPlayer ? c.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().GetPlayerSubClassId() : c.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().GetEnemySubClassId(), (int)_clan, c, cards)); } } diff --git a/SVSim.BattleEngine/Engine/SkillCardTurnDestroyedFilter.cs b/SVSim.BattleEngine/Engine/SkillCardTurnDestroyedFilter.cs index b19b3594..b563f8d0 100644 --- a/SVSim.BattleEngine/Engine/SkillCardTurnDestroyedFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillCardTurnDestroyedFilter.cs @@ -15,6 +15,6 @@ public class SkillCardTurnDestroyedFilter : ISkillCardFilter public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option) { - return BattleManagerBase.GetIns().GetBattlePlayer(_ownerCard.IsPlayer).GetSpecificTurnDestroyCards(_turnPlayerInfo); + return _ownerCard.SelfBattlePlayer.BattleMgr.GetBattlePlayer(_ownerCard.IsPlayer).GetSpecificTurnDestroyCards(_turnPlayerInfo); } } diff --git a/SVSim.BattleEngine/Engine/SkillCollectionBase.cs b/SVSim.BattleEngine/Engine/SkillCollectionBase.cs index bdce405d..60e3fd2d 100644 --- a/SVSim.BattleEngine/Engine/SkillCollectionBase.cs +++ b/SVSim.BattleEngine/Engine/SkillCollectionBase.cs @@ -86,11 +86,6 @@ public class SkillCollectionBase : IEnumerable, IEnumerable return _skillList.IndexOf(skill); } - public int FindIndex() - { - return _skillList.FindIndex((SkillBase s) => s is T); - } - IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); @@ -330,7 +325,7 @@ public class SkillCollectionBase : IEnumerable, IEnumerable { if (processInfo == null && destroyCard.SelfBattlePlayer.Class.SkillApplyInformation.RepeatSkillTimingList.Any((RepeatSkillInfo s) => s.Timing == "when_destroy" && Skill_repeat_skill.CheckCardType(s.Target, destroyCard))) { - vfx = new RepeatSkillEffectVfx(destroyCard.SelfBattlePlayer.Class.BattleCardView, "when_destroy", destroyCard.IsPlayer); + vfx = new RepeatSkillEffectVfx(destroyCard.SelfBattlePlayer.BattleMgr, destroyCard.SelfBattlePlayer.Class.BattleCardView, "when_destroy", destroyCard.IsPlayer); } AllStopRepeatSkill(destroyCard, destroyCard.SelfBattlePlayer, "when_destroy", processInfo != null, skillProcessor); } @@ -676,12 +671,6 @@ public class SkillCollectionBase : IEnumerable, IEnumerable return CreateProcessInfo((SkillBase s) => s.OnWhenAddToDeckStart, skillProcessor, playerInfoPair, checkerOption); } - public SkillProcessor.ProcessInfo CreateWhenEnhance(SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair) - { - SkillConditionCheckerOption checkerOption = new SkillConditionCheckerOption(); - return CreateProcessInfo((SkillBase s) => s.OnWhenEnhanceStart, skillProcessor, playerInfoPair, checkerOption); - } - public SkillProcessor.ProcessInfo CreateWhenBurialRiteOther(BattleCardBase burialRiteCard, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair) { SkillConditionCheckerOption skillConditionCheckerOption = new SkillConditionCheckerOption(); @@ -946,14 +935,14 @@ public class SkillCollectionBase : IEnumerable, IEnumerable return; } List deckSkills = activeSkills.Where((SkillBase c) => c.ConditionTargetFilter is SkillTargetDeckSelfFilter).ToList(); - bool flag = GameMgr.GetIns().IsUseUnapprovedList(playerInfoPair.ReadOnlySelf.IsPlayer); + bool flag = _ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsUseUnapprovedList(playerInfoPair.ReadOnlySelf.IsPlayer); if (deckSkills.Any((SkillBase s) => s is Skill_summon_card || s.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessTimesPerTurn && (p as SkillPreprocessTimesPerTurn).IsSameBaseCardId))) { DistinctDeckActiveSkillCards(flag, activeSkills, deckSkills, skillProcessor, playerInfoPair, checkerOption); } else if (flag) { - List receiveCardList = (BattleManagerBase.GetIns() as NetworkBattleManagerBase).networkBattleData.GetReceiveData().GetReceiveCardList(); + List receiveCardList = (_ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData().GetReceiveCardList(); if (receiveCardList != null && !receiveCardList.Where((CardDataModel c) => c.fromState == NetworkBattleDefine.NetworkCardPlaceState.Deck).Any((CardDataModel i) => i.Index == _ownerCard.Index)) { activeSkills.RemoveAll((SkillBase s) => deckSkills.Contains(s)); @@ -969,14 +958,14 @@ public class SkillCollectionBase : IEnumerable, IEnumerable { if (isUseUnapprovedList) { - NetworkBattleManagerBase battleMgr = BattleManagerBase.GetIns() as NetworkBattleManagerBase; + NetworkBattleManagerBase battleMgr = _ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase; NetworkBattleReceiver.ReceiveData receiveData = battleMgr.networkBattleData.GetReceiveData(); bool isCheckHand = deckSkills.Any((SkillBase s) => s is Skill_draw); List isOpenIndexList = (from c in receiveData.GetReceiveCardList() where c.IsOpen select c.Index).ToList(); List list = (from c in receiveData.unapprovedList - where (c.fromState == NetworkBattleDefine.NetworkCardPlaceState.Deck || (c.fromState == NetworkBattleDefine.NetworkCardPlaceState.None && (GameMgr.GetIns().IsWatchBattle || battleMgr.IsRecovery))) && c.ToStateList.Count > 0 && (c.ToStateList[0] == NetworkBattleDefine.NetworkCardPlaceState.Field || (isCheckHand && c.ToStateList[0] == NetworkBattleDefine.NetworkCardPlaceState.Hand && isOpenIndexList.Contains(c.Index))) + where (c.fromState == NetworkBattleDefine.NetworkCardPlaceState.Deck || (c.fromState == NetworkBattleDefine.NetworkCardPlaceState.None && (_ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsWatchBattle || battleMgr.IsRecovery))) && c.ToStateList.Count > 0 && (c.ToStateList[0] == NetworkBattleDefine.NetworkCardPlaceState.Field || (isCheckHand && c.ToStateList[0] == NetworkBattleDefine.NetworkCardPlaceState.Hand && isOpenIndexList.Contains(c.Index))) where c.Index == c.skillCardIndex select c).ToList(); CardDataModel cardDataModel = list.FirstOrDefault((CardDataModel i) => i.Index == _ownerCard.Index); @@ -1132,21 +1121,21 @@ public class SkillCollectionBase : IEnumerable, IEnumerable ActiveSkillWhenPlayEffectInfo activeSkillWhenPlayEffectInfo = list3.Find((ActiveSkillWhenPlayEffectInfo e) => e.Index == i); if (activeSkillWhenPlayEffectInfo != null && !_ownerCard.SelfBattlePlayer.BattleMgr.IsBattleEnd) { - if (!BattleManagerBase.GetIns().IsRecovery) + if (!_ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { switch (activeSkillWhenPlayEffectInfo.Type) { case WhenPlayEffectType.Berserk: - sequentialVfxPlayer.Register(new BerserkSkillActivationVfx(activeSkillWhenPlayEffectInfo.OwnerCard.BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); break; case WhenPlayEffectType.Awake: - sequentialVfxPlayer.Register(new AwakeSkillActivationVfx(activeSkillWhenPlayEffectInfo.OwnerCard.BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); break; case WhenPlayEffectType.WhenPlay: - sequentialVfxPlayer.Register(new WhenPlaySkillActivationVfx(activeSkillWhenPlayEffectInfo.OwnerCard.BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); break; case WhenPlayEffectType.WhenDestroy: - sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_card_destroy_3", "se_cmn_card_destroy_3", activeSkillWhenPlayEffectInfo.OwnerCard.BattleCardView.Transform, 0f)); + sequentialVfxPlayer.Register(VfxWithLoadingSequential.Create()); break; } } @@ -1154,7 +1143,7 @@ public class SkillCollectionBase : IEnumerable, IEnumerable } if (flag && num2 == 1 && !_ownerCard.SelfBattlePlayer.BattleMgr.IsBattleEnd) { - sequentialVfxPlayer.Register(new RepeatSkillEffectVfx(skillBase.SkillPrm.ownerCard.SelfBattlePlayer.Class.BattleCardView, "when_destroy", skillBase.SkillPrm.ownerCard.IsPlayer)); + sequentialVfxPlayer.Register(new RepeatSkillEffectVfx(skillBase.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr, skillBase.SkillPrm.ownerCard.SelfBattlePlayer.Class.BattleCardView, "when_destroy", skillBase.SkillPrm.ownerCard.IsPlayer)); } sequentialVfxPlayer.Register(skillBase.CallStart(skillProcessor, playerInfoPair, flag ? skillConditionCheckerOption2 : checkerOption, callParameter, SkillProcessor.ProcessCallType.Start, list2.Contains(i))); if (skillBase is Skill_invoke_skill skill_invoke_skill) @@ -1177,7 +1166,7 @@ public class SkillCollectionBase : IEnumerable, IEnumerable SkillBase skillBase2 = skill_invoke_skill.NotInsertSkillList.FirstOrDefault((SkillBase s) => s.IsWhenDestroySkill); if (skillBase2 != null) { - sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_card_destroy_3", "se_cmn_card_destroy_3", skillBase2.SkillPrm.ownerCard.BattleCardView.Transform, 0f)); + sequentialVfxPlayer.Register(VfxWithLoadingSequential.Create()); } } list = IfNeededRepeatSkills(skill_invoke_skill.InsertSkillList, skillProcessor); @@ -1190,7 +1179,7 @@ public class SkillCollectionBase : IEnumerable, IEnumerable list = IfNeededRepeatSkills(skill_invoke_skill.NotInsertSkillList, skillProcessor); if (list != null && !_ownerCard.SelfBattlePlayer.BattleMgr.IsBattleEnd) { - sequentialVfxPlayer.Register(new RepeatSkillEffectVfx(skillBase.SkillPrm.ownerCard.SelfBattlePlayer.Class.BattleCardView, "when_destroy", skillBase.SkillPrm.ownerCard.IsPlayer)); + sequentialVfxPlayer.Register(new RepeatSkillEffectVfx(skillBase.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr, skillBase.SkillPrm.ownerCard.SelfBattlePlayer.Class.BattleCardView, "when_destroy", skillBase.SkillPrm.ownerCard.IsPlayer)); } } list3.AddRange(list4); diff --git a/SVSim.BattleEngine/Engine/SkillConditionHealingCardIsClass.cs b/SVSim.BattleEngine/Engine/SkillConditionHealingCardIsClass.cs deleted file mode 100644 index 9cefb13f..00000000 --- a/SVSim.BattleEngine/Engine/SkillConditionHealingCardIsClass.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Linq; -using Wizard; -using Wizard.Battle; - -public class SkillConditionHealingCardIsClass : ISkillConditionChecker -{ - private BattleCardBase _ownerCard; - - private bool _isSelf; - - public SkillConditionHealingCardIsClass(BattleCardBase ownerCard, bool isSelf) - { - _ownerCard = ownerCard; - _isSelf = isSelf; - } - - public bool IsRight(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool PreexecutionCheck = false) - { - if (!_isSelf) - { - return playerInfoPair.ReadOnlyOpponent.SkillInfoHealingCards.Any((IReadOnlyBattleCardInfo c) => c == _ownerCard.OpponentBattlePlayer.Class); - } - return playerInfoPair.ReadOnlySelf.SkillInfoHealingCards.Any((IReadOnlyBattleCardInfo c) => c == _ownerCard.SelfBattlePlayer.Class); - } - - public bool IsRightPrePlay(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool PreexecutionCheck = false) - { - return IsRight(playerInfoPair, option); - } -} diff --git a/SVSim.BattleEngine/Engine/SkillConditionPlayCount.cs b/SVSim.BattleEngine/Engine/SkillConditionPlayCount.cs index 08fa06df..7b66e305 100644 --- a/SVSim.BattleEngine/Engine/SkillConditionPlayCount.cs +++ b/SVSim.BattleEngine/Engine/SkillConditionPlayCount.cs @@ -22,9 +22,4 @@ public class SkillConditionPlayCount : ISkillConditionChecker { return _compareFunc(playerInfoPair.ReadOnlySelf.GetCurrentTurnPlayCount(), _count - 1); } - - public int GetCount() - { - return _count; - } } diff --git a/SVSim.BattleEngine/Engine/SkillCostNoDuplicationRandomSelectFilter.cs b/SVSim.BattleEngine/Engine/SkillCostNoDuplicationRandomSelectFilter.cs index 27230418..7f256091 100644 --- a/SVSim.BattleEngine/Engine/SkillCostNoDuplicationRandomSelectFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillCostNoDuplicationRandomSelectFilter.cs @@ -23,13 +23,13 @@ public class SkillCostNoDuplicationRandomSelectFilter : ISkillSelectFilter _count = CalcCount(option); cards = cards.OrderBy((BattleCardBase x) => x.Index); List cardList = cards.ToList(); - BattleManagerBase battleMgr = BattleManagerBase.GetIns(); + BattleManagerBase battleMgr = cardList.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; _count = Math.Min(_count, cardList.Count); for (int i = 0; i < _count; i++) { if (cardList.Count > 0) { - int index = (BattleManagerBase.IsRandomDraw ? battleMgr.StableRandom(cardList.Count) : 0); + int index = (battleMgr.InstanceIsRandomDraw ? battleMgr.StableRandom(cardList.Count) : 0); BattleCardBase card = cardList[index]; cardList = cardList.Where((BattleCardBase c) => c.Card.Cost != card.Cost).ToList(); yield return card; diff --git a/SVSim.BattleEngine/Engine/SkillCreator.cs b/SVSim.BattleEngine/Engine/SkillCreator.cs index 0ac17619..db6d825b 100644 --- a/SVSim.BattleEngine/Engine/SkillCreator.cs +++ b/SVSim.BattleEngine/Engine/SkillCreator.cs @@ -121,8 +121,6 @@ public class SkillCreator protected readonly IBattleResourceMgr _battleResourceMgr; - private const string PARSE_CONTENTINFO_PATTERN = "\\(.+?\\)"; - public SkillCreator(BattleCardBase ownerCard, BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr battleResourceMgr) { _ownerCard = ownerCard; @@ -134,7 +132,7 @@ public class SkillCreator private SkillBase CreateSkillFactory(string skillName, SkillBuildInfo buildInfo, SkillParameter skillParam) { SkillKeywordInfo.SkillKeyword keyword = SkillKeywordInfo.GetKeyword(skillName); - bool flag = skillParam.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !GameMgr.GetIns().IsAINetwork; + bool flag = skillParam.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !skillParam.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork; switch (keyword) { case SkillKeywordInfo.SkillKeyword.damage_modifier: @@ -1283,7 +1281,7 @@ public class SkillCreator conditionFilterCollection.CardFilterList.Add(new SkillTargetNotUniqueBaseCardIdFilter()); break; case SkillFilterCreator.ContentKeyword.attacked: - if (BattleManagerBase.GetIns() is SingleBattleMgr) + if (ownerCard.SelfBattlePlayer.BattleMgr is SingleBattleMgr) { conditionFilterCollection.CardFilterList.Add(new SkillAttackedCardFilter(info.ValueStr)); } @@ -1344,7 +1342,7 @@ public class SkillCreator private static ISkillTargetFilter CreateTargetFilterOld(SkillFilterCreator.ContentInfo info, SkillFilterCreator.ContentKeyword keyword, BattleCardBase ownerCard, SkillBase skill) { - bool flag = BattleManagerBase.GetIns() is NetworkBattleManagerBase && !GameMgr.GetIns().IsAINetwork; + bool flag = ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork; switch (keyword) { case SkillFilterCreator.ContentKeyword.inplay: @@ -1579,16 +1577,6 @@ public class SkillCreator }; } - private static ISkillConditionChecker CreateHealingCardChecker(SkillFilterCreator.ContentKeyword keyword, BattleCardBase ownerCard) - { - return keyword switch - { - SkillFilterCreator.ContentKeyword.self_class => new SkillConditionHealingCardIsClass(ownerCard, isSelf: true), - SkillFilterCreator.ContentKeyword.opp_class => new SkillConditionHealingCardIsClass(ownerCard, isSelf: false), - _ => null, - }; - } - private static ISkillConditionChecker CreateInHandChecker(SkillFilterCreator.ContentKeyword keyword, BattleCardBase ownerCard) { return keyword switch @@ -1793,7 +1781,7 @@ public class SkillCreator filterCollection.CardFilterList.Add(new SkillTargetNotUniqueBaseCardIdFilter()); break; case SkillFilterCreator.ContentKeyword.attacked: - if (BattleManagerBase.GetIns() is SingleBattleMgr) + if (ownerCard.SelfBattlePlayer.BattleMgr is SingleBattleMgr) { filterCollection.CardFilterList.Add(new SkillAttackedCardFilter(info.ValueStr)); } @@ -1816,7 +1804,7 @@ public class SkillCreator protected virtual ISkillSelectFilter CreateRandomSelectUntilFilter(string count, BattlePlayerBase player, SkillBase skill) { - if (!(BattleManagerBase.GetIns() is NetworkBattleManagerBase) || GameMgr.GetIns().IsAINetwork) + if (!(skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase) || skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork) { return new SkillRandomSelectUntilFilter(count, player); } @@ -1840,7 +1828,7 @@ public class SkillCreator protected virtual ISkillSelectFilter CreateSkillRandomEachSameBaseCardIdFilter(int count, BattlePlayerBase player, SkillBase skill) { - if (!(BattleManagerBase.GetIns() is NetworkBattleManagerBase) || GameMgr.GetIns().IsAINetwork) + if (!(skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase) || skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork) { return new SkillRandomEachSameBaseCardIdFilter(count, player); } @@ -1858,7 +1846,7 @@ public class SkillCreator private static SkillPreprocessBase MakeSkillPreprocess(SkillBase skill, SkillFilterCreator.ContentInfo info, ref bool isExecutionCheck, ref bool isReferencePreviousPreprocess) { - bool flag = BattleManagerBase.GetIns() is NetworkBattleManagerBase && !GameMgr.GetIns().IsAINetwork; + bool flag = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork; SkillPreprocessBase skillPreprocessBase = null; switch (info.Name) { diff --git a/SVSim.BattleEngine/Engine/SkillEnvironmentalCharaIdFilter.cs b/SVSim.BattleEngine/Engine/SkillEnvironmentalCharaIdFilter.cs index 21f12b8a..76a6711d 100644 --- a/SVSim.BattleEngine/Engine/SkillEnvironmentalCharaIdFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillEnvironmentalCharaIdFilter.cs @@ -2,7 +2,7 @@ public class SkillEnvironmentalCharaIdFilter : ISkillEnvironmentalFilter { public int Filtering(IBattlePlayerReadOnlyInfo playerInfo, SkillConditionCheckerOption option) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr if (!playerInfo.IsPlayer) { return dataMgr.GetEnemyCharaId(); diff --git a/SVSim.BattleEngine/Engine/SkillEnvironmentalGamePlayCountFilter.cs b/SVSim.BattleEngine/Engine/SkillEnvironmentalGamePlayCountFilter.cs index f2a53899..28935192 100644 --- a/SVSim.BattleEngine/Engine/SkillEnvironmentalGamePlayCountFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillEnvironmentalGamePlayCountFilter.cs @@ -4,7 +4,6 @@ public class SkillEnvironmentalGamePlayCountFilter : ISkillEnvironmentalFilter { public int Filtering(IBattlePlayerReadOnlyInfo playerInfo, SkillConditionCheckerOption option) { - BattleManagerBase.GetIns(); return playerInfo.TurnPlayCardCountInfo.Where((TurnAndIntValue c) => c.IsSelfTurn == playerInfo.IsPlayer).Sum((TurnAndIntValue c) => c.Value); } diff --git a/SVSim.BattleEngine/Engine/SkillFilterCollectionBase.cs b/SVSim.BattleEngine/Engine/SkillFilterCollectionBase.cs index 935e117f..25dd8e7c 100644 --- a/SVSim.BattleEngine/Engine/SkillFilterCollectionBase.cs +++ b/SVSim.BattleEngine/Engine/SkillFilterCollectionBase.cs @@ -5,7 +5,6 @@ using Wizard.Battle; public class SkillFilterCollectionBase { - private const int CAP_CARDFILTER = 6; private bool _isSkipPrivateCardCheck; @@ -17,11 +16,6 @@ public class SkillFilterCollectionBase public ISkillSelectFilter SelectFilter { get; set; } - public void SetCardFilter(List list) - { - CardFilterList = list; - } - protected bool IsPrivateCard(BattlePlayerReadOnlyInfoPair playerInfoPair, IEnumerable cardInfos, SkillConditionCheckerOption checkerOption) { if (_isSkipPrivateCardCheck) @@ -56,7 +50,8 @@ public class SkillFilterCollectionBase { return false; } - if (BattleManagerBase.GetIns().XorShiftRandom(isSelf: true) != null && BattleManagerBase.GetIns().XorShiftRandom(isSelf: false) == null) + BattleManagerBase _mgr = cardInfos.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; + if (_mgr != null && _mgr.XorShiftRandom(isSelf: true) != null && _mgr.XorShiftRandom(isSelf: false) == null) { if (!cardInfos.All((IReadOnlyBattleCardInfo s) => (s.IsInHand && (checkerOption.LeftCards == null || checkerOption.LeftCards.IndexOf(s) == -1)) || s.IsInDeck)) { diff --git a/SVSim.BattleEngine/Engine/SkillFilterCreator.cs b/SVSim.BattleEngine/Engine/SkillFilterCreator.cs index 78c8506e..31849ea8 100644 --- a/SVSim.BattleEngine/Engine/SkillFilterCreator.cs +++ b/SVSim.BattleEngine/Engine/SkillFilterCreator.cs @@ -165,7 +165,6 @@ public static class SkillFilterCreator set_damage, add_healing, set_healing, - gain_ep, set_ep, cut_amount, cut_clipping, @@ -247,10 +246,6 @@ public static class SkillFilterCreator before_transform_token_draw, after_transform_token_draw, metamorphose, - behavior_option, - target_option, - copy, - transform, card_id, healing, skill, @@ -436,7 +431,6 @@ public static class SkillFilterCreator quick, drain, white_ritual, - white_ritual_all, destroy_white_ritual, when_attack, when_destroy, @@ -461,8 +455,6 @@ public static class SkillFilterCreator equal_or_less_cost_from_last_target, other, duplication, - self_class, - opp_class, repeat_type, invoke_type, is_allow_destroy_target, @@ -493,12 +485,10 @@ public static class SkillFilterCreator reset_random_distinct_by, except_fusion_card_id, except_game_play_card_id, - is_remain, include_self, is_individual, is_activate_summon_card, show_battle_log, - show_exclution_battle_log, only_random_index, shortage_deck_lose, game_used_ep_count, @@ -507,8 +497,6 @@ public static class SkillFilterCreator skill_drew_card_list, distinct_base_card_and_random_index, activated_random_array, - each, - each_value, preprocess_condition, skill_stop_and_remove_by_when_summon_other, option, @@ -532,7 +520,6 @@ public static class SkillFilterCreator not_unique_base_card_id_card, each_same_base_card_id_count_until, induction, - mission_info, quest_stage_id, turn_start_life, is_chaos, @@ -1074,7 +1061,7 @@ public static class SkillFilterCreator filterCollection.CardCountFilter = CreateSetCountFilter(retParsedInfo.Name); continue; } - SkillCardLimitUpperCountFilter skillCardLimitUpperCountFilter = BattleManagerBase.GetIns().CheackCalledCreateFilterDictionary(ownerCard, text2, retParsedInfo.ValueStr); + SkillCardLimitUpperCountFilter skillCardLimitUpperCountFilter = ownerCard.SelfBattlePlayer.BattleMgr.CheackCalledCreateFilterDictionary(ownerCard, text2, retParsedInfo.ValueStr); if (skillCardLimitUpperCountFilter != null) { filterCollection.CardCountExtensionsFilter = skillCardLimitUpperCountFilter; @@ -1095,7 +1082,7 @@ public static class SkillFilterCreator filterCollection.CalcFilter = CreateCalcSelectFilter(retParsedInfo.Name); continue; } - SkillOrFilter skillOrFilter = BattleManagerBase.GetIns().CheackCalledCreateOrFilterDictionary(ownerCard, text2, retParsedInfo.ValueStr); + SkillOrFilter skillOrFilter = ownerCard.SelfBattlePlayer.BattleMgr.CheackCalledCreateOrFilterDictionary(ownerCard, text2, retParsedInfo.ValueStr); if (skillOrFilter != null) { filterCollection.OrFilter = skillOrFilter; @@ -1258,7 +1245,7 @@ public static class SkillFilterCreator public static List SetupCommon(SkillFilterCollectionBase filterCollection, IEnumerable partTexts, IReadOnlyBattleCardInfo ownerCard, SkillBase skill) { - BattleManagerBase.GetIns().RemoveUnUseCalledFilterDictionary(); + ownerCard.SelfBattlePlayer.BattleMgr.RemoveUnUseCalledFilterDictionary(); List list = null; foreach (string partText in partTexts) { @@ -1297,7 +1284,7 @@ public static class SkillFilterCreator filterCollection.SelectFilter = CreateCardSelectFilter(partText); continue; } - ISkillCardFilter skillCardFilter = BattleManagerBase.GetIns().CheackCalledCreateSkillCardFilterDictionary(ownerCard, partText, null); + ISkillCardFilter skillCardFilter = ownerCard.SelfBattlePlayer.BattleMgr.CheackCalledCreateSkillCardFilterDictionary(ownerCard, partText, null); if (skillCardFilter != null) { filterCollection.CardFilterList.Add(skillCardFilter); @@ -1330,7 +1317,7 @@ public static class SkillFilterCreator public static ISkillTargetFilter CreatePlayerTargetFilter(ContentInfo info, ContentKeyword keyword, IReadOnlyBattleCardInfo ownerCard, SkillBase skill) { - bool flag = BattleManagerBase.GetIns() is NetworkBattleManagerBase && !GameMgr.GetIns().IsAINetwork; + bool flag = ownerCard.SelfBattlePlayer.BattleMgr is NetworkBattleManagerBase && !ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork; switch (keyword) { case ContentKeyword.inplay: @@ -1608,7 +1595,7 @@ public static class SkillFilterCreator { List list = new List(); CardBasePrm.ClanType clan = ownerCard.SelfBattlePlayer.Class.Clan; - CardBasePrm.ClanType item = (CardBasePrm.ClanType)(ownerCard.SelfBattlePlayer.Class.IsPlayer ? GameMgr.GetIns().GetDataMgr().GetPlayerSubClassId() : GameMgr.GetIns().GetDataMgr().GetEnemySubClassId()); + CardBasePrm.ClanType item = (CardBasePrm.ClanType)(ownerCard.SelfBattlePlayer.Class.IsPlayer ? ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().GetPlayerSubClassId() : ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().GetEnemySubClassId()); list.Add(CardBasePrm.ClanType.ALL); list.Add(clan); list.Add(item); @@ -1691,7 +1678,7 @@ public static class SkillFilterCreator case ContentKeyword.last_burial_rite_card_list: return new SkillLastBurialRiteCardFilter(); case ContentKeyword.attacked: - if (BattleManagerBase.GetIns() is SingleBattleMgr) + if (ownerCard.SelfBattlePlayer.BattleMgr is SingleBattleMgr) { return new SkillAttackedCardFilter(retParsedInfo.ValueStr); } diff --git a/SVSim.BattleEngine/Engine/SkillIdNoDuplicationRandomSelectFilter.cs b/SVSim.BattleEngine/Engine/SkillIdNoDuplicationRandomSelectFilter.cs index 51005893..db987f38 100644 --- a/SVSim.BattleEngine/Engine/SkillIdNoDuplicationRandomSelectFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillIdNoDuplicationRandomSelectFilter.cs @@ -8,8 +8,6 @@ public class SkillIdNoDuplicationRandomSelectFilter : ISkillSelectFilter private int _count; - public int Count => _count; - public SkillIdNoDuplicationRandomSelectFilter(string randomCountText) { _context = randomCountText; @@ -25,13 +23,13 @@ public class SkillIdNoDuplicationRandomSelectFilter : ISkillSelectFilter _count = CalcCount(option); cards = cards.OrderBy((BattleCardBase x) => x.Index); List cardList = cards.ToList(); - BattleManagerBase battleMgr = BattleManagerBase.GetIns(); + BattleManagerBase battleMgr = cardList.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; _count = Math.Min(_count, cardList.Count); for (int i = 0; i < _count; i++) { if (cardList.Count > 0) { - int index = (BattleManagerBase.IsRandomDraw ? battleMgr.StableRandom(cardList.Count) : 0); + int index = (battleMgr.InstanceIsRandomDraw ? battleMgr.StableRandom(cardList.Count) : 0); BattleCardBase card = cardList[index]; cardList = cardList.Where((BattleCardBase c) => c.Card.BaseParameter.BaseCardId != card.BaseParameter.BaseCardId).ToList(); yield return card; @@ -39,25 +37,6 @@ public class SkillIdNoDuplicationRandomSelectFilter : ISkillSelectFilter } } - public static IEnumerable Filtering(int selectCount, IEnumerable cards, BattleManagerBase battleMgr) - { - cards = cards.OrderBy((BattleCardBase x) => x.Index); - List list = cards.ToList(); - List list2 = new List(); - int num = Math.Min(selectCount, list.Count); - for (int num2 = 0; num2 < num; num2++) - { - if (list.Count > 0) - { - int index = battleMgr.StableRandom(list.Count); - BattleCardBase card = list[index]; - list = list.Where((BattleCardBase c) => c.Card.BaseParameter.BaseCardId != card.BaseParameter.BaseCardId).ToList(); - list2.Add(card); - } - } - return list2; - } - public bool IsUpperLimit() { return _context == "5-{me.inplay.unit_and_allfield.count}"; diff --git a/SVSim.BattleEngine/Engine/SkillInOrderFromOldestFilter.cs b/SVSim.BattleEngine/Engine/SkillInOrderFromOldestFilter.cs index 64d95863..d90c2fa5 100644 --- a/SVSim.BattleEngine/Engine/SkillInOrderFromOldestFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillInOrderFromOldestFilter.cs @@ -4,7 +4,6 @@ using Wizard.Battle; public class SkillInOrderFromOldestFilter : ISkillCustomSelectFilter { - private int _count; public List OldTargets { get; private set; } diff --git a/SVSim.BattleEngine/Engine/SkillIsOwnerFilter.cs b/SVSim.BattleEngine/Engine/SkillIsOwnerFilter.cs index 27c96268..0d964adc 100644 --- a/SVSim.BattleEngine/Engine/SkillIsOwnerFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillIsOwnerFilter.cs @@ -13,7 +13,9 @@ public class SkillIsOwnerFilter : ISkillCardFilter public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option) { List list = new List(); - bool isAdminWatch = GameMgr.GetIns().IsAdminWatch; + // IsAdminWatch is const-false in headless (Phase 4) — the guard collapses to + // `card.IsPlayer == _isOwner`. Preserved the local for readability. + bool isAdminWatch = false; foreach (IReadOnlyBattleCardInfo card in cards) { if (card.IsPlayer == _isOwner || isAdminWatch) diff --git a/SVSim.BattleEngine/Engine/SkillIsWatchFilter.cs b/SVSim.BattleEngine/Engine/SkillIsWatchFilter.cs index 0e06206a..3a5c9abe 100644 --- a/SVSim.BattleEngine/Engine/SkillIsWatchFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillIsWatchFilter.cs @@ -7,7 +7,9 @@ public class SkillIsWatchFilter : ISkillCardFilter public SkillIsWatchFilter(bool flag) { - _isWatchOk = (GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle) == flag; + // IsWatchBattle and IsReplayBattle are both const-false in headless (Phase 4). + // `(false && !false) == flag` collapses to `false == flag`, i.e. `!flag`. + _isWatchOk = !flag; } public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option) diff --git a/SVSim.BattleEngine/Engine/SkillLeaderSkinIdFilter.cs b/SVSim.BattleEngine/Engine/SkillLeaderSkinIdFilter.cs index c1e3b6c6..df0564b1 100644 --- a/SVSim.BattleEngine/Engine/SkillLeaderSkinIdFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillLeaderSkinIdFilter.cs @@ -17,7 +17,8 @@ public class SkillLeaderSkinIdFilter : ISkillCardFilter public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option) { List list = new List(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = cards.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr?.GameMgr?.GetDataMgr(); + if (dataMgr == null) return list; for (int i = 0; i < cards.Count(); i++) { IReadOnlyBattleCardInfo readOnlyBattleCardInfo = cards.ElementAt(i); diff --git a/SVSim.BattleEngine/Engine/SkillNoDuplicationRandomSelectInOrderFilter.cs b/SVSim.BattleEngine/Engine/SkillNoDuplicationRandomSelectInOrderFilter.cs index 2cd41af1..944f46cd 100644 --- a/SVSim.BattleEngine/Engine/SkillNoDuplicationRandomSelectInOrderFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillNoDuplicationRandomSelectInOrderFilter.cs @@ -43,7 +43,7 @@ public class SkillNoDuplicationRandomSelectInOrderFilter : ISkillSelectFilter { int num = CalcCount(option); List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = list.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; cards = cards.OrderBy((BattleCardBase x) => x.Index); List list2 = cards.ToList(); bool flag = list.Count < num; @@ -53,7 +53,7 @@ public class SkillNoDuplicationRandomSelectInOrderFilter : ISkillSelectFilter List list3 = list2.Where((BattleCardBase card) => _sortFilter.Filtering(new BattleCardBase[1] { card }).FirstOrDefault() == LotteringValue).ToList(); while (flag && list3.Count > 0) { - int index = (BattleManagerBase.IsRandomDraw ? ins.StableRandom(list3.Count()) : 0); + int index = (ins.InstanceIsRandomDraw ? ins.StableRandom(list3.Count()) : 0); BattleCardBase battleCardBase = list3[index]; list.Add(battleCardBase); int duplicationValue = _duplicationFilter.Filtering(new BattleCardBase[1] { battleCardBase }).FirstOrDefault(); diff --git a/SVSim.BattleEngine/Engine/SkillOptionValue.cs b/SVSim.BattleEngine/Engine/SkillOptionValue.cs index 1dda429c..6825f64d 100644 --- a/SVSim.BattleEngine/Engine/SkillOptionValue.cs +++ b/SVSim.BattleEngine/Engine/SkillOptionValue.cs @@ -24,38 +24,6 @@ public class SkillOptionValue } } - public const string VARIABLE_PLAY_COUNT = "PLAY_COUNT"; - - public const string VARIABLE_HAND_COUNT = "HAND_COUNT"; - - public const string VARIABLE_HAND_SPACE_COUNT = "HAND_SPACE_COUNT"; - - public const string VARIABLE_CHANT_COUNT = "CHANT_COUNT"; - - public const string VARIABLE_CHARGE_COUNT = "CHARGE_COUNT"; - - public const string VARIABLE_DROP_COUNT = "DROP_COUNT"; - - public const string VARIABLE_RETURN_COUNT = "RETURN_COUNT"; - - public const string VARIABLE_INPLAY_ME_COUNT = "INPLAY_ME_COUNT"; - - public const string VARIABLE_INPLAY_OP_COUNT = "INPLAY_OP_COUNT"; - - public const string VARIABLE_INPLAY_UNIT_ME_COUNT = "INPLAY_UNIT_ME_COUNT"; - - public const string VARIABLE_INPLAY_UNIT_OP_COUNT = "INPLAY_UNIT_OP_COUNT"; - - public const string VARIABLE_CLASS_ME_LIFE = "CLASS_ME_LIFE"; - - public const string VARIABLE_CLASS_OP_LIFE = "CLASS_OP_LIFE"; - - public const string VARIABLE_ADD_CHARGE_COUNT = "ADD_CHARGE_COUNT"; - - public const string VARIABLE_ADD_ODD_CHARGE_COUNT = "ADD_ODD_CHARGE_COUNT"; - - public const string VARIABLE_ADD_EVEN_CHARGE_COUNT = "ADD_EVEN_CHARGE_COUNT"; - private SkillFilterCreator.ContentInfo[] _contentInfos; private readonly Dictionary _variableDictionary = new Dictionary(); @@ -96,11 +64,6 @@ public class SkillOptionValue } } - public void ClearVariable() - { - _variableDictionary.Clear(); - } - public string GetOption(SkillFilterCreator.ContentKeyword nameType, string defaultValue = null) { SkillFilterCreator.ContentInfo retInfo = default(SkillFilterCreator.ContentInfo); @@ -256,16 +219,6 @@ public class SkillOptionValue return text; } - public bool IsVariableOptionValue(SkillFilterCreator.ContentKeyword nameType) - { - SkillFilterCreator.ContentInfo retInfo = default(SkillFilterCreator.ContentInfo); - if (!GetInfoByName(nameType, out retInfo)) - { - return false; - } - return IsContainVariableValue(retInfo.ValueStr); - } - private static bool IsOperator(char str) { if (str != '+' && str != '-' && str != '*' && str != '/') @@ -401,15 +354,6 @@ public class SkillOptionValue return false; } - public static bool IsContainVariableValue(string name) - { - if (name.Contains('{')) - { - return name.Contains('}'); - } - return false; - } - private string GetVariableValue(string name) { name = ConvertNewVariableName(name); diff --git a/SVSim.BattleEngine/Engine/SkillParameterBuffCountFilter.cs b/SVSim.BattleEngine/Engine/SkillParameterBuffCountFilter.cs index 1dd9ca9f..e2d7b6fd 100644 --- a/SVSim.BattleEngine/Engine/SkillParameterBuffCountFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillParameterBuffCountFilter.cs @@ -22,14 +22,4 @@ public class SkillParameterBuffCountFilter : ISkillCardFilter { return cards.Where((IReadOnlyBattleCardInfo c) => _compareFunc(c.SkillApplyInformation.BuffCount, parameter, c, cards)); } - - public int GetParameter() - { - return parameter; - } - - public string GetOptionText() - { - return _optionText; - } } diff --git a/SVSim.BattleEngine/Engine/SkillParameterBuffLifeCountFilter.cs b/SVSim.BattleEngine/Engine/SkillParameterBuffLifeCountFilter.cs index 6e02360a..1205c04e 100644 --- a/SVSim.BattleEngine/Engine/SkillParameterBuffLifeCountFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillParameterBuffLifeCountFilter.cs @@ -22,14 +22,4 @@ public class SkillParameterBuffLifeCountFilter : ISkillCardFilter { return cards.Where((IReadOnlyBattleCardInfo c) => _compareFunc(c.SkillApplyInformation.BuffLifeCount, parameter, c, cards)); } - - public int GetParameter() - { - return parameter; - } - - public string GetOptionText() - { - return _optionText; - } } diff --git a/SVSim.BattleEngine/Engine/SkillParameterIsChaosFilter.cs b/SVSim.BattleEngine/Engine/SkillParameterIsChaosFilter.cs index 5ab36756..47b8fd6a 100644 --- a/SVSim.BattleEngine/Engine/SkillParameterIsChaosFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillParameterIsChaosFilter.cs @@ -1,21 +1,24 @@ using System.Collections.Generic; +using System.Linq; using Wizard.Battle; public class SkillParameterIsChaosFilter : ISkillCardFilter { private bool _isChaos; - private NetworkUserInfoData _userInfo; - public SkillParameterIsChaosFilter(string value) { _isChaos = value == "true"; - _userInfo = GameMgr.GetIns().GetNetworkUserInfoData(); } public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option) { - if ((_isChaos && _userInfo.GetSelfChaosId() != -1) || (!_isChaos && _userInfo.GetSelfChaosId() == -1)) + // Pull NetworkUserInfoData lazily via the first card's mgr chain instead of caching + // it at ctor time (the ctor runs during skill parsing when no mgr is attached). + NetworkUserInfoData userInfo = cards.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr?.GameMgr?.GetNetworkUserInfoData(); + if (userInfo == null) return new List(); + int chaosId = userInfo.GetSelfChaosId(); + if ((_isChaos && chaosId != -1) || (!_isChaos && chaosId == -1)) { return cards; } diff --git a/SVSim.BattleEngine/Engine/SkillParameterLastLifeFilter.cs b/SVSim.BattleEngine/Engine/SkillParameterLastLifeFilter.cs index b2bd3660..e387f608 100644 --- a/SVSim.BattleEngine/Engine/SkillParameterLastLifeFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillParameterLastLifeFilter.cs @@ -22,14 +22,4 @@ public class SkillParameterLastLifeFilter : ISkillCardFilter { return cards.Where((IReadOnlyBattleCardInfo c) => _compareFunc(c.SkillApplyInformation.GetLastLife(), parameter, c, cards)); } - - public int GetParameter() - { - return parameter; - } - - public string GetOptionText() - { - return _optionText; - } } diff --git a/SVSim.BattleEngine/Engine/SkillParameterTurnDamageCountTextFilter.cs b/SVSim.BattleEngine/Engine/SkillParameterTurnDamageCountTextFilter.cs index 4baa49b7..b2cc5e81 100644 --- a/SVSim.BattleEngine/Engine/SkillParameterTurnDamageCountTextFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillParameterTurnDamageCountTextFilter.cs @@ -11,6 +11,6 @@ public class SkillParameterTurnDamageCountTextFilter : SkillParameterTurnDamageC public override IEnumerable Filtering(IEnumerable cardInfos, SkillConditionCheckerOption checkerOption = null) { - return cardInfos.Select((IReadOnlyBattleCardInfo c) => (c.IsPlayer == BattleManagerBase.GetIns().BattlePlayer.IsSelfTurn) ? c.SkillApplyInformation.GetSpecificTurnDamageCount(c, _turnPlayerInfo) : 0); + return cardInfos.Select((IReadOnlyBattleCardInfo c) => (c.IsPlayer == c.SelfBattlePlayer.BattleMgr.BattlePlayer.IsSelfTurn) ? c.SkillApplyInformation.GetSpecificTurnDamageCount(c, _turnPlayerInfo) : 0); } } diff --git a/SVSim.BattleEngine/Engine/SkillParameterTurnFusionCountTextFilter.cs b/SVSim.BattleEngine/Engine/SkillParameterTurnFusionCountTextFilter.cs index 956dcb8f..0fbb53ed 100644 --- a/SVSim.BattleEngine/Engine/SkillParameterTurnFusionCountTextFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillParameterTurnFusionCountTextFilter.cs @@ -13,6 +13,6 @@ public class SkillParameterTurnFusionCountTextFilter : ISkillParameterSelectFilt public virtual IEnumerable Filtering(IEnumerable cardInfos, SkillConditionCheckerOption checkerOption = null) { - return cardInfos.Select((IReadOnlyBattleCardInfo c) => (c.IsPlayer == BattleManagerBase.GetIns().BattlePlayer.IsSelfTurn) ? c.SkillApplyInformation.GetSpecificTurnFusionCount(c, _turnPlayerInfo) : 0); + return cardInfos.Select((IReadOnlyBattleCardInfo c) => (c.IsPlayer == c.SelfBattlePlayer.BattleMgr.BattlePlayer.IsSelfTurn) ? c.SkillApplyInformation.GetSpecificTurnFusionCount(c, _turnPlayerInfo) : 0); } } diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessBase.cs b/SVSim.BattleEngine/Engine/SkillPreprocessBase.cs index 4b97ded3..1e9f89ee 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessBase.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessBase.cs @@ -56,19 +56,9 @@ public abstract class SkillPreprocessBase : ISkillConditionChecker protected void SkillIconInitialize(ParallelVfxPlayer vfx, List inPlayCards) { - if (!BattleManagerBase.GetIns().IsRecovery) - { - for (int i = 0; i < inPlayCards.Count; i++) - { - BattleCardBase battleCardBase = inPlayCards[i]; - vfx.Register(battleCardBase.BattleCardView.BattleCardIconAnimations.Initialize(battleCardBase, battleCardBase.Skills)); - } - } - } - - protected void SkillIconInitialize(SequentialVfxPlayer vfx, List inPlayCards) - { - if (!BattleManagerBase.GetIns().IsRecovery) + // Route through the first inPlayCard's mgr (all cards in the pair share a mgr); no-op when + // the list is empty (nothing to initialize) which matches the pre-cull "no mgr = no icon" state. + if (inPlayCards.Count > 0 && !inPlayCards[0].SelfBattlePlayer.BattleMgr.IsRecovery) { for (int i = 0; i < inPlayCards.Count; i++) { diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessBurialRite.cs b/SVSim.BattleEngine/Engine/SkillPreprocessBurialRite.cs index 9f180f06..d5e4fc27 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessBurialRite.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessBurialRite.cs @@ -90,7 +90,7 @@ public class SkillPreprocessBurialRite : SkillPreprocessBase summonedCardsList.AddCardToSummonedCards(burialRiteCard, overrideSummonEffect: true); sequentialVfxPlayer.Register(burialRiteCard.LoseSkill()); burialRiteCard.IsSelectedDuringSelectingBurialRiteTarget = false; - if (!BattleManagerBase.GetIns().IsRecovery) + if (!burialRiteCard.SelfBattlePlayer.BattleMgr.IsRecovery) { burialRiteCard.SelfBattlePlayer.BurialRiteOrDiscardCardHandIndexList.Add(burialRiteCard.SelfBattlePlayer.HandCardList.IndexOf(burialRiteCard)); } diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessDestroyTribe.cs b/SVSim.BattleEngine/Engine/SkillPreprocessDestroyTribe.cs index f0324d65..5113aa99 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessDestroyTribe.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessDestroyTribe.cs @@ -13,8 +13,6 @@ public class SkillPreprocessDestroyTribe : SkillPreprocessBase private bool IsAllDestroy; - private const string ALL_DESTROY = "_all"; - private int _count = 1; private BattleCardBase _ownerCard; @@ -126,7 +124,7 @@ public class SkillPreprocessDestroyTribe : SkillPreprocessBase { if (num4 != 0) { - parallelVfxPlayer.Register(new ChangeWhiteRitualCountVfx(list[num3], -num4)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); BattleLogManager.GetInstance().AddLogDepriveWhiteRitualStack(-num4, list[num3], skill); } if (skill.SkillPrm.selfBattlePlayer.BattleMgr is NetworkBattleManagerBase networkBattleManagerBase) diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessNecromance.cs b/SVSim.BattleEngine/Engine/SkillPreprocessNecromance.cs index 7894d9af..468fe5bd 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessNecromance.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessNecromance.cs @@ -46,9 +46,9 @@ public class SkillPreprocessNecromance : SkillPreprocessBase } int num2 = NecromanceCount(playerPair.Self.CemeteryList.Count, playerPair, checkerOption); playerPair.Self.CemeteryConsumption(num2, skill.SkillPrm.ownerCard, skillProcessor, skill.OnWhenFusion != 0); - if (!skill.SkillPrm.ownerCard.IsSpell && (skill.OnWhenFusion == 0 || skill.SkillPrm.ownerCard.IsPlayer || GameMgr.GetIns().IsAdminWatch)) + if (!skill.SkillPrm.ownerCard.IsSpell && (skill.OnWhenFusion == 0 || skill.SkillPrm.ownerCard.IsPlayer || skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)) { - return new NecromanceSkillActivationVfx(skill.SkillPrm.ownerCard.BattleCardView); + return NullVfx.GetInstance(); } return NullVfx.GetInstance(); } diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessOpenCard.cs b/SVSim.BattleEngine/Engine/SkillPreprocessOpenCard.cs index b996fe66..05eaa990 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessOpenCard.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessOpenCard.cs @@ -8,12 +8,6 @@ public class SkillPreprocessOpenCard : SkillPreprocessBase { private readonly BattleCardBase _ownerCard; - public const float WAIT_TIME = 0.5f; - - public static readonly string HAND_SKILL_1_EFFECT = "stt_act_handskill_1"; - - public static readonly string HAND_SKILL_1_SE = "se_stt_act_handskill_1"; - public SkillPreprocessOpenCard(BattleCardBase ownerCard) { _ownerCard = ownerCard; @@ -64,7 +58,7 @@ public class SkillPreprocessOpenCard : SkillPreprocessBase _ownerCard.SelfBattlePlayer.CallOnOpenCard(_ownerCard); } Transform transform = ownerCard.BattleCardView.GameObject.transform; - sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx(HAND_SKILL_1_EFFECT, HAND_SKILL_1_SE, transform, 0.5f, isFollowAll: true)); + sequentialVfxPlayer.Register(VfxWithLoadingSequential.Create()); } else { @@ -78,8 +72,8 @@ public class SkillPreprocessOpenCard : SkillPreprocessBase ownerCard.BattleCardView.UpdateCost(costList, isGenerateInHand: true, playEffect: true, isInHand); })); } - sequentialVfxPlayer.Register(new OpenCardFromHandVfx(ownerCard.BattleCardView, ownerCard.IsLegend)); - sequentialVfxPlayer.Register(new PlayerEndDrawVfx(list)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); if (ownerCard == ownerCard.LastDrawOpenCard) { sequentialVfxPlayer.Register(ownerCard.SelfBattlePlayer.BattleView.HandView.ShuffleHand()); diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessRandomCount.cs b/SVSim.BattleEngine/Engine/SkillPreprocessRandomCount.cs index 9a14fe01..0ad7cc72 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessRandomCount.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessRandomCount.cs @@ -8,8 +8,6 @@ public class SkillPreprocessRandomCount : SkillPreprocessBase private readonly IReadOnlyBattleCardInfo _card; - public int RandomCount => _randomCount; - public SkillPreprocessRandomCount(IReadOnlyBattleCardInfo card, int randomCount) { _card = card; diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessSkillStopAndRemoveByWhenSummonOther.cs b/SVSim.BattleEngine/Engine/SkillPreprocessSkillStopAndRemoveByWhenSummonOther.cs index 5b6cf91c..5978523b 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessSkillStopAndRemoveByWhenSummonOther.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessSkillStopAndRemoveByWhenSummonOther.cs @@ -10,8 +10,6 @@ public class SkillPreprocessSkillStopAndRemoveByWhenSummonOther : SkillPreproces private readonly string _key; - private const string ME_SUMMONED_CARD_UNIT_CLAN = "me_summoned_card_unit_clan"; - public SkillPreprocessSkillStopAndRemoveByWhenSummonOther(string info) { if (info.Length < 2 || info.First() != '(' || info.Last() != ')') diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessTimesPerTurn.cs b/SVSim.BattleEngine/Engine/SkillPreprocessTimesPerTurn.cs index ba76614f..495eda90 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessTimesPerTurn.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessTimesPerTurn.cs @@ -6,7 +6,6 @@ using Wizard.Battle.View.Vfx; public class SkillPreprocessTimesPerTurn : SkillPreprocessTimesPerBase { - private const string SAME_BASE_CARD_ID_TEXT = "same_base_card_id"; private BattleCardBase _owner; @@ -65,11 +64,6 @@ public class SkillPreprocessTimesPerTurn : SkillPreprocessTimesPerBase } } - public int GetLimitCount() - { - return _limitCount; - } - public int GetInvokeCount() { return _invokeCount; diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessTurnStartStop.cs b/SVSim.BattleEngine/Engine/SkillPreprocessTurnStartStop.cs index a55551c9..229b17a8 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessTurnStartStop.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessTurnStartStop.cs @@ -10,8 +10,6 @@ public class SkillPreprocessTurnStartStop : SkillPreprocessBase private Func _conditionFunc; - public string Target => _target; - public SkillPreprocessTurnStartStop(string target) { string[] array = DisassemblySpecialString(target); diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessUnitAttackStop.cs b/SVSim.BattleEngine/Engine/SkillPreprocessUnitAttackStop.cs index 302e2c8b..4a4eca67 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessUnitAttackStop.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessUnitAttackStop.cs @@ -4,7 +4,6 @@ using Wizard.Battle.View.Vfx; public class SkillPreprocessUnitAttackStop : SkillPreprocessBase { - private const string REMOVE_TARGET_SELF = "me"; private readonly string _target = ""; diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessUseEvolutionPoint.cs b/SVSim.BattleEngine/Engine/SkillPreprocessUseEvolutionPoint.cs index 178f6d09..009932a5 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessUseEvolutionPoint.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessUseEvolutionPoint.cs @@ -36,7 +36,7 @@ public class SkillPreprocessUseEvolutionPoint : SkillPreprocessBase networkStandardBattleMgr.RegisterUseEpTrigger(playerPair.Self); } ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(new EpChangeVfx(playerPair.Self, currentEpCount, num, epTotal)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); if (!playerPair.Self.BattleMgr.IsVirtualBattle) { BattleLogManager.GetInstance().AddLogSkillSetEP(num, playerPair.Self.Class, skill); diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessUsePp.cs b/SVSim.BattleEngine/Engine/SkillPreprocessUsePp.cs index e86dd3ca..3fe113a2 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessUsePp.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessUsePp.cs @@ -6,8 +6,6 @@ public class SkillPreprocessUsePp : SkillPreprocessBase { private readonly int _consumeValue; - public int ConsumeValue => _consumeValue; - public SkillPreprocessUsePp(int count) { _consumeValue = count; @@ -27,6 +25,6 @@ public class SkillPreprocessUsePp : SkillPreprocessBase BattleLogManager.GetInstance().AddLogSkillUsePp(skill, skill.SkillPrm.ownerCard.SelfBattlePlayer.Class, -_consumeValue); } playerPair.Self.CallOnAddPp(_consumeValue * -1, skill.SkillPrm.ownerCard); - return new PpChangeVfx(skill.SkillPrm.ownerCard.SelfBattlePlayer); + return NullVfx.GetInstance(); } } diff --git a/SVSim.BattleEngine/Engine/SkillPreprocessWhenEvolveEndRemove.cs b/SVSim.BattleEngine/Engine/SkillPreprocessWhenEvolveEndRemove.cs index 4b456d75..c4d3bbda 100644 --- a/SVSim.BattleEngine/Engine/SkillPreprocessWhenEvolveEndRemove.cs +++ b/SVSim.BattleEngine/Engine/SkillPreprocessWhenEvolveEndRemove.cs @@ -33,7 +33,7 @@ public class SkillPreprocessWhenEvolveEndRemove : SkillPreprocessBase SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(StopSkill(skill, skillProcessorOneTime)); skill.SkillPrm.ownerCard.Skills.Remove(skill); - if (skill.GetAttachSkill is Skill_attach_skill skill_attach_skill && !BattleManagerBase.IsForecast) + if (skill.GetAttachSkill is Skill_attach_skill skill_attach_skill && !skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { sequentialVfxPlayer.Register(skill_attach_skill.StopSpecificCard(skill.SkillPrm.ownerCard)); } diff --git a/SVSim.BattleEngine/Engine/SkillProcessor.cs b/SVSim.BattleEngine/Engine/SkillProcessor.cs index 675af50e..f0a0e884 100644 --- a/SVSim.BattleEngine/Engine/SkillProcessor.cs +++ b/SVSim.BattleEngine/Engine/SkillProcessor.cs @@ -1,441 +1,410 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using Wizard; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class SkillProcessor -{ - private struct InplayCardInfo - { - public int _index; - - public bool _isPlayer; - } - - public enum ProcessCallType - { - Start, - ResidentStop - } - - public abstract class ProcessInfo - { - protected SkillProcessor _skillProcessor; - - protected BattlePlayerReadOnlyInfoPair _playerInfoPair; - - protected SkillConditionCheckerOption _checkerOption; - - public BattleCardBase OwnerCard { get; private set; } - - public bool NeedOwnerDeadCheck { get; set; } - - public bool IsImmediate { get; set; } - - public abstract bool IsContainDeckSkill { get; } - - public abstract List GetDeckSkills { get; } - - public ProcessInfo(BattleCardBase ownerCard, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption) - { - OwnerCard = ownerCard; - IsImmediate = false; - _skillProcessor = skillProcessor; - _playerInfoPair = playerInfoPair; - _checkerOption = checkerOption; - } - - public abstract VfxBase CallStart(); - - public abstract List GetActiveSkill(); - } - - public class ProcessInfoCollection : ProcessInfo - { - protected SkillCollectionBase _skillCollection; - - protected List _activeSkill; - - public override bool IsContainDeckSkill => _activeSkill.Any((SkillBase s) => s.IsDeckSelfSkill); - - public override List GetDeckSkills => _activeSkill.Where((SkillBase s) => s.IsDeckSelfSkill).ToList(); - - public ProcessInfoCollection(BattleCardBase ownerCard, SkillCollectionBase skills, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption, List activeSkill) - : base(ownerCard, skillProcessor, playerInfoPair, checkerOption) - { - _skillCollection = skills; - _activeSkill = activeSkill; - } - - public override VfxBase CallStart() - { - return _skillCollection.CallStart(_skillProcessor, _playerInfoPair, _checkerOption, _activeSkill); - } - - public override List GetActiveSkill() - { - return _activeSkill; - } - } - - public class ProcessInfoSkill : ProcessInfo - { - protected SkillBase _skill; - - public override bool IsContainDeckSkill => _skill.IsDeckSelfSkill; - - public override List GetDeckSkills - { - get - { - List list = new List(); - if (_skill.IsDeckSelfSkill) - { - list.Add(_skill); - } - return list; - } - } - - public ProcessInfoSkill(BattleCardBase ownerCard, SkillBase skill, bool isPlayer, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption) - : base(ownerCard, skillProcessor, playerInfoPair, checkerOption) - { - _skill = skill; - } - - public override VfxBase CallStart() - { - SkillBase.CallParameter callParameter = new SkillBase.CallParameter(); - callParameter.skillProcessor = _skillProcessor; - callParameter.calledSkillResultInfo = new SkillBase.SkillResultInfo(); - return _skill.CallStart(_skillProcessor, _playerInfoPair, _checkerOption, callParameter); - } - - public override List GetActiveSkill() - { - return new List { _skill }; - } - } - - public class StopProcessInfoResidentSkill : ProcessInfoSkill - { - public StopProcessInfoResidentSkill(BattleCardBase ownerCard, SkillBase skill, bool isPlayer, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption) - : base(ownerCard, skill, isPlayer, skillProcessor, playerInfoPair, checkerOption) - { - } - - public override VfxBase CallStart() - { - SkillBase.CallParameter callParameter = new SkillBase.CallParameter(); - callParameter.skillProcessor = _skillProcessor; - callParameter.calledSkillResultInfo = new SkillBase.SkillResultInfo(); - return _skill.CallStart(_skillProcessor, _playerInfoPair, _checkerOption, callParameter, ProcessCallType.ResidentStop); - } - } - - protected List _processSkillList = new List(); - - private List _inactiveSkillList = new List(); - - public Func OnSkillProcedureEnd; - - private Queue _collectionQueue = new Queue(); - - private bool m_needOwnerDeadCheck; - - public event Func OnSkillStart; - - public void Register(ProcessInfo info, bool ignoreOwnerDeadCheck = false) - { - if (info != null) - { - int needOwnerDeadCheck2; - if (!ignoreOwnerDeadCheck) - { - bool flag = (info.NeedOwnerDeadCheck = m_needOwnerDeadCheck); - needOwnerDeadCheck2 = (flag ? 1 : 0); - } - else - { - needOwnerDeadCheck2 = 0; - } - info.NeedOwnerDeadCheck = (byte)needOwnerDeadCheck2 != 0; - _collectionQueue.Enqueue(info); - } - } - - public void InsertRegister(Queue infos, bool ignoreOwnerDeadCheck = false) - { - if (infos.IsNotNullOrEmpty()) - { - Queue queue = new Queue(); - while (_collectionQueue.Any()) - { - queue.Enqueue(_collectionQueue.Dequeue()); - } - while (infos.Any()) - { - _collectionQueue.Enqueue(infos.Dequeue()); - } - while (queue.Any()) - { - _collectionQueue.Enqueue(queue.Dequeue()); - } - } - } - - private Queue ReplacementQueue(Queue ownerQueue, Queue pushQueue) - { - while (pushQueue.Count > 0) - { - ProcessInfo item = pushQueue.Dequeue(); - ownerQueue.Enqueue(item); - } - return ownerQueue; - } - - private InplayCardInfo[] CreateInplayCardInfo(IEnumerable inplayCards) - { - int num = 0; - InplayCardInfo[] array = new InplayCardInfo[inplayCards.Count()]; - foreach (BattleCardBase inplayCard in inplayCards) - { - array[num++] = new InplayCardInfo - { - _index = inplayCard.Index, - _isPlayer = inplayCard.IsPlayer - }; - } - return array; - } - - public void AddProcessSkilList(SkillBase skill) - { - _processSkillList.Add(skill); - } - - public void ClearProcessSkillList() - { - _processSkillList.Clear(); - } - - public List GetProcessSkillList() - { - return _processSkillList; - } - - public void AddInactiveSkilList(List skills) - { - _inactiveSkillList.AddRange(skills); - } - - private void ClearInactiveSkillList() - { - _inactiveSkillList.Clear(); - } - - public List GetDeckSkils() - { - List list = new List(); - for (int i = 0; i < _collectionQueue.Count; i++) - { - list.AddRange(_collectionQueue.ElementAt(i).GetDeckSkills); - } - return list; - } - - private void SortDeckSkillProcess(List tmpList, BattlePlayerPair battlePlayerPair, bool isNotCheckUlist) - { - int i = 0; - for (int count = tmpList.Count; i < count; i++) - { - int num = 0; - ProcessInfo processInfo = null; - if (isNotCheckUlist) - { - num = battlePlayerPair.Self.BattleMgr.StableRandomOnlySelf(tmpList.Count()); - processInfo = tmpList[num]; - } - else - { - NetworkBattleReceiver.ReceiveData receivedData = (battlePlayerPair.Self.BattleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData(); - int k; - for (k = 0; k < receivedData.unapprovedList.Count; k++) - { - ProcessInfo processInfo2 = tmpList.FirstOrDefault((ProcessInfo t) => t.OwnerCard.Index == receivedData.unapprovedList[k].Index); - if (processInfo2 != null) - { - processInfo = processInfo2; - break; - } - } - } - if (processInfo != null) - { - tmpList.Remove(processInfo); - _collectionQueue.Enqueue(processInfo); - } - } - } - - public VfxBase Process(BattlePlayerPair battlePlayerPair, bool isImmediate = false) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - InplayCardInfo[] clonedSelf = CreateInplayCardInfo(battlePlayerPair.Self.InPlayCards.Where((BattleCardBase s) => battlePlayerPair.Self.SummonedCards.Count == 0 || battlePlayerPair.Self.SummonedCards.Any((BattleCardBase a) => s != a))); - InplayCardInfo[] clonedOp = CreateInplayCardInfo(battlePlayerPair.Opponent.InPlayCards.Where((BattleCardBase s) => battlePlayerPair.Opponent.SummonedCards.Count == 0 || battlePlayerPair.Opponent.SummonedCards.Any((BattleCardBase a) => s != a))); - m_needOwnerDeadCheck = true; - bool isNotCheckUlist = !GameMgr.GetIns().IsUseUnapprovedList(battlePlayerPair.Self.IsPlayer); - if (_collectionQueue.Where((ProcessInfo p) => p.IsContainDeckSkill).ToList().Count() >= 2) - { - List list = _collectionQueue.ToList(); - List list2 = new List(); - _collectionQueue.Clear(); - int num = 0; - for (int count = list.Count; num < count; num++) - { - ProcessInfo processInfo = list[num]; - if (processInfo.IsContainDeckSkill) - { - list2.Add(processInfo); - continue; - } - SortDeckSkillProcess(list2, battlePlayerPair, isNotCheckUlist); - _collectionQueue.Enqueue(processInfo); - } - SortDeckSkillProcess(list2, battlePlayerPair, isNotCheckUlist); - } - for (int num2 = 0; num2 < _inactiveSkillList.Count; num2++) - { - _inactiveSkillList[num2].CallOnInactiveSkill(); - } - while (_collectionQueue.Count > 0) - { - ProcessInfo info = _collectionQueue.Dequeue(); - VfxBase vfx = ProcessOneSkill(info, battlePlayerPair); - sequentialVfxPlayer.Register(vfx); - } - PlayVoiceOnCharacterDeath(clonedSelf, clonedOp, battlePlayerPair); - VfxBase allFuncVfxResults = OnSkillProcedureEnd.GetAllFuncVfxResults(); - sequentialVfxPlayer.Register(allFuncVfxResults); - if (!isImmediate) - { - battlePlayerPair.Self.SkillsEndProcess(); - battlePlayerPair.Opponent.SkillsEndProcess(); - if (battlePlayerPair.Self.BattleView != null && !(battlePlayerPair.Self.BattleView is NullBattlePlayerView)) - { - sequentialVfxPlayer.Register(battlePlayerPair.Self.BattleView.GetSideLogControl(isSkillTargetSelect: false).ClearLastShowLogCard()); - BattleManagerBase.GetIns().OperateMgr.CallOnClearSideLog(battlePlayerPair.Self.IsPlayer); - } - ClearProcessSkillList(); - ClearInactiveSkillList(); - } - return sequentialVfxPlayer; - } - - private VfxBase ProcessOneSkill(ProcessInfo info, BattlePlayerPair battlePlayerPair) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - bool flag = true; - if (info.NeedOwnerDeadCheck) - { - flag = !info.OwnerCard.IsDead; - } - if (flag) - { - BattleManagerBase.GetIns().OperateMgr.CallOnSkillProcessStart(); - VfxBase vfxBase = info.CallStart(); - if (vfxBase.IsVfxNonEmpty()) - { - VfxBase vfxCollection = this.OnSkillStart.GetAllFuncVfxResults(info.OwnerCard); - InstantVfx vfx = InstantVfx.Create(delegate - { - ImmediateVfxMgr.GetInstance().Register(vfxCollection); - }); - sequentialVfxPlayer.Register(vfx); - } - BattleManagerBase.GetIns().OperateMgr.CallOnSkillProcessEnd(); - sequentialVfxPlayer.Register(vfxBase); - } - battlePlayerPair.Self.OnCallOneSkillProcess(); - battlePlayerPair.Opponent.OnCallOneSkillProcess(); - this.OnSkillStart = null; - return sequentialVfxPlayer; - } - - private List GetDestroyedCard(InplayCardInfo[] inplayInfo, List cemeteryList) - { - List list = new List(); - BattleCardBase battleCardBase = null; - int i = 0; - for (int num = inplayInfo.Length; i < num; i++) - { - battleCardBase = GetCardInCemetery(ref inplayInfo[i], cemeteryList); - if (battleCardBase != null) - { - list.Add(battleCardBase); - } - } - return list; - } - - private BattleCardBase GetCardInCemetery(ref InplayCardInfo inplayInfo, List cemeteryList) - { - int i = 0; - for (int count = cemeteryList.Count; i < count; i++) - { - if (cemeteryList[i].IsPlayer == inplayInfo._isPlayer && cemeteryList[i].Index == inplayInfo._index) - { - return cemeteryList[i]; - } - } - return null; - } - - private void PlayVoiceOnCharacterDeath(InplayCardInfo[] clonedSelf, InplayCardInfo[] clonedOp, BattlePlayerPair actualPair) - { - List list = new List(); - list.AddRange(GetDestroyedCard(clonedSelf, actualPair.Self.CemeteryList)); - list.AddRange(GetDestroyedCard(clonedOp, actualPair.Opponent.CemeteryList)); - list.AddRange(GetDestroyedCard(clonedSelf, actualPair.Self.NecromanceZoneList)); - list.AddRange(GetDestroyedCard(clonedOp, actualPair.Opponent.NecromanceZoneList)); - if (!list.Any()) - { - return; - } - BattleCardBase battleCardBase = SelectCardToHaveDestroyVoicePlay(list, BattleManagerBase.GetIns().IsRecovery); - if (battleCardBase != null) - { - if (!BattleManagerBase.GetIns().IsRecovery || !(battleCardBase.BattleCardView is NullBattleCardView)) - { - battleCardBase.BattleCardView.playVoiceOnDeath = true; - battleCardBase.BattleCardView.VoiceInfo.SetDestroyCardId(-1); - } - battleCardBase.SelfBattlePlayer.CallOnPlayVoiceOnDeath(battleCardBase); - } - } - - private BattleCardBase SelectCardToHaveDestroyVoicePlay(List destroyedCards, bool isRecovery) - { - destroyedCards.FisherYatesShuffle(); - for (int i = 0; i < destroyedCards.Count; i++) - { - BattleCardBase battleCardBase = destroyedCards[i]; - if (!isRecovery) - { - _ = battleCardBase.BattleCardView.VoiceInfo; - } - else - { - CardVoiceInfoCache.GetCardVoiceInfoForBattle(battleCardBase.CardId); - } - if (!string.IsNullOrEmpty(battleCardBase.BattleCardView.VoiceInfo.GetDestroyVoice(battleCardBase.IsEvolution, battleCardBase.IsExecutedEarthRite).Voice) || (isRecovery && !string.IsNullOrEmpty(CardVoiceInfoCache.GetCardVoiceInfoForBattle(battleCardBase.CardId).GetDestroyVoice(battleCardBase.IsEvolution, battleCardBase.IsExecutedEarthRite).Voice))) - { - return battleCardBase; - } - } - return null; - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Cute; +using Wizard; +using Wizard.Battle.View; +using Wizard.Battle.View.Vfx; + +public class SkillProcessor +{ + private struct InplayCardInfo + { + public int _index; + + public bool _isPlayer; + } + + public enum ProcessCallType + { + Start, + ResidentStop + } + + public abstract class ProcessInfo + { + protected SkillProcessor _skillProcessor; + + protected BattlePlayerReadOnlyInfoPair _playerInfoPair; + + protected SkillConditionCheckerOption _checkerOption; + + public BattleCardBase OwnerCard { get; private set; } + + public bool NeedOwnerDeadCheck { get; set; } + + public bool IsImmediate { get; set; } + + public abstract bool IsContainDeckSkill { get; } + + public abstract List GetDeckSkills { get; } + + public ProcessInfo(BattleCardBase ownerCard, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption) + { + OwnerCard = ownerCard; + IsImmediate = false; + _skillProcessor = skillProcessor; + _playerInfoPair = playerInfoPair; + _checkerOption = checkerOption; + } + + public abstract VfxBase CallStart(); + + public abstract List GetActiveSkill(); + } + + public class ProcessInfoCollection : ProcessInfo + { + protected SkillCollectionBase _skillCollection; + + protected List _activeSkill; + + public override bool IsContainDeckSkill => _activeSkill.Any((SkillBase s) => s.IsDeckSelfSkill); + + public override List GetDeckSkills => _activeSkill.Where((SkillBase s) => s.IsDeckSelfSkill).ToList(); + + public ProcessInfoCollection(BattleCardBase ownerCard, SkillCollectionBase skills, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption, List activeSkill) + : base(ownerCard, skillProcessor, playerInfoPair, checkerOption) + { + _skillCollection = skills; + _activeSkill = activeSkill; + } + + public override VfxBase CallStart() + { + return _skillCollection.CallStart(_skillProcessor, _playerInfoPair, _checkerOption, _activeSkill); + } + + public override List GetActiveSkill() + { + return _activeSkill; + } + } + + public class ProcessInfoSkill : ProcessInfo + { + protected SkillBase _skill; + + public override bool IsContainDeckSkill => _skill.IsDeckSelfSkill; + + public override List GetDeckSkills + { + get + { + List list = new List(); + if (_skill.IsDeckSelfSkill) + { + list.Add(_skill); + } + return list; + } + } + + public ProcessInfoSkill(BattleCardBase ownerCard, SkillBase skill, bool isPlayer, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption) + : base(ownerCard, skillProcessor, playerInfoPair, checkerOption) + { + _skill = skill; + } + + public override VfxBase CallStart() + { + SkillBase.CallParameter callParameter = new SkillBase.CallParameter(); + callParameter.skillProcessor = _skillProcessor; + callParameter.calledSkillResultInfo = new SkillBase.SkillResultInfo(); + return _skill.CallStart(_skillProcessor, _playerInfoPair, _checkerOption, callParameter); + } + + public override List GetActiveSkill() + { + return new List { _skill }; + } + } + + public class StopProcessInfoResidentSkill : ProcessInfoSkill + { + public StopProcessInfoResidentSkill(BattleCardBase ownerCard, SkillBase skill, bool isPlayer, SkillProcessor skillProcessor, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption checkerOption) + : base(ownerCard, skill, isPlayer, skillProcessor, playerInfoPair, checkerOption) + { + } + + public override VfxBase CallStart() + { + SkillBase.CallParameter callParameter = new SkillBase.CallParameter(); + callParameter.skillProcessor = _skillProcessor; + callParameter.calledSkillResultInfo = new SkillBase.SkillResultInfo(); + return _skill.CallStart(_skillProcessor, _playerInfoPair, _checkerOption, callParameter, ProcessCallType.ResidentStop); + } + } + + protected List _processSkillList = new List(); + + private List _inactiveSkillList = new List(); + + public Func OnSkillProcedureEnd; + + private Queue _collectionQueue = new Queue(); + + private bool m_needOwnerDeadCheck; + + public event Func OnSkillStart; + + public void Register(ProcessInfo info, bool ignoreOwnerDeadCheck = false) + { + if (info != null) + { + int needOwnerDeadCheck2; + if (!ignoreOwnerDeadCheck) + { + bool flag = (info.NeedOwnerDeadCheck = m_needOwnerDeadCheck); + needOwnerDeadCheck2 = (flag ? 1 : 0); + } + else + { + needOwnerDeadCheck2 = 0; + } + info.NeedOwnerDeadCheck = (byte)needOwnerDeadCheck2 != 0; + _collectionQueue.Enqueue(info); + } + } + + private InplayCardInfo[] CreateInplayCardInfo(IEnumerable inplayCards) + { + int num = 0; + InplayCardInfo[] array = new InplayCardInfo[inplayCards.Count()]; + foreach (BattleCardBase inplayCard in inplayCards) + { + array[num++] = new InplayCardInfo + { + _index = inplayCard.Index, + _isPlayer = inplayCard.IsPlayer + }; + } + return array; + } + + public void AddProcessSkilList(SkillBase skill) + { + _processSkillList.Add(skill); + } + + public void ClearProcessSkillList() + { + _processSkillList.Clear(); + } + + public List GetProcessSkillList() + { + return _processSkillList; + } + + public void AddInactiveSkilList(List skills) + { + _inactiveSkillList.AddRange(skills); + } + + private void ClearInactiveSkillList() + { + _inactiveSkillList.Clear(); + } + + public List GetDeckSkils() + { + List list = new List(); + for (int i = 0; i < _collectionQueue.Count; i++) + { + list.AddRange(_collectionQueue.ElementAt(i).GetDeckSkills); + } + return list; + } + + private void SortDeckSkillProcess(List tmpList, BattlePlayerPair battlePlayerPair, bool isNotCheckUlist) + { + int i = 0; + for (int count = tmpList.Count; i < count; i++) + { + int num = 0; + ProcessInfo processInfo = null; + if (isNotCheckUlist) + { + num = battlePlayerPair.Self.BattleMgr.StableRandomOnlySelf(tmpList.Count()); + processInfo = tmpList[num]; + } + else + { + NetworkBattleReceiver.ReceiveData receivedData = (battlePlayerPair.Self.BattleMgr as NetworkBattleManagerBase).networkBattleData.GetReceiveData(); + int k; + for (k = 0; k < receivedData.unapprovedList.Count; k++) + { + ProcessInfo processInfo2 = tmpList.FirstOrDefault((ProcessInfo t) => t.OwnerCard.Index == receivedData.unapprovedList[k].Index); + if (processInfo2 != null) + { + processInfo = processInfo2; + break; + } + } + } + if (processInfo != null) + { + tmpList.Remove(processInfo); + _collectionQueue.Enqueue(processInfo); + } + } + } + + public VfxBase Process(BattlePlayerPair battlePlayerPair, bool isImmediate = false) + { + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + InplayCardInfo[] clonedSelf = CreateInplayCardInfo(battlePlayerPair.Self.InPlayCards.Where((BattleCardBase s) => battlePlayerPair.Self.SummonedCards.Count == 0 || battlePlayerPair.Self.SummonedCards.Any((BattleCardBase a) => s != a))); + InplayCardInfo[] clonedOp = CreateInplayCardInfo(battlePlayerPair.Opponent.InPlayCards.Where((BattleCardBase s) => battlePlayerPair.Opponent.SummonedCards.Count == 0 || battlePlayerPair.Opponent.SummonedCards.Any((BattleCardBase a) => s != a))); + m_needOwnerDeadCheck = true; + bool isNotCheckUlist = !battlePlayerPair.Self.BattleMgr.GameMgr.IsUseUnapprovedList(battlePlayerPair.Self.IsPlayer); + if (_collectionQueue.Where((ProcessInfo p) => p.IsContainDeckSkill).ToList().Count() >= 2) + { + List list = _collectionQueue.ToList(); + List list2 = new List(); + _collectionQueue.Clear(); + int num = 0; + for (int count = list.Count; num < count; num++) + { + ProcessInfo processInfo = list[num]; + if (processInfo.IsContainDeckSkill) + { + list2.Add(processInfo); + continue; + } + SortDeckSkillProcess(list2, battlePlayerPair, isNotCheckUlist); + _collectionQueue.Enqueue(processInfo); + } + SortDeckSkillProcess(list2, battlePlayerPair, isNotCheckUlist); + } + for (int num2 = 0; num2 < _inactiveSkillList.Count; num2++) + { + _inactiveSkillList[num2].CallOnInactiveSkill(); + } + while (_collectionQueue.Count > 0) + { + ProcessInfo info = _collectionQueue.Dequeue(); + VfxBase vfx = ProcessOneSkill(info, battlePlayerPair); + sequentialVfxPlayer.Register(vfx); + } + PlayVoiceOnCharacterDeath(clonedSelf, clonedOp, battlePlayerPair); + VfxBase allFuncVfxResults = OnSkillProcedureEnd.GetAllFuncVfxResults(); + sequentialVfxPlayer.Register(allFuncVfxResults); + if (!isImmediate) + { + battlePlayerPair.Self.SkillsEndProcess(); + battlePlayerPair.Opponent.SkillsEndProcess(); + if (battlePlayerPair.Self.BattleView != null && !(battlePlayerPair.Self.BattleView is NullBattlePlayerView)) + { + sequentialVfxPlayer.Register(battlePlayerPair.Self.BattleView.GetSideLogControl(isSkillTargetSelect: false).ClearLastShowLogCard()); + battlePlayerPair.Self.BattleMgr.OperateMgr.CallOnClearSideLog(battlePlayerPair.Self.IsPlayer); + } + ClearProcessSkillList(); + ClearInactiveSkillList(); + } + return sequentialVfxPlayer; + } + + private VfxBase ProcessOneSkill(ProcessInfo info, BattlePlayerPair battlePlayerPair) + { + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + bool flag = true; + if (info.NeedOwnerDeadCheck) + { + flag = !info.OwnerCard.IsDead; + } + if (flag) + { + battlePlayerPair.Self.BattleMgr.OperateMgr.CallOnSkillProcessStart(); + VfxBase vfxBase = info.CallStart(); + if (vfxBase.IsVfxNonEmpty()) + { + VfxBase vfxCollection = this.OnSkillStart.GetAllFuncVfxResults(info.OwnerCard); + InstantVfx vfx = InstantVfx.Create(delegate + { + }); + sequentialVfxPlayer.Register(vfx); + } + battlePlayerPair.Self.BattleMgr.OperateMgr.CallOnSkillProcessEnd(); + sequentialVfxPlayer.Register(vfxBase); + } + battlePlayerPair.Self.OnCallOneSkillProcess(); + battlePlayerPair.Opponent.OnCallOneSkillProcess(); + this.OnSkillStart = null; + return sequentialVfxPlayer; + } + + private List GetDestroyedCard(InplayCardInfo[] inplayInfo, List cemeteryList) + { + List list = new List(); + BattleCardBase battleCardBase = null; + int i = 0; + for (int num = inplayInfo.Length; i < num; i++) + { + battleCardBase = GetCardInCemetery(ref inplayInfo[i], cemeteryList); + if (battleCardBase != null) + { + list.Add(battleCardBase); + } + } + return list; + } + + private BattleCardBase GetCardInCemetery(ref InplayCardInfo inplayInfo, List cemeteryList) + { + int i = 0; + for (int count = cemeteryList.Count; i < count; i++) + { + if (cemeteryList[i].IsPlayer == inplayInfo._isPlayer && cemeteryList[i].Index == inplayInfo._index) + { + return cemeteryList[i]; + } + } + return null; + } + + private void PlayVoiceOnCharacterDeath(InplayCardInfo[] clonedSelf, InplayCardInfo[] clonedOp, BattlePlayerPair actualPair) + { + List list = new List(); + list.AddRange(GetDestroyedCard(clonedSelf, actualPair.Self.CemeteryList)); + list.AddRange(GetDestroyedCard(clonedOp, actualPair.Opponent.CemeteryList)); + list.AddRange(GetDestroyedCard(clonedSelf, actualPair.Self.NecromanceZoneList)); + list.AddRange(GetDestroyedCard(clonedOp, actualPair.Opponent.NecromanceZoneList)); + if (!list.Any()) + { + return; + } + BattleCardBase battleCardBase = SelectCardToHaveDestroyVoicePlay(list, actualPair.Self.BattleMgr.IsRecovery); + if (battleCardBase != null) + { + if (!actualPair.Self.BattleMgr.IsRecovery || !(battleCardBase.BattleCardView is NullBattleCardView)) + { + battleCardBase.BattleCardView.playVoiceOnDeath = true; + battleCardBase.BattleCardView.VoiceInfo.SetDestroyCardId(-1); + } + battleCardBase.SelfBattlePlayer.CallOnPlayVoiceOnDeath(battleCardBase); + } + } + + private BattleCardBase SelectCardToHaveDestroyVoicePlay(List destroyedCards, bool isRecovery) + { + destroyedCards.FisherYatesShuffle(); + for (int i = 0; i < destroyedCards.Count; i++) + { + BattleCardBase battleCardBase = destroyedCards[i]; + if (!isRecovery) + { + _ = battleCardBase.BattleCardView.VoiceInfo; + } + else + { + CardVoiceInfoCache.GetCardVoiceInfoForBattle(battleCardBase.CardId); + } + if (!string.IsNullOrEmpty(battleCardBase.BattleCardView.VoiceInfo.GetDestroyVoice(battleCardBase.IsEvolution, battleCardBase.IsExecutedEarthRite).Voice) || (isRecovery && !string.IsNullOrEmpty(CardVoiceInfoCache.GetCardVoiceInfoForBattle(battleCardBase.CardId).GetDestroyVoice(battleCardBase.IsEvolution, battleCardBase.IsExecutedEarthRite).Voice))) + { + return battleCardBase; + } + } + return null; + } +} diff --git a/SVSim.BattleEngine/Engine/SkillRandomEachSameBaseCardIdFilter.cs b/SVSim.BattleEngine/Engine/SkillRandomEachSameBaseCardIdFilter.cs index 84a7cc70..46a0cbfd 100644 --- a/SVSim.BattleEngine/Engine/SkillRandomEachSameBaseCardIdFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillRandomEachSameBaseCardIdFilter.cs @@ -35,7 +35,7 @@ public class SkillRandomEachSameBaseCardIdFilter : ISkillSelectFilter int num = list2.Count() - _restCount; for (int num2 = 0; num2 < num; num2++) { - BattleCardBase item = list2[BattleManagerBase.GetIns().StableRandom(list2.Count)]; + BattleCardBase item = list2[_player.BattleMgr.StableRandom(list2.Count)]; list.Add(item); list2.Remove(item); _count++; diff --git a/SVSim.BattleEngine/Engine/SkillRandomSelectFilter.cs b/SVSim.BattleEngine/Engine/SkillRandomSelectFilter.cs index 6b9c9464..4a8fccf8 100644 --- a/SVSim.BattleEngine/Engine/SkillRandomSelectFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillRandomSelectFilter.cs @@ -9,10 +9,6 @@ public class SkillRandomSelectFilter : ISkillSelectFilter private int _count; - public string Context => _context; - - public int Count => _count; - public SkillRandomSelectFilter(string randomCountText) { _context = randomCountText; @@ -23,23 +19,21 @@ public class SkillRandomSelectFilter : ISkillSelectFilter return option.ParseInt(_context); } - public bool IsContainVariableValue() - { - return SkillOptionValue.IsContainVariableValue(_context); - } - public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option, SkillConditionCheckerOption checkerOption) { _count = CalcCount(option); cards = cards.OrderBy((BattleCardBase x) => x.Index); List attractSkillCardList = cards.Where((BattleCardBase c) => c.SkillApplyInformation.IsAttractSkillTarget).ToList(); List nonAttractSkillCardList = cards.Where((BattleCardBase c) => !c.SkillApplyInformation.IsAttractSkillTarget).ToList(); - BattleManagerBase battleMgr = BattleManagerBase.GetIns(); + // Route through the first card's mgr — all cards in a filtering pass share the same mgr, + // and if cards is empty the loop below runs zero times so the null branch is unreachable. + BattleManagerBase battleMgr = attractSkillCardList.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr + ?? nonAttractSkillCardList.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; _count = Math.Min(_count, attractSkillCardList.Count + nonAttractSkillCardList.Count); for (int i = 0; i < _count; i++) { List list = ((attractSkillCardList.Count > 0) ? attractSkillCardList : nonAttractSkillCardList); - int index = (BattleManagerBase.IsRandomDraw ? battleMgr.StableRandom(list.Count) : 0); + int index = (battleMgr.InstanceIsRandomDraw ? battleMgr.StableRandom(list.Count) : 0); BattleCardBase battleCardBase = list[index]; list.Remove(battleCardBase); yield return battleCardBase; diff --git a/SVSim.BattleEngine/Engine/SkillRandomSelectUntilFilter.cs b/SVSim.BattleEngine/Engine/SkillRandomSelectUntilFilter.cs index 84224b9a..4a703d61 100644 --- a/SVSim.BattleEngine/Engine/SkillRandomSelectUntilFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillRandomSelectUntilFilter.cs @@ -28,7 +28,7 @@ public class SkillRandomSelectUntilFilter : ISkillSelectFilter { return Enumerable.Empty(); } - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _player.BattleMgr; ApplySkillTargetFilterCollection applySkillTargetFilterCollection = new ApplySkillTargetFilterCollection(); SkillFilterCreator.SetupTarget(applySkillTargetFilterCollection, _randomCountText, _player.Class, null); ApplySkillTargetFilterCollection applySkillTargetFilterCollection2 = applySkillTargetFilterCollection.ApplyAndFilter[0]; @@ -37,7 +37,7 @@ public class SkillRandomSelectUntilFilter : ISkillSelectFilter List list2 = new List(); while (!IsHandMaxAfterDraw(list2)) { - int index = (BattleManagerBase.IsRandomDraw ? ins.StableRandom(list.Count) : 0); + int index = (ins.InstanceIsRandomDraw ? ins.StableRandom(list.Count) : 0); BattleCardBase battleCardBase = list[index]; list.Remove(battleCardBase); list2.Add(battleCardBase); diff --git a/SVSim.BattleEngine/Engine/SkillTargetChosenCardsFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetChosenCardsFilter.cs index 63796596..99f8b62a 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetChosenCardsFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetChosenCardsFilter.cs @@ -15,7 +15,7 @@ public class SkillTargetChosenCardsFilter : ISkillTargetFilter { if (CardMaster.GetInstanceForBattle().CardExists(chosenCard)) { - BattleCardBase item = BattleManagerBase.GetIns().CreateTransformCardRegisterVfx(option.PlayedCard, chosenCard, option.PlayedCard.IsPlayer, null, isRecoveryFinish: false, isChoice: true); + BattleCardBase item = option.PlayedCard.SelfBattlePlayer.BattleMgr.CreateTransformCardRegisterVfx(option.PlayedCard, chosenCard, option.PlayedCard.IsPlayer, null, isRecoveryFinish: false, isChoice: true); list.Add(item); } } diff --git a/SVSim.BattleEngine/Engine/SkillTargetDestroyedThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetDestroyedThisTurnCardListFilter.cs index 228b341a..31ceda4e 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetDestroyedThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetDestroyedThisTurnCardListFilter.cs @@ -7,9 +7,13 @@ public class SkillTargetDestroyedThisTurnCardListFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped (same for every player in the pair); IsSelfTurn on the mgr's + // BattlePlayer is equivalent to the mgr-home player's IsSelfTurn. Route through the + // first battle-player-info's Turn and IsPlayer/IsSelfTurn. + IBattlePlayerReadOnlyInfo first = battlePlayerInfos.FirstOrDefault(); + if (first == null) return list; + int turn = first.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? first).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoNecromanceZoneCards.Where((IReadOnlyBattleCardInfo pp) => pp.IsDead && !(pp is NullBattleCard) && pp.DestroyedTurn == turn && pp.IsDestroySelfTurn == isSelfTurn))); list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoCemeterys.Where((IReadOnlyBattleCardInfo pp) => pp.IsDead && !(pp is NullBattleCard) && pp.DestroyedTurn == turn && pp.IsDestroySelfTurn == isSelfTurn))); return list; diff --git a/SVSim.BattleEngine/Engine/SkillTargetDiscardThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetDiscardThisTurnCardListFilter.cs index 5edb2780..34524730 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetDiscardThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetDiscardThisTurnCardListFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetDiscardThisTurnCardListFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoDiscardedCards.Where((IReadOnlyBattleCardInfo pp) => !(pp is NullBattleCard) && pp.DestroyedTurn == turn && pp.IsDestroySelfTurn == isSelfTurn))); return list; } diff --git a/SVSim.BattleEngine/Engine/SkillTargetEqualOrLessCostFromLastTarget.cs b/SVSim.BattleEngine/Engine/SkillTargetEqualOrLessCostFromLastTarget.cs index 56959537..1b1ae065 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetEqualOrLessCostFromLastTarget.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetEqualOrLessCostFromLastTarget.cs @@ -16,10 +16,11 @@ public class SkillTargetEqualOrLessCostFromLastTarget : ISkillCustomSelectFilter public IEnumerable Filtering(IEnumerable cards, IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { KeyCards = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); List list = new List(); List selectKeyCards = new SkillTargetLastTargetFilter(_strLastTargetIndex).Filtering(battlePlayerInfos, option).ToList(); List list2 = cards.OrderBy((IReadOnlyBattleCardInfo x) => x.Index).ToList(); + BattleManagerBase ins = list2.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr + ?? selectKeyCards.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; int i; for (i = 0; i < selectKeyCards.Count; i++) { @@ -27,7 +28,7 @@ public class SkillTargetEqualOrLessCostFromLastTarget : ISkillCustomSelectFilter if (source.Count() > 0) { KeyCards.Add(selectKeyCards[i]); - int index = (BattleManagerBase.IsRandomDraw ? ins.StableRandom(source.Count()) : 0); + int index = (ins.InstanceIsRandomDraw ? ins.StableRandom(source.Count()) : 0); IReadOnlyBattleCardInfo item = source.ElementAtOrDefault(index); list.Add(item); list2.Remove(item); diff --git a/SVSim.BattleEngine/Engine/SkillTargetFusionIngredientedThisTurnCardList.cs b/SVSim.BattleEngine/Engine/SkillTargetFusionIngredientedThisTurnCardList.cs index e69dea16..587f7cbe 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetFusionIngredientedThisTurnCardList.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetFusionIngredientedThisTurnCardList.cs @@ -7,8 +7,9 @@ public class SkillTargetFusionIngredientedThisTurnCardList : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoFusionIngredientList.Where((IReadOnlyBattleCardInfo pp) => pp.FusionedTurn == turn))); return list; } diff --git a/SVSim.BattleEngine/Engine/SkillTargetHandBanishedThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetHandBanishedThisTurnCardListFilter.cs index c4608bc4..2de30a66 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetHandBanishedThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetHandBanishedThisTurnCardListFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetHandBanishedThisTurnCardListFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoBanishCards.Where((IReadOnlyBattleCardInfo pp) => !(pp is NullBattleCard) && pp.BanishedInfo.Turn == turn && pp.BanishedInfo.IsSelfTurn == isSelfTurn && pp.BanishedInfo.Place == BattleCardBase.BanishInfo.BanishPlace.Hand))); return list; } diff --git a/SVSim.BattleEngine/Engine/SkillTargetInplayBanishedThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetInplayBanishedThisTurnCardListFilter.cs index a5a5d9ca..c7f30550 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetInplayBanishedThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetInplayBanishedThisTurnCardListFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetInplayBanishedThisTurnCardListFilter : ISkillTargetFilte public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoBanishCards.Where((IReadOnlyBattleCardInfo pp) => !(pp is NullBattleCard) && pp.BanishedInfo.Turn == turn && pp.BanishedInfo.IsSelfTurn == isSelfTurn && pp.BanishedInfo.Place == BattleCardBase.BanishInfo.BanishPlace.Field))); return list; } diff --git a/SVSim.BattleEngine/Engine/SkillTargetInplayLastTargetFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetInplayLastTargetFilter.cs index 0763a90f..b0ba7ebd 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetInplayLastTargetFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetInplayLastTargetFilter.cs @@ -4,7 +4,6 @@ using Wizard.Battle; public class SkillTargetInplayLastTargetFilter : SkillTargetLastTargetFilter { - private readonly int _option; public SkillTargetInplayLastTargetFilter(string option) : base(option) diff --git a/SVSim.BattleEngine/Engine/SkillTargetLeftThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetLeftThisTurnCardListFilter.cs index f56e54d4..7b7c6c7e 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetLeftThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetLeftThisTurnCardListFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetLeftThisTurnCardListFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => from t in p.SkillInfoGameTurnLeftCards where t.Turn == turn && t.IsSelfTurn == isSelfTurn select t.Card)); diff --git a/SVSim.BattleEngine/Engine/SkillTargetOverCostFromLastTargetFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetOverCostFromLastTargetFilter.cs index 6f403876..a4bd7841 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetOverCostFromLastTargetFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetOverCostFromLastTargetFilter.cs @@ -9,10 +9,11 @@ public class SkillTargetOverCostFromLastTargetFilter : ISkillCustomSelectFilter public IEnumerable Filtering(IEnumerable cards, IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { KeyDestroyedCard = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); List list = new List(); List selectKeyCards = battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo s) => s.SkillInfoLastTargets.First()).ToList(); List list2 = cards.OrderBy((IReadOnlyBattleCardInfo x) => x.Index).ToList(); + BattleManagerBase ins = list2.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr + ?? selectKeyCards.FirstOrDefault()?.SelfBattlePlayer?.BattleMgr; int i = 0; int count = selectKeyCards.Count; while (i < count) @@ -21,7 +22,7 @@ public class SkillTargetOverCostFromLastTargetFilter : ISkillCustomSelectFilter if (source.Count() > 0) { KeyDestroyedCard.Add(selectKeyCards[i]); - int index = (BattleManagerBase.IsRandomDraw ? ins.StableRandom(source.Count()) : 0); + int index = (ins.InstanceIsRandomDraw ? ins.StableRandom(source.Count()) : 0); IReadOnlyBattleCardInfo item = source.ElementAtOrDefault(index); list.Add(item); list2.Remove(item); diff --git a/SVSim.BattleEngine/Engine/SkillTargetPastSummonCardsFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetPastSummonCardsFilter.cs index 94fc12d1..ae40fe8e 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetPastSummonCardsFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetPastSummonCardsFilter.cs @@ -17,7 +17,7 @@ public class SkillTargetPastSummonCardsFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _ownerCard.SelfBattlePlayer.BattleMgr; int turn = ins.CurrentTurn; bool isTurnEnd = ins.IsTurnEnd; foreach (IBattlePlayerReadOnlyInfo battlePlayerInfo in battlePlayerInfos) diff --git a/SVSim.BattleEngine/Engine/SkillTargetReanimatedThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetReanimatedThisTurnCardListFilter.cs index 353852c1..29f9de5b 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetReanimatedThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetReanimatedThisTurnCardListFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetReanimatedThisTurnCardListFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => from t in p.SkillInfoGameReanimatedCards where t.Turn == turn && t.IsSelfTurn == isSelfTurn select t.Card)); diff --git a/SVSim.BattleEngine/Engine/SkillTargetReturnThisTurnCardListFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetReturnThisTurnCardListFilter.cs index 6fc38421..dc00af18 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetReturnThisTurnCardListFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetReturnThisTurnCardListFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetReturnThisTurnCardListFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => from pp in p.SkillInfoReturnedCards where pp.Turn == turn && pp.IsSelfTurn == isSelfTurn select pp.Card)); diff --git a/SVSim.BattleEngine/Engine/SkillTargetTurnSummonCardsFilter.cs b/SVSim.BattleEngine/Engine/SkillTargetTurnSummonCardsFilter.cs index 27ccd211..870d82ac 100644 --- a/SVSim.BattleEngine/Engine/SkillTargetTurnSummonCardsFilter.cs +++ b/SVSim.BattleEngine/Engine/SkillTargetTurnSummonCardsFilter.cs @@ -7,9 +7,12 @@ public class SkillTargetTurnSummonCardsFilter : ISkillTargetFilter public IEnumerable Filtering(IEnumerable battlePlayerInfos, SkillConditionCheckerOption option) { List list = new List(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - int turn = ins.CurrentTurn; - bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; + // Turn is battle-scoped; IsSelfTurn on the mgr's home player is equivalent to iterating + // for the p.IsPlayer entry. Route through the first battle-player-info. + IBattlePlayerReadOnlyInfo _f = battlePlayerInfos.FirstOrDefault(); + if (_f == null) return list; + int turn = _f.Turn; + bool isSelfTurn = (battlePlayerInfos.FirstOrDefault(p => p.IsPlayer) ?? _f).IsSelfTurn; foreach (IBattlePlayerReadOnlyInfo battlePlayerInfo in battlePlayerInfos) { list.AddRange(from c in battlePlayerInfo.SkillInfoGameSummonCards diff --git a/SVSim.BattleEngine/Engine/Skill_attach_skill.cs b/SVSim.BattleEngine/Engine/Skill_attach_skill.cs index baefe362..1009fbdc 100644 --- a/SVSim.BattleEngine/Engine/Skill_attach_skill.cs +++ b/SVSim.BattleEngine/Engine/Skill_attach_skill.cs @@ -286,7 +286,7 @@ public class Skill_attach_skill : SkillBase { return NullVfxWithLoading.GetInstance(); } - if (GameMgr.GetIns().IsAdminWatch) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { _effectTargets = list; } @@ -348,7 +348,7 @@ public class Skill_attach_skill : SkillBase }; } BuffInfo buffInfo = (IsBattleLog ? AddBuffInfoIfNeeded(target) : null); - if (base.HasIndividualId && (battleCardBase.IsPlayer || GameMgr.GetIns().IsAdminWatch)) + if (base.HasIndividualId && (battleCardBase.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)) { skill.AddIndividualIdSkillBuffLog(this, battleCardBase); } @@ -451,7 +451,7 @@ public class Skill_attach_skill : SkillBase { if (!target.IsPlayer && !target.IsInplay) { - return GameMgr.GetIns().IsAdminWatch; + return SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch; } return true; } @@ -548,13 +548,13 @@ public class Skill_attach_skill : SkillBase protected void LoggingOpponentPrivateCard(List targets, SkillCreator.SkillBuildInfo buildInfo) { - if (!IsBattleLog || BattleManagerBase.GetIns().BattleEnemy.HandCardList.Count <= 0) + if (!IsBattleLog || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.BattleEnemy.HandCardList.Count <= 0) { return; } BattleLogManager instance = BattleLogManager.GetInstance(); SkillBase attachedSkill = base.SkillPrm.ownerCard.CreateSkillCreator(base.SkillPrm.ownerCard.SelfBattlePlayer, base.SkillPrm.ownerCard.OpponentBattlePlayer, base.SkillPrm.resourceMgr).Create(buildInfo, null, isAttachSkill: true, this); - if (GameMgr.GetIns().IsAdminWatch) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { for (int i = 0; i < targets.Count; i++) { @@ -563,7 +563,7 @@ public class Skill_attach_skill : SkillBase } else if (!(base.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter) || targets.Count != 0) { - instance.AddLogSkillAttachSkill(BattleManagerBase.GetIns().BattleEnemy.Class, attachedSkill, this, isTargetInOpponentHand: true); + instance.AddLogSkillAttachSkill(SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.BattleEnemy.Class, attachedSkill, this, isTargetInOpponentHand: true); } } diff --git a/SVSim.BattleEngine/Engine/Skill_attack_by_life.cs b/SVSim.BattleEngine/Engine/Skill_attack_by_life.cs index dba60a15..1921ff7f 100644 --- a/SVSim.BattleEngine/Engine/Skill_attack_by_life.cs +++ b/SVSim.BattleEngine/Engine/Skill_attack_by_life.cs @@ -4,9 +4,6 @@ using Wizard.Battle.View.Vfx; public class Skill_attack_by_life : SkillBase { - public const string OPTION_ATTACK = "attack"; - - public const string OPTION_BE_ATTACKED = "be_attacked"; public string type => base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.type, "_OPT_NULL_"); diff --git a/SVSim.BattleEngine/Engine/Skill_attack_count.cs b/SVSim.BattleEngine/Engine/Skill_attack_count.cs index a6b5af04..251884bc 100644 --- a/SVSim.BattleEngine/Engine/Skill_attack_count.cs +++ b/SVSim.BattleEngine/Engine/Skill_attack_count.cs @@ -21,10 +21,6 @@ public class Skill_attack_count : SkillBase } } - private const int NULL_COUNT = -1; - - private const string ATTACK_COUNT_RECOVERY = "recovery"; - public bool IsRecovery => base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.attack_count) == "recovery"; public Skill_attack_count(SkillParameter skillPrm, string option) diff --git a/SVSim.BattleEngine/Engine/Skill_banish.cs b/SVSim.BattleEngine/Engine/Skill_banish.cs index 35ca0fd6..3ef26377 100644 --- a/SVSim.BattleEngine/Engine/Skill_banish.cs +++ b/SVSim.BattleEngine/Engine/Skill_banish.cs @@ -16,9 +16,9 @@ public class Skill_banish : SkillBase { bool flag = base.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.is_open, SkillFilterCreator.ContentKeyword._false.ToStringCustom()) == SkillFilterCreator.ContentKeyword._true.ToStringCustom() || (OnWhenDraw != 0 && base.ApplyingTargetFilter is SkillTargetSelfFilter); List list = parameter.targetCards.ToList(); - List list2 = ((!BattleManagerBase.IsForecast) ? list.Where((BattleCardBase c) => c.IsInplay && (!c.SkillApplyInformation.IsBanishByDestroy || !c.SkillApplyInformation.IsIndestructible)).ToList() : null); - List list3 = ((!BattleManagerBase.IsForecast) ? list.Where((BattleCardBase c) => c.IsInHand).ToList() : null); - List list4 = ((!BattleManagerBase.IsForecast) ? list.Where((BattleCardBase c) => c.IsInDeck).ToList() : null); + List list2 = ((!base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) ? list.Where((BattleCardBase c) => c.IsInplay && (!c.SkillApplyInformation.IsBanishByDestroy || !c.SkillApplyInformation.IsIndestructible)).ToList() : null); + List list3 = ((!base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) ? list.Where((BattleCardBase c) => c.IsInHand).ToList() : null); + List list4 = ((!base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) ? list.Where((BattleCardBase c) => c.IsInDeck).ToList() : null); int count = base.SkillPrm.selfBattlePlayer.DeckCardList.Count; int count2 = base.SkillPrm.opponentBattlePlayer.DeckCardList.Count; ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); @@ -54,7 +54,7 @@ public class Skill_banish : SkillBase card.BattleCardView.UpdateLife(card.Life); })); } - parallelVfxPlayer.Register(new BanishDeckCardVfx(card.BattleCardView)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } } BattleLogManager.GetInstance().AddLogSkillBanishDeck(list4.Where((BattleCardBase c) => c.IsPlayer).ToList(), this, flag); diff --git a/SVSim.BattleEngine/Engine/Skill_bp_modifier.cs b/SVSim.BattleEngine/Engine/Skill_bp_modifier.cs index fc24cae0..69ff5356 100644 --- a/SVSim.BattleEngine/Engine/Skill_bp_modifier.cs +++ b/SVSim.BattleEngine/Engine/Skill_bp_modifier.cs @@ -5,10 +5,6 @@ public class Skill_bp_modifier : SkillBase { public static readonly int BP_NONE = -1; - public const string BP_MINUS_EFFECT = "cmn_ui_hbp_1"; - - public const string BP_PLUS_EFFECT = "cmn_ui_hbp_2"; - public Skill_bp_modifier(SkillParameter skillPrm, string option) : base(skillPrm, option) { @@ -25,19 +21,19 @@ public class Skill_bp_modifier : SkillBase BattlePlayerBase targetClass = parameter.targetCards.ElementAt(i).SelfBattlePlayer; if (num != 0) { - parallelVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_ui_hbp_2", null, () => targetClass.BattleView.GetBPLabelPosition(), 0f, BattleManagerBase.GetIns().Battle3DContainer.layer)); + parallelVfxPlayer.Register(VfxWithLoadingSequential.Create()); parallelVfxPlayer.Register(AddBp(targetClass, num)); if (targetClass is BattlePlayer) { parallelVfxPlayer.Register(InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HBP_UP); + })); } } else if (num2 > BP_NONE) { - parallelVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_ui_hbp_1", null, () => targetClass.BattleView.GetBPLabelPosition(), 0f, BattleManagerBase.GetIns().Battle3DContainer.layer)); + parallelVfxPlayer.Register(VfxWithLoadingSequential.Create()); parallelVfxPlayer.Register(AddBp(targetClass, -num2)); } } diff --git a/SVSim.BattleEngine/Engine/Skill_cant_attack.cs b/SVSim.BattleEngine/Engine/Skill_cant_attack.cs index 30b600bf..e844a7f7 100644 --- a/SVSim.BattleEngine/Engine/Skill_cant_attack.cs +++ b/SVSim.BattleEngine/Engine/Skill_cant_attack.cs @@ -35,8 +35,6 @@ public class Skill_cant_attack : SkillBase public static readonly int BIT_FLAG_UNIT_AND_CLASS = 3; - public static readonly int BIT_FLAG_ALL = 4; - public static readonly int BIT_UNIT_NOT_HAS_GUARD = 8; private int _baseCardId; diff --git a/SVSim.BattleEngine/Engine/Skill_change_affiliation.cs b/SVSim.BattleEngine/Engine/Skill_change_affiliation.cs index de17b28f..b8296cac 100644 --- a/SVSim.BattleEngine/Engine/Skill_change_affiliation.cs +++ b/SVSim.BattleEngine/Engine/Skill_change_affiliation.cs @@ -59,7 +59,7 @@ public class Skill_change_affiliation : SkillBase buffInfoContainer.Add(buffInfoAffiliationContainer); SetOnLoseEvent(battleCardBase, buffInfo, buffInfoAffiliationContainer); } - if (!BattleManagerBase.IsForecast) + if (!base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { AddBattleLog(parameter.targetCards, _clan, list); } @@ -114,7 +114,7 @@ public class Skill_change_affiliation : SkillBase private void AddBattleLog(IEnumerable targetCards, CardBasePrm.ClanType newClan, List newTribe) { - bool isAdminWatch = GameMgr.GetIns().IsAdminWatch; + bool isAdminWatch = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch; List cards = targetCards.Where((BattleCardBase c) => c.IsInplay || (c.IsInHand && (c.IsPlayer || isAdminWatch))).ToList(); bool isTargetInOpponentHand = IsTargetInOpponentHand(); if (CardBasePrm.ClanType.NONE != newClan) diff --git a/SVSim.BattleEngine/Engine/Skill_change_skybound_art_count.cs b/SVSim.BattleEngine/Engine/Skill_change_skybound_art_count.cs index 7a1767b0..04480b55 100644 --- a/SVSim.BattleEngine/Engine/Skill_change_skybound_art_count.cs +++ b/SVSim.BattleEngine/Engine/Skill_change_skybound_art_count.cs @@ -2,11 +2,6 @@ using Wizard.Battle.View.Vfx; public class Skill_change_skybound_art_count : SkillBase { - private const string EFFECT_FILE_NAME = "stt_act_costdown_1"; - - private const string SE_FILE_NAME = "se_stt_act_costdown_1"; - - public const int DEFAULT_SKYBOUND_ART_COUNT = 10; public Skill_change_skybound_art_count(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -19,16 +14,11 @@ public class Skill_change_skybound_art_count : SkillBase VfxWithLoadingSequential result = VfxWithLoadingSequential.Create(); foreach (BattleCardBase targetCard in parameter.targetCards) { - if (!BattleManagerBase.GetIns().IsVirtualBattle) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsVirtualBattle) { targetCard.SkillApplyInformation.GiveSkyboundArtCount(new SkyboundArtCountAddModifier(-num)); } } return result; } - - public int GetGainSkyboundArtCount() - { - return base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.gain_skybound_art_count, 0); - } } diff --git a/SVSim.BattleEngine/Engine/Skill_change_super_skybound_art_count.cs b/SVSim.BattleEngine/Engine/Skill_change_super_skybound_art_count.cs index c1a09184..88d299fb 100644 --- a/SVSim.BattleEngine/Engine/Skill_change_super_skybound_art_count.cs +++ b/SVSim.BattleEngine/Engine/Skill_change_super_skybound_art_count.cs @@ -3,11 +3,6 @@ using Wizard.Battle.View.Vfx; public class Skill_change_super_skybound_art_count : SkillBase { - private const string EFFECT_FILE_NAME = "stt_act_costdown_1"; - - private const string SE_FILE_NAME = "se_stt_act_costdown_1"; - - public const int DEFAULT_SUPER_SKYBOUND_ART_COUNT = 15; public Skill_change_super_skybound_art_count(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -20,25 +15,17 @@ public class Skill_change_super_skybound_art_count : SkillBase VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); foreach (BattleCardBase targetCard in parameter.targetCards) { - if (!BattleManagerBase.GetIns().IsVirtualBattle) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsVirtualBattle) { targetCard.SkillApplyInformation.GiveSuperSkyboundArtCount(new SuperSkyboundArtCountAddModifier(-num)); } - if (targetCard.HasSuperSkyboundArt && (targetCard.IsPlayer || GameMgr.GetIns().IsAdminWatch)) + if (targetCard.HasSuperSkyboundArt && (targetCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)) { GameObject effectGameObject = null; - vfxWithLoadingSequential.RegisterToLoadingVfx(new WaitLoadEffectAndSetSeVfx("stt_act_costdown_1", "se_stt_act_costdown_1", delegate(GameObject e) - { - effectGameObject = e; - })); - vfxWithLoadingSequential.RegisterToMainVfx(new PlayEffectAndSeVfx(() => effectGameObject, targetCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true)); + vfxWithLoadingSequential.RegisterToLoadingVfx(NullVfx.GetInstance()); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); } } return vfxWithLoadingSequential; } - - public int GetGainSkyboundArtCount() - { - return base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.gain_super_skybound_art_count, 0); - } } diff --git a/SVSim.BattleEngine/Engine/Skill_change_union_burst_count.cs b/SVSim.BattleEngine/Engine/Skill_change_union_burst_count.cs index 84695bc4..8f919850 100644 --- a/SVSim.BattleEngine/Engine/Skill_change_union_burst_count.cs +++ b/SVSim.BattleEngine/Engine/Skill_change_union_burst_count.cs @@ -3,11 +3,6 @@ using Wizard.Battle.View.Vfx; public class Skill_change_union_burst_count : SkillBase { - private const string EFFECT_FILE_NAME = "stt_act_costdown_1"; - - private const string SE_FILE_NAME = "se_stt_act_costdown_1"; - - public const int DEFAULT_UNION_BURST_COUNT = 10; public Skill_change_union_burst_count(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -21,14 +16,11 @@ public class Skill_change_union_burst_count : SkillBase foreach (BattleCardBase targetCard in parameter.targetCards) { targetCard.SkillApplyInformation.GiveUnionBurstCount(new UnionBurstCountAddModifier(-num)); - if (targetCard.HasUnionBurst && (targetCard.IsPlayer || GameMgr.GetIns().IsAdminWatch)) + if (targetCard.HasUnionBurst && (targetCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)) { GameObject effectGameObject = null; - vfxWithLoadingSequential.RegisterToLoadingVfx(new WaitLoadEffectAndSetSeVfx("stt_act_costdown_1", "se_stt_act_costdown_1", delegate(GameObject e) - { - effectGameObject = e; - })); - vfxWithLoadingSequential.RegisterToMainVfx(new PlayEffectAndSeVfx(() => effectGameObject, targetCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true)); + vfxWithLoadingSequential.RegisterToLoadingVfx(NullVfx.GetInstance()); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); } } return vfxWithLoadingSequential; diff --git a/SVSim.BattleEngine/Engine/Skill_change_white_ritual_stack.cs b/SVSim.BattleEngine/Engine/Skill_change_white_ritual_stack.cs index 443384af..ac3c34d6 100644 --- a/SVSim.BattleEngine/Engine/Skill_change_white_ritual_stack.cs +++ b/SVSim.BattleEngine/Engine/Skill_change_white_ritual_stack.cs @@ -20,7 +20,7 @@ public class Skill_change_white_ritual_stack : SkillBase if (newestInplayStack != null) { newestInplayStack.SkillApplyInformation.GiveWhiteRitualCount(num); - sequentialVfxPlayer.Register(new ChangeWhiteRitualCountVfx(newestInplayStack, num)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); CallOnChangeWhiteRitualStack(newestInplayStack, num); if (newestInplayStack.SkillApplyInformation.WhiteRitualCount <= 0) { diff --git a/SVSim.BattleEngine/Engine/Skill_chant_count_change.cs b/SVSim.BattleEngine/Engine/Skill_chant_count_change.cs index effa8255..bc76b6a6 100644 --- a/SVSim.BattleEngine/Engine/Skill_chant_count_change.cs +++ b/SVSim.BattleEngine/Engine/Skill_chant_count_change.cs @@ -35,17 +35,17 @@ public class Skill_chant_count_change : SkillBase foreach (BattleCardBase targetCard2 in parameter.targetCards) { BattleCardBase targetCard = targetCard2; - targetCard.OnRemoveFromInPlayAfterOneTime += (bool flg, SkillProcessor skillProcessor) => new RemoveChantCountVfx(targetCard.BattleCardView); + targetCard.OnRemoveFromInPlayAfterOneTime += (bool flg, SkillProcessor skillProcessor) => NullVfx.GetInstance(); num = targetCard.ChantCount; if (setChant != CHANT_NONE) { ChantCountSet(targetCard, setChant); - vfxWithLoadingSequential.RegisterToMainVfx(new ShowChantCountVfx(targetCard, targetCard.ChantCount, base.SkillPrm.resourceMgr)); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); } else if (gainChant > 0) { ChantCountGain(targetCard, gainChant); - vfxWithLoadingSequential.RegisterVfxWithLoading(new ChangeChantCountVfx(targetCard, targetCard.ChantCount, base.SkillPrm.resourceMgr)); + vfxWithLoadingSequential.RegisterVfxWithLoading(NullVfxWithLoading.GetInstance()); BattlePlayerReadOnlyInfoPair playerInfoPair = new BattlePlayerReadOnlyInfoPair(targetCard2.SelfBattlePlayer, targetCard2.OpponentBattlePlayer); if (!IsSelfChantSkill && base.SkillPrm.ownerCard.IsPlayer == targetCard.IsPlayer) { @@ -56,7 +56,7 @@ public class Skill_chant_count_change : SkillBase else if (addChant > 0) { ChantCountAdd(targetCard, addChant); - vfxWithLoadingSequential.RegisterVfxWithLoading(new ChangeChantCountVfx(targetCard, targetCard.ChantCount, base.SkillPrm.resourceMgr)); + vfxWithLoadingSequential.RegisterVfxWithLoading(NullVfxWithLoading.GetInstance()); } parallelVfxPlayer.Register(CheckChantCountDestroy(targetCard, parameter.skillProcessor)); num2 = targetCard.ChantCount; diff --git a/SVSim.BattleEngine/Engine/Skill_cost_change.cs b/SVSim.BattleEngine/Engine/Skill_cost_change.cs index fdcd2088..98cd44fb 100644 --- a/SVSim.BattleEngine/Engine/Skill_cost_change.cs +++ b/SVSim.BattleEngine/Engine/Skill_cost_change.cs @@ -19,16 +19,6 @@ public class Skill_cost_change : SkillBase } } - private const string EACH_TARGET_OPTION = "each_target"; - - public const string HALF_COST_PARAMETER_ROUND_UP = "half"; - - public const string HALF_COST_PARAMETER_ROUND_DOWN = "half_round_down"; - - public const int SET_COST_DEFAULT_INT = int.MinValue; - - public const int ADD_COST_DEFAULT_INT = int.MinValue; - protected int _addValue = int.MinValue; protected int _setValue = int.MinValue; @@ -135,7 +125,7 @@ public class Skill_cost_change : SkillBase } } } - CostChangeVfx costChangeVfx = new CostChangeVfx(_targets, OnWhenSpellChargeStart != 0, _isCostUpList, isStop: false); + VfxWithLoadingSequential costChangeVfx = VfxWithLoadingSequential.Create(); parallelVfxPlayer.Register(costChangeVfx.MainVfx); if (OnAccumulationCostChange != null && !HasEachTargetOption()) { @@ -253,7 +243,7 @@ public class Skill_cost_change : SkillBase } buffInfoContainer.Clear(); StopEnd(skillProcessor); - return VfxWithLoading.Create(new CostChangeVfx(list, OnWhenSpellChargeStart != 0, new List(), isStop: true).MainVfx); + return VfxWithLoading.Create(VfxWithLoadingSequential.Create().MainVfx); } protected bool IsHalfRoundUpCostSkill(SkillFilterCreator.ContentKeyword nameType) @@ -274,13 +264,6 @@ public class Skill_cost_change : SkillBase return false; } - public bool IsHalfCostSkill() - { - bool num = IsHalfRoundUpCostSkill(SkillFilterCreator.ContentKeyword.set); - bool flag = IsHalfRoundUpCostSkill(SkillFilterCreator.ContentKeyword.add); - return num || flag; - } - protected bool HasEachTargetOption() { return base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.type, "NONE") == "each_target"; @@ -328,11 +311,11 @@ public class Skill_cost_change : SkillBase { case SkillProcessor.ProcessCallType.Start: { - if ((!GameMgr.GetIns().IsAdminWatch && !base.SkillPrm.ownerCard.IsPlayer && !(base.ApplyingTargetFilter is SkillTargetSelfFilter) && !(base.ApplyingTargetFilter is SkillTargetHandSelfFilter) && base.SkillPrm.ownerCard.SelfBattlePlayer.HandCardList.Count > 0) || base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessOpenCard)) + if ((!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch && !base.SkillPrm.ownerCard.IsPlayer && !(base.ApplyingTargetFilter is SkillTargetSelfFilter) && !(base.ApplyingTargetFilter is SkillTargetHandSelfFilter) && base.SkillPrm.ownerCard.SelfBattlePlayer.HandCardList.Count > 0) || base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessOpenCard)) { return true; } - if (!base.SkillPrm.ownerCard.IsPlayer && !GameMgr.GetIns().IsAdminWatch) + if (!base.SkillPrm.ownerCard.IsPlayer && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { break; } @@ -345,11 +328,11 @@ public class Skill_cost_change : SkillBase return false; } case SkillProcessor.ProcessCallType.ResidentStop: - if (!base.SkillPrm.ownerCard.IsPlayer && base.SkillPrm.ownerCard.IsInHand && !GameMgr.GetIns().IsAdminWatch) + if (!base.SkillPrm.ownerCard.IsPlayer && base.SkillPrm.ownerCard.IsInHand && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { return false; } - if (base.SkillPrm.ownerCard.IsPlayer || GameMgr.GetIns().IsAdminWatch) + if (base.SkillPrm.ownerCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { return true; } diff --git a/SVSim.BattleEngine/Engine/Skill_damage.cs b/SVSim.BattleEngine/Engine/Skill_damage.cs index 96458749..dc171ee2 100644 --- a/SVSim.BattleEngine/Engine/Skill_damage.cs +++ b/SVSim.BattleEngine/Engine/Skill_damage.cs @@ -103,12 +103,6 @@ public class Skill_damage : SkillBase } } - private const string OPTION_OLDEST = "oldest"; - - private const string OPTION_EACH_TARGET = "each_target"; - - private const string OPTION_OLDEST_EACH_TARGET = "oldest_each_target"; - public override bool IsTargetIndicate => false; public Skill_damage(SkillParameter skillPrm, string option) @@ -217,7 +211,7 @@ public class Skill_damage : SkillBase BattleCardBase.DamageResult damageResult = target.ApplyDamage(this, damageParam, doesAttackerPossessKiller: false, isReflectedDamage: false, skillProcessor, (damageReflectionTarget != target) ? target : null); if (base.SkillPrm.ownerCard.IsUnit) { - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr; base.SkillPrm.ownerCard.SelfBattlePlayer.Class.SkillApplyInformation.CausedDamageLife(damageResult.DamageApplied, ins.CurrentTurn, ins.BattlePlayer.IsSelfTurn); } damageResultList.Add(damageResult); @@ -314,11 +308,6 @@ public class Skill_damage : SkillBase base.SkillPrm.selfBattlePlayer.StartSkillWhenDamageSelfAndOther(this, target.ToList(), skillProcessor, defDamage, damageResult.DamageApplied); } - private bool IsOnceTakeUnfixedDamageEffect() - { - return base.SkillPrm.buildInfo._effectTargetType == EffectMgr.TargetType.AREA_OPPONENT; - } - private VfxWithLoading TakeDamagePerTarget(List targets, SkillProcessor skillProcessor, string perTargetDamageText) { List battleLogInfo = new List(); diff --git a/SVSim.BattleEngine/Engine/Skill_damage_cut.cs b/SVSim.BattleEngine/Engine/Skill_damage_cut.cs index 5d4291c9..f7018dd3 100644 --- a/SVSim.BattleEngine/Engine/Skill_damage_cut.cs +++ b/SVSim.BattleEngine/Engine/Skill_damage_cut.cs @@ -34,54 +34,6 @@ public class Skill_damage_cut : SkillBase public int LifeLowerLimit { get; private set; } - public bool IsAllDamageCut - { - get - { - if (CutAmount > 0 && _type == DamageCutInfo.DamageType.ALL) - { - return !base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDamageAfterStop); - } - return false; - } - } - - public bool IsNextDamageCut - { - get - { - if (CutAmount > 0 && _type == DamageCutInfo.DamageType.ALL) - { - return base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDamageAfterStop); - } - return false; - } - } - - public bool IsSkillDamageCut - { - get - { - if (CutAmount > 0 && _type == DamageCutInfo.DamageType.SKILL) - { - return !base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDamageAfterStop); - } - return false; - } - } - - public bool IsDamageClipping - { - get - { - if (ClippingMax == int.MaxValue) - { - return LifeLowerLimit != -1; - } - return true; - } - } - public Skill_damage_cut(SkillParameter skillPrm, string option) : base(skillPrm, option) { diff --git a/SVSim.BattleEngine/Engine/Skill_damage_modifier.cs b/SVSim.BattleEngine/Engine/Skill_damage_modifier.cs index b6618a38..f27e41ed 100644 --- a/SVSim.BattleEngine/Engine/Skill_damage_modifier.cs +++ b/SVSim.BattleEngine/Engine/Skill_damage_modifier.cs @@ -7,8 +7,6 @@ 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) { diff --git a/SVSim.BattleEngine/Engine/Skill_discard.cs b/SVSim.BattleEngine/Engine/Skill_discard.cs index dc44c916..9128d8e3 100644 --- a/SVSim.BattleEngine/Engine/Skill_discard.cs +++ b/SVSim.BattleEngine/Engine/Skill_discard.cs @@ -11,7 +11,7 @@ public class Skill_discard : SkillBase { if (base.ShowSideLog) { - if (!GameMgr.GetIns().IsAdmin && !base.SkillPrm.ownerCard.IsPlayer) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdmin && !base.SkillPrm.ownerCard.IsPlayer) { return !base.SkillPrm.ownerCard.IsInCemetery; } diff --git a/SVSim.BattleEngine/Engine/Skill_draw.cs b/SVSim.BattleEngine/Engine/Skill_draw.cs index 191572ba..ef815e37 100644 --- a/SVSim.BattleEngine/Engine/Skill_draw.cs +++ b/SVSim.BattleEngine/Engine/Skill_draw.cs @@ -5,7 +5,6 @@ using Wizard.Battle.View.Vfx; public class Skill_draw : SkillBase { - private const string CARD_OPEN_TRUE = "true"; private bool _isActiveChangeShortageDeck; diff --git a/SVSim.BattleEngine/Engine/Skill_evolve.cs b/SVSim.BattleEngine/Engine/Skill_evolve.cs index 1a4c8a30..15478d48 100644 --- a/SVSim.BattleEngine/Engine/Skill_evolve.cs +++ b/SVSim.BattleEngine/Engine/Skill_evolve.cs @@ -10,7 +10,6 @@ using Wizard.Battle.View.Vfx; public class Skill_evolve : SkillBase { - public const float EVOLVE_STAGGER_TIME_AMOUNT = 0.05f; protected List _evolvedBySkill = new List(); @@ -56,7 +55,6 @@ public class Skill_evolve : SkillBase enableAttackTargettingMovementAction = card.BattleCardView._attackTargetSelectInfo.DisableAttackTargettingMovement(); } })); - VfxWith> loadResourcesVfxWithEffect = SkillEvolveVfx.LoadCardEvolveResources(card, base.SkillPrm.resourceMgr); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(WaitVfx.Create(num)); BattleCardBase battleCardBase = card; VfxWithLoading vfxWithLoading = CreateSkillEffect(base.SkillPrm.resourceMgr, battleCardBase.AsIEnumerable(), isFollowInHand: false, addToLastOperation: true, num2 > 0); @@ -67,10 +65,9 @@ public class Skill_evolve : SkillBase { base.SkillPrm.ownerCard.SelfBattlePlayer.CallOnEvolveMeWhenAttack(battleCardBase); } - sequentialVfxPlayer.Register(card.Evolution(isSkill: true, parameter.skillProcessor, new SkillConditionCheckerOption(), (BattleCardBase evolvedCard, IBattleResourceMgr resourceMgr) => new SkillEvolveVfx(evolvedCard, resourceMgr, loadResourcesVfxWithEffect.Value, base.SkillPrm.ownerCard, evolveMeWhenAttack))); + sequentialVfxPlayer.Register(card.Evolution(isSkill: true, parameter.skillProcessor, new SkillConditionCheckerOption())); parallelVfxPlayer3.Register(sequentialVfxPlayer); parallelVfxPlayer2.Register(TurnOffAttackFrameVfx(card)); - parallelVfxPlayer.Register(loadResourcesVfxWithEffect.Vfx); parallelVfxPlayer4.Register(ToggleOffCantAttackVfx(card, enableAttackControlAction, enableAttackTargettingMovementAction)); num += 0.05f; num2++; diff --git a/SVSim.BattleEngine/Engine/Skill_extra_turn.cs b/SVSim.BattleEngine/Engine/Skill_extra_turn.cs index fefdc625..2968fdf5 100644 --- a/SVSim.BattleEngine/Engine/Skill_extra_turn.cs +++ b/SVSim.BattleEngine/Engine/Skill_extra_turn.cs @@ -9,7 +9,7 @@ public class Skill_extra_turn : SkillBase public override VfxWithLoading Start(CallParameter parameter) { - if (BattleManagerBase.IsForecast) + if (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { return NullVfxWithLoading.GetInstance(); } diff --git a/SVSim.BattleEngine/Engine/Skill_fusion_metamorphose.cs b/SVSim.BattleEngine/Engine/Skill_fusion_metamorphose.cs index 85b12acf..187221ed 100644 --- a/SVSim.BattleEngine/Engine/Skill_fusion_metamorphose.cs +++ b/SVSim.BattleEngine/Engine/Skill_fusion_metamorphose.cs @@ -7,11 +7,6 @@ using Wizard.Battle.View.Vfx; public class Skill_fusion_metamorphose : Skill_metamorphose { - public const float METAMORPHOSE_EFFECT_TIME = 0.5f; - - public const string FUSION_METAMORPHOSE_EFFECT_PATH = "cmn_card_fusionmetamorphose_2"; - - public const string FUSION_METAMORPHOSE_SE_PATH = "se_cmn_card_fusionmetamorphose_2"; public override bool IsShowSideLogSkillType => false; @@ -44,15 +39,15 @@ public class Skill_fusion_metamorphose : Skill_metamorphose { BattleCardBase originalCard = item.Card; BattleCardBase metamorphosedCard; - if (GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsAINetwork && !BattleManagerBase.IsForecast && !GameMgr.GetIns().IsReplayBattle) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsNetworkBattle && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork && !base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle) { - metamorphosedCard = BattleManagerBase.GetIns().MetamorphoseCard(_metamorphoseCardId, originalCard.IsPlayer, originalCard.Index, this, isFusion: true); + metamorphosedCard = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.MetamorphoseCard(_metamorphoseCardId, originalCard.IsPlayer, originalCard.Index, this, isFusion: true); } else { metamorphosedCard = originalCard.SelfBattlePlayer.CreateCard(_metamorphoseCardId, originalCard.Index); } - if (!BattleManagerBase.GetIns().IsVirtualBattle && !BattleManagerBase.GetIns().IsRecovery) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsVirtualBattle && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false); } @@ -70,10 +65,10 @@ public class Skill_fusion_metamorphose : Skill_metamorphose MetamorphoseCardPair metamorphoseCardPair = new MetamorphoseCardPair(originalCard, metamorphosedCard); list.Add(metamorphoseCardPair); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (!BattleManagerBase.GetIns().IsRecovery && (originalCard.IsPlayer || GameMgr.GetIns().IsAdminWatch)) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery && (originalCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)) { - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); + VfxBase canNotTouchCardVfx = NullVfx.GetInstance(); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); _canNotTouchCardVfxList.Add(canNotTouchCardVfx); } sequentialVfxPlayer.Register(InstantVfx.Create(delegate @@ -96,22 +91,16 @@ public class Skill_fusion_metamorphose : Skill_metamorphose Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard); })); GameObject effectGameObject = null; - WaitLoadEffectAndSetSeVfx loadingVfx = new WaitLoadEffectAndSetSeVfx("cmn_card_fusionmetamorphose_2", "se_cmn_card_fusionmetamorphose_2", delegate(GameObject e) - { - effectGameObject = e; - }); - PlayEffectAndSeVfx playEffectAndSeVfx = new PlayEffectAndSeVfx(() => effectGameObject, metamorphosedCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true); + VfxBase loadingVfx = NullVfx.GetInstance(); + VfxBase playEffectAndSeVfx = NullVfx.GetInstance(); VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, playEffectAndSeVfx); parallelVfxPlayer2.Register(vfxWithLoading.LoadingVfx); base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnEffect(base.SkillPrm.buildInfo); - SequentialVfxPlayer morphVfx = SequentialVfxPlayer.Create(vfxBase, vfxWithLoading.MainVfx, InstantVfx.Create(delegate - { - MotionUtils.SetLayerAll(playEffectAndSeVfx.GetLoadedGameObject(), 31); - }), WaitVfx.Create(0.5f), parallelVfxPlayer5); + SequentialVfxPlayer morphVfx = SequentialVfxPlayer.Create(vfxBase, vfxWithLoading.MainVfx, WaitVfx.Create(0.5f), parallelVfxPlayer5); sequentialVfxPlayer.Register(Skill_metamorphose.AttachMetamorphoseCardToOriginalCardVfx(originalCard, metamorphosedCard)); sequentialVfxPlayer.Register(WaitVfx.Create(num)); num += 0.1f; - sequentialVfxPlayer.Register(new MetamorphoseHandCardVfx(metamorphoseCardPair.NewCard, morphVfx, isFusion: true)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard)); sequentialVfxPlayer.Register(TouchableUpdateVfx(originalCard.IsPlayer)); parallelVfxPlayer4.Register(sequentialVfxPlayer); diff --git a/SVSim.BattleEngine/Engine/Skill_heal.cs b/SVSim.BattleEngine/Engine/Skill_heal.cs index b32d6a82..04a54dc2 100644 --- a/SVSim.BattleEngine/Engine/Skill_heal.cs +++ b/SVSim.BattleEngine/Engine/Skill_heal.cs @@ -6,7 +6,6 @@ using Wizard.Battle.View.Vfx; public class Skill_heal : SkillBase { - private const int NONE_AMOUNT = -1; protected List HealResultList = new List(); diff --git a/SVSim.BattleEngine/Engine/Skill_heal_modifier.cs b/SVSim.BattleEngine/Engine/Skill_heal_modifier.cs index 8943b0e5..40f01881 100644 --- a/SVSim.BattleEngine/Engine/Skill_heal_modifier.cs +++ b/SVSim.BattleEngine/Engine/Skill_heal_modifier.cs @@ -7,8 +7,6 @@ public class Skill_heal_modifier : SkillBase { private HealModifier _healModifier; - private const string HEALED_TEXT = "be_healed"; - public Skill_heal_modifier(SkillParameter skillPrm, string option) : base(skillPrm, option) { diff --git a/SVSim.BattleEngine/Engine/Skill_invoke_skill.cs b/SVSim.BattleEngine/Engine/Skill_invoke_skill.cs index e1b7bb04..871839d0 100644 --- a/SVSim.BattleEngine/Engine/Skill_invoke_skill.cs +++ b/SVSim.BattleEngine/Engine/Skill_invoke_skill.cs @@ -24,7 +24,7 @@ internal class Skill_invoke_skill : SkillBase { InsertSkillList = new List(); NotInsertSkillList = new List(); - if (BattleManagerBase.GetIns() is SingleBattleMgr) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is SingleBattleMgr) { _isAllowDestroyTarget = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.is_allow_destroy_target) == "true"; } diff --git a/SVSim.BattleEngine/Engine/Skill_invoke_voice.cs b/SVSim.BattleEngine/Engine/Skill_invoke_voice.cs index cb012586..0a68857f 100644 --- a/SVSim.BattleEngine/Engine/Skill_invoke_voice.cs +++ b/SVSim.BattleEngine/Engine/Skill_invoke_voice.cs @@ -11,8 +11,8 @@ public class Skill_invoke_voice : SkillBase { string text = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.invoke_voice, "_OPT_NULL_"); VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(); - vfxWithLoadingSequential.RegisterToLoadingVfx(new WaitLoadVoiceResourceVfx(base.SkillPrm.ownerCard.BattleCardView, text.Split('_')[0])); - vfxWithLoadingSequential.RegisterToMainVfx(new PlayCRISoundVfx(base.SkillPrm.ownerCard.BattleCardView, text)); + vfxWithLoadingSequential.RegisterToLoadingVfx(NullVfx.GetInstance()); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); return vfxWithLoadingSequential; } } diff --git a/SVSim.BattleEngine/Engine/Skill_metamorphose.cs b/SVSim.BattleEngine/Engine/Skill_metamorphose.cs index 774f0fb6..8ded58bf 100644 --- a/SVSim.BattleEngine/Engine/Skill_metamorphose.cs +++ b/SVSim.BattleEngine/Engine/Skill_metamorphose.cs @@ -20,9 +20,7 @@ public class Skill_metamorphose : SkillBaseSummon } } - public const float METAMORPHOSE_STAGGER_TIME_AMOUNT = 0.1f; - - protected List _canNotTouchCardVfxList = new List(); + protected List _canNotTouchCardVfxList = new List(); protected int _metamorphoseCardId; @@ -60,14 +58,14 @@ public class Skill_metamorphose : SkillBaseSummon { BattleCardBase originalCard = item.Card; BattleCardBase metamorphosedCard; - if (GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsAINetwork && !BattleManagerBase.IsForecast && !GameMgr.GetIns().IsReplayBattle) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsNetworkBattle && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAINetwork && !base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle) { - metamorphosedCard = BattleManagerBase.GetIns().MetamorphoseCard(_metamorphoseCardId, originalCard.IsPlayer, originalCard.Index, this); + metamorphosedCard = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.MetamorphoseCard(_metamorphoseCardId, originalCard.IsPlayer, originalCard.Index, this); } else { metamorphosedCard = originalCard.SelfBattlePlayer.CreateCard(_metamorphoseCardId, originalCard.Index); - if (!BattleManagerBase.GetIns().IsVirtualBattle && !BattleManagerBase.GetIns().IsRecovery) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsVirtualBattle && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false); } @@ -88,10 +86,10 @@ public class Skill_metamorphose : SkillBaseSummon if (originalCard.IsInHand) { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (!BattleManagerBase.GetIns().IsRecovery && (originalCard.IsPlayer || GameMgr.GetIns().IsAdminWatch)) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery && (originalCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch)) { - CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx(); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); + VfxBase canNotTouchCardVfx = NullVfx.GetInstance(); + SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx); _canNotTouchCardVfxList.Add(canNotTouchCardVfx); } sequentialVfxPlayer.Register(metamorphosedCard.SelfBattlePlayer.ReplaceInHand(originalCard, metamorphosedCard, parameter.skillProcessor)); @@ -99,7 +97,7 @@ public class Skill_metamorphose : SkillBaseSummon { base.SkillPrm.selfBattlePlayer.BattleView.HandView.ReplaceCardInView(originalCard.BattleCardView, metamorphosedCard.BattleCardView); }); - if (originalCard.IsPlayer || GameMgr.GetIns().IsAdminWatch) + if (originalCard.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { originalCard.BattleCardView.HideCanPlayEffect(); VfxBase vfxBase = SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard); @@ -111,11 +109,8 @@ public class Skill_metamorphose : SkillBaseSummon SwapMetamorphosedCardMesh(originalCard, metamorphosedCard); })); GameObject effectGameObject = null; - WaitLoadEffectAndSetSeVfx loadingVfx = new WaitLoadEffectAndSetSeVfx(base.SkillPrm.buildInfo._effectPath, base.SkillPrm.buildInfo._sePath, delegate(GameObject e) - { - effectGameObject = e; - }); - PlayEffectAndSeVfx mainVfx = new PlayEffectAndSeVfx(() => effectGameObject, metamorphosedCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true); + VfxBase loadingVfx = NullVfx.GetInstance(); + VfxBase mainVfx = NullVfx.GetInstance(); VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, mainVfx); parallelVfxPlayer2.Register(vfxWithLoading.LoadingVfx); base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnEffect(base.SkillPrm.buildInfo, isFollowInHand: false, isTargetPosition: false, addToLastOperation: true); @@ -123,11 +118,11 @@ public class Skill_metamorphose : SkillBaseSummon sequentialVfxPlayer.Register(AttachMetamorphoseCardToOriginalCardVfx(originalCard, metamorphosedCard)); sequentialVfxPlayer.Register(WaitVfx.Create(num)); num += 0.1f; - sequentialVfxPlayer.Register(new MetamorphoseHandCardVfx(metamorphoseCardPair.NewCard, morphVfx)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } else { - sequentialVfxPlayer.Register(SequentialVfxPlayer.Create(SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard), new MetamorphoseHandCardVfx(metamorphoseCardPair.NewCard, NullVfx.GetInstance()), InstantVfx.Create(delegate + sequentialVfxPlayer.Register(SequentialVfxPlayer.Create(SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard), NullVfx.GetInstance(), InstantVfx.Create(delegate { SwapMetamorphosedCardMesh(originalCard, metamorphosedCard); }), instantVfx)); @@ -148,7 +143,7 @@ public class Skill_metamorphose : SkillBaseSummon VfxWithLoading vfxWithLoading2 = CreateSkillEffect(base.SkillPrm.resourceMgr, new BattleCardBase[1] { metamorphosedCard }, isFollowInHand: false, addToLastOperation: true, num2 > 0); num2++; parallelVfxPlayer2.Register(vfxWithLoading2.LoadingVfx); - parallelVfxPlayer6.Register(SequentialVfxPlayer.Create(new MetamorphoseInPlayCardVfx(metamorphoseCardPair.OldCard, metamorphoseCardPair.NewCard, vfxWithLoading2.MainVfx), EnableMetamorphosedCardColliderVfx(metamorphosedCard), metamorphosedCard.BattleCardView.InitializeBattleCardIcon(metamorphosedCard, metamorphosedCard.Skills))); + parallelVfxPlayer6.Register(SequentialVfxPlayer.Create(NullVfx.GetInstance(), EnableMetamorphosedCardColliderVfx(metamorphosedCard), metamorphosedCard.BattleCardView.InitializeBattleCardIcon(metamorphosedCard, metamorphosedCard.Skills))); originalCard.FlagCardAsDestroyedBySkill(); parallelVfxPlayer6.Register(originalCard.RemoveFromInPlay()); parallelVfxPlayer4.Register(parallelVfxPlayer6); @@ -188,13 +183,12 @@ public class Skill_metamorphose : SkillBaseSummon protected VfxBase TouchableUpdateVfx(bool isPlayer) { - if (isPlayer || GameMgr.GetIns().IsAdminWatch) + if (isPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { return InstantVfx.Create(delegate { if (_canNotTouchCardVfxList.Count > 0) { - _canNotTouchCardVfxList.First().End(); _canNotTouchCardVfxList.RemoveAt(0); } }); @@ -233,7 +227,7 @@ public class Skill_metamorphose : SkillBaseSummon { int num = -1; string text = base.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.metamorphose, "_OPT_NULL_"); - if (BattleManagerBase.GetIns() is SingleBattleMgr) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is SingleBattleMgr) { text = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.metamorphose, "_OPT_NULL_"); } diff --git a/SVSim.BattleEngine/Engine/Skill_possess_ep_modifier.cs b/SVSim.BattleEngine/Engine/Skill_possess_ep_modifier.cs index c599fbd7..70b31619 100644 --- a/SVSim.BattleEngine/Engine/Skill_possess_ep_modifier.cs +++ b/SVSim.BattleEngine/Engine/Skill_possess_ep_modifier.cs @@ -12,7 +12,7 @@ public class Skill_possess_ep_modifier : SkillBase public override VfxWithLoading Start(CallParameter parameter) { - if (BattleManagerBase.IsForecast) + if (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { return NullVfxWithLoading.GetInstance(); } @@ -37,7 +37,7 @@ public class Skill_possess_ep_modifier : SkillBase } int currentEpCount2 = targetCard.SelfBattlePlayer.CurrentEpCount; int epTotal = targetCard.SelfBattlePlayer.EpTotal; - parallelVfxPlayer.Register(new EpChangeVfx(targetCard.SelfBattlePlayer, currentEpCount, currentEpCount2, epTotal)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); if (IsBattleLog) { BattleLogManager.GetInstance().AddLogSkillSetEP(currentEpCount2, targetCard.SelfBattlePlayer.Class, this); diff --git a/SVSim.BattleEngine/Engine/Skill_power_down.cs b/SVSim.BattleEngine/Engine/Skill_power_down.cs index 1555b026..a23990e1 100644 --- a/SVSim.BattleEngine/Engine/Skill_power_down.cs +++ b/SVSim.BattleEngine/Engine/Skill_power_down.cs @@ -25,8 +25,6 @@ public class Skill_power_down : SkillBase public static readonly string MINUS_ZERO = "-0"; - public const string NOT_BE_DEBUFFED_EFFECT_PATH = "btl_nerva_2"; - public Skill_power_down(SkillParameter skillPrm, string option) : base(skillPrm, option) { @@ -96,7 +94,7 @@ public class Skill_power_down : SkillBase } if (target.SkillApplyInformation.IsNotBeDebuffed) { - if (!BattleManagerBase.GetIns().IsRecovery) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { parallelVfxPlayer2.Register(SkillBase.CreateSingleVfx(base.SkillPrm.resourceMgr, () => target.BattleCardView.GameObject.transform.position, new List { target }, target.IsPlayer, target.BattleCardView, "btl_nerva_2", EffectMgr.EngineType.SHURIKEN, "se_btl_nerva_2", EffectMgr.MoveType.DIRECT_LEADER, EffectMgr.TargetType.SINGLE, 0f)); } @@ -261,16 +259,4 @@ public class Skill_power_down : SkillBase buffInfoContainer.Clear(); return VfxWithLoading.Create(parallelVfxPlayer); } - - private int SetOffensetSub(BattleCardBase card, int setOffense) - { - int atk = card.Atk; - return setOffense - atk; - } - - private int SetLifeSub(BattleCardBase card, int setLife) - { - int num = (card.IsEvolution ? card.BaseParameter.EvoLife : card.BaseParameter.Life); - return setLife - num; - } } diff --git a/SVSim.BattleEngine/Engine/Skill_powerup.cs b/SVSim.BattleEngine/Engine/Skill_powerup.cs index 36c49921..66594646 100644 --- a/SVSim.BattleEngine/Engine/Skill_powerup.cs +++ b/SVSim.BattleEngine/Engine/Skill_powerup.cs @@ -11,9 +11,7 @@ public class Skill_powerup : SkillBase Null, Add, Multiply, - AddMaxLife, - Copy - } + AddMaxLife } public class PowerUpModifierContainer { @@ -34,10 +32,6 @@ public class Skill_powerup : SkillBase } } - public static readonly string[] BehaviorOptionType = new string[1] { SkillFilterCreator.ContentKeyword.copy.ToStringCustom() }; - - public static readonly string[] TargetOptionType = new string[1] { SkillFilterCreator.ContentKeyword.last_target.ToStringCustom() }; - protected readonly List _targetList = new List(); protected int _addOffense = -1; @@ -160,9 +154,9 @@ public class Skill_powerup : SkillBase } } CallPowerUpEvent(list3); - if (IsBattleLog && !GameMgr.GetIns().IsAdminWatch && !base.SkillPrm.ownerCard.IsPlayer && OnWhenDraw != 0) + if (IsBattleLog && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch && !base.SkillPrm.ownerCard.IsPlayer && OnWhenDraw != 0) { - BattleLogManager.GetInstance().AddLogSkillBuffAddClass(new List { BattleManagerBase.GetIns().BattleEnemy.Class }, this); + BattleLogManager.GetInstance().AddLogSkillBuffAddClass(new List { SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.BattleEnemy.Class }, this); } IncrementGameBuffCount(inplayTargetCards); RegisterOtherSkillInfo(parameter, inplayTargetCards); @@ -319,85 +313,6 @@ public class Skill_powerup : SkillBase return new LifeAddModifier(0); } - private List CreateBehaviorOffenceModifierList(string behaviorOption, string targetOption, CallParameter parameter) - { - List list = new List(); - string[] array = targetOption.Split('.'); - if (SkillFilterCreator.Str2ContentKeyword(behaviorOption) == SkillFilterCreator.ContentKeyword.copy) - { - string text = array[1]; - if (text.Contains(SkillFilterCreator.ContentKeyword.last_target.ToStringCustom())) - { - List> list2 = ((array[0] == SkillFilterCreator.ContentKeyword.me.ToString()) ? parameter.calledSkillResultInfo.SelfLastTargetCards : parameter.calledSkillResultInfo.OpponentLastTargetCards); - int result = 0; - if (text.Count() > SkillFilterCreator.ContentKeyword.last_target.ToStringCustom().Count()) - { - int.TryParse(text.Substring(SkillFilterCreator.ContentKeyword.last_target.ToStringCustom().Count() + 1), out result); - } - for (int i = 0; i < list2[result].Count; i++) - { - list.AddRange(list2[result][i].SkillApplyInformation.OffenseModifierList); - } - } - else if (text.Contains(SkillFilterCreator.ContentKeyword.load_target.ToStringCustom())) - { - List list3 = base.SkillPrm.ownerCard.SkillApplyInformation.LoadTargetList(); - for (int j = 0; j < list3.Count; j++) - { - list.AddRange(list3[j].SkillApplyInformation.OffenseModifierList); - } - } - else if (text.Contains(SkillFilterCreator.ContentKeyword.load_burial_rite_target.ToStringCustom())) - { - List list4 = base.SkillPrm.ownerCard.SkillApplyInformation.LoadBurialRiteTargetList(); - for (int k = 0; k < list4.Count; k++) - { - list.AddRange(list4[k].SkillApplyInformation.OffenseModifierList); - } - } - return list; - } - return list; - } - - private List CreateBehaviorLifeModifierList(string behaviorOption, string targetOption, CallParameter parameter) - { - List list = new List(); - string[] array = targetOption.Split('.'); - if (SkillFilterCreator.Str2ContentKeyword(behaviorOption) == SkillFilterCreator.ContentKeyword.copy) - { - string text = array[1]; - if (text.Contains(SkillFilterCreator.ContentKeyword.last_target.ToStringCustom())) - { - List> list2 = ((array[0] == SkillFilterCreator.ContentKeyword.me.ToString()) ? parameter.calledSkillResultInfo.SelfLastTargetCards : parameter.calledSkillResultInfo.OpponentLastTargetCards); - int customValue = 0; - SkillFilterCreator.ParseSuffixX(text, out customValue); - for (int i = 0; i < list2[customValue].Count; i++) - { - list.AddRange(list2[customValue][i].SkillApplyInformation.LifeChangeList); - } - } - else if (text.Contains(SkillFilterCreator.ContentKeyword.load_target.ToStringCustom())) - { - List list3 = base.SkillPrm.ownerCard.SkillApplyInformation.LoadTargetList(); - for (int j = 0; j < list3.Count; j++) - { - list.AddRange(list3[j].SkillApplyInformation.LifeChangeList); - } - } - else if (text.Contains(SkillFilterCreator.ContentKeyword.load_burial_rite_target.ToStringCustom())) - { - List list4 = base.SkillPrm.ownerCard.SkillApplyInformation.LoadBurialRiteTargetList(); - for (int k = 0; k < list4.Count; k++) - { - list.AddRange(list4[k].SkillApplyInformation.LifeChangeList); - } - } - return list; - } - return list; - } - public void SettingPowerUpData(int offense, int life) { _addOffense = offense; @@ -425,7 +340,7 @@ public class Skill_powerup : SkillBase break; } } - bool isAdminWatch = GameMgr.GetIns().IsAdminWatch; + bool isAdminWatch = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch; bool isTargetSelfOpenCardSkill = base.IsContainSelfFilter && (base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessOpenCard) || (isAdminWatch && OnWhenDraw != 0)); list = targetCards.Where((BattleCardBase c) => c.IsInHand && (c.IsPlayer == base.SkillPrm.selfBattlePlayer.IsPlayer || isAdminWatch || isTargetSelfOpenCardSkill)).ToList(); if ((IsTargetInHand() || isTargetSelfOpenCardSkill || ((base.SkillPrm.selfBattlePlayer.IsPlayer || base.ApplyingTargetFilter is SkillTargetReturnCardFilter) && list.Count > 0)) && (!(base.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter) || list.Count != 0)) diff --git a/SVSim.BattleEngine/Engine/Skill_pp_modifier.cs b/SVSim.BattleEngine/Engine/Skill_pp_modifier.cs index 1156797a..d0dd6e36 100644 --- a/SVSim.BattleEngine/Engine/Skill_pp_modifier.cs +++ b/SVSim.BattleEngine/Engine/Skill_pp_modifier.cs @@ -23,7 +23,7 @@ public class Skill_pp_modifier : SkillBase _decreaseTurnPp = base.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.decrease_turn_pp, PP_NONE); bool isBattleLog = IsBattleLog; ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr; foreach (BattleCardBase targetCard in parameter.targetCards) { BattleCardBase battleCardBase = targetCard; @@ -33,12 +33,12 @@ public class Skill_pp_modifier : SkillBase if (num != 0) { selfBattlePlayer.AddPpTotal(num, isUpdatePp: false, parameter.skillProcessor, base.SkillPrm.ownerCard, bySkill: true); - parallelVfxPlayer.Register(new PpIncreaseVfx(selfBattlePlayer, ppTotal, selfBattlePlayer.PpTotal)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } else if (num2 != PP_NONE) { base.SkillPrm.selfBattlePlayer.SetPpTotal(num2, isUpdatePp: false, parameter.skillProcessor); - parallelVfxPlayer.Register(new PpIncreaseVfx(selfBattlePlayer, pp, selfBattlePlayer.Pp)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } if (num3 != 0) { @@ -63,7 +63,7 @@ public class Skill_pp_modifier : SkillBase battleCardBase.SkillApplyInformation.GiveDecreaseTurnStartPP(_decreaseTurnPp); SetOnLoseEvent(battleCardBase, buffInfo, buffInfoContainer); } - parallelVfxPlayer.Register(new PpChangeVfx(selfBattlePlayer)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); int ppTotal2 = selfBattlePlayer.PpTotal; int pp2 = selfBattlePlayer.Pp; selfBattlePlayer.UpdateHandCardsPlayability(); diff --git a/SVSim.BattleEngine/Engine/Skill_return_card.cs b/SVSim.BattleEngine/Engine/Skill_return_card.cs index 533b03b5..9b7f683d 100644 --- a/SVSim.BattleEngine/Engine/Skill_return_card.cs +++ b/SVSim.BattleEngine/Engine/Skill_return_card.cs @@ -31,7 +31,7 @@ public class Skill_return_card : SkillBase List source2 = (base.SkillPrm.selfBattlePlayer.IsPlayer ? list2 : list); List playerCardsToReturn = source.Where((BattleCardBase c) => !c.IsDestroyedBySkill).ToList(); List enemyCardsToReturn = source2.Where((BattleCardBase c) => !c.IsDestroyedBySkill).ToList(); - ReturnCardVfx returnCardVfx = new ReturnCardVfx(playerCardsToReturn, enemyCardsToReturn, base.SkillPrm.resourceMgr); + SequentialVfxPlayer returnCardVfx = SequentialVfxPlayer.Create(); if (IsBattleLog) { BattleLogManager instance = BattleLogManager.GetInstance(); diff --git a/SVSim.BattleEngine/Engine/Skill_shield.cs b/SVSim.BattleEngine/Engine/Skill_shield.cs index 571c1628..6f6b529a 100644 --- a/SVSim.BattleEngine/Engine/Skill_shield.cs +++ b/SVSim.BattleEngine/Engine/Skill_shield.cs @@ -16,38 +16,8 @@ public class Skill_shield : SkillBase } } - public const string SHIELD_TYPE_ALL = "all"; - private SkillGainType _gainType; - public bool IsAllDamageShield - { - get - { - if (_gainType == SkillGainType.Null || _gainType == SkillGainType.ShieldAll) - { - return !base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDamageAfterStop); - } - return false; - } - } - - public bool IsNextDamageShield - { - get - { - if (_gainType == SkillGainType.Null || _gainType == SkillGainType.ShieldAll) - { - return base.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDamageAfterStop); - } - return false; - } - } - - public bool IsSkillDamageShield => _gainType == SkillGainType.ShieldSkill; - - public bool IsSpellDamageShield => _gainType == SkillGainType.ShieldSpell; - public Skill_shield(SkillParameter skillPrm, string option) : base(skillPrm, option) { diff --git a/SVSim.BattleEngine/Engine/Skill_shortage_deck_win.cs b/SVSim.BattleEngine/Engine/Skill_shortage_deck_win.cs index 07537876..530a7cc2 100644 --- a/SVSim.BattleEngine/Engine/Skill_shortage_deck_win.cs +++ b/SVSim.BattleEngine/Engine/Skill_shortage_deck_win.cs @@ -6,7 +6,6 @@ using Wizard.Battle.View.Vfx; public class Skill_shortage_deck_win : SkillBase { - private const string CANT_ACTIVATE_EFFECT_PATH = "btl_nerva_4"; public Skill_shortage_deck_win(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -41,8 +40,8 @@ public class Skill_shortage_deck_win : SkillBase { BattleLogManager.GetInstance().AddLogSkillShortageDeckWin(list.ToList(), this); } - vfxWithLoadingSequential.RegisterToMainVfx(CreateSingleVfx(BattleManagerBase.GetIns().BattleResourceMgr, () => Vector3.zero, list)); - vfxWithLoadingSequential.RegisterToMainVfx(new SetShortageDeckWinVfx(base.SkillPrm.ownerCard.SelfBattlePlayer.IsPlayer)); + vfxWithLoadingSequential.RegisterToMainVfx(CreateSingleVfx(SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.BattleResourceMgr, () => Vector3.zero, list)); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.OperateMgr.CallOnEffect(base.SkillPrm.buildInfo, isFollowInHand: false, isTargetPosition: true); return vfxWithLoadingSequential; } diff --git a/SVSim.BattleEngine/Engine/Skill_special_lose.cs b/SVSim.BattleEngine/Engine/Skill_special_lose.cs index ecaa5984..7e5e1081 100644 --- a/SVSim.BattleEngine/Engine/Skill_special_lose.cs +++ b/SVSim.BattleEngine/Engine/Skill_special_lose.cs @@ -4,9 +4,6 @@ using Wizard.Battle.View.Vfx; public class Skill_special_lose : SkillBase { - protected const string OPTION_TRUE = "true"; - - private const string OPTION_WHEN_SPECIAL_LOSE = "when_special_lose"; public Skill_special_lose(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -15,7 +12,7 @@ public class Skill_special_lose : SkillBase public override VfxWithLoading Start(CallParameter parameter) { - if (BattleManagerBase.IsForecast) + if (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { return NullVfxWithLoading.GetInstance(); } diff --git a/SVSim.BattleEngine/Engine/Skill_special_token_draw.cs b/SVSim.BattleEngine/Engine/Skill_special_token_draw.cs index 14d0397b..67bd554e 100644 --- a/SVSim.BattleEngine/Engine/Skill_special_token_draw.cs +++ b/SVSim.BattleEngine/Engine/Skill_special_token_draw.cs @@ -9,11 +9,6 @@ using Wizard.Battle.View.Vfx; public class Skill_special_token_draw : SkillBase { - private const string TOKEN_EFFECT_PATH = "cmn_token_draw_1"; - - public const float BEFORE_TRANSFORM_WAIT_TIME = 0f; - - public const float AFTER_TRANSFORM_WAIT_TIME = 0.2f; protected IEnumerable _beforeTransformTokenId; @@ -114,7 +109,7 @@ public class Skill_special_token_draw : SkillBase _transformEffectPath = "cmn_token_draw_1"; _beforeChangeWaitTime = 0f; _afterChangeWaitTime = 0.2f; - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; + DataMgr.SpecialBattleSetting specialBattleSettingInfo = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().SpecialBattleSettingInfo; if (specialBattleSettingInfo != null && specialBattleSettingInfo.SpecialTokenDrawOverrideEffectPair.ContainsKey(afterTransformDrawList.First().CardId)) { _transformEffectPath = specialBattleSettingInfo.SpecialTokenDrawOverrideEffectPair[afterTransformDrawList.First().CardId]; @@ -129,7 +124,7 @@ public class Skill_special_token_draw : SkillBase } } } - vfxWithLoadingSequential.RegisterToMainVfx(new DrawSpecialTokenVfx(beforeTransformDrawList, afterTransformDrawList, vfxWithLoading.MainVfx, playerSide, this, _beforeChangeWaitTime, _afterChangeWaitTime, _transformEffectPath)); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); vfxWithLoadingSequential.RegisterToMainVfx(InstantVfx.Create(delegate { @@ -150,7 +145,8 @@ public class Skill_special_token_draw : SkillBase public static VfxWithLoading CreateTokenSpawnVfx(SkillBase skill, BattleCardBase firstToken) { - if (BattleManagerBase.GetIns().IsRecovery) + // Static helper with `skill` param — route through skill.SkillPrm rather than instance SkillPrm. + if (skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { return NullVfxWithLoading.GetInstance(); } @@ -168,7 +164,7 @@ public class Skill_special_token_draw : SkillBase _ => Color.clear, }; string text = "cmn_token_draw_1"; - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; + DataMgr.SpecialBattleSetting specialBattleSettingInfo = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().SpecialBattleSettingInfo; if (specialBattleSettingInfo != null && specialBattleSettingInfo.TokenDrawOverrideEffectPair.ContainsKey(firstToken.CardId)) { text = specialBattleSettingInfo.TokenDrawOverrideEffectPair[firstToken.CardId]; diff --git a/SVSim.BattleEngine/Engine/Skill_special_win.cs b/SVSim.BattleEngine/Engine/Skill_special_win.cs index b7f07119..21743af6 100644 --- a/SVSim.BattleEngine/Engine/Skill_special_win.cs +++ b/SVSim.BattleEngine/Engine/Skill_special_win.cs @@ -5,15 +5,6 @@ using Wizard.Battle.View.Vfx; public class Skill_special_win : SkillBase { - private const int SHAKE_SCREEN_MAX_VALUE = 10; - - private const float SHAKE_CAMERA_VECTOR_VALUE = 0.02f; - - private const float SHAKE_CAMERA_TIME_COEFFICIENT = 0.05f; - - private const float SHAKE_CAMERA_TIME_OFFSET = 0.2f; - - private const string OPTION_WHEN_SPECIAL_LOSE = "when_special_lose"; public Skill_special_win(SkillParameter skillPrm, string option) : base(skillPrm, option) @@ -22,7 +13,7 @@ public class Skill_special_win : SkillBase public override VfxWithLoading Start(CallParameter parameter) { - if (BattleManagerBase.IsForecast) + if (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast) { return NullVfxWithLoading.GetInstance(); } @@ -36,7 +27,7 @@ public class Skill_special_win : SkillBase if (processInfo != null && !flag) { parameter.skillProcessor.Register(processInfo); - if (!BattleManagerBase.GetIns().IsRecovery) + if (!SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { BattleCardBase targetClass = targetCard.OpponentBattlePlayer.Class; sequentialVfxPlayer.Register(SkillBase.CreateSingleVfx(base.SkillPrm.resourceMgr, () => targetClass.BattleCardView.GameObject.transform.position, new List { targetClass }, targetClass.IsPlayer, targetClass.BattleCardView, "btl_nerva_2", EffectMgr.EngineType.SHURIKEN, "se_btl_nerva_2", EffectMgr.MoveType.DIRECT_LEADER, EffectMgr.TargetType.SINGLE, 0f)); @@ -64,12 +55,9 @@ public class Skill_special_win : SkillBase return VfxWithLoading.Create(vfxWithLoading.LoadingVfx, mainVfx); } + // Pre-Phase-5b: static camera-shake helper. Headless has no BattleCamera / BackGround view; + // the enclosing "special win" celebratory VFX is unreachable. Method body stubbed to no-op. public static void ShakeScreen(int shakeScreenMinValue = 10) { - BattleManagerBase ins = BattleManagerBase.GetIns(); - float num = Mathf.Min(10, shakeScreenMinValue); - BattleCamera camera = ins.Camera; - ins.VfxMgr.RegisterImmediateVfx(SequentialVfxPlayer.Create(camera.ShakeCamera(Vector3.one * (num * 0.02f), num * 0.05f + 0.2f, 0f), WaitVfx.Create(num * 0.05f + 0.2f), camera.ShakeComplete())); - ins.BackGround.StartFieldShake(); } } diff --git a/SVSim.BattleEngine/Engine/Skill_spell_charge.cs b/SVSim.BattleEngine/Engine/Skill_spell_charge.cs index 71e367a2..e32be8d3 100644 --- a/SVSim.BattleEngine/Engine/Skill_spell_charge.cs +++ b/SVSim.BattleEngine/Engine/Skill_spell_charge.cs @@ -54,7 +54,7 @@ public class Skill_spell_charge : SkillBase _targetCards.Add(item); _addList.Add(AddCount); parameter.skillProcessor.Register(item.Skills.CreateWhenSpellChargeInfo(parameter.skillProcessor, playerInfoPair, AddCount)); - if ((item.IsPlayer || GameMgr.GetIns().IsAdminWatch) && !item.IsInDeck) + if ((item.IsPlayer || SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) && !item.IsInDeck) { parallelVfxPlayer.Register(item.GetSpellChargeLoopEffect(AddCount)); } diff --git a/SVSim.BattleEngine/Engine/Skill_stack_white_ritual.cs b/SVSim.BattleEngine/Engine/Skill_stack_white_ritual.cs index f240d42c..207d863d 100644 --- a/SVSim.BattleEngine/Engine/Skill_stack_white_ritual.cs +++ b/SVSim.BattleEngine/Engine/Skill_stack_white_ritual.cs @@ -5,7 +5,6 @@ using Wizard.Battle.View.Vfx; public class Skill_stack_white_ritual : SkillBase { - public const int DEFAULT_WHITE_RITUAL_COUNT = 1; protected int _addCount; @@ -41,7 +40,7 @@ public class Skill_stack_white_ritual : SkillBase } base.SkillPrm.ownerCard.SkillApplyInformation.GiveWhiteRitualCount(_addCount); vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer); - vfxWithLoadingSequential.RegisterToMainVfx(new ChangeWhiteRitualCountVfx(base.SkillPrm.ownerCard, _addCount)); + vfxWithLoadingSequential.RegisterToMainVfx(NullVfx.GetInstance()); if (base.SkillPrm.ownerCard.HasStackWhiteRitualAndOtherIconSkill()) { vfxWithLoadingSequential.RegisterToMainVfx(base.SkillPrm.ownerCard.BattleCardView.InitializeBattleCardIcon(base.SkillPrm.ownerCard, base.SkillPrm.ownerCard.Skills, _addCount != 0)); diff --git a/SVSim.BattleEngine/Engine/Skill_summon_card.cs b/SVSim.BattleEngine/Engine/Skill_summon_card.cs index f1e45983..d94ef939 100644 --- a/SVSim.BattleEngine/Engine/Skill_summon_card.cs +++ b/SVSim.BattleEngine/Engine/Skill_summon_card.cs @@ -69,7 +69,7 @@ public class Skill_summon_card : SkillBaseSummon } break; case SUMMON_TYPE.DECK: - if (GameMgr.GetIns().IsReplayBattle || !GameMgr.GetIns().IsNetworkBattle) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsReplayBattle || !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsNetworkBattle) { for (int num = 0; num < _summonedCardsList.summonedCards.Count(); num++) { @@ -85,8 +85,8 @@ public class Skill_summon_card : SkillBaseSummon if (IsDeckSelfSummon) { BattleCardBase battleCardBase = _summonedCardsList.summonedCards.First(); - sequentialVfxPlayer.Register(new DeckSelfSummonVfx(battleCardBase, base.SkillPrm.resourceMgr)); - parallelVfxPlayer2.Register(new SummonCardShakeCameraVfx(battleCardBase)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); + parallelVfxPlayer2.Register(NullVfx.GetInstance()); } VfxWithLoadingSequential vfxWithLoadingSequential2 = VfxWithLoadingSequential.Create(vfxWithLoadingSequential.LoadingVfx, parallelVfxPlayer, sequentialVfxPlayer, parallelVfxPlayer2, vfxWithLoadingSequential.MainVfx); vfxWithLoadingSequential2.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); diff --git a/SVSim.BattleEngine/Engine/Skill_summon_token.cs b/SVSim.BattleEngine/Engine/Skill_summon_token.cs index 2037e0e1..564f4c1f 100644 --- a/SVSim.BattleEngine/Engine/Skill_summon_token.cs +++ b/SVSim.BattleEngine/Engine/Skill_summon_token.cs @@ -8,7 +8,6 @@ using Wizard.Battle.View.Vfx; public class Skill_summon_token : SkillBaseSummon { - private const string SELF_TURN_END = "self_turn_end"; private ApplySkillTargetFilterCollection _filters; @@ -84,7 +83,7 @@ public class Skill_summon_token : SkillBaseSummon string text = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.summon_token, "_OPT_NULL_"); string option = base.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.summon_side, "null"); string option2 = base.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.effect, "NONE"); - bool flag = num >= 0 && !BattleManagerBase.IsForecast; + bool flag = num >= 0 && !base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsForecast; if (parameter.targetCards.Count() > 0) { enumerable = GetTargetId(parameter.targetCards, IsMakeFoil); diff --git a/SVSim.BattleEngine/Engine/Skill_token_draw.cs b/SVSim.BattleEngine/Engine/Skill_token_draw.cs index ef5ad1b3..ba866e22 100644 --- a/SVSim.BattleEngine/Engine/Skill_token_draw.cs +++ b/SVSim.BattleEngine/Engine/Skill_token_draw.cs @@ -9,17 +9,6 @@ using Wizard.Battle.View.Vfx; public class Skill_token_draw : SkillBase { - protected const string OPTION_DUPLICATION_FALSE = "false"; - - public const string OPTION_DUPLICATION_TRUE = "true"; - - private const string TOKEN_EFFECT_PATH = "cmn_token_draw_1"; - - private const string OPTION_OLDEST = "oldest"; - - private const string OPTION_EXCEPT_FUSION_CARD_ID_TRUE = "true"; - - private const string OPTION_EXCEPT_GAME_PLAY_CARD_ID_TRUE = "true"; protected IEnumerable _tokenIds; @@ -31,14 +20,6 @@ public class Skill_token_draw : SkillBase protected int _randomCount = -1; - private const string GLEAMING_GEM = "Gleaming_Gem_"; - - private const string RADIANT_CRYSTAL = "Radiant_Crystal_"; - - private const string GLEAMING_GEM_V2 = "Gleaming_Gem_v2_"; - - private const string RADIANT_CRYSTAL_V2 = "Radiant_Crystal_v2_"; - public override bool IsTargetIndicate => false; public override bool IsAllowDestroyTarget => true; @@ -175,7 +156,7 @@ public class Skill_token_draw : SkillBase { string[] source = text.Replace(")", "").Replace("(", "").Split(':'); int classType = 0; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr(); foreach (BattleCardBase targetCard in targetCards) { classType = (targetCard.IsPlayer ? dataMgr.GetPlayerClassId() : dataMgr.GetEnemyClassId()); @@ -301,7 +282,7 @@ public class Skill_token_draw : SkillBase { IsVisibleTarget = true; } - vfxWithLoading.RegisterToMainVfx(new DrawTokenVfx(drawList, vfxWithLoading2.MainVfx, playerSide, IsVisibleTarget)); + vfxWithLoading.RegisterToMainVfx(NullVfx.GetInstance()); vfxWithLoading.RegisterToLoadingVfx(vfxWithLoading2.LoadingVfx); vfxWithLoading.RegisterToMainVfx(InstantVfx.Create(delegate { @@ -344,7 +325,7 @@ public class Skill_token_draw : SkillBase public virtual bool IsVisibleDrawSkillTarget(BattlePlayerBase selfBattlePlayer, CallParameter parameter) { - if (!selfBattlePlayer.IsPlayer && !GameMgr.GetIns().IsAdminWatch) + if (!selfBattlePlayer.IsPlayer && !SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch) { if (parameter.targetCards.Count() > 0) { @@ -395,7 +376,7 @@ public class Skill_token_draw : SkillBase { continue; } - int index = (BattleManagerBase.IsRandomDraw ? base.SkillPrm.selfBattlePlayer.BattleMgr.StableRandom(list.Count) : num2); + int index = (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsRandomDraw ? base.SkillPrm.selfBattlePlayer.BattleMgr.StableRandom(list.Count) : num2); int id = list[index]; if (!allowDuplication) { @@ -408,7 +389,8 @@ public class Skill_token_draw : SkillBase public static VfxWithLoading CreateTokenSpawnVfx(SkillBase skill, BattleCardBase firstToken) { - if (BattleManagerBase.GetIns().IsRecovery) + // Static helper with `skill` param — route through skill.SkillPrm rather than instance SkillPrm. + if (skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.IsRecovery) { return NullVfxWithLoading.GetInstance(); } @@ -426,7 +408,7 @@ public class Skill_token_draw : SkillBase _ => Color.clear, }; string text = "cmn_token_draw_1"; - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; + DataMgr.SpecialBattleSetting specialBattleSettingInfo = skill.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.GetDataMgr().SpecialBattleSettingInfo; if (specialBattleSettingInfo != null && specialBattleSettingInfo.TokenDrawOverrideEffectPair.ContainsKey(firstToken.CardId)) { text = specialBattleSettingInfo.TokenDrawOverrideEffectPair[firstToken.CardId]; diff --git a/SVSim.BattleEngine/Engine/Skill_transform.cs b/SVSim.BattleEngine/Engine/Skill_transform.cs index 57169205..dfbf76ac 100644 --- a/SVSim.BattleEngine/Engine/Skill_transform.cs +++ b/SVSim.BattleEngine/Engine/Skill_transform.cs @@ -2,7 +2,6 @@ using Wizard.Battle.View.Vfx; public class Skill_transform : SkillBaseSummon { - private const float METAMORPHOSE_STAGGER_TIME_AMOUNT = 0.1f; public int TransformId { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Skill_unite.cs b/SVSim.BattleEngine/Engine/Skill_unite.cs index 23e00a20..c30b4e7d 100644 --- a/SVSim.BattleEngine/Engine/Skill_unite.cs +++ b/SVSim.BattleEngine/Engine/Skill_unite.cs @@ -19,10 +19,6 @@ public class Skill_unite : SkillBaseSummon } } - private const string OPTION_UNITE_COMBINE = "combine"; - - private const string OPTION_UNITE_MIX = "mix"; - protected UniteCardPair _uniteCardPair; public Skill_unite(SkillParameter skillPrm, string option) diff --git a/SVSim.BattleEngine/Engine/Skill_untouchable.cs b/SVSim.BattleEngine/Engine/Skill_untouchable.cs index 9366f820..41554d3e 100644 --- a/SVSim.BattleEngine/Engine/Skill_untouchable.cs +++ b/SVSim.BattleEngine/Engine/Skill_untouchable.cs @@ -5,9 +5,6 @@ using Wizard.Battle.View.Vfx; public class Skill_untouchable : SkillBase { - public const string UNTOUCHBLE_TYPE_ALL = "all"; - - public const string UNTOUCHBLE_TYPE_SPELL = "spell"; private string _cardType; diff --git a/SVSim.BattleEngine/Engine/Skill_update_deck.cs b/SVSim.BattleEngine/Engine/Skill_update_deck.cs index 52a13a59..dac28009 100644 --- a/SVSim.BattleEngine/Engine/Skill_update_deck.cs +++ b/SVSim.BattleEngine/Engine/Skill_update_deck.cs @@ -23,12 +23,6 @@ public class Skill_update_deck : SkillBase } } - public const string OPTION_UPDATE_CHANGE = "change"; - - private const string OPTION_FALSE = "false"; - - private const string OPTION_TRUE = "true"; - protected string _updateType = "change"; protected bool _isReferenceOpponentCard; @@ -183,7 +177,7 @@ public class Skill_update_deck : SkillBase parameter.calledSkillResultInfo.UpdatedDeckCards = new List(); if (_updateType == "change") { - _vfxWithLoading.RegisterToMainVfx(new DummyDeckChangeCardVfx(battlePlayerBase.IsPlayer, battlePlayerBase.DeckCardList.Count)); + _vfxWithLoading.RegisterToMainVfx(NullVfx.GetInstance()); } return _vfxWithLoading; } @@ -210,18 +204,18 @@ public class Skill_update_deck : SkillBase if (_updateType != "change") { VfxWithLoading vfxWithLoading = Skill_token_draw.CreateTokenSpawnVfx(this, _addCards.First()); - _vfxWithLoading.RegisterToMainVfx(new AddTokenDeckVfx(_addCards, vfxWithLoading.MainVfx, battlePlayerBase, parallelVfxPlayer, flag2)); + _vfxWithLoading.RegisterToMainVfx(NullVfx.GetInstance()); _vfxWithLoading.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx); } if (_updateType != "change" && (_isUsingTargetCards || num > 0)) { CreateWhenAddToDeckInfo(parameter, battlePlayerBase, flag ? base.SkillPrm.opponentBattlePlayer : base.SkillPrm.selfBattlePlayer); } - _vfxWithLoading.RegisterToMainVfx(new DummyDeckChangeCardVfx(battlePlayerBase.IsPlayer, battlePlayerBase.DeckCardList.Count)); - _vfxWithLoading.RegisterToMainVfx(new DeckChangeVfx(battlePlayerBase)); + _vfxWithLoading.RegisterToMainVfx(NullVfx.GetInstance()); + _vfxWithLoading.RegisterToMainVfx(NullVfx.GetInstance()); if (IsBattleLog) { - bool isAdminWatch = GameMgr.GetIns().IsAdminWatch; + bool isAdminWatch = SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.GameMgr.IsAdminWatch; if ((!_isUsingTargetCards || base.SkillPrm.ownerCard.IsPlayer || _isReferenceOpponentCard || _isReferenceFusionedCard || isAdminWatch || IsOpen) && _updateType != "change") { BattleLogManager.GetInstance().AddLogSkillAddDeck(_addCards, this); @@ -239,19 +233,11 @@ public class Skill_update_deck : SkillBase return targetCards.Select((BattleCardBase card) => (!card.IsChoiceEvolutionCard) ? card.BaseParameter.NormalCardId : card.BaseParameter.BaseCardId); } - public static IEnumerable ParseOptionTokenID(string option) - { - return from str in (from s in option.Replace(")", "").Replace("(", "").Split(':') - where !s.Contains("?") - select s).ToArray() - select int.Parse(str); - } - protected virtual void CreateWhenAddToDeckInfo(CallParameter parameter, BattlePlayerBase self, BattlePlayerBase opp) { List list = new List(); list.AddRange(self.HandCardList); - if (BattleManagerBase.GetIns() is SingleBattleMgr) + if (SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr is SingleBattleMgr) { list.AddRange(self.ClassAndInPlayCardList); } @@ -285,7 +271,7 @@ public class Skill_update_deck : SkillBase { continue; } - int index = (BattleManagerBase.IsRandomDraw ? base.SkillPrm.selfBattlePlayer.BattleMgr.StableRandom(list.Count) : num2); + int index = (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr.InstanceIsRandomDraw ? base.SkillPrm.selfBattlePlayer.BattleMgr.StableRandom(list.Count) : num2); int id = list[index]; if (!allowDuplication) { diff --git a/SVSim.BattleEngine/Engine/SlideObjectReceiveControl.cs b/SVSim.BattleEngine/Engine/SlideObjectReceiveControl.cs index 0168eefb..8f6f1b48 100644 --- a/SVSim.BattleEngine/Engine/SlideObjectReceiveControl.cs +++ b/SVSim.BattleEngine/Engine/SlideObjectReceiveControl.cs @@ -37,7 +37,7 @@ public class SlideObjectReceiveControl if (_slideStartObject != indexToCardBase2.BattleCardView.GameObject) { IBattleCardView battleCardView = indexToCardBase2.BattleCardView; - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(SequentialVfxPlayer.Create(new WaitLoadVoiceResourceVfx(battleCardView, battleCardView.VoiceInfo.VoiceId), new PlayCRISoundVfx(battleCardView, battleCardView.VoiceInfo.GetAttackVoice(indexToCardBase2.IsEvolution).Voice))); + _networkBattleMgr.VfxMgr.RegisterImmediateVfx(SequentialVfxPlayer.Create(NullVfx.GetInstance(), NullVfx.GetInstance())); _networkBattleMgr.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(0.5f)); } StartSlide(indexToCardBase2.BattleCardView.GameObject, indexToCardBase3.BattleCardView.GameObject, receivedData._slideObjectType, isSelf, isEvol: false); @@ -60,13 +60,13 @@ public class SlideObjectReceiveControl { if (!(_slideStartObject == null)) { - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(new StopEvolutionChoiceEffectVfx(_networkBattleMgr.BattlePlayer.BattleView.EpIcon)); - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(new StopEvolutionChoiceEffectVfx(_networkBattleMgr.BattleEnemy.BattleView.EpIcon)); + _networkBattleMgr.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); + _networkBattleMgr.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); _slideStartObject = null; BattleCoroutine.GetInstance().StopCoroutine(_slideCoroutine); _slideCoroutine = null; - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(new StopArrowMoveVfx(_networkBattleMgr)); - GameMgr.GetIns().GetEffectMgr().Stop(GetSlideLockOnEffect()); + _networkBattleMgr.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); + _networkBattleMgr.GameMgr.GetEffectMgr().Stop(GetSlideLockOnEffect()); } } @@ -85,14 +85,14 @@ public class SlideObjectReceiveControl BattlePlayerBase battlePlayer = _networkBattleMgr.GetBattlePlayer(isTargettingEnemy); if (isEvol) { - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(new StartEvolutionChoiceEffectVfx(battlePlayer.BattleView.EpIcon, !battlePlayer.IsEvolve && battlePlayer.IsExceptionEvolve)); + _networkBattleMgr.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); } _networkBattleMgr.BattlePlayer.PlayerBattleView.DragArrowStart(_networkBattleMgr, startObject, _networkBattleMgr.AttackArrowHead, isTargettingEnemy); BattleCoroutine.GetInstance().StartCoroutine(_slideCoroutine); } EffectMgr.EffectType slideLockOnEffect = GetSlideLockOnEffect(); - GameMgr.GetIns().GetEffectMgr().Stop(slideLockOnEffect); - GameMgr.GetIns().GetEffectMgr().Start(slideLockOnEffect, endObject.transform.position, endObject); + _networkBattleMgr.GameMgr.GetEffectMgr().Stop(slideLockOnEffect); + _networkBattleMgr.GameMgr.GetEffectMgr().Start(slideLockOnEffect, endObject.transform.position, endObject); } private IEnumerator SlideToTarget() diff --git a/SVSim.BattleEngine/Engine/SoundMgr.cs b/SVSim.BattleEngine/Engine/SoundMgr.cs deleted file mode 100644 index a2f58fb4..00000000 --- a/SVSim.BattleEngine/Engine/SoundMgr.cs +++ /dev/null @@ -1,730 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using Wizard; - -public class SoundMgr -{ - private enum LoadType - { - Se, - Bgm, - Voice, - TemporaryVoice, - EnvSound - } - - private Se m_Se; - - private Voice m_Voice; - - private Bgm m_Bgm; - - public static readonly string PREINSTALL_CUESHEET = "preinstall"; - - private string PREINSTALL_ACB = "preinstall.acb"; - - private string PREINSTALL_AWB = "preinstall.awb"; - - private const float BGM_DEFAULT_FADEOUT_TIME = 2f; - - private const float BGM_SAME_WAIT_TIME = 1f; - - private float m_movieVolume; - - private bool m_isMovieMute; - - private bool _rejectNewSound; - - public SoundMgr() - { - m_Se = new Se(); - m_Bgm = new Bgm(); - m_Voice = new Voice(); - SetMovieVolume(1f); - MovieMute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - if (!UIManager.GetInstance().ApplicationHasFocus) - { - OnFocus(focus: false); - } - } - - public void SetCueInfo() - { - if (!Toolbox.AudioManager.AddCueSheet(PREINSTALL_CUESHEET, PREINSTALL_ACB, "", PREINSTALL_AWB)) - { - throw new Exception("CRI initialization failed. Make sure your cuesheet and .acb files are existed in an application folder installed."); - } - } - - public void AssignSe() - { - m_Se.Load(Se.TYPE.BREAKCARD, "se_breakcard"); - m_Se.Load(Se.TYPE.SYS_CARD_SCROLL, "se_sys_card_scroll"); - m_Se.Load(Se.TYPE.SYS_COMMON_BUTTON, "se_sys_button"); - m_Se.Load(Se.TYPE.SYS_COMMON_CANCEL, "se_sys_cancel"); - m_Se.Load(Se.TYPE.SYS_COMMON_DECIDE, "se_sys_title_start"); - m_Se.Load(Se.TYPE.SYS_TITLE_START, "se_sys_title_start"); - m_Se.Load(Se.TYPE.SYS_BTN_DECIDE, "se_sys_button"); - m_Se.Load(Se.TYPE.SYS_BTN_DECIDE_TRANS, "se_sys_button_large"); - m_Se.Load(Se.TYPE.SYS_BTN_CANCEL, "se_sys_cancel_window_1"); - m_Se.Load(Se.TYPE.SYS_BTN_CANCEL_TRANS, "se_sys_cancel"); - m_Se.Load(Se.TYPE.SYS_SWITCH_MENU, "se_sys_switch_menu"); - m_Se.Load(Se.TYPE.SYS_MENU_CARD, "se_sys_button_menu_card"); - m_Se.Load(Se.TYPE.SYS_SWITCH_MENU_CARD, "se_sys_switch_menu_card"); - m_Se.Load(Se.TYPE.SYS_TOGGLE_ON, "se_sys_button_toggle_on"); - m_Se.Load(Se.TYPE.SYS_TOGGLE_OFF, "se_sys_button_toggle_off"); - m_Se.Load(Se.TYPE.SYS_SLIDE_BTN, "se_sys_slide"); - m_Se.Load(Se.TYPE.SYS_CARD_INFO, "se_sys_cardinfo"); - m_Se.Load(Se.TYPE.SYS_DRAG_CARD, "se_sys_drag_card"); - m_Se.Load(Se.TYPE.SYS_BAR_SLIDE, "se_sys_bar_slide"); - m_Se.Load(Se.TYPE.SYS_CARD_TOUCH, "se_sys_card_touch"); - m_Se.Load(Se.TYPE.SYS_2PICK_SELECT, "se_sys_2pick_card_select"); - m_Se.Load(Se.TYPE.SYS_2PICK_BOX_OPEN, "se_sys_2pick_box_open"); - m_Se.Load(Se.TYPE.SYS_CARD_MOVE_SINGLE_1, "se_sys_card_move_single_1"); - m_Se.Load(Se.TYPE.SYS_CARD_MOVE_SINGLE_2, "se_sys_card_move_single_2"); - m_Se.Load(Se.TYPE.SYS_CARD_MOVE_SINGLE_3, "se_sys_card_move_single_3"); - m_Se.Load(Se.TYPE.SYS_MYPAGE_EVOLVE, "se_sys_mypage_evolve"); - m_Se.Load(Se.TYPE.BATTLE_START_VS, "se_sys_battle_start_vs"); - m_Se.Load(Se.TYPE.BATTLE_START_VS_ST2, "se_sys_battle_start_vs_st2"); - m_Se.Load(Se.TYPE.DRAW, "se_sys_draw"); - m_Se.Load(Se.TYPE.DRAW_CARD_OPEN_LG, "se_sys_draw_card_open_lg"); - m_Se.Load(Se.TYPE.DRAW_CARD_OPEN, "se_sys_draw_card_open"); - m_Se.Load(Se.TYPE.MULLIGAN_SELECT_REPLACE_CARD, "se_sys_mulligan_select_replace_card"); - m_Se.Load(Se.TYPE.MULLIGAN_CANCEL_REPLACE_CARD, "se_sys_mulligan_cancel_replace_card"); - m_Se.Load(Se.TYPE.MULLIGAN_DECIDE, "se_sys_mulligan_decide"); - m_Se.Load(Se.TYPE.MULLIGAN_CARD_RETURN, "se_sys_mulligan_card_return"); - m_Se.Load(Se.TYPE.SET_CARD_TO_HAND, "se_sys_set_card_to_hand"); - m_Se.Load(Se.TYPE.SYS_BREAK_CHARACTER, "se_sys_break_character"); - m_Se.Load(Se.TYPE.SYS_TURN_END, "se_sys_turn_end"); - m_Se.Load(Se.TYPE.SYS_TURN_END_CONFIRM, "se_sys_turn_end_confirm"); - m_Se.Load(Se.TYPE.SYS_CAMERA_ZOOM_OUT, "se_sys_camera_zoom_out"); - m_Se.Load(Se.TYPE.SYS_ACTUVATE_TURNEND_BUTTON, "se_sys_activate_turnend_button"); - m_Se.Load(Se.TYPE.SYS_OPEN_SEQUENCE_CARD, "se_sys_open_sequence_card"); - m_Se.Load(Se.TYPE.SYS_CMN_CARD_DRAW_4, "se_cmn_card_draw_4"); - m_Se.Load(Se.TYPE.SYS_CMN_CARD_SELECT_3, "se_cmn_card_select_3"); - m_Se.Load(Se.TYPE.SYS_CMN_CARD_RETURN_1, "se_cmn_card_return_1"); - m_Se.Load(Se.TYPE.SYS_ATTACK_ICON_1, "se_stt_state_attack_1"); - m_Se.Load(Se.TYPE.SYS_ATTACK_ICON_2, "se_stt_state_attack_2"); - m_Se.Load(Se.TYPE.SYS_ATTACK_ICON_3, "se_stt_state_attack_3"); - m_Se.Load(Se.TYPE.SYS_CMN_UI_EP_6, "se_cmn_ui_ep_6"); - m_Se.Load(Se.TYPE.SYS_DECK_CARD_MOVE_IN, "se_sys_card_move_in"); - m_Se.Load(Se.TYPE.SYS_DECK_CARD_MOVE_OUT, "se_sys_card_move_out"); - m_Se.Load(Se.TYPE.SYS_USE_RED_ETHER, "se_sys_use_redaether"); - m_Se.Load(Se.TYPE.SYS_GET_RED_ETHER, "se_sys_get_redaether"); - m_Se.Load(Se.TYPE.SYS_CARDLIST_REVERSE, "se_sys_card_move_open"); - m_Se.Load(Se.TYPE.SYS_DECK_IN, "se_sys_deck_in"); - m_Se.Load(Se.TYPE.SYS_DECK_OUT, "se_sys_deck_out"); - m_Se.Load(Se.TYPE.SYS_GIFT_ALL, "se_sys_gift_slide"); - m_Se.Load(Se.TYPE.SYS_DIALOG_OPEN, "se_sys_popup_window"); - m_Se.Load(Se.TYPE.SYS_DL_CARD_APPEAR, "se_sys_card_appear"); - m_Se.Load(Se.TYPE.SYS_CARD_INFO_SMALL, "se_sys_cardinfo_small"); - m_Se.Load(Se.TYPE.SYS_CARD_INFO_CANCEL, "se_sys_cardinfo_small_cancel"); - m_Se.Load(Se.TYPE.SYS_FEED_TEXT, "se_sys_feed_text"); - m_Se.Load(Se.TYPE.SYS_SCROLL, "se_sys_scroll"); - m_Se.Load(Se.TYPE.SYS_PROLOGUE_CHAR_APPEAR, "se_st_prologue_char_appear"); - m_Se.Load(Se.TYPE.SYS_PROLOGUE_CHAR_APPEAR_EFFECT, "se_st_prologue_char_appear_light"); - m_Se.Load(Se.TYPE.SYS_PROLOGUE_CHAR_LEAVE, "se_st_prologue_char_leave"); - m_Se.Load(Se.TYPE.SYS_MAP_CLEAR, "se_st_map_clear"); - m_Se.Load(Se.TYPE.SYS_MAP_CAMERA_MOVE, "se_st_map_camera_move"); - m_Se.Load(Se.TYPE.SYS_MAP_NEW_AREA_RELEASE, "se_st_map_new_area_release"); - m_Se.Load(Se.TYPE.SYS_MAP_CUTIN_TEXT, "se_st_map_cutin_text"); - m_Se.Load(Se.TYPE.SE_MAP_TREE_EFFECT, "se_st_map_chapter_change_01"); - m_Se.Load(Se.TYPE.SE_MAP_SECTION9_CHAPTER1, "se_st_map_chapter_change_02"); - m_Se.Load(Se.TYPE.SE_MAP_SECTION9_CHAPTER2, "se_st_map_chapter_change_03"); - m_Se.Load(Se.TYPE.SE_MAP_SECTION9_CHANGE_CHAPTER, "se_st_map_chapter_change_09"); - m_Se.Load(Se.TYPE.SE_MAP_BACKGROUND_CHANGE_FIRST_CLEAR_604, "se_st_map_chapter_change_05"); - m_Se.Load(Se.TYPE.SE_MAP_BACKGROUND_CHANGE_604, "se_st_map_chapter_change_06"); - m_Se.Load(Se.TYPE.SE_MAP_BACKGROUND_CHANGE_FIRST_CLEAR_614, "se_st_map_chapter_change_07"); - m_Se.Load(Se.TYPE.SE_MAP_CHAPTER_SELECT_FOCUS_CHANGE, "se_st_chapterselect_switch"); - m_Se.Load(Se.TYPE.SE_MAP_CHAPTER_SELECT_CLEAR, "se_st_chapterselect_clear"); - m_Se.Load(Se.TYPE.SE_MAP_CHAPTER_SELECT_CHAPTER_RELEASE, "se_st_chapterselect_new_chapter_release"); - m_Se.Load(Se.TYPE.SE_MAP_CHAPTER_SELECT_LOCKED_CHAPTER_RELEASE, "se_st_chapterselect_lock_chapter_release"); - m_Se.Load(Se.TYPE.SE_MAP_CHAPTER_SELECT_UNLOCK, "se_st_chapterselect_unlock"); - m_Se.Load(Se.TYPE.SE_MAP_SECTION20_CHANGE_CHAPTER1, "se_st_map_chapter_change_09"); - m_Se.Load(Se.TYPE.LOGIN_BONUS_STAMP_1, "se_sys_login_stamp_1"); - m_Se.Load(Se.TYPE.LOGIN_BONUS_STAMP_2, "se_sys_login_stamp_2"); - m_Se.Load(Se.TYPE.LOGIN_BONUS_STAMP_NEXT, "se_sys_login_stamp_next"); - m_Se.Load(Se.TYPE.SYS_WINDOW_MOVE, "se_sys_window_move"); - m_Se.Load(Se.TYPE.SYS_ROOM_IN, "se_sys_room_match_in"); - m_Se.Load(Se.TYPE.SYS_ROOM_OUT, "se_sys_room_match_out"); - m_Se.Load(Se.TYPE.SYS_LOTTERY_BOX_TOUCH, "se_sys_lottery_box_touch"); - m_Se.Load(Se.TYPE.SYS_BOX_OPEN_SP, "se_sys_box_open_sp_01"); - m_Se.Load(Se.TYPE.SYS_SUMMON_CARD_DROP, "se_sys_summon_card_drop"); - m_Se.Load(Se.TYPE.SYS_YOURTURN, "se_sys_yourturn"); - m_Se.Load(Se.TYPE.SYS_SUMMON_LANDING, "se_sys_summon_landing"); - m_Se.Load(Se.TYPE.SYS_ENEMY_CARD_OPEN, "se_sys_enemy_card_open"); - m_Se.Load(Se.TYPE.SYS_ENEMY_SET_CARD_TO_HAND, "se_sys_enemy_set_card_to_hand"); - m_Se.Load(Se.TYPE.SYS_ARROW_DRAG, "se_sys_arrow_drag"); - m_Se.Load(Se.TYPE.SYS_ARROW_SELECT, "se_sys_arrow_select"); - m_Se.Load(Se.TYPE.SYS_DRAG_SLIDE, "se_sys_drag_slide"); - m_Se.Load(Se.TYPE.SYS_BATTLE_EVOLVE, "se_sys_evolve"); - m_Se.Load(Se.TYPE.SYS_BATTLE_EVOLVE_SKILL, "se_cmn_card_evo_5"); - m_Se.Load(Se.TYPE.SYS_BATTLE_EVOLVE_DRAG, "se_sys_evolve_drag"); - m_Se.Load(Se.TYPE.SYS_BATTLE_EVOLVE_CUTIN, "se_sys_evolve_cutin"); - m_Se.Load(Se.TYPE.SYS_SPELL_CAST, "se_sys_spell"); - m_Se.Load(Se.TYPE.SYS_SUMMON_FALL, "se_sys_summon_fall"); - m_Se.Load(Se.TYPE.SYS_HAND_MOVE_CENTER, "se_sys_hand_move_center"); - m_Se.Load(Se.TYPE.SYS_HAND_MOVE_RIGHT, "se_sys_hand_move_right"); - m_Se.Load(Se.TYPE.SYS_BREAK_LEADER, "se_sys_break_leader"); - m_Se.Load(Se.TYPE.SYS_BREAK_LEADER_ST1, "se_sys_break_leader_st1"); - m_Se.Load(Se.TYPE.SYS_BREAK_LEADER_ST2, "se_sys_break_leader_st2"); - m_Se.Load(Se.TYPE.SYS_APPEAR_MANA, "se_sys_appear_mana_ui"); - m_Se.Load(Se.TYPE.SYS_APPEAR_LEADER, "se_sys_appear_leader_icon"); - m_Se.Load(Se.TYPE.SYS_CMN_CLASS_DECKOUT_1, "se_cmn_class_deckout_1"); - m_Se.Load(Se.TYPE.SYS_REPLAY_TURN_SKIPPING, "se_replay_turn_skipping"); - m_Se.Load(Se.TYPE.SYS_HBP_BUTTON, "se_sys_hbp_button"); - m_Se.Load(Se.TYPE.SYS_HBP_UP, "se_sys_hbp_up"); - m_Se.Load(Se.TYPE.SYS_JINGLE_WIN, "bgm_btl_jingle_win"); - m_Se.Load(Se.TYPE.SYS_JINGLE_LOSE, "bgm_btl_jingle_lose"); - m_Se.Load(Se.TYPE.SYS_RESULT_GAUGEUP, "se_sys_result_gaugeup"); - m_Se.Load(Se.TYPE.SYS_RESULT_LEVELUP, "se_sys_result_levelup"); - m_Se.Load(Se.TYPE.SYS_RESULT_RANKUP, "se_sys_result_rankup"); - m_Se.Load(Se.TYPE.SYS_RESULT_WINDOW_APPER, "se_sys_result_window_appear"); - m_Se.Load(Se.TYPE.SYS_RESULT_YOUWIN, "se_sys_result_youwin"); - m_Se.Load(Se.TYPE.SYS_RESULT_YOULOSE, "se_sys_result_youlose"); - m_Se.Load(Se.TYPE.SYS_RESULT_PUZZLE_RESET, "se_sys_puzzle_reset"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_BEGIN, "se_rank_up_mach_begin"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_WINDOW_MOVE, "se_rank_up_mach_window_move"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_WIN, "se_rank_up_mach_win"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_SUCCESS, "se_rank_up_mach_success"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_LOSE, "se_rank_up_mach_lose"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_FAILED, "se_rank_up_mach_failed"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_RANK_DOWN, "se_rank_up_mach_rank_down"); - m_Se.Load(Se.TYPE.SYS_RANK_UP_MACH_SUCCES_2, "se_rank_up_mach_succes_2"); - m_Se.Load(Se.TYPE.SYS_BOSS_RUSH_RESULT_APPEAR, "se_sys_result_bossrush_appear"); - m_Se.Load(Se.TYPE.SYS_BOSS_RUSH_RESULT_CLEAR, "se_sys_result_bossrush_clear"); - m_Se.Load(Se.TYPE.SYS_BOSS_RUSH_RESULT_MOVE, "se_sys_result_bossrush_move"); - m_Se.Load(Se.TYPE.SYS_GACHA_LEGEND, "se_sys_gacha_legend"); - m_Se.Load(Se.TYPE.SYS_GACHA_EPIC, "se_sys_gacha_epic"); - m_Se.Load(Se.TYPE.SYS_GACHA_RARE, "se_sys_gacha_rare"); - m_Se.Load(Se.TYPE.SYS_GACHA_COMMON, "se_sys_gacha_common"); - m_Se.Load(Se.TYPE.SYS_GACHA_OPEN, "se_sys_gacha_open"); - m_Se.Load(Se.TYPE.SYS_GACHA_APPEAR, "se_sys_gacha_appear"); - m_Se.Load(Se.TYPE.SYS_GACHA_MOVE, "se_sys_gacha_move"); - m_Se.Load(Se.TYPE.SYS_GACHA_CHOICE, "se_sys_gacha_choice"); - m_Se.Load(Se.TYPE.SYS_GACHA_BACK, "se_sys_gacha_back"); - m_Se.Load(Se.TYPE.SYS_GACHA_RARE_LOOP, "se_sys_gacha_rare_loop"); - m_Se.Load(Se.TYPE.SYS_GACHA_EPIC_LOOP, "se_sys_gacha_epic_loop"); - m_Se.Load(Se.TYPE.SYS_GACHA_LEGEND_LOOP, "se_sys_gacha_legend_loop"); - m_Se.Load(Se.TYPE.SYS_GACHA_CARD_OUT, "se_sys_gacha_card_out"); - m_Se.Load(Se.TYPE.SYS_GACHA_CARD_IN, "se_sys_gacha_card_in"); - m_Se.Load(Se.TYPE.SE_SYS_WIN_REWARD_BOX_BIG, "se_sys_win_reward_box_big_1"); - m_Se.Load(Se.TYPE.SE_SYS_WIN_REWARD_BOX_SMALL, "se_sys_win_reward_box_small_1"); - m_Se.Load(Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_01, "se_sys_upgrade_treasure_box_01"); - m_Se.Load(Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_02, "se_sys_upgrade_treasure_box_02"); - m_Se.Load(Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_03, "se_sys_upgrade_treasure_box_03"); - m_Se.Load(Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_04, "se_sys_upgrade_treasure_box_04"); - } - - public void CreateBGMList() - { - m_Bgm.AddList(Bgm.BGM_TYPE.BATTLE_STANDBY, "bgm_btl_stand_by"); - m_Bgm.AddList(Bgm.BGM_TYPE.BATTLE, ""); - m_Bgm.AddList(Bgm.BGM_TYPE.SYS_WIN_LOOP, "bgm_btl_win", "bgm_btl_jingle"); - m_Bgm.AddList(Bgm.BGM_TYPE.SYS_LOSE_LOOP, "bgm_btl_lose", "bgm_btl_jingle"); - m_Bgm.AddList(Bgm.BGM_TYPE.HOME, "bgm_mpg_main"); - m_Bgm.AddList(Bgm.BGM_TYPE.TITLE, "bgm_ttl_main", PREINSTALL_CUESHEET); - m_Bgm.AddList(Bgm.BGM_TYPE.TITLE_SPECIAL_1, "bgm_ttl_main_sp1", PREINSTALL_CUESHEET); - m_Bgm.AddList(Bgm.BGM_TYPE.TITLE_SPECIAL_2, "bgm_ttl_main_sp2", PREINSTALL_CUESHEET); - m_Bgm.AddList(Bgm.BGM_TYPE.COLOSSEUM_FINAL, "bgm_st_lastbattle"); - m_Bgm.AddList(Bgm.BGM_TYPE.GRANDPRIX_SPECIAL, "bgm_gp_special_01"); - m_Bgm.AddList(Bgm.BGM_TYPE.GRANDPRIX_SPECIAL_FINAL, "bgm_gp_special_02"); - m_Bgm.AddList(Bgm.BGM_TYPE.SEALED, "bgm_open6"); - m_Bgm.AddList(Bgm.BGM_TYPE.QUEST, "bgm_quest_main"); - m_Bgm.AddList(Bgm.BGM_TYPE.COMPETITION_LOBBY, "bgm_competition"); - m_Bgm.AddList(Bgm.BGM_TYPE.BINGO, "bgm_bng_main"); - } - - public void AllMute(bool isMute) - { - BgmMute(isMute); - SeMute(isMute); - VoiceMute(isMute); - MovieMute(isMute); - } - - public void SetRejectNewSound(bool isMute) - { - _rejectNewSound = isMute; - } - - public bool IsRejectNewSound() - { - return _rejectNewSound; - } - - public void SetSeVolume(float prm) - { - m_Se.SetVolume(prm); - } - - public float GetSeVolume() - { - return m_Se.GetVolume(); - } - - public void SeMute(bool isMute) - { - m_Se.Mute(isMute); - } - - public bool IsSeMuted() - { - return m_Se.IsMuted(); - } - - public void SetAisac(string cuename, string param, float num) - { - m_Se.SetAisac(cuename, param, num); - } - - public void SetAisac(Se.TYPE setype, string param, float num) - { - m_Se.SetAisac(setype, param, num); - } - - public void PlaySe(Se.TYPE setype, bool isSeSysSummonLandingDuplicateCheck = false) - { - m_Se.Play(setype, isSeSysSummonLandingDuplicateCheck); - } - - public void PlaySeByStr(string sestring, string AcbName, float fadeInTime = 0f, long startTime = 0L) - { - m_Se.PlayByStr(sestring, AcbName, fadeInTime, startTime); - } - - public void PlaySeByStr(string sestring, float fadeInTime = 0f, long startTime = 0L) - { - PlaySeByStr(sestring, sestring, fadeInTime, startTime); - } - - public void PlayLoopSe(Se.TYPE setype) - { - m_Se.PlayLoop(setype); - } - - public void PlayLoopSeByStr(string sestring, float fadeInTime = 0f, long startTime = 0L) - { - m_Se.PlayLoopByStr(sestring, fadeInTime, startTime); - } - - public void ChangeAisac(float aisacnum) - { - m_Se.AisacChange(aisacnum); - } - - public void StopSe(string cuename, float fadeOutTime = 0.5f) - { - m_Se.Stop(cuename, fadeOutTime); - } - - public void StopSe(Se.TYPE setype, float fadetime = 0f) - { - m_Se.Stop(setype, fadetime); - } - - public void StopSeAll(float fadeOutTime) - { - m_Se.StopAll(fadeOutTime); - } - - public string LoadSe(string cueSheet, Action onLoaded = null) - { - return Load(LoadType.Se, cueSheet, onLoaded)[0]; - } - - public void UnloadSe(string cueSheet) - { - Unload(LoadType.Se, cueSheet); - } - - public void UnloadSe(List cueSheets) - { - for (int i = 0; i < cueSheets.Count; i++) - { - UnloadSe(cueSheets[i]); - } - } - - public void PlayToggleSe(bool isOn) - { - if (isOn) - { - PlaySe(Se.TYPE.SYS_TOGGLE_ON); - } - else - { - PlaySe(Se.TYPE.SYS_TOGGLE_OFF); - } - } - - public void SetVoiceVolume(float prm) - { - m_Voice.SetVolume(prm); - } - - public float GetVoiceVolume() - { - return m_Voice.GetVolume(); - } - - public void VoiceMute(bool isMute) - { - m_Voice.Mute(isMute); - } - - public bool IsVoiceMuted() - { - return m_Voice.IsMuted(); - } - - public void PlayVoice(ClassCharaPrm.EmotionType emotiontype, int classid, List pathList, string voiceId = "", bool isEvolved = false) - { - m_Voice.Play(emotiontype, classid, pathList, voiceId, isEvolved); - } - - public void PlayVoiceByKey(string quenameid, bool forcePlay = false) - { - m_Voice.PlayByKey(quenameid, forcePlay); - } - - public void PlayVoiceScenario(string cuename, float fadeout = 0.5f) - { - m_Voice.PlayScenario(cuename, fadeout); - } - - public float StopVoice(float fadeout = 0.5f) - { - m_Voice.StopVoice(fadeout); - return fadeout; - } - - public float StopVoiceAll(float fadeout = 0.5f) - { - m_Voice.StopAll(fadeout); - return fadeout; - } - - public bool IsVoicePlaying() - { - return m_Voice.IsPlaying(); - } - - public string LoadVoice(string cueSheet, Action onLoaded = null) - { - return Load(LoadType.Voice, cueSheet, onLoaded)[0]; - } - - public void UnloadVoice(string cueSheet) - { - Unload(LoadType.Voice, cueSheet); - } - - public void UnloadVoice(List cueSheets) - { - for (int i = 0; i < cueSheets.Count; i++) - { - UnloadVoice(cueSheets[i]); - } - } - - public string LoadTemporaryVoice(string cueSheet, Action onLoaded = null) - { - return Load(LoadType.TemporaryVoice, cueSheet, onLoaded)[0]; - } - - public void UnloadTemporaryVoice(string cueSheet) - { - Unload(LoadType.TemporaryVoice, cueSheet); - } - - public void UnloadTemporaryVoice(List cueSheets) - { - for (int i = 0; i < cueSheets.Count; i++) - { - UnloadTemporaryVoice(cueSheets[i]); - } - } - - public void SetBgmVolume(float prm) - { - m_Bgm.SetVolume(prm); - } - - public float GetBgmVolume() - { - return m_Bgm.GetVolume(); - } - - public void BgmMute(bool isMute) - { - m_Bgm.Mute(isMute); - } - - public bool IsBgmMuted() - { - return m_Bgm.IsMuted(); - } - - public void PlayBGM(Bgm.BGM_TYPE bgmtype, float fadetime = 0f) - { - if (bgmtype != Bgm.BGM_TYPE.BATTLE) - { - m_Bgm.Play(bgmtype, fadetime, 0L); - CheckFocus(); - } - } - - public void PlayCrossFadeBGM(Bgm.BGM_TYPE bgmtype, float fadeOutTime = 0.5f, float fadeInTime = 0f, long startTime = 0L) - { - if (bgmtype != Bgm.BGM_TYPE.BATTLE) - { - m_Bgm.PlayCrossFade(bgmtype, fadeOutTime, fadeInTime, startTime); - CheckFocus(); - } - } - - public void PlayBGM(string cuename, float fadeInTime = 0f, long startTime = 0L) - { - m_Bgm.Play(cuename, fadeInTime, startTime); - CheckFocus(); - } - - public void PlayCrossFadeBGM(string cuename, float fadeOutTime = 0.5f, float fadeInTime = 0f, long startTime = 0L) - { - m_Bgm.PlayCrossFade(cuename, fadeOutTime, fadeInTime, startTime); - CheckFocus(); - } - - public void PlayFadeOutBGM(Bgm.BGM_TYPE bgmtype, float fadeouttime = 0f, float fadeintime = 0f) - { - m_Bgm.PlayFadeOut(bgmtype, fadeouttime, fadeintime); - CheckFocus(); - } - - public virtual void PauseBGM() - { - m_Bgm.Pause(); - } - - public virtual void StopBGM(Action OnStopped = null, float fadetime = 2f) - { - m_Bgm.Stop(fadetime, OnStopped); - } - - public virtual void StopAllBGM(float fadetime = 2f) - { - m_Bgm.StopAll(fadetime); - } - - public void FadeBgmVolume(float to, float time = 2f) - { - iTween.ValueTo(Toolbox.AudioManager.gameObject, iTween.Hash("from", GetBgmVolume(), "to", to, "time", time, "onupdate", "SetBgmVolume")); - } - - public bool IsPlayBGM(Bgm.BGM_TYPE bgmType = Bgm.BGM_TYPE.NONE) - { - return m_Bgm.IsPlayBGM(bgmType); - } - - public List LoadBGM(Bgm.BGM_TYPE bgmType, Action onLoaded = null) - { - return LoadBGM(m_Bgm.GetCueSheet(bgmType), onLoaded); - } - - public List LoadBGM(string cueSheet, Action onLoaded = null) - { - if (string.IsNullOrEmpty(cueSheet) || m_Bgm.IsPreInstall(cueSheet, out var _)) - { - onLoaded?.Invoke(); - return new List(); - } - return Load(LoadType.Bgm, cueSheet, onLoaded); - } - - public void UnloadBGM(Bgm.BGM_TYPE bgmType) - { - UnloadBGM(m_Bgm.GetCueSheet(bgmType)); - } - - public void UnloadBGM(string cueSheet) - { - if (!m_Bgm.IsPreInstall(cueSheet, out var _)) - { - Unload(LoadType.Bgm, cueSheet); - } - } - - public void UnloadBGM(List cueSheets) - { - for (int i = 0; i < cueSheets.Count; i++) - { - UnloadBGM(cueSheets[i]); - } - } - - public void Stop_Play_BGM(Bgm.BGM_TYPE bgmType, Action onPlay = null, float fadeoutTime = 2f) - { - if (IsPlayBGM(bgmType)) - { - if (onPlay != null) - { - Toolbox.AudioManager.StartCoroutine_DelayMethod(1f, onPlay); - } - return; - } - StopBGM(delegate - { - PlayBGM(bgmType); - if (onPlay != null) - { - onPlay(); - } - }, fadeoutTime); - } - - public void PlayEnvSound(string sestring, float fadeInTime = 0f, long startTime = 0L) - { - Toolbox.AudioManager.AddCueSheet(sestring, sestring + ".acb", "s/", sestring + ".awb"); - PlaySeByStr(sestring, sestring, fadeInTime, startTime); - } - - public void StopEnvSound(string cuename, float fadeoutTime, bool isImmediatelyRemove = false) - { - StopSe(cuename, fadeoutTime); - if (isImmediatelyRemove) - { - Toolbox.AudioManager.RemoveCueSheet(cuename); - return; - } - Toolbox.AudioManager.StartCoroutine_DelayMethod(fadeoutTime, delegate - { - Toolbox.AudioManager.RemoveCueSheet(cuename); - }); - } - - public List LoadEnvSound(string cueSheet, Action onLoaded = null) - { - return Load(LoadType.EnvSound, cueSheet, onLoaded); - } - - public void SetMovieVolume(float volume) - { - if (!IsMovieMuted()) - { - Toolbox.MovieManager.SetVolume(volume); - } - m_movieVolume = volume; - } - - public float GetMovieVolume() - { - return m_movieVolume; - } - - public void MovieMute(bool isMute) - { - Toolbox.MovieManager.SetVolume((!isMute) ? m_movieVolume : 0f); - m_isMovieMute = isMute; - } - - public bool IsMovieMuted() - { - return m_isMovieMute; - } - - private List Load(LoadType loadType, string cueSheet, Action onLoaded) - { - if (cueSheet == PREINSTALL_CUESHEET) - { - if (onLoaded != null) - { - onLoaded(); - } - return null; - } - List loadTargetFiles = GetLoadTargetFiles(loadType, cueSheet); - Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupSync(loadTargetFiles, delegate - { - if (onLoaded != null) - { - onLoaded(); - } - }); - return loadTargetFiles; - } - - private void Unload(LoadType loadType, string cueSheet) - { - if (!(cueSheet == PREINSTALL_CUESHEET)) - { - Toolbox.ResourcesManager.RemoveAssetGroup(GetLoadTargetFiles(loadType, cueSheet)); - } - } - - private List GetLoadTargetFiles(LoadType loadType, string cueSheet) - { - List list = new List(); - switch (loadType) - { - case LoadType.Se: - list.Add("s/" + cueSheet + ".acb"); - break; - case LoadType.Bgm: - list.Add("b/" + cueSheet + ".acb"); - list.Add("b/" + cueSheet + ".awb"); - break; - case LoadType.Voice: - list.Add(GetVoiceLoadPath(cueSheet)); - break; - case LoadType.TemporaryVoice: - list.Add("v/t/" + cueSheet + ".acb"); - break; - case LoadType.EnvSound: - list.Add("s/" + cueSheet + ".acb"); - list.Add("s/" + cueSheet + ".awb"); - break; - } - return list; - } - - public string GetVoiceLoadPath(string cueSheet) - { - return "v/" + cueSheet + ".acb"; - } - - public void SetUseDownloadVoice(bool isUse) - { - Toolbox.AudioManager.isDownloadVoiceUse = isUse; - } - - public void OnFocus(bool focus) - { - SetBgmOnOff(focus); - } - - private void SetBgmOnOff(bool b) - { - if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.PLAY_SOUND_IN_BACKGROUND)) - { - Toolbox.AudioManager.PauseAllBgm(!b); - if (b) - { - AllMute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - } - else - { - AllMute(isMute: true); - } - } - } - - private void CheckFocus() - { - if (!UIManager.GetInstance().ApplicationHasFocus) - { - SetBgmOnOff(b: false); - } - } -} diff --git a/SVSim.BattleEngine/Engine/SpecialArenaField.cs b/SVSim.BattleEngine/Engine/SpecialArenaField.cs index 858a9fba..a49ca756 100644 --- a/SVSim.BattleEngine/Engine/SpecialArenaField.cs +++ b/SVSim.BattleEngine/Engine/SpecialArenaField.cs @@ -1,100 +1,14 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class SpecialArenaField : BackGroundBase { - private const string TAPESTRY_OBJECT_PATH = "md_bf_arn2_01_tapestry/tapestry_big"; - - private const string TAPESTRY_TEXTURE_NAME = "tx_bf_arn2_01_tapestry_d"; - - private const string CANDLE_ROAD_EFFECT_NAME = "candle_road"; - public override int FieldId => 1001; public SpecialArenaField(string bgmId = "NONE") : base(bgmId) { } - - protected override List CollectAdditionalAssets() - { - return new List { Toolbox.ResourcesManager.GetAssetTypePath("tx_bf_arn2_01_tapestry_d", ResourcesManager.AssetLoadPathType.Uilang3DField) }; - } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_arn2_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles09").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - ParticleSystem component = _fieldParticles.transform.Find("candle_road").GetComponent(); - component.gameObject.SetActive(value: false); - _fieldParticleSystemDictionary.Add("candle_road", component); - SkinnedMeshRenderer skinnedMeshRenderer = _fieldModel.transform.Find("md_bf_arn2_01_tapestry/tapestry_big")?.GetComponent(); - if (skinnedMeshRenderer != null) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("tx_bf_arn2_01_tapestry_d", ResourcesManager.AssetLoadPathType.Uilang3DField, isfetch: true); - Texture texture = Toolbox.ResourcesManager.LoadObject(assetTypePath) as Texture; - if (texture != null) - { - skinnedMeshRenderer.material.SetTexture("_MainTex", texture); - } - } - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1001, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1001_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - GameObject candleRoadEffectObj = _fieldParticleSystemDictionary["candle_road"].gameObject; - candleRoadEffectObj.SetActive(value: true); - _battleCamera.Camera.transform.localPosition = new Vector3(3300f, -1070f, 50f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-15f, -56f, 80f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(20f, -10f, -70f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-18f, -105f, 95f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - candleRoadEffectObj.SetActive(value: false); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/SpecialCrystalBuyFinishDialog.cs b/SVSim.BattleEngine/Engine/SpecialCrystalBuyFinishDialog.cs deleted file mode 100644 index 71785b7a..00000000 --- a/SVSim.BattleEngine/Engine/SpecialCrystalBuyFinishDialog.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class SpecialCrystalBuyFinishDialog : MonoBehaviour -{ - [SerializeField] - private UILabel _label; - - [SerializeField] - private UITexture _tipsTexture; - - [SerializeField] - private GameObject _begginerRoot; - - [SerializeField] - private UIButton _goToShopButton; - - [SerializeField] - private UIButton _goToShopButton2; - - [SerializeField] - private UILabel _nextSceneLabel; - - private List _assetList = new List(); - - private SpecialCrystalInfo _specialCrystalInfo; - - private DialogBase _dialog; - - private string _productName; - - private static bool NeedExtraResultDialog(SpecialCrystalInfo info) - { - if (!info.EnableExtraResult) - { - return false; - } - return info.ExtraResultPurchaseCount == info.AvailablePurchaseCount; - } - - public static void Create(GameObject prefab, SpecialCrystalInfo info, string productName) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - SystemText systemText = Data.SystemText; - dialogBase.SetTitleLabel(systemText.Get("MyPage_0051")); - if (NeedExtraResultDialog(info)) - { - SpecialCrystalBuyFinishDialog component = Object.Instantiate(prefab).GetComponent(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.onPushButton1 = delegate - { - ReloadMyPage(); - }; - dialogBase.SetObj(component.gameObject); - component._dialog = dialogBase; - component._specialCrystalInfo = info; - component._productName = productName; - } - else - { - dialogBase.SetSize(DialogBase.Size.S); - if (info.Status.StartsWith("80")) - { - dialogBase.SetText(Data.SystemText.Get("MyPage_0116", productName)); - } - else - { - dialogBase.SetText(Data.SystemText.Get("MyPage_0059", productName)); - } - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.onPushButton1 = delegate - { - ReloadMyPage(); - }; - } - dialogBase.onCloseWithoutSelect = delegate - { - ReloadMyPage(); - }; - } - - public static void ReloadMyPage() - { - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.MyPage) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); - } - } - - private IEnumerator Start() - { - _label.text = Data.SystemText.Get("MyPage_0059", _productName); - _nextSceneLabel.text = SceneTransition.TransitionData.GetTransitionText(_specialCrystalInfo.ResultDialogNextSceneClick); - ResourcesManager resourceManager = Toolbox.ResourcesManager; - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(_specialCrystalInfo.ExtraResultDialogBGImageFileName, ResourcesManager.AssetLoadPathType.SpecialCrystal); - _assetList.Add(assetTypePath); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(assetTypePath, null)); - _tipsTexture.mainTexture = resourceManager.LoadObject(resourceManager.GetAssetTypePath(_specialCrystalInfo.ExtraResultDialogBGImageFileName, ResourcesManager.AssetLoadPathType.SpecialCrystal, isfetch: true)) as Texture; - UIEventListener.Get(_goToShopButton.gameObject).onClick = delegate - { - OnClickNextSceneButton(); - }; - UIEventListener.Get(_goToShopButton2.gameObject).onClick = delegate - { - OnClickNextSceneButton(); - }; - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_assetList); - _assetList.Clear(); - } - - private void OnClickNextSceneButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - MyPageBannerBase.SceneChangeBySetting(_specialCrystalInfo.ResultDialogNextSceneClick, _specialCrystalInfo.ResultDialogNextSceneStatus); - _dialog.Close(); - } -} diff --git a/SVSim.BattleEngine/Engine/SpecialCrystalDialog.cs b/SVSim.BattleEngine/Engine/SpecialCrystalDialog.cs deleted file mode 100644 index 83d46371..00000000 --- a/SVSim.BattleEngine/Engine/SpecialCrystalDialog.cs +++ /dev/null @@ -1,468 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.ErrorDialog; - -public class SpecialCrystalDialog : MonoBehaviour -{ - private const int TIME_LIMIT_ERROR_CODE = 4305; - - private const float FLICK_MARGIN = 70f; - - private List _assetList = new List(); - - [SerializeField] - private UITexture _tipsTexture; - - [SerializeField] - private GameObject _jpnOnlyRoot; - - [SerializeField] - private UIDragScrollView _dragScrollView; - - [SerializeField] - private UIButton _fundSettlementButton; - - [SerializeField] - private UIButton _legalButton; - - [SerializeField] - private UILabel _priceLabel; - - [SerializeField] - private UILabel _timeLimitLabel; - - [SerializeField] - private UILabel _purchaseCountLabel; - - [SerializeField] - private GameObject _buyFinishDialogPrefab; - - [SerializeField] - private GameObject _rootObject; - - [SerializeField] - private UIButton _arrowLeftButton; - - [SerializeField] - private UIButton _arrowRightButton; - - [SerializeField] - private GameObject _dragObject; - - private string _defaultOpen = string.Empty; - - private bool _isDragging; - - private int _selectIndex; - - private DialogBase _dialog; - - private bool _finishGetProduct; - - private static string _defaultOpenPageStatus = string.Empty; - - private static GameObject _originalPrefab; - - private static string _productName; - - private static Action _saveOnCancel; - - private static Action _saveOnFinish; - - private static string saveScrollToProductId; - - private static List _specialCrystalInfo = null; - - private static GameObject _finishDialogPrefab; - - public static void Create(GameObject prefab, string scrollToProductId, Action onCancel, Action onFinish) - { - _originalPrefab = prefab; - _saveOnCancel = onCancel; - _saveOnFinish = onFinish; - saveScrollToProductId = scrollToProductId; - SystemText systemText = Wizard.Data.SystemText; - GameObject gameObject = UnityEngine.Object.Instantiate(prefab); - SpecialCrystalDialog specialDialog = gameObject.GetComponent(); - specialDialog._defaultOpen = _defaultOpenPageStatus; - _defaultOpenPageStatus = string.Empty; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonText(systemText.Get("Dia_BuyCrystal_004_Button"), systemText.Get("MyPage_0054")); - dialogBase.onPushButton1 = delegate - { - specialDialog.OnClickBuyButton(); - }; - dialogBase.onPushButton2 = delegate - { - BuyCrystal.InstantiateCrystalDialog(scrollToProductId, onlyInputBirthday: false, onCancel, onFinish); - }; - dialogBase.onCloseWithoutSelect = delegate - { - PaymentPC.GetInstance().finalize(); - }; - dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_DECIDE; - dialogBase.SetDisp(inDisp: false); - dialogBase.gameObject.SetActive(value: false); - specialDialog._dialog = dialogBase; - specialDialog._rootObject.SetActive(value: false); - } - - public static void SetDefaultOpenPage(string openPageStatus) - { - _defaultOpenPageStatus = openPageStatus; - } - - private string CorrectPriceText(string price) - { - return Wizard.Data.SystemText.Get("Shop_0083") + "$" + price; - } - - private void Start() - { - UIManager.GetInstance().StartCoroutine(Initialize()); - } - - private IEnumerator Initialize() - { - _finishDialogPrefab = _buyFinishDialogPrefab; - UIManager.GetInstance().createInSceneCenterLoading(); - bool oldBackKeyEnable = GameMgr.GetIns().GetInputMgr().isBackKeyEnable; - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; - foreach (SpecialCrystalInfo item in Wizard.Data.Load.data._userCrystalCount.SpecialCrystalInfo) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(item.DialogBGImageFileName, ResourcesManager.AssetLoadPathType.SpecialCrystal); - _assetList.Add(assetTypePath); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroup(_assetList, null)); - _ = Wizard.Data.SystemText; - PaymentPC paymentImpl = PaymentPC.GetInstance(); - paymentImpl.initialize(); - paymentImpl.ProductListSucceeded += OnSuccessGetProductList; - paymentImpl.ProductListFailed += OnFailedGetProductList; - while (!_finishGetProduct) - { - yield return null; - } - _specialCrystalInfo = new List(); - foreach (SpecialCrystalInfo item2 in Wizard.Data.Load.data._userCrystalCount.SpecialCrystalInfo) - { - if (paymentImpl.FormatProductPriceList.ContainsKey(item2.ProductId) && item2.RemainTime.Second > 0) - { - _specialCrystalInfo.Add(item2); - } - } - UIManager.GetInstance().closeInSceneCenterLoading(); - _dialog.gameObject.SetActive(value: true); - _dialog.SetDisp(inDisp: true); - _dialog.SetObj(base.gameObject); - _rootObject.SetActive(value: true); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = oldBackKeyEnable; - if (!string.IsNullOrEmpty(_defaultOpen) && !_specialCrystalInfo.Exists((SpecialCrystalInfo info) => info.Status == _defaultOpen)) - { - CloseDialogOnErrorFinish(); - Dialog.Create(4305); - yield break; - } - if (_specialCrystalInfo.Count == 0) - { - CloseDialogOnErrorFinish(); - BuyCrystal.InstantiateCrystalDialog(null, onlyInputBirthday: false, _saveOnCancel, _saveOnFinish); - yield break; - } - UpdateRemainTimeLabel(); - UIEventListener.Get(_arrowLeftButton.gameObject).onClick = delegate - { - OnClickButtonLeft(); - }; - UIEventListener.Get(_arrowRightButton.gameObject).onClick = delegate - { - OnClickButtonRight(); - }; - if (_specialCrystalInfo.Count <= 1) - { - _arrowLeftButton.gameObject.SetActive(value: false); - _arrowRightButton.gameObject.SetActive(value: false); - } - _jpnOnlyRoot.gameObject.SetActive(value: false); - _dragScrollView.enabled = false; - InitializeDragEvent(); - int page = 0; - for (int num = 0; num < _specialCrystalInfo.Count; num++) - { - if (_specialCrystalInfo[num].Status == _defaultOpen) - { - page = num; - break; - } - } - ChangeSelectSpecialCrystal(page); - } - - private void CloseDialogOnErrorFinish() - { - base.gameObject.SetActive(value: false); - _dialog.SetDisp(inDisp: false); - _dialog.Close(); - _specialCrystalInfo = null; - } - - private void InitializeDragEvent() - { - if (_specialCrystalInfo.Count <= 1) - { - return; - } - UIEventListener.Get(_dragObject).onDragStart = delegate - { - _isDragging = true; - }; - UIEventListener.Get(_dragObject).onDragEnd = delegate - { - _isDragging = false; - }; - UIEventListener.Get(_dragObject).onDrag = delegate(GameObject obj, Vector2 delta) - { - if (delta.x >= 70f) - { - if (_isDragging) - { - OnClickButtonLeft(); - _isDragging = false; - } - } - else if (delta.x <= -70f && _isDragging) - { - OnClickButtonRight(); - _isDragging = false; - } - }; - UIEventListener.Get(_dragObject).onScroll = delegate(GameObject obj, float delta) - { - if (delta > 0f) - { - if (_isDragging) - { - OnClickButtonLeft(); - _isDragging = false; - } - } - else if (_isDragging) - { - OnClickButtonRight(); - _isDragging = false; - } - }; - } - - private void UpdateRemainTimeLabel() - { - if (_specialCrystalInfo != null && _selectIndex <= _specialCrystalInfo.Count) - { - SpecialCrystalInfo specialCrystalInfo = _specialCrystalInfo[_selectIndex]; - _timeLimitLabel.text = specialCrystalInfo.RemainTime.GetShowText(); - } - } - - private void Update() - { - UpdateRemainTimeLabel(); - } - - private void OnSuccessGetProductList() - { - _finishGetProduct = true; - ClearPaymentHandler(); - } - - private void OnFailedGetProductList() - { - _finishGetProduct = true; - ClearPaymentHandler(); - BuyCrystal.PaymentListErrorDialog(); - _dialog.Close(); - } - - private void ClearPaymentHandler() - { - PaymentPC instance = PaymentPC.GetInstance(); - instance.ProductListSucceeded -= OnSuccessGetProductList; - instance.ProductListFailed -= OnFailedGetProductList; - } - - private void OnClickFundSettingButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.FUND_SETTLEMENT); - } - - private void OnClickLegalButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.LEGALTEXT); - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_assetList); - _assetList.Clear(); - } - - private void OnClickBuyButton() - { - if (PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.SPECIAL_CRYSTAL)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - LootBoxDialogUtility.CreateLootBoxRegulationDialog(PlayerStaticData.LootBoxType.SPECIAL_CRYSTAL); - } - else if (CreateItemList.IsBirthdayNotInput()) - { - ShowBirthdayInputDialog(); - } - else - { - ShowPayment(_selectIndex); - } - } - - private void ShowBirthdayInputDialog() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - Action onFinish = delegate - { - OnDecideBirthday(_selectIndex); - }; - bool onlyInputBirthday = true; - BuyCrystal.CreateBuyCrystal(isPlaySe: false, null, onlyInputBirthday, OnCancelBirthdayDialog, onFinish, isSpecialCrystal: true); - } - - private static void OnCancelBirthdayDialog() - { - Create(_originalPrefab, saveScrollToProductId, _saveOnCancel, _saveOnFinish); - } - - private static void OnDecideBirthday(int index) - { - ShowPayment(index); - } - - private static void ShowPayment(int index) - { - SpecialCrystalInfo info = _specialCrystalInfo[index]; - Action value = delegate - { - OnCunsumePurchageSuccess(info); - }; - if (!PaymentPC.GetInstance().ProductPriceList.ContainsKey(info.ProductId)) - { - Dialog.Create(4305); - return; - } - PaymentPC.GetInstance().purchaceStart(info.ProductId); - PaymentPC.GetInstance().ConsumePurchaseSucceeded += value; - } - - private static void OnCunsumePurchageSuccess(SpecialCrystalInfo info) - { - OnFinishPayment(info); - } - - private static void OnPurchageFinishSuccess(SpecialCrystalInfo info) - { - OnFinishPayment(info); - } - - private static void OnFinishPayment(SpecialCrystalInfo info) - { - UIManager.GetInstance().StartCoroutine(OnFinishPaymentCoroutine(info)); - } - - private static IEnumerator OnFinishPaymentCoroutine(SpecialCrystalInfo info) - { - UIManager.GetInstance().OpenNotTouch(); - SpecialCrystalTaskInfo task = new SpecialCrystalTaskInfo(); - bool taskSuccess = false; - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - taskSuccess = true; - })); - while (!taskSuccess) - { - yield return null; - } - UIManager.GetInstance().offNotTouch(); - ShowBuyFinishDialog(info); - } - - private static void ShowBuyFinishDialog(SpecialCrystalInfo info) - { - Action value = delegate - { - OnPurchageFinishSuccess(info); - }; - PaymentImpl.GetInstance().ConsumePurchaseSucceeded -= value; - if (!PaymentImpl.GetInstance().IsRefundedReceipt) - { - SpecialCrystalBuyFinishDialog.Create(_finishDialogPrefab, info, _productName); - } - } - - private void OnClickButtonLeft() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - _selectIndex--; - if (_selectIndex < 0) - { - _selectIndex = _specialCrystalInfo.Count - 1; - } - ChangeSelectSpecialCrystal(_selectIndex); - } - - private void OnClickButtonRight() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - _selectIndex++; - if (_selectIndex >= _specialCrystalInfo.Count) - { - _selectIndex = 0; - } - ChangeSelectSpecialCrystal(_selectIndex); - } - - private void ChangeSelectSpecialCrystal(int page) - { - _selectIndex = page; - PaymentPC instance = PaymentPC.GetInstance(); - SpecialCrystalInfo specialCrystalInfo = _specialCrystalInfo[_selectIndex]; - Dictionary formatProductPriceList = instance.FormatProductPriceList; - _dialog.SetTitleLabel(specialCrystalInfo.DialogTitle); - if (formatProductPriceList != null) - { - bool flag = false; - foreach (KeyValuePair item in formatProductPriceList) - { - if (item.Key == specialCrystalInfo.ProductId) - { - _priceLabel.text = CorrectPriceText(item.Value); - flag = true; - break; - } - } - if (!flag) - { - _priceLabel.text = string.Empty; - } - else - { - _productName = instance.ProductNameList[specialCrystalInfo.ProductId]; - } - _purchaseCountLabel.text = Wizard.Data.SystemText.Get("MyPage_0060", specialCrystalInfo.AvailablePurchaseCount.ToString()); - } - _tipsTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(specialCrystalInfo.DialogBGImageFileName, ResourcesManager.AssetLoadPathType.SpecialCrystal, isfetch: true)) as Texture; - } -} diff --git a/SVSim.BattleEngine/Engine/SpecialCrystalInfo.cs b/SVSim.BattleEngine/Engine/SpecialCrystalInfo.cs deleted file mode 100644 index 9a638281..00000000 --- a/SVSim.BattleEngine/Engine/SpecialCrystalInfo.cs +++ /dev/null @@ -1,53 +0,0 @@ -using LitJson; -using Wizard; - -public class SpecialCrystalInfo -{ - public string ProductId { get; private set; } - - public int AvailablePurchaseCount { get; private set; } - - public RemainTime RemainTime { get; private set; } - - public string DialogTitle { get; private set; } - - public string DialogBGImageFileName { get; private set; } - - public bool EnableExtraResult { get; private set; } - - public int ExtraResultPurchaseCount { get; private set; } - - public string ExtraResultDialogBGImageFileName { get; private set; } - - public string ResultDialogNextSceneClick { get; private set; } - - public string ResultDialogNextSceneStatus { get; private set; } - - public string Status { get; private set; } - - public SpecialCrystalInfo(JsonData json, JsonData responseData) - { - ProductId = json["product_id"].ToString(); - AvailablePurchaseCount = json["available_purchase_num"].ToInt(); - RemainTime = new RemainTime(json["end_time"].ToString(), responseData["data_headers"]["servertime"].ToDouble()); - DialogTitle = json["dialog_top_title"].ToString(); - DialogBGImageFileName = json["dialog_top_img"].ToString(); - Status = json["status_id"].ToString(); - if (json.Keys.Contains("ex_dialog_img")) - { - EnableExtraResult = true; - ExtraResultPurchaseCount = json["ex_dialog_condtion_available_purchase_num"].ToInt(); - ExtraResultDialogBGImageFileName = json["ex_dialog_img"].ToString(); - ResultDialogNextSceneClick = json["ex_dialog_click"].ToString(); - ResultDialogNextSceneStatus = json["ex_dialog_status"].ToString(); - } - else - { - EnableExtraResult = false; - ExtraResultPurchaseCount = -1; - ExtraResultDialogBGImageFileName = string.Empty; - ResultDialogNextSceneClick = string.Empty; - ResultDialogNextSceneStatus = string.Empty; - } - } -} diff --git a/SVSim.BattleEngine/Engine/SpellBattleCard.cs b/SVSim.BattleEngine/Engine/SpellBattleCard.cs index eadd374f..e1120f0e 100644 --- a/SVSim.BattleEngine/Engine/SpellBattleCard.cs +++ b/SVSim.BattleEngine/Engine/SpellBattleCard.cs @@ -104,17 +104,9 @@ public class SpellBattleCard : BattleCardBase VfxBase vfxBase = base.StartPlayCard(); base.BattleCardView.HideCanPlayEffect(); _isActionCard = true; - return SequentialVfxPlayer.Create(vfxBase, base.VfxCreator.CreatePick()); + return SequentialVfxPlayer.Create(vfxBase, NullVfx.GetInstance()); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - if (isNullView) - { - return NullCardVfxCreator.GetInstance(); - } - return new SpellCardVfxCreator(isPlayer, this, battleCardView, _buildInfo.ResourceMgr, () => IsActionCard); - } protected override IBattleCardView CreateView(BattleCardView.BuildInfo buildInfo, bool isNullView) { diff --git a/SVSim.BattleEngine/Engine/SpringPanel.cs b/SVSim.BattleEngine/Engine/SpringPanel.cs index 50af0e84..4e9561d1 100644 --- a/SVSim.BattleEngine/Engine/SpringPanel.cs +++ b/SVSim.BattleEngine/Engine/SpringPanel.cs @@ -6,62 +6,12 @@ public class SpringPanel : MonoBehaviour { public delegate void OnFinished(); - public static SpringPanel current; - public Vector3 target = Vector3.zero; public float strength = 10f; public OnFinished onFinished; - private UIPanel mPanel; - - private Transform mTrans; - - private UIScrollView mDrag; - - private void Start() - { - mPanel = GetComponent(); - mDrag = GetComponent(); - mTrans = base.transform; - } - - private void Update() - { - AdvanceTowardsPosition(); - } - - protected virtual void AdvanceTowardsPosition() - { - float deltaTime = RealTime.deltaTime; - bool flag = false; - Vector3 localPosition = mTrans.localPosition; - Vector3 vector = NGUIMath.SpringLerp(mTrans.localPosition, target, strength, deltaTime); - if ((vector - target).sqrMagnitude < 0.01f) - { - vector = target; - base.enabled = false; - flag = true; - } - mTrans.localPosition = vector; - Vector3 vector2 = vector - localPosition; - Vector2 clipOffset = mPanel.clipOffset; - clipOffset.x -= vector2.x; - clipOffset.y -= vector2.y; - mPanel.clipOffset = clipOffset; - if (mDrag != null) - { - mDrag.UpdateScrollbars(recalculateBounds: false); - } - if (flag && onFinished != null) - { - current = this; - onFinished(); - current = null; - } - } - public static SpringPanel Begin(GameObject go, Vector3 pos, float strength) { SpringPanel springPanel = go.GetComponent(); diff --git a/SVSim.BattleEngine/Engine/SpringPosition.cs b/SVSim.BattleEngine/Engine/SpringPosition.cs index 7aa783fc..3667487a 100644 --- a/SVSim.BattleEngine/Engine/SpringPosition.cs +++ b/SVSim.BattleEngine/Engine/SpringPosition.cs @@ -5,8 +5,6 @@ public class SpringPosition : MonoBehaviour { public delegate void OnFinished(); - public static SpringPosition current; - public Vector3 target = Vector3.zero; public float strength = 10f; @@ -19,80 +17,8 @@ public class SpringPosition : MonoBehaviour public OnFinished onFinished; - [SerializeField] - [HideInInspector] - private GameObject eventReceiver; - - [SerializeField] - [HideInInspector] - public string callWhenFinished; - - private Transform mTrans; - private float mThreshold; - private UIScrollView mSv; - - private void Start() - { - mTrans = base.transform; - if (updateScrollView) - { - mSv = NGUITools.FindInParents(base.gameObject); - } - } - - private void Update() - { - float deltaTime = (ignoreTimeScale ? RealTime.deltaTime : Time.deltaTime); - if (worldSpace) - { - if (mThreshold == 0f) - { - mThreshold = (target - mTrans.position).sqrMagnitude * 0.001f; - } - mTrans.position = NGUIMath.SpringLerp(mTrans.position, target, strength, deltaTime); - if (mThreshold >= (target - mTrans.position).sqrMagnitude) - { - mTrans.position = target; - NotifyListeners(); - base.enabled = false; - } - } - else - { - if (mThreshold == 0f) - { - mThreshold = (target - mTrans.localPosition).sqrMagnitude * 1E-05f; - } - mTrans.localPosition = NGUIMath.SpringLerp(mTrans.localPosition, target, strength, deltaTime); - if (mThreshold >= (target - mTrans.localPosition).sqrMagnitude) - { - mTrans.localPosition = target; - NotifyListeners(); - base.enabled = false; - } - } - if (mSv != null) - { - mSv.UpdateScrollbars(recalculateBounds: true); - } - } - - private void NotifyListeners() - { - current = this; - if (onFinished != null) - { - onFinished(); - } - if (eventReceiver != null && !string.IsNullOrEmpty(callWhenFinished)) - { - eventReceiver.SendMessage(callWhenFinished, this, SendMessageOptions.DontRequireReceiver); - } - current = null; - } - public static SpringPosition Begin(GameObject go, Vector3 pos, float strength) { SpringPosition springPosition = go.GetComponent(); diff --git a/SVSim.BattleEngine/Engine/Sqlite3Plugin/DBProxy.cs b/SVSim.BattleEngine/Engine/Sqlite3Plugin/DBProxy.cs index d9394aa1..29d82422 100644 --- a/SVSim.BattleEngine/Engine/Sqlite3Plugin/DBProxy.cs +++ b/SVSim.BattleEngine/Engine/Sqlite3Plugin/DBProxy.cs @@ -10,11 +10,6 @@ public class DBProxy : IDisposable public string dbPath { get; private set; } - ~DBProxy() - { - CloseDB(); - } - public DBProxy() { dbPath = null; @@ -103,16 +98,6 @@ public class DBProxy : IDisposable CloseDB(); } - protected virtual void Dispose(bool disposing) - { - CloseDB(); - } - - private void Terminate() - { - CloseDB(); - } - public virtual void CloseDB() { if (DBHandle != IntPtr.Zero) diff --git a/SVSim.BattleEngine/Engine/Sqlite3Plugin/PreparedQuery.cs b/SVSim.BattleEngine/Engine/Sqlite3Plugin/PreparedQuery.cs index cdb39c33..32fbbb5f 100644 --- a/SVSim.BattleEngine/Engine/Sqlite3Plugin/PreparedQuery.cs +++ b/SVSim.BattleEngine/Engine/Sqlite3Plugin/PreparedQuery.cs @@ -22,28 +22,6 @@ public class PreparedQuery : Query return num == 0; } - public bool BindInt(int idx, int iValue) - { - int num = Sqlite3LibImport.sqlite3_bind_int(_stmt, idx, iValue); - if (num != 0) - { - Debug.LogError($"sqlite3_bind_int error at idx {idx}: code {num}"); - ResultCode.CheckCorruption(num); - } - return num == 0; - } - - public bool BindDouble(int idx, double rValue) - { - int num = Sqlite3LibImport.sqlite3_bind_double(_stmt, idx, rValue); - if (num != 0) - { - Debug.LogError($"sqlite3_bind_double error at idx {idx}: code {num}"); - ResultCode.CheckCorruption(num); - } - return num == 0; - } - public bool Reset() { int num = Sqlite3LibImport.sqlite3_reset(_stmt); diff --git a/SVSim.BattleEngine/Engine/Sqlite3Plugin/Query.cs b/SVSim.BattleEngine/Engine/Sqlite3Plugin/Query.cs index a7b146f6..f5fe022e 100644 --- a/SVSim.BattleEngine/Engine/Sqlite3Plugin/Query.cs +++ b/SVSim.BattleEngine/Engine/Sqlite3Plugin/Query.cs @@ -59,32 +59,8 @@ public class Query : IDisposable return Sqlite3LibImport.sqlite3_column_int(_stmt, idx); } - public double GetDouble(int idx) - { - return Sqlite3LibImport.sqlite3_column_double(_stmt, idx); - } - public string GetText(int idx) { return Marshal.PtrToStringAnsi(Sqlite3LibImport.sqlite3_column_text(_stmt, idx)); } - - public byte[] GetBlob(int idx) - { - int num = Sqlite3LibImport.sqlite3_column_bytes(_stmt, idx); - if (num == 0) - { - Debug.LogError("null blob at idx: " + idx); - return null; - } - IntPtr source = Sqlite3LibImport.sqlite3_column_blob(_stmt, idx); - byte[] array = new byte[num]; - Marshal.Copy(source, array, 0, num); - return array; - } - - public bool IsNull(int idx) - { - return Sqlite3LibImport.sqlite3_column_type(_stmt, idx) == 5; - } } diff --git a/SVSim.BattleEngine/Engine/Sqlite3Plugin/ResultCode.cs b/SVSim.BattleEngine/Engine/Sqlite3Plugin/ResultCode.cs index be40b499..f2bb0aed 100644 --- a/SVSim.BattleEngine/Engine/Sqlite3Plugin/ResultCode.cs +++ b/SVSim.BattleEngine/Engine/Sqlite3Plugin/ResultCode.cs @@ -4,67 +4,6 @@ namespace Sqlite3Plugin; public class ResultCode { - public const int SQLITE_OK = 0; - - public const int SQLITE_ERROR = 1; - - public const int SQLITE_INTERNAL = 2; - - public const int SQLITE_PERM = 3; - - public const int SQLITE_ABORT = 4; - - public const int SQLITE_BUSY = 5; - - public const int SQLITE_LOCKED = 6; - - public const int SQLITE_NOMEM = 7; - - public const int SQLITE_READONLY = 8; - - public const int SQLITE_INTERRUPT = 9; - - public const int SQLITE_IOERR = 10; - - public const int SQLITE_CORRUPT = 11; - - public const int SQLITE_NOTFOUND = 12; - - public const int SQLITE_FULL = 13; - - public const int SQLITE_CANTOPEN = 14; - - public const int SQLITE_PROTOCOL = 15; - - public const int SQLITE_EMPTY = 16; - - public const int SQLITE_SCHEMA = 17; - - public const int SQLITE_TOOBIG = 18; - - public const int SQLITE_CONSTRAINT = 19; - - public const int SQLITE_MISMATCH = 20; - - public const int SQLITE_MISUSE = 21; - - public const int SQLITE_NOLFS = 22; - - public const int SQLITE_AUTH = 23; - - public const int SQLITE_FORMAT = 24; - - public const int SQLITE_RANGE = 25; - - public const int SQLITE_NOTADB = 26; - - public const int SQLITE_NOTICE = 27; - - public const int SQLITE_WARNING = 28; - - public const int SQLITE_ROW = 100; - - public const int SQLITE_DONE = 101; public static void CheckCorruption(int rc, string errMsg = null) { diff --git a/SVSim.BattleEngine/Engine/Sqlite3Plugin/Sqlite3LibImport.cs b/SVSim.BattleEngine/Engine/Sqlite3Plugin/Sqlite3LibImport.cs index 4a873c7a..660fed9f 100644 --- a/SVSim.BattleEngine/Engine/Sqlite3Plugin/Sqlite3LibImport.cs +++ b/SVSim.BattleEngine/Engine/Sqlite3Plugin/Sqlite3LibImport.cs @@ -5,7 +5,6 @@ namespace Sqlite3Plugin; public static class Sqlite3LibImport { - private const string LibraryName = "libsqlite3"; [DllImport("libsqlite3")] public static extern int sqlite3_open(byte[] zFilename, out IntPtr ppDB); @@ -25,15 +24,6 @@ public static class Sqlite3LibImport [DllImport("libsqlite3")] public static extern int sqlite3_bind_text(IntPtr pStmt, int i, byte[] zData, int nData, IntPtr xDel); - [DllImport("libsqlite3")] - public static extern int sqlite3_bind_int(IntPtr pStmt, int i, int iValue); - - [DllImport("libsqlite3")] - public static extern int sqlite3_bind_double(IntPtr pStmt, int i, double rValue); - - [DllImport("libsqlite3")] - public static extern int sqlite3_bind_null(IntPtr pStmt, int i); - [DllImport("libsqlite3")] public static extern int sqlite3_reset(IntPtr pStmt); @@ -46,27 +36,6 @@ public static class Sqlite3LibImport [DllImport("libsqlite3")] public static extern int sqlite3_column_int(IntPtr pStmt, int i); - [DllImport("libsqlite3")] - public static extern double sqlite3_column_double(IntPtr pStmt, int i); - - [DllImport("libsqlite3")] - public static extern int sqlite3_column_bytes(IntPtr pStmt, int i); - - [DllImport("libsqlite3")] - public static extern IntPtr sqlite3_column_blob(IntPtr pStmt, int i); - [DllImport("libsqlite3")] public static extern IntPtr sqlite3_column_text(IntPtr pStmt, int i); - - [DllImport("libsqlite3")] - public static extern int sqlite3_column_type(IntPtr pStmt, int i); - - [DllImport("libsqlite3")] - public static extern int sqlite3_vfs_register(IntPtr pStmt, int makeDflt); - - [DllImport("libsqlite3")] - public static extern int sqlite3_vfs_unregister(IntPtr pVfs); - - [DllImport("libsqlite3")] - public static extern IntPtr sqlite3_vfs_find(byte[] zVfsName); } diff --git a/SVSim.BattleEngine/Engine/StageField.cs b/SVSim.BattleEngine/Engine/StageField.cs index de2c5512..2e10ef95 100644 --- a/SVSim.BattleEngine/Engine/StageField.cs +++ b/SVSim.BattleEngine/Engine/StageField.cs @@ -1,277 +1,15 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class StageField : BackGroundBase { - private static Dictionary specialSkinIdAndColor = new Dictionary - { - { - 2001, - new Color32(125, 229, 72, byte.MaxValue) - }, - { - 2002, - new Color32(248, 116, 171, byte.MaxValue) - }, - { - 2003, - new Color32(96, 110, 178, byte.MaxValue) - }, - { - 2004, - new Color32(238, 185, 39, byte.MaxValue) - }, - { - 2005, - new Color32(171, 202, 233, byte.MaxValue) - }, - { - 2006, - new Color32(218, 25, 132, byte.MaxValue) - }, - { - 2007, - new Color32(239, 75, 129, byte.MaxValue) - }, - { - 2008, - new Color32(byte.MaxValue, 209, 0, byte.MaxValue) - }, - { - 2018, - new Color32(64, 234, byte.MaxValue, byte.MaxValue) - }, - { - 3101, - new Color32(156, 219, 217, byte.MaxValue) - }, - { - 3102, - new Color32(246, 117, 153, byte.MaxValue) - }, - { - 3103, - new Color32(225, 6, 0, byte.MaxValue) - }, - { - 3104, - new Color32(byte.MaxValue, 184, 28, byte.MaxValue) - }, - { - 3105, - new Color32(200, 0, 161, byte.MaxValue) - }, - { - 3106, - new Color32(166, 10, 61, byte.MaxValue) - }, - { - 3107, - new Color32(229, 155, 220, byte.MaxValue) - }, - { - 3108, - new Color32(126, 147, 167, byte.MaxValue) - }, - { - 3111, - new Color32(0, 156, 222, byte.MaxValue) - } - }; - public override int FieldId => 1004; - public override int FieldEffectId => 1004; public StageField(string bgmId = "NONE") : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1004_root").gameObject; - _fieldObjDictionary.Add("clock", _fieldModel.transform.Find("md_bf_1004_01_clock").gameObject); - _fieldObjDictionary.Add("screen_01", _fieldModel.transform.Find("md_bf_1004_01_screen_01").gameObject); - _fieldObjDictionary.Add("screen_02", _fieldModel.transform.Find("md_bf_1004_01_screen_02").gameObject); - _fieldObjDictionary.Add("screen_03", _fieldModel.transform.Find("md_bf_1004_01_screen_03").gameObject); - _fieldObjDictionary.Add("screen_04", _fieldModel.transform.Find("md_bf_1004_01_screen_04").gameObject); - _fieldObjDictionary.Add("symbol", _fieldModel.transform.Find("md_bf_1004_01_symbol").gameObject); - m_FieldAnimatorDictionary.Add("clock", _fieldObjDictionary["clock"].GetComponent()); - m_FieldAnimatorDictionary.Add("symbol", _fieldObjDictionary["symbol"].GetComponent()); - _fieldParticles = _fieldModel.transform.Find("Particles1004").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("base", _fieldParticles.transform.Find("base").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_2", _fieldParticles.transform.Find("gimic_2").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_3", _fieldParticles.transform.Find("gimic_3").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - Color color = Global.EFFECT_COLOR_ELF; - if (specialSkinIdAndColor.ContainsKey(GameMgr.GetIns().GetDataMgr().GetPlayerSkinId())) - { - color = specialSkinIdAndColor[GameMgr.GetIns().GetDataMgr().GetPlayerSkinId()]; - } - else - { - switch (GameMgr.GetIns().GetDataMgr().GetPlayerClassId()) - { - case 1: - color = Global.EFFECT_COLOR_ELF; - break; - case 2: - color = Global.EFFECT_COLOR_ROYAL; - break; - case 3: - color = Global.EFFECT_COLOR_WITCH_2; - break; - case 4: - color = Global.EFFECT_COLOR_DRAGON; - break; - case 5: - color = Global.EFFECT_COLOR_NECROMANCER; - break; - case 6: - color = Global.EFFECT_COLOR_VANPIRE; - break; - case 7: - color = Global.EFFECT_COLOR_BISHOP; - break; - case 8: - color = Global.EFFECT_COLOR_NEMESIS; - break; - } - } - for (int i = 0; i < _fieldParticleSystemDictionary["base"].gameObject.transform.childCount; i++) - { - _fieldParticleSystemDictionary["base"].gameObject.transform.GetChild(i).GetComponent().material.color = color; - } - _fieldParticleSystemDictionary["base"].Play(); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int j = 0; j < _fieldObjDictionary.Count; j++) - { - list2.Add(_fieldObjDictionary[list[j]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1004, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1004_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - m_FieldAnimatorDictionary["clock"].SetTrigger("opening"); - _battleCamera.Camera.transform.localPosition = new Vector3(-403f, -21f, -570f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-18f, -90f, 95f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(-403f, -21f, -570f), new Vector3(245f, -195f, -175f), new Vector3(758f, -334f, -101f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 1.8f, "delay", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuart)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-18f, -90f, 95.5f), "time", 1.8f, "delay", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuart)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - _fieldParticleSystemDictionary["opening"].Clear(); - _fieldParticleSystemDictionary["opening"].Stop(); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["symbol"].SetTrigger("tap"); - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(3f); - _fieldParticleSystemDictionary["base"].Play(); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(0, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_field_1004_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 0: - m_FieldAnimatorDictionary["symbol"].SetTrigger("tap"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(3f); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Play(); - yield return new WaitForSeconds(0f); - _gimicCntDictionary[obj.tag]--; - break; - case 1: - m_FieldAnimatorDictionary["symbol"].SetTrigger("tap"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["gimic_2"].Play(); - yield return new WaitForSeconds(3f); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Play(); - yield return new WaitForSeconds(0f); - _gimicCntDictionary[obj.tag]--; - break; - case 2: - m_FieldAnimatorDictionary["symbol"].SetTrigger("tap"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["gimic_3"].Play(); - yield return new WaitForSeconds(3f); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Play(); - yield return new WaitForSeconds(0f); - _gimicCntDictionary[obj.tag]--; - break; - } - } - yield return null; - } } diff --git a/SVSim.BattleEngine/Engine/StartPickMultiCardVfx.cs b/SVSim.BattleEngine/Engine/StartPickMultiCardVfx.cs index a194c1bf..c93fc70a 100644 --- a/SVSim.BattleEngine/Engine/StartPickMultiCardVfx.cs +++ b/SVSim.BattleEngine/Engine/StartPickMultiCardVfx.cs @@ -28,7 +28,7 @@ public class StartPickMultiCardVfx : SequentialVfxPlayer SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); ReadOnlyCollection summonedCardEffectPairList = summonedCardsList.summonedCardEffectPairList; ReadOnlyCollection overflowCardEffectPairList = summonedCardsList.overflowCardEffectPairList; - sequentialVfxPlayer.Register(new SummonCardPreperationVfx(summonedCardsList.summonedCards, summonedCardsList.overflowCards)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); SkillBaseSummon.SummonedCardsList.CardEffectPair cardEffectPair = summonedCardEffectPairList.FirstOrDefault(); int num = (isRandomVoice ? new System.Random().Next(summonedCardsList.summonedCards.Count()) : (-1)); @@ -44,21 +44,12 @@ public class StartPickMultiCardVfx : SequentialVfxPlayer { playVoice = false; } - if (isGetoff) - { - DestroyVfx.FileNamePair fileNamePair = new DestroyVfx.FileNamePair("stt_act_getoff_1"); - LoadAndPlayEffectVfx summonEffect = new LoadAndPlayEffectVfx(fileNamePair.ObjectFileName, fileNamePair.SeFileName, cardEffectPair2.card.BattleCardView.Transform, 0f); - parallelVfxPlayer.Register(new SummonUnitVfx(cardEffectPair2.card, isToken, playVoice, _resourceMgr, summonEffect, isEvoVoice)); - } - else - { - parallelVfxPlayer.Register(new SummonUnitVfx(cardEffectPair2.card, isToken, playVoice, _resourceMgr, cardEffectPair2.summonEffect, isEvoVoice, voiceWaitTime, isSeSysSummonLandingDuplicateCheck)); - } + parallelVfxPlayer.Register(NullVfx.GetInstance()); } for (int j = 0; j < overflowCardEffectPairList.Count; j++) { SkillBaseSummon.SummonedCardsList.CardEffectPair cardEffectPair3 = overflowCardEffectPairList[j]; - parallelVfxPlayer.Register(new SummonUnitOverflowVfx(cardEffectPair3.card, j, isToken, _resourceMgr, cardEffectPair3.summonEffect)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); } for (int k = 0; k < summonedCardsList.summonedCards.Count(); k++) { diff --git a/SVSim.BattleEngine/Engine/StaticTextForUILabel.cs b/SVSim.BattleEngine/Engine/StaticTextForUILabel.cs index aec28be6..7640992d 100644 --- a/SVSim.BattleEngine/Engine/StaticTextForUILabel.cs +++ b/SVSim.BattleEngine/Engine/StaticTextForUILabel.cs @@ -3,20 +3,4 @@ using Wizard; public class StaticTextForUILabel : MonoBehaviour { - [SerializeField] - private string m_textID = ""; - - private void Start() - { - UILabel component = GetComponent(); - if ((bool)component) - { - component.text = Data.SystemText.Get(m_textID); - } - } - - public void Set(string id, string memo) - { - m_textID = id; - } } diff --git a/SVSim.BattleEngine/Engine/SteamManager.cs b/SVSim.BattleEngine/Engine/SteamManager.cs deleted file mode 100644 index 1010c92d..00000000 --- a/SVSim.BattleEngine/Engine/SteamManager.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Text; -using AOT; -using Steamworks; -using UnityEngine; - -[DisallowMultipleComponent] -public class SteamManager : MonoBehaviour -{ - protected static bool s_EverInitialized; - - protected static SteamManager s_instance; - - protected bool m_bInitialized; - - protected SteamAPIWarningMessageHook_t m_SteamAPIWarningMessageHook; - - protected static SteamManager Instance - { - get - { - if (s_instance == null) - { - return new GameObject("SteamManager").AddComponent(); - } - return s_instance; - } - } - - public static bool Initialized => Instance.m_bInitialized; - - [MonoPInvokeCallback(typeof(SteamAPIWarningMessageHook_t))] - protected static void SteamAPIDebugTextHook(int nSeverity, StringBuilder pchDebugText) - { - } - - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] - private static void InitOnPlayMode() - { - s_EverInitialized = false; - s_instance = null; - } - - protected virtual void Awake() - { - if (s_instance != null) - { - UnityEngine.Object.Destroy(base.gameObject); - return; - } - s_instance = this; - if (s_EverInitialized) - { - throw new Exception("Tried to Initialize the SteamAPI twice in one session!"); - } - UnityEngine.Object.DontDestroyOnLoad(base.gameObject); - if (!Packsize.Test()) - { - Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this); - } - if (!DllCheck.Test()) - { - Debug.LogError("[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", this); - } - try - { - if (SteamAPI.RestartAppIfNecessary((AppId_t)453480u)) - { - Application.Quit(); - return; - } - } - catch (DllNotFoundException ex) - { - Debug.LogError("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + ex, this); - Application.Quit(); - return; - } - m_bInitialized = SteamAPI.Init(); - if (!m_bInitialized) - { - Debug.LogError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", this); - } - else - { - s_EverInitialized = true; - } - } - - protected virtual void OnEnable() - { - if (s_instance == null) - { - s_instance = this; - } - if (m_bInitialized && m_SteamAPIWarningMessageHook == null) - { - m_SteamAPIWarningMessageHook = SteamAPIDebugTextHook; - SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook); - } - } - - protected virtual void OnDestroy() - { - if (!(s_instance != this)) - { - s_instance = null; - if (m_bInitialized) - { - SteamAPI.Shutdown(); - } - } - } - - protected virtual void Update() - { - if (m_bInitialized) - { - SteamAPI.RunCallbacks(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/StockEmitMgr.cs b/SVSim.BattleEngine/Engine/StockEmitMgr.cs deleted file mode 100644 index 7e94d47c..00000000 --- a/SVSim.BattleEngine/Engine/StockEmitMgr.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -public class StockEmitMgr : StockSequenceMgr -{ - private List> _pubSequenceSendAllData = new List>(); - - public static float WAIT_ACK_TIMEOUT = 3f; - - private long _emitTime; - - public static float ACK_NOT_RECEIVE_LOG_TIME = 15f; - - public int SequenceNumber { get; private set; } - - public long EmitToAckCheckTime { get; private set; } - - public bool IsReceiveAck { get; private set; } - - public StockEmitMgr(string name) - : base(name) - { - SequenceNumber = 1; - } - - public override void StockData(Dictionary data) - { - base.StockData(data); - bool flag = false; - if (_pubSequenceSendAllData.Count > 0) - { - for (int i = 0; i < _pubSequenceSendAllData.Count; i++) - { - if (_pubSequenceSendAllData[i].ContainsKey("pubSeq") && data.ContainsKey("pubSeq") && _pubSequenceSendAllData[i]["pubSeq"] == data["pubSeq"]) - { - flag = true; - break; - } - } - } - if (!flag) - { - _pubSequenceSendAllData.Add(data); - } - } - - public void AddSequenceNumber() - { - SequenceNumber++; - } - - public void ResetSequence() - { - SequenceNumber = 1; - _pubSequenceSendAllData.Clear(); - } - - public Dictionary GetSelectData(int num) - { - Dictionary dictionary = sequenceDataList.FirstOrDefault((Dictionary d) => GetSequenceNumber(d) == num); - if (dictionary == null) - { - dictionary = _pubSequenceSendAllData.FirstOrDefault((Dictionary d) => GetSequenceNumber(d) == num); - } - return dictionary; - } - - public Dictionary GetAllSelectData(int num) - { - return _pubSequenceSendAllData.FirstOrDefault((Dictionary d) => GetSequenceNumber(d) == num); - } - - public void FirstAddSequenceDataList(Dictionary info) - { - lock (sequenceDataList) - { - sequenceDataList.Insert(0, info); - } - } - - public List> GetSequenceAllData() - { - return sequenceDataList; - } - - public void Recovery(int sequenceNumber) - { - SequenceNumber = sequenceNumber; - ClearSequenceDataList(); - } - - public void SetEmitTime(long emitTime) - { - _emitTime = emitTime; - if (IsReceiveAck) - { - SetEmitToAckCheckTime(emitTime); - } - IsReceiveAck = false; - } - - public void SetEmitToAckCheckTime(long time) - { - EmitToAckCheckTime = time; - } - - public void SetReceiveAck() - { - IsReceiveAck = true; - } - - public long GetEmitTime() - { - return _emitTime; - } -} diff --git a/SVSim.BattleEngine/Engine/StockReceiveMgr.cs b/SVSim.BattleEngine/Engine/StockReceiveMgr.cs deleted file mode 100644 index 71dcabde..00000000 --- a/SVSim.BattleEngine/Engine/StockReceiveMgr.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Wizard; - -public class StockReceiveMgr : StockSequenceMgr -{ - private List DisConnectIndexList = new List(); - - public int SequenceAlreadyNumber { get; private set; } - - public StockReceiveMgr(string name) - : base(name) - { - } - - public override void StockData(Dictionary data) - { - base.StockData(data); - string text = data["uri"].ToString(); - if (text == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnEnd] || text == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnEndFinal]) - { - ToolboxGame.RealTimeNetworkAgent.SetGungnirSendActionSequence(isActive: true); - } - } - - public Dictionary GetFrontData() - { - if (sequenceDataList.Count == 0) - { - return null; - } - int num = -1; - Dictionary result = new Dictionary(); - foreach (Dictionary sequenceData in sequenceDataList) - { - if (num == -1 || GetSequenceNumber(sequenceData) < num) - { - num = GetSequenceNumber(sequenceData); - result = sequenceData; - } - } - return result; - } - - public Dictionary FindData(int sequenceNum) - { - if (sequenceDataList.Count == 0) - { - return null; - } - return sequenceDataList.Find((Dictionary x) => GetSequenceNumber(x) == sequenceNum); - } - - public int GetMaxSequenceNumber() - { - if (sequenceDataList.Count == 0) - { - return SequenceAlreadyNumber; - } - int num = SequenceAlreadyNumber; - bool flag; - do - { - flag = false; - foreach (Dictionary sequenceData in sequenceDataList) - { - if (GetSequenceNumber(sequenceData) == num + 1) - { - num = GetSequenceNumber(sequenceData); - flag = true; - break; - } - } - } - while (flag); - return num; - } - - public bool CheckStockData(Dictionary data) - { - if (DisConnectIndexList.Any((int d) => d == GetSequenceNumber(data))) - { - return true; - } - int dataSequenceNumber = GetSequenceNumber(data); - string dataUri = data["uri"].ToString(); - if (dataSequenceNumber <= SequenceAlreadyNumber) - { - LocalLog.AccumulateLastTraceLog("CheckStockData False SequenceAlreadyNumber " + SequenceAlreadyNumber + "dataSequenceNumber" + dataSequenceNumber); - return false; - } - if (sequenceDataList.Any((Dictionary d) => dataSequenceNumber == GetSequenceNumber(d))) - { - LocalLog.AccumulateLastTraceLog("CheckStockData False Already dataSequenceNumber" + dataSequenceNumber); - if (sequenceDataList.Any((Dictionary d) => d["uri"].ToString() == dataUri)) - { - LocalLog.AccumulateLastTraceLog("CheckStockData False Already Uri" + dataUri); - return false; - } - } - return true; - } - - public void SettingOppoDisconnectSequenceNumber(Dictionary data) - { - if (data["uri"].ToString() == "OppoDisconnect") - { - data[sequenceName] = (SequenceAlreadyNumber + 1).ToString(); - DisConnectIndexList.Add(SequenceAlreadyNumber + 1); - } - } - - public void UpdateSequenceAlreadyNumber(Dictionary data) - { - int sequenceNumber = GetSequenceNumber(data); - if (SequenceAlreadyNumber < sequenceNumber) - { - SequenceAlreadyNumber = sequenceNumber; - } - } - - public bool IsNoStockData(Dictionary data) - { - if (data["uri"].ToString() == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.JudgeResult] || data["uri"].ToString() == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.BattleFinish]) - { - return true; - } - if (!data.ContainsKey(sequenceName)) - { - return true; - } - return GetSequenceNumber(data) == 0; - } - - public void Recovery(int sequenceAlreadyNumber) - { - SequenceAlreadyNumber = sequenceAlreadyNumber; - ClearSequenceDataList(); - } - - public void SetSequenceNumber(int num) - { - SequenceAlreadyNumber = num; - } -} diff --git a/SVSim.BattleEngine/Engine/StockSequenceMgr.cs b/SVSim.BattleEngine/Engine/StockSequenceMgr.cs deleted file mode 100644 index 9db306ca..00000000 --- a/SVSim.BattleEngine/Engine/StockSequenceMgr.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.Collections.Generic; - -public class StockSequenceMgr -{ - public class StringSequenceData - { - public string SequenceNum { get; private set; } - - public string SequenceUri { get; private set; } - - public StringSequenceData(string num, string uri) - { - SequenceNum = num; - SequenceUri = uri; - } - } - - protected List> sequenceDataList = new List>(); - - protected string sequenceName = ""; - - public StockSequenceMgr(string name) - { - sequenceName = name; - } - - public List> GetStockDataList() - { - return sequenceDataList; - } - - public void RemoveSelectData(Dictionary data) - { - if (data != null) - { - lock (sequenceDataList) - { - sequenceDataList.Remove(data); - } - } - } - - public bool IsEmpty() - { - return sequenceDataList.Count == 0; - } - - public virtual void StockData(Dictionary data) - { - lock (sequenceDataList) - { - sequenceDataList.Add(data); - } - } - - public int GetSequenceNumber(Dictionary data) - { - if (data.ContainsKey(sequenceName)) - { - return int.Parse(data[sequenceName].ToString()); - } - return 0; - } - - public void ClearSequenceDataList() - { - sequenceDataList.Clear(); - } - - public int GetSequenceDataCount() - { - if (sequenceDataList == null) - { - return 0; - } - return sequenceDataList.Count; - } - - public List GetAllSequenceNum() - { - List list = new List(); - for (int i = 0; i < sequenceDataList.Count; i++) - { - if (sequenceDataList[i].ContainsKey(sequenceName)) - { - list.Add(new StringSequenceData(sequenceDataList[i][sequenceName].ToString(), sequenceDataList[i]["uri"].ToString())); - } - } - return list; - } - - public bool IsIncludedSequenceName(Dictionary receivedMessage) - { - return receivedMessage.ContainsKey(sequenceName); - } - - public bool IsIncludedUri(string uri) - { - return sequenceDataList.Exists((Dictionary x) => x["uri"].ToString() == uri); - } -} diff --git a/SVSim.BattleEngine/Engine/StoryCardPanel.cs b/SVSim.BattleEngine/Engine/StoryCardPanel.cs deleted file mode 100644 index 1131c49e..00000000 --- a/SVSim.BattleEngine/Engine/StoryCardPanel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using UnityEngine; - -public class StoryCardPanel : MyPageCardPanel -{ - [SerializeField] - private GameObject _appealRibbon; - - [SerializeField] - private GameObject _appealBadge; - - public void DispAppealRibbon(bool inDisp) - { - _appealRibbon.SetActive(inDisp); - } - - public void DispAppealBadge(bool inDisp) - { - _appealBadge.SetActive(inDisp); - } -} diff --git a/SVSim.BattleEngine/Engine/StoryChapterData.cs b/SVSim.BattleEngine/Engine/StoryChapterData.cs index 6a9ea9ff..6bb03cc0 100644 --- a/SVSim.BattleEngine/Engine/StoryChapterData.cs +++ b/SVSim.BattleEngine/Engine/StoryChapterData.cs @@ -37,8 +37,6 @@ public class StoryChapterData : HeaderData public ChapterClearStatus ClearStatus { get; private set; } - public string BtnLoadPath { get; set; } - public bool IsMaintenanceChapter { get; private set; } public SubChapterData(JsonData jsonData) @@ -102,42 +100,6 @@ public class StoryChapterData : HeaderData public bool IsEnableBattleSkip { get; } - public bool IsSkipBattle - { - get - { - if (IsEnableBattleSkip) - { - return PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SKIP_CLEARED_STORY_BATTLE); - } - return false; - } - } - - public bool IsDoBattle - { - get - { - if (ExistsBattle) - { - return !IsSkipBattle; - } - return false; - } - } - - public bool IsFixedDeck - { - get - { - if (SectionId != StorySection.TUTORIAL_SECTION_ID) - { - return IsClassTutorial; - } - return true; - } - } - public int EnemyAiId { get; } public List BattleSettingDatas { get; } @@ -158,18 +120,6 @@ public class StoryChapterData : HeaderData public int TutorialStep { get; } - public bool IsClassTutorial - { - get - { - if (SectionId == 1) - { - return ChapterId == "1"; - } - return false; - } - } - public bool IsAlreadyRead => ClearStatus == ChapterClearStatus.AlreadyRead; public bool IsCleared => ClearStatus == ChapterClearStatus.Cleared; @@ -186,36 +136,8 @@ public class StoryChapterData : HeaderData } } - public List AvailableDeckClassList => BattleSettingDatas.Select((BattleSettingData bd) => bd.DeckClassId).Distinct().ToList(); - - public List CharaIdList => BattleSettingDatas.Select((BattleSettingData bd) => bd.PlayerCharaId).Distinct().ToList(); - - public bool IsBranchChapter => !string.IsNullOrEmpty(UIUtil.ExtractStringAlphabet(ChapterId)); - - public bool IsDuplicateDeckClass => (from bd in BattleSettingDatas - select bd.DeckClassId into x - group x by x).Any((IGrouping x) => x.Count() > 1); - - public bool IsExistNextChapter => NextChapterId != "0"; - - public string AllReadButtonPath { get; set; } - - public bool IsNotReleasedDisplayChapter { get; set; } - - public int[] AllSubStoryIds => SubChapterDatas.Select((SubChapterData x) => x.StoryId).ToArray(); - public bool ExistsSubChapter => SubChapterDatas.Count > 0; - public BattleSettingData FindBattleSettingDataByDeckSkinId(int deckSkinId) - { - return BattleSettingDatas.Find((BattleSettingData x) => x.DeckSkinId == deckSkinId); - } - - public BattleSettingData FindBattleSettingDataByDeckClassId(int deckClassId) - { - return BattleSettingDatas.Find((BattleSettingData x) => x.DeckClassId == deckClassId); - } - public BattleSettingData FindBattleSettingDataByPlayerCharaId(int playerCharaId) { return BattleSettingDatas.Find((BattleSettingData x) => x.PlayerCharaId == playerCharaId); @@ -364,33 +286,6 @@ public class StoryChapterData : HeaderData return ChapterClearStatus.NotCleared; } - private SubChapterData FindSubChapterData(int subChapterId) - { - return SubChapterDatas.Find((SubChapterData data) => data.SubChapterId == subChapterId); - } - - public int[] GetStartStoryIds(int? subChapterId) - { - if (!subChapterId.HasValue) - { - return new int[1] { StoryId }; - } - if (subChapterId == SUB_CHAPTER_ALL) - { - return AllSubStoryIds; - } - return new int[1] { FindSubChapterData(subChapterId.Value).StoryId }; - } - - public int GetFinishStoryId(int? subChapterId) - { - if (!subChapterId.HasValue) - { - return StoryId; - } - return FindSubChapterData(subChapterId.Value).StoryId; - } - private static string GetRouteName(int sectionId, int charaId, string chapterId) { string text = UIUtil.ExtractStringAlphabet(chapterId); diff --git a/SVSim.BattleEngine/Engine/StoryFinishDetail.cs b/SVSim.BattleEngine/Engine/StoryFinishDetail.cs index c712084e..60ec3451 100644 --- a/SVSim.BattleEngine/Engine/StoryFinishDetail.cs +++ b/SVSim.BattleEngine/Engine/StoryFinishDetail.cs @@ -16,8 +16,6 @@ public class StoryFinishDetail public List achieved_achievement_list => AchievedInfo._achievements; - public List Rewards => AchievedInfo._rewards; - public IReadOnlyList StoryClearRewards { get; set; } = Array.Empty(); public AchievedInfo AchievedInfo { get; private set; } diff --git a/SVSim.BattleEngine/Engine/StoryLeaderSelect.cs b/SVSim.BattleEngine/Engine/StoryLeaderSelect.cs index f9a21d9e..09b72e5c 100644 --- a/SVSim.BattleEngine/Engine/StoryLeaderSelect.cs +++ b/SVSim.BattleEngine/Engine/StoryLeaderSelect.cs @@ -10,9 +10,4 @@ public class StoryLeaderSelect : HeaderData public int LeaderCount { get; set; } public IEnumerable LeaderCharaIds => _dataList.Select((StoryLeaderSelectData x) => x.CharaId); - - public StoryLeaderSelectData FindLeaderSelectDataByClassId(int classId) - { - return DataList.Find((StoryLeaderSelectData x) => x.ClassId == classId); - } } diff --git a/SVSim.BattleEngine/Engine/StoryLeaderSelectData.cs b/SVSim.BattleEngine/Engine/StoryLeaderSelectData.cs index 12cc6eb8..6ec733c5 100644 --- a/SVSim.BattleEngine/Engine/StoryLeaderSelectData.cs +++ b/SVSim.BattleEngine/Engine/StoryLeaderSelectData.cs @@ -6,6 +6,7 @@ public class StoryLeaderSelectData public string CurrentChapter { get; set; } - public int ClassId => GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(CharaId) - .class_id; + // Pre-Phase-5b: pulled class_id via DataMgr.GetCharaPrmByCharaId. Headless has no + // chara master; return 0 as a headless-safe default. + public int ClassId => 0; } diff --git a/SVSim.BattleEngine/Engine/StoryNextSceneSelector.cs b/SVSim.BattleEngine/Engine/StoryNextSceneSelector.cs index 96b33fd0..350abc2b 100644 --- a/SVSim.BattleEngine/Engine/StoryNextSceneSelector.cs +++ b/SVSim.BattleEngine/Engine/StoryNextSceneSelector.cs @@ -1,252 +1,7 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Story; -using Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult; - -public class StoryNextSceneSelector : INextSceneSelector -{ - private BattleResultUIController m_battleResultNewControl; - - private const int BUILD_DECK_RENTAL_LOSE_COUNT = 2; - - private const float INTERVAL_OPEN_DIALOG = 0.1f; - - private bool _isEnableDeckRentalAssist; - - private bool _isWin; - - private int _loseCount; - - private readonly IProcessing _firstSelectionProcessing; - - private static bool _isHistoryOfUsingTrialDeck; - - private SelectedStoryInfo SelectedStoryInfo => Data.SelectedStoryInfo; - - private UIManager.ViewScene ChapterSelectionView => SelectedStoryInfo.ChapterSelectionView; - - private static KeyValuePair DeckRentalPlayerPrefsKey => new KeyValuePair($"{PlayerPrefsWrapper.STORY_BATTLE_LOSE_COUNT}{Data.SelectedStoryInfo.StoryId}", 0); - - public StoryNextSceneSelector(BattleResultUIController battleResultControl) - { - m_battleResultNewControl = battleResultControl; - _loseCount = GetDeckRentalLoseCount(); - _firstSelectionProcessing = CreateSelectionProcessings(); - } - - public static int GetDeckRentalLoseCount() - { - return PlayerPrefsWrapper.GetValue(DeckRentalPlayerPrefsKey); - } - - public static void SetDeckRentalLoseCount(int loseCount) - { - PlayerPrefsWrapper.SetValue(DeckRentalPlayerPrefsKey, loseCount); - } - - public static void ResetHistoryOfUsingPreBuildDeck() - { - _isHistoryOfUsingTrialDeck = false; - } - - public void Setup(bool isWin, GameObject gameObject) - { - _isWin = isWin; - if (Data.StoryInfo.IsPreBuildDeck) - { - GameMgr.GetIns().GetDataMgr().LastSelectDeckAttributeType = DeckAttributeType.BuildDeck; - } - _isHistoryOfUsingTrialDeck = _isHistoryOfUsingTrialDeck || Data.StoryInfo.IsTrialDeck; - if (!isWin) - { - Data.StoryInfo.IsPreBuildDeck = false; - } - int num = 0; - if (IsEnableDeckRentalStory() && !isWin) - { - num = _loseCount + 1; - } - if (IsEnableDeckRentalStory() && num >= 2 && !_isHistoryOfUsingTrialDeck) - { - _isEnableDeckRentalAssist = true; - } - else - { - ShowResult(isWin); - } - } - - private void ShowResult(bool isWin) - { - m_battleResultNewControl.MissionBtnObj.labels[0].text = Data.SystemText.Get("Battle_0200"); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.MissionBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().createInSceneCenterLoading(); - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); - missionInfoTask.SetParameter(); - m_battleResultNewControl.StartCoroutine(Toolbox.NetworkManager.Connect(missionInfoTask, delegate - { - m_battleResultNewControl.CreateMissionList(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - })); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Clear(); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Clear(); - if (isWin) - { - m_battleResultNewControl.HomeBtnObj.gameObject.SetActive(value: false); - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Story_0004"); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - if (isWin) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Scenario2); - } - })); - return; - } - m_battleResultNewControl.HomeBtnObj.labels[0].text = Data.SystemText.Get("Story_0002"); - m_battleResultNewControl.HomeBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(ChapterSelectionView); - })); - m_battleResultNewControl.RetryBtnObj.labels[0].text = Data.SystemText.Get("Battle_0204"); - m_battleResultNewControl.RetryBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - CreateDeckSelectForStory(); - })); - } - - private void ShowDeckRentalConfirmDialog() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Story_0054")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("Story_0053")); - dialogBase.SetButtonText(systemText.Get("Story_0055"), systemText.Get("Common_0005")); - dialogBase.onPushButton1 = delegate - { - CreateDeckSelectForStoryWithPrimaryTrialDeck(); - }; - dialogBase.onPushButton2 = delegate - { - DeckRentalFinish(); - }; - dialogBase.onCloseWithoutSelect = delegate - { - DeckRentalFinish(); - }; - } - - private void DeckRentalFinish() - { - if (!Data.StoryInfo.IsTrialDeck) - { - SetDeckRentalLoseCount(0); - ShowResult(_isWin); - ResultMenuAppearAnimation(); - } - } - - public void CreateDeckSelectForStory() - { - Parameter param = new Parameter(UIManager.GetInstance(), SelectedStoryInfo, (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_SELECT_DECK_FORMAT), DeckAttributeType.Invalid, null, null); - ExecuteSelectionProcessings(param); - } - - private void CreateDeckSelectForStoryWithPrimaryTrialDeck() - { - bool isDecidedDeck = false; - Parameter param = new Parameter(UIManager.GetInstance(), SelectedStoryInfo, Format.Max, DeckAttributeType.TrialDeck, delegate - { - if (!isDecidedDeck) - { - ShowDeckRentalConfirmDialog(); - } - }, delegate - { - isDecidedDeck = true; - }); - ExecuteSelectionProcessings(param); - Data.StoryInfo.IsTrialDeck = false; - } - - private bool IsEnableDeckRentalStory() - { - if (SelectedStoryInfo.IsFixedDeck) - { - return false; - } - if (SelectedStoryInfo.ClearStatus == StoryChapterData.ChapterClearStatus.Cleared) - { - return false; - } - return true; - } - - private IEnumerator ShowRentalDeckCoroutine() - { - yield return new WaitForSeconds(0.5f); - bool isWaitRewardDialog = m_battleResultNewControl.IsRewardWait; - while (m_battleResultNewControl.IsRewardWait) - { - yield return null; - } - if (isWaitRewardDialog) - { - yield return new WaitForSeconds(0.1f); - } - ShowDeckRentalConfirmDialog(); - } - - public void Show() - { - if (_isEnableDeckRentalAssist) - { - m_battleResultNewControl.StartCoroutine(ShowRentalDeckCoroutine()); - } - else - { - ResultMenuAppearAnimation(); - } - } - - private void ResultMenuAppearAnimation() - { - iTween.MoveTo(m_battleResultNewControl.ButtonGrid.gameObject, iTween.Hash("position", m_battleResultNewControl.DefaultPosDict["ButtonGrid"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private static IProcessing CreateSelectionProcessings() - { - IProcessing[] array = new IProcessing[6] - { - new DeckSelectionDialogDisplay(), - new ChapterCharaDecider(), - new DownloadInfoGetter(), - new DeckSelectionConfirmDialogDisplay(), - new Download(), - new BattleStarter() - }; - for (int i = 0; i < array.Length - 1; i++) - { - array[i].NextProcessing = array[i + 1]; - } - return array.FirstOrDefault(); - } - - private void ExecuteSelectionProcessings(Parameter param) - { - if (_firstSelectionProcessing != null) - { - _firstSelectionProcessing.Execute(param); - } - } -} +// PASS-8/Phase-1 STUB: 200-line client-side story next-scene selector reduced to the +// external static-method surface. `ResetHistoryOfUsingPreBuildDeck` is called from +// AreaSelectUI.cs:492,543 (also stubbed). No instantiations anywhere. +public class StoryNextSceneSelector +{ + public static void ResetHistoryOfUsingPreBuildDeck() { } +} diff --git a/SVSim.BattleEngine/Engine/StoryReportEndAgent.cs b/SVSim.BattleEngine/Engine/StoryReportEndAgent.cs deleted file mode 100644 index 4b402608..00000000 --- a/SVSim.BattleEngine/Engine/StoryReportEndAgent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -public class StoryReportEndAgent : MonoBehaviour -{ - public bool IsEnd { get; private set; } - - public void Finished() - { - IsEnd = true; - } -} diff --git a/SVSim.BattleEngine/Engine/StoryResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/StoryResultAnimationAgent.cs deleted file mode 100644 index 41fa8c33..00000000 --- a/SVSim.BattleEngine/Engine/StoryResultAnimationAgent.cs +++ /dev/null @@ -1,206 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard; -using Wizard.Story; - -public class StoryResultAnimationAgent : ResultAnimationAgent -{ - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); - } - DataMgr.SpecialBattleResultType skipStorySpecialBatlleResult = GameMgr.GetIns().GetDataMgr().SkipStorySpecialBattleResult; - if (skipStorySpecialBatlleResult != DataMgr.SpecialBattleResultType.None && !isWin) - { - GameMgr.GetIns().GetDataMgr().ResetStorySpecialBattleResultSkipFlag(); - } - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (skipStorySpecialBatlleResult != DataMgr.SpecialBattleResultType.None && isWin) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - GameMgr.GetIns().GetDataMgr().SetPlayerEmotionId(string.Empty); - GameMgr.GetIns().GetDataMgr().SetEnemyEmotionId(string.Empty); - } - else - { - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - } - if (skipStorySpecialBatlleResult != DataMgr.SpecialBattleResultType.None && isWin) - { - battleResultControl.SetClassLvAndExp(); - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.Scenario2); - } - else - { - StartCoroutine(ShowResult(battleResultControl, nextSceneSelector, isWin)); - } - } - - private IEnumerator ShowResult(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - string voiceId = GameMgr.GetIns().GetDataMgr().GetPlayerEmotionData()[ClassCharaPrm.EmotionType.WIN].GetVoiceId(BattleManagerBase.GetIns().BattlePlayer.IsSkinEvolved); - GameMgr.GetIns().GetSoundMgr().PlayVoiceByKey(voiceId); - } - GameMgr.GetIns().GetDataMgr().SetPlayerEmotionId(string.Empty); - GameMgr.GetIns().GetDataMgr().SetEnemyEmotionId(string.Empty); - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - for (int i = 0; i < 10; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - yield return new WaitForSeconds(0.5f); - } - battleResultControl.SetBattlePassGauge(delegate - { - StartCoroutine(FinishResult(battleResultControl, nextSceneSelector, isWin)); - }); - } - - public IEnumerator FinishResult(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - SelectedStoryInfo selectedStoryInfo = Data.SelectedStoryInfo; - if (!selectedStoryInfo.IsClassTutorial || !isWin) - { - nextSceneSelector.Show(); - } - else if (selectedStoryInfo.ClearStatus == StoryChapterData.ChapterClearStatus.Cleared) - { - battleResultControl.RewardCheck(); - } - battleResultControl.PrepareAchievementLog(); - if (battleResultControl.ResultReporter.LotteryData.IsEnable) - { - yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); - } - if (ShowRewardDialog(battleResultControl, addStoryReward: true)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - battleResultControl.FinishResult(); - } -} diff --git a/SVSim.BattleEngine/Engine/StoryResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/StoryResultAnimationHandler.cs deleted file mode 100644 index ac47242c..00000000 --- a/SVSim.BattleEngine/Engine/StoryResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class StoryResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly StoryResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public StoryResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/StoryResultReporter.cs b/SVSim.BattleEngine/Engine/StoryResultReporter.cs deleted file mode 100644 index eb54146a..00000000 --- a/SVSim.BattleEngine/Engine/StoryResultReporter.cs +++ /dev/null @@ -1,107 +0,0 @@ -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 => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => GetRewardsList(); - - public List 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(); - } - - 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 GetUserAchievementList() - { - return Data.StoryFinish.data.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.StoryFinish.data.achieved_mission_list; - } - - public List GetRewardsList() - { - return Data.StoryFinish.data.Rewards; - } - - public int GetClassExp() - { - return Data.StoryFinish.data.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/StorySectionData.cs b/SVSim.BattleEngine/Engine/StorySectionData.cs index ff30e26a..d2f58a03 100644 --- a/SVSim.BattleEngine/Engine/StorySectionData.cs +++ b/SVSim.BattleEngine/Engine/StorySectionData.cs @@ -6,14 +6,6 @@ public class StorySectionData { private static readonly string FORMAT_STORY_SECTION_NO = "story_section_no_{0:D2}"; - public const int WAZAWAI_SECTION_ID = 1; - - private const int WAZAWAI_FINAL_SECTION_ID = 2; - - public const int OUKOKU_KIKAN_SECTION_ID = 9003; - - public const int SHUKUSEI_HEN_KOUHEN_SECTION_ID = 20; - public int Id { get; } public int AllStoryOrderId { get; } @@ -78,15 +70,6 @@ public class StorySectionData } } - public bool IsExistExtraBackGround() - { - if (Id != 2 && Id != 9003) - { - return Id == 20; - } - return true; - } - public StorySectionData(JsonData jsonData) { Id = jsonData["section_id"].ToInt(); diff --git a/SVSim.BattleEngine/Engine/SwitchLanguage.cs b/SVSim.BattleEngine/Engine/SwitchLanguage.cs deleted file mode 100644 index 8364a044..00000000 --- a/SVSim.BattleEngine/Engine/SwitchLanguage.cs +++ /dev/null @@ -1,445 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class SwitchLanguage : MonoBehaviour -{ - private const int DEFAULT_INDEX = 0; - - [SerializeField] - private UILabel _labelSelectTextLanguage; - - [SerializeField] - private UILabel _labelSelectVoiceLanguage; - - [SerializeField] - private GameObject _myPageLayoutRoot; - - [SerializeField] - private GameObject _titleLayoutRoot; - - [SerializeField] - private UIToggle _useSmallResource; - - private List _languageTextList = new List(); - - private List _languageKeyList = new List(); - - private List _languageTextListVoice = new List(); - - private int _currentTextIndex; - - private int _currentVoiceIndex; - - private string _selectTextLanguage = ""; - - private string _selectVoiceLanguage = ""; - - private bool _isFirstCallUseSmallResourceToggleChange = true; - - private static readonly Dictionary _dictTableVoiceLanguage = new Dictionary - { - { - Global.LANG_TYPE.Eng.ToString(), - new string[2] - { - Global.LANG_TYPE.Eng.ToString(), - Global.LANG_TYPE.Jpn.ToString() - } - }, - { - Global.LANG_TYPE.Kor.ToString(), - new string[2] - { - Global.LANG_TYPE.Kor.ToString(), - Global.LANG_TYPE.Jpn.ToString() - } - }, - { - Global.LANG_TYPE.Chs.ToString(), - new string[1] { Global.LANG_TYPE.Jpn.ToString() } - }, - { - Global.LANG_TYPE.Cht.ToString(), - new string[1] { Global.LANG_TYPE.Jpn.ToString() } - }, - { - Global.LANG_TYPE.Fre.ToString(), - new string[2] - { - Global.LANG_TYPE.Eng.ToString(), - Global.LANG_TYPE.Jpn.ToString() - } - }, - { - Global.LANG_TYPE.Ita.ToString(), - new string[2] - { - Global.LANG_TYPE.Eng.ToString(), - Global.LANG_TYPE.Jpn.ToString() - } - }, - { - Global.LANG_TYPE.Ger.ToString(), - new string[2] - { - Global.LANG_TYPE.Eng.ToString(), - Global.LANG_TYPE.Jpn.ToString() - } - }, - { - Global.LANG_TYPE.Spa.ToString(), - new string[2] - { - Global.LANG_TYPE.Eng.ToString(), - Global.LANG_TYPE.Jpn.ToString() - } - } - }; - - private Dictionary> _dictTableVoiceLanguageViewText = new Dictionary> - { - { - Global.LANG_TYPE.Eng.ToString(), - new Dictionary - { - { - Global.LANG_TYPE.Eng.ToString(), - "System_Eng_Eng" - }, - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Eng_Jpn" - } - } - }, - { - Global.LANG_TYPE.Kor.ToString(), - new Dictionary - { - { - Global.LANG_TYPE.Kor.ToString(), - "System_Kor_Kor" - }, - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Kor_Jpn" - } - } - }, - { - Global.LANG_TYPE.Chs.ToString(), - new Dictionary { - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Chs_Jpn" - } } - }, - { - Global.LANG_TYPE.Cht.ToString(), - new Dictionary { - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Cht_Jpn" - } } - }, - { - Global.LANG_TYPE.Fre.ToString(), - new Dictionary - { - { - Global.LANG_TYPE.Eng.ToString(), - "System_Fre_Eng" - }, - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Fre_Jpn" - } - } - }, - { - Global.LANG_TYPE.Ita.ToString(), - new Dictionary - { - { - Global.LANG_TYPE.Eng.ToString(), - "System_Ita_Eng" - }, - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Ita_Jpn" - } - } - }, - { - Global.LANG_TYPE.Ger.ToString(), - new Dictionary - { - { - Global.LANG_TYPE.Eng.ToString(), - "System_Ger_Eng" - }, - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Ger_Jpn" - } - } - }, - { - Global.LANG_TYPE.Spa.ToString(), - new Dictionary - { - { - Global.LANG_TYPE.Eng.ToString(), - "System_Spa_Eng" - }, - { - Global.LANG_TYPE.Jpn.ToString(), - "System_Spa_Jpn" - } - } - } - }; - - private DialogBase _switchLanguageDialog; - - public static void Create(bool isForceConfirmDialog, bool isTitle, Action decideCallback, Action decideCallbackWhenSameChoice = null) - { - SwitchLanguage switchLanguage = UnityEngine.Object.Instantiate(UIManager.GetInstance().SwitchLanguagePrefab); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetObj(switchLanguage.gameObject); - switchLanguage.CreateSwitchLanguageDialog(dialogBase, isForceConfirmDialog, isTitle, decideCallback, decideCallbackWhenSameChoice); - } - - public static string GetDefaultVoiceLanguage(string languageKey) - { - if (_dictTableVoiceLanguage.ContainsKey(languageKey)) - { - return _dictTableVoiceLanguage[languageKey][0]; - } - return "Eng"; - } - - public void CreateSwitchLanguageDialog(DialogBase dialog, bool isForceConfirmDialog, bool isTitle, Action decideCallback, Action decideCallbackWhenSameChoice = null) - { - SystemText text = Data.SystemText; - _switchLanguageDialog = dialog; - _switchLanguageDialog.SetSize(DialogBase.Size.M); - _switchLanguageDialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - _switchLanguageDialog.SetButtonText(text.Get("Common_0004")); - _switchLanguageDialog.SetTitleLabel(text.Get("Dia_Language_003_Title")); - _languageKeyList.Clear(); - _languageTextList.Clear(); - Global.LanguageProps[] languagePropList = Global.LanguagePropList; - for (int i = 0; i < languagePropList.Length; i++) - { - Global.LanguageProps languageProps = languagePropList[i]; - _languageKeyList.Add(languageProps.LangType); - _languageTextList.Add(languageProps.DisplayName); - } - isTitle = true; - _titleLayoutRoot.SetActive(isTitle); - _myPageLayoutRoot.SetActive(!isTitle); - _useSmallResource.value = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 2; - _useSmallResource.onChange.Add(new EventDelegate(delegate - { - OnClickUseSmallResource(); - })); - _selectTextLanguage = Toolbox.SavedataManager.GetString("LANG_SETTING", "Eng"); - _selectVoiceLanguage = Toolbox.SavedataManager.GetString("LANG_SOUND_SETTING", GetDefaultVoiceLanguage(_selectTextLanguage)); - UpdateSelectLanguageLabel(); - _switchLanguageDialog.SetButtonDelegate(delegate - { - bool flag = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 2; - bool afterUseSmallResource = _useSmallResource.value; - if (isTitle) - { - afterUseSmallResource = flag; - } - if (IsSameCurrentLanguage() && flag == afterUseSmallResource && !isForceConfirmDialog) - { - Toolbox.SavedataManager.SetString("LANG_FIRST_SET", "1"); - decideCallbackWhenSameChoice.Call(); - } - else - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(text.Get("System_0040")); - string textLanguageViewText = GetTextLanguageViewText(_selectTextLanguage); - string voiceLanguageViewText = GetVoiceLanguageViewText(_selectTextLanguage, _selectVoiceLanguage); - string arg = Data.SystemText.Get(afterUseSmallResource ? "System_0062" : "System_0061"); - string key = ((PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 0) ? "System_0063" : "System_0041"); - dialogBase.SetText(string.Format(text.Get(key), textLanguageViewText, voiceLanguageViewText, arg)); - string selectText = _selectTextLanguage; - string selectVoice = _selectVoiceLanguage; - bool isSameCurrentLanguage = IsSameCurrentLanguage(); - dialogBase.SetButtonText(text.Get("Common_0004")); - dialogBase.SetButtonDelegate(delegate - { - if (UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Title) - { - CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - ChangeLanguage(isTitle, afterUseSmallResource, decideCallback, selectText, selectVoice, isSameCurrentLanguage); - })); - } - else - { - ChangeLanguage(isTitle, afterUseSmallResource, decideCallback, selectText, selectVoice, isSameCurrentLanguage); - } - }); - } - }); - } - - private static void ChangeLanguage(bool isTitle, bool afterUseSmallResource, Action decideCallback, string selectTextLanguage, string selectVoiceLanguage, bool isSameCurrentLanguage) - { - Toolbox.SavedataManager.SetString("LANG_SETTING", selectTextLanguage); - string fontLangType = Global.GetFontLangType(selectTextLanguage); - Toolbox.SavedataManager.SetString("LANG_FONT", fontLangType); - CustomPreference.SetTextLanguage(Toolbox.SavedataManager.GetString("LANG_SETTING", "Eng")); - Toolbox.SavedataManager.SetString("LANG_SOUND_SETTING", selectVoiceLanguage); - CustomPreference.SetSoundLanguage(Toolbox.SavedataManager.GetString("LANG_SOUND_SETTING", "Eng")); - if (!isTitle) - { - PlayerPrefsCache.Instance.SetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS, (!afterUseSmallResource) ? 1 : 2); - } - Toolbox.SavedataManager.SetString("LANG_FIRST_SET", "1"); - ToolboxGame.SetUp.InitFrameWorkSettings(); - CustomPreference.createResourcePath(); - Data.Initialize(); - Data.SystemText.Initialize(); - if (selectTextLanguage != selectVoiceLanguage) - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES, flag: true); - } - else - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES, flag: false); - } - decideCallback.Call(!isSameCurrentLanguage); - } - - public void CreateSwitchTextLanguageDialog() - { - _switchLanguageDialog.SetDisp(inDisp: false); - _currentTextIndex = _languageKeyList.FindIndex((string k) => k == _selectTextLanguage); - if (_currentTextIndex == -1) - { - _currentTextIndex = 0; - } - DialogBase dia = DrumrollDialog.Create(_languageTextList, _currentTextIndex, onSelectTextLanguage); - SystemText systemText = Data.SystemText; - dia.SetTitleLabel(systemText.Get("Dia_Language_001_Text_Title")); - dia.SetButtonText(systemText.Get("Common_0004")); - dia.ResetBackViewAlpha(); - dia.onPushButton1 = delegate - { - _selectTextLanguage = _languageKeyList[_currentTextIndex]; - _selectVoiceLanguage = GetDefaultVoiceLanguage(_selectTextLanguage); - UpdateSelectLanguageLabel(); - _switchLanguageDialog.ReOpen(isResetBackViewAlpha: true); - dia.InactiveBackView(); - }; - dia.onCloseWithoutSelect = delegate - { - _switchLanguageDialog.ReOpen(isResetBackViewAlpha: true); - dia.InactiveBackView(); - }; - } - - private void onSelectTextLanguage(int index) - { - _currentTextIndex = index; - } - - public void CreateSwitchVoiceLanguageDialog() - { - _switchLanguageDialog.SetDisp(inDisp: false); - string[] array = _dictTableVoiceLanguage[_selectTextLanguage]; - _currentVoiceIndex = 0; - _languageTextListVoice.Clear(); - for (int i = 0; i < array.Length; i++) - { - string text = array[i]; - _languageTextListVoice.Add(GetVoiceLanguageViewText(_selectTextLanguage, text)); - if (_selectVoiceLanguage == text) - { - _currentVoiceIndex = i; - } - } - DialogBase dia = DrumrollDialog.Create(_languageTextListVoice, _currentVoiceIndex, onSelectVoiceLanguage); - SystemText systemText = Data.SystemText; - dia.SetTitleLabel(systemText.Get("Dia_Language_002_Voice_Title")); - dia.SetButtonText(systemText.Get("Common_0004")); - dia.ResetBackViewAlpha(); - dia.onPushButton1 = delegate - { - _selectVoiceLanguage = _dictTableVoiceLanguage[_selectTextLanguage][_currentVoiceIndex]; - UpdateSelectLanguageLabel(); - _switchLanguageDialog.ReOpen(isResetBackViewAlpha: true); - dia.InactiveBackView(); - }; - dia.onCloseWithoutSelect = delegate - { - _switchLanguageDialog.ReOpen(isResetBackViewAlpha: true); - dia.InactiveBackView(); - }; - } - - private void onSelectVoiceLanguage(int index) - { - _currentVoiceIndex = index; - } - - private void UpdateSelectLanguageLabel() - { - _labelSelectTextLanguage.text = GetTextLanguageViewText(_selectTextLanguage); - _labelSelectVoiceLanguage.text = GetVoiceLanguageViewText(_selectTextLanguage, _selectVoiceLanguage); - } - - private string GetTextLanguageViewText(string key) - { - string result = string.Empty; - if (Global.IsSupportedLanguageType(key)) - { - result = Global.GetDisplayLanguage(key); - } - return result; - } - - private string GetVoiceLanguageViewText(string textKey, string voiceKey) - { - string text = string.Empty; - if (_dictTableVoiceLanguageViewText.ContainsKey(textKey) && _dictTableVoiceLanguageViewText[textKey].ContainsKey(voiceKey)) - { - text = Data.SystemText.Get(_dictTableVoiceLanguageViewText[textKey][voiceKey]); - } - _ = text == string.Empty; - return text; - } - - private bool IsSameCurrentLanguage() - { - string text = Toolbox.SavedataManager.GetString("LANG_SETTING", "Eng"); - string text2 = Toolbox.SavedataManager.GetString("LANG_SOUND_SETTING", "Eng"); - if (_selectTextLanguage == text && _selectVoiceLanguage == text2) - { - return true; - } - return false; - } - - private void OnClickUseSmallResource() - { - if (!_isFirstCallUseSmallResourceToggleChange) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_useSmallResource.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - _isFirstCallUseSmallResourceToggleChange = false; - } -} diff --git a/SVSim.BattleEngine/Engine/TaskManager.cs b/SVSim.BattleEngine/Engine/TaskManager.cs deleted file mode 100644 index 73275792..00000000 --- a/SVSim.BattleEngine/Engine/TaskManager.cs +++ /dev/null @@ -1,181 +0,0 @@ -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Scripts.Network.Task.Arena; -using Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class TaskManager : MonoBehaviour -{ - private NetworkManager networkManager; - - private GameObject returnSendObj; - - private static TaskManager main; - - private string returnMsg = ""; - - private const string mypageSendTraceFlag_Key = "mypageSendTraceFlag"; - - private void Awake() - { - main = this; - } - - public static TaskManager GetInstance() - { - return main; - } - - private NetworkManager getNetworkManager() - { - if (networkManager == null) - { - networkManager = Toolbox.NetworkManager; - } - return networkManager; - } - - public void StartMailTop(GameObject sendObj, string msg, bool isTutorial) - { - returnMsg = msg; - returnSendObj = sendObj; - MailTopTask mailTopTask = new MailTopTask(); - mailTopTask.SetParameter(isTutorial); - StartCoroutine(getNetworkManager().Connect(mailTopTask, mailtop, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - private void mailtop(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - private void ReadMail(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - private void UserData(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - public void StartArenaTopTaskData(GameObject sendObj, string msg, int mode) - { - returnMsg = msg; - returnSendObj = sendObj; - ArenaTopTaskBase taskInstance = ArenaTopTaskBase.GetTaskInstance(mode); - taskInstance.SetParameter(); - StartCoroutine(getNetworkManager().Connect(taskInstance, ArenaTopTaskData, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - private void ArenaTopTaskData(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - public void StartArenaPrepareData(GameObject sendObj, string msg, int mode, int payType) - { - returnMsg = msg; - returnSendObj = sendObj; - ArenaEntryTaskBase taskInstance = ArenaEntryTaskBase.GetTaskInstance(mode); - taskInstance.SetParameter(payType); - StartCoroutine(getNetworkManager().Connect(taskInstance, ArenaPrepareData, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - private void ArenaPrepareData(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - public void StartArenaClassCharaChooseData(GameObject sendObj, string msg, int classId) - { - ClassCharaChooseTask classCharaChooseTask = new ClassCharaChooseTask(); - classCharaChooseTask.SetParameter(classId); - StartTask(classCharaChooseTask, sendObj, msg); - } - - public void StartTask(NetworkTask task, GameObject sendObj, string msg) - { - returnMsg = msg; - returnSendObj = sendObj; - StartCoroutine(getNetworkManager().Connect(task, SendMessage, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - public void StartArenaCardChooseTaskData(GameObject sendObj, string msg, int selectedId) - { - CardChooseTask cardChooseTask = new CardChooseTask(); - cardChooseTask.SetParameter(selectedId); - StartTask(cardChooseTask, sendObj, msg); - } - - private void SendMessage(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - public void StartArenaRetireTaskData(GameObject sendObj, string msg, int mode) - { - returnMsg = msg; - returnSendObj = sendObj; - ArenaRetireTaskBase taskInstance = ArenaRetireTaskBase.GetTaskInstance(mode); - taskInstance.SetParameter(); - StartCoroutine(getNetworkManager().Connect(taskInstance, ArenaRetireTaskData, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - private void ArenaRetireTaskData(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - public void StartArenaFinishTaskData(GameObject sendObj, string msg, int mode) - { - returnMsg = msg; - returnSendObj = sendObj; - FinishTask finishTask = new FinishTask(); - finishTask.SetParameter(); - StartCoroutine(getNetworkManager().Connect(finishTask, ArenaFinishTaskData, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - private void ArenaFinishTaskData(NetworkTask.ResultCode error) - { - returnSendObj.SendMessage(returnMsg); - } - - public static void GetErrorMsgFromCode(int code, out string msg, out string title) - { - string key = "Error_" + code.ToString("0000"); - string key2 = "ErrorHeader_" + code.ToString("0000"); - msg = Data.SystemText.Get(key); - title = Data.SystemText.Get(key2); - } - - public void ClearLastLogKey() - { - LocalLog.ClearLastLogKey(); - NotMyPageSend(); - } - - public void MyPageSend() - { - PlayerPrefs.SetInt("mypageSendTraceFlag", 1); - } - - public void NotMyPageSend() - { - PlayerPrefs.SetInt("mypageSendTraceFlag", 0); - } - - public bool IsMyPageSend() - { - if (PlayerPrefs.GetInt("mypageSendTraceFlag") != 1) - { - return false; - } - return true; - } - - private void BackToHome() - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.MyPage); - } -} diff --git a/SVSim.BattleEngine/Engine/TempleField.cs b/SVSim.BattleEngine/Engine/TempleField.cs index 53c6e374..070758f8 100644 --- a/SVSim.BattleEngine/Engine/TempleField.cs +++ b/SVSim.BattleEngine/Engine/TempleField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class TempleField : BackGroundBase { public override int FieldId => 5; @@ -10,121 +11,4 @@ public class TempleField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_ctdl_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles05").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - if (FieldId == 5) - { - _fieldParticleSystemDictionary.Add("monu", _fieldParticles.transform.Find("monu").GetComponent()); - _fieldParticleSystemDictionary.Add("monu_2", _fieldParticles.transform.Find("monu_2").GetComponent()); - _fieldParticleSystemDictionary.Add("monu_summon", _fieldParticles.transform.Find("monu_summon").GetComponent()); - _fieldParticleSystemDictionary.Add("monu_gimic_1", _fieldParticles.transform.Find("monu_gimic_1").GetComponent()); - } - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_5, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_5_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(-750f, 250f, -220f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-20f, -90f, 90f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-220f, -20f, -60f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-25f, -97f, 93f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - if (FieldId == 5) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1") - { - switch (_gimicCntDictionary[obj.tag]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - _gimicCntDictionary[obj.tag]++; - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["monu"].transform.GetChild(_gimicCntDictionary[obj.tag] - 1).GetComponent().Play(); - _fieldParticleSystemDictionary["monu_2"].transform.GetChild(_gimicCntDictionary[obj.tag] - 1).GetComponent().Play(); - break; - case 9: - { - _gimicCntDictionary[obj.tag]++; - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["monu"].transform.GetChild(_gimicCntDictionary[obj.tag] - 1).GetComponent().Play(); - _fieldParticleSystemDictionary["monu_2"].transform.GetChild(_gimicCntDictionary[obj.tag] - 1).GetComponent().Play(); - yield return new WaitForSeconds(1f); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_2", "se_field_" + _str3DFieldNo, 0f, 0L); - for (int i = 0; i < _fieldParticleSystemDictionary["monu"].transform.childCount; i++) - { - ParticleSystem.MainModule main = _fieldParticleSystemDictionary["monu"].transform.GetChild(i).GetComponent().main; - main.startColor = new Color(1f, 0.25f, 0.25f); - _fieldParticleSystemDictionary["monu"].transform.GetChild(i).GetComponent().Stop(); - _fieldParticleSystemDictionary["monu"].transform.GetChild(i).GetComponent().Play(); - } - _fieldParticleSystemDictionary["monu_summon"].Play(); - yield return new WaitForSeconds(1f); - for (int j = 0; j < _fieldParticleSystemDictionary["monu"].transform.childCount; j++) - { - ParticleSystem.MainModule main2 = _fieldParticleSystemDictionary["monu"].transform.GetChild(j).GetComponent().main; - main2.startColor = new Color(0.25f, 0.5f, 1f); - _fieldParticleSystemDictionary["monu"].transform.GetChild(j).GetComponent().Stop(); - } - yield return new WaitForSeconds(4f); - _gimicCntDictionary[obj.tag] = 0; - break; - } - } - } - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/TempleNightField.cs b/SVSim.BattleEngine/Engine/TempleNightField.cs index c49de424..460fa78f 100644 --- a/SVSim.BattleEngine/Engine/TempleNightField.cs +++ b/SVSim.BattleEngine/Engine/TempleNightField.cs @@ -1,7 +1,11 @@ +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class TempleNightField : TempleField { public override int FieldId => 15; - public override int FieldEffectId => 5; public TempleNightField(string bgmId = "NONE") diff --git a/SVSim.BattleEngine/Engine/Timer.cs b/SVSim.BattleEngine/Engine/Timer.cs index 453fd672..e75f79fe 100644 --- a/SVSim.BattleEngine/Engine/Timer.cs +++ b/SVSim.BattleEngine/Engine/Timer.cs @@ -37,11 +37,6 @@ public class Timer this.onEndEvent(); } - public void Cancel() - { - IsEnd = true; - } - public static IEnumerator DelayMethod(float waitTime, Action process) { yield return new WaitForSeconds(waitTime); diff --git a/SVSim.BattleEngine/Engine/TimerMgr.cs b/SVSim.BattleEngine/Engine/TimerMgr.cs index 33b7e7ad..94e03b6f 100644 --- a/SVSim.BattleEngine/Engine/TimerMgr.cs +++ b/SVSim.BattleEngine/Engine/TimerMgr.cs @@ -32,13 +32,4 @@ public class TimerMgr { timerList.Remove(timer); } - - public void Flush() - { - foreach (Timer item in timerList.OrderBy((Timer x) => x.RemainTimeSec)) - { - item.CallEvent(); - } - timerList.Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/TitleMenu.cs b/SVSim.BattleEngine/Engine/TitleMenu.cs deleted file mode 100644 index 596f7ade..00000000 --- a/SVSim.BattleEngine/Engine/TitleMenu.cs +++ /dev/null @@ -1,85 +0,0 @@ -using UnityEngine; -using Wizard; - -public class TitleMenu : MonoBehaviour -{ - [SerializeField] - protected UIButton BtnCacheClear; - - [SerializeField] - protected UIButton BtnNewInfo; - - [SerializeField] - protected UIButton BtnCs; - - [SerializeField] - protected UIButton _quitBtn; - - [SerializeField] - protected UIButton _deleteUserDataButton; - - public GameObject ParentObject; - - private DialogBase dia; - - private void Start() - { - EventDelegate.Add(BtnCacheClear.onClick, ShowCacheClearInfo); - EventDelegate.Add(BtnNewInfo.onClick, ShowWebViewInfo); - EventDelegate.Add(BtnCs.onClick, ShowFAQInfo); - _quitBtn.gameObject.SetActive(value: true); - EventDelegate.Add(_quitBtn.onClick, Application.Quit); - _deleteUserDataButton.gameObject.SetActive(value: false); - } - - public void ShowWebViewInfo() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.INFO); - } - - private void ShowFAQInfo() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DialogSupport.Create(); - } - - private void ShowCacheClearInfo() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - SystemText systemText = Data.SystemText; - dia = UIManager.GetInstance().CreateDialogClose(); - dia.SetSize(DialogBase.Size.M); - dia.SetTitleLabel(systemText.Get("Title_0007")); - dia.SetText(systemText.Get("Title_0008")); - dia.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dia.SetButtonText(systemText.Get("Dia_Title_001_Button")); - dia.SetReturnMsg(ParentObject, "ClearCache"); - dia.SetPanelDepth(3000); - } - - private void OnClickDeleteUserDataButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Title_0046")); - dialogBase.SetText(Data.SystemText.Get("Title_0047")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Title_0048")); - dialogBase.onPushButton1 = OpenDeleteUserDataConfirmDialog; - dialogBase.SetPanelDepth(3000); - } - - private void OpenDeleteUserDataConfirmDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Title_0051")); - dialogBase.SetText(Data.SystemText.Get("Title_0049")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Title_0048")); - dialogBase.SetReturnMsg(ParentObject, "DeleteUserData"); - dialogBase.SetPanelDepth(3000); - } -} diff --git a/SVSim.BattleEngine/Engine/TitleUI.cs b/SVSim.BattleEngine/Engine/TitleUI.cs deleted file mode 100644 index 94240e2a..00000000 --- a/SVSim.BattleEngine/Engine/TitleUI.cs +++ /dev/null @@ -1,722 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle.Recovery; -using Wizard.Title; - -public class TitleUI : UIBase -{ - public enum ImageType - { - Default, - Special1, - Special2, - Special3 - } - - public enum BgmType - { - Default, - Special1, - Special2 - } - - private class GuidelineParam - { - public float DisplayTime { get; private set; } - - public bool IncludeFadeInOut { get; private set; } - - public bool EnableTouch { get; private set; } - - public float FadeInTime { get; private set; } - - public float PanelFadeOutTime { get; private set; } - - public float BgFadeOutTime { get; private set; } - - public GuidelineParam(float displayTime, bool includeFadeInOut, bool enableTouch, float fadeInTime, float panelFadeOutTime, float bgFadeOutTime) - { - DisplayTime = displayTime; - IncludeFadeInOut = includeFadeInOut; - EnableTouch = enableTouch; - FadeInTime = fadeInTime; - PanelFadeOutTime = panelFadeOutTime; - BgFadeOutTime = bgFadeOutTime; - } - } - - public const string DEFAULT_TITLE_ID = "0"; - - public const string USE_LOCAL_PREFAB_ID = "1"; - - private const string DEFAULT_TITLE_PATH = "Title/NormalTitle/NormalTitle"; - - [SerializeField] - private GameObject BtnTouchStart; - - [SerializeField] - private UILabel VersionIDLabel; - - [SerializeField] - private UILabel UserIDLabel; - - [SerializeField] - private GameObject _userIdRoot; - - [SerializeField] - private UIButton ButtonMenu; - - [SerializeField] - private UILabel ButtonMenuLabel; - - [SerializeField] - private GameObject ButtonMenuObject; - - [SerializeField] - private UIButton ButtonTransfer; - - [SerializeField] - private UILabel ButtonTransferLabel; - - [SerializeField] - private NguiObjs LoginInput; - - [SerializeField] - private GameObject _korGuidelineRoot; - - [SerializeField] - private UIPanel _korGuidelineDisplayRootPanel; - - [SerializeField] - private UISprite _korGuidelineBG; - - [SerializeField] - private GameObject _jpnGuidelineRoot; - - [SerializeField] - private UIPanel _jpnGuidelineDisplayRootPanel; - - [SerializeField] - private UISprite _jpnGuidelineBG; - - [SerializeField] - private float _jpnGuidelineDisplayTime; - - [SerializeField] - private bool _jpnGuidelineIncludeFadeInOut; - - [SerializeField] - private GameObject _parentTitleView; - - [SerializeField] - private SpecialTitleAssetBundle _specialTitle; - - private GameObject _normalTitle; - - private DialogBase dia; - - private GameSetup _gameSetup; - - private bool _isAutoCacheExecution; - - private Coroutine _fadeInCoroutine; - - private bool _isSteamKor; - - private DataMgr _dataManager; - - private SoundMgr _soundManager; - - private bool IsDownloadTitle - { - get - { - if (_dataManager.TitleId != "0") - { - return _dataManager.TitleId != "1"; - } - return false; - } - } - - public override void onFirstStart() - { - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString()) - { - _isSteamKor = true; - } - else - { - _isSteamKor = false; - } - string appVersionName = Toolbox.DeviceManager.GetAppVersionName(); - try - { - VideoHostingUtil.AutoPausePublishing(isSave: true); - VideoHostingUtil.AutoStopRecording(isSave: true); - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 VideoHostingUtil InitializeException"); - throw; - } - Toolbox.SceneManager.SceneChangeParameter.KeepAssets = false; - VersionIDLabel.text = "Ver." + appVersionName; - if (Certification.ViewerId > 0) - { - SetUserIdLabel(Certification.ViewerId); - } - else - { - try - { - RecoveryRecordManagerBase.DeleteRecoveryFile(); - SetUserIdLabel(Certification.ViewerId); - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 DeleteRecoveryDataException"); - throw; - } - } - SystemText systemText = Data.SystemText; - try - { - ButtonMenuLabel.text = systemText.Get("Title_0006"); - ButtonTransferLabel.text = systemText.Get("Account_0001"); - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 ButtonTextSetException"); - throw; - } - try - { - base.onFirstStart(); - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 BaseFirstStartException"); - } - GameMgr ins = GameMgr.GetIns(); - _dataManager = ins.GetDataMgr(); - _soundManager = ins.GetSoundMgr(); - try - { - SetChangeableTitleUI(); - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 SetChangeableTitleUIException"); - } - try - { - ins.GetGameObjMgr().GetUIContainer().SetActive(value: false); - Toolbox.AssetManager.AddNoUnloadAssetGroupName("card_foil"); - _gameSetup = new GameSetup(this); - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 InitializeExeption"); - } - try - { - UIEventListener.Get(BtnTouchStart.gameObject).onClick = OnClickStartButton; - UIEventListener.Get(ButtonMenu.gameObject).onClick = OnClickMenuButton; - UIEventListener.Get(ButtonTransfer.gameObject).onClick = OnClickTransferButton; - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 ButtonCallBackException"); - } - if (!DisplayGuideline()) - { - PlayChangeableTitleBGM(); - } - UIManager.GetInstance().CreatFadeOpen(); - if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.AUTO_CACHE_CLEAR_FLAG)) - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.AUTO_CACHE_CLEAR_FLAG, flag: false); - _isAutoCacheExecution = true; - ClearCache(); - } - } - - private void SetUserIdLabel(int id) - { - if (id > 0) - { - UserIDLabel.text = VideoHostingUtil.GetUserIDHidden($"ID: {id:#,0}".Replace(",", " ")); - } - else - { - UserIDLabel.text = ""; - } - _userIdRoot.SetActive(id > 0); - } - - private void PlayChangeableTitleBGM() - { - switch (_dataManager.TitleId) - { - case "0": - _soundManager.PlayBGM(Bgm.BGM_TYPE.TITLE); - break; - case "1": - _soundManager.PlayBGM(Bgm.BGM_TYPE.TITLE_SPECIAL_1); - break; - default: - _specialTitle.PlayBGM(); - break; - } - } - - private void SetChangeableTitleUI() - { - switch (_dataManager.TitleId) - { - case "0": - _normalTitle = InitializeLocalPrefabTitle("Title/NormalTitle/NormalTitle"); - break; - case "1": - InitializeLocalPrefabTitle("Title/SpecialTitle1/SpecialTitle1"); - break; - default: - _specialTitle.Initialize(_dataManager.TitleId); - break; - } - } - - private GameObject InitializeLocalPrefabTitle(string path) - { - ChangeableTitleUIParts component = NGUITools.AddChild(_parentTitleView, Resources.Load(path) as GameObject).GetComponent(); - if (component != null) - { - component.Init(); - return component.gameObject; - } - return null; - } - - private bool DisplayGuideline() - { - bool result = false; - try - { - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Jpn.ToString()) - { - GuidelineParam param = new GuidelineParam(_jpnGuidelineDisplayTime, _jpnGuidelineIncludeFadeInOut, enableTouch: true, 0.5f, 0.5f, 0.5f); - _fadeInCoroutine = StartCoroutine(GuidelineFadeCoroutine(_jpnGuidelineRoot, _jpnGuidelineDisplayRootPanel, _jpnGuidelineBG, param)); - result = true; - } - else - { - _jpnGuidelineRoot.SetActive(value: false); - } - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 DisplayGuideline.JapanInitializeException"); - throw; - } - try - { - if (_isSteamKor) - { - GuidelineParam param2 = new GuidelineParam(3f, includeFadeInOut: false, enableTouch: false, 0.3f, 0.3f, 0.3f); - _fadeInCoroutine = StartCoroutine(GuidelineFadeCoroutine(_korGuidelineRoot, _korGuidelineDisplayRootPanel, _korGuidelineBG, param2)); - result = true; - } - else - { - _korGuidelineRoot.SetActive(value: false); - } - } - catch (Exception) - { - LocalLog.AccumulateTraceLog("690753 DisplayGuideline.KorInitializeException"); - throw; - } - return result; - } - - private IEnumerator GuidelineFadeCoroutine(GameObject guidelineRoot, UIPanel guidelineRootPanel, UISprite bg, GuidelineParam param) - { - guidelineRoot.SetActive(value: true); - guidelineRootPanel.alpha = 0f; - TweenAlpha.Begin(guidelineRootPanel.gameObject, param.FadeInTime, 1f); - if (param.EnableTouch) - { - UIEventListener uIEventListener = UIEventListener.Get(bg.gameObject); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate(GameObject g) - { - SkipGuidelineEvent(g, guidelineRoot, guidelineRootPanel, bg, param, _fadeInCoroutine); - }); - } - yield return new WaitForSeconds(param.FadeInTime); - float time = 0f; - float waitFadeTime = param.DisplayTime; - if (param.IncludeFadeInOut) - { - waitFadeTime = waitFadeTime - param.FadeInTime - param.PanelFadeOutTime - param.BgFadeOutTime; - } - while (true) - { - time += Time.deltaTime; - if (time > waitFadeTime) - { - break; - } - yield return null; - } - StartCoroutine(EndGuideline(guidelineRoot, guidelineRootPanel, bg, param)); - } - - private void SkipGuidelineEvent(GameObject g, GameObject guidelineRoot, UIPanel guidelineRootPanel, UISprite bg, GuidelineParam param, Coroutine fadeInCoroutine) - { - StopCoroutine(fadeInCoroutine); - StartCoroutine(EndGuideline(guidelineRoot, guidelineRootPanel, bg, param)); - } - - private IEnumerator EndGuideline(GameObject guidelineRoot, UIPanel guidelineRootPanel, UISprite bg, GuidelineParam param) - { - if (param.EnableTouch) - { - UIEventListener.Get(bg.gameObject).onClick = null; - } - TweenAlpha.Begin(guidelineRootPanel.gameObject, param.PanelFadeOutTime, 0f); - yield return new WaitForSeconds(param.PanelFadeOutTime); - PlayChangeableTitleBGM(); - TweenAlpha.Begin(bg.gameObject, param.BgFadeOutTime, 0f); - yield return new WaitForSeconds(param.BgFadeOutTime); - guidelineRoot.SetActive(value: false); - } - - public bool IsEnableClickButton() - { - if (!_gameSetup.IsRunning) - { - return !_isAutoCacheExecution; - } - return false; - } - - private void OnClickStartButton(GameObject g) - { - if (IsEnableClickButton()) - { - NtDataTranslateManager.GetInstance().ShowCygamesStatement(attendSetLanguage, fromTitle: true); - } - } - - private void StartCuteCertification() - { - StartCoroutine(cuteCertification(delegate - { - if (!ShowRefundDialogIfNeeded()) - { - attendSocialAccountDataTrans(); - } - })); - } - - private void OnClickMenuButton(GameObject g) - { - if (IsEnableClickButton()) - { - _soundManager.PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - ShowMenu(); - } - } - - private void OnClickTransferButton(GameObject g) - { - if (IsEnableClickButton()) - { - _soundManager.PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - StartCoroutine(cuteCertification(ShowTransferMenu)); - } - } - - private IEnumerator cuteCertification(Action callback) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true, notCollider: false, force: false); - yield return StartCoroutine(Toolbox.NetworkManager._certification.Login()); - while (!Toolbox.BootNetwork.IsDoneGameStartCheck) - { - yield return 0; - } - UIManager.GetInstance().closeInSceneCenterLoading(); - CustomPreference.createResourcePath(); - callback?.Invoke(); - } - - private void attendSetLanguage() - { - Action onFinish = delegate - { - StartCuteCertification(); - }; - if (string.IsNullOrEmpty(Toolbox.SavedataManager.GetString("LANG_FIRST_SET"))) - { - SwitchLanguage.Create(isForceConfirmDialog: true, isTitle: true, delegate - { - onFinish(); - }, attendSocialAccountDataTrans); - } - else - { - onFinish(); - } - } - - private bool ShowRefundDialogIfNeeded() - { - string refundUrl = GameStartCheckTask.RefundUrl; - if (string.IsNullOrEmpty(refundUrl)) - { - return false; - } - OutOfService.ShowRefundDialog(refundUrl); - return true; - } - - private void attendSocialAccountDataTrans() - { - if (GameStartCheckTask.IsSocialAccountDataTransNotSetAndTutorialClear && !GameStartCheckTask.HasAppliedForAccountDeletion && PlayerStaticData._tosAgreementState != PlayerStaticData.AgreementState.Reset && PlayerStaticData._privacyPolicyAgreementState != PlayerStaticData.AgreementState.Reset && PlayerStaticData.KorAuthorityAgreementState != PlayerStaticData.AgreementState.Reset && !UIManager.GetInstance().IsAutoCacheClearAfter) - { - ShowAccountConnectWindow(); - } - else - { - startGameSetup(); - } - } - - private void startGameSetup() - { - LocalLog.RecordFreezeLogIfLoadErrorOccured(); - SetUserIdLabel(Certification.ViewerId); - if (!_gameSetup.IsRunning) - { - StartUpDateRegion(); - } - } - - private void StartUpDateRegion() - { - new UserRegionUpdater().UpDateRegion(delegate - { - StartCoroutine(_gameSetup.StartSetup()); - }); - } - - private void ShowMenu() - { - GameObject gameObject = UnityEngine.Object.Instantiate(ButtonMenuObject); - TitleMenu component = gameObject.GetComponent(); - SystemText systemText = Data.SystemText; - dia = UIManager.GetInstance().CreateDialogClose(); - dia.SetTitleLabel(systemText.Get("Title_0006")); - dia.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dia.SetObj(gameObject); - dia.SetPanelDepth(1); - component.ParentObject = base.gameObject; - } - - private void ShowTransferMenu() - { - SetUserIdLabel(Certification.ViewerId); - SystemText systemText = Data.SystemText; - dia = UIManager.GetInstance().CreateDialogClose(); - dia.SetSize(DialogBase.Size.M); - dia.SetTitleLabel(systemText.Get("Account_0001")); - string text = systemText.Get("OtherTop_0020"); - dia.SetText(text); - dia.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dia.SetButtonText(systemText.Get("Account_0089")); - EventDelegate method_btn = new EventDelegate(delegate - { - UIManager.GetInstance().AccountTransferHelper.CreateAccountTransferDialog(AccountBase.DisplayType.TITLE, AccountBase.TransitionOriginalScreen.TITLE); - }); - dia.SetButtonDelegate(method_btn); - } - - public void ClearCache() - { - if (dia != null) - { - dia.CloseWithoutSelect(); - } - if (IsViewerIdDecided()) - { - ClientCacheClearTask task = new ClientCacheClearTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - ClearCacheCore(); - })); - } - else - { - ClearCacheCore(); - } - } - - private void ClearCacheCore() - { - UIManager.GetInstance().createInSceneLoading(); - if (IsDownloadTitle) - { - _soundManager.PlayBGM(Bgm.BGM_TYPE.TITLE); - } - StartCoroutine(WaitCoroutine(0.2f, delegate - { - if (IsDownloadTitle) - { - _specialTitle.UnloadBGM(); - _specialTitle.RemoveSpecialTitle(); - } - WebViewManager.getInstance().CacheClear(); - StartCoroutine(StartCleanCache()); - CardMasterLocalFileUtility.DeleteAllCardMasterLocalFile(); - RecoveryRecordManagerBase.DeleteRecoveryFile(); - LocalLog.ClearAllLog(); - NativePluginWrapper.ClearWWWCache(); - LocalLog.ClearTraceLog(); - TaskManager.GetInstance().ClearLastLogKey(); - NewReplayBattleMgr.DeleteReplayFiles(); - if (_normalTitle == null && IsDownloadTitle) - { - _normalTitle = InitializeLocalPrefabTitle("Title/NormalTitle/NormalTitle"); - } - LocalLog.AccumulateTraceLog("Clear Cache"); - })); - } - - private IEnumerator WaitCoroutine(float time, Action onFinish) - { - yield return new WaitForSeconds(time); - onFinish.Call(); - } - - public void DeleteUserData() - { - if (dia != null) - { - dia.CloseWithoutSelect(); - } - if (IsViewerIdDecided()) - { - DeleteUserDataTask task = new DeleteUserDataTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - DeleteUserDataCore(); - CreateDeleteUserDataDialog(); - })); - } - else - { - DeleteUserDataCore(); - CreateDeleteUserDataDialog(); - } - } - - private void DeleteUserDataCore() - { - Certification.InitializeFileds(); - Toolbox.SavedataManager.DeleteAll(); - LocalLog.ClearAllLog(); - RecoveryRecordManagerBase.DeleteRecoveryFile(); - GameObject gameObject = GameObject.Find("OmotePlugin"); - if (gameObject != null) - { - OmotePlugin component = gameObject.GetComponent(); - if (component != null) - { - component.Unregister(isLocalOnly: false); - OmotePlugin.LocalNotification.CancelAll(); - } - } - } - - private void CreateDeleteUserDataDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetTitleLabel(Data.SystemText.Get("Common_0021")); - dialogBase.SetText(Data.SystemText.Get("Title_0050")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueButton); - dialogBase.SetButtonText(Data.SystemText.Get("Common_0004")); - dialogBase.OnClose = delegate - { - SoftwareReset.exec(null, isFromUserDelete: true); - }; - } - - private bool IsViewerIdDecided() - { - return Certification.ViewerId != 0; - } - - private IEnumerator StartCleanCache() - { - yield return new WaitForSeconds(1f); - FontChanger.FontReset(); - UILabel[] array = UnityEngine.Object.FindObjectsOfType(typeof(UILabel)) as UILabel[]; - if (array.Length != 0) - { - UILabel[] array2 = array; - foreach (UILabel uILabel in array2) - { - if (uILabel != null) - { - uILabel.RefreshCustom(); - } - } - } - Toolbox.AssetManager.ClearAllAssetFile(); - Toolbox.AssetManager.ClearAssetCacheAssetBundle(); - while (!Caching.ready) - { - yield return null; - } - _gameSetup = new GameSetup(this); - if (!_isAutoCacheExecution) - { - SystemText systemText = Data.SystemText; - dia = UIManager.GetInstance().CreateDialogClose(); - dia.SetTitleLabel(systemText.Get("Title_0007")); - dia.SetText(systemText.Get("Title_0009")); - dia.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dia.SetPanelDepth(3000); - } - else - { - _isAutoCacheExecution = false; - UIManager.GetInstance().IsAutoCacheClearAfter = true; - OnClickStartButton(null); - } - UIManager.GetInstance().closeInSceneLoading(); - } - - private void ShowAccountConnectWindow() - { - SystemText systemText = Data.SystemText; - dia = UIManager.GetInstance().CreateDialogClose(); - dia.SetSize(DialogBase.Size.M); - dia.SetTitleLabel(systemText.Get("Account_0082")); - string text = systemText.Get("Account_0083"); - dia.SetText(text); - dia.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dia.SetButtonText(systemText.Get("Account_0084"), systemText.Get("Account_0085")); - EventDelegate method_btn = new EventDelegate(delegate - { - UIManager.GetInstance().AccountTransferHelper.CreateAccountTransferDialog(AccountBase.DisplayType.ACCOUNT_LINK, AccountBase.TransitionOriginalScreen.OTHER); - }); - EventDelegate method_btn2 = new EventDelegate(startGameSetup); - dia.SetButtonDelegate(method_btn, method_btn2); - } -} diff --git a/SVSim.BattleEngine/Engine/TopBar.cs b/SVSim.BattleEngine/Engine/TopBar.cs index f8d78f0f..943449f2 100644 --- a/SVSim.BattleEngine/Engine/TopBar.cs +++ b/SVSim.BattleEngine/Engine/TopBar.cs @@ -6,24 +6,6 @@ using Wizard.RoomMatch; public class TopBar : MonoBehaviour { - private const int TITLE_SIZE_MIN = 294; - - private const int TITLE_SIZE_MAX = 504; - - private const int TITLE_SIZE_MAX_WIDEMODE = 543; - - private const int TITLE_BORDER_ZENKAKU = 9; - - private const int TITLE_BORDER_HANKAKU = 16; - - private const int TITLE_TEXT_SIZE_ZENKAKU = 30; - - private const int TITLE_TEXT_SIZE_HANKAKU = 15; - - private const int TITLE_SIZE_LABEL_OFFSET = -30; - - [SerializeField] - private UIPanel _panel; [SerializeField] public GameObject TitleObject; @@ -34,51 +16,21 @@ public class TopBar : MonoBehaviour [SerializeField] public UIButton BuyCrystalButton; - [SerializeField] - public GameObject NameWindowBg; - [SerializeField] public UILabel NameLabel; - [SerializeField] - private UILabel BattlePointLabel; - - [SerializeField] - private UILabel BattlePointTitleLabel; - - [SerializeField] - public UITexture RankTexture; - - [SerializeField] - public UITexture EmblemTexture; - [SerializeField] public UIButton BackButton; - [SerializeField] - public UILabel BackButtonLabel; - [SerializeField] private UILabelGradientOverwriter _backLabelGradientOverwriter; - [SerializeField] - private UILabelEffectOverwriter _backLabelEffectOverwriter; - [SerializeField] private UILabel BackButtonTitleLabel; [SerializeField] private UISprite _backButtonTitleLabelBG; - [SerializeField] - public UILabel RupyLabel; - - [SerializeField] - public UILabel CrystalLabel; - - [SerializeField] - private Collider _titleSpriteCollider; - private Vector3 _firstPositionBack; private Vector3 _firstPositionTitle; @@ -87,40 +39,10 @@ public class TopBar : MonoBehaviour private bool _isWideMode; - public UILabel rupyLabel => RupyLabel; - - public UILabel crystalLabel => CrystalLabel; - - public static TopBar Create(NguiObjs prefab, GameObject obj, string titleMsg, bool MoneyDraw = true, bool isWideMode = false) - { - if (GameMgr.GetIns() == null) - { - return null; - } - NguiObjs nguiObjs = UnityEngine.Object.Instantiate(prefab); - TopBar component = nguiObjs.GetComponent(); - nguiObjs.transform.parent = obj.transform; - nguiObjs.transform.localPosition = new Vector3(0f, 0f, 0f); - nguiObjs.transform.localScale = new Vector3(1f, 1f, 1f); - component._isWideMode = isWideMode; - nguiObjs.objs[1].SetActive(titleMsg != null); - component.SetTitleLabel(titleMsg); - component.rupyLabel.text = PlayerStaticData.UserRupyCount.ToString(); - component.crystalLabel.text = PlayerStaticData.UserCrystalCount.ToString(); - component.BackButtonLabel.text = Data.SystemText.Get("Common_0137"); - component._titleSpriteCollider.enabled = false; - component.BackButton.onClick.Clear(); - UIManager.SetObjectToGrey(component.BuyCrystalButton.gameObject, b: true); - if (!MoneyDraw) - { - nguiObjs.objs[0].gameObject.SetActive(value: false); - } - return component; - } - public void SetBackButtonEnable(bool enable) { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = enable; + // Pre-Phase-5b: also flipped GameMgr's InputMgr back-key flag. Headless has no + // InputMgr; the button toggle below is the only observable effect. BackButton.enabled = enable; UIManager.SetObjectToGrey(BackButton.gameObject, !enable); } @@ -140,7 +62,7 @@ public class TopBar : MonoBehaviour { if (backScene == UIManager.ViewScene.None) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); + uibase.PushTurnButton(); } else @@ -152,7 +74,7 @@ public class TopBar : MonoBehaviour } else { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); + UIManager.GetInstance().ChangeViewScene(uibase.getBackScene(), UIManager.GetInstance().TopBarBackParameterDict[currentScene], UIManager.GetInstance().GetLastSceneChangeParam(uibase.getBackScene())); } } @@ -173,61 +95,6 @@ public class TopBar : MonoBehaviour _firstPositionName = NameWindowObject.transform.localPosition; } - private void OnDestroy() - { - UIManager.GetInstance().m_CrystalLabelList.Remove(CrystalLabel); - UIManager.GetInstance().m_RupyLabelList.Remove(RupyLabel); - } - - public void SetPanelDepth(int depth) - { - _panel.depth = depth; - } - - public void SetSortingOrder(int sortingOrder) - { - _panel.sortingOrder = sortingOrder; - } - - public void SetBackButtonActive(bool inActive) - { - BackButton.gameObject.SetActive(inActive); - TitleObject.SetActive(inActive); - } - - public void ChangeNameWindowMode() - { - NameWindowObject.SetActive(value: true); - BackButton.gameObject.SetActive(value: false); - TitleObject.SetActive(value: false); - } - - public void SetBattlePoint(int inBattlePoint, bool inIsMaster) - { - BattlePointLabel.text = inBattlePoint.ToString(); - if (inIsMaster) - { - BattlePointTitleLabel.text = Data.SystemText.Get("Common_0151"); - } - else - { - BattlePointTitleLabel.text = Data.SystemText.Get("Common_0150"); - } - } - - public void SetActiveBattlePoint(bool isActive) - { - BattlePointLabel.gameObject.SetActive(isActive); - BattlePointTitleLabel.gameObject.SetActive(isActive); - } - - public void RestorePosition() - { - BackButton.transform.localPosition = _firstPositionBack; - TitleObject.transform.localPosition = _firstPositionTitle; - NameWindowObject.transform.localPosition = _firstPositionName; - } - public void SetTitleLabel(string text, bool isWideMode) { _isWideMode = isWideMode; @@ -275,38 +142,10 @@ public class TopBar : MonoBehaviour OverwriteBackLabelGradient(gradientTopColorId, gradientBottomColorId); } - public void CancelOverwriteBackLabelColors() - { - CancelOverwriteBackLabelGradient(); - } - private void OverwriteBackLabelGradient(eColorCodeId topColorId, eColorCodeId bottomColorId) { _backLabelGradientOverwriter.enabled = true; _backLabelGradientOverwriter.GradientTopColorId = topColorId; _backLabelGradientOverwriter.GradientBottomColorId = bottomColorId; } - - private void CancelOverwriteBackLabelGradient() - { - _backLabelGradientOverwriter.enabled = false; - } - - public void OverwriteBackLabelEffect(UILabel.Effect style, eColorCodeId colorId, Vector2 distance) - { - _backLabelEffectOverwriter.enabled = true; - _backLabelEffectOverwriter.EffectStyle = style; - _backLabelEffectOverwriter.EffectColorId = colorId; - _backLabelEffectOverwriter.EffectDistance = distance; - } - - public void CancelOverwriteBackLabelEffect() - { - _backLabelEffectOverwriter.enabled = false; - } - - public void SetTitleSpriteColliderEnabled(bool enabled) - { - _titleSpriteCollider.enabled = enabled; - } } diff --git a/SVSim.BattleEngine/Engine/TouchControl.cs b/SVSim.BattleEngine/Engine/TouchControl.cs index 9dbe0fe2..dd3c392d 100644 --- a/SVSim.BattleEngine/Engine/TouchControl.cs +++ b/SVSim.BattleEngine/Engine/TouchControl.cs @@ -36,40 +36,12 @@ public class TouchControl private IBattlePlayerView _battleEnemyView; - public PlayerEmotion _playerEmotion; - - private Vector3 _moveWorld; - - private Vector3 _moveArrowWorld; - public BattleCardBase _hitCard; - private GameObject _arrowObject; - private DetailPanelTouchProcessor _detailPanelTouchProcessor; private EvolutionTouchProcessor _evolutionTouchProcessor; - private const string TapEffectArea1Tag = "TapEffectArea1"; - - private const string TapEffectArea2Tag = "TapEffectArea2"; - - private const string EpPanelTag = "EpPanel"; - - private const string PlayerChoiceBraveButtonTag = "PlayerChoiceBraveButton"; - - private const string EnemyChoiceBraveButtonTag = "EnemyChoiceBraveButton"; - - public const string BattleUITag = "BattleUI"; - - private const string ClassButtonTag = "ClassBtn"; - - private const string FieldGimic1Tag = "FieldGimic1"; - - private const string FieldGimic2Tag = "FieldGimic2"; - - private const string FieldGimic3Tag = "FieldGimic3"; - private BattleCardBase _detailCardDisplay; private BattleCardBase _detailCardHover; @@ -92,10 +64,6 @@ public class TouchControl public static BattleCardBase KeepAlertCard; - private const float HOVER_TIME = 0.2f; - - private const float HOVER_HAND_ANGLE_MAX = 70f; - protected BattleCardBase _pressedCard; public bool IsProcessorStart { get; private set; } @@ -141,7 +109,7 @@ public class TouchControl _predictionVfxMgr = new VfxMgr(); _prediction = _battleMgr.Prediction; _classEffectVfxMgr = new VfxMgr(); - _inputMgr = GameMgr.GetIns().GetInputMgr(); + _inputMgr = _battleMgr.GameMgr.GetInputMgr(); _battlePlayerView = battleMgr.BattlePlayer.PlayerBattleView; _battleEnemyView = battleMgr.BattleEnemy.BattleEnemyView; } @@ -178,7 +146,7 @@ public class TouchControl { return NullVfx.GetInstance(); } - if (BattleManagerBase.GetIns().IsRecovery) + if (_battleMgr.IsRecovery) { return NullVfx.GetInstance(); } @@ -320,7 +288,7 @@ public class TouchControl flag = TryZoomHand(hits, array); } } - else if (GameMgr.GetIns().IsAdmin && _inputMgr.IsDown()) + else if (_battleMgr.GameMgr.IsAdmin && _inputMgr.IsDown()) { if (_battlePlayerView.IsDetailOn() && array == null) { @@ -460,7 +428,7 @@ public class TouchControl if (BattleManagerBase.UseCustomMouse && !array.Any((RaycastHit entry) => entry.collider.CompareTag("BattleUI"))) { _battleMgr.VfxMgr.RegisterImmediateVfx(_battlePlayerView.HandUnfocus()); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_RIGHT); + } return parallelVfxPlayer; } @@ -471,7 +439,7 @@ public class TouchControl { _battleMgr.VfxMgr.RegisterImmediateVfx(_battlePlayerView.HandUnfocus()); _battleMgr.VfxMgr.RegisterImmediateVfx(_battleEnemyView.HandUnfocus()); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_RIGHT); + } if (flag2) { @@ -486,11 +454,11 @@ public class TouchControl { if (CheckChoiceBraveButton(hits, "PlayerChoiceBraveButton")) { - BattleCardBase battleCardBase2 = BattleManagerBase.GetIns().BattlePlayer.Class; - if (!GameMgr.GetIns().IsWatchBattle && BattlePlayer.CanChoiceBrave) + BattleCardBase battleCardBase2 = _battleMgr.BattlePlayer.Class; + if (!_battleMgr.GameMgr.IsWatchBattle && BattlePlayer.CanChoiceBrave) { ResetDetail(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HBP_BUTTON); + _battlePlayerView.UpdateChoiceBraveActivatingEffect(isActivating: true); List choiceSkills = battleCardBase2.Skills.Where((SkillBase s) => s is Skill_choice && s.OnWhenChoiceBrave != 0).ToList(); parallelVfxPlayer.Register(RegisterTouchProcessor(new ChoiceBraveTouchProcessor(_battleMgr, battleCardBase2, choiceSkills))); @@ -503,7 +471,7 @@ public class TouchControl } if (CheckChoiceBraveButton(hits, "EnemyChoiceBraveButton") && flag2) { - BattleCardBase card = BattleManagerBase.GetIns().BattleEnemy.Class; + BattleCardBase card = _battleMgr.BattleEnemy.Class; StartOpenHandDetail(card, right: false, isChoiceBraveButton: true); } } @@ -529,7 +497,7 @@ public class TouchControl } } } - else if ((_hitCard.IsPlayer || GameMgr.GetIns().IsWatchBattle) && _hitCard.IsInHand && (GameMgr.GetIns().IsAdmin || _hitCard.IsPlayer)) + else if ((_hitCard.IsPlayer || _battleMgr.GameMgr.IsWatchBattle) && _hitCard.IsInHand && (_battleMgr.GameMgr.IsAdmin || _hitCard.IsPlayer)) { SelectCardProcessor touchProcessor4 = new SelectCardProcessor(_battleMgr, _hitCard, _inputMgr, _pressedCard != null); parallelVfxPlayer.Register(RegisterTouchProcessor(touchProcessor4)); @@ -608,7 +576,7 @@ public class TouchControl hits = Physics.RaycastAll(ray.origin, ray.direction, float.PositiveInfinity); } bool flag5 = true; - if (BattleManagerBase.GetIns().IsPuzzleMgr) + if (_battleMgr.IsPuzzleMgr) { _ = new RaycastHit[0]; Ray ray3 = UIManager.GetInstance().getCamera().ScreenPointToRay(mousePosition); @@ -646,15 +614,15 @@ public class TouchControl { _battleMgr.VfxMgr.RegisterImmediateVfx(_battlePlayerView.HandFocus()); _battleMgr.VfxMgr.RegisterImmediateVfx(_battleEnemyView.HandUnfocus()); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_CENTER); + return true; } } - else if (GameMgr.GetIns().IsAdminWatch && !battleCardBase.IsPlayer && BattleEnemy.HandCardList.Count > 0) + else if (_battleMgr.GameMgr.IsAdminWatch && !battleCardBase.IsPlayer && BattleEnemy.HandCardList.Count > 0) { _battleMgr.VfxMgr.RegisterImmediateVfx(_battlePlayerView.HandUnfocus()); _battleMgr.VfxMgr.RegisterImmediateVfx(_battleEnemyView.HandFocus()); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_CENTER); + return true; } } @@ -721,7 +689,7 @@ public class TouchControl public BattleCardBase TouchCard(RaycastHit[] hits) { BattleCardBase result = null; - if (!GameMgr.GetIns().IsWatchBattle && (!_battlePlayerView.IsTouchable() || _battlePlayerView.IsSelecting)) + if (!_battleMgr.GameMgr.IsWatchBattle && (!_battlePlayerView.IsTouchable() || _battlePlayerView.IsSelecting)) { return result; } @@ -837,7 +805,6 @@ public class TouchControl { _pressedCard = null; _battlePlayerView.CancelCardDrag(card); - ImmediateVfxMgr.GetInstance().Register(card.BattleCardView.ShowHandCardInfo(isRecovery: false, modifyParameterLabel: false)); _prediction.Clear(); } @@ -907,7 +874,7 @@ public class TouchControl _battleMgr.VfxMgr.RegisterImmediateVfx(ParallelVfxPlayer.Create(InstantVfx.Create(delegate { _battlePlayerView.ShowDetailPanel(_battleMgr, _battleMgr.OperateMgr, targetCard, DetailPanelControl.ShowRequest.EVOLUTION_SELECT); - }), new StartEvolutionTargetFocusVfx(targetCard.BattleCardView.GameObject), new EvolutionHideMessageVfx(_battleMgr, _battleMgr.BattleResourceMgr))); + }), NullVfx.GetInstance(), NullVfx.GetInstance())); EmitHandUtility.SendSlideObject(_battleMgr, NetworkBattleSender.SLIDE_OBJECT_TYPE.Evolve, targetCard); } return NullVfx.GetInstance(); @@ -918,7 +885,7 @@ public class TouchControl if (targetCard != null) { this.OnEvolveUnfocus.Call(); - parallelVfxPlayer.Register(new StopEvolutionTargetFocasVfx(targetCard.BattleCardView.GameObject)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); parallelVfxPlayer.Register(InstantVfx.Create(delegate { HideDetailPanel(); @@ -939,7 +906,7 @@ public class TouchControl _backGround.SetShaderGlobalColorBG.ChangeGlobalShaderColorFadeIn(); } } - }), new StopEvolutionChoiceEffectVfx(_battlePlayerView.EpIcon), PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.CONFIRM_EVOLVE) ? _battleMgr.DetailMgr.DetailPanelControl.ShowEvolutionButton(targetCard) : NullVfx.GetInstance())); + }), NullVfx.GetInstance(), PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.CONFIRM_EVOLVE) ? _battleMgr.DetailMgr.DetailPanelControl.ShowEvolutionButton(targetCard) : NullVfx.GetInstance())); return NullVfx.GetInstance(); }; EvolutionTouchProcessor evolutionTouchProcessor = _evolutionTouchProcessor; @@ -947,7 +914,7 @@ public class TouchControl _evolutionTouchProcessor.OnNotSelectTarget += delegate { _battlePlayerView.DragArrowStop(_battleMgr); - _battleMgr.VfxMgr.RegisterImmediateVfx(new StopEvolutionChoiceEffectVfx(_battlePlayerView.EpIcon)); + _battleMgr.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); EmitHandUtility.SendSlideObject(_battleMgr, NetworkBattleSender.SLIDE_OBJECT_TYPE.Cancel); }; Exit(); @@ -1102,27 +1069,6 @@ public class TouchControl return new ClassBuffTouchProcessor(battleMgr, touchClass, inputMgr); } - public static GameObject FindTouchPositionObject(IEnumerable gameObjects, Camera camera) - { - if (gameObjects == null) - { - return null; - } - Ray ray = camera.ScreenPointToRay(Input.mousePosition); - RaycastHit[] array = Physics.RaycastAll(ray.origin, ray.direction, float.PositiveInfinity); - foreach (GameObject gameObject in gameObjects) - { - for (int i = 0; i < array.Length; i++) - { - if (array[i].collider.gameObject == gameObject) - { - return gameObject; - } - } - } - return null; - } - public static bool CanInPlayCardBeDragged(BattleCardBase attackCard, BattlePlayerBase battlePlayer) { if (battlePlayer.IsSelfTurn && attackCard.IsPlayer && attackCard.IsUnit && attackCard.Attackable) @@ -1163,10 +1109,7 @@ public class TouchControl private void checkHoverCard(RaycastHit[] hits, bool isZoomHand) { - if (OptionSettingWindow.ShortcutDetailPanel != OptionSettingWindow.ShortcutDetail.Auto) - { - return; - } + // OptionSettingWindow removed (DEAD-COLD engine cleanup Task 13) — Auto is the headless default; guard removed BattleCardBase battleCardBase = TouchCard(hits); BattleCardBase battleCardBase2 = null; if (KeepAlertCard != null && KeepAlertCard == battleCardBase && IsShowingAlert()) @@ -1182,15 +1125,15 @@ public class TouchControl flag = battleCardBase.IsClass; flag3 = battleCardBase.IsHoverActionCard(); } - else if (CheckChoiceBraveButton(hits, "PlayerChoiceBraveButton") && (GameMgr.GetIns().IsWatchBattle || !BattlePlayer.CanChoiceBrave)) + else if (CheckChoiceBraveButton(hits, "PlayerChoiceBraveButton") && (_battleMgr.GameMgr.IsWatchBattle || !BattlePlayer.CanChoiceBrave)) { flag2 = true; - battleCardBase = BattleManagerBase.GetIns().BattlePlayer.Class; + battleCardBase = _battleMgr.BattlePlayer.Class; } else if (CheckChoiceBraveButton(hits, "EnemyChoiceBraveButton")) { flag2 = true; - battleCardBase = BattleManagerBase.GetIns().BattleEnemy.Class; + battleCardBase = _battleMgr.BattleEnemy.Class; } else { @@ -1274,49 +1217,18 @@ public class TouchControl } } - private bool UsePlayShortcut() - { - return OptionSettingWindow.ShortcutPlay switch - { - OptionSettingWindow.Shortcut.RightClick => Input.GetMouseButtonDown(1), - OptionSettingWindow.Shortcut.MiddleClick => Input.GetMouseButtonDown(2), - _ => false, - }; - } + // OptionSettingWindow removed (DEAD-COLD engine cleanup Task 13) — shortcut methods return false (headless default) + private bool UsePlayShortcut() => false; - private bool UseEvolutionShortcut() - { - return OptionSettingWindow.ShortcutEvolution switch - { - OptionSettingWindow.Shortcut.RightClick => Input.GetMouseButtonDown(1), - OptionSettingWindow.Shortcut.MiddleClick => Input.GetMouseButtonDown(2), - OptionSettingWindow.Shortcut.DoubleClick => _inputMgr.IsDoubleClick(), - _ => false, - }; - } + private bool UseEvolutionShortcut() => false; - private bool UseDetailShortcut() - { - return OptionSettingWindow.ShortcutDetailPanel switch - { - OptionSettingWindow.ShortcutDetail.RightClick => Input.GetMouseButtonDown(1), - OptionSettingWindow.ShortcutDetail.MiddleClick => Input.GetMouseButtonDown(2), - OptionSettingWindow.ShortcutDetail.DoubleClick => _inputMgr.IsDoubleClick(), - OptionSettingWindow.ShortcutDetail.LongPress => _inputMgr.IsLongPress(), - _ => false, - }; - } + private bool UseDetailShortcut() => false; public Prediction GetPrediction() { return _prediction; } - public void SelectCancelActCard() - { - _battleMgr.OperateMgr.SelectCancel(_hitCard); - } - protected virtual void StopDraggingArrow() { _battlePlayerView.DragArrowStop(_battleMgr); diff --git a/SVSim.BattleEngine/Engine/TurnAndIntValue.cs b/SVSim.BattleEngine/Engine/TurnAndIntValue.cs index f8d4082f..2b005090 100644 --- a/SVSim.BattleEngine/Engine/TurnAndIntValue.cs +++ b/SVSim.BattleEngine/Engine/TurnAndIntValue.cs @@ -1,6 +1,5 @@ public class TurnAndIntValue { - public const int NONE_TURN = -1; public int Value { get; private set; } diff --git a/SVSim.BattleEngine/Engine/TurnEndButtonUI.cs b/SVSim.BattleEngine/Engine/TurnEndButtonUI.cs index 682363f3..d262e2a3 100644 --- a/SVSim.BattleEngine/Engine/TurnEndButtonUI.cs +++ b/SVSim.BattleEngine/Engine/TurnEndButtonUI.cs @@ -1,6 +1,12 @@ using UnityEngine; -using Wizard; +// Post-Phase-5b (2026-07-03) UI stub. The turn-end button is a UIBase with +// SetActive/sprite/iTween logic driven by BattlePlayer/NetworkBattleManagerBase +// UI paths (ShowBtn/HideBtn/ChangeButtonView/HideAnimation/EnableButton/etc.). +// Nothing headless observes the button state; every method body has been reduced +// to a no-op while the surface stays intact so the ~15 external call sites +// (BattlePlayer, BattlePlayerBase, NetworkBattleManagerBase, PuzzleBattleManager, +// NetworkBattleReceiver, RecoveryManagerBase) still resolve. public class TurnEndButtonUI : UIBase, ITurnEndButtonUI { public enum ViewType @@ -10,20 +16,6 @@ public class TurnEndButtonUI : UIBase, ITurnEndButtonUI Replay } - private const int TITLELABEL_FONTSIZE_NORMAL = 28; - - private const int TITLELABEL_FONTSIZE_WATCH = 25; - - private const int HIDE_X_VALUE = 200; - - private const string SPRITE_NAME_BLUE = "battle_btn_turnend_off"; - - private const string SPRITE_NAME_BLUE_WATCH = "battle_btn_turnend_owner"; - - private const string SPRITE_NAME_RED = "battle_btn_turnend_red"; - - private const string SPRITE_NAME_RED_WATCH = "battle_btn_turnend_guest"; - [SerializeField] private GameObject BtnMain; @@ -36,206 +28,65 @@ public class TurnEndButtonUI : UIBase, ITurnEndButtonUI [SerializeField] private UIButton TurnEndButtonButton; - private Vector3 _defPos; - - private bool _isSettingDefPost; - public bool _isButtonForcedOff { get; set; } - public bool GetEnableLabel => TitleLabel.gameObject.activeSelf; + public bool GetEnableLabel => TitleLabel != null && TitleLabel.gameObject.activeSelf; public bool _isChangeViewLock { get; set; } public GameObject GameObject => base.gameObject; - private ViewType ActiveView - { - get - { - if (GameMgr.GetIns().IsReplayBattle) - { - return ViewType.Replay; - } - if (GameMgr.GetIns().IsWatchBattle) - { - return ViewType.Watch; - } - return ViewType.Normal; - } - } - public void StartTurnEndCountdown() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_ACTUVATE_TURNEND_BUTTON); - base.gameObject.SetActive(value: true); - ShowBtn(); } public void ShowBtn(bool canPlayerEndTurnImmediately = false) { - BattleManagerBase ins = BattleManagerBase.GetIns(); - BattlePlayer battlePlayer = ins.BattlePlayer; - BattlePlayerBase battlePlayer2 = ins.GetBattlePlayer(isPlayer: false); - if (!battlePlayer.IsTurnStartEffectNotFinished && !battlePlayer.Class.IsDead && !battlePlayer2.Class.IsDead && !ins.IsPlayerRetire) - { - if (_isButtonForcedOff) - { - DisableButton(); - } - else - { - EnableButton(); - } - bool isSelfTurn = battlePlayer.IsSelfTurn; - if (isSelfTurn) - { - BtnMain.SetActive(value: true); - } - if (ActiveView == ViewType.Watch) - { - TitleLabel.gameObject.SetActive(value: true); - } - else - { - TitleLabel.gameObject.SetActive(isSelfTurn); - } - ChangeButtonView(isSelfTurn); - if (canPlayerEndTurnImmediately) - { - EnableEndTurnPulsateEffect(); - } - else - { - DisableEndTurnPulsateEffect(); - } - } } public void HideBtn() { - if (ActiveView == ViewType.Normal) - { - TitleLabel.gameObject.SetActive(value: false); - } - DisableButton(); - DisableEndTurnPulsateEffect(); } public void HideAnimation() { - iTween.MoveTo(BtnMain, iTween.Hash("position", BtnMain.transform.localPosition + Vector3.right * 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); } public void ChangeButtonView(bool isMyTurn) { - if (!_isChangeViewLock) - { - ChangeSpriteOnTurn(isMyTurn); - ChangeTitleLabelOnTurn(isMyTurn); - } - } - - private void ChangeSpriteOnTurn(bool isMyTurn) - { - string text = ""; - text = ((ActiveView != ViewType.Normal) ? (isMyTurn ? "battle_btn_turnend_owner" : "battle_btn_turnend_guest") : (isMyTurn ? "battle_btn_turnend_off" : "battle_btn_turnend_red")); - TurnEndButtonImg.spriteName = text; - TurnEndButtonButton.normalSprite = text; - } - - private void ChangeTitleLabelOnTurn(bool isMyTurn) - { - string text = string.Empty; - int num = 28; - if (ActiveView == ViewType.Normal && isMyTurn) - { - text = "Battle_0109"; - num = 28; - } - else if (ActiveView == ViewType.Normal && !isMyTurn) - { - text = string.Empty; - num = 28; - } - else if (ActiveView == ViewType.Replay) - { - TitleLabel.text = string.Empty; - num = 28; - } - else - { - text = (isMyTurn ? "Battle_0468" : "Battle_0469"); - num = 25; - } - if (!string.IsNullOrEmpty(text)) - { - TitleLabel.text = Data.SystemText.Get(text); - TitleLabel.fontSize = num; - } - else - { - TitleLabel.text = string.Empty; - TitleLabel.fontSize = 28; - } } public void EnableButton() { - if (BattleManagerBase.GetIns().BattlePlayer.IsSelfTurn && !_isButtonForcedOff && !_isChangeViewLock) - { - TurnEndButtonButton.isEnabled = true; - } } public void DisableButton() { - TurnEndButtonButton.isEnabled = false; } public void EnableEndTurnPulsateEffect() { - if (TurnEndButtonButton.isEnabled && GetEnableLabel && base.gameObject.activeSelf && ActiveView != ViewType.Watch) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FRAME_BTN_1, GetBtnPosition()); - } } public void DisableEndTurnPulsateEffect() { - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_FRAME_BTN_1); } public Vector3 GetBtnPosition() { - return BtnMain.transform.position; + return BtnMain != null ? BtnMain.transform.position : Vector3.zero; } public void SettingTimer(float second, bool isRed) { - if (!isRed) - { - if (!_isSettingDefPost) - { - _defPos = BtnMain.transform.localPosition; - _isSettingDefPost = true; - } - BtnMain.transform.localPosition = _defPos; - } - else - { - float num = 20f - second; - BtnMain.transform.localPosition = new Vector3(num * Random.value - num * 0.5f, num * Random.value - num * 0.5f, 0f) + _defPos; - } } public void Recovery() { - BtnMain.SetActive(value: false); - BtnMain.SetActive(value: true); } public GameObject GetTurnEndButton() { - return TurnEndButtonButton.gameObject; + return TurnEndButtonButton != null ? TurnEndButtonButton.gameObject : null; } } diff --git a/SVSim.BattleEngine/Engine/TurnEndTimeController.cs b/SVSim.BattleEngine/Engine/TurnEndTimeController.cs index 10e23ea4..e00d1dba 100644 --- a/SVSim.BattleEngine/Engine/TurnEndTimeController.cs +++ b/SVSim.BattleEngine/Engine/TurnEndTimeController.cs @@ -1,320 +1,315 @@ -using System; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -public class TurnEndTimeController -{ - private enum TIMEOUT_TURNEND_SCENE - { - NONE = 0, - TIMEOUT_START = 10, - TIMEOUT_START_WAIT = 20, - TURNEND_OPERATION = 30, - TURNEND_OPERATION_WAIT = 40, - EFFECT_STOP = 50, - EFFECT_STOP_WAIT = 60, - NOT_TOUCH_RELEASE = 70 - } - - public const float ALERT_TIME = 20f; - - private const float ALERT_SCALE_RATE = 1.3333334f; - - private NetworkBattleManagerBase _networkBattleManager; - - private BattlePlayer _battlePlayer; - - private ITurnEndButtonUI _turnEndUI; - - private long _startTicks; - - private bool _isAlertEffect; - - private float _extendTime; - - private GameObject _alertEffect; - - private bool _isMovingTurnEndTimer; - - private TIMEOUT_TURNEND_SCENE _timeoutTurnEndScene; - - private CanNotTouchCardVfx _canNotTouchVfx; - - private string _opponentTurnTurnEndLogMessage = ""; - - private bool _isOpponentTurnTimerUpdateLog; - - private int _logAddNum; - - private bool _isTurnStartTimeCheckLog; - - protected virtual bool IsTurnTimeDecrement { get; set; } - - public bool IsNowTurnTimeDecrement { get; private set; } - - public bool IsNextTurnTimeDecrement { get; private set; } - - public TurnEndTimeController(BattleManagerBase battleMgr, BattlePlayer battlePlayer, ITurnEndButtonUI turnEnd) - { - LocalLog.AccumulateLastTraceLog("TurnEndTimeController"); - _networkBattleManager = battleMgr as NetworkBattleManagerBase; - _battlePlayer = battlePlayer; - _networkBattleManager.OperateMgr.OnTurnEnd_ButtonPush += delegate - { - IsTurnTimeDecrement = false; - SetDecrementFlag(isDecrement: false); - LocalLog.AccumulateLastTraceLog("OnTurnEnd_ButtonPush"); - }; - _turnEndUI = turnEnd; - SetDecrementFlag(isDecrement: true); - } - - public void StartCountDown(string log) - { - LocalLog.AccumulateLastTraceLog("StartCountDown " + log); - DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); - _startTicks = absoluteTime.Ticks; - _extendTime = 0f; - log = log + absoluteTime.Hour + ":" + absoluteTime.Minute + ":" + absoluteTime.Second + ":" + absoluteTime.Millisecond.ToString("000") + ":"; - AddTurnEndTimerLog(" StartCountDown " + log); - _isTurnStartTimeCheckLog = false; - _turnEndUI.SettingTimer(GetMaxSecond(), isRed: false); - EndCountDown("startAfter"); - _isMovingTurnEndTimer = true; - } - - public void EndCountDown(string log) - { - LocalLog.AccumulateLastTraceLog("EndCountDown " + log); - AddTurnEndTimerLog(" EndCountDown " + log); - _isMovingTurnEndTimer = false; - if (_isAlertEffect) - { - _alertEffect = null; - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_TURN_5); - _isAlertEffect = false; - } - if (_turnEndUI as UnityEngine.Object != null) - { - _turnEndUI.SettingTimer(0f, isRed: false); - } - } - - public void AddTurnEndTimerLog(string text) - { - _logAddNum++; - if (_logAddNum <= 15) - { - DateTime dateTime = DateTime.Now.ToUniversalTime(); - string text2 = dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000"); - _opponentTurnTurnEndLogMessage = _opponentTurnTurnEndLogMessage + text2 + text + " \n"; - } - } - - public void BattleEndToTraceLog() - { - if (_isOpponentTurnTimerUpdateLog) - { - LocalLog.AccumulateTraceLog("665987UpdateTimerCountDownBatlteEnd " + _opponentTurnTurnEndLogMessage); - } - } - - public bool IsCountdownRunning() - { - return _isMovingTurnEndTimer; - } - - public void SetDecrementFlag(bool isDecrement) - { - IsNextTurnTimeDecrement = isDecrement; - LocalLog.AccumulateLastTraceLog("SetDecrementFlag " + isDecrement); - } - - public void SetExtendTime(float leftTime) - { - _extendTime = leftTime; - } - - public void UpdateTimerCountDown() - { - if (!_isMovingTurnEndTimer || _turnEndUI == null || !_turnEndUI.GameObject.activeSelf || _timeoutTurnEndScene >= TIMEOUT_TURNEND_SCENE.TIMEOUT_START) - { - return; - } - if (!GameMgr.GetIns().IsWatchBattle && (_battlePlayer.IsTurnStartEffectNotFinished || !_battlePlayer.IsSelfTurn)) - { - if (!_isOpponentTurnTimerUpdateLog) - { - LocalLog.AccumulateTraceLog("665987ErrorUpdateTimerCountDown "); - _isOpponentTurnTimerUpdateLog = true; - } - return; - } - DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); - long ticks = absoluteTime.Ticks - _startTicks; - TimeSpan timeSpan = new TimeSpan(ticks); - float num = GetMaxSecond() - (float)timeSpan.TotalMilliseconds / 1000f + _extendTime; - if (!_isTurnStartTimeCheckLog) - { - AddTurnEndTimerLog(" UpdateTimerCountDown differenceSecond " + num + " IsTurnTimeDecrement" + IsTurnTimeDecrement + "_startTicks" + _startTicks + "_nowTicks" + absoluteTime.Ticks + "_extendTime" + _extendTime); - _isTurnStartTimeCheckLog = true; - } - if (num <= 0f) - { - if (CompulsionTurnEnd()) - { - return; - } - } - else if (num < 20f) - { - UpdateTimerPosition(num, isShowingAlert: true); - if (!_isAlertEffect) - { - _isAlertEffect = true; - EmitHandUtility.SendTurnEndReady(_networkBattleManager, IsTurnTimeDecrement); - if (!_networkBattleManager.IsRecovery) - { - _alertEffect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_5, _turnEndUI.GetBtnPosition()) - .GetGameObjIns(); - _alertEffect.transform.localScale = ((!GameMgr.GetIns().IsWatchBattle) ? (Vector3.one * 20f) : (Vector3.one * 19f)); - } - } - else if (!_networkBattleManager.IsRecovery) - { - if (_alertEffect == null) - { - _alertEffect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_5, _turnEndUI.GetBtnPosition()) - .GetGameObjIns(); - } - else - { - float x = _alertEffect.transform.localScale.x; - x += (GetEffectScaleByTime(num) - x) * 0.5f; - _alertEffect.transform.localScale = Vector3.one * x; - } - } - } - else - { - UpdateTimerPosition(num, isShowingAlert: false); - } - if (_battlePlayer.IsSelfTurn && IsNextTurnTimeDecrement && (Input.GetMouseButton(0) || Input.GetMouseButton(1) || Input.GetMouseButton(2) || Input.touchCount >= 1)) - { - LocalLog.AccumulateLastTraceLog("IsNextTurnTimeDecrement Off"); - SetDecrementFlag(isDecrement: false); - } - } - - protected virtual bool CompulsionTurnEnd() - { - if (_timeoutTurnEndScene >= TIMEOUT_TURNEND_SCENE.TIMEOUT_START) - { - return false; - } - if (_networkBattleManager.TouchControl._touchProcessor != null && _networkBattleManager.TouchControl.IsProcessorStart && _networkBattleManager.TouchControl.IsProcessorUpdate && _networkBattleManager.TouchControl.IsProcessorEnd && !_networkBattleManager.VfxMgr.IsEnd) - { - _networkBattleManager.TouchControl.IsForceEnd = true; - return false; - } - _battlePlayer.IsTimeOverTurnEndProcessing = true; - if (_networkBattleManager.JudgeCurrentFinishStatus() == NetworkBattleReceiver.RESULT_CODE.NotFinish) - { - VfxBase vfx = NullVfx.GetInstance(); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_6, _turnEndUI.GetBtnPosition()); - if (!(_networkBattleManager.OperateMgr is RecoveryOperateMgr)) - { - vfx = _networkBattleManager.OperateMgr.PlayerTurnEnd(isAuto: true); - } - _networkBattleManager.VfxMgr.RegisterSequentialVfx(vfx); - _networkBattleManager.TouchControl.IsForceEnd = false; - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TIMEOUT_START; - EndCountDown("TimeOut"); - return true; - } - return false; - } - - protected virtual void UpdateTimerPosition(float timeDifference, bool isShowingAlert) - { - _turnEndUI.SettingTimer(timeDifference, isShowingAlert); - } - - public void UpdateTimeoutTurnEnd() - { - switch (_timeoutTurnEndScene) - { - case TIMEOUT_TURNEND_SCENE.TIMEOUT_START: - _canNotTouchVfx = new CanNotTouchCardVfx(); - _networkBattleManager.VfxMgr.RegisterImmediateVfx(_canNotTouchVfx); - IsTurnTimeDecrement = IsNextTurnTimeDecrement; - AddTurnEndTimerLog("ExecTurnEnd IsTurnTimeDecrement" + IsTurnTimeDecrement); - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TIMEOUT_START_WAIT; - _turnEndUI.ChangeButtonView(isMyTurn: false); - _turnEndUI.HideBtn(); - _turnEndUI._isChangeViewLock = true; - break; - case TIMEOUT_TURNEND_SCENE.TIMEOUT_START_WAIT: - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION; - break; - case TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION: - if ((!_networkBattleManager.IsRecovery && !_networkBattleManager.IsCardPlayToTurnEndTimeoutStop && !_battlePlayer.PlayerBattleView.IsSelecting) || _networkBattleManager.VfxMgr.IsEnd) - { - _networkBattleManager.VfxMgr.RegisterSequentialVfx(_networkBattleManager.OperateMgr.TurnEndOperation(isPlayer: true)); - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION_WAIT; - _turnEndUI._isChangeViewLock = false; - } - break; - case TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION_WAIT: - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.EFFECT_STOP; - break; - case TIMEOUT_TURNEND_SCENE.EFFECT_STOP: - if (_networkBattleManager.VfxMgr.IsEnd) - { - _battlePlayer.PlayerBattleView.ForceStopShowSelect(); - EffectMgr effectMgr = GameMgr.GetIns().GetEffectMgr(); - effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_SET_1); - effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_ACCELERATE_1); - effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_CRYSTALLIZE_1); - effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_SET_2); - effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_SET_3); - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.EFFECT_STOP_WAIT; - } - break; - case TIMEOUT_TURNEND_SCENE.EFFECT_STOP_WAIT: - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.NOT_TOUCH_RELEASE; - break; - case TIMEOUT_TURNEND_SCENE.NOT_TOUCH_RELEASE: - { - IPlayerView playerBattleView = _battlePlayer.PlayerBattleView; - _canNotTouchVfx.End(); - playerBattleView.AllClear(popUpClose: false, isRemoveSideLog: false); - playerBattleView.HandView.FocusRearrangeHandHand(); - _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.NONE; - break; - } - } - } - - public float GetMaxSecond() - { - float result = 90f; - IsNowTurnTimeDecrement = false; - if (IsTurnTimeDecrement) - { - result = 20f; - IsNowTurnTimeDecrement = true; - } - return result; - } - - private float GetEffectScaleByTime(float time) - { - float num = 2f; - float num2 = ((!(time > num)) ? 0f : Mathf.Min(1.3333334f, (time - num) / (20f - num) * 1.3333334f)); - return num2 * 2f + 1f; - } -} +using System; +using Cute; +using UnityEngine; +using Wizard; +using Wizard.Battle.View; +using Wizard.Battle.View.Vfx; + +public class TurnEndTimeController +{ + private enum TIMEOUT_TURNEND_SCENE + { + NONE = 0, + TIMEOUT_START = 10, + TIMEOUT_START_WAIT = 20, + TURNEND_OPERATION = 30, + TURNEND_OPERATION_WAIT = 40, + EFFECT_STOP = 50, + EFFECT_STOP_WAIT = 60, + NOT_TOUCH_RELEASE = 70 + } + + private NetworkBattleManagerBase _networkBattleManager; + + private BattlePlayer _battlePlayer; + + private ITurnEndButtonUI _turnEndUI; + + private long _startTicks; + + private bool _isAlertEffect; + + private float _extendTime; + + private GameObject _alertEffect; + + private bool _isMovingTurnEndTimer; + + private TIMEOUT_TURNEND_SCENE _timeoutTurnEndScene; + + private VfxBase _canNotTouchVfx; + + private string _opponentTurnTurnEndLogMessage = ""; + + private bool _isOpponentTurnTimerUpdateLog; + + private int _logAddNum; + + private bool _isTurnStartTimeCheckLog; + + protected virtual bool IsTurnTimeDecrement { get; set; } + + public bool IsNowTurnTimeDecrement { get; private set; } + + public bool IsNextTurnTimeDecrement { get; private set; } + + public TurnEndTimeController(BattleManagerBase battleMgr, BattlePlayer battlePlayer, ITurnEndButtonUI turnEnd) + { + LocalLog.AccumulateLastTraceLog("TurnEndTimeController"); + _networkBattleManager = battleMgr as NetworkBattleManagerBase; + _battlePlayer = battlePlayer; + _networkBattleManager.OperateMgr.OnTurnEnd_ButtonPush += delegate + { + IsTurnTimeDecrement = false; + SetDecrementFlag(isDecrement: false); + LocalLog.AccumulateLastTraceLog("OnTurnEnd_ButtonPush"); + }; + _turnEndUI = turnEnd; + SetDecrementFlag(isDecrement: true); + } + + public void StartCountDown(string log) + { + LocalLog.AccumulateLastTraceLog("StartCountDown " + log); + DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); + _startTicks = absoluteTime.Ticks; + _extendTime = 0f; + log = log + absoluteTime.Hour + ":" + absoluteTime.Minute + ":" + absoluteTime.Second + ":" + absoluteTime.Millisecond.ToString("000") + ":"; + AddTurnEndTimerLog(" StartCountDown " + log); + _isTurnStartTimeCheckLog = false; + _turnEndUI.SettingTimer(GetMaxSecond(), isRed: false); + EndCountDown("startAfter"); + _isMovingTurnEndTimer = true; + } + + public void EndCountDown(string log) + { + LocalLog.AccumulateLastTraceLog("EndCountDown " + log); + AddTurnEndTimerLog(" EndCountDown " + log); + _isMovingTurnEndTimer = false; + if (_isAlertEffect) + { + _alertEffect = null; + _battlePlayer.BattleMgr.GameMgr.GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_TURN_5); + _isAlertEffect = false; + } + if (_turnEndUI as UnityEngine.Object != null) + { + _turnEndUI.SettingTimer(0f, isRed: false); + } + } + + public void AddTurnEndTimerLog(string text) + { + _logAddNum++; + if (_logAddNum <= 15) + { + DateTime dateTime = DateTime.Now.ToUniversalTime(); + string text2 = dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000"); + _opponentTurnTurnEndLogMessage = _opponentTurnTurnEndLogMessage + text2 + text + " \n"; + } + } + + public void BattleEndToTraceLog() + { + if (_isOpponentTurnTimerUpdateLog) + { + LocalLog.AccumulateTraceLog("665987UpdateTimerCountDownBatlteEnd " + _opponentTurnTurnEndLogMessage); + } + } + + public bool IsCountdownRunning() + { + return _isMovingTurnEndTimer; + } + + public void SetDecrementFlag(bool isDecrement) + { + IsNextTurnTimeDecrement = isDecrement; + LocalLog.AccumulateLastTraceLog("SetDecrementFlag " + isDecrement); + } + + public void SetExtendTime(float leftTime) + { + _extendTime = leftTime; + } + + public void UpdateTimerCountDown() + { + if (!_isMovingTurnEndTimer || _turnEndUI == null || !_turnEndUI.GameObject.activeSelf || _timeoutTurnEndScene >= TIMEOUT_TURNEND_SCENE.TIMEOUT_START) + { + return; + } + if (!_battlePlayer.BattleMgr.GameMgr.IsWatchBattle && (_battlePlayer.IsTurnStartEffectNotFinished || !_battlePlayer.IsSelfTurn)) + { + if (!_isOpponentTurnTimerUpdateLog) + { + LocalLog.AccumulateTraceLog("665987ErrorUpdateTimerCountDown "); + _isOpponentTurnTimerUpdateLog = true; + } + return; + } + DateTime absoluteTime = TimeUtil.GetAbsoluteTime(); + long ticks = absoluteTime.Ticks - _startTicks; + TimeSpan timeSpan = new TimeSpan(ticks); + float num = GetMaxSecond() - (float)timeSpan.TotalMilliseconds / 1000f + _extendTime; + if (!_isTurnStartTimeCheckLog) + { + AddTurnEndTimerLog(" UpdateTimerCountDown differenceSecond " + num + " IsTurnTimeDecrement" + IsTurnTimeDecrement + "_startTicks" + _startTicks + "_nowTicks" + absoluteTime.Ticks + "_extendTime" + _extendTime); + _isTurnStartTimeCheckLog = true; + } + if (num <= 0f) + { + if (CompulsionTurnEnd()) + { + return; + } + } + else if (num < 20f) + { + UpdateTimerPosition(num, isShowingAlert: true); + if (!_isAlertEffect) + { + _isAlertEffect = true; + EmitHandUtility.SendTurnEndReady(_networkBattleManager, IsTurnTimeDecrement); + if (!_networkBattleManager.IsRecovery) + { + _alertEffect = _battlePlayer.BattleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_5, _turnEndUI.GetBtnPosition()) + .GetGameObjIns(); + _alertEffect.transform.localScale = ((!_battlePlayer.BattleMgr.GameMgr.IsWatchBattle) ? (Vector3.one * 20f) : (Vector3.one * 19f)); + } + } + else if (!_networkBattleManager.IsRecovery) + { + if (_alertEffect == null) + { + _alertEffect = _battlePlayer.BattleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_5, _turnEndUI.GetBtnPosition()) + .GetGameObjIns(); + } + else + { + float x = _alertEffect.transform.localScale.x; + x += (GetEffectScaleByTime(num) - x) * 0.5f; + _alertEffect.transform.localScale = Vector3.one * x; + } + } + } + else + { + UpdateTimerPosition(num, isShowingAlert: false); + } + if (_battlePlayer.IsSelfTurn && IsNextTurnTimeDecrement && (Input.GetMouseButton(0) || Input.GetMouseButton(1) || Input.GetMouseButton(2) || Input.touchCount >= 1)) + { + LocalLog.AccumulateLastTraceLog("IsNextTurnTimeDecrement Off"); + SetDecrementFlag(isDecrement: false); + } + } + + protected virtual bool CompulsionTurnEnd() + { + if (_timeoutTurnEndScene >= TIMEOUT_TURNEND_SCENE.TIMEOUT_START) + { + return false; + } + if (_networkBattleManager.TouchControl._touchProcessor != null && _networkBattleManager.TouchControl.IsProcessorStart && _networkBattleManager.TouchControl.IsProcessorUpdate && _networkBattleManager.TouchControl.IsProcessorEnd && !_networkBattleManager.VfxMgr.IsEnd) + { + _networkBattleManager.TouchControl.IsForceEnd = true; + return false; + } + _battlePlayer.IsTimeOverTurnEndProcessing = true; + if (_networkBattleManager.JudgeCurrentFinishStatus() == NetworkBattleReceiver.RESULT_CODE.NotFinish) + { + VfxBase vfx = NullVfx.GetInstance(); + _battlePlayer.BattleMgr.GameMgr.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_6, _turnEndUI.GetBtnPosition()); + if (!(_networkBattleManager.OperateMgr is RecoveryOperateMgr)) + { + vfx = _networkBattleManager.OperateMgr.PlayerTurnEnd(isAuto: true); + } + _networkBattleManager.VfxMgr.RegisterSequentialVfx(vfx); + _networkBattleManager.TouchControl.IsForceEnd = false; + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TIMEOUT_START; + EndCountDown("TimeOut"); + return true; + } + return false; + } + + protected virtual void UpdateTimerPosition(float timeDifference, bool isShowingAlert) + { + _turnEndUI.SettingTimer(timeDifference, isShowingAlert); + } + + public void UpdateTimeoutTurnEnd() + { + switch (_timeoutTurnEndScene) + { + case TIMEOUT_TURNEND_SCENE.TIMEOUT_START: + _canNotTouchVfx = NullVfx.GetInstance(); + _networkBattleManager.VfxMgr.RegisterImmediateVfx(_canNotTouchVfx); + IsTurnTimeDecrement = IsNextTurnTimeDecrement; + AddTurnEndTimerLog("ExecTurnEnd IsTurnTimeDecrement" + IsTurnTimeDecrement); + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TIMEOUT_START_WAIT; + _turnEndUI.ChangeButtonView(isMyTurn: false); + _turnEndUI.HideBtn(); + _turnEndUI._isChangeViewLock = true; + break; + case TIMEOUT_TURNEND_SCENE.TIMEOUT_START_WAIT: + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION; + break; + case TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION: + if ((!_networkBattleManager.IsRecovery && !_networkBattleManager.IsCardPlayToTurnEndTimeoutStop && !_battlePlayer.PlayerBattleView.IsSelecting) || _networkBattleManager.VfxMgr.IsEnd) + { + _networkBattleManager.VfxMgr.RegisterSequentialVfx(_networkBattleManager.OperateMgr.TurnEndOperation(isPlayer: true)); + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION_WAIT; + _turnEndUI._isChangeViewLock = false; + } + break; + case TIMEOUT_TURNEND_SCENE.TURNEND_OPERATION_WAIT: + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.EFFECT_STOP; + break; + case TIMEOUT_TURNEND_SCENE.EFFECT_STOP: + if (_networkBattleManager.VfxMgr.IsEnd) + { + _battlePlayer.PlayerBattleView.ForceStopShowSelect(); + EffectMgr effectMgr = _battlePlayer.BattleMgr.GameMgr.GetEffectMgr(); + effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_SET_1); + effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_ACCELERATE_1); + effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_CRYSTALLIZE_1); + effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_SET_2); + effectMgr.Stop(EffectMgr.EffectType.CMN_CARD_SET_3); + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.EFFECT_STOP_WAIT; + } + break; + case TIMEOUT_TURNEND_SCENE.EFFECT_STOP_WAIT: + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.NOT_TOUCH_RELEASE; + break; + case TIMEOUT_TURNEND_SCENE.NOT_TOUCH_RELEASE: + { + IPlayerView playerBattleView = _battlePlayer.PlayerBattleView; + playerBattleView.AllClear(popUpClose: false, isRemoveSideLog: false); + playerBattleView.HandView.FocusRearrangeHandHand(); + _timeoutTurnEndScene = TIMEOUT_TURNEND_SCENE.NONE; + break; + } + } + } + + public float GetMaxSecond() + { + float result = 90f; + IsNowTurnTimeDecrement = false; + if (IsTurnTimeDecrement) + { + result = 20f; + IsNowTurnTimeDecrement = true; + } + return result; + } + + private float GetEffectScaleByTime(float time) + { + float num = 2f; + float num2 = ((!(time > num)) ? 0f : Mathf.Min(1.3333334f, (time - num) / (20f - num) * 1.3333334f)); + return num2 * 2f + 1f; + } +} diff --git a/SVSim.BattleEngine/Engine/TurnPanelControl.cs b/SVSim.BattleEngine/Engine/TurnPanelControl.cs index 5aa9df43..a8b1dfbb 100644 --- a/SVSim.BattleEngine/Engine/TurnPanelControl.cs +++ b/SVSim.BattleEngine/Engine/TurnPanelControl.cs @@ -31,9 +31,6 @@ public class TurnPanelControl : MonoBehaviour, ITurnPanelControl [SerializeField] private UIPanel EvoPanel; - [SerializeField] - private UISprite EvoText; - [SerializeField] private UIPanel ArcanePanel; @@ -56,8 +53,6 @@ public class TurnPanelControl : MonoBehaviour, ITurnPanelControl [HideInInspector] public bool isEvoEnableE; - private GameObject m_effectGameObject; - private IEnumerator _turnStartSequenceEnumerator; public GameObject GameObject => base.gameObject; @@ -75,10 +70,7 @@ public class TurnPanelControl : MonoBehaviour, ITurnPanelControl public VfxBase LoadResource() { - return new WaitLoadEffectAndSetSeVfx("cmn_ui_yourturn_3", "se_cmn_ui_yourturn_3", delegate(GameObject e) - { - m_effectGameObject = e; - }); + return NullVfx.GetInstance(); } public void StartUI(int turn, int evo, bool isP) @@ -211,7 +203,8 @@ public class TurnPanelControl : MonoBehaviour, ITurnPanelControl if (evoCnt == 0 && ((isPlayer && isEvoEnableP) || (!isPlayer && isEvoEnableE))) { yield return new WaitForSeconds(0.2f); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(new PlayEffectAndSeVfx(() => m_effectGameObject, Vector3.zero)); + // Pre-Phase-5b: registered a NullVfx on the mgr's VfxMgr — a no-op VFX slot. + // Dropping the ambient reach; the yield-based pacing above/below is preserved. yield return new WaitForSeconds(0.2f); EvoPanel.alpha = 1f; EvoPanel.transform.localScale = Vector3.one * 1.05f; diff --git a/SVSim.BattleEngine/Engine/TutorialNextSceneSelector.cs b/SVSim.BattleEngine/Engine/TutorialNextSceneSelector.cs deleted file mode 100644 index b524426a..00000000 --- a/SVSim.BattleEngine/Engine/TutorialNextSceneSelector.cs +++ /dev/null @@ -1,16 +0,0 @@ -using UnityEngine; - -public class TutorialNextSceneSelector : INextSceneSelector -{ - public TutorialNextSceneSelector(BattleResultUIController battleResultControl) - { - } - - public void Setup(bool isWin, GameObject gameObject) - { - } - - public void Show() - { - } -} diff --git a/SVSim.BattleEngine/Engine/TutorialReportEndAgent.cs b/SVSim.BattleEngine/Engine/TutorialReportEndAgent.cs deleted file mode 100644 index fa869a53..00000000 --- a/SVSim.BattleEngine/Engine/TutorialReportEndAgent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -public class TutorialReportEndAgent : MonoBehaviour -{ - public bool IsEnd { get; private set; } - - public void Finished() - { - IsEnd = true; - } -} diff --git a/SVSim.BattleEngine/Engine/TutorialResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/TutorialResultAnimationAgent.cs deleted file mode 100644 index 9699d102..00000000 --- a/SVSim.BattleEngine/Engine/TutorialResultAnimationAgent.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System.Collections; -using Cute; -using UnityEngine; -using Wizard; - -public class TutorialResultAnimationAgent : ResultAnimationAgent -{ - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - yield return new WaitForSeconds(2f); - if (BattleManagerBase.IsTutorial) - { - Invoke("returnTutorial", 2f); - } - else if (Data.SelectedStoryInfo.IsTutorialReplay) - { - BattleEndTutorialReplay(isWin); - } - GameMgr.GetIns().GetDataMgr().SetPlayerEmotionId(string.Empty); - GameMgr.GetIns().GetDataMgr().SetEnemyEmotionId(string.Empty); - battleResultControl.FinishResult(); - } - - private void returnTutorial() - { - int tutorial_step = Data.Load.data._userTutorial.tutorial_step; - if (tutorial_step <= 11) - { - if (tutorial_step != 1 && tutorial_step != 11) - { - return; - } - } - else - { - switch (tutorial_step) - { - default: - _ = 100; - return; - case 21: - break; - case 31: - return; - } - } - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.AreaSelect); - } - - private void BattleEndTutorialReplay(bool isWin) - { - switch (Data.Load.data._userTutorial.tutorial_replay_step) - { - case 1: - case 11: - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.AreaSelect); - break; - case 21: - case 100: - if (isWin) - { - UIManager.GetInstance().createInSceneLoading(); - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().StartCoroutine(GameMgr.GetIns().GetBattleCtrl().BattleEnd(delegate - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Scenario2); - })); - }); - } - else - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.AreaSelect); - } - break; - } - } - - private void OnRequestTutorialFinish(NetworkTask.ResultCode successcode) - { - ToolboxGame.SetUp.BuildFirstScene(); - UIManager.GetInstance().createInSceneLoading(); - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().StartCoroutine(GameMgr.GetIns().GetBattleCtrl().BattleEnd(delegate - { - UIManager.GetInstance().DestroyView(UIManager.ViewScene.AreaSelect); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Scenario2); - })); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/TutorialResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/TutorialResultAnimationHandler.cs deleted file mode 100644 index 5311dbe7..00000000 --- a/SVSim.BattleEngine/Engine/TutorialResultAnimationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -public class TutorialResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject m_resultAnimationAgentObj; - - private readonly TutorialResultAnimationAgent m_resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => m_resultAnimationAgentIns; - - public TutorialResultAnimationHandler(BattleCamera battleCamera) - { - m_resultAnimationAgentObj = new GameObject(); - m_resultAnimationAgentIns = m_resultAnimationAgentObj.AddComponent(); - m_resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(m_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/TutorialResultReporter.cs b/SVSim.BattleEngine/Engine/TutorialResultReporter.cs deleted file mode 100644 index b6debd22..00000000 --- a/SVSim.BattleEngine/Engine/TutorialResultReporter.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using LitJson; -using UnityEngine; -using Wizard; -using Wizard.Battle.Tutorial; -using Wizard.Lottery; - -public class TutorialResultReporter : IBattleResultReporter -{ - private readonly GameObject m_reportEndAgentObj; - - private readonly TutorialReportEndAgent m_reportEndAgent; - - public bool IsEnd => m_reportEndAgent.IsEnd; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => null; - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => LotteryApplyData.EmptyData(); - - public MyPageHomeDialogData HomeDialogData => null; - - public bool IsDataExist => true; - - public TutorialResultReporter() - { - m_reportEndAgentObj = new GameObject(); - m_reportEndAgent = m_reportEndAgentObj.AddComponent(); - } - - public void Report(bool isWin) - { - int tutorial_step = 0; - if (isWin && Data.SelectedStoryInfo.IsTutorial) - { - if (Data.Load.data._userTutorial.tutorial_step == 1) - { - tutorial_step = 11; - } - else if (Data.Load.data._userTutorial.tutorial_step == 11) - { - tutorial_step = 21; - } - else if (Data.Load.data._userTutorial.tutorial_step == 21) - { - tutorial_step = 31; - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.FIRST_TIPS_AFTER_ROTATION_USER_FLAG, 1); - } - bool isSkip = BattleManagerBase.GetIns() is TutorialBattleMgrBase tutorialBattleMgrBase && tutorialBattleMgrBase.IsUseTutorialSkip; - StartTutorialUpdateTaskData(tutorial_step, isSkip, delegate - { - m_reportEndAgent.Finished(); - }); - } - else - { - m_reportEndAgent.Finished(); - } - } - - public void StartTutorialUpdateTaskData(int tutorial_step, bool isSkip, Action callback) - { - FinishTutorialReport(tutorial_step); - TutorialUpdateTask tutorialUpdateTask = new TutorialUpdateTask(); - tutorialUpdateTask.SetParameter(tutorial_step, isSkip); - m_reportEndAgent.StartCoroutine(Toolbox.NetworkManager.Connect(tutorialUpdateTask, delegate - { - callback.Call(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - public JsonData GetFinishResponseData() - { - return null; - } - - public List GetUserAchievementList() - { - return new List(); - } - - public List GetUserMissionList() - { - return new List(); - } - - public void Destroy() - { - UnityEngine.Object.Destroy(m_reportEndAgentObj); - } - - public int GetClassExp() - { - return 0; - } - - private void FinishTutorialReport(int tutorial_step) - { - if (tutorial_step == 31) - { - AdjustManager.TutorialCompleteEvent(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/TweenColor.cs b/SVSim.BattleEngine/Engine/TweenColor.cs index c8d07e46..51a7dac5 100644 --- a/SVSim.BattleEngine/Engine/TweenColor.cs +++ b/SVSim.BattleEngine/Engine/TweenColor.cs @@ -138,16 +138,4 @@ public class TweenColor : UITweener { to = value; } - - [ContextMenu("Assume value of 'From'")] - private void SetCurrentValueToStart() - { - value = from; - } - - [ContextMenu("Assume value of 'To'")] - private void SetCurrentValueToEnd() - { - value = to; - } } diff --git a/SVSim.BattleEngine/Engine/TweenPosition.cs b/SVSim.BattleEngine/Engine/TweenPosition.cs index d84e1472..c1008563 100644 --- a/SVSim.BattleEngine/Engine/TweenPosition.cs +++ b/SVSim.BattleEngine/Engine/TweenPosition.cs @@ -94,20 +94,6 @@ public class TweenPosition : UITweener return tweenPosition; } - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, bool worldSpace) - { - TweenPosition tweenPosition = UITweener.Begin(go, duration); - tweenPosition.worldSpace = worldSpace; - tweenPosition.from = tweenPosition.value; - tweenPosition.to = pos; - if (duration <= 0f) - { - tweenPosition.Sample(1f, isFinished: true); - tweenPosition.enabled = false; - } - return tweenPosition; - } - [ContextMenu("Set 'From' to current value")] public override void SetStartToCurrentValue() { @@ -119,16 +105,4 @@ public class TweenPosition : UITweener { to = value; } - - [ContextMenu("Assume value of 'From'")] - private void SetCurrentValueToStart() - { - value = from; - } - - [ContextMenu("Assume value of 'To'")] - private void SetCurrentValueToEnd() - { - value = to; - } } diff --git a/SVSim.BattleEngine/Engine/TweenPositionX.cs b/SVSim.BattleEngine/Engine/TweenPositionX.cs deleted file mode 100644 index 32b4e7ab..00000000 --- a/SVSim.BattleEngine/Engine/TweenPositionX.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using UnityEngine; - -[AddComponentMenu("NGUI/Tween/Tween Position X")] -public class TweenPositionX : UITweener -{ - public float from; - - public float to; - - [HideInInspector] - public bool worldSpace; - - private Transform mTrans; - - private UIRect mRect; - - public Transform cachedTransform - { - get - { - if (mTrans == null) - { - mTrans = base.transform; - } - return mTrans; - } - } - - [Obsolete("Use 'value' instead")] - public float positionX - { - get - { - return Xvalue; - } - set - { - Xvalue = value; - } - } - - public float Xvalue - { - get - { - if (!worldSpace) - { - return cachedTransform.localPosition.x; - } - return cachedTransform.position.x; - } - set - { - if (mRect == null || !mRect.isAnchored || worldSpace) - { - if (worldSpace) - { - cachedTransform.position = new Vector3(value, cachedTransform.position.y, cachedTransform.position.z); - } - else - { - cachedTransform.localPosition = new Vector3(value, cachedTransform.localPosition.y, cachedTransform.localPosition.z); - } - } - else - { - value -= cachedTransform.localPosition.x; - NGUIMath.MoveRect(mRect, value, 0f); - } - } - } - - private void Awake() - { - mRect = GetComponent(); - } - - protected override void OnUpdate(float factor, bool isFinished) - { - Xvalue = from * (1f - factor) + to * factor; - } - - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos) - { - TweenPosition tweenPosition = UITweener.Begin(go, duration); - tweenPosition.from = tweenPosition.value; - tweenPosition.to = pos; - if (duration <= 0f) - { - tweenPosition.Sample(1f, isFinished: true); - tweenPosition.enabled = false; - } - return tweenPosition; - } - - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, bool worldSpace) - { - TweenPosition tweenPosition = UITweener.Begin(go, duration); - tweenPosition.worldSpace = worldSpace; - tweenPosition.from = tweenPosition.value; - tweenPosition.to = pos; - if (duration <= 0f) - { - tweenPosition.Sample(1f, isFinished: true); - tweenPosition.enabled = false; - } - return tweenPosition; - } - - [ContextMenu("Set 'From' to current value")] - public override void SetStartToCurrentValue() - { - from = Xvalue; - } - - [ContextMenu("Set 'To' to current value")] - public override void SetEndToCurrentValue() - { - to = Xvalue; - } - - [ContextMenu("Assume value of 'From'")] - private void SetCurrentValueToStart() - { - Xvalue = from; - } - - [ContextMenu("Assume value of 'To'")] - private void SetCurrentValueToEnd() - { - Xvalue = to; - } -} diff --git a/SVSim.BattleEngine/Engine/TweenPositionY.cs b/SVSim.BattleEngine/Engine/TweenPositionY.cs deleted file mode 100644 index f60e467e..00000000 --- a/SVSim.BattleEngine/Engine/TweenPositionY.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using UnityEngine; - -[AddComponentMenu("NGUI/Tween/Tween Position Y")] -public class TweenPositionY : UITweener -{ - public float from; - - public float to; - - [HideInInspector] - public bool worldSpace; - - private Transform mTrans; - - private UIRect mRect; - - public Transform cachedTransform - { - get - { - if (mTrans == null) - { - mTrans = base.transform; - } - return mTrans; - } - } - - [Obsolete("Use 'value' instead")] - public float positionY - { - get - { - return Yvalue; - } - set - { - Yvalue = value; - } - } - - public float Yvalue - { - get - { - if (!worldSpace) - { - return cachedTransform.localPosition.y; - } - return cachedTransform.position.y; - } - set - { - if (mRect == null || !mRect.isAnchored || worldSpace) - { - if (worldSpace) - { - cachedTransform.position = new Vector3(cachedTransform.position.x, value, cachedTransform.position.z); - } - else - { - cachedTransform.localPosition = new Vector3(cachedTransform.localPosition.x, value, cachedTransform.localPosition.z); - } - } - else - { - value -= cachedTransform.localPosition.y; - NGUIMath.MoveRect(mRect, 0f, value); - } - } - } - - private void Awake() - { - mRect = GetComponent(); - } - - protected override void OnUpdate(float factor, bool isFinished) - { - Yvalue = from * (1f - factor) + to * factor; - } - - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos) - { - TweenPosition tweenPosition = UITweener.Begin(go, duration); - tweenPosition.from = tweenPosition.value; - tweenPosition.to = pos; - if (duration <= 0f) - { - tweenPosition.Sample(1f, isFinished: true); - tweenPosition.enabled = false; - } - return tweenPosition; - } - - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, bool worldSpace) - { - TweenPosition tweenPosition = UITweener.Begin(go, duration); - tweenPosition.worldSpace = worldSpace; - tweenPosition.from = tweenPosition.value; - tweenPosition.to = pos; - if (duration <= 0f) - { - tweenPosition.Sample(1f, isFinished: true); - tweenPosition.enabled = false; - } - return tweenPosition; - } - - [ContextMenu("Set 'From' to current value")] - public override void SetStartToCurrentValue() - { - from = Yvalue; - } - - [ContextMenu("Set 'To' to current value")] - public override void SetEndToCurrentValue() - { - to = Yvalue; - } - - [ContextMenu("Assume value of 'From'")] - private void SetCurrentValueToStart() - { - Yvalue = from; - } - - [ContextMenu("Assume value of 'To'")] - private void SetCurrentValueToEnd() - { - Yvalue = to; - } -} diff --git a/SVSim.BattleEngine/Engine/TweenRotation.cs b/SVSim.BattleEngine/Engine/TweenRotation.cs index 03c546ac..ffc2a6fa 100644 --- a/SVSim.BattleEngine/Engine/TweenRotation.cs +++ b/SVSim.BattleEngine/Engine/TweenRotation.cs @@ -78,16 +78,4 @@ public class TweenRotation : UITweener { to = value.eulerAngles; } - - [ContextMenu("Assume value of 'From'")] - private void SetCurrentValueToStart() - { - value = Quaternion.Euler(from); - } - - [ContextMenu("Assume value of 'To'")] - private void SetCurrentValueToEnd() - { - value = Quaternion.Euler(to); - } } diff --git a/SVSim.BattleEngine/Engine/TweenScale.cs b/SVSim.BattleEngine/Engine/TweenScale.cs index 626a0bb1..8275cee1 100644 --- a/SVSim.BattleEngine/Engine/TweenScale.cs +++ b/SVSim.BattleEngine/Engine/TweenScale.cs @@ -94,16 +94,4 @@ public class TweenScale : UITweener { to = value; } - - [ContextMenu("Assume value of 'From'")] - private void SetCurrentValueToStart() - { - value = from; - } - - [ContextMenu("Assume value of 'To'")] - private void SetCurrentValueToEnd() - { - value = to; - } } diff --git a/SVSim.BattleEngine/Engine/Twitter.cs b/SVSim.BattleEngine/Engine/Twitter.cs index 5549361a..ab6db2fa 100644 --- a/SVSim.BattleEngine/Engine/Twitter.cs +++ b/SVSim.BattleEngine/Engine/Twitter.cs @@ -1,276 +1,14 @@ -using System; -using System.Collections; -using System.IO; -using Cute; using UnityEngine; -using UnityEngine.Networking; using Wizard; -using Wizard.ErrorDialog; +// Post-Phase-5b (2026-07-03) UI stub. Twitter was the deck-share-to-Twitter +// coroutine driver — dialog display, deck-image download, browser-open of an +// intent URL. Nothing headless runs. Kept as a MonoBehaviour type with the one +// externally-called method (TweetDataFromPortal, from UICardList) preserved as +// a no-op so the stub compiles cleanly with the rest of the culled UI cluster. public class Twitter : MonoBehaviour { - private const string UNITY_CLASS = "com.unity3d.player.UnityPlayer"; - - private const string UNITY_ACTIVITY = "currentActivity"; - - private const string TWITTER_URL = "http://twitter.com/intent/tweet?text={0}&url={1}&hashtags={2}"; - - private const string SAVED_IMAGE_NAME = "image_saved.png"; - - private const int ERROR_CODE_UNKNOWN = 102; - - public const int REQUEST_CODE = 555; - - private const float TIMEOUT = 20f; - - private GenerateDeckImageTask _task; - - private const string OBJECT_NAME = "TwitterShareObject"; - - private void Start() - { - base.gameObject.name = "TwitterShareObject"; - } - - public static void Logout(Action callback = null) - { - } - - public void TweetWithoutImage(string text, string url, string tags) - { - Post(text, url, tags, null); - } - - public void TweetWithScreenshot(string text, string url, string tags) - { - ScreenCapture.CaptureScreenshot("image_saved.png"); - string imageFilename = GetImagePath(); - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - StartCoroutine(CheckFileExistsAndExecute(delegate - { - Post(text, url, tags, imageFilename); - UIManager.GetInstance().closeInSceneCenterLoading(); - }, imageFilename, delegate(bool isTimeout) - { - CloseLoadingAndShowErrorDialog(isTimeout); - })); - } - - public void TweetWithDownloadImage(string text, string url, string tags, string imageUrl, Action callback = null) - { - string imageFilename = GetImagePath(); - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - Action action = delegate - { - StartCoroutine(CheckFileExistsAndExecute(delegate - { - Post(text, url, tags, imageFilename); - UIManager.GetInstance().closeInSceneCenterLoading(); - if (callback != null) - { - callback(); - } - }, imageFilename, delegate(bool isTimeout) - { - CloseLoadingAndShowErrorDialog(isTimeout); - })); - }; - StartCoroutine(DownloadImage(imageUrl, imageFilename, action, CloseLoadingAndShowErrorDialog)); - } - - public void TweetWithSavedImage(string text, string hashtags, string imagePath, Action callback = null) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - StartCoroutine(CheckFileExistsAndExecute(delegate - { - Post(text, "", hashtags, imagePath); - UIManager.GetInstance().closeInSceneCenterLoading(); - if (callback != null) - { - callback(); - } - }, imagePath, delegate(bool isTimeout) - { - CloseLoadingAndShowErrorDialog(isTimeout); - })); - } - - private static string MakeIntentUrl(string text, string url, string tags) - { - return $"http://twitter.com/intent/tweet?text={UnityWebRequest.EscapeURL(text)}&url={UnityWebRequest.EscapeURL(url)}&hashtags={UnityWebRequest.EscapeURL(tags)}"; - } - - private static string FormatText(string text, string url, string tags) - { - if (!string.IsNullOrEmpty(url)) - { - text = text + " " + url; - } - if (!string.IsNullOrEmpty(tags)) - { - string[] array = tags.Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries); - foreach (string text2 in array) - { - text = text + " #" + text2; - } - } - return text; - } - - private void ShowDialogUrl(string text, string url, string tags) - { - bool isBackKeyEnable = GameMgr.GetIns().GetInputMgr().isBackKeyEnable; - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - SystemText systemText = Wizard.Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Card_0161")); - dialogBase.SetText(systemText.Get("Common_0208")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Dia_Web_001_Button")); - dialogBase.onPushButton1 = delegate - { - BrowserURL.Open(MakeIntentUrl(text, url, tags)); - }; - dialogBase.OnClose = delegate - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = isBackKeyEnable; - }; - } - - public void Post(string text, string url, string tags, string imageFilename) - { - ShowDialogUrl(text, url, tags); - } - - private IEnumerator DownloadImage(string url, string filename, Action action, Action onError) - { - using UnityWebRequest request = UnityWebRequestTexture.GetTexture(url); - yield return request.SendWebRequest(); - bool isTimeout = false; - float startDownloadTime = Time.time; - while (!request.isDone && !isTimeout) - { - isTimeout = Time.time - startDownloadTime > 20f; - yield return null; - } - if (request.error != null || isTimeout) - { - onError(isTimeout); - request.Dispose(); - yield break; - } - Texture2D content = DownloadHandlerTexture.GetContent(request); - request.Dispose(); - byte[] bytes = content.EncodeToPNG(); - UnityEngine.Object.Destroy(content); - File.WriteAllBytes(filename, bytes); - action(); - } - - private IEnumerator CheckFileExistsAndExecute(Action onFileExists, string filePath, Action onError) - { - bool isFileTimeout = false; - float startWaitTime = Time.time; - while (!File.Exists(filePath) && !isFileTimeout) - { - isFileTimeout = Time.time - startWaitTime > 20f; - yield return null; - } - if (File.Exists(filePath)) - { - onFileExists(); - } - else - { - onError(obj: false); - } - } - - private static string GetImagePath() - { - return "" + "image_saved.png"; - } - - private void CloseLoadingAndShowErrorDialog(bool isTimeout) - { - UIManager.GetInstance().closeInSceneCenterLoading(); - if (isTimeout) - { - Dialog.Create("TIMEOUT_NORETRY"); - } - else - { - Dialog.Create(102); - } - } - public void TweetDataFromPortal(int[] cardIds, ClassSet classSet, GenerateDeckCodeTask.SubmitDeckType submitType, int[] phantomCardIdList, string rotationId) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - StartTweet(cardIds, classSet, submitType, phantomCardIdList, rotationId); - } - - private void StartTweet(int[] cardIds, ClassSet classSet, GenerateDeckCodeTask.SubmitDeckType submitType, int[] phantomCardIdList, string rotationId) - { - UIManager.GetInstance().createInSceneCenterLoading(); - Action callbackOnSuccess = delegate - { - if (CardBasePrm.ClanTypeIsUseable(classSet.SubClass)) - { - _task = new GenerateDeckImageTask(); - _task.SetParameter((int)classSet.MainClass, (int)classSet.SubClass, submitType, cardIds, phantomCardIdList); - StartCoroutine(Toolbox.NetworkManager.Connect(_task, GetImageResponse, null, null, encrypt: false)); - } - else - { - _task = new GenerateDeckImageTask(); - _task.SetParameter((int)classSet.MainClass, submitType, cardIds, rotationId, phantomCardIdList); - StartCoroutine(Toolbox.NetworkManager.Connect(_task, GetImageResponse, null, null, encrypt: false)); - } - }; - GenerateDeckImageMaintenanceTask task = new GenerateDeckImageMaintenanceTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, callbackOnSuccess)); - } - - private void GetImageResponse(NetworkTask.ResultCode error) - { - string imageFilename = GetImagePath(); - File.WriteAllBytes(imageFilename, _task.ImageBytes); - string text = _task.TwitterMessage; - _task = null; - StartCoroutine(CheckFileExistsAndExecute(delegate - { - Post(text, "", "", imageFilename); - UIManager.GetInstance().closeInSceneCenterLoading(); - }, imageFilename, delegate(bool isTimeout) - { - CloseLoadingAndShowErrorDialog(isTimeout); - })); - } - - public void OnResult(string result) - { - bool isBackKeyEnable = GameMgr.GetIns().GetInputMgr().isBackKeyEnable; - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - SystemText systemText = Wizard.Data.SystemText; - dialogBase.SetTitleLabel(systemText.Get("Dia_Share_005")); - string[] array = result.Split(','); - if (array.Length <= 1 || int.Parse(array[1]) == 555) - { - if (int.Parse(array[0]) == 1) - { - dialogBase.SetText(systemText.Get("Dia_Share_001")); - } - else - { - dialogBase.SetText(systemText.Get("Dia_Share_002")); - } - dialogBase.OnClose = delegate - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = isBackKeyEnable; - }; - } } } diff --git a/SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs b/SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs deleted file mode 100644 index fa78760f..00000000 --- a/SVSim.BattleEngine/Engine/TwoPickCardSelectBase.cs +++ /dev/null @@ -1,664 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; -using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; -using Wizard.Scripts.Network.Data.TaskData.Arena.TwoPick; - -public abstract class TwoPickCardSelectBase : MonoBehaviour -{ - public enum MoveType - { - LEFT, - RIGHT, - UP, - DOWN - } - - public enum PICK_SIDE - { - LEFT, - RIGHT - } - - private class CardPosXInfo - { - public Transform Transform { get; private set; } - - public float PosX { get; private set; } - - public CardPosXInfo(Transform t, float posX) - { - Transform = t; - PosX = posX; - } - } - - public const int PICK_SIDE_NUM = 2; - - public const int PICK_CARD_NUM = 2; - - protected TwoPickCardSelectView _viewData; - - private int scene_layer = 24; - - private const int maxDrawCard = 4; - - private const float CARD_IN_ANIMATION_TIME = 0.5f; - - private IList LeftObjs = new List(); - - private IList RightObjs = new List(); - - private List cardObjList = new List(); - - private List cardObjListSpell = new List(); - - private List _loadAssetList = new List(); - - protected List _selectedCardList = new List(); - - private bool _bOnDestory; - - private int _lastTimeCardNum; - - protected int _followerNum; - - protected int _amuletNum; - - protected int _spellNum; - - private List _tweenObjectList = new List(); - - private List cardPosXInfoList = new List(); - - private bool isCardSetFirst = true; - - private const int DECK_INFO_ICON = 0; - - private const int DECK_INFO_CLASS_NAME = 0; - - private const int DECK_INFO_CARD_NUM = 1; - - private const int DECK_INFO_CARD_MAX = 2; - - private const int DECK_INFO_FOLLOWER_NUM = 3; - - private const int DECK_INFO_SPELL_NUM = 4; - - private const int DECK_INFO_AMULET_NUM = 5; - - private const float DECK_INFO_TWEEN_Y = -151f; - - private readonly Color EFFECT_COLOR_BLUE = new Color(0.2509804f, 0.5019608f, 1f); - - private readonly Color EFFECT_COLOR_ORANGE = new Color(1f, 32f / 85f, 0f); - - private List _effects = new List(); - - public UICardList UiCardList { get; set; } - - public CardDetailUI UiCardDetail { get; set; } - - public int SelectedClassId { get; set; } - - public bool IsButtonEnable { get; set; } - - public bool IsTitleEnable { get; set; } - - public bool IsFirstCardDisp { get; set; } - - protected virtual void Awake() - { - IsButtonEnable = true; - IsTitleEnable = true; - IsFirstCardDisp = false; - } - - public void Init() - { - isCardSetFirst = true; - _viewData = base.transform.GetComponent(); - _viewData.TitlePanel.gameObject.SetActive(IsTitleEnable); - _viewData.CostCurveClass.Initialize(FormatBehaviorManager.GetDefaultBehaviour(Format.Max).CardMasterId); - _viewData.DeckBtnObj.labels[0].text = Data.SystemText.Get("Arena_0009"); - _viewData.SelectBtnObjs[0].labels[0].text = Data.SystemText.Get("Arena_0029"); - _viewData.SelectBtnObjs[1].labels[0].text = Data.SystemText.Get("Arena_0029"); - for (int i = 0; i < 2; i++) - { - _viewData.SelectBtnObjs[i].buttons[0].onClick.Clear(); - _viewData.SelectBtnObjs[i].buttons[0].onClick.Add(new EventDelegate(delegate - { - OnClickSelectBtn(); - })); - } - _viewData.DeckBtnObj.buttons[0].onClick.Clear(); - _viewData.DeckBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate - { - DeckViewOpen(); - })); - UiCardList.SetClan(GetSelectedClassId()); - CardBasePrm.ClanType selectedClassId = GetSelectedClassId(); - _viewData.DeckInfoObjs.sprites[0].spriteName = ClassCharaPrm.GetIconSpriteName(selectedClassId); - _viewData.DeckInfoObjs.labels[0].text = ClassCharaPrm.GetNameText(selectedClassId); - ClassCharaPrm.SetClassLabelSetting(_viewData.DeckInfoObjs.labels[0], selectedClassId); - _viewData.DeckTypeNameLabel.gameObject.SetActive(value: false); - if (GetDeckInfo().cardIds.Length == 0) - { - _viewData.DeckInfoObjs.labels[1].text = "0"; - _viewData.DeckInfoObjs.labels[2].text = "/" + 30; - _viewData.DeckInfoObjs.labels[3].text = "0"; - _viewData.DeckInfoObjs.labels[4].text = "0"; - _viewData.DeckInfoObjs.labels[5].text = "0"; - } - _viewData.TitlePanel.alpha = 0f; - _viewData.DeckInfoObjs.GetComponent().alpha = 0f; - TweenAlpha.Begin(base.gameObject, 0f, 1f); - LeftObjs = new List(); - RightObjs = new List(); - Deck deckInfo = GetDeckInfo(); - _selectedCardList = new List(); - if (deckInfo.cardIds.Length != 0) - { - _selectedCardList.AddRange(deckInfo.cardIds); - } - for (int num = 0; num < _selectedCardList.Count; num++) - { - DeckInfoCardNumUpdate(_selectedCardList.Count, 30, _selectedCardList[num]); - } - if (_selectedCardList.Count == 0) - { - _viewData.DeckBtnObj.buttons[0].isEnabled = false; - _viewData.DeckBtnObj.labels[0].color = LabelDefine.TEXT_COLOR_BUTTON_DISABLE; - } - else - { - _viewData.DeckBtnObj.buttons[0].isEnabled = true; - _viewData.DeckBtnObj.labels[0].color = LabelDefine.TEXT_COLOR_BUTTON_ENABLE; - } - StartCoroutine(cardChoosePost_NonTask()); - _viewData.SelectBtnObjs[0].gameObject.SetActive(value: false); - _viewData.SelectBtnObjs[1].gameObject.SetActive(value: false); - _viewData.CardContainer[0].SetActive(value: false); - _viewData.CardContainer[1].SetActive(value: false); - TweenAlpha.Begin(_viewData.BaseObj, 0f, 0f); - _loadAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(GetSelectedSkinId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase)); - _viewData.ClassObj.textures[0].mainTexture = null; - UIManager.GetInstance().createInSceneCenterLoading(); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadAssetList, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - if (!_bOnDestory) - { - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GetSelectedSkinId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture; - UITexture obj = _viewData.ClassObj.textures[0]; - obj.mainTexture = mainTexture; - obj.material = null; - TweenAlpha.Begin(_viewData.BaseObj, 0f, 1f); - } - })); - _viewData.TitlePanel.alpha = 0f; - TweenAlpha.Begin(_viewData.TitlePanel.transform.parent.gameObject, 0.5f, 1f); - StartCoroutine(ForceSetCardPosX()); - } - - public void SetDeckTypeName(string name) - { - _viewData.DeckTypeNameLabel.gameObject.SetActive(value: true); - _viewData.DeckTypeNameLabel.text = name; - ClassCharaPrm.SetClassLabelSetting(_viewData.DeckTypeNameLabel, GetSelectedClassId()); - _viewData.DeckInfoObjs.sprites[0].gameObject.SetActive(value: false); - _viewData.DeckInfoObjs.labels[0].gameObject.SetActive(value: false); - } - - public virtual void StartDestory() - { - Object.Destroy(base.gameObject); - } - - protected virtual void OnDestroy() - { - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_1); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_2); - foreach (Effect effect in _effects) - { - effect.Stop(); - } - _effects.Clear(); - _bOnDestory = true; - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - public void RemoveData() - { - for (int i = 0; i < LeftObjs.Count; i++) - { - Object.Destroy(LeftObjs[i]); - } - LeftObjs.Clear(); - for (int j = 0; j < RightObjs.Count; j++) - { - Object.Destroy(RightObjs[j]); - } - RightObjs.Clear(); - cardObjList.Clear(); - cardObjListSpell.Clear(); - Toolbox.ResourcesManager.RemoveAssetGroup(_loadAssetList); - _loadAssetList.Clear(); - } - - private IEnumerator cardChoosePost(int selectedId) - { - UIManager.GetInstance().createInSceneCenterLoading(); - yield return new WaitForSeconds(0.5f); - ConnectTask(selectedId); - } - - public void NextCardSelect(PICK_SIDE inPickSide) - { - _selectedCardList.Clear(); - _selectedCardList.AddRange(Data.RoomTwoPickInfo.deckData.cardIds); - _followerNum = 0; - _amuletNum = 0; - _spellNum = 0; - _viewData.CostCurveClass.Refresh(); - for (int i = 0; i < Data.RoomTwoPickInfo.deckData.cardIds.Length; i++) - { - DeckInfoCardNumUpdate(_selectedCardList.Count, 30, Data.RoomTwoPickInfo.deckData.cardIds[i]); - } - CardDecide(inPickSide, isCardListUpdate: false); - } - - private IEnumerator cardChoosePost_NonTask() - { - yield return new WaitForSeconds(0.5f); - returnPost(); - } - - private void returnPost() - { - UIManager.GetInstance().closeInSceneCenterLoading(); - StartCoroutine(CardSet()); - } - - private IEnumerator CardSet() - { - try - { - for (int i = 0; i < _tweenObjectList.Count; i++) - { - if (_tweenObjectList[i] != null) - { - iTween.Stop(_tweenObjectList[i]); - } - } - _tweenObjectList.Clear(); - } - catch - { - } - if (_selectedCardList.Count >= 30) - { - StartCoroutine(RunSceneNext()); - yield break; - } - LeftObjs.Clear(); - RightObjs.Clear(); - _viewData.CardContainer[0].SetActive(value: true); - _viewData.CardContainer[1].SetActive(value: true); - if (isCardSetFirst) - { - isCardSetFirst = false; - iTween.MoveTo(_viewData.DeckInfoObjs.gameObject, iTween.Hash("y", -151f, "time", 0.25f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - TweenAlpha.Begin(_viewData.DeckInfoObjs.gameObject, 0.25f, 1f); - _tweenObjectList.Add(_viewData.DeckInfoObjs.gameObject); - } - for (int j = 0; j < cardObjList.Count; j++) - { - Object.Destroy(cardObjList[j].CardObj); - } - cardObjList.Clear(); - for (int k = 0; k < cardObjListSpell.Count; k++) - { - Object.Destroy(cardObjListSpell[k].CardObj); - } - cardObjListSpell.Clear(); - cardPosXInfoList.Clear(); - int[] downloadList = new int[4] - { - GetCardInfo().candidateCards[0].cardId1, - GetCardInfo().candidateCards[0].cardId2, - GetCardInfo().candidateCards[1].cardId1, - GetCardInfo().candidateCards[1].cardId2 - }; - UIManager.GetInstance().CardLoadSelect(base.gameObject, downloadList, scene_layer, is2D: false); - while (!UIManager.GetInstance().getUIBase_CardManager().getCreateEndFlag() || !UIManager.GetInstance().getUIBase_CardManager().isAssetAllReady) - { - yield return null; - } - cardObjList = UIManager.GetInstance().getSelectCardListObjs(); - _loadAssetList.AddRange(Toolbox.ResourcesManager.CardListAssetPathList); - Toolbox.ResourcesManager.CardListAssetPathList.Clear(); - for (int l = 0; l < 4; l++) - { - GameObject cardObj = cardObjList[l].CardObj; - cardObj.transform.parent = base.transform; - cardObj.GetComponent().SetCardId(downloadList[l]); - switch (l) - { - case 0: - case 1: - cardObj.transform.parent = _viewData.CardContainer[0].transform; - LeftObjs.Add(cardObj); - break; - case 2: - case 3: - cardObj.transform.parent = _viewData.CardContainer[1].transform; - RightObjs.Add(cardObj); - break; - } - cardObj.transform.localPosition = Vector3.up * 100f; - cardObj.transform.localRotation = Quaternion.Euler(Vector3.up * 90f); - cardObj.transform.localScale = new Vector3(50f, 50f, 50f); - cardObj.transform.Find("CardBase").gameObject.AddComponent().onClick.Add(CreateCardDetailEvent(cardObj)); - cardObj.SetActive(value: false); - } - StartCoroutine(RunCardIn()); - } - - private EventDelegate CreateCardDetailEvent(GameObject cardObject) - { - return new EventDelegate(delegate - { - UiCardDetail.OnPushCardDetailOn(cardObject); - }); - } - - private IEnumerator RunCardIn() - { - Vector3[] posList = new Vector3[4] - { - new Vector3(-100f, 200f, 0f), - new Vector3(110f, 160f, 100f), - new Vector3(110f, 200f, 0f), - new Vector3(-100f, 160f, 100f) - }; - Vector3[] rotList = new Vector3[4] - { - new Vector3(0f, 0f, 5f), - new Vector3(0f, 0f, -5f), - new Vector3(0f, 0f, -5f), - new Vector3(0f, 0f, 5f) - }; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DL_CARD_APPEAR); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_ARCANE_1, _viewData.CardContainer[0].transform.position); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_ARCANE_2, _viewData.CardContainer[1].transform.position); - int i = 0; - while (i < 4 && LeftObjs.Count != 0 && RightObjs.Count != 0) - { - GameObject gameObject; - Color color; - if (i < 2) - { - gameObject = LeftObjs[i]; - color = EFFECT_COLOR_BLUE; - } - else - { - gameObject = RightObjs[i % 2]; - color = EFFECT_COLOR_ORANGE; - } - gameObject.SetActive(value: true); - iTween.MoveTo(gameObject, iTween.Hash("position", posList[i], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(gameObject, iTween.Hash("rotation", rotList[i], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo, "oncomplete", "")); - iTween.MoveAdd(gameObject, iTween.Hash("y", Random.value * 0.03f + 0.03f, "time", Random.value * 2f + 2f, "looptype", iTween.LoopType.pingPong, "easetype", iTween.EaseType.easeInOutQuad)); - StartCoroutine(CardInAnimationEndAction(gameObject, posList[i], rotList[i])); - Effect effect = ((cardObjList[i].cardType == CardBasePrm.CharaType.NORMAL) ? GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_ARENA_FRAME_1, gameObject) : ((cardObjList[i].cardType != CardBasePrm.CharaType.SPELL) ? GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_ARENA_FRAME_2, gameObject) : GameMgr.GetIns().GetEffectMgr().StartBuff(EffectMgr.EffectType.CMN_ARENA_FRAME_3, gameObject))); - if (effect == null) - { - break; - } - effect.ChangeParticleColor(color); - _effects.Add(effect); - if (i % 2 == 0) - { - yield return new WaitForSeconds(0.1f); - } - int num = i + 1; - i = num; - } - _viewData.SelectBtnObjs[0].gameObject.SetActive(IsButtonEnable); - _viewData.SelectBtnObjs[1].gameObject.SetActive(IsButtonEnable); - IsFirstCardDisp = true; - } - - private IEnumerator CardInAnimationEndAction(GameObject cardObject, Vector3 position, Vector3 rotation) - { - yield return new WaitForSeconds(0.5f); - if (cardObject != null) - { - cardObject.transform.localPosition = position; - TweenRotation tweenRotation = cardObject.AddComponent(); - tweenRotation.from = rotation; - float x = Random.value * 0.04f - 0.02f; - float y = Random.value * 0.08f - 0.04f; - float z = Random.value * 0.02f - 0.01f; - tweenRotation.to = new Vector3(x, y, z); - tweenRotation.style = UITweener.Style.PingPong; - tweenRotation.method = UITweener.Method.EaseInOut; - tweenRotation.duration = Random.value * 2f + 2f; - _tweenObjectList.Add(cardObject); - cardPosXInfoList.Add(new CardPosXInfo(cardObject.transform, position.x)); - } - } - - private IEnumerator RunCardOut(bool isLeft) - { - if (LeftObjs.Count == 0 || RightObjs.Count == 0) - { - yield break; - } - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_1); - GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_ARENA_ARCANE_2); - foreach (Effect effect in _effects) - { - effect.Stop(); - } - _effects.Clear(); - int i = 0; - while (i < 2) - { - if (i != 0) - { - yield return new WaitForSeconds(0.1f); - } - if (LeftObjs.Count == 0 || RightObjs.Count == 0) - { - break; - } - if (isLeft) - { - _viewData.CardTweenTarget[i].transform.SetParent(LeftObjs[i].transform.parent); - _viewData.CardTweenTarget[i].transform.localPosition = LeftObjs[i].transform.localPosition; - _viewData.CardTweenTarget[i].transform.rotation = LeftObjs[i].transform.rotation; - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_1, _viewData.CardTweenTarget[i].transform.localPosition, _viewData.CardTweenTarget[i]); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_3, LeftObjs[i].transform.position); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_2, RightObjs[i].transform.position); - } - else - { - _viewData.CardTweenTarget[i].transform.SetParent(RightObjs[i].transform.parent); - _viewData.CardTweenTarget[i].transform.localPosition = RightObjs[i].transform.localPosition; - _viewData.CardTweenTarget[i].transform.rotation = RightObjs[i].transform.rotation; - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_2, LeftObjs[i].transform.position); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_1, _viewData.CardTweenTarget[i].transform.localPosition, _viewData.CardTweenTarget[i]); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECIDE_3, RightObjs[i].transform.position); - } - LeftObjs[i].SetActive(value: false); - RightObjs[i].SetActive(value: false); - int num = i + 1; - i = num; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_SELECT); - try - { - for (int j = 0; j < _tweenObjectList.Count; j++) - { - if (_tweenObjectList[j] != null) - { - iTween.Stop(_tweenObjectList[j]); - } - } - _tweenObjectList.Clear(); - } - catch - { - } - Vector3 vector = new Vector3(100f, 100f, 0f); - Vector3 p = new Vector3(340f, 140f, 0f); - if (!isLeft) - { - vector.x *= -1f; - p.x *= -1f; - } - for (int k = 0; k < 2; k++) - { - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(_viewData.CardTweenTarget[k].transform.localPosition, _viewData.CardTweenTarget[k].transform.localPosition + vector, p, 10); - iTween.MoveTo(_viewData.CardTweenTarget[k], iTween.Hash("path", bezierQuad, "time", 0.25f, "islocal", true, "movetopath", false, "easetype", iTween.EaseType.linear)); - iTween.RotateTo(_viewData.CardTweenTarget[k], iTween.Hash("z", -180f, "time", 0.25f, "islocal", true, "easetype", iTween.EaseType.linear)); - _tweenObjectList.Add(_viewData.CardTweenTarget[k]); - } - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_ARENA_DECK_1, _viewData.DeckInfoObjs.transform.position); - } - - private IEnumerator RunSceneNext() - { - SetUiCardList(); - TweenAlpha.Begin(base.gameObject, 0.5f, 0f); - yield return new WaitForSeconds(0.5f); - base.gameObject.SetActive(value: false); - CardSelectEndAction(); - } - - public void DeckInfoCardNumUpdate(int deckNow, int deckMax, int inCardId) - { - _viewData.DeckInfoObjs.labels[1].text = deckNow.ToString(); - _viewData.DeckInfoObjs.labels[2].text = "/" + deckMax; - switch (CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(inCardId).CharType) - { - case CardBasePrm.CharaType.NORMAL: - _followerNum++; - break; - case CardBasePrm.CharaType.FIELD: - case CardBasePrm.CharaType.CHANT_FIELD: - _amuletNum++; - break; - default: - _spellNum++; - break; - } - _viewData.DeckInfoObjs.labels[3].text = _followerNum.ToString(); - _viewData.DeckInfoObjs.labels[4].text = _spellNum.ToString(); - _viewData.DeckInfoObjs.labels[5].text = _amuletNum.ToString(); - _viewData.CostCurveClass.Add(inCardId, withAnim: false); - } - - private void OnClickSelectBtn() - { - if (IsButtonEnable) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - PICK_SIDE inPickSide = ((!(UIButton.current.name == "SelectBtn0")) ? PICK_SIDE.RIGHT : PICK_SIDE.LEFT); - CardDecide(inPickSide, isCardListUpdate: true); - } - } - - protected void CardDecide(PICK_SIDE inPickSide, bool isCardListUpdate) - { - int num = 0; - int num2 = 0; - switch (inPickSide) - { - case PICK_SIDE.LEFT: - num = GetCardInfo().candidateCards[0].cardId1; - num2 = GetCardInfo().candidateCards[0].cardId2; - StartCoroutine(RunCardOut(isLeft: true)); - StartCoroutine(cardChoosePost(GetCardInfo().candidateCards[0].id)); - break; - case PICK_SIDE.RIGHT: - num = GetCardInfo().candidateCards[1].cardId1; - num2 = GetCardInfo().candidateCards[1].cardId2; - StartCoroutine(RunCardOut(isLeft: false)); - StartCoroutine(cardChoosePost(GetCardInfo().candidateCards[1].id)); - break; - } - if (isCardListUpdate) - { - _selectedCardList.Add(num); - _selectedCardList.Add(num2); - DeckInfoCardNumUpdate(_selectedCardList.Count, 30, num); - DeckInfoCardNumUpdate(_selectedCardList.Count, 30, num2); - } - _viewData.SelectBtnObjs[0].gameObject.SetActive(value: false); - _viewData.SelectBtnObjs[1].gameObject.SetActive(value: false); - _viewData.DeckBtnObj.buttons[0].isEnabled = true; - _viewData.DeckBtnObj.labels[0].color = LabelDefine.TEXT_COLOR_BUTTON_ENABLE; - } - - private IEnumerator ForceSetCardPosX() - { - while (true) - { - for (int i = 0; i < cardPosXInfoList.Count; i++) - { - CardPosXInfo cardPosXInfo = cardPosXInfoList[i]; - Transform transform = cardPosXInfo.Transform; - if (!(transform == null)) - { - Vector3 localPosition = transform.localPosition; - localPosition.x = cardPosXInfo.PosX; - transform.localPosition = localPosition; - } - } - yield return null; - } - } - - protected abstract CardBasePrm.ClanType GetSelectedClassId(); - - protected abstract int GetSelectedSkinId(); - - protected void DeckViewOpen() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UiCardList.SetActive(in_Active: true); - SetUiCardList(); - UiCardList.ResetScroll(); - } - - protected void SetUiCardList() - { - if (_lastTimeCardNum != _selectedCardList.Count) - { - if (_selectedCardList.Count != 0) - { - UiCardList.RemoveData(); - } - _selectedCardList = UIManager.GetInstance().getUIBase_CardManager().SortIDList(_selectedCardList, CardMaster.CardMasterId.Default); - for (int i = 0; i < _selectedCardList.Count; i++) - { - UiCardList.addScrollItem(_selectedCardList[i]); - } - _lastTimeCardNum = _selectedCardList.Count; - } - } - - protected abstract Deck GetDeckInfo(); - - protected abstract CandidateCardInfo GetCardInfo(); - - protected abstract void CardSelectEndAction(); - - protected abstract void ConnectTask(int selectedCardId); -} diff --git a/SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs b/SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs deleted file mode 100644 index 02962786..00000000 --- a/SVSim.BattleEngine/Engine/TwoPickCardSelectView.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; - -public class TwoPickCardSelectView : MonoBehaviour -{ - public GameObject BaseObj; - - public NguiObjs ClassObj; - - public NguiObjs DeckBtnObj; - - public NguiObjs[] SelectBtnObjs; - - public GameObject[] CardContainer; - - public UIPanel TitlePanel; - - public NguiObjs DeckInfoObjs; - - public CostCurveUI CostCurveClass; - - public GameObject[] CardTweenTarget; - - public UILabel DeckTypeNameLabel; -} diff --git a/SVSim.BattleEngine/Engine/UIAnchor.cs b/SVSim.BattleEngine/Engine/UIAnchor.cs index a247036f..5a0abdd3 100644 --- a/SVSim.BattleEngine/Engine/UIAnchor.cs +++ b/SVSim.BattleEngine/Engine/UIAnchor.cs @@ -7,7 +7,6 @@ public class UIAnchor : MonoBehaviour { public enum Side { - BottomLeft, Left, TopLeft, Top, @@ -30,10 +29,6 @@ public class UIAnchor : MonoBehaviour public Vector2 pixelOffset = Vector2.zero; - [HideInInspector] - [SerializeField] - private UIWidget widgetContainer; - private Transform mTrans; private Animation mAnim; @@ -51,11 +46,6 @@ public class UIAnchor : MonoBehaviour UICamera.onScreenResize = (UICamera.OnScreenResize)Delegate.Combine(UICamera.onScreenResize, new UICamera.OnScreenResize(ScreenSizeChanged)); } - private void OnDestroy() - { - UICamera.onScreenResize = (UICamera.OnScreenResize)Delegate.Remove(UICamera.onScreenResize, new UICamera.OnScreenResize(ScreenSizeChanged)); - } - private void ScreenSizeChanged() { if (mStarted && runOnlyOnce) @@ -64,22 +54,6 @@ public class UIAnchor : MonoBehaviour } } - private void Start() - { - if (container == null && widgetContainer != null) - { - container = widgetContainer.gameObject; - widgetContainer = null; - } - mRoot = NGUITools.FindInParents(base.gameObject); - if (uiCamera == null) - { - uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer); - } - Update(); - mStarted = true; - } - private void Update() { if (mAnim != null && mAnim.enabled && mAnim.isPlaying) diff --git a/SVSim.BattleEngine/Engine/UIAtlas.cs b/SVSim.BattleEngine/Engine/UIAtlas.cs index 9b02ffd3..952f037b 100644 --- a/SVSim.BattleEngine/Engine/UIAtlas.cs +++ b/SVSim.BattleEngine/Engine/UIAtlas.cs @@ -14,8 +14,6 @@ public class UIAtlas : MonoBehaviour public Rect inner = new Rect(0f, 0f, 1f, 1f); - public bool rotated; - public float paddingLeft; public float paddingRight; @@ -23,23 +21,10 @@ public class UIAtlas : MonoBehaviour public float paddingTop; public float paddingBottom; - - public bool hasPadding - { - get - { - if (paddingLeft == 0f && paddingRight == 0f && paddingTop == 0f) - { - return paddingBottom != 0f; - } - return true; - } - } } private enum Coordinates { - Pixels, TexCoords } @@ -279,28 +264,6 @@ public class UIAtlas : MonoBehaviour return null; } - public string GetRandomSprite(string startsWith) - { - if (GetSprite(startsWith) == null) - { - List list = spriteList; - List list2 = new List(); - foreach (UISpriteData item in list) - { - if (item.name.StartsWith(startsWith)) - { - list2.Add(item.name); - } - } - if (list2.Count <= 0) - { - return null; - } - return list2[UnityEngine.Random.Range(0, list2.Count)]; - } - return startsWith; - } - public void MarkSpriteListAsChanged() { mSpriteIndices.Clear(); @@ -311,11 +274,6 @@ public class UIAtlas : MonoBehaviour } } - public void SortAlphabetically() - { - mSprites.Sort((UISpriteData s1, UISpriteData s2) => s1.name.CompareTo(s2.name)); - } - public BetterList GetListOfSprites() { if (mReplacement != null) @@ -424,15 +382,6 @@ public class UIAtlas : MonoBehaviour return true; } - public void UpdateSize() - { - if (material != null) - { - width = material.mainTexture.width; - height = material.mainTexture.height; - } - } - public void MarkAsChanged() { if (this == null) diff --git a/SVSim.BattleEngine/Engine/UIBase.cs b/SVSim.BattleEngine/Engine/UIBase.cs index 53569d8c..468c9bba 100644 --- a/SVSim.BattleEngine/Engine/UIBase.cs +++ b/SVSim.BattleEngine/Engine/UIBase.cs @@ -6,7 +6,6 @@ using UnityEngine; public class UIBase : MonoBehaviour { - private bool loadOk; private bool isAssetSetting; @@ -18,18 +17,6 @@ public class UIBase : MonoBehaviour protected bool IsShowFooterMenu { get; set; } - private void Start() - { - IsShowFooterMenu = false; - onFirstStart(); - } - - private void FixedUpdate() - { - assetBundleSetting(); - onMove(); - } - public virtual bool IsGetOutOfScene(Action backupExec) { return true; @@ -45,21 +32,6 @@ public class UIBase : MonoBehaviour UnloadBackground(); } - private void assetBundleSetting() - { - if (!loadOk) - { - StartCoroutine(assetSetting()); - loadOk = true; - assetBundleEnd(); - } - } - - public bool GetloadOk() - { - return loadOk; - } - public IEnumerator assetSetting() { if (isAssetSetting) @@ -97,13 +69,6 @@ public class UIBase : MonoBehaviour m_loadBackgroundList.Clear(); } - protected void resetAssetBaundleSetting() - { - loadOk = false; - isAssetSetting = false; - UnloadBackground(); - } - public virtual void onFirstStart() { Open(); @@ -145,10 +110,9 @@ public class UIBase : MonoBehaviour protected virtual void onClose() { - if (GameMgr.GetIns() != null && GameMgr.GetIns().GetInputMgr() != null) - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - } + // Pre-Phase-5b: re-enable the back key on the ambient GameMgr's InputMgr. + // Headless has no input manager; the branch was a no-op through the null-guards + // anyway (GameMgr's InputMgr wasn't seeded), so dropping the ambient reach is safe. } public virtual void onMove() @@ -163,22 +127,8 @@ public class UIBase : MonoBehaviour { } - public virtual void deleteAction() - { - } - - public void setBackScene(UIManager.ViewScene scene) - { - backSceneSave = scene; - } - public UIManager.ViewScene getBackScene() { return backSceneSave; } - - public virtual List GetButtonList() - { - return null; - } } diff --git a/SVSim.BattleEngine/Engine/UIBase_CardManager.cs b/SVSim.BattleEngine/Engine/UIBase_CardManager.cs index eb900b3d..c01027f9 100644 --- a/SVSim.BattleEngine/Engine/UIBase_CardManager.cs +++ b/SVSim.BattleEngine/Engine/UIBase_CardManager.cs @@ -13,23 +13,14 @@ public class UIBase_CardManager : MonoBehaviour { public enum LOAD_KIND { - MYPAGE_HOME_DEFAULT_DECK_DATA, - SELECT_DATA, - SELECT_DATA_GACHA, - MYPAGE_HOME_CUSTOM_DECK } public enum ScrollType { - HORIZONTAL, - VERTICAL } private enum AddCardResult { - ADDED, - NOT_ADDED, - END } public class CardObjData @@ -48,12 +39,8 @@ public class UIBase_CardManager : MonoBehaviour public string lifes; - public int LifesNum; - public string Atks; - public int AtksNum; - public string Names; public string Skills; @@ -85,41 +72,6 @@ public class UIBase_CardManager : MonoBehaviour public class CardPrefabs { - public GameObject SpellGameObj; - - public GameObject SpellGameObj_LG; - - public GameObject SpellSpecGameObj; - - public GameObject FieldGameObj; - - public GameObject FieldSpecGameObj; - - public GameObject UnitGameObj; - - public GameObject UnitSpecGameObj; - - public GameObject UnitGameObj_SR; - - public GameObject UnitGameObj_LG; - - public GameObject m_CardBase; - - public GameObject m_EPIcon; - - public GameObject m_AtkIcon; - - public GameObject m_LifeIcon; - - public GameObject m_CostIcon; - - public GameObject m_NameIcon; - - public Material BaseTexBase; - - public Material SpecularMaterial; - - public GameObject RotationOnlyIcon { get; set; } } public class LoadCondition @@ -183,12 +135,6 @@ public class UIBase_CardManager : MonoBehaviour SPOT } - public const int FILTER_COST_MAX = 8; - - public const int FILTER_ATTACK_MAX = 8; - - public const int FILTER_LIFE_MAX = 8; - public int Cost; public int Class; @@ -355,64 +301,14 @@ public class UIBase_CardManager : MonoBehaviour } } - private readonly Vector3 NormalScale = new Vector3(70f, 70f, 2f); - - private readonly Vector3 ZoomedScale = new Vector3(80f, 80f, 1f); - - private readonly Vector3 DetailScale = new Vector3(200f, 200f, 100f); - - public const string SPECULAR_UNIT_0 = "tx_Card_Unit_a_4"; - - public const string SPECULAR_UNIT_1 = "tx_Card_Unit_n_4"; - - public const string SPECULAR_SPELL_0 = "tx_Card_Spell_a_3"; - - public const string SPECULAR_SPELL_1 = "tx_Card_Spell_n_3"; - - public const string SPECULAR_AMULET_0 = "tx_Card_Field_a_3"; - - public const string SPECULAR_AMULET_1 = "tx_Card_Field_n_3"; - - public const string ROTATION_ONLY_ICON_NAME = "RotationOnlyIcon"; - private static readonly Color32 PREMIERE_GRADIENT_TOP_COLOR = new Color32(byte.MaxValue, 243, 176, byte.MaxValue); private static readonly Color32 PREMIERE_GRADIENT_BOTTOM_COLOR = new Color32(186, 150, 0, byte.MaxValue); private static readonly Color32 EFFECT_COLOR = new Color32(92, 56, 3, byte.MaxValue); - private LOAD_KIND loadKind; - - private List normalCards; - - private List evoCards; - private bool CreateEndFlag; - private List _loadList = new List(); - - private List CardListObjs; - - private List SelectCardListObjs; - - private List CardList2DObjs; - - private List AllCardList2DObjs; - - private IList SelectedCardIDList; - - private List SelectedCardList2DObjs; - - private List CardList2DTextures; - - private IDictionary CardList2DDict; - - private NetworkManager networkManager; - - private Transform ScrollViewHorGrid; - - private int loadCnt; - [SerializeField] private UIFont _NormalCardFont; @@ -421,24 +317,8 @@ public class UIBase_CardManager : MonoBehaviour private long SleeveId = 3000011L; - private Material DeckBaseTexBase; - - private DeckData _myPageHomeDeck; - - private IList m_CardList = new List(); - - private IList m_DCardList = new List(); - - private bool _wizardSetUpFinish; - - private IList loadSelectIds; - - private IDictionary DetailBasePrmList; - public bool isAssetAllReady; - private bool isReadyTemplate; - private CardKeyWordCommonCache _keyWordCommonCache; private CardKeyWordCache _keyWordCache; @@ -447,103 +327,13 @@ public class UIBase_CardManager : MonoBehaviour private CardKeyWordCache _cardNameKeyWordHiraganaCache; - public const string BBCodePattern = "(\\[[a-zA-Z0-9\\/\\-]*(rub\\<[^\\>]*\\>)*\\])"; - public _3dCardFrameManager _3dCardFrameManager { get; private set; } = new _3dCardFrameManager(); - private void DisposeAllCardListData() - { - ScrollViewHorGrid = null; - networkManager = null; - m_CardList = null; - m_DCardList = null; - } - - private void Start() - { - StartCoroutine(WaitCallBack()); - } - - private IEnumerator WaitCallBack() - { - while (!Global.IS_LOAD_ALLDONE) - { - yield return null; - } - SetNetWorkManager(); - Init(); - } - - private void SetNetWorkManager() - { - if (networkManager == null) - { - networkManager = Toolbox.NetworkManager; - } - } - - private void Init() - { - GameMgr.GetIns().GetGameObjMgr().GetUIContainer() - .SetActive(value: true); - _wizardSetUpFinish = true; - } - - public bool IsWizardSetupFinish() - { - return _wizardSetUpFinish; - } - public bool getCreateEndFlag() { return CreateEndFlag; } - private List GetAddUnitPathList() - { - return new List - { - Toolbox.ResourcesManager.GetAssetTypePath("Unit", ResourcesManager.AssetLoadPathType.HandCard), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_low", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_specular", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("UnitCardFrameSpecularMat", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus), - Toolbox.ResourcesManager.GetAssetTypePath("SpecularUnit", ResourcesManager.AssetLoadPathType.HandCardSpecular), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Unit_a_4", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Unit_n_4", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon) - }; - } - - private List GetAddSpellPathList() - { - return new List - { - Toolbox.ResourcesManager.GetAssetTypePath("Spell", ResourcesManager.AssetLoadPathType.HandCard), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_low", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_specular", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("SpellCardFrameSpecularMat", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus), - Toolbox.ResourcesManager.GetAssetTypePath("SpecularSpell", ResourcesManager.AssetLoadPathType.HandCardSpecular), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Spell_a_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Spell_n_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon) - }; - } - - private List GetAddFieldPathList() - { - return new List - { - Toolbox.ResourcesManager.GetAssetTypePath("Field", ResourcesManager.AssetLoadPathType.HandCard), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_field", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_low", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_specular", ResourcesManager.AssetLoadPathType.CardFrameMesh), - Toolbox.ResourcesManager.GetAssetTypePath("FieldCardFrameSpecularMat", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus), - Toolbox.ResourcesManager.GetAssetTypePath("SpecularField", ResourcesManager.AssetLoadPathType.HandCardSpecular), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Field_a_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon), - Toolbox.ResourcesManager.GetAssetTypePath("tx_Card_Field_n_3", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon) - }; - } - public List AddAssetPath(List List, bool is2D, CardMaster.CardMasterId cardMasterId, bool isAddSleeve = true, long sleeveId = 3000011L) { List list = new List(); @@ -587,126 +377,6 @@ public class UIBase_CardManager : MonoBehaviour return list; } - private void AddCardAssetPath(List List, int page, int perPage, CardMaster.CardMasterId cardMasterId, bool is2D = false, bool isAddSleeve = true) - { - for (int i = 0; i < List.Count; i++) - { - if ((i < page * perPage || i >= Mathf.Abs((page + 1) * perPage)) && page != -1) - { - continue; - } - CardParameter cardParameterFromId = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId(List[i]); - int resourceCardId = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId(cardParameterFromId.NormalCardId).ResourceCardId; - if (cardParameterFromId.CharType == CardBasePrm.CharaType.NORMAL) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial); - Toolbox.ResourcesManager.CardListAssetPathList.Add(assetTypePath); - continue; - } - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); - if (CardMaster.IsMutationCardCheck(cardParameterFromId.BaseCardId)) - { - assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial); - } - Toolbox.ResourcesManager.CardListAssetPathList.Add(assetTypePath2); - } - if (!is2D && isAddSleeve) - { - DeckData myPageHomeDeck = _myPageHomeDeck; - SleeveId = ((myPageHomeDeck == null) ? 3000011 : Toolbox.ResourcesManager.GetExistingSleeveId(myPageHomeDeck.GetDeckSleeveID())); - string assetTypePath3 = Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial); - if (!Toolbox.ResourcesManager.CardListAssetPathList.Contains(assetTypePath3)) - { - Toolbox.ResourcesManager.CardListAssetPathList.Add(assetTypePath3); - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - } - } - } - - public bool MyPageHomeCreateCustomDeckCard(GameObject returnObj, DeckData deckData, int layer, bool is2D, Action onFinish = null) - { - isAssetAllReady = false; - isReadyTemplate = false; - _myPageHomeDeck = deckData; - return MyPageCreateDeckCard(returnObj, deckData, layer, is2D, onFinish); - } - - private bool MyPageCreateDeckCard(GameObject returnObj, DeckData deck, int layer, bool is2D, Action onFinish) - { - if (is2D) - { - Toolbox.ResourcesManager.RemoveAssetGroup(Toolbox.ResourcesManager.Card2DAssetPathList); - Toolbox.ResourcesManager.Card2DAssetPathList.Clear(); - if (CardList2DDict == null) - { - CardList2DDict = new Dictionary(); - } - else - { - CardList2DDict.Clear(); - } - } - else - { - Toolbox.ResourcesManager.RemoveAssetGroup(Toolbox.ResourcesManager.Card2DAssetPathList); - Toolbox.ResourcesManager.Card2DAssetPathList.Clear(); - Toolbox.ResourcesManager.RemoveAssetGroup(Toolbox.ResourcesManager.Card3DAssetPathList); - Toolbox.ResourcesManager.Card3DAssetPathList.Clear(); - } - CreateEndFlag = false; - if (!deck.IsNoCard()) - { - GameMgr.GetIns().GetDataMgr().SetCurrentDeckData(deck.GetCardIdList()); - List list; - if (is2D) - { - list = Toolbox.ResourcesManager.Card2DAssetPathList; - } - else - { - list = Toolbox.ResourcesManager.Card3DAssetPathList; - if (DetailBasePrmList == null) - { - DetailBasePrmList = new Dictionary(); - } - else - { - DetailBasePrmList.Clear(); - } - } - if (deck.IsDefaultDeck()) - { - list.AddRange(AddAssetPath(deck.GetCardIdList(), is2D, CardMaster.CardMasterId.Default, isAddSleeve: false, 3000011L)); - } - else - { - list.AddRange(AddAssetPath(deck.GetCardIdList(), is2D, CardMaster.CardMasterId.Default, isAddSleeve: true, deck.GetDeckSleeveID())); - } - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(list, delegate - { - if (deck.IsDefaultDeck()) - { - SleeveId = 3000011L; - loadKind = LOAD_KIND.MYPAGE_HOME_DEFAULT_DECK_DATA; - } - else - { - if (SleeveId == 0L) - { - SleeveId = 3000011L; - } - loadKind = LOAD_KIND.MYPAGE_HOME_CUSTOM_DECK; - } - StartCoroutine(CreateDeckData(layer, is2D, CardMaster.CardMasterId.Default, CardBasePrm.ClanType.NONE, own: false, onFinish)); - isAssetAllReady = true; - })); - return true; - } - onFinish(); - isAssetAllReady = true; - return false; - } - public IList SelectCardIDInConditionMask(List idList, FilterParameter filterParam, IFormatBehavior formatBehaviour, MyRotationInfo myRotationInfo, bool alreadySorted = false, bool isCraftMode = false, bool isDisableAllTribe = false) { CardMaster cardMaster = CardMaster.GetInstance(formatBehaviour.CardMasterId); @@ -867,7 +537,7 @@ public class UIBase_CardManager : MonoBehaviour { return true; } - bool flag = GameMgr.GetIns().GetDataMgr().FavoriteCardList.Contains(card.CardId); + bool flag = false; // headless: no user favorites return (param.IsFavoriteState(FilterParameter.FavoriteBit.NORMAL) && !flag) || (param.IsFavoriteState(FilterParameter.FavoriteBit.FAVORITE) && flag); }); filters = (Func)Delegate.Combine(filters, (Func)delegate(CardParameter card, FilterParameter param) @@ -876,7 +546,7 @@ public class UIBase_CardManager : MonoBehaviour { return true; } - bool flag = GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(card.CardId); + bool flag = false; // headless: no user spot cards if (isCraftMode) { if (param.IsSpotState(FilterParameter.SpotBit.SPOT)) @@ -885,7 +555,7 @@ public class UIBase_CardManager : MonoBehaviour } return true; } - return param.IsSpotState(FilterParameter.SpotBit.SPOT) ? flag : (GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(card.CardId, isIncludingSpotCard: false) > 0); + return param.IsSpotState(FilterParameter.SpotBit.SPOT) ? flag : false; // headless: no user card counts }); if (filterParam.MyRotationInfoForFormatAvailable != null) { @@ -998,11 +668,6 @@ public class UIBase_CardManager : MonoBehaviour select id).ToList(); } - public IList SelectAllCardIDInConditionMask(FilterParameter filterParam, IFormatBehavior formatBehavior, MyRotationInfo myRotationInfo, bool isConventionMode, bool isCraftMode = false) - { - return SelectCardIDInConditionMask(formatBehavior.SortedDeckUsableCardList, filterParam, formatBehavior, myRotationInfo, alreadySorted: true, isCraftMode); - } - public List SortIDList(IList idList, CardMaster.CardMasterId cardMasterId) { return (from id in idList @@ -1011,148 +676,6 @@ public class UIBase_CardManager : MonoBehaviour select id).ToList(); } - public void CrateSelectCard(GameObject returnObj, IList cardIds, int layer, bool is2D, Action onFinish = null, bool isDefaultSleeve = false, CardMaster.CardMasterId cardMasterId = CardMaster.CardMasterId.Default) - { - isAssetAllReady = false; - if (is2D) - { - if (!UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.TwoPick)) - { - Toolbox.ResourcesManager.RemoveAssetGroup(Toolbox.ResourcesManager.CardListAssetPathList); - Toolbox.ResourcesManager.CardListAssetPathList.Clear(); - } - if (CardList2DDict == null) - { - CardList2DDict = new Dictionary(); - } - else - { - CardList2DDict.Clear(); - } - } - SelectCardListObjs = null; - AddCardAssetPath(cardIds.ToList(), -1, 0, cardMasterId, is2D, !isDefaultSleeve); - bool preferSynchronousLoad = UIManager.GetInstance().IsLocked(); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroup(Toolbox.ResourcesManager.CardListAssetPathList, delegate - { - CreateEndFlag = false; - if (isDefaultSleeve) - { - SleeveId = 3000011L; - } - else - { - SleeveId = ((_myPageHomeDeck == null) ? 3000011 : Toolbox.ResourcesManager.GetExistingSleeveId(_myPageHomeDeck.GetDeckSleeveID())); - } - loadKind = LOAD_KIND.SELECT_DATA; - StartCoroutine(CreateDeckData(layer, is2D, cardMasterId, CardBasePrm.ClanType.MAX, own: false, onFinish)); - loadSelectIds = cardIds; - isAssetAllReady = true; - }, isProgress: true, preferSynchronousLoad)); - } - - public IEnumerator CreateGachaCardPack(GameObject returnObj, IList cardIds, int layer, bool is2D, int sleeveId) - { - isAssetAllReady = false; - if (is2D) - { - if (!UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.TwoPick)) - { - Toolbox.ResourcesManager.RemoveAssetGroup(Toolbox.ResourcesManager.CardListAssetPathList); - Toolbox.ResourcesManager.CardListAssetPathList.Clear(); - } - if (CardList2DDict == null) - { - CardList2DDict = new Dictionary(); - } - else - { - CardList2DDict.Clear(); - } - } - SelectCardListObjs = null; - Toolbox.ResourcesManager.CardListAssetPathList.Clear(); - AddCardAssetPath(cardIds.ToList(), -1, 0, CardMaster.CardMasterId.Default, is2D, isAddSleeve: false); - SleeveId = Toolbox.ResourcesManager.GetExistingSleeveId(sleeveId); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial); - if (!Toolbox.ResourcesManager.CardListAssetPathList.Contains(assetTypePath)) - { - Toolbox.ResourcesManager.CardListAssetPathList.Add(assetTypePath); - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureAORefSpec)); - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_cardbase_s", ResourcesManager.AssetLoadPathType.SleeveSpecular)); - if (Toolbox.ResourcesManager.IsExistSleeveNormalMap(sleeveId)) - { - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureNormalMap)); - } - else - { - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_tx_general_n", ResourcesManager.AssetLoadPathType.SleeveTextureBasePath)); - } - if (Data.Master.SleeveMgr.Get(SleeveId).IsPremiumSleeve) - { - Toolbox.ResourcesManager.CardListAssetPathList.Add(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureMask)); - } - } - bool isFinish = false; - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(Toolbox.ResourcesManager.CardListAssetPathList, delegate - { - isFinish = true; - })); - while (!isFinish) - { - yield return null; - } - CreateEndFlag = false; - loadKind = LOAD_KIND.SELECT_DATA_GACHA; - StartCoroutine(CreateDeckData(layer, is2D, CardMaster.CardMasterId.Default)); - loadSelectIds = cardIds; - isAssetAllReady = true; - } - - public static void CardStatusIconOnOff(CardObjData st, bool onoff) - { - GameObject cardObj = st.CardObj; - cardObj.transform.Find("Cost(Clone)").gameObject.SetActive(onoff); - if (st.EvolOk) - { - cardObj.transform.Find("Atk(Clone)").gameObject.SetActive(onoff); - cardObj.transform.Find("Life(Clone)").gameObject.SetActive(onoff); - } - } - - public static void CardStatusZPointArranged(CardObjData st) - { - GameObject cardObj = st.CardObj; - GameObject obj = cardObj.transform.Find("Cost(Clone)").gameObject; - Vector3 localPosition = obj.transform.localPosition; - localPosition.z = -1f; - obj.transform.localPosition = localPosition; - GameObject obj2 = cardObj.transform.Find("Name(Clone)").gameObject; - Vector3 localPosition2 = obj2.transform.localPosition; - localPosition2.z = -1f; - obj2.transform.localPosition = localPosition2; - GameObject obj3 = cardObj.transform.Find("SkillDisc(Clone)").gameObject; - Vector3 localPosition3 = obj3.transform.localPosition; - obj3.transform.localPosition = localPosition3; - GameObject obj4 = cardObj.transform.Find("CardBase").gameObject; - obj4.transform.localScale = Global.CARD_BASE_SCALE; - Vector3 localPosition4 = obj4.transform.localPosition; - localPosition4.z = 1f; - obj4.transform.localPosition = localPosition4; - if (st.EvolOk) - { - GameObject obj5 = cardObj.transform.Find("Atk(Clone)").gameObject; - Vector3 localPosition5 = obj5.transform.localPosition; - localPosition5.z = -1f; - obj5.transform.localPosition = localPosition5; - GameObject obj6 = cardObj.transform.Find("Life(Clone)").gameObject; - Vector3 localPosition6 = obj6.transform.localPosition; - localPosition6.z = -1f; - obj6.transform.localPosition = localPosition6; - } - } - public static CardObjData cardDataCopy(CardObjData data, CardObjData data2) { data.Cost = data2.Cost; @@ -1173,386 +696,6 @@ public class UIBase_CardManager : MonoBehaviour return data; } - private IEnumerator Load2D(int scene_layer, Action SetCardPrefab) - { - yield return StartCoroutine(GameMgr.GetIns().GetPrefabMgr().LoadAync("Prefab/Cards/CardListTemplate")); - CardPrefabs cardPrefabs = new CardPrefabs(); - cardPrefabs.UnitGameObj = (cardPrefabs.SpellGameObj = GameMgr.GetIns().GetPrefabMgr().Get("Prefab/Cards/CardListTemplate")); - GameObject spellGameObj = cardPrefabs.SpellGameObj; - int layer = (cardPrefabs.UnitGameObj.layer = scene_layer); - spellGameObj.layer = layer; - SetCardPrefab(cardPrefabs); - isReadyTemplate = true; - } - - private IEnumerator Load3D(int scene_layer, Action SetCardPrefab) - { - CardPrefabs cp = new CardPrefabs(); - yield return StartCoroutine(GameMgr.GetIns().GetPrefabMgr().LoadAync("Prefab/CardDeco/Name")); - cp.m_NameIcon = GameMgr.GetIns().GetPrefabMgr().GetObj("Prefab/CardDeco/Name") as GameObject; - cp.m_AtkIcon = Resources.Load("Prefab/CardDeco/Atk") as GameObject; - cp.m_AtkIcon.layer = scene_layer; - cp.m_AtkIcon.name = "Atk"; - cp.m_LifeIcon = Resources.Load("Prefab/CardDeco/Life") as GameObject; - cp.m_LifeIcon.layer = scene_layer; - cp.m_LifeIcon.name = "Life"; - cp.m_CostIcon = Resources.Load("Prefab/CardDeco/Cost") as GameObject; - cp.m_CostIcon.layer = scene_layer; - cp.m_CostIcon.name = "Cost"; - cp.RotationOnlyIcon = Resources.Load("Prefab/CardDeco/RotationOnlyIcon") as GameObject; - cp.RotationOnlyIcon.layer = scene_layer; - cp.RotationOnlyIcon.name = "RotationOnlyIcon"; - cp.m_CardBase = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_CardBase", ResourcesManager.AssetLoadPathType.CardDeco, isfetch: true)); - if (loadKind == LOAD_KIND.SELECT_DATA_GACHA) - { - Texture value = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureAORefSpec, isfetch: true)) as Texture; - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_cardbase_s", ResourcesManager.AssetLoadPathType.SleeveSpecular, isfetch: true)) as Material; - float value2 = 20f; - Texture value3; - if (Toolbox.ResourcesManager.IsExistSleeveNormalMap(SleeveId)) - { - value3 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureNormalMap, isfetch: true)) as Texture; - value2 = 40f; - } - else - { - value3 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_tx_general_n", ResourcesManager.AssetLoadPathType.SleeveTextureBasePath, isfetch: true)) as Texture; - } - material.SetTexture("_AOREFSPEC", value); - material.SetTexture("_BumpMap", value3); - material.SetFloat("_SpecPow", value2); - cp.SpecularMaterial = material; - } - if (loadKind != LOAD_KIND.SELECT_DATA) - { - cp.BaseTexBase = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial, isfetch: true)); - cp.BaseTexBase.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture, isfetch: true)); - if (Data.Master.SleeveMgr.Get(SleeveId).IsPremiumSleeve) - { - Texture value4 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(SleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTextureMask, isfetch: true)); - cp.BaseTexBase.SetTexture("_MaskTex", value4); - } - cp.BaseTexBase.shader = Shader.Find(cp.BaseTexBase.shader.name); - DeckBaseTexBase = cp.BaseTexBase; - } - else - { - cp.BaseTexBase = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(3000011.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial, isfetch: true)); - cp.BaseTexBase.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(3000011.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture, isfetch: true)); - cp.BaseTexBase.shader = Shader.Find(cp.BaseTexBase.shader.name); - } - cp.m_CardBase.layer = scene_layer; - cp.m_CardBase.name = "CardBase"; - cp.UnitGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Unit", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)); - cp.UnitSpecGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("SpecularUnit", ResourcesManager.AssetLoadPathType.HandCardSpecular, isfetch: true)); - cp.UnitSpecGameObj.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_specular", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - cp.UnitGameObj.layer = scene_layer; - cp.SpellGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Spell", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)); - cp.SpellSpecGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("SpecularSpell", ResourcesManager.AssetLoadPathType.HandCardSpecular, isfetch: true)); - cp.SpellSpecGameObj.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_specular", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - cp.SpellGameObj.layer = scene_layer; - cp.FieldGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("Field", ResourcesManager.AssetLoadPathType.HandCard, isfetch: true)); - cp.FieldSpecGameObj = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("SpecularField", ResourcesManager.AssetLoadPathType.HandCardSpecular, isfetch: true)); - cp.FieldSpecGameObj.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_specular", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - cp.FieldGameObj.layer = scene_layer; - SetCardPrefab(cp); - isReadyTemplate = true; - } - - private int ClearAndGetCount(CardBasePrm.ClanType clantype, bool own) - { - int result = 0; - if (loadKind == LOAD_KIND.SELECT_DATA || loadKind == LOAD_KIND.SELECT_DATA_GACHA) - { - SelectCardListObjs = new List(); - result = loadSelectIds.Count; - } - else if (loadKind == LOAD_KIND.MYPAGE_HOME_CUSTOM_DECK || loadKind == LOAD_KIND.MYPAGE_HOME_DEFAULT_DECK_DATA) - { - result = _myPageHomeDeck.GetCardIdList().Count; - } - return result; - } - - private IEnumerator CreateDeckData(int scene_layer, bool is2D, CardMaster.CardMasterId cardMasterId, CardBasePrm.ClanType clantype = CardBasePrm.ClanType.NONE, bool own = false, Action onFinish = null) - { - CardPrefabs cp = null; - if (!is2D) - { - yield return StartCoroutine(Load3D(scene_layer, delegate(CardPrefabs v) - { - cp = v; - })); - } - else - { - if (CardList2DDict == null) - { - CardList2DDict = new Dictionary(); - } - else - { - CardList2DDict.Clear(); - } - yield return StartCoroutine(Load2D(scene_layer, delegate(CardPrefabs v) - { - cp = v; - })); - } - while (!isAssetAllReady || !isReadyTemplate) - { - yield return null; - } - CardListObjs = new List(); - CardList2DObjs = new List(); - int num = ClearAndGetCount(clantype, own); - for (int num2 = 0; num2 < num; num2++) - { - AddCardResult addCardResult = createCard(num2, is2D, clantype, scene_layer, own, cp, cardMasterId); - if (addCardResult != AddCardResult.NOT_ADDED && addCardResult == AddCardResult.END) - { - break; - } - } - UIManager.GetInstance().LoadingViewManager.UpdateLoadingNum(100); - CreateEndFlag = true; - onFinish?.Invoke(); - } - - private bool getCardBaseStatus(int cardIndex, CardMaster.CardMasterId cardMasterId, ref CardParameter baseStatus) - { - Func func = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId; - if (loadKind == LOAD_KIND.SELECT_DATA || loadKind == LOAD_KIND.SELECT_DATA_GACHA) - { - baseStatus = func(loadSelectIds[cardIndex]); - } - else if (loadKind == LOAD_KIND.MYPAGE_HOME_CUSTOM_DECK || loadKind == LOAD_KIND.MYPAGE_HOME_DEFAULT_DECK_DATA) - { - int arg = _myPageHomeDeck.GetCardIdList()[cardIndex]; - baseStatus = func(arg); - } - return true; - } - - private AddCardResult createCard(int cardIndex, bool is2D, CardBasePrm.ClanType clantype, int scene_layer, bool own, CardPrefabs cp, CardMaster.CardMasterId cardMasterId) - { - CardObjData cardObjData = new CardObjData(); - CardParameter baseStatus = null; - if (!getCardBaseStatus(cardIndex, cardMasterId, ref baseStatus)) - { - return AddCardResult.END; - } - CardBasePrm.CharaType charaType = (cardObjData.cardType = baseStatus.CharType); - if (charaType == CardBasePrm.CharaType.CLASS) - { - return AddCardResult.ADDED; - } - if (DetailBasePrmList == null) - { - DetailBasePrmList = new Dictionary(); - } - if (!DetailBasePrmList.ContainsKey(baseStatus.ResourceCardId)) - { - DetailBasePrmList.Add(baseStatus.ResourceCardId, baseStatus); - } - if (charaType != CardBasePrm.CharaType.SPELL && charaType != CardBasePrm.CharaType.FIELD && charaType != CardBasePrm.CharaType.CHANT_FIELD) - { - cardObjData.Evo_lifes = baseStatus.EvoLife.ToString(); - cardObjData.Evo_Atks = baseStatus.EvoAtk.ToString(); - cardObjData.Evo_Costs = baseStatus.Cost.ToString(); - cardObjData.Evo_Names = baseStatus.CardName; - cardObjData.Evo_Skills = baseStatus.EvoSkillDescription; - cardObjData.Skills = baseStatus.SkillDescription; - cardObjData.EvolOk = true; - } - else - { - cardObjData.Skills = baseStatus.SkillDescription; - cardObjData.EvolOk = false; - } - cardObjData.lifes = baseStatus.Life.ToString(); - cardObjData.LifesNum = baseStatus.Life; - cardObjData.Atks = baseStatus.Atk.ToString(); - cardObjData.AtksNum = baseStatus.Atk; - cardObjData.Names = baseStatus.CardName; - cardObjData.Cost = baseStatus.Cost.ToString(); - cardObjData.CostNum = baseStatus.Cost; - cardObjData.clan = baseStatus.Clan; - cardObjData.tribe = baseStatus.Tribe; - cardObjData.isPremiere = baseStatus.IsFoil; - cardObjData.ids = baseStatus.CardId; - string text = baseStatus.ResourceCardId.ToString(); - int cardId = (cardObjData.ids = baseStatus.CardId); - cardObjData.mainCardNum = 1; - GameObject gameObject = null; - if (!(text == "")) - { - gameObject = ((!is2D) ? createNot2DCard(baseStatus, text, cp, scene_layer) : create2DCard(baseStatus, text, cp)); - } - if (scene_layer != 0) - { - gameObject.layer = scene_layer; - } - CharIdx charIdx = gameObject.AddComponent(); - charIdx.SetIdx(loadCnt); - charIdx.SetCardId(cardId); - if (is2D) - { - CardSetUp2D(gameObject, baseStatus, cardObjData, cardIndex); - } - else - { - CardSetUp3D(gameObject, baseStatus, scene_layer, cardIndex, cp, cardObjData); - } - loadCnt++; - return AddCardResult.ADDED; - } - - private void CardSetUp2D(GameObject GameObj, CardParameter cardParameter, CardObjData cardObjData, int cardIndex) - { - CardListTemplate component = GameObj.GetComponent(); - CardBasePrm.CharaType charType = cardParameter.CharType; - UILabel nameLabel = component._nameLabel; - nameLabel.text = cardParameter.CardName; - SetNameLabelStyle(nameLabel, cardParameter.IsFoil); - Global.SetRepositionNameLabel(nameLabel, cardParameter.CardName, is2D: true); - component.RotationOnlyIconVisible = cardParameter.IsResurgentCard; - if (GameMgr.GetIns().GetDataMgr().IsNewCard(cardParameter.CardId)) - { - component._newLabel.gameObject.SetActive(value: true); - } - else - { - component._newLabel.gameObject.SetActive(value: false); - } - if (charType == CardBasePrm.CharaType.NORMAL) - { - component._atkLabel.text = cardParameter.Atk.ToString(); - component._lifeLabel.text = cardParameter.Life.ToString(); - SetNumberLabelStyle(component._atkLabel, cardParameter.IsFoil); - SetNumberLabelStyle(component._lifeLabel, cardParameter.IsFoil); - } - component._costLabel.text = cardParameter.Cost.ToString(); - SetNumberLabelStyle(component._costLabel, cardParameter.IsFoil); - cardObjData.CardObj = GameObj; - CardList2DObjs.Add(cardObjData); - cardObjData.CardObj.name = loadKind.ToString() + " " + cardIndex; - } - - private void CardSetUp3D(GameObject GameObj, CardParameter cardParameter, int scene_layer, int cardIndex, CardPrefabs cp, CardObjData cardObjData) - { - CardBasePrm.CharaType charType = cardParameter.CharType; - GameObject obj = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(cp.m_CostIcon); - obj.transform.parent = GameObj.transform; - int cost = cardParameter.Cost; - UILabel component = obj.transform.Find("CostLabel").GetComponent(); - component.text = cost.ToString(); - obj.SetActive(value: true); - obj.transform.localPosition = Global.POSITION_COST_ICON; - obj.transform.localScale = Global.SCALE_CARD_ICON; - if (cardParameter.IsResurgentCard) - { - GameObject obj2 = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(cp.RotationOnlyIcon); - obj2.transform.parent = GameObj.transform; - obj2.transform.localPosition = Vector3.zero; - obj2.transform.localScale = Vector3.one; - obj2.name = "RotationOnlyIcon"; - } - SetNumberLabelStyle(component, cardParameter.IsFoil); - obj.gameObject.layer = scene_layer; - m_DCardList.Add(GameObj); - GameObj.gameObject.name = cardIndex.ToString(); - GameObj.layer = scene_layer; - GameObject gameObject = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab(cp.m_CardBase); - gameObject.name = "CardBase"; - gameObject.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_md_Card", ResourcesManager.AssetLoadPathType.SleeveMesh, isfetch: true)); - MeshRenderer component2 = gameObject.GetComponent(); - component2.sharedMaterial = cp.BaseTexBase; - component2.sharedMaterial.SetFloat("_CullMode", 2f); - component2.sharedMaterial.SetFloat("_ZWriteMode", 1f); - gameObject.transform.parent = GameObj.transform; - gameObject.transform.localPosition = new Vector3(Global.CARD_BASE_POS.x, Global.CARD_BASE_POS.y, Global.CARD_BASE_POS.z); - gameObject.transform.localRotation = Quaternion.Euler(Global.CARD_BASE_ROT.x, Global.CARD_BASE_ROT.y, Global.CARD_BASE_ROT.z); - gameObject.transform.localScale = new Vector3(1f, 1f, 1f); - Transform transform = gameObject.transform.Find("CardBase_Specular"); - transform.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_md_Card", ResourcesManager.AssetLoadPathType.SleeveMesh, isfetch: true)); - if (cp.SpecularMaterial != null) - { - transform.GetComponent().sharedMaterial = cp.SpecularMaterial; - } - GameObj.tag = "Card"; - GameObj.layer = scene_layer; - GameObj.transform.localScale = DetailScale; - GameObj.AddComponent(); - TweenScale tweenScale = GameObj.AddComponent(); - m_CardList.Add(GameObj.GetComponent()); - tweenScale.from = NormalScale; - tweenScale.to = ZoomedScale; - tweenScale.duration = 0.2f; - tweenScale.enabled = false; - GameObj.transform.parent = ScrollViewHorGrid; - GameObj.gameObject.SetActive(value: false); - if (charType != CardBasePrm.CharaType.SPELL && charType != CardBasePrm.CharaType.FIELD && charType != CardBasePrm.CharaType.CHANT_FIELD) - { - GameObject gameObject2 = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(cp.m_LifeIcon); - UILabel component3 = gameObject2.transform.Find("LifeLabel").GetComponent(); - gameObject2.transform.parent = GameObj.transform; - component3.text = cardParameter.Life.ToString(); - gameObject2.transform.localPosition = Global.POSITION_LIFE_ICON; - SetNumberLabelStyle(component3, cardParameter.IsFoil); - GameObject gameObject3 = GameMgr.GetIns().GetGameObjMgr().AddUIManagerChildPrefab(cp.m_AtkIcon); - UILabel component4 = gameObject3.transform.Find("AtkLabel").GetComponent(); - gameObject3.transform.parent = GameObj.transform; - component4.text = cardParameter.Atk.ToString(); - gameObject3.transform.localPosition = Global.POSITION_ATK_ICON; - SetNumberLabelStyle(component4, cardParameter.IsFoil); - Transform obj3 = gameObject2.transform; - Vector3 localScale = (gameObject3.transform.localScale = Global.SCALE_CARD_ICON); - obj3.localScale = localScale; - if (scene_layer != 0) - { - gameObject3.layer = scene_layer; - gameObject2.layer = scene_layer; - } - gameObject3.SetActive(value: true); - gameObject2.SetActive(value: true); - } - GameObject gameObject4 = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab(cp.m_NameIcon); - gameObject4.transform.parent = GameObj.transform; - UILabel component5 = gameObject4.transform.Find("NameLabel").GetComponent(); - component5.text = cardParameter.CardName; - SetNameLabelStyle(component5, cardParameter.IsFoil); - Global.SetRepositionNameLabel(component5, cardParameter.CardName, is2D: false); - gameObject4.transform.localScale = Global.SCALE_NAME_TEXT; - gameObject4.transform.localPosition = Global.POSITION_NAME_TEXT; - if (scene_layer != 0) - { - gameObject4.layer = scene_layer; - gameObject.layer = scene_layer; - } - cardObjData.CardObj = GameObj; - if (loadKind == LOAD_KIND.SELECT_DATA || loadKind == LOAD_KIND.SELECT_DATA_GACHA) - { - SelectCardListObjs.Add(cardObjData); - } - else - { - CardListObjs.Add(cardObjData); - } - } - - private GameObject create2DCard(CardParameter prm, string PrefabPath, CardPrefabs cp) - { - GameObject gameObject = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab((prm.CharType == CardBasePrm.CharaType.NORMAL) ? cp.UnitGameObj : cp.SpellGameObj); - Material material = Get2dCardMaterial(prm); - if (material != null) - { - material.shader = Shader.Find(material.shader.name); - } - SetCardTexture(gameObject, material, prm); - return gameObject; - } - public static Material Get2dCardMaterial(CardParameter param) { ResourcesManager.AssetLoadPathType type; @@ -1573,184 +716,6 @@ public class UIBase_CardManager : MonoBehaviour return Toolbox.ResourcesManager.FindCardMaterial(param.ResourceCardId, type); } - private void SetCardTexture(GameObject GameObj, Material material, CardParameter prm) - { - CardListTemplate component = GameObj.GetComponent(); - component._cardTexture.material = material; - component._cardTexture.uvRect = Global.CARD_2D_UV_RECT; - component.SetFrame(prm); - SetupClassIcon(component, prm); - } - - private void SetupClassIcon(CardListTemplate obj, CardParameter prm) - { - obj._classIconTexture.mainTexture = ClassCharaPrm.GetClassIconTexture((int)prm.Clan); - } - - private GameObject createNot2DCard(CardParameter prm, string PrefabPath, CardPrefabs cp, int scene_layer) - { - GameObject gameObject = null; - ResourcesManager.AssetLoadPathType type = ResourcesManager.AssetLoadPathType.SpellCardMaterial; - Mesh mesh = null; - Mesh mesh2 = null; - MeshFilter[] componentsInChildren; - if (prm.CharType == CardBasePrm.CharaType.SPELL) - { - gameObject = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab(cp.SpellGameObj); - gameObject.name = "Spell"; - NGUITools.AddChild(gameObject, cp.SpellSpecGameObj).name = "SpecularSpell"; - componentsInChildren = gameObject.GetComponentsInChildren(); - mesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - mesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_spell_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - if (CardMaster.IsMutationCardCheck(prm.BaseCardId)) - { - type = ResourcesManager.AssetLoadPathType.UnitCardMaterial; - } - } - else - { - if (prm.CharType != CardBasePrm.CharaType.FIELD && prm.CharType != CardBasePrm.CharaType.CHANT_FIELD) - { - return create3DFollowerCard(prm, cp, scene_layer); - } - gameObject = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab(cp.FieldGameObj); - gameObject.name = "Field"; - NGUITools.AddChild(gameObject, cp.FieldSpecGameObj).name = "SpecularField"; - componentsInChildren = gameObject.GetComponentsInChildren(); - mesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - mesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_field_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - if (CardMaster.IsMutationCardCheck(prm.BaseCardId)) - { - type = ResourcesManager.AssetLoadPathType.UnitCardMaterial; - } - } - componentsInChildren[0].sharedMesh = mesh; - componentsInChildren[1].sharedMesh = mesh2; - Transform obj = componentsInChildren[0].transform; - Quaternion rotation = (componentsInChildren[1].transform.rotation = Quaternion.Euler(componentsInChildren[0].transform.rotation.x, componentsInChildren[0].transform.rotation.y + 180f, componentsInChildren[0].transform.rotation.z)); - obj.rotation = rotation; - gameObject.transform.localScale = new Vector3(gameObject.transform.localScale.x, gameObject.transform.localScale.y, 1f); - Material material = Toolbox.ResourcesManager.FindCardMaterial(prm.ResourceCardId, type); - if (material != null) - { - CardShaderDefine.ReplaceBaseShader(material, prm.IsFoil); - } - Material[] sharedMaterials = new Material[3] - { - _3dCardFrameManager.GetFrameMaterial(prm.IsPhantomCard, prm.CharType, prm.Rarity), - material, - CardCreatorBase.GetSharedClassIconMaterial(prm.Clan) - }; - LOD[] lODs = gameObject.GetComponent().GetLODs(); - for (int i = 0; i < lODs.Length; i++) - { - lODs[i].renderers[0].sharedMaterials = sharedMaterials; - } - UIManager.GetInstance().SetLayerRecursive(gameObject.transform, scene_layer); - return gameObject; - } - - private GameObject create3DFollowerCard(CardParameter prm, CardPrefabs cp, int scene_layer) - { - GameObject gameObject = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab(cp.UnitGameObj); - gameObject.name = "Unit"; - NGUITools.AddChild(gameObject, cp.UnitSpecGameObj).name = "SpecularUnit"; - Material material = Toolbox.ResourcesManager.FindCardMaterial(prm.ResourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial); - Material material2 = Toolbox.ResourcesManager.FindCardMaterial(prm.ResourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial, isEvol: true); - if (material != null && material2 != null) - { - CardShaderDefine.ReplaceBaseShader(material, prm.IsFoil); - CardShaderDefine.ReplaceBaseShader(material2, prm.IsFoil); - } - gameObject.transform.localScale = new Vector3(gameObject.transform.localScale.x, gameObject.transform.localScale.y, 1f); - MeshFilter[] componentsInChildren = gameObject.GetComponentsInChildren(); - Mesh sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - Mesh sharedMesh2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_card_unit_low", ResourcesManager.AssetLoadPathType.CardFrameMesh, isfetch: true)); - componentsInChildren[0].sharedMesh = sharedMesh; - componentsInChildren[1].sharedMesh = sharedMesh2; - Transform obj = componentsInChildren[0].transform; - Quaternion rotation = (componentsInChildren[1].transform.rotation = Quaternion.Euler(componentsInChildren[0].transform.rotation.x, componentsInChildren[0].transform.rotation.y + 180f, componentsInChildren[0].transform.rotation.z)); - obj.rotation = rotation; - Material[] sharedMaterials = new Material[3] - { - _3dCardFrameManager.GetFrameMaterial(prm.IsPhantomCard, prm.CharType, prm.Rarity), - material, - CardCreatorBase.GetSharedClassIconMaterial(prm.Clan) - }; - LOD[] lODs = gameObject.GetComponent().GetLODs(); - for (int i = 0; i < lODs.Length; i++) - { - lODs[i].renderers[0].sharedMaterials = sharedMaterials; - } - UIManager.GetInstance().SetLayerRecursive(gameObject.transform, scene_layer); - return gameObject; - } - - public List getCardListObjs() - { - return CardListObjs; - } - - public List getCardList2DObjs() - { - return CardList2DObjs; - } - - public List getAllCardList2DObjs() - { - return AllCardList2DObjs; - } - - public List getSelectedCardList2DObjs() - { - return SelectedCardList2DObjs; - } - - public IList getSelectedCardIDList() - { - return SelectedCardIDList; - } - - public List getSelectCardListObjs() - { - return SelectCardListObjs; - } - - public Material GetUIBaseSleeveTexture() - { - if (DeckBaseTexBase == null) - { - DeckBaseTexBase = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(3000011.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial, isfetch: true)); - } - return DeckBaseTexBase; - } - - public IEnumerator LoadResident() - { - _loadList.AddRange(_3dCardFrameManager.GetCommonLoadAssetList()); - _loadList.AddRange(_3dCardFrameManager.GetLoadAssetList(_3dCardFrameManager.eFrameKind.Normal)); - _loadList.AddRange(GetAddUnitPathList()); - _loadList.AddRange(GetAddSpellPathList()); - _loadList.AddRange(GetAddFieldPathList()); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath("CardFrameClassIcon", ResourcesManager.AssetLoadPathType.CardFrameMaterialPlus)); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_CardBase", ResourcesManager.AssetLoadPathType.CardDeco)); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_md_Card", ResourcesManager.AssetLoadPathType.SleeveMesh)); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_cardbase_d", ResourcesManager.AssetLoadPathType.SleeveSpecular)); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath("foiltextures", ResourcesManager.AssetLoadPathType.FoilTextures)); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath(3000011.ToString(), ResourcesManager.AssetLoadPathType.SleeveMaterial)); - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath(3000011.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - for (int i = 0; i < 9; i++) - { - _loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath("class_card_" + i.ToString("00"), ResourcesManager.AssetLoadPathType.CardFrameClassIcon)); - } - _loadList.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame)); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(_loadList, delegate - { - UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.CardFrame); - _3dCardFrameManager.InitFrameMaterials(_3dCardFrameManager.eFrameKind.Normal); - })); - } - public void SetNumberLabelStyle(UILabel inLabel, bool inIsPremiere) { UIFont bitmapFont; @@ -1852,14 +817,6 @@ public class UIBase_CardManager : MonoBehaviour } } - public void ClearKeyWordCache() - { - _keyWordCache = null; - _cardNameKeyWordCache = null; - _cardNameKeyWordHiraganaCache = null; - _keyWordCommonCache = null; - } - public IList GetKeyword(CardParameter param) { if (_keyWordCommonCache != null) diff --git a/SVSim.BattleEngine/Engine/UIBase_Textuer.cs b/SVSim.BattleEngine/Engine/UIBase_Textuer.cs index bedba8f8..fcf4657f 100644 --- a/SVSim.BattleEngine/Engine/UIBase_Textuer.cs +++ b/SVSim.BattleEngine/Engine/UIBase_Textuer.cs @@ -3,6 +3,4 @@ using UnityEngine; public class UIBase_Textuer : MonoBehaviour { public string TextuerName = ""; - - public UITexture texObj; } diff --git a/SVSim.BattleEngine/Engine/UIBasicSprite.cs b/SVSim.BattleEngine/Engine/UIBasicSprite.cs index a5eb0a4a..a35f0074 100644 --- a/SVSim.BattleEngine/Engine/UIBasicSprite.cs +++ b/SVSim.BattleEngine/Engine/UIBasicSprite.cs @@ -30,7 +30,6 @@ public abstract class UIBasicSprite : UIWidget public enum Flip { - Nothing, Horizontally, Vertically, Both @@ -93,22 +92,6 @@ public abstract class UIBasicSprite : UIWidget } } - public Flip flip - { - get - { - return mFlip; - } - set - { - if (mFlip != value) - { - mFlip = value; - MarkAsChanged(); - } - } - } - public FillDirection fillDirection { get diff --git a/SVSim.BattleEngine/Engine/UIButton.cs b/SVSim.BattleEngine/Engine/UIButton.cs index 03860523..1a20a436 100644 --- a/SVSim.BattleEngine/Engine/UIButton.cs +++ b/SVSim.BattleEngine/Engine/UIButton.cs @@ -122,37 +122,6 @@ public class UIButton : UIButtonColor } } - public Sprite normalSprite2D - { - get - { - if (!mInitDone) - { - OnInit(); - } - return mNormalSprite2D; - } - set - { - if (!mInitDone) - { - OnInit(); - } - if (mSprite2D != null && mNormalSprite2D == mSprite2D.sprite2D) - { - mNormalSprite2D = value; - SetSprite(value); - NGUITools.SetDirty(mSprite); - return; - } - mNormalSprite2D = value; - if (mState == State.Normal) - { - SetSprite(value); - } - } - } - protected override void OnInit() { base.OnInit(); @@ -199,16 +168,6 @@ public class UIButton : UIButtonColor } } - protected virtual void OnClick() - { - if (current == null && isEnabled) - { - current = this; - EventDelegate.Execute(onClick); - current = null; - } - } - public override void SetState(State state, bool immediate) { base.SetState(state, immediate); diff --git a/SVSim.BattleEngine/Engine/UIButtonColor.cs b/SVSim.BattleEngine/Engine/UIButtonColor.cs index 00681426..48cedc7f 100644 --- a/SVSim.BattleEngine/Engine/UIButtonColor.cs +++ b/SVSim.BattleEngine/Engine/UIButtonColor.cs @@ -85,31 +85,6 @@ public class UIButtonColor : UIWidgetContainer } } - public void ResetDefaultColor() - { - defaultColor = mStartingColor; - } - - public void CacheDefaultColor() - { - if (!mInitDone) - { - OnInit(); - } - } - - private void Start() - { - if (!mInitDone) - { - OnInit(); - } - if (!isEnabled) - { - SetState(State.Disabled, instant: true); - } - } - protected virtual void OnInit() { mInitDone = true; @@ -172,20 +147,6 @@ public class UIButtonColor : UIWidgetContainer } } - protected virtual void OnDisable() - { - if (mInitDone && tweenTarget != null) - { - SetState(State.Normal, instant: true); - TweenColor component = tweenTarget.GetComponent(); - if (component != null) - { - component.value = mDefaultColor; - component.enabled = false; - } - } - } - protected virtual void OnHover(bool isOver) { if (isEnabled) diff --git a/SVSim.BattleEngine/Engine/UIButtonExtension.cs b/SVSim.BattleEngine/Engine/UIButtonExtension.cs deleted file mode 100644 index 596c56eb..00000000 --- a/SVSim.BattleEngine/Engine/UIButtonExtension.cs +++ /dev/null @@ -1,20 +0,0 @@ -public static class UIButtonExtension -{ - public static void CopyButtonParameters(this UIButton dst, UIButton src) - { - dst.tweenTarget = src.tweenTarget; - dst.hover = src.hover; - dst.pressed = src.pressed; - dst.disabledColor = src.disabledColor; - dst.duration = src.duration; - dst.dragHighlight = src.dragHighlight; - dst.hoverSprite = src.hoverSprite; - dst.pressedSprite = src.pressedSprite; - dst.disabledSprite = src.disabledSprite; - dst.hoverSprite2D = src.hoverSprite2D; - dst.pressedSprite2D = src.pressedSprite2D; - dst.disabledSprite2D = src.disabledSprite2D; - dst.pixelSnap = src.pixelSnap; - dst.onClick = src.onClick; - } -} diff --git a/SVSim.BattleEngine/Engine/UICamera.cs b/SVSim.BattleEngine/Engine/UICamera.cs index 86a61199..9cb89fa7 100644 --- a/SVSim.BattleEngine/Engine/UICamera.cs +++ b/SVSim.BattleEngine/Engine/UICamera.cs @@ -17,24 +17,17 @@ public class UICamera : MonoBehaviour public enum ClickNotification { None, - Always, - BasedOnDelta - } + Always } public class MouseOrTouch { - public KeyCode key; public Vector2 pos; public Vector2 lastPos; - public Vector2 delta; - public Vector2 totalDelta; - public Camera pressedCam; - public GameObject last; public GameObject current; @@ -43,42 +36,15 @@ public class UICamera : MonoBehaviour public GameObject dragged; - public float pressTime; - - public float clickTime; - public ClickNotification clickNotification = ClickNotification.Always; - public bool touchBegan = true; - - public bool pressStarted; - public bool dragStarted; - - public int ignoreDelta; - - public float deltaTime => RealTime.time - pressTime; - - public bool isOverUI - { - get - { - if (current != null && current != fallThrough) - { - return NGUITools.FindInParents(current) != null; - } - return false; - } - } } public enum EventType { World_3D, - UI_3D, - World_2D, - UI_2D - } + UI_3D } public delegate bool GetKeyStateFunc(KeyCode key); @@ -108,9 +74,6 @@ public class UICamera : MonoBehaviour public struct DepthEntry { - public int depth; - - public RaycastHit hit; public Vector3 point; @@ -119,13 +82,8 @@ public class UICamera : MonoBehaviour public class Touch { - public int fingerId; - - public TouchPhase phase; public Vector2 position; - - public int tapCount; } public delegate int GetTouchCountCallback(); @@ -140,59 +98,18 @@ public class UICamera : MonoBehaviour public static GetKeyStateFunc GetKey = Input.GetKey; - public static GetAxisFunc GetAxis = Input.GetAxis; - - public static GetAnyKeyFunc GetAnyKeyDown; - public static OnScreenResize onScreenResize; public EventType eventType = EventType.UI_3D; - public bool eventsGoToColliders; - - public LayerMask eventReceiverMask = -1; - - public bool debug; - public bool useMouse = true; public bool useTouch = true; - public bool allowMultiTouch = true; - public bool useKeyboard = true; public bool useController = true; - public bool stickyTooltip = true; - - public float tooltipDelay = 1f; - - public bool longPressTooltip; - - public float mouseDragThreshold = 4f; - - public float mouseClickThreshold = 10f; - - public float touchDragThreshold = 40f; - - public float touchClickThreshold = 40f; - - public float rangeDistance = -1f; - - public string horizontalAxisName = "Horizontal"; - - public string verticalAxisName = "Vertical"; - - public string horizontalPanAxisName; - - public string verticalPanAxisName; - - public string scrollAxisName = "Mouse ScrollWheel"; - - [NonSerialized] - public bool commandClick; - public KeyCode submitKey0 = KeyCode.Return; public KeyCode submitKey1 = KeyCode.JoystickButton0; @@ -201,14 +118,6 @@ public class UICamera : MonoBehaviour public KeyCode cancelKey1 = KeyCode.JoystickButton1; - public bool autoHideCursor = true; - - public static OnCustomInput onCustomInput; - - public static bool showTooltips = true; - - private static bool mDisableController = false; - private static Vector2 mLastPos = Vector2.zero; public static Vector3 lastWorldPosition = Vector3.zero; @@ -227,52 +136,18 @@ public class UICamera : MonoBehaviour private static KeyCode mCurrentKey = KeyCode.Alpha0; - private const int MOUSE_BUTTONS = 2; - public static MouseOrTouch currentTouch = null; - private GameObject _lastClickedObjectToCheckForDoubleClick; - private static bool mInputFocus = false; private static GameObject mGenericHandler; - public static GameObject fallThrough; - - public static VoidDelegate onClick; - - public static VoidDelegate onDoubleClick; - public static BoolDelegate onHover; - public static BoolDelegate onPress; - public static BoolDelegate onSelect; - public static FloatDelegate onScroll; - - public static VectorDelegate onDrag; - - public static VoidDelegate onDragStart; - - public static ObjectDelegate onDragOver; - - public static ObjectDelegate onDragOut; - - public static VoidDelegate onDragEnd; - - public static ObjectDelegate onDrop; - - public static KeyCodeDelegate onKey; - - public static KeyCodeDelegate onNavigate; - - public static VectorDelegate onPan; - public static BoolDelegate onTooltip; - public static MoveDelegate onMouseMove; - private static MouseOrTouch[] mMouse = new MouseOrTouch[3] { new MouseOrTouch(), @@ -284,8 +159,6 @@ public class UICamera : MonoBehaviour public static List activeTouches = new List(); - private static List mTouchIDs = new List(); - private static int mWidth = 0; private static int mHeight = 0; @@ -296,66 +169,14 @@ public class UICamera : MonoBehaviour private static float mTooltipTime = 0f; - private float mNextRaycast; - - public static bool isDragging = false; - - private static GameObject mRayHitObject; - private static GameObject mHover; private static GameObject mSelected; - private static DepthEntry mHit = default(DepthEntry); - private static BetterList mHits = new BetterList(); - private static Plane m2DPlane = new Plane(Vector3.back, 0f); - - private static float mNextEvent = 0f; - private static int mNotifying = 0; - private static bool disableControllerCheck = true; - - private static bool mUsingTouchEvents = true; - - public static GetTouchCountCallback GetInputTouchCount; - - public static GetTouchCallback GetInputTouch; - - [Obsolete("Use new OnDragStart / OnDragOver / OnDragOut / OnDragEnd events instead")] - public bool stickyPress => true; - - public static bool disableController - { - get - { - if (mDisableController) - { - return !UIPopupList.isOpen; - } - return false; - } - set - { - mDisableController = value; - } - } - - [Obsolete("Use lastEventPosition instead. It handles controller input properly.")] - public static Vector2 lastTouchPosition - { - get - { - return mLastPos; - } - set - { - mLastPos = value; - } - } - public static Vector2 lastEventPosition { get @@ -377,18 +198,6 @@ public class UICamera : MonoBehaviour } } - public static UICamera first - { - get - { - if (list == null || list.size == 0) - { - return null; - } - return list[0]; - } - } - public static ControlScheme currentScheme { get @@ -471,37 +280,6 @@ public class UICamera : MonoBehaviour } } - public static bool inputHasFocus - { - get - { - if (mInputFocus) - { - if ((bool)mSelected && mSelected.activeInHierarchy) - { - return true; - } - mInputFocus = false; - } - return false; - } - } - - [Obsolete("Use delegates instead such as UICamera.onClick, UICamera.onHover, etc.")] - public static GameObject genericEventHandler - { - get - { - return mGenericHandler; - } - set - { - mGenericHandler = value; - } - } - - private bool handlesEvents => eventHandler == this; - public Camera cachedCamera { get @@ -514,37 +292,6 @@ public class UICamera : MonoBehaviour } } - public static GameObject tooltipObject => mTooltip; - - public static bool isOverUI - { - get - { - if (currentTouch != null) - { - return currentTouch.isOverUI; - } - int i = 0; - for (int count = activeTouches.Count; i < count; i++) - { - MouseOrTouch mouseOrTouch = activeTouches[i]; - if (mouseOrTouch.pressed != null && mouseOrTouch.pressed != fallThrough && NGUITools.FindInParents(mouseOrTouch.pressed) != null) - { - return true; - } - } - if (mMouse[0].current != null && mMouse[0].current != fallThrough && NGUITools.FindInParents(mMouse[0].current) != null) - { - return true; - } - if (controller.pressed != null && controller.pressed != fallThrough && NGUITools.FindInParents(controller.pressed) != null) - { - return true; - } - return false; - } - } - public static GameObject hoveredObject { get @@ -625,58 +372,6 @@ public class UICamera : MonoBehaviour } } - public static GameObject controllerNavigationObject - { - get - { - if ((bool)controller.current && controller.current.activeInHierarchy) - { - return controller.current; - } - if (currentScheme == ControlScheme.Controller && current != null && current.useController && UIKeyNavigation.list.size > 0) - { - for (int i = 0; i < UIKeyNavigation.list.size; i++) - { - UIKeyNavigation uIKeyNavigation = UIKeyNavigation.list[i]; - if ((bool)uIKeyNavigation && uIKeyNavigation.constraint != UIKeyNavigation.Constraint.Explicit && uIKeyNavigation.startsSelected) - { - hoveredObject = uIKeyNavigation.gameObject; - controller.current = mHover; - return mHover; - } - } - if (mHover == null) - { - for (int j = 0; j < UIKeyNavigation.list.size; j++) - { - UIKeyNavigation uIKeyNavigation2 = UIKeyNavigation.list[j]; - if ((bool)uIKeyNavigation2 && uIKeyNavigation2.constraint != UIKeyNavigation.Constraint.Explicit) - { - hoveredObject = uIKeyNavigation2.gameObject; - controller.current = mHover; - return mHover; - } - } - } - } - controller.current = null; - return null; - } - set - { - if (controller.current != value && (bool)controller.current) - { - Notify(controller.current, "OnHover", false); - if (onHover != null) - { - onHover(controller.current, state: false); - } - controller.current = null; - } - hoveredObject = value; - } - } - public static GameObject selectedObject { get @@ -748,66 +443,6 @@ public class UICamera : MonoBehaviour } } - [Obsolete("Use either 'CountInputSources()' or 'activeTouches.Count'")] - public static int touchCount => CountInputSources(); - - public static int dragCount - { - get - { - int num = 0; - int i = 0; - for (int count = activeTouches.Count; i < count; i++) - { - if (activeTouches[i].dragged != null) - { - num++; - } - } - for (int j = 0; j < mMouse.Length; j++) - { - if (mMouse[j].dragged != null) - { - num++; - } - } - if (controller.dragged != null) - { - num++; - } - return num; - } - } - - public static Camera mainCamera - { - get - { - UICamera uICamera = eventHandler; - if (!(uICamera != null)) - { - return null; - } - return uICamera.cachedCamera; - } - } - - public static UICamera eventHandler - { - get - { - for (int i = 0; i < list.size; i++) - { - UICamera uICamera = list.buffer[i]; - if (!(uICamera == null) && uICamera.enabled && NGUITools.GetActive(uICamera.gameObject)) - { - return uICamera; - } - } - return null; - } - } - public static bool IsPressed(GameObject go) { for (int i = 0; i < 3; i++) @@ -832,350 +467,11 @@ public class UICamera : MonoBehaviour return false; } - public static int CountInputSources() - { - int num = 0; - int i = 0; - for (int count = activeTouches.Count; i < count; i++) - { - if (activeTouches[i].pressed != null) - { - num++; - } - } - for (int j = 0; j < mMouse.Length; j++) - { - if (mMouse[j].pressed != null) - { - num++; - } - } - if (controller.pressed != null) - { - num++; - } - return num; - } - - private static int CompareFunc(UICamera a, UICamera b) - { - if (a.cachedCamera.depth < b.cachedCamera.depth) - { - return 1; - } - if (a.cachedCamera.depth > b.cachedCamera.depth) - { - return -1; - } - return 0; - } - public static BetterList GetHitsList() { return mHits; } - private static Rigidbody FindRootRigidbody(Transform trans) - { - while (trans != null) - { - if (trans.GetComponent() != null) - { - return null; - } - Rigidbody component = trans.GetComponent(); - if (component != null) - { - return component; - } - trans = trans.parent; - } - return null; - } - - private static Rigidbody2D FindRootRigidbody2D(Transform trans) - { - while (trans != null) - { - if (trans.GetComponent() != null) - { - return null; - } - Rigidbody2D component = trans.GetComponent(); - if (component != null) - { - return component; - } - trans = trans.parent; - } - return null; - } - - public static void Raycast(MouseOrTouch touch) - { - if (!Raycast(touch.pos)) - { - mRayHitObject = fallThrough; - } - if (mRayHitObject == null) - { - mRayHitObject = mGenericHandler; - } - touch.last = touch.current; - touch.current = mRayHitObject; - mLastPos = touch.pos; - } - - public static bool Raycast(Vector3 inPos) - { - for (int i = 0; i < list.size; i++) - { - UICamera uICamera = list.buffer[i]; - if (!uICamera.enabled || !NGUITools.GetActive(uICamera.gameObject)) - { - continue; - } - currentCamera = uICamera.cachedCamera; - Vector3 vector = currentCamera.ScreenToViewportPoint(inPos); - if (float.IsNaN(vector.x) || float.IsNaN(vector.y) || vector.x < 0f || vector.x > 1f || vector.y < 0f || vector.y > 1f) - { - continue; - } - Ray ray = currentCamera.ScreenPointToRay(inPos); - int layerMask = currentCamera.cullingMask & (int)uICamera.eventReceiverMask; - float enter = ((uICamera.rangeDistance > 0f) ? uICamera.rangeDistance : (currentCamera.farClipPlane - currentCamera.nearClipPlane)); - if (uICamera.eventType == EventType.World_3D) - { - if (!Physics.Raycast(ray, out lastHit, enter, layerMask)) - { - continue; - } - lastWorldPosition = lastHit.point; - mRayHitObject = lastHit.collider.gameObject; - if (!list[0].eventsGoToColliders) - { - Rigidbody rigidbody = FindRootRigidbody(mRayHitObject.transform); - if (rigidbody != null) - { - mRayHitObject = rigidbody.gameObject; - } - } - return true; - } - if (uICamera.eventType == EventType.UI_3D) - { - RaycastHit[] array = Physics.RaycastAll(ray, enter, layerMask); - if (array.Length > 1) - { - for (int j = 0; j < array.Length; j++) - { - GameObject gameObject = array[j].collider.gameObject; - UIWidget component = gameObject.GetComponent(); - if (component != null) - { - if (!component.isVisible || (component.hitCheck != null && !component.hitCheck(array[j].point))) - { - continue; - } - } - else - { - UIRect uIRect = NGUITools.FindInParents(gameObject); - if (uIRect != null && uIRect.finalAlpha < 0.001f) - { - continue; - } - } - mHit.depth = NGUITools.CalculateRaycastDepth(gameObject); - if (mHit.depth != int.MaxValue) - { - mHit.hit = array[j]; - mHit.point = array[j].point; - mHit.go = array[j].collider.gameObject; - mHits.Add(mHit); - } - } - mHits.Sort((DepthEntry r1, DepthEntry r2) => r2.depth.CompareTo(r1.depth)); - for (int num = 0; num < mHits.size; num++) - { - if (IsVisible(ref mHits.buffer[num])) - { - lastHit = mHits[num].hit; - mRayHitObject = mHits[num].go; - lastWorldPosition = mHits[num].point; - mHits.Clear(); - return true; - } - } - mHits.Clear(); - } - else - { - if (array.Length != 1) - { - continue; - } - GameObject gameObject2 = array[0].collider.gameObject; - UIWidget component2 = gameObject2.GetComponent(); - if (component2 != null) - { - if (!component2.isVisible || (component2.hitCheck != null && !component2.hitCheck(array[0].point))) - { - continue; - } - } - else - { - UIRect uIRect2 = NGUITools.FindInParents(gameObject2); - if (uIRect2 != null && uIRect2.finalAlpha < 0.001f) - { - continue; - } - } - if (IsVisible(array[0].point, array[0].collider.gameObject)) - { - lastHit = array[0]; - lastWorldPosition = array[0].point; - mRayHitObject = lastHit.collider.gameObject; - return true; - } - } - } - else - { - if (uICamera.eventType == EventType.World_2D) - { - if (!m2DPlane.Raycast(ray, out enter)) - { - continue; - } - Vector3 point = ray.GetPoint(enter); - Collider2D collider2D = Physics2D.OverlapPoint(point, layerMask); - if (!collider2D) - { - continue; - } - lastWorldPosition = point; - mRayHitObject = collider2D.gameObject; - if (!uICamera.eventsGoToColliders) - { - Rigidbody2D rigidbody2D = FindRootRigidbody2D(mRayHitObject.transform); - if (rigidbody2D != null) - { - mRayHitObject = rigidbody2D.gameObject; - } - } - return true; - } - if (uICamera.eventType != EventType.UI_2D || !m2DPlane.Raycast(ray, out enter)) - { - continue; - } - lastWorldPosition = ray.GetPoint(enter); - Collider2D[] array2 = Physics2D.OverlapPointAll(lastWorldPosition, layerMask); - if (array2.Length > 1) - { - for (int num2 = 0; num2 < array2.Length; num2++) - { - GameObject gameObject3 = array2[num2].gameObject; - UIWidget component3 = gameObject3.GetComponent(); - if (component3 != null) - { - if (!component3.isVisible || (component3.hitCheck != null && !component3.hitCheck(lastWorldPosition))) - { - continue; - } - } - else - { - UIRect uIRect3 = NGUITools.FindInParents(gameObject3); - if (uIRect3 != null && uIRect3.finalAlpha < 0.001f) - { - continue; - } - } - mHit.depth = NGUITools.CalculateRaycastDepth(gameObject3); - if (mHit.depth != int.MaxValue) - { - mHit.go = gameObject3; - mHit.point = lastWorldPosition; - mHits.Add(mHit); - } - } - mHits.Sort((DepthEntry r1, DepthEntry r2) => r2.depth.CompareTo(r1.depth)); - for (int num3 = 0; num3 < mHits.size; num3++) - { - if (IsVisible(ref mHits.buffer[num3])) - { - mRayHitObject = mHits[num3].go; - mHits.Clear(); - return true; - } - } - mHits.Clear(); - } - else - { - if (array2.Length != 1) - { - continue; - } - GameObject gameObject4 = array2[0].gameObject; - UIWidget component4 = gameObject4.GetComponent(); - if (component4 != null) - { - if (!component4.isVisible || (component4.hitCheck != null && !component4.hitCheck(lastWorldPosition))) - { - continue; - } - } - else - { - UIRect uIRect4 = NGUITools.FindInParents(gameObject4); - if (uIRect4 != null && uIRect4.finalAlpha < 0.001f) - { - continue; - } - } - if (IsVisible(lastWorldPosition, gameObject4)) - { - mRayHitObject = gameObject4; - return true; - } - } - } - } - return false; - } - - private static bool IsVisible(Vector3 worldPoint, GameObject go) - { - UIPanel uIPanel = NGUITools.FindInParents(go); - while (uIPanel != null) - { - if (!uIPanel.IsVisible(worldPoint)) - { - return false; - } - uIPanel = uIPanel.parentPanel; - } - return true; - } - - private static bool IsVisible(ref DepthEntry de) - { - UIPanel uIPanel = NGUITools.FindInParents(de.go); - while (uIPanel != null) - { - if (!uIPanel.IsVisible(de.point)) - { - return false; - } - uIPanel = uIPanel.parentPanel; - } - return true; - } - public static bool IsHighlighted(GameObject go) { return hoveredObject == go; @@ -1196,68 +492,6 @@ public class UICamera : MonoBehaviour return null; } - private static int GetDirection(KeyCode up, KeyCode down) - { - if (GetKeyDown(up)) - { - currentKey = up; - return 1; - } - if (GetKeyDown(down)) - { - currentKey = down; - return -1; - } - return 0; - } - - private static int GetDirection(KeyCode up0, KeyCode up1, KeyCode down0, KeyCode down1) - { - if (GetKeyDown(up0)) - { - currentKey = up0; - return 1; - } - if (GetKeyDown(up1)) - { - currentKey = up1; - return 1; - } - if (GetKeyDown(down0)) - { - currentKey = down0; - return -1; - } - if (GetKeyDown(down1)) - { - currentKey = down1; - return -1; - } - return 0; - } - - private static int GetDirection(string axis) - { - float time = RealTime.time; - if (mNextEvent < time && !string.IsNullOrEmpty(axis)) - { - float num = GetAxis(axis); - if (num > 0.75f) - { - currentKey = KeyCode.JoystickButton0; - mNextEvent = time + 0.25f; - return 1; - } - if (num < -0.75f) - { - currentKey = KeyCode.JoystickButton0; - mNextEvent = time + 0.25f; - return -1; - } - } - return 0; - } - public static void Notify(GameObject go, string funcName, object obj) { if (mNotifying > 10) @@ -1280,51 +514,6 @@ public class UICamera : MonoBehaviour } } - public static MouseOrTouch GetMouse(int button) - { - return mMouse[button]; - } - - public static MouseOrTouch GetTouch(int id, bool createIfMissing = false) - { - if (id < 0) - { - return GetMouse(-id - 1); - } - int i = 0; - for (int count = mTouchIDs.Count; i < count; i++) - { - if (mTouchIDs[i] == id) - { - return activeTouches[i]; - } - } - if (createIfMissing) - { - MouseOrTouch mouseOrTouch = new MouseOrTouch(); - mouseOrTouch.pressTime = RealTime.time; - mouseOrTouch.touchBegan = true; - activeTouches.Add(mouseOrTouch); - mTouchIDs.Add(id); - return mouseOrTouch; - } - return null; - } - - public static void RemoveTouch(int id) - { - int i = 0; - for (int count = mTouchIDs.Count; i < count; i++) - { - if (mTouchIDs[i] == id) - { - mTouchIDs.RemoveAt(i); - activeTouches.RemoveAt(i); - break; - } - } - } - private void Awake() { mWidth = Screen.width; @@ -1373,821 +562,6 @@ public class UICamera : MonoBehaviour } } - private void OnEnable() - { - list.Add(this); - list.Sort(CompareFunc); - } - - private void OnDisable() - { - list.Remove(this); - } - - private void Start() - { - if (eventType != EventType.World_3D && cachedCamera.transparencySortMode != TransparencySortMode.Orthographic) - { - cachedCamera.transparencySortMode = TransparencySortMode.Orthographic; - } - if (!Application.isPlaying) - { - return; - } - if (fallThrough == null) - { - UIRoot uIRoot = NGUITools.FindInParents(base.gameObject); - if (uIRoot != null) - { - fallThrough = uIRoot.gameObject; - } - else - { - Transform transform = base.transform; - fallThrough = ((transform.parent != null) ? transform.parent.gameObject : base.gameObject); - } - } - cachedCamera.eventMask = 0; - if (disableControllerCheck && useController && handlesEvents) - { - disableControllerCheck = false; - if (!string.IsNullOrEmpty(horizontalAxisName) && Mathf.Abs(GetAxis(horizontalAxisName)) > 0.1f) - { - useController = false; - } - else if (!string.IsNullOrEmpty(verticalAxisName) && Mathf.Abs(GetAxis(verticalAxisName)) > 0.1f) - { - useController = false; - } - else if (!string.IsNullOrEmpty(horizontalPanAxisName) && Mathf.Abs(GetAxis(horizontalPanAxisName)) > 0.1f) - { - useController = false; - } - else if (!string.IsNullOrEmpty(verticalPanAxisName) && Mathf.Abs(GetAxis(verticalPanAxisName)) > 0.1f) - { - useController = false; - } - } - } - - private void Update() - { - if (!handlesEvents) - { - return; - } - current = this; - NGUIDebug.debugRaycast = debug; - if (useTouch) - { - ProcessTouches(); - } - else if (useMouse) - { - ProcessMouse(); - } - if (onCustomInput != null) - { - onCustomInput(); - } - if ((useKeyboard || useController) && !disableController) - { - ProcessOthers(); - } - if (useMouse && mHover != null) - { - float num = ((!string.IsNullOrEmpty(scrollAxisName)) ? GetAxis(scrollAxisName) : 0f); - if (num != 0f) - { - if (onScroll != null) - { - onScroll(mHover, num); - } - Notify(mHover, "OnScroll", num); - } - if (showTooltips && mTooltipTime != 0f && !UIPopupList.isOpen && mMouse[0].dragged == null && (mTooltipTime < RealTime.time || GetKey(KeyCode.LeftShift) || GetKey(KeyCode.RightShift))) - { - currentTouch = mMouse[0]; - currentTouchID = -1; - ShowTooltip(mHover); - } - } - if (mTooltip != null && !NGUITools.GetActive(mTooltip)) - { - ShowTooltip(null); - } - current = null; - currentTouchID = -100; - } - - private void LateUpdate() - { - if (!handlesEvents) - { - return; - } - int width = Screen.width; - int height = Screen.height; - if (width != mWidth || height != mHeight) - { - mWidth = width; - mHeight = height; - UIRoot.Broadcast("UpdateAnchors"); - if (onScreenResize != null) - { - onScreenResize(); - } - } - } - - public void ProcessMouse() - { - bool flag = false; - bool flag2 = false; - for (int i = 0; i < 2; i++) - { - if (Input.GetMouseButtonDown(i)) - { - currentKey = (KeyCode)(323 + i); - flag2 = true; - flag = true; - } - else if (Input.GetMouseButton(i)) - { - currentKey = (KeyCode)(323 + i); - flag = true; - } - } - if (currentScheme == ControlScheme.Touch) - { - return; - } - currentTouch = mMouse[0]; - Vector2 vector = Input.mousePosition; - if (currentTouch.ignoreDelta == 0) - { - currentTouch.delta = vector - currentTouch.pos; - } - else - { - currentTouch.ignoreDelta--; - currentTouch.delta.x = 0f; - currentTouch.delta.y = 0f; - } - float sqrMagnitude = currentTouch.delta.sqrMagnitude; - currentTouch.pos = vector; - mLastPos = vector; - bool flag3 = false; - if (currentScheme != ControlScheme.Mouse) - { - if (sqrMagnitude < 0.001f) - { - return; - } - currentKey = KeyCode.Mouse0; - flag3 = true; - } - else if (sqrMagnitude > 0.001f) - { - flag3 = true; - } - for (int j = 1; j < 3; j++) - { - mMouse[j].pos = currentTouch.pos; - mMouse[j].delta = currentTouch.delta; - } - if (flag || flag3 || mNextRaycast < RealTime.time) - { - mNextRaycast = RealTime.time + 0.02f; - Raycast(currentTouch); - for (int k = 0; k < 3; k++) - { - mMouse[k].current = currentTouch.current; - } - } - bool flag4 = currentTouch.last != currentTouch.current; - bool flag5 = currentTouch.pressed != null; - if (!flag5) - { - hoveredObject = currentTouch.current; - } - currentTouchID = -1; - if (flag4) - { - currentKey = KeyCode.Mouse0; - } - if (!flag && flag3 && (!stickyTooltip || flag4)) - { - if (mTooltipTime != 0f) - { - mTooltipTime = Time.unscaledTime + tooltipDelay; - } - else if (mTooltip != null) - { - ShowTooltip(null); - } - } - if (flag3 && onMouseMove != null) - { - onMouseMove(currentTouch.delta); - currentTouch = null; - } - if (flag4 && (flag2 || (flag5 && !flag))) - { - hoveredObject = null; - } - for (int l = 0; l < 2; l++) - { - bool mouseButtonDown = Input.GetMouseButtonDown(l); - bool mouseButtonUp = Input.GetMouseButtonUp(l); - if (mouseButtonDown || mouseButtonUp) - { - currentKey = (KeyCode)(323 + l); - } - currentTouch = mMouse[l]; - currentTouchID = -1 - l; - currentKey = (KeyCode)(323 + l); - if (mouseButtonDown) - { - currentTouch.pressedCam = currentCamera; - currentTouch.pressTime = RealTime.time; - } - else if (currentTouch.pressed != null) - { - currentCamera = currentTouch.pressedCam; - } - ProcessTouch(mouseButtonDown, mouseButtonUp); - } - if (!flag && flag4) - { - currentTouch = mMouse[0]; - mTooltipTime = RealTime.time + tooltipDelay; - currentTouchID = -1; - currentKey = KeyCode.Mouse0; - hoveredObject = currentTouch.current; - } - currentTouch = null; - mMouse[0].last = mMouse[0].current; - for (int m = 1; m < 3; m++) - { - mMouse[m].last = mMouse[0].last; - } - } - - public void ProcessTouches() - { - int num = ((GetInputTouchCount == null) ? Input.touchCount : GetInputTouchCount()); - for (int i = 0; i < num; i++) - { - TouchPhase phase; - int fingerId; - Vector2 position; - int tapCount; - if (GetInputTouch == null) - { - UnityEngine.Touch touch = Input.GetTouch(i); - phase = touch.phase; - fingerId = touch.fingerId; - position = touch.position; - tapCount = touch.tapCount; - } - else - { - Touch touch2 = GetInputTouch(i); - phase = touch2.phase; - fingerId = touch2.fingerId; - position = touch2.position; - tapCount = touch2.tapCount; - } - currentTouchID = ((!allowMultiTouch) ? 1 : fingerId); - currentTouch = GetTouch(currentTouchID, createIfMissing: true); - bool flag = phase == TouchPhase.Began || currentTouch.touchBegan; - bool flag2 = phase == TouchPhase.Canceled || phase == TouchPhase.Ended; - currentTouch.touchBegan = false; - currentTouch.delta = position - currentTouch.pos; - currentTouch.pos = position; - currentKey = KeyCode.None; - Raycast(currentTouch); - if (flag) - { - currentTouch.pressedCam = currentCamera; - } - else if (currentTouch.pressed != null) - { - currentCamera = currentTouch.pressedCam; - } - if (tapCount > 1) - { - currentTouch.clickTime = RealTime.time; - } - ProcessTouch(flag, flag2); - if (flag2) - { - RemoveTouch(currentTouchID); - } - currentTouch.last = null; - currentTouch = null; - if (!allowMultiTouch) - { - break; - } - } - if (num == 0) - { - if (mUsingTouchEvents) - { - mUsingTouchEvents = false; - } - else if (useMouse) - { - ProcessMouse(); - } - } - else - { - mUsingTouchEvents = true; - } - } - - private void ProcessFakeTouches() - { - bool mouseButtonDown = Input.GetMouseButtonDown(0); - bool mouseButtonUp = Input.GetMouseButtonUp(0); - bool mouseButton = Input.GetMouseButton(0); - if (mouseButtonDown || mouseButtonUp || mouseButton) - { - currentTouchID = 1; - currentTouch = mMouse[0]; - currentTouch.touchBegan = mouseButtonDown; - if (mouseButtonDown) - { - currentTouch.pressTime = RealTime.time; - activeTouches.Add(currentTouch); - } - Vector2 vector = Input.mousePosition; - currentTouch.delta = vector - currentTouch.pos; - currentTouch.pos = vector; - Raycast(currentTouch); - if (mouseButtonDown) - { - currentTouch.pressedCam = currentCamera; - } - else if (currentTouch.pressed != null) - { - currentCamera = currentTouch.pressedCam; - } - currentKey = KeyCode.None; - ProcessTouch(mouseButtonDown, mouseButtonUp); - if (mouseButtonUp) - { - activeTouches.Remove(currentTouch); - } - currentTouch.last = null; - currentTouch = null; - } - } - - public void ProcessOthers() - { - currentTouchID = -100; - currentTouch = controller; - bool flag = false; - bool flag2 = false; - if (submitKey0 != KeyCode.None && GetKeyDown(submitKey0)) - { - currentKey = submitKey0; - flag = true; - } - else if (submitKey1 != KeyCode.None && GetKeyDown(submitKey1)) - { - currentKey = submitKey1; - flag = true; - } - else if ((submitKey0 == KeyCode.Return || submitKey1 == KeyCode.Return) && GetKeyDown(KeyCode.KeypadEnter)) - { - currentKey = submitKey0; - flag = true; - } - if (submitKey0 != KeyCode.None && GetKeyUp(submitKey0)) - { - currentKey = submitKey0; - flag2 = true; - } - else if (submitKey1 != KeyCode.None && GetKeyUp(submitKey1)) - { - currentKey = submitKey1; - flag2 = true; - } - else if ((submitKey0 == KeyCode.Return || submitKey1 == KeyCode.Return) && GetKeyUp(KeyCode.KeypadEnter)) - { - currentKey = submitKey0; - flag2 = true; - } - if (flag) - { - currentTouch.pressTime = RealTime.time; - } - if ((flag || flag2) && currentScheme == ControlScheme.Controller) - { - currentTouch.current = controllerNavigationObject; - ProcessTouch(flag, flag2); - currentTouch.last = currentTouch.current; - } - KeyCode keyCode = KeyCode.None; - if (useController) - { - if (!disableController && currentScheme == ControlScheme.Controller && (currentTouch.current == null || !currentTouch.current.activeInHierarchy)) - { - currentTouch.current = controllerNavigationObject; - } - if (!string.IsNullOrEmpty(verticalAxisName)) - { - int direction = GetDirection(verticalAxisName); - if (direction != 0) - { - ShowTooltip(null); - currentScheme = ControlScheme.Controller; - currentTouch.current = controllerNavigationObject; - if (currentTouch.current != null) - { - keyCode = ((direction > 0) ? KeyCode.UpArrow : KeyCode.DownArrow); - if (onNavigate != null) - { - onNavigate(currentTouch.current, keyCode); - } - Notify(currentTouch.current, "OnNavigate", keyCode); - } - } - } - if (!string.IsNullOrEmpty(horizontalAxisName)) - { - int direction2 = GetDirection(horizontalAxisName); - if (direction2 != 0) - { - ShowTooltip(null); - currentScheme = ControlScheme.Controller; - currentTouch.current = controllerNavigationObject; - if (currentTouch.current != null) - { - keyCode = ((direction2 > 0) ? KeyCode.RightArrow : KeyCode.LeftArrow); - if (onNavigate != null) - { - onNavigate(currentTouch.current, keyCode); - } - Notify(currentTouch.current, "OnNavigate", keyCode); - } - } - } - float num = ((!string.IsNullOrEmpty(horizontalPanAxisName)) ? GetAxis(horizontalPanAxisName) : 0f); - float num2 = ((!string.IsNullOrEmpty(verticalPanAxisName)) ? GetAxis(verticalPanAxisName) : 0f); - if (num != 0f || num2 != 0f) - { - ShowTooltip(null); - currentScheme = ControlScheme.Controller; - currentTouch.current = controllerNavigationObject; - if (currentTouch.current != null) - { - Vector2 vector = new Vector2(num, num2); - vector *= Time.unscaledDeltaTime; - if (onPan != null) - { - onPan(currentTouch.current, vector); - } - Notify(currentTouch.current, "OnPan", vector); - } - } - } - if ((GetAnyKeyDown != null) ? GetAnyKeyDown() : Input.anyKeyDown) - { - int i = 0; - for (int num3 = NGUITools.keys.Length; i < num3; i++) - { - KeyCode keyCode2 = NGUITools.keys[i]; - if (keyCode != keyCode2 && GetKeyDown(keyCode2) && (useKeyboard || keyCode2 >= KeyCode.Mouse0) && (useController || keyCode2 < KeyCode.JoystickButton0) && (useMouse || (keyCode2 < KeyCode.Mouse0 && keyCode2 > KeyCode.Mouse6))) - { - currentKey = keyCode2; - if (onKey != null) - { - onKey(currentTouch.current, keyCode2); - } - Notify(currentTouch.current, "OnKey", keyCode2); - } - } - } - currentTouch = null; - } - - private void ProcessPress(bool pressed, float click, float drag) - { - if (pressed) - { - if (mTooltip != null) - { - ShowTooltip(null); - } - currentTouch.pressStarted = true; - if (onPress != null && (bool)currentTouch.pressed) - { - onPress(currentTouch.pressed, state: false); - } - if (currentTouchID == -2) - { - Notify(currentTouch.pressed, "OnPressRight", false); - } - else - { - Notify(currentTouch.pressed, "OnPress", false); - } - if (currentScheme == ControlScheme.Mouse && hoveredObject == null && currentTouch.current != null) - { - hoveredObject = currentTouch.current; - } - currentTouch.pressed = currentTouch.current; - currentTouch.dragged = currentTouch.current; - currentTouch.clickNotification = ClickNotification.BasedOnDelta; - currentTouch.totalDelta = Vector2.zero; - currentTouch.dragStarted = false; - if (onPress != null && (bool)currentTouch.pressed) - { - onPress(currentTouch.pressed, state: true); - } - if (currentTouchID == -2) - { - Notify(currentTouch.pressed, "OnPressRight", true); - } - else - { - Notify(currentTouch.pressed, "OnPress", true); - } - if (mTooltip != null) - { - ShowTooltip(null); - } - if (!(mSelected != currentTouch.pressed)) - { - return; - } - mInputFocus = false; - if ((bool)mSelected) - { - Notify(mSelected, "OnSelect", false); - if (onSelect != null) - { - onSelect(mSelected, state: false); - } - } - mSelected = currentTouch.pressed; - if (currentTouch.pressed != null && currentTouch.pressed.GetComponent() != null) - { - controller.current = currentTouch.pressed; - } - if ((bool)mSelected) - { - mInputFocus = mSelected.activeInHierarchy && mSelected.GetComponent() != null; - if (onSelect != null) - { - onSelect(mSelected, state: true); - } - Notify(mSelected, "OnSelect", true); - } - } - else - { - if (!(currentTouch.pressed != null) || (currentTouch.delta.sqrMagnitude == 0f && !(currentTouch.current != currentTouch.last)) || currentTouchID == -2) - { - return; - } - currentTouch.totalDelta += currentTouch.delta; - float sqrMagnitude = currentTouch.totalDelta.sqrMagnitude; - bool flag = false; - if (!currentTouch.dragStarted && currentTouch.last != currentTouch.current) - { - currentTouch.dragStarted = true; - currentTouch.delta = currentTouch.totalDelta; - isDragging = true; - if (onDragStart != null) - { - onDragStart(currentTouch.dragged); - } - Notify(currentTouch.dragged, "OnDragStart", null); - if (onDragOver != null) - { - onDragOver(currentTouch.last, currentTouch.dragged); - } - Notify(currentTouch.last, "OnDragOver", currentTouch.dragged); - isDragging = false; - } - else if (!currentTouch.dragStarted && drag < sqrMagnitude) - { - flag = true; - currentTouch.dragStarted = true; - currentTouch.delta = currentTouch.totalDelta; - } - if (!currentTouch.dragStarted) - { - return; - } - if (mTooltip != null) - { - ShowTooltip(null); - } - isDragging = true; - bool num = currentTouch.clickNotification == ClickNotification.None; - if (flag) - { - if (onDragStart != null) - { - onDragStart(currentTouch.dragged); - } - Notify(currentTouch.dragged, "OnDragStart", null); - if (onDragOver != null) - { - onDragOver(currentTouch.last, currentTouch.dragged); - } - Notify(currentTouch.current, "OnDragOver", currentTouch.dragged); - } - else if (currentTouch.last != currentTouch.current) - { - if (onDragOut != null) - { - onDragOut(currentTouch.last, currentTouch.dragged); - } - Notify(currentTouch.last, "OnDragOut", currentTouch.dragged); - if (onDragOver != null) - { - onDragOver(currentTouch.last, currentTouch.dragged); - } - Notify(currentTouch.current, "OnDragOver", currentTouch.dragged); - } - if (onDrag != null) - { - onDrag(currentTouch.dragged, currentTouch.delta); - } - Notify(currentTouch.dragged, "OnDrag", currentTouch.delta); - currentTouch.last = currentTouch.current; - isDragging = false; - if (num) - { - currentTouch.clickNotification = ClickNotification.None; - } - else if (currentTouch.clickNotification == ClickNotification.BasedOnDelta && click < sqrMagnitude) - { - currentTouch.clickNotification = ClickNotification.None; - } - } - } - - private void ProcessRelease(bool isMouse, float drag) - { - if (currentTouch == null) - { - return; - } - currentTouch.pressStarted = false; - if (currentTouch.pressed != null) - { - if (currentTouch.dragStarted) - { - if (onDragOut != null) - { - onDragOut(currentTouch.last, currentTouch.dragged); - } - Notify(currentTouch.last, "OnDragOut", currentTouch.dragged); - if (onDragEnd != null) - { - onDragEnd(currentTouch.dragged); - } - Notify(currentTouch.dragged, "OnDragEnd", null); - } - if (onPress != null) - { - onPress(currentTouch.pressed, state: false); - } - if (currentTouchID == -2) - { - Notify(currentTouch.pressed, "OnPressRight", false); - } - else - { - Notify(currentTouch.pressed, "OnPress", false); - } - if (isMouse && HasCollider(currentTouch.pressed)) - { - if (mHover == currentTouch.current) - { - if (onHover != null) - { - onHover(currentTouch.current, state: true); - } - Notify(currentTouch.current, "OnHover", true); - } - else - { - hoveredObject = currentTouch.current; - } - } - if (currentTouch.dragged == currentTouch.current || (currentScheme != ControlScheme.Controller && currentTouch.clickNotification != ClickNotification.None && currentTouch.totalDelta.sqrMagnitude < drag)) - { - if (currentTouch.clickNotification != ClickNotification.None && currentTouch.pressed == currentTouch.current) - { - ShowTooltip(null); - float time = RealTime.time; - if (currentTouchID == -2) - { - Notify(currentTouch.pressed, "OnClickRight", null); - } - else - { - if (onClick != null) - { - onClick(currentTouch.pressed); - } - Notify(currentTouch.pressed, "OnClick", null); - } - if (currentTouch.clickTime + 0.35f > time && _lastClickedObjectToCheckForDoubleClick == currentTouch.pressed) - { - if (onDoubleClick != null) - { - onDoubleClick(currentTouch.pressed); - } - Notify(currentTouch.pressed, "OnDoubleClick", null); - } - currentTouch.clickTime = time; - _lastClickedObjectToCheckForDoubleClick = currentTouch.pressed; - } - } - else if (currentTouch.dragStarted) - { - if (onDrop != null) - { - onDrop(currentTouch.current, currentTouch.dragged); - } - Notify(currentTouch.current, "OnDrop", currentTouch.dragged); - } - } - currentTouch.dragStarted = false; - currentTouch.pressed = null; - currentTouch.dragged = null; - } - - private bool HasCollider(GameObject go) - { - if (go == null) - { - return false; - } - Collider component = go.GetComponent(); - if (component != null) - { - return component.enabled; - } - Collider2D component2 = go.GetComponent(); - if (component2 != null) - { - return component2.enabled; - } - return false; - } - - public void ProcessTouch(bool pressed, bool released) - { - if (pressed) - { - mTooltipTime = Time.unscaledTime + tooltipDelay; - } - bool flag = currentScheme == ControlScheme.Mouse; - float num = (flag ? mouseDragThreshold : touchDragThreshold); - float num2 = (flag ? mouseClickThreshold : touchClickThreshold); - num *= num; - num2 *= num2; - if (currentTouch.pressed != null) - { - if (released) - { - ProcessRelease(flag, num); - } - ProcessPress(pressed, num2, num); - if (currentTouch.pressed == currentTouch.current && mTooltipTime != 0f && currentTouch.clickNotification != ClickNotification.None && !currentTouch.dragStarted && currentTouch.deltaTime > tooltipDelay) - { - mTooltipTime = 0f; - currentTouch.clickNotification = ClickNotification.None; - if (longPressTooltip) - { - ShowTooltip(currentTouch.pressed); - } - Notify(currentTouch.current, "OnLongPress", null); - } - } - else if (flag || pressed || released) - { - ProcessPress(pressed, num2, num); - if (released) - { - ProcessRelease(flag, num); - } - } - } - public static bool ShowTooltip(GameObject go) { if (mTooltip != go) diff --git a/SVSim.BattleEngine/Engine/UICardList.cs b/SVSim.BattleEngine/Engine/UICardList.cs index 250c48f4..4a6d1db9 100644 --- a/SVSim.BattleEngine/Engine/UICardList.cs +++ b/SVSim.BattleEngine/Engine/UICardList.cs @@ -8,15 +8,6 @@ using Wizard.DeckCardEdit; public class UICardList : MonoBehaviour { - private const string FILTER_BTN_LEFT_ON = "pilltab_02_left_on"; - - private const string FILTER_BTN_LEFT_OFF = "pilltab_02_left_off"; - - private const string FILTER_BTN_RIGHT_ON = "pilltab_02_right_on"; - - private const string FILTER_BTN_RIGHT_OFF = "pilltab_02_right_off"; - - private const string PREMIUM_SELECT_PREFAB_PATH = "UI/DeckList/DeckIntroductionPreferSelect"; private readonly Vector3 MY_ROTATION_FORMAT_ICON_POSITION = new Vector3(167f, 0f, 0f); @@ -26,10 +17,6 @@ public class UICardList : MonoBehaviour private readonly Vector3 MY_ROTATION_CARD_NUMBER_MAX_POSITION = new Vector3(59f, 0f, 0f); - private const int MY_ROTATION_CLASS_NAME_WIDTH = 110; - - private const int MY_ROTATION_CLASS_NAME_UNDER_LINE_WIDTH = 182; - [SerializeField] private GameObject _cardListTemplatePrefab; @@ -41,9 +28,6 @@ public class UICardList : MonoBehaviour [SerializeField] private UIScrollView scrollView; - [SerializeField] - private UIScrollBar ScrollBar; - [SerializeField] private CostCurveUI CostCurve; @@ -59,12 +43,6 @@ public class UICardList : MonoBehaviour [SerializeField] private UIPanel _rootPanel; - [SerializeField] - private UIPanel _scrollPanel; - - [SerializeField] - private UIPanel _costCurvePanel; - [SerializeField] private UILabel _deckClassLabel; @@ -101,71 +79,15 @@ public class UICardList : MonoBehaviour [SerializeField] private UITexture _qrCodeSmallTexture; - [SerializeField] - private UISprite _qrCodeMaintenance; - - [SerializeField] - private GameObject _keyboardCloseSelectEffect; - [SerializeField] private GameObject _deckIntroductionRoot; [SerializeField] private GameObject _qrCodeRoot; - [SerializeField] - private UIButton _deckIntroductionRedEtherOffButton; - - [SerializeField] - private UIButton _deckIntroductionRedEtherOnButton; - - [SerializeField] - private UISprite _deckIntroductionRedEtherOffSprite; - - [SerializeField] - private UISprite _deckIntroductionRedEtherOnSprite; - [SerializeField] private UIButton _redUtilButton; - [SerializeField] - private UILabel _redUtilButtonLabel; - - private bool _isEnableShortageCardVisible; - - [SerializeField] - private UIButton _deckIntroductionCopyButton; - - [SerializeField] - private GameObject _cardEnoughRoot; - - [SerializeField] - private GameObject _redEtherEnoughRoot; - - [SerializeField] - private GameObject _redEtherNotEnoughRoot; - - [SerializeField] - private GameObject _redEtherRoot; - - [SerializeField] - private UILabel _useRedEther; - - [SerializeField] - private UILabel _haveRedEther; - - [SerializeField] - private UILabel _haveRedEtherEnoughCard; - - [SerializeField] - private UILabel _haveRedEtherEnough; - - [SerializeField] - private UILabel _redEtherAfter; - - [SerializeField] - private UILabel _notEnoughRedEther; - [SerializeField] private GameObject _blueUtilButtonRoot; @@ -208,12 +130,6 @@ public class UICardList : MonoBehaviour [SerializeField] private UISprite _useSubClassFormatIconSprite; - [SerializeField] - private DeckCopyDialog _useSubClassDeckCopyDialog3OptionsPrefab; - - [SerializeField] - private SubClassSelectDialog _subClassSelectDialogPrefab; - [SerializeField] private GameObject _myRotationIconOriginal; @@ -244,10 +160,6 @@ public class UICardList : MonoBehaviour [NonSerialized] public GenerateDeckCodeTask.SubmitDeckType SubmitDeckType = GenerateDeckCodeTask.SubmitDeckType.NORMAL; - private DialogBase _qrCodeDialog; - - private static int UpdateCounter; - private List PlayerDataIds; private Dictionary PlayerDataIdDict; @@ -268,8 +180,6 @@ public class UICardList : MonoBehaviour private DeckData _deck; - private Dictionary _shortageBasicCardIdList = new Dictionary(); - private Format _format = Format.Max; private IFormatBehavior _formatBehavior; @@ -284,23 +194,9 @@ public class UICardList : MonoBehaviour private bool _isLabelMoved; - private int _selectedSubClass = 10; - - private const int DISP_MAX_CARD_TYPE_NUM = 16; - - private const int RESET_WAIT_COUNT = 2; - - private const float CardSizeScale = 0.65f; - - private const float MOVE_BLUE_BUTTON_DISTANCE = 630f; - - private bool _isSelectCloseButton; - [NonSerialized] public bool _loadingEnd; - public bool IsEnableShortageCardVisible => _isEnableShortageCardVisible; - public Action OnCardDetailOpen { get; set; } public Action OnCardDetailClose { get; set; } @@ -309,10 +205,6 @@ public class UICardList : MonoBehaviour public bool IsEnableMyRotationDisplay { get; set; } = true; - public bool IsEnableAvatarBattleDisplay { get; set; } = true; - - public bool IsConventionDeckIntroduction { get; set; } - private bool _isShareButtonUse { get; set; } private void Awake() @@ -332,40 +224,6 @@ public class UICardList : MonoBehaviour CostCurve.Initialize(_formatBehavior.CardMasterId); } - private void Start() - { - _deckIntroductionCopyButton.onClick.Add(new EventDelegate(delegate - { - OnClickDeckCopy(); - })); - _deckIntroductionRedEtherOffButton.onClick.Add(new EventDelegate(delegate - { - OnClickShortageCardVisibleButton(visible: false); - })); - _deckIntroductionRedEtherOnButton.onClick.Add(new EventDelegate(delegate - { - OnClickShortageCardVisibleButton(visible: true); - })); - _myRotationIconOriginal.SetActive(value: false); - SetShortageCardVisible(visible: false); - } - - private void Update() - { - if (m_ResetFlg) - { - if (UpdateCounter >= 2) - { - ResetScrollImmediately(); - } - else - { - UpdateCounter++; - } - } - KeyboardUpdate(); - } - private void OnEnable() { if (!_isActive) @@ -382,14 +240,6 @@ public class UICardList : MonoBehaviour } } - private void OnDestroy() - { - if (_qrCodeDialog != null) - { - UnityEngine.Object.Destroy(_qrCodeDialog.gameObject); - } - } - public void Init(GameObject in_ParentObject, CardDetailUI in_CardDetail, string in_DeckName, Action in_CloseButtonEvent, string in_LayerName = "Detail", bool in_DetailCameraUse = false, CardBasePrm.ClanType? clan = null, int in_MaxCardNum = 0) { RemoveData(); @@ -425,7 +275,7 @@ public class UICardList : MonoBehaviour CloseBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate { in_CloseButtonEvent(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); + })); } else @@ -433,7 +283,7 @@ public class UICardList : MonoBehaviour CloseBtnObj.buttons[0].onClick.Add(new EventDelegate(delegate { SetActive(in_Active: false); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); + })); } SetShareButton(clan); @@ -441,14 +291,6 @@ public class UICardList : MonoBehaviour SetEnableBlueButton(isEnable: false); } - public void SetCameraEnable(bool enable) - { - if (_detailCamera != null) - { - _detailCamera.gameObject.SetActive(enable); - } - } - public void SetFormat(Format inFormat, ConventionDeckList conventionDeckList) { _formatBehavior = FormatBehaviorManager.Create(inFormat, conventionDeckList); @@ -464,16 +306,6 @@ public class UICardList : MonoBehaviour UpdateDeckInfo(); } - public void SetFormatIcon(string iconSpriteName) - { - if (!(iconSpriteName == _formatIcon.spriteName)) - { - _formatIcon.spriteName = iconSpriteName; - _formatIcon.gameObject.SetActive(value: true); - UpdateDeckInfo(); - } - } - public void SetLabelPositionToNoDeckName() { if (!_isLabelMoved) @@ -513,17 +345,6 @@ public class UICardList : MonoBehaviour InitUseSubClassDisplay(); } - public void SetClassName(string name) - { - _deckClassLabel.text = name; - } - - public void SetChaosDeckName(string name) - { - SetClassName(name); - _deckClassLabel.width = 136; - } - public void SetDeckName(string in_DeckName) { _deckName = in_DeckName; @@ -555,15 +376,6 @@ public class UICardList : MonoBehaviour } } - public void SetPanelDepthOffset(int offsetDepth) - { - UIPanel[] componentsInChildren = base.transform.GetComponentsInChildren(includeInactive: true); - for (int i = 0; i < componentsInChildren.Length; i++) - { - componentsInChildren[i].depth += offsetDepth; - } - } - public List GetLoadFileList(List inCardIdList) { List list = new List(); @@ -621,11 +433,6 @@ public class UICardList : MonoBehaviour UpdateDeckInfo(); } - public int getCardNum() - { - return CardCount; - } - public void SetDeck(DeckData deck, ConventionDeckList conventionDeckList, bool isSortIdList = false) { _deck = deck; @@ -681,20 +488,8 @@ public class UICardList : MonoBehaviour { return; } - GameMgr.GetIns().GetDataMgr().SetPlayerAvatarBattleInfo(deck.GetSkinId().ToString()); - if (GameMgr.GetIns().GetDataMgr().TryGetPlayerAvatarBattleInfo(out var avatarBattleInfo)) - { - SetEnableBlueButton(isEnable: false); - _avatarAbilityButton.onClick.Clear(); - _avatarAbilityButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - AvatarAbilityDetailDialog.Create(avatarBattleInfo, deck); - })); - CardDetail.IsShowEvolutionButton = false; - CardDetail.IsShowVoiceButton = false; - CardDetail.IsShowFlavorTextButton = false; - } + // Pre-Phase-5b: SetPlayerAvatarBattleInfo + TryGetPlayerAvatarBattleInfo dropped; + // headless has no avatar battle info to display. } public void SetMyRotationInfo(int classId, MyRotationInfo myRotationInfo) @@ -713,58 +508,6 @@ public class UICardList : MonoBehaviour _myRotationGrid.Reposition(); } - public void UpdateShortageRedEther() - { - if (_deck == null) - { - return; - } - _shortageBasicCardIdList.Clear(); - DeckCardEditUI.ClassSet = _classSet; - MyRotationInfo myRotationInfo = null; - if (_deck != null) - { - myRotationInfo = Data.MyRotationAllInfo.Get(_deck.MyRotationId); - } - List shortageCardList = DeckCardEditUI.GetShortageCardList(_deck.GetCardIdList(), _deck.DeckCopyFormat, _formatBehavior, myRotationInfo); - int num = 0; - foreach (int item in shortageCardList) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetCardParameterFromId(item); - num += cardParameterFromId.UseRedEther; - int baseCardId = cardParameterFromId.BaseCardId; - if (_shortageBasicCardIdList.ContainsKey(baseCardId)) - { - _shortageBasicCardIdList[baseCardId]++; - } - else - { - _shortageBasicCardIdList[baseCardId] = 1; - } - } - int userRedEtherCount = PlayerStaticData.UserRedEtherCount; - int num2 = num - userRedEtherCount; - _useRedEther.text = num.ToString(); - _haveRedEther.text = userRedEtherCount.ToString(); - _haveRedEtherEnoughCard.text = userRedEtherCount.ToString(); - _haveRedEtherEnough.text = userRedEtherCount.ToString(); - _notEnoughRedEther.text = Data.SystemText.Get("Card_0208", num2.ToString()); - _redEtherAfter.text = Data.SystemText.Get("Card_0094", (userRedEtherCount - num).ToString()); - if (_shortageBasicCardIdList.Count == 0) - { - _cardEnoughRoot.SetActive(value: true); - _redEtherEnoughRoot.gameObject.SetActive(value: false); - _redEtherNotEnoughRoot.gameObject.SetActive(value: false); - } - else - { - _cardEnoughRoot.SetActive(value: false); - bool flag = userRedEtherCount >= num; - _redEtherEnoughRoot.gameObject.SetActive(flag); - _redEtherNotEnoughRoot.gameObject.SetActive(!flag); - } - } - public void addScrollItem(int inCardId) { CardBasePrm.CharaType charType = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetCardParameterFromId(inCardId).CharType; @@ -891,23 +634,6 @@ public class UICardList : MonoBehaviour } } - public void ResetScrollImmediately() - { - if (PlayerDataIdDict.Count > 16) - { - scrollView.ResetPosition(); - ScrollBar.value = 1f; - ScrollBar.value = 0f; - } - else - { - scrollView.ResetPosition(); - } - UpdateCounter = 0; - m_ResetFlg = false; - scrollView.GetComponent().alpha = 1f; - } - public void SetShareButtonUse(bool isUse) { _isShareButtonUse = isUse; @@ -968,7 +694,7 @@ public class UICardList : MonoBehaviour _qrCodeRoot.gameObject.SetActive(value: false); _showQRCodeButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ShowQRCode(); })); } @@ -1001,28 +727,6 @@ public class UICardList : MonoBehaviour private void ShowQRCode() { - _qrCodeRoot.gameObject.SetActive(value: true); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.DECK_QR_CODE)) - { - _qrCodeMaintenance.gameObject.SetActive(value: true); - return; - } - string qrCodeText = QRCodeUtility.GenerateQRCodeText(PlayerDataIds, _clanType, _classSet, _formatBehavior, _format, _myRotationInfo); - _qrCodeSmallTexture.GetComponent().mainTexture = QRCodeUtility.CreateQrCodeTexture(207, 207, qrCodeText); - _showQRCodeButton.gameObject.SetActive(value: false); - UIEventListener.Get(_qrCodeSmallTexture.gameObject).onClick = delegate - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.XL); - dialogBase.SetTitleLabel(string.Format(Data.SystemText.Get("Card_0265"), _deckName)); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - GameObject gameObject = new GameObject("QRCodeBigTexture"); - UITexture uITexture = gameObject.AddComponent(); - uITexture.SetRect(0f, 0f, 400f, 400f); - uITexture.mainTexture = QRCodeUtility.CreateQrCodeTexture(508, 508, qrCodeText); - dialogBase.SetObj(gameObject); - _qrCodeDialog = dialogBase; - }; } private void CheckEnableShareButton() @@ -1073,37 +777,6 @@ public class UICardList : MonoBehaviour return false; } - public void SetActiveDeckIntroductionObj(bool isActive) - { - _deckIntroductionRoot.gameObject.SetActive(isActive); - SetGrayOutDeckIntroductionObj(isActive); - } - - public void SetGrayOutDeckIntroductionObj(bool isActive) - { - bool flag = isActive && _deck.IsOutOfRotationFormat && _deck.HasResurgentCard() && !Data.MyRotationAllInfo.IsWithinCopyDeckIntroductionPeriod; - UIManager.SetObjectToGrey(_deckIntroductionRoot, flag); - if (flag) - { - SetShortageCardDisableDefault(); - } - } - - public void SetRedButtonOnClickCallBack(string btnNameText, Action onClickCallback) - { - _redUtilButtonLabel.text = btnNameText; - _redUtilButton.onClick.Clear(); - _redUtilButton.onClick.Add(new EventDelegate(delegate - { - onClickCallback.Call(); - })); - } - - public void SetEnableRedButton(bool isEnable) - { - _redUtilButton.gameObject.SetActive(isEnable); - } - public void SetEnableBlueButton(bool isEnable, string label = null, Action onClickCallback = null) { _blueUtilButtonRoot.SetActive(isEnable); @@ -1129,241 +802,6 @@ public class UICardList : MonoBehaviour _blueUtilButtonRoot.transform.localPosition = localPosition; } - private void OnClickDeckCopy() - { - if (_deck == null) - { - return; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _selectedSubClass = 10; - DialogBase dialog; - if (_formatBehavior.UseSubClass && FormatBehaviorManager.GetDefaultBehaviour(_deck.Format).UseSubClass) - { - dialog = DeckCopyDialog.CreateDeckCopyDialogUseSubClass(_useSubClassDeckCopyDialog3OptionsPrefab, _deck); - } - else - { - dialog = CreateDeckCopyDialog(); - } - dialog.onPushButton1 = delegate - { - if (!_formatBehavior.UseSubClass) - { - DeckIntroductionCopyDialog componentInChildren = dialog.GetComponentInChildren(); - ExecEmptyDeckInfoTask(componentInChildren.IsCopyToMyRotation || componentInChildren.IsResurgentToMyRotationDeck); - } - else if (FormatBehaviorManager.GetDefaultBehaviour(_deck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS)) - { - ExecEmptyDeckInfoTask(isCopyMyRotation: false); - } - else - { - dialog.Close(); - SubClassSelectDialog.Create(_deck, _subClassSelectDialogPrefab, new List(), delegate(int subClassId) - { - _selectedSubClass = subClassId; - ExecEmptyDeckInfoTask(isCopyMyRotation: false); - }); - } - }; - } - - private void ExecEmptyDeckInfoTask(bool isCopyMyRotation) - { - EmptyDeckInfoTask emptyDeckInfoTask = new EmptyDeckInfoTask(); - Format parameter = _deck.DeckCopyFormat; - if (isCopyMyRotation) - { - parameter = Format.MyRotation; - } - emptyDeckInfoTask.SetParameter(parameter); - StartCoroutine(Toolbox.NetworkManager.Connect(emptyDeckInfoTask, delegate - { - OnSuccessEmptyDeckInfoTask(isCopyMyRotation); - })); - } - - private static bool IsTimeSlipRotationDeck(DeckData deck) - { - if (deck.RotationId == null) - { - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - using List.Enumerator enumerator = deck.GetCardIdList().GetEnumerator(); - if (enumerator.MoveNext()) - { - int current = enumerator.Current; - if (!instance.GetCardParameterFromId(current).IsAvailableFormat(Format.Rotation, ClassType.None)) - { - return false; - } - return true; - } - } - return deck.RotationId == Data.Load.data.RotationLatestCardPackId.ToString(); - } - - private DialogBase CreateDeckCopyDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - DeckIntroductionCopyDialog deckIntroductionCopyDialog = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject("UI/DeckList/DeckIntroductionPreferSelect", isServerResources: false)); - deckIntroductionCopyDialog.Initialize(IsTimeSlipRotationDeck(_deck)); - if (Data.MyRotationAllInfo.Get(_deck.MyRotationId) == null && IsConventionDeckIntroduction) - { - deckIntroductionCopyDialog.IsDisableMyRotation = true; - } - deckIntroductionCopyDialog.IsMyRotationDeck = _deck.Format == Format.MyRotation; - dialogBase.SetObj(deckIntroductionCopyDialog.gameObject); - dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0121")); - string labelCopyConfirm = Data.SystemText.Get("Card_0112", _deck.GetDeckName()); - string labelHint; - if (!Data.MyRotationAllInfo.IsWithinCopyDeckIntroductionPeriod || deckIntroductionCopyDialog.IsDisableMyRotation) - { - labelHint = ((!IsTimeSlipRotationDeck(_deck)) ? Data.SystemText.Get("Card_0222") : ""); - } - else if (_deck.Format == Format.Unlimited) - { - labelHint = string.Empty; - deckIntroductionCopyDialog.IsDisableMyRotation = true; - } - else if (_deck.Format == Format.MyRotation) - { - labelHint = string.Empty; - } - else if (IsTimeSlipRotationDeck(_deck)) - { - labelHint = Data.SystemText.Get("Card_0303"); - } - else if (_deck.HasResurgentCard()) - { - labelHint = Data.SystemText.Get("MyRotation_ID_24"); - deckIntroductionCopyDialog.IsResurgentToMyRotationDeck = true; - } - else - { - labelHint = Data.SystemText.Get("MyRotation_ID_05"); - } - deckIntroductionCopyDialog.LabelCopyConfirm = labelCopyConfirm; - deckIntroductionCopyDialog.LabelHint = labelHint; - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Card_0122")); - return dialogBase; - } - - private void OnSuccessEmptyDeckInfoTask(bool isCopyMyRotation) - { - if (Data.EmptyDeckInfo.EmptyDeckID < 0) - { - ShowEmptyDeckNotFoundDialog(isCopyMyRotation); - return; - } - Data.CurrentFormat = _deck.DeckCopyFormat; - ShowCopySceneChangeMessag(isCopyMyRotation); - } - - private void ShowCopySceneChangeMessag(bool isCopyMyRotation) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0214")); - dialogBase.SetText(Data.SystemText.Get("Card_0215")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.onCloseWithoutSelect = delegate - { - _selectedSubClass = 10; - }; - dialogBase.onPushButton1 = delegate - { - bool num = _selectedSubClass != 10; - bool flag = _formatBehavior.UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS); - if (num && !flag) - { - _deck.SetDeckSubClassID(_selectedSubClass); - } - Format format = _deck.DeckCopyFormat; - MyRotationInfo myRotationInfo = null; - if (isCopyMyRotation) - { - format = Format.MyRotation; - myRotationInfo = ((_deck.Format != Format.MyRotation) ? _deck.GetMyRotationInfoFromCardList() : Data.MyRotationAllInfo.Get(_deck.MyRotationId)); - } - DeckData deckData = new DeckData(format, DeckAttributeType.CustomDeck); - deckData.SetDeckID(Data.EmptyDeckInfo.EmptyDeckID); - DeckCardEditUI.SetDeckCopyParameterForDeckIntroduction(deckData, _deck, myRotationInfo); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.DeckCardEdit); - }; - } - - private void ShowEmptyDeckNotFoundDialog(bool isCopyMyRotation) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - SystemText systemText = Data.SystemText; - string formatName = FormatBehaviorManager.GetFormatName(isCopyMyRotation ? Format.MyRotation : _deck.DeckCopyFormat); - dialogBase.SetTitleLabel(systemText.Get("Card_0212")); - dialogBase.SetText(systemText.Get("Card_0213", formatName)); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } - - private void OnClickShortageCardVisibleButton(bool visible) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - SetShortageCardVisible(visible); - } - - public void SetShortageCardVisible(bool visible) - { - _isEnableShortageCardVisible = visible; - _redEtherRoot.gameObject.SetActive(visible); - _deckIntroductionRedEtherOffButton.enabled = visible; - _deckIntroductionRedEtherOnButton.enabled = !visible; - _deckIntroductionRedEtherOffSprite.spriteName = (visible ? "pilltab_02_left_off" : "pilltab_02_left_on"); - _deckIntroductionRedEtherOnSprite.spriteName = (visible ? "pilltab_02_right_on" : "pilltab_02_right_off"); - foreach (CardListTemplate scrollItem in scrollItems) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(_formatBehavior.CardMasterId).GetCardParameterFromId(scrollItem.GetId()); - bool flag = _shortageBasicCardIdList.ContainsKey(cardParameterFromId.BaseCardId); - if (visible && flag) - { - string infoLabelText = Data.SystemText.Get("Card_0209", _shortageBasicCardIdList[cardParameterFromId.BaseCardId].ToString()); - if (cardParameterFromId.IsPreReleaseCard) - { - infoLabelText = Data.SystemText.Get("Card_0245"); - scrollItem.SetInfoLabelTextColor(LabelDefine.TEXT_COLOR_RED); - } - else if (cardParameterFromId.IsBasicCard) - { - infoLabelText = Data.SystemText.Get("Card_0160"); - scrollItem.SetInfoLabelTextColor(LabelDefine.TEXT_COLOR_RED); - } - else - { - scrollItem.SetInfoLabelTextColor(LabelDefine.TEXT_COLOR_NORMAL); - } - scrollItem.AttachGrayShader(); - scrollItem.SetInfoVisible(visible: true); - scrollItem.SetInfoLabelText(infoLabelText); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._atkLabel, inIsPremiere: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._costLabel, inIsPremiere: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._lifeLabel, inIsPremiere: false); - } - else - { - scrollItem.AttachShaders(_formatBehavior.CardMasterId); - scrollItem.SetInfoVisible(visible: false); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._atkLabel, cardParameterFromId.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._costLabel, cardParameterFromId.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(scrollItem._lifeLabel, cardParameterFromId.IsFoil); - } - } - } - - private void SetShortageCardDisableDefault() - { - bool isEnableShortageCardVisible = _isEnableShortageCardVisible; - SetShortageCardVisible(visible: false); - _isEnableShortageCardVisible = isEnableShortageCardVisible; - } - private void InitUseSubClassDisplay() { if (!_formatBehavior.UseSubClass) @@ -1391,40 +829,4 @@ public class UICardList : MonoBehaviour _useSubClassFormatIconSprite.spriteName = _formatBehavior.SmallIconSpriteName; } } - - public bool IsDeckNull() - { - return _deck == null; - } - - public void ReSearchUIRoot() - { - GetComponent().ReSearchUIRoot(); - } - - public void SetPanelSortOrder(int sortOrder) - { - _rootPanel.sortingOrder = sortOrder; - _scrollPanel.sortingOrder = sortOrder + 1; - _costCurvePanel.sortingOrder = sortOrder + 2; - } - - private void KeyboardUpdate() - { - DataMgr.BattleType battleType = GameMgr.GetIns().GetDataMgr().m_BattleType; - if ((battleType == DataMgr.BattleType.FreeBattle || battleType == DataMgr.BattleType.RankBattle) && _loadingEnd && !UIManager.GetInstance().LoadingViewManager.IsEnableInSceneCenterObj() && InputMgr.KeyboardControl) - { - if (GameMgr.GetIns().GetInputMgr().IsKeyboardLeftArrow() || GameMgr.GetIns().GetInputMgr().IsKeyboardRightArrow()) - { - _isSelectCloseButton = true; - _keyboardCloseSelectEffect.SetActive(value: true); - } - if ((GameMgr.GetIns().GetInputMgr().IsKeyboardEnter() && _isSelectCloseButton) || GameMgr.GetIns().GetInputMgr().IsKeyboardCancel()) - { - _isSelectCloseButton = false; - _keyboardCloseSelectEffect.SetActive(value: false); - CloseBtnObj.gameObject.SendMessage("OnClick"); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/UICenterOnChild.cs b/SVSim.BattleEngine/Engine/UICenterOnChild.cs index f6ac9faf..6d98a60e 100644 --- a/SVSim.BattleEngine/Engine/UICenterOnChild.cs +++ b/SVSim.BattleEngine/Engine/UICenterOnChild.cs @@ -26,30 +26,6 @@ public class UICenterOnChild : MonoBehaviour private GameObject mCenteredObject; - public GameObject centeredObject => mCenteredObject; - - private void Start() - { - Recenter(); - } - - private void OnEnable() - { - if ((bool)mScrollView) - { - mScrollView.centerOnChild = this; - Recenter(); - } - } - - private void OnDisable() - { - if ((bool)mScrollView) - { - mScrollView.centerOnChild = null; - } - } - private void OnDragFinished() { if (base.enabled) @@ -58,11 +34,6 @@ public class UICenterOnChild : MonoBehaviour } } - private void OnValidate() - { - nextPageThreshold = Mathf.Abs(nextPageThreshold); - } - [ContextMenu("Execute")] public void Recenter() { diff --git a/SVSim.BattleEngine/Engine/UICenterOnClick.cs b/SVSim.BattleEngine/Engine/UICenterOnClick.cs index 3986ba20..cd1b58c9 100644 --- a/SVSim.BattleEngine/Engine/UICenterOnClick.cs +++ b/SVSim.BattleEngine/Engine/UICenterOnClick.cs @@ -3,40 +3,4 @@ using UnityEngine; [AddComponentMenu("NGUI/Interaction/Center Scroll View on Click")] public class UICenterOnClick : MonoBehaviour { - [SerializeField] - private Transform _otherCenteringTarget; - - private void OnClick() - { - UICenterOnChild uICenterOnChild = NGUITools.FindInParents(base.gameObject); - UIPanel uIPanel = NGUITools.FindInParents(base.gameObject); - if (uICenterOnChild != null) - { - if (uICenterOnChild.enabled) - { - if (_otherCenteringTarget != null) - { - uICenterOnChild.CenterOn(_otherCenteringTarget); - } - else - { - uICenterOnChild.CenterOn(base.transform); - } - } - } - else if (uIPanel != null && uIPanel.clipping != UIDrawCall.Clipping.None) - { - UIScrollView component = uIPanel.GetComponent(); - Vector3 pos = -uIPanel.cachedTransform.InverseTransformPoint(base.transform.position); - if (!component.canMoveHorizontally) - { - pos.x = uIPanel.cachedTransform.localPosition.x; - } - if (!component.canMoveVertically) - { - pos.y = uIPanel.cachedTransform.localPosition.y; - } - SpringPanel.Begin(uIPanel.cachedGameObject, pos, 6f); - } - } } diff --git a/SVSim.BattleEngine/Engine/UICurveLabel.cs b/SVSim.BattleEngine/Engine/UICurveLabel.cs index ac969244..a2405dd5 100644 --- a/SVSim.BattleEngine/Engine/UICurveLabel.cs +++ b/SVSim.BattleEngine/Engine/UICurveLabel.cs @@ -9,8 +9,6 @@ public class UICurveLabel : MonoBehaviour [SerializeField] private AnimationCurve _animationCurve; - private const float HALF_CHARACTER = 0.5f; - private float _timeIntervalCharacter; public void Init(string text) diff --git a/SVSim.BattleEngine/Engine/UIDragDropContainer.cs b/SVSim.BattleEngine/Engine/UIDragDropContainer.cs deleted file mode 100644 index 295b5f16..00000000 --- a/SVSim.BattleEngine/Engine/UIDragDropContainer.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEngine; - -[AddComponentMenu("NGUI/Interaction/Drag and Drop Container")] -public class UIDragDropContainer : MonoBehaviour -{ - public Transform reparentTarget; - - protected virtual void Start() - { - if (reparentTarget == null) - { - reparentTarget = base.transform; - } - } -} diff --git a/SVSim.BattleEngine/Engine/UIDragDropItem.cs b/SVSim.BattleEngine/Engine/UIDragDropItem.cs index 5e9550f6..d914aeb1 100644 --- a/SVSim.BattleEngine/Engine/UIDragDropItem.cs +++ b/SVSim.BattleEngine/Engine/UIDragDropItem.cs @@ -73,18 +73,6 @@ public class UIDragDropItem : MonoBehaviour mCollider2D = base.gameObject.GetComponent(); } - protected virtual void OnEnable() - { - } - - protected virtual void OnDisable() - { - if (mDragging) - { - StopDragging(UICamera.hoveredObject); - } - } - protected virtual void Start() { mButton = GetComponent(); @@ -204,31 +192,6 @@ public class UIDragDropItem : MonoBehaviour { } - protected virtual void OnDrag(Vector2 delta) - { - if (interactable && mDragging && base.enabled && mTouch == UICamera.currentTouch) - { - OnDragDropMove(delta * mRoot.pixelSizeAdjustment); - } - } - - protected virtual void OnDragEnd() - { - if (interactable && base.enabled && mTouch == UICamera.currentTouch) - { - StopDragging(UICamera.hoveredObject); - } - } - - public void StopDragging(GameObject go) - { - if (mDragging) - { - mDragging = false; - OnDragDropRelease(go); - } - } - protected virtual void OnDragDropStart() { if (!draggedItems.Contains(this)) @@ -287,74 +250,4 @@ public class UIDragDropItem : MonoBehaviour { mTrans.localPosition += (Vector3)delta; } - - protected virtual void OnDragDropRelease(GameObject surface) - { - if (!cloneOnDrag) - { - if (mButton != null) - { - mButton.isEnabled = true; - } - else if (mCollider != null) - { - mCollider.enabled = true; - } - else if (mCollider2D != null) - { - mCollider2D.enabled = true; - } - UIDragDropContainer uIDragDropContainer = (surface ? NGUITools.FindInParents(surface) : null); - if (uIDragDropContainer != null) - { - mTrans.parent = ((uIDragDropContainer.reparentTarget != null) ? uIDragDropContainer.reparentTarget : uIDragDropContainer.transform); - Vector3 localPosition = mTrans.localPosition; - localPosition.z = 0f; - mTrans.localPosition = localPosition; - } - else - { - mTrans.parent = mParent; - } - mParent = mTrans.parent; - mGrid = NGUITools.FindInParents(mParent); - mTable = NGUITools.FindInParents(mParent); - if (mDragScrollView != null) - { - StartCoroutine(EnableDragScrollView()); - } - NGUITools.MarkParentAsChanged(base.gameObject); - if (mTable != null) - { - mTable.repositionNow = true; - } - if (!IsGridRepositionUse) - { - mGrid = null; - } - if (mGrid != null) - { - mGrid.repositionNow = true; - } - } - else - { - NGUITools.Destroy(base.gameObject); - } - OnDragDropEnd(); - } - - protected virtual void OnDragDropEnd() - { - draggedItems.Remove(this); - } - - protected IEnumerator EnableDragScrollView() - { - yield return new WaitForEndOfFrame(); - if (mDragScrollView != null) - { - mDragScrollView.enabled = true; - } - } } diff --git a/SVSim.BattleEngine/Engine/UIDragDropRoot.cs b/SVSim.BattleEngine/Engine/UIDragDropRoot.cs index ec0e6c26..e618d9b4 100644 --- a/SVSim.BattleEngine/Engine/UIDragDropRoot.cs +++ b/SVSim.BattleEngine/Engine/UIDragDropRoot.cs @@ -4,17 +4,4 @@ using UnityEngine; public class UIDragDropRoot : MonoBehaviour { public static Transform root; - - private void OnEnable() - { - root = base.transform; - } - - private void OnDisable() - { - if (root == base.transform) - { - root = null; - } - } } diff --git a/SVSim.BattleEngine/Engine/UIDragScrollView.cs b/SVSim.BattleEngine/Engine/UIDragScrollView.cs index 3e904f98..96472337 100644 --- a/SVSim.BattleEngine/Engine/UIDragScrollView.cs +++ b/SVSim.BattleEngine/Engine/UIDragScrollView.cs @@ -5,55 +5,12 @@ public class UIDragScrollView : MonoBehaviour { public UIScrollView scrollView; - [HideInInspector] - [SerializeField] - private UIScrollView draggablePanel; - private Transform mTrans; private UIScrollView mScroll; private bool mAutoFind; - private bool mStarted; - - public bool _dragEnabled = true; - - private void OnEnable() - { - mTrans = base.transform; - if (scrollView == null && draggablePanel != null) - { - scrollView = draggablePanel; - draggablePanel = null; - } - if (mStarted && (mAutoFind || mScroll == null)) - { - FindScrollView(); - } - } - - private void Start() - { - mStarted = true; - FindScrollView(); - } - - private void FindScrollView() - { - UIScrollView uIScrollView = NGUITools.FindInParents(mTrans); - if (scrollView == null || (mAutoFind && uIScrollView != scrollView)) - { - scrollView = uIScrollView; - mAutoFind = true; - } - else if (scrollView == uIScrollView) - { - mAutoFind = true; - } - mScroll = scrollView; - } - private void OnPress(bool pressed) { if (mAutoFind && mScroll != scrollView) @@ -71,28 +28,4 @@ public class UIDragScrollView : MonoBehaviour } } } - - private void OnDrag(Vector2 delta) - { - if (_dragEnabled && (bool)scrollView && NGUITools.GetActive(this)) - { - scrollView.Drag(); - } - } - - private void OnScroll(float delta) - { - if ((bool)scrollView && NGUITools.GetActive(this)) - { - scrollView.Scroll(delta); - } - } - - public void OnPan(Vector2 delta) - { - if ((bool)scrollView && NGUITools.GetActive(this)) - { - scrollView.OnPan(delta); - } - } } diff --git a/SVSim.BattleEngine/Engine/UIDrawCall.cs b/SVSim.BattleEngine/Engine/UIDrawCall.cs index 121407a6..72a7336d 100644 --- a/SVSim.BattleEngine/Engine/UIDrawCall.cs +++ b/SVSim.BattleEngine/Engine/UIDrawCall.cs @@ -104,21 +104,12 @@ public class UIDrawCall : MonoBehaviour public OnRenderCallback onRender; - private const int maxIndexBufferCache = 10; - private static List mCache = new List(10); private static int[] ClipRange = null; private static int[] ClipArgs = null; - [Obsolete("Use UIDrawCall.activeList")] - public static BetterList list => mActiveList; - - public static BetterList activeList => mActiveList; - - public static BetterList inactiveList => mInactiveList; - public int renderQueue { get @@ -157,18 +148,6 @@ public class UIDrawCall : MonoBehaviour } } - public int finalRenderQueue - { - get - { - if (!(mDynamicMat != null)) - { - return mRenderQueue; - } - return mDynamicMat.renderQueue; - } - } - public Transform cachedTransform { get @@ -197,8 +176,6 @@ public class UIDrawCall : MonoBehaviour } } - public Material dynamicMaterial => mDynamicMat; - public Texture mainTexture { get @@ -231,18 +208,6 @@ public class UIDrawCall : MonoBehaviour } } - public int triangles - { - get - { - if (!(mMesh != null)) - { - return 0; - } - return mTriangles; - } - } - public bool isClipped => mClipCount != 0; private void CreateMaterial() @@ -360,11 +325,6 @@ public class UIDrawCall : MonoBehaviour return false; } - public void SetDisableLegacyShader() - { - mLegacyShader = false; - } - private Material RebuildMaterial() { NGUITools.DestroyImmediate(mDynamicMat); @@ -546,105 +506,6 @@ public class UIDrawCall : MonoBehaviour return array2; } - private void OnWillRenderObject() - { - UpdateMaterials(); - if (onRender != null) - { - onRender(mDynamicMat ?? mMaterial); - } - if (mDynamicMat == null || mClipCount == 0) - { - return; - } - if (mTextureClip) - { - Vector4 drawCallClipRange = panel.drawCallClipRange; - Vector2 clipSoftness = panel.clipSoftness; - Vector2 vector = new Vector2(1000f, 1000f); - if (clipSoftness.x > 0f) - { - vector.x = drawCallClipRange.z / clipSoftness.x; - } - if (clipSoftness.y > 0f) - { - vector.y = drawCallClipRange.w / clipSoftness.y; - } - mDynamicMat.SetVector(ClipRange[0], new Vector4((0f - drawCallClipRange.x) / drawCallClipRange.z, (0f - drawCallClipRange.y) / drawCallClipRange.w, 1f / drawCallClipRange.z, 1f / drawCallClipRange.w)); - mDynamicMat.SetTexture("_ClipTex", clipTexture); - } - else if (!mLegacyShader) - { - UIPanel parentPanel = panel; - int num = 0; - while (parentPanel != null) - { - if (parentPanel.hasClipping) - { - float angle = 0f; - Vector4 drawCallClipRange2 = parentPanel.drawCallClipRange; - if (parentPanel != panel) - { - Vector3 vector2 = parentPanel.cachedTransform.InverseTransformPoint(panel.cachedTransform.position); - drawCallClipRange2.x -= vector2.x; - drawCallClipRange2.y -= vector2.y; - Vector3 eulerAngles = panel.cachedTransform.rotation.eulerAngles; - Vector3 vector3 = parentPanel.cachedTransform.rotation.eulerAngles - eulerAngles; - vector3.x = NGUIMath.WrapAngle(vector3.x); - vector3.y = NGUIMath.WrapAngle(vector3.y); - vector3.z = NGUIMath.WrapAngle(vector3.z); - if (!(Mathf.Abs(vector3.x) > 0.001f)) - { - Mathf.Abs(vector3.y); - _ = 0.001f; - } - angle = vector3.z; - } - SetClipping(num++, drawCallClipRange2, parentPanel.clipSoftness, angle); - } - parentPanel = parentPanel.parentPanel; - } - } - else - { - Vector2 clipSoftness2 = panel.clipSoftness; - Vector4 drawCallClipRange3 = panel.drawCallClipRange; - Vector2 mainTextureOffset = new Vector2((0f - drawCallClipRange3.x) / drawCallClipRange3.z, (0f - drawCallClipRange3.y) / drawCallClipRange3.w); - Vector2 mainTextureScale = new Vector2(1f / drawCallClipRange3.z, 1f / drawCallClipRange3.w); - Vector2 vector4 = new Vector2(1000f, 1000f); - if (clipSoftness2.x > 0f) - { - vector4.x = drawCallClipRange3.z / clipSoftness2.x; - } - if (clipSoftness2.y > 0f) - { - vector4.y = drawCallClipRange3.w / clipSoftness2.y; - } - mDynamicMat.mainTextureOffset = mainTextureOffset; - mDynamicMat.mainTextureScale = mainTextureScale; - mDynamicMat.SetVector("_ClipSharpness", vector4); - } - } - - private void SetClipping(int index, Vector4 cr, Vector2 soft, float angle) - { - angle *= -(float)Math.PI / 180f; - Vector2 vector = new Vector2(1000f, 1000f); - if (soft.x > 0f) - { - vector.x = cr.z / soft.x; - } - if (soft.y > 0f) - { - vector.y = cr.w / soft.y; - } - if (index < ClipRange.Length) - { - mDynamicMat.SetVector(ClipRange[index], new Vector4((0f - cr.x) / cr.z, (0f - cr.y) / cr.w, 1f / cr.z, 1f / cr.w)); - mDynamicMat.SetVector(ClipArgs[index], new Vector4(vector.x, vector.y, Mathf.Sin(angle), Mathf.Cos(angle))); - } - } - private void Awake() { if (ClipRange == null) @@ -669,34 +530,6 @@ public class UIDrawCall : MonoBehaviour } } - private void OnEnable() - { - mRebuildMat = true; - } - - private void OnDisable() - { - depthStart = int.MaxValue; - depthEnd = int.MinValue; - panel = null; - manager = null; - mMaterial = null; - mTexture = null; - clipTexture = null; - if (mRenderer != null) - { - mRenderer.sharedMaterials = new Material[0]; - } - NGUITools.DestroyImmediate(mDynamicMat); - mDynamicMat = null; - } - - private void OnDestroy() - { - NGUITools.DestroyImmediate(mMesh); - mMesh = null; - } - public static UIDrawCall Create(UIPanel panel, Material mat, Texture tex, Shader shader) { return Create(null, panel, mat, tex, shader); @@ -777,19 +610,6 @@ public class UIDrawCall : MonoBehaviour mInactiveList.Clear(); } - public static int Count(UIPanel panel) - { - int num = 0; - for (int i = 0; i < mActiveList.size; i++) - { - if (mActiveList[i].manager == panel) - { - num++; - } - } - return num; - } - public static void Destroy(UIDrawCall dc) { if (!dc) diff --git a/SVSim.BattleEngine/Engine/UIEventListener.cs b/SVSim.BattleEngine/Engine/UIEventListener.cs index c359cc11..fed0bfcb 100644 --- a/SVSim.BattleEngine/Engine/UIEventListener.cs +++ b/SVSim.BattleEngine/Engine/UIEventListener.cs @@ -15,10 +15,6 @@ public class UIEventListener : MonoBehaviour public delegate void KeyCodeDelegate(GameObject go, KeyCode key); - public object parameter; - - public VoidDelegate onSubmit; - public VoidDelegate onClick; public VoidDelegate onDoubleClick; @@ -37,18 +33,10 @@ public class UIEventListener : MonoBehaviour public VoidDelegate onDragOver; - public VoidDelegate onDragOut; - public VoidDelegate onDragEnd; - public ObjectDelegate onDrop; - - public KeyCodeDelegate onKey; - public BoolDelegate onTooltip; - public VoidDelegate onClickRight; - public BoolDelegate onPressRight; private bool isColliderEnabled @@ -69,30 +57,6 @@ public class UIEventListener : MonoBehaviour } } - private void OnSubmit() - { - if (isColliderEnabled && onSubmit != null) - { - onSubmit(base.gameObject); - } - } - - private void OnClick() - { - if (isColliderEnabled && onClick != null) - { - onClick(base.gameObject); - } - } - - private void OnDoubleClick() - { - if (isColliderEnabled && onDoubleClick != null) - { - onDoubleClick(base.gameObject); - } - } - private void OnHover(bool isOver) { if (isColliderEnabled && onHover != null) @@ -117,70 +81,6 @@ public class UIEventListener : MonoBehaviour } } - private void OnScroll(float delta) - { - if (isColliderEnabled && onScroll != null) - { - onScroll(base.gameObject, delta); - } - } - - private void OnDragStart() - { - if (onDragStart != null) - { - onDragStart(base.gameObject); - } - } - - private void OnDrag(Vector2 delta) - { - if (onDrag != null) - { - onDrag(base.gameObject, delta); - } - } - - private void OnDragOver() - { - if (isColliderEnabled && onDragOver != null) - { - onDragOver(base.gameObject); - } - } - - private void OnDragOut() - { - if (isColliderEnabled && onDragOut != null) - { - onDragOut(base.gameObject); - } - } - - private void OnDragEnd() - { - if (onDragEnd != null) - { - onDragEnd(base.gameObject); - } - } - - private void OnDrop(GameObject go) - { - if (isColliderEnabled && onDrop != null) - { - onDrop(base.gameObject, go); - } - } - - private void OnKey(KeyCode key) - { - if (isColliderEnabled && onKey != null) - { - onKey(base.gameObject, key); - } - } - private void OnTooltip(bool show) { if (isColliderEnabled && onTooltip != null) @@ -189,22 +89,6 @@ public class UIEventListener : MonoBehaviour } } - private void OnClickRight() - { - if (isColliderEnabled && onClickRight != null) - { - onClickRight(base.gameObject); - } - } - - private void OnPressRight(bool isPressed) - { - if (isColliderEnabled && onPressRight != null) - { - onPressRight(base.gameObject, isPressed); - } - } - public static UIEventListener Get(GameObject go) { UIEventListener uIEventListener = go.GetComponent(); diff --git a/SVSim.BattleEngine/Engine/UIFont.cs b/SVSim.BattleEngine/Engine/UIFont.cs index d2fefabe..697be214 100644 --- a/SVSim.BattleEngine/Engine/UIFont.cs +++ b/SVSim.BattleEngine/Engine/UIFont.cs @@ -232,9 +232,6 @@ public class UIFont : MonoBehaviour } } - [Obsolete("Use UIFont.premultipliedAlphaShader instead")] - public bool premultipliedAlpha => premultipliedAlphaShader; - public bool premultipliedAlphaShader { get @@ -346,31 +343,6 @@ public class UIFont : MonoBehaviour } } - public bool isValid - { - get - { - if (!(mDynamicFont != null)) - { - return mFont.isValid; - } - return true; - } - } - - [Obsolete("Use UIFont.defaultSize instead")] - public int size - { - get - { - return defaultSize; - } - set - { - defaultSize = value; - } - } - public int defaultSize { get @@ -639,27 +611,6 @@ public class UIFont : MonoBehaviour } } - private BMSymbol GetSymbol(string sequence, bool createIfMissing) - { - int i = 0; - for (int count = mSymbols.Count; i < count; i++) - { - BMSymbol bMSymbol = mSymbols[i]; - if (bMSymbol.sequence == sequence) - { - return bMSymbol; - } - } - if (createIfMissing) - { - BMSymbol bMSymbol2 = new BMSymbol(); - bMSymbol2.sequence = sequence; - mSymbols.Add(bMSymbol2); - return bMSymbol2; - } - return null; - } - public BMSymbol MatchSymbol(string text, int offset, int textLength) { int count = mSymbols.Count; @@ -692,51 +643,4 @@ public class UIFont : MonoBehaviour } return null; } - - public void AddSymbol(string sequence, string spriteName) - { - GetSymbol(sequence, createIfMissing: true).spriteName = spriteName; - MarkAsChanged(); - } - - public void RemoveSymbol(string sequence) - { - BMSymbol symbol = GetSymbol(sequence, createIfMissing: false); - if (symbol != null) - { - symbols.Remove(symbol); - } - MarkAsChanged(); - } - - public void RenameSymbol(string before, string after) - { - BMSymbol symbol = GetSymbol(before, createIfMissing: false); - if (symbol != null) - { - symbol.sequence = after; - } - MarkAsChanged(); - } - - public bool UsesSprite(string s) - { - if (!string.IsNullOrEmpty(s)) - { - if (s.Equals(spriteName)) - { - return true; - } - int i = 0; - for (int count = symbols.Count; i < count; i++) - { - BMSymbol bMSymbol = symbols[i]; - if (s.Equals(bMSymbol.spriteName)) - { - return true; - } - } - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/UIGeometry.cs b/SVSim.BattleEngine/Engine/UIGeometry.cs index 230652d0..9d2483a2 100644 --- a/SVSim.BattleEngine/Engine/UIGeometry.cs +++ b/SVSim.BattleEngine/Engine/UIGeometry.cs @@ -16,18 +16,6 @@ public class UIGeometry public bool hasVertices => verts.size > 0; - public bool hasTransformed - { - get - { - if (mRtpVerts != null && mRtpVerts.size > 0) - { - return mRtpVerts.size == verts.size; - } - return false; - } - } - public void Clear() { verts.Clear(); diff --git a/SVSim.BattleEngine/Engine/UIGrid.cs b/SVSim.BattleEngine/Engine/UIGrid.cs index a44ac3bd..fd82108b 100644 --- a/SVSim.BattleEngine/Engine/UIGrid.cs +++ b/SVSim.BattleEngine/Engine/UIGrid.cs @@ -10,7 +10,6 @@ public class UIGrid : UIWidgetContainer public enum Arrangement { Horizontal, - Vertical, CellSnap } @@ -105,21 +104,6 @@ public class UIGrid : UIWidgetContainer return list; } - public Transform GetChild(int index) - { - List childList = GetChildList(); - if (index >= childList.Count) - { - return null; - } - return childList[index]; - } - - public int GetIndex(Transform trans) - { - return GetChildList().IndexOf(trans); - } - public void AddChild(Transform trans) { AddChild(trans, sort: true); @@ -151,33 +135,6 @@ public class UIGrid : UIWidgetContainer mPanel = NGUITools.FindInParents(base.gameObject); } - protected virtual void Start() - { - if (!mInitDone) - { - Init(); - } - bool flag = animateSmoothly; - animateSmoothly = false; - Reposition(); - animateSmoothly = flag; - base.enabled = false; - } - - protected virtual void Update() - { - Reposition(); - base.enabled = false; - } - - private void OnValidate() - { - if (!Application.isPlaying && NGUITools.GetActive(this)) - { - Reposition(); - } - } - public static int SortByName(Transform a, Transform b) { return string.Compare(a.name, b.name); diff --git a/SVSim.BattleEngine/Engine/UIInput.cs b/SVSim.BattleEngine/Engine/UIInput.cs index a3810dd9..c42d9d64 100644 --- a/SVSim.BattleEngine/Engine/UIInput.cs +++ b/SVSim.BattleEngine/Engine/UIInput.cs @@ -8,8 +8,6 @@ public class UIInput : MonoBehaviour { public enum InputType { - Standard, - AutoCorrect, Password } @@ -26,20 +24,11 @@ public class UIInput : MonoBehaviour public enum KeyboardType { - Default, - ASCIICapable, - NumbersAndPunctuation, - URL, - NumberPad, - PhonePad, - NamePhonePad, - EmailAddress - } + Default } public enum OnReturnKey { Default, - Submit, NewLine } @@ -59,8 +48,6 @@ public class UIInput : MonoBehaviour public KeyboardType keyboardType; - public bool hideInput; - [NonSerialized] public bool selectAllTextOnFocus = true; @@ -70,10 +57,6 @@ public class UIInput : MonoBehaviour public string savedAs; - [HideInInspector] - [SerializeField] - private GameObject selectOnTab; - public Color activeTextColor = Color.white; public Color caretColor = new Color(1f, 1f, 1f, 0.8f); @@ -137,9 +120,6 @@ public class UIInput : MonoBehaviour [NonSerialized] protected float mLastAlpha; - [NonSerialized] - protected string mCached = ""; - [NonSerialized] protected int mSelectMe = -1; @@ -157,52 +137,6 @@ public class UIInput : MonoBehaviour private static int mIgnoreKey = 0; - public string defaultText - { - get - { - if (mDoInit) - { - Init(); - } - return mDefaultText; - } - set - { - if (mDoInit) - { - Init(); - } - mDefaultText = value; - UpdateLabel(); - } - } - - public bool inputShouldBeHidden - { - get - { - if (hideInput && label != null && !label.multiLine) - { - return inputType != InputType.Password; - } - return false; - } - } - - [Obsolete("Use UIInput.value instead")] - public string text - { - get - { - return value; - } - set - { - this.value = value; - } - } - public string value { get @@ -253,19 +187,6 @@ public class UIInput : MonoBehaviour } } - [Obsolete("Use UIInput.isSelected instead")] - public bool selected - { - get - { - return isSelected; - } - set - { - isSelected = value; - } - } - public bool isSelected { get @@ -348,8 +269,6 @@ public class UIInput : MonoBehaviour } } - public UITexture caret => mCaret; - public string Validate(string val) { if (string.IsNullOrEmpty(val)) @@ -380,27 +299,6 @@ public class UIInput : MonoBehaviour return stringBuilder.ToString(); } - private void Start() - { - if (selectOnTab != null) - { - if (GetComponent() == null) - { - base.gameObject.AddComponent().onDown = selectOnTab; - } - selectOnTab = null; - NGUITools.SetDirty(this); - } - if (mLoadSavedValue && !string.IsNullOrEmpty(savedAs)) - { - LoadValue(); - } - else - { - value = mValue.Replace("\\n", "\n"); - } - } - protected void Init() { if (mDoInit && label != null) @@ -648,199 +546,6 @@ public class UIInput : MonoBehaviour Insert(""); } - public virtual bool ProcessEvent(Event ev) - { - if (label == null) - { - return false; - } - RuntimePlatform platform = Application.platform; - bool flag = ((platform == RuntimePlatform.OSXEditor || platform == RuntimePlatform.OSXPlayer) ? ((ev.modifiers & EventModifiers.Command) != 0) : ((ev.modifiers & EventModifiers.Control) != 0)); - if ((ev.modifiers & EventModifiers.Alt) != EventModifiers.None) - { - flag = false; - } - bool flag2 = (ev.modifiers & EventModifiers.Shift) != 0; - switch (ev.keyCode) - { - case KeyCode.Backspace: - ev.Use(); - DoBackspace(); - return true; - case KeyCode.Delete: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - if (mSelectionStart == mSelectionEnd) - { - if (mSelectionStart >= mValue.Length) - { - return true; - } - mSelectionEnd++; - } - Insert(""); - } - return true; - case KeyCode.LeftArrow: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - mSelectionEnd = Mathf.Max(mSelectionEnd - 1, 0); - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.RightArrow: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - mSelectionEnd = Mathf.Min(mSelectionEnd + 1, mValue.Length); - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.PageUp: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - mSelectionEnd = 0; - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.PageDown: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - mSelectionEnd = mValue.Length; - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.Home: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - if (label.multiLine) - { - mSelectionEnd = label.GetCharacterIndex(mSelectionEnd, KeyCode.Home); - } - else - { - mSelectionEnd = 0; - } - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.End: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - if (label.multiLine) - { - mSelectionEnd = label.GetCharacterIndex(mSelectionEnd, KeyCode.End); - } - else - { - mSelectionEnd = mValue.Length; - } - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.UpArrow: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - mSelectionEnd = label.GetCharacterIndex(mSelectionEnd, KeyCode.UpArrow); - if (mSelectionEnd != 0) - { - mSelectionEnd += mDrawStart; - } - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.DownArrow: - ev.Use(); - if (!string.IsNullOrEmpty(mValue)) - { - mSelectionEnd = label.GetCharacterIndex(mSelectionEnd, KeyCode.DownArrow); - if (mSelectionEnd != label.processedText.Length) - { - mSelectionEnd += mDrawStart; - } - else - { - mSelectionEnd = mValue.Length; - } - if (!flag2) - { - mSelectionStart = mSelectionEnd; - } - UpdateLabel(); - } - return true; - case KeyCode.A: - if (flag) - { - ev.Use(); - mSelectionStart = 0; - mSelectionEnd = mValue.Length; - UpdateLabel(); - } - return true; - case KeyCode.C: - if (flag) - { - ev.Use(); - NGUITools.clipboard = GetSelection(); - } - return true; - case KeyCode.V: - if (flag) - { - ev.Use(); - Insert(NGUITools.clipboard); - isAfterPaste = true; - } - return true; - case KeyCode.X: - if (flag) - { - ev.Use(); - NGUITools.clipboard = GetSelection(); - Insert(""); - } - return true; - default: - return false; - } - } - protected virtual void Insert(string text, bool dontAddCompositionString = false) { string leftText = GetLeftText(); @@ -918,17 +623,6 @@ public class UIInput : MonoBehaviour return ""; } - protected string GetSelection() - { - if (string.IsNullOrEmpty(mValue) || mSelectionStart == mSelectionEnd) - { - return ""; - } - int num = Mathf.Min(mSelectionStart, mSelectionEnd); - int num2 = Mathf.Max(mSelectionStart, mSelectionEnd); - return mValue.Substring(num, num2 - num); - } - protected int GetCharUnderMouse() { if (string.IsNullOrEmpty(label.text)) @@ -956,19 +650,6 @@ public class UIInput : MonoBehaviour } } - protected virtual void OnDrag(Vector2 delta) - { - if (label != null && (UICamera.currentScheme == UICamera.ControlScheme.Mouse || UICamera.currentScheme == UICamera.ControlScheme.Touch)) - { - selectionEnd = GetCharUnderMouse(); - } - } - - private void OnDisable() - { - Cleanup(); - } - protected virtual void Cleanup() { if ((bool)mHighlight) @@ -1312,21 +993,6 @@ public class UIInput : MonoBehaviour { } - public void SaveValue() - { - SaveToPlayerPrefs(mValue); - } - - public void LoadValue() - { - if (!string.IsNullOrEmpty(savedAs)) - { - string text = mValue.Replace("\\n", "\n"); - mValue = ""; - value = (PlayerPrefs.HasKey(savedAs) ? PlayerPrefs.GetString(savedAs) : text); - } - } - private bool UpdateFromInput(string inputString, string compositionString, bool forceInsert = false) { bool result = false; diff --git a/SVSim.BattleEngine/Engine/UIInputOnGUI.cs b/SVSim.BattleEngine/Engine/UIInputOnGUI.cs index 352c5cb5..5690c7f7 100644 --- a/SVSim.BattleEngine/Engine/UIInputOnGUI.cs +++ b/SVSim.BattleEngine/Engine/UIInputOnGUI.cs @@ -4,13 +4,6 @@ using UnityEngine; [RequireComponent(typeof(UIInput))] public class UIInputOnGUI : MonoBehaviour { - private const int KEY_LEFT = 28; - - private const int KEY_RIGHT = 29; - - private const int KEY_UP = 30; - - private const int KEY_DOWN = 31; [NonSerialized] private UIInput mInput; @@ -19,12 +12,4 @@ public class UIInputOnGUI : MonoBehaviour { mInput = GetComponent(); } - - private void OnGUI() - { - if (Event.current.rawType == EventType.KeyDown) - { - mInput.ProcessEvent(Event.current); - } - } } diff --git a/SVSim.BattleEngine/Engine/UIKeyNavigation.cs b/SVSim.BattleEngine/Engine/UIKeyNavigation.cs index 58daaf8f..21ab8e81 100644 --- a/SVSim.BattleEngine/Engine/UIKeyNavigation.cs +++ b/SVSim.BattleEngine/Engine/UIKeyNavigation.cs @@ -24,30 +24,10 @@ public class UIKeyNavigation : MonoBehaviour public GameObject onRight; - public GameObject onClick; - public GameObject onTab; - public bool startsSelected; - - [NonSerialized] - private bool mStarted; - public static int mLastFrame = 0; - public static UIKeyNavigation current - { - get - { - GameObject hoveredObject = UICamera.hoveredObject; - if (hoveredObject == null) - { - return null; - } - return hoveredObject.GetComponent(); - } - } - public bool isColliderEnabled { get @@ -70,29 +50,6 @@ public class UIKeyNavigation : MonoBehaviour } } - protected virtual void OnEnable() - { - list.Add(this); - if (mStarted) - { - Start(); - } - } - - private void Start() - { - mStarted = true; - if (startsSelected && isColliderEnabled) - { - UICamera.hoveredObject = base.gameObject; - } - } - - protected virtual void OnDisable() - { - list.Remove(this); - } - private static bool IsActive(GameObject go) { if ((bool)go && go.activeInHierarchy) @@ -224,34 +181,6 @@ public class UIKeyNavigation : MonoBehaviour return go.transform.position; } - public virtual void OnNavigate(KeyCode key) - { - if (!UIPopupList.isOpen && mLastFrame != Time.frameCount) - { - mLastFrame = Time.frameCount; - GameObject gameObject = null; - switch (key) - { - case KeyCode.LeftArrow: - gameObject = GetLeft(); - break; - case KeyCode.RightArrow: - gameObject = GetRight(); - break; - case KeyCode.UpArrow: - gameObject = GetUp(); - break; - case KeyCode.DownArrow: - gameObject = GetDown(); - break; - } - if (gameObject != null) - { - UICamera.hoveredObject = gameObject; - } - } - } - public virtual void OnKey(KeyCode key) { if (UIPopupList.isOpen || mLastFrame == Time.frameCount) @@ -310,12 +239,4 @@ public class UIKeyNavigation : MonoBehaviour } } } - - protected virtual void OnClick() - { - if (NGUITools.GetActive(onClick)) - { - UICamera.hoveredObject = onClick; - } - } } diff --git a/SVSim.BattleEngine/Engine/UILabel.cs b/SVSim.BattleEngine/Engine/UILabel.cs index 5fc0cf4f..798f0599 100644 --- a/SVSim.BattleEngine/Engine/UILabel.cs +++ b/SVSim.BattleEngine/Engine/UILabel.cs @@ -11,7 +11,6 @@ public class UILabel : UIWidget public enum Effect { None, - Shadow, Outline, Outline8 } @@ -26,12 +25,7 @@ public class UILabel : UIWidget public enum Crispness { - Never, - OnDesktop, - Always - } - - public Crispness keepCrispWhenShrunk = Crispness.OnDesktop; +} private static bool OnFontChangedFlg = false; @@ -210,8 +204,6 @@ public class UILabel : UIWidget private string _originalText; - public Action OnWindowResize; - private static BetterList mList = new BetterList(); private static Dictionary mFontUsage = new Dictionary(); @@ -234,18 +226,6 @@ public class UILabel : UIWidget public float DotMargin => m_WizardDotMargin; - public int finalFontSize - { - get - { - if ((bool)trueTypeFont) - { - return Mathf.RoundToInt(mScale * (float)mFinalFontSize); - } - return Mathf.RoundToInt((float)mFinalFontSize * mScale); - } - } - private bool shouldBeProcessed { get @@ -319,19 +299,6 @@ public class UILabel : UIWidget } } - [Obsolete("Use UILabel.bitmapFont instead")] - public UIFont font - { - get - { - return bitmapFont; - } - set - { - bitmapFont = value; - } - } - public UIFont bitmapFont { get @@ -471,23 +438,6 @@ public class UILabel : UIWidget } } - public FontStyle fontStyle - { - get - { - return mFontStyle; - } - set - { - if (mFontStyle != value) - { - mFontStyle = value; - shouldBeProcessed = true; - ProcessAndRequest(); - } - } - } - public NGUIText.Alignment alignment { get @@ -570,22 +520,6 @@ public class UILabel : UIWidget } } - public int spacingX - { - get - { - return mSpacingX; - } - set - { - if (mSpacingX != value) - { - mSpacingX = value; - MarkAsChanged(); - } - } - } - public int spacingY { get @@ -602,54 +536,6 @@ public class UILabel : UIWidget } } - public bool useFloatSpacing - { - get - { - return mUseFloatSpacing; - } - set - { - if (mUseFloatSpacing != value) - { - mUseFloatSpacing = value; - shouldBeProcessed = true; - } - } - } - - public float floatSpacingX - { - get - { - return mFloatSpacingX; - } - set - { - if (!Mathf.Approximately(mFloatSpacingX, value)) - { - mFloatSpacingX = value; - MarkAsChanged(); - } - } - } - - public float floatSpacingY - { - get - { - return mFloatSpacingY; - } - set - { - if (!Mathf.Approximately(mFloatSpacingY, value)) - { - mFloatSpacingY = value; - MarkAsChanged(); - } - } - } - public float effectiveSpacingY { get @@ -708,22 +594,6 @@ public class UILabel : UIWidget } } - public NGUIText.SymbolStyle symbolStyle - { - get - { - return mSymbols; - } - set - { - if (mSymbols != value) - { - mSymbols = value; - shouldBeProcessed = true; - } - } - } - public Overflow overflowMethod { get @@ -740,32 +610,6 @@ public class UILabel : UIWidget } } - [Obsolete("Use 'width' instead")] - public int lineWidth - { - get - { - return base.width; - } - set - { - base.width = value; - } - } - - [Obsolete("Use 'height' instead")] - public int lineHeight - { - get - { - return base.height; - } - set - { - base.height = value; - } - } - public bool multiLine { get @@ -889,22 +733,6 @@ public class UILabel : UIWidget } } - [Obsolete("Use 'overflowMethod == UILabel.Overflow.ShrinkContent' instead")] - public bool shrinkToFit - { - get - { - return mOverflow == Overflow.ShrinkContent; - } - set - { - if (value) - { - overflowMethod = Overflow.ShrinkContent; - } - } - } - public string processedText { get @@ -965,18 +793,6 @@ public class UILabel : UIWidget text = Global.GetConvertWrapText(this, s); } - public void WrapOnResize() - { - if (_originalText != null) - { - text = Global.GetConvertWrapText(this, _originalText); - } - if (OnWindowResize != null) - { - OnWindowResize(); - } - } - protected override void OnInit() { base.OnInit(); @@ -1131,17 +947,6 @@ public class UILabel : UIWidget } } - public void RefreshCustom() - { - SetActiveFont(null); - mList.Remove(this); - RemoveFromPanel(); - if (base.isActiveAndEnabled) - { - base.OnEnable(); - } - } - protected override void OnStart() { base.OnStart(); @@ -1310,12 +1115,6 @@ public class UILabel : UIWidget } } - private IEnumerator FontRefreshCoroutine() - { - yield return null; - Invalidate(includeChildren: false); - } - private static void FontReflash(UnityEngine.Font font) { OnFontChangedFlg = false; @@ -1420,46 +1219,6 @@ public class UILabel : UIWidget } } - [Obsolete("Use UILabel.GetCharacterAtPosition instead")] - public int GetCharacterIndex(Vector3 worldPos) - { - return GetCharacterIndexAtPosition(worldPos, precise: false); - } - - [Obsolete("Use UILabel.GetCharacterAtPosition instead")] - public int GetCharacterIndex(Vector2 localPos) - { - return GetCharacterIndexAtPosition(localPos, precise: false); - } - - public int GetCharacterIndexAtPositionRangeSpecification(Vector3 worldPos, List rangeList) - { - if (isValid) - { - Vector2 pos = base.cachedTransform.InverseTransformPoint(worldPos); - string value = processedText; - if (string.IsNullOrEmpty(value)) - { - return 0; - } - UpdateNGUIText(); - NGUIText.PrintApproximateCharacterPositions(value, mTempVerts, mTempIndices); - if (mTempVerts.size > 0) - { - ApplyOffset(mTempVerts, 0); - int nearCharacterIndex = NGUIText.GetNearCharacterIndex(mTempVerts, mTempIndices, pos, rangeList); - mTempVerts.Clear(); - mTempIndices.Clear(); - NGUIText.bitmapFont = null; - NGUIText.dynamicFont = null; - return nearCharacterIndex; - } - NGUIText.bitmapFont = null; - NGUIText.dynamicFont = null; - } - return 0; - } - public int GetCharacterIndexAtPosition(Vector3 worldPos, bool precise) { Vector2 localPos = base.cachedTransform.InverseTransformPoint(worldPos); @@ -1500,137 +1259,6 @@ public class UILabel : UIWidget return 0; } - public string GetWordAtPosition(Vector3 worldPos) - { - int characterIndexAtPosition = GetCharacterIndexAtPosition(worldPos, precise: true); - return GetWordAtCharacterIndex(characterIndexAtPosition); - } - - public string GetWordAtPosition(Vector2 localPos) - { - int characterIndexAtPosition = GetCharacterIndexAtPosition(localPos, precise: true); - return GetWordAtCharacterIndex(characterIndexAtPosition); - } - - public string GetWordAtCharacterIndex(int characterIndex) - { - if (characterIndex != -1 && characterIndex < mText.Length) - { - int num = mText.LastIndexOfAny(new char[2] { ' ', '\n' }, characterIndex) + 1; - int num2 = mText.IndexOfAny(new char[4] { ' ', '\n', ',', '.' }, characterIndex); - if (num2 == -1) - { - num2 = mText.Length; - } - if (num != num2) - { - int num3 = num2 - num; - if (num3 > 0) - { - return NGUIText.StripSymbols(mText.Substring(num, num3)); - } - } - } - return null; - } - - public string GetUrlAtPosition(Vector3 worldPos) - { - return GetUrlAtCharacterIndex(GetCharacterIndexAtPosition(worldPos, precise: true)); - } - - public string GetUrlAtPosition(Vector2 localPos) - { - return GetUrlAtCharacterIndex(GetCharacterIndexAtPosition(localPos, precise: true)); - } - - public string GetUrlAtCharacterIndex(int characterIndex) - { - if (characterIndex != -1 && characterIndex < mText.Length - 6) - { - int num = ((mText[characterIndex] != '[' || mText[characterIndex + 1] != 'u' || mText[characterIndex + 2] != 'r' || mText[characterIndex + 3] != 'l' || mText[characterIndex + 4] != '=') ? mText.LastIndexOf("[url=", characterIndex) : characterIndex); - if (num == -1) - { - return null; - } - num += 5; - int num2 = mText.IndexOf("]", num); - if (num2 == -1) - { - return null; - } - int num3 = mText.IndexOf("[/url]", num2); - if (num3 == -1 || characterIndex <= num3) - { - return mText.Substring(num, num2 - num); - } - } - return null; - } - - public int GetCharacterIndex(int currentIndex, KeyCode key) - { - if (isValid) - { - string text = processedText; - if (string.IsNullOrEmpty(text)) - { - return 0; - } - int num = defaultFontSize; - UpdateNGUIText(); - NGUIText.PrintApproximateCharacterPositions(text, mTempVerts, mTempIndices); - if (mTempVerts.size > 0) - { - ApplyOffset(mTempVerts, 0); - for (int i = 0; i < mTempIndices.size; i++) - { - if (mTempIndices[i] == currentIndex) - { - Vector2 pos = mTempVerts[i]; - switch (key) - { - case KeyCode.UpArrow: - pos.y += (float)num + effectiveSpacingY; - break; - case KeyCode.DownArrow: - pos.y -= (float)num + effectiveSpacingY; - break; - case KeyCode.Home: - pos.x -= 1000f; - break; - case KeyCode.End: - pos.x += 1000f; - break; - } - int approximateCharacterIndex = NGUIText.GetApproximateCharacterIndex(mTempVerts, mTempIndices, pos); - if (approximateCharacterIndex == currentIndex) - { - break; - } - mTempVerts.Clear(); - mTempIndices.Clear(); - return approximateCharacterIndex; - } - } - mTempVerts.Clear(); - mTempIndices.Clear(); - } - NGUIText.bitmapFont = null; - NGUIText.dynamicFont = null; - switch (key) - { - case KeyCode.UpArrow: - case KeyCode.Home: - return 0; - case KeyCode.DownArrow: - case KeyCode.End: - return text.Length; - } - } - return currentIndex; - } - public void PrintOverlay(int start, int end, UIGeometry caret, UIGeometry highlight, Color caretColor, Color highlightColor) { caret?.Clear(); @@ -1798,30 +1426,6 @@ public class UILabel : UIWidget return result; } - public void SetCurrentProgress() - { - if (UIProgressBar.current != null) - { - text = UIProgressBar.current.value.ToString("F"); - } - } - - public void SetCurrentPercent() - { - if (UIProgressBar.current != null) - { - text = Mathf.RoundToInt(UIProgressBar.current.value * 100f) + "%"; - } - } - - public void SetCurrentSelection() - { - if (UIPopupList.current != null) - { - text = (UIPopupList.current.isLocalized ? Localization.Get(UIPopupList.current.value) : UIPopupList.current.value); - } - } - public bool Wrap(string text, out string final) { return Wrap(text, out final, 1000000); @@ -1930,12 +1534,4 @@ public class UILabel : UIWidget } NGUIText.Update(base.rawPivot); } - - private void OnApplicationPause(bool paused) - { - if (!paused && mTrueTypeFont != null) - { - Invalidate(includeChildren: false); - } - } } diff --git a/SVSim.BattleEngine/Engine/UIOrthoCamera.cs b/SVSim.BattleEngine/Engine/UIOrthoCamera.cs deleted file mode 100644 index 2e29c93f..00000000 --- a/SVSim.BattleEngine/Engine/UIOrthoCamera.cs +++ /dev/null @@ -1,28 +0,0 @@ -using UnityEngine; - -[ExecuteInEditMode] -[RequireComponent(typeof(Camera))] -[AddComponentMenu("NGUI/UI/Orthographic Camera")] -public class UIOrthoCamera : MonoBehaviour -{ - private Camera mCam; - - private Transform mTrans; - - private void Start() - { - mCam = GetComponent(); - mTrans = base.transform; - mCam.orthographic = true; - } - - private void Update() - { - float num = mCam.rect.yMin * (float)Screen.height; - float num2 = (mCam.rect.yMax * (float)Screen.height - num) * 0.5f * mTrans.lossyScale.y; - if (!Mathf.Approximately(mCam.orthographicSize, num2)) - { - mCam.orthographicSize = num2; - } - } -} diff --git a/SVSim.BattleEngine/Engine/UIPanel.cs b/SVSim.BattleEngine/Engine/UIPanel.cs index e1ba8f2c..671eb011 100644 --- a/SVSim.BattleEngine/Engine/UIPanel.cs +++ b/SVSim.BattleEngine/Engine/UIPanel.cs @@ -21,8 +21,6 @@ public class UIPanel : UIRect public OnGeometryUpdated onGeometryUpdated; - public bool showInPanelTool = true; - public bool generateNormals; public bool widgetsAreStatic; @@ -116,24 +114,6 @@ public class UIPanel : UIRect private bool mForced; - public static int nextUnusedDepth - { - get - { - int num = int.MinValue; - int i = 0; - for (int count = list.Count; i < count; i++) - { - num = Mathf.Max(num, list[i].depth); - } - if (num != int.MinValue) - { - return num + 1; - } - return 0; - } - } - public override bool canBeAnchored => mClipping != UIDrawCall.Clipping.None; public override float alpha @@ -187,8 +167,6 @@ public class UIPanel : UIRect } } - public float width => GetViewSize().x; - public float height => GetViewSize().y; public bool halfPixelOffset => mHalfPixelOffset; @@ -266,23 +244,8 @@ public class UIPanel : UIRect } } - public bool hasClipping - { - get - { - if (mClipping != UIDrawCall.Clipping.SoftClip) - { - return mClipping == UIDrawCall.Clipping.TextureMask; - } - return true; - } - } - public bool hasCumulativeClipping => clipCount != 0; - [Obsolete("Use 'hasClipping' or 'hasCumulativeClipping' instead")] - public bool clipsChildren => hasCumulativeClipping; - public Vector2 clipOffset { get @@ -303,34 +266,6 @@ public class UIPanel : UIRect } } - public Texture2D clipTexture - { - get - { - return mClipTexture; - } - set - { - if (mClipTexture != value) - { - mClipTexture = value; - } - } - } - - [Obsolete("Use 'finalClipRegion' or 'baseClipRegion' instead")] - public Vector4 clipRange - { - get - { - return baseClipRegion; - } - set - { - baseClipRegion = value; - } - } - public Vector4 baseClipRegion { get @@ -631,37 +566,6 @@ public class UIPanel : UIRect return true; } - public bool IsVisible(Vector3 worldPos) - { - if (mAlpha < 0.001f) - { - return false; - } - if (mClipping == UIDrawCall.Clipping.None || mClipping == UIDrawCall.Clipping.ConstrainButDontClip) - { - return true; - } - UpdateTransformMatrix(); - Vector3 vector = worldToLocal.MultiplyPoint3x4(worldPos); - if (vector.x < mMin.x) - { - return false; - } - if (vector.y < mMin.y) - { - return false; - } - if (vector.x > mMax.x) - { - return false; - } - if (vector.y > mMax.y) - { - return false; - } - return true; - } - public bool IsVisible(UIWidget w) { UIPanel uIPanel = this; @@ -686,33 +590,6 @@ public class UIPanel : UIRect return true; } - public bool Affects(UIWidget w) - { - if (w == null) - { - return false; - } - UIPanel panel = w.panel; - if (panel == null) - { - return false; - } - UIPanel uIPanel = this; - while (uIPanel != null) - { - if (uIPanel == panel) - { - return true; - } - if (!uIPanel.hasCumulativeClipping) - { - return false; - } - uIPanel = uIPanel.mParentPanel; - } - return false; - } - [ContextMenu("Force Refresh")] public void RebuildAllDrawCalls() { @@ -1479,16 +1356,6 @@ public class UIPanel : UIRect return ConstrainTargetToBounds(target, ref targetBounds, immediate); } - public static UIPanel Find(Transform trans) - { - return Find(trans, createIfMissing: false, -1); - } - - public static UIPanel Find(Transform trans, bool createIfMissing) - { - return Find(trans, createIfMissing, -1); - } - public static UIPanel Find(Transform trans, bool createIfMissing, int layer) { UIPanel uIPanel = NGUITools.FindInParents(trans); diff --git a/SVSim.BattleEngine/Engine/UIPlaySound.cs b/SVSim.BattleEngine/Engine/UIPlaySound.cs deleted file mode 100644 index c40f23bf..00000000 --- a/SVSim.BattleEngine/Engine/UIPlaySound.cs +++ /dev/null @@ -1,115 +0,0 @@ -using UnityEngine; - -[AddComponentMenu("NGUI/Interaction/Play Sound")] -public class UIPlaySound : MonoBehaviour -{ - public enum Trigger - { - OnClick, - OnMouseOver, - OnMouseOut, - OnPress, - OnRelease, - Custom, - OnEnable, - OnDisable - } - - public AudioClip audioClip; - - public Trigger trigger; - - [Range(0f, 1f)] - public float volume = 1f; - - [Range(0f, 2f)] - public float pitch = 1f; - - private bool mIsOver; - - private bool canPlay - { - get - { - if (!base.enabled) - { - return false; - } - UIButton component = GetComponent(); - if (!(component == null)) - { - return component.isEnabled; - } - return true; - } - } - - private void OnEnable() - { - if (trigger == Trigger.OnEnable) - { - NGUITools.PlaySound(audioClip, volume, pitch); - } - } - - private void OnDisable() - { - if (trigger == Trigger.OnDisable) - { - NGUITools.PlaySound(audioClip, volume, pitch); - } - } - - private void OnHover(bool isOver) - { - if (trigger == Trigger.OnMouseOver) - { - if (mIsOver == isOver) - { - return; - } - mIsOver = isOver; - } - if (canPlay && ((isOver && trigger == Trigger.OnMouseOver) || (!isOver && trigger == Trigger.OnMouseOut))) - { - NGUITools.PlaySound(audioClip, volume, pitch); - } - } - - private void OnPress(bool isPressed) - { - if (trigger == Trigger.OnPress) - { - if (mIsOver == isPressed) - { - return; - } - mIsOver = isPressed; - } - if (canPlay && ((isPressed && trigger == Trigger.OnPress) || (!isPressed && trigger == Trigger.OnRelease))) - { - NGUITools.PlaySound(audioClip, volume, pitch); - } - } - - private void OnClick() - { - if (canPlay && trigger == Trigger.OnClick) - { - NGUITools.PlaySound(audioClip, volume, pitch); - } - } - - private void OnSelect(bool isSelected) - { - if (canPlay && (!isSelected || UICamera.currentScheme == UICamera.ControlScheme.Controller)) - { - OnHover(isSelected); - } - } - - public void Play() - { - NGUITools.PlaySound(audioClip, volume, pitch); - } -} diff --git a/SVSim.BattleEngine/Engine/UIPopupList.cs b/SVSim.BattleEngine/Engine/UIPopupList.cs index 45842481..70625c7e 100644 --- a/SVSim.BattleEngine/Engine/UIPopupList.cs +++ b/SVSim.BattleEngine/Engine/UIPopupList.cs @@ -9,17 +9,10 @@ public class UIPopupList : UIWidgetContainer { public enum Position { - Auto, - Above, - Below - } +} public enum OpenOn { - ClickOrTap, - RightClick, - DoubleClick, - Manual } public delegate void LegacyEvent(string val); @@ -30,56 +23,20 @@ public class UIPopupList : UIWidgetContainer private static float mFadeOutComplete; - private const float animSpeed = 0.15f; - - public UIAtlas atlas; - - public UIFont bitmapFont; - - public Font trueTypeFont; - - public int fontSize = 16; - - public FontStyle fontStyle; - - public string backgroundSprite; - - public string highlightSprite; - public Position position; - public NGUIText.Alignment alignment = NGUIText.Alignment.Left; - public List items = new List(); public List itemData = new List(); - public Vector2 padding = new Vector3(4f, 4f); - - public Color textColor = Color.white; - - public Color backgroundColor = Color.white; - - public Color highlightColor = new Color(0.88235295f, 40f / 51f, 0.5882353f, 1f); - public bool isAnimated = true; - public bool isLocalized; - - public bool separatePanel = true; - - public OpenOn openOn; - public List onChange = new List(); [HideInInspector] [SerializeField] protected string mSelectedItem; - [HideInInspector] - [SerializeField] - protected UIPanel mPanel; - [HideInInspector] [SerializeField] protected UISprite mBackground; @@ -88,24 +45,13 @@ public class UIPopupList : UIWidgetContainer [SerializeField] protected UISprite mHighlight; - [HideInInspector] - [SerializeField] - protected UILabel mHighlightedLabel; - [HideInInspector] [SerializeField] protected List mLabelList = new List(); - [HideInInspector] - [SerializeField] - protected float mBgBorder; - [NonSerialized] protected GameObject mSelection; - [NonSerialized] - protected int mOpenFrame; - [HideInInspector] [SerializeField] private GameObject eventReceiver; @@ -114,73 +60,13 @@ public class UIPopupList : UIWidgetContainer [SerializeField] private string functionName = "OnSelectionChange"; - [HideInInspector] - [SerializeField] - private float textScale; - - [HideInInspector] - [SerializeField] - private UIFont font; - - [HideInInspector] - [SerializeField] - private UILabel textLabel; - private LegacyEvent mLegacyEvent; [NonSerialized] protected bool mExecuting; - protected bool mUseDynamicFont; - - protected bool mTweening; - public GameObject source; - public UnityEngine.Object ambigiousFont - { - get - { - if (trueTypeFont != null) - { - return trueTypeFont; - } - if (bitmapFont != null) - { - return bitmapFont; - } - return font; - } - set - { - if (value is Font) - { - trueTypeFont = value as Font; - bitmapFont = null; - font = null; - } - else if (value is UIFont) - { - bitmapFont = value as UIFont; - trueTypeFont = null; - font = null; - } - } - } - - [Obsolete("Use EventDelegate.Add(popup.onChange, YourCallback) instead, and UIPopupList.current.value to determine the state")] - public LegacyEvent onSelectionChange - { - get - { - return mLegacyEvent; - } - set - { - mLegacyEvent = value; - } - } - public static bool isOpen { get @@ -226,111 +112,6 @@ public class UIPopupList : UIWidgetContainer } } - public bool isColliderEnabled - { - get - { - Collider component = GetComponent(); - if (component != null) - { - return component.enabled; - } - Collider2D component2 = GetComponent(); - if (component2 != null) - { - return component2.enabled; - } - return false; - } - } - - [Obsolete("Use 'value' instead")] - public string selection - { - get - { - return value; - } - set - { - this.value = value; - } - } - - private bool isValid - { - get - { - if (!(bitmapFont != null)) - { - return trueTypeFont != null; - } - return true; - } - } - - private int activeFontSize - { - get - { - if (!(trueTypeFont != null) && !(bitmapFont == null)) - { - return bitmapFont.defaultSize; - } - return fontSize; - } - } - - private float activeFontScale - { - get - { - if (!(trueTypeFont != null) && !(bitmapFont == null)) - { - return (float)fontSize / (float)bitmapFont.defaultSize; - } - return 1f; - } - } - - public virtual void Clear() - { - items.Clear(); - itemData.Clear(); - } - - public virtual void AddItem(string text) - { - items.Add(text); - itemData.Add(null); - } - - public virtual void AddItem(string text, object data) - { - items.Add(text); - itemData.Add(data); - } - - public virtual void RemoveItem(string text) - { - int num = items.IndexOf(text); - if (num != -1) - { - items.RemoveAt(num); - itemData.RemoveAt(num); - } - } - - public virtual void RemoveItemByData(object data) - { - int num = itemData.IndexOf(data); - if (num != -1) - { - items.RemoveAt(num); - itemData.RemoveAt(num); - } - } - protected void TriggerCallbacks() { if (!mExecuting) @@ -355,237 +136,6 @@ public class UIPopupList : UIWidgetContainer } } - protected virtual void OnEnable() - { - if (EventDelegate.IsValid(onChange)) - { - eventReceiver = null; - functionName = null; - } - if (font != null) - { - if (font.isDynamic) - { - trueTypeFont = font.dynamicFont; - fontStyle = font.dynamicFontStyle; - mUseDynamicFont = true; - } - else if (bitmapFont == null) - { - bitmapFont = font; - mUseDynamicFont = false; - } - font = null; - } - if (textScale != 0f) - { - fontSize = ((bitmapFont != null) ? Mathf.RoundToInt((float)bitmapFont.defaultSize * textScale) : 16); - textScale = 0f; - } - if (trueTypeFont == null && bitmapFont != null && bitmapFont.isDynamic) - { - trueTypeFont = bitmapFont.dynamicFont; - bitmapFont = null; - } - } - - protected virtual void OnValidate() - { - Font font = trueTypeFont; - UIFont uIFont = bitmapFont; - bitmapFont = null; - trueTypeFont = null; - if (font != null && (uIFont == null || !mUseDynamicFont)) - { - bitmapFont = null; - trueTypeFont = font; - mUseDynamicFont = true; - } - else if (uIFont != null) - { - if (uIFont.isDynamic) - { - trueTypeFont = uIFont.dynamicFont; - fontStyle = uIFont.dynamicFontStyle; - fontSize = uIFont.defaultSize; - mUseDynamicFont = true; - } - else - { - bitmapFont = uIFont; - mUseDynamicFont = false; - } - } - else - { - trueTypeFont = font; - mUseDynamicFont = true; - } - } - - protected virtual void Start() - { - if (textLabel != null) - { - EventDelegate.Add(onChange, textLabel.SetCurrentSelection); - textLabel = null; - } - if (Application.isPlaying) - { - if (string.IsNullOrEmpty(mSelectedItem) && items.Count > 0) - { - mSelectedItem = items[0]; - } - if (!string.IsNullOrEmpty(mSelectedItem)) - { - TriggerCallbacks(); - } - } - } - - protected virtual void OnLocalize() - { - if (isLocalized) - { - TriggerCallbacks(); - } - } - - protected virtual void Highlight(UILabel lbl, bool instant) - { - if (!(mHighlight != null)) - { - return; - } - mHighlightedLabel = lbl; - if (mHighlight.GetAtlasSprite() == null) - { - return; - } - Vector3 highlightPosition = GetHighlightPosition(); - if (!instant && isAnimated) - { - TweenPosition.Begin(mHighlight.gameObject, 0.1f, highlightPosition).method = UITweener.Method.EaseOut; - if (!mTweening) - { - mTweening = true; - StartCoroutine("UpdateTweenPosition"); - } - } - else - { - mHighlight.cachedTransform.localPosition = highlightPosition; - } - } - - protected virtual Vector3 GetHighlightPosition() - { - if (mHighlightedLabel == null || mHighlight == null) - { - return Vector3.zero; - } - UISpriteData atlasSprite = mHighlight.GetAtlasSprite(); - if (atlasSprite == null) - { - return Vector3.zero; - } - float pixelSize = atlas.pixelSize; - float num = (float)atlasSprite.borderLeft * pixelSize; - float y = (float)atlasSprite.borderTop * pixelSize; - return mHighlightedLabel.cachedTransform.localPosition + new Vector3(0f - num, y, 1f); - } - - protected virtual IEnumerator UpdateTweenPosition() - { - if (mHighlight != null && mHighlightedLabel != null) - { - TweenPosition tp = mHighlight.GetComponent(); - while (tp != null && tp.enabled) - { - tp.to = GetHighlightPosition(); - yield return null; - } - } - mTweening = false; - } - - protected virtual void OnItemHover(GameObject go, bool isOver) - { - if (isOver) - { - UILabel component = go.GetComponent(); - Highlight(component, instant: false); - } - } - - protected virtual void OnItemPress(GameObject go, bool isPressed) - { - if (!isPressed) - { - return; - } - Select(go.GetComponent(), instant: true); - UIEventListener component = go.GetComponent(); - value = component.parameter as string; - UIPlaySound[] components = GetComponents(); - int i = 0; - for (int num = components.Length; i < num; i++) - { - UIPlaySound uIPlaySound = components[i]; - if (uIPlaySound.trigger == UIPlaySound.Trigger.OnClick) - { - NGUITools.PlaySound(uIPlaySound.audioClip, uIPlaySound.volume, 1f); - } - } - CloseSelf(); - } - - private void Select(UILabel lbl, bool instant) - { - Highlight(lbl, instant); - } - - protected virtual void OnNavigate(KeyCode key) - { - if (!base.enabled || !(current == this)) - { - return; - } - int num = mLabelList.IndexOf(mHighlightedLabel); - if (num == -1) - { - num = 0; - } - switch (key) - { - case KeyCode.UpArrow: - if (num > 0) - { - Select(mLabelList[--num], instant: false); - } - break; - case KeyCode.DownArrow: - if (num + 1 < mLabelList.Count) - { - Select(mLabelList[++num], instant: false); - } - break; - } - } - - protected virtual void OnKey(KeyCode key) - { - if (base.enabled && current == this && (key == UICamera.current.cancelKey0 || key == UICamera.current.cancelKey1)) - { - OnSelect(isSelected: false); - } - } - - protected virtual void OnDisable() - { - CloseSelf(); - } - protected virtual void OnSelect(bool isSelected) { if (!isSelected) @@ -643,69 +193,6 @@ public class UIPopupList : UIWidgetContainer current = null; } - protected virtual void AnimateColor(UIWidget widget) - { - Color color = widget.color; - widget.color = new Color(color.r, color.g, color.b, 0f); - TweenColor.Begin(widget.gameObject, 0.15f, color).method = UITweener.Method.EaseOut; - } - - protected virtual void AnimatePosition(UIWidget widget, bool placeAbove, float bottom) - { - Vector3 localPosition = widget.cachedTransform.localPosition; - Vector3 localPosition2 = (placeAbove ? new Vector3(localPosition.x, bottom, localPosition.z) : new Vector3(localPosition.x, 0f, localPosition.z)); - widget.cachedTransform.localPosition = localPosition2; - TweenPosition.Begin(widget.gameObject, 0.15f, localPosition).method = UITweener.Method.EaseOut; - } - - protected virtual void AnimateScale(UIWidget widget, bool placeAbove, float bottom) - { - GameObject go = widget.gameObject; - Transform cachedTransform = widget.cachedTransform; - float num = (float)activeFontSize * activeFontScale + mBgBorder * 2f; - cachedTransform.localScale = new Vector3(1f, num / (float)widget.height, 1f); - TweenScale.Begin(go, 0.15f, Vector3.one).method = UITweener.Method.EaseOut; - if (placeAbove) - { - Vector3 localPosition = cachedTransform.localPosition; - cachedTransform.localPosition = new Vector3(localPosition.x, localPosition.y - (float)widget.height + num, localPosition.z); - TweenPosition.Begin(go, 0.15f, localPosition).method = UITweener.Method.EaseOut; - } - } - - private void Animate(UIWidget widget, bool placeAbove, float bottom) - { - AnimateColor(widget); - AnimatePosition(widget, placeAbove, bottom); - } - - protected virtual void OnClick() - { - if (mOpenFrame == Time.frameCount) - { - return; - } - if (mChild == null) - { - if (openOn != OpenOn.DoubleClick && openOn != OpenOn.Manual && (openOn != OpenOn.RightClick || UICamera.currentTouchID == -2)) - { - Show(); - } - } - else if (mHighlightedLabel != null) - { - OnItemPress(mHighlightedLabel.gameObject, isPressed: true); - } - } - - protected virtual void OnDoubleClick() - { - if (openOn == OpenOn.DoubleClick) - { - Show(); - } - } - private IEnumerator CloseIfUnselected() { do @@ -715,219 +202,4 @@ public class UIPopupList : UIWidgetContainer while (!(UICamera.selectedObject != mSelection)); CloseSelf(); } - - public virtual void Show() - { - if (base.enabled && NGUITools.GetActive(base.gameObject) && mChild == null && atlas != null && isValid && items.Count > 0) - { - mLabelList.Clear(); - StopCoroutine("CloseIfUnselected"); - UICamera.selectedObject = UICamera.hoveredObject ?? base.gameObject; - mSelection = UICamera.selectedObject; - source = UICamera.selectedObject; - if (source == null) - { - Debug.LogError("Popup list needs a source object..."); - return; - } - mOpenFrame = Time.frameCount; - if (mPanel == null) - { - mPanel = UIPanel.Find(base.transform); - if (mPanel == null) - { - return; - } - } - mChild = new GameObject("Drop-down List"); - mChild.layer = base.gameObject.layer; - if (separatePanel) - { - if (GetComponent() != null) - { - mChild.AddComponent().isKinematic = true; - } - else if (GetComponent() != null) - { - mChild.AddComponent().isKinematic = true; - } - mChild.AddComponent().depth = 1000000; - } - current = this; - Transform transform = mChild.transform; - transform.parent = mPanel.cachedTransform; - Vector3 vector2; - Vector3 vector3; - Vector3 vector; - if (openOn == OpenOn.Manual && mSelection != base.gameObject) - { - vector = UICamera.lastEventPosition; - vector2 = mPanel.cachedTransform.InverseTransformPoint(mPanel.anchorCamera.ScreenToWorldPoint(vector)); - vector3 = vector2; - transform.localPosition = vector2; - vector = transform.position; - } - else - { - Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(mPanel.cachedTransform, base.transform, considerInactive: false, considerChildren: false); - vector2 = bounds.min; - vector3 = bounds.max; - transform.localPosition = vector2; - vector = transform.position; - } - StartCoroutine("CloseIfUnselected"); - transform.localRotation = Quaternion.identity; - transform.localScale = Vector3.one; - mBackground = NGUITools.AddSprite(mChild, atlas, backgroundSprite, (!separatePanel) ? NGUITools.CalculateNextDepth(mPanel.gameObject) : 0); - mBackground.pivot = UIWidget.Pivot.TopLeft; - mBackground.color = backgroundColor; - Vector4 border = mBackground.border; - mBgBorder = border.y; - mBackground.cachedTransform.localPosition = new Vector3(0f, border.y, 0f); - mHighlight = NGUITools.AddSprite(mChild, atlas, highlightSprite, mBackground.depth + 1); - mHighlight.pivot = UIWidget.Pivot.TopLeft; - mHighlight.color = highlightColor; - UISpriteData atlasSprite = mHighlight.GetAtlasSprite(); - if (atlasSprite == null) - { - return; - } - float num = atlasSprite.borderTop; - float num2 = activeFontSize; - float num3 = activeFontScale; - float num4 = num2 * num3; - float a = 0f; - float num5 = 0f - padding.y; - List list = new List(); - if (!items.Contains(mSelectedItem)) - { - mSelectedItem = null; - } - int i = 0; - for (int count = items.Count; i < count; i++) - { - string text = items[i]; - UILabel uILabel = NGUITools.AddWidget(mChild, mBackground.depth + 2); - uILabel.name = i.ToString(); - uILabel.pivot = UIWidget.Pivot.TopLeft; - uILabel.bitmapFont = bitmapFont; - uILabel.trueTypeFont = trueTypeFont; - uILabel.fontSize = fontSize; - uILabel.fontStyle = fontStyle; - uILabel.text = (isLocalized ? Localization.Get(text) : text); - uILabel.color = textColor; - uILabel.cachedTransform.localPosition = new Vector3(border.x + padding.x - uILabel.pivotOffset.x, num5, -1f); - uILabel.overflowMethod = UILabel.Overflow.ResizeFreely; - uILabel.alignment = alignment; - list.Add(uILabel); - num5 -= num4; - num5 -= padding.y; - a = Mathf.Max(a, uILabel.printedSize.x); - UIEventListener uIEventListener = UIEventListener.Get(uILabel.gameObject); - uIEventListener.onHover = OnItemHover; - uIEventListener.onPress = OnItemPress; - uIEventListener.parameter = text; - if (mSelectedItem == text || (i == 0 && string.IsNullOrEmpty(mSelectedItem))) - { - Highlight(uILabel, instant: true); - } - mLabelList.Add(uILabel); - } - a = Mathf.Max(a, vector3.x - vector2.x - (border.x + padding.x) * 2f); - float num6 = a; - Vector3 vector4 = new Vector3(num6 * 0.5f, (0f - num4) * 0.5f, 0f); - Vector3 vector5 = new Vector3(num6, num4 + padding.y, 1f); - int j = 0; - for (int count2 = list.Count; j < count2; j++) - { - UILabel uILabel2 = list[j]; - NGUITools.AddWidgetCollider(uILabel2.gameObject); - uILabel2.autoResizeBoxCollider = false; - BoxCollider component = uILabel2.GetComponent(); - if (component != null) - { - vector4.z = component.center.z; - component.center = vector4; - component.size = vector5; - } - else - { - BoxCollider2D component2 = uILabel2.GetComponent(); - component2.offset = vector4; - component2.size = vector5; - } - } - int width = Mathf.RoundToInt(a); - a += (border.x + padding.x) * 2f; - num5 -= border.y; - mBackground.width = Mathf.RoundToInt(a); - mBackground.height = Mathf.RoundToInt(0f - num5 + border.y); - int k = 0; - for (int count3 = list.Count; k < count3; k++) - { - UILabel uILabel3 = list[k]; - uILabel3.overflowMethod = UILabel.Overflow.ShrinkContent; - uILabel3.width = width; - } - float num7 = 2f * atlas.pixelSize; - float f = a - (border.x + padding.x) * 2f + (float)atlasSprite.borderLeft * num7; - float f2 = num4 + num * num7; - mHighlight.width = Mathf.RoundToInt(f); - mHighlight.height = Mathf.RoundToInt(f2); - bool flag = position == Position.Above; - if (position == Position.Auto) - { - UICamera uICamera = UICamera.FindCameraForLayer(mSelection.layer); - if (uICamera != null) - { - flag = uICamera.cachedCamera.WorldToViewportPoint(vector).y < 0.5f; - } - } - if (isAnimated) - { - AnimateColor(mBackground); - if (Time.timeScale == 0f || Time.timeScale >= 0.1f) - { - float bottom = num5 + num4; - Animate(mHighlight, flag, bottom); - int l = 0; - for (int count4 = list.Count; l < count4; l++) - { - Animate(list[l], flag, bottom); - } - AnimateScale(mBackground, flag, bottom); - } - } - if (flag) - { - vector2.y = vector3.y - border.y; - vector3.y = vector2.y + (float)mBackground.height; - vector3.x = vector2.x + (float)mBackground.width; - transform.localPosition = new Vector3(vector2.x, vector3.y - border.y, vector2.z); - } - else - { - vector3.y = vector2.y + border.y; - vector2.y = vector3.y - (float)mBackground.height; - vector3.x = vector2.x + (float)mBackground.width; - } - Transform parent = mPanel.cachedTransform.parent; - if (parent != null) - { - vector2 = mPanel.cachedTransform.TransformPoint(vector2); - vector3 = mPanel.cachedTransform.TransformPoint(vector3); - vector2 = parent.InverseTransformPoint(vector2); - vector3 = parent.InverseTransformPoint(vector3); - } - Vector3 vector6 = (mPanel.hasClipping ? Vector3.zero : mPanel.CalculateConstrainOffset(vector2, vector3)); - vector = transform.localPosition + vector6; - vector.x = Mathf.Round(vector.x); - vector.y = Mathf.Round(vector.y); - transform.localPosition = vector; - } - else - { - OnSelect(isSelected: false); - } - } } diff --git a/SVSim.BattleEngine/Engine/UIProgressBar.cs b/SVSim.BattleEngine/Engine/UIProgressBar.cs index a8451b19..970321b3 100644 --- a/SVSim.BattleEngine/Engine/UIProgressBar.cs +++ b/SVSim.BattleEngine/Engine/UIProgressBar.cs @@ -105,22 +105,6 @@ public class UIProgressBar : UIWidgetContainer } } - public FillDirection fillDirection - { - get - { - return mFill; - } - set - { - if (mFill != value) - { - mFill = value; - ForceUpdate(); - } - } - } - public float value { get @@ -237,26 +221,6 @@ public class UIProgressBar : UIWidgetContainer } } - protected void Start() - { - Upgrade(); - if (Application.isPlaying) - { - if (mBG != null) - { - mBG.autoResizeBoxCollider = true; - } - OnStart(); - if (current == null && onChange != null) - { - current = this; - EventDelegate.Execute(onChange); - current = null; - } - } - ForceUpdate(); - } - protected virtual void Upgrade() { } @@ -273,45 +237,6 @@ public class UIProgressBar : UIWidgetContainer } } - protected void OnValidate() - { - if (NGUITools.GetActive(this)) - { - Upgrade(); - mIsDirty = true; - float num = Mathf.Clamp01(mValue); - if (mValue != num) - { - mValue = num; - } - if (numberOfSteps < 0) - { - numberOfSteps = 0; - } - else if (numberOfSteps > 20) - { - numberOfSteps = 20; - } - ForceUpdate(); - } - else - { - float num2 = Mathf.Clamp01(mValue); - if (mValue != num2) - { - mValue = num2; - } - if (numberOfSteps < 0) - { - numberOfSteps = 0; - } - else if (numberOfSteps > 20) - { - numberOfSteps = 20; - } - } - } - protected float ScreenToValue(Vector2 screenPos) { Transform transform = cachedTransform; diff --git a/SVSim.BattleEngine/Engine/UIRect.cs b/SVSim.BattleEngine/Engine/UIRect.cs index 0c767bc9..8b5601e7 100644 --- a/SVSim.BattleEngine/Engine/UIRect.cs +++ b/SVSim.BattleEngine/Engine/UIRect.cs @@ -33,37 +33,6 @@ public abstract class UIRect : MonoBehaviour this.absolute = Mathf.FloorToInt(absolute + 0.5f); } - public void Set(Transform target, float relative, float absolute) - { - this.target = target; - this.relative = relative; - this.absolute = Mathf.FloorToInt(absolute + 0.5f); - } - - public void SetToNearest(float abs0, float abs1, float abs2) - { - SetToNearest(0f, 0.5f, 1f, abs0, abs1, abs2); - } - - public void SetToNearest(float rel0, float rel1, float rel2, float abs0, float abs1, float abs2) - { - float num = Mathf.Abs(abs0); - float num2 = Mathf.Abs(abs1); - float num3 = Mathf.Abs(abs2); - if (num < num2 && num < num3) - { - Set(rel0, abs0); - } - else if (num2 < num && num2 < num3) - { - Set(rel1, abs1); - } - else - { - Set(rel2, abs2); - } - } - public void SetHorizontal(Transform parent, float localPos) { if ((bool)rect) @@ -118,9 +87,7 @@ public abstract class UIRect : MonoBehaviour public enum AnchorUpdate { OnEnable, - OnUpdate, - OnStart - } + OnUpdate } public AnchorPoint leftAnchor = new AnchorPoint(); @@ -440,13 +407,6 @@ public abstract class UIRect : MonoBehaviour _hasTrans = true; } - protected void Start() - { - mStarted = true; - OnInit(); - OnStart(); - } - public void Update() { if (!mAnchorsCached) @@ -529,36 +489,6 @@ public abstract class UIRect : MonoBehaviour UpdateAnchors(); } - public void SetAnchor(GameObject go) - { - Transform target = ((go != null) ? go.transform : null); - leftAnchor.target = target; - rightAnchor.target = target; - topAnchor.target = target; - bottomAnchor.target = target; - ResetAnchors(); - UpdateAnchors(); - } - - public void SetAnchor(GameObject go, int left, int bottom, int right, int top) - { - Transform target = ((go != null) ? go.transform : null); - leftAnchor.target = target; - rightAnchor.target = target; - topAnchor.target = target; - bottomAnchor.target = target; - leftAnchor.relative = 0f; - rightAnchor.relative = 1f; - bottomAnchor.relative = 0f; - topAnchor.relative = 1f; - leftAnchor.absolute = left; - rightAnchor.absolute = right; - bottomAnchor.absolute = bottom; - topAnchor.absolute = top; - ResetAnchors(); - UpdateAnchors(); - } - public void ResetAnchors() { mAnchorsCached = true; diff --git a/SVSim.BattleEngine/Engine/UIRoot.cs b/SVSim.BattleEngine/Engine/UIRoot.cs index c6d8b1e4..fd97c436 100644 --- a/SVSim.BattleEngine/Engine/UIRoot.cs +++ b/SVSim.BattleEngine/Engine/UIRoot.cs @@ -143,16 +143,6 @@ public class UIRoot : MonoBehaviour } } - public static float GetPixelSizeAdjustment(GameObject go) - { - UIRoot uIRoot = NGUITools.FindInParents(go); - if (!(uIRoot != null)) - { - return 1f; - } - return uIRoot.pixelSizeAdjustment; - } - public float GetPixelSizeAdjustment(int height) { height = Mathf.Max(2, height); @@ -175,91 +165,4 @@ public class UIRoot : MonoBehaviour { mTrans = base.transform; } - - protected virtual void OnEnable() - { - list.Add(this); - } - - protected virtual void OnDisable() - { - list.Remove(this); - } - - protected virtual void Start() - { - UIOrthoCamera componentInChildren = GetComponentInChildren(); - if (componentInChildren != null) - { - Camera component = componentInChildren.gameObject.GetComponent(); - componentInChildren.enabled = false; - if (component != null) - { - component.orthographicSize = 1f; - } - } - else - { - UpdateScale(updateAnchors: false); - } - } - - private void Update() - { - UpdateScale(); - } - - public void UpdateScale(bool updateAnchors = true) - { - if (!(mTrans != null)) - { - return; - } - float num = activeHeight; - if (!(num > 0f)) - { - return; - } - float num2 = 2f / num; - Vector3 localScale = mTrans.localScale; - if (!(Mathf.Abs(localScale.x - num2) <= float.Epsilon) || !(Mathf.Abs(localScale.y - num2) <= float.Epsilon) || !(Mathf.Abs(localScale.z - num2) <= float.Epsilon)) - { - mTrans.localScale = new Vector3(num2, num2, num2); - if (updateAnchors) - { - BroadcastMessage("UpdateAnchors"); - } - } - } - - public static void Broadcast(string funcName) - { - int i = 0; - for (int count = list.Count; i < count; i++) - { - UIRoot uIRoot = list[i]; - if (uIRoot != null) - { - uIRoot.BroadcastMessage(funcName, SendMessageOptions.DontRequireReceiver); - } - } - } - - public static void Broadcast(string funcName, object param) - { - if (param == null) - { - Debug.LogError("SendMessage is bugged when you try to pass 'null' in the parameter field. It behaves as if no parameter was specified."); - return; - } - int i = 0; - for (int count = list.Count; i < count; i++) - { - UIRoot uIRoot = list[i]; - if (uIRoot != null) - { - uIRoot.BroadcastMessage(funcName, param, SendMessageOptions.DontRequireReceiver); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/UIScrollBar.cs b/SVSim.BattleEngine/Engine/UIScrollBar.cs index 653ed9cc..39c15192 100644 --- a/SVSim.BattleEngine/Engine/UIScrollBar.cs +++ b/SVSim.BattleEngine/Engine/UIScrollBar.cs @@ -8,7 +8,6 @@ public class UIScrollBar : UISlider private enum Direction { Horizontal, - Vertical, Upgraded } @@ -24,19 +23,6 @@ public class UIScrollBar : UISlider [SerializeField] private Direction mDir = Direction.Upgraded; - [Obsolete("Use 'value' instead")] - public float scrollValue - { - get - { - return base.value; - } - set - { - base.value = value; - } - } - public float barSize { get diff --git a/SVSim.BattleEngine/Engine/UIScrollBarWrapContent.cs b/SVSim.BattleEngine/Engine/UIScrollBarWrapContent.cs index 787f304c..08289959 100644 --- a/SVSim.BattleEngine/Engine/UIScrollBarWrapContent.cs +++ b/SVSim.BattleEngine/Engine/UIScrollBarWrapContent.cs @@ -2,7 +2,6 @@ using UnityEngine; public class UIScrollBarWrapContent : UIScrollBar { - private const int CHECK_COUNT_MAX = 10; private bool m_bDragNow; diff --git a/SVSim.BattleEngine/Engine/UIScrollView.cs b/SVSim.BattleEngine/Engine/UIScrollView.cs index b76d4b9d..4bc6d554 100644 --- a/SVSim.BattleEngine/Engine/UIScrollView.cs +++ b/SVSim.BattleEngine/Engine/UIScrollView.cs @@ -17,23 +17,17 @@ public class UIScrollView : MonoBehaviour public enum DragEffect { None, - Momentum, MomentumAndSpring } public enum ShowCondition { - Always, - OnlyIfNeeded, - WhenDragging - } +} public delegate void OnDragNotification(); public static BetterList list = new BetterList(); - public bool IsScrollYAxisOnly; - public Movement movement; public DragEffect dragEffect = DragEffect.MomentumAndSpring; @@ -44,20 +38,12 @@ public class UIScrollView : MonoBehaviour public bool smoothDragStart = true; - public bool iOSDragEmulation = true; - - public float scrollWheelFactor = 0.25f; - public float momentumAmount = 35f; - public float dampenStrength = 9f; - public UIProgressBar horizontalScrollBar; public UIProgressBar verticalScrollBar; - public ShowCondition showScrollBars = ShowCondition.OnlyIfNeeded; - public Vector2 customMovement = new Vector2(1f, 0f); public UIWidget.Pivot contentPivot; @@ -66,8 +52,6 @@ public class UIScrollView : MonoBehaviour public OnDragNotification onDragFinished; - public OnDragNotification onMomentumMove; - public OnDragNotification onStoppedMoving; [HideInInspector] @@ -108,11 +92,6 @@ public class UIScrollView : MonoBehaviour protected bool mDragStarted; - public const float WIN_SCROLL_FACTOR = 10f; - - [NonSerialized] - private bool mStarted; - [HideInInspector] public UICenterOnChild centerOnChild; @@ -176,19 +155,6 @@ public class UIScrollView : MonoBehaviour } } - public virtual bool shouldMoveHorizontally - { - get - { - float num = bounds.size.x; - if (mPanel.clipping == UIDrawCall.Clipping.SoftClip) - { - num += mPanel.clipSoftness.x * 2f; - } - return Mathf.RoundToInt(num - mPanel.width) > 0; - } - } - public virtual bool shouldMoveVertically { get @@ -262,22 +228,6 @@ public class UIScrollView : MonoBehaviour } } - public float CurrentScroll - { - set - { - mScroll = value; - } - } - - public bool NeedsCalculateBounds - { - set - { - mCalculatedBounds = !value; - } - } - private void Awake() { mTrans = base.transform; @@ -315,45 +265,6 @@ public class UIScrollView : MonoBehaviour } } - private void OnEnable() - { - list.Add(this); - if (mStarted && Application.isPlaying) - { - CheckScrollbars(); - } - } - - private void Start() - { - mStarted = true; - if (Application.isPlaying) - { - CheckScrollbars(); - } - } - - private void CheckScrollbars() - { - if (horizontalScrollBar != null) - { - EventDelegate.Add(horizontalScrollBar.onChange, OnScrollBar); - horizontalScrollBar.BroadcastMessage("CacheDefaultColor", SendMessageOptions.DontRequireReceiver); - horizontalScrollBar.alpha = ((showScrollBars == ShowCondition.Always || shouldMoveHorizontally) ? 1f : 0f); - } - if (verticalScrollBar != null) - { - EventDelegate.Add(verticalScrollBar.onChange, OnScrollBar); - verticalScrollBar.BroadcastMessage("CacheDefaultColor", SendMessageOptions.DontRequireReceiver); - verticalScrollBar.alpha = ((showScrollBars == ShowCondition.Always || shouldMoveVertically) ? 1f : 0f); - } - } - - private void OnDisable() - { - list.Remove(this); - } - public bool RestrictWithinBounds(bool instant) { return RestrictWithinBounds(instant, horizontal: true, vertical: true); @@ -584,11 +495,6 @@ public class UIScrollView : MonoBehaviour } } - public void InvalidateBounds() - { - mCalculatedBounds = false; - } - [ContextMenu("Reset Clipping Position")] public void ResetPosition() { @@ -617,18 +523,6 @@ public class UIScrollView : MonoBehaviour } } - public void OnScrollBar() - { - if (!mIgnoreCallbacks) - { - mIgnoreCallbacks = true; - float x = ((horizontalScrollBar != null) ? horizontalScrollBar.value : 0f); - float y = ((verticalScrollBar != null) ? verticalScrollBar.value : 0f); - SetDragAmount(x, y, updateScrollbars: false); - mIgnoreCallbacks = false; - } - } - public virtual void MoveRelative(Vector3 relative) { mTrans.localPosition += relative; @@ -639,13 +533,6 @@ public class UIScrollView : MonoBehaviour UpdateScrollbars(recalculateBounds: false); } - public void MoveAbsolute(Vector3 absolute) - { - Vector3 vector = mTrans.InverseTransformPoint(absolute); - Vector3 vector2 = mTrans.InverseTransformPoint(Vector3.zero); - MoveRelative(vector - vector2); - } - public void Press(bool pressed) { if (UICamera.currentScheme == UICamera.ControlScheme.Controller) @@ -717,230 +604,4 @@ public class UIScrollView : MonoBehaviour } } } - - public void Drag() - { - if (UICamera.currentScheme == UICamera.ControlScheme.Controller || !base.enabled || !NGUITools.GetActive(base.gameObject) || !mShouldMove) - { - return; - } - if (mDragID == -10) - { - mDragID = UICamera.currentTouchID; - } - UICamera.currentTouch.clickNotification = UICamera.ClickNotification.BasedOnDelta; - if (smoothDragStart && !mDragStarted) - { - mDragStarted = true; - mDragStartOffset = UICamera.currentTouch.totalDelta; - if (onDragStarted != null) - { - onDragStarted(); - } - } - Ray ray = (smoothDragStart ? UICamera.currentCamera.ScreenPointToRay(UICamera.currentTouch.pos - mDragStartOffset) : UICamera.currentCamera.ScreenPointToRay(UICamera.currentTouch.pos)); - float enter = 0f; - if (!mPlane.Raycast(ray, out enter)) - { - return; - } - Vector3 point = ray.GetPoint(enter); - Vector3 vector = point - mLastPos; - mLastPos = point; - if (vector.x != 0f || vector.y != 0f || vector.z != 0f) - { - vector = mTrans.InverseTransformDirection(vector); - if (movement == Movement.Horizontal) - { - vector.y = 0f; - vector.z = 0f; - } - else if (movement == Movement.Vertical) - { - vector.x = 0f; - vector.z = 0f; - } - else if (movement == Movement.Unrestricted) - { - vector.z = 0f; - } - else - { - vector.Scale(customMovement); - } - vector = mTrans.TransformDirection(vector); - } - if (dragEffect == DragEffect.None) - { - mMomentum = Vector3.zero; - } - else - { - mMomentum = Vector3.Lerp(mMomentum, mMomentum + vector * (0.01f * momentumAmount), 0.67f); - } - if (!iOSDragEmulation || dragEffect != DragEffect.MomentumAndSpring) - { - MoveAbsolute(vector); - } - else if (mPanel.CalculateConstrainOffset(bounds.min, bounds.max).magnitude > 1f) - { - MoveAbsolute(vector * 0.5f); - mMomentum *= 0.5f; - } - else - { - MoveAbsolute(vector); - } - if (restrictWithinPanel && mPanel.clipping != UIDrawCall.Clipping.None && dragEffect != DragEffect.MomentumAndSpring) - { - RestrictWithinBounds(instant: true, canMoveHorizontally, canMoveVertically); - } - } - - public void Scroll(float delta) - { - if (base.enabled && NGUITools.GetActive(base.gameObject) && scrollWheelFactor != 0f) - { - mCalculatedBounds = false; - DisableSpring(); - mShouldMove |= shouldMove; - if (Mathf.Sign(mScroll) != Mathf.Sign(delta)) - { - mScroll = 0f; - } - mScroll += delta * scrollWheelFactor * 10f; - } - } - - private void LateUpdate() - { - if (!Application.isPlaying) - { - return; - } - float deltaTime = RealTime.deltaTime; - if (showScrollBars != ShowCondition.Always && ((bool)verticalScrollBar || (bool)horizontalScrollBar)) - { - bool flag = false; - bool flag2 = false; - if (showScrollBars != ShowCondition.WhenDragging || mDragID != -10 || mMomentum.magnitude > 0.01f) - { - flag = shouldMoveVertically; - flag2 = shouldMoveHorizontally; - } - if ((bool)verticalScrollBar) - { - float alpha = verticalScrollBar.alpha; - alpha += (flag ? (deltaTime * 6f) : ((0f - deltaTime) * 3f)); - alpha = Mathf.Clamp01(alpha); - if (verticalScrollBar.alpha != alpha) - { - verticalScrollBar.alpha = alpha; - } - } - if ((bool)horizontalScrollBar) - { - float alpha2 = horizontalScrollBar.alpha; - alpha2 += (flag2 ? (deltaTime * 6f) : ((0f - deltaTime) * 3f)); - alpha2 = Mathf.Clamp01(alpha2); - if (horizontalScrollBar.alpha != alpha2) - { - horizontalScrollBar.alpha = alpha2; - } - } - } - if (!mShouldMove) - { - return; - } - if (!mPressed) - { - if (mMomentum.magnitude > 0.0001f || Mathf.Abs(mScroll) > 0.0001f) - { - if (movement == Movement.Horizontal) - { - mMomentum -= mTrans.TransformDirection(new Vector3((0f - mScroll) * 0.05f, 0f, 0f)); - } - else if (movement == Movement.Vertical || (movement == Movement.Unrestricted && IsScrollYAxisOnly)) - { - mMomentum -= mTrans.TransformDirection(new Vector3(0f, mScroll * 0.05f, 0f)); - } - else if (movement == Movement.Unrestricted) - { - mMomentum -= mTrans.TransformDirection(new Vector3((0f - mScroll) * 0.05f, mScroll * 0.05f, 0f)); - } - else - { - mMomentum -= mTrans.TransformDirection(new Vector3((0f - mScroll) * customMovement.x * 0.05f, mScroll * customMovement.y * 0.05f, 0f)); - } - mScroll = NGUIMath.SpringLerp(mScroll, 0f, 20f, deltaTime); - Vector3 absolute = NGUIMath.SpringDampen(ref mMomentum, dampenStrength, deltaTime); - MoveAbsolute(absolute); - if (restrictWithinPanel && mPanel.clipping != UIDrawCall.Clipping.None) - { - if (NGUITools.GetActive(centerOnChild)) - { - RestrictWithinBounds(instant: false, canMoveHorizontally, canMoveVertically); - if (centerOnChild.nextPageThreshold != 0f) - { - mMomentum = Vector3.zero; - mScroll = 0f; - } - else - { - centerOnChild.Recenter(); - } - } - else - { - RestrictWithinBounds(instant: false, canMoveHorizontally, canMoveVertically); - } - } - if (onMomentumMove != null) - { - onMomentumMove(); - } - return; - } - mScroll = 0f; - mMomentum = Vector3.zero; - SpringPanel component = GetComponent(); - if (!(component != null) || !component.enabled) - { - mShouldMove = false; - if (onStoppedMoving != null) - { - onStoppedMoving(); - } - } - } - else - { - mScroll = 0f; - NGUIMath.SpringDampen(ref mMomentum, 9f, deltaTime); - } - } - - public void OnPan(Vector2 delta) - { - if (horizontalScrollBar != null) - { - horizontalScrollBar.OnPan(delta); - } - if (verticalScrollBar != null) - { - verticalScrollBar.OnPan(delta); - } - if (horizontalScrollBar == null && verticalScrollBar == null) - { - if (scale.x != 0f) - { - Scroll(delta.x); - } - else if (scale.y != 0f) - { - Scroll(delta.y); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/UISlider.cs b/SVSim.BattleEngine/Engine/UISlider.cs index 08374080..460d1cf3 100644 --- a/SVSim.BattleEngine/Engine/UISlider.cs +++ b/SVSim.BattleEngine/Engine/UISlider.cs @@ -8,7 +8,6 @@ public class UISlider : UIProgressBar private enum Direction { Horizontal, - Vertical, Upgraded } @@ -46,31 +45,6 @@ public class UISlider : UIProgressBar } } - [Obsolete("Use 'value' instead")] - public float sliderValue - { - get - { - return base.value; - } - set - { - base.value = value; - } - } - - [Obsolete("Use 'fillDirection' instead")] - public bool inverted - { - get - { - return base.isInverted; - } - set - { - } - } - protected override void Upgrade() { if (direction != Direction.Upgraded) diff --git a/SVSim.BattleEngine/Engine/UISprite.cs b/SVSim.BattleEngine/Engine/UISprite.cs index fc4efa35..8d49ab11 100644 --- a/SVSim.BattleEngine/Engine/UISprite.cs +++ b/SVSim.BattleEngine/Engine/UISprite.cs @@ -95,23 +95,6 @@ public class UISprite : UIBasicSprite public bool isValid => GetAtlasSprite() != null; - [Obsolete("Use 'centerType' instead")] - public bool fillCenter - { - get - { - return centerType != AdvancedType.Invisible; - } - set - { - if (value != (centerType != AdvancedType.Invisible)) - { - centerType = (value ? AdvancedType.Sliced : AdvancedType.Invisible); - MarkAsChanged(); - } - } - } - public override Vector4 border { get diff --git a/SVSim.BattleEngine/Engine/UISpriteData.cs b/SVSim.BattleEngine/Engine/UISpriteData.cs index 9989b0e1..cee3b3cc 100644 --- a/SVSim.BattleEngine/Engine/UISpriteData.cs +++ b/SVSim.BattleEngine/Engine/UISpriteData.cs @@ -32,53 +32,4 @@ public class UISpriteData public bool hasBorder => (borderLeft | borderRight | borderTop | borderBottom) != 0; public bool hasPadding => (paddingLeft | paddingRight | paddingTop | paddingBottom) != 0; - - public void SetRect(int x, int y, int width, int height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - - public void SetPadding(int left, int bottom, int right, int top) - { - paddingLeft = left; - paddingBottom = bottom; - paddingRight = right; - paddingTop = top; - } - - public void SetBorder(int left, int bottom, int right, int top) - { - borderLeft = left; - borderBottom = bottom; - borderRight = right; - borderTop = top; - } - - public void CopyFrom(UISpriteData sd) - { - name = sd.name; - x = sd.x; - y = sd.y; - width = sd.width; - height = sd.height; - borderLeft = sd.borderLeft; - borderRight = sd.borderRight; - borderTop = sd.borderTop; - borderBottom = sd.borderBottom; - paddingLeft = sd.paddingLeft; - paddingRight = sd.paddingRight; - paddingTop = sd.paddingTop; - paddingBottom = sd.paddingBottom; - } - - public void CopyBorderFrom(UISpriteData sd) - { - borderLeft = sd.borderLeft; - borderRight = sd.borderRight; - borderTop = sd.borderTop; - borderBottom = sd.borderBottom; - } } diff --git a/SVSim.BattleEngine/Engine/UISpriteExtension.cs b/SVSim.BattleEngine/Engine/UISpriteExtension.cs deleted file mode 100644 index 1d6715b1..00000000 --- a/SVSim.BattleEngine/Engine/UISpriteExtension.cs +++ /dev/null @@ -1,19 +0,0 @@ -public static class UISpriteExtension -{ - public static void CopySpriteParameters(this UISprite dst, UISprite src) - { - dst.type = src.type; - dst.flip = src.flip; - dst.border = src.border; - dst.centerType = src.centerType; - dst.fillDirection = src.fillDirection; - dst.fillAmount = src.fillAmount; - dst.invert = src.invert; - dst.leftType = src.leftType; - dst.rightType = src.rightType; - dst.topType = src.topType; - dst.bottomType = src.bottomType; - dst.atlas = src.atlas; - dst.spriteName = src.spriteName; - } -} diff --git a/SVSim.BattleEngine/Engine/UITable.cs b/SVSim.BattleEngine/Engine/UITable.cs index e471a257..af2570e0 100644 --- a/SVSim.BattleEngine/Engine/UITable.cs +++ b/SVSim.BattleEngine/Engine/UITable.cs @@ -9,18 +9,14 @@ public class UITable : UIWidgetContainer public enum Direction { - Down, - Up - } + Down } public enum Sorting { None, Alphabetic, Horizontal, - Vertical, - Custom - } + Vertical } public int columns; @@ -103,36 +99,12 @@ public class UITable : UIWidgetContainer list.Sort(UIGrid.SortByName); } - protected virtual void Start() - { - Init(); - Reposition(); - base.enabled = false; - } - protected virtual void Init() { mInitDone = true; mPanel = NGUITools.FindInParents(base.gameObject); } - protected virtual void LateUpdate() - { - if (mReposition) - { - Reposition(); - } - base.enabled = false; - } - - private void OnValidate() - { - if (!Application.isPlaying && NGUITools.GetActive(this)) - { - Reposition(); - } - } - protected void RepositionVariableSize(List children) { float num = 0f; diff --git a/SVSim.BattleEngine/Engine/UITexture.cs b/SVSim.BattleEngine/Engine/UITexture.cs index 612c0c9e..d4837964 100644 --- a/SVSim.BattleEngine/Engine/UITexture.cs +++ b/SVSim.BattleEngine/Engine/UITexture.cs @@ -145,22 +145,6 @@ public class UITexture : UIBasicSprite } } - public Rect uvRect - { - get - { - return mRect; - } - set - { - if (mRect != value) - { - mRect = value; - MarkAsChanged(); - } - } - } - public override Vector4 drawingDimensions { get @@ -229,23 +213,6 @@ public class UITexture : UIBasicSprite } } - public bool fixedAspect - { - get - { - return mFixedAspect; - } - set - { - if (mFixedAspect != value) - { - mFixedAspect = value; - mDrawRegion = new Vector4(0f, 0f, 1f, 1f); - MarkAsChanged(); - } - } - } - public override void MakePixelPerfect() { base.MakePixelPerfect(); diff --git a/SVSim.BattleEngine/Engine/UIToggle.cs b/SVSim.BattleEngine/Engine/UIToggle.cs index f8137d83..3139a37e 100644 --- a/SVSim.BattleEngine/Engine/UIToggle.cs +++ b/SVSim.BattleEngine/Engine/UIToggle.cs @@ -33,14 +33,6 @@ public class UIToggle : UIWidgetContainer public Validate validator; - [HideInInspector] - [SerializeField] - private UISprite checkSprite; - - [HideInInspector] - [SerializeField] - private Animation checkAnimation; - [HideInInspector] [SerializeField] private GameObject eventReceiver; @@ -49,10 +41,6 @@ public class UIToggle : UIWidgetContainer [SerializeField] private string functionName = "OnActivate"; - [HideInInspector] - [SerializeField] - private bool startsChecked; - private bool mIsActive = true; private bool mStarted; @@ -80,108 +68,6 @@ public class UIToggle : UIWidgetContainer } } - public bool isColliderEnabled - { - get - { - Collider component = GetComponent(); - if (component != null) - { - return component.enabled; - } - Collider2D component2 = GetComponent(); - if (component2 != null) - { - return component2.enabled; - } - return false; - } - } - - [Obsolete("Use 'value' instead")] - public bool isChecked - { - get - { - return value; - } - set - { - this.value = value; - } - } - - public static UIToggle GetActiveToggle(int group) - { - for (int i = 0; i < list.size; i++) - { - UIToggle uIToggle = list[i]; - if (uIToggle != null && uIToggle.group == group && uIToggle.mIsActive) - { - return uIToggle; - } - } - return null; - } - - private void OnEnable() - { - list.Add(this); - } - - private void OnDisable() - { - list.Remove(this); - } - - private void Start() - { - if (startsChecked) - { - startsChecked = false; - startsActive = true; - } - if (!Application.isPlaying) - { - if (checkSprite != null && activeSprite == null) - { - activeSprite = checkSprite; - checkSprite = null; - } - if (checkAnimation != null && activeAnimation == null) - { - activeAnimation = checkAnimation; - checkAnimation = null; - } - if (Application.isPlaying && activeSprite != null) - { - activeSprite.alpha = (startsActive ? 1f : 0f); - } - if (EventDelegate.IsValid(onChange)) - { - eventReceiver = null; - functionName = null; - } - } - else - { - mIsActive = !startsActive; - mStarted = true; - bool flag = instantTween; - instantTween = true; - Set(startsActive); - instantTween = flag; - } - } - - private void OnClick() - { - if (base.enabled && isColliderEnabled && UICamera.currentTouchID != -2) - { - value = !value; - } - } - public void Set(bool state) { if (validator != null && !validator(state)) diff --git a/SVSim.BattleEngine/Engine/UITweenAlpha.cs b/SVSim.BattleEngine/Engine/UITweenAlpha.cs index ea90f7a3..93ece443 100644 --- a/SVSim.BattleEngine/Engine/UITweenAlpha.cs +++ b/SVSim.BattleEngine/Engine/UITweenAlpha.cs @@ -18,8 +18,6 @@ public class UITweenAlpha : MonoBehaviour public bool _loop; - public bool PingPong; - public UITweenAlpha[] LinkTargets; private UIPanel _panel; @@ -36,8 +34,6 @@ public class UITweenAlpha : MonoBehaviour private bool _initialized; - private float _value; - public FinishCallBack _finishCallBack { get; set; } public float Timer { get; set; } @@ -85,81 +81,6 @@ public class UITweenAlpha : MonoBehaviour } } - private void Update() - { - if (_isPlay) - { - Timer += Time.deltaTime; - if (Timer >= _delayTime) - { - float b = (Timer - _delayTime) / (_curve.keys[_curve.length - 1].time * _endTime); - b = Mathf.Min(_curve.keys[_curve.length - 1].time, b); - if (_isPlayFoward) - { - _value = _from + (_to - _from) * _curve.Evaluate(b); - } - else - { - _value = _from + (_to - _from) * _curve.Evaluate(_curve.keys[_curve.length - 1].time - b); - } - _rect.alpha = _value; - if (b >= _curve.keys[_curve.length - 1].time) - { - if (_isPlayFoward) - { - _rect.alpha = _to; - } - else - { - _rect.alpha = _from; - } - if (PingPong) - { - Timer = 0f; - if (_isPlayFoward) - { - _isPlayFoward = false; - } - else - { - _isPlayFoward = true; - } - } - else if (!_loop) - { - _isPlay = false; - _isEnd = true; - } - else - { - Timer = 0f; - } - } - } - } - if (_isEnd) - { - if (_finishCallBack != null) - { - _finishCallBack(this); - } - _isEnd = false; - } - } - - public void Cancel(bool isFrom = false, bool isTo = false) - { - _isPlay = false; - if (isFrom) - { - _rect.alpha = _from; - } - else if (isTo) - { - _rect.alpha = _to; - } - } - public void PlayForward(bool isReset = false) { if (!base.gameObject.activeSelf) @@ -198,36 +119,6 @@ public class UITweenAlpha : MonoBehaviour } } - public void PlayReverse(bool isReset = false) - { - if (!base.gameObject.activeSelf || _curve == null) - { - return; - } - _isPlayFoward = false; - if (isReset) - { - _rect.alpha = _to; - } - if (!_loop) - { - if (_rect.alpha != _from || isReset) - { - _isPlay = true; - Timer = 0f; - } - else - { - _isEnd = true; - } - } - else - { - _isPlay = true; - Timer = 0f; - } - } - public void End() { if (_isPlay) diff --git a/SVSim.BattleEngine/Engine/UITweenPosition.cs b/SVSim.BattleEngine/Engine/UITweenPosition.cs index 76f4f127..8be6f06f 100644 --- a/SVSim.BattleEngine/Engine/UITweenPosition.cs +++ b/SVSim.BattleEngine/Engine/UITweenPosition.cs @@ -108,19 +108,6 @@ public class UITweenPosition : MonoBehaviour } } - public void Cancel(bool setFrom = false, bool setTo = false) - { - IsPlay = false; - if (setFrom) - { - base.gameObject.transform.localPosition = new Vector2(From.x, From.y); - } - else if (setTo) - { - base.gameObject.transform.localPosition = new Vector2(To.x, To.y); - } - } - public void PlayForward(bool resetFlag = false) { IsPlayFoward = true; @@ -143,27 +130,4 @@ public class UITweenPosition : MonoBehaviour _isEnd = true; } } - - public void PlayReverse(bool resetFlag = false) - { - IsPlayFoward = false; - if (resetFlag) - { - _toStart = To; - } - else - { - _toStart = new Vector2(base.transform.localPosition.x, base.transform.localPosition.y); - } - if (base.gameObject.transform.localPosition.x != From.x || base.gameObject.transform.localPosition.y != From.y || resetFlag) - { - IsPlay = true; - _timer = 0f; - Update(); - } - else - { - _isEnd = true; - } - } } diff --git a/SVSim.BattleEngine/Engine/UITweener.cs b/SVSim.BattleEngine/Engine/UITweener.cs index ff1a7a0a..15c28578 100644 --- a/SVSim.BattleEngine/Engine/UITweener.cs +++ b/SVSim.BattleEngine/Engine/UITweener.cs @@ -7,7 +7,6 @@ public abstract class UITweener : MonoBehaviour { public enum Method { - Linear, EaseIn, EaseOut, EaseInOut, @@ -106,20 +105,6 @@ public abstract class UITweener : MonoBehaviour } } - private void Reset() - { - if (!mStarted) - { - SetStartToCurrentValue(); - SetEndToCurrentValue(); - } - } - - protected virtual void Start() - { - Update(); - } - private void Update() { float num = (ignoreTimeScale ? RealTime.deltaTime : Time.deltaTime); @@ -203,11 +188,6 @@ public abstract class UITweener : MonoBehaviour EventDelegate.Set(onFinished, del); } - public void AddOnFinished(EventDelegate.Callback del) - { - EventDelegate.Add(onFinished, del); - } - public void AddOnFinished(EventDelegate del) { EventDelegate.Add(onFinished, del); @@ -225,11 +205,6 @@ public abstract class UITweener : MonoBehaviour } } - private void OnDisable() - { - mStarted = false; - } - public void Sample(float factor, bool isFinished) { float num = Mathf.Clamp01(factor); @@ -279,12 +254,6 @@ public abstract class UITweener : MonoBehaviour return val; } - [Obsolete("Use PlayForward() instead")] - public void Play() - { - Play(forward: true); - } - public void PlayForward() { Play(forward: true); @@ -313,19 +282,6 @@ public abstract class UITweener : MonoBehaviour Sample(mFactor, isFinished: false); } - public void Toggle() - { - if (mFactor > 0f) - { - mAmountPerDelta = 0f - amountPerDelta; - } - else - { - mAmountPerDelta = Mathf.Abs(amountPerDelta); - } - base.enabled = true; - } - protected abstract void OnUpdate(float factor, bool isFinished); public static T Begin(GameObject go, float duration) where T : UITweener diff --git a/SVSim.BattleEngine/Engine/UIWidget.cs b/SVSim.BattleEngine/Engine/UIWidget.cs index 7ef7430a..60fe8578 100644 --- a/SVSim.BattleEngine/Engine/UIWidget.cs +++ b/SVSim.BattleEngine/Engine/UIWidget.cs @@ -66,8 +66,6 @@ public class UIWidget : UIRect public float aspectRatio = 1f; - public HitCheck hitCheck; - [NonSerialized] public UIPanel panel; @@ -116,31 +114,6 @@ public class UIWidget : UIRect private Vector3 mOldV1; - public UIDrawCall.OnRenderCallback onRender - { - get - { - return mOnRender; - } - set - { - if (mOnRender != value) - { - if (drawCall != null && drawCall.onRender != null && mOnRender != null) - { - UIDrawCall uIDrawCall = drawCall; - uIDrawCall.onRender = (UIDrawCall.OnRenderCallback)Delegate.Remove(uIDrawCall.onRender, mOnRender); - } - mOnRender = value; - if (drawCall != null) - { - UIDrawCall uIDrawCall2 = drawCall; - uIDrawCall2.onRender = (UIDrawCall.OnRenderCallback)Delegate.Combine(uIDrawCall2.onRender, value); - } - } - } - } - public Vector4 drawRegion { get @@ -406,22 +379,6 @@ public class UIWidget : UIRect } } - public int raycastDepth - { - get - { - if (panel == null) - { - CreatePanel(); - } - if (!(panel != null)) - { - return mDepth; - } - return mDepth + panel.depth * 1000; - } - } - public override Vector3[] localCorners { get @@ -448,15 +405,6 @@ public class UIWidget : UIRect } } - public Vector3 localCenter - { - get - { - Vector3[] array = localCorners; - return Vector3.Lerp(array[0], array[2], 0.5f); - } - } - public override Vector3[] worldCorners { get @@ -475,8 +423,6 @@ public class UIWidget : UIRect } } - public Vector3 worldCenter => base.cachedTransform.TransformPoint(localCenter); - public virtual Vector4 drawingDimensions { get @@ -536,21 +482,6 @@ public class UIWidget : UIRect } } - [Obsolete("There is no relative scale anymore. Widgets now have width and height instead")] - public Vector2 relativeSize => Vector2.one; - - public bool hasBoxCollider - { - get - { - if (GetComponent() as BoxCollider != null) - { - return true; - } - return GetComponent() != null; - } - } - public virtual int minWidth => 2; public virtual int minHeight => 2; @@ -724,18 +655,6 @@ public class UIWidget : UIRect } } - [DebuggerHidden] - [DebuggerStepThrough] - public static int FullCompareFunc(UIWidget left, UIWidget right) - { - int num = UIPanel.CompareFunc(left.panel, right.panel); - if (num != 0) - { - return num; - } - return PanelCompareFunc(left, right); - } - [DebuggerHidden] [DebuggerStepThrough] public static int PanelCompareFunc(UIWidget left, UIWidget right) @@ -769,11 +688,6 @@ public class UIWidget : UIRect return -1; } - public Bounds CalculateBounds() - { - return CalculateBounds(null); - } - public Bounds CalculateBounds(Transform relativeParent) { if (relativeParent == null) @@ -1027,25 +941,12 @@ public class UIWidget : UIRect } } - private void OnApplicationPause(bool paused) - { - if (!paused) - { - MarkAsChanged(); - } - } - protected override void OnDisable() { RemoveFromPanel(); base.OnDisable(); } - private void OnDestroy() - { - RemoveFromPanel(); - } - public bool UpdateVisibility(bool visibleByAlpha, bool visibleByPanel) { if (mIsVisibleByAlpha != visibleByAlpha || mIsVisibleByPanel != visibleByPanel) diff --git a/SVSim.BattleEngine/Engine/UIWidgetExtension.cs b/SVSim.BattleEngine/Engine/UIWidgetExtension.cs deleted file mode 100644 index 0aaacad3..00000000 --- a/SVSim.BattleEngine/Engine/UIWidgetExtension.cs +++ /dev/null @@ -1,20 +0,0 @@ -public static class UIWidgetExtension -{ - public static void CopyWidgetParameters(this UIWidget dst, UIWidget src) - { - dst.leftAnchor = src.leftAnchor; - dst.rightAnchor = src.rightAnchor; - dst.topAnchor = src.topAnchor; - dst.bottomAnchor = src.bottomAnchor; - dst.updateAnchors = src.updateAnchors; - dst.drawRegion = src.drawRegion; - dst.width = src.width; - dst.height = src.height; - dst.color = src.color; - dst.pivot = src.pivot; - dst.depth = src.depth; - dst.aspectRatio = src.aspectRatio; - dst.keepAspectRatio = src.keepAspectRatio; - dst.autoResizeBoxCollider = src.autoResizeBoxCollider; - } -} diff --git a/SVSim.BattleEngine/Engine/UIWrapContent.cs b/SVSim.BattleEngine/Engine/UIWrapContent.cs index e9e4950c..15e9a6fe 100644 --- a/SVSim.BattleEngine/Engine/UIWrapContent.cs +++ b/SVSim.BattleEngine/Engine/UIWrapContent.cs @@ -30,22 +30,6 @@ public class UIWrapContent : MonoBehaviour public bool EnableNoLimit { get; set; } = true; - protected virtual void Start() - { - SortBasedOnScrollMovement(); - WrapContent(); - if (mScroll != null) - { - mScroll.GetComponent().onClipMove = OnMove; - } - mFirstTime = false; - } - - protected virtual void OnMove(UIPanel panel) - { - WrapContent(); - } - [ContextMenu("Sort Based on Scroll Movement")] public virtual void SortBasedOnScrollMovement() { @@ -68,21 +52,6 @@ public class UIWrapContent : MonoBehaviour } } - [ContextMenu("Sort Alphabetically")] - public virtual void SortAlphabetically() - { - if (CacheScrollView()) - { - mChildren.Clear(); - for (int i = 0; i < mTrans.childCount; i++) - { - mChildren.Add(mTrans.GetChild(i)); - } - mChildren.Sort(UIGrid.SortByName); - ResetChildPositions(); - } - } - protected bool CacheScrollView() { mTrans = base.transform; @@ -276,18 +245,6 @@ public class UIWrapContent : MonoBehaviour return result; } - private void OnValidate() - { - if (maxIndex < minIndex) - { - maxIndex = minIndex; - } - if (minIndex > maxIndex) - { - maxIndex = minIndex; - } - } - protected virtual void UpdateItem(Transform item, int index) { if (onInitializeItem != null) diff --git a/SVSim.BattleEngine/Engine/UIWrapContentWizard.cs b/SVSim.BattleEngine/Engine/UIWrapContentWizard.cs index 9302cf76..68f01c2d 100644 --- a/SVSim.BattleEngine/Engine/UIWrapContentWizard.cs +++ b/SVSim.BattleEngine/Engine/UIWrapContentWizard.cs @@ -1,7 +1,3 @@ public class UIWrapContentWizard : UIWrapContent { - public void resetItems() - { - ResetChildPositions(); - } } diff --git a/SVSim.BattleEngine/Engine/UIWrapMuchContent.cs b/SVSim.BattleEngine/Engine/UIWrapMuchContent.cs deleted file mode 100644 index fc77b620..00000000 --- a/SVSim.BattleEngine/Engine/UIWrapMuchContent.cs +++ /dev/null @@ -1,166 +0,0 @@ -using UnityEngine; - -public class UIWrapMuchContent : UIWrapContent -{ - public override bool WrapContent() - { - bool result = false; - bool flag = true; - float num = (float)(itemSize * mChildren.Count) * 0.5f; - float num2 = num * 2f; - Vector3[] worldCorners = mPanel.worldCorners; - for (int i = 0; i < 4; i++) - { - Vector3 position = worldCorners[i]; - position = mTrans.InverseTransformPoint(position); - worldCorners[i] = position; - } - Vector3 vector = Vector3.Lerp(worldCorners[0], worldCorners[2], 0.5f); - if (mHorizontal) - { - float num3 = worldCorners[0].x - (float)itemSize; - float num4 = worldCorners[2].x + (float)itemSize; - float num5 = (worldCorners[2].x - worldCorners[0].x) * 0.5f - mPanel.clipSoftness.x; - float num6 = num - num5; - bool flag2 = 0f < num6 && num6 < (float)itemSize * 0.5f; - int j = 0; - for (int count = mChildren.Count; j < count; j++) - { - Transform transform = mChildren[j]; - float num7 = transform.localPosition.x - vector.x; - if (num7 < 0f - num) - { - Vector3 localPosition = transform.localPosition; - float num8 = Mathf.Ceil((0f - num - num7) / num2); - localPosition.x += num2 * num8; - num7 = localPosition.x - vector.x; - int num9 = Mathf.RoundToInt(localPosition.x / (float)itemSize); - if ((base.EnableNoLimit && minIndex == maxIndex) || (minIndex <= num9 && num9 <= maxIndex)) - { - transform.localPosition = localPosition; - UpdateItem(transform, j); - } - else - { - flag = false; - } - } - else if (num7 > num) - { - Vector3 localPosition2 = transform.localPosition; - float num10 = Mathf.Ceil((num7 - num) / num2); - localPosition2.x -= num2 * num10; - num7 = localPosition2.x - vector.x; - int num11 = Mathf.RoundToInt(localPosition2.x / (float)itemSize); - if ((base.EnableNoLimit && minIndex == maxIndex) || (minIndex <= num11 && num11 <= maxIndex)) - { - transform.localPosition = localPosition2; - UpdateItem(transform, j); - } - else - { - flag = false; - } - } - else - { - if (mFirstTime) - { - UpdateItem(transform, j); - } - if (flag2) - { - float num12 = (float)itemSize * 0.5f - num6; - if (num7 < 0f - (num - num12) || num7 > num - num12) - { - flag = false; - } - } - result = true; - } - if (cullContent) - { - num7 += mPanel.clipOffset.x - mTrans.localPosition.x; - if (!UICamera.IsPressed(transform.gameObject)) - { - NGUITools.SetActive(transform.gameObject, num7 > num3 && num7 < num4, compatibilityMode: false); - } - } - } - } - else - { - float num13 = worldCorners[0].y - (float)itemSize; - float num14 = worldCorners[2].y + (float)itemSize; - float num15 = (worldCorners[2].y - worldCorners[0].y) * 0.5f - mPanel.clipSoftness.y; - float num16 = num - num15; - bool flag3 = 0f < num16 && num16 < (float)itemSize * 0.5f; - int k = 0; - for (int count2 = mChildren.Count; k < count2; k++) - { - Transform transform2 = mChildren[k]; - float num17 = transform2.localPosition.y - vector.y; - if (num17 < 0f - num) - { - Vector3 localPosition3 = transform2.localPosition; - float num18 = Mathf.Ceil((0f - num - num17) / num2); - localPosition3.y += num2 * num18; - num17 = localPosition3.y - vector.y; - int num19 = Mathf.RoundToInt(localPosition3.y / (float)itemSize); - if ((base.EnableNoLimit && minIndex == maxIndex) || (minIndex <= num19 && num19 <= maxIndex)) - { - transform2.localPosition = localPosition3; - UpdateItem(transform2, k); - } - else - { - flag = false; - } - } - else if (num17 > num) - { - Vector3 localPosition4 = transform2.localPosition; - float num20 = Mathf.Ceil((num17 - num) / num2); - localPosition4.y -= num2 * num20; - num17 = localPosition4.y - vector.y; - int num21 = Mathf.RoundToInt(localPosition4.y / (float)itemSize); - if ((base.EnableNoLimit && minIndex == maxIndex) || (minIndex <= num21 && num21 <= maxIndex)) - { - transform2.localPosition = localPosition4; - UpdateItem(transform2, k); - } - else - { - flag = false; - } - } - else - { - if (mFirstTime) - { - UpdateItem(transform2, k); - } - if (flag3) - { - float num22 = (float)itemSize * 0.5f - num16; - if (num17 < 0f - (num - num22) || num17 > num - num22) - { - flag = false; - } - } - result = true; - } - if (cullContent) - { - num17 += mPanel.clipOffset.y - mTrans.localPosition.y; - if (!UICamera.IsPressed(transform2.gameObject)) - { - NGUITools.SetActive(transform2.gameObject, num17 > num13 && num17 < num14, compatibilityMode: false); - } - } - } - } - mScroll.restrictWithinPanel = !flag; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/UIWrapVariableContentVertical.cs b/SVSim.BattleEngine/Engine/UIWrapVariableContentVertical.cs deleted file mode 100644 index dad27b61..00000000 --- a/SVSim.BattleEngine/Engine/UIWrapVariableContentVertical.cs +++ /dev/null @@ -1,403 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Wizard; - -public class UIWrapVariableContentVertical : UIWrapContent -{ - public class ItemParam - { - public float Position { get; set; } - - public int Size { get; set; } - - public ItemParam(float pos, int size) - { - Position = pos; - Size = size; - } - } - - private int _cashNum; - - private int _nowIndex; - - private float _marginSize = float.MaxValue; - - public List ItemParamList { get; } = new List(); - - public void Init(int cashNum, int nowIndex, int maxIndex, OnInitializeItem _onInitializeItem) - { - _cashNum = cashNum; - _nowIndex = nowIndex; - maxIndex = 0; - onInitializeItem = _onInitializeItem; - } - - public bool IsBottom() - { - if (!IsScrollEnableSize()) - { - return true; - } - return mPanel.transform.localPosition.y > GetPosYBottomItem(); - } - - public void UpdateItemSize(int index, int size) - { - if (0 <= index && index > ItemParamList.Count) - { - return; - } - ItemParam itemParam = ItemParamList[index]; - int num = itemParam.Size - size; - itemParam.Size = size; - MoveScrollPanel(mPanel.gameObject.transform.localPosition.y - (float)num); - if (index++ < ItemParamList.Count) - { - for (int i = index; i < ItemParamList.Count; i++) - { - ItemParamList[i].Position += num; - } - } - UpdateItemCurrentAll(); - WrapContent(); - mScroll.UpdateScrollbars(); - } - - public void AddItemList(List addItemSizeList, bool isBottom) - { - if (isBottom) - { - for (int i = 0; i < addItemSizeList.Count; i++) - { - float pos = 0f; - if (ItemParamList.Count > 0) - { - ItemParam itemParam = ItemParamList[ItemParamList.Count - 1]; - pos = itemParam.Position - (float)itemParam.Size; - } - AddItemListBottom(pos, addItemSizeList[i]); - } - SortChildrenVertical(isAscendingOrder: false); - } - else - { - if (ItemParamList.Count > 0) - { - _nowIndex += addItemSizeList.Count; - } - for (int num = addItemSizeList.Count - 1; num >= 0; num--) - { - int num2 = addItemSizeList[num]; - float pos2 = 0f; - if (ItemParamList.Count > 0) - { - pos2 = ItemParamList[0].Position + (float)num2; - } - AddItemListTop(pos2, num2); - } - SortChildrenVertical(isAscendingOrder: true); - } - minIndex = -(ItemParamList.Count - 1); - } - - private void AddItemListBottom(float pos, int size) - { - ItemParamList.Add(new ItemParam(pos, size)); - if ((float)size < _marginSize) - { - _marginSize = size; - } - } - - private void AddItemListTop(float pos, int size) - { - ItemParamList.Insert(0, new ItemParam(pos, size)); - if ((float)size < _marginSize) - { - _marginSize = size; - } - } - - protected override void ResetChildPositions() - { - ResetChildPositionsByIndex(0); - } - - private void ResetChildPositionsByIndex(int index) - { - _nowIndex = index; - for (int i = 0; i < mChildren.Count; i++) - { - int num = index + i; - Transform transform = mChildren[i]; - if (num < ItemParamList.Count) - { - transform.localPosition = new Vector3(0f, ItemParamList[num].Position, 0f); - } - UpdateItem(transform, i); - } - } - - public void ResetScrollPositionByIndex(int centerIndex) - { - centerIndex = Mathf.Clamp(centerIndex, 0, ItemParamList.Count - 1); - int num = 0; - int num2 = ItemParamList.Count - 1; - float num3 = mPanel.GetViewSize().y - mPanel.clipSoftness.y * 2f; - float num4 = num3 / 2f; - for (int i = 0; i < ItemParamList.Count; i++) - { - num += ItemParamList[i].Size; - if (i >= centerIndex) - { - num4 -= (float)ItemParamList[i].Size; - if (num4 < 0f) - { - num2 = i; - break; - } - } - } - mScroll.ResetPosition(); - if (num3 > (float)num) - { - return; - } - Vector3 vector = new Vector3(0f, (float)num - num3); - mScroll.transform.localPosition += vector; - mPanel.clipOffset -= (Vector2)vector; - int num5 = Mathf.Max(0, ItemParamList.Count - _cashNum); - int value = num5; - int num6 = 0; - for (int j = 0; j < _cashNum; j++) - { - int num7 = num2 - j; - num6 += ItemParamList[num7].Size; - if ((float)num6 > num3) - { - value = num7; - break; - } - } - value = Mathf.Clamp(value, 0, num5); - ResetChildPositionsByIndex(value); - } - - public void ResetScrollPositionBottomEasing() - { - StartCoroutine(SetPositionBottomEasing()); - } - - private IEnumerator SetPositionBottomEasing() - { - mScroll.currentMomentum = Vector3.zero; - mScroll.DisableSpring(); - WrapContent(); - mScroll.UpdateScrollbars(); - float targetPosY = GetPosYBottomItem() + (float)ItemParamList[ItemParamList.Count - 1].Size; - CustomEasing easing = new CustomEasing(CustomEasing.eType.outQuad, mPanel.gameObject.transform.localPosition.y, targetPosY, 0.3f); - while (easing.IsMoving) - { - MoveScrollPanel(easing.GetCurVal(Time.deltaTime)); - yield return null; - } - MoveScrollPanel(targetPosY); - } - - private float GetPosYBottomItem() - { - return mPanel.baseClipRegion.y - mPanel.baseClipRegion.w * 0.5f + mPanel.clipSoftness.y * 2f - ItemParamList[ItemParamList.Count - 1].Position; - } - - public float GetDistanceBetweenBottomItemAndScrollBottomPos() - { - return GetPosYBottomItem() + (float)ItemParamList[ItemParamList.Count - 1].Size - mPanel.gameObject.transform.localPosition.y; - } - - public void MoveScrollPanel(float targetPosY) - { - Vector3 vector = (mPanel.gameObject.transform.localPosition.y - targetPosY) * Vector3.up; - mPanel.gameObject.transform.localPosition -= vector; - mPanel.clipOffset += (Vector2)vector; - mScroll.UpdateScrollbars(); - } - - public bool IsScrollEnableSize() - { - float num = mPanel.GetViewSize().y; - for (int i = 0; i < ItemParamList.Count; i++) - { - num -= (float)ItemParamList[i].Size; - if (num <= 0f) - { - return true; - } - } - return false; - } - - public float TopOverflowItemSize() - { - Vector3[] worldCorners = mPanel.worldCorners; - float num = mTrans.InverseTransformPoint(worldCorners[1]).y - mPanel.clipSoftness.y; - return ItemParamList[0].Position - num; - } - - public override bool WrapContent() - { - if (mHorizontal) - { - return true; - } - if (mChildren.Count <= 0) - { - return true; - } - bool result = false; - bool flag = true; - Vector3[] worldCorners = mPanel.worldCorners; - for (int i = 0; i < worldCorners.Length; i++) - { - Vector3 position = worldCorners[i]; - position = mTrans.InverseTransformPoint(position); - worldCorners[i] = position; - } - List list = new List(mChildren.Count); - int j = 0; - for (int count = mChildren.Count; j < count; j++) - { - list.Add(item: false); - } - SortChildrenVertical(isAscendingOrder: true); - float y = mChildren[mChildren.Count - 1].localPosition.y; - float num = mChildren[0].localPosition.y - (float)ItemParamList[-1 * GetRealIndex(mChildren[0].localPosition)].Size; - float num2 = worldCorners[2].y + _marginSize; - float num3 = worldCorners[0].y - _marginSize; - if (y < num2) - { - int num4 = 0; - for (int k = 0; k < ItemParamList.Count; k++) - { - Transform transform = mChildren[num4]; - int num5 = _nowIndex - 1; - int num6 = ((num5 < 0) ? 1 : (num5 * -1)); - if (minIndex > num6 || num6 > maxIndex) - { - flag = false; - break; - } - if (transform.localPosition.y > num3) - { - break; - } - transform.localPosition = new Vector3(transform.localPosition.x, ItemParamList[num5].Position, transform.localPosition.z); - _nowIndex--; - list[num4] = true; - num4 = (num4 + 1) % mChildren.Count; - } - } - else if (num > num3) - { - int num7 = mChildren.Count - 1; - for (int l = 0; l < ItemParamList.Count; l++) - { - Transform transform2 = mChildren[num7]; - int num8 = _nowIndex + _cashNum; - int num9 = ((num8 >= ItemParamList.Count) ? (minIndex - 1) : (num8 * -1)); - if (minIndex > num9 || num9 > maxIndex) - { - flag = false; - break; - } - if (transform2.localPosition.y - (float)ItemParamList[_nowIndex].Size < num2) - { - break; - } - transform2.localPosition = new Vector3(transform2.localPosition.x, ItemParamList[num8].Position, transform2.localPosition.z); - _nowIndex++; - list[num7] = true; - num7 = (num7 - 1 + mChildren.Count) % mChildren.Count; - } - } - else - { - if (mFirstTime) - { - int m = 0; - for (int count2 = mChildren.Count; m < count2; m++) - { - Transform item = mChildren[m]; - UpdateItem(item, m); - } - } - result = true; - } - int n = 0; - for (int count3 = mChildren.Count; n < count3; n++) - { - if (list[n]) - { - Transform item2 = mChildren[n]; - UpdateItem(item2, n); - } - } - mScroll.restrictWithinPanel = !flag; - return result; - } - - protected override void UpdateItem(Transform item, int index) - { - if (onInitializeItem != null) - { - int realIndex = GetRealIndex(item.localPosition); - onInitializeItem(item.gameObject, index, realIndex); - } - } - - private void UpdateItemCurrentAll() - { - int i = 0; - for (int count = mChildren.Count; i < count; i++) - { - Transform transform = mChildren[i]; - int num = _nowIndex + i; - if (num <= ItemParamList.Count) - { - Vector3 localPosition = transform.localPosition; - localPosition.y = ItemParamList[num].Position; - transform.localPosition = localPosition; - onInitializeItem?.Invoke(transform.gameObject, i, num * -1); - continue; - } - break; - } - } - - private int GetRealIndex(Vector3 item) - { - int result = 0; - for (int i = 0; i < ItemParamList.Count; i++) - { - if (item.y == ItemParamList[i].Position) - { - result = i * -1; - break; - } - } - return result; - } - - private void SortChildrenVertical(bool isAscendingOrder) - { - if (isAscendingOrder) - { - mChildren.Sort((Transform a, Transform b) => a.localPosition.y.CompareTo(b.localPosition.y)); - } - else - { - mChildren.Sort((Transform a, Transform b) => b.localPosition.y.CompareTo(a.localPosition.y)); - } - } -} diff --git a/SVSim.BattleEngine/Engine/UnitBattleCard.cs b/SVSim.BattleEngine/Engine/UnitBattleCard.cs index a4d7b2b0..11d2bbd8 100644 --- a/SVSim.BattleEngine/Engine/UnitBattleCard.cs +++ b/SVSim.BattleEngine/Engine/UnitBattleCard.cs @@ -11,11 +11,6 @@ using Wizard.Battle.View.Vfx; public class UnitBattleCard : BattleCardBase { - public const string DRAIN_EFFECT = "btl_magic_cure_1"; - - public const string DRAIN_SE = "se_btl_magic_cure_1"; - - public const float DRAIN_WAIT_TIME = 0.3f; private bool _isEvolution; @@ -33,11 +28,6 @@ public class UnitBattleCard : BattleCardBase public event Func OnAfterAttack; - public void Evolution(bool isEvolution = true) - { - _isEvolution = isEvolution; - } - public override bool Movable(bool isCheckOnDraw = true, bool isSkipSelecting = false, CHECK_CONDITION_MUTATIONSKILL_TYPE type = CHECK_CONDITION_MUTATIONSKILL_TYPE.NONE, bool isRecording = false) { type = IsCheckActiveMutationSkill; @@ -80,7 +70,7 @@ public class UnitBattleCard : BattleCardBase { parallelVfxPlayer.Register(InstantVfx.Create(base.BattleCardView._inPlayFrameEffect.HideFrameEffect)); } - if (GameMgr.GetIns().IsWatchBattle || GameMgr.GetIns().IsReplayBattle) + if (_buildInfo.BattleMgr.GameMgr.IsWatchBattle || _buildInfo.BattleMgr.GameMgr.IsReplayBattle) { parallelVfxPlayer.Register(InstantVfx.Create(delegate { @@ -126,23 +116,23 @@ public class UnitBattleCard : BattleCardBase } _isEvolution = true; base.AttackableCount = attackableCount; - if (BattleManagerBase.GetIns().IsRecovery) + if (_buildInfo.BattleMgr.IsRecovery) { - sequentialVfxPlayer.Register(new RecoveryEvolveVfx(this, _buildInfo.ResourceMgr)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } else if (getEvolveVfxFunc == null) { - if (base.IsPlayer && GameMgr.GetIns().GetDataMgr().Is3DSkin(isPlayer: true)) + if (base.IsPlayer && _buildInfo.BattleMgr.GameMgr.GetDataMgr().Is3DSkin(isPlayer: true)) { - sequentialVfxPlayer.Register(new Class3dEvolveVfx(this, _buildInfo.ResourceMgr)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } - else if (base.IsPlayer && GameMgr.GetIns().GetDataMgr().IsHighRankSkinPlayer()) + else if (base.IsPlayer && _buildInfo.BattleMgr.GameMgr.GetDataMgr().IsHighRankSkinPlayer()) { - sequentialVfxPlayer.Register(new HighRankEvolveVfx(this, _buildInfo.ResourceMgr)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } else { - sequentialVfxPlayer.Register(new EvolveVfx(this, _buildInfo.ResourceMgr)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } } else @@ -274,7 +264,7 @@ public class UnitBattleCard : BattleCardBase SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); base.SelfBattlePlayer.HandCardToField(this); base.BattleCardView.ResetTemplate(); - sequentialVfxPlayer.Register(base.VfxCreator.CreatePick()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); return sequentialVfxPlayer; } @@ -348,10 +338,10 @@ public class UnitBattleCard : BattleCardBase public override AttackOpponentResult AttackOpponent(BattleCardBase target, DamageParam damageParam, SkillProcessor skillProcessor, bool IsChallenge) { - VfxBase vfx = base.VfxCreator.CreateAttack(base.BattleCardView, target.BattleCardView); + VfxBase vfx = NullVfx.GetInstance(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); DamageResult damageResult = target.ApplyDamage(null, damageParam, base.SkillApplyInformation.IsKiller, isReflectedDamage: false, skillProcessor, null); - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _buildInfo.BattleMgr; base.SelfBattlePlayer.Class.SkillApplyInformation.CausedDamageLife(damageResult.DamageApplied, ins.CurrentTurn, ins.BattlePlayer.IsSelfTurn); sequentialVfxPlayer.Register(damageResult.Vfx); SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); @@ -381,11 +371,11 @@ public class UnitBattleCard : BattleCardBase { EffectBattle effectBattle = null; Vector3 effectPosition = base.SelfBattlePlayer.Class.BattleCardView.CardWrapObject.transform.position; - sequentialVfxPlayer.Register(new SkillBase.WaitEffectLoadVfx("btl_magic_cure_1", EffectMgr.EngineType.SHURIKEN, "se_btl_magic_cure_1", BattleManagerBase.GetIns().BattleResourceMgr, delegate(EffectBattle eb) + sequentialVfxPlayer.Register(new SkillBase.WaitEffectLoadVfx("btl_magic_cure_1", EffectMgr.EngineType.SHURIKEN, "se_btl_magic_cure_1", _buildInfo.BattleMgr.BattleResourceMgr, delegate(EffectBattle eb) { effectBattle = eb; })); - DelaySetupVfx vfx = new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, base.SelfBattlePlayer.Class.BattleCardView, BattleManagerBase.GetIns().BattleResourceMgr, () => effectPosition, () => effectPosition, 0f, 0.2f, EffectMgr.MoveType.NONE, base.SelfBattlePlayer.Class.SelfBattlePlayer.IsPlayer, Color.clear)); + VfxBase vfx = NullVfx.GetInstance(); sequentialVfxPlayer2.Register(vfx); } sequentialVfxPlayer.Register(sequentialVfxPlayer2); @@ -408,14 +398,14 @@ public class UnitBattleCard : BattleCardBase } damageParam.Damage = CalculateFinalDamageAmount(damageParam.Damage, isSkillDamage, isSpellDamage); new SkillConditionCheckerOption().DefaultDamage = new DamageInfo(skill, damage); - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _buildInfo.BattleMgr; base.SkillApplyInformation.DamageLife(damageParam.Damage, ins.CurrentTurn, ins.BattlePlayer.IsSelfTurn); if (doesAttackerPossessKiller && !base.SkillApplyInformation.IsIndependent && !base.SkillApplyInformation.IsIndestructible) { FlagCardAsDestroyedByKiller(); } SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(base.VfxCreator.CreateDamage(damageParam.Damage, base.Life, base.MaxLife, BaseMaxLife, isReflectedDamage, isSkillDamage)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); skillProcessor.Register(base.Skills.CreateWhenDamageInfo(skill, skillProcessor, new BattlePlayerReadOnlyInfoPair(base.SelfBattlePlayer, base.OpponentBattlePlayer), damage, damageParam.Damage)); sequentialVfxPlayer.Register(base.ApplyDamage(skill, damageParam, doesAttackerPossessKiller, isReflectedDamage, skillProcessor, reflectCard).Vfx); return new DamageResult(sequentialVfxPlayer, damageParam.Damage, damageParam.Damage, null, null, isReflectedDamage); @@ -423,10 +413,10 @@ public class UnitBattleCard : BattleCardBase public override HealResult ApplyHealing(HealParam healParam, SkillProcessor skillProcessor) { - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = _buildInfo.BattleMgr; int num = HealLife(healParam.HealAmount, ins.CurrentTurn, ins.BattlePlayer.IsSelfTurn); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(base.VfxCreator.CreateHealing(num, base.Life, base.MaxLife, BaseMaxLife)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); new SkillConditionCheckerOption().HealingCardAndValue = new List { new BattlePlayerBase.CardAndValue(this, num) @@ -444,18 +434,10 @@ public class UnitBattleCard : BattleCardBase return result; } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - if (isNullView) - { - return NullCardVfxCreator.GetInstance(); - } - return new UnitCardVfxCreator(isPlayer, this, battleCardView, _buildInfo.ResourceMgr); - } - protected override ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) + protected override ISkillApplyInformation CreateSkillApplyInformation(BattleCardBase card) { - return new UnitSkillApplyInformation(card, vfxCreator); + return new UnitSkillApplyInformation(card); } protected override IBattleCardView CreateView(BattleCardView.BuildInfo buildInfo, bool isNullView) @@ -487,15 +469,15 @@ public class UnitBattleCard : BattleCardBase sequentialVfxPlayer.Register(base.RecoveryInPlay(inPlayIndex, newReplayMoveTurn)); if (IsEvolution) { - sequentialVfxPlayer.Register(new EvolveImageChangeVfx(this, _buildInfo.ResourceMgr)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); if (base.IsChoiceEvolutionCard) { - sequentialVfxPlayer.Register(new EvolveNameChangeVfx(this)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } - sequentialVfxPlayer.Register(new EvolveUnitMaskCardInPlayVfx(base.BattleCardView)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); } - sequentialVfxPlayer.Register(new RefreshAttackVfx(base.BattleCardView, base.Atk, base.BaseAtk, forceUpdate: true, newReplayMoveTurn)); - sequentialVfxPlayer.Register(new RefreshHealthVfx(base.BattleCardView, base.Life, base.MaxLife, BaseMaxLife, newReplayMoveTurn)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); if (Attackable && base.IsSelfTurn) { sequentialVfxPlayer.Register(InstantVfx.Create(delegate diff --git a/SVSim.BattleEngine/Engine/UnitSkillApplyInformation.cs b/SVSim.BattleEngine/Engine/UnitSkillApplyInformation.cs index c70c27f2..e43539a1 100644 --- a/SVSim.BattleEngine/Engine/UnitSkillApplyInformation.cs +++ b/SVSim.BattleEngine/Engine/UnitSkillApplyInformation.cs @@ -2,8 +2,8 @@ using Wizard.Battle.View.Vfx; public class UnitSkillApplyInformation : SkillApplyInformation { - public UnitSkillApplyInformation(BattleCardBase card, ICardVfxCreator vfxCreator) - : base(card, vfxCreator) + public UnitSkillApplyInformation(BattleCardBase card) + : base(card) { } @@ -15,7 +15,7 @@ public class UnitSkillApplyInformation : SkillApplyInformation { _card.IsSummonDrunkenness = false; } - return _vfxCreator.CreateQuick(_card.Attackable, _card.IsCantAttackClass); + return NullVfx.GetInstance(); } public override VfxBase DepriveQuick() @@ -53,7 +53,7 @@ public class UnitSkillApplyInformation : SkillApplyInformation { _card.IsSummonDrunkenness = false; } - return _vfxCreator.CreateQuick(_card.Attackable, _card.IsCantAttackClass); + return NullVfx.GetInstance(); } public override VfxBase DepriveRush(RushInfo info) diff --git a/SVSim.BattleEngine/Engine/UnityEventAgent.cs b/SVSim.BattleEngine/Engine/UnityEventAgent.cs index d317509b..2361a646 100644 --- a/SVSim.BattleEngine/Engine/UnityEventAgent.cs +++ b/SVSim.BattleEngine/Engine/UnityEventAgent.cs @@ -7,8 +7,6 @@ public class UnityEventAgent : MonoBehaviour { private BattleManagerBase m_battleMgr; - private Action ResetTouchable; - public bool HasFocus { get; private set; } public UnityEventAgent() @@ -20,69 +18,4 @@ public class UnityEventAgent : MonoBehaviour { m_battleMgr = battleMgr; } - - private void Update() - { - m_battleMgr.Update(Time.deltaTime); - } - - private void OnDisable() - { - LocalLog.AccumulateLastTraceLog("【UnityEventAgent】Object is Disabled"); - } - - private void OnEnable() - { - LocalLog.AccumulateLastTraceLog("【UnityEventAgent】Object is Enabled"); - } - - private void OnApplicationPause(bool pause) - { - if (!IsSkipPause()) - { - if (m_battleMgr != null) - { - LocalLog.AccumulateLastTraceLog("【UnityEventAgent】OnApplicationPause is called!! isPause:" + pause + "【Phase】:" + m_battleMgr.GetCurrentPhase()); - } - HasFocus = !pause; - if (pause) - { - m_battleMgr.Pause(); - } - else - { - m_battleMgr.Resume(); - } - } - } - - private void OnApplicationFocus(bool focus) - { - if (!IsSkipPause()) - { - if (m_battleMgr != null) - { - LocalLog.AccumulateLastTraceLog("【UnityEventAgent】OnApplicationFocus is called!! isFocus:" + focus + "【Phase】:" + m_battleMgr.GetCurrentPhase()); - } - HasFocus = focus; - if (focus) - { - m_battleMgr.Pause(); - m_battleMgr.Resume(); - } - else - { - m_battleMgr.Pause(); - } - } - } - - private bool IsSkipPause() - { - if (m_battleMgr != null && (m_battleMgr.GetCurrentPhase() is LoadingPhase || m_battleMgr.GetCurrentPhase() is OpeningPhase)) - { - return true; - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/UserAchievement.cs b/SVSim.BattleEngine/Engine/UserAchievement.cs index 17046ead..ab21af6e 100644 --- a/SVSim.BattleEngine/Engine/UserAchievement.cs +++ b/SVSim.BattleEngine/Engine/UserAchievement.cs @@ -12,32 +12,18 @@ public class UserAchievement : HeaderData public int total_count; - public string achievement_title; - public string achievement_name; public int require_number; - public string reward_name; - public int reward_type; public int reward_number; - public string reward_detail; - public string achieved_message; public string create_time; - public string update_time; - - public string delete_time; - - public string affected_rows; - - private const string OS_ID = null; - public long RewardUserGoodsId { get; set; } public string OsId { get; private set; } diff --git a/SVSim.BattleEngine/Engine/UserCard.cs b/SVSim.BattleEngine/Engine/UserCard.cs deleted file mode 100644 index 7b6207e3..00000000 --- a/SVSim.BattleEngine/Engine/UserCard.cs +++ /dev/null @@ -1,16 +0,0 @@ -public class UserCard : HeaderData -{ - public int card_id; - - public int number; - - public string last_got_time; - - public string create_time; - - public string update_time; - - public string delete_time; - - public string affected_rows; -} diff --git a/SVSim.BattleEngine/Engine/UserConfig.cs b/SVSim.BattleEngine/Engine/UserConfig.cs index f4b046f2..25b9a972 100644 --- a/SVSim.BattleEngine/Engine/UserConfig.cs +++ b/SVSim.BattleEngine/Engine/UserConfig.cs @@ -6,45 +6,7 @@ public class UserConfig : HeaderData { public string create_time; - public string update_time; - - public string delete_time; - - public string affected_rows; - - public bool ReceivedInvite { get; set; } - - public bool ReceivedInviteInBattle { get; set; } - - public bool ReceivedInviteInOffline { get; set; } - - public bool ReceivedFriendApply { get; set; } - - public bool ArrowAdjustSend { get; private set; } - public bool IsFoilPreferred { get; set; } public bool IsPrizePreferred { get; set; } - - public void SetArrowAdjustSend(bool arrow) - { - ArrowAdjustSend = arrow; - int num = (arrow ? 1 : 0); - if (Toolbox.SavedataManager.GetInt("ADJUST_ON", 1) != num) - { - Toolbox.SavedataManager.SetInt("ADJUST_ON", num); - WizardFirebase.OnChangeDataUseEnable(); - } - } - - public void Parse(JsonData data) - { - ReceivedInvite = data["receive_invitation"].ToInt() == 1; - ReceivedInviteInBattle = data["receive_invitation_in_battle"].ToInt() == 1; - ReceivedInviteInOffline = data["receive_invitation_in_offline"].ToInt() == 1; - ReceivedFriendApply = data["receive_friend_apply"].ToInt() == 1; - SetArrowAdjustSend(data["is_allow_send_adjust"].ToInt() == 1); - IsFoilPreferred = data["is_foil_preferred"].ToInt() == 1; - IsPrizePreferred = data["is_prize_preferred"].ToInt() == 1; - } } diff --git a/SVSim.BattleEngine/Engine/UserCrystalCount.cs b/SVSim.BattleEngine/Engine/UserCrystalCount.cs index dc5062ee..14ee293f 100644 --- a/SVSim.BattleEngine/Engine/UserCrystalCount.cs +++ b/SVSim.BattleEngine/Engine/UserCrystalCount.cs @@ -4,14 +4,9 @@ using Wizard; public class UserCrystalCount : HeaderData { - private const string ORB_KEY = "orb"; public int total_crystal; - public int free_crystal; - - public int charge_crystal; - public int red_ether; public int rupy; @@ -19,74 +14,4 @@ public class UserCrystalCount : HeaderData public int _spotcardPoint; public string create_time; - - public string update_time; - - public string delete_time; - - public string affected_rows; - - public int last_payment_date; - - public string _lastPaymentId; - - public int _lastPaymentItemBuyNumber; - - public List SpecialCrystalInfo { get; private set; } - - public bool EnableSpecialCrystal => SpecialCrystalInfo.Count > 0; - - public bool NeedNewIcon - { - get - { - foreach (SpecialCrystalInfo item in SpecialCrystalInfo) - { - if (item.AvailablePurchaseCount > 0) - { - return true; - } - } - return false; - } - } - - public RemainTime GetCloseTimeLimit() - { - int num = int.MaxValue; - RemainTime result = null; - foreach (SpecialCrystalInfo item in SpecialCrystalInfo) - { - if (item.RemainTime.Second < num) - { - num = item.RemainTime.Second; - result = item.RemainTime; - } - } - return result; - } - - public void SetUserCrystalCount(JsonData data) - { - total_crystal = data["total_crystal"].ToInt(); - free_crystal = data["free_crystal"].ToInt(); - charge_crystal = data["crystal"].ToInt(); - red_ether = data["red_ether"].ToInt(); - rupy = data["rupy"].ToInt(); - } - - public void ParseSpecialCrystal(JsonData responseData) - { - SpecialCrystalInfo = new List(); - JsonData jsonData = responseData["data"]; - if (jsonData.Keys.Contains("special_crystal_info")) - { - JsonData jsonData2 = jsonData["special_crystal_info"]; - for (int i = 0; i < jsonData2.Count; i++) - { - SpecialCrystalInfo item = new SpecialCrystalInfo(jsonData2[i], responseData); - SpecialCrystalInfo.Add(item); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/UserDegree.cs b/SVSim.BattleEngine/Engine/UserDegree.cs deleted file mode 100644 index 0fd5b1aa..00000000 --- a/SVSim.BattleEngine/Engine/UserDegree.cs +++ /dev/null @@ -1,14 +0,0 @@ -public class UserDegree : HeaderData -{ - public int degree_id; - - public int is_get; - - public string create_time; - - public string update_time; - - public string delete_time; - - public string affected_rows; -} diff --git a/SVSim.BattleEngine/Engine/UserEmblem.cs b/SVSim.BattleEngine/Engine/UserEmblem.cs deleted file mode 100644 index 15f7284f..00000000 --- a/SVSim.BattleEngine/Engine/UserEmblem.cs +++ /dev/null @@ -1,14 +0,0 @@ -public class UserEmblem : HeaderData -{ - public int emblem_id; - - public int is_get; - - public string create_time; - - public string update_time; - - public string delete_time; - - public string affected_rows; -} diff --git a/SVSim.BattleEngine/Engine/UserInfo.cs b/SVSim.BattleEngine/Engine/UserInfo.cs index f9c18436..57bd86b3 100644 --- a/SVSim.BattleEngine/Engine/UserInfo.cs +++ b/SVSim.BattleEngine/Engine/UserInfo.cs @@ -4,9 +4,5 @@ public class UserInfo : HeaderData public long selected_emblem_id; - public int selected_degree_id; - public string country_code; - - public string birth_day; } diff --git a/SVSim.BattleEngine/Engine/UserMission.cs b/SVSim.BattleEngine/Engine/UserMission.cs index e29700cc..d8fb9e10 100644 --- a/SVSim.BattleEngine/Engine/UserMission.cs +++ b/SVSim.BattleEngine/Engine/UserMission.cs @@ -10,22 +10,16 @@ public class UserMission : HeaderData public int total_count; - public string mission_title; - public string mission_name; public int display_order; public int require_number; - public string reward_name; - public int reward_type; public int reward_number; - public string reward_detail; - public long start_time; public long end_time; @@ -34,18 +28,10 @@ public class UserMission : HeaderData public string create_time; - public string update_time; - - public string delete_time; - - public string affected_rows; - public bool default_flag; public int lot_type; - public const int GEM_MISSION_TYPE = 6; - public long RewardUserGoodsId { get; set; } public static UserMission CreateAchievedMission(JsonData data) diff --git a/SVSim.BattleEngine/Engine/UserPromotionMatch.cs b/SVSim.BattleEngine/Engine/UserPromotionMatch.cs index 9b087e4e..027fc3db 100644 --- a/SVSim.BattleEngine/Engine/UserPromotionMatch.cs +++ b/SVSim.BattleEngine/Engine/UserPromotionMatch.cs @@ -11,10 +11,4 @@ public class UserPromotionMatch : HeaderData public bool is_promotion; public string create_time; - - public string update_time; - - public string delete_time; - - public string affected_rows; } diff --git a/SVSim.BattleEngine/Engine/UserRank.cs b/SVSim.BattleEngine/Engine/UserRank.cs index 6bdc7f58..40f818c3 100644 --- a/SVSim.BattleEngine/Engine/UserRank.cs +++ b/SVSim.BattleEngine/Engine/UserRank.cs @@ -7,29 +7,17 @@ public class UserRank : HeaderData { public int[] id = new int[3]; - public int[] periodNum = new int[3]; - public int[] masterPoint = new int[3]; - public int[] rankId = new int[3]; - public int targetMasterPoint; public int currentMasterPoint; } - public const int GRAND_MASTER_PERIOD = 3; - - public const int MASTER_RANK_INDEX = 24; - public int rank; - public int battle_point; - public int master_point; - public int successive_win_number; - public bool is_master_rank; public bool is_grand_master_rank; @@ -39,40 +27,4 @@ public class UserRank : HeaderData public UserPromotionMatch user_promotion_match = new UserPromotionMatch(); public static bool IsGrandMasterAvailability { get; set; } - - public void Initialize(JsonData userRank, Format format) - { - rank = userRank["rank"].ToInt(); - battle_point = userRank["battle_point"].ToInt(); - master_point = userRank["master_point"].ToInt(); - successive_win_number = userRank["successive_win_number"].ToInt(); - is_master_rank = userRank["is_master_rank"].ToInt() != 0; - is_grand_master_rank = userRank.GetValueOrDefault("is_grand_master_rank", 0) != 0; - user_promotion_match.is_promotion = userRank["is_promotion"].ToInt() != 0; - if (user_promotion_match.is_promotion) - { - user_promotion_match.match_count = userRank["user_promotion_match"]["match_count"].ToInt(); - user_promotion_match.battle_result = userRank["user_promotion_match"]["battle_result"].ToInt(); - user_promotion_match.win = userRank["user_promotion_match"]["win"].ToInt(); - user_promotion_match.lose = userRank["user_promotion_match"]["lose"].ToInt(); - } - if (is_master_rank && format != Format.Crossover) - { - IsGrandMasterAvailability = false; - if (userRank.Keys.Contains("target_grand_master_point")) - { - grandMasterData.targetMasterPoint = userRank["target_grand_master_point"].ToInt(); - IsGrandMasterAvailability = true; - } - if (userRank.Keys.Contains("current_grand_master_point")) - { - grandMasterData.currentMasterPoint = userRank["current_grand_master_point"].ToInt(); - IsGrandMasterAvailability = true; - } - } - if (is_master_rank && format == Format.Crossover) - { - grandMasterData.currentMasterPoint = master_point; - } - } } diff --git a/SVSim.BattleEngine/Engine/UserTicketCountContents.cs b/SVSim.BattleEngine/Engine/UserTicketCountContents.cs deleted file mode 100644 index 5ee969ac..00000000 --- a/SVSim.BattleEngine/Engine/UserTicketCountContents.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard; - -public class UserTicketCountContents : MonoBehaviour -{ - public struct ItemColumn - { - public int UserGoodsId; - - public string IconTextureName; - - public int PossetionNumber; - - public string unitFormat; - - public string TimeLimit { get; set; } - } - - [SerializeField] - private UIButton ButtonChangeScene; - - [SerializeField] - private UILabel ButtonLabel; - - [SerializeField] - private UILabel ItemNameLabel; - - [SerializeField] - private UILabel InfoLabel; - - [SerializeField] - private UITexture IconTexture; - - [SerializeField] - private UILabel _timeLimitLabel; - - public void SetData(ItemColumn item, Action onClick) - { - int userGoodsId = item.UserGoodsId; - IconTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(item.IconTextureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true)); - ItemNameLabel.text = string.Format(item.unitFormat, UserGoods.getUserGoodsName(UserGoods.Type.Item, item.UserGoodsId), item.PossetionNumber.ToString()); - InfoLabel.text = Data.Master.GetItemText("ITI_" + userGoodsId); - if (string.IsNullOrEmpty(item.TimeLimit)) - { - _timeLimitLabel.gameObject.SetActive(value: false); - } - else - { - _timeLimitLabel.gameObject.SetActive(value: true); - _timeLimitLabel.text = Data.SystemText.Get("Shop_0193", item.TimeLimit); - } - UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: false); - ButtonChangeScene.gameObject.SetActive(value: true); - ButtonChangeScene.onClick.Clear(); - SceneTransition.TransitionData transitionData; - switch (userGoodsId) - { - case 1: - ButtonLabel.text = Data.SystemText.Get("Arena_NewMode"); - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - transitionData = new SceneTransition.TransitionData("2pick"); - SceneTransition.ChangeScene(transitionData, null); - })); - break; - case 2: - ButtonLabel.text = Data.SystemText.Get("Colosseum_0001"); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.COLOSSEUM)) - { - UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: true); - } - else if (Data.ArenaData.ColosseumData.IsColosseumPeriod) - { - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - transitionData = new SceneTransition.TransitionData("colosseum"); - SceneTransition.ChangeScene(transitionData, null); - })); - } - else - { - UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: true); - } - break; - case 2001: - case 2002: - case 2004: - ButtonLabel.text = Data.SystemText.Get("Bingo_0023"); - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Bingo); - })); - break; - default: - if (Data.Load.data.UserItemNotStartList.Contains(userGoodsId)) - { - ButtonChangeScene.gameObject.SetActive(value: false); - } - if (Item.IsSpotCardBuildDeckTicket(userGoodsId)) - { - ButtonLabel.text = Data.SystemText.Get("Shop_0200"); - GiftTransition giftTransition = Data.Master.GiftTransitionList.Find((GiftTransition data) => data._rewardType == 4 && data._rewardDetailId == userGoodsId); - if (giftTransition != null) - { - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - transitionData = new SceneTransition.TransitionData("deck_pack"); - transitionData.Status = giftTransition._buttons[0]._transitionData.Status; - SceneTransition.ChangeScene(transitionData, null); - })); - } - } - else if (Item.IsLeaderSkinTicket(userGoodsId)) - { - ButtonLabel.text = Data.SystemText.Get("Shop_0192"); - GiftTransition giftTransition2 = Data.Master.GiftTransitionList.Find((GiftTransition data) => data._rewardType == 4 && data._rewardDetailId == userGoodsId); - if (giftTransition2 != null) - { - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - transitionData = new SceneTransition.TransitionData("leader_skin"); - transitionData.Status = giftTransition2._buttons[0]._transitionData.Status; - SceneTransition.ChangeScene(transitionData, null); - })); - } - } - else - { - if (userGoodsId < 10001) - { - break; - } - ButtonLabel.text = Data.SystemText.Get("Mail_0022"); - if (Data.Master.GiftTransitionList.Find((GiftTransition data) => data._rewardType == 4 && data._rewardDetailId == userGoodsId) != null) - { - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.SHOP_CARDPACK_MAINTENANCE)) - { - UIManager.SetObjectToGrey(ButtonChangeScene.gameObject, b: true); - break; - } - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - transitionData = new SceneTransition.TransitionData("card_pack"); - transitionData.Status = userGoodsId; - SceneTransition.ChangeScene(transitionData, null); - })); - } - else - { - ButtonChangeScene.gameObject.SetActive(value: false); - } - } - break; - } - ButtonChangeScene.onClick.Add(new EventDelegate(delegate - { - onClick.Call(); - })); - } -} diff --git a/SVSim.BattleEngine/Engine/UserTicketCountDialog.cs b/SVSim.BattleEngine/Engine/UserTicketCountDialog.cs deleted file mode 100644 index 40d367bf..00000000 --- a/SVSim.BattleEngine/Engine/UserTicketCountDialog.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard; - -public class UserTicketCountDialog : MonoBehaviour -{ - [SerializeField] - private UIWrapContent _wrapContents; - - [SerializeField] - private WrapContentsScrollBarSize _wrapScrollbarSize; - - [SerializeField] - private UIScrollBarWrapContent _wrapScrollbarContents; - - [SerializeField] - private GameObject _noItemObject; - - private List _loadFileList = new List(); - - private DialogBase _parentDialog; - - private List _itemList = new List(); - - public void Init(DialogBase parentDialog) - { - _parentDialog = parentDialog; - UserTicketCountContents.ItemColumn item = default(UserTicketCountContents.ItemColumn); - for (int i = 0; i < Data.Master.ItemList.Count; i++) - { - int itemNum = PlayerStaticData.GetItemNum(Data.Master.ItemList[i].UserGoodsId); - if (itemNum > 0 && Item.IsTicket(UserGoods.Type.Item, Data.Master.ItemList[i].UserGoodsId)) - { - item.UserGoodsId = Data.Master.ItemList[i].UserGoodsId; - item.IconTextureName = Data.Master.ItemList[i].thumbnail; - item.PossetionNumber = itemNum; - item.unitFormat = Data.Master.ItemList[i].unitFormat; - string value = null; - Data.Load.data.UserItemExpireTimeDictionary.TryGetValue(item.UserGoodsId, out value); - item.TimeLimit = value; - _itemList.Add(item); - _loadFileList.Add(Toolbox.ResourcesManager.GetAssetTypePath(item.IconTextureName, ResourcesManager.AssetLoadPathType.Item)); - } - } - if (_itemList.Count == 0) - { - _noItemObject.SetActive(value: true); - _wrapContents.gameObject.SetActive(value: false); - _wrapScrollbarContents.gameObject.SetActive(value: false); - return; - } - UIScrollView component = _wrapContents.transform.parent.GetComponent(); - UIPanel component2 = component.GetComponent(); - _noItemObject.SetActive(value: false); - _wrapContents.gameObject.SetActive(value: true); - _wrapScrollbarContents.gameObject.SetActive(value: true); - _wrapContents.onInitializeItem = _OnInitializeItem; - _wrapContents.maxIndex = 0; - _wrapScrollbarContents.m_WrapContents = _wrapContents; - _wrapContents.minIndex = -(_itemList.Count - 1); - component.ResetPosition(); - if (component2.height > (float)(_itemList.Count * _wrapContents.itemSize)) - { - component.verticalScrollBar.gameObject.SetActive(value: false); - component.enabled = false; - } - else - { - component.verticalScrollBar.gameObject.SetActive(value: true); - component.enabled = true; - } - parentDialog.SetActive(inActive: false); - UIManager.GetInstance().createInSceneCenterLoading(); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadFileList, delegate - { - parentDialog.SetActive(inActive: true); - UIManager.GetInstance().closeInSceneCenterLoading(); - _wrapScrollbarSize.ContentUpdate(); - _wrapContents.SortBasedOnScrollMovement(); - })); - } - - private void _OnInitializeItem(GameObject go, int wrapIndex, int realIndex) - { - int num = realIndex * -1; - go.name = num.ToString(); - Transform[] componentsInChildren = go.GetComponentsInChildren(includeInactive: true); - Transform[] array; - if (num >= _itemList.Count || num < 0) - { - array = componentsInChildren; - for (int i = 0; i < array.Length; i++) - { - array[i].gameObject.SetActive(value: false); - } - return; - } - array = componentsInChildren; - for (int i = 0; i < array.Length; i++) - { - array[i].gameObject.SetActive(value: true); - } - SetContents(num, go.GetComponent()); - } - - private void SetContents(int ItemListIndex, UserTicketCountContents contents) - { - Action onClick = delegate - { - MoveSceneAction(); - }; - contents.SetData(_itemList[ItemListIndex], onClick); - } - - private void MoveSceneAction() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _parentDialog.Close(); - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - } -} diff --git a/SVSim.BattleEngine/Engine/UserTutorial.cs b/SVSim.BattleEngine/Engine/UserTutorial.cs index 0bb289aa..7a9f28b2 100644 --- a/SVSim.BattleEngine/Engine/UserTutorial.cs +++ b/SVSim.BattleEngine/Engine/UserTutorial.cs @@ -3,38 +3,11 @@ using Wizard; public class UserTutorial : HeaderData { - public const int TUTORIAL_STEP0 = 1; - - public const int TUTORIAL_STEP1 = 11; - - public const int TUTORIAL_STEP2 = 21; - - public const int TUTORIAL_STEP_RECEIVE_GIFT = 31; - - public const int TUTORIAL_STEP_BUY_CARD_PACK = 41; - - public const int TUTORIAL_END = 100; public int tutorial_step; - public int tutorial_replay_step; - public string create_time; - public string update_time; - - public string delete_time; - - public string affected_rows; - - public const int PRE_TUTORIAL_STEP = 0; - - public const int ENTER_USER_ID_ACTION_NUMBER = 1; - - public const int CLEARED_PROLOGUE_ACTION_NUMBER = 2; - - public bool NeedAllResource => tutorial_step >= 31; - public int TutorialStep { get diff --git a/SVSim.BattleEngine/Engine/UtilityDrumrollItem.cs b/SVSim.BattleEngine/Engine/UtilityDrumrollItem.cs index 0d2469d3..9c3f0182 100644 --- a/SVSim.BattleEngine/Engine/UtilityDrumrollItem.cs +++ b/SVSim.BattleEngine/Engine/UtilityDrumrollItem.cs @@ -11,8 +11,6 @@ public class UtilityDrumrollItem : MonoBehaviour [SerializeField] private UtilityDrumrollItemCustomize _customizeItem; - private const float COLOR_DIFF_Y = 20f; - private UIPanel _scrollView; private Vector2 _scrollSize = Vector2.zero; @@ -28,35 +26,4 @@ public class UtilityDrumrollItem : MonoBehaviour _scrollView = scroll; _scrollSize = _scrollView.GetViewSize(); } - - private void Update() - { - if (_childLabel != null) - { - float num = _scrollView.clipOffset.y - base.gameObject.transform.localPosition.y; - float num2 = _scrollSize.y / 2f; - float num3 = Mathf.Clamp(Mathf.Abs(num), 0f, num2); - float num4 = Mathf.LerpAngle(0f, 90f, num3 * (num3 / num2) / num2); - if (num > 0f) - { - num4 *= -1f; - } - _childLabel.transform.localEulerAngles = Vector3.right * num4; - Color32 color3; - if (num3 > 20f) - { - Color color = (_childLabel.color = LabelDefine.TEXT_COLOR_B0B0B0); - color3 = color; - } - else - { - Color color = (_childLabel.color = LabelDefine.TEXT_COLOR_NORMAL); - color3 = color; - } - if (_customizeItem != null) - { - _customizeItem.OnUpdate(num4, color3); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/UtilityDrumrollScroll.cs b/SVSim.BattleEngine/Engine/UtilityDrumrollScroll.cs index 2054aca6..bd8badd6 100644 --- a/SVSim.BattleEngine/Engine/UtilityDrumrollScroll.cs +++ b/SVSim.BattleEngine/Engine/UtilityDrumrollScroll.cs @@ -147,7 +147,7 @@ public class UtilityDrumrollScroll : MonoBehaviour if (CurrentIndex != index) { CurrentIndex = index; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + if (!_isDrag) { _centerOnChild.CenterOn(g.transform); diff --git a/SVSim.BattleEngine/Engine/VellsarDesertField.cs b/SVSim.BattleEngine/Engine/VellsarDesertField.cs index 013224ef..ad7e0e4c 100644 --- a/SVSim.BattleEngine/Engine/VellsarDesertField.cs +++ b/SVSim.BattleEngine/Engine/VellsarDesertField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class VellsarDesertField : BackGroundBase { public override int FieldId => 43; @@ -10,75 +11,4 @@ public class VellsarDesertField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0043_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles43").gameObject; - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldParticleSystemDictionary.Add("start", _fieldParticles.transform.Find("start").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_43, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_43_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["start"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-2810f, 1044f, 51f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(20.5f, 73f, -96f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-218f, 123f, -36.3f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(18.5f, 95f, -88f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(3f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/VideoHostingImplBase.cs b/SVSim.BattleEngine/Engine/VideoHostingImplBase.cs index 122a76c0..d2207e9d 100644 --- a/SVSim.BattleEngine/Engine/VideoHostingImplBase.cs +++ b/SVSim.BattleEngine/Engine/VideoHostingImplBase.cs @@ -6,35 +6,10 @@ public abstract class VideoHostingImplBase : MonoBehaviour { } - protected virtual void Start() - { - } - - protected virtual void OnDestroy() - { - } - - public virtual bool IsVideoHostingSupported() - { - return false; - } - - public virtual void StartRecording() - { - } - public virtual void StopRecording() { } - public virtual void PauseRecording() - { - } - - public virtual void ResumeRecording() - { - } - public virtual bool IsRecording() { return false; @@ -45,40 +20,10 @@ public abstract class VideoHostingImplBase : MonoBehaviour return false; } - public virtual bool HasRecordedData() - { - return false; - } - - public virtual void UploadRecording() - { - } - - public virtual bool IsUploading() - { - return false; - } - - public virtual void WatchRecording() - { - } - - public virtual void StartPublishing() - { - } - - public virtual void StopPublishing() - { - } - public virtual void PausePublishing() { } - public virtual void ResumePublishing() - { - } - public virtual bool IsPublising() { return false; @@ -89,97 +34,11 @@ public abstract class VideoHostingImplBase : MonoBehaviour return false; } - public virtual void SetPublishingReceiveCommentEnable(bool isEnable) - { - } - - public virtual void ShowPublishingMenu() - { - } - public virtual void SetRecordingFaceCameraMicrophoneStatus(bool isEnableCamera, bool isEnalbeMicrophon) { } - public virtual bool GetRecordingFaceCameraEnable() - { - return false; - } - - public virtual bool GetRecordingMicrophoneEnable() - { - return false; - } - - public virtual void SetRecordingMicrophoneGain(float gain) - { - } - - public virtual float GetRecordingMicrophoneGain() - { - return 0f; - } - public virtual void SetPublishingFaceCameraMicrophoneStatus(bool isEnableCamera, bool isEnalbeMicrophon) { } - - public virtual bool GetPublishingFaceCameraEnable() - { - return false; - } - - public virtual bool GetPublishingMicrophoneEnable() - { - return false; - } - - public virtual void SetPublishingMicrophoneGain(float gain) - { - } - - public virtual float GetPublishingMicrophoneGain() - { - return 0f; - } - - public virtual void SetFaceCameraWindowVisible(bool isVisible) - { - } - - public virtual int GetFaceCameraWindowX() - { - return 0; - } - - public virtual void SetFaceCameraWindowX(int screenX) - { - } - - public virtual int GetFaceCameraWindowY() - { - return 0; - } - - public virtual void SetFaceCameraWindowY(int screenY) - { - } - - public virtual int GetFaceCameraWindowWidth() - { - return 0; - } - - public virtual void SetFaceCameraWindowWidth(int w) - { - } - - public virtual int GetFaceCameraWindowHeight() - { - return 0; - } - - public virtual void SetFaceCameraWindowHeight(int h) - { - } } diff --git a/SVSim.BattleEngine/Engine/VideoHostingImplNull.cs b/SVSim.BattleEngine/Engine/VideoHostingImplNull.cs deleted file mode 100644 index ed963c72..00000000 --- a/SVSim.BattleEngine/Engine/VideoHostingImplNull.cs +++ /dev/null @@ -1,3 +0,0 @@ -public class VideoHostingImplNull : VideoHostingImplBase -{ -} diff --git a/SVSim.BattleEngine/Engine/VideoHostingManager.cs b/SVSim.BattleEngine/Engine/VideoHostingManager.cs index 67c25b8b..8a5a1090 100644 --- a/SVSim.BattleEngine/Engine/VideoHostingManager.cs +++ b/SVSim.BattleEngine/Engine/VideoHostingManager.cs @@ -2,40 +2,11 @@ public class VideoHostingManager : SingletonMonoBehaviour { private VideoHostingImplBase _impl; - private void Start() - { - _impl = base.gameObject.AddComponent(); - } - - private void OnDestroy() - { - } - - public bool IsVideoHostingSupported() - { - return _impl.IsVideoHostingSupported(); - } - - public void StartRecording() - { - _impl.StartRecording(); - } - public void StopRecording() { _impl.StopRecording(); } - public void PauseRecording() - { - _impl.PauseRecording(); - } - - public void ResumeRecording() - { - _impl.ResumeRecording(); - } - public bool IsRecording() { return _impl.IsRecording(); @@ -46,46 +17,11 @@ public class VideoHostingManager : SingletonMonoBehaviour return _impl.IsRecordingPause(); } - public bool HasRecordedData() - { - return _impl.HasRecordedData(); - } - - public void UploadRecording() - { - _impl.UploadRecording(); - } - - public bool IsUploading() - { - return _impl.IsUploading(); - } - - public void WatchRecording() - { - _impl.WatchRecording(); - } - - public void StartPublishing() - { - _impl.StartPublishing(); - } - - public void StopPublishing() - { - _impl.StopPublishing(); - } - public void PausePublishing() { _impl.PausePublishing(); } - public void ResumePublishing() - { - _impl.ResumePublishing(); - } - public bool IsPublising() { return _impl.IsPublising(); @@ -96,108 +32,13 @@ public class VideoHostingManager : SingletonMonoBehaviour return _impl.IsPublishingPause(); } - public void SetPublishingReceiveCommentEnable(bool isEnable) - { - _impl.SetPublishingReceiveCommentEnable(isEnable); - } - - public void ShowPublishingMenu() - { - _impl.ShowPublishingMenu(); - } - public void SetRecordingFaceCameraMicrophoneStatus(bool isEnableCamera, bool isEnableMicrophone) { _impl.SetRecordingFaceCameraMicrophoneStatus(isEnableCamera, isEnableMicrophone); } - public bool GetRecordingFaceCameraEnable() - { - return _impl.GetRecordingFaceCameraEnable(); - } - - public bool GetRecordingMicrophoneEnable() - { - return _impl.GetRecordingMicrophoneEnable(); - } - - public void SetRecordingMicrophoneGain(float gain) - { - _impl.SetRecordingMicrophoneGain(gain); - } - - public float GetRecordingMicrophoneGain() - { - return _impl.GetRecordingMicrophoneGain(); - } - public void SetPublishingFaceCameraMicrophoneStatus(bool isEnableCamera, bool isEnableMicrophone) { _impl.SetPublishingFaceCameraMicrophoneStatus(isEnableCamera, isEnableMicrophone); } - - public bool GetPublishingFaceCameraEnable() - { - return _impl.GetPublishingFaceCameraEnable(); - } - - public bool GetPublishingMicrophoneEnable() - { - return _impl.GetPublishingMicrophoneEnable(); - } - - public void SetPublishingMicrophoneGain(float gain) - { - _impl.SetPublishingMicrophoneGain(gain); - } - - public float GetPublishingMicrophoneGain() - { - return _impl.GetPublishingMicrophoneGain(); - } - - public void SetFaceCameraWindowVisible(bool isVisible) - { - _impl.SetFaceCameraWindowVisible(isVisible); - } - - public int GetFaceCameraWindowX() - { - return _impl.GetFaceCameraWindowX(); - } - - public void SetFaceCameraWindowX(int screenX) - { - _impl.SetFaceCameraWindowX(screenX); - } - - public int GetFaceCameraWindowY() - { - return _impl.GetFaceCameraWindowY(); - } - - public void SetFaceCameraWindowY(int screenY) - { - _impl.SetFaceCameraWindowY(screenY); - } - - public int GetFaceCameraWindowWidth() - { - return _impl.GetFaceCameraWindowWidth(); - } - - public void SetFaceCameraWindowWidth(int w) - { - _impl.SetFaceCameraWindowWidth(w); - } - - public int GetFaceCameraWindowHeight() - { - return _impl.GetFaceCameraWindowHeight(); - } - - public void SetFaceCameraWindowHeight(int h) - { - _impl.SetFaceCameraWindowHeight(h); - } } diff --git a/SVSim.BattleEngine/Engine/VideoHostingNicoNicoNotification.cs b/SVSim.BattleEngine/Engine/VideoHostingNicoNicoNotification.cs deleted file mode 100644 index b7559fd4..00000000 --- a/SVSim.BattleEngine/Engine/VideoHostingNicoNicoNotification.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using UnityEngine; -using Wizard; - -public class VideoHostingNicoNicoNotification : MonoBehaviour -{ - [SerializeField] - private UIToggle _toggleAgree; - - [SerializeField] - private UIButton _buttonNicoNico; - - [SerializeField] - private UIButton _buttonNicoNama; - - [SerializeField] - private UIButton _buttonAgree; - - [SerializeField] - private UILabel _buttonLabelNicoNico; - - [SerializeField] - private UILabel _buttonLabelNicoNama; - - [SerializeField] - private UILabel _buttonLabelAgree; - - [SerializeField] - private UILabel _labelDialogBody; - - private DialogBase _parent; - - private bool _isNicoNicoAgree; - - private void Start() - { - SystemText systemText = Data.SystemText; - _toggleAgree.onChange.Add(new EventDelegate(OnClickNicoNicoNotificationAgree)); - _buttonNicoNico.onClick.Add(new EventDelegate(OnClickNicoNico)); - _buttonNicoNama.onClick.Add(new EventDelegate(OnClickNicoNama)); - _buttonAgree.onClick.Add(new EventDelegate(OnClickNicoNicoNotificationAgreeButton)); - _buttonLabelNicoNico.text = systemText.Get("VideoHosting_0034"); - _buttonLabelNicoNama.text = systemText.Get("VideoHosting_0035"); - _buttonLabelAgree.text = systemText.Get("Title_0015"); - _labelDialogBody.text = systemText.Get("VideoHosting_0036"); - } - - public void SetParent(DialogBase parent) - { - _parent = parent; - _parent.SetButtonDisable(isEnableOK: true); - DialogBase parent2 = _parent; - parent2.onPushButton1 = (Action)Delegate.Combine(parent2.onPushButton1, new Action(OnClickNicoNicoNotificationOK)); - DialogBase parent3 = _parent; - parent3.onPushButton2 = (Action)Delegate.Combine(parent3.onPushButton2, new Action(OnNotificationClose)); - } - - private void OnClickNicoNico() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.NICONICO); - } - - private void OnClickNicoNama() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.NICONICO_PUBLISH); - } - - private void OnClickNicoNicoNotificationAgree() - { - _isNicoNicoAgree = UIToggle.current.value; - _parent.SetButtonDisable(!_isNicoNicoAgree); - } - - private void OnClickNicoNicoNotificationAgreeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_isNicoNicoAgree ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - - public void OnClickNicoNicoNotificationOK() - { - if (_isNicoNicoAgree) - { - VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.NicoNicoNotificationAgreement, enable: true); - UIManager.GetInstance().CheckFirstTips(FirstTips.TipsType.VideoSharing); - VideoHostingUtil.CreateVideoHostingSetting(); - } - } - - public void OnNotificationClose() - { - _parent = null; - } -} diff --git a/SVSim.BattleEngine/Engine/VideoHostingUtil.cs b/SVSim.BattleEngine/Engine/VideoHostingUtil.cs index 645e9158..982ea0c9 100644 --- a/SVSim.BattleEngine/Engine/VideoHostingUtil.cs +++ b/SVSim.BattleEngine/Engine/VideoHostingUtil.cs @@ -8,164 +8,20 @@ public class VideoHostingUtil : SingletonMonoBehaviour public enum Option { EnemyNameDisplay, - RecordPauseInMenu, - UseRecordingFaceCamera, - UseRecordingMicrophone, - UsePublishingFaceCamera, - UsePublishingMicrophone, - NicoNicoNotificationAgreement, - AutoPauseRecording, AutoPausePublishing, AutoStopRecording, - IsPublishing, - IsRecording, Max } public enum HUDScene { - Title = 0, - Home = 1, Battle = 2, - BattleResult = 3, - RoomMatchRobby = 4, Default = 1 } private enum RecordingAutoStopStatus { - Null, - Active, - Pause - } - - public const int FACECAMERAWINDOW_WIDTH_DEFAULT = 72; - - public const int FACECAMERAWINDOW_HEIGHT_DEFAULT = 72; - - public const float FACECAMERAWINDOW_WIDTH_MIN = 72f; - - public const float FACECAMERAWINDOW_WIDTH_MAX = 400f; - - public const float FACECAMERAWINDOW_HEIGHT_MIN = 72f; - - public const float FACECAMERAWINDOW_HEIGHT_MAX = 400f; - - private const int TAGRECORDING_EDITABLE_CAPACITY = 2; - - private const int TAGRECORDING_UNEDITABLE_CAPACITY = 2; - - private const int TAGPUBLISHING_UNEDITABLE_CAPACITY = 3; - - public const int VIDEOHOSTING_DIALOG_OVERLAY_DEPTH = 5000; - - public const int VIDEOHOSTING_DIALOG_OVERLAY_DEPTH_AUTOSTOP = 5010; - - private const int NICONICODIALOG_BUTTON_NICONICO = 0; - - private const int NICONICODIALOG_BUTTON_NICONAMA = 1; - - private const int NICONICODIALOG_BUTTON_AGREE = 2; - - private const int NICONICODIALOG_LABEL_NICONICO = 0; - - private const int NICONICODIALOG_LABEL_NICONAMA = 1; - - private const int NICONICODIALOG_LABEL_AGREE = 2; - - private const int NICONICODIALOG_LABEL_DIALOGBODY = 3; - - private const int NICONICODIALOG_TOGGLE_AGREE = 0; - - public const int VIDEOHOSTING_OPTION_DEFAULT = 1; - - private const int ERROR_DIALOG_DEPTH_OFFSET = 5; - - private const int ERROR_DIALOG_MAX = 100; - - private const float DELAY_UPLOAD_SEC = 0.3f; - - private const float DELAY_UPLOAD_RETURN_MUTE_SEC = 1f; - - private const float RECORD_AUTOSTOP_SEC_BUFFER = 10f; - - private const float RECORD_AUTOSTOP_SEC = 1510f; - - private bool _isRecordModeEnable; - - private bool _isPublishModeEnable; - - private HUDScene _HUDScene = HUDScene.Home; - - [SerializeField] - private GameObject _niconicoNotifcation; - - private double _autoStopTimer; - - private RecordingAutoStopStatus _autoStopStatus; - - public static int GetFaceCameraWindowXDefault() - { - UIManager uIManager = UIManager.GetInstance(); - if (null == uIManager) - { - return 0; - } - if (null == uIManager.getCamera() || null == uIManager.GetVideoHostingHUD()) - { - return 0; - } - return (int)uIManager.getCamera().WorldToScreenPoint(uIManager.GetVideoHostingHUD().GetFaceCameraWindowLocator().position).x; - } - - public static int GetFaceCameraWindowYDefault() - { - UIManager uIManager = UIManager.GetInstance(); - if (null == uIManager) - { - return Screen.height; - } - if (null == uIManager.getCamera() || null == uIManager.GetVideoHostingHUD()) - { - return Screen.height; - } - return (int)uIManager.getCamera().WorldToScreenPoint(uIManager.GetVideoHostingHUD().GetFaceCameraWindowLocator().position).y; - } - - private void Update() - { - _UpdateRecordingAutoStopTimer(); - } - - public static bool GetRecordModeEnable() - { - return SingletonMonoBehaviour.instance._isRecordModeEnable; - } - - public static void SetRecordModeEnable(bool isEnable) - { - SingletonMonoBehaviour.instance._isRecordModeEnable = isEnable; - } - - public static bool GetPublishModeEnable() - { - return SingletonMonoBehaviour.instance._isPublishModeEnable; - } - - public static void SetPublishModeEnable(bool isEnable) - { - SingletonMonoBehaviour.instance._isPublishModeEnable = isEnable; - } - - public static bool GetOptionFlagFromPlayerPrefs(Option option) - { - if (option < Option.EnemyNameDisplay || option >= Option.Max) - { - return false; - } - int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VIDEOHOSTING_FLAGS); - return (value & (1 << (int)option)) != 0; - } +} public static void SetOptionFlagFromPlayerPrefs(Option option, bool enable) { @@ -177,51 +33,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour } } - public static string GetVideoHostingVersion() - { - return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VIDEOHOSTING_VERSION); - } - - public static void SetVideoHostingVersion(string version) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.VIDEOHOSTING_VERSION, version); - } - - public static void CreateVideoHostingSetting() - { - if (SingletonMonoBehaviour.instance.IsRecording() || SingletonMonoBehaviour.instance.IsPublising()) - { - CreateDialogInvalidOperation(); - } - else - { - UIManager.GetInstance().CreateVideoHostingSettingRoot().SetTitleLabel(GetVideoHostingSettingTitle()); - } - } - - public static void CreateNicoNicoNotification() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("VideoHosting_0037")); - dialogBase.SetButtonText(systemText.Get("Common_0004"), systemText.Get("Common_0005")); - GameObject gameObject = UnityEngine.Object.Instantiate(SingletonMonoBehaviour.instance._niconicoNotifcation); - dialogBase.SetObj(gameObject); - gameObject.GetComponent().SetParent(dialogBase); - } - - public static string GetVideoHostingSettingTitle() - { - return Data.SystemText.Get("VideoHosting_0001"); - } - - public static void CheckVideoHostingAndShowAchievement(Action cbAchievement) - { - cbAchievement(); - } - public static void CheckVideoHostingAndExecAction(Action cbClose) { bool flag = SingletonMonoBehaviour.instance.IsPublising() && !SingletonMonoBehaviour.instance.IsPublishingPause(); @@ -251,190 +62,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour } } - private static void _OverrideSoundMute() - { - GameMgr.GetIns().GetSoundMgr().AllMute(isMute: true); - } - - private static void _ReturnSoundMute() - { - GameMgr.GetIns().GetSoundMgr().AllMute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - } - - public static void UploadRecordingAndSoundMute() - { - if (SingletonMonoBehaviour.instance.HasRecordedData() && !SingletonMonoBehaviour.instance.IsUploading()) - { - _OverrideSoundMute(); - SingletonMonoBehaviour.instance.UploadRecording(); - } - else - { - CreateDialogNotHasRecordedData(); - } - } - - private static void _DelayUpload() - { - UIManager.GetInstance().closeInSceneCenterLoading(); - UploadRecordingAndSoundMute(); - } - - public static void CheckAndCreateHUD(HUDScene scene) - { - if (GetRecordModeEnable()) - { - UIManager.GetInstance().CreateVideoHostingHUD(VideoHostingHUD.HUDMode.Recording); - SetHUDScene(scene); - } - else if (GetPublishModeEnable()) - { - UIManager.GetInstance().CreateVideoHostingHUD(VideoHostingHUD.HUDMode.Publishing); - SetHUDScene(scene); - } - else - { - UIManager.GetInstance().DestroyVideoHostingHUD(); - } - } - - public static void SetHUDScene(HUDScene scene) - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null == videoHostingHUD) - { - return; - } - bool pushEnablePlay = false; - bool pushEnableSetting = false; - int controlButtonLayer = VideoHostingHUD.CONTROLBUTTON_LAYER_DEFAULT; - switch (scene) - { - case HUDScene.Home: - if (GetRecordModeEnable()) - { - pushEnablePlay = true; - pushEnableSetting = true; - } - else if (GetPublishModeEnable()) - { - pushEnablePlay = true; - pushEnableSetting = true; - } - break; - case HUDScene.Battle: - if (GetRecordModeEnable()) - { - pushEnablePlay = true; - pushEnableSetting = true; - } - else if (GetPublishModeEnable()) - { - pushEnablePlay = false; - pushEnableSetting = true; - } - controlButtonLayer = VideoHostingHUD.CONTROLBUTTON_LAYER_BATTLE; - break; - case HUDScene.BattleResult: - if (GetRecordModeEnable()) - { - pushEnablePlay = true; - pushEnableSetting = true; - } - else if (GetPublishModeEnable()) - { - pushEnablePlay = false; - pushEnableSetting = true; - } - break; - case HUDScene.RoomMatchRobby: - if (GetRecordModeEnable()) - { - pushEnablePlay = true; - pushEnableSetting = true; - } - else if (GetPublishModeEnable()) - { - pushEnablePlay = false; - pushEnableSetting = true; - } - break; - case HUDScene.Title: - if (GetRecordModeEnable()) - { - pushEnablePlay = false; - pushEnableSetting = false; - } - else if (GetPublishModeEnable()) - { - pushEnablePlay = false; - pushEnableSetting = false; - } - break; - } - SingletonMonoBehaviour.instance._HUDScene = scene; - videoHostingHUD.SetPushEnablePlay(pushEnablePlay); - videoHostingHUD.SetPushEnableSetting(pushEnableSetting); - videoHostingHUD.SetControlButtonLayer(controlButtonLayer); - } - - public static HUDScene GetHUDScene() - { - return SingletonMonoBehaviour.instance._HUDScene; - } - - public static bool CheckHUDSceneUploadEnable(HUDScene scene) - { - if (scene == HUDScene.Battle || scene == HUDScene.BattleResult || scene == HUDScene.RoomMatchRobby) - { - return false; - } - return true; - } - - public static void FaceCameraAdjustSwitch() - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (!(null == videoHostingHUD)) - { - if (GetPublishModeEnable() && SingletonMonoBehaviour.instance.GetPublishingFaceCameraEnable()) - { - videoHostingHUD.InitFaceCameraAdjust(); - videoHostingHUD.SetFaceCameraAdjustSwitchEnable(isEnable: true); - } - else - { - videoHostingHUD.SetFaceCameraAdjustSwitchEnable(isEnable: false); - } - } - } - - private static IEnumerator _InitHUDForPublishing() - { - VideoHostingHUD vhHUD = UIManager.GetInstance().GetVideoHostingHUD(); - while (!vhHUD.GetInitialized()) - { - yield return null; - } - UIManager.GetInstance().GetVideoHostingHUD().OnStartPublishing(); - FaceCameraAdjustSwitch(); - } - - public static bool IsAutoPauseRecording() - { - return GetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording); - } - - public static bool IsAutoStopRecording() - { - return GetOptionFlagFromPlayerPrefs(Option.AutoStopRecording); - } - - public static bool IsAutoPausePublishing() - { - return GetOptionFlagFromPlayerPrefs(Option.AutoPausePublishing); - } - public static void AutoPausePublishing(bool isSave) { if (SingletonMonoBehaviour.instance.IsPublising() && !SingletonMonoBehaviour.instance.IsPublishingPause()) @@ -447,18 +74,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour } } - public static void AutoPauseRecording(bool isSave) - { - if (SingletonMonoBehaviour.instance.IsRecording() && !SingletonMonoBehaviour.instance.IsRecordingPause()) - { - SingletonMonoBehaviour.instance.PauseRecording(); - if (isSave) - { - SetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording, enable: true); - } - } - } - public static void AutoStopRecording(bool isSave) { if (SingletonMonoBehaviour.instance.IsRecording()) @@ -471,159 +86,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour } } - public static void AutoResumePublishing() - { - if (IsAutoPausePublishing()) - { - if (SingletonMonoBehaviour.instance.IsPublishingPause()) - { - SingletonMonoBehaviour.instance.ResumePublishing(); - } - SetOptionFlagFromPlayerPrefs(Option.AutoPausePublishing, enable: false); - } - } - - public static void AutoResumeRecording() - { - if (IsAutoPauseRecording()) - { - if (SingletonMonoBehaviour.instance.IsRecordingPause()) - { - SingletonMonoBehaviour.instance.ResumeRecording(); - } - SetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording, enable: false); - } - } - - private void _UpdateRecordingAutoStopTimer() - { - if (RecordingAutoStopStatus.Active != _autoStopStatus) - { - return; - } - _autoStopTimer -= Time.deltaTime; - if (_autoStopTimer < 0.0) - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null != videoHostingHUD) - { - videoHostingHUD.CloseSettingMenuDialog(); - } - CreateDialogStopRecording(CheckHUDSceneUploadEnable(GetHUDScene()), isTimeOut: true); - SingletonMonoBehaviour.instance.StopRecording(); - _StopRecordingAutoStopTimer(); - } - } - - private void _StartRecordingAutoStopTimer(float sec) - { - _StopRecordingAutoStopTimer(); - _autoStopStatus = RecordingAutoStopStatus.Active; - _autoStopTimer = sec; - } - - private void _StopRecordingAutoStopTimer() - { - _autoStopStatus = RecordingAutoStopStatus.Null; - _autoStopTimer = 0.0; - } - - private void _PauseRecordingAutoStopTimer() - { - if (RecordingAutoStopStatus.Active == _autoStopStatus) - { - _autoStopStatus = RecordingAutoStopStatus.Pause; - } - } - - private void _ResumeRecordingAutoStopTimer() - { - if (RecordingAutoStopStatus.Pause == _autoStopStatus) - { - _autoStopStatus = RecordingAutoStopStatus.Active; - } - } - - public static string GetUserNameHidden(string userName) - { - if ((GetRecordModeEnable() || GetPublishModeEnable()) && !GetOptionFlagFromPlayerPrefs(Option.EnemyNameDisplay)) - { - userName = Data.SystemText.Get("VideoHosting_0046"); - } - return userName; - } - - public static string GetUserIDHidden(string userID) - { - if (GetRecordModeEnable() || GetPublishModeEnable()) - { - userID = Data.SystemText.Get("VideoHosting_0081"); - } - return userID; - } - - public static void OnStartRecording() - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null != videoHostingHUD) - { - videoHostingHUD.OnStartRecording(); - } - SetOptionFlagFromPlayerPrefs(Option.IsRecording, enable: true); - } - - public static void OnFinishRecording() - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null != videoHostingHUD) - { - videoHostingHUD.OnFinishRecording(); - } - SetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording, enable: false); - SetOptionFlagFromPlayerPrefs(Option.IsRecording, enable: false); - } - - public static void OnPauseRecording() - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null != videoHostingHUD) - { - videoHostingHUD.OnPauseRecording(); - } - } - - public static void OnResumeRecording() - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null != videoHostingHUD) - { - videoHostingHUD.OnResumeRecording(); - } - } - - public static void OnStartUploadRecording() - { - } - - public static void OnFinishUploadRecording(string strVideoId, string strUrl) - { - } - - public static void OnCameraStartedSession() - { - FaceCameraAdjustSwitch(); - } - - public static void OnCameraStoppedSession() - { - VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD(); - if (null != videoHostingHUD) - { - videoHostingHUD.EndFaceCameraAdjust(); - videoHostingHUD.SetFaceCameraAdjustSwitchEnable(isEnable: false); - } - } - public static void OnSoftwareReset() { AutoPausePublishing(isSave: true); @@ -631,160 +93,4 @@ public class VideoHostingUtil : SingletonMonoBehaviour SingletonMonoBehaviour.instance.SetRecordingFaceCameraMicrophoneStatus(isEnableCamera: false, isEnableMicrophone: false); SingletonMonoBehaviour.instance.SetPublishingFaceCameraMicrophoneStatus(isEnableCamera: false, isEnableMicrophone: false); } - - private static DialogBase _CreateVideoHostingDialogCommon(string strKeyTitle, string strKeyText) - { - return _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, strKeyTitle, strKeyText, "", ""); - } - - private static DialogBase _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout layout, string strKeyTitle, string strKeyText, string strKeyButton1, string strKeyButton2) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetButtonLayout(layout); - dialogBase.SetTitleLabel(systemText.Get(strKeyTitle)); - dialogBase.SetText(systemText.Get(strKeyText)); - if (!string.IsNullOrEmpty(strKeyButton1) && !string.IsNullOrEmpty(strKeyButton2)) - { - dialogBase.SetButtonText(systemText.Get(strKeyButton1), systemText.Get(strKeyButton2)); - } - else if (!string.IsNullOrEmpty(strKeyButton1)) - { - dialogBase.SetButtonText(systemText.Get(strKeyButton1)); - } - dialogBase.SetPanelDepth(5000); - return dialogBase; - } - - public static void CreateDialogNotHasRecordedData() - { - _CreateVideoHostingDialogCommon("Common_0021", "VideoHosting_0075"); - } - - public static void CreateDialogStopRecording(bool isUseUploadButton, bool isTimeOut) - { - if (isUseUploadButton) - { - string strKeyText = (isTimeOut ? "VideoHosting_0049" : "VideoHosting_0051"); - string strKeyButton = "VideoHosting_0021"; - DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.BlueBtn_CancelBtn, "Common_0021", strKeyText, "Common_0004", strKeyButton); - dialogBase.onPushButton2 = (Action)Delegate.Combine(dialogBase.onPushButton2, (Action)delegate - { - SingletonMonoBehaviour.instance.StartCoroutine(Timer.DelayMethod(0.3f, _DelayUpload)); - }); - dialogBase.SetPanelDepth(5010); - } - else - { - string strKeyText2 = (isTimeOut ? "VideoHosting_0024" : "VideoHosting_0050"); - _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", strKeyText2, "Common_0004", "").SetPanelDepth(5010); - } - } - - private static void _CreateDialogStopPublishing(bool isTimeOut) - { - string text = ""; - text = ((!isTimeOut) ? "VideoHosting_0040" : "VideoHosting_0039"); - _CreateVideoHostingDialogCommon("Common_0021", text); - } - - public static void CreateDialogNotSupported() - { - _CreateVideoHostingDialogCommon("Error_0001", "VideoHosting_0080"); - } - - public static void CreateDialogInvalidOperation() - { - string strKeyText = ""; - if (SingletonMonoBehaviour.instance.IsPublising()) - { - strKeyText = "VideoHosting_0067"; - } - else if (SingletonMonoBehaviour.instance.IsRecording()) - { - strKeyText = "VideoHosting_0068"; - } - _CreateVideoHostingDialogCommon("Common_0021", strKeyText); - } - - public static void CreateDialogPrivacyAccount() - { - string strKeyText = ""; - if (SingletonMonoBehaviour.instance.IsPublising()) - { - strKeyText = "VideoHosting_0057"; - } - else if (SingletonMonoBehaviour.instance.IsRecording()) - { - strKeyText = "VideoHosting_0056"; - } - _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", strKeyText, "Common_0004", ""); - } - - public static void CreateDialogAchievementEnter() - { - string strKeyText = ""; - if (SingletonMonoBehaviour.instance.IsPublising()) - { - strKeyText = "VideoHosting_0072"; - } - else if (SingletonMonoBehaviour.instance.IsRecording()) - { - strKeyText = "VideoHosting_0068"; - } - _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", strKeyText, "Common_0004", ""); - } - - public static void CreateDialogPrivacyBuyCrystalEnter(Action cbPushOK) - { - DialogBase dialogBase = null; - if (SingletonMonoBehaviour.instance.IsPublising()) - { - string strKeyTitle = "VideoHosting_0078"; - string strKeyText = "VideoHosting_0054"; - string strKeyButton = "VideoHosting_0063"; - dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.BlueBtn_CancelBtn, strKeyTitle, strKeyText, strKeyButton, ""); - DialogBase dialogBase2 = dialogBase; - dialogBase2.onPushButton1 = (Action)Delegate.Combine(dialogBase2.onPushButton1, (Action)delegate - { - AutoPausePublishing(isSave: true); - }); - } - else if (SingletonMonoBehaviour.instance.IsRecording()) - { - string strKeyTitle2 = "VideoHosting_0079"; - string strKeyText2 = "VideoHosting_0052"; - string strKeyButton2 = "VideoHosting_0048"; - dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.BlueBtn_CancelBtn, strKeyTitle2, strKeyText2, strKeyButton2, ""); - DialogBase dialogBase3 = dialogBase; - dialogBase3.onPushButton1 = (Action)Delegate.Combine(dialogBase3.onPushButton1, (Action)delegate - { - AutoStopRecording(isSave: false); - }); - } - if (!(null == dialogBase) && cbPushOK != null) - { - DialogBase dialogBase4 = dialogBase; - dialogBase4.onPushButton1 = (Action)Delegate.Combine(dialogBase4.onPushButton1, cbPushOK); - } - } - - public static void CreateDialogPrivacyBuyCrystalExit() - { - DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", "VideoHosting_0055", "Common_0004", ""); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, new Action(AutoResumePublishing)); - } - - public static void CreateDialogPrivacyAutoStopRecordingTitle(Action cbPushOK) - { - DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", "VideoHosting_0066", "Common_0004", ""); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, cbPushOK); - } - - public static void CreateDialogPrivacyAutoPausePublishingTitle(Action cbPushOK) - { - DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", "VideoHosting_0065", "Common_0004", ""); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, cbPushOK); - } } diff --git a/SVSim.BattleEngine/Engine/Voice.cs b/SVSim.BattleEngine/Engine/Voice.cs deleted file mode 100644 index e79c88a7..00000000 --- a/SVSim.BattleEngine/Engine/Voice.cs +++ /dev/null @@ -1,182 +0,0 @@ -using System.Collections.Generic; -using CriWare; -using Cute; -using Wizard; - -public class Voice -{ - private CriAtomSource m_VoiceAudioSourceA; - - private CriAtomSource m_VoiceAudioSourceB; - - private const string CATEGORY_NAME = "VO"; - - private float m_volume; - - private bool m_isMuted; - - private int _currentVoiceSourceIndex; - - private int _voiceSourceCount; - - private const int VoiceA = 0; - - private const int VoiceB = 1; - - public Voice() - { - m_VoiceAudioSourceA = GameMgr.GetIns().GetGameObjMgr().GetGameObj() - .AddComponent(); - m_VoiceAudioSourceA.loop = false; - m_VoiceAudioSourceA.playOnStart = false; - m_VoiceAudioSourceA.use3dPositioning = false; - m_VoiceAudioSourceA.player.AttachFader(); - m_VoiceAudioSourceA.player.SetFadeOutTime(50); - m_VoiceAudioSourceB = GameMgr.GetIns().GetGameObjMgr().GetGameObj() - .AddComponent(); - m_VoiceAudioSourceB.loop = false; - m_VoiceAudioSourceB.playOnStart = false; - m_VoiceAudioSourceB.use3dPositioning = false; - m_VoiceAudioSourceB.player.AttachFader(); - m_VoiceAudioSourceB.player.SetFadeOutTime(50); - SetVolume(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VOICE_VOLUME)); - Mute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - _voiceSourceCount = Toolbox.AudioManager.GetVoiceSourceCount(); - } - - public void SetVolume(float Prm) - { - CriAtomExCategory.SetVolume("VO", Prm); - m_volume = Prm; - } - - public float GetVolume() - { - return m_volume; - } - - public void Mute(bool isMute) - { - CriAtomExCategory.Mute("VO", isMute); - m_isMuted = isMute; - } - - public bool IsMuted() - { - return m_isMuted; - } - - public void Play(ClassCharaPrm.EmotionType emotiontype, int classid, List pathList, string voiceId = "", bool isEvolved = false) - { - string cueName = ""; - string cueSheet = ""; - cueName = GetEmotionCueName(emotiontype, classid, isEvolved); - cueSheet = GetEmotionCueSheet(emotiontype, classid); - if (voiceId != string.Empty) - { - cueName = "vo_" + voiceId; - cueSheet = "v/" + cueName + ".acb"; - } - if (string.IsNullOrEmpty(cueName)) - { - return; - } - if (Toolbox.AudioManager.IsAvailableCueSheet(cueSheet) || pathList == null) - { - Toolbox.AudioManager.PlayVoice(0, cueName, cueSheet, cueName); - return; - } - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(cueSheet, delegate - { - pathList.Add(cueSheet); - Toolbox.AudioManager.PlayVoice(0, cueName, cueSheet, cueName); - })); - } - - public static string GetEmotionCueName(ClassCharaPrm.EmotionType emotiontype, int skinId, bool isEvolved = false) - { - return "vo_" + GameMgr.GetIns().GetDataMgr().GetEmotionDataBySkinId(skinId.ToString())[emotiontype].GetVoiceId(isEvolved); - } - - public static string GetEmotionCueSheet(ClassCharaPrm.EmotionType emotiontype, int skinId) - { - return "v/" + GetEmotionCueName(emotiontype, skinId) + ".acb"; - } - - public void PlayScenario(string cuename, float fadeout) - { - AudioManager audioManager = Toolbox.AudioManager; - audioManager.StopVoice(_currentVoiceSourceIndex, fadeout); - _currentVoiceSourceIndex = (_currentVoiceSourceIndex + 1) % _voiceSourceCount; - audioManager.PlayVoice(_currentVoiceSourceIndex, cuename); - } - - public void StopScenario(float fadeout) - { - Toolbox.AudioManager.StopVoice(_currentVoiceSourceIndex, fadeout); - } - - public void PlayByKey(string quenameid, bool forcePlay = false) - { - if (!forcePlay) - { - if (Toolbox.AudioManager.IsPlayVoice(0)) - { - string text = "vo_" + quenameid; - if (UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Battle) - { - Toolbox.AudioManager.StopVoice(0); - } - Toolbox.AudioManager.PlayVoice(1, text, m_VoiceAudioSourceB.cueSheet, text); - } - else - { - string text2 = "vo_" + quenameid; - if (UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Battle) - { - Toolbox.AudioManager.StopVoice(1); - } - Toolbox.AudioManager.PlayVoice(0, text2, m_VoiceAudioSourceA.cueSheet, text2); - } - } - else - { - Toolbox.AudioManager.StopVoice(0); - Toolbox.AudioManager.StopVoice(1); - string text3 = "vo_" + quenameid; - Toolbox.AudioManager.PlayVoice(0, text3, m_VoiceAudioSourceA.cueSheet, text3); - } - } - - public void StopVoice(float fadeout) - { - if (m_VoiceAudioSourceA.status == CriAtomSource.Status.Playing) - { - Toolbox.AudioManager.StopVoice(0, fadeout); - } - else - { - Toolbox.AudioManager.StopVoice(1, fadeout); - } - } - - public void StopAll(float fadeout) - { - for (int i = 0; i < _voiceSourceCount; i++) - { - Toolbox.AudioManager.StopVoice(i, fadeout); - } - } - - public bool IsPlaying() - { - for (int i = 0; i < _voiceSourceCount; i++) - { - if (Toolbox.AudioManager.IsPlayVoice(i)) - { - return true; - } - } - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/VoiceDictionaries.cs b/SVSim.BattleEngine/Engine/VoiceDictionaries.cs index 46580bda..f052779c 100644 --- a/SVSim.BattleEngine/Engine/VoiceDictionaries.cs +++ b/SVSim.BattleEngine/Engine/VoiceDictionaries.cs @@ -23,8 +23,6 @@ public class VoiceDictionaries public List attachSkillVoices; - private const string UNDER_BAR = "_"; - public string VoiceId { get; private set; } public VoiceDictionaries(int cardId, CardMaster.CardMasterId cardMasterId) diff --git a/SVSim.BattleEngine/Engine/VoiceDictionary.cs b/SVSim.BattleEngine/Engine/VoiceDictionary.cs index 9254d862..269e3ce3 100644 --- a/SVSim.BattleEngine/Engine/VoiceDictionary.cs +++ b/SVSim.BattleEngine/Engine/VoiceDictionary.cs @@ -4,79 +4,6 @@ using System.Linq; public class VoiceDictionary { - private const string DESTROY_COMVO_VOICE_CHECK = "_4_"; - - private const string ENEMY_COMVO_VOICE_CHECK = "_7_"; - - private const string ALLY_COMVO_VOICE_CHECK = "_8_"; - - private const string ENHANCE_VOICE_CHECK = "_enh"; - - private const string UNION_BURST_VOICE_CHECK = "_ub"; - - private const string UNION_BURST_VOICE_CHECK_PLAY = "_ubp"; - - private const string UNION_BURST_VOICE_CHECK_30 = "_ubs"; - - private const string UNION_BURST_VOICE_CHECK_60 = "_ubl"; - - private const string UNION_BURST_VOICE_CHECK_SHORT_30 = "_ubks"; - - private const string UNION_BURST_VOICE_CHECK_SHORT_60 = "_ubkl"; - - private const string UNION_BURST_VOICE_CHECK_DIRECTLY_30 = "_ubds"; - - private const string UNION_BURST_VOICE_CHECK_DIRECTLY_60 = "_ubdl"; - - private const string UNION_BURST_VOICE_CHECK_DIRECTLY_SHORT_30 = "_ubdks"; - - private const string UNION_BURST_VOICE_CHECK_DIRECTLY_SHORT_60 = "_ubdkl"; - - private const string SKYBOUND_ART_VOICE_CHECK = "_sb"; - - private const string SKYBOUND_ART_VOICE_CHECK_PLAY = "_sbp"; - - private const string SKYBOUND_ART_VOICE_CHECK_30 = "_sbs"; - - private const string SKYBOUND_ART_VOICE_CHECK_60 = "_sbl"; - - private const string SKYBOUND_ART_VOICE_CHECK_SHORT_30 = "_sbks"; - - private const string SKYBOUND_ART_VOICE_CHECK_SHORT_60 = "_sbkl"; - - private const string SKYBOUND_ART_VOICE_CHECK_DIRECTLY_30 = "_sbds"; - - private const string SKYBOUND_ART_VOICE_CHECK_DIRECTLY_60 = "_sbdl"; - - private const string SKYBOUND_ART_VOICE_CHECK_DIRECTLY_SHORT_30 = "_sbdks"; - - private const string SKYBOUND_ART_VOICE_CHECK_DIRECTLY_SHORT_60 = "_sbdkl"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK = "_ssb"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_PLAY = "_ssbp"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_30 = "_ssbs"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_60 = "_ssbl"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_SHORT_30 = "_ssbks"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_SHORT_60 = "_ssbkl"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_DIRECTLY_30 = "_ssbds"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_DIRECTLY_60 = "_ssbdl"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_DIRECTLY_SHORT_30 = "_ssbdks"; - - private const string SUPER_SKYBOUND_ART_VOICE_CHECK_DIRECTLY_SHORT_60 = "_ssbdkl"; - - private const string EARTH_RITE_VOICE_CHECK = "_ear"; - - private const string SUMMON_TOKEN_VOICE = "_11"; - - public const int CONVE_ID_INDEX = 2; private VoiceAndWaitTime[] _parsedVoice; @@ -100,58 +27,6 @@ public class VoiceDictionary public List AllyComvoList { get; private set; } - public bool HasFixedUseCost - { - get - { - if (_fixedUseCostVoice != null) - { - return _fixedUseCostVoice.Count > 0; - } - return false; - } - } - - public bool HasUnionBurstVoice - { - get - { - if (_unionBurstVoice != null) - { - return _unionBurstVoice.Count > 0; - } - return false; - } - } - - public bool HasSkyboundArtVoice - { - get - { - if (_skyboundArtVoice != null) - { - return _skyboundArtVoice.Count > 0; - } - return false; - } - } - - public bool HasSuperSkyboundArtVoice - { - get - { - if (_superSkyboundArtVoice != null) - { - return _superSkyboundArtVoice.Count > 0; - } - return false; - } - } - - public bool HasEarthRite => _earthRiteVoice != null; - - public bool HasSummonTokenVoice => _summonTokenVoice != null; - public VoiceDictionary(string voice) { EnemyComvoList = new List(); @@ -303,15 +178,6 @@ public class VoiceDictionary return _allVoiceID; } - public VoiceAndWaitTime GetNormalVoice() - { - if (_normalVoice == null) - { - return VoiceAndWaitTime._nullVoice; - } - return _normalVoice; - } - private bool IsNormalVoice(string voiceName) { if (!IsConvVoice(voiceName) && !IsFixedUseCostVoice(voiceName) && !IsUnionBurstVoice(voiceName) && !IsSkyboundArtVoice(voiceName) && !IsSuperSkyboundArtVoice(voiceName) && !IsEarthRiteVoice(voiceName)) @@ -321,38 +187,6 @@ public class VoiceDictionary return false; } - public VoiceAndWaitTime GetAllyConvVoice(int cardId) - { - string cardIDStr = cardId.ToString(); - int i = 0; - while (i < AllyComvoList.Count) - { - if (IsConvMatch(AllyComvoList[i].ToString(), cardIDStr)) - { - return _parsedVoice.FirstOrDefault((VoiceAndWaitTime c) => c.Voice.Contains(AllyComvoList[i].ToString()) && c.Voice.Contains("_8_")); - } - int num = i + 1; - i = num; - } - return VoiceAndWaitTime._nullVoice; - } - - public VoiceAndWaitTime GetEnemyConvVoice(int cardId) - { - string cardIDStr = cardId.ToString(); - int i = 0; - while (i < EnemyComvoList.Count) - { - if (IsConvMatch(EnemyComvoList[i].ToString(), cardIDStr)) - { - return _parsedVoice.FirstOrDefault((VoiceAndWaitTime c) => c.Voice.Contains(EnemyComvoList[i].ToString()) && c.Voice.Contains("_7_")); - } - int num = i + 1; - i = num; - } - return VoiceAndWaitTime._nullVoice; - } - private bool IsConvVoice(string voiceName) { if (voiceName.Contains("_4_")) @@ -373,160 +207,11 @@ public class VoiceDictionary return true; } - private bool IsConvMatch(string voiceName, string cardIDStr) - { - return voiceName.Contains(cardIDStr); - } - - public VoiceAndWaitTime GetEnhanceVoice(int index) - { - if (_fixedUseCostVoice.Count <= 0) - { - return VoiceAndWaitTime._nullVoice; - } - return _fixedUseCostVoice[index]; - } - private bool IsFixedUseCostVoice(string voiceName) { return voiceName.Contains("_enh"); } - public VoiceAndWaitTime GetUnionBurstVoice(int skillVoiceIndex) - { - int count = _unionBurstVoice.Count; - if (count <= 0) - { - return VoiceAndWaitTime._nullVoice; - } - if (count == 1) - { - return _unionBurstVoice[0]; - } - if (skillVoiceIndex == 9) - { - foreach (VoiceAndWaitTime item in _unionBurstVoice) - { - if (item.Voice.Contains("_ubp")) - { - return item; - } - } - return VoiceAndWaitTime._nullVoice; - } - string text = ""; - text = skillVoiceIndex switch - { - 1 => "_ubs", - 3 => "_ubl", - 2 => "_ubks", - 4 => "_ubkl", - 5 => "_ubds", - 7 => "_ubdl", - 6 => "_ubdks", - 8 => "_ubdkl", - _ => "_ubs", - }; - foreach (VoiceAndWaitTime item2 in _unionBurstVoice) - { - if (item2.Voice.Contains(text)) - { - return new VoiceAndWaitTime(item2.Voice.Replace(text, "_ub"), item2.WaitTime); - } - } - return VoiceAndWaitTime._nullVoice; - } - - public VoiceAndWaitTime GetSkyboundArtVoice(int skillVoiceIndex) - { - int count = _skyboundArtVoice.Count; - if (count <= 0) - { - return VoiceAndWaitTime._nullVoice; - } - if (count == 1) - { - return _skyboundArtVoice[0]; - } - if (skillVoiceIndex == 19) - { - foreach (VoiceAndWaitTime item in _skyboundArtVoice) - { - if (item.Voice.Contains("_sbp")) - { - return item; - } - } - return VoiceAndWaitTime._nullVoice; - } - string text = ""; - text = skillVoiceIndex switch - { - 11 => "_sbs", - 13 => "_sbl", - 12 => "_sbks", - 14 => "_sbkl", - 15 => "_sbds", - 17 => "_sbdl", - 16 => "_sbdks", - 18 => "_sbdkl", - _ => "_sbs", - }; - foreach (VoiceAndWaitTime item2 in _skyboundArtVoice) - { - if (item2.Voice.Contains(text)) - { - return new VoiceAndWaitTime(item2.Voice.Replace(text, "_sb"), item2.WaitTime); - } - } - return VoiceAndWaitTime._nullVoice; - } - - public VoiceAndWaitTime GetSuperSkyboundArtVoice(int skillVoiceIndex) - { - int count = _superSkyboundArtVoice.Count; - if (count <= 0) - { - return VoiceAndWaitTime._nullVoice; - } - if (count == 1) - { - return _superSkyboundArtVoice[0]; - } - if (skillVoiceIndex == 29) - { - foreach (VoiceAndWaitTime item in _superSkyboundArtVoice) - { - if (item.Voice.Contains("_ssbp")) - { - return item; - } - } - return VoiceAndWaitTime._nullVoice; - } - string text = ""; - text = skillVoiceIndex switch - { - 21 => "_ssbs", - 23 => "_ssbl", - 22 => "_ssbks", - 24 => "_ssbkl", - 25 => "_ssbds", - 27 => "_ssbdl", - 26 => "_ssbdks", - 28 => "_ssbdkl", - _ => "_ssbs", - }; - foreach (VoiceAndWaitTime item2 in _superSkyboundArtVoice) - { - if (item2.Voice.Contains(text)) - { - return new VoiceAndWaitTime(item2.Voice.Replace(text, "_ssb"), item2.WaitTime); - } - } - return VoiceAndWaitTime._nullVoice; - } - private bool IsUnionBurstVoice(string voiceName) { return voiceName.Contains("_ub"); @@ -542,29 +227,11 @@ public class VoiceDictionary return voiceName.Contains("_ssb"); } - public VoiceAndWaitTime GetEarthRiteVoice() - { - if (_earthRiteVoice == null) - { - return VoiceAndWaitTime._nullVoice; - } - return _earthRiteVoice; - } - private bool IsEarthRiteVoice(string voiceName) { return voiceName.Contains("_ear"); } - public VoiceAndWaitTime GetSummonTokenVoice() - { - if (_summonTokenVoice == null) - { - return VoiceAndWaitTime._nullVoice; - } - return _summonTokenVoice; - } - private bool IsSummonTokenVoice(string voiceName) { return voiceName.EndsWith("_11"); diff --git a/SVSim.BattleEngine/Engine/VolcanoField.cs b/SVSim.BattleEngine/Engine/VolcanoField.cs index 868d3673..33b36228 100644 --- a/SVSim.BattleEngine/Engine/VolcanoField.cs +++ b/SVSim.BattleEngine/Engine/VolcanoField.cs @@ -1,8 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View.Vfx; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class VolcanoField : BackGroundBase { public override int FieldId => 3; @@ -11,134 +11,4 @@ public class VolcanoField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_vlca_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles03").gameObject; - _fieldObjDictionary.Add(_fieldParticles.name, _fieldParticles); - _fieldObjDictionary.Add("obj1", _fieldModel.transform.Find("md_bf_vlca_01_obj1").gameObject); - _fieldParticleSystemDictionary.Add("pillar1", _fieldParticles.transform.Find("pillar1").GetComponent()); - _fieldParticleSystemDictionary.Add("pillar2", _fieldParticles.transform.Find("pillar2").GetComponent()); - _fieldParticleSystemDictionary.Add("pillar3", _fieldParticles.transform.Find("pillar3").GetComponent()); - _fieldParticleSystemDictionary.Add("obj1_fog", _fieldParticles.transform.Find("obj1_fog").GetComponent()); - _fieldParticleSystemDictionary.Add("obj1_stay", _fieldParticles.transform.Find("obj1_stay").GetComponent()); - _fieldParticleSystemDictionary.Add("obj1_shake", _fieldParticles.transform.Find("obj1_shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_3, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_3_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_3_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldObjDictionary["obj1"].transform.localPosition = new Vector3(1.308078f, 1.5f, -0.4518712f); - _battleCamera.Camera.transform.localPosition = new Vector3(840f, -30f, -100f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-50f, -30f, 37f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(840f, -30f, -100f), new Vector3(720f, 450f, -100f), new Vector3(20f, 240f, -80f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-20f, -75f, 85f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[1], "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["pillar2"].Play(); - yield return new WaitForSeconds(0.5f); - _fieldParticleSystemDictionary["pillar3"].Play(); - yield return new WaitForSeconds(0.5f); - _fieldParticleSystemDictionary["pillar1"].Play(); - yield return new WaitForSeconds(1f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(4f); - _fieldParticleSystemDictionary["obj1_stay"].Play(); - _fieldParticleSystemDictionary["obj1_fog"].Play(); - iTween.MoveTo(_fieldObjDictionary["obj1"], iTween.Hash("position", new Vector3(1.308078f, 0.5299267f, -0.4518712f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1") - { - switch (_gimicCntDictionary[obj.tag]) - { - case 0: - case 1: - case 2: - case 3: - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["obj1_shake"].Play(); - iTween.Stop(_fieldObjDictionary["obj1"]); - iTween.ShakePosition(_fieldObjDictionary["obj1"], iTween.Hash("amount", new Vector3(0.005f, 0f, 0.005f) * _gimicCntDictionary[obj.tag], "time", 0.5f)); - iTween.MoveTo(_fieldObjDictionary["obj1"], iTween.Hash("position", new Vector3(1.308078f, 0.5299267f, -0.4518712f), "time", 0.1f, "delay", 0.5f, "islocal", true)); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[0], "se_field_" + _str3DFieldNo, 0f, 0L); - break; - case 4: - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["obj1_shake"].Play(); - _fieldParticleSystemDictionary["obj1_stay"].Stop(); - iTween.ShakePosition(_fieldObjDictionary["obj1"], iTween.Hash("amount", new Vector3(0.005f, 0f, 0.005f) * _gimicCntDictionary[obj.tag], "time", 0.5f)); - iTween.MoveTo(_fieldObjDictionary["obj1"], iTween.Hash("position", new Vector3(1.308078f, -1f, -0.4518712f), "time", 0.5f, "delay", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(GimicAudioList[0], "se_field_" + _str3DFieldNo, 0f, 0L); - yield return new WaitForSeconds(1f); - _fieldParticleSystemDictionary["pillar1"].Play(); - m_BtlMgrIns.VfxMgr.RegisterImmediateVfx(_battleCamera.ShakeCamera(Vector3.one * 0.1f, 0.5f, 0f)); - m_BtlMgrIns.VfxMgr.RegisterImmediateVfx(SequentialVfxPlayer.Create(WaitVfx.Create(0.5f), _battleCamera.ShakeComplete())); - yield return new WaitForSeconds(5f); - _fieldParticleSystemDictionary["obj1_fog"].Play(); - _fieldObjDictionary["obj1"].transform.localPosition = new Vector3(1.308078f, 1.5f, -0.4518712f); - iTween.MoveTo(_fieldObjDictionary["obj1"], iTween.Hash("position", new Vector3(1.308078f, 0.5299267f, -0.4518712f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - yield return new WaitForSeconds(2f); - _gimicCntDictionary[obj.tag] = 0; - _fieldParticleSystemDictionary["obj1_stay"].Play(); - break; - } - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - if (_gimicCntDictionary["FieldGimic1"] < 4) - { - _fieldParticleSystemDictionary["obj1_shake"].Play(); - iTween.ShakePosition(_fieldObjDictionary["obj1"], iTween.Hash("amount", new Vector3(0.01f, 0f, 0.01f), "time", 0.8f)); - iTween.MoveTo(_fieldObjDictionary["obj1"], iTween.Hash("position", new Vector3(1.308078f, 0.5299267f, -0.4518712f), "time", 0.1f, "delay", 0.8f, "islocal", true)); - } - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/WatchInPlayAction.cs b/SVSim.BattleEngine/Engine/WatchInPlayAction.cs deleted file mode 100644 index 24db3e47..00000000 --- a/SVSim.BattleEngine/Engine/WatchInPlayAction.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Cute; -using Wizard.Battle.Touch; -using Wizard.Battle.View.Vfx; - -public class WatchInPlayAction : InPlayCardReflection -{ - private const float DELAY_BEFORE_START_SKILL_TARGET_SELECT = 0.5f; - - private const float WAIT_TIME_BETWEEN_SELECT_AND_EVOLUTION = 0.25f; - - private const float WAIT_TIME_BETWEEN_CHOICE_AND_EVOLUTION = 0.5f; - - public WatchInPlayAction(BattleManagerBase battleMgr, OperateMgr operateMgr) - : base(battleMgr, operateMgr) - { - } - - protected override VfxBase CreateEvolveVfx(BattleCardBase evolvedCard, List targetCards, bool isPlayer, List choiceId, bool isChoice) - { - if (((targetCards != null && targetCards.Any()) || (choiceId != null && choiceId.Any())) && (isPlayer || GameMgr.GetIns().IsAdmin)) - { - return NullVfx.GetInstance(); - } - return base.CreateEvolveVfx(evolvedCard, targetCards, isPlayer, choiceId, isChoice); - } - - public override void StartSelect(int actingCardIndex, bool isPlayer = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_battleMgr, _battleMgr.GetBattlePlayer(isPlayer), actingCardIndex); - sequentialVfxPlayer.Register(CreateStartSelectVfx(indexToCardBase, isEvolve: true)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - public override void StartChoiceSelect(int actingCardIndex, bool isPlayer = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_battleMgr, _battleMgr.GetBattlePlayer(isPlayer), actingCardIndex); - SkillBase choiceSkill = GetSelectSkills(indexToCardBase, isEvolve: true).FirstOrDefault(); - sequentialVfxPlayer.Register(new StartEvolutionTargetFocusVfx(indexToCardBase.BattleCardView.GameObject)); - sequentialVfxPlayer.Register(CreateStartChoiceSelectVfx(indexToCardBase, choiceSkill, isEvolve: true, null)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - public override void StartSelectFusion(int actingCardIndex, bool isPlayer = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_battleMgr, _battleMgr.GetBattlePlayer(isPlayer), actingCardIndex); - sequentialVfxPlayer.Register(new StartEvolutionTargetFocusVfx(indexToCardBase.BattleCardView.GameObject)); - sequentialVfxPlayer.Register(CreateStartFusionSelectVfx(indexToCardBase)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - public override void CancelSelect(bool isPlayer = true) - { - if (_actingCard != null) - { - base.CancelSelect(isPlayer); - _battleMgr.VfxMgr.RegisterImmediateVfx(CreateStopEvolutionTargetFocusVfx(_actingCard)); - } - } - - public override void CancelChoiceSelect(bool isPlayer = true) - { - if (_actingChoiceCard != null) - { - ChoiceUtility.StopChoiceEffects(_choiceCards); - ChoiceUtility.PlayCancelEvolveChoiceAnimation(_choiceCards, _battleMgr); - base.CancelChoiceSelect(isPlayer); - _battleMgr.VfxMgr.RegisterImmediateVfx(CreateStopEvolutionTargetFocusVfx(_actingChoiceCard)); - } - } - - protected override VfxBase CreateAfterSelectVfx(BattleCardBase actingCard, List selectedChoiceCardIds, bool isPlayer = true, bool isChoiceBrave = false) - { - float waitTime = (selectedChoiceCardIds.IsNotNullOrEmpty() ? 0.5f : 0.25f); - return SequentialVfxPlayer.Create(WaitVfx.Create(waitTime), ParallelVfxPlayer.Create(_operateMgr.EvolutionCard(actingCard, isPlayer, _selectedCards, selectedChoiceCardIds), CreateStopEvolutionTargetFocusVfx(actingCard))); - } - - private VfxBase CreateStopEvolutionTargetFocusVfx(BattleCardBase actingCard) - { - return new StopEvolutionTargetFocasVfx(actingCard.BattleCardView.GameObject); - } -} diff --git a/SVSim.BattleEngine/Engine/WatchOperateReceive.cs b/SVSim.BattleEngine/Engine/WatchOperateReceive.cs deleted file mode 100644 index ec85481b..00000000 --- a/SVSim.BattleEngine/Engine/WatchOperateReceive.cs +++ /dev/null @@ -1,17 +0,0 @@ -public class WatchOperateReceive : OperateReceive -{ - public WatchOperateReceive(NetworkBattleManagerBase networkBattleMgr, RegisterActionManager registerCardList, OperateMgr operateMgr, NetworkBattleData networkBattleData) - : base(networkBattleMgr, registerCardList, operateMgr, networkBattleData) - { - } - - protected override PlayHandCardReflection CreateNetworkPlayCardAction() - { - return new WatchPlayCardAction(_battleMgr, _operateMgr, _networkBattleData); - } - - protected override InPlayCardReflection CreateNetworkInPlayAction() - { - return new WatchInPlayAction(_battleMgr, _operateMgr); - } -} diff --git a/SVSim.BattleEngine/Engine/WatchOperationCollection.cs b/SVSim.BattleEngine/Engine/WatchOperationCollection.cs index e2e90cd5..44c7a9f2 100644 --- a/SVSim.BattleEngine/Engine/WatchOperationCollection.cs +++ b/SVSim.BattleEngine/Engine/WatchOperationCollection.cs @@ -10,8 +10,6 @@ public class WatchOperationCollection : NetworkOperationCollectionBase private int _lastIndex; - private const float TOUCH_ASYNC_WAIT_TIME = 0.3f; - public WatchOperationCollection(NetworkWatchBattleMgr watchBattleMgr, OperateMgr operateMgr, NetworkBattleReceiver.ReceiveData receivedData, NetworkBattleData networkBattleData, bool isPlayer) : base(watchBattleMgr, operateMgr, receivedData, networkBattleData, isPlayer) { @@ -141,7 +139,7 @@ public class WatchOperationCollection : NetworkOperationCollectionBase switch (_receivedData.actionType) { case NetworkBattleDefine.PlayActionType.PLAY_HAND: - if (_receivedData.IsChoiceBrave && (BattleManagerBase.GetIns().IsRecovery || (!_receivedData.isSelf && !GameMgr.GetIns().IsAdminWatch))) + if (_receivedData.IsChoiceBrave && (_watchBattleMgr.IsRecovery || (!_receivedData.isSelf && !_watchBattleMgr.GameMgr.IsAdminWatch))) { ChoiceBraveOperation(networkPlayCardAction, _receivedData.choiceIdList); } @@ -152,7 +150,7 @@ public class WatchOperationCollection : NetworkOperationCollectionBase CallCompleteEvent(networkPlayCardAction); break; case NetworkBattleDefine.PlayActionType.PLAY_HAND_SELECT: - if (_receivedData.IsChoiceBrave && (BattleManagerBase.GetIns().IsRecovery || (!_receivedData.isSelf && !GameMgr.GetIns().IsAdminWatch))) + if (_receivedData.IsChoiceBrave && (_watchBattleMgr.IsRecovery || (!_receivedData.isSelf && !_watchBattleMgr.GameMgr.IsAdminWatch))) { ChoiceBraveOperation(networkPlayCardAction, _receivedData.choiceIdList); } @@ -460,9 +458,9 @@ public class WatchOperationCollection : NetworkOperationCollectionBase public override void MaintenanceOperation() { - ToolboxGame.RealTimeNetworkAgent.StopNetworkBattle(); - ToolboxGame.RealTimeNetworkAgent.CallMaintenanceError(); - ToolboxGame.RealTimeNetworkAgent.DestroyObj(RealTimeNetworkAgent.DESTROY_OBJECT_LOG.WatchMaintenance); + _networkBattleMgr.InstanceNetworkAgent.StopNetworkBattle(); + _networkBattleMgr.InstanceNetworkAgent.CallMaintenanceError(); + _networkBattleMgr.InstanceNetworkAgent.DestroyObj(RealTimeNetworkAgent.DESTROY_OBJECT_LOG.WatchMaintenance); } public override void JudgeResultOperation() diff --git a/SVSim.BattleEngine/Engine/WatchPlayCardAction.cs b/SVSim.BattleEngine/Engine/WatchPlayCardAction.cs deleted file mode 100644 index 9e0d2683..00000000 --- a/SVSim.BattleEngine/Engine/WatchPlayCardAction.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Wizard.Battle.View.Vfx; - -public class WatchPlayCardAction : PlayHandCardReflection -{ - public WatchPlayCardAction(BattleManagerBase battleMgr, OperateMgr operateMgr, NetworkBattleData networkBattleData) - : base(battleMgr, operateMgr, networkBattleData) - { - } - - protected override void PlayMove(BattleCardBase playedCard, bool isPlayer = false, List choiceId = null, bool isChoice = false) - { - if (isChoice && choiceId != null && (isPlayer || GameMgr.GetIns().IsAdmin)) - { - return; - } - if (!GameMgr.GetIns().IsAdminWatch && !isPlayer) - { - base.PlayMove(playedCard, isPlayer, choiceId, isChoice); - return; - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (_networkBattleData.GetReceiveData().mutationAfterCardId != 0) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - playedCard.BattleCardView.HideHandCardInfo(); - playedCard.BattleCardView.HideCanPlayEffect(); - })); - } - sequentialVfxPlayer.Register(_operateMgr.InitSetCard(playedCard, isPlayer)); - sequentialVfxPlayer.Register(_operateMgr.PlayCard(playedCard, isPlayer, null, isRecovery: false, choiceId)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - protected override void PlayActionMove(BattleCardBase receivedCard, List targetCards, bool isPlayer = false, List choiceId = null) - { - if (!isPlayer && !GameMgr.GetIns().IsAdmin) - { - base.PlayActionMove(receivedCard, targetCards, isPlayer, choiceId); - } - } - - protected override void SendEcho(BattleCardBase receivedCard, NetworkBattleDefine.PlayActionType actionType) - { - } - - public override void StartSelect(int actingCardIndex, bool isPlayer = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase playedCard = NetworkBattleGenericTool.GetIndexToCardBase(_battleMgr, _battleMgr.GetBattlePlayer(isPlayer), actingCardIndex); - Skill_transform accelerateOrCrystallizeTransformSkill = playedCard.GetAccelerateOrCrystallizeTransformSkill(); - bool isAccelerateSelect = accelerateOrCrystallizeTransformSkill != null; - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - playedCard.BattleCardView.HideHandCardInfo(); - if (!isPlayer && GameMgr.GetIns().IsAdminWatch) - { - _battleMgr.BattleEnemy.UpdateHandCardsPlayability(areArrowsForcedOff: true); - } - })); - sequentialVfxPlayer.Register(_operateMgr.InitSetCard(playedCard, isPlayer, isSelect: true, isRecovery: false, isChoiceSelect: false, isAccelerateSelect)); - sequentialVfxPlayer.Register(CreateStartSelectVfx(playedCard, isEvolve: false, isChoice: false, accelerateOrCrystallizeTransformSkill)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - public override void StartChoiceSelect(int actingCardIndex, bool isPlayer = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase indexToCardBase = NetworkBattleGenericTool.GetIndexToCardBase(_battleMgr, _battleMgr.GetBattlePlayer(isPlayer), actingCardIndex); - Skill_transform accelerateOrCrystallizeTransformSkill = indexToCardBase.GetAccelerateOrCrystallizeTransformSkill(); - BattleCardBase battleCardBase = null; - if (accelerateOrCrystallizeTransformSkill != null) - { - int tokenId = accelerateOrCrystallizeTransformSkill.TransformId + (accelerateOrCrystallizeTransformSkill.SkillPrm.ownerCard.BaseParameter.IsFoil ? 1 : 0); - battleCardBase = _battleMgr.CreateTransformCardRegisterVfx(indexToCardBase, tokenId, isPlayer); - } - SkillBase choiceSkill = GetSelectSkills((battleCardBase != null) ? battleCardBase : indexToCardBase, isEvolve: false).FirstOrDefault(); - sequentialVfxPlayer.Register(CreateStartChoiceSelectVfx(indexToCardBase, choiceSkill, isEvolve: false, battleCardBase)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - public override void StartSelectFusion(int actingCardIndex, bool isPlayer = true) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - BattleCardBase playedCard = NetworkBattleGenericTool.GetIndexToCardBase(_battleMgr, _battleMgr.GetBattlePlayer(isPlayer), actingCardIndex); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - playedCard.BattleCardView.HideHandCardInfo(); - if (!isPlayer && GameMgr.GetIns().IsAdminWatch) - { - _battleMgr.BattleEnemy.UpdateHandCardsPlayability(areArrowsForcedOff: true); - } - })); - sequentialVfxPlayer.Register((_battleMgr as NetworkWatchBattleMgr).CreateVfxResetPositionByCardBase(playedCard, null)); - sequentialVfxPlayer.Register(CreateStartFusionSelectVfx(playedCard)); - _battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - protected override VfxBase CreateAfterSelectVfx(BattleCardBase actingCard, List selectedChoiceCardIds, bool isPlayer, bool isChoiceBrave) - { - return _operateMgr.PlayCard(actingCard, isPlayer, _selectedCards, isRecovery: false, selectedChoiceCardIds, isChoiceBrave); - } -} diff --git a/SVSim.BattleEngine/Engine/WatchTouchControl.cs b/SVSim.BattleEngine/Engine/WatchTouchControl.cs deleted file mode 100644 index 65eb8cd1..00000000 --- a/SVSim.BattleEngine/Engine/WatchTouchControl.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System.Linq; -using UnityEngine; -using Wizard.Battle.Touch; -using Wizard.Battle.View.Vfx; - -public class WatchTouchControl : NetworkTouchControl -{ - private const float IDLE_TIME = 20f; - - private const int IDLE_EMOTE_KIND = 3; - - private Coroutine idleTimeCoroutine; - - private ClassCharaPrm.EmotionType _previousEmotionType; - - public new bool notAttackFlag { private get; set; } - - public new bool notEmoteFlag { private get; set; } - - public new bool notDragPlayCardFlag { private get; set; } - - public new bool notEvolCardFlag { private get; set; } - - public WatchTouchControl(BattleManagerBase battleMgr, BattleCamera battleCamera, BackGroundBase backGround) - : base(battleMgr, battleCamera, backGround) - { - notAttackFlag = true; - notEmoteFlag = true; - notDragPlayCardFlag = true; - notEvolCardFlag = true; - } - - protected override bool IsFeasibleAttack() - { - if (notAttackFlag) - { - return false; - } - return base.IsFeasibleAttack(); - } - - protected override bool IsFeasibleEmote() - { - if (notEmoteFlag) - { - return false; - } - return base.IsFeasibleEmote(); - } - - protected override bool IsFeasiblePlayCard() - { - if (notDragPlayCardFlag) - { - return false; - } - return base.IsFeasiblePlayCard(); - } - - protected override bool IsFeasibleEvol() - { - if (notEvolCardFlag) - { - return false; - } - return base.IsFeasibleEvol(); - } - - protected override void StopDraggingArrow() - { - } - - protected override BattleCardBase GetHitCardFromRayCastHit(RaycastHit hit) - { - GameObject cardRootGameObject = hit.collider.gameObject.transform.parent.gameObject; - BattleCardBase battleCardBase = base.BattlePlayer.FindCardFromGameObject(cardRootGameObject); - if (battleCardBase != null) - { - return battleCardBase; - } - battleCardBase = base.BattlePlayer.BattleView.GetSelectCardList().FirstOrDefault((BattleCardBase s) => s.BattleCardView.GameObject == cardRootGameObject); - if (battleCardBase != null) - { - return battleCardBase; - } - BattleCardBase battleCardBase2 = base.BattleEnemy.FindCardFromGameObject(cardRootGameObject); - if (battleCardBase2 != null) - { - return battleCardBase2; - } - battleCardBase2 = base.BattleEnemy.BattleView.GetSelectCardList().FirstOrDefault((BattleCardBase s) => s.BattleCardView.GameObject == cardRootGameObject); - if (battleCardBase2 != null) - { - return battleCardBase2; - } - return null; - } - - protected override void WatchChoiceDetail(BattleCardBase hitCard, ParallelVfxPlayer parallelVfx) - { - if (hitCard != null && !hitCard.IsInHand && !hitCard.IsInDeck && !hitCard.IsInplay && !hitCard.IsDead) - { - _hitCard = hitCard; - SelectCardProcessor touchProcessor = new SelectCardProcessor(_battleMgr, _hitCard, _inputMgr, _pressedCard != null); - parallelVfx.Register(RegisterTouchProcessor(touchProcessor)); - if (hitCard.BattleCardView.Transform.localScale.x >= 1f) - { - StartOpenHandDetail(_hitCard, right: false); - } - } - } - - protected override void HideAlert() - { - _alertCard = null; - } - - protected override bool IsShowingAlert() - { - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/WatchTurnEndTimeController.cs b/SVSim.BattleEngine/Engine/WatchTurnEndTimeController.cs deleted file mode 100644 index 94979db9..00000000 --- a/SVSim.BattleEngine/Engine/WatchTurnEndTimeController.cs +++ /dev/null @@ -1,27 +0,0 @@ -public class WatchTurnEndTimeController : TurnEndTimeController -{ - protected override bool IsTurnTimeDecrement - { - get - { - return false; - } - set - { - } - } - - public WatchTurnEndTimeController(BattleManagerBase battleMgr, BattlePlayer battlePlayer, ITurnEndButtonUI turnEnd) - : base(battleMgr, battlePlayer, turnEnd) - { - } - - protected override bool CompulsionTurnEnd() - { - return false; - } - - protected override void UpdateTimerPosition(float timeDifference, bool isShowingAlert) - { - } -} diff --git a/SVSim.BattleEngine/Engine/WatcherDisconnectChecker.cs b/SVSim.BattleEngine/Engine/WatcherDisconnectChecker.cs deleted file mode 100644 index a6654759..00000000 --- a/SVSim.BattleEngine/Engine/WatcherDisconnectChecker.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Cute; - -public class WatcherDisconnectChecker : NetworkBattleIntervalCheckerBase -{ - private const float DISP_DISCONNECT_INTERVAL = 30f; - - public bool isDisp; - - public event Action OnDisp; - - public event Action OnErase; - - public void EraseDisp() - { - if (isDisp) - { - this.OnErase.Call(); - isDisp = false; - } - } - - protected override void IntervalCheck() - { - base.IntervalCheck(); - if ((float)NetworkUtility.GetTimeSpanSecond(base.startTick) >= 30f) - { - this.OnDisp.Call(); - isDisp = true; - StopChecker(); - } - } - - public override void FinishChecker() - { - base.FinishChecker(); - EraseDisp(); - } -} diff --git a/SVSim.BattleEngine/Engine/WatcherLeaveChecker.cs b/SVSim.BattleEngine/Engine/WatcherLeaveChecker.cs deleted file mode 100644 index 30adacfd..00000000 --- a/SVSim.BattleEngine/Engine/WatcherLeaveChecker.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Cute; - -public class WatcherLeaveChecker : NetworkBattleIntervalCheckerBase -{ - private const float DISP_LEAVE_INTERVAL = 95f; - - public bool isDisp; - - private NetworkWatchBattleMgr WatchBattleMgr; - - public event Action OnDisp; - - public event Action OnErase; - - public void EraseDisp() - { - if (isDisp) - { - this.OnErase.Call(); - isDisp = false; - } - } - - protected override void IntervalCheck() - { - base.IntervalCheck(); - if ((float)NetworkUtility.GetTimeSpanSecond(base.startTick) >= 95f && WatchBattleMgr.disconnectDialog == null) - { - this.OnDisp.Call(); - isDisp = true; - StopChecker(); - } - } - - public override void FinishChecker() - { - base.FinishChecker(); - EraseDisp(); - } - - public void SetBattleMgr(NetworkWatchBattleMgr battleMgr) - { - WatchBattleMgr = battleMgr; - } -} diff --git a/SVSim.BattleEngine/Engine/WindowResize.cs b/SVSim.BattleEngine/Engine/WindowResize.cs deleted file mode 100644 index 64df0aff..00000000 --- a/SVSim.BattleEngine/Engine/WindowResize.cs +++ /dev/null @@ -1,376 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Cute; -using UnityEngine; - -public class WindowResize -{ - public delegate IntPtr WndProcDelegate(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); - - public struct Rect - { - public int Left { get; set; } - - public int Top { get; set; } - - public int Right { get; set; } - - public int Bottom { get; set; } - - public int Width - { - get - { - return Right - Left; - } - set - { - Right = Left + value; - } - } - - public int Height - { - get - { - return Bottom - Top; - } - set - { - Bottom = Top + value; - } - } - - public Rect(int left, int top, int right, int bottom) - { - this = default(Rect); - Left = left; - Top = top; - Right = right; - Bottom = bottom; - } - } - - public struct WindowPos - { - public IntPtr hwnd; - - public IntPtr hwndafter; - - public int x; - - public int y; - - public int cx; - - public int cy; - - public uint flags; - } - - private const int WINDOW_WIDTH_MIN = 128; - - private const int WINDOW_HEIGHT_MIN = 59; - - public const float ASPECT_RATIO_MAX = 2.1666667f; - - public const float ASPECT_RATIO_MIN = 1.333f; - - private static int _windowLastWidth; - - private static int _windowLastHeight; - - private static bool _lastFullscreen; - - private static int? _requestUiUpdateFrame; - - private static int _frameLastWidth; - - private static int _frameLastHeight; - - private const int WM_WINDOWPOSCHANGING = 70; - - private const int WM_SIZING = 532; - - private const int WMSZ_LEFT = 1; - - private const int WMSZ_TOP = 3; - - private const int WMSZ_TOPLEFT = 4; - - private const int WMSZ_TOPRIGHT = 5; - - private const int WMSZ_BOTTOMLEFT = 7; - - private const int SWP_NOSIZE = 1; - - private static WndProcDelegate _wndProc; - - private static IntPtr _oldwndProcPtr; - - private static bool _init; - - private IntPtr WndProcPtr(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) - { - if (!Screen.fullScreen) - { - switch (msg) - { - case 532u: - { - Rect structure2 = (Rect)Marshal.PtrToStructure(lParam, typeof(Rect)); - if (_windowLastWidth != structure2.Width || _windowLastHeight != structure2.Height) - { - (int, int) newWindowSize2 = GetNewWindowSize(hWnd, structure2.Width, structure2.Height); - int item3 = newWindowSize2.Item1; - int item4 = newWindowSize2.Item2; - int num = (int)wParam; - bool num2 = num == 7 || num == 1 || num == 4; - bool flag = num == 3 || num == 4 || num == 5; - if (num2) - { - structure2.Left = structure2.Right - item3; - } - else - { - structure2.Right = structure2.Left + item3; - } - if (flag) - { - structure2.Top = structure2.Bottom - item4; - } - else - { - structure2.Bottom = structure2.Top + item4; - } - Marshal.StructureToPtr(structure2, lParam, fDeleteOld: true); - } - break; - } - case 70u: - { - WindowPos structure = (WindowPos)Marshal.PtrToStructure(lParam, typeof(WindowPos)); - if ((structure.flags & 1) == 0 && (_windowLastWidth != structure.cx || _windowLastHeight != structure.cy)) - { - (int, int) newWindowSize = GetNewWindowSize(hWnd, structure.cx, structure.cy); - int item = newWindowSize.Item1; - int item2 = newWindowSize.Item2; - structure.cx = item; - structure.cy = item2; - Marshal.StructureToPtr(structure, lParam, fDeleteOld: true); - } - break; - } - } - } - return CallWindowProc(_oldwndProcPtr, hWnd, msg, wParam, lParam); - } - - private (int, int) GetWindowFrameSize(IntPtr hWnd) - { - GetClientRect(hWnd, out var lpRect); - if (lpRect.Right - lpRect.Left == 0 || lpRect.Bottom - lpRect.Top == 0) - { - return (_frameLastWidth, _frameLastHeight); - } - GetWindowRect(hWnd, out var lpRect2); - int item = lpRect2.Right - lpRect2.Left - (lpRect.Right - lpRect.Left); - int item2 = lpRect2.Bottom - lpRect2.Top - (lpRect.Bottom - lpRect.Top); - return (item, item2); - } - - private static (int, int) WindowToClientSize(int windowWidth, int windowHeight, int frameWidth, int frameHeight) - { - return (windowWidth - frameWidth, windowHeight - frameHeight); - } - - private static (int, int) ClientToWindowSize(int clientWidth, int clientHeight, int frameWidth, int frameHeight) - { - return (clientWidth + frameWidth, clientHeight + frameHeight); - } - - private (int, int) GetNewWindowSize(IntPtr hWnd, int width, int height) - { - (int, int) windowFrameSize = GetWindowFrameSize(hWnd); - int item = windowFrameSize.Item1; - int item2 = windowFrameSize.Item2; - _frameLastWidth = item; - _frameLastHeight = item2; - (int, int) tuple = WindowToClientSize(width, height, item, item2); - int item3 = tuple.Item1; - int item4 = tuple.Item2; - Vector3 fixedSize = getFixedSize(item3, item4); - item3 = (int)fixedSize.x; - item4 = (int)fixedSize.y; - UpdateGame(fixedSize.z); - _windowLastWidth = item3; - _windowLastHeight = item4; - return ClientToWindowSize(item3, item4, item, item2); - } - - private void init() - { - if (!_init) - { - IntPtr activeWindow = GetActiveWindow(); - _wndProc = WndProcPtr; - IntPtr functionPointerForDelegate = Marshal.GetFunctionPointerForDelegate(_wndProc); - IntPtr? intPtr = SetWindowLongPtr(activeWindow, -4, functionPointerForDelegate); - if (intPtr.HasValue) - { - _oldwndProcPtr = intPtr.Value; - _init = true; - } - } - } - - public WindowResize() - { - init(); - } - - private static Vector3 getFixedSize(int width, int height) - { - if (height < 59) - { - height = 59; - } - float num = (float)width / (float)height; - if (num < 1.333f) - { - num = 1.333f; - if (width < 128) - { - width = 128; - } - height = (int)((float)width / num); - } - else if (num > 2.1666667f) - { - num = 2.1666667f; - width = (int)((float)height * num); - } - return new Vector3(width, height, num); - } - - public static void SetResolution(int newWidth, int newHeight) - { - Vector3 fixedSize = getFixedSize(newWidth, newHeight); - newWidth = (int)fixedSize.x; - newHeight = (int)fixedSize.y; - float z = fixedSize.z; - if (Toolbox.QualityManager != null) - { - Toolbox.QualityManager.ChangeResolution(newWidth, newHeight, Screen.fullScreen); - } - UpdateGame(z); - _windowLastWidth = Screen.width; - _windowLastHeight = Screen.height; - } - - private static void ResolutionChanged() - { - Vector3 fixedSize = getFixedSize(Screen.width, Screen.height); - int num = (int)fixedSize.x; - int num2 = (int)fixedSize.y; - float z = fixedSize.z; - if (Toolbox.QualityManager != null) - { - if (num != Screen.width || num2 != Screen.height) - { - Toolbox.QualityManager.ChangeResolution(num, num2, Screen.fullScreen); - } - else - { - Toolbox.QualityManager.UpdateFromUnity(); - } - } - UpdateGame(z); - _windowLastWidth = num; - _windowLastHeight = num2; - _lastFullscreen = Screen.fullScreen; - } - - private static void UpdateGame(float ratio) - { - if (GameMgr.GetIns() != null) - { - GameMgr.GetIns().ChangeAspectRatio(ratio); - } - if (UIManager.GetInstance() != null && UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle && BattleManagerBase.GetIns() != null) - { - BattleManagerBase.GetIns().ChangeCameraFieldOfView(ratio); - } - _requestUiUpdateFrame = Time.frameCount; - } - - private static void UpdateUI() - { - UILabel[] array = UnityEngine.Object.FindObjectsOfType(); - for (int i = 0; i < array.Length; i++) - { - array[i].WrapOnResize(); - array[i].UpdateNGUIText(); - } - UITable[] array2 = UnityEngine.Object.FindObjectsOfType(); - for (int j = 0; j < array2.Length; j++) - { - array2[j].Reposition(); - } - AspectCameraPerspective[] array3 = UnityEngine.Object.FindObjectsOfType(); - for (int k = 0; k < array3.Length; k++) - { - array3[k].UpdateFov(); - } - } - - public void Update() - { - init(); - if (_requestUiUpdateFrame.HasValue && _requestUiUpdateFrame.Value < Time.frameCount) - { - UpdateUI(); - _requestUiUpdateFrame = null; - } - if (Screen.fullScreen && (_windowLastWidth != Screen.width || _windowLastHeight != Screen.height)) - { - ResolutionChanged(); - } - } - - public void SetSavedResolutionSettings() - { - } - - [DllImport("user32.dll")] - private static extern IntPtr GetActiveWindow(); - - [DllImport("user32.dll")] - private static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam); - - [DllImport("user32.dll", EntryPoint = "SetWindowLong")] - private static extern int SetWindowLong32(IntPtr hWnd, int nIndex, int dwNewLong); - - [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr")] - private static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong); - - [DllImport("user32.dll")] - private static extern bool GetWindowRect(IntPtr hwnd, out Rect lpRect); - - [DllImport("user32.dll")] - private static extern bool GetClientRect(IntPtr hwnd, out Rect lpRect); - - public static IntPtr? SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong) - { - if (IntPtr.Size == 8) - { - return SetWindowLongPtr64(hWnd, nIndex, dwNewLong); - } - int num = SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32()); - if (num == 0) - { - return null; - } - return new IntPtr(num); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.AutoTest/AutoTestBattleMgr.cs b/SVSim.BattleEngine/Engine/Wizard.AutoTest/AutoTestBattleMgr.cs index 2e1c861b..f7fbfc94 100644 --- a/SVSim.BattleEngine/Engine/Wizard.AutoTest/AutoTestBattleMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard.AutoTest/AutoTestBattleMgr.cs @@ -81,23 +81,4 @@ public static class AutoTestBattleMgr } } } - - public static JsonData LoadJsonData(string filePath) - { - return JsonMapper.ToObject(Resources.Load(filePath).text); - } - - private static IEnumerable CreateDeckIds(JsonData playerJsonData) - { - JsonData deckJsonData = playerJsonData["deck"]; - if (deckJsonData.IsArray) - { - int deckCardCount = deckJsonData.Count; - for (int i = 0; i < deckCardCount; i++) - { - JsonData jsonData = deckJsonData[i]; - yield return jsonData["id"].ToInt(); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card.InnerOptions/CardInnerOptionsBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card.InnerOptions/CardInnerOptionsBase.cs index 54b402f4..9a87fc0c 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card.InnerOptions/CardInnerOptionsBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card.InnerOptions/CardInnerOptionsBase.cs @@ -1,4 +1,8 @@ using Wizard.Battle.View; +// TODO(engine-cleanup-pass2): 1 of 2 methods unrun in baseline +// Type: Wizard.Battle.Card.InnerOptions.CardInnerOptionsBase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Card.InnerOptions; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualChantFieldBattleCard.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualChantFieldBattleCard.cs index 94f41b3f..ab23da90 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualChantFieldBattleCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualChantFieldBattleCard.cs @@ -19,10 +19,6 @@ public class VirtualChantFieldBattleCard : ChantFieldBattleCard, IVirtualBattleC return new NullFieldBattleCardView(buildInfo); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } public override SkillCreator CreateSkillCreator(BattlePlayerBase selfBattlPlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr resourceMgr) { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualClassBattleCard.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualClassBattleCard.cs index 7b384245..7097d711 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualClassBattleCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualClassBattleCard.cs @@ -2,6 +2,10 @@ using Wizard.Battle.Operation; using Wizard.Battle.Resource; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 3 of 7 methods unrun in baseline +// Type: Wizard.Battle.Card.VirtualClassBattleCard +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Card; @@ -21,10 +25,6 @@ public class VirtualClassBattleCard : ClassBattleCardBase, IVirtualBattleCard return new NullClassBattleCardView(buildInfo); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } protected override void _CacheBattlePlayer() { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualFieldBattleCard.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualFieldBattleCard.cs index 83de0b18..fe53d9a4 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualFieldBattleCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualFieldBattleCard.cs @@ -19,10 +19,6 @@ public class VirtualFieldBattleCard : FieldBattleCard, IVirtualBattleCard return new NullFieldBattleCardView(buildInfo); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } public override SkillCreator CreateSkillCreator(BattlePlayerBase selfBattlPlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr resourceMgr) { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpecialSkillBattleCard.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpecialSkillBattleCard.cs index fbcde615..0211c962 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpecialSkillBattleCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpecialSkillBattleCard.cs @@ -19,10 +19,6 @@ public class VirtualSpecialSkillBattleCard : SpecialSkillBattleCard, IVirtualBat return new NullBattleCardView(buildInfo); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } public override SkillCreator CreateSkillCreator(BattlePlayerBase selfBattlPlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr resourceMgr) { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpellBattleCard.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpellBattleCard.cs index d9a83008..0cb4a1aa 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpellBattleCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualSpellBattleCard.cs @@ -19,10 +19,6 @@ public class VirtualSpellBattleCard : SpellBattleCard, IVirtualBattleCard return new NullBattleCardView(buildInfo); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } public override SkillCreator CreateSkillCreator(BattlePlayerBase selfBattlPlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr resourceMgr) { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualUnitBattleCard.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualUnitBattleCard.cs index a2cb8d34..b795d3b7 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualUnitBattleCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Card/VirtualUnitBattleCard.cs @@ -2,6 +2,10 @@ using Wizard.Battle.Operation; using Wizard.Battle.Resource; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 5 of 8 methods unrun in baseline +// Type: Wizard.Battle.Card.VirtualUnitBattleCard +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Card; @@ -24,10 +28,6 @@ public class VirtualUnitBattleCard : UnitBattleCard, IVirtualBattleCard return new NullBattleCardView(buildInfo); } - protected override ICardVfxCreator CreateVfxCreator(bool isPlayer, IBattleCardView battleCardView, bool isNullView) - { - return NullCardVfxCreator.GetInstance(); - } public override SkillCreator CreateSkillCreator(BattlePlayerBase selfBattlPlayer, BattlePlayerBase opponentBattlePlayer, IBattleResourceMgr resourceMgr) { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/IMulliganMgr.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/IMulliganMgr.cs index a5a553ce..ef229033 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/IMulliganMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/IMulliganMgr.cs @@ -23,7 +23,7 @@ public interface IMulliganMgr VfxBase CompleteMulligan(BattleManagerBase m_BtlMgrIns); - VfxBase InitMulligan(MulliganInfoControl mulliganInfo, IPlayerView view); + VfxBase InitMulligan(BattleManagerBase mgr, MulliganInfoControl mulliganInfo, IPlayerView view); VfxBase RecoverMulligan(bool didPlayerSubmitMulligan, BattleManagerBase battleMgr); diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganCtrl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganCtrl.cs index 830290bf..ecc3b974 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganCtrl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganCtrl.cs @@ -2,16 +2,14 @@ using System; using System.Collections.Generic; using System.Linq; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 7 of 19 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.MulliganCtrl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt namespace Wizard.Battle.Mulligan; public abstract class MulliganCtrl { - public const int MULLIGAN_CARD_MAX = 3; - - public const int MULLIGAN_FIRST_EXCHANGE_MAX = 6; - - public const int MULLIGAN_CHANGED_NUM_NULL = -1; protected BattlePlayerBase _battlePlayer; @@ -73,6 +71,8 @@ public abstract class MulliganCtrl protected IDictionary NetworkMoveNewCardToHand(IList AbandonCards) { + // Phase-5 chunk 48: restored card lookup — chunk 35's stub broke live receive Deal path. + var battleMgr = _battlePlayer.BattleMgr; BattlePlayerBase player = GetBattlePlayer(); List list = new List(); for (int i = 0; i < _mulliganAfterCardIndexList.Count; i++) @@ -80,7 +80,7 @@ public abstract class MulliganCtrl int num = _mulliganAfterCardIndexList[i]; if (!DealIdxList.Contains(num)) { - list.Add(BattleManagerBase.GetIns().GetBattleCardIdx(player.DeckCardList, num)); + list.Add(battleMgr.GetBattleCardIdx(player.DeckCardList, num)); } } if (AbandonCards.Count != list.Count) @@ -137,7 +137,7 @@ public abstract class MulliganCtrl _mulliganView.HideMulliganTitle(); } })); - sequentialVfxPlayer.Register(new PlayerMulliganSwapVfx(list2, list, oldList, isCardHolderPlayer)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); int count = newList.Count; ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); for (int num = 0; num < count; num++) @@ -148,7 +148,7 @@ public abstract class MulliganCtrl } parallelVfxPlayer.Register(InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_RIGHT); + })); sequentialVfxPlayer.Register(parallelVfxPlayer); return sequentialVfxPlayer; @@ -161,16 +161,6 @@ public abstract class MulliganCtrl retCardList = source.Select((int index) => battleMgr.GetBattleCardIdx(GetBattlePlayer().AllCards.ToList(), index)).ToList(); } - public SequentialVfxPlayer MoveCardToStaticPosition(BattleCardBase card, int posIndex, bool isAbandon) - { - return _mulliganView.MoveCardToStaticPosition(card, posIndex, isAbandon); - } - - public VfxBase MoveMulliganUIOutWhenSubmitMulligan() - { - return _mulliganView.MoveMulliganUIOutWhenSubmitMulligan(); - } - public VfxBase DrawFirstMulliganCard() { SkillProcessor skillProcessor = new SkillProcessor(); @@ -181,11 +171,11 @@ public abstract class MulliganCtrl { List list = new List(6); List list2 = Enumerable.Range(1, maxNum).ToList(); - if (BattleManagerBase.IsRandomDraw || GameMgr.GetIns().IsNetworkBattle) + if (_battlePlayer.BattleMgr.InstanceIsRandomDraw /* Pre-Phase-5b: IsNetworkBattle assumed true */) { for (int i = 0; i < 6; i++) { - int index = BattleManagerBase.GetIns().StableRandom(list2.Count); + int index = 0; // Pre-Phase-5b: no mgr in scope; deterministic fallback list.Add(list2[index]); list2.Remove(list2[index]); } @@ -202,11 +192,15 @@ public abstract class MulliganCtrl protected void _CreateMulliganCardList(List indexList) { + // Phase-5 chunk 48 (2026-07-03): restored the real card lookup — chunk 35's null stub + // broke the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd on null + // entries). mgr is reachable via _battlePlayer.BattleMgr (chunk 42 seam). + var battleMgr = _battlePlayer.BattleMgr; List deckCardList = GetBattlePlayer().DeckCardList; for (int i = 0; i < 3; i++) { - BattleCardBase battleCardIdx = BattleManagerBase.GetIns().GetBattleCardIdx(deckCardList, indexList[i]); - BattleCardBase battleCardIdx2 = BattleManagerBase.GetIns().GetBattleCardIdx(deckCardList, indexList[i + 3]); + BattleCardBase battleCardIdx = battleMgr.GetBattleCardIdx(deckCardList, indexList[i]); + BattleCardBase battleCardIdx2 = battleMgr.GetBattleCardIdx(deckCardList, indexList[i + 3]); _firstDrawList.Add(battleCardIdx); _stockList.Add(battleCardIdx2); } @@ -214,10 +208,12 @@ public abstract class MulliganCtrl public void CreateMulliganDealList(List indexList) { + // Phase-5 chunk 48 (2026-07-03): restored the real card lookup — see _CreateMulliganCardList. + var battleMgr = _battlePlayer.BattleMgr; List deckCardList = GetBattlePlayer().DeckCardList; for (int i = 0; i < 3; i++) { - BattleCardBase battleCardIdx = BattleManagerBase.GetIns().GetBattleCardIdx(deckCardList, indexList[i]); + BattleCardBase battleCardIdx = battleMgr.GetBattleCardIdx(deckCardList, indexList[i]); _firstDrawList.Add(battleCardIdx); } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganInfoControl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganInfoControl.cs index 0fe66572..7e2fe0ba 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganInfoControl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganInfoControl.cs @@ -4,6 +4,9 @@ using System.Linq; using Cute; using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 47 of 50 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.MulliganInfoControl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt namespace Wizard.Battle.Mulligan; @@ -48,16 +51,6 @@ public class MulliganInfoControl : UIBase private static readonly Vector3 SUBMIT_BUTTON_SCALE = new Vector3(1.4f, 1.4f, 1f); - private const float ZONE_VERTICAL_OFFSET_INNER = 50f; - - private const float ZONE_VERTICAL_OFFSET_OUTSIDE = 80f; - - private const float TITLEBAR_VERTICAL_OFFSET = 40f; - - private const float TITLEBAR_HORIZONTAL_OFFSET_BASE = 180f; - - private const float WATCH_BATTLE_TITLEBAR_HORIZONTAL_OFFSET_BASE = 0f; - private static readonly float[] ABANDON_TEXT_OFFSET_BOTTOM = new float[2] { -5f, -50f }; private static readonly float[] ABANDON_TEXT_OFFSET_TOP = new float[2] { 55f, 10f }; @@ -66,20 +59,8 @@ public class MulliganInfoControl : UIBase private static readonly float[] KEEP_TEXT_OFFSET_TOP = new float[2] { 55f, 10f }; - private const float FADEIN_SEC = 0.5f; - - private const float FADEIN_ALPHA = 1f; - - private const float FADEOUT_SEC = 0.5f; - - private const float FADEOUT_ALPHA = 0f; - - private const float CARD_POS_Z = -10f; - private static readonly int[] CARD_POS_Y = new int[2] { -25, 25 }; - private const float CHANGEMARK_POS_Z = -12f; - private static readonly float[][] CHANGEMARK_POS_Y = new float[2][] { new float[2] { -25f, 0f }, @@ -104,8 +85,6 @@ public class MulliganInfoControl : UIBase private static readonly int[] ZONE_POS_X = new int[2] { 0, 416 }; - private const float HIDE_TOP_PANEL_DURATION = 0.3f; - private static readonly Vector3 ENEMY_CLASS_ICON_POSITION = new Vector3(-274.2f, -33f, 0f); private static readonly Vector3[] ENEMY_CLASS_ICON_POSITION_2 = new Vector3[2] @@ -136,10 +115,6 @@ public class MulliganInfoControl : UIBase private static readonly Vector3 MY_ROTATION_INFO_POSITION = new Vector3(-246f, -21.9f, 0f); - private const int MY_ROTATION_PACK_RABEL_WIDTH_SHORT = 50; - - private const int MY_ROTATION_PACK_RABEL_WIDTH_LONG = 80; - private static readonly string[] USE_SHORT_WIDTH_LANGUAGE = new string[2] { "Jpn", "Kor" }; [SerializeField] @@ -187,9 +162,6 @@ public class MulliganInfoControl : UIBase [SerializeField] private GameObject TimerObj; - [SerializeField] - private UILabel TimerLabel; - [SerializeField] public UIButton SubmitBtn; @@ -217,30 +189,12 @@ public class MulliganInfoControl : UIBase private BattleManagerBase m_BtlMgrIns; - private long startTicks; - - private int passageStartSecond; - - private float maxSecond; - private bool isTimerOn; private int StateCnt; - public const float ENEMY_INFO_HIDE_POS = 340f; - - private float extendTime; - - private Color TIMER_COLOR_RED = new Color(0.85490197f, 0.2901961f, 0.2509804f); - - private Color TIMER_COLOR_YELLOW = new Color(1f, 41f / 51f, 23f / 85f); - - private Color TIMER_COLOR_WHITE = new Color(1f, 0.99215686f, 47f / 51f); - public bool IsEnd { get; private set; } - public bool IsShowingMulliganSelect { get; private set; } - private int SCREEN_HEIGHT => m_3DCamera.pixelHeight; public event Action OnStartMulligan; @@ -249,53 +203,10 @@ public class MulliganInfoControl : UIBase public event Func OnTimeUp; - public void SetExtendTime(float leftTime) - { - extendTime = leftTime; - } - public void InitMulliganInfo() { - m_BtlMgrIns = BattleManagerBase.GetIns(); - base.gameObject.SetActive(value: false); - m_3DCamera = m_BtlMgrIns.Battle3DContainer.transform.Find("Camera").GetComponent(); - List list = new List(); - for (int i = 0; i < _partsPlayer._exchangeMark.Length; i++) - { - list.Add(_partsPlayer._exchangeMark[i].gameObject); - } - for (int j = 0; j < _partsOpponent._exchangeMark.Length; j++) - { - list.Add(_partsOpponent._exchangeMark[j].gameObject); - } - UIManager.GetInstance().AttachAtlas(list); - } - - private void Update() - { - if (GameMgr.GetIns().IsAINetwork && m_BtlMgrIns.IsRecovery) - { - return; - } - long ticks = TimeUtil.GetAbsoluteTime().Ticks - startTicks; - TimeSpan timeSpan = new TimeSpan(ticks); - if (!isTimerOn) - { - return; - } - float num = maxSecond - (float)timeSpan.TotalMilliseconds / 1000f + extendTime; - SetTimerLabel(num); - if (num <= 0f) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - VfxBase[] allFuncCallResults = this.OnTimeUp.GetAllFuncCallResults(); - foreach (VfxBase vfx in allFuncCallResults) - { - sequentialVfxPlayer.Register(vfx); - } - sequentialVfxPlayer.Register(m_BtlMgrIns.MulliganMgr.Submit(m_BtlMgrIns)); - m_BtlMgrIns.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } + // Pre-Phase-5b: MulliganInfoControl is UI-only headless; camera lookup + AttachAtlas dropped + m_BtlMgrIns = null; } public override void assetBundleEnd() @@ -329,7 +240,7 @@ public class MulliganInfoControl : UIBase StateCnt = 0; base.gameObject.SetActive(value: true); SetSubmitLabel(); - if (GameMgr.GetIns().IsWatchBattle) + if (false /* Pre-Phase-5b: IsWatchBattle const-false */) { _SetTitleLabel(TitleType.Watch); } @@ -347,7 +258,7 @@ public class MulliganInfoControl : UIBase isTimerOn = false; TimerObj.SetActive(value: false); EnableButton(on: false); - if (GameMgr.GetIns().IsNetworkBattle && StateCnt < 2 && !GameMgr.GetIns().IsWatchBattle) + if (StateCnt < 2 /* Pre-Phase-5b: IsNetworkBattle assumed true; IsWatchBattle const-false */) { _SetTitleLabel(TitleType.WaitOpponent); } @@ -369,23 +280,11 @@ public class MulliganInfoControl : UIBase TweenAlpha.Begin(_partsPlayer._abandonBG.gameObject, 0.5f, 0f); } - public void HideMulliganCenterUI() - { - TweenAlpha.Begin(_partsPlayer._keepBG.gameObject, 0.5f, 0f); - TweenAlpha.Begin(_partsPlayer._abandonBG.gameObject, 0.5f, 0f); - } - public void HideMulliganOpponentChangeUI() { TweenAlpha.Begin(_partsOpponent._abandonBG.gameObject, 0.5f, 0f); } - public void HideMulliganOpponentCenterUI() - { - TweenAlpha.Begin(_partsOpponent._keepBG.gameObject, 0.5f, 0f); - TweenAlpha.Begin(_partsOpponent._abandonBG.gameObject, 0.5f, 0f); - } - public void InitiallizeView() { AnchorTL.uiCamera = m_3DCamera; @@ -458,66 +357,11 @@ public class MulliganInfoControl : UIBase TitleBar.bottomAnchor.Set(0.5f, -40f); TitleBar.leftAnchor.target = target; TitleBar.rightAnchor.target = target; - float num3 = ((GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle) ? 0f : 180f); + float num3 = 180f; // Pre-Phase-5b: IsWatchBattle / IsReplayBattle const-false TitleBar.leftAnchor.Set(0f, num3 * m_3DCamera.aspect); TitleBar.rightAnchor.Set(1f, (0f - num3) * m_3DCamera.aspect); } - public void ShowMulliganUI() - { - if (GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsReplayBattle) - { - isTimerOn = true; - startTicks = TimeUtil.GetAbsoluteTime().Ticks; - if (ToolboxGame.RealTimeNetworkAgent != null) - { - passageStartSecond = ToolboxGame.RealTimeNetworkAgent.GetPreparedStartTimer(); - } - if ((float)passageStartSecond <= 25f) - { - maxSecond = 60f; - } - else - { - maxSecond = 60f - ((float)passageStartSecond - 25f); - if (maxSecond <= 0f) - { - maxSecond = 0f; - } - } - } - bool active = true; - bool active2 = true; - bool flag = true; - if (ViewType.Watch == _viewType) - { - active = false; - active2 = false; - flag = false; - } - TurnImg.gameObject.SetActive(active); - EnemyInfo.gameObject.SetActive(active2); - EnableButton(flag); - TweenAlpha.Begin(TitleBar.gameObject, 0.5f, 1f); - TweenAlpha.Begin(_partsPlayer._keepBG.gameObject, 0.5f, 1f); - TweenAlpha.Begin(_partsPlayer._abandonBG.gameObject, 0.5f, 1f); - if (ViewType.Watch == _viewType) - { - TweenAlpha.Begin(_partsOpponent._keepBG.gameObject, 0.5f, 1f); - TweenAlpha.Begin(_partsOpponent._abandonBG.gameObject, 0.5f, 1f); - } - TweenAlpha.Begin(TurnImg.gameObject, 0.5f, 1f); - TweenAlpha.Begin(EnemyInfo.gameObject, 0.5f, 1f); - SetEnemyReady(-1); - SetTimerLabel(maxSecond); - IsShowingMulliganSelect = true; - } - - public void ShowTimerUI() - { - TimerObj.SetActive(ViewType.Watch != _viewType && isTimerOn); - } - private void EnableButton(bool on) { SubmitBtn.gameObject.SetActive(on); @@ -536,11 +380,6 @@ public class MulliganInfoControl : UIBase return sequentialVfxPlayer; } - public void SetMulliganEnd() - { - IsEnd = true; - } - public void SetEnemyReady(int num) { SystemText systemText = Data.SystemText; @@ -562,7 +401,7 @@ public class MulliganInfoControl : UIBase private void SetEnemyClassInfo() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr MyRotationInfo myRotationInfo; if (dataMgr.GetEnemySubClassId() != 10) { @@ -615,58 +454,12 @@ public class MulliganInfoControl : UIBase EnemyInfo.spriteName = MARIGAN_PANEL_CLASS + dataMgr.GetEnemyClassId().ToString("00"); } - private void SetTimerLabel(float milliseconds) - { - if (GameMgr.GetIns().IsNetworkBattle) - { - float num = Mathf.Max(0f, Mathf.Ceil(milliseconds)); - if (num <= 10f) - { - TimerLabel.color = TIMER_COLOR_RED; - } - else if (num <= 30f) - { - TimerLabel.color = TIMER_COLOR_YELLOW; - } - else - { - TimerLabel.color = TIMER_COLOR_WHITE; - } - TimerLabel.text = num.ToString(); - } - else - { - TimerLabel.text = ""; - TimerObj.SetActive(value: false); - } - } - private void SetSubmitLabel() { SystemText systemText = Data.SystemText; SubmitBtnLabel.text = systemText.Get("Battle_0102"); } - public VfxBase OnMulliganSubmit() - { - HideButtons(); - for (int i = 0; i < _partsPlayer._exchangeMark.Length; i++) - { - _partsPlayer._exchangeMark[i].gameObject.SetActive(value: false); - } - for (int j = 0; j < _partsOpponent._exchangeMark.Length; j++) - { - _partsOpponent._exchangeMark[j].gameObject.SetActive(value: false); - } - return InstantVfx.Create(delegate - { - if (!BattleManagerBase.GetIns().IsRecovery) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.MULLIGAN_DECIDE); - } - }); - } - private void _SetTitleLabel(TitleType type) { TitleLabel.text = string.Empty; @@ -681,7 +474,7 @@ public class MulliganInfoControl : UIBase TitleLabel.text = Data.SystemText.Get("Battle_0104"); break; case TitleType.Watch: - if (GameMgr.GetIns().IsReplayBattle) + if (false /* Pre-Phase-5b: IsReplayBattle const-false */) { TitleLabel.text = Data.SystemText.Get("Battle_0467"); break; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganMgrBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganMgrBase.cs index a0277767..40272442 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganMgrBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganMgrBase.cs @@ -7,6 +7,10 @@ using UnityEngine; using Wizard.Battle.UI; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 13 of 18 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.MulliganMgrBase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Mulligan; @@ -14,16 +18,12 @@ public abstract class MulliganMgrBase : IMulliganMgr { protected OpponentMulliganCtrl _opponentMulliganControl; - private const float MULLIGAN_LIMIT_TIME = 5f; - private Coroutine mulliganTimeoutCoroutine; public PlayerMulliganCtrl PlayerMlgCtrl { get; protected set; } public OpponentMulliganCtrl OpponentMlgCtrl => _opponentMulliganControl; - public IList AbandonList => PlayerMlgCtrl.AbandonList; - public Action OnSubmit { get; set; } public VfxBase StartDeal(List playerDealIdxList, List oppoDealIdxList, SkillProcessor skillProcessor) @@ -40,7 +40,7 @@ public abstract class MulliganMgrBase : IMulliganMgr instance2 = _opponentMulliganControl.StartMulliganVfx(skillProcessor); parallelVfxPlayer.Register(instance); parallelVfxPlayer.Register(instance2); - if (BattleManagerBase.GetIns().IsRecovery && Data.BattleRecoveryInfo.IsMulliganEnd) + if (false /* Pre-Phase-5b: recovery+mulligan-end guard headless-safe as false */) { return NullVfx.GetInstance(); } @@ -60,7 +60,7 @@ public abstract class MulliganMgrBase : IMulliganMgr BattleCoroutine.GetInstance().StopCoroutine(mulliganTimeoutCoroutine); mulliganTimeoutCoroutine = null; } - BattleManagerBase.GetIns().BattlePlayer.BattleView.HideAlertDialogue(); + /* Pre-Phase-5b: HideAlertDialogue dropped; no BattleView headless */ } private IEnumerator MulliganNetworkTimeout() @@ -69,20 +69,19 @@ public abstract class MulliganMgrBase : IMulliganMgr do { yield return null; - if (BattleManagerBase.GetIns().IsBattleEnd) + if (false /* Pre-Phase-5b: IsBattleEnd guard on coroutine timeout; unreachable headless */) { StopTimeout(); yield break; } } while (!((float)NetworkUtility.GetTimeSpanSecond(matchedTimer) >= 5f)); - BattleManagerBase.GetIns().BattlePlayer.BattleView.ShowAlert(PanelMgr.BattleAlertType.DisconnectInfomationMulligan, isClass: false); + /* Pre-Phase-5b: ShowAlert dropped; no BattleView headless */ } public virtual VfxBase Submit(BattleManagerBase m_BtlMgrIns) { OnSubmit.Call(); - ImmediateVfxMgr.GetInstance().Register(PlayerMlgCtrl.MoveMulliganUIOutWhenSubmitMulligan()); return NullVfx.GetInstance(); } @@ -106,17 +105,17 @@ public abstract class MulliganMgrBase : IMulliganMgr public virtual VfxBase CompleteMulligan(BattleManagerBase battleMgr) { - if (!battleMgr.IsVirtualBattle && !GameMgr.GetIns().IsNewReplayBattle) + if (!battleMgr.IsVirtualBattle && !battleMgr.GameMgr.IsNewReplayBattle) { AddBattleLogMulliganResult(battleMgr); } return NullVfx.GetInstance(); } - public virtual VfxBase InitMulligan(MulliganInfoControl mulliganInfo, IPlayerView view) + public virtual VfxBase InitMulligan(BattleManagerBase mgr, MulliganInfoControl mulliganInfo, IPlayerView view) { - PlayerMlgCtrl = new PlayerMulliganCtrl(BattleManagerBase.GetIns().BattlePlayer, mulliganInfo, view); - _opponentMulliganControl = new OpponentMulliganCtrl(BattleManagerBase.GetIns().BattleEnemy, mulliganInfo, isUseExchangeMark: false); + PlayerMlgCtrl = new PlayerMulliganCtrl(mgr.BattlePlayer, mulliganInfo, view); + _opponentMulliganControl = new OpponentMulliganCtrl(mgr.BattleEnemy, mulliganInfo, isUseExchangeMark: false); return NullVfx.GetInstance(); } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganOperateControl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganOperateControl.cs index 29aac9c0..e282d9de 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganOperateControl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganOperateControl.cs @@ -35,19 +35,11 @@ public class MulliganOperateControl private BattleCardBase _pressedCard; - private const float SHOW_DETAIL_DELAY = 0f; - - private const int START_CARD_NUMBER = 0; - - private const int END_CARD_NUMBER = 2; - - private const int ENTER_MULLIGAN_NUMBER = 3; - public STATE State => _state; public MulliganOperateControl(PlayerMulliganCtrl mulliganCtrl) { - _inputManager = GameMgr.GetIns().GetInputMgr(); + _inputManager = null; // Pre-Phase-5b: no InputMgr headless _state = STATE.WAIT; _playerMulliganCtrl = mulliganCtrl; _mulliganView = mulliganCtrl.GetPlayerMulliganView(); @@ -93,7 +85,7 @@ public class MulliganOperateControl } else if (UseChangeShortcut()) { - if (!BattleManagerBase.GetIns().VfxMgr.IsEnd) + if (false /* Pre-Phase-5b: MulliganOperateControl is UI-only headless */) { return NullVfx.GetInstance(); } @@ -120,7 +112,7 @@ public class MulliganOperateControl _mulliganView.ShowCardDetail(_showDetailCard); } } - else if (_inputManager.IsNone() && BattleManagerBase.GetIns().HasFocus && OptionSettingWindow.ShortcutDetailPanel == OptionSettingWindow.ShortcutDetail.Auto) + else if (false /* Pre-Phase-5b: MulliganOperateControl is UI-only headless */) { RaycastHit[] hits = _mulliganView.ConvertMousePositionToFrontUIRaycastHits(Input.mousePosition); if (!IsTouchingDetail(hits)) @@ -469,42 +461,12 @@ public class MulliganOperateControl _mulliganView.ShutDownCardDetail(); } - private bool UseChangeShortcut() - { - return OptionSettingWindow.ShortcutPlay switch - { - OptionSettingWindow.Shortcut.RightClick => Input.GetMouseButtonDown(1), - OptionSettingWindow.Shortcut.MiddleClick => Input.GetMouseButtonDown(2), - _ => false, - }; - } + // OptionSettingWindow removed (DEAD-COLD engine cleanup Task 13) — shortcut methods return false (headless default) + private bool UseChangeShortcut() => false; - private bool UseChangeShortcutDoubleClick() - { - if (OptionSettingWindow.ShortcutPlay == OptionSettingWindow.Shortcut.DoubleClick) - { - return _inputManager.IsDoubleClick(); - } - return false; - } + private bool UseChangeShortcutDoubleClick() => false; - private bool UseDetailShortcut() - { - return OptionSettingWindow.ShortcutDetailPanel switch - { - OptionSettingWindow.ShortcutDetail.RightClick => Input.GetMouseButtonDown(1), - OptionSettingWindow.ShortcutDetail.MiddleClick => Input.GetMouseButtonDown(2), - OptionSettingWindow.ShortcutDetail.LongPress => _inputManager.IsLongPress(), - _ => false, - }; - } + private bool UseDetailShortcut() => false; - private bool UseDetailShortcutDoubleClick() - { - if (OptionSettingWindow.ShortcutDetailPanel == OptionSettingWindow.ShortcutDetail.DoubleClick) - { - return _inputManager.IsDoubleClick(); - } - return false; - } + private bool UseDetailShortcutDoubleClick() => false; } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganViewBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganViewBase.cs index 0b9bd60d..9085d7b4 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganViewBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/MulliganViewBase.cs @@ -1,6 +1,10 @@ using System.Collections.Generic; using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 4 of 9 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.MulliganViewBase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Mulligan; @@ -27,11 +31,6 @@ public abstract class MulliganViewBase }); } - public VfxBase MoveMulliganUIOutWhenSubmitMulligan() - { - return m_MlgUI.OnMulliganSubmit(); - } - public VfxBase SortFirstDrawsToKeepZone(IList firstDraws) { return new PlayerMulliganCardSortOutVfx(GetMulliganUIKeepZone(), firstDraws, m_MlgUI); @@ -46,7 +45,7 @@ public abstract class MulliganViewBase target.BattleCardView.GameObject.transform.parent = mulliganZone.transform; Vector3 mulliganZoneCardPos = mulliganUI.GetMulliganZoneCardPos(posIndex, isAbandon, target.IsPlayer); Vector3 mulliganZoneCardScale = mulliganUI.GetMulliganZoneCardScale(); - if (BattleManagerBase.GetIns().IsRecovery) + if (false /* Pre-Phase-5b: IsRecovery guard headless-safe as false in view code */) { gameObject.transform.localScale = mulliganZoneCardScale; } @@ -54,13 +53,13 @@ public abstract class MulliganViewBase { iTween.ScaleTo(gameObject, iTween.Hash("scale", mulliganZoneCardScale, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); } - if (GameMgr.GetIns().IsWatchBattle) + if (false /* Pre-Phase-5b: IsWatchBattle const-false */) { - if (GameMgr.GetIns().IsAdmin) + if (false /* Pre-Phase-5b: IsAdmin const-false */) { RotatePlayer(gameObject); } - else if (!BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.HandControl.IsVisibleHand()) + else if (false /* Pre-Phase-5b: no BattleView headless */) { RotateEnemy(gameObject); } @@ -77,7 +76,7 @@ public abstract class MulliganViewBase { RotatePlayer(gameObject); } - if (BattleManagerBase.GetIns().IsRecovery) + if (false /* Pre-Phase-5b: IsRecovery guard headless-safe as false in view code */) { gameObject.transform.localPosition = mulliganZoneCardPos; } @@ -91,7 +90,7 @@ public abstract class MulliganViewBase private static void RotatePlayer(GameObject cardObj) { - if (BattleManagerBase.GetIns().IsRecovery) + if (false /* Pre-Phase-5b: IsRecovery guard headless-safe as false in view code */) { cardObj.transform.localRotation = Quaternion.Euler(CARD_ROTATION); return; @@ -101,7 +100,7 @@ public abstract class MulliganViewBase private static void RotateEnemy(GameObject cardObj) { - if (BattleManagerBase.GetIns().IsRecovery) + if (false /* Pre-Phase-5b: IsRecovery guard headless-safe as false in view code */) { cardObj.transform.localRotation = Quaternion.Euler(CARD_ROTATION_OPPO); return; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkMulliganMgr.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkMulliganMgr.cs index 05954489..92a21af3 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkMulliganMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkMulliganMgr.cs @@ -4,25 +4,29 @@ using Cute; using UnityEngine; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 3 of 9 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.NetworkMulliganMgr +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Mulligan; public class NetworkMulliganMgr : MulliganMgrBase { - private readonly NetworkBattleManagerBase _networkBattleManager; + private NetworkBattleManagerBase _networkBattleManager; private readonly NetworkBattleSender _networkBattleSender; public NetworkMulliganMgr(NetworkBattleSender sender) { _networkBattleSender = sender; - _networkBattleManager = BattleManagerBase.GetIns() as NetworkBattleManagerBase; } - public override VfxBase InitMulligan(MulliganInfoControl mulliganInfo, IPlayerView view) + public override VfxBase InitMulligan(BattleManagerBase mgr, MulliganInfoControl mulliganInfo, IPlayerView view) { - base.PlayerMlgCtrl = new NetworkPlayerMulliganCtrl(BattleManagerBase.GetIns().BattlePlayer, mulliganInfo, view); - _opponentMulliganControl = new NetworkOpponentMulliganCtrl(BattleManagerBase.GetIns().BattleEnemy, mulliganInfo, isUseExchangeMark: false); + _networkBattleManager = mgr as NetworkBattleManagerBase; + base.PlayerMlgCtrl = new NetworkPlayerMulliganCtrl(mgr.BattlePlayer, mulliganInfo, view); + _opponentMulliganControl = new NetworkOpponentMulliganCtrl(mgr.BattleEnemy, mulliganInfo, isUseExchangeMark: false); return NullVfx.GetInstance(); } @@ -127,7 +131,7 @@ public class NetworkMulliganMgr : MulliganMgrBase battleCardView.Transform.localRotation = Quaternion.Euler(MulliganViewBase.CARD_ROTATION); battleCardView.GameObject.SetActive(value: true); } - DummyDeckRemoveCardVfx dummyDeckRemoveCardVfx = new DummyDeckRemoveCardVfx(isPlayer: true, 3); + VfxBase dummyDeckRemoveCardVfx = NullVfx.GetInstance(); return ParallelVfxPlayer.Create(dummyDeckRemoveCardVfx, _networkBattleManager.LoadCardResources(list)); } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkOpponentMulliganCtrl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkOpponentMulliganCtrl.cs index 5867b11b..18060a86 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkOpponentMulliganCtrl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkOpponentMulliganCtrl.cs @@ -16,7 +16,7 @@ public class NetworkOpponentMulliganCtrl : OpponentMulliganCtrl { SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(_battlePlayer.BattleMgr.LoadCardResources(_firstDrawList)); - sequentialVfxPlayer.Register(new EnemyMulliganDrawVfx(_firstDrawList, GetMulliganInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); _battlePlayer.CallRecordingMulliganStart(_firstDrawList); return sequentialVfxPlayer; } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkPlayerMulliganCtrl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkPlayerMulliganCtrl.cs index bc6a917e..e5fa01b6 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkPlayerMulliganCtrl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/NetworkPlayerMulliganCtrl.cs @@ -1,6 +1,10 @@ using System.Collections.Generic; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 1 of 3 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.NetworkPlayerMulliganCtrl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Mulligan; @@ -18,7 +22,7 @@ public class NetworkPlayerMulliganCtrl : PlayerMulliganCtrl { DrawFirstMulliganCard(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new PlayerMulliganDrawVfx(_firstDrawList, GetMulliganInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(_playerMulliganView.SortFirstDrawsToKeepZone(_firstDrawList)); sequentialVfxPlayer.Register(InstantVfx.Create(delegate { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/OpponentMulliganCtrl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/OpponentMulliganCtrl.cs index d71d97b2..47b0f5cf 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/OpponentMulliganCtrl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/OpponentMulliganCtrl.cs @@ -1,6 +1,10 @@ using System.Collections.Generic; using System.Linq; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 2 of 4 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.OpponentMulliganCtrl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Mulligan; @@ -24,7 +28,7 @@ public class OpponentMulliganCtrl : MulliganCtrl _CreateMulliganCardList(opponentIndexList); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(battlePlayer.BattleMgr.LoadCardResources(_firstDrawList)); - sequentialVfxPlayer.Register(new EnemyMulliganDrawVfx(_firstDrawList, GetMulliganInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); return sequentialVfxPlayer; } @@ -36,18 +40,13 @@ public class OpponentMulliganCtrl : MulliganCtrl { parallelVfxPlayer.Register(_MulliganCardChange(abandonCards)); } - parallelVfxPlayer.Register(new DummyDeckRemoveCardVfx(isPlayer: false, 3)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); parallelVfxPlayer.Register(_mulliganView.UpdateOpponentMulliganStatusLabel(abandonCards.Count)); return parallelVfxPlayer; } - public List GetOpponentIndexList() - { - return opponentIndexList; - } - protected override VfxBase _MulliganSwap(IDictionary newList, IList oldList) { - return new EnemyMulliganSwapVfx(newList.Values.ToList(), newList.Keys.ToList(), oldList); + return NullVfx.GetInstance(); } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCardSortOutVfx.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCardSortOutVfx.cs index 4c6e42ad..d14ba10b 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCardSortOutVfx.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCardSortOutVfx.cs @@ -39,13 +39,13 @@ public class PlayerMulliganCardSortOutVfx : SequentialVfxPlayer { parallelVfxPlayer.Register(MulliganViewBase.MoveCardToMulliganZone(firstDraws[i], keepZone, i, mulliganUI, isAbandon: false)); } - if (BattleManagerBase.GetIns().IsRecovery) + if (false /* Pre-Phase-5b: IsRecovery guard collapsed headless */) { return parallelVfxPlayer; } parallelVfxPlayer.Register(InstantVfx.Create(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HAND_MOVE_RIGHT); + })); return parallelVfxPlayer; } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCtrl.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCtrl.cs index b410b182..f2b4b19b 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCtrl.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCtrl.cs @@ -3,6 +3,9 @@ using System.Collections.Generic; using Cute; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 6 of 9 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.PlayerMulliganCtrl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt namespace Wizard.Battle.Mulligan; @@ -18,8 +21,6 @@ public class PlayerMulliganCtrl : MulliganCtrl public IList AbandonList => m_AbandonList; - public bool IsSetOnCard => _isSetOnCard; - public PlayerMulliganCtrl(BattlePlayerBase player, MulliganInfoControl mulliganInfo, IPlayerView view) : base(player) { @@ -35,7 +36,7 @@ public class PlayerMulliganCtrl : MulliganCtrl _CreateMulliganCardList(indexList); DrawFirstMulliganCard(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new PlayerMulliganDrawVfx(_firstDrawList, GetMulliganInfo())); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(_playerMulliganView.SortFirstDrawsToKeepZone(_firstDrawList)); sequentialVfxPlayer.Register(InstantVfx.Create(delegate { @@ -59,7 +60,7 @@ public class PlayerMulliganCtrl : MulliganCtrl sequentialVfxPlayer.Register(_MulliganCardChange(abandonCards)); parallelVfxPlayer.Register(sequentialVfxPlayer); } - parallelVfxPlayer.Register(new DummyDeckRemoveCardVfx(isPlayer: true, 3)); + parallelVfxPlayer.Register(NullVfx.GetInstance()); return parallelVfxPlayer; } @@ -77,7 +78,7 @@ public class PlayerMulliganCtrl : MulliganCtrl { if (_firstDrawList.Contains(card) && !m_AbandonList.Contains(card)) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1); + m_AbandonList.Add(card); } } @@ -86,7 +87,7 @@ public class PlayerMulliganCtrl : MulliganCtrl { if (m_AbandonList.Contains(card)) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1); + m_AbandonList.Remove(card); } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganView.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganView.cs index 18a3ffeb..22f08c7d 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganView.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganView.cs @@ -2,6 +2,9 @@ using System; using UnityEngine; using Wizard.Battle.View; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 16 of 18 methods unrun in baseline +// Type: Wizard.Battle.Mulligan.PlayerMulliganView +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt namespace Wizard.Battle.Mulligan; @@ -32,7 +35,7 @@ public class PlayerMulliganView : MulliganViewBase public void DragCardStop(BattleCardBase card) { m_PlayerBattleView.CardMoveEffectSwitch(on: false); - GameMgr.GetIns().GetSoundMgr().StopSe(Se.TYPE.SYS_DRAG_SLIDE); + card.SetOnMove(move: false); } @@ -58,14 +61,14 @@ public class PlayerMulliganView : MulliganViewBase public void ShowCardDetail(BattleCardBase card) { - bool flag = !GameMgr.GetIns().IsWatchBattle && Mathf.Approximately(card.BattleCardView.Transform.localPosition.x, 0f); + bool flag = Mathf.Approximately(card.BattleCardView.Transform.localPosition.x, 0f); // Pre-Phase-5b: IsWatchBattle const-false m_PlayerBattleView.SetDetailScreenPosition(!flag && _IsDetailScreenRight()); m_PlayerBattleView.ShowDetailPanel(null, null, card, DetailPanelControl.ShowRequest.MULLIGAN); } private bool _IsDetailScreenRight() { - if (InputMgr.ShowDetailLeftAndRight || GameMgr.GetIns().IsWatchBattle) + if (InputMgr.ShowDetailLeftAndRight /* Pre-Phase-5b: IsWatchBattle const-false */) { return Input.mousePosition.x < (float)Screen.width / 2f; } @@ -111,15 +114,4 @@ public class PlayerMulliganView : MulliganViewBase { m_MlgUI.HideMulliganChangeUI(); } - - public void SelectEffectOn(BattleCardBase targetCard) - { - m_PlayerBattleView.DetailPanelSelectEffectOff(); - m_PlayerBattleView.DetailPanelSelectEffectOn(targetCard, DetailPanelControl.ShowRequest.MULLIGAN); - } - - public void SelectEffectOff() - { - m_PlayerBattleView.DetailPanelSelectEffectOff(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/SingleMulliganMgr.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/SingleMulliganMgr.cs index 91d9981c..21ddcd01 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/SingleMulliganMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/SingleMulliganMgr.cs @@ -12,7 +12,7 @@ public class SingleMulliganMgr : MulliganMgrBase ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(base.Submit(battleManager)); - if (GameMgr.GetIns().IsAINetwork && !battleManager.IsRecovery) + if (battleManager.GameMgr.IsAINetwork && !battleManager.IsRecovery) { sequentialVfxPlayer.Register(parallelVfxPlayer); return sequentialVfxPlayer; @@ -24,19 +24,13 @@ public class SingleMulliganMgr : MulliganMgrBase return sequentialVfxPlayer; } - public override VfxBase InitMulligan(MulliganInfoControl mulliganInfo, IPlayerView view) + public override VfxBase InitMulligan(BattleManagerBase mgr, MulliganInfoControl mulliganInfo, IPlayerView view) { - VfxBase result = base.InitMulligan(mulliganInfo, view); - if (GameMgr.GetIns().IsAINetwork && !BattleManagerBase.GetIns().IsRecovery) - { - ((AINetworkBattleManager)BattleManagerBase.GetIns()).SetupMulliganLaunchCompleteEvent(); - } - return result; + return base.InitMulligan(mgr, mulliganInfo, view); } - public void AIMulliganEndAction() + public void AIMulliganEndAction(BattleManagerBase ins) { - BattleManagerBase ins = BattleManagerBase.GetIns(); ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); parallelVfxPlayer.Register(PlayerChangeCardVfx(ins)); diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/OperationSimulator.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/OperationSimulator.cs index fa7c4178..8f53f409 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/OperationSimulator.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/OperationSimulator.cs @@ -6,29 +6,12 @@ namespace Wizard.Battle.Operation; public static class OperationSimulator { - public static BattlePlayerPair Attack(BattlePlayerPair sourcePair, IBattleCardUniqueID attackCardId, IBattleCardUniqueID targetCardId, bool isPrediction = false, Action OnVirtualPairCloned = null) - { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; - BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); - OnVirtualPairCloned?.Call(battlePlayerPair); - if (isPrediction) - { - Prediction.ChangeFilters(battlePlayerPair); - } - Prediction.CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); - new ActionProcessor(battlePlayerPair).Attack(attackCardId, targetCardId); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; - return battlePlayerPair; - } public static BattlePlayerPair Play(BattlePlayerPair sourcePair, IBattleCardUniqueID playCardId, List skillTargets, Action OnVirtualPairCloned = null, Action playCardSkillEvent = null) { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; + sourcePair.Self.BattleMgr.InstanceIsForecast = true; + bool isRecovery = sourcePair.Self.BattleMgr.IsRecovery; + sourcePair.Self.BattleMgr.IsRecovery = true; BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); OnVirtualPairCloned?.Call(battlePlayerPair); Prediction.CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); @@ -39,8 +22,8 @@ public static class OperationSimulator battlePlayerPair.Self.SetupActionProcessorEvent(actionProcessor); battlePlayerPair.Opponent.SetupActionProcessorEvent(actionProcessor); actionProcessor.PlayCard(battleCardBase, first); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; + sourcePair.Self.BattleMgr.IsRecovery = isRecovery; + sourcePair.Self.BattleMgr.InstanceIsForecast = false; return battlePlayerPair; } @@ -74,17 +57,17 @@ public static class OperationSimulator public static BattlePlayerPair Evolve(BattlePlayerPair sourcePair, IBattleCardUniqueID evolutionCardId, List skillTargets, Action OnVirtualPairCloned = null) { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; + sourcePair.Self.BattleMgr.InstanceIsForecast = true; + bool isRecovery = sourcePair.Self.BattleMgr.IsRecovery; + sourcePair.Self.BattleMgr.IsRecovery = true; BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); OnVirtualPairCloned?.Call(battlePlayerPair); Prediction.CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); BattleCardBase[] first = Evolve_GetTargetsAndChoice(battlePlayerPair, skillTargets).first; BattleCardBase card = battlePlayerPair.Self.ClassAndInPlayCardList.FindFromCardId(evolutionCardId); new ActionProcessor(battlePlayerPair).Evolution(card, first); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; + sourcePair.Self.BattleMgr.IsRecovery = isRecovery; + sourcePair.Self.BattleMgr.InstanceIsForecast = false; return battlePlayerPair; } @@ -140,24 +123,11 @@ public static class OperationSimulator return null; } - public static BattlePlayerPair TurnEnd(BattlePlayerPair sourcePair) - { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; - BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); - Prediction.CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); - battlePlayerPair.Self.GetTurnEndSkillProcess().Process(battlePlayerPair); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; - return battlePlayerPair; - } - public static BattlePlayerPair TurnStart(BattlePlayerPair sourcePair) { - BattleManagerBase.IsForecast = true; - bool isRecovery = BattleManagerBase.GetIns().IsRecovery; - BattleManagerBase.GetIns().IsRecovery = true; + sourcePair.Self.BattleMgr.InstanceIsForecast = true; + bool isRecovery = sourcePair.Self.BattleMgr.IsRecovery; + sourcePair.Self.BattleMgr.IsRecovery = true; BattlePlayerPair battlePlayerPair = sourcePair.VirtualClone(CloneActualFlags.All); Prediction.CloneSkillsPreprocessAndBuffInfo(sourcePair, battlePlayerPair); battlePlayerPair.Self.IsSelfTurn = true; @@ -172,8 +142,8 @@ public static class OperationSimulator inPlayCard2.OpponentTurnStart(skillProcessor); } skillProcessor.Process(battlePlayerPair); - BattleManagerBase.GetIns().IsRecovery = isRecovery; - BattleManagerBase.IsForecast = false; + sourcePair.Self.BattleMgr.IsRecovery = isRecovery; + sourcePair.Self.BattleMgr.InstanceIsForecast = false; return battlePlayerPair; } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulateSkillCreator.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulateSkillCreator.cs index d424d98d..80d1c5e5 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulateSkillCreator.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulateSkillCreator.cs @@ -1,5 +1,9 @@ using Wizard.Battle.Card; using Wizard.Battle.Resource; +// TODO(engine-cleanup-pass2): 2 of 3 methods unrun in baseline +// Type: Wizard.Battle.Operation.SimulateSkillCreator +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Operation; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulationSelection.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulationSelection.cs index 467d1932..14b16098 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulationSelection.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SimulationSelection.cs @@ -2,7 +2,6 @@ namespace Wizard.Battle.Operation; public enum SimulationSelection { - Random, All, None } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SkillOperationCommandBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SkillOperationCommandBase.cs index dc975f55..75c85bff 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SkillOperationCommandBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Operation/SkillOperationCommandBase.cs @@ -58,7 +58,7 @@ public abstract class SkillOperationCommandBase : IOperationCommand protected VfxWith> GetSkillSelectedCardsWithVfx(BattleCardBase card, bool isEvolution, Func func = null) { - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = card.GetBuildInfo.BattleMgr; // Pre-Phase-5b: mgr via card's build info List list = card.GetSelectTypeSkill(isEvolution).ToList(); SkillCollectionBase source = (isEvolution ? card.EvolutionSkills : card.NormalSkills); VfxBase vfx = NullVfx.GetInstance(); diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/LoadingPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/LoadingPhase.cs index 9d9238a8..4241ea84 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/LoadingPhase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/LoadingPhase.cs @@ -1,4 +1,8 @@ using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 2 of 4 methods unrun in baseline +// Type: Wizard.Battle.Phase.LoadingPhase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Phase; @@ -23,7 +27,7 @@ public class LoadingPhase : IPhase public virtual VfxBase Teardown() { - return new BattleLoadingEndVfx(_battleMgr); + return NullVfx.GetInstance(); } public virtual void Pause() diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MainPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MainPhase.cs index a803c322..3ac9e5ae 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MainPhase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MainPhase.cs @@ -1,169 +1,172 @@ -using System; -using UnityEngine; -using Wizard.Battle.Resource; -using Wizard.Battle.Touch; -using Wizard.Battle.UI; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Phase; - -public class MainPhase : IPhase -{ - protected readonly BattleManagerBase _battleManager; - - protected readonly BattlePlayer _battlePlayer; - - protected readonly BattleEnemy _battleEnemy; - - private readonly TouchControl _touchControl; - - protected readonly GameObject _menuButton; - - private readonly IBattleResourceMgr _battleResourceMgr; - - private readonly BattleLogManager _battleLogManager; - - private readonly GameObject _battery; - - protected bool _enableTouch; - - private CanNotTouchCardVfx _canNotTouchCardVfx; - - private readonly Func _getOperateMgr; - - private OperateMgr OperateMgr => _getOperateMgr(); - - public MainPhase(BattleManagerBase battleManager, BattleLogManager logManager) - { - _battleManager = battleManager; - _battlePlayer = battleManager.BattlePlayer; - _battleEnemy = battleManager.BattleEnemy; - _touchControl = battleManager.TouchControl; - _menuButton = battleManager.MenuButtonObject; - _getOperateMgr = () => battleManager.OperateMgr; - _battleResourceMgr = battleManager.BattleResourceMgr; - _battleLogManager = logManager; - _battery = battleManager.BattleUIContainer.Battery; - } - - public virtual VfxBase Setup() - { - ParallelVfxPlayer parallelVfxPlayer = CreateUpdateBattlePlayersVfx(); - parallelVfxPlayer.Register(InstantVfx.Create(delegate - { - if (!_battleManager.IsBattleEnd) - { - if (_menuButton != null) - { - _menuButton.SetActive(value: true); - } - _battleLogManager.SetActiveShowButton(isActive: true); - } - })); - return SequentialVfxPlayer.Create(parallelVfxPlayer, InstantVfx.Create(delegate - { - _enableTouch = true; - })); - } - - public VfxWith Update(float dt) - { - if (_enableTouch) - { - return new VfxWith(_touchControl.Update(dt), null); - } - return new VfxWith(NullVfx.GetInstance(), null); - } - - public virtual VfxBase Teardown() - { - _battleManager.VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); - _menuButton.SetActive(value: false); - _battlePlayer.PlayerBattleView.HideTurnEndButton(); - _battleLogManager.HideLog(); - _battleLogManager.SetActiveShowButton(isActive: false); - OperateMgr.AllClearBattleView(); - _enableTouch = false; - _battlePlayer.ClassInformationUIController.HideInfomation(); - _battleEnemy.ClassInformationUIController.HideInfomation(); - _battery.SetActive(value: false); - _battlePlayer.StatusPanelControl.HideStatusPanelAlways(); - _battleEnemy.StatusPanelControl.HideStatusPanelAlways(); - if (_battleManager is NewReplayBattleMgr) - { - (_battleManager as NewReplayBattleMgr).SetActiveMoveTurnButton(isActive: false); - } - _battleManager.FinishBattle(); - return ParallelVfxPlayer.Create(new ThinkIconHideVfx(_battleResourceMgr), new EmotionHideMessageVfx(_battleResourceMgr), (_touchControl._touchProcessor == null) ? NullVfx.GetInstance() : _touchControl._touchProcessor.End().Vfx, InstantVfx.Create(delegate - { - if (UIManager.GetInstance().NowOpenDialog != null) - { - UIManager.GetInstance().NowOpenDialog.Close(); - } - }), InstantVfx.Create(_battlePlayer.PlayerEmotion.CancelShowButtons), _battlePlayer.PlayerEmotion.HideButtons()); - } - - public void Pause() - { - bool isSelecting = _battlePlayer.PlayerBattleView.IsSelecting; - if (isSelecting) - { - _battlePlayer.BattleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - SetTouchable(enable: false); - })); - } - _battlePlayer.PlayerBattleView.DragArrowStop(BattleManagerBase.GetIns()); - _battlePlayer.PlayerBattleView.ReleaseLockOnTarget(); - BattleCardBase hitCard = _touchControl._hitCard; - if (hitCard != null && hitCard.IsOnMove) - { - _touchControl.StopMovingHandCard(hitCard); - } - ResetInput(); - if (isSelecting) - { - _battlePlayer.BattleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - SetTouchable(enable: true); - })); - } - } - - protected virtual void ResetInput() - { - _touchControl.Exit(); - _battlePlayer.BattleMgr.VfxMgr.RegisterSequentialVfx(_touchControl.ForceEndTouchProcessor()); - if (_battlePlayer.IsSelfTurn && !_battlePlayer.PlayerBattleView.IsEvolutionVfx) - { - _battlePlayer.PlayerBattleView.TurnEndButtonUI.ShowBtn(_battlePlayer.PlayerBattleView.CanPlayerEndTurnImmediately); - } - } - - protected ParallelVfxPlayer CreateUpdateBattlePlayersVfx() - { - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - parallelVfxPlayer.Register(ParallelVfxPlayer.Create(_battlePlayer.CreateUpdateDeckCountLabelVfx(), _battleEnemy.CreateUpdateDeckCountLabelVfx())); - parallelVfxPlayer.Register(_battlePlayer.StartBattleMainView()); - parallelVfxPlayer.Register(_battleEnemy.StartBattleMainView()); - return parallelVfxPlayer; - } - - protected virtual void SetTouchable(bool enable) - { - if (enable && _canNotTouchCardVfx == null) - { - bool isUpdateHandCardsPlayability = true; - if (GameMgr.GetIns().IsWatchBattle) - { - isUpdateHandCardsPlayability = !(BattleManagerBase.GetIns() as NetworkBattleManagerBase).IsSkillSelectTiming; - } - _canNotTouchCardVfx = new CanNotTouchCardVfx(isUpdateHandCardsPlayability); - } - else if (_canNotTouchCardVfx != null) - { - _canNotTouchCardVfx.End(); - _canNotTouchCardVfx = null; - } - } -} +using System; +using UnityEngine; +using Wizard.Battle.Resource; +using Wizard.Battle.Touch; +using Wizard.Battle.UI; +using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 9 of 12 methods unrun in baseline +// Type: Wizard.Battle.Phase.MainPhase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + + +namespace Wizard.Battle.Phase; + +public class MainPhase : IPhase +{ + protected readonly BattleManagerBase _battleManager; + + protected readonly BattlePlayer _battlePlayer; + + protected readonly BattleEnemy _battleEnemy; + + private readonly TouchControl _touchControl; + + protected readonly GameObject _menuButton; + + private readonly IBattleResourceMgr _battleResourceMgr; + + private readonly BattleLogManager _battleLogManager; + + private readonly GameObject _battery; + + protected bool _enableTouch; + + private VfxBase _canNotTouchCardVfx; + + private readonly Func _getOperateMgr; + + private OperateMgr OperateMgr => _getOperateMgr(); + + public MainPhase(BattleManagerBase battleManager, BattleLogManager logManager) + { + _battleManager = battleManager; + _battlePlayer = battleManager.BattlePlayer; + _battleEnemy = battleManager.BattleEnemy; + _touchControl = battleManager.TouchControl; + _menuButton = battleManager.MenuButtonObject; + _getOperateMgr = () => battleManager.OperateMgr; + _battleResourceMgr = battleManager.BattleResourceMgr; + _battleLogManager = logManager; + _battery = battleManager.BattleUIContainer.Battery; + } + + public virtual VfxBase Setup() + { + ParallelVfxPlayer parallelVfxPlayer = CreateUpdateBattlePlayersVfx(); + parallelVfxPlayer.Register(InstantVfx.Create(delegate + { + if (!_battleManager.IsBattleEnd) + { + if (_menuButton != null) + { + _menuButton.SetActive(value: true); + } + _battleLogManager.SetActiveShowButton(isActive: true); + } + })); + return SequentialVfxPlayer.Create(parallelVfxPlayer, InstantVfx.Create(delegate + { + _enableTouch = true; + })); + } + + public VfxWith Update(float dt) + { + if (_enableTouch) + { + return new VfxWith(_touchControl.Update(dt), null); + } + return new VfxWith(NullVfx.GetInstance(), null); + } + + public virtual VfxBase Teardown() + { + _battleManager.VfxMgr.RegisterImmediateVfx(NullVfx.GetInstance()); + _menuButton.SetActive(value: false); + _battlePlayer.PlayerBattleView.HideTurnEndButton(); + _battleLogManager.HideLog(); + _battleLogManager.SetActiveShowButton(isActive: false); + OperateMgr.AllClearBattleView(); + _enableTouch = false; + _battlePlayer.ClassInformationUIController.HideInfomation(); + _battleEnemy.ClassInformationUIController.HideInfomation(); + _battery.SetActive(value: false); + _battlePlayer.StatusPanelControl.HideStatusPanelAlways(); + _battleEnemy.StatusPanelControl.HideStatusPanelAlways(); + if (_battleManager is NewReplayBattleMgr) + { + (_battleManager as NewReplayBattleMgr).SetActiveMoveTurnButton(isActive: false); + } + _battleManager.FinishBattle(); + return ParallelVfxPlayer.Create(NullVfx.GetInstance(), NullVfx.GetInstance(), (_touchControl._touchProcessor == null) ? NullVfx.GetInstance() : _touchControl._touchProcessor.End().Vfx, InstantVfx.Create(delegate + { + if (UIManager.GetInstance().NowOpenDialog != null) + { + UIManager.GetInstance().NowOpenDialog.Close(); + } + }), InstantVfx.Create(_battlePlayer.PlayerEmotion.CancelShowButtons), _battlePlayer.PlayerEmotion.HideButtons()); + } + + public void Pause() + { + bool isSelecting = _battlePlayer.PlayerBattleView.IsSelecting; + if (isSelecting) + { + _battlePlayer.BattleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate + { + SetTouchable(enable: false); + })); + } + _battlePlayer.PlayerBattleView.DragArrowStop(_battleManager); + _battlePlayer.PlayerBattleView.ReleaseLockOnTarget(); + BattleCardBase hitCard = _touchControl._hitCard; + if (hitCard != null && hitCard.IsOnMove) + { + _touchControl.StopMovingHandCard(hitCard); + } + ResetInput(); + if (isSelecting) + { + _battlePlayer.BattleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate + { + SetTouchable(enable: true); + })); + } + } + + protected virtual void ResetInput() + { + _touchControl.Exit(); + _battlePlayer.BattleMgr.VfxMgr.RegisterSequentialVfx(_touchControl.ForceEndTouchProcessor()); + if (_battlePlayer.IsSelfTurn && !_battlePlayer.PlayerBattleView.IsEvolutionVfx) + { + _battlePlayer.PlayerBattleView.TurnEndButtonUI.ShowBtn(_battlePlayer.PlayerBattleView.CanPlayerEndTurnImmediately); + } + } + + protected ParallelVfxPlayer CreateUpdateBattlePlayersVfx() + { + ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); + parallelVfxPlayer.Register(ParallelVfxPlayer.Create(_battlePlayer.CreateUpdateDeckCountLabelVfx(), _battleEnemy.CreateUpdateDeckCountLabelVfx())); + parallelVfxPlayer.Register(_battlePlayer.StartBattleMainView()); + parallelVfxPlayer.Register(_battleEnemy.StartBattleMainView()); + return parallelVfxPlayer; + } + + protected virtual void SetTouchable(bool enable) + { + if (enable && _canNotTouchCardVfx == null) + { + bool isUpdateHandCardsPlayability = true; + if (_battleManager.GameMgr.IsWatchBattle) + { + isUpdateHandCardsPlayability = !(_battleManager as NetworkBattleManagerBase).IsSkillSelectTiming; + } + _canNotTouchCardVfx = NullVfx.GetInstance(); + } + else if (_canNotTouchCardVfx != null) + { + _canNotTouchCardVfx = null; + } + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MulliganPhaseBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MulliganPhaseBase.cs index e4f2b937..d46f93b2 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MulliganPhaseBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/MulliganPhaseBase.cs @@ -2,6 +2,10 @@ using System; using System.Collections.Generic; using Wizard.Battle.Mulligan; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 9 of 12 methods unrun in baseline +// Type: Wizard.Battle.Phase.MulliganPhaseBase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Phase; @@ -15,8 +19,6 @@ public class MulliganPhaseBase : IPhase private bool _enableTouch; - private const float MULLIGAN_LOG_WAIT_TIME = 20f; - protected MulliganPhaseBase(BattleManagerBase battleMgr) { _battleMgr = battleMgr; @@ -26,8 +28,8 @@ public class MulliganPhaseBase : IPhase { _mulliganMgr = mulliganMgr; _battleMgr.MulliganMgr = _mulliganMgr; - MulliganInfoControl component = NGUITools.AddChild(_battleMgr.Battle3DContainer, GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/MulliganInfo")).GetComponent(); - _mulliganMgr.InitMulligan(component, _battleMgr.BattlePlayer.PlayerBattleView); + MulliganInfoControl component = NGUITools.AddChild(_battleMgr.Battle3DContainer, _battleMgr.GameMgr.GetPrefabMgr().Get("Prefab/UI/MulliganInfo")).GetComponent(); + _mulliganMgr.InitMulligan(_battleMgr, component, _battleMgr.BattlePlayer.PlayerBattleView); _mulliganOperateCtrl = CreateMulliganOperateControl(); } @@ -79,10 +81,10 @@ public class MulliganPhaseBase : IPhase _battleMgr.OnSubmitMulligan -= SubmitMulligan; MulliganInfoControl mulliganInfo = _mulliganMgr.GetMulliganInfo(); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(new MulliganEndVfx(mulliganInfo, _battleMgr.BattlePlayer, _battleMgr.BattleEnemy)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(mulliganInfo.SetPlayerReady()); sequentialVfxPlayer.Register(InstantVfx.Create(mulliganInfo.HideTopPanels)); - sequentialVfxPlayer.Register(new PlayerAndEnemyReadyVfx(_battleMgr.BattlePlayer, _battleMgr.BattleEnemy)); + sequentialVfxPlayer.Register(NullVfx.GetInstance()); sequentialVfxPlayer.Register(mulliganInfo.DestroyMulliganUIVfx()); sequentialVfxPlayer.Register(InstantVfx.Create(delegate { diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkBattlePhaseCreator.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkBattlePhaseCreator.cs deleted file mode 100644 index b56407c1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkBattlePhaseCreator.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Wizard.Battle.Phase; - -public class NetworkBattlePhaseCreator : PhaseCreatorBase -{ - protected readonly NetworkBattleManagerBase _networkBattleManager; - - public NetworkBattlePhaseCreator(NetworkBattleManagerBase battleMgr) - : base(battleMgr) - { - _networkBattleManager = battleMgr; - } - - public override IPhase CreateMulliganPhase() - { - return new NetworkMulliganPhase(_networkBattleManager, _networkBattleManager.NetworkSender); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkMulliganPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkMulliganPhase.cs index 564a59cf..3a459fad 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkMulliganPhase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/NetworkMulliganPhase.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; using Cute; using Wizard.Battle.Mulligan; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 6 of 11 methods unrun in baseline +// Type: Wizard.Battle.Phase.NetworkMulliganPhase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Phase; @@ -22,7 +26,7 @@ public class NetworkMulliganPhase : MulliganPhaseBase : base(battleMgr) { _networkBattleMgr = battleMgr; - if (GameMgr.GetIns().IsAINetwork) + if (_networkBattleMgr.GameMgr.IsAINetwork) { _singleMulliganMgr = new SingleMulliganMgr(); } @@ -31,7 +35,7 @@ public class NetworkMulliganPhase : MulliganPhaseBase _networkMulliganMgr = new NetworkMulliganMgr(sender); } IMulliganMgr mulliganMgr; - if (!GameMgr.GetIns().IsAINetwork) + if (!_networkBattleMgr.GameMgr.IsAINetwork) { IMulliganMgr networkMulliganMgr = _networkMulliganMgr; mulliganMgr = networkMulliganMgr; @@ -60,12 +64,12 @@ public class NetworkMulliganPhase : MulliganPhaseBase IMulliganMgr mulliganMgr = _mulliganMgr; mulliganMgr.OnSubmit = (Action)Delegate.Combine(mulliganMgr.OnSubmit, (Action)delegate { - if (GameMgr.GetIns().IsAINetwork) + if (_networkBattleMgr.GameMgr.IsAINetwork) { SingleMulliganMgr singleMulligan = _mulliganMgr as SingleMulliganMgr; OnNetworkAlive = (Action)Delegate.Combine(OnNetworkAlive, (Action)delegate { - singleMulligan.AIMulliganEndAction(); + singleMulligan.AIMulliganEndAction(_networkBattleMgr); OnNetworkAlive = null; }); } @@ -74,7 +78,7 @@ public class NetworkMulliganPhase : MulliganPhaseBase public override VfxWith Update(float dt) { - if (GameMgr.GetIns().IsAINetwork && ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive) + if (_networkBattleMgr.GameMgr.IsAINetwork && _networkBattleMgr.InstanceNetworkAgent != null && _networkBattleMgr.InstanceNetworkAgent.PlayerNetworkStatus.IsAlive) { OnNetworkAlive.Call(); } @@ -83,7 +87,7 @@ public class NetworkMulliganPhase : MulliganPhaseBase public void MulliganEventSetting() { - if (!GameMgr.GetIns().IsAINetwork) + if (!_networkBattleMgr.GameMgr.IsAINetwork) { OperateReceive operateReceive = _networkBattleMgr.OperateReceive; operateReceive.OnEndMulligan = (Func)Delegate.Combine(operateReceive.OnEndMulligan, new Func(EndMulligan)); @@ -99,7 +103,7 @@ public class NetworkMulliganPhase : MulliganPhaseBase public override VfxBase Teardown() { VfxBase result = base.Teardown(); - if (GameMgr.GetIns().IsAINetwork) + if (_networkBattleMgr.GameMgr.IsAINetwork) { return result; } @@ -119,13 +123,13 @@ public class NetworkMulliganPhase : MulliganPhaseBase LocalLog.AccumulateLastTraceLog("EndMulligan"); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); sequentialVfxPlayer.Register(this.OnEndMulligan.GetAllFuncVfxResults()); - sequentialVfxPlayer.Register(GameMgr.GetIns().IsAINetwork ? _singleMulliganMgr.CompleteMulligan(_networkBattleMgr) : _networkMulliganMgr.CompleteMulligan(_networkBattleMgr)); + sequentialVfxPlayer.Register(_networkBattleMgr.GameMgr.IsAINetwork ? _singleMulliganMgr.CompleteMulligan(_networkBattleMgr) : _networkMulliganMgr.CompleteMulligan(_networkBattleMgr)); return sequentialVfxPlayer; } protected virtual VfxBase ReceivePlayerMulligan(List mulliganAfterCardIndexes) { - if (GameMgr.GetIns().IsAINetwork) + if (_networkBattleMgr.GameMgr.IsAINetwork) { return NullVfx.GetInstance(); } @@ -136,7 +140,7 @@ public class NetworkMulliganPhase : MulliganPhaseBase protected VfxBase ReceiveOpponentMulligan(List mulliganAfterCardIndexes) { LocalLog.AccumulateLastTraceLog("ReceiveOpponentMulligan"); - if (GameMgr.GetIns().IsAINetwork) + if (_networkBattleMgr.GameMgr.IsAINetwork) { return NullVfx.GetInstance(); } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/OpeningPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/OpeningPhase.cs index ccaf85b7..0561bf70 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/OpeningPhase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/OpeningPhase.cs @@ -13,7 +13,7 @@ public class OpeningPhase : IPhase public virtual VfxBase Setup() { - return new DefaultOpeningVfx(_battleMgr.BackGround); + return NullVfx.GetInstance(); } public virtual VfxWith Update(float dt) diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/PhaseCreatorBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/PhaseCreatorBase.cs index 14f84893..7e293729 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/PhaseCreatorBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/PhaseCreatorBase.cs @@ -1,4 +1,8 @@ using Wizard.Battle.UI; +// TODO(engine-cleanup-pass2): 4 of 6 methods unrun in baseline +// Type: Wizard.Battle.Phase.PhaseCreatorBase +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Phase; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryAfterMulliganPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryAfterMulliganPhase.cs deleted file mode 100644 index 047ec181..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryAfterMulliganPhase.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Wizard.Battle.Recovery; -using Wizard.Battle.UI; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Phase; - -public class RecoveryAfterMulliganPhase : IPhase -{ - private readonly IRecoveryManager _recoveryManager; - - private readonly BattleManagerBase _battleMgr; - - private readonly Func _createMainPhase; - - private readonly BattlePlayer _battlePlayer; - - private readonly BattleEnemy _battleEnemy; - - private readonly TouchControl _touchControl; - - private bool _isEndRecovery; - - public RecoveryAfterMulliganPhase(IRecoveryManager recoveryManager, BattleManagerBase battleMgr, Func createMainPhase) - { - _recoveryManager = recoveryManager; - _battleMgr = battleMgr; - _createMainPhase = createMainPhase; - _battlePlayer = battleMgr.BattlePlayer; - _battleEnemy = battleMgr.BattleEnemy; - _touchControl = battleMgr.TouchControl; - } - - public VfxBase Setup() - { - _recoveryManager.OnEndRecovery += delegate - { - _isEndRecovery = true; - }; - return _recoveryManager.Recovery(_battleMgr.BattlePlayer, _battleMgr.BattleEnemy, BattleCoroutine.GetInstance().StartCoroutine); - } - - public VfxWith Update(float dt) - { - _battleMgr.VfxMgr.Update(dt); - VfxBase vfx = _recoveryManager.UpdateRecovery(); - if (_isEndRecovery) - { - return new VfxWith(vfx, _createMainPhase()); - } - return new VfxWith(vfx, null); - } - - public VfxBase Teardown() - { - if (_recoveryManager is SingleBattleRecoveryManager) - { - ((SingleBattleRecoveryManager)_recoveryManager).CreateRecoveryFileFromTempFile(); - ((SingleBattleRecoveryRecordManager)((SingleBattleMgr)BattleManagerBase.GetIns()).ContentsCreator.RecoveryRecordManager).ClearRecoderTempFilePath(); - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - _battleMgr.BattlePlayer.PlayerBattleView.PlayQueueView.ForceClearPlayQueue(); - _battleMgr.BattleEnemy.BattleEnemyView.PlayQueueView.ForceClearPlayQueue(); - if (_battleMgr.IsBattleEnd) - { - BattleLogManager.GetInstance().SetActiveShowButton(isActive: false); - } - if (_battleMgr.BattlePlayer.Class.IsDead && _battleMgr.BattleEnemy.Class.IsDead) - { - VfxBase vfx = (_battleMgr.BattlePlayer.IsSelfTurn ? _battleMgr.DeadClass(PlayerDead: true, BattleManagerBase.FINISH_TYPE.NORMAL) : _battleMgr.DeadClass(PlayerDead: false, BattleManagerBase.FINISH_TYPE.NORMAL)); - sequentialVfxPlayer.Register(vfx); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _battleMgr.InitiateGameEndSequence(!_battleMgr.BattlePlayer.IsSelfTurn); - })); - } - else if (_battleMgr.BattlePlayer.Class.IsDead) - { - sequentialVfxPlayer.Register(_battleMgr.DeadClass(PlayerDead: true, BattleManagerBase.FINISH_TYPE.NORMAL)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _battleMgr.InitiateGameEndSequence(hasWon: false); - })); - } - else if (_battleMgr.BattleEnemy.Class.IsDead) - { - sequentialVfxPlayer.Register(_battleMgr.DeadClass(PlayerDead: false, BattleManagerBase.FINISH_TYPE.NORMAL)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _battleMgr.InitiateGameEndSequence(hasWon: true); - })); - } - if (_battlePlayer.PlayerBattleView.IsSelecting) - { - _touchControl.SelectCancelActCard(); - } - _touchControl.Exit(); - if (_battlePlayer.IsSelfTurn) - { - for (int num = 0; num < _battlePlayer.HandCardList.Count; num++) - { - _battlePlayer.HandCardList[num].BattleCardView.UpdateMovability(); - } - } - VfxBase vfxBase = (_battleEnemy.IsSelfTurn ? _battleEnemy.CreateThinkingVfx(_battleMgr) : NullVfx.GetInstance()); - VfxBase vfxBase2 = RestoreUI(_battleMgr); - return SequentialVfxPlayer.Create(InstantVfx.Create(delegate - { - _battleMgr.BackGround.PlayBgm(); - }), vfxBase2, InstantVfx.Create(delegate - { - _battleMgr.BattlePlayer.ClassInformationUIController.Recovery(); - _battleMgr.BattleEnemy.ClassInformationUIController.Recovery(); - _battleMgr.BattlePlayer.PlayerBattleView.TurnEndButtonUI.Recovery(); - _battleMgr.BattleResultControl.Recovery(); - if (!_battleMgr.IsBattleEnd) - { - IPlayerView playerBattleView = _battleMgr.BattlePlayer.PlayerBattleView; - playerBattleView.TurnEndButtonUI._isButtonForcedOff = false; - _battleMgr.BattlePlayer.TurnStartEffectEnd(); - playerBattleView.HideTurnEndPulseEffect(); - playerBattleView.ShowTurnEndButton(); - } - }), new BattleLoadingEndVfx(_battleMgr), vfxBase, sequentialVfxPlayer); - } - - public static VfxBase RestoreUI(BattleManagerBase battleMgr) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register((!battleMgr.BattlePlayer.NowTurnEvol) ? ((VfxBase)InstantVfx.Create(delegate - { - battleMgr.BattlePlayer.BattleView.EpIcon.GetComponent().spriteName = "battle_icon_evo_off"; - })) : ((VfxBase)NullVfx.GetInstance())); - sequentialVfxPlayer.Register((!battleMgr.BattleEnemy.NowTurnEvol) ? ((VfxBase)InstantVfx.Create(delegate - { - battleMgr.BattleEnemy.BattleView.EpIcon.GetComponent().spriteName = "battle_icon_evo_off"; - })) : ((VfxBase)NullVfx.GetInstance())); - sequentialVfxPlayer.Register(new DummyDeckChangeCardVfx(isPlayer: true, battleMgr.BattlePlayer.DeckCardList.Count)); - sequentialVfxPlayer.Register(new DummyDeckChangeCardVfx(isPlayer: false, battleMgr.BattleEnemy.DeckCardList.Count)); - sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(battleMgr.BattlePlayer.Class.SkillApplyInformation.AllSkillEffectRestart(), battleMgr.BattleEnemy.Class.SkillApplyInformation.AllSkillEffectRestart())); - foreach (BattleCardBase handCard in battleMgr.BattlePlayer.HandCardList) - { - sequentialVfxPlayer.Register(handCard.BattleCardView.ShowHandCardInfo(isRecovery: true)); - } - List list = battleMgr.BattlePlayer.InPlayCards.ToList(); - list.AddRange(battleMgr.BattleEnemy.InPlayCards.ToList()); - for (int num = 0; num < list.Count; num++) - { - sequentialVfxPlayer.Register(list[num].BattleCardView.InitializeBattleCardIcon(list[num], list[num].Skills)); - sequentialVfxPlayer.Register(list[num].BattleCardView.ShowBattleCardIcon()); - } - return sequentialVfxPlayer; - } - - public void Pause() - { - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkAfterSubmitMulliganPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkAfterSubmitMulliganPhase.cs deleted file mode 100644 index f2b870ad..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkAfterSubmitMulliganPhase.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Phase; - -public class RecoveryNetworkAfterSubmitMulliganPhase : RecoveryNetworkBeforeSubmitMulliganPhase -{ - public RecoveryNetworkAfterSubmitMulliganPhase(NetworkBattleManagerBase networkBattleMgr, NetworkBattleSender networkBattleSender) - : base(networkBattleMgr, networkBattleSender) - { - } - - public override VfxBase Setup() - { - base.Setup(); - return NullVfx.GetInstance(); - } - - public override VfxBase Teardown() - { - base.Teardown(); - return NullVfx.GetInstance(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBattleMainPhaseCreator.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBattleMainPhaseCreator.cs deleted file mode 100644 index f347b6fd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBattleMainPhaseCreator.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Wizard.Battle.Phase; - -public class RecoveryNetworkBattleMainPhaseCreator : NetworkBattlePhaseCreator -{ - public RecoveryNetworkBattleMainPhaseCreator(NetworkBattleManagerBase battleMgr) - : base(battleMgr) - { - } - - public override IPhase CreateMulliganPhase() - { - return new RecoveryNetworkAfterSubmitMulliganPhase(_networkBattleManager, _networkBattleManager.NetworkSender); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBattleMulliganPhaseCreator.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBattleMulliganPhaseCreator.cs deleted file mode 100644 index 4e765977..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBattleMulliganPhaseCreator.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Wizard.Battle.Phase; - -public class RecoveryNetworkBattleMulliganPhaseCreator : NetworkBattlePhaseCreator -{ - public RecoveryNetworkBattleMulliganPhaseCreator(NetworkBattleManagerBase battleMgr) - : base(battleMgr) - { - } - - public override IPhase CreateMulliganPhase() - { - return new RecoveryNetworkBeforeSubmitMulliganPhase(_networkBattleManager, _networkBattleManager.NetworkSender); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBeforeSubmitMulliganPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBeforeSubmitMulliganPhase.cs deleted file mode 100644 index 5e3ec3b7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/RecoveryNetworkBeforeSubmitMulliganPhase.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Wizard.Battle.Phase; - -public class RecoveryNetworkBeforeSubmitMulliganPhase : NetworkMulliganPhase -{ - public RecoveryNetworkBeforeSubmitMulliganPhase(NetworkBattleManagerBase networkBattleMgr, NetworkBattleSender networkBattleSender) - : base(networkBattleMgr, networkBattleSender) - { - } - - public void RecoveryEnd() - { - SetUpSubmitEvent(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/ResultPhase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/ResultPhase.cs index 4ff7eca1..44603330 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/ResultPhase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Phase/ResultPhase.cs @@ -22,7 +22,7 @@ public class ResultPhase : IResultPhase, IPhase { _battleMgr.TurnPanelControl.GameObject.SetActive(value: false); SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = _battleMgr.GameMgr.GetDataMgr(); if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest && !_battleMgr.BattleResultControl.AlreadyResultRecovery) { _battleMgr.BattleResultControl.AlreadyResultRecovery = true; @@ -36,7 +36,7 @@ public class ResultPhase : IResultPhase, IPhase { effectBattle = eb; }); - DelaySetupVfx mainVfx = new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, classCard.BattleCardView, classCard.ResourceMgr, () => classCard.BattleCardView.GameObject.transform.position, () => classCard.BattleCardView.CardWrapObject.transform.position, 0f, 0f, EffectMgr.MoveType.DIRECT, EffectMgr.TargetType.SINGLE, isPlayer: true)); + VfxBase mainVfx = NullVfx.GetInstance(); VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, mainVfx); BattleCardBase.HealParam healParam = new BattleCardBase.HealParam(dataMgr.BossRushBattleData.RecoveryPointWhenFinish, classCard, classCard); BattleCardBase.HealResult healResult = classCard.ApplyHealing(healParam, null); @@ -63,7 +63,7 @@ public class ResultPhase : IResultPhase, IPhase _battleMgr.BattlePlayer.PlayerBattleView.TurnEndButtonUI.HideAnimation(); _battleMgr.BattlePlayer.PlayerBattleView.HideChoiceBraveButton(); _battleMgr.BattleEnemy.BattleEnemyView.HideChoiceBraveButton(); - GameMgr.GetIns().GetSoundMgr().StopBGM(null, 1f); + this.OnSetupEnd.Call(); } })); diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Class3dCharacterBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Class3dCharacterBase.cs deleted file mode 100644 index 642e0cfa..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Class3dCharacterBase.cs +++ /dev/null @@ -1,532 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using UnityEngine.Experimental.Rendering; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -public class Class3dCharacterBase : ClassCharacterBase -{ - protected Material _class3DMaterial; - - private Camera _norCamera; - - private Camera _evoCamera; - - protected GameObject _root; - - protected Charactor3dInformation _charaInfo; - - private Effect3dInformation _effectInfo; - - private ClassCharaPrm.MotionType _currentMotion = ClassCharaPrm.MotionType.idle; - - protected List _idleStateHash = new List(); - - private readonly Vector3 PP_PANEL_POSITION = new Vector3(0f, -34.22f, -29.25f); - - private readonly Vector3 WIDGET_POSITION = new Vector3(0f, 490f, 30f); - - private readonly int WIDGET_OFFSET_TOP = -1162; - - private readonly int WIDGET_OFFSET_BOTTOM = 195; - - private readonly string IDLE_NAME = "Base Layer.idle"; - - protected int _classCharacterId = 3604; - - public bool IsPlayer = true; - - protected const int RENDER_QUEUE = 2999; - - protected override Vector3 MessagePosition => _initPosition + new Vector3(0f, -0.3f, 0f); - - public override VfxBase CreateLoadResouceVfx() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(LoadResouceVfx()); - return sequentialVfxPlayer; - } - - private VfxBase LoadResouceVfx() - { - return InstantVfx.Create(delegate - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - int num = (IsPlayer ? dataMgr.GetPlayerSkinId() : dataMgr.GetEnemySkinId()); - if (_classCharacterId != num) - { - _classCharacterId = num; - } - ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(_classCharacterId); - GameObject gobj = new ClassCardCreator(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(charaPrmByCharaId.path, ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true))).LoadRootObject(); - GameObject gameObject = NGUITools.AddChild(BattleManagerBase.GetIns().Battle3DContainer); - gameObject.name = "ClassCharacterRoot"; - GameObject gameObject2 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(gobj, gameObject); - SetUpAnchor(gameObject); - AttachOtherUI(gameObject); - GameObject gameObject3 = gameObject2.transform.Find("ClassObj").gameObject; - GameObject gameObject4 = gameObject2.transform.Find("Collider").gameObject; - base.GameObject = gameObject2; - base.GameObject.tag = GetTagName(); - base.GameObject.transform.localPosition = GetPosition(); - _initPosition = base.GameObject.transform.position; - gameObject3.transform.localScale = Global.CLASS_BATTLE_SCALE; - gameObject3.tag = GetTagName(); - gameObject4.tag = GetTagName(); - Transform transform = gameObject3.transform.Find("Class"); - transform.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_uma_Base", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - MotionUtils.SetLayerAll(transform.gameObject, 15); - Transform child = transform.transform.GetChild(0); - child.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_uma_Outside", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - MotionUtils.SetLayerAll(child.gameObject, 10); - RenderTextureFormat lutFormat = GetLutFormat(); - RenderTexture renderTexture = new RenderTexture(2048, 2048, 1, lutFormat); - Shader shader = Shader.Find("UI/Default"); - _class3DMaterial = new Material(shader); - _class3DMaterial.name = "ClassEvolveMaterial"; - _class3DMaterial.mainTexture = renderTexture; - Material source = new Material(Shader.Find("Custom/ModelShaderBattle")) - { - name = "ClassFlameMaterial", - mainTexture = renderTexture - }; - _root = new GameObject(); - _root.name = (IsPlayer ? "Player3DChara" : "Enemy3DChara"); - Transform transform2 = _root.transform; - transform2.localPosition = Vector3.zero; - float width = (float)Screen.width / (float)Screen.height; - _norCamera = new GameObject - { - name = "Player3DCamera" - }.AddComponent(); - _norCamera.backgroundColor = new Color(0f, 0f, 0f, 0f); - _norCamera.nearClipPlane = 1f; - _norCamera.farClipPlane = 40f; - _norCamera.fieldOfView = 33f; - _norCamera.transform.parent = transform2; - _norCamera.targetTexture = renderTexture; - _norCamera.cullingMask = 1; - _norCamera.transform.localPosition = new Vector3(0f, 0.09718f, -3.338f); - _norCamera.transform.localEulerAngles = new Vector3(2.5f, 0f, 0f); - Class3dPostImageEffect class3dPostImageEffect = null; - if (IsPlayer) - { - GameObject gameObject5 = new GameObject - { - name = "Evo3DCamera" - }; - _evoCamera = gameObject5.AddComponent(); - _evoCamera.backgroundColor = new Color(0f, 0f, 0f, 0f); - _evoCamera.nearClipPlane = 1f; - _evoCamera.farClipPlane = 40f; - _evoCamera.fieldOfView = 21f; - _evoCamera.rect = new Rect(0f, 0f, width, 1f); - _evoCamera.transform.parent = transform2; - _evoCamera.allowMSAA = false; - _evoCamera.depth = 30f; - _evoCamera.cullingMask = 1; - _evoCamera.clearFlags = CameraClearFlags.Depth; - _evoCamera.gameObject.SetActive(value: false); - _evoCamera.transform.localPosition = new Vector3(0f, 0.12f, 0f); - _evoCamera.transform.localEulerAngles = new Vector3(2.5f, 0f, 0f); - class3dPostImageEffect = gameObject5.AddComponent(); - class3dPostImageEffect.Initialize(); - } - GameObject gameObject6 = null; - gameObject6 = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(_classCharacterId.ToString(), ResourcesManager.AssetLoadPathType.ClassChara3D, isfetch: true)), transform2) as GameObject; - _effectInfo = gameObject6.GetComponent(); - _charaInfo = gameObject6.GetComponent(); - _charaInfo.InitializeMesh(this, class3dPostImageEffect); - _charaInfo.Quad.SetLayer(15, isSetChildren: true); - Transform transform3 = _charaInfo.Quad.transform; - transform3.transform.parent = transform.parent; - float y = (IsPlayer ? 0.2f : (-0.41f)); - transform3.localPosition = new Vector3(0f, y, -0.35f); - float y2 = (IsPlayer ? 5.7f : 6.1725f); - transform3.localScale = new Vector3(5.7f, y2, 1f); - Vector3 battleCameraPos = BattleManagerBase.GetIns().Camera.BattleCameraPos; - battleCameraPos.x = transform3.position.x; - transform3.LookAt(battleCameraPos); - MeshRenderer component = _charaInfo.Quad.GetComponent(); - component.sharedMaterial = new Material(source); - component.sharedMaterial.renderQueue = 2999; - CardTemplate cardTemplate = gameObject2.AddComponent(); - cardTemplate.CardWrapObjTemp = gameObject3; - cardTemplate.Collider = gameObject4.GetComponent(); - Transform transform4 = transform.transform; - transform4.localRotation = ConvertBackPanelRotation(transform4.localRotation); - GameObject gameObject7 = gameObject3.transform.Find("Shield").gameObject; - gameObject7.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - gameObject7.GetComponent().sharedMaterial = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)); - gameObject7.GetComponent().sharedMaterial.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - gameObject7.transform.localPosition = GetShieldPosition(); - gameObject7.transform.localScale = new Vector3(1.5f, 1.5f, 1f); - GameMgr.GetIns().GetEffectMgr().SetParticleShader(gameObject7); - MeshRenderer component2 = transform.GetComponent(); - MeshRenderer component3 = child.GetComponent(); - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_uma_Frame", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)) as Material; - if (material != null) - { - material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_uma_Frame", ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture, isfetch: true)); - } - CardCreatorBase.SetupClassMaterialToCenterCharacterMesh(component2, component3, new Material(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GetTextureName(), ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true))) - { - mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(((int)charaPrmByCharaId.ClassColorId).ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaEncampment, isfetch: true)) - }, material); - gameObject7.SetActive(value: true); - SBattleLoad sBattleLoad = BattleManagerBase.GetIns().SBattleLoad; - GameObject gameObject8 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_class_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), BattleManagerBase.GetIns().Battle3DContainer); - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(gameObject8, null, isBattle: true, isField: true); - gameObject8.transform.parent = gameObject3.transform; - gameObject8.transform.localPosition = new Vector3(0f, 0.1f, 0.15f); - gameObject8.transform.localRotation = GetMaskImageRotation(); - gameObject8.transform.localScale = new Vector3(6.4f, 6.4f, 20.48f); - gameObject8.SetActive(value: false); - cardTemplate.FrameEffectNormal = gameObject8; - GameObject gameObject9 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(sBattleLoad.LifePoolIcon, BattleManagerBase.GetIns().Battle3DContainer); - gameObject9.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); - gameObject9.transform.parent = gameObject7.transform; - gameObject9.transform.localPosition = GetLifeIconPosition(); - gameObject3.transform.localScale = new Vector3(80f, 80f, 25f); - gameObject4.transform.localScale = new Vector3(80f, 80f, 25f); - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(0); - (cardTemplate.LifeLabelTemp = gameObject9.transform.Find("LifeLabel").GetComponent()).text = cardParameterFromId.Life.ToString(); - SpriteRenderer spriteRenderer = new GameObject().AddComponent(); - spriteRenderer.sprite = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_uma_mask", ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - Material material2 = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_encampment_mask", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true))); - material2.SetInt("_Stencil", GetStencil()); - spriteRenderer.material = material2; - spriteRenderer.transform.parent = gameObject3.transform; - spriteRenderer.transform.localPosition = GetMaskImagePosition(); - spriteRenderer.transform.localScale = Vector3.one * 0.46f; - spriteRenderer.gameObject.SetLayer(15, isSetChildren: true); - spriteRenderer.sortingOrder = GetMaskSortingOrder(); - spriteRenderer.name = "SpineMask"; - spriteRenderer.transform.localRotation = GetMaskImageRotation(); - GameMgr.GetIns().GetPrefabMgr().Load("UI/Battle/EmotionMessage"); - _emotionLabel = NGUITools.AddChild(BattleManagerBase.GetIns().BtlUIContainer, GameMgr.GetIns().GetPrefabMgr().Get("UI/Battle/EmotionMessage")); - _emotionLabel.transform.Find("Scale").GetComponent().depth = GetEmoteLabelDepth(); - _emotionLabel.SetActive(value: false); - GameMgr.GetIns().GetPrefabMgr().Load("UI/Battle/EnvironmentMessage"); - _enviromentLabel = NGUITools.AddChild(BattleManagerBase.GetIns().BtlUIContainer, GameMgr.GetIns().GetPrefabMgr().Get("UI/Battle/EnvironmentMessage")); - _enviromentLabel.SetActive(value: false); - base.GameObject.SetActive(value: false); - }); - } - - private RenderTextureFormat GetLutFormat() - { - RenderTextureFormat renderTextureFormat = RenderTextureFormat.ARGB32; - if (!IsRenderTextureFormatSupportedForLinearFiltering(renderTextureFormat)) - { - renderTextureFormat = RenderTextureFormat.ARGB64; - if (!IsRenderTextureFormatSupportedForLinearFiltering(renderTextureFormat)) - { - renderTextureFormat = RenderTextureFormat.ARGBHalf; - } - if (!IsRenderTextureFormatSupportedForLinearFiltering(renderTextureFormat)) - { - Debug.LogError("RenderTexture not Supported."); - } - } - return renderTextureFormat; - } - - private static bool IsRenderTextureFormatSupportedForLinearFiltering(RenderTextureFormat format) - { - return SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Linear), FormatUsage.Linear); - } - - public void EnableEvolve(bool enable) - { - _charaInfo.Quad.SetActive(!enable); - _evoCamera.gameObject.SetActive(enable); - } - - public override void PlayMotion(ClassCharaPrm.MotionType motionType) - { - if (BattleManagerBase.GetIns().IsRecovery || !_isAnimation) - { - return; - } - _currentMotion = motionType; - Animator[] animators = _charaInfo.Animators; - foreach (Animator animator in animators) - { - if (_currentMotion == ClassCharaPrm.MotionType.damage || motionType == ClassCharaPrm.MotionType.damage) - { - animator.ResetTrigger(ClassCharaPrm.MotionType.idle.ToString()); - string trigger = ClassCharaPrm.MotionType.damage.ToString(); - animator.SetTrigger(trigger); - } - else if (animator.GetCurrentAnimatorStateInfo(0).IsName(IDLE_NAME)) - { - animator.ResetTrigger(ClassCharaPrm.MotionType.idle.ToString()); - animator.SetTrigger(motionType.ToString()); - _effectInfo.PlayEffect(motionType); - } - else - { - BattleCoroutine.GetInstance().StartCoroutine(WaitMotionEnd(animator, motionType)); - } - } - } - - public override void ResetMotion() - { - _currentMotion = ClassCharaPrm.MotionType.idle; - Animator[] animators = _charaInfo.Animators; - foreach (Animator obj in animators) - { - obj.ResetTrigger(ClassCharaPrm.MotionType.idle.ToString()); - obj.SetTrigger(ClassCharaPrm.MotionType.idle.ToString()); - } - } - - private IEnumerator WaitMotionEnd(Animator animator, ClassCharaPrm.MotionType motionType) - { - animator.SetTrigger(ClassCharaPrm.MotionType.idle.ToString()); - _currentMotion = ClassCharaPrm.MotionType.idle; - yield return new WaitForSeconds(0.1f); - animator.ResetTrigger(ClassCharaPrm.MotionType.idle.ToString()); - animator.SetTrigger(motionType.ToString()); - _effectInfo.PlayEffect(motionType); - } - - public override bool IsAnimationEnable() - { - return _isAnimation; - } - - protected override string GetTagName() - { - return "Enemy"; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return Quaternion.Euler(0f, -180f, 180f); - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_ENEMY; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.topAnchor.relative = 1f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - Transform target = BattleManagerBase.GetIns().Battle3DContainer.transform.Find("Camera"); - uIWidget.topAnchor.target = target; - uIWidget.bottomAnchor.target = target; - uIWidget.bottomAnchor.relative = 0.5f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattleEnemy.BattleView.EpPanel.transform.parent = o.transform; - EnemyStatusPanelControl enemyStatusPanelControl = BattleManagerBase.GetIns().BattleEnemy.StatusPanelControl as EnemyStatusPanelControl; - if ((bool)enemyStatusPanelControl) - { - enemyStatusPanelControl.ChangePPPanelParent(o.transform, PP_PANEL_POSITION); - } - } - - public override Vector3 GetSpinePosition() - { - return new Vector3(0f, -0.36f, 0.17f); - } - - public override Vector3 GetMaskImagePosition() - { - return new Vector3(0f, 0.04f, 0f); - } - - protected override Vector3 GetShieldPosition() - { - return new Vector3(1.86f, 0.48f, 0f); - } - - protected override Vector3 GetLifeIconPosition() - { - return new Vector3(0f, 0f, 0.1f); - } - - protected override string GetTextureName() - { - return "mt_Encampment_Chara_1_Rev"; - } - - public override Quaternion GetMaskImageRotation() - { - return Quaternion.Euler(new Vector3(0f, 0f, 180f)); - } - - public override Vector3 ConvertSpineScale(Vector3 originalScale) - { - return originalScale; - } - - protected int GetSpineSortingOrder() - { - return -1; - } - - protected int GetMaskSortingOrder() - { - return -1; - } - - protected override int GetEmoteLabelDepth() - { - return 0; - } - - protected override int GetCharaId() - { - return GameMgr.GetIns().GetDataMgr().GetEnemyCharaId(); - } - - public override int GetSkinId() - { - return GameMgr.GetIns().GetDataMgr().GetEnemySkinId(); - } - - public override int GetStencil() - { - return 2; - } - - public override void SetAnimationEnable(bool enable) - { - _isAnimation = enable; - if (enable) - { - PlayMotion(ClassCharaPrm.MotionType.idle); - SetAnimatorSpeed(1f); - return; - } - Animator[] animators = _charaInfo.Animators; - for (int i = 0; i < animators.Length; i++) - { - animators[i].Play(ClassCharaPrm.MotionType.idle.ToString(), -1, 0f); - } - SetAnimatorSpeed(0f); - } - - private void SetAnimatorSpeed(float speed) - { - Animator[] animators = _charaInfo.Animators; - for (int i = 0; i < animators.Length; i++) - { - animators[i].speed = speed; - } - } - - public override float GetCurrentClipTime() - { - return 0f; - } - - public override bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType) - { - return false; - } - - protected override IEnumerator WaitReturnFrame() - { - yield return null; - } - - public override void OutFrame() - { - } - - public override int GetSpineSortingOrder(bool isBack = false) - { - if (!isBack) - { - return -1; - } - return -9; - } - - public override int GetMaskSortingOrder(bool isBack = false) - { - if (!isBack) - { - return -1; - } - return -9; - } - - public override void SetTrigger(string str) - { - } - - public override IEnumerator WaitChangeFace(ClassCharaPrm.FaceType faceType) - { - yield return null; - } - - public override IEnumerator WaitMotionEnd() - { - yield return null; - } - - public override void ChangeFace(ClassCharaPrm.FaceType faceType) - { - } - - public override void ClearResourceObject() - { - if (_class3DMaterial != null) - { - Object.Destroy(_class3DMaterial); - _class3DMaterial = null; - } - if (_norCamera != null && _norCamera.targetTexture != null) - { - _norCamera.targetTexture.Release(); - _norCamera.targetTexture = null; - } - if (_effectInfo != null) - { - _effectInfo.DestroyEffect(); - _effectInfo = null; - } - if (_charaInfo != null) - { - _charaInfo.Destroy(); - _charaInfo = null; - } - if (_root != null) - { - Object.Destroy(_root); - _root = null; - } - Toolbox.ResourcesManager.RemoveAsset(Toolbox.ResourcesManager.GetAssetTypePath(_classCharacterId.ToString(), ResourcesManager.AssetLoadPathType.ClassChara3D)); - } - - public override ClassCharaPrm.MotionType GetMotion() - { - return _currentMotion; - } - - public override bool IsNoEvolveShift() - { - return false; - } - - public override bool IsOpponentReverse() - { - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/ClassCharacterBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/ClassCharacterBase.cs deleted file mode 100644 index 505fce85..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/ClassCharacterBase.cs +++ /dev/null @@ -1,202 +0,0 @@ -using System.Collections; -using UnityEngine; -using Wizard.Battle.Sound; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -public abstract class ClassCharacterBase : IClassCharacter -{ - protected const float ENEMY_ORTHO_SCALE_X = 0.934f; - - protected Vector3 _initPosition; - - private LeaderSoundManager _leaderSoundManager; - - protected bool _isAnimation; - - protected GameObject _emotionLabel; - - protected GameObject _enviromentLabel; - - protected abstract Vector3 MessagePosition { get; } - - public GameObject GameObject { get; protected set; } - - public bool IsWaiting { get; private set; } - - public bool IsRecovery { get; private set; } - - protected ClassCharacterBase() - { - _leaderSoundManager = new LeaderSoundManager(); - } - - public abstract VfxBase CreateLoadResouceVfx(); - - public abstract void ClearResourceObject(); - - public abstract void PlayMotion(ClassCharaPrm.MotionType motionType); - - public abstract void ResetMotion(); - - public abstract void SetTrigger(string str); - - public abstract IEnumerator WaitMotionEnd(); - - public abstract void ChangeFace(ClassCharaPrm.FaceType faceType); - - public abstract IEnumerator WaitChangeFace(ClassCharaPrm.FaceType faceType); - - public abstract void SetAnimationEnable(bool enable); - - public abstract bool IsAnimationEnable(); - - public VfxBase CreateLoadVoiceResource(string voiceId) - { - OpeningVfx.OpenningLogStep = "CreateLoadVoiceResource " + voiceId; - return _leaderSoundManager.CreateLoadResouceVfx(voiceId); - } - - public VfxBase PlayVoice(string voiceId, bool forcePlay = false) - { - OpeningVfx.OpenningLogStep = "PlayVoice " + voiceId; - return _leaderSoundManager.CreatePlayVfx(voiceId, forcePlay); - } - - public VfxBase PlaySkinEvolveSe(string skinId, string suffix) - { - OpeningVfx.OpenningLogStep = "PlaySe " + skinId + suffix; - return _leaderSoundManager.CreateLoadAndPlayEvolveSeVfx(skinId, suffix); - } - - public VfxBase ShowVoiceMessage(string text) - { - return InstantVfx.Create(delegate - { - if (GameMgr.GetIns().IsWatchBattle) - { - if (GameMgr.GetIns().GetDataMgr().Is3DSkin(isPlayer: true)) - { - _emotionLabel.layer = 24; - } - else - { - _emotionLabel.SetLayer(24, isSetChildren: true); - } - } - else - { - _emotionLabel.layer = 24; - } - _emotionLabel.SetActive(value: true); - _emotionLabel.transform.Find("Scale/MessageLabel").GetComponent().text = text; - _emotionLabel.transform.position = MessagePosition; - }); - } - - public VfxBase HideVoiceMessage() - { - return InstantVfx.Create(delegate - { - _emotionLabel.SetActive(value: false); - }); - } - - public VfxBase SetWaiting(bool flag) - { - IsWaiting = flag; - return UpdateEnviromentMessage(); - } - - public VfxBase SetRecovery(bool flag) - { - IsRecovery = flag; - return UpdateEnviromentMessage(); - } - - public VfxBase ResetStatusInfo() - { - IsRecovery = false; - IsWaiting = false; - return UpdateEnviromentMessage(); - } - - public VfxBase UpdateEnviromentMessage() - { - return InstantVfx.Create(delegate - { - if (_enviromentLabel != null) - { - _enviromentLabel.layer = LayerMask.NameToLayer("FrontUI"); - string text = string.Empty; - if (IsRecovery) - { - text = Data.SystemText.Get("Battle_0473"); - } - else if (IsWaiting) - { - text = Data.SystemText.Get("Battle_0445"); - } - _enviromentLabel.SetActive(text != string.Empty); - _enviromentLabel.transform.Find("Scale/MessageLabel").GetComponent().text = text; - _enviromentLabel.transform.position = MessagePosition; - } - }); - } - - public abstract void OutFrame(); - - public void IntoFrame() - { - BattleCoroutine.GetInstance().StartCoroutine(WaitReturnFrame()); - } - - protected abstract IEnumerator WaitReturnFrame(); - - public abstract float GetCurrentClipTime(); - - public abstract bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType); - - protected abstract string GetTagName(); - - protected abstract Quaternion ConvertBackPanelRotation(Quaternion originalRotation); - - protected abstract Vector3 GetPosition(); - - protected abstract void SetUpAnchor(GameObject o); - - protected abstract void AttachOtherUI(GameObject o); - - public abstract Vector3 GetSpinePosition(); - - public abstract Vector3 GetMaskImagePosition(); - - protected abstract Vector3 GetShieldPosition(); - - protected abstract Vector3 GetLifeIconPosition(); - - protected abstract string GetTextureName(); - - public abstract Quaternion GetMaskImageRotation(); - - public abstract Vector3 ConvertSpineScale(Vector3 originalScale); - - public abstract int GetSpineSortingOrder(bool isBack = false); - - public abstract int GetMaskSortingOrder(bool isBack = false); - - protected abstract int GetEmoteLabelDepth(); - - protected abstract int GetCharaId(); - - public abstract int GetSkinId(); - - public abstract int GetStencil(); - - public abstract ClassCharaPrm.MotionType GetMotion(); - - public abstract bool IsNoEvolveShift(); - - public abstract bool IsOpponentReverse(); -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Enemy3dClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Enemy3dClassCharacter.cs deleted file mode 100644 index a92c6f76..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Enemy3dClassCharacter.cs +++ /dev/null @@ -1,73 +0,0 @@ -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -public class Enemy3dClassCharacter : Class3dCharacterBase -{ - private readonly Vector3 PP_PANEL_POSITION = new Vector3(0f, -34.22f, -29.25f); - - private readonly Vector3 WIDGET_POSITION = new Vector3(0f, 490f, 30f); - - private readonly int WIDGET_OFFSET_TOP = -1162; - - private readonly int WIDGET_OFFSET_BOTTOM = 195; - - protected override Vector3 MessagePosition => _initPosition + new Vector3(0f, -0.3f, 0f); - - public Enemy3dClassCharacter(int classId) - { - _classCharacterId = classId; - IsPlayer = false; - } - - public override VfxBase CreateLoadResouceVfx() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(base.CreateLoadResouceVfx()); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _root.transform.localPosition = Vector3.left * 10f; - base.GameObject.transform.Find("Collider").gameObject.GetComponent().size = new Vector3(3.8f, 3.9f, 0.2f); - })); - return sequentialVfxPlayer; - } - - protected override string GetTagName() - { - return "Enemy"; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return Quaternion.Euler(0f, -180f, 180f); - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_ENEMY; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.topAnchor.relative = 1f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - Transform target = BattleManagerBase.GetIns().Battle3DContainer.transform.Find("Camera"); - uIWidget.topAnchor.target = target; - uIWidget.bottomAnchor.target = target; - uIWidget.bottomAnchor.relative = 0.5f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattleEnemy.BattleView.EpPanel.transform.parent = o.transform; - EnemyStatusPanelControl enemyStatusPanelControl = BattleManagerBase.GetIns().BattleEnemy.StatusPanelControl as EnemyStatusPanelControl; - if ((bool)enemyStatusPanelControl) - { - enemyStatusPanelControl.ChangePPPanelParent(o.transform, PP_PANEL_POSITION); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/EnemyHighRankSpineClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/EnemyHighRankSpineClassCharacter.cs deleted file mode 100644 index 5dd50527..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/EnemyHighRankSpineClassCharacter.cs +++ /dev/null @@ -1,143 +0,0 @@ -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -internal class EnemyHighRankSpineClassCharacter : HighRankSpineClassCharacter -{ - protected readonly Vector3 WIDGET_POSITION = new Vector3(0f, 490f, 30f); - - protected readonly int WIDGET_OFFSET_BOTTOM = 195; - - protected readonly int WIDGET_OFFSET_TOP = -1162; - - protected readonly Vector3 PP_PANEL_POSITION = new Vector3(0f, -34.22f, -29.25f); - - protected override Vector3 MessagePosition => _initPosition + new Vector3(0f, -0.3f, 0f); - - public override VfxBase CreateLoadResouceVfx() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(base.CreateLoadResouceVfx()); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.GameObject.transform.Find("Collider").gameObject.GetComponent().size = new Vector3(3.8f, 3.9f, 0.2f); - })); - return sequentialVfxPlayer; - } - - protected override string GetTagName() - { - return "Enemy"; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.topAnchor.relative = 1f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - Transform target = BattleManagerBase.GetIns().Battle3DContainer.transform.Find("Camera"); - uIWidget.topAnchor.target = target; - uIWidget.bottomAnchor.target = target; - uIWidget.bottomAnchor.relative = 0.5f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattleEnemy.BattleView.EpPanel.transform.parent = o.transform; - EnemyStatusPanelControl enemyStatusPanelControl = BattleManagerBase.GetIns().BattleEnemy.StatusPanelControl as EnemyStatusPanelControl; - if ((bool)enemyStatusPanelControl) - { - enemyStatusPanelControl.ChangePPPanelParent(o.transform, PP_PANEL_POSITION); - } - } - - public override Vector3 GetSpinePosition() - { - return new Vector3(0f, -0.36f, -0.27f); - } - - protected override string GetTextureName() - { - return "mt_Encampment_Chara_1_Rev"; - } - - public override Vector3 GetMaskImagePosition() - { - return new Vector3(0f, 0.04f, 0f); - } - - protected override Vector3 GetShieldPosition() - { - return new Vector3(1.86f, 0.4f, 0f); - } - - protected override Vector3 GetLifeIconPosition() - { - return new Vector3(0f, 0f, 0.1f); - } - - public override Quaternion GetMaskImageRotation() - { - return Quaternion.Euler(new Vector3(0f, 0f, 180f)); - } - - public override Vector3 ConvertSpineScale(Vector3 originalScale) - { - if (GameMgr.GetIns().GetDataMgr().GetEnemyBattleSkillReverse() == 1) - { - return new Vector3((0f - originalScale.x) * 0.934f, originalScale.y, originalScale.z) * 1.003125f; - } - return new Vector3(originalScale.x * 0.934f, originalScale.y, originalScale.z); - } - - public override int GetSpineSortingOrder(bool isBack = false) - { - if (!isBack) - { - return -1; - } - return -9; - } - - public override int GetMaskSortingOrder(bool isBack = false) - { - if (!isBack) - { - return -1; - } - return -9; - } - - protected override int GetEmoteLabelDepth() - { - return 0; - } - - protected override int GetCharaId() - { - return GameMgr.GetIns().GetDataMgr().GetEnemyCharaId(); - } - - public override int GetSkinId() - { - return GameMgr.GetIns().GetDataMgr().GetEnemySkinId(); - } - - public override int GetStencil() - { - return 2; - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_ENEMY; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return Quaternion.Euler(0f, -180f, 180f); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/EnemySpineClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/EnemySpineClassCharacter.cs deleted file mode 100644 index de865a4e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/EnemySpineClassCharacter.cs +++ /dev/null @@ -1,135 +0,0 @@ -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -internal class EnemySpineClassCharacter : SpineClassCharacter -{ - protected readonly Vector3 WIDGET_POSITION = new Vector3(0f, 490f, 30f); - - protected readonly int WIDGET_OFFSET_BOTTOM = 195; - - protected readonly int WIDGET_OFFSET_TOP = -1162; - - protected readonly Vector3 PP_PANEL_POSITION = new Vector3(0f, -34.22f, -29.25f); - - protected override Vector3 MessagePosition => _initPosition + new Vector3(0f, -0.3f, 0f); - - public override VfxBase CreateLoadResouceVfx() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(base.CreateLoadResouceVfx()); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - base.GameObject.transform.Find("Collider").gameObject.GetComponent().size = new Vector3(3.8f, 3.9f, 0.2f); - })); - return sequentialVfxPlayer; - } - - protected override string GetTagName() - { - return "Enemy"; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.topAnchor.relative = 1f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - Transform target = BattleManagerBase.GetIns().Battle3DContainer.transform.Find("Camera"); - uIWidget.topAnchor.target = target; - uIWidget.bottomAnchor.target = target; - uIWidget.bottomAnchor.relative = 0.5f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattleEnemy.BattleView.EpPanel.transform.parent = o.transform; - EnemyStatusPanelControl enemyStatusPanelControl = BattleManagerBase.GetIns().BattleEnemy.StatusPanelControl as EnemyStatusPanelControl; - if ((bool)enemyStatusPanelControl) - { - enemyStatusPanelControl.ChangePPPanelParent(o.transform, PP_PANEL_POSITION); - } - } - - public override Vector3 GetSpinePosition() - { - return new Vector3(0f, -0.36f, -0.17f); - } - - protected override string GetTextureName() - { - return "mt_Encampment_Chara_1_Rev"; - } - - public override Vector3 GetMaskImagePosition() - { - return new Vector3(0f, 0.04f, 0f); - } - - protected override Vector3 GetShieldPosition() - { - return new Vector3(1.86f, 0.4f, 0f); - } - - protected override Vector3 GetLifeIconPosition() - { - return new Vector3(0f, 0f, 0.1f); - } - - public override Quaternion GetMaskImageRotation() - { - return Quaternion.Euler(new Vector3(0f, 0f, 180f)); - } - - public override Vector3 ConvertSpineScale(Vector3 originalScale) - { - if (GameMgr.GetIns().GetDataMgr().GetEnemyBattleSkillReverse() == 1) - { - return new Vector3((0f - originalScale.x) * 0.934f, originalScale.y, originalScale.z) * 1.003125f; - } - return new Vector3(originalScale.x * 0.934f, originalScale.y, originalScale.z); - } - - public override int GetSpineSortingOrder(bool isBack = false) - { - return -1; - } - - public override int GetMaskSortingOrder(bool isBack = false) - { - return -1; - } - - protected override int GetEmoteLabelDepth() - { - return 0; - } - - protected override int GetCharaId() - { - return GameMgr.GetIns().GetDataMgr().GetEnemyCharaId(); - } - - public override int GetSkinId() - { - return GameMgr.GetIns().GetDataMgr().GetEnemySkinId(); - } - - public override int GetStencil() - { - return 2; - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_ENEMY; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return Quaternion.Euler(0f, -180f, 180f); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/HighRankSpineClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/HighRankSpineClassCharacter.cs deleted file mode 100644 index 72c55c84..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/HighRankSpineClassCharacter.cs +++ /dev/null @@ -1,447 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using Spine; -using UnityEngine; -using Wizard.Battle.Resource; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -public abstract class HighRankSpineClassCharacter : ClassCharacterBase -{ - public const string EFFECT_FILE_PATH = "Jpn/Effect/Effects/"; - - protected readonly float ScreenWidthFraction = 0.5f; - - protected readonly float ScreenHeightFraction = 0.05f; - - public SpineObject _backSpineObject; - - public SpineObject _frontSpineObject; - - private ClassCharaPrm.MotionType _currentMotion = ClassCharaPrm.MotionType.idle; - - public List EvolveEffects = new List(); - - public bool IsEvolveSkin { get; private set; } - - protected override Vector3 MessagePosition => UIManager.GetInstance().getCamera().ScreenToWorldPoint(new Vector3((float)Screen.width * ScreenWidthFraction, (float)Screen.height * ScreenHeightFraction, 0f)); - - public HighRankSpineClassCharacter() - { - } - - public static Vector3 BoneWorldToGlobalPosConsiderRotate(Bone _bone, Transform _position, Vector3 _lossyScale) - { - return _position.position + Quaternion.Euler(_position.eulerAngles) * (Vector3.Scale(new Vector3(_bone.WorldX, _bone.WorldY, 0f), _lossyScale) - Vector3.Scale(_position.localPosition, _position.lossyScale)); - } - - public IEnumerator TrackTarget(bool isFront, GameObject effect, Vector3 absolutePosition, bool _followX = true, bool _followY = true, Bone bone = null, bool trackRotation = false, Transform traskScale = null, float _coefficient = 1f) - { - GameObject spine = (isFront ? _frontSpineObject._spineObject : _backSpineObject._spineObject); - Transform transform = effect.transform; - Vector3 baseLocalScale = transform.localScale; - while (this != null && !(spine == null) && !(transform == null)) - { - if (_followX && _followY) - { - transform.position = BoneWorldToGlobalPosConsiderRotate(bone, spine.transform, spine.transform.lossyScale); - } - else if (!_followX) - { - Vector3 position = transform.position; - position.y = BoneWorldToGlobalPosConsiderRotate(bone, spine.transform, spine.transform.lossyScale).y; - transform.position = position; - } - else if (!_followY) - { - Vector3 position2 = transform.position; - position2.x = BoneWorldToGlobalPosConsiderRotate(bone, spine.transform, spine.transform.lossyScale).x; - transform.position = position2; - } - if (trackRotation && bone != null) - { - float num = (((bone.Skeleton.ScaleX < 0f) ^ (bone.Skeleton.ScaleY < 0f) ^ (spine.transform.localScale.x < 0f)) ? (-1f) : 1f); - Vector3 eulerAngles = transform.localRotation.eulerAngles; - transform.localRotation = Quaternion.Euler(eulerAngles.x, eulerAngles.y, bone.WorldRotationX * num); - } - if (traskScale != null) - { - transform.localScale = Vector3.Scale(baseLocalScale * _coefficient, traskScale.localScale); - } - yield return null; - } - } - - public static bool IsEvolveMotion(ClassCharaPrm.MotionType motionType) - { - if (motionType == ClassCharaPrm.MotionType.extra || (uint)(motionType - 15) <= 2u) - { - return true; - } - return false; - } - - public static bool IsOpponentEvolveMotion(ClassCharaPrm.MotionType motionType) - { - if ((uint)(motionType - 18) <= 2u) - { - return true; - } - return false; - } - - public override void PlayMotion(ClassCharaPrm.MotionType motionType) - { - if ((BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().IsRecovery) || (_frontSpineObject._animator == null && _backSpineObject._animator == null)) - { - return; - } - if (!_isAnimation) - { - if (!IsEvolveSkin) - { - return; - } - bool num = IsEvolveMotion(motionType); - bool flag = IsOpponentEvolveMotion(motionType); - if (num || flag) - { - _currentMotion = motionType; - if (_frontSpineObject._animator != null) - { - Animator animator = _frontSpineObject._animator; - animator.Play(ClassCharaPrm.MotionType.z_idle.ToString(), 0, animator.GetCurrentAnimatorStateInfo(0).normalizedTime); - } - if (_backSpineObject._animator != null) - { - Animator animator2 = _backSpineObject._animator; - animator2.Play(ClassCharaPrm.MotionType.z_idle.ToString(), 0, animator2.GetCurrentAnimatorStateInfo(0).normalizedTime); - } - } - else if (motionType == ClassCharaPrm.MotionType.z_idle && _currentMotion != motionType) - { - _currentMotion = motionType; - if (_frontSpineObject._animator != null) - { - _frontSpineObject._animator.Play(ClassCharaPrm.MotionType.z_idle.ToString(), 0, 0f); - } - if (_backSpineObject._animator != null) - { - _backSpineObject._animator.Play(ClassCharaPrm.MotionType.z_idle.ToString(), 0, 0f); - } - } - return; - } - _currentMotion = motionType; - bool isEvolve = IsEvolveMotion(motionType); - if (_frontSpineObject._animator != null && !isEvolve) - { - _frontSpineObject._animator.SetTrigger(motionType.ToString()); - } - if (_backSpineObject._animator != null && !isEvolve) - { - _backSpineObject._animator.SetTrigger(motionType.ToString()); - } - BattleCoroutine.GetInstance().StartCoroutine(WaitMotionEnd()); - if (isEvolve) - { - float normalizedTime = 1f / _frontSpineObject._animator.GetCurrentAnimatorClipInfo(0)[0].clip.frameRate; - if (_frontSpineObject._animator != null) - { - _frontSpineObject._animator.Play(motionType.ToString(), 0, normalizedTime); - } - if (_backSpineObject._animator != null) - { - _backSpineObject._animator.Play(motionType.ToString(), 0, normalizedTime); - } - } - if (BattleManagerBase.GetIns() == null) - { - new BattleResourceMgr(); - } - else - { - _ = BattleManagerBase.GetIns().BattleResourceMgr; - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - Transform effectTransform = ((_frontSpineObject._spineObject != null) ? _frontSpineObject._spineObject.transform : _backSpineObject._spineObject.transform); - foreach (HighRankEffectInfo effect in EvolveEffects) - { - if (!effect.IsEffectMotion(motionType) || !(effect.Prefab != "")) - { - continue; - } - Object original = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(effect.Prefab, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)); - EffectBattle effObject = (Object.Instantiate(original) as GameObject).AddComponent(); - effObject.gameObject.SetActive(value: false); - if (!isEvolve) - { - effObject.transform.SetParent(_frontSpineObject._skeletonMecanim.transform); - } - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - if (BattleManagerBase.GetIns() != null) - { - if (Global.PreLoadSkinId.Contains(GetSkinId()) && this is PlayerHighRankSpineClassCharacter) - { - sequentialVfxPlayer2.Register(InstantVfx.Create(delegate - { - GameMgr.GetIns().GetEffectMgr().SetOnlyUIParticleShader(effObject.gameObject); - })); - } - else - { - sequentialVfxPlayer2.Register(InstantVfx.Create(delegate - { - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effObject.gameObject, delegate - { - }, isBattle: true); - })); - } - } - if (effect.Delay > 0) - { - sequentialVfxPlayer2.Register(WaitVfx.Create((float)effect.Delay / 30f)); - } - sequentialVfxPlayer2.Register(new DelaySetupVfx(() => new SkinEffectVfx(() => effObject, effectTransform, effect.Layer, isEvolve))); - if (effect.TargetBoneName != "") - { - sequentialVfxPlayer2.Register(InstantVfx.Create(delegate - { - BattleCoroutine.GetInstance().StartCoroutine(TrackTarget(isFront: true, effObject.gameObject, Vector3.zero, _followX: true, _followY: true, _frontSpineObject._skeletonMecanim.Skeleton.FindBone(effect.TargetBoneName))); - })); - } - parallelVfxPlayer.Register(sequentialVfxPlayer2); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - if (BattleManagerBase.GetIns() != null) - { - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(sequentialVfxPlayer); - } - } - - public override void ResetMotion() - { - _currentMotion = ClassCharaPrm.MotionType.idle; - if (_frontSpineObject._animator != null) - { - _frontSpineObject._animator.Play(ClassCharaPrm.MotionType.idle.ToString(), 0, 0f); - } - if (_backSpineObject._animator != null) - { - _backSpineObject._animator.Play(ClassCharaPrm.MotionType.idle.ToString(), 0, 0f); - } - } - - public override ClassCharaPrm.MotionType GetMotion() - { - return _currentMotion; - } - - private void Load() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - ClassCharacterMasterData charaPrmByCharaId = dataMgr.GetCharaPrmByCharaId(GetCharaId()); - bool isPlayer = this is PlayerHighRankSpineClassCharacter; - IsEvolveSkin = dataMgr.IsEvolveSkin(isPlayer); - GameObject gobj = new ClassCardCreator(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(charaPrmByCharaId.path, ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true))).LoadRootObject(); - int skinId = GetSkinId(); - GameObject gameObject = NGUITools.AddChild(BattleManagerBase.GetIns().Battle3DContainer); - gameObject.name = "ClassCharacterRoot"; - GameObject gameObject2 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(gobj, gameObject); - SetUpAnchor(gameObject); - AttachOtherUI(gameObject); - GameObject gameObject3 = gameObject2.transform.Find("ClassObj").gameObject; - GameObject gameObject4 = gameObject2.transform.Find("Collider").gameObject; - base.GameObject = gameObject2; - base.GameObject.tag = GetTagName(); - base.GameObject.transform.localPosition = GetPosition(); - _initPosition = base.GameObject.transform.position; - gameObject3.transform.localScale = Global.CLASS_BATTLE_SCALE; - gameObject3.tag = GetTagName(); - gameObject4.tag = GetTagName(); - Transform transform = gameObject3.transform.Find("Class"); - transform.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_" + skinId + "_Base", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - MotionUtils.SetLayerAll(transform.gameObject, 15); - Transform child = transform.transform.GetChild(0); - child.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_" + skinId + "_Outside", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - MotionUtils.SetLayerAll(child.gameObject, 10); - CardTemplate cardTemplate = gameObject2.AddComponent(); - cardTemplate.CardWrapObjTemp = gameObject3; - cardTemplate.Collider = gameObject4.GetComponent(); - Transform transform2 = transform.transform; - transform2.localRotation = ConvertBackPanelRotation(transform2.localRotation); - GameObject gameObject5 = gameObject3.transform.Find("Shield").gameObject; - gameObject5.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - gameObject5.GetComponent().sharedMaterial = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)); - gameObject5.GetComponent().sharedMaterial.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - gameObject5.transform.localPosition = GetShieldPosition(); - gameObject5.transform.localScale = new Vector3(1.5f, 1.5f, 1f); - GameMgr.GetIns().GetEffectMgr().SetParticleShader(gameObject5); - MeshRenderer component = transform.GetComponent(); - MeshRenderer component2 = child.GetComponent(); - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_" + skinId + "_Frame", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)) as Material; - if (material != null) - { - material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_" + skinId + "_Frame", ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture, isfetch: true)); - } - Material material2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GetTextureName(), ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)); - material2.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(((int)charaPrmByCharaId.ClassColorId).ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaEncampment, isfetch: true)); - CardCreatorBase.SetupClassMaterialToCenterCharacterMesh(component, component2, material2, material); - gameObject5.SetActive(value: true); - SBattleLoad sBattleLoad = BattleManagerBase.GetIns().SBattleLoad; - GameObject gameObject6 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_class_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), BattleManagerBase.GetIns().Battle3DContainer); - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(gameObject6, null, isBattle: true, isField: true); - gameObject6.transform.parent = gameObject3.transform; - gameObject6.transform.localPosition = new Vector3(0f, 0.1f, 0.15f); - gameObject6.transform.localRotation = GetMaskImageRotation(); - gameObject6.transform.localScale = new Vector3(6.4f, 6.4f, 20.48f); - gameObject6.SetActive(value: false); - cardTemplate.FrameEffectNormal = gameObject6; - GameObject gameObject7 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(sBattleLoad.LifePoolIcon, BattleManagerBase.GetIns().Battle3DContainer); - gameObject7.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); - gameObject7.transform.parent = gameObject5.transform; - gameObject7.transform.localPosition = GetLifeIconPosition(); - gameObject3.transform.localScale = new Vector3(80f, 80f, 25f); - gameObject4.transform.localScale = new Vector3(80f, 80f, 25f); - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(0); - (cardTemplate.LifeLabelTemp = gameObject7.transform.Find("LifeLabel").GetComponent()).text = cardParameterFromId.Life.ToString(); - _frontSpineObject = new SpineObject(); - _frontSpineObject.LoadAndSet(skinId.ToString(), this, gameObject3.transform); - _backSpineObject = new SpineObject(); - _backSpineObject.LoadAndSet(skinId.ToString(), this, gameObject3.transform, isBack: true); - string key = "class_" + skinId; - if (Data.Master.HighRankEffect.ContainsKey(key)) - { - EvolveEffects = Data.Master.HighRankEffect[key]; - } - GameMgr.GetIns().GetPrefabMgr().Load("UI/Battle/EmotionMessage"); - _emotionLabel = NGUITools.AddChild(BattleManagerBase.GetIns().BtlUIContainer, GameMgr.GetIns().GetPrefabMgr().Get("UI/Battle/EmotionMessage")); - _emotionLabel.transform.Find("Scale").GetComponent().depth = GetEmoteLabelDepth(); - _emotionLabel.SetActive(value: false); - GameMgr.GetIns().GetPrefabMgr().Load("UI/Battle/EnvironmentMessage"); - _enviromentLabel = NGUITools.AddChild(BattleManagerBase.GetIns().BtlUIContainer, GameMgr.GetIns().GetPrefabMgr().Get("UI/Battle/EnvironmentMessage")); - _enviromentLabel.SetActive(value: false); - base.GameObject.SetActive(value: false); - } - - public override VfxBase CreateLoadResouceVfx() - { - return InstantVfx.Create(delegate - { - Load(); - }); - } - - public override void ClearResourceObject() - { - if (_frontSpineObject != null) - { - _frontSpineObject.Clear(); - } - if (_backSpineObject != null) - { - _backSpineObject.Clear(); - } - } - - protected override IEnumerator WaitReturnFrame() - { - BattleCoroutine.GetInstance().StartCoroutine(_backSpineObject.WaitReturnFrame(GetSpinePosition(), isHighRank: true)); - yield return _frontSpineObject.WaitReturnFrame(GetSpinePosition(), isHighRank: true); - } - - public override void OutFrame() - { - if (_isAnimation) - { - _frontSpineObject.OutFrame(isHighRank: true); - _backSpineObject.OutFrame(isHighRank: true); - } - } - - public override void SetTrigger(string str) - { - _frontSpineObject._animator.SetTrigger(str); - _backSpineObject._animator.SetTrigger(str); - } - - public override IEnumerator WaitChangeFace(ClassCharaPrm.FaceType faceType) - { - yield return null; - string faceStr = faceType.ToString(); - _frontSpineObject.WaitChangeFace(faceStr); - _backSpineObject.WaitChangeFace(faceStr); - } - - public override void SetAnimationEnable(bool enable) - { - bool isAnimation = _isAnimation; - _isAnimation = enable; - BattleManagerBase ins = BattleManagerBase.GetIns(); - bool isPlayer = this is PlayerHighRankSpineClassCharacter; - bool isEvolved = false; - if (ins != null) - { - isEvolved = ins.GetBattlePlayer(isPlayer).IsSkinEvolved; - } - _frontSpineObject.SetAnimationEnable(_isAnimation, isAnimation, IsEvolveSkin, isEvolved); - _backSpineObject.SetAnimationEnable(_isAnimation, isAnimation, IsEvolveSkin, isEvolved); - } - - public override bool IsAnimationEnable() - { - return _isAnimation; - } - - public override IEnumerator WaitMotionEnd() - { - yield return null; - float num = 0f; - if (_frontSpineObject._animator != null) - { - num = ((!GetCurrentClipIsName(ClassCharaPrm.MotionType.idle)) ? _frontSpineObject._animator.GetCurrentAnimatorStateInfo(0).length : (_frontSpineObject._animator.GetCurrentAnimatorStateInfo(0).length * 0.5f)); - } - num -= Time.deltaTime * 2f; - yield return new WaitForSeconds(num); - ChangeFace(ClassCharaPrm.FaceType.skin_01); - } - - public override void ChangeFace(ClassCharaPrm.FaceType faceType) - { - if (BattleManagerBase.GetIns() != null && !BattleManagerBase.GetIns().IsRecovery && _isAnimation && !(_frontSpineObject._skeletonMecanim == null)) - { - BattleCoroutine.GetInstance().StartCoroutine(WaitChangeFace(faceType)); - } - } - - public override float GetCurrentClipTime() - { - if (_frontSpineObject._animator == null) - { - return 0f; - } - return _frontSpineObject._animator.GetCurrentAnimatorStateInfo(0).length; - } - - public override bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType) - { - if (_frontSpineObject._animator == null) - { - return false; - } - return _frontSpineObject._animator.GetCurrentAnimatorStateInfo(0).IsName(motionType.ToString()); - } - - public override bool IsNoEvolveShift() - { - return false; - } - - public override bool IsOpponentReverse() - { - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Player3dClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Player3dClassCharacter.cs deleted file mode 100644 index 57dd9d78..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/Player3dClassCharacter.cs +++ /dev/null @@ -1,82 +0,0 @@ -using UnityEngine; - -namespace Wizard.Battle.Player.ClassCharacter; - -public class Player3dClassCharacter : Class3dCharacterBase -{ - private readonly float ScreenWidthFraction = 0.5f; - - private readonly float ScreenHeightFraction = 0.05f; - - private readonly Vector3 WIDGET_POSITION = new Vector3(0f, -460f, 30f); - - private readonly int WIDGET_OFFSET_BOTTOM = 71; - - private readonly int WIDGET_OFFSET_TOP = 171; - - protected override Vector3 MessagePosition => UIManager.GetInstance().getCamera().ScreenToWorldPoint(new Vector3((float)Screen.width * ScreenWidthFraction, (float)Screen.height * ScreenHeightFraction, 0f)); - - public Player3dClassCharacter(int classId) - { - _classCharacterId = classId; - IsPlayer = true; - } - - public void SetClassId(int id) - { - _classCharacterId = id; - } - - protected override string GetTagName() - { - return "Player"; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return originalRotation; - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_PLAYER; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.bottomAnchor.relative = 0f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - Transform transform = BattleManagerBase.GetIns().Battle3DContainer.transform; - uIWidget.bottomAnchor.target = transform; - uIWidget.topAnchor.target = transform; - uIWidget.topAnchor.relative = 0f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattlePlayer.BattleView.EpPanel.transform.parent = o.transform; - } - - public override Vector3 GetMaskImagePosition() - { - return new Vector3(0f, 0.12f, 0f); - } - - protected override Vector3 GetShieldPosition() - { - return new Vector3(2f, 1.7f, 0f); - } - - protected override Vector3 GetLifeIconPosition() - { - return new Vector3(0f, 0f, 0.1f); - } - - public override Quaternion GetMaskImageRotation() - { - return Quaternion.identity; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerClassCharacter.cs deleted file mode 100644 index eba80b9b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerClassCharacter.cs +++ /dev/null @@ -1,63 +0,0 @@ -namespace Wizard.Battle.Player.ClassCharacter; - -public class PlayerClassCharacter -{ - public ClassCharacterBase _class { get; protected set; } - - public PlayerClassCharacter(bool isPlayer) - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - if (isPlayer) - { - if (dataMgr.Is3DSkin(isPlayer)) - { - _class = new Player3dClassCharacter(dataMgr.GetPlayerSkinId()); - } - else if (dataMgr.IsHighRankSkinPlayer()) - { - _class = new PlayerHighRankSpineClassCharacter(); - } - else - { - _class = new PlayerSpineClassCharacter(); - } - } - else if (dataMgr.Is3DSkin(isPlayer)) - { - _class = new Enemy3dClassCharacter(dataMgr.GetEnemySkinId()); - } - else if (dataMgr.IsHighRankSkinEnemy()) - { - _class = new EnemyHighRankSpineClassCharacter(); - } - else - { - _class = new EnemySpineClassCharacter(); - } - } - - public void OutFrame() - { - _class.OutFrame(); - } - - public void IntoFrame() - { - _class.IntoFrame(); - } - - public float GetCurrentClipTime() - { - return _class.GetCurrentClipTime(); - } - - public bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType) - { - return _class.GetCurrentClipIsName(motionType); - } - - public void ClearSpineObject() - { - _class.ClearResourceObject(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerHighRankSpineClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerHighRankSpineClassCharacter.cs deleted file mode 100644 index 7d99e413..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerHighRankSpineClassCharacter.cs +++ /dev/null @@ -1,120 +0,0 @@ -using UnityEngine; - -namespace Wizard.Battle.Player.ClassCharacter; - -internal class PlayerHighRankSpineClassCharacter : HighRankSpineClassCharacter -{ - protected readonly Vector3 WIDGET_POSITION = new Vector3(0f, -460f, 30f); - - protected readonly int WIDGET_OFFSET_BOTTOM = 71; - - protected readonly int WIDGET_OFFSET_TOP = 171; - - protected readonly Vector3 PP_PANEL_POSITION = new Vector3(0f, -34.22f, -29.25f); - - protected override string GetTagName() - { - return "Player"; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.bottomAnchor.relative = 0f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - Transform transform = BattleManagerBase.GetIns().Battle3DContainer.transform; - uIWidget.bottomAnchor.target = transform; - uIWidget.topAnchor.target = transform; - uIWidget.topAnchor.relative = 0f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattlePlayer.BattleView.EpPanel.transform.parent = o.transform; - } - - public override Vector3 GetSpinePosition() - { - return new Vector3(0f, -0.02f, -0.27f); - } - - protected override string GetTextureName() - { - return "mt_Encampment_Chara_1"; - } - - public override Vector3 GetMaskImagePosition() - { - return new Vector3(0f, 0.12f, 0f); - } - - protected override Vector3 GetShieldPosition() - { - return new Vector3(2f, 1.7f, 0f); - } - - protected override Vector3 GetLifeIconPosition() - { - return new Vector3(0f, 0f, 0.1f); - } - - public override Quaternion GetMaskImageRotation() - { - return Quaternion.identity; - } - - public override Vector3 ConvertSpineScale(Vector3 originalScale) - { - return originalScale * 1.003125f; - } - - public override int GetSpineSortingOrder(bool isBack = false) - { - if (!isBack) - { - return -2; - } - return -10; - } - - public override int GetMaskSortingOrder(bool isBack = false) - { - if (!isBack) - { - return -2; - } - return -10; - } - - protected override int GetEmoteLabelDepth() - { - return 42; - } - - protected override int GetCharaId() - { - return GameMgr.GetIns().GetDataMgr().GetPlayerCharaId(); - } - - public override int GetSkinId() - { - return GameMgr.GetIns().GetDataMgr().GetPlayerSkinId(); - } - - public override int GetStencil() - { - return 3; - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_PLAYER; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return originalRotation; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerSpineClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerSpineClassCharacter.cs deleted file mode 100644 index 510092b5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/PlayerSpineClassCharacter.cs +++ /dev/null @@ -1,123 +0,0 @@ -using UnityEngine; - -namespace Wizard.Battle.Player.ClassCharacter; - -internal class PlayerSpineClassCharacter : SpineClassCharacter -{ - protected readonly Vector3 WIDGET_POSITION = new Vector3(0f, -460f, 30f); - - protected readonly int WIDGET_OFFSET_BOTTOM = 71; - - protected readonly int WIDGET_OFFSET_TOP = 171; - - protected readonly Vector3 PP_PANEL_POSITION = new Vector3(0f, -34.22f, -29.25f); - - protected override Vector3 MessagePosition => UIManager.GetInstance().getCamera().ScreenToWorldPoint(new Vector3((float)Screen.width * ScreenWidthFraction, (float)Screen.height * ScreenHeightFraction, 0f)); - - protected override string GetTagName() - { - return "Player"; - } - - protected override void SetUpAnchor(GameObject o) - { - o.transform.localPosition = WIDGET_POSITION; - UIWidget uIWidget = o.AddComponent(); - uIWidget.bottomAnchor.relative = 0f; - uIWidget.bottomAnchor.absolute = WIDGET_OFFSET_BOTTOM; - Transform transform = BattleManagerBase.GetIns().Battle3DContainer.transform; - uIWidget.bottomAnchor.target = transform; - uIWidget.topAnchor.target = transform; - uIWidget.topAnchor.relative = 0f; - uIWidget.topAnchor.absolute = WIDGET_OFFSET_TOP; - } - - protected override void AttachOtherUI(GameObject o) - { - BattleManagerBase.GetIns().BattlePlayer.BattleView.EpPanel.transform.parent = o.transform; - } - - public override void PlayMotion(ClassCharaPrm.MotionType motionType) - { - base.PlayMotion(motionType); - if (_isNoEvolveShift && motionType == ClassCharaPrm.MotionType.extra) - { - BattleCoroutine.GetInstance().StartCoroutine(WaitReturnOnAnimation()); - } - } - - public override Vector3 GetSpinePosition() - { - return new Vector3(0f, -0.02f, -0.17f); - } - - protected override string GetTextureName() - { - return "mt_Encampment_Chara_1"; - } - - public override Vector3 GetMaskImagePosition() - { - return new Vector3(0f, 0.12f, 0f); - } - - protected override Vector3 GetShieldPosition() - { - return new Vector3(2f, 1.7f, 0f); - } - - protected override Vector3 GetLifeIconPosition() - { - return new Vector3(0f, 0f, 0.1f); - } - - public override Quaternion GetMaskImageRotation() - { - return Quaternion.identity; - } - - public override Vector3 ConvertSpineScale(Vector3 originalScale) - { - return originalScale * 1.003125f; - } - - public override int GetSpineSortingOrder(bool isBack = false) - { - return -2; - } - - public override int GetMaskSortingOrder(bool isBack = false) - { - return -2; - } - - protected override int GetEmoteLabelDepth() - { - return 42; - } - - protected override int GetCharaId() - { - return GameMgr.GetIns().GetDataMgr().GetPlayerCharaId(); - } - - public override int GetSkinId() - { - return GameMgr.GetIns().GetDataMgr().GetPlayerSkinId(); - } - - public override int GetStencil() - { - return 3; - } - - protected override Vector3 GetPosition() - { - return Global.CLASS_BATTLE_POSITION_PLAYER; - } - - protected override Quaternion ConvertBackPanelRotation(Quaternion originalRotation) - { - return originalRotation; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SkinEffectVfx.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SkinEffectVfx.cs deleted file mode 100644 index 55681d43..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SkinEffectVfx.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -public class SkinEffectVfx : VfxBase, IEffectVfx -{ - private Func _getLoadedEffectObject; - - protected EffectBattle _effectObject; - - private Transform _targetTransform; - - private int _order = -1; - - private bool _isEvolve = true; - - public bool IsEffectEnd { get; private set; } - - public SkinEffectVfx(Func getLoadedEffectObject, Transform baseTransform, int order = -1, bool isEvolve = true) - { - if (BattleManagerBase.GetIns() == null || !BattleManagerBase.GetIns().IsRecovery) - { - _targetTransform = baseTransform; - _getLoadedEffectObject = getLoadedEffectObject; - _order = order; - _isEvolve = isEvolve; - } - } - - public static void SetLayerAndOrder(GameObject gameObject, int layerNo, int order, bool needSetChildren = true) - { - if (gameObject == null) - { - return; - } - gameObject.layer = layerNo; - ParticleSystemRenderer component = gameObject.GetComponent(); - if (component != null) - { - component.sortingOrder = order; - } - if (!needSetChildren) - { - return; - } - foreach (Transform item in gameObject.transform) - { - SetLayerAndOrder(item.gameObject, layerNo, order, needSetChildren); - } - } - - public override void Play() - { - if (BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().IsRecovery) - { - return; - } - base.Play(); - _effectObject = _getLoadedEffectObject(); - if (!(_effectObject == null)) - { - _effectObject.GetComponent(); - SetLayerAndOrder(_effectObject.gameObject, _isEvolve ? 13 : 15, _order); - if (!_isEvolve) - { - SetMaskSetting(_effectObject.transform); - } - _effectObject.gameObject.SetActive(value: true); - IsEffectEnd = false; - IsEnd = true; - } - } - - private void SetMaskSetting(Transform effectObject) - { - foreach (Transform item in effectObject) - { - ParticleSystemRenderer component = item.GetComponent(); - if (component != null) - { - component.maskInteraction = SpriteMaskInteraction.VisibleInsideMask; - } - SetMaskSetting(item); - } - } - - public void UpdateEffect() - { - if (_effectObject == null) - { - IsEffectEnd = true; - } - else - { - RemoveCheck(); - } - } - - public void RemoveCheck() - { - if (CheckEffectEnd(_effectObject)) - { - DestroyEffect(); - } - } - - public void DestroyEffect() - { - UnityEngine.Object.Destroy(_effectObject.gameObject); - IsEffectEnd = true; - } - - public override void Update(float dt, List effectVfxList) - { - base.Update(dt, effectVfxList); - if (IsEnd) - { - VfxMgr.CheckAndAddEffectVfxList(this, effectVfxList); - } - } - - private bool CheckEffectEnd(EffectBattle effect) - { - if (effect.AnimationObj != null) - { - if (effect.AnimationObj.isPlaying) - { - return false; - } - effect.AnimationObj.gameObject.SetActive(value: false); - } - foreach (Transform item in effect.transform) - { - ParticleSystem component = item.GetComponent(); - if (component != null && component.IsAlive()) - { - return false; - } - } - return true; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SpineClassCharacter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SpineClassCharacter.cs deleted file mode 100644 index 91df2fc7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SpineClassCharacter.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System.Collections; -using Cute; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.ClassCharacter; - -public abstract class SpineClassCharacter : ClassCharacterBase -{ - protected readonly float ScreenWidthFraction = 0.5f; - - protected readonly float ScreenHeightFraction = 0.05f; - - protected bool _isNoEvolveShift; - - protected bool _isOpponentReverse; - - private SpineObject _spine; - - private ClassCharaPrm.MotionType _currentMotion = ClassCharaPrm.MotionType.idle; - - private bool IsSnCollabSkin => Global.IsSnCollabSkin(GetCharaId()); - - public SpineClassCharacter() - { - } - - public override VfxBase CreateLoadResouceVfx() - { - return InstantVfx.Create(delegate - { - ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(GetCharaId()); - GameObject gobj = new ClassCardCreator(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(charaPrmByCharaId.path, ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true))).LoadRootObject(); - _isNoEvolveShift = charaPrmByCharaId.IsNoEvolveShift; - _isOpponentReverse = this is EnemySpineClassCharacter && charaPrmByCharaId.IsOpponentReverse; - GameObject gameObject = NGUITools.AddChild(BattleManagerBase.GetIns().Battle3DContainer); - gameObject.name = "ClassCharacterRoot"; - GameObject gameObject2 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(gobj, gameObject); - SetUpAnchor(gameObject); - AttachOtherUI(gameObject); - GameObject gameObject3 = gameObject2.transform.Find("ClassObj").gameObject; - GameObject gameObject4 = gameObject2.transform.Find("Collider").gameObject; - base.GameObject = gameObject2; - base.GameObject.tag = GetTagName(); - base.GameObject.transform.localPosition = GetPosition(); - _initPosition = base.GameObject.transform.position; - gameObject3.transform.localScale = Global.CLASS_BATTLE_SCALE; - gameObject3.tag = GetTagName(); - gameObject4.tag = GetTagName(); - Transform transform = gameObject3.transform.Find("Class"); - string path = (IsSnCollabSkin ? "md_Encampment_sn_Base" : "md_Encampment_Base"); - transform.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - MotionUtils.SetLayerAll(transform.gameObject, 15); - Transform child = transform.transform.GetChild(0); - string path2 = (IsSnCollabSkin ? "md_Encampment_sn_Outside" : "md_Encampment_outside"); - child.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - MotionUtils.SetLayerAll(child.gameObject, 10); - CardTemplate cardTemplate = gameObject2.AddComponent(); - cardTemplate.CardWrapObjTemp = gameObject3; - cardTemplate.Collider = gameObject4.GetComponent(); - Transform transform2 = transform.transform; - transform2.localRotation = ConvertBackPanelRotation(transform2.localRotation); - GameObject gameObject5 = gameObject3.transform.Find("Shield").gameObject; - gameObject5.GetComponent().sharedMesh = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("md_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMesh, isfetch: true)); - gameObject5.GetComponent().sharedMaterial = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)); - gameObject5.GetComponent().sharedMaterial.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_Encampment_Shield", ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - gameObject5.transform.localPosition = GetShieldPosition(); - gameObject5.transform.localScale = new Vector3(1.5f, 1.5f, 1f); - GameMgr.GetIns().GetEffectMgr().SetParticleShader(gameObject5); - MeshRenderer component = transform.GetComponent(); - MeshRenderer component2 = child.GetComponent(); - string path3 = (IsSnCollabSkin ? "mt_Encampment_sn_Frame" : "mt_Encampment_Frame"); - Material material = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path3, ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)) as Material; - if (material != null) - { - string path4 = (IsSnCollabSkin ? "tx_Encampment_sn_Frame" : "tx_Encampment_Frame"); - material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path4, ResourcesManager.AssetLoadPathType.ClassCharaFrameTexture, isfetch: true)); - } - Material material2 = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GetTextureName(), ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true)); - material2.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(((int)charaPrmByCharaId.ClassColorId).ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaEncampment, isfetch: true)); - CardCreatorBase.SetupClassMaterialToCenterCharacterMesh(component, component2, material2, material); - gameObject5.SetActive(value: true); - SBattleLoad sBattleLoad = BattleManagerBase.GetIns().SBattleLoad; - GameObject gameObject6 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_class_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), BattleManagerBase.GetIns().Battle3DContainer); - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(gameObject6, null, isBattle: true, isField: true); - gameObject6.transform.parent = gameObject3.transform; - gameObject6.transform.localPosition = new Vector3(0f, 0.1f, 0.15f); - gameObject6.transform.localRotation = GetMaskImageRotation(); - gameObject6.transform.localScale = new Vector3(6.4f, 6.4f, 20.48f); - gameObject6.SetActive(value: false); - cardTemplate.FrameEffectNormal = gameObject6; - GameObject gameObject7 = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(sBattleLoad.LifePoolIcon, BattleManagerBase.GetIns().Battle3DContainer); - gameObject7.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); - gameObject7.transform.parent = gameObject5.transform; - gameObject7.transform.localPosition = GetLifeIconPosition(); - gameObject3.transform.localScale = new Vector3(80f, 80f, 25f); - gameObject4.transform.localScale = new Vector3(80f, 80f, 25f); - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(0); - (cardTemplate.LifeLabelTemp = gameObject7.transform.Find("LifeLabel").GetComponent()).text = cardParameterFromId.Life.ToString(); - _spine = new SpineObject(); - _spine.LoadAndSet(GetSkinId().ToString(), this, gameObject3.transform); - GameMgr.GetIns().GetPrefabMgr().Load("UI/Battle/EmotionMessage"); - _emotionLabel = NGUITools.AddChild(BattleManagerBase.GetIns().BtlUIContainer, GameMgr.GetIns().GetPrefabMgr().Get("UI/Battle/EmotionMessage")); - _emotionLabel.transform.Find("Scale").GetComponent().depth = GetEmoteLabelDepth(); - _emotionLabel.SetActive(value: false); - GameMgr.GetIns().GetPrefabMgr().Load("UI/Battle/EnvironmentMessage"); - _enviromentLabel = NGUITools.AddChild(BattleManagerBase.GetIns().BtlUIContainer, GameMgr.GetIns().GetPrefabMgr().Get("UI/Battle/EnvironmentMessage")); - _enviromentLabel.SetActive(value: false); - base.GameObject.SetActive(value: false); - }); - } - - public override void ClearResourceObject() - { - if (_spine != null) - { - _spine.Clear(); - } - } - - public override void PlayMotion(ClassCharaPrm.MotionType motionType) - { - if (!BattleManagerBase.GetIns().IsRecovery) - { - _currentMotion = motionType; - if (_isAnimation && !(_spine._animator == null)) - { - _spine._animator.SetTrigger(motionType.ToString()); - BattleCoroutine.GetInstance().StartCoroutine(WaitMotionEnd()); - } - } - } - - public override void ResetMotion() - { - _currentMotion = ClassCharaPrm.MotionType.idle; - _spine._animator.Play(ClassCharaPrm.MotionType.idle.ToString(), 0, 0f); - _spine.WaitChangeFace(ClassCharaPrm.FaceType.skin_01.ToString()); - } - - public override void SetTrigger(string str) - { - _spine._animator.SetTrigger(str); - } - - public override ClassCharaPrm.MotionType GetMotion() - { - return _currentMotion; - } - - public override void OutFrame() - { - if (_isAnimation) - { - _spine.OutFrame(isHighRank: false); - } - } - - public override void ChangeFace(ClassCharaPrm.FaceType faceType) - { - if (BattleManagerBase.GetIns() != null && !BattleManagerBase.GetIns().IsRecovery && _isAnimation && !(_spine._skeletonMecanim == null)) - { - BattleCoroutine.GetInstance().StartCoroutine(WaitChangeFace(faceType)); - } - } - - public override IEnumerator WaitChangeFace(ClassCharaPrm.FaceType faceType) - { - yield return null; - string faceStr = faceType.ToString(); - _spine.WaitChangeFace(faceStr); - } - - public override void SetAnimationEnable(bool enable) - { - bool isAnimation = _isAnimation; - _isAnimation = enable; - _spine.SetAnimationEnable(_isAnimation, isAnimation); - } - - public override bool IsAnimationEnable() - { - return _isAnimation; - } - - public override IEnumerator WaitMotionEnd() - { - yield return null; - float num = ((!GetCurrentClipIsName(ClassCharaPrm.MotionType.idle)) ? _spine._animator.GetCurrentAnimatorStateInfo(0).length : (_spine._animator.GetCurrentAnimatorStateInfo(0).length * 0.5f)); - num -= Time.deltaTime * 2f; - yield return new WaitForSeconds(num); - ChangeFace(ClassCharaPrm.FaceType.skin_01); - } - - public IEnumerator WaitReturnOnAnimation() - { - float seconds = (float)((Toolbox.QualityManager.GetFrameRate() == 60) ? 85 : 86) / 30f; - yield return new WaitForSeconds(seconds); - _spine.SetDefaultLayer(isHighRank: false); - } - - protected override IEnumerator WaitReturnFrame() - { - yield return _spine.WaitReturnFrame(GetSpinePosition(), isHighRank: false); - } - - public override float GetCurrentClipTime() - { - if (_spine._animator == null) - { - return 0f; - } - return _spine._animator.GetCurrentAnimatorStateInfo(0).length; - } - - public override bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType) - { - if (_spine._animator == null) - { - return false; - } - return _spine._animator.GetCurrentAnimatorStateInfo(0).IsName(motionType.ToString()); - } - - public override bool IsNoEvolveShift() - { - return _isNoEvolveShift; - } - - public override bool IsOpponentReverse() - { - return _isOpponentReverse; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SpineObject.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SpineObject.cs deleted file mode 100644 index fbdfe852..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.ClassCharacter/SpineObject.cs +++ /dev/null @@ -1,379 +0,0 @@ -using System.Collections; -using System.Linq; -using Cute; -using Spine; -using Spine.Unity; -using UnityEngine; - -namespace Wizard.Battle.Player.ClassCharacter; - -public class SpineObject -{ - protected readonly string ANIMATION_TRANSFORM_NAME = "AnimationTransform"; - - public const float SPINE_CORRECTION_SCALE = 1.003125f; - - public const float SPINE_ORTHO_SCALE_Y = 1.1207f; - - protected readonly Vector3 SPINE_DEFAULT_SCALE = new Vector3(6.4f, 6.4f, 20.48f) * 1.003125f; - - protected readonly Vector3 SPINE_EVOLVE_ROTATION = new Vector3(-29f, 0f, 0f); - - protected readonly Vector3 OUT_OF_FRAME_POSITION = new Vector3(3f, 2f, -6f); - - public static readonly Vector3 BILLBOARD_ROTATE = new Vector3(-12f, 0f, 0f); - - public static readonly Vector3 BILLBOARD_ROTATE_REVERSE_VERTICAL = new Vector3(-12f, 0f, 180f); - - protected readonly Vector3 BILLBOARD_ROTATE_EVOLVE = new Vector3(-29f, 0f, 0f); - - protected readonly Vector3 SPINE_EVOLVE_SCALE = new Vector3(5.8f, 6.5f, 20.48f) * 1.003125f; - - public static readonly Vector3 OPPONENT_MECANIM_POSITION = new Vector3(0f, -0.2f, 0f); - - public GameObject _spineObject; - - protected Transform _animationTransform; - - protected SpriteRenderer _maskOutSprite; - - protected Material _spineMaterial; - - protected Material _maskMaterial; - - protected Vector3 _spineEvolveScale; - - protected ClassCharacterBase _character; - - public SkeletonMecanim _skeletonMecanim { get; private set; } - - public Animator _animator { get; private set; } - - public SpriteRenderer _maskSprite { get; protected set; } - - public bool IsBack { get; private set; } - - public bool IsNoEvolveShift { get; private set; } - - public bool IsOpponentReverse { get; private set; } - - private string MaskTextureName(string skinId) - { - if (_character is HighRankSpineClassCharacter) - { - return "tx_Encampment_" + skinId + "_mask"; - } - if (Global.IsSnCollabSkin(int.Parse(skinId))) - { - return "tx_Encampment_sn_mask"; - } - return "tx_encampment_mask"; - } - - private void SetMaterialInfo(MeshRenderer meshRenderer, int stencil) - { - _spineMaterial = Object.Instantiate(meshRenderer.material); - _spineMaterial.SetInt("_Stencil", stencil); - meshRenderer.material = _spineMaterial; - for (int i = 0; i < meshRenderer.materials.Length; i++) - { - Material material = meshRenderer.materials[i]; - if (material != null && material.GetInt("_Stencil") != stencil) - { - meshRenderer.materials[i] = Object.Instantiate(material); - meshRenderer.materials[i].SetInt("_Stencil", stencil); - } - } - } - - public void LoadAndSetTest(string skinId, ClassCharacterBase character, Transform wrapObject, bool isBack = false) - { - _spineObject = null; - _character = character; - IsBack = isBack; - IsNoEvolveShift = _character.IsNoEvolveShift(); - GameObject gameObject = Resources.Load("Jpn/Ui/ClassChar/Prefab/class_" + skinId); - if (!(gameObject != null)) - { - return; - } - _maskSprite = new GameObject().AddComponent(); - _maskSprite.sprite = Resources.Load("Jpn/Ui/ClassChar/Textures/" + MaskTextureName(skinId)); - _maskMaterial = Object.Instantiate(Resources.Load("Jpn/Ui/ClassChar/Materials/mt_encampment_mask")); - _maskMaterial.SetInt("_Stencil", character.GetStencil()); - _maskSprite.material = _maskMaterial; - _maskSprite.transform.parent = wrapObject; - _maskSprite.transform.localPosition = character.GetMaskImagePosition(); - _maskSprite.transform.localScale = Vector3.one * 0.46f; - _maskSprite.gameObject.layer = 15; - _maskSprite.sortingOrder = character.GetMaskSortingOrder(IsBack); - _maskSprite.name = "SpineMask"; - _maskSprite.transform.localRotation = character.GetMaskImageRotation(); - _maskOutSprite = new GameObject().AddComponent(); - _maskOutSprite.sprite = Resources.Load("Jpn/Ui/ClassChar/Textures/tx_encampment_mask_out"); - _maskOutSprite.material = _maskMaterial; - _maskOutSprite.transform.parent = wrapObject; - _maskOutSprite.transform.localPosition = character.GetMaskImagePosition(); - _maskOutSprite.transform.localScale = new Vector3(30f, 30f, 1f); - _maskOutSprite.gameObject.layer = 10; - _maskOutSprite.sortingOrder = character.GetMaskSortingOrder(IsBack); - _maskOutSprite.name = "SpineMaskOut"; - _maskOutSprite.gameObject.SetActive(value: false); - if (character is HighRankSpineClassCharacter) - { - GameObject gameObject2 = null; - foreach (Transform item in gameObject.transform) - { - if (item.gameObject.name == (IsBack ? "back" : "front")) - { - gameObject2 = item.gameObject; - break; - } - } - if (!(gameObject2 != null)) - { - return; - } - gameObject = gameObject2; - } - _spineObject = Object.Instantiate(gameObject); - _animationTransform = _spineObject.transform.Find(ANIMATION_TRANSFORM_NAME); - Transform transform2 = _spineObject.transform; - MotionUtils.SetLayerAll(_spineObject, 15); - transform2.parent = wrapObject; - transform2.localPosition = character.GetSpinePosition(); - transform2.localScale = character.ConvertSpineScale(transform2.localScale); - transform2.localEulerAngles = GetDefaultRotate(); - _skeletonMecanim = transform2.GetComponentInChildren(); - if (IsOpponentReverse) - { - _skeletonMecanim.transform.localPosition = OPPONENT_MECANIM_POSITION; - } - MeshRenderer component = _skeletonMecanim.GetComponent(); - component.sortingOrder = character.GetSpineSortingOrder(IsBack); - _animator = transform2.GetComponentInChildren(); - _animator.speed = 1f; - SetMaterialInfo(component, character.GetStencil()); - _spineEvolveScale = new Vector3(SPINE_DEFAULT_SCALE.x * Mathf.Abs(_animationTransform.localScale.x), SPINE_DEFAULT_SCALE.y * Mathf.Abs(_animationTransform.localScale.y) * 1.1207f, SPINE_DEFAULT_SCALE.z * Mathf.Abs(_animationTransform.localScale.z)) * 1.3f; - } - - public void LoadAndSet(string skinId, ClassCharacterBase character, Transform wrapObject, bool isBack = false) - { - IsBack = isBack; - _character = character; - IsNoEvolveShift = _character.IsNoEvolveShift(); - IsOpponentReverse = _character.IsOpponentReverse(); - _maskSprite = new GameObject().AddComponent(); - _maskSprite.sprite = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(MaskTextureName(skinId), ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - _maskMaterial = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_encampment_mask", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true))); - _maskMaterial.SetInt("_Stencil", character.GetStencil()); - _maskSprite.material = _maskMaterial; - _maskSprite.transform.parent = wrapObject; - _maskSprite.transform.localPosition = character.GetMaskImagePosition(); - _maskSprite.transform.localScale = Vector3.one * 0.46f; - _maskSprite.gameObject.layer = 15; - _maskSprite.sortingOrder = character.GetMaskSortingOrder(IsBack); - _maskSprite.name = "SpineMask"; - _maskSprite.transform.localRotation = character.GetMaskImageRotation(); - _maskOutSprite = new GameObject().AddComponent(); - _maskOutSprite.sprite = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("tx_encampment_mask_out", ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - _maskOutSprite.material = _maskMaterial; - _maskOutSprite.transform.parent = wrapObject; - _maskOutSprite.transform.localPosition = character.GetMaskImagePosition(); - _maskOutSprite.transform.localScale = new Vector3(30f, 30f, 1f); - _maskOutSprite.gameObject.layer = 10; - _maskOutSprite.sortingOrder = character.GetMaskSortingOrder(IsBack); - _maskOutSprite.name = "SpineMaskOut"; - _maskOutSprite.gameObject.SetActive(value: false); - _spineObject = null; - GameObject gameObject = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(skinId, ResourcesManager.AssetLoadPathType.ClassCharaSpine, isfetch: true)); - if (!(gameObject != null)) - { - return; - } - if (character is HighRankSpineClassCharacter) - { - GameObject gameObject2 = null; - foreach (Transform item in gameObject.transform) - { - if (item.gameObject.name == (IsBack ? "back" : "front")) - { - gameObject2 = item.gameObject; - break; - } - } - if (!(gameObject2 != null)) - { - return; - } - gameObject = gameObject2; - } - _spineObject = Object.Instantiate(gameObject); - _animationTransform = _spineObject.transform.Find(ANIMATION_TRANSFORM_NAME); - MotionUtils.SetLayerAll(_spineObject, 15); - Transform transform2 = _spineObject.transform; - transform2.parent = wrapObject; - transform2.localPosition = character.GetSpinePosition(); - transform2.localScale = character.ConvertSpineScale(transform2.localScale); - transform2.localEulerAngles = GetDefaultRotate(); - _skeletonMecanim = transform2.GetComponentInChildren(); - if (IsOpponentReverse) - { - _skeletonMecanim.transform.localPosition = OPPONENT_MECANIM_POSITION; - } - MeshRenderer component = _skeletonMecanim.GetComponent(); - component.sortingOrder = character.GetSpineSortingOrder(IsBack); - _animator = transform2.GetComponentInChildren(); - _animator.speed = 1f; - SetMaterialInfo(component, character.GetStencil()); - _spineEvolveScale = new Vector3(SPINE_DEFAULT_SCALE.x * Mathf.Abs(_animationTransform.localScale.x), SPINE_DEFAULT_SCALE.y * Mathf.Abs(_animationTransform.localScale.y) * 1.1207f, SPINE_DEFAULT_SCALE.z * Mathf.Abs(_animationTransform.localScale.z)) * 1.3f; - } - - private Vector3 GetDefaultRotate() - { - if (!IsOpponentReverse) - { - return BILLBOARD_ROTATE; - } - return BILLBOARD_ROTATE_REVERSE_VERTICAL; - } - - public void Clear() - { - if (_spineObject != null) - { - Object.Destroy(_spineObject); - } - _spineObject = null; - _skeletonMecanim = null; - _animator = null; - _spineMaterial = null; - _maskMaterial = null; - } - - public void WaitChangeFace(string faceStr) - { - if (_skeletonMecanim != null) - { - _ = _skeletonMecanim.skeleton; - if (_skeletonMecanim.skeleton.Data.Skins.Any((Skin a) => a.Name == faceStr)) - { - _skeletonMecanim.skeleton.SetSkin(faceStr); - } - } - } - - public void OutFrame(bool isHighRank) - { - if (_maskOutSprite == null) - { - return; - } - _maskOutSprite.gameObject.SetActive(value: true); - if (!(_spineObject != null)) - { - return; - } - if (isHighRank) - { - _maskOutSprite.gameObject.layer = 13; - _spineObject.layer = 13; - _skeletonMecanim.gameObject.layer = 13; - if (_character is PlayerHighRankSpineClassCharacter) - { - iTween.RotateTo(_spineObject, iTween.Hash("rotation", BILLBOARD_ROTATE_EVOLVE, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(_spineObject, iTween.Hash("scale", SPINE_EVOLVE_SCALE, "time", 0.3f, "easetype", iTween.EaseType.easeOutExpo)); - } - return; - } - if (_skeletonMecanim != null) - { - _spineObject.layer = 10; - _skeletonMecanim.gameObject.layer = 10; - _skeletonMecanim.gameObject.GetComponent().sortingOrder = 1000; - _maskOutSprite.sortingOrder = 1000; - } - if (IsNoEvolveShift) - { - _maskOutSprite.gameObject.layer = 13; - _spineObject.layer = 13; - _skeletonMecanim.gameObject.layer = 13; - return; - } - iTween.MoveTo(_spineObject, iTween.Hash("position", OUT_OF_FRAME_POSITION + _animationTransform.localPosition, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(_spineObject, iTween.Hash("scale", _spineEvolveScale, "time", 0.3f, "easetype", iTween.EaseType.easeOutExpo)); - iTween.RotateTo(_spineObject, iTween.Hash("rotation", SPINE_EVOLVE_ROTATION, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public void SetAnimationEnable(bool isAnimation, bool previous, bool isEvolveSkin = false, bool isEvolved = false) - { - if (_animator == null) - { - return; - } - if (isEvolveSkin) - { - if (previous != isAnimation) - { - _animator.Play(((!isEvolved) ? ClassCharaPrm.MotionType.idle : ClassCharaPrm.MotionType.z_idle).ToString(), 0, 0f); - } - _animator.speed = (isAnimation ? 1 : 0); - return; - } - _animator.gameObject.SetActive(value: false); - _animator.gameObject.SetActive(value: true); - if (isAnimation) - { - _animator.enabled = true; - return; - } - _animator.enabled = false; - string faceStr = ClassCharaPrm.FaceType.skin_01.ToString(); - if (_skeletonMecanim.skeleton.Data.Skins.Any((Skin a) => a.Name == faceStr)) - { - _skeletonMecanim.skeleton.SetSkin(faceStr); - } - _skeletonMecanim.skeleton.Update(Time.deltaTime); - } - - public IEnumerator WaitReturnFrame(Vector3 position, bool isHighRank) - { - if (_spineObject != null && !IsNoEvolveShift) - { - if (!isHighRank) - { - iTween.MoveTo(_spineObject, iTween.Hash("position", position, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - } - iTween.ScaleTo(_spineObject, iTween.Hash("scale", SPINE_DEFAULT_SCALE, "time", isHighRank ? 0.24f : 0.3f, "easetype", iTween.EaseType.easeInExpo)); - iTween.RotateTo(_spineObject, iTween.Hash("rotation", GetDefaultRotate(), "time", isHighRank ? 0.24f : 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo)); - } - yield return new WaitForSeconds(isHighRank ? 0.3f : 0.33f); - if (!IsNoEvolveShift) - { - SetDefaultLayer(isHighRank); - } - } - - public void SetDefaultLayer(bool isHighRank) - { - if (_spineObject != null) - { - if (isHighRank || IsNoEvolveShift) - { - _maskOutSprite.gameObject.layer = 10; - } - _spineObject.layer = 15; - _skeletonMecanim.gameObject.layer = 15; - } - if (_skeletonMecanim != null) - { - _skeletonMecanim.gameObject.GetComponent().sortingOrder = _character.GetSpineSortingOrder(IsBack); - _maskOutSprite.sortingOrder = _character.GetMaskSortingOrder(IsBack); - _maskSprite.sortingOrder = _character.GetMaskSortingOrder(IsBack); - } - if (_maskOutSprite != null) - { - _maskOutSprite.gameObject.SetActive(value: false); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/Debug722006NullVfx.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/Debug722006NullVfx.cs deleted file mode 100644 index b2bda804..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/Debug722006NullVfx.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Player.Emotion; - -public class Debug722006NullVfx : VfxBase -{ - public override bool IsEnd => true; -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/EmotionBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/EmotionBase.cs index 89248363..8a0ee0c9 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/EmotionBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/EmotionBase.cs @@ -8,11 +8,6 @@ namespace Wizard.Battle.Player.Emotion; public abstract class EmotionBase : IEmotion { - public const float DEFAULT_HIDE_TEXT_TIME = 1.5f; - - public const float ICON_HIDE_DURATION_TIME = 0.3f; - - public const float ICON_HIDE_DELAY_TIME = 1.2f; protected readonly string _emotionId; @@ -47,12 +42,7 @@ public abstract class EmotionBase : IEmotion { return NullVfx.GetInstance(); } - Dictionary emotionDataBySkinId = GameMgr.GetIns().GetDataMgr().GetEmotionDataBySkinId(_emotionId); - if (emotionDataBySkinId.ContainsKey(emoteType)) - { - BattleManagerBase.GetIns().GetBattlePlayer(this is PlayerEmotion).CallOnEmotion(emoteType); - return ParallelVfxPlayer.Create(this.OnPlay.GetAllFuncVfxResults(emoteType), PlayEmotion(emotionDataBySkinId[emoteType], hideTextTime)); - } + // Pre-Phase-5b: emotion data headless-empty; branch dead return NullVfx.GetInstance(); } @@ -70,7 +60,7 @@ public abstract class EmotionBase : IEmotion { return PlayEmotion(emotionInfo.motion_id, emotionInfo.face_id, voiceId, text, hideTextTime, flag); } - if (!GameMgr.GetIns().IsWatchBattle || PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_OTHER_PLAYER_EMOTE)) + if (true /* Pre-Phase-5b: IsWatchBattle const-false */) { return PlayEmotion(emotionInfo.motion_id, emotionInfo.face_id, voiceId, text, hideTextTime, flag); } @@ -84,8 +74,8 @@ public abstract class EmotionBase : IEmotion public bool IsSkinEvolved() { - bool isPlayer = this is PlayerEmotion; - return BattleManagerBase.GetIns().GetBattlePlayer(isPlayer).IsSkinEvolved; + // Pre-Phase-5b: no mgr in scope; skin-evolved gate defaults to false + return false; } public virtual VfxBase PlayEmotion(ClassCharaPrm.MotionType motionType, ClassCharaPrm.FaceType faceType, string voiceId, string text, float hideTextTime, bool forcePlay = false) diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/NullPlayerEmotion.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/NullPlayerEmotion.cs index 29265774..f0624a95 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/NullPlayerEmotion.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/NullPlayerEmotion.cs @@ -2,6 +2,10 @@ using System; using System.Collections.Generic; using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 21 of 22 methods unrun in baseline +// Type: Wizard.Battle.Player.Emotion.NullPlayerEmotion +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Player.Emotion; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/PlayerEmotion.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/PlayerEmotion.cs index 046a36e5..e93d0f4a 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/PlayerEmotion.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/PlayerEmotion.cs @@ -31,16 +31,6 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion } } - private const int MAX_PLAY_COUNT = 3; - - private const int EMOTION_KIND_COUNT = 7; - - private const string ICON_PREFAB_PATH = "UI/Battle/EmotionIcon"; - - private const int ICON_DEPTH = 13; - - private const float ICON_DISTANCE = 240f; - private static readonly string[] FOCUS_ICON_NAMES = new string[7] { "battle_btn_emote_greet_on", "battle_btn_emote_thank_on", "battle_btn_emote_apology_on", "battle_btn_emote_praise_on", "battle_btn_emote_surprise_on", "battle_btn_emote_confuse_on", "battle_btn_emote_provocation_on" }; private static readonly string[] UNFOCUS_ICON_NAMES = new string[7] { "battle_btn_emote_greet_off", "battle_btn_emote_thank_off", "battle_btn_emote_apology_off", "battle_btn_emote_praise_off", "battle_btn_emote_surprise_off", "battle_btn_emote_confuse_off", "battle_btn_emote_provocation_off" }; @@ -132,7 +122,7 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion } } _isActiveHideTween = false; - }), new Debug722006NullVfx()); + })); } public VfxBase HideButtons(GameObject iconObject) @@ -160,7 +150,7 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion iconObject.SetActive(value: false); _isActiveHideTween = false; })); - }), new Debug722006NullVfx()); + })); } public void CancelShowButtons() @@ -214,7 +204,7 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion { if (++_playCount > 3) { - BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.ShowAlert(PanelMgr.BattleAlertType.EmoteLimit, isClass: false); + /* Pre-Phase-5b: PlayerBattleView.ShowAlert UI-only */ return NullVfx.GetInstance(); } ClassCharaPrm.EmotionType emoteType = IndexToEmotionType(GetIconIndex(iconObject)); @@ -224,7 +214,7 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion public string GetVoiceTextFromIconObject(GameObject iconObject) { ClassCharaPrm.EmotionType key = IndexToEmotionType(GetIconIndex(iconObject)); - Dictionary emotionDataBySkinId = GameMgr.GetIns().GetDataMgr().GetEmotionDataBySkinId(_emotionId); + Dictionary emotionDataBySkinId = new(); // Pre-Phase-5b: emotion data headless-empty if (emotionDataBySkinId.ContainsKey(key)) { return emotionDataBySkinId[key].GetText(IsSkinEvolved()); @@ -261,7 +251,7 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion public bool IsContainsEmotionType(ClassCharaPrm.EmotionType type) { - return GameMgr.GetIns().GetDataMgr().GetEmotionDataBySkinId(_emotionId) + return new Dictionary() // Pre-Phase-5b: emotion data headless-empty .ContainsKey(type); } @@ -296,14 +286,6 @@ public class PlayerEmotion : EmotionBase, IPlayerEmotion, IEmotion { continue; } - List allVfxAsList = sequentialVfxPlayer.GetAllVfxAsList(); - for (int k = 0; k < allVfxAsList.Count; k++) - { - if (allVfxAsList[k] is Debug722006NullVfx) - { - return; - } - } } } if (_isActiveHideTween) diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/AINetworkBattleOperationRecorder.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/AINetworkBattleOperationRecorder.cs deleted file mode 100644 index bfc2914b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/AINetworkBattleOperationRecorder.cs +++ /dev/null @@ -1,580 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using LitJson; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Recovery; - -public class AINetworkBattleOperationRecorder : OperationRecorderBase -{ - protected DataMgr.BattleType _battleType; - - protected long _turnStartTime; - - protected JsonData _setupJsonData = new JsonData(); - - public AINetworkBattleOperationRecorder(string filePath) - : base(filePath) - { - if (RecoveryRecordManagerBase.IsExistsAINetworkRecoveryFile()) - { - JsonData jsonData = RecoveryOperationInfo.ReadRecoveryFile(filePath); - _setupJsonData = jsonData["setup"]; - _battleType = (DataMgr.BattleType)jsonData["battle_type"].ToInt(); - if (jsonData.Keys.Any((string a) => a == "operations")) - { - foreach (object item in (IEnumerable)jsonData["operations"]) - { - _operationJsonDataList.Add((JsonData)item); - } - } - if (jsonData.Keys.Any((string a) => a == "skill_targets")) - { - foreach (object item2 in (IEnumerable)jsonData["skill_targets"]) - { - _skillTargetList.Add((string)item2); - } - } - } - else - { - _setupJsonData["player"] = new JsonData(); - _setupJsonData["player"].SetJsonType(JsonType.Object); - _setupJsonData["enemy"] = new JsonData(); - _setupJsonData["enemy"].SetJsonType(JsonType.Object); - } - WriteJsonData(); - } - - public override void RecordMulliganStart() - { - DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0)); - _setupJsonData["start_mulligan_time"] = dateTimeOffset.ToUnixTimeSeconds(); - WriteJsonData(); - } - - public override void RecordPractice3DFieldId(int id) - { - } - - public override void RecordBattleType(DataMgr.BattleType battleType) - { - _battleType = battleType; - WriteJsonData(); - } - - public override void RecordRandomSeed(int randomSeed) - { - _setupJsonData["random_seed"] = randomSeed; - WriteJsonData(); - } - - public override void RecordBackGroundId(int backGroundId) - { - _setupJsonData["background_id"] = backGroundId; - WriteJsonData(); - } - - public override void RecordBgmId(string bgmId) - { - _setupJsonData["bgm_id"] = bgmId; - WriteJsonData(); - } - - public override void RecordClass(string playerName, int clanType) - { - _setupJsonData[playerName]["clan_type"] = clanType; - WriteJsonData(); - } - - public override void RecordSubClass(string playerName, int clanType) - { - _setupJsonData[playerName]["sub_class_type"] = clanType; - WriteJsonData(); - } - - public override void RecordMyRotationId(string playerName, string myRotationId) - { - _setupJsonData[playerName]["my_rotation_id"] = myRotationId; - WriteJsonData(); - } - - public override void RecordSleeve(string playerName, long sleeveId) - { - _setupJsonData[playerName]["sleeve_id"] = sleeveId; - WriteJsonData(); - } - - public override void RecordChara(string playerName, int charaId) - { - _setupJsonData[playerName]["chara_id"] = charaId; - WriteJsonData(); - } - - public override void RecordDeck(string playerName, char indexHeadChar, IEnumerable cardIds) - { - JsonData jsonData = new JsonData(); - _setupJsonData[playerName]["deck"] = jsonData; - jsonData.SetJsonType(JsonType.Array); - int num = 1; - foreach (int cardId in cardIds) - { - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Object); - jsonData2["index"] = indexHeadChar.ToString() + num; - jsonData2["id"] = cardId; - jsonData2["name"] = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId).CardName; - jsonData.Add(jsonData2); - num++; - } - WriteJsonData(); - } - - public override void RecordEnemyAIDifficulty(int level) - { - _setupJsonData["enemy"]["ai_difficulty"] = level; - WriteJsonData(); - } - - public override void RecordEnemyAILogicLevel(int level) - { - _setupJsonData["enemy"]["ai_logic_level"] = level; - WriteJsonData(); - } - - public override void RecordEnemyAIMaxLife(int life) - { - _setupJsonData["enemy"]["ai_max_life"] = life; - WriteJsonData(); - } - - public override void RecordEnemyAIDeckId(int deckId) - { - _setupJsonData["enemy"]["ai_deck_id"] = deckId; - WriteJsonData(); - } - - public override void RecordEnemyAIStyleId(int styleId) - { - _setupJsonData["enemy"]["ai_style_id"] = styleId; - WriteJsonData(); - } - - public override void RecordEnemyAIEmoteId(int emoteId) - { - _setupJsonData["enemy"]["ai_emote_id"] = emoteId; - WriteJsonData(); - } - - public override void RecordEnemyAIUseInnerEmote(bool useInnerEmote) - { - _setupJsonData["enemy"]["ai_use_inner_emote"] = useInnerEmote; - WriteJsonData(); - } - - public override void RecordStartTurnIsPlayer(bool startTurnIsPlayer) - { - _setupJsonData["player_start_turn"] = startTurnIsPlayer; - DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0)); - _setupJsonData["opening_start_time"] = dateTimeOffset.ToUnixTimeSeconds(); - WriteJsonData(); - } - - public override void RecordPracticeDifficultyDegreeId(int degreeId) - { - _setupJsonData["practice_difficulty_degree_id"] = degreeId; - WriteJsonData(); - } - - public override void RecordIsPreBuildDeck(bool isPreBuildDeck) - { - _setupJsonData["is_prebuild_deck"] = isPreBuildDeck; - WriteJsonData(); - } - - public override void RecordIsTrialDeck(bool isTrialDeck) - { - _setupJsonData["is_trial_deck"] = isTrialDeck; - WriteJsonData(); - } - - public override void RecordIsDefaultDeck(bool isDefaultDeck) - { - _setupJsonData["is_default_deck"] = isDefaultDeck; - WriteJsonData(); - } - - public override void RecordQuestStageId(int id) - { - _setupJsonData["quest_stage_id"] = id; - WriteJsonData(); - } - - public override void RecordQuestEnemyAiId(int id) - { - _setupJsonData["quest_enemy_ai_id"] = id; - WriteJsonData(); - } - - public override void RecordQuestEnemyEmblemId(int id) - { - _setupJsonData["quest_enemy_emblem_id"] = id; - WriteJsonData(); - } - - public override void RecordQuestEnemyDegreeId(int id) - { - _setupJsonData["quest_enemy_degree_id"] = id; - WriteJsonData(); - } - - public override void RecordQuestEnemyEmotionOverride(int id) - { - _setupJsonData["quest_enemy_emotion_override"] = id; - WriteJsonData(); - } - - public override void RecordQuestPlayerEmotionOverride(int id) - { - _setupJsonData["quest_player_emotion_override"] = id; - WriteJsonData(); - } - - public override void RecordQuestRecoveryPoint(int recoveryPoint) - { - _setupJsonData["recovery_point"] = recoveryPoint; - WriteJsonData(); - } - - public override void RecordQuestPlayerSkillList(List skills) - { - JsonData jsonData = new JsonData(); - _setupJsonData["quest_player_skill_list"] = jsonData; - jsonData.SetJsonType(JsonType.Array); - foreach (BossRushSpecialSkill skill in skills) - { - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Object); - jsonData2["original_card_id"] = skill.OriginalCardId; - jsonData2["name"] = skill.Name; - jsonData2["skill_text"] = skill.SkillText; - jsonData2["skill_desc_text"] = skill.SkillDescText; - jsonData2["is_foil"] = skill.IsFoil; - jsonData.Add(jsonData2); - } - WriteJsonData(); - } - - public override void RecordQuestEnemySkill(BossRushSpecialSkill skill) - { - JsonData jsonData = new JsonData(); - jsonData.SetJsonType(JsonType.Object); - jsonData["original_card_id"] = skill.OriginalCardId; - jsonData["name"] = skill.Name; - jsonData["skill_text"] = skill.SkillText; - jsonData["skill_desc_text"] = skill.SkillDescText; - jsonData["is_foil"] = skill.IsFoil; - _setupJsonData["quest_enemy_skill"] = jsonData; - WriteJsonData(); - } - - public override void RecordQuestMaxBattleCount(int maxBattleCount) - { - _setupJsonData["quest_max_battle_count"] = maxBattleCount; - WriteJsonData(); - } - - public override void RecordQuestCurrentWinCount(int currentWinCount) - { - _setupJsonData["quest_current_win_count"] = currentWinCount; - WriteJsonData(); - } - - public override void RecordQuestIsExtra(bool isExtra) - { - _setupJsonData["quest_is_extra"] = isExtra; - WriteJsonData(); - } - - public override void RecordQuestIsMockBattle(bool isMockBattle) - { - _setupJsonData["quest_is_mock_battle"] = isMockBattle; - WriteJsonData(); - } - - public override void RecordQuestExtraDeckScheduleId(int id) - { - _setupJsonData["quest_extra_deck_schedule_id"] = id; - WriteJsonData(); - } - - public override void RecordMissionNecessaryInformation(BattleManagerBase.MissionNecessaryInformation missionNecessaryInformation) - { - _setupJsonData["mission_necessary_information"] = new JsonData(); - _setupJsonData["mission_necessary_information"].SetJsonType(JsonType.Object); - foreach (KeyValuePair item in missionNecessaryInformation.GetOriginalTargetDictionary()) - { - _setupJsonData["mission_necessary_information"][item.Key] = item.Value; - } - WriteJsonData(); - } - - public override void RecordPlayerMulliganReplaceCards(IEnumerable replaceCards, IEnumerable completeCards) - { - JsonData jsonData = new JsonData(); - jsonData.SetJsonType(JsonType.Array); - foreach (BattleCardBase replaceCard in replaceCards) - { - jsonData.Add(replaceCard.GetName()); - } - _setupJsonData["player_mulligan_abandon"] = jsonData; - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Array); - foreach (int completeCard in completeCards) - { - jsonData2.Add("p" + completeCard); - } - _setupJsonData["player_mulligan_complete"] = jsonData2; - WriteJsonData(); - } - - public override void RecordEnemyMulliganReplaceCards(IEnumerable replaceCards, IEnumerable completeCards) - { - JsonData jsonData = new JsonData(); - jsonData.SetJsonType(JsonType.Array); - foreach (BattleCardBase replaceCard in replaceCards) - { - jsonData.Add(replaceCard.GetName()); - } - _setupJsonData["enemy_mulligan_abandon"] = jsonData; - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Array); - foreach (int completeCard in completeCards) - { - jsonData2.Add("e" + completeCard); - } - _setupJsonData["enemy_mulligan_complete"] = jsonData2; - WriteJsonData(); - } - - public override void RecordPlay(BattleCardBase card, BattleCardBase originalCard, IEnumerable selectedCards) - { - JsonData jsonData = new JsonData(); - jsonData["ope"] = "play"; - jsonData["index"] = CardToIndexName(card); - jsonData["id"] = card.CardId; - jsonData["name"] = card.BaseParameter.CardName; - jsonData["cost"] = card.Cost; - jsonData["is_choice_brave"] = (originalCard.IsChoiceBraveSkillCard ? 1 : 0); - WriteSkillTargetInfoToJson(selectedCards, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override VfxBase RecordAttack(BattleCardBase attackCard, BattleCardBase targetCard, SkillProcessor skillProcessor) - { - JsonData jsonData = new JsonData(); - jsonData["ope"] = "attack"; - jsonData["index"] = CardToIndexName(attackCard); - jsonData["id"] = attackCard.CardId; - jsonData["name"] = attackCard.BaseParameter.CardName; - jsonData["target"] = CardToIndexName(targetCard); - jsonData["target_id"] = targetCard.CardId; - jsonData["target_name"] = targetCard.BaseParameter.CardName; - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - return NullVfx.GetInstance(); - } - - public override void RecordEvolve(BattleCardBase originalCard, BattleCardBase card, IEnumerable selectedCards) - { - JsonData jsonData = new JsonData(); - jsonData["ope"] = "evolve"; - jsonData["index"] = CardToIndexName(card); - jsonData["id"] = card.CardId; - jsonData["name"] = card.BaseParameter.CardName; - WriteSkillTargetInfoToJson(selectedCards, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordStartSelect(BattleCardBase card, bool isEvolve, List selectableCards, bool isChoiceBrave) - { - } - - public override void RecordSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isBurialRite, bool isChoiceBrave) - { - } - - public override void RecordCompleteSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isChoiceBrave, bool isBurialRite) - { - } - - public override void RecordStartChoice(BattleCardBase card, bool isEvolve, List choiceCards, bool isChoiceBrave) - { - } - - public override void RecordStartFusion(BattleCardBase card, List selectableCards) - { - } - - public override void RecordSelectFusion(BattleCardBase card) - { - } - - public override void RecordCompleteChoice(BattleCardBase card, bool isEvolve, List chosenCardList, BattleCardBase actCard, List chosenCardIndexList, bool hasSelectionSkill, bool isChoiceBrave) - { - } - - public override void RecordCancelChoice(BattleCardBase card, bool isEvolve, bool isChoiceBrave) - { - } - - public override void RecordCancelFusion(BattleCardBase card) - { - } - - public override void RecordCancelSelect(BattleCardBase actCard, bool isEvolve, bool isChoiceBrave) - { - } - - public override void RecordTurnStart() - { - DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0)); - _turnStartTime = dateTimeOffset.ToUnixTimeSeconds(); - WriteJsonData(); - } - - public override void RecordTurnEnd() - { - JsonData jsonData = new JsonData(); - jsonData["ope"] = "turn_end"; - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordRetire() - { - } - - public void RecordChangeAI(string logicName, int operationQueueCount) - { - JsonData jsonData = new JsonData(); - jsonData["ope"] = "change_ai"; - jsonData["logic"] = logicName; - jsonData["queue_count"] = operationQueueCount; - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordSkillTargets(IEnumerable targetCards) - { - foreach (BattleCardBase targetCard in targetCards) - { - _skillTargetList.Add(targetCard.GetName()); - } - WriteJsonData(); - } - - public void RecordSpecialBattleSetting(DataMgr.SpecialBattleSetting setting) - { - if (setting != null) - { - _setupJsonData["story_special_battle_player_attach_skill"] = setting.PlayerAttachSkillText; - _setupJsonData["story_special_battle_enemy_attach_skill"] = setting.EnemyAttachSkillText; - _setupJsonData["story_special_battle_player_start_pp"] = setting.PlayerStartPp; - _setupJsonData["story_special_battle_enemy_start_pp"] = setting.EnemyStartPp; - _setupJsonData["story_special_battle_player_start_life"] = setting.PlayerStartMaxLife; - _setupJsonData["story_special_battle_enemy_start_life"] = setting.EnemyStartMaxLife; - _setupJsonData["story_special_battle_banish_effect_override"] = setting.IdOverrideInBattleLogText; - _setupJsonData["story_special_battle_token_draw_effect_override"] = setting.TokenDrawEffectOverrideText; - _setupJsonData["story_special_battle_id_override_in_battle_log"] = setting.IdOverrideInBattleLogText; - WriteJsonData(); - } - } - - public override void RecordCompleteFusionSelect(BattleCardBase fusionCard, IEnumerable ingredientCards) - { - JsonData jsonData = new JsonData(); - jsonData["ope"] = "comp_fusion"; - jsonData["index"] = CardToIndexName(fusionCard); - jsonData["id"] = fusionCard.CardId; - jsonData["name"] = fusionCard.BaseParameter.CardName; - WriteSkillTargetInfoToJson(ingredientCards, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - protected override void WriteJsonData() - { - if (RecoveryManagerBase.failedRecoveryFlag) - { - return; - } - JsonData jsonData = new JsonData(); - jsonData["version"] = 0; - jsonData["battle_type"] = (int)_battleType; - jsonData["record_time"] = DateTime.Now.Ticks; - jsonData["turn_start_time"] = _turnStartTime; - jsonData["setup"] = _setupJsonData; - jsonData["operations"] = new JsonData(); - jsonData["operations"].SetJsonType(JsonType.Array); - foreach (JsonData operationJsonData in _operationJsonDataList) - { - jsonData["operations"].Add(operationJsonData); - } - jsonData["check"] = new JsonData(); - jsonData["check"]["player"] = new JsonData(); - jsonData["check"]["player"].SetJsonType(JsonType.Object); - jsonData["check"]["enemy"] = new JsonData(); - jsonData["check"]["enemy"].SetJsonType(JsonType.Object); - BattlePlayer battlePlayer = BattleManagerBase.GetIns().BattlePlayer; - BattleEnemy battleEnemy = BattleManagerBase.GetIns().BattleEnemy; - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Array); - JsonData jsonData3 = new JsonData(); - jsonData3.SetJsonType(JsonType.Array); - JsonData jsonData4 = new JsonData(); - jsonData4.SetJsonType(JsonType.Array); - JsonData jsonData5 = new JsonData(); - jsonData5.SetJsonType(JsonType.Array); - foreach (BattleCardBase handCard in battlePlayer.HandCardList) - { - jsonData2.Add(handCard.GetName()); - } - foreach (BattleCardBase inPlayCard in battlePlayer.InPlayCards) - { - jsonData3.Add(inPlayCard.GetName()); - } - foreach (BattleCardBase handCard2 in battleEnemy.HandCardList) - { - jsonData4.Add(handCard2.GetName()); - } - foreach (BattleCardBase inPlayCard2 in battleEnemy.InPlayCards) - { - jsonData5.Add(inPlayCard2.GetName()); - } - jsonData["check"]["player"]["hand"] = jsonData2; - jsonData["check"]["player"]["inplay"] = jsonData3; - jsonData["check"]["enemy"]["hand"] = jsonData4; - jsonData["check"]["enemy"]["inplay"] = jsonData5; - JsonData jsonData6 = new JsonData(); - jsonData6.SetJsonType(JsonType.Array); - foreach (string skillTarget in _skillTargetList) - { - jsonData6.Add(skillTarget); - } - if (jsonData6.Count > 0) - { - jsonData["skill_targets"] = jsonData6; - } - WriteJsonDataToFile(jsonData); - } - - protected override void WriteJsonDataToFile(JsonData jsonData, string overrideFilePath = "") - { - base.WriteJsonDataToFile(jsonData, string.Empty); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/AINetworkBattleRecoveryRecordManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/AINetworkBattleRecoveryRecordManager.cs deleted file mode 100644 index 53882e9d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/AINetworkBattleRecoveryRecordManager.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using Wizard.Battle.Mulligan; - -namespace Wizard.Battle.Recovery; - -public class AINetworkBattleRecoveryRecordManager : RecoveryRecordManagerBase -{ - protected override string DefaultRecoveryFileName => "recovery_ai_network.json"; - - public AINetworkBattleRecoveryRecordManager() - { - } - - public AINetworkBattleRecoveryRecordManager(string filePath) - : base(filePath) - { - } - - public override void SetupRecording(BattleManagerBase battleMgr, DataMgr.BattleType battleType, int randomSeed, int backGroundId, string bgmId = "NONE") - { - base.SetupRecording(battleMgr, battleType, randomSeed, backGroundId, bgmId); - RecordAINetworkBattleSettings(_recorder, battleType, randomSeed, backGroundId, bgmId); - } - - protected override OperationRecorderBase CreateOperationRecorder() - { - return new AINetworkBattleOperationRecorder(_recoveryFilePath); - } - - protected override void SetupRecorderEvents(OperationRecorderBase operationRecorder, BattleManagerBase battleMgr) - { - base.SetupRecorderEvents(operationRecorder, battleMgr); - BattlePlayer battlePlayer = battleMgr.BattlePlayer; - battlePlayer.OnTurnStartComplete = (Action)Delegate.Combine(battlePlayer.OnTurnStartComplete, new Action(operationRecorder.RecordTurnStart)); - BattleEnemy battleEnemy = battleMgr.BattleEnemy; - battleEnemy.OnTurnStartComplete = (Action)Delegate.Combine(battleEnemy.OnTurnStartComplete, new Action(operationRecorder.RecordTurnStart)); - battleMgr.OperateMgr.OnTurnEnd += operationRecorder.RecordTurnEnd; - } - - public override void SetupMulliganStartTimeRecorderEvent(BattleManagerBase battleMgr) - { - PlayerMulliganCtrl playerMlgCtrl = battleMgr.MulliganMgr.PlayerMlgCtrl; - playerMlgCtrl.OnMulliganLaunchComplete = (Action)Delegate.Combine(playerMlgCtrl.OnMulliganLaunchComplete, new Action(_recorder.RecordMulliganStart)); - } - - protected void RecordAINetworkBattleSettings(OperationRecorderBase operationRecorder, DataMgr.BattleType battleType, int randomSeed, int backGroundId, string bgmId) - { - DataMgr dataMgr = _gameMgr.GetDataMgr(); - operationRecorder.RecordBattleType(battleType); - operationRecorder.RecordRandomSeed(randomSeed); - operationRecorder.RecordBackGroundId(backGroundId); - operationRecorder.RecordBgmId(bgmId); - operationRecorder.RecordClass("player", dataMgr.GetPlayerClassId()); - operationRecorder.RecordSubClass("player", dataMgr.GetPlayerSubClassId()); - if (dataMgr.TryGetPlayerMyRotationInfo(out var myRotationInfo)) - { - operationRecorder.RecordMyRotationId("player", myRotationInfo.Id); - } - operationRecorder.RecordClass("enemy", dataMgr.GetEnemyClassId()); - operationRecorder.RecordSubClass("enemy", dataMgr.GetEnemySubClassId()); - if (dataMgr.TryGetEnemyMyRotationInfo(out var myRotationInfo2)) - { - operationRecorder.RecordMyRotationId("enemy", myRotationInfo2.Id); - } - operationRecorder.RecordChara("player", dataMgr.GetPlayerCharaId()); - operationRecorder.RecordChara("enemy", dataMgr.GetEnemyCharaId()); - operationRecorder.RecordSleeve("player", dataMgr.GetPlayerSleeveId()); - operationRecorder.RecordSleeve("enemy", dataMgr.GetEnemySleeveId()); - operationRecorder.RecordDeck("player", 'p', dataMgr.GetCurrentDeckData()); - operationRecorder.RecordDeck("enemy", 'e', dataMgr.GetCurrentEnemyDeckData()); - operationRecorder.RecordEnemyAIDifficulty(dataMgr.m_EnemyAIDifficulty); - operationRecorder.RecordEnemyAILogicLevel(dataMgr.m_EnemyAILogicLevel); - operationRecorder.RecordEnemyAIMaxLife(dataMgr.m_EnemyAIMaxLife); - operationRecorder.RecordEnemyAIDeckId(dataMgr.m_EnemyAIDeckId); - operationRecorder.RecordEnemyAIStyleId(dataMgr.m_EnemyAIStyleId); - operationRecorder.RecordEnemyAIEmoteId(dataMgr.m_EnemyAIEmoteId); - operationRecorder.RecordEnemyAIUseInnerEmote(dataMgr.m_EnemyAIUseInnerEmote); - operationRecorder.RecordPracticeDifficultyDegreeId(dataMgr.PracticeDifficultyDegreeId); - operationRecorder.RecordIsPreBuildDeck(dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.BuildDeck)); - operationRecorder.RecordIsTrialDeck(dataMgr.IsLastSelectDeckAttributeType(DeckAttributeType.TrialDeck)); - } - - public void RecordChangeAI(string logicName, int operationQueueCount) - { - if (_recorder is SingleBattleOperationRecorder singleBattleOperationRecorder) - { - singleBattleOperationRecorder.RecordChangeAI(logicName, operationQueueCount); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleOperationRecorder.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleOperationRecorder.cs deleted file mode 100644 index 9f93ce6b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleOperationRecorder.cs +++ /dev/null @@ -1,421 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using LitJson; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Recovery; - -public class NetworkBattleOperationRecorder : OperationRecorderBase -{ - public NetworkBattleOperationRecorder(string filePath) - : base(filePath) - { - if (File.Exists(filePath)) - { - JsonData operationDataList = RecoveryOperationInfo.ReadRecoveryFile(filePath); - SetOperationDataList(operationDataList); - } - else - { - WriteJsonData(); - } - } - - public override void RecordBattleType(DataMgr.BattleType battleType) - { - } - - public override void RecordRandomSeed(int randomSeed) - { - } - - public override void RecordBackGroundId(int backGroundId) - { - } - - public override void RecordBgmId(string bgmId) - { - } - - public override void RecordClass(string playerName, int clanType) - { - } - - public override void RecordSubClass(string playerName, int clanType) - { - } - - public override void RecordMyRotationId(string playerName, string myRotationId) - { - } - - public override void RecordSleeve(string playerName, long sleeveId) - { - } - - public override void RecordChara(string playerName, int charaId) - { - } - - public override void RecordDeck(string playerName, char indexHeadChar, IEnumerable cardIds) - { - } - - public override void RecordEnemyAIDifficulty(int difficulty) - { - } - - public override void RecordEnemyAILogicLevel(int level) - { - } - - public override void RecordEnemyAIMaxLife(int life) - { - } - - public override void RecordEnemyAIDeckId(int deckId) - { - } - - public override void RecordEnemyAIStyleId(int styleId) - { - } - - public override void RecordEnemyAIEmoteId(int emoteId) - { - } - - public override void RecordEnemyAIUseInnerEmote(bool useInnerEmote) - { - } - - public override void RecordStartTurnIsPlayer(bool startTurnIsPlayer) - { - } - - public override void RecordPracticeDifficultyDegreeId(int degreeId) - { - } - - public override void RecordIsPreBuildDeck(bool isPreBuildDeck) - { - } - - public override void RecordIsTrialDeck(bool isTrialDeck) - { - } - - public override void RecordIsDefaultDeck(bool isDefaultDeck) - { - } - - public override void RecordQuestStageId(int id) - { - } - - public override void RecordQuestEnemyAiId(int id) - { - } - - public override void RecordQuestEnemyEmblemId(int id) - { - } - - public override void RecordQuestEnemyDegreeId(int id) - { - } - - public override void RecordQuestEnemyEmotionOverride(int id) - { - } - - public override void RecordQuestPlayerEmotionOverride(int id) - { - } - - public override void RecordQuestRecoveryPoint(int recoveryPoint) - { - } - - public override void RecordQuestPlayerSkillList(List skills) - { - } - - public override void RecordQuestEnemySkill(BossRushSpecialSkill skill) - { - } - - public override void RecordQuestMaxBattleCount(int maxBattleCount) - { - } - - public override void RecordQuestCurrentWinCount(int currentWinCount) - { - } - - public override void RecordQuestIsExtra(bool isExtra) - { - } - - public override void RecordQuestIsMockBattle(bool isMockBattle) - { - } - - public override void RecordQuestExtraDeckScheduleId(int id) - { - } - - public override void RecordMissionNecessaryInformation(BattleManagerBase.MissionNecessaryInformation missionNecessaryInformation) - { - } - - public override void RecordMulliganStart() - { - } - - public override void RecordPractice3DFieldId(int id) - { - } - - public override void RecordPlayerMulliganReplaceCards(IEnumerable replaceCards, IEnumerable completeCards) - { - JsonData jsonData = new JsonData(); - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Array); - foreach (BattleCardBase replaceCard in replaceCards) - { - jsonData2.Add(replaceCard.GetName()); - } - jsonData["operation"] = "mulligan"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["abandoned_cards"] = jsonData2; - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordEnemyMulliganReplaceCards(IEnumerable replaceCards, IEnumerable completeCards) - { - } - - public override void RecordPlay(BattleCardBase card, BattleCardBase originalCard, IEnumerable selectedCards) - { - if (card.IsPlayer) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "play"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - jsonData["is_choice_brave"] = (originalCard.IsChoiceBraveSkillCard ? 1 : 0); - WriteSkillTargetInfoToJson(selectedCards, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - } - - public override VfxBase RecordAttack(BattleCardBase attackCard, BattleCardBase targetCard, SkillProcessor skillProcessor) - { - if (!attackCard.IsPlayer) - { - return NullVfx.GetInstance(); - } - JsonData jsonData = new JsonData(); - jsonData["operation"] = "attack"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(attackCard); - jsonData["target"] = CardToIndexName(targetCard); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - return NullVfx.GetInstance(); - } - - public override void RecordEvolve(BattleCardBase originalCard, BattleCardBase card, IEnumerable selectedCards) - { - if (card.IsPlayer) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "evolve"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - WriteSkillTargetInfoToJson(selectedCards, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - } - - public override void RecordCompleteFusionSelect(BattleCardBase fusionCard, IEnumerable ingredientCards) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "comp_fusion"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(fusionCard); - WriteSkillTargetInfoToJson(ingredientCards, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordStartFusion(BattleCardBase fusionCard, List selectableCards) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "start_fusion"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(fusionCard); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordSelectFusion(BattleCardBase card) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "select_fusion"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordCancelFusion(BattleCardBase card) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "cancel_fusion"; - jsonData["seq"] = GetCurrentSequenceNumber(); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordStartSelect(BattleCardBase card, bool isEvolve, List selectableCards, bool isChoiceBrave) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "start_select"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - jsonData["bool"] = (isEvolve ? 1 : 0); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isBurialRite, bool isChoiceBrave) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "select"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - jsonData["bool"] = (isEvolve ? 1 : 0); - jsonData["is_burial_rite"] = (isBurialRite ? 1 : 0); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordCompleteSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isChoiceBrave, bool isBurialRite) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "comp_select"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - jsonData["bool"] = (isEvolve ? 1 : 0); - jsonData["is_burial_rite"] = (isBurialRite ? 1 : 0); - jsonData["is_choice_brave"] = (isChoiceBrave ? 1 : 0); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordCancelSelect(BattleCardBase actCard, bool isEvolve, bool isChoiceBrave) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "cancel_select"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["bool"] = (isEvolve ? 1 : 0); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordStartChoice(BattleCardBase card, bool isEvolve, List choiceCards, bool isChoiceBrave) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "start_choice"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - jsonData["bool"] = (isEvolve ? 1 : 0); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordCompleteChoice(BattleCardBase card, bool isEvolve, List chosenCardList, BattleCardBase actCard, List chosenCardIndexList, bool hasSelectionSkill, bool isChoiceBrave) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "comp_choice"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["index"] = CardToIndexName(card); - jsonData["bool"] = (isEvolve ? 1 : 0); - WriteSkillTargetInfoToJson(chosenCardList, jsonData); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordCancelChoice(BattleCardBase card, bool isEvolve, bool isChoiceBrave) - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "cancel_choice"; - jsonData["seq"] = GetCurrentSequenceNumber(); - jsonData["bool"] = (isEvolve ? 1 : 0); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordTurnStart() - { - } - - public override void RecordTurnEnd() - { - JsonData jsonData = new JsonData(); - jsonData["operation"] = "turn_end"; - jsonData["seq"] = GetCurrentSequenceNumber(); - _operationJsonDataList.Add(jsonData); - WriteJsonData(); - } - - public override void RecordRetire() - { - } - - public override void RecordSkillTargets(IEnumerable targetCards) - { - } - - protected override void WriteJsonData() - { - JsonData jsonData = new JsonData(); - jsonData["operations"] = new JsonData(); - jsonData["operations"].SetJsonType(JsonType.Array); - foreach (JsonData operationJsonData in _operationJsonDataList) - { - jsonData["operations"].Add(operationJsonData); - } - WriteJsonDataToFile(jsonData); - } - - private void SetOperationDataList(JsonData recoveryLogData) - { - if (recoveryLogData.Keys.Contains("operations")) - { - JsonData jsonData = recoveryLogData["operations"]; - for (int i = 0; i < jsonData.Count; i++) - { - _operationJsonDataList.Add(jsonData[i]); - } - } - else - { - LocalLog.AccumulateTraceLog("operations key is not found in recovery file"); - } - } - - private int GetCurrentSequenceNumber() - { - if (ToolboxGame.RealTimeNetworkAgent != null) - { - return ToolboxGame.RealTimeNetworkAgent.GetCurrentSequenceNumber() + 1; - } - return 0; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleRecoveryManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleRecoveryManager.cs deleted file mode 100644 index 3b39f310..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleRecoveryManager.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Recovery; - -public class NetworkBattleRecoveryManager : RecoveryNetworkManagerBase -{ - public override VfxBase Recovery(BattlePlayer battlePlayer, BattleEnemy battleEnemy, Func startCoroutine) - { - return NullVfx.GetInstance(); - } - - public override VfxBase UpdateRecovery() - { - return NullVfx.GetInstance(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleRecoveryRecordManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleRecoveryRecordManager.cs deleted file mode 100644 index 5b516edf..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NetworkBattleRecoveryRecordManager.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Wizard.Battle.Recovery; - -public class NetworkBattleRecoveryRecordManager : RecoveryRecordManagerBase -{ - protected override string DefaultRecoveryFileName => "recovery_network.json"; - - protected override OperationRecorderBase CreateOperationRecorder() - { - return new NetworkBattleOperationRecorder(_recoveryFilePath); - } - - protected override void SetupRecorderEvents(OperationRecorderBase operationRecorder, BattleManagerBase battleMgr) - { - base.SetupRecorderEvents(operationRecorder, battleMgr); - battleMgr.OperateMgr.OnBeforePlayerTurnEnd += operationRecorder.RecordTurnEnd; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NullRecoveryManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NullRecoveryManager.cs index f50ba673..6154d986 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NullRecoveryManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/NullRecoveryManager.cs @@ -3,6 +3,10 @@ using System.Collections; using Cute; using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 18 of 20 methods unrun in baseline +// Type: Wizard.Battle.Recovery.NullRecoveryManager +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Recovery; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryController.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryController.cs index 4ceec0b1..37d0d845 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryController.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryController.cs @@ -1,392 +1,20 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; -using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; - -namespace Wizard.Battle.Recovery; - -public class RecoveryController -{ - private NetworkBattleManagerBase _networkBattleMgr; - - private List _recoveryCoroutineList = new List(); - - private Matching _matchingInstance; - - public RecoveryDataHandler RecoveryDataHandlerInstance { get; private set; } - - public bool IsMariganFinished => Data.BattleRecoveryInfo.IsMulliganEnd; - - public RecoveryOperationInfo AIBattleRecoveryData { get; private set; } - - public event Action OnFinishRecoveringData; - - public event Action OnFinishRecoveryLogSync; - - public RecoveryController(RecoveryOperationInfo aiBattleRecoveryData = null) - { - AIBattleRecoveryData = aiBattleRecoveryData; - Format format = Data.CurrentFormat; - if (format == Format.Max && GameMgr.GetIns().GetDataMgr().IsDipslayHighRankFormat()) - { - format = PlayerStaticData.HighRankFormat(); - } - PlayerStaticData.LoadUserRankTexture(format); - switch (GameMgr.GetIns().GetDataMgr().m_BattleType) - { - case DataMgr.BattleType.FreeBattle: - _matchingInstance = new Matching_Free(); - break; - case DataMgr.BattleType.RankBattle: - _matchingInstance = new Matching_RankMatch(); - break; - case DataMgr.BattleType.ColosseumNormal: - case DataMgr.BattleType.ColosseumTwoPick: - case DataMgr.BattleType.ColosseumHof: - case DataMgr.BattleType.ColosseumWindFall: - _matchingInstance = new Matching_Colosseum(); - break; - case DataMgr.BattleType.CompetitionNormal: - case DataMgr.BattleType.CompetitionTwoPick: - _matchingInstance = new Matching_Competition(); - break; - case DataMgr.BattleType.RoomBattle: - ResetRoomInfo(NetworkDefine.ServerBattleType.OpenRoom, Data.BattleRecoveryInfo, RoomConnectController.BattleRule.Bo1, Format.Max, TwoPickFormat.None, isOpenDeckRule: false); - break; - case DataMgr.BattleType.RoomTwoPick: - ResetRoomInfo(NetworkDefine.ServerBattleType.RoomTwoPick, Data.BattleRecoveryInfo, Data.BattleRecoveryInfo.BattleParameterInstance.Rule, Format.Max, Data.BattleRecoveryInfo.BattleParameterInstance.TwoPickFormat, isOpenDeckRule: false); - break; - case DataMgr.BattleType.TwoPickBackdraft: - ResetRoomInfo(NetworkDefine.ServerBattleType.RoomTwoPick, Data.BattleRecoveryInfo, RoomConnectController.BattleRule.Bo1, Format.Max, Data.BattleRecoveryInfo.BattleParameterInstance.TwoPickFormat, isOpenDeckRule: false); - break; - case DataMgr.BattleType.TwoPick: - _matchingInstance = new Matching_TwoPick(); - break; - case DataMgr.BattleType.Sealed: - _matchingInstance = new Matching_Sealed(); - break; - } - ConnectNode(); - UIManager.GetInstance().StartCoroutine(WaitRealtimeObjectCreateToSetupRecoveryData()); - } - - private void ResetRoomInfo(NetworkDefine.ServerBattleType battleType, BattleRecoveryInfo battleRecoveryInfo, RoomConnectController.BattleRule roomRule, Format format, TwoPickFormat deckFormatType, bool isOpenDeckRule) - { - _matchingInstance = new Matching_Room(battleRecoveryInfo._isConventionRoom, battleRecoveryInfo.IsGatheringRoom); - (_matchingInstance as Matching_Room).SetBattleParameter(new BattleParameter(battleType, format, deckFormatType, roomRule, isOpenDeckRule)); - RoomBase.SettingOpponentDispData(!Data.BattleRecoveryInfo.is_owner, Data.BattleRecoveryInfo.opponent_name, Data.BattleRecoveryInfo.opponent_emblem_id, Data.BattleRecoveryInfo.opponent_degree_id, Data.BattleRecoveryInfo.opponent_country_code, Data.BattleRecoveryInfo.opponent_rank, Data.BattleRecoveryInfo.IsOpponentOfficialUser, Data.BattleRecoveryInfo.OpponentHighFormatRank); - } - - private IEnumerator WaitRealtimeObjectCreateToSetupRecoveryData() - { - while (ToolboxGame.RealTimeNetworkAgent == null) - { - _matchingInstance.UpdateOffLineMatching(); - yield return null; - } - ToolboxGame.RealTimeNetworkAgent.IsNotPlayReceivingData = true; - SetupRecoveryData(); - } - - private void SetupRecoveryData() - { - ParseRecoveryData(); - OnRecoveryReady(); - ToolboxGame.RealTimeNetworkAgent.StartRecovery(Data.BattleRecoveryInfo.battle_id.ToString(), Data.BattleRecoveryInfo.Play_seq, Data.BattleRecoveryInfo.Pub_seq); - if (!GameMgr.GetIns().IsAINetwork) - { - _recoveryCoroutineList.Add(UIManager.GetInstance().StartCoroutine(RealtimeOpenToRecoveryStart())); - } - _recoveryCoroutineList.Add(UIManager.GetInstance().StartCoroutine(WaitTillBattleCreate())); - } - - private IEnumerator RealtimeOpenToRecoveryStart() - { - while (!ToolboxGame.RealTimeNetworkAgent.IsOpen()) - { - yield return null; - } - ToolboxGame.RealTimeNetworkAgent.EmitMsgPack(NetworkBattleDefine.NetworkBattleURI.RecoveryStart); - } - - private IEnumerator WaitTillBattleCreate() - { - while (BattleManagerBase.GetIns() == null || BattleManagerBase.GetIns().SBattleLoad == null || !BattleManagerBase.GetIns().SBattleLoad.isLoadEnd || !ToolboxGame.RealTimeNetworkAgent.IsOpen()) - { - yield return null; - } - RecoveryEndToChangeBattleScene(); - } - - private void RecoveryEndToChangeBattleScene() - { - _networkBattleMgr = BattleManagerBase.GetIns() as NetworkBattleManagerBase; - ToolboxGame.RealTimeNetworkAgent.SetNetworkBattleMgr(_networkBattleMgr); - BattleManagerBase.GetIns().OnStartOpening += delegate - { - _networkBattleMgr._recoveryController = this; - RecoveryDataHandlerInstance = new RecoveryDataHandler(_networkBattleMgr, this.OnFinishRecoveringData, this.OnFinishRecoveryLogSync, AIBattleRecoveryData); - RecoveryDataHandlerInstance.OnBattleReceived(); - }; - _matchingInstance.GotoBattle(); - BattleManagerBase.GetIns().SBattleLoad.StartBattleScene(); - } - - private void RecoveryReturnScene() - { - if (!_matchingInstance.GetMatchingDataReady()) - { - UIManager.GetInstance().OffViewAll(); - } - ToolboxGame.DestroyNetworkAgent(); - if (_matchingInstance is Matching_Room) - { - RoomBase.ResetOpponentData(); - } - if (_matchingInstance.GetMatchingDataReady() && GameMgr.GetIns().GetBattleCtrl() != null) - { - UIManager.GetInstance().StartCoroutine(BattleEndCoroutin(ChangeScene)); - return; - } - UIManager.GetInstance().CloseInSceneLoadingMatching(); - ChangeScene(); - } - - private void ChangeScene() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.OnFinishChangeView = delegate - { - UIManager.GetInstance().CloseInSceneLoadingMatching(); - UIManager.GetInstance().CloseInSceneLoadingBattle(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - private IEnumerator BattleEndCoroutin(Action callback) - { - while (BattleManagerBase.GetIns() == null) - { - yield return null; - } - SBattleLoad battleLoad = BattleManagerBase.GetIns().SBattleLoad; - while (!battleLoad.isLoadEnd) - { - yield return null; - } - yield return GameMgr.GetIns().GetBattleCtrl().BattleEnd(); - callback(); - } - - private void ConnectNode() - { - MatchingNetworkConnectChecker matchingNetworkConnectCheker = _matchingInstance._matchingNetworkConnectCheker; - matchingNetworkConnectCheker.Start(); - matchingNetworkConnectCheker.OnConnectError = ReturnTitle; - string battleId = Data.BattleRecoveryInfo.battle_id.ToString(); - if (GameMgr.GetIns().GetDataMgr().IsRoomBattleType()) - { - battleId = Data.BattleRecoveryInfo.roomId.ToString(); - } - matchingNetworkConnectCheker.SetBattleId(battleId); - matchingNetworkConnectCheker.SetConnectOnly(); - } - - private void ReturnTitle() - { - for (int i = 0; i < _recoveryCoroutineList.Count; i++) - { - Coroutine routine = _recoveryCoroutineList[i]; - UIManager.GetInstance().StopCoroutine(routine); - routine = null; - } - _recoveryCoroutineList.Clear(); - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(systemText.Get("ErrorHeader_0012")); - dialogBase.SetText(systemText.Get("Error_0012")); - dialogBase.AddButton(DialogBase.ButtonType.BackToTitle); - dialogBase.SetPanelDepth(6000); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate - { - if (_matchingInstance.GetMatchingDataReady() && GameMgr.GetIns().GetBattleCtrl() != null) - { - UIManager.GetInstance().StartCoroutine(BattleEndCoroutin(SoftwareReset)); - } - else - { - SoftwareReset(); - } - }); - } - - private void SoftwareReset() - { - Wizard.SoftwareReset.exec(); - } - - private void OnRecoveryReady() - { - UIManager.GetInstance().createInSceneLoadingMatching(notBlack: true); - UIManager.GetInstance().closeInSceneLoading(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - List list = null; - list = ((!GameMgr.GetIns().IsAINetwork) ? (from i in GameMgr.GetIns().GetNetworkUserInfoData().GetSelfDeck() - select i.CardId).ToList() : AIBattleRecoveryData.SetupInfo.PlayerInfo.DeckCardInfos.Select((DeckCardInfo i) => i?.CardId.Value ?? 100011010).ToList()); - dataMgr.SetCurrentDeckData(list); - dataMgr.SetPlayerCharaId(Data.BattleRecoveryInfo.chara_id); - dataMgr.SetPlayerSubClassID(Data.BattleRecoveryInfo.SubClassId); - dataMgr.SetPlayerMyRotationInfo(Data.BattleRecoveryInfo.MyRotationId); - dataMgr.SetPlayerSleeveId(Data.BattleRecoveryInfo.sleeve_id); - dataMgr.SetSelectDeckFormat(Data.BattleRecoveryInfo.deck_format); - if (GameMgr.GetIns().IsAINetwork) - { - List currentEnemyDeckData = AIBattleRecoveryData.SetupInfo.EnemyInfo.DeckCardInfos.Select((DeckCardInfo i) => i?.CardId.Value ?? 100011010).ToList(); - dataMgr.SetCurrentEnemyDeckData(currentEnemyDeckData); - dataMgr.SetEnemyCharaId(AIBattleRecoveryData.SetupInfo.EnemyInfo.CharaId); - dataMgr.SetEnemySleeveId(AIBattleRecoveryData.SetupInfo.EnemyInfo.SleeveId); - } - else - { - List currentEnemyDeckData2 = (from i in GameMgr.GetIns().GetNetworkUserInfoData().GetOpponentDeck() - select i.CardId).ToList(); - dataMgr.SetCurrentEnemyDeckData(currentEnemyDeckData2); - dataMgr.SetEnemyCharaId(Data.BattleRecoveryInfo.chara_id); - dataMgr.SetEnemySubClassID(Data.BattleRecoveryInfo.OpponentSubClassId); - dataMgr.SetEnemyMyRotationInfo(Data.BattleRecoveryInfo.OpponentMyRotationId); - dataMgr.SetEnemySleeveId(Data.BattleRecoveryInfo.sleeve_id); - } - int playerClassId = dataMgr.GetPlayerClassId(); - int selectDeckId = dataMgr.GetSelectDeckId(); - bool num = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.LAST_BATTLE_IS_TRIALDECK); - _matchingInstance.FirstSetting(playerClassId, selectDeckId, isRecovery: true); - if (num && (Data.BattleRecoveryInfo.BattleParameterInstance.TwoPickFormat != TwoPickFormat.Chaos || Data.BattleRecoveryInfo.BattleParameterInstance.TwoPickFormat != TwoPickFormat.BackdraftChaos)) - { - DeckData deckData = new DeckData(Format.Max, DeckAttributeType.TrialDeck); - deckData.SetDeckID(selectDeckId); - deckData.SetDeckClassID(playerClassId); - deckData.SetCardIdList(list); - deckData.SetDeckName(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_BATTLE_NAME_TRIALDECK)); - dataMgr.SetSelectDeckId(deckData.GetDeckID()); - dataMgr.LastSelectDeckAttributeType = DeckAttributeType.TrialDeck; - dataMgr.SetPlayerCharaIdBySkinId(deckData.GetSkinId()); - } - else if (dataMgr.IsTwoPickBattleType()) - { - DeckData deckData2 = new DeckData(); - deckData2.SetDeckID(0); - deckData2.SetDeckClassID(playerClassId); - deckData2.SetDeckSleeveID(3000011L); - deckData2.SetDeckName(GameMgr.GetIns().GetDataMgr().GetClanNameByKey(playerClassId)); - deckData2.SetCardIdList(list); - dataMgr.SetSelectDeckId(deckData2.GetDeckID()); - dataMgr.LastSelectDeckAttributeType = DeckAttributeType.Invalid; - dataMgr.SetPlayerCharaIdBySkinId(Data.BattleRecoveryInfo.chara_id); - dataMgr._roomTwoPickDeckData = deckData2; - if (dataMgr.m_BattleType == DataMgr.BattleType.TwoPickBackdraft) - { - Data.RoomTwoPickInfo.deckData.classId = dataMgr.GetEnemyClassId(); - dataMgr._roomTwoPickDeckData.SetDeckClassID(dataMgr.GetEnemyClassId()); - } - else - { - Data.RoomTwoPickInfo.deckData.classId = playerClassId; - } - Data.RoomTwoPickInfo.deckData.entryId = 0; - Data.RoomTwoPickInfo.deckData.isSelectCompleted = true; - Data.RoomTwoPickInfo.deckData.cardIds = deckData2.GetCardIdList().ToArray(); - Data.RoomTwoPickBeforeBattleInfo.SetSelfClassIdTwoPickDraftData(playerClassId); - if (Data.BattleRecoveryInfo.BattleParameterInstance.TwoPickFormat == TwoPickFormat.Chaos || Data.BattleRecoveryInfo.BattleParameterInstance.TwoPickFormat == TwoPickFormat.BackdraftChaos) - { - CandidateChaos candidateChaos = Data.RoomTwoPickInfo.CandidateChaos; - candidateChaos.SelectedChaosId = Data.BattleRecoveryInfo.ChaosId; - candidateChaos.SelectedCharaId = Data.BattleRecoveryInfo.chara_id; - candidateChaos.SelectedClassId = Data.BattleRecoveryInfo.class_id; - } - } - if ((bool)ToolboxGame.RealTimeNetworkAgent) - { - CustomPreference.SetNodeServerURL(Data.BattleRecoveryInfo.node_server_url); - } - } - - private int DecideFirstUser(int id) - { - if (id == PlayerStaticData.UserViewerID) - { - return 0; - } - return 1; - } - - private bool IsPlayer(int id) - { - if (id == PlayerStaticData.UserViewerID) - { - return true; - } - return false; - } - - private void ParseRecoveryData() - { - int first_turn = Data.BattleRecoveryInfo.first_turn; - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = DecideFirstUser(first_turn); - Dictionary info = ParseData(isPlayer: true); - Dictionary info2 = ParseData(isPlayer: false); - GameMgr.GetIns().SettingSelfInfo(info, isWatchReplayRecovery: true); - GameMgr.GetIns().SettingOpponentInfo(info2, isWatchReplayRecovery: true); - GameMgr.GetIns().GetNetworkUserInfoData().SetSelfDeck(Data.BattleRecoveryInfo.deck); - } - - private Dictionary ParseData(bool isPlayer) - { - Dictionary dictionary = new Dictionary(); - dictionary.Add("fieldId", Data.BattleRecoveryInfo.field_id); - dictionary.Add("seed", Data.BattleRecoveryInfo.seed); - if (isPlayer) - { - dictionary.Add("viewerId", Data.BattleRecoveryInfo.viewer_id); - dictionary.Add("oppoId", Data.BattleRecoveryInfo.opponent_viewer_id); - dictionary.Add("charaId", Data.BattleRecoveryInfo.chara_id); - dictionary.Add("classId", Data.BattleRecoveryInfo.class_id); - dictionary.Add("sleeveId", Data.BattleRecoveryInfo.sleeve_id); - dictionary.Add("rank", Data.BattleRecoveryInfo.rank); - dictionary.Add("degreeId", Data.BattleRecoveryInfo.degree_id); - dictionary.Add("emblemId", Data.BattleRecoveryInfo.emblem_id); - dictionary.Add("country_code", Data.BattleRecoveryInfo.country_code); - dictionary.Add("userName", Data.BattleRecoveryInfo.name); - dictionary.Add("isOfficial", Data.BattleRecoveryInfo.IsOfficialUser); - dictionary.Add("chaosId", Data.BattleRecoveryInfo.ChaosId); - dictionary.Add("subclassId", Data.BattleRecoveryInfo.SubClassId); - dictionary.Add("rotationId", Data.BattleRecoveryInfo.MyRotationId); - } - else - { - dictionary.Add("viewerId", Data.BattleRecoveryInfo.viewer_id); - dictionary.Add("charaId", Data.BattleRecoveryInfo.opponent_chara_id); - dictionary.Add("classId", Data.BattleRecoveryInfo.opponent_class_id); - dictionary.Add("sleeveId", Data.BattleRecoveryInfo.opponent_sleeve_id); - dictionary.Add("rank", Data.BattleRecoveryInfo.opponent_rank); - dictionary.Add("degreeId", Data.BattleRecoveryInfo.opponent_degree_id); - dictionary.Add("emblemId", Data.BattleRecoveryInfo.opponent_emblem_id); - dictionary.Add("country_code", Data.BattleRecoveryInfo.opponent_country_code); - dictionary.Add("userName", Data.BattleRecoveryInfo.opponent_name); - dictionary.Add("battlePoint", Data.BattleRecoveryInfo.opponent_battle_point); - dictionary.Add("isMasterRank", Data.BattleRecoveryInfo.is_opponent_master_rank); - dictionary.Add("masterPoint", Data.BattleRecoveryInfo.opponent_master_point); - dictionary.Add("isOfficial", Data.BattleRecoveryInfo.IsOpponentOfficialUser); - dictionary.Add("chaosId", Data.BattleRecoveryInfo.OpponentChaosId); - dictionary.Add("subclassId", Data.BattleRecoveryInfo.OpponentSubClassId); - dictionary.Add("rotationId", Data.BattleRecoveryInfo.OpponentMyRotationId); - } - dictionary.Add("isChaosSkinOverride", Data.BattleRecoveryInfo.IsChaosSkinOverride); - return dictionary; - } -} +namespace Wizard.Battle.Recovery; + +// PASS-5 STUB: full body dropped. RecoveryController is client-side coroutine machinery +// (Matching_*, RoomConnectController.BattleRule, RoomBase.SettingOpponentDispData etc.) +// that never runs in the headless node — nothing constructs it (RecoveryNetworkBattleMgr- +// ContentsCreator was deleted in this pass). The type must still exist as a compile-time +// reference because: +// 1. NetworkBattleManagerBase.cs:96 declares `public RecoveryController _recoveryController;` +// as a field that is always null in the node context. +// 2. RecoveryOperationCollection.cs:42 dereferences that field via +// `_recoveryController.RecoveryDataHandlerInstance.OnCompleteRecovery` on the +// IsRecovery=true headless path — the resulting NRE is the pinned failure that +// Spellboost_play_resolution_under_random_draw_plus_spin and Capture_replay_reproduces_ +// post_mulligan_divergence rely on as their expected divergence signal. +// 3. RecoveryDataHandler.cs (also stubbed this pass) touches _recoveryController.IsMariganFinished. +// The two surface members below are the entire external contract. +public class RecoveryController +{ + public RecoveryDataHandler RecoveryDataHandlerInstance => null; +} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryDataHandler.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryDataHandler.cs index 0c021f9c..a928876c 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryDataHandler.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryDataHandler.cs @@ -1,1167 +1,16 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Cute; -using LitJson; -using UnityEngine; -using Wizard.Battle.Mulligan; -using Wizard.Battle.Operation; -using Wizard.Battle.Phase; -using Wizard.Battle.Touch; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Recovery; - -public class RecoveryDataHandler -{ - protected bool isEmitEnterRoom; - - protected NetworkBattleManagerBase _networkBattleMgr; - - protected StockReceiveMgr stockReceiveMessageMgr = new StockReceiveMgr("seq"); - - protected Coroutine _coroutineInBattle; - - protected const string DATA_PARAM_VID = "vid"; - - protected const string DATA_PARAM_URI = "uri"; - - protected const string DATA_PARAM_TIME = "time"; - - private readonly List RecoveryExceptUriList = new List - { - NetworkBattleDefine.NetworkBattleURI.ChatStamp, - NetworkBattleDefine.NetworkBattleURI.Touch, - NetworkBattleDefine.NetworkBattleURI.TurnEndReady, - NetworkBattleDefine.NetworkBattleURI.SelectSkill, - NetworkBattleDefine.NetworkBattleURI.SlideObject, - NetworkBattleDefine.NetworkBattleURI.SelectObject - }; - - private NetworkBattleDefine.NetworkBattleURI _hasSequenceUri; - - private int _hasSequenceResult; - - private bool _isPlayerSend; - - private bool _isOpponentDisconnect; - - private Coroutine _timeOutCoroutine; - - private bool isFirstTimeSet; - - private DateTime _firstTime; - - private DateTime _lastTime; - - private float _pastTime; - - private DateTime _battleStartDate; - - private const int TIMEOUT_TIME = 10; - - private JsonData jsonObject; - - private Action OnFinishRecoveryLogSync; - - private bool isTurnStartWithNoAction; - - private CanNotTouchCardVfx _canNotTouchCardVfx; - - private const float FUSION_WAIT_TIME = 0.3f; - - private const string RECOVERY_KEY = "operations"; - - private const string OPERATION_KEY = "operation"; - - private const string SEQ_KEY = "seq"; - - private const string PLAY_KEY = "play"; - - private const string BOOL_KEY = "bool"; - - private const string INDEX_KEY = "index"; - - private const string SKILL_TARGET_KEY = "skill_target"; - - private const string TARGET_KEY = "target"; - - private const string ATTACK_KEY = "attack"; - - private const string EVOLVE_KEY = "evolve"; - - private const string MULLIGAN_KEY = "mulligan"; - - private const string MULLIGAN_ABANDON = "abandoned_cards"; - - private const string TURN_END_KEY = "turn_end"; - - private const string IS_BURIAL_RITE_KEY = "is_burial_rite"; - - public const string IS_CHOICE_BRAVE_KEY = "is_choice_brave"; - - private const string START_CHOICE_KEY = "start_choice"; - - private const string START_SELECT_KEY = "start_select"; - - public const string START_FUSION_KEY = "start_fusion"; - - private const string SELECT_KEY = "select"; - - public const string SELECT_FUSION_KEY = "select_fusion"; - - private const string CANCEL_SELECT_KEY = "cancel_select"; - - private const string CANCEL_CHOICE_KEY = "cancel_choice"; - - public const string CANCEL_FUSION_KEY = "cancel_fusion"; - - private const string COMP_CHOICE_KEY = "comp_choice"; - - private const string COMP_SELECT_KEY = "comp_select"; - - public const string COMP_FUSION = "comp_fusion"; - - private List _mulliganList = new List(); - - private int playIndex; - - public int receivedMaxSequenceNum { get; protected set; } - - public event Action OnCompleteRecovery; - - public RecoveryDataHandler(NetworkBattleManagerBase networkbattleManager, Action onFinishRecoveringData, Action onFinishRecoveryLogSync, RecoveryOperationInfo aiBattleRecoveryData = null) - { - OnFinishRecoveryLogSync = onFinishRecoveryLogSync; - if (GameMgr.GetIns().IsAINetwork) - { - if (aiBattleRecoveryData != null) - { - AISetup(networkbattleManager, onFinishRecoveringData, aiBattleRecoveryData); - } - else - { - RecoveryManagerBase.OpenRecoveryFailedDialog(); - } - return; - } - string text = OperationRecorderBase.RecordDirectoryPath + "recovery_network.json"; - if (File.Exists(text)) - { - jsonObject = RecoveryOperationInfo.ReadRecoveryFile(text); - Setup(networkbattleManager, onFinishRecoveringData); - } - else - { - RecoveryManagerBase.OpenRecoveryFailedDialog(); - } - } - - private void Setup(NetworkBattleManagerBase networkbattleManager, Action onFinishRecoveringData) - { - _networkBattleMgr = networkbattleManager; - _coroutineInBattle = BattleCoroutine.GetInstance().StartCoroutine(StockDataPlayer(onFinishRecoveringData)); - } - - private void AISetup(NetworkBattleManagerBase networkbattleManager, Action onFinishRecoveringData, RecoveryOperationInfo aiBattleRecoveryData) - { - _networkBattleMgr = networkbattleManager; - _coroutineInBattle = BattleCoroutine.GetInstance().StartCoroutine(AIStockDataPlayer(onFinishRecoveringData, aiBattleRecoveryData)); - } - - public virtual void Stop() - { - BattleCoroutine.GetInstance().StopCoroutine(_coroutineInBattle); - } - - public void OnBattleReceived() - { - Dictionary play_list = Data.BattleRecoveryInfo.play_list; - if (play_list != null && play_list.ContainsKey("uri")) - { - string text = play_list["uri"].ToString(); - if (text != null && text == "Watch") - { - ParseBattleWatchData(play_list); - } - } - } - - private void ParseBattleWatchData(Dictionary received) - { - if (!received.TryGetValue("playlist", out var value) || !(value is List list)) - { - return; - } - for (int i = 0; i < list.Count; i++) - { - Dictionary dictionary = list[i] as Dictionary; - int num = int.Parse(dictionary["seq"].ToString()); - if (receivedMaxSequenceNum < num) - { - receivedMaxSequenceNum = int.Parse(dictionary["seq"].ToString()); - } - if (stockReceiveMessageMgr.CheckStockData(dictionary)) - { - stockReceiveMessageMgr.StockData(dictionary); - } - } - } - - public int GetWatchSequenceNum() - { - return stockReceiveMessageMgr.GetMaxSequenceNumber(); - } - - public int GetCurrentSequenceNumber() - { - return stockReceiveMessageMgr.SequenceAlreadyNumber; - } - - protected IEnumerator StockDataPlayer(Action onFinishRecoveringData) - { - while (true) - { - if ((bool)ToolboxGame.RealTimeNetworkAgent && !ToolboxGame.RealTimeNetworkAgent.IsPlayReceiveDataOk()) - { - yield return null; - continue; - } - if (stockReceiveMessageMgr.SequenceAlreadyNumber == GetWatchSequenceNum()) - { - _networkBattleMgr.GetNetworkBattleReceiver().CheckLatestReplayInfoInRecoveryExceptUriList(); - CallRecoveryFinish(onFinishRecoveringData, waitForAck: true); - } - Dictionary dictionary = stockReceiveMessageMgr.FindData(stockReceiveMessageMgr.SequenceAlreadyNumber + 1); - if (dictionary != null) - { - bool flag = isOwner(dictionary["vid"].ToString()); - string value = dictionary["uri"].ToString(); - if (!Enum.IsDefined(typeof(NetworkBattleDefine.NetworkBattleURI), value)) - { - NextStockReceive(dictionary); - continue; - } - NetworkBattleDefine.NetworkBattleURI networkBattleURI = (NetworkBattleDefine.NetworkBattleURI)Enum.Parse(typeof(NetworkBattleDefine.NetworkBattleURI), value); - if (networkBattleURI == NetworkBattleDefine.NetworkBattleURI.PlayActions || networkBattleURI == NetworkBattleDefine.NetworkBattleURI.TurnStart || networkBattleURI == NetworkBattleDefine.NetworkBattleURI.TurnEndActions || networkBattleURI == NetworkBattleDefine.NetworkBattleURI.Echo) - { - ToolboxGame.RealTimeNetworkAgent.AddActionSequence(); - LocalLog.AccumulateLastTraceLog("uri:" + networkBattleURI.ToString() + " ActionSeq:" + ToolboxGame.RealTimeNetworkAgent.GetActionSequenceCount() + " Recovery"); - } - if (networkBattleURI == NetworkBattleDefine.NetworkBattleURI.BattleStart) - { - DateTime battleStartDate = ((!dictionary.ContainsKey(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.battleStartDate])) ? GetCulculateWaitTime(double.Parse(dictionary["time"].ToString())) : new DateTime(long.Parse(dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.battleStartDate]].ToString()))); - _battleStartDate = battleStartDate; - ToolboxGame.RealTimeNetworkAgent.SetIsBattleStart(flag: true); - } - if (networkBattleURI == NetworkBattleDefine.NetworkBattleURI.JudgeResult) - { - _hasSequenceResult = int.Parse(dictionary[NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.result]].ToString()); - } - RecordLogTime(dictionary, networkBattleURI); - CheckNoAction(flag, networkBattleURI); - if (!flag) - { - bool isOpponentDisconnected = ToolboxGame.RealTimeNetworkAgent.IsOpponentDisconnected; - bool flag2 = networkBattleURI == NetworkBattleDefine.NetworkBattleURI.OppoDisconnect; - _isOpponentDisconnect = isOpponentDisconnected || flag2; - } - if (!RecoveryExceptUriList.Contains(networkBattleURI)) - { - if (networkBattleURI != NetworkBattleDefine.NetworkBattleURI.OppoDisconnect && networkBattleURI != NetworkBattleDefine.NetworkBattleURI.RecoveryStart && networkBattleURI != NetworkBattleDefine.NetworkBattleURI.RecoveryEnd && (networkBattleURI != NetworkBattleDefine.NetworkBattleURI.JudgeResult || _hasSequenceResult != 0)) - { - _hasSequenceUri = networkBattleURI; - _isPlayerSend = flag; - } - if (networkBattleURI == NetworkBattleDefine.NetworkBattleURI.TurnStart && flag) - { - _networkBattleMgr.BattlePlayer.PlayerEmotion.ResetPlayCount(); - } - _networkBattleMgr.GetNetworkBattleReceiver().ReceivedMessage(networkBattleURI, isHaveSequence: true, dictionary, flag, null, checkBreakData: false); - if (_hasSequenceUri == NetworkBattleDefine.NetworkBattleURI.TurnEndFinal || _hasSequenceUri == NetworkBattleDefine.NetworkBattleURI.BattleFinish || _hasSequenceUri == NetworkBattleDefine.NetworkBattleURI.Retire) - { - CallRecoveryFinish(onFinishRecoveringData, waitForAck: false); - } - } - else - { - _networkBattleMgr.GetNetworkBattleReceiver().RecordReplayInfoInRecoveryExceptUriList(networkBattleURI, isHaveSequence: true, dictionary, flag); - } - if (networkBattleURI == NetworkBattleDefine.NetworkBattleURI.ChatStamp && flag) - { - _networkBattleMgr.BattlePlayer.PlayerEmotion.AddPlayCount(); - } - NextStockReceive(dictionary); - } - yield return null; - } - } - - private void NextStockReceive(Dictionary frontData) - { - stockReceiveMessageMgr.UpdateSequenceAlreadyNumber(frontData); - stockReceiveMessageMgr.RemoveSelectData(frontData); - } - - protected IEnumerator AIStockDataPlayer(Action onFinishRecoveringData, RecoveryOperationInfo aiBattleRecoveryData) - { - if (!aiBattleRecoveryData.SetupInfo.HasMulliganInfo) - { - yield return null; - AICallRecoveryFinish(onFinishRecoveringData, waitForAck: true, aiBattleRecoveryData); - } - else - { - SingleMulliganMgr singleMulliganMgr = new SingleMulliganMgr(); - MulliganInfoControl component = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/MulliganInfo") - .GetComponent(); - singleMulliganMgr.InitMulligan(component, _networkBattleMgr.BattlePlayer.PlayerBattleView); - SkillProcessor skillProcessor = new SkillProcessor(); - singleMulliganMgr.MulliganStartDraw(aiBattleRecoveryData.SetupInfo.DidPlayerGoFirst, skillProcessor); - foreach (int playerMulliganReplaceCard in aiBattleRecoveryData.SetupInfo.PlayerMulliganReplaceCards) - { - int cardIndex = playerMulliganReplaceCard; - BattleCardBase battleCardBase = _networkBattleMgr.BattlePlayer.HandCardList.SingleOrDefault((BattleCardBase c) => c.Index == cardIndex); - if (battleCardBase != null) - { - singleMulliganMgr.AbandonList.Add(battleCardBase); - } - } - singleMulliganMgr.Submit(BattleManagerBase.GetIns()); - singleMulliganMgr.GetMulliganInfo().SetPlayerReady(); - IEnumerable _commands = aiBattleRecoveryData.ActionCommands; - EnemyAI ai = BattleManagerBase.GetIns().EnemyAI as EnemyAI; - while (_commands.Any()) - { - IOperationCommand operationCommand = _commands.FirstOrDefault(); - if (operationCommand != null) - { - bool isSelfTurn = _networkBattleMgr.BattlePlayer.IsSelfTurn; - operationCommand.Operation(_networkBattleMgr); - ai.UpdateAICurrentVirtualField(); - if (operationCommand is TurnEndOperationCommand && !_networkBattleMgr.IsBattleEnd) - { - if (isSelfTurn) - { - _networkBattleMgr.ControlTurnStartOpponent(); - } - else - { - _networkBattleMgr.ControlTurnStartPlayer(); - } - ai.UpdateAICurrentVirtualField(); - } - } - _commands = _commands.Skip(1); - yield return null; - } - if (_networkBattleMgr.BattlePlayer.IsSelfTurn) - { - _networkBattleMgr.BattlePlayer.TurnStartEffectEnd(); - } - AICallRecoveryFinish(onFinishRecoveringData, waitForAck: true, aiBattleRecoveryData); - } - yield return null; - } - - private void CheckNoAction(bool isPlayer, NetworkBattleDefine.NetworkBattleURI uri) - { - if (isPlayer) - { - switch (uri) - { - case NetworkBattleDefine.NetworkBattleURI.TurnStart: - isTurnStartWithNoAction = true; - break; - default: - isTurnStartWithNoAction = false; - break; - case NetworkBattleDefine.NetworkBattleURI.OppoDisconnect: - case NetworkBattleDefine.NetworkBattleURI.RecoveryStart: - case NetworkBattleDefine.NetworkBattleURI.RecoveryEnd: - break; - } - } - } - - private void RecordLogTime(Dictionary frontData, NetworkBattleDefine.NetworkBattleURI uri) - { - if (!frontData.ContainsKey("time")) - { - return; - } - if (!_networkBattleMgr._recoveryController.IsMariganFinished) - { - if (!isFirstTimeSet) - { - isFirstTimeSet = true; - _firstTime = GetCulculateWaitTime(double.Parse(frontData["time"].ToString())); - } - } - else if (uri == NetworkBattleDefine.NetworkBattleURI.TurnStart || uri == NetworkBattleDefine.NetworkBattleURI.Ready) - { - isFirstTimeSet = true; - _firstTime = GetCulculateWaitTime(double.Parse(frontData["time"].ToString())); - } - _lastTime = GetCulculateWaitTime(double.Parse(frontData["time"].ToString())); - } - - private void CallRecoveryFinish(Action onFinishRecoveringData, bool waitForAck) - { - onFinishRecoveringData.Call(); - _networkBattleMgr.SetupFieldAndHandAfterRecovery(delegate - { - CompleteRecovery(waitForAck); - }); - } - - private void AICallRecoveryFinish(Action onFinishRecoveringData, bool waitForAck, RecoveryOperationInfo aiBattleRecoveryData) - { - onFinishRecoveringData.Call(); - _networkBattleMgr._recoveryController = null; - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (!aiBattleRecoveryData.SetupInfo.HasMulliganInfo) - { - if (!aiBattleRecoveryData.SetupInfo.HasMulliganInfo) - { - sequentialVfxPlayer = SequentialVfxPlayer.Create(_networkBattleMgr.MulliganMgr.RecoverMulligan(didPlayerSubmitMulligan: false, _networkBattleMgr), InstantVfx.Create(delegate - { - if (_networkBattleMgr.GetCurrentPhase() is RecoveryNetworkBeforeSubmitMulliganPhase recoveryNetworkBeforeSubmitMulliganPhase) - { - recoveryNetworkBeforeSubmitMulliganPhase.RecoveryEnd(); - } - })); - } - } - else - { - _networkBattleMgr.ReinitializeTurnPanelControl(); - _networkBattleMgr.BattlePlayer.PlayerBattleView.ClearPlayQueue(); - if (_networkBattleMgr.BattlePlayer.IsSelfTurn) - { - _networkBattleMgr.BattlePlayer.TurnStartEffectEnd(); - } - _networkBattleMgr.SetupFieldAndHandAfterRecovery(null, aiBattleRecoveryData); - ParallelVfxPlayer vfx = ParallelVfxPlayer.Create(InstantVfx.Create(delegate - { - GameMgr.GetIns().GetBattleCtrl().StartCoroutine(FontChanger.FontChange(null)); - }), _networkBattleMgr.BattlePlayer.Recovery(), _networkBattleMgr.BattleEnemy.Recovery()); - IBattlePlayerView battlePlayerView = (_networkBattleMgr.BattleEnemy.IsSelfTurn ? _networkBattleMgr.BattleEnemy.BattleView : _networkBattleMgr.BattlePlayer.BattleView); - sequentialVfxPlayer.Register(vfx); - sequentialVfxPlayer.Register(HandViewBase.CreateHideCardMeshesVfx(_networkBattleMgr.BattleEnemy.HandCardList)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _networkBattleMgr.BattlePlayer.UpdateHandCardsPlayability(); - })); - sequentialVfxPlayer.Register(battlePlayerView.RecoveryTurnStart()); - sequentialVfxPlayer.Register(_networkBattleMgr.GetCurrentPhase().Setup()); - } - AIOpenRecovery(aiBattleRecoveryData); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _networkBattleMgr.BattlePlayer.PlayerBattleView.ResetTouchable(); - if (_canNotTouchCardVfx != null) - { - _canNotTouchCardVfx.End(); - _canNotTouchCardVfx = null; - } - _networkBattleMgr.RecoveryEnd(); - ToolboxGame.RealTimeNetworkAgent.EndRecovery(); - ToolboxGame.UIManager.CloseInSceneLoadingBattle(); - })); - sequentialVfxPlayer.Register(_networkBattleMgr.JudgeBattleResult()); - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - - private void CompleteRecovery(bool waitForAck) - { - Stop(); - _networkBattleMgr.RecoveryEnd(); - StopTimeOut(); - NetworkBattleReceiver.RESULT_CODE rESULT_CODE = _networkBattleMgr.JudgeCurrentFinishStatus(); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (_networkBattleMgr.IsBattleEnd) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _networkBattleMgr.BattlePlayer.PlayerBattleView.HideTurnEndButton(); - })); - } - bool flag = false; - bool isCheckTimeOutTurnEnd = true; - switch (rESULT_CODE) - { - case NetworkBattleReceiver.RESULT_CODE.DeckoutWin: - CheckDeckoutResult(sequentialVfxPlayer, isDeckoutWin: true); - break; - case NetworkBattleReceiver.RESULT_CODE.DeckoutLose: - CheckDeckoutResult(sequentialVfxPlayer, isDeckoutWin: false); - break; - case NetworkBattleReceiver.RESULT_CODE.NotFinish: - if (_networkBattleMgr._specialWinVfx != null) - { - RegisterSpecialWin(sequentialVfxPlayer); - break; - } - switch (_hasSequenceUri) - { - case NetworkBattleDefine.NetworkBattleURI.TurnEndActions: - if (_isPlayerSend) - { - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = 0; - _networkBattleMgr.SendTurnEnd(); - } - else - { - _networkBattleMgr.networkBattleData.isReceiveTurnEndAction = true; - _networkBattleMgr.SendEcho(_networkBattleMgr.networkBattleData.GetReceiveData().playCardIndex, _networkBattleMgr.networkBattleData.GetReceiveData().actionType, isNotActiveSeq: true); - } - break; - case NetworkBattleDefine.NetworkBattleURI.TurnEnd: - { - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = 0; - bool flag2 = false; - if (!_isPlayerSend) - { - flag2 = true; - } - else if (_networkBattleMgr.BattlePlayer.IsExtraTurn && !_isOpponentDisconnect) - { - flag2 = true; - } - if (flag2) - { - _networkBattleMgr.SendJudge(); - flag = true; - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent.OnAck, new Action>(AckTurnStartToRecoveryEnd)); - } - break; - } - case NetworkBattleDefine.NetworkBattleURI.Ready: - sequentialVfxPlayer.Register(_networkBattleMgr.StartBattle()); - break; - case NetworkBattleDefine.NetworkBattleURI.TurnStart: - if (_networkBattleMgr.BattlePlayer.IsShortageDeck) - { - sequentialVfxPlayer.Register(SendDeckShortage(_networkBattleMgr.BattlePlayer)); - } - else if (_networkBattleMgr.BattleEnemy.IsShortageDeck) - { - sequentialVfxPlayer.Register(SendDeckShortage(_networkBattleMgr.BattleEnemy)); - } - else if (!_isPlayerSend && _networkBattleMgr.BattlePlayer.IsExtraTurn) - { - _networkBattleMgr.SendEcho(_networkBattleMgr.networkBattleData.GetReceiveData().playCardIndex, _networkBattleMgr.networkBattleData.GetReceiveData().actionType); - } - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = ((!_networkBattleMgr.BattlePlayer.IsSelfTurn) ? 1 : 0); - break; - case NetworkBattleDefine.NetworkBattleURI.Judge: - if (_networkBattleMgr.BattlePlayer.IsExtraTurn) - { - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(_networkBattleMgr.ControlTurnStartOpponent()); - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = 0; - isCheckTimeOutTurnEnd = false; - } - else if (_networkBattleMgr.IsBeforePlayerTurn) - { - sequentialVfxPlayer.Register(_networkBattleMgr.ControlTurnStartPlayer()); - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = 0; - isCheckTimeOutTurnEnd = false; - } - else - { - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = 0; - } - break; - default: - if (_networkBattleMgr._recoveryController.IsMariganFinished) - { - GameMgr.GetIns().GetNetworkUserInfoData().TurnState = ((!_networkBattleMgr.BattlePlayer.IsSelfTurn) ? 1 : 0); - } - break; - } - break; - default: - if (_networkBattleMgr.IsBattleEnd) - { - BattlePlayer battlePlayer = _networkBattleMgr.BattlePlayer; - BattleEnemy battleEnemy = _networkBattleMgr.BattleEnemy; - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (battlePlayer.Class.IsDead) - { - parallelVfxPlayer.Register(battlePlayer.Class.DestroyInPlay(new SkillProcessor())); - } - if (battleEnemy.Class.IsDead) - { - parallelVfxPlayer.Register(battleEnemy.Class.DestroyInPlay(new SkillProcessor())); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - } - break; - } - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(SequentialVfxPlayer.Create(InstantVfx.Create(delegate - { - _networkBattleMgr.BattlePlayer.PlayerBattleView.ResetTouchable(); - ToolboxGame.RealTimeNetworkAgent.EndRecovery(); - _networkBattleMgr._recoveryController = null; - if (_networkBattleMgr.BattlePlayer.IsSelfTurn || !Data.BattleRecoveryInfo.IsMulliganEnd) - { - RecoveryCreateRegisterAction(delegate - { - if (!_networkBattleMgr.IsBattleEnd) - { - IPlayerView playerBattleView = _networkBattleMgr.BattlePlayer.PlayerBattleView; - playerBattleView.TurnEndButtonUI._isButtonForcedOff = false; - _networkBattleMgr.BattlePlayer.TurnStartEffectEnd(); - playerBattleView.ShowTurnEndButton(); - } - if (!Data.BattleRecoveryInfo.IsReceivedDeal) - { - _networkBattleMgr.NetworkSender.SendDeal(); - } - if (_canNotTouchCardVfx != null) - { - _canNotTouchCardVfx.End(); - _canNotTouchCardVfx = null; - } - OpenRecovery(isCheckTimeOutTurnEnd); - }); - } - else - { - OpenRecovery(isCheckTimeOutTurnEnd); - } - if (Data.BattleRecoveryInfo.IsMulliganEnd) - { - _networkBattleMgr.BattleUIContainer.Battery.SetActive(value: true); - _networkBattleMgr.BattlePlayer.StatusPanelControl.ShowStatusPanelAlways(); - _networkBattleMgr.BattleEnemy.StatusPanelControl.ShowStatusPanelAlways(); - } - ToolboxGame.UIManager.CloseInSceneLoadingBattle(); - }), sequentialVfxPlayer)); - ToolboxGame.RealTimeNetworkAgent.IsNotPlayReceivingData = false; - if (_hasSequenceUri == NetworkBattleDefine.NetworkBattleURI.TurnEndFinal && rESULT_CODE != NetworkBattleReceiver.RESULT_CODE.NotFinish) - { - _networkBattleMgr.SendJudge(); - } - if ((_hasSequenceUri == NetworkBattleDefine.NetworkBattleURI.JudgeResult && _hasSequenceResult != 0) || _hasSequenceUri == NetworkBattleDefine.NetworkBattleURI.BattleFinish) - { - if (!_isPlayerSend) - { - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(SequentialVfxPlayer.Create(InstantVfx.Create(delegate - { - RealTimeNetworkAgent realTimeNetworkAgent5 = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent5.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent5.OnAck, new Action>(AckBattleFinish)); - StartTimeOut(10, isBattleFinish: true); - _networkBattleMgr.BattleFinishToTurnEndFinal(isSelfTurn: false); - }))); - } - _networkBattleMgr.NetworkSender.SendRecoveryEnd(); - return; - } - if (isCheckTimeOutTurnEnd && _networkBattleMgr.BattlePlayer.IsSelfTurn && (float)TimeUtil.GetElapsedTime(_firstTime, _lastTime.AddSeconds(TimeNativePlugin.GetDeviceOperatingTime())) >= 80f) - { - if (rESULT_CODE != NetworkBattleReceiver.RESULT_CODE.NotFinish) - { - _networkBattleMgr.BattleFinishToTurnEndFinal(_networkBattleMgr.BattlePlayer.IsSelfTurn); - RealTimeNetworkAgent realTimeNetworkAgent2 = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent2.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent2.OnAck, new Action>(AckTurnEndFinalToRecoveryEnd)); - } - else - { - RealTimeNetworkAgent realTimeNetworkAgent3 = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent3.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent3.OnAck, new Action>(AckTurnEndToRecoveryEnd)); - } - } - else if (!flag) - { - _networkBattleMgr.NetworkSender.SendRecoveryEnd(); - } - if (waitForAck) - { - RealTimeNetworkAgent realTimeNetworkAgent4 = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent4.OnAck = (Action>)Delegate.Combine(realTimeNetworkAgent4.OnAck, new Action>(AckToComplete)); - StartTimeOut(10); - } - else - { - AckToComplete(null); - } - } - - private void AckTurnEndToRecoveryEnd(Dictionary objs) - { - if (NetworkBattleGenericTool.FindDictionaryURI(objs) == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnEnd]) - { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckTurnEndToRecoveryEnd)); - _networkBattleMgr.NetworkSender.SendRecoveryEnd(); - } - } - - private void AckTurnEndFinalToRecoveryEnd(Dictionary objs) - { - if (NetworkBattleGenericTool.FindDictionaryURI(objs) == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnEndFinal]) - { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckTurnEndFinalToRecoveryEnd)); - _networkBattleMgr.NetworkSender.SendJudgeResult(NetworkBattleSender.JUDGE_RESULT_STATUS.RecoveryBattleFinishToJudge); - } - } - - private void AckTurnStartToRecoveryEnd(Dictionary objs) - { - if (_networkBattleMgr.BattleEnemy.IsExtraTurn && !_isOpponentDisconnect && NetworkBattleGenericTool.FindDictionaryURI(objs) == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.Judge]) - { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckTurnStartToRecoveryEnd)); - _networkBattleMgr.NetworkSender.SendRecoveryEnd(); - } - else if (NetworkBattleGenericTool.FindDictionaryURI(objs) == NetworkBattleDefine.NetworkURINames[NetworkBattleDefine.NetworkBattleURI.TurnStart]) - { - RealTimeNetworkAgent realTimeNetworkAgent2 = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent2.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent2.OnAck, new Action>(AckTurnStartToRecoveryEnd)); - _networkBattleMgr.NetworkSender.SendRecoveryEnd(); - } - } - - private void AckToComplete(Dictionary objs) - { - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckToComplete)); - this.OnCompleteRecovery.Call(); - } - - private void CheckDeckoutResult(SequentialVfxPlayer afterRecoveryResultVfx, bool isDeckoutWin) - { - if (_networkBattleMgr._specialWinVfx != null) - { - RegisterSpecialWin(afterRecoveryResultVfx); - } - else if (_networkBattleMgr != null && _networkBattleMgr.BattleResultControl != null && !_networkBattleMgr.BattleResultControl.IsResultOn) - { - if (_networkBattleMgr.GetBattlePlayer(isDeckoutWin).IsShortageDeck && _networkBattleMgr.GetBattlePlayer(isDeckoutWin).Class.SkillApplyInformation.IsShortageDeckWin) - { - afterRecoveryResultVfx.Register(SendDeckShortage(_networkBattleMgr.GetBattlePlayer(isDeckoutWin))); - } - else - { - afterRecoveryResultVfx.Register(SendDeckShortage(_networkBattleMgr.GetBattlePlayer(!isDeckoutWin))); - } - } - } - - private void RegisterSpecialWin(SequentialVfxPlayer afterRecoveryResultVfx) - { - afterRecoveryResultVfx.Register(SequentialVfxPlayer.Create(_networkBattleMgr._specialWinVfx, InstantVfx.Create(delegate - { - if (!_isPlayerSend) - { - _networkBattleMgr.SendEchoRecovery(_networkBattleMgr._lastReceivedData); - } - }))); - } - - private void AckBattleFinish(Dictionary objs) - { - StopTimeOut(); - RealTimeNetworkAgent realTimeNetworkAgent = ToolboxGame.RealTimeNetworkAgent; - realTimeNetworkAgent.OnAck = (Action>)Delegate.Remove(realTimeNetworkAgent.OnAck, new Action>(AckBattleFinish)); - this.OnCompleteRecovery.Call(); - } - - private void OpenRecovery(bool isSetTurnTimeoutTimer) - { - OnFinishRecoveryLogSync.Call(); - if (isFirstTimeSet) - { - _pastTime = TimeUtil.GetElapsedTime(_firstTime, _lastTime.AddSeconds(TimeNativePlugin.GetDeviceOperatingTime())); - } - if (isSetTurnTimeoutTimer) - { - _networkBattleMgr.RecoveryTimeOutSetting(0f - _pastTime, Data.BattleRecoveryInfo.IsMulliganEnd, -1L); - _networkBattleMgr.SetTimeDecrementFlag(isTurnStartWithNoAction); - } - ToolboxGame.RealTimeNetworkAgent.StartPreparedStartTimer(_battleStartDate); - } - - private void AIOpenRecovery(RecoveryOperationInfo aiBattleRecoveryData) - { - OnFinishRecoveryLogSync.Call(); - DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0)); - long num = dateTimeOffset.ToUnixTimeSeconds(); - long num2 = (aiBattleRecoveryData.SetupInfo.HasMulliganInfo ? aiBattleRecoveryData.TurnStartTime : aiBattleRecoveryData.MulliganStartTime); - if (num2 == 0L) - { - num2 = aiBattleRecoveryData.OpeningStartTime; - } - if (!_networkBattleMgr.IsBattleEnd) - { - _networkBattleMgr.RecoveryTimeOutSetting(-(num - num2), aiBattleRecoveryData.SetupInfo.HasMulliganInfo, num2); - _networkBattleMgr.SetTimeDecrementFlag(isTurnStartWithNoAction); - } - ToolboxGame.RealTimeNetworkAgent.StartPreparedStartTimer(DateTime.Now.AddSeconds(-(num - num2))); - } - - private void RecoveryCreateRegisterAction(Action callback) - { - if (jsonObject == null) - { - OnFinishRecoveryLogSync.Call(); - return; - } - if (!jsonObject.Keys.Contains("operations")) - { - RecoveryManagerBase.OpenRecoveryFailedDialog(); - return; - } - JsonData jsonData = jsonObject["operations"]; - List> list = new List>(); - for (int i = 0; i < jsonData.Count; i++) - { - Dictionary dictionary = new Dictionary(); - foreach (string key in jsonData[i].Keys) - { - if (key == "abandoned_cards") - { - JsonData jsonData2 = jsonData[i]["abandoned_cards"]; - for (int j = 0; j < jsonData2.Count; j++) - { - _mulliganList.Add(jsonData2[j]); - } - } - dictionary.Add(key, jsonData[i][key]); - } - list.Add(dictionary); - } - _networkBattleMgr.BattlePlayer.PlayerBattleView.TurnEndButtonUI._isButtonForcedOff = true; - _networkBattleMgr.BattlePlayer.PlayerBattleView.TurnEndButtonUI.DisableButton(); - if (_canNotTouchCardVfx == null) - { - _canNotTouchCardVfx = new CanNotTouchCardVfx(); - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx); - } - UIManager.GetInstance().StartCoroutine(StockRecoveryPlayer(list, callback)); - } - - private void AINetworkRecoveryCreateRegisterAction(Action callback) - { - _networkBattleMgr.BattlePlayer.PlayerBattleView.TurnEndButtonUI._isButtonForcedOff = true; - _networkBattleMgr.BattlePlayer.PlayerBattleView.TurnEndButtonUI.DisableButton(); - if (_canNotTouchCardVfx == null) - { - _canNotTouchCardVfx = new CanNotTouchCardVfx(); - _networkBattleMgr.VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx); - } - callback.Call(); - } - - protected virtual IEnumerator StockRecoveryPlayer(List> recoveryDictList, Action callback) - { - bool skipRecoveryData = true; - if (skipRecoveryData && recoveryDictList.Count > 0 && Convert.ToInt32(recoveryDictList.Last()["seq"].ToString()) <= Data.BattleRecoveryInfo.Pub_seq) - { - playIndex = recoveryDictList.Count; - } - while (playIndex < recoveryDictList.Count) - { - if (skipRecoveryData && (bool)ToolboxGame.RealTimeNetworkAgent && !ToolboxGame.RealTimeNetworkAgent.IsPlayReceiveDataOk()) - { - yield return null; - continue; - } - try - { - Dictionary dictionary = recoveryDictList[playIndex]; - new List(); - object obj = null; - BattleCardBase selectPlayCard = null; - bool flag = false; - if (Convert.ToInt32(dictionary["seq"].ToString()) > Data.BattleRecoveryInfo.Pub_seq) - { - string text = dictionary["operation"].ToString(); - switch (text) - { - case "play": - { - BattleCardBase cardBaseByPrefix5 = GetCardBaseByPrefix(dictionary["index"].ToString()); - bool flag3 = int.Parse(dictionary["is_choice_brave"].ToString()) == 1; - if (dictionary.ContainsKey("skill_target")) - { - obj = dictionary["skill_target"]; - } - bool isTargetSelectSkill = obj != null; - VfxBase vfxBase = ((!flag3) ? _networkBattleMgr.OperateMgr.InitSetCard(cardBaseByPrefix5, isPlayer: true, isTargetSelectSkill) : NullVfx.GetInstance()); - List list = CreateSkillTargetListFromJsonData(isTargetSelectSkill, obj); - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(SequentialVfxPlayer.Create(vfxBase, _networkBattleMgr.OperateMgr.PlayCard(cardBaseByPrefix5, isPlayer: true, list, isRecovery: true, null, flag3))); - break; - } - case "attack": - { - BattleCardBase cardBaseByPrefix3 = GetCardBaseByPrefix(dictionary["index"].ToString()); - BattleCardBase cardBaseByPrefix4 = GetCardBaseByPrefix(dictionary["target"].ToString()); - RegisterPairToAttackSelectControl(cardBaseByPrefix3, cardBaseByPrefix4); - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(_networkBattleMgr.OperateMgr.Attack(cardBaseByPrefix3, cardBaseByPrefix4, isPlayer: true)); - break; - } - case "evolve": - { - BattleCardBase cardBaseByPrefix = GetCardBaseByPrefix(dictionary["index"].ToString()); - if (dictionary.ContainsKey("skill_target")) - { - obj = dictionary["skill_target"]; - } - bool isTargetSelectSkill = obj != null; - List list = CreateSkillTargetListFromJsonData(isTargetSelectSkill, obj); - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(_networkBattleMgr.OperateMgr.EvolutionCard(cardBaseByPrefix, isPlayer: true, list)); - break; - } - case "mulligan": - if (!_networkBattleMgr.networkBattleData.isPlayerMulliganEnd) - { - for (int num = 0; num < _mulliganList.Count; num++) - { - BattleCardBase cardBaseByPrefix2 = GetCardBaseByPrefix(_mulliganList[num].ToString()); - _networkBattleMgr.MulliganMgr.PlayerMlgCtrl.RegisterAbandonCard(cardBaseByPrefix2); - } - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(_networkBattleMgr.MulliganMgr.Submit(_networkBattleMgr)); - } - break; - case "start_select": - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - flag = int.Parse(dictionary["bool"].ToString()) == 1; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.StartSelect, _networkBattleMgr, selectPlayCard, flag); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordSelectStart(selectPlayCard); - break; - case "select": - { - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - flag = int.Parse(dictionary["bool"].ToString()) == 1; - bool flag2 = int.Parse(dictionary["is_burial_rite"].ToString()) == 1; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.SelectCard, _networkBattleMgr, selectPlayCard, flag, null, null, flag2); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordSelectCard(selectPlayCard, flag2); - break; - } - case "comp_select": - { - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - flag = int.Parse(dictionary["bool"].ToString()) == 1; - bool flag2 = int.Parse(dictionary["is_burial_rite"].ToString()) == 1; - bool flag3 = int.Parse(dictionary["is_choice_brave"].ToString()) == 1; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.CompleteSelect, _networkBattleMgr, selectPlayCard, flag, null, null, flag2, flag3); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordCompleteSelect(selectPlayCard, flag2, flag3); - break; - } - case "cancel_select": - flag = int.Parse(dictionary["bool"].ToString()) == 1; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.CancelSelect, _networkBattleMgr, null, flag); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordCancelSelect(); - break; - case "start_choice": - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - flag = int.Parse(dictionary["bool"].ToString()) == 1; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.StartChoiceSelect, _networkBattleMgr, selectPlayCard, flag); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordStartChoiceSelect(selectPlayCard); - break; - case "comp_choice": - { - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - flag = int.Parse(dictionary["bool"].ToString()) == 1; - if (dictionary.ContainsKey("skill_target")) - { - obj = dictionary["skill_target"]; - } - bool isTargetSelectSkill = obj != null; - List list = CreateSkillTargetListFromJsonData(isTargetSelectSkill, obj); - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.CompleteChoiceSelect, _networkBattleMgr, selectPlayCard, flag, list); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordCompleteChoiceSelect(list.Select((BattleCardBase c) => c.CardId).ToList()); - break; - } - case "cancel_choice": - flag = int.Parse(dictionary["bool"].ToString()) == 1; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.CancelChoiceSelect, _networkBattleMgr, null, flag); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordCancelChoice(); - break; - case "start_fusion": - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.StartFusionSelect, _networkBattleMgr, selectPlayCard, isEvolveSelect: false); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordStartFusion(selectPlayCard); - break; - case "select_fusion": - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.SelectFusionIngredient, _networkBattleMgr, selectPlayCard, flag); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordSelectFusion(selectPlayCard); - break; - case "cancel_fusion": - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.CancelSelect, _networkBattleMgr, null, isEvolveSelect: false); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).RecordCancelSelect(); - break; - case "comp_fusion": - { - selectPlayCard = GetCardBaseByPrefix(dictionary["index"].ToString()); - if (dictionary.ContainsKey("skill_target")) - { - obj = dictionary["skill_target"]; - } - bool isTargetSelectSkill = obj != null; - EmitHandUtility.SendSelectSkill(NetworkBattleSender.SELECT_SKILL_OPERATION.CompleteFusionSelect, _networkBattleMgr, selectPlayCard, isEvolveSelect: false); - List list = CreateSkillTargetListFromJsonData(isTargetSelectSkill, obj); - SequentialVfxPlayer vfx = SequentialVfxPlayer.Create(InstantVfx.Create(delegate - { - selectPlayCard.BattleCardView.HideHandCardInfo(); - selectPlayCard.BattleCardView.GameObject.transform.localEulerAngles = FusionTargetSelectTouchProcessor.INIT_LOCAL_EULAR_ANGLE; - }), selectPlayCard.SelfBattlePlayer.BattleView.PlayQueueView.AddCardToViewVfx(selectPlayCard.BattleCardView, forceCardIntoPlayQueue: true, isSelectTarget: false, isChoice: false), new SkillSelectHandCardsVfx(list), WaitVfx.Create(0.3f), _networkBattleMgr.OperateMgr.FusionCard(selectPlayCard, isPlayer: true, list)); - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(vfx); - _networkBattleMgr.OperateReceive.GetPlayActionsReflection(flag).ClearData(); - break; - } - case "turn_end": - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - })); - break; - default: - Debug.LogError("Auto test \"" + text + "\" is not supported."); - break; - } - } - playIndex++; - } - catch - { - LocalLog.AccumulateTraceLog("Recovery: Failed to recover actions during disconnection. Force quit recovery. actionName:" + recoveryDictList[playIndex]["operation"].ToString() + ", playIndex:" + playIndex); - callback.Call(); - yield break; - } - yield return null; - } - callback.Call(); - } - - private List CreateSkillTargetListFromJsonData(bool isTargetSelectSkill, object jsonDataObject) - { - if (!isTargetSelectSkill) - { - return null; - } - List list = new List(); - if (jsonDataObject is IEnumerable enumerable) - { - foreach (object item in enumerable) - { - string text = item.ToString(); - BattleCardBase battleCardBase = GetCardBaseByPrefix(text); - if (battleCardBase == null) - { - bool flag = (text.Contains("p") ? true : false); - int num = Convert.ToInt32(text.Replace(flag ? "p" : "e", "")); - if (!CardMaster.GetInstanceForBattle().CardExists(num)) - { - continue; - } - battleCardBase = _networkBattleMgr.CreateTransformCardRegisterVfx(null, num, flag); - } - if (battleCardBase != null) - { - list.Add(battleCardBase); - } - } - } - return list; - } - - private void RegisterTarget(Dictionary jsonData, BattleCardBase actionCard) - { - if (jsonData.ContainsKey("skill_target")) - { - string idxString = jsonData["skill_target"].ToString(); - BattleCardBase cardBaseByPrefix = GetCardBaseByPrefix(idxString); - if (cardBaseByPrefix != null) - { - _networkBattleMgr.VfxMgr.RegisterSequentialVfx(_networkBattleMgr.OperateMgr.BattleCardSelect(actionCard, cardBaseByPrefix, isPlayer: true)); - } - } - } - - private BattleCardBase GetCardBaseByPrefix(string idxString) - { - BattleCardBase result = null; - if (idxString.Contains("p")) - { - int index = Convert.ToInt32(idxString.Replace("p", "")); - result = NetworkBattleGenericTool.GetIndexToCardBase(_networkBattleMgr, _networkBattleMgr.BattlePlayer, index); - } - else if (idxString.Contains("e")) - { - int index2 = Convert.ToInt32(idxString.Replace("e", "")); - result = NetworkBattleGenericTool.GetIndexToCardBase(_networkBattleMgr, _networkBattleMgr.BattleEnemy, index2); - } - return result; - } - - private void RegisterPairToAttackSelectControl(BattleCardBase attackCard, BattleCardBase targetCard) - { - AttackSelectControl.AttackPair attackPair = new AttackSelectControl.AttackPair(attackCard.BattleCardView, targetCard.BattleCardView); - AttackSelectControl attackSelectControl = _networkBattleMgr.BattlePlayer.BattleView.AttackSelectControl; - attackPair._attackTarget._isReady = !attackSelectControl.IsCardTranslatable(targetCard.BattleCardView); - attackSelectControl.RegisterAttackPair(attackPair); - } - - private VfxBase SendDeckShortage(BattlePlayerBase player) - { - VfxBase result = player.SendShortageDeck(); - _networkBattleMgr.BattleFinishToTurnEndFinal(_networkBattleMgr.BattlePlayer.IsSelfTurn); - return result; - } - - private void StartTimeOut(int timer, bool isBattleFinish = false) - { - StopTimeOut(); - _timeOutCoroutine = UIManager.GetInstance().StartCoroutine(StartTimeOutCorutine(timer, isBattleFinish)); - } - - private IEnumerator StartTimeOutCorutine(int timer, bool isBattleFinish = false) - { - long oldTimer = TimeUtil.GetAbsoluteTime().Ticks; - while (timer - NetworkUtility.GetTimeSpanSecond(oldTimer) > 0) - { - yield return null; - } - StopTimeOut(); - if (isBattleFinish) - { - AckBattleFinish(null); - } - else - { - AckToComplete(null); - } - } - - private void StopTimeOut() - { - if (_timeOutCoroutine != null) - { - UIManager.GetInstance().StopCoroutine(_timeOutCoroutine); - _timeOutCoroutine = null; - } - } - - protected DateTime GetCulculateWaitTime(double time) - { - return TimeUtil.MicroTimeToFromUnixTime((long)time); - } - - public bool isOwner(string idStr) - { - if (Convert.ToInt32(idStr) == GameMgr.GetIns().GetNetworkUserInfoData().GetSelfViewerId()) - { - return true; - } - return false; - } -} +using System; + +namespace Wizard.Battle.Recovery; + +// PASS-5 STUB: full 1072-line body dropped. RecoveryDataHandler drove the client-side stock- +// receive-message replay for reconnect flows. Nothing constructs it in the headless node +// (the only ctor callsite was RecoveryController's ctor body, itself now a stub). The type +// must exist because RecoveryOperationCollection.cs:42 accesses +// `_recoveryController.RecoveryDataHandlerInstance.OnCompleteRecovery += ...`. Since +// _recoveryController is always null in the node, the NRE happens on the FIRST deref +// (`_recoveryController.RecoveryDataHandlerInstance`) — we never reach the event +// subscription, so the event body doesn't matter. Kept as a symbol placeholder. +public class RecoveryDataHandler +{ + public event Action OnCompleteRecovery; +} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryManagerBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryManagerBase.cs index 09cd20de..846eb845 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryManagerBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryManagerBase.cs @@ -24,8 +24,6 @@ public abstract class RecoveryManagerBase : IRecoveryManager protected Action EndRecoveryEvent; - protected RecoveryController _recoveryController; - public DataMgr.BattleType BattleType => _operationInfo.BattleType; public bool? DidPlayerGoFirst => _operationInfo.SetupInfo.DidPlayerGoFirst; @@ -95,7 +93,7 @@ public abstract class RecoveryManagerBase : IRecoveryManager dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate { failedRecoveryFlag = false; - UIManager.GetInstance().StartCoroutine(GameMgr.GetIns().GetBattleCtrl().BattleEnd()); + /* Pre-Phase-5b: BattleCtrl.BattleEnd stubbed */ }); failedRecoveryFlag = true; RecoveryRecordManagerBase.DeleteRecoveryFile(); @@ -119,7 +117,7 @@ public abstract class RecoveryManagerBase : IRecoveryManager { try { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: DataMgr not reachable headless dataMgr.m_BattleType = _operationInfo.BattleType; SetupConditionInfo setupInfo = _operationInfo.SetupInfo; BattleConditionPlayerInfo playerInfo = setupInfo.PlayerInfo; @@ -200,8 +198,6 @@ public abstract class RecoveryManagerBase : IRecoveryManager } } - protected abstract List CreateEnemyDeckIDList(BattleConditionEnemyInfo enemyInfo); - public abstract VfxBase Recovery(BattlePlayer battlePlayer, BattleEnemy battleEnemy, Func startCoroutine); public abstract VfxBase UpdateRecovery(); @@ -215,7 +211,7 @@ public abstract class RecoveryManagerBase : IRecoveryManager EndDataRecovery(); return SequentialVfxPlayer.Create(InstantVfx.Create(delegate { - GameMgr.GetIns().GetBattleCtrl().StartCoroutine(FontChanger.FontChange(null)); + /* Pre-Phase-5b: FontChanger UI-only */ }), ParallelVfxPlayer.Create(battlePlayer.BattleView.RecoveryMulligan(), battleEnemy.BattleView.RecoveryMulligan()), InstantVfx.Create(delegate { EndRecoveryEvent.Call(); @@ -232,50 +228,4 @@ public abstract class RecoveryManagerBase : IRecoveryManager _needUpdate = false; EndDataRecoveryEvent.Call(); } - - protected void RecoveryTurnStartPanel() - { - BattleManagerBase.GetIns().ReinitializeTurnPanelControl(); - } - - protected void Dump(BattlePlayer battlePlayer, BattleEnemy battleEnemy) - { - string text = ""; - text += "P Hand :"; - foreach (BattleCardBase handCard in battlePlayer.HandCardList) - { - text = text + " p" + handCard.Index; - } - text += "\nP Inplay :"; - foreach (BattleCardBase inPlayCard in battlePlayer.InPlayCards) - { - text = text + " p" + inPlayCard.Index; - } - text += "\nE Hand :"; - foreach (BattleCardBase handCard2 in battleEnemy.HandCardList) - { - text = text + " e" + handCard2.Index; - } - text += "\nE Inplay :"; - foreach (BattleCardBase inPlayCard2 in battleEnemy.InPlayCards) - { - text = text + " e" + inPlayCard2.Index; - } - } - - protected void ResetLeaderAnimation(BattlePlayer battlePlayer, BattleEnemy battleEnemy) - { - PlayerClassBattleCardView playerClassBattleCardView = battlePlayer.Class.BattleCardView as PlayerClassBattleCardView; - playerClassBattleCardView.ClassCharacter.SetAnimationEnable(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION)); - if (battlePlayer.IsSkinEvolved) - { - playerClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle); - } - EnemyClassBattleCardView enemyClassBattleCardView = battleEnemy.Class.BattleCardView as EnemyClassBattleCardView; - enemyClassBattleCardView.ClassCharacter.SetAnimationEnable(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION)); - if (battleEnemy.IsSkinEvolved) - { - enemyClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryNetworkManagerBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryNetworkManagerBase.cs deleted file mode 100644 index 386a7262..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryNetworkManagerBase.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Recovery; - -public abstract class RecoveryNetworkManagerBase : IRecoveryManager -{ - protected readonly RecoveryOperationInfo _operationInfo; - - protected bool _needUpdate; - - private readonly Queue _skillTargetNameQueue; - - protected Action StartRecoveryEvent; - - protected Action EndDataRecoveryEvent; - - protected Action EndRecoveryEvent; - - public DataMgr.BattleType BattleType => _operationInfo.BattleType; - - public bool? DidPlayerGoFirst => Data.BattleRecoveryInfo.first_turn == PlayerStaticData.UserViewerID; - - public int RandomSeed => Data.BattleRecoveryInfo.seed; - - public bool HasMulliganInfo => false; - - public int BackGroundId => Data.BattleRecoveryInfo.field_id; - - public string BgmId => "NONE"; - - public long RecordTime => long.Parse(DateTime.Now.ToLongTimeString()); - - public int IdxChangeSeed => Data.BattleRecoveryInfo.IdxChangeSeed; - - public static bool failedRecoveryFlag { get; private set; } - - public event Action OnStartRecovery - { - add - { - StartRecoveryEvent = (Action)Delegate.Combine(StartRecoveryEvent, value); - } - remove - { - StartRecoveryEvent = (Action)Delegate.Remove(StartRecoveryEvent, value); - } - } - - public event Action OnEndDataRecovery - { - add - { - EndDataRecoveryEvent = (Action)Delegate.Combine(EndDataRecoveryEvent, value); - } - remove - { - EndDataRecoveryEvent = (Action)Delegate.Remove(EndDataRecoveryEvent, value); - } - } - - public event Action OnEndRecovery - { - add - { - EndRecoveryEvent = (Action)Delegate.Combine(EndRecoveryEvent, value); - } - remove - { - EndRecoveryEvent = (Action)Delegate.Remove(EndRecoveryEvent, value); - } - } - - public RecoveryNetworkManagerBase() - { - } - - public void Setup() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.SetPlayerCharaId(Data.BattleRecoveryInfo.chara_id); - dataMgr.SetEnemyCharaId(Data.BattleRecoveryInfo.opponent_chara_id); - } - - public abstract VfxBase Recovery(BattlePlayer battlePlayer, BattleEnemy battleEnemy, Func startCoroutine); - - public abstract VfxBase UpdateRecovery(); - - public virtual void RecoveryBeforeMulligan() - { - } - - public virtual VfxBase RecoveryMulligan(BattlePlayer battlePlayer, BattleEnemy battleEnemy) - { - return NullVfx.GetInstance(); - } - - public virtual string RecoveryPopSkillTargetCardName() - { - return ""; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryRecordManagerBase.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryRecordManagerBase.cs index 1c02aa09..2c7c8d03 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryRecordManagerBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/RecoveryRecordManagerBase.cs @@ -18,12 +18,6 @@ public abstract class RecoveryRecordManagerBase : IRecoveryRecordManager protected readonly string _recoveryFilePath; - public const string DEFAULT_RECOVERY_SINGLE_FILE_NAME = "recovery_single.json"; - - public const string DEFAULT_RECOVERY_NETWORK_FILE_NAME = "recovery_network.json"; - - public const string DEFAULT_RECOVERY_AI_NETWORK_FILE_NAME = "recovery_ai_network.json"; - protected abstract string DefaultRecoveryFileName { get; } public RecoveryRecordManagerBase() @@ -44,7 +38,7 @@ public abstract class RecoveryRecordManagerBase : IRecoveryRecordManager public virtual void SetupRecording(BattleManagerBase battleMgr, DataMgr.BattleType battleType, int randomSeed, int backGroundId, string bgmId = "NONE") { Directory.CreateDirectory(OperationRecorderBase.RecordDirectoryPath); - _gameMgr = GameMgr.GetIns(); + _gameMgr = null; // Pre-Phase-5b: GameMgr not reachable in ctor headless _battleType = battleType; _recorder = CreateOperationRecorder(); SetupRecorderEvents(_recorder, battleMgr); @@ -81,90 +75,11 @@ public abstract class RecoveryRecordManagerBase : IRecoveryRecordManager } } - public static bool IsExistsNetworkRecoveryFile() - { - return File.Exists(OperationRecorderBase.RecordDirectoryPath + "recovery_network.json"); - } - - public static bool IsExistsAINetworkRecoveryFile() - { - return File.Exists(OperationRecorderBase.RecordDirectoryPath + "recovery_ai_network.json"); - } - public static bool IsExistsSingleRecoveryFile() { return File.Exists(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json"); } - public static bool IsBossRushBattleRetired() - { - if (!IsExistsSingleRecoveryFile()) - { - return false; - } - JsonData jsonData; - try - { - jsonData = RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json"); - } - catch (Exception ex) - { - AbortSoloPlayRecoveryTask task = new AbortSoloPlayRecoveryTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Data.Load.data.InitRecoveryStatus(); - UIManager.GetInstance().isBattleRecovery = false; - DeleteRecoveryFile(); - DialogBase dialogBase = Wizard.ErrorDialog.Dialog.Create(20001); - dialogBase.SetButtonDelegate(delegate - { - SoftwareReset.exec(); - }); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - })); - throw ex; - } - if (!jsonData.Keys.Contains("operations")) - { - return false; - } - for (int num = jsonData["operations"].Count - 1; num >= 0; num--) - { - JsonData jsonData2 = jsonData["operations"][num]; - if (jsonData2.Keys.Contains("ope") && jsonData2["ope"].ToString() == "retire") - { - return true; - } - } - return false; - } - - public static void DeleteTempAINetworkRecoveryFile() - { - if (File.Exists(OperationRecorderBase.RecordDirectoryPath + "temp_recovery_ai_network.json")) - { - File.Delete(OperationRecorderBase.RecordDirectoryPath + "temp_recovery_ai_network.json"); - } - } - - public static DataMgr.BattleType GetRecoveryBattleType() - { - if (IsExistsNetworkRecoveryFile() || IsExistsAINetworkRecoveryFile()) - { - if (IsExistsAINetworkRecoveryFile()) - { - GameMgr.GetIns().IsAINetwork = true; - } - return Data.BattleRecoveryInfo.BattleType; - } - if (IsExistsSingleRecoveryFile()) - { - JsonData jsonData = RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json"); - return (DataMgr.BattleType)jsonData.ToIntOrDefault("battle_type", 100); - } - return DataMgr.BattleType.None; - } - public static void DeleteRecoveryFile() { if (File.Exists(OperationRecorderBase.RecordDirectoryPath + "recovery_network.json")) diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SetupConditionInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SetupConditionInfo.cs index 5c49ca24..deee0d12 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SetupConditionInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SetupConditionInfo.cs @@ -93,7 +93,7 @@ public class SetupConditionInfo : BattleConditionInfo QuestExtraDeckScheduleId = jsonData.ToIntOrDefault("quest_extra_deck_schedule_id", 0); if ((battleType == DataMgr.BattleType.Story || DataMgr.IsQuestBattleType(battleType)) && jsonData.HasKey("story_special_battle_player_attach_skill")) { - GameMgr.GetIns().GetDataMgr().SetSpecialBattleSetting(DidPlayerGoFirst, jsonData.ToStringOrDefault("story_special_battle_player_attach_skill", string.Empty), jsonData.ToStringOrDefault("story_special_battle_enemy_attach_skill", string.Empty), jsonData.ToIntOrDefault("story_special_battle_player_start_pp", 0), jsonData.ToIntOrDefault("story_special_battle_enemy_start_pp", 0), jsonData.ToIntOrDefault("story_special_battle_player_current_life", 0), jsonData.ToIntOrDefault("story_special_battle_player_start_life", 0), jsonData.ToIntOrDefault("story_special_battle_enemy_start_life", 0), jsonData.ToStringOrDefault("story_special_battle_id_override_in_battle_log", string.Empty), jsonData.ToStringOrDefault("story_special_battle_id", string.Empty), jsonData.ToStringOrDefault("story_special_battle_banish_effect_override", string.Empty), jsonData.ToStringOrDefault("story_special_battle_token_draw_effect_override", string.Empty), jsonData.ToStringOrDefault("story_special_battle_special_token_draw_effect_override", string.Empty), jsonData.ToIntOrDefault("story_special_battle_skip_result", 0)); + /* Pre-Phase-5b: SetSpecialBattleSetting is Story/Quest-only; headless is PvP-only */ } if (battleType == DataMgr.BattleType.BossRushQuest) { @@ -122,7 +122,7 @@ public class SetupConditionInfo : BattleConditionInfo switch (battleType) { case DataMgr.BattleType.Practice: - GameMgr.GetIns().GetDataMgr().Practice3DfieldId = jsonData.ToIntOrDefault("practice_3d_field_id", 0); + /* Pre-Phase-5b: Practice3DfieldId is Practice-only; headless is PvP-only */ break; case DataMgr.BattleType.Story: StoryRecoveryData = new StoryRecoveryData(jsonData); diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleOperationRecorder.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleOperationRecorder.cs index 2953184c..7c1b1644 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleOperationRecorder.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleOperationRecorder.cs @@ -22,7 +22,7 @@ public class SingleBattleOperationRecorder : OperationRecorderBase _setupJsonData["player"].SetJsonType(JsonType.Object); _setupJsonData["enemy"] = new JsonData(); _setupJsonData["enemy"].SetJsonType(JsonType.Object); - DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo; + DataMgr.SpecialBattleSetting specialBattleSettingInfo = null; // Pre-Phase-5b: SpecialBattleSettingInfo headless-null if (specialBattleSettingInfo != null) { RecordSpecialBattleSetting(specialBattleSettingInfo); @@ -30,11 +30,6 @@ public class SingleBattleOperationRecorder : OperationRecorderBase WriteJsonData(); } - public void ClearTempRecoveryFilePath() - { - _tempRecoveryFilePath = string.Empty; - } - public override void RecordBattleType(DataMgr.BattleType battleType) { _battleType = battleType; @@ -491,7 +486,7 @@ public class SingleBattleOperationRecorder : OperationRecorderBase _setupJsonData["story_special_battle_banish_effect_override"] = setting.BanishEffectOverRideText; _setupJsonData["story_special_battle_token_draw_effect_override"] = setting.TokenDrawEffectOverrideText; _setupJsonData["story_special_battle_special_token_draw_effect_override"] = setting.SpecialTokenDrawEffectOverrideText; - _setupJsonData["story_special_battle_skip_result"] = (int)GameMgr.GetIns().GetDataMgr().SkipStorySpecialBattleResult; + _setupJsonData["story_special_battle_skip_result"] = 0; // Pre-Phase-5b: SkipStorySpecialBattleResult headless-0 WriteJsonData(); } } @@ -530,32 +525,11 @@ public class SingleBattleOperationRecorder : OperationRecorderBase jsonData["check"]["player"].SetJsonType(JsonType.Object); jsonData["check"]["enemy"] = new JsonData(); jsonData["check"]["enemy"].SetJsonType(JsonType.Object); - BattlePlayer battlePlayer = BattleManagerBase.GetIns().BattlePlayer; - BattleEnemy battleEnemy = BattleManagerBase.GetIns().BattleEnemy; - JsonData jsonData2 = new JsonData(); - jsonData2.SetJsonType(JsonType.Array); - JsonData jsonData3 = new JsonData(); - jsonData3.SetJsonType(JsonType.Array); - JsonData jsonData4 = new JsonData(); - jsonData4.SetJsonType(JsonType.Array); - JsonData jsonData5 = new JsonData(); - jsonData5.SetJsonType(JsonType.Array); - foreach (BattleCardBase handCard in battlePlayer.HandCardList) - { - jsonData2.Add(handCard.GetName()); - } - foreach (BattleCardBase inPlayCard in battlePlayer.InPlayCards) - { - jsonData3.Add(inPlayCard.GetName()); - } - foreach (BattleCardBase handCard2 in battleEnemy.HandCardList) - { - jsonData4.Add(handCard2.GetName()); - } - foreach (BattleCardBase inPlayCard2 in battleEnemy.InPlayCards) - { - jsonData5.Add(inPlayCard2.GetName()); - } + // Pre-Phase-5b: check-block state snapshot dropped headless (no mgr in scope in WriteJsonData) + JsonData jsonData2 = new JsonData(); jsonData2.SetJsonType(JsonType.Array); + JsonData jsonData3 = new JsonData(); jsonData3.SetJsonType(JsonType.Array); + JsonData jsonData4 = new JsonData(); jsonData4.SetJsonType(JsonType.Array); + JsonData jsonData5 = new JsonData(); jsonData5.SetJsonType(JsonType.Array); jsonData["check"]["player"]["hand"] = jsonData2; jsonData["check"]["player"]["inplay"] = jsonData3; jsonData["check"]["enemy"]["hand"] = jsonData4; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryManager.cs deleted file mode 100644 index 873d01fd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryManager.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.Battle.Mulligan; -using Wizard.Battle.Operation; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Recovery; - -public class SingleBattleRecoveryManager : RecoveryManagerBase -{ - protected BattlePlayer _battlePlayer; - - protected BattleEnemy _battleEnemy; - - protected IEnumerable _commands; - - protected bool _isBeforeFramePlayerTurn = true; - - private EnemyAI ai; - - public SingleBattleRecoveryManager(string filePath) - : base(filePath) - { - } - - protected override List CreateEnemyDeckIDList(BattleConditionEnemyInfo enemyInfo) - { - return enemyInfo.DeckCardInfos.Select((DeckCardInfo i) => i.CardId.Value).ToList(); - } - - public override VfxBase Recovery(BattlePlayer battlePlayer, BattleEnemy battleEnemy, Func startCoroutine) - { - BattleManagerBase ins = BattleManagerBase.GetIns(); - ins.IsPreRecovery = true; - _battlePlayer = battlePlayer; - _battleEnemy = battleEnemy; - ai = BattleManagerBase.GetIns().EnemyAI as EnemyAI; - _ = ai; - _battleEnemy.EnableEnemyAI = false; - _battlePlayer.Emotion.Enable = false; - _battleEnemy.Emotion.Enable = false; - BattleManagerBase.GetIns().SetupEvolCount(_operationInfo.SetupInfo.DidPlayerGoFirst); - SingleMulliganMgr singleMulliganMgr = new SingleMulliganMgr(); - MulliganInfoControl component = GameMgr.GetIns().GetGameObjMgr().AddUIContainerChildPrefab("Prefab/UI/MulliganInfo") - .GetComponent(); - singleMulliganMgr.InitMulligan(component, battlePlayer.PlayerBattleView); - StartRecoveryEvent.Call(); - if (!base.HasMulliganInfo) - { - EndDataRecoveryEvent.Call(); - EndRecoveryEvent.Call(); - return NullVfx.GetInstance(); - } - SkillProcessor skillProcessor = new SkillProcessor(); - singleMulliganMgr.MulliganStartDraw(_operationInfo.SetupInfo.DidPlayerGoFirst, skillProcessor); - foreach (int playerMulliganReplaceCard in _operationInfo.SetupInfo.PlayerMulliganReplaceCards) - { - int cardIndex = playerMulliganReplaceCard; - BattleCardBase battleCardBase = battlePlayer.HandCardList.SingleOrDefault((BattleCardBase c) => c.Index == cardIndex); - if (battleCardBase != null) - { - singleMulliganMgr.AbandonList.Add(battleCardBase); - } - } - singleMulliganMgr.Submit(BattleManagerBase.GetIns()); - singleMulliganMgr.GetMulliganInfo().SetPlayerReady(); - _commands = _operationInfo.ActionCommands; - _needUpdate = true; - ins.IsPreRecovery = false; - ins.IsRecovery = true; - return NullVfx.GetInstance(); - } - - public override VfxBase UpdateRecovery() - { - if (!_needUpdate) - { - return NullVfx.GetInstance(); - } - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (_isBeforeFramePlayerTurn) - { - _ = _battleEnemy.IsSelfTurn; - } - if (_battleEnemy.IsSelfTurn) - { - foreach (BattleCardBase handCard in _battleEnemy.HandCardList) - { - handCard.SetOnDraw(draw: false); - } - } - _isBeforeFramePlayerTurn = _battlePlayer.IsSelfTurn; - IOperationCommand operationCommand = _commands.FirstOrDefault(); - if (operationCommand != null) - { - if (ai != null) - { - ai.UpdateAICurrentVirtualField(); - } - operationCommand.Operation(ins); - } - _commands = _commands.Skip(1); - if (_commands.Any() || _commands is TurnEndOperationCommand) - { - return NullVfx.GetInstance(); - } - if (ins is SingleBattleMgr) - { - ((SingleBattleMgr)ins).LifeZeroActivateLeonSkillIfNeeded(); - } - if (ai != null) - { - ai.UpdateAICurrentVirtualField(); - } - EndDataRecovery(); - RecoveryTurnStartPanel(); - _battlePlayer.PlayerBattleView.ClearPlayQueue(); - if (_battlePlayer.IsSelfTurn) - { - _battlePlayer.TurnStartEffectEnd(); - _battlePlayer._isPlayerActive = true; - } - _battleEnemy.BattleEnemyView.ClearPlayQueue(); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(InstantVfx.Create(delegate - { - GameMgr.GetIns().GetBattleCtrl().StartCoroutine(FontChanger.FontChange(null)); - }), _battlePlayer.BattleView.Recovery(_operationInfo.SetupInfo.DidPlayerGoFirst, _battlePlayer.HandCardList.Count > 0), _battleEnemy.BattleView.Recovery(!_operationInfo.SetupInfo.DidPlayerGoFirst), _battlePlayer.Recovery(), _battleEnemy.Recovery()); - string path = GameMgr.GetIns().GetDataMgr().GetPlayerSkinId() - .ToString("00"); - string path2 = GameMgr.GetIns().GetDataMgr().GetEnemySkinId() - .ToString("00"); - parallelVfxPlayer.Register(new WaitLoadResourceVfx(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.ClassCharaBase))); - parallelVfxPlayer.Register(new WaitLoadResourceVfx(Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.ClassCharaBase))); - IBattlePlayerView battlePlayerView = (_battleEnemy.IsSelfTurn ? _battleEnemy.BattleView : _battlePlayer.BattleView); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - sequentialVfxPlayer.Register(parallelVfxPlayer); - sequentialVfxPlayer.Register(HandViewBase.CreateHideCardMeshesVfx(_battleEnemy.HandCardList)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - _battleEnemy.EnableEnemyAI = true; - _battlePlayer.Emotion.Enable = true; - _battleEnemy.Emotion.Enable = true; - ResetLeaderAnimation(_battlePlayer, _battleEnemy); - _battlePlayer.UpdateHandCardsPlayability(); - Dump(_battlePlayer, _battleEnemy); - EndRecoveryEvent.Call(); - })); - sequentialVfxPlayer.Register(battlePlayerView.RecoveryTurnStart()); - ins.IsRecovery = false; - return sequentialVfxPlayer; - } - - public SetupConditionInfo GetSetupConditionInfo() - { - if (_operationInfo == null) - { - return null; - } - return _operationInfo.SetupInfo; - } - - public void CreateRecoveryFileFromTempFile() - { - if (SingleBattleRecoveryRecordManager.IsExistsTempSingleRecoveryFile()) - { - string recordDirectoryPath = OperationRecorderBase.RecordDirectoryPath; - string sourceFileName = recordDirectoryPath + "temp_recovery_single.json"; - string destFileName = recordDirectoryPath + "recovery_single.json"; - File.Copy(sourceFileName, destFileName, overwrite: true); - SingleBattleRecoveryRecordManager.DeleteTempRecoveryFile(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryRecordManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryRecordManager.cs index f87211e3..128f8a7f 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryRecordManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Recovery/SingleBattleRecoveryRecordManager.cs @@ -4,7 +4,6 @@ namespace Wizard.Battle.Recovery; public class SingleBattleRecoveryRecordManager : RecoveryRecordManagerBase { - public const string TEMP_RECOVERY_SINGLE_FILE_NAME = "temp_recovery_single.json"; protected override string DefaultRecoveryFileName => "recovery_single.json"; @@ -34,19 +33,6 @@ public class SingleBattleRecoveryRecordManager : RecoveryRecordManagerBase return new SingleBattleOperationRecorder(_recoveryFilePath); } - public static void DeleteTempRecoveryFile() - { - if (File.Exists(OperationRecorderBase.RecordDirectoryPath + "temp_recovery_single.json")) - { - File.Delete(OperationRecorderBase.RecordDirectoryPath + "temp_recovery_single.json"); - } - } - - public void ClearRecoderTempFilePath() - { - ((SingleBattleOperationRecorder)_recorder).ClearTempRecoveryFilePath(); - } - protected override void SetupRecorderEvents(OperationRecorderBase operationRecorder, BattleManagerBase battleMgr) { base.SetupRecorderEvents(operationRecorder, battleMgr); @@ -138,9 +124,4 @@ public class SingleBattleRecoveryRecordManager : RecoveryRecordManagerBase singleBattleOperationRecorder.RecordChangeAI(logicName, operationQueueCount); } } - - public static bool IsExistsTempSingleRecoveryFile() - { - return File.Exists(OperationRecorderBase.RecordDirectoryPath + "temp_recovery_single.json"); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/BattleResourceMgr.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/BattleResourceMgr.cs index 1ebdaef5..014732e5 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/BattleResourceMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/BattleResourceMgr.cs @@ -1,10 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; -using CriWare; using Cute; using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 23 of 25 methods unrun in baseline +// Type: Wizard.Battle.Resource.BattleResourceMgr +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Resource; @@ -40,8 +43,6 @@ public class BattleResourceMgr : IBattleResourceMgr private bool _recordedLog; - private const float ACCUMULATE_TRACE_LOG_TIME = 10f; - public WaitLoadLoalResourceVfx(string path, Dictionary containerDictionary, bool isAddUIContainer) { _path = path; @@ -71,11 +72,8 @@ public class BattleResourceMgr : IBattleResourceMgr } if (_loadRequest.isDone && !IsEnd) { + // Pre-Phase-5b: Prefab clone + AttachAtlas UI-only; mark done to advance loader GameObject gameObject = null; - gameObject = ((!_isAddUIContainer) ? GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent((GameObject)_loadRequest.asset, GameMgr.GetIns().GetGameObjMgr().GetSubUIContainer()) : GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent((GameObject)_loadRequest.asset, BattleManagerBase.GetIns().BtlUIContainer)); - UIManager.GetInstance().AttachAtlas(new List { gameObject }); - gameObject.SetActive(value: false); - _containerDictionary.Add(_path, gameObject); IsEnd = true; } } @@ -136,12 +134,12 @@ public class BattleResourceMgr : IBattleResourceMgr public virtual VfxBase LoadAsset(string path, ResourcesManager.AssetLoadPathType pathType, Action action) { - return new WaitLoadResourceVfx(Toolbox.ResourcesManager.GetAssetTypePath(path, pathType), action); + return NullVfx.GetInstance(); } public virtual VfxBase LoadAsset(string fullPath, Action action) { - return new WaitLoadResourceVfx(fullPath, action); + return NullVfx.GetInstance(); } public VfxBase LoadCardImageMaterial(int cardId, bool isEvolution, bool isFollower) @@ -231,20 +229,7 @@ public class BattleResourceMgr : IBattleResourceMgr { list.Add("s/" + sePath + ".acb"); } - return new WaitLoadResourceVfx(list, delegate - { - if (_effectBattleInfoDictionary != null && _effectBattleInfoDictionary.ContainsKey(objectPath)) - { - if (_effectBattleInfoDictionary[objectPath].assetObject == null) - { - _effectBattleInfoDictionary[objectPath].assetObject = Toolbox.ResourcesManager.LoadObject(objectFullPath); - } - else - { - _effectBattleInfoDictionary[objectPath].refCount++; - } - } - }); + return NullVfx.GetInstance(); } public void AddEffectBattleInfoDictionary(string objectPath, string sePath) @@ -327,13 +312,8 @@ public class BattleResourceMgr : IBattleResourceMgr GameObject gameObject = UnityEngine.Object.Instantiate(effectBattleInfo.assetObject); EffectBattle effectBattle = gameObject.AddComponent(); effectBattle.engineType = engineType; - effectBattle.ECriAtomSource = gameObject.AddComponent(); - effectBattle.ECriAtomSource.cueName = effectBattleInfo.sePath; - effectBattle.ECriAtomSource.playOnStart = false; - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(gameObject, delegate - { - loadEndCallback.Call(effectBattle); - }, isBattle: true); + // Pre-Phase-5b: SetUIParticleShader VFX no-op — fire callback directly + loadEndCallback.Call(effectBattle); } } })); @@ -528,10 +508,8 @@ public class BattleResourceMgr : IBattleResourceMgr { return null; } - GameObject gobj = m_shardObjectDictionary[path]; - GameObject gameObject = GameMgr.GetIns().GetPrefabMgr().CloneObjectToParent(gobj, BattleManagerBase.GetIns().Battle3DContainer); - UIManager.GetInstance().AttachAtlas(new List { gameObject }); - return gameObject; + // Pre-Phase-5b: InstantiateSharedObject UI-only; return null headless + return null; } public void Dispose() diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/RecoveryBattleResourceMgr.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/RecoveryBattleResourceMgr.cs deleted file mode 100644 index f838b7ce..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Resource/RecoveryBattleResourceMgr.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Cute; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Resource; - -public class RecoveryBattleResourceMgr : BattleResourceMgr -{ - private bool _enable; - - public override VfxBase LoadAsset(string path, ResourcesManager.AssetLoadPathType pathType, Action action) - { - if (_enable) - { - return base.LoadAsset(path, pathType, action); - } - return NullVfx.GetInstance(); - } - - public override VfxBase LoadAsset(string fullPath, Action action) - { - if (_enable) - { - return base.LoadAsset(fullPath, action); - } - return NullVfx.GetInstance(); - } - - public override VfxBase LoadEffectBattle(string objectFullPath, string objectPath, string sePath) - { - if (_enable) - { - return base.LoadEffectBattle(objectFullPath, objectPath, sePath); - } - return NullVfx.GetInstance(); - } - - public override VfxBase LoadAndCreateEffectBattleInstance(string objectPath, EffectMgr.EngineType engineType, string sePath, Action loadEndCallback) - { - if (_enable) - { - return base.LoadAndCreateEffectBattleInstance(objectPath, engineType, sePath, loadEndCallback); - } - return NullVfx.GetInstance(); - } - - public void EnableLoadResouce() - { - _enable = true; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.Sound/LeaderSoundManager.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.Sound/LeaderSoundManager.cs deleted file mode 100644 index 4bcd7ba9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.Sound/LeaderSoundManager.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Cute; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle.Sound; - -public class LeaderSoundManager -{ - public VfxBase CreateLoadResouceVfx(string voiceId, bool isSe = false) - { - if (BattleManagerBase.GetIns() == null || BattleManagerBase.GetIns().IsRecovery) - { - return NullVfx.GetInstance(); - } - string text = (isSe ? "s/se_" : "v/vo_") + voiceId + ".acb"; - if (!Toolbox.ResourcesManager.BattleListAssetPathList.Contains(text)) - { - return new WaitLoadResourceVfx(text); - } - return NullVfx.GetInstance(); - } - - public VfxBase CreatePlayVfx(string voiceId, bool forcePlay = false) - { - if (BattleManagerBase.GetIns() == null || BattleManagerBase.GetIns().IsRecovery) - { - return NullVfx.GetInstance(); - } - return InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlayVoiceByKey(voiceId, forcePlay); - }); - } - - public VfxBase CreatePlaySeVfx(string seId) - { - if (BattleManagerBase.GetIns() == null || BattleManagerBase.GetIns().IsRecovery) - { - return NullVfx.GetInstance(); - } - return InstantVfx.Create(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(seId, 0f, 0L); - }); - } - - public VfxBase CreateLoadAndPlayEvolveSeVfx(string skinId, string suffiix) - { - string text = skinId + "_000_evo" + suffiix; - return SequentialVfxPlayer.Create(CreateLoadResouceVfx(text, isSe: true), CreatePlaySeVfx("se_" + text)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.UI/LogType.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.UI/LogType.cs index 43209153..90eb2bab 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.UI/LogType.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.UI/LogType.cs @@ -2,87 +2,10 @@ namespace Wizard.Battle.UI; public enum LogType { - Null, Turn, Cost, - MulliganChanged, - BuffAdd, - BuffMultiply, - BuffSetAttack, - BuffSetLife, - BuffAddMaxLife, - BuffInHandAdd, - Gain, - AttachSkill, - Heal, - HealSkill, - Damage, - DamageSkill, - CantAttack, ChantCount, - GiveWhiteRitualStack, - DepriveWhiteRitualStack, - AttackCountRecovery, - ChangeDeck, - PlayChoice, - Attack, - AttackCounter, - Metamorphose, - UniteMaterial, Play, - Summon, - WhenPlay, WhenDestroy, - WhenLeave, - WhenAttackSelfAndOtherAfter, - OtherEffect, - EP, - PP, - PPMax, - AddCost, - SetCost, - DrawToken, - DrawCard, Enhance, - Accelerate, - Crystallize, - OverDraw, - OverDrawOnTurnStartDraw, - UsePp, - OpenDrawCard, - ReturnCard, - Discard, - BanishHand, - BanishDeck, - Destroy, - Banish, - Evolution, - EvolutionSkill, - ChangeCemetery, - AwakeBySkill, - AwakeByTurnStart, - BerserkBySkill, - BerserkByWar, - Necromance, - Lose, - ChangeClan, - ChangeTribe, - ChangePlayCount, - BattleLogCardList, - DeckSummonCardList, - FusionInfoList, - FusionIngredientList, - BurialRite, - ShortageDeckWin, - CopiedSkill, - RandomArray, - Fusion, - FusionIngredient, - ClearDestroyedCardList, - ClearSummonedCardList, - Geton, - GetonIngredient, - GetoffIngredient, - ReserveToken, - NotConsumeEp -} + Necromance} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.UI/SkillGainType.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.UI/SkillGainType.cs index be04bb8e..437fb1e4 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.UI/SkillGainType.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.UI/SkillGainType.cs @@ -23,7 +23,6 @@ public enum SkillGainType Indestructible, CantActivateFanfare, CantActivateShortageDeckWin, - ForceAttack, ForceSkillTarget, AttractSkillTarget, Independent, @@ -34,14 +33,8 @@ public enum SkillGainType DecreaseTurnPP, CantPlayUnit, CantSummon, - RepeatFanfare, RepeatLastWord, DamageCut, AttackByLife, - Reflection, DontConsumeEp, - RobLastWords, - ShortageDeckWin, - NotDecreasePP, - Max -} + NotDecreasePP} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs deleted file mode 100644 index fbdf7e3d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NotEmptyNullVfx.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard.Battle.View.Vfx; - -public class NotEmptyNullVfx : VfxBase -{ - private static NotEmptyNullVfx _instance; - - public override bool IsEnd => true; - - public static NotEmptyNullVfx GetInstance() - { - if (_instance == null) - { - _instance = new NotEmptyNullVfx(); - } - return _instance; - } - - protected NotEmptyNullVfx() - { - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullCardVfxCreator.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullCardVfxCreator.cs deleted file mode 100644 index f78738c5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullCardVfxCreator.cs +++ /dev/null @@ -1,236 +0,0 @@ -using UnityEngine; - -namespace Wizard.Battle.View.Vfx; - -public class NullCardVfxCreator : ICardVfxCreator -{ - private static NullCardVfxCreator m_instance; - - public static NullCardVfxCreator GetInstance() - { - if (m_instance == null) - { - m_instance = new NullCardVfxCreator(); - } - return m_instance; - } - - private NullCardVfxCreator() - { - } - - public VfxBase CreateDraw(Vector3 pos, bool isCardRare) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreatePick() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDestroyHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateBanish(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) - { - return NullVfx.GetInstance(); - } - - public VfxWithLoading CreateBanishHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) - { - return NullVfxWithLoading.GetInstance(); - } - - public VfxBase CreateGeton(Transform vehicleCardTrans, IBattleCardView vehicleCardView, BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) - { - return NullVfxWithLoading.GetInstance(); - } - - public VfxWithLoading CreateFusionHand(BattlePlayerBase battlePlayerBase, IBattleCardView fusionCard, bool isFusionMetamorphose) - { - return NullVfxWithLoading.GetInstance(); - } - - public VfxBase CreateParameterChange(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool isDead, bool isEvolve, bool skipWait) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateBuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateBuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDebuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDebuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateBuffStartInHand(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true, bool isDebuff = false) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateGuardStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateGuardStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateKillerStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateKillerStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateProtectionStart(ProtectionColorType tyep) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateProtectionStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateNotBeAttackedStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateNotBeAttackedStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateUntouchableStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateUntouchableStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateQuick(bool hasAttacksRemaining, bool isCardUnableToAttackClass) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateSneakStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateSneakStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateForceCantAttackStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateForceCantAttackStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDrainStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDrainStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateAttack(IBattleCardView attackCardView, IBattleCardView attackTargetCardView) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateAttackFloatUp() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateAttackFloatDown(bool isAttacker, bool isDead, int attackableCount) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateMoving(Vector3 pos) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateDamage(int damage, int currentHealth, int maxHealth, int baseHealth, bool isReflectedDamage, bool IsSkillDamage) - { - return NotEmptyNullVfx.GetInstance(); - } - - public VfxBase CreateHealing(int healAmount, int currentHealth, int maxHealth, int baseHealth) - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateMaskCardInPlay() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateReflectionStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateReflectionStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateHeavenlyAegisStart() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateHeavenlyAegisStop() - { - return NullVfx.GetInstance(); - } - - public VfxBase CreateChangeAffiliation(BattleCardBase card, CardBasePrm.ClanType clan, bool showEffect) - { - return NullVfx.GetInstance(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullVfxWithLoading.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullVfxWithLoading.cs index eb29fe62..2ac83ca8 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullVfxWithLoading.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/NullVfxWithLoading.cs @@ -1,4 +1,8 @@ using System.Collections.Generic; +// TODO(engine-cleanup-pass2): 4 of 7 methods unrun in baseline +// Type: Wizard.Battle.View.Vfx.NullVfxWithLoading +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.View.Vfx; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/VfxResultEventExtension.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/VfxResultEventExtension.cs index 44ebd6b7..0c93d965 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/VfxResultEventExtension.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.View.Vfx/VfxResultEventExtension.cs @@ -1,4 +1,8 @@ using System; +// TODO(engine-cleanup-pass2): 4 of 6 methods unrun in baseline +// Type: Wizard.Battle.View.Vfx.VfxResultEventExtension +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.View.Vfx; diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandCardFrameEffectType.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandCardFrameEffectType.cs index 13037905..ecd50b85 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandCardFrameEffectType.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandCardFrameEffectType.cs @@ -5,8 +5,5 @@ public enum HandCardFrameEffectType NONE = 0, YELLOW = 1, LIGHT_BLUE = 2, - SELECTABLE = 3, - FUSION_METAMORPHOSE = 4, - MAX = 5, NULL = -1 } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandParameter.cs b/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandParameter.cs index 239eff19..84eae0ad 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandParameter.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle.View/HandParameter.cs @@ -6,60 +6,9 @@ public class HandParameter : MonoBehaviour { public enum IconLayout { - Simple, - FixedUse } private struct IconLayoutInfo { - public Vector3 _attackPos; - - public Vector3 _lifePos; - - public Vector3 _costPos; - } - - private static readonly IconLayoutInfo[] ICON_LAYOUT = new IconLayoutInfo[2] - { - new IconLayoutInfo - { - _attackPos = new Vector3(0f, 0f, 0f), - _lifePos = new Vector3(0f, -45.73f, 0f), - _costPos = new Vector3(0f, 0f, 0f) - }, - new IconLayoutInfo - { - _attackPos = new Vector3(0f, -36f, 0f), - _lifePos = new Vector3(0f, -83.1f, 0f), - _costPos = new Vector3(0f, 6.3f, 0f) - } - }; - - [SerializeField] - public GameObject _attackIcon; - - [SerializeField] - public UILabel _attackLabel; - - [SerializeField] - public GameObject _lifeIcon; - - [SerializeField] - public UILabel _lifeLabel; - - [SerializeField] - public GameObject _costIcon; - - [SerializeField] - public UILabel _costLabel; - - [SerializeField] - public UISprite _costSprite; - - public void InitIconPos(IconLayout layout) - { - _attackIcon.transform.localPosition = ICON_LAYOUT[(int)layout]._attackPos; - _lifeIcon.transform.localPosition = ICON_LAYOUT[(int)layout]._lifePos; - _costIcon.transform.localPosition = ICON_LAYOUT[(int)layout]._costPos; } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle/ActionProcessor.cs b/SVSim.BattleEngine/Engine/Wizard.Battle/ActionProcessor.cs index 29bdbdf9..f6bfd40c 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle/ActionProcessor.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle/ActionProcessor.cs @@ -1,897 +1,876 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.Battle.Resource; -using Wizard.Battle.UI; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -namespace Wizard.Battle; - -public class ActionProcessor -{ - private readonly BattlePlayerPair _pair; - - public Action OnPlayComplete; - - public Action OnEvolutionComplete; - - public Action OnAttackComplete; - - public Action OnFusionComplete; - - public Action OnAttackDamageComplete; - - public Action OnAttackProcessComplete; - - public Action OnAttackStart; - - private const float ADMIN_WATCH_CARD_ROTATION_Y = 180f; - - public const float ACCELERATE_WAITTIME = 0.4f; - - public const float CRYSTALLIZE_WAITTIME_BEFORE = 0.2f; - - public const float CRYSTALLIZE_WAITTIME_AFTER = 0.3f; - - public static readonly Vector3 ACCELERATE_POSITION_OFFSET = new Vector3(0f, 0f, -0.03f); - - public event Action> OnBeforePlayCard; - - public event Action> OnBeforeChosenPlayCard; - - public event Action, bool> OnBeforeBurialRitePlayCard; - - public event Func OnAfterPlayCard; - - public event Func OnBeforeAttack; - - public event Func OnBeforeAttackSkillComplete; - - public event Func OnAfterAttack; - - public event Action> OnBeforeEvolution; - - public event Action> OnBeforeChosenEvolution; - - public event Action OnJustBeforeEvolution; - - public event Action OnRightAfterEvolution; - - public event Func OnAfterEvolution; - - public event Action> OnBeforeFusion; - - public event Func OnAfterFusion; - - public event Action OnTransform; - - public event Action OnSpecialAccelerate; - - public ActionProcessor(BattlePlayerPair pair) - { - _pair = pair; - } - - private void GetSelectTargetBySelectList(SkillBase selectSkill, List selectList, List selectTargets, ref int skillIndex) - { - BattlePlayerPair playerInfoPair = new BattlePlayerPair(selectSkill.SkillPrm.ownerCard.SelfBattlePlayer, selectSkill.SkillPrm.ownerCard.OpponentBattlePlayer); - SkillConditionCheckerOption option = new SkillConditionCheckerOption(); - int skillSelectCount = selectSkill.GetSkillSelectCount(); - int num = 1; - if (skillSelectCount >= 2) - { - NetworkBattleManagerBase networkBattleManagerBase = selectSkill.SkillPrm.selfBattlePlayer.BattleMgr as NetworkBattleManagerBase; - num = ((selectSkill.SkillPrm.selfBattlePlayer.IsPlayer || networkBattleManagerBase == null || GameMgr.GetIns().IsAdminWatch || !RegisterValidate.IsValidateCard(selectSkill)) ? Math.Min(skillSelectCount, selectSkill.GetSelectableCards(playerInfoPair, option, isSkipForceSelect: true).Count()) : (from n in networkBattleManagerBase.GetValidateTargetSkillIndexList() - where n == NetworkBattleGenericTool.GetSkillIndex(selectSkill) - select n).Count()); - } - for (int num2 = 0; num2 < num; num2++) - { - if (skillIndex >= selectList.Count) - { - break; - } - selectTargets.Add(new SkillConditionCheckerOption.SkillAndSelectTarget(selectList[skillIndex], selectSkill)); - skillIndex++; - } - } - - private VfxBase SetSkillConditionCheckeroptionSelectCards(BattleCardBase card, SkillConditionCheckerOption option, IEnumerable cards, bool isEvolve, List selectChoiceCardIdList, bool isFusion = false, bool isChoiceBrave = false) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SkillCollectionBase skillCollectionBase = (isEvolve ? card.EvolutionSkills : card.Skills); - bool isChoiceTransform = false; - List list = null; - if (cards != null) - { - list = cards.ToList(); - } - if (!isFusion && skillCollectionBase.Any((SkillBase s) => s is Skill_transform)) - { - BattlePlayerReadOnlyInfoPair playerInfoPair = new BattlePlayerReadOnlyInfoPair(card.SelfBattlePlayer, card.OpponentBattlePlayer); - CardMaster instanceForBattle = CardMaster.GetInstanceForBattle(); - for (int num = 1; num < skillCollectionBase.Count(); num++) - { - if (skillCollectionBase.Get(num) is Skill_transform skill_transform) - { - Skill_pp_fixeduse skill_pp_fixeduse = skillCollectionBase.Get(num - 1) as Skill_pp_fixeduse; - if (false || (skill_transform.TransformId != -1 && skill_pp_fixeduse != null && skill_pp_fixeduse.IsMutationFixedUseCost && skill_pp_fixeduse.CheckCondition(playerInfoPair, option, isPrePlay: true) && card.GetAccelerateOrCrystallizeTransformSkill() != null)) - { - BattleCardBase.TransformType transformType = ((skill_transform.OnWhenAccelerate != 0) ? BattleCardBase.TransformType.Accelerate : BattleCardBase.TransformType.Crystallize); - sequentialVfxPlayer.Register(SwapTransformCard(card, card.BaseParameter.IsFoil ? instanceForBattle.GetCardParameterFromId(skill_transform.TransformId).FoilCardId : skill_transform.TransformId, option, transformType, selectChoiceCardIdList, list)); - this.OnSpecialAccelerate.Call(skill_pp_fixeduse); - this.OnSpecialAccelerate.Call(skill_transform); - } - if (skillCollectionBase.Get(num - 1) is Skill_choice skill_choice && skill_choice.CheckCondition(playerInfoPair, option, isPrePlay: true)) - { - isChoiceTransform = true; - } - } - } - } - if (cards == null && selectChoiceCardIdList == null) - { - return sequentialVfxPlayer; - } - SkillBase skillBase = card.GetSelectTypeSkill(isEvolve, isFusion: false, isRegister: false, isEvolutionSimpleProcessor: false, isChoiceCheck: true).FirstOrDefault((SkillBase s) => s is Skill_choice); - int num2 = 1; - if (skillBase != null) - { - num2 = SetupChoiceCard(card, option, selectChoiceCardIdList, skillBase, list, isChoiceTransform, sequentialVfxPlayer, isChoiceBrave); - } - if (list != null && list.Count > 0) - { - BattleCardBase battleCardBase = card; - if (option.PlayedCard != null && card != option.PlayedCard) - { - battleCardBase = option.PlayedCard; - } - IEnumerable selectTypeSkill = battleCardBase.GetSelectTypeSkill(isEvolve, isFusion: false, isRegister: true); - int num3 = selectTypeSkill.Where((SkillBase s) => s.IsBurialRite).Count(); - List list2 = selectTypeSkill.Where((SkillBase s) => !(s is Skill_none)).ToList(); - int skillIndex = num3; - for (int num4 = 0; num4 < list2.Count; num4++) - { - if (list2[num4].IsChoiceType) - { - num4 += num2 - 1; - } - else if (list2[num4].IsBurialRite) - { - if (list2[num4].IsUserSelectType) - { - GetSelectTargetBySelectList(list2[num4], list, option.SelectedCards, ref skillIndex); - } - } - else - { - GetSelectTargetBySelectList(list2[num4], list, option.SelectedCards, ref skillIndex); - } - } - for (int num5 = 0; num5 < num3; num5++) - { - option.BurialRiteCards.Add(list[num5]); - } - if (num3 > 0) - { - card.SkillApplyInformation.ClearLastBurialRiteCardList(); - card.SkillApplyInformation.AddLastBurialRiteCardList(list); - } - } - return sequentialVfxPlayer; - } - - private int SetupChoiceCard(BattleCardBase card, SkillConditionCheckerOption option, List selectChoiceCardIdList, SkillBase selectChoiceSkill, List selectList, bool isChoiceTransform, SequentialVfxPlayer vfx, bool isChoiceBrave) - { - int num = 1; - if (option.PlayedCard == null) - { - option.PlayedCard = card; - } - int num2 = -1; - if (selectChoiceSkill.ApplySelectFilter is SkillChoiceSelectFilter) - { - num = ((SkillChoiceSelectFilter)selectChoiceSkill.ApplySelectFilter).CalcCount(selectChoiceSkill.OptionValue); - } - if (selectChoiceCardIdList != null && selectChoiceCardIdList.Count >= 1) - { - foreach (int selectChoiceCardId in selectChoiceCardIdList) - { - num2 = selectChoiceCardId; - option.ChosenCards.Add(num2); - } - } - else if (selectList != null && selectList.Count > 0) - { - for (int i = 0; i < num; i++) - { - BattleCardBase battleCardBase = selectList[i]; - num2 = battleCardBase.BaseParameter.CardId; - option.ChosenCards.Add(num2); - if (isChoiceTransform || isChoiceBrave) - { - selectList.Remove(battleCardBase); - } - } - } - if (num2 >= 0 && isChoiceTransform) - { - vfx.Register(SwapTransformCard(card, num2, option, BattleCardBase.TransformType.Choice, selectChoiceCardIdList, selectList)); - } - return num; - } - - private VfxBase SwapTransformCard(BattleCardBase originalCard, int transformCardID, SkillConditionCheckerOption option, BattleCardBase.TransformType transformType, List selectChoiceCardIdList, List selectList) - { - bool isMutation = transformType == BattleCardBase.TransformType.Accelerate || transformType == BattleCardBase.TransformType.Crystallize; - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - BattleCardBase transformCard = originalCard.SelfBattlePlayer.CreateCard(transformCardID, originalCard.Index); - transformCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - transformCard.BattleCardView.GameObject.SetActive(value: false); - })); - sequentialVfxPlayer2.Register(InstantVfx.Create(delegate - { - if (!BattleManagerBase.GetIns().IsRecovery) - { - Transform transform = transformCard.BattleCardView.Transform; - Transform transform2 = originalCard.BattleCardView.Transform; - transform.position = transform2.position; - transform.rotation = transform2.rotation; - if (GameMgr.GetIns().IsWatchBattle || GameMgr.GetIns().IsReplayBattle) - { - transform.parent = originalCard.SelfBattlePlayer.BattleView.HandDeck.transform; - } - else - { - transform.parent = transform2.parent; - } - transform.localScale = transform2.localScale; - transform.SetSiblingIndex(transform2.GetSiblingIndex()); - if (!isMutation) - { - transformCard.BattleCardView.CardTemplate.DynamicSetupMaterials(transformCard, BattleManagerBase.GetIns().BattleResourceMgr); - originalCard.BattleCardView.GameObject.SetActive(value: false); - transformCard.BattleCardView.GameObject.SetActive(value: true); - } - } - })); - if (isMutation) - { - sequentialVfxPlayer.Register(sequentialVfxPlayer2); - } - else - { - transformCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(sequentialVfxPlayer2); - } - transformCard.SetOnDraw(draw: false); - originalCard.MetamorphoseCard = transformCard; - transformCard.TransformInfo = new BattleCardBase.TransformInformation(transformType, originalCard); - option.PlayedCard = transformCard; - option.SummonedCard = transformCard; - SkillBase skillBase = transformCard.GetSelectTypeSkill().FirstOrDefault((SkillBase s) => s is Skill_choice); - if (skillBase != null) - { - SetupChoiceCard(transformCard, option, selectChoiceCardIdList, skillBase, selectList, isChoiceTransform: false, sequentialVfxPlayer, isChoiceBrave: false); - } - this.OnTransform.Call(originalCard, transformCardID, !isMutation); - return sequentialVfxPlayer; - } - - private VfxBase SetupPlayCard(BattleCardBase originalCard, BattleCardBase playCard, SkillProcessor skillProcessor, bool isChoiceBrave) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - bool isMutation = originalCard.CheckConditionFixedUseCost(isPrePlay: true) && originalCard.CalcFixedUseCost(originalCard.SelfBattlePlayer.Pp) < originalCard.Cost; - GameMgr gameMgr = GameMgr.GetIns(); - bool isAdminWatch = gameMgr.IsAdminWatch; - BattleManagerBase battleMgr = BattleManagerBase.GetIns(); - if (!isChoiceBrave) - { - sequentialVfxPlayer.Register(playCard.SelfBattlePlayer.ReplaceInHand(originalCard, playCard, skillProcessor)); - } - if (isMutation) - { - sequentialVfxPlayer.Register(battleMgr.LoadCardResources(new List { playCard })); - } - if (!battleMgr.IsRecovery) - { - playCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate - { - originalCard.SelfBattlePlayer.BattleView.HandView.RemoveCardFromView(originalCard.BattleCardView, 0.3f); - })); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (!battleMgr.IsRecovery) - { - playCard.SelfBattlePlayer.BattleView.PlayQueueView.RemoveCardFromView(originalCard.BattleCardView, (isAdminWatch && isMutation) || isChoiceBrave); - if (isMutation) - { - playCard.BattleCardView.CardTemplate.DynamicSetupMaterials(playCard, battleMgr.BattleResourceMgr); - } - } - })); - if (!isMutation) - { - sequentialVfxPlayer.Register(battleMgr.OperateMgr.InitSetCard(playCard, playCard.SelfBattlePlayer.IsPlayer, isSelect: false, isRecovery: false, isChoiceSelect: true, isAccelerateSelect: false, registerDirectlyToVfxManager: true, isFusionWait: false, isChoiceBrave)); - } - else - { - bool isChoice = playCard.GetSelectTypeSkill().Any((SkillBase s) => s is Skill_choice); - sequentialVfxPlayer.Register(playCard.SelfBattlePlayer.BattleView.PlayQueueView.InstantAddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isChoice)); - if (isMutation) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - Vector3 position = originalCard.BattleCardView.GameObject.transform.position; - position += ACCELERATE_POSITION_OFFSET; - Quaternion rot = originalCard.BattleCardView.GameObject.transform.rotation; - if (!playCard.IsSpell && playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView)) - { - Vector3 localEulerAngles = originalCard.BattleCardView.GameObject.transform.localEulerAngles; - rot = Quaternion.Euler(localEulerAngles.x, 0f, localEulerAngles.z); - } - gameMgr.GetEffectMgr().Start(playCard.IsSpell ? EffectMgr.EffectType.CMN_CARD_ACCELERATE_1 : EffectMgr.EffectType.CMN_CARD_CRYSTALLIZE_1, playCard.IsSpell ? position : originalCard.BattleCardView.GameObject.transform.position, rot, 31); - })); - sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.2f)); - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - CardTemplate cardTemplate = originalCard.BattleCardView.CardTemplate; - cardTemplate.SetEffectStyle(UILabel.Effect.None); - if (originalCard is UnitBattleCard) - { - cardTemplate.NormalAtkLabelTemp.effectStyle = UILabel.Effect.None; - cardTemplate.NormalLifeLabelTemp.effectStyle = UILabel.Effect.None; - } - })); - sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0f)); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - if (!battleMgr.IsRecovery && isMutation) - { - Transform transform = playCard.BattleCardView.Transform; - Transform transform2 = originalCard.BattleCardView.Transform; - if (playCard.IsSpell || playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView)) - { - MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 31); - playCard.BattleCardView.Transform.SetParent(battleMgr.CutInContainer.transform, worldPositionStays: false); - } - if (playCard.IsSpell) - { - transform.position = transform2.position; - transform.localScale = transform2.localScale; - originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); - originalCard.BattleCardView.GameObject.SetActive(value: false); - playCard.BattleCardView.GameObject.SetActive(value: true); - playCard.BattleCardView.ShowInHandFrameEffect(enable: true, HandCardFrameEffectType.LIGHT_BLUE); - originalCard.BattleCardView.CardTemplate.SetEffectStyle(UILabel.Effect.None); - } - else - { - transform.position = transform2.position; - transform.localScale = transform2.localScale; - originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); - originalCard.BattleCardView.GameObject.SetActive(value: false); - playCard.BattleCardView.GameObject.SetActive(value: true); - originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); - } - } - })); - if (isMutation) - { - sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.3f)); - if (!playCard.IsSpell) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - originalCard.BattleCardView.GameObject.SetActive(value: false); - MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 10); - })); - } - } - } - return sequentialVfxPlayer; - } - - public VfxBase PlayCard(BattleCardBase card, IEnumerable selectedCards, List selectChoiceId = null, bool isChoiceBrave = false) - { - if (selectedCards != null) - { - foreach (BattleCardBase selectedCard in selectedCards) - { - selectedCard.SelfBattlePlayer.AddLastTargetCardsList(selectedCard); - } - } - SetIndividualId(card.NormalSkills); - if (card.NormalSkills.Any((SkillBase s) => s.HasIndividualId)) - { - card.SelfBattlePlayer.BattleMgr.IncrementIndividualId(); - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SkillProcessor skillProcessor = new SkillProcessor(); - BattleCardBase battleCardBase = card; - SkillConditionCheckerOption skillConditionCheckerOption = new SkillConditionCheckerOption(); - skillConditionCheckerOption.PlayedCard = card; - skillConditionCheckerOption.SummonedCard = card; - if (isChoiceBrave) - { - card.SelfBattlePlayer.IsAlreadyChoiceBraveInThisTurn = true; - card.SelfBattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); - card.SelfBattlePlayer.BattleView.UpdateChoiceBraveActivatingEffect(isActivating: false); - int cardId = ((selectChoiceId != null && selectChoiceId.Count > 0) ? selectChoiceId[0] : selectedCards.First().CardId); - BattleCardBase selectSkillCard = (CardMaster.IsChoiceBraveCardCheck(card.CardId) ? card : ((selectedCards != null && selectedCards.Count() > 1 && (card.IsPlayer || GameMgr.GetIns().IsAdminWatch)) ? selectedCards.First() : null)); - skillConditionCheckerOption.PlayedCard = card.SelfBattlePlayer.BattleMgr.ReplaceChoiceBraveCard(card, cardId, selectSkillCard); - } - sequentialVfxPlayer.Register(SetSkillConditionCheckeroptionSelectCards(card, skillConditionCheckerOption, selectedCards, isEvolve: false, selectChoiceId, isFusion: false, isChoiceBrave)); - if (battleCardBase != skillConditionCheckerOption.PlayedCard) - { - if (battleCardBase.SkillApplyInformation.SkillRandomArray == null) - { - skillConditionCheckerOption.PlayedCard.SkillApplyInformation.GiveSkillRandomArray(battleCardBase.SkillApplyInformation.SkillRandomArray); - } - battleCardBase = skillConditionCheckerOption.PlayedCard; - sequentialVfxPlayer.Register(SetupPlayCard(card, battleCardBase, skillProcessor, isChoiceBrave)); - BattleManagerBase.GetIns().PSideLogControl.RemoveAllLog(); - } - battleCardBase.SetPlayedTurnNow(); - int count = skillConditionCheckerOption.ChosenCards.Count; - int num = selectedCards?.Count() ?? 0; - if (count > 0 && num - count < 0) - { - List list = ((selectedCards != null) ? selectedCards.ToList() : new List()); - foreach (int chosenCard in skillConditionCheckerOption.ChosenCards) - { - BattleCardBase item = BattleManagerBase.GetIns().CreateTransformCardRegisterVfx(skillConditionCheckerOption.PlayedCard, chosenCard, skillConditionCheckerOption.PlayedCard.IsPlayer); - list.Insert(0, item); - } - selectedCards = list; - } - this.OnBeforePlayCard.Call(card, battleCardBase, selectedCards); - this.OnBeforeChosenPlayCard.Call(card, battleCardBase, skillConditionCheckerOption.ChosenCards); - if (skillConditionCheckerOption.BurialRiteCards != null && skillConditionCheckerOption.BurialRiteCards.Count > 0) - { - this.OnBeforeBurialRitePlayCard.Call(battleCardBase, selectedCards, arg3: false); - } - bool isEnhance = battleCardBase.CheckConditionFixedUseCost(isPrePlay: true); - VfxWith vfxWith = card.PlayChoiceCard(skillProcessor, skillConditionCheckerOption); - VfxWith vfxWith2 = battleCardBase.PlayCard(skillProcessor, skillConditionCheckerOption, isInplayGeneration: false, card); - VfxBase vfx = battleCardBase.SelfBattlePlayer.StartSkillWhenChangeInplay(null, new List { battleCardBase }, skillProcessor); - skillProcessor.Register(vfxWith.Value); - skillProcessor.Register(vfxWith2.Value); - VfxBase vfx2 = _pair.Self.StartSkillWhenPlayOtherEnhanceAndAccelerateAndCrystallize(battleCardBase, isEnhance, skillProcessor); - VfxBase vfx3 = _pair.Self.StartSkillWhenSummonOther(battleCardBase, skillProcessor); - VfxBase vfx4 = skillProcessor.Process(_pair); - if (card != battleCardBase && card.Skills.HaveBeforeChoiceSkill()) - { - BattleLogManager.GetInstance().AddLogPlayAsChoiceTransform(battleCardBase); - } - VfxBase vfxBase = battleCardBase.FinishWhenPlaySkill(); - VfxBase allFuncVfxResults = this.OnAfterPlayCard.GetAllFuncVfxResults(battleCardBase); - BattleUIContainer battleUIContainer = BattleManagerBase.GetIns().BattleUIContainer; - bool isSelfTurn = BattleManagerBase.GetIns().BattlePlayer.IsSelfTurn; - if (isSelfTurn) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - battleUIContainer.PlayerCardPlaying = true; - if (battleUIContainer.IsEnableMenu()) - { - battleUIContainer.DisableMenu(); - } - })); - } - sequentialVfxPlayer.Register(vfxWith2.Vfx); - sequentialVfxPlayer.Register(vfx); - sequentialVfxPlayer.Register(battleCardBase.StopSpellCharge()); - sequentialVfxPlayer.Register(vfx2); - sequentialVfxPlayer.Register(vfx3); - sequentialVfxPlayer.Register(vfx4); - if (vfxBase != null) - { - sequentialVfxPlayer.Register(vfxBase); - } - if (allFuncVfxResults.IsVfxNonEmpty()) - { - sequentialVfxPlayer.Register(allFuncVfxResults); - } - Action handleBattleMenu = delegate - { - }; - if (isSelfTurn) - { - handleBattleMenu = delegate - { - battleUIContainer.PlayerCardPlaying = false; - if (BattleManagerBase.GetIns().BattlePlayer.BattleView.PlayQueueView.QueueCount() == 0 && !battleUIContainer.IsEnableMenu()) - { - battleUIContainer.RequestEnableMenuWhenTouchable(); - } - }; - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - BattlePlayer battlePlayer = BattleManagerBase.GetIns().BattlePlayer; - handleBattleMenu(); - int num2 = battlePlayer.BattleView.PlayQueueView.QueueCount(); - bool isSelecting = battlePlayer.BattleView.IsSelecting; - if (num2 == 0 && !isSelecting && !battlePlayer.IsDuringChoiceBrave) - { - battlePlayer.BattleView.ClearSelectCardList(); - } - })); - OnPlayComplete.Call(); - return sequentialVfxPlayer; - } - - private void SetIndividualId(SkillCollectionBase skills) - { - for (int i = 0; i < skills.Count(); i++) - { - skills.ElementAt(i).InitSetIndividualId(); - } - } - - public VfxBase Attack(IBattleCardUniqueID attackCardId, IBattleCardUniqueID targetCardId) - { - BattleCardBase attackCard = _pair.Self.InPlayCards.SingleOrDefault((BattleCardBase c) => c.EquelsID(attackCardId)); - IfNullCardThenException(attackCard, attackCardId, "場"); - if (attackCard.SkillApplyInformation.IsQuick) - { - attackCard.SelfBattlePlayer.GameQuickAttackCards.Add(attackCard); - } - BattleCardBase battleCardBase = ((targetCardId.IsPlayer == _pair.Self.IsPlayer) ? _pair.Self.ClassAndInPlayCardList.SingleOrDefault((BattleCardBase c) => c.EquelsID(targetCardId)) : _pair.Opponent.ClassAndInPlayCardList.SingleOrDefault((BattleCardBase c) => c.EquelsID(targetCardId))); - IfNullCardThenException(battleCardBase, targetCardId, "場"); - attackCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - OnAttackStart.Call(attackCard, battleCardBase); - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SkillProcessor skillProcessor = new SkillProcessor(); - SkillCollectionBase skills = attackCard.Skills; - foreach (SkillBase item in skills) - { - if (item.IsBeforAttackSkill) - { - VfxWith vfxWith = skills.CreateBeforeAttackInfo(item, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); - skillProcessor.Register(vfxWith.Value); - sequentialVfxPlayer.Register(vfxWith.Vfx); - if (vfxWith.Value != null) - { - attackCard.SelfBattlePlayer.PredictionWarningCards.Add(attackCard); - } - } - if (item.IsWhenFightSkill) - { - VfxWith vfxWith2 = skills.CreateBeforeFightInfo(item, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); - skillProcessor.Register(vfxWith2.Value); - sequentialVfxPlayer.Register(vfxWith2.Vfx); - if (vfxWith2.Value != null) - { - attackCard.SelfBattlePlayer.PredictionWarningCards.Add(attackCard); - } - } - } - SkillCollectionBase skills2 = battleCardBase.Skills; - foreach (SkillBase item2 in skills2) - { - if (item2.IsWhenFightSkill) - { - VfxWith vfxWith3 = skills2.CreateBeforeFightInfo(item2, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(battleCardBase.SelfBattlePlayer, battleCardBase.OpponentBattlePlayer)); - skillProcessor.Register(vfxWith3.Value); - sequentialVfxPlayer.Register(vfxWith3.Vfx); - if (vfxWith3.Value != null) - { - attackCard.SelfBattlePlayer.PredictionWarningCards.Add(attackCard); - } - } - } - foreach (BattleCardBase item3 in from c in _pair.Self.ClassAndInPlayCardList.Concat(_pair.Opponent.ClassAndInPlayCardList) - where c.Skills._skillTimingInfo.IsBeforeAttackSelfAndOther - select c) - { - SkillCollectionBase skills3 = item3.Skills; - foreach (SkillBase item4 in skills3) - { - if (item4.IsBeforeAttackSelfAndOtherSkill) - { - VfxWith vfxWith4 = skills3.CreateBeforeAttackSelfAndOtherInfo(item4, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(item3.SelfBattlePlayer, item3.OpponentBattlePlayer)); - skillProcessor.Register(vfxWith4.Value); - sequentialVfxPlayer.Register(vfxWith4.Vfx); - if (vfxWith4.Value != null) - { - item3.SelfBattlePlayer.PredictionWarningCards.Add(item3); - } - } - } - } - VfxBase allFuncVfxResults = this.OnBeforeAttack.GetAllFuncVfxResults(); - sequentialVfxPlayer.Register(allFuncVfxResults); - sequentialVfxPlayer.Register(attackCard.SelfBattlePlayer.BattleView.PrepareCardsForAttackSequenceVfx(attackCard.BattleCardView, battleCardBase.BattleCardView)); - VfxBase vfx = skillProcessor.Process(_pair); - sequentialVfxPlayer.Register(vfx); - VfxBase allFuncVfxResults2 = this.OnBeforeAttackSkillComplete.GetAllFuncVfxResults(); - sequentialVfxPlayer.Register(allFuncVfxResults2); - BattleCardBase battleCardBase2 = (attackCard.IsDead ? null : attackCard.GetDamageReflectionTarget(isSkillDamage: false)); - int damage = battleCardBase.DamageCalculationAtkTypeBeAttacked.Damage; - int num = attackCard.CalculateFinalDamageAmount(damage); - BattleCardBase battleCardBase3 = (battleCardBase.IsDead ? null : battleCardBase.GetDamageReflectionTarget(isSkillDamage: false)); - int damage2 = attackCard.DamageCalculationAtkTypeAttack.Damage; - int num2 = battleCardBase.CalculateFinalDamageAmount(damage2); - OnAttackDamageComplete.Call(attackCard, battleCardBase, num2, num); - bool flag = !attackCard.IsDead && !battleCardBase.IsDead && !attackCard.SelfBattlePlayer.Class.IsDead && !battleCardBase.SelfBattlePlayer.Class.IsDead && attackCard.IsInplay && battleCardBase.IsInplay; - if (flag) - { - VfxBase vfx2 = attackCard.StartAttack(battleCardBase, _pair); - sequentialVfxPlayer.Register(vfx2); - } - else - { - if (attackCard.SkillApplyInformation.IsSneak) - { - sequentialVfxPlayer.Register(attackCard.SkillApplyInformation.FourceDepriveSneak()); - } - attackCard.AttackableCount--; - if (!attackCard.Attackable) - { - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - attackCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); - })); - } - AttackSelectControl attackSelectControl = attackCard.SelfBattlePlayer.BattleView.AttackSelectControl; - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - if (!attackCard.IsDead && attackCard.IsInplay) - { - IBattleCardView battleCardView = attackCard.BattleCardView; - parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView)); - } - if (!battleCardBase.IsDead && battleCardBase.IsInplay) - { - IBattleCardView battleCardView2 = battleCardBase.BattleCardView; - parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView2)); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - } - sequentialVfxPlayer.Register(InstantVfx.Create(delegate - { - attackCard.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); - })); - if (GameMgr.GetIns().IsWatchBattle || GameMgr.GetIns().IsReplayBattle) - { - bool num3 = attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl.IsShow && attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl._card == attackCard; - bool flag2 = attackCard.SelfBattlePlayer.IsSelfTurn && attackCard.IsPlayer && attackCard.IsInplay && attackCard.AttackableCount <= 0; - if (num3 && flag2) - { - sequentialVfxPlayer.Register(attackCard.BattleCardView.ShowAttackFinished()); - } - } - OnAttackProcessComplete.Call(attackCard); - if (flag) - { - SkillProcessor skillProcessor2 = new SkillProcessor(); - attackCard.SelfBattlePlayer.StartSkillWhenDamageSelfAndOther(null, (battleCardBase3 != null) ? new List { battleCardBase3 } : null, skillProcessor2, damage2, num2); - if (battleCardBase is UnitBattleCard) - { - attackCard.SelfBattlePlayer.StartSkillWhenDamageSelfAndOther(null, (battleCardBase2 != null) ? new List { battleCardBase2 } : null, skillProcessor2, damage, num); - } - for (int num4 = 0; num4 < attackCard.Skills.Count(); num4++) - { - SkillBase skillBase = attackCard.Skills.ElementAt(num4); - if (skillBase.OnAfterAttackStart != 0) - { - SkillProcessor.ProcessInfo info = attackCard.Skills.CreateAfterAttackInfo(skillBase, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); - skillProcessor2.Register(info); - } - if (skillBase.OnAfterFightStart != 0) - { - SkillProcessor.ProcessInfo info2 = attackCard.Skills.CreateAfterFightInfo(skillBase, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); - skillProcessor2.Register(info2); - } - } - for (int num5 = 0; num5 < battleCardBase.Skills.Count(); num5++) - { - SkillBase skillBase2 = battleCardBase.Skills.ElementAt(num5); - if (skillBase2.OnAfterFightStart != 0) - { - SkillProcessor.ProcessInfo info3 = battleCardBase.Skills.CreateAfterFightInfo(skillBase2, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(battleCardBase.SelfBattlePlayer, battleCardBase.OpponentBattlePlayer)); - skillProcessor2.Register(info3); - } - } - foreach (BattleCardBase item5 in from c in _pair.Self.ClassAndInPlayCardList.Concat(_pair.Opponent.ClassAndInPlayCardList) - where c.Skills._skillTimingInfo.IsAfterAttackSelfAndOther - select c) - { - SkillCollectionBase skills4 = item5.Skills; - foreach (SkillBase item6 in skills4) - { - if (item6.IsAfterAttackSelfAndOtherSkill) - { - VfxWith vfxWith5 = skills4.CreateAfterAttackSelfAndOtherInfo(item6, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(item5.SelfBattlePlayer, item5.OpponentBattlePlayer)); - skillProcessor2.Register(vfxWith5.Value); - sequentialVfxPlayer.Register(vfxWith5.Vfx); - if (vfxWith5.Value != null) - { - item5.SelfBattlePlayer.PredictionWarningCards.Add(item5); - } - } - } - } - VfxBase vfx3 = skillProcessor2.Process(_pair); - sequentialVfxPlayer.Register(vfx3); - } - VfxBase allFuncVfxResults3 = this.OnAfterAttack.GetAllFuncVfxResults(attackCard, battleCardBase, flag); - sequentialVfxPlayer.Register(allFuncVfxResults3); - OnAttackComplete.Call(); - return sequentialVfxPlayer; - } - - public VfxBase Evolve(IBattleCardUniqueID cardId, Func, SkillBase, Func, VfxBase>, VfxBase> selectSkillTargetCards) - { - BattleCardBase card = _pair.Self.InPlayCards.SingleOrDefault((BattleCardBase c) => c.EquelsID(cardId)); - IfNullCardThenException(card, cardId, "場"); - return CallCardSkill(card.EvolutionSkills, (IEnumerable selectedCards) => Evolution(card, selectedCards), selectSkillTargetCards); - } - - public VfxBase Evolution(BattleCardBase card, IEnumerable selectedCards, List selectChoiceId = null) - { - BattleCardBase battleCardBase = card; - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - if (BattleManagerBase.GetIns().BattlePlayer.Class.IsDead || BattleManagerBase.GetIns().BattleEnemy.Class.IsDead || card.IsEvolution || !card.SelfBattlePlayer.IsSelfTurn) - { - return NullVfx.GetInstance(); - } - SkillConditionCheckerOption option = new SkillConditionCheckerOption(); - sequentialVfxPlayer.Register(SetSkillConditionCheckeroptionSelectCards(card, option, selectedCards, isEvolve: true, selectChoiceId)); - SkillProcessor skillProcessor = new SkillProcessor(); - if (option.PlayedCard != null && card.EvolutionSkills.Any((SkillBase s) => s is Skill_transform)) - { - battleCardBase = option.PlayedCard; - sequentialVfxPlayer.Register(battleCardBase.SelfBattlePlayer.ReplaceInPlay(card, battleCardBase, skillProcessor)); - sequentialVfxPlayer.Register(battleCardBase.SetUpInplay()); - BattlePlayerPair playerInfoPair = new BattlePlayerPair(battleCardBase.SelfBattlePlayer, battleCardBase.OpponentBattlePlayer); - sequentialVfxPlayer.Register(battleCardBase.Skills.RegisterAndProcessWhenChangeInplayImmediateInfo(playerInfoPair)); - battleCardBase.Skills.CreateAndRegisterWhenChangeInplayInfo(new List { battleCardBase }, skillProcessor, playerInfoPair); - sequentialVfxPlayer.Register(card.RemoveFromInPlay()); - } - BattlePlayerReadOnlyInfoPair pair = new BattlePlayerReadOnlyInfoPair(card.SelfBattlePlayer, card.OpponentBattlePlayer); - SkillBase skillBase = card.EvolutionSkills.FirstOrDefault((SkillBase s) => s.OnWhenEvolveBeforeStart != 0 && s is Skill_evolve_to_other && s.CheckCondition(pair, option, isPrePlay: true)); - if (skillBase != null) - { - IBattleResourceMgr battleResourceMgr = card.SelfBattlePlayer.BattleMgr.BattleResourceMgr; - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); - UnitBattleCardView unitBattleCardView = card.BattleCardView as UnitBattleCardView; - parallelVfxPlayer.Register(battleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: false))); - parallelVfxPlayer.Register(battleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: true))); - if (option.ChosenCards.Count > 0) - { - card.UpdateBuildInfoAndSkillCollection(option.ChosenCards[0], isFoil: false); - } - else - { - card.UpdateBuildInfoAndSkillCollection(skillBase.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.card_id, -1), card.BaseParameter.IsFoil); - } - card.BattleCardView.InitializeVoiceInfo(card.CardId); - for (int num = 0; num < card.NormalSkills.Count(); num++) - { - card.NormalSkills.ElementAt(num).SetInductionVoiceIndex(); - } - for (int num2 = 0; num2 < card.EvolutionSkills.Count(); num2++) - { - card.EvolutionSkills.ElementAt(num2).SetInductionVoiceIndex(); - } - if (unitBattleCardView != null) - { - parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: false)); - parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: true)); - } - sequentialVfxPlayer.Register(parallelVfxPlayer); - } - if (option.ChosenCards.Count > 0 && selectedCards.Count() <= 0) - { - List list = selectedCards.ToList(); - foreach (int chosenCard in option.ChosenCards) - { - BattleCardBase item = BattleManagerBase.GetIns().CreateTransformCardRegisterVfx(card, chosenCard, option.PlayedCard.IsPlayer); - list.Add(item); - } - selectedCards = list; - } - SetIndividualId(card.EvolutionSkills); - if (card.EvolutionSkills.Any((SkillBase s) => s.HasIndividualId)) - { - card.SelfBattlePlayer.BattleMgr.IncrementIndividualId(); - } - this.OnBeforeEvolution.Call(card, battleCardBase, selectedCards); - this.OnBeforeChosenEvolution.Call(card, battleCardBase, option.ChosenCards); - if (option.BurialRiteCards != null && option.BurialRiteCards.Count > 0) - { - this.OnBeforeBurialRitePlayCard.Call(battleCardBase, selectedCards, arg3: true); - } - this.OnJustBeforeEvolution.Call(battleCardBase); - VfxBase vfx = battleCardBase.Evolution(isSkill: false, skillProcessor, option); - sequentialVfxPlayer.Register(vfx); - this.OnRightAfterEvolution.Call(battleCardBase); - VfxBase vfx2 = skillProcessor.Process(_pair); - sequentialVfxPlayer.Register(vfx2); - VfxBase allFuncVfxResults = this.OnAfterEvolution.GetAllFuncVfxResults(battleCardBase); - sequentialVfxPlayer.Register(allFuncVfxResults); - OnEvolutionComplete.Call(); - return sequentialVfxPlayer; - } - - public VfxBase Fusion(BattleCardBase fusionCard, List selectedCards) - { - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins.BattlePlayer.Class.IsDead || ins.BattleEnemy.Class.IsDead || fusionCard.IsEvolution || !fusionCard.SelfBattlePlayer.IsSelfTurn) - { - return NullVfx.GetInstance(); - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - SkillConditionCheckerOption option = new SkillConditionCheckerOption(); - this.OnBeforeFusion.Call(fusionCard, selectedCards); - sequentialVfxPlayer.Register(SetSkillConditionCheckeroptionSelectCards(fusionCard, option, selectedCards, isEvolve: false, new List(), isFusion: true)); - sequentialVfxPlayer.Register(fusionCard.SelfBattlePlayer.CardManagement(fusionCard, new SkillProcessor(), BattlePlayerBase.CARD_MANAGEMENT.FUSION_MATERIAL, isRandom: false, selectedCards)); - VfxBase allFuncVfxResults = this.OnAfterFusion.GetAllFuncVfxResults(fusionCard); - sequentialVfxPlayer.Register(allFuncVfxResults); - OnFusionComplete.Call(); - return sequentialVfxPlayer; - } - - private VfxBase CallCardSkill(SkillCollectionBase skills, Func, VfxBase> standardCall, Func, SkillBase, Func, VfxBase>, VfxBase> selectSkillTargetCards, bool isNotSelect = false) - { - SkillBase actSkill = null; - IEnumerable skillUserSelectableTargets = GetSkillUserSelectableTargets(skills, _pair, ref actSkill); - if (isNotSelect || skillUserSelectableTargets == null) - { - return standardCall(null); - } - return selectSkillTargetCards(skillUserSelectableTargets, actSkill, standardCall); - } - - private static void IfNullCardThenException(BattleCardBase card, IBattleCardUniqueID cardId, string positionName) - { - if (card == null) - { - throw new ArgumentException("カード " + cardId.GetName() + " は" + positionName + "に見つかりませんでした"); - } - } - - public static IEnumerable GetSkillUserSelectableTargets(SkillBase skill, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option = null, List selectedCards = null) - { - if (skill == null || !skill.DoesSkillFulfillActivationConditions(playerInfoPair, ignoreHandSkill: true, isPrePlay: true)) - { - return null; - } - if (option == null) - { - option = new SkillConditionCheckerOption(); - } - IEnumerable selectableCards = skill.GetSelectableCards(playerInfoPair, option, isSkipForceSelect: false, selectedCards); - if (!selectableCards.Any()) - { - selectableCards = skill.GetSelectableCards(playerInfoPair, option, isSkipForceSelect: true, selectedCards); - } - if (!selectableCards.Any()) - { - return null; - } - return selectableCards; - } - - public static IEnumerable GetSkillUserSelectableTargets(SkillCollectionBase skills, BattlePlayerReadOnlyInfoPair playerInfoPair, ref SkillBase actSkill) - { - IEnumerable source = skills.Where(delegate(SkillBase s) - { - BattlePlayerReadOnlyInfoPair playerInfoPair2 = new BattlePlayerReadOnlyInfoPair(s.SkillPrm.ownerCard.SelfBattlePlayer, s.SkillPrm.ownerCard.OpponentBattlePlayer); - return s.IsUserSelectType && s.CheckCondition(playerInfoPair2, new SkillConditionCheckerOption(), isPrePlay: true); - }); - if (source.Count() > 0) - { - actSkill = ((source.Count() > 1) ? source.ToList().Last() : source.ToList().First()); - } - return GetSkillUserSelectableTargets(actSkill, playerInfoPair); - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Cute; +using UnityEngine; +using Wizard.Battle.Resource; +using Wizard.Battle.UI; +using Wizard.Battle.View; +using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 27 of 47 methods unrun in baseline +// Type: Wizard.Battle.ActionProcessor +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + + +namespace Wizard.Battle; + +public class ActionProcessor +{ + private readonly BattlePlayerPair _pair; + + public Action OnPlayComplete; + + public Action OnEvolutionComplete; + + public Action OnAttackComplete; + + public Action OnFusionComplete; + + public Action OnAttackDamageComplete; + + public Action OnAttackProcessComplete; + + public Action OnAttackStart; + + public static readonly Vector3 ACCELERATE_POSITION_OFFSET = new Vector3(0f, 0f, -0.03f); + + public event Action> OnBeforePlayCard; + + public event Action> OnBeforeChosenPlayCard; + + public event Action, bool> OnBeforeBurialRitePlayCard; + + public event Func OnAfterPlayCard; + + public event Func OnBeforeAttack; + + public event Func OnBeforeAttackSkillComplete; + + public event Func OnAfterAttack; + + public event Action> OnBeforeEvolution; + + public event Action> OnBeforeChosenEvolution; + + public event Action OnJustBeforeEvolution; + + public event Action OnRightAfterEvolution; + + public event Func OnAfterEvolution; + + public event Action> OnBeforeFusion; + + public event Func OnAfterFusion; + + public event Action OnTransform; + + public event Action OnSpecialAccelerate; + + public ActionProcessor(BattlePlayerPair pair) + { + _pair = pair; + } + + private void GetSelectTargetBySelectList(SkillBase selectSkill, List selectList, List selectTargets, ref int skillIndex) + { + BattlePlayerPair playerInfoPair = new BattlePlayerPair(selectSkill.SkillPrm.ownerCard.SelfBattlePlayer, selectSkill.SkillPrm.ownerCard.OpponentBattlePlayer); + SkillConditionCheckerOption option = new SkillConditionCheckerOption(); + int skillSelectCount = selectSkill.GetSkillSelectCount(); + int num = 1; + if (skillSelectCount >= 2) + { + NetworkBattleManagerBase networkBattleManagerBase = selectSkill.SkillPrm.selfBattlePlayer.BattleMgr as NetworkBattleManagerBase; + num = ((selectSkill.SkillPrm.selfBattlePlayer.IsPlayer || networkBattleManagerBase == null || _pair.Self.BattleMgr.GameMgr.IsAdminWatch || !RegisterValidate.IsValidateCard(selectSkill)) ? Math.Min(skillSelectCount, selectSkill.GetSelectableCards(playerInfoPair, option, isSkipForceSelect: true).Count()) : (from n in networkBattleManagerBase.GetValidateTargetSkillIndexList() + where n == NetworkBattleGenericTool.GetSkillIndex(selectSkill) + select n).Count()); + } + for (int num2 = 0; num2 < num; num2++) + { + if (skillIndex >= selectList.Count) + { + break; + } + selectTargets.Add(new SkillConditionCheckerOption.SkillAndSelectTarget(selectList[skillIndex], selectSkill)); + skillIndex++; + } + } + + private VfxBase SetSkillConditionCheckeroptionSelectCards(BattleCardBase card, SkillConditionCheckerOption option, IEnumerable cards, bool isEvolve, List selectChoiceCardIdList, bool isFusion = false, bool isChoiceBrave = false) + { + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + SkillCollectionBase skillCollectionBase = (isEvolve ? card.EvolutionSkills : card.Skills); + bool isChoiceTransform = false; + List list = null; + if (cards != null) + { + list = cards.ToList(); + } + if (!isFusion && skillCollectionBase.Any((SkillBase s) => s is Skill_transform)) + { + BattlePlayerReadOnlyInfoPair playerInfoPair = new BattlePlayerReadOnlyInfoPair(card.SelfBattlePlayer, card.OpponentBattlePlayer); + CardMaster instanceForBattle = CardMaster.GetInstanceForBattle(); + for (int num = 1; num < skillCollectionBase.Count(); num++) + { + if (skillCollectionBase.Get(num) is Skill_transform skill_transform) + { + Skill_pp_fixeduse skill_pp_fixeduse = skillCollectionBase.Get(num - 1) as Skill_pp_fixeduse; + if (false || (skill_transform.TransformId != -1 && skill_pp_fixeduse != null && skill_pp_fixeduse.IsMutationFixedUseCost && skill_pp_fixeduse.CheckCondition(playerInfoPair, option, isPrePlay: true) && card.GetAccelerateOrCrystallizeTransformSkill() != null)) + { + BattleCardBase.TransformType transformType = ((skill_transform.OnWhenAccelerate != 0) ? BattleCardBase.TransformType.Accelerate : BattleCardBase.TransformType.Crystallize); + sequentialVfxPlayer.Register(SwapTransformCard(card, card.BaseParameter.IsFoil ? instanceForBattle.GetCardParameterFromId(skill_transform.TransformId).FoilCardId : skill_transform.TransformId, option, transformType, selectChoiceCardIdList, list)); + this.OnSpecialAccelerate.Call(skill_pp_fixeduse); + this.OnSpecialAccelerate.Call(skill_transform); + } + if (skillCollectionBase.Get(num - 1) is Skill_choice skill_choice && skill_choice.CheckCondition(playerInfoPair, option, isPrePlay: true)) + { + isChoiceTransform = true; + } + } + } + } + if (cards == null && selectChoiceCardIdList == null) + { + return sequentialVfxPlayer; + } + SkillBase skillBase = card.GetSelectTypeSkill(isEvolve, isFusion: false, isRegister: false, isEvolutionSimpleProcessor: false, isChoiceCheck: true).FirstOrDefault((SkillBase s) => s is Skill_choice); + int num2 = 1; + if (skillBase != null) + { + num2 = SetupChoiceCard(card, option, selectChoiceCardIdList, skillBase, list, isChoiceTransform, sequentialVfxPlayer, isChoiceBrave); + } + if (list != null && list.Count > 0) + { + BattleCardBase battleCardBase = card; + if (option.PlayedCard != null && card != option.PlayedCard) + { + battleCardBase = option.PlayedCard; + } + IEnumerable selectTypeSkill = battleCardBase.GetSelectTypeSkill(isEvolve, isFusion: false, isRegister: true); + int num3 = selectTypeSkill.Where((SkillBase s) => s.IsBurialRite).Count(); + List list2 = selectTypeSkill.Where((SkillBase s) => !(s is Skill_none)).ToList(); + int skillIndex = num3; + for (int num4 = 0; num4 < list2.Count; num4++) + { + if (list2[num4].IsChoiceType) + { + num4 += num2 - 1; + } + else if (list2[num4].IsBurialRite) + { + if (list2[num4].IsUserSelectType) + { + GetSelectTargetBySelectList(list2[num4], list, option.SelectedCards, ref skillIndex); + } + } + else + { + GetSelectTargetBySelectList(list2[num4], list, option.SelectedCards, ref skillIndex); + } + } + for (int num5 = 0; num5 < num3; num5++) + { + option.BurialRiteCards.Add(list[num5]); + } + if (num3 > 0) + { + card.SkillApplyInformation.ClearLastBurialRiteCardList(); + card.SkillApplyInformation.AddLastBurialRiteCardList(list); + } + } + return sequentialVfxPlayer; + } + + private int SetupChoiceCard(BattleCardBase card, SkillConditionCheckerOption option, List selectChoiceCardIdList, SkillBase selectChoiceSkill, List selectList, bool isChoiceTransform, SequentialVfxPlayer vfx, bool isChoiceBrave) + { + int num = 1; + if (option.PlayedCard == null) + { + option.PlayedCard = card; + } + int num2 = -1; + if (selectChoiceSkill.ApplySelectFilter is SkillChoiceSelectFilter) + { + num = ((SkillChoiceSelectFilter)selectChoiceSkill.ApplySelectFilter).CalcCount(selectChoiceSkill.OptionValue); + } + if (selectChoiceCardIdList != null && selectChoiceCardIdList.Count >= 1) + { + foreach (int selectChoiceCardId in selectChoiceCardIdList) + { + num2 = selectChoiceCardId; + option.ChosenCards.Add(num2); + } + } + else if (selectList != null && selectList.Count > 0) + { + for (int i = 0; i < num; i++) + { + BattleCardBase battleCardBase = selectList[i]; + num2 = battleCardBase.BaseParameter.CardId; + option.ChosenCards.Add(num2); + if (isChoiceTransform || isChoiceBrave) + { + selectList.Remove(battleCardBase); + } + } + } + if (num2 >= 0 && isChoiceTransform) + { + vfx.Register(SwapTransformCard(card, num2, option, BattleCardBase.TransformType.Choice, selectChoiceCardIdList, selectList)); + } + return num; + } + + private VfxBase SwapTransformCard(BattleCardBase originalCard, int transformCardID, SkillConditionCheckerOption option, BattleCardBase.TransformType transformType, List selectChoiceCardIdList, List selectList) + { + bool isMutation = transformType == BattleCardBase.TransformType.Accelerate || transformType == BattleCardBase.TransformType.Crystallize; + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); + BattleCardBase transformCard = originalCard.SelfBattlePlayer.CreateCard(transformCardID, originalCard.Index); + transformCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate + { + transformCard.BattleCardView.GameObject.SetActive(value: false); + })); + sequentialVfxPlayer2.Register(InstantVfx.Create(delegate + { + if (!_pair.Self.BattleMgr.IsRecovery) + { + Transform transform = transformCard.BattleCardView.Transform; + Transform transform2 = originalCard.BattleCardView.Transform; + transform.position = transform2.position; + transform.rotation = transform2.rotation; + if (_pair.Self.BattleMgr.GameMgr.IsWatchBattle || _pair.Self.BattleMgr.GameMgr.IsReplayBattle) + { + transform.parent = originalCard.SelfBattlePlayer.BattleView.HandDeck.transform; + } + else + { + transform.parent = transform2.parent; + } + transform.localScale = transform2.localScale; + transform.SetSiblingIndex(transform2.GetSiblingIndex()); + if (!isMutation) + { + transformCard.BattleCardView.CardTemplate.DynamicSetupMaterials(transformCard, _pair.Self.BattleMgr.BattleResourceMgr); + originalCard.BattleCardView.GameObject.SetActive(value: false); + transformCard.BattleCardView.GameObject.SetActive(value: true); + } + } + })); + if (isMutation) + { + sequentialVfxPlayer.Register(sequentialVfxPlayer2); + } + else + { + transformCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(sequentialVfxPlayer2); + } + transformCard.SetOnDraw(draw: false); + originalCard.MetamorphoseCard = transformCard; + transformCard.TransformInfo = new BattleCardBase.TransformInformation(transformType, originalCard); + option.PlayedCard = transformCard; + option.SummonedCard = transformCard; + SkillBase skillBase = transformCard.GetSelectTypeSkill().FirstOrDefault((SkillBase s) => s is Skill_choice); + if (skillBase != null) + { + SetupChoiceCard(transformCard, option, selectChoiceCardIdList, skillBase, selectList, isChoiceTransform: false, sequentialVfxPlayer, isChoiceBrave: false); + } + this.OnTransform.Call(originalCard, transformCardID, !isMutation); + return sequentialVfxPlayer; + } + + private VfxBase SetupPlayCard(BattleCardBase originalCard, BattleCardBase playCard, SkillProcessor skillProcessor, bool isChoiceBrave) + { + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + bool isMutation = originalCard.CheckConditionFixedUseCost(isPrePlay: true) && originalCard.CalcFixedUseCost(originalCard.SelfBattlePlayer.Pp) < originalCard.Cost; + GameMgr gameMgr = _pair.Self.BattleMgr.GameMgr; + // IsAdminWatch is const-false in headless — the isAdminWatch local was only used at the + // `(isAdminWatch && isMutation) || isChoiceBrave` argument which collapses to isChoiceBrave. + BattleManagerBase battleMgr = _pair.Self.BattleMgr; + if (!isChoiceBrave) + { + sequentialVfxPlayer.Register(playCard.SelfBattlePlayer.ReplaceInHand(originalCard, playCard, skillProcessor)); + } + if (isMutation) + { + sequentialVfxPlayer.Register(battleMgr.LoadCardResources(new List { playCard })); + } + if (!battleMgr.IsRecovery) + { + playCard.SelfBattlePlayer.BattleMgr.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate + { + originalCard.SelfBattlePlayer.BattleView.HandView.RemoveCardFromView(originalCard.BattleCardView, 0.3f); + })); + } + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + if (!battleMgr.IsRecovery) + { + playCard.SelfBattlePlayer.BattleView.PlayQueueView.RemoveCardFromView(originalCard.BattleCardView, isChoiceBrave); + if (isMutation) + { + playCard.BattleCardView.CardTemplate.DynamicSetupMaterials(playCard, battleMgr.BattleResourceMgr); + } + } + })); + if (!isMutation) + { + sequentialVfxPlayer.Register(battleMgr.OperateMgr.InitSetCard(playCard, playCard.SelfBattlePlayer.IsPlayer, isSelect: false, isRecovery: false, isChoiceSelect: true, isAccelerateSelect: false, registerDirectlyToVfxManager: true, isFusionWait: false, isChoiceBrave)); + } + else + { + bool isChoice = playCard.GetSelectTypeSkill().Any((SkillBase s) => s is Skill_choice); + sequentialVfxPlayer.Register(playCard.SelfBattlePlayer.BattleView.PlayQueueView.InstantAddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isChoice)); + if (isMutation) + { + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + Vector3 position = originalCard.BattleCardView.GameObject.transform.position; + position += ACCELERATE_POSITION_OFFSET; + Quaternion rot = originalCard.BattleCardView.GameObject.transform.rotation; + if (!playCard.IsSpell && playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView)) + { + Vector3 localEulerAngles = originalCard.BattleCardView.GameObject.transform.localEulerAngles; + rot = Quaternion.Euler(localEulerAngles.x, 0f, localEulerAngles.z); + } + gameMgr.GetEffectMgr().Start(playCard.IsSpell ? EffectMgr.EffectType.CMN_CARD_ACCELERATE_1 : EffectMgr.EffectType.CMN_CARD_CRYSTALLIZE_1, playCard.IsSpell ? position : originalCard.BattleCardView.GameObject.transform.position, rot, 31); + })); + sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.2f)); + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + CardTemplate cardTemplate = originalCard.BattleCardView.CardTemplate; + cardTemplate.SetEffectStyle(UILabel.Effect.None); + if (originalCard is UnitBattleCard) + { + cardTemplate.NormalAtkLabelTemp.effectStyle = UILabel.Effect.None; + cardTemplate.NormalLifeLabelTemp.effectStyle = UILabel.Effect.None; + } + })); + sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0f)); + } + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + if (!battleMgr.IsRecovery && isMutation) + { + Transform transform = playCard.BattleCardView.Transform; + Transform transform2 = originalCard.BattleCardView.Transform; + if (playCard.IsSpell || playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView)) + { + MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 31); + playCard.BattleCardView.Transform.SetParent(battleMgr.CutInContainer.transform, worldPositionStays: false); + } + if (playCard.IsSpell) + { + transform.position = transform2.position; + transform.localScale = transform2.localScale; + originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); + originalCard.BattleCardView.GameObject.SetActive(value: false); + playCard.BattleCardView.GameObject.SetActive(value: true); + playCard.BattleCardView.ShowInHandFrameEffect(enable: true, HandCardFrameEffectType.LIGHT_BLUE); + originalCard.BattleCardView.CardTemplate.SetEffectStyle(UILabel.Effect.None); + } + else + { + transform.position = transform2.position; + transform.localScale = transform2.localScale; + originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); + originalCard.BattleCardView.GameObject.SetActive(value: false); + playCard.BattleCardView.GameObject.SetActive(value: true); + originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform); + } + } + })); + if (isMutation) + { + sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.3f)); + if (!playCard.IsSpell) + { + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + originalCard.BattleCardView.GameObject.SetActive(value: false); + MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 10); + })); + } + } + } + return sequentialVfxPlayer; + } + + public VfxBase PlayCard(BattleCardBase card, IEnumerable selectedCards, List selectChoiceId = null, bool isChoiceBrave = false) + { + if (selectedCards != null) + { + foreach (BattleCardBase selectedCard in selectedCards) + { + selectedCard.SelfBattlePlayer.AddLastTargetCardsList(selectedCard); + } + } + SetIndividualId(card.NormalSkills); + if (card.NormalSkills.Any((SkillBase s) => s.HasIndividualId)) + { + card.SelfBattlePlayer.BattleMgr.IncrementIndividualId(); + } + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + SkillProcessor skillProcessor = new SkillProcessor(); + BattleCardBase battleCardBase = card; + SkillConditionCheckerOption skillConditionCheckerOption = new SkillConditionCheckerOption(); + skillConditionCheckerOption.PlayedCard = card; + skillConditionCheckerOption.SummonedCard = card; + if (isChoiceBrave) + { + card.SelfBattlePlayer.IsAlreadyChoiceBraveInThisTurn = true; + card.SelfBattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite(); + card.SelfBattlePlayer.BattleView.UpdateChoiceBraveActivatingEffect(isActivating: false); + int cardId = ((selectChoiceId != null && selectChoiceId.Count > 0) ? selectChoiceId[0] : selectedCards.First().CardId); + BattleCardBase selectSkillCard = (CardMaster.IsChoiceBraveCardCheck(card.CardId) ? card : ((selectedCards != null && selectedCards.Count() > 1 && (card.IsPlayer || _pair.Self.BattleMgr.GameMgr.IsAdminWatch)) ? selectedCards.First() : null)); + skillConditionCheckerOption.PlayedCard = card.SelfBattlePlayer.BattleMgr.ReplaceChoiceBraveCard(card, cardId, selectSkillCard); + } + sequentialVfxPlayer.Register(SetSkillConditionCheckeroptionSelectCards(card, skillConditionCheckerOption, selectedCards, isEvolve: false, selectChoiceId, isFusion: false, isChoiceBrave)); + if (battleCardBase != skillConditionCheckerOption.PlayedCard) + { + if (battleCardBase.SkillApplyInformation.SkillRandomArray == null) + { + skillConditionCheckerOption.PlayedCard.SkillApplyInformation.GiveSkillRandomArray(battleCardBase.SkillApplyInformation.SkillRandomArray); + } + battleCardBase = skillConditionCheckerOption.PlayedCard; + sequentialVfxPlayer.Register(SetupPlayCard(card, battleCardBase, skillProcessor, isChoiceBrave)); + _pair.Self.BattleMgr.PSideLogControl.RemoveAllLog(); + } + battleCardBase.SetPlayedTurnNow(); + int count = skillConditionCheckerOption.ChosenCards.Count; + int num = selectedCards?.Count() ?? 0; + if (count > 0 && num - count < 0) + { + List list = ((selectedCards != null) ? selectedCards.ToList() : new List()); + foreach (int chosenCard in skillConditionCheckerOption.ChosenCards) + { + BattleCardBase item = _pair.Self.BattleMgr.CreateTransformCardRegisterVfx(skillConditionCheckerOption.PlayedCard, chosenCard, skillConditionCheckerOption.PlayedCard.IsPlayer); + list.Insert(0, item); + } + selectedCards = list; + } + this.OnBeforePlayCard.Call(card, battleCardBase, selectedCards); + this.OnBeforeChosenPlayCard.Call(card, battleCardBase, skillConditionCheckerOption.ChosenCards); + if (skillConditionCheckerOption.BurialRiteCards != null && skillConditionCheckerOption.BurialRiteCards.Count > 0) + { + this.OnBeforeBurialRitePlayCard.Call(battleCardBase, selectedCards, arg3: false); + } + bool isEnhance = battleCardBase.CheckConditionFixedUseCost(isPrePlay: true); + VfxWith vfxWith = card.PlayChoiceCard(skillProcessor, skillConditionCheckerOption); + VfxWith vfxWith2 = battleCardBase.PlayCard(skillProcessor, skillConditionCheckerOption, isInplayGeneration: false, card); + VfxBase vfx = battleCardBase.SelfBattlePlayer.StartSkillWhenChangeInplay(null, new List { battleCardBase }, skillProcessor); + skillProcessor.Register(vfxWith.Value); + skillProcessor.Register(vfxWith2.Value); + VfxBase vfx2 = _pair.Self.StartSkillWhenPlayOtherEnhanceAndAccelerateAndCrystallize(battleCardBase, isEnhance, skillProcessor); + VfxBase vfx3 = _pair.Self.StartSkillWhenSummonOther(battleCardBase, skillProcessor); + VfxBase vfx4 = skillProcessor.Process(_pair); + if (card != battleCardBase && card.Skills.HaveBeforeChoiceSkill()) + { + BattleLogManager.GetInstance().AddLogPlayAsChoiceTransform(battleCardBase); + } + VfxBase vfxBase = battleCardBase.FinishWhenPlaySkill(); + VfxBase allFuncVfxResults = this.OnAfterPlayCard.GetAllFuncVfxResults(battleCardBase); + BattleUIContainer battleUIContainer = _pair.Self.BattleMgr.BattleUIContainer; + bool isSelfTurn = _pair.Self.BattleMgr.BattlePlayer.IsSelfTurn; + if (isSelfTurn) + { + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + battleUIContainer.PlayerCardPlaying = true; + if (battleUIContainer.IsEnableMenu()) + { + battleUIContainer.DisableMenu(); + } + })); + } + sequentialVfxPlayer.Register(vfxWith2.Vfx); + sequentialVfxPlayer.Register(vfx); + sequentialVfxPlayer.Register(battleCardBase.StopSpellCharge()); + sequentialVfxPlayer.Register(vfx2); + sequentialVfxPlayer.Register(vfx3); + sequentialVfxPlayer.Register(vfx4); + if (vfxBase != null) + { + sequentialVfxPlayer.Register(vfxBase); + } + if (allFuncVfxResults.IsVfxNonEmpty()) + { + sequentialVfxPlayer.Register(allFuncVfxResults); + } + Action handleBattleMenu = delegate + { + }; + if (isSelfTurn) + { + handleBattleMenu = delegate + { + battleUIContainer.PlayerCardPlaying = false; + if (_pair.Self.BattleMgr.BattlePlayer.BattleView.PlayQueueView.QueueCount() == 0 && !battleUIContainer.IsEnableMenu()) + { + battleUIContainer.RequestEnableMenuWhenTouchable(); + } + }; + } + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + BattlePlayer battlePlayer = _pair.Self.BattleMgr.BattlePlayer; + handleBattleMenu(); + int num2 = battlePlayer.BattleView.PlayQueueView.QueueCount(); + bool isSelecting = battlePlayer.BattleView.IsSelecting; + if (num2 == 0 && !isSelecting && !battlePlayer.IsDuringChoiceBrave) + { + battlePlayer.BattleView.ClearSelectCardList(); + } + })); + OnPlayComplete.Call(); + return sequentialVfxPlayer; + } + + private void SetIndividualId(SkillCollectionBase skills) + { + for (int i = 0; i < skills.Count(); i++) + { + skills.ElementAt(i).InitSetIndividualId(); + } + } + + public VfxBase Attack(IBattleCardUniqueID attackCardId, IBattleCardUniqueID targetCardId) + { + BattleCardBase attackCard = _pair.Self.InPlayCards.SingleOrDefault((BattleCardBase c) => c.EquelsID(attackCardId)); + IfNullCardThenException(attackCard, attackCardId, "場"); + if (attackCard.SkillApplyInformation.IsQuick) + { + attackCard.SelfBattlePlayer.GameQuickAttackCards.Add(attackCard); + } + BattleCardBase battleCardBase = ((targetCardId.IsPlayer == _pair.Self.IsPlayer) ? _pair.Self.ClassAndInPlayCardList.SingleOrDefault((BattleCardBase c) => c.EquelsID(targetCardId)) : _pair.Opponent.ClassAndInPlayCardList.SingleOrDefault((BattleCardBase c) => c.EquelsID(targetCardId))); + IfNullCardThenException(battleCardBase, targetCardId, "場"); + attackCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); + OnAttackStart.Call(attackCard, battleCardBase); + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + SkillProcessor skillProcessor = new SkillProcessor(); + SkillCollectionBase skills = attackCard.Skills; + foreach (SkillBase item in skills) + { + if (item.IsBeforAttackSkill) + { + VfxWith vfxWith = skills.CreateBeforeAttackInfo(item, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); + skillProcessor.Register(vfxWith.Value); + sequentialVfxPlayer.Register(vfxWith.Vfx); + if (vfxWith.Value != null) + { + attackCard.SelfBattlePlayer.PredictionWarningCards.Add(attackCard); + } + } + if (item.IsWhenFightSkill) + { + VfxWith vfxWith2 = skills.CreateBeforeFightInfo(item, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); + skillProcessor.Register(vfxWith2.Value); + sequentialVfxPlayer.Register(vfxWith2.Vfx); + if (vfxWith2.Value != null) + { + attackCard.SelfBattlePlayer.PredictionWarningCards.Add(attackCard); + } + } + } + SkillCollectionBase skills2 = battleCardBase.Skills; + foreach (SkillBase item2 in skills2) + { + if (item2.IsWhenFightSkill) + { + VfxWith vfxWith3 = skills2.CreateBeforeFightInfo(item2, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(battleCardBase.SelfBattlePlayer, battleCardBase.OpponentBattlePlayer)); + skillProcessor.Register(vfxWith3.Value); + sequentialVfxPlayer.Register(vfxWith3.Vfx); + if (vfxWith3.Value != null) + { + attackCard.SelfBattlePlayer.PredictionWarningCards.Add(attackCard); + } + } + } + foreach (BattleCardBase item3 in from c in _pair.Self.ClassAndInPlayCardList.Concat(_pair.Opponent.ClassAndInPlayCardList) + where c.Skills._skillTimingInfo.IsBeforeAttackSelfAndOther + select c) + { + SkillCollectionBase skills3 = item3.Skills; + foreach (SkillBase item4 in skills3) + { + if (item4.IsBeforeAttackSelfAndOtherSkill) + { + VfxWith vfxWith4 = skills3.CreateBeforeAttackSelfAndOtherInfo(item4, attackCard, battleCardBase, skillProcessor, new BattlePlayerPair(item3.SelfBattlePlayer, item3.OpponentBattlePlayer)); + skillProcessor.Register(vfxWith4.Value); + sequentialVfxPlayer.Register(vfxWith4.Vfx); + if (vfxWith4.Value != null) + { + item3.SelfBattlePlayer.PredictionWarningCards.Add(item3); + } + } + } + } + VfxBase allFuncVfxResults = this.OnBeforeAttack.GetAllFuncVfxResults(); + sequentialVfxPlayer.Register(allFuncVfxResults); + sequentialVfxPlayer.Register(attackCard.SelfBattlePlayer.BattleView.PrepareCardsForAttackSequenceVfx(attackCard.BattleCardView, battleCardBase.BattleCardView)); + VfxBase vfx = skillProcessor.Process(_pair); + sequentialVfxPlayer.Register(vfx); + VfxBase allFuncVfxResults2 = this.OnBeforeAttackSkillComplete.GetAllFuncVfxResults(); + sequentialVfxPlayer.Register(allFuncVfxResults2); + BattleCardBase battleCardBase2 = (attackCard.IsDead ? null : attackCard.GetDamageReflectionTarget(isSkillDamage: false)); + int damage = battleCardBase.DamageCalculationAtkTypeBeAttacked.Damage; + int num = attackCard.CalculateFinalDamageAmount(damage); + BattleCardBase battleCardBase3 = (battleCardBase.IsDead ? null : battleCardBase.GetDamageReflectionTarget(isSkillDamage: false)); + int damage2 = attackCard.DamageCalculationAtkTypeAttack.Damage; + int num2 = battleCardBase.CalculateFinalDamageAmount(damage2); + OnAttackDamageComplete.Call(attackCard, battleCardBase, num2, num); + bool flag = !attackCard.IsDead && !battleCardBase.IsDead && !attackCard.SelfBattlePlayer.Class.IsDead && !battleCardBase.SelfBattlePlayer.Class.IsDead && attackCard.IsInplay && battleCardBase.IsInplay; + if (flag) + { + VfxBase vfx2 = attackCard.StartAttack(battleCardBase, _pair); + sequentialVfxPlayer.Register(vfx2); + } + else + { + if (attackCard.SkillApplyInformation.IsSneak) + { + sequentialVfxPlayer.Register(attackCard.SkillApplyInformation.FourceDepriveSneak()); + } + attackCard.AttackableCount--; + if (!attackCard.Attackable) + { + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + attackCard.BattleCardView._inPlayFrameEffect.HideFrameEffect(); + })); + } + AttackSelectControl attackSelectControl = attackCard.SelfBattlePlayer.BattleView.AttackSelectControl; + ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); + if (!attackCard.IsDead && attackCard.IsInplay) + { + IBattleCardView battleCardView = attackCard.BattleCardView; + parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView)); + } + if (!battleCardBase.IsDead && battleCardBase.IsInplay) + { + IBattleCardView battleCardView2 = battleCardBase.BattleCardView; + parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView2)); + } + sequentialVfxPlayer.Register(parallelVfxPlayer); + } + sequentialVfxPlayer.Register(InstantVfx.Create(delegate + { + attackCard.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(); + })); + if (_pair.Self.BattleMgr.GameMgr.IsWatchBattle || _pair.Self.BattleMgr.GameMgr.IsReplayBattle) + { + bool num3 = attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl.IsShow && attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl._card == attackCard; + bool flag2 = attackCard.SelfBattlePlayer.IsSelfTurn && attackCard.IsPlayer && attackCard.IsInplay && attackCard.AttackableCount <= 0; + if (num3 && flag2) + { + sequentialVfxPlayer.Register(attackCard.BattleCardView.ShowAttackFinished()); + } + } + OnAttackProcessComplete.Call(attackCard); + if (flag) + { + SkillProcessor skillProcessor2 = new SkillProcessor(); + attackCard.SelfBattlePlayer.StartSkillWhenDamageSelfAndOther(null, (battleCardBase3 != null) ? new List { battleCardBase3 } : null, skillProcessor2, damage2, num2); + if (battleCardBase is UnitBattleCard) + { + attackCard.SelfBattlePlayer.StartSkillWhenDamageSelfAndOther(null, (battleCardBase2 != null) ? new List { battleCardBase2 } : null, skillProcessor2, damage, num); + } + for (int num4 = 0; num4 < attackCard.Skills.Count(); num4++) + { + SkillBase skillBase = attackCard.Skills.ElementAt(num4); + if (skillBase.OnAfterAttackStart != 0) + { + SkillProcessor.ProcessInfo info = attackCard.Skills.CreateAfterAttackInfo(skillBase, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); + skillProcessor2.Register(info); + } + if (skillBase.OnAfterFightStart != 0) + { + SkillProcessor.ProcessInfo info2 = attackCard.Skills.CreateAfterFightInfo(skillBase, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(attackCard.SelfBattlePlayer, attackCard.OpponentBattlePlayer)); + skillProcessor2.Register(info2); + } + } + for (int num5 = 0; num5 < battleCardBase.Skills.Count(); num5++) + { + SkillBase skillBase2 = battleCardBase.Skills.ElementAt(num5); + if (skillBase2.OnAfterFightStart != 0) + { + SkillProcessor.ProcessInfo info3 = battleCardBase.Skills.CreateAfterFightInfo(skillBase2, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(battleCardBase.SelfBattlePlayer, battleCardBase.OpponentBattlePlayer)); + skillProcessor2.Register(info3); + } + } + foreach (BattleCardBase item5 in from c in _pair.Self.ClassAndInPlayCardList.Concat(_pair.Opponent.ClassAndInPlayCardList) + where c.Skills._skillTimingInfo.IsAfterAttackSelfAndOther + select c) + { + SkillCollectionBase skills4 = item5.Skills; + foreach (SkillBase item6 in skills4) + { + if (item6.IsAfterAttackSelfAndOtherSkill) + { + VfxWith vfxWith5 = skills4.CreateAfterAttackSelfAndOtherInfo(item6, attackCard, battleCardBase, skillProcessor2, new BattlePlayerPair(item5.SelfBattlePlayer, item5.OpponentBattlePlayer)); + skillProcessor2.Register(vfxWith5.Value); + sequentialVfxPlayer.Register(vfxWith5.Vfx); + if (vfxWith5.Value != null) + { + item5.SelfBattlePlayer.PredictionWarningCards.Add(item5); + } + } + } + } + VfxBase vfx3 = skillProcessor2.Process(_pair); + sequentialVfxPlayer.Register(vfx3); + } + VfxBase allFuncVfxResults3 = this.OnAfterAttack.GetAllFuncVfxResults(attackCard, battleCardBase, flag); + sequentialVfxPlayer.Register(allFuncVfxResults3); + OnAttackComplete.Call(); + return sequentialVfxPlayer; + } + + public VfxBase Evolution(BattleCardBase card, IEnumerable selectedCards, List selectChoiceId = null) + { + BattleCardBase battleCardBase = card; + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + if (_pair.Self.BattleMgr.BattlePlayer.Class.IsDead || _pair.Self.BattleMgr.BattleEnemy.Class.IsDead || card.IsEvolution || !card.SelfBattlePlayer.IsSelfTurn) + { + return NullVfx.GetInstance(); + } + SkillConditionCheckerOption option = new SkillConditionCheckerOption(); + sequentialVfxPlayer.Register(SetSkillConditionCheckeroptionSelectCards(card, option, selectedCards, isEvolve: true, selectChoiceId)); + SkillProcessor skillProcessor = new SkillProcessor(); + if (option.PlayedCard != null && card.EvolutionSkills.Any((SkillBase s) => s is Skill_transform)) + { + battleCardBase = option.PlayedCard; + sequentialVfxPlayer.Register(battleCardBase.SelfBattlePlayer.ReplaceInPlay(card, battleCardBase, skillProcessor)); + sequentialVfxPlayer.Register(battleCardBase.SetUpInplay()); + BattlePlayerPair playerInfoPair = new BattlePlayerPair(battleCardBase.SelfBattlePlayer, battleCardBase.OpponentBattlePlayer); + sequentialVfxPlayer.Register(battleCardBase.Skills.RegisterAndProcessWhenChangeInplayImmediateInfo(playerInfoPair)); + battleCardBase.Skills.CreateAndRegisterWhenChangeInplayInfo(new List { battleCardBase }, skillProcessor, playerInfoPair); + sequentialVfxPlayer.Register(card.RemoveFromInPlay()); + } + BattlePlayerReadOnlyInfoPair pair = new BattlePlayerReadOnlyInfoPair(card.SelfBattlePlayer, card.OpponentBattlePlayer); + SkillBase skillBase = card.EvolutionSkills.FirstOrDefault((SkillBase s) => s.OnWhenEvolveBeforeStart != 0 && s is Skill_evolve_to_other && s.CheckCondition(pair, option, isPrePlay: true)); + if (skillBase != null) + { + IBattleResourceMgr battleResourceMgr = card.SelfBattlePlayer.BattleMgr.BattleResourceMgr; + ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(); + UnitBattleCardView unitBattleCardView = card.BattleCardView as UnitBattleCardView; + parallelVfxPlayer.Register(battleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: false))); + parallelVfxPlayer.Register(battleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: true))); + if (option.ChosenCards.Count > 0) + { + card.UpdateBuildInfoAndSkillCollection(option.ChosenCards[0], isFoil: false); + } + else + { + card.UpdateBuildInfoAndSkillCollection(skillBase.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.card_id, -1), card.BaseParameter.IsFoil); + } + card.BattleCardView.InitializeVoiceInfo(card.CardId); + for (int num = 0; num < card.NormalSkills.Count(); num++) + { + card.NormalSkills.ElementAt(num).SetInductionVoiceIndex(); + } + for (int num2 = 0; num2 < card.EvolutionSkills.Count(); num2++) + { + card.EvolutionSkills.ElementAt(num2).SetInductionVoiceIndex(); + } + if (unitBattleCardView != null) + { + parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: false)); + parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: true)); + } + sequentialVfxPlayer.Register(parallelVfxPlayer); + } + if (option.ChosenCards.Count > 0 && selectedCards.Count() <= 0) + { + List list = selectedCards.ToList(); + foreach (int chosenCard in option.ChosenCards) + { + BattleCardBase item = _pair.Self.BattleMgr.CreateTransformCardRegisterVfx(card, chosenCard, option.PlayedCard.IsPlayer); + list.Add(item); + } + selectedCards = list; + } + SetIndividualId(card.EvolutionSkills); + if (card.EvolutionSkills.Any((SkillBase s) => s.HasIndividualId)) + { + card.SelfBattlePlayer.BattleMgr.IncrementIndividualId(); + } + this.OnBeforeEvolution.Call(card, battleCardBase, selectedCards); + this.OnBeforeChosenEvolution.Call(card, battleCardBase, option.ChosenCards); + if (option.BurialRiteCards != null && option.BurialRiteCards.Count > 0) + { + this.OnBeforeBurialRitePlayCard.Call(battleCardBase, selectedCards, arg3: true); + } + this.OnJustBeforeEvolution.Call(battleCardBase); + VfxBase vfx = battleCardBase.Evolution(isSkill: false, skillProcessor, option); + sequentialVfxPlayer.Register(vfx); + this.OnRightAfterEvolution.Call(battleCardBase); + VfxBase vfx2 = skillProcessor.Process(_pair); + sequentialVfxPlayer.Register(vfx2); + VfxBase allFuncVfxResults = this.OnAfterEvolution.GetAllFuncVfxResults(battleCardBase); + sequentialVfxPlayer.Register(allFuncVfxResults); + OnEvolutionComplete.Call(); + return sequentialVfxPlayer; + } + + public VfxBase Fusion(BattleCardBase fusionCard, List selectedCards) + { + BattleManagerBase ins = _pair.Self.BattleMgr; + if (ins.BattlePlayer.Class.IsDead || ins.BattleEnemy.Class.IsDead || fusionCard.IsEvolution || !fusionCard.SelfBattlePlayer.IsSelfTurn) + { + return NullVfx.GetInstance(); + } + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + SkillConditionCheckerOption option = new SkillConditionCheckerOption(); + this.OnBeforeFusion.Call(fusionCard, selectedCards); + sequentialVfxPlayer.Register(SetSkillConditionCheckeroptionSelectCards(fusionCard, option, selectedCards, isEvolve: false, new List(), isFusion: true)); + sequentialVfxPlayer.Register(fusionCard.SelfBattlePlayer.CardManagement(fusionCard, new SkillProcessor(), BattlePlayerBase.CARD_MANAGEMENT.FUSION_MATERIAL, isRandom: false, selectedCards)); + VfxBase allFuncVfxResults = this.OnAfterFusion.GetAllFuncVfxResults(fusionCard); + sequentialVfxPlayer.Register(allFuncVfxResults); + OnFusionComplete.Call(); + return sequentialVfxPlayer; + } + + private static void IfNullCardThenException(BattleCardBase card, IBattleCardUniqueID cardId, string positionName) + { + if (card == null) + { + throw new ArgumentException("カード " + cardId.GetName() + " は" + positionName + "に見つかりませんでした"); + } + } + + public static IEnumerable GetSkillUserSelectableTargets(SkillBase skill, BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option = null, List selectedCards = null) + { + if (skill == null || !skill.DoesSkillFulfillActivationConditions(playerInfoPair, ignoreHandSkill: true, isPrePlay: true)) + { + return null; + } + if (option == null) + { + option = new SkillConditionCheckerOption(); + } + IEnumerable selectableCards = skill.GetSelectableCards(playerInfoPair, option, isSkipForceSelect: false, selectedCards); + if (!selectableCards.Any()) + { + selectableCards = skill.GetSelectableCards(playerInfoPair, option, isSkipForceSelect: true, selectedCards); + } + if (!selectableCards.Any()) + { + return null; + } + return selectableCards; + } + + public static IEnumerable GetSkillUserSelectableTargets(SkillCollectionBase skills, BattlePlayerReadOnlyInfoPair playerInfoPair, ref SkillBase actSkill) + { + IEnumerable source = skills.Where(delegate(SkillBase s) + { + BattlePlayerReadOnlyInfoPair playerInfoPair2 = new BattlePlayerReadOnlyInfoPair(s.SkillPrm.ownerCard.SelfBattlePlayer, s.SkillPrm.ownerCard.OpponentBattlePlayer); + return s.IsUserSelectType && s.CheckCondition(playerInfoPair2, new SkillConditionCheckerOption(), isPrePlay: true); + }); + if (source.Count() > 0) + { + actSkill = ((source.Count() > 1) ? source.ToList().Last() : source.ToList().First()); + } + return GetSkillUserSelectableTargets(actSkill, playerInfoPair); + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle/EnemyAIInnerOptionsBuilder.cs b/SVSim.BattleEngine/Engine/Wizard.Battle/EnemyAIInnerOptionsBuilder.cs index 3b3cee8d..2686968a 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle/EnemyAIInnerOptionsBuilder.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle/EnemyAIInnerOptionsBuilder.cs @@ -13,7 +13,7 @@ public class EnemyAIInnerOptionsBuilder : IInnerOptionsBuilder public IEmotion CreateEnemyEmotion(IClassBattleCardView classCardView) { - return new EnemyAIEmotion(GameMgr.GetIns().GetDataMgr().GetEnemyEmotionId(), classCardView.ClassCharacter, BattleManagerBase.GetIns().EnemyAI); + return new EnemyAIEmotion("0", classCardView.ClassCharacter, null); // Pre-Phase-5b: emotion id + EnemyAI not reachable headless } public CardInnerOptionsBase CreateCardOptions() diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle/NetworkOpponentInnerOptionsBuilder.cs b/SVSim.BattleEngine/Engine/Wizard.Battle/NetworkOpponentInnerOptionsBuilder.cs index cd006351..5a3f2b27 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle/NetworkOpponentInnerOptionsBuilder.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle/NetworkOpponentInnerOptionsBuilder.cs @@ -1,6 +1,10 @@ using Wizard.Battle.Card.InnerOptions; using Wizard.Battle.Player.Emotion; using Wizard.Battle.View; +// TODO(engine-cleanup-pass2): 2 of 3 methods unrun in baseline +// Type: Wizard.Battle.NetworkOpponentInnerOptionsBuilder +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle; @@ -13,8 +17,7 @@ public class NetworkOpponentInnerOptionsBuilder : IInnerOptionsBuilder public IEmotion CreateEnemyEmotion(IClassBattleCardView classCardView) { - return new NetworkOpponentEmotion(GameMgr.GetIns().GetDataMgr().GetEnemyCharaId() - .ToString(), classCardView.ClassCharacter); + return new NetworkOpponentEmotion("0", classCardView.ClassCharacter); // Pre-Phase-5b: enemy chara id not reachable headless } public CardInnerOptionsBase CreateCardOptions() diff --git a/SVSim.BattleEngine/Engine/Wizard.Battle/PlayerInnerOptionsBuilder.cs b/SVSim.BattleEngine/Engine/Wizard.Battle/PlayerInnerOptionsBuilder.cs index ec63d679..a566364e 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Battle/PlayerInnerOptionsBuilder.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Battle/PlayerInnerOptionsBuilder.cs @@ -2,6 +2,10 @@ using Wizard.Battle.Card.InnerOptions; using Wizard.Battle.Player.Emotion; using Wizard.Battle.Resource; using Wizard.Battle.View; +// TODO(engine-cleanup-pass2): 2 of 3 methods unrun in baseline +// Type: Wizard.Battle.PlayerInnerOptionsBuilder +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle; @@ -16,7 +20,7 @@ public class PlayerInnerOptionsBuilder : IInnerOptionsBuilder public IPlayerEmotion CreatePlayerEmotion(IClassBattleCardView classCardView) { - return new PlayerEmotion(GameMgr.GetIns().GetDataMgr().GetPlayerEmotionId(), classCardView.ClassCharacter, _resourceMgr); + return new PlayerEmotion("0", classCardView.ClassCharacter, _resourceMgr); // Pre-Phase-5b: player emotion id not reachable headless } public IEmotion CreateEnemyEmotion(IClassBattleCardView classCardView) diff --git a/SVSim.BattleEngine/Engine/Wizard.BattleMgr/RecoveryNetworkBattleMgrContentsCreator.cs b/SVSim.BattleEngine/Engine/Wizard.BattleMgr/RecoveryNetworkBattleMgrContentsCreator.cs deleted file mode 100644 index f27429fb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.BattleMgr/RecoveryNetworkBattleMgrContentsCreator.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Wizard.Battle.Phase; -using Wizard.Battle.Recovery; -using Wizard.Battle.Replay; -using Wizard.Battle.Resource; -using Wizard.Battle.View.Vfx; - -namespace Wizard.BattleMgr; - -public class RecoveryNetworkBattleMgrContentsCreator : IBattleMgrContentsCreator -{ - public int RandomSeed => Data.BattleRecoveryInfo.seed; - - public IRecoveryManager RecoveryManager { get; protected set; } - - public IRecoveryRecordManager RecoveryRecordManager { get; private set; } - - public IReplayRecordManager ReplayRecordManager { get; private set; } - - public RecoveryController RecoveryControllerInstance { get; private set; } - - public RecoveryNetworkBattleMgrContentsCreator() - { - RecoveryManager = new NetworkBattleRecoveryManager(); - RecoveryRecordManager = new NullRecoveryRecordManager(); - ReplayRecordManager = new ReplayRecordManager(); - RecoveryControllerInstance = new RecoveryController(GameMgr.GetIns().IsAINetwork ? new RecoveryOperationInfo(OperationRecorderBase.RecordDirectoryPath + "recovery_ai_network.json") : null); - RecoveryControllerInstance.OnFinishRecoveryLogSync += delegate - { - if (GameMgr.GetIns().IsAINetwork) - { - RecoveryRecordManager = new AINetworkBattleRecoveryRecordManager("recovery_ai_network.json"); - BattleManagerBase.GetIns().StartRecoveryRecording(); - } - else - { - RecoveryRecordManager = new NetworkBattleRecoveryRecordManager(); - ToolboxGame.RealTimeNetworkAgent.StartRecoveryRecording(); - } - }; - } - - public IBattleResourceMgr CreateResourceMgr() - { - if (RecoveryControllerInstance.IsMariganFinished || (GameMgr.GetIns().IsAINetwork && RecoveryControllerInstance.AIBattleRecoveryData.SetupInfo.HasMulliganInfo)) - { - RecoveryBattleResourceMgr recoveryBattleResourceMgr = new RecoveryBattleResourceMgr(); - RecoveryControllerInstance.OnFinishRecoveringData += recoveryBattleResourceMgr.EnableLoadResouce; - return recoveryBattleResourceMgr; - } - return new BattleResourceMgr(); - } - - public VfxMgr CreateVfxMgr() - { - return new VfxMgr(); - } - - public IPhaseCreator CreatePhaseCreator(BattleManagerBase battleMgr) - { - battleMgr.IsRecovery = true; - NetworkBattleManagerBase battleMgr2 = (NetworkBattleManagerBase)battleMgr; - if (RecoveryControllerInstance.IsMariganFinished || (GameMgr.GetIns().IsAINetwork && RecoveryControllerInstance.AIBattleRecoveryData.SetupInfo.HasMulliganInfo)) - { - return new RecoveryNetworkBattleMainPhaseCreator(battleMgr2); - } - return new RecoveryNetworkBattleMulliganPhaseCreator(battleMgr2); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoDrawTask.cs b/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoDrawTask.cs index da1b1993..b34df76b 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoDrawTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoDrawTask.cs @@ -7,7 +7,6 @@ public class BingoDrawTask : BaseTask { public class BingoDrawTaskParam : BaseParam { - public int draw_count; } public class BingoDrawTaskData @@ -58,14 +57,6 @@ public class BingoDrawTask : BaseTask base.type = ApiType.Type.BingoDraw; } - public void SetParameter(int buyNum, int viewerId) - { - BingoDrawTaskParam bingoDrawTaskParam = new BingoDrawTaskParam(); - bingoDrawTaskParam.viewer_id = viewerId.ToString(); - bingoDrawTaskParam.draw_count = buyNum; - base.Params = bingoDrawTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoInfoTask.cs deleted file mode 100644 index 50dffb11..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoInfoTask.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; - -namespace Wizard.Bingo; - -public class BingoInfoTask : BaseTask -{ - public struct SquareData - { - public int SquareId; - - public int DisplayId; - - public bool IsOpen; - - public int TreasureBoxGradeId; - - public SquareData(JsonData squareJsonData) - { - SquareId = squareJsonData["square_id"].ToInt(); - DisplayId = squareJsonData["display_id"].ToInt(); - IsOpen = squareJsonData["is_open"].ToInt() == 1; - TreasureBoxGradeId = squareJsonData["treasure_box_grade_id"].ToInt(); - } - } - - public struct BingoMissionData - { - public string MissionTitle { get; private set; } - - public int MissionCurrent { get; private set; } - - public int MissionMax { get; private set; } - - public bool IsCleared { get; private set; } - - public ReceivedReward Reward { get; private set; } - - public float MissionRatio - { - get - { - if (MissionMax == 0) - { - return 0f; - } - return (float)MissionCurrent / (float)MissionMax; - } - } - - public BingoMissionData(JsonData json) - { - MissionTitle = json["mission_name"].ToString(); - MissionCurrent = json["total_count"].ToInt(); - MissionMax = json["require_number"].ToInt(); - IsCleared = json["is_achieved"].ToInt() == 1; - ReceivedReward reward = ReceivedReward.CreateFromBingoMissionReward(json["reward_list"][0]); - Reward = reward; - } - } - - public struct CurrentLineRewardInfo - { - public string LineNum { get; private set; } - - public bool IsCleared { get; private set; } - - public ReceivedReward Reward { get; private set; } - - public CurrentLineRewardInfo(JsonData json) - { - LineNum = json["line_num"].ToString(); - IsCleared = json["is_achieved"].ToInt() == 1; - ReceivedReward reward = ReceivedReward.CreateFromBingoMissionReward(json); - Reward = reward; - } - } - - public class BingoInfoData - { - public int CampaignId; - - public int SheetNum { get; private set; } - - public int BingoTicketNum { get; private set; } - - public int MaxSquareNum { get; private set; } - - public int MaxSheetNum { get; private set; } - - public int BingoDrawCost { get; private set; } - - public List SquareDataList { get; private set; } - - public Dictionary> AllLineRewardsListDic { get; private set; } - - public DateTime StartTime { get; private set; } - - public DateTime EndTime { get; private set; } - - public string NotificationId { get; private set; } - - public List MissionList { get; private set; } - - public List CurrentLineRewardList { get; private set; } - - public DateTime MissionEndTime { get; private set; } - - public bool IsMissionActivePeriod { get; private set; } - - public BingoInfoData(int campaignId, int sheetNum, int bingoTicketNum, int maxSquareNum, int maxSheetNum, int bingoDrawCost, DateTime startTime, DateTime endTime, List squareDataList, Dictionary> allLineRewardsListDic, string notificationId, List missionList, List currentLineRewardList, DateTime missionEndTime, bool isMissionActivePeriod) - { - CampaignId = campaignId; - SheetNum = sheetNum; - BingoTicketNum = bingoTicketNum; - MaxSquareNum = maxSquareNum; - MaxSheetNum = maxSheetNum; - BingoDrawCost = bingoDrawCost; - StartTime = startTime; - EndTime = endTime; - SquareDataList = squareDataList; - AllLineRewardsListDic = allLineRewardsListDic; - NotificationId = notificationId; - MissionList = missionList; - CurrentLineRewardList = currentLineRewardList; - MissionEndTime = missionEndTime; - IsMissionActivePeriod = isMissionActivePeriod; - } - } - - public class BingoInfoTaskParam : BaseParam - { - public bool is_display_update; - } - - public BingoInfoData Result { get; private set; } - - public bool CanGiveDailyLoginBonus { get; private set; } - - public BingoDrawTask.BingoDrawTaskData BingoLoginDrawResult { get; private set; } - - public BingoInfoTask() - { - base.type = ApiType.Type.BingoInfo; - } - - public void SetParameter(bool isDisplayUpdate) - { - BingoInfoTaskParam bingoInfoTaskParam = new BingoInfoTaskParam(); - bingoInfoTaskParam.is_display_update = isDisplayUpdate; - base.Params = bingoInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - CanGiveDailyLoginBonus = jsonData.GetValueOrDefault("can_give_login_bonus", defaultValue: false); - if (CanGiveDailyLoginBonus) - { - return num; - } - int campaignId = jsonData["campaign_id"].ToInt(); - int sheetNum = jsonData["sheet_num"].ToInt(); - int bingoTicketNum = jsonData["bingo_ticket_num"].ToInt(); - int maxSquareNum = jsonData["max_square_num"].ToInt(); - int maxSheetNum = jsonData["max_sheet_num"].ToInt(); - int bingoDrawCost = jsonData["bingo_draw_cost"].ToInt(); - string notificationId = jsonData["notice_text_id"].ToString(); - DateTime startTime = DateTime.Parse(jsonData["start_time"].ToString()); - DateTime endTime = DateTime.Parse(jsonData["end_time"].ToString()); - DateTime missionEndTime = DateTime.Parse(jsonData["mission_end_time"].ToString()); - bool isMissionActivePeriod = jsonData["is_mission_active_period"].ToBoolean(); - JsonData jsonData2 = jsonData["square_list"]; - List list = new List(); - for (int i = 1; i < jsonData2.Count; i++) - { - SquareData item = new SquareData(jsonData2[i]); - list.Add(item); - } - JsonData jsonData3 = jsonData["all_line_reward_list"]; - Dictionary> dictionary = new Dictionary>(); - for (int j = 0; j < jsonData3.Count; j++) - { - for (int k = 0; k < jsonData3[j].Count; k++) - { - ReceivedReward item2 = ReceivedReward.CreateFromBingoLineReward(jsonData3[j][k]); - if (dictionary.ContainsKey(j)) - { - dictionary[j].Add(item2); - continue; - } - dictionary[j] = new List(); - dictionary[j].Add(item2); - } - } - JsonData jsonData4 = jsonData["mission_list"]; - List list2 = new List(); - for (int l = 0; l < jsonData4.Count; l++) - { - BingoMissionData item3 = new BingoMissionData(jsonData4[l]); - list2.Add(item3); - } - JsonData jsonData5 = jsonData["current_line_reward_list"]; - List list3 = new List(); - for (int m = 0; m < jsonData5.Count; m++) - { - CurrentLineRewardInfo item4 = new CurrentLineRewardInfo(jsonData5[m]); - list3.Add(item4); - } - if (jsonData.TryGetValue("login_bonus", out var value)) - { - BingoLoginDrawResult = BingoDrawTask.ParseBingoDrawResult(value, isBingoLoginBonus: true); - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(value["reward_list"]); - } - Result = new BingoInfoData(campaignId, sheetNum, bingoTicketNum, maxSquareNum, maxSheetNum, bingoDrawCost, startTime, endTime, list, dictionary, notificationId, list2, list3, missionEndTime, isMissionActivePeriod); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoMissionDialog.cs b/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoMissionDialog.cs deleted file mode 100644 index b554dea1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoMissionDialog.cs +++ /dev/null @@ -1,55 +0,0 @@ -using UnityEngine; - -namespace Wizard.Bingo; - -public class BingoMissionDialog : MonoBehaviour -{ - [SerializeField] - private GameObject _bingoMissionItemPrefab; - - [SerializeField] - private UIGrid _grid; - - [SerializeField] - private UIScrollView _scrollPanel; - - private BingoInfoTask.BingoInfoData _bingoInfoData; - - private ResourceHandler _resourceHandler; - - public static void Create(GameObject prefab, BingoInfoTask.BingoInfoData bingoData) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - BingoMissionDialog missionDialog = Object.Instantiate(prefab).GetComponent(); - missionDialog._resourceHandler = missionDialog.gameObject.AddMissingComponent(); - dialogBase.SetObj(missionDialog.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.OnClose = delegate - { - missionDialog._resourceHandler.UnloadAll(); - }; - missionDialog.Initialize(bingoData); - } - - private void Initialize(BingoInfoTask.BingoInfoData bingoInfoData) - { - _bingoInfoData = bingoInfoData; - UpdateMissionView(); - } - - private void UpdateMissionView() - { - _grid.transform.DestroyChildren(); - for (int i = 0; i < _bingoInfoData.MissionList.Count; i++) - { - bool flag = i + 1 == _bingoInfoData.MissionList.Count; - AchievementWindowBase component = NGUITools.AddChild(_grid.gameObject, _bingoMissionItemPrefab).GetComponent(); - component.gameObject.SetActive(value: true); - component.SetBingoMission(_bingoInfoData.MissionList[i], !flag, _resourceHandler); - } - _grid.Reposition(); - _scrollPanel.ResetPosition(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoPage.cs b/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoPage.cs deleted file mode 100644 index d195d282..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoPage.cs +++ /dev/null @@ -1,1245 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard.Bingo; - -public class BingoPage : UIBase -{ - public struct BallPosData - { - public Vector3 Line1LeftPos { get; private set; } - - public Vector3 Line2LeftPos { get; private set; } - - public Vector3 Line3LeftPos { get; private set; } - - public int Line1Num { get; private set; } - - public int Line2Num { get; private set; } - - public int Line3Num { get; private set; } - - public float Line1Space { get; private set; } - - public float Line2Space { get; private set; } - - public float Line3Space { get; private set; } - - public BallPosData(Vector3 line1LeftPos, Vector3 line2LeftPos, Vector3 line3LeftPos, int line1Num, int line2Num, int line3Num, float line1Space, float line2Space, float line3Space) - { - Line1LeftPos = line1LeftPos; - Line2LeftPos = line2LeftPos; - Line3LeftPos = line3LeftPos; - Line1Num = line1Num; - Line2Num = line2Num; - Line3Num = line3Num; - Line1Space = line1Space; - Line2Space = line2Space; - Line3Space = line3Space; - } - } - - public const float EFFECT_DURATION_TOTAL = 1f; - - public const float BALL_FALL_TIME = 0.7f; - - private const int MAX_BINGO_GACHA_NUM = 10; - - private const float BLOCK_LIGHT_DELAY = 0.06f; - - private const float THREE_ROWS_SIZE = 90f; - - private const float FIVE_ROWS_SIZE = 54f; - - public const string BALL_FALL_EFFECT = "cmn_bingo_ball_1"; - - public const string BALL_LIGHT_EFFECT = "cmn_bingo_ball_2"; - - public const string BINGO_EFFECT = "cmn_bingo_cmp_1"; - - private const string TREASUREBOX_SPRITE_NAME = "box_2pick_0{0}_close"; - - private const string TREASUREBOX_SE_NAME = "se_bng_box_open_0{0}"; - - private const string TREASUREBOX_EFFECT_NAME = "cmn_arena_treasure_gp_{0}"; - - private const string BINGO_LINES_TEXUTRE_NAME = "bingo_lines"; - - private const string BINGO_STAMP_TEXUTRE_NAME = "bingo_square_stamp"; - - private const string BINGO_SHEET_NAME = "bingosheet"; - - private const int BINGO_CHARA_STANDING_PIC_CHARA_ID = 3304; - - private float _fiveFiveBlockScale = 0.6f; - - private float _bingoBlockGridSizeCoef = 1.0889f; - - private const float LOGIN_ANIMATION_WAIT_TIME = 1.25f; - - private const int DIALOG_RIBBON_ANCHOR_BOTTOM = -5; - - private const int DIALOG_RIBBON_ANCHOR_TOP = 15; - - [SerializeField] - private UIGrid _gridBingBlockGrid; - - [SerializeField] - private GameObject _originBingoSheetBlock; - - [SerializeField] - private GachaLayoutPurchaseButton _bingoTicketAreaLayout; - - [SerializeField] - private BingoSelectBuyNumPopup _prefabDialogSelectBuyNumber; - - [SerializeField] - private UIButton _questMissionButton; - - [SerializeField] - private UIButton _rewardsButton; - - [SerializeField] - private UIButton _detailsButton; - - [SerializeField] - private GameObject _missionDialogPrefab; - - [SerializeField] - private GameObject _allRewardsDialogPrefab; - - [SerializeField] - private TweenAlpha _fadeDarkBgTweenAlpha; - - [SerializeField] - private BoxCollider _notTouchMypageCollider; - - [SerializeField] - private UIGrid _bingoRewardsGrid; - - [SerializeField] - private UIScrollView _bingoRewardsScrollPanel; - - [SerializeField] - private GameObject _bingoMissionItemPrefab; - - [SerializeField] - private BingoBall _originBingoBall; - - [SerializeField] - private UILabel _labelPeriod; - - [SerializeField] - private UILabel _labelSheetNum; - - [SerializeField] - private GameObject _bingoBalls; - - [SerializeField] - private RewardBase _rewardBase; - - [SerializeField] - private TweenAnimationGroup _bingoAnimation; - - [SerializeField] - private TweenAnimationGroup _bingoLineAnimation; - - [SerializeField] - private UISpriteAtlasOverwriter _spriteAtlasOverwriter; - - [SerializeField] - private UITexture _bgCharaTexture; - - [SerializeField] - private UITexture _animationLinesTexture; - - [SerializeField] - private UIButton _skipButton; - - [SerializeField] - private UIButton _hiddenFullScreenButton; - - [SerializeField] - private GameObject _dustEffectContainer; - - [SerializeField] - private GameObject _bingoTicketButtonEffect; - - [SerializeField] - private UITexture _bingoSheet; - - [SerializeField] - private GameObject _bingoAnimationFadeDarkBg; - - [SerializeField] - private TweenAlpha _bingoAnimationFadeDarkTweenAlpha; - - [SerializeField] - private SpineDisplay _spineDisplayLogin; - - [SerializeField] - private SpineDisplay _spineDisplayPurchase; - - [SerializeField] - private UITexture _spineTexture; - - [SerializeField] - private Camera _uiSpineCamera; - - private List _bingoSheetBlockList; - - private BingoInfoTask.BingoInfoData _bingoInfoData; - - private BingoDrawTask.BingoDrawTaskData _bingoLoginDrawData; - - private BingoDrawTask.BingoDrawTaskData _bingoDrawTaskData; - - private ResourceHandler _resourceHandler; - - private GameObject _boxOpenEffectObj; - - private GameObject _treasureEffectObj; - - private bool _isPlayBoxOpenEffect; - - private List _loadedResourceList = new List(); - - private List _inProcessCoroutines = new List(); - - private List _inProcessTweenAnimationGroup = new List(); - - private const string BINGO_LOGIN_ANIMATION = "spine_bingo_01"; - - private const string BINGO_PURCHASE_ANIMATION = "spine_bingo_02"; - - private static readonly KeyValuePair FirstTipsSaveKey = PlayerPrefsWrapper.FIRST_TIPS_BINGO_ID; - - private List _bingoSeList = new List - { - "se_sys_bng_ballfall_01", "se_sys_bng_number_open_01", "se_sys_bng_stamp_01", "se_sys_bng_line_01", "se_sys_bng_line_02", "se_sys_bng_line_03", "se_sys_bng_line_04", "se_sys_bng_line_05", "se_sys_bng_line_06", "se_sys_bng_line_07", - "se_sys_bng_line_08", "se_sys_bng_line_09", "se_sys_bng_line_10", "se_sys_bng_line_11", "se_sys_bng_line_12", "se_sys_bng_bingo_01", "se_sys_bng_number_open_pre_01", "se_bng_appear_01", "se_bng_lottery_01", "se_bng_lottery_voice_01", - "se_bng_box_open_01", "se_bng_box_open_05", "se_bng_box_open_06" - }; - - private const float BALL_SPACE = 40f; - - private Dictionary _ballPosDataDic; - - private List _bingoBallList; - - private List GetOpenedBingoBlock => _bingoInfoData.SquareDataList.Where((BingoInfoTask.SquareData squareData) => squareData.IsOpen).ToList(); - - private int GetDisplayIdBySquareId(int squareId) - { - return _bingoInfoData.SquareDataList.Where((BingoInfoTask.SquareData squareData) => squareData.SquareId == squareId).FirstOrDefault().DisplayId; - } - - private bool IsGetSomeRewards() - { - if (_bingoDrawTaskData == null || (_bingoDrawTaskData.LineRewardData.Count <= 0 && _bingoDrawTaskData.TreasureBoxReawrdList.Count <= 0)) - { - if (_bingoLoginDrawData != null) - { - if (_bingoLoginDrawData.LineRewardData.Count <= 0) - { - return _bingoLoginDrawData.TreasureBoxReawrdList.Count > 0; - } - return true; - } - return false; - } - return true; - } - - public static void ChangeSceneBingoPage() - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Bingo); - } - - public override void onFirstStart() - { - base.IsShowFooterMenu = true; - _resourceHandler = base.gameObject.AddMissingComponent(); - base.onFirstStart(); - } - - protected override void onOpen() - { - base.onOpen(); - CreateTopBar(); - InitFooter(); - InitSpriteAtlasOverwriter(); - AddSeCueSheet(); - BingoInfoTask task = new BingoInfoTask(); - task.SetParameter(isDisplayUpdate: false); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _bingoInfoData = task.Result; - _bingoLoginDrawData = task.BingoLoginDrawResult; - Init(); - })); - } - - protected override void onClose() - { - base.onClose(); - UnloadResources(); - _notTouchMypageCollider.enabled = false; - UIManager.GetInstance()._Footer.CancelOverwriteLabelColors(); - UnityEngine.Object.Destroy(_fadeDarkBgTweenAlpha.transform.parent.gameObject); - } - - private void CreateBallPosDataDic() - { - float num = 0f - _originBingoBall.GetBallMovement().x; - float num2 = 0f - _originBingoBall.GetBallMovement().y; - _ballPosDataDic = new Dictionary - { - { - 1, - new BallPosData(new Vector3(num, num2, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), 1, 0, 0, 0f, 0f, 0f) - }, - { - 2, - new BallPosData(new Vector3(num - 80f, num2, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), 2, 0, 0, 160f, 0f, 0f) - }, - { - 3, - new BallPosData(new Vector3(num - 160f, num2, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), 3, 0, 0, 160f, 0f, 0f) - }, - { - 4, - new BallPosData(new Vector3(num - 240f, num2, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), 4, 0, 0, 160f, 0f, 0f) - }, - { - 5, - new BallPosData(new Vector3(num - 320f, num2, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), 5, 0, 0, 160f, 0f, 0f) - }, - { - 6, - new BallPosData(new Vector3(num - 160f, num2 + 80f, 0f), new Vector3(num - 160f, num2 - 80f, 0f), new Vector3(0f, 0f, 0f), 3, 3, 0, 160f, 160f, 0f) - }, - { - 7, - new BallPosData(new Vector3(num - 80f, num2 + 160f, 0f), new Vector3(num - 160f, num2, 0f), new Vector3(num - 80f, num2 - 160f, 0f), 2, 3, 2, 160f, 160f, 160f) - }, - { - 8, - new BallPosData(new Vector3(num - 160f, num2 + 160f, 0f), new Vector3(num - 80f, num2, 0f), new Vector3(num - 160f, num2 - 160f, 0f), 3, 2, 3, 160f, 160f, 160f) - }, - { - 9, - new BallPosData(new Vector3(num - 160f, num2 + 160f, 0f), new Vector3(num - 160f, num2, 0f), new Vector3(num - 160f, num2 - 160f, 0f), 3, 3, 3, 160f, 160f, 160f) - }, - { - 10, - new BallPosData(new Vector3(num - 160f, num2 + 160f, 0f), new Vector3(num - 240f, num2, 0f), new Vector3(num - 160f, num2 - 160f, 0f), 3, 4, 3, 160f, 160f, 160f) - } - }; - } - - private void Init() - { - if (_bingoInfoData == null) - { - return; - } - CreateBallPosDataDic(); - _fadeDarkBgTweenAlpha.gameObject.transform.parent.transform.parent = UIManager.GetInstance().transform; - _fadeDarkBgTweenAlpha.gameObject.transform.parent.gameObject.SetLayer(LayerMask.NameToLayer("MyPage"), isSetChildren: true); - _fadeDarkBgTweenAlpha.gameObject.transform.parent.gameObject.GetComponent().depth = 31; - _notTouchMypageCollider.enabled = false; - _skipButton.GetComponent().uiCamera = UIManager.GetInstance().MyPageUICameraObj.GetComponent(); - UpdatePeriodInfo(); - _bingoSheetBlockList = new List(); - _bingoBallList = new List(); - StartCoroutine(LoadResources(delegate - { - SetTextures(); - UpdateBingoSheet(); - UpdatePurchaseArea(); - UpdateSideBarRewards(isFirstOpen: true); - UpdateBingoSheetNum(); - UpdateBuyButton(); - _spineDisplayPurchase.Initialize("spine_bingo_02", _spineTexture, _uiSpineCamera); - _spineDisplayLogin.Initialize("spine_bingo_01", _spineTexture, _uiSpineCamera); - _spineDisplayPurchase.gameObject.SetActive(value: false); - _spineDisplayLogin.gameObject.SetActive(value: false); - _spineTexture.gameObject.SetActive(value: false); - UIManager.GetInstance().OnReadyViewScene(isFadein: true, delegate - { - if (_bingoLoginDrawData != null) - { - BingoLoginBonusStart(); - } - else - { - DisplayFirstTips(_bingoInfoData.CampaignId, _bingoInfoData.IsMissionActivePeriod); - } - }); - })); - CreateButtons(); - } - - private void CreateTopBar() - { - string titleMsg = Data.SystemText.Get("Bingo_0023"); - TopBar topBar = UIManager.GetInstance().CreateTopBar(base.gameObject, titleMsg, UIManager.ViewScene.MyPage, MoneyDraw: false); - topBar.gameObject.layer = LayerMask.NameToLayer("MyPage"); - topBar.OverwriteBackLabelColors(eColorCodeId.QuestBackButtonGradientTop, eColorCodeId.QuestBackButtonGradientBottom); - } - - private void InitFooter() - { - UIManager.GetInstance()._Footer.OverwriteLabelColors(eColorCodeId.QuestFooterGradientTop, eColorCodeId.QuestFooterGradientBottom, eColorCodeId.QuestFooterOutline); - UIManager.GetInstance()._Footer.UpdateCurrentIndex(0); - } - - private void InitSpriteAtlasOverwriter() - { - UIAtlas component = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("dummy", ResourcesManager.AssetLoadPathType.QuestAtlas, isfetch: true)).GetComponent(); - UISpriteAtlasOverwriter.TargetObject[] targetObjects = new UISpriteAtlasOverwriter.TargetObject[2] - { - new UISpriteAtlasOverwriter.TargetObject(UIManager.GetInstance().UIManagerRoot.gameObject, includeChildren: true), - new UISpriteAtlasOverwriter.TargetObject(UIManager.GetInstance().UIRootSystem.gameObject, includeChildren: true) - }; - _spriteAtlasOverwriter.Init(component, targetObjects); - } - - private void AddSeCueSheet() - { - foreach (string bingoSe in _bingoSeList) - { - Toolbox.AudioManager.AddCueSheet(bingoSe, bingoSe + ".acb", "s/"); - } - } - - private void CreateButtons() - { - _questMissionButton.onClick.Clear(); - _questMissionButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (_bingoInfoData.IsMissionActivePeriod) - { - BingoMissionDialog.Create(_missionDialogPrefab, _bingoInfoData); - } - else - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetTitleLabel(systemText.Get("Bingo_0005")); - dialogBase.SetText(systemText.Get("Bingo_0033")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - } - })); - _detailsButton.onClick.Clear(); - _detailsButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - OnClickDetailsButton(); - })); - _rewardsButton.onClick.Clear(); - _rewardsButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - BingoRewardsDialog.Create(_allRewardsDialogPrefab, _bingoInfoData); - })); - _skipButton.onClick.Clear(); - _skipButton.gameObject.SetActive(value: false); - _skipButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - SkipBingoAnimationsAndEffects(); - _skipButton.gameObject.SetActive(value: false); - })); - _hiddenFullScreenButton.onClick.Clear(); - _hiddenFullScreenButton.gameObject.SetActive(value: false); - } - - private void OnClickDetailsButton() - { - if (_bingoInfoData.NotificationId == "") - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(systemText.Get("Bingo_0007")); - dialogBase.SetText(systemText.Get("Quest_0034")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - SetExceptionDialog(dialogBase); - } - else - { - UIManager.GetInstance().WebViewHelper.OpenAnnounceWebView(_bingoInfoData.NotificationId, delegate(DialogBase dialog) - { - SetExceptionDialog(dialog); - }); - } - } - - private void SetExceptionDialog(DialogBase dialog) - { - List exceptionObjects = new List - { - new UISpriteAtlasOverwriter.TargetObject(dialog.gameObject, includeChildren: true) - }; - _spriteAtlasOverwriter.AddExceptionObjects(exceptionObjects); - } - - private void UpdateBingoSheet() - { - _gridBingBlockGrid.transform.DestroyChildren(); - _bingoSheetBlockList.Clear(); - _originBingoSheetBlock.SetActive(value: false); - List squareDataList = _bingoInfoData.SquareDataList; - int num = (int)Mathf.Sqrt(_bingoInfoData.MaxSquareNum); - float blockScale = ((num == 5) ? _fiveFiveBlockScale : 1f); - int num2 = ((num == 3) ? 90 : 54); - for (int i = 0; i < _bingoInfoData.MaxSquareNum; i++) - { - BingoSheetBlock component = NGUITools.AddChild(_gridBingBlockGrid.gameObject, _originBingoSheetBlock).GetComponent(); - component.gameObject.SetActive(value: true); - component.SetNumLabel(squareDataList[i].DisplayId, num); - component.SetBlockScale(blockScale); - component.SetPartsVisible(blockVisible: true, squareDataList[i].TreasureBoxGradeId, squareDataList[i].IsOpen); - _bingoSheetBlockList.Add(component); - } - _originBingoSheetBlock.gameObject.SetActive(value: false); - _gridBingBlockGrid.maxPerLine = num; - _gridBingBlockGrid.cellHeight = (float)num2 * _bingoBlockGridSizeCoef; - _gridBingBlockGrid.cellWidth = (float)num2 * _bingoBlockGridSizeCoef; - _gridBingBlockGrid.repositionNow = true; - } - - private void UpdateBingoSheetNum() - { - _labelSheetNum.text = Data.SystemText.Get("Bingo_0002", _bingoInfoData.SheetNum.ToString(), _bingoInfoData.MaxSheetNum.ToString(), GetOpenedBingoBlock.Count.ToString(), _bingoInfoData.MaxSquareNum.ToString()); - } - - private void UpdatePurchaseArea(int preCalculatedNum = -1) - { - if (preCalculatedNum >= 0) - { - _bingoTicketAreaLayout.SetHaveItemLabel(preCalculatedNum); - } - else - { - _bingoTicketAreaLayout.SetHaveItemLabel(_bingoInfoData.BingoTicketNum); - } - _bingoTicketAreaLayout.SetOnClickPurchaseButton(OnClickPurchaseButton); - } - - private void UpdateSideBarRewards(bool isFirstOpen = false) - { - List currentLineRewardList = _bingoInfoData.CurrentLineRewardList; - _bingoRewardsGrid.transform.DestroyChildren(); - for (int i = 0; i < currentLineRewardList.Count; i++) - { - bool flag = i + 1 == currentLineRewardList.Count; - AchievementWindowBase component = NGUITools.AddChild(_bingoRewardsGrid.gameObject, _bingoMissionItemPrefab).GetComponent(); - component.gameObject.SetActive(value: true); - component.SetBingoSideBarRewards(currentLineRewardList[i].LineNum, currentLineRewardList[i].Reward, currentLineRewardList[i].IsCleared, !flag, _resourceHandler); - } - _bingoRewardsGrid.Reposition(); - if (GetOpenedBingoBlock.Count == 0 || isFirstOpen) - { - _bingoRewardsScrollPanel.ResetPosition(); - } - } - - private void SkipBingoAnimationsAndEffects() - { - if (_inProcessCoroutines.Count > 0) - { - foreach (Coroutine inProcessCoroutine in _inProcessCoroutines) - { - if (inProcessCoroutine != null) - { - UIManager.GetInstance().StopCoroutine(inProcessCoroutine); - } - } - } - foreach (BingoBall bingoBall in _bingoBallList) - { - bingoBall.StopCoroutine(); - } - _spineTexture.gameObject.SetActive(value: false); - _spineDisplayPurchase.StartMotion("NONE"); - _spineDisplayLogin.StartMotion("NONE"); - _spineDisplayPurchase.gameObject.SetActive(value: false); - _spineDisplayLogin.gameObject.SetActive(value: false); - iTween.Stop(base.gameObject, includechildren: true); - _bingoBalls.transform.DestroyChildren(); - _dustEffectContainer.transform.DestroyChildren(); - TweenAlpha.Begin(_fadeDarkBgTweenAlpha.gameObject, 0f, 0f); - _notTouchMypageCollider.enabled = false; - if (_inProcessTweenAnimationGroup.Count > 0) - { - foreach (TweenAnimationGroup item in _inProcessTweenAnimationGroup) - { - item.StopAllCoroutines(); - UnityEngine.Object.Destroy(item.gameObject); - } - _inProcessTweenAnimationGroup.Clear(); - } - foreach (BingoSheetBlock bingoSheetBlock in _bingoSheetBlockList) - { - bingoSheetBlock.CancelAnimations(); - } - _hiddenFullScreenButton.onClick.Clear(); - _hiddenFullScreenButton.gameObject.SetActive(value: false); - _bingoAnimationFadeDarkBg.SetActive(value: false); - if (_boxOpenEffectObj != null) - { - UnityEngine.Object.Destroy(_boxOpenEffectObj); - } - if (_treasureEffectObj != null) - { - UnityEngine.Object.Destroy(_treasureEffectObj); - } - _isPlayBoxOpenEffect = false; - if (IsGetSomeRewards()) - { - ShowAllRewardsDialog(); - return; - } - BingoInfoUpdate(delegate - { - EnableTouchAndBackKey(); - DisplayFirstTips(_bingoInfoData.CampaignId, _bingoInfoData.IsMissionActivePeriod); - }); - } - - private IEnumerator LoadResources(Action callBack) - { - List loadList = new List(); - string[] array = new string[3] { "cmn_bingo_ball_1", "cmn_bingo_ball_2", "cmn_bingo_cmp_1" }; - foreach (string path in array) - { - loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.Effect2D)); - } - loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath(3304.ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase)); - array = new string[3] { "bingo_lines", "bingo_square_stamp", "bingosheet" }; - foreach (string path2 in array) - { - loadList.Add(Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.Bingo)); - } - loadList.AddRange(_spineDisplayPurchase.GetLoadPath("spine_bingo_02", fetch: false)); - loadList.AddRange(_spineDisplayLogin.GetLoadPath("spine_bingo_01", fetch: false)); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _loadedResourceList.AddRange(loadList); - callBack.Call(); - } - - private void UnloadResources() - { - _resourceHandler.UnloadAll(); - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private void OnClickPurchaseButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - CreateSelectBuyNumDialog(); - } - - private void CreateSelectBuyNumDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0014")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.NONE); - dialogBase.SetReturnMsg(null, ""); - dialogBase.SetPanelDepth(100); - int ablePackNumByGachaInfo = GetAblePackNumByGachaInfo(); - BingoSelectBuyNumPopup bingoSelectBuyNumPopup = UnityEngine.Object.Instantiate(_prefabDialogSelectBuyNumber); - bingoSelectBuyNumPopup.gameObject.SetActive(value: true); - dialogBase.SetObj(bingoSelectBuyNumPopup.gameObject); - bingoSelectBuyNumPopup.Init(dialogBase, ablePackNumByGachaInfo, GetOpenedBingoBlock.Count, _bingoInfoData, BingoPurchase); - } - - private static void DisplayFirstTips(int id, bool isMissionActivePeriod) - { - if (isMissionActivePeriod && PlayerPrefsWrapper.GetValue(FirstTipsSaveKey) != id) - { - UIManager.GetInstance().StartFirstTips(FirstTips.TipsType.Bingo, delegate - { - PlayerPrefsWrapper.SetValue(FirstTipsSaveKey, id); - }); - } - } - - private int GetAblePackNumByGachaInfo() - { - int count = GetOpenedBingoBlock.Count; - return Mathf.Clamp(_bingoInfoData.BingoTicketNum / _bingoInfoData.BingoDrawCost, 0, Mathf.Min(10, _bingoInfoData.MaxSquareNum - count)); - } - - private void BingoPurchase(int buyNum) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - BingoDrawTask task = new BingoDrawTask(); - task.SetParameter(buyNum, Certification.ViewerId); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _bingoDrawTaskData = task.Result; - FadeInDark(task.Result); - })); - } - - private void BingoLoginBonusStart() - { - FadeInDark(_bingoLoginDrawData); - } - - private void FadeInDark(BingoDrawTask.BingoDrawTaskData result) - { - UIManager.GetInstance().OpenNotTouch(); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; - _notTouchMypageCollider.enabled = true; - if (!result.IsBingoLoginBonus) - { - UpdatePurchaseArea(_bingoInfoData.BingoTicketNum - result.HitSquareIdList.Count); - } - _fadeDarkBgTweenAlpha.from = 0f; - _fadeDarkBgTweenAlpha.SetOnFinished(delegate - { - _skipButton.gameObject.SetActive(value: true); - _skipButton.gameObject.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); - if (result.IsBingoLoginBonus) - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlayBingoLoginBonusAnimation(result))); - } - else - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlayPurchaseAnimation(result))); - } - }); - TweenAlpha.Begin(_fadeDarkBgTweenAlpha.gameObject, 0.6f, 1f); - } - - private IEnumerator PlayPurchaseAnimation(BingoDrawTask.BingoDrawTaskData result) - { - _spineDisplayPurchase.gameObject.SetActive(value: true); - _spineDisplayPurchase.StartMotion(ClassCharaPrm.MotionType.extra.ToString()); - yield return null; - _spineTexture.gameObject.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_bng_lottery_01", "se_bng_lottery_01", 0f, 0L); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_bng_lottery_voice_01", "se_bng_lottery_voice_01", 0f, 0L); - while (_spineDisplayPurchase.IsPlaying()) - { - yield return null; - } - _spineDisplayPurchase.gameObject.SetActive(value: false); - _spineTexture.gameObject.SetActive(value: false); - BingoMovement(result, delegate - { - EnableTouchAndBackKey(); - DisplayFirstTips(_bingoInfoData.CampaignId, _bingoInfoData.IsMissionActivePeriod); - }); - } - - private IEnumerator PlayBingoLoginBonusAnimation(BingoDrawTask.BingoDrawTaskData result) - { - _spineDisplayLogin.gameObject.SetActive(value: true); - _spineDisplayLogin.StartMotion("anime"); - yield return null; - _spineTexture.gameObject.SetActive(value: true); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_bng_appear_01", "se_bng_appear_01", 0f, 0L); - yield return new WaitForSeconds(1.25f); - _spineDisplayLogin.gameObject.SetActive(value: false); - _spineTexture.gameObject.SetActive(value: false); - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(FadeOutDark(0.3f, result, delegate - { - EnableTouchAndBackKey(); - DisplayFirstTips(_bingoInfoData.CampaignId, _bingoInfoData.IsMissionActivePeriod); - }))); - } - - private void EnableTouchAndBackKey() - { - UIManager.GetInstance().offNotTouch(); - _notTouchMypageCollider.enabled = false; - _inProcessCoroutines.Clear(); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - } - - private IEnumerator FadeOutDark(float delay, BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - yield return new WaitForSeconds(delay); - _bingoBalls.transform.DestroyChildren(); - _fadeDarkBgTweenAlpha.from = 1f; - _fadeDarkBgTweenAlpha.SetOnFinished(delegate - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlayStamp(result, onBingoFinish))); - }); - TweenAlpha.Begin(_fadeDarkBgTweenAlpha.gameObject, 0.6f, 0f); - } - - private void BingoMovement(BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - _bingoBallList.Clear(); - int count = result.HitSquareIdList.Count; - _bingoBalls.transform.DestroyChildren(); - _ballPosDataDic.TryGetValue(count, out var value); - for (int i = 0; i < value.Line1Num; i++) - { - BingoBall component = NGUITools.AddChild(_bingoBalls, _originBingoBall.gameObject).GetComponent(); - component.gameObject.transform.localPosition = new Vector3(value.Line1LeftPos.x + (float)i * value.Line1Space, value.Line1LeftPos.y, 0f); - component.SetBallSprite(isFront: false); - _bingoBallList.Add(component); - } - for (int j = 0; j < value.Line2Num; j++) - { - BingoBall component2 = NGUITools.AddChild(_bingoBalls, _originBingoBall.gameObject).GetComponent(); - component2.gameObject.transform.localPosition = new Vector3(value.Line2LeftPos.x + (float)j * value.Line2Space, value.Line2LeftPos.y, 0f); - component2.SetBallSprite(isFront: false); - _bingoBallList.Add(component2); - } - for (int k = 0; k < value.Line3Num; k++) - { - BingoBall component3 = NGUITools.AddChild(_bingoBalls, _originBingoBall.gameObject).GetComponent(); - component3.gameObject.transform.localPosition = new Vector3(value.Line3LeftPos.x + (float)k * value.Line3Space, value.Line3LeftPos.y, 0f); - component3.SetBallSprite(isFront: false); - _bingoBallList.Add(component3); - } - for (int l = 0; l < _bingoBallList.Count; l++) - { - _bingoBallList[l].SetBallNum(GetDisplayIdBySquareId(result.HitSquareIdList[l])); - float num = 0f - _originBingoBall.GetBallMovement().y; - float y = _bingoBallList[l].transform.parent.transform.TransformPoint(new Vector3(_bingoBallList[l].transform.localPosition.x, _bingoBallList[l].transform.localPosition.y - num, 0f)).y; - float num2 = 1f / (float)_bingoBallList.Count * (float)l; - _bingoBallList[l].PlayTweenAnimation(_bingoBallList[l].transform.localPosition, num2); - _loadedResourceList.AddRange(_bingoBallList[l].PlayDustEffect("cmn_bingo_ball_1", _dustEffectContainer, 0.7f, y, num2)); - } - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(PlayBallEffect(_bingoBallList, 1.7f, result, onBingoFinish))); - } - - private IEnumerator PlayBallEffect(List bingoBalls, float delay, BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - yield return new WaitForSeconds(delay - 0.4f); - foreach (BingoBall bingoBall in bingoBalls) - { - _loadedResourceList.AddRange(bingoBall.PlayEffect("cmn_bingo_ball_2", isOnBottom: false)); - } - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_sys_bng_number_open_pre_01", "se_sys_bng_number_open_pre_01", 0f, 0L); - yield return new WaitForSeconds(0.4f); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_sys_bng_number_open_01", "se_sys_bng_number_open_01", 0f, 0L); - foreach (BingoBall bingoBall2 in bingoBalls) - { - bingoBall2.SetBallSprite(isFront: true); - bingoBall2.SetNumSprite(); - } - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(FadeOutDark(3f, result, onBingoFinish))); - } - - private IEnumerator PlayStamp(BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - float num = 0.05f; - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_sys_bng_stamp_01", "se_sys_bng_stamp_01", 0f, 0L); - for (int i = 0; i < result.HitSquareIdList.Count; i++) - { - int index = result.HitSquareIdList[i] - 1; - BingoSheetBlock bingoSheetBlock = _bingoSheetBlockList[index]; - bingoSheetBlock.ResetStampTexture(); - bingoSheetBlock.SetStampVisible(visible: true); - bingoSheetBlock.StampDown(num); - num += 0.03f; - } - float num2 = num; - int num3 = (((int)Mathf.Sqrt(_bingoInfoData.MaxSquareNum) == 3) ? 10 : 8); - for (int j = 0; j < result.CompletedLineConditionList.Count; j++) - { - List list = result.CompletedLineConditionList[j].OrderBy((int a) => a).ToList(); - num2 += (float)(list.Count + num3) * 0.06f; - for (int num4 = 0; num4 < list.Count; num4++) - { - if (num4 == 0) - { - _bingoSheetBlockList[list[num4] - 1].PlaySe(j, num2 - (float)(list.Count - num4) * 0.06f); - } - _bingoSheetBlockList[list[num4] - 1].LightOn(num2 - (float)(list.Count - num4) * 0.06f); - } - } - yield return new WaitForSeconds(Mathf.Max(num2, num) + 0.15f); - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(ShowBingoAnimationAndEffects(result, onBingoFinish))); - } - - private IEnumerator ShowBingoAnimationAndEffects(BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - if (result.CompletedLineConditionList.Count <= 0) - { - ShowLineRewardsDialog(result, onBingoFinish); - yield break; - } - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_sys_bng_bingo_01", "se_sys_bng_bingo_01", 0f, 0L); - TweenAnimationGroup component = NGUITools.AddChild(_bingoAnimationFadeDarkBg, _bingoAnimation.gameObject).GetComponent(); - UIManager.GetInstance().AttachAtlas(component.gameObject); - component.Play(null); - _inProcessTweenAnimationGroup.Add(component); - GameObject bingoEffectObj = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_bingo_cmp_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - bingoEffectObj.transform.parent = component.gameObject.transform; - bingoEffectObj.transform.localPosition = Vector3.zero; - _loadedResourceList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(bingoEffectObj, delegate - { - bingoEffectObj.SetActive(value: true); - })); - _bingoAnimationFadeDarkTweenAlpha.ResetToBeginning(); - _bingoAnimationFadeDarkBg.SetActive(value: true); - _bingoAnimationFadeDarkTweenAlpha.PlayForward(); - yield return new WaitForSeconds(0.32f); - if (result.CompletedLineConditionList.Count > 1) - { - TweenAnimationGroup component2 = NGUITools.AddChild(_bingoAnimationFadeDarkBg, _bingoLineAnimation.gameObject).GetComponent(); - component2.gameObject.SetActive(value: true); - UIManager.GetInstance().AttachAtlas(component2.gameObject); - component2.GetChildObject(0).GetComponentInChildren().spriteName = $"bingo_lines_{result.CompletedLineConditionList.Count.ToString()}"; - component2.Play(null); - _inProcessTweenAnimationGroup.Add(component2); - } - yield return new WaitForSeconds(2f); - _hiddenFullScreenButton.onClick.Clear(); - _hiddenFullScreenButton.onClick.Add(new EventDelegate(delegate - { - foreach (TweenAnimationGroup item in _inProcessTweenAnimationGroup) - { - UnityEngine.Object.Destroy(item.gameObject); - } - _inProcessTweenAnimationGroup.Clear(); - ShowLineRewardsDialog(result, onBingoFinish); - _hiddenFullScreenButton.gameObject.SetActive(value: false); - _bingoAnimationFadeDarkBg.SetActive(value: false); - })); - _hiddenFullScreenButton.gameObject.SetActive(value: true); - } - - public void ShowLineRewardsDialog(BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - if (result.LineRewardData.Count > 0) - { - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.ResetBackViewAlpha(); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(34, isSetBackViewDepthImmediately: true); - dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0022")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - _skipButton.gameObject.SetActive(value: false); - dialogBase.OnClose = delegate - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(RunOpenBoxEffect(Data.SystemText.Get("Bingo_0020"), result, delegate - { - ShowTreatureBoxRewardsDialog(result, onBingoFinish); - }))); - }; - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, _rewardBase.gameObject).GetComponent(); - for (int num = 0; num < result.LineRewardData.Count; num++) - { - component.AddReward(result.LineRewardData[num]); - } - component.EndCreate(); - } - else - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(RunOpenBoxEffect(Data.SystemText.Get("Bingo_0020"), result, delegate - { - ShowTreatureBoxRewardsDialog(result, onBingoFinish); - }))); - } - } - - public void ShowTreatureBoxRewardsDialog(BingoDrawTask.BingoDrawTaskData result, Action onBingoFinish) - { - HideBoxEffect(); - if (result.TreasureBoxReawrdList.Count > 0) - { - _skipButton.gameObject.SetActive(value: true); - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(34); - dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0021")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - _skipButton.gameObject.SetActive(value: false); - dialogBase.OnClose = delegate - { - BingoInfoUpdate(onBingoFinish); - }; - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, _rewardBase.gameObject).GetComponent(); - for (int num = 0; num < result.TreasureBoxReawrdList.Count; num++) - { - component.AddReward(result.TreasureBoxReawrdList[num]); - } - component.EndCreate(); - } - else - { - BingoInfoUpdate(onBingoFinish); - } - } - - private void BingoInfoUpdate(Action onBingoFinish) - { - _skipButton.gameObject.SetActive(value: false); - BingoInfoTask task = new BingoInfoTask(); - task.SetParameter(isDisplayUpdate: true); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - if (task.CanGiveDailyLoginBonus) - { - CreateLoginBonusDialog(); - } - else - { - _bingoInfoData = task.Result; - UpdateBingoSheet(); - UpdatePurchaseArea(); - UpdateSideBarRewards(); - UpdateBingoSheetNum(); - UpdateBuyButton(); - onBingoFinish.Call(); - _bingoDrawTaskData = null; - _bingoLoginDrawData = null; - } - })); - } - - private void CreateLoginBonusDialog() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Dia_LoginBonus_001_Title")); - dialogBase.SetText(systemText.Get("Dia_LoginBonus_001_Body")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BackToTitleBtn); - dialogBase.SetPanelDepth(10); - dialogBase.SetFadeButtonEnabled(flag: false); - } - - private void UpdateBuyButton() - { - bool flag = false; - flag |= _bingoInfoData.MaxSheetNum == _bingoInfoData.SheetNum && _bingoInfoData.SquareDataList.Where((BingoInfoTask.SquareData b) => !b.IsOpen).ToList().Count == 0; - flag |= _bingoInfoData.BingoTicketNum == 0; - _bingoTicketAreaLayout.SetToGrayPurchaseButton(flag); - _bingoTicketButtonEffect.SetActive(!flag); - } - - private void UpdatePeriodInfo() - { - string text = ""; - if (_bingoInfoData.IsMissionActivePeriod) - { - text = ConvertTime.ToLocal(_bingoInfoData.StartTime, _bingoInfoData.MissionEndTime); - _labelPeriod.text = Data.SystemText.Get("Bingo_0001", text); - } - else - { - text = ConvertTime.ToLocal(_bingoInfoData.StartTime, _bingoInfoData.EndTime); - _labelPeriod.text = Data.SystemText.Get("Bingo_0032", text); - } - } - - private void SetTextures() - { - _bgCharaTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(3304.ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture; - _animationLinesTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("bingo_lines", ResourcesManager.AssetLoadPathType.Bingo, isfetch: true)) as Texture; - _originBingoSheetBlock.GetComponent().SetStampTexture(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("bingo_square_stamp", ResourcesManager.AssetLoadPathType.Bingo, isfetch: true)) as Texture); - _bingoSheet.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("bingosheet", ResourcesManager.AssetLoadPathType.Bingo, isfetch: true)) as Texture; - } - - private IEnumerator RunOpenBoxEffect(string message, BingoDrawTask.BingoDrawTaskData result, Action endAction) - { - if (result.TreasureBoxReawrdList.Count <= 0) - { - endAction.Call(); - yield break; - } - _isPlayBoxOpenEffect = true; - int maxGrade = result.TreasureBoxReawrdList.Max((ReceivedReward d) => d._gradeId).Value; - UIManager.GetInstance().OpenNotTouch(); - _notTouchMypageCollider.enabled = true; - _boxOpenEffectObj = NGUITools.AddChild(base.gameObject, Resources.Load("UI/layoutParts/RankWinnerRewardResultPanel") as GameObject); - NguiObjs component = _boxOpenEffectObj.GetComponent(); - UISprite bg = component.sprites[0]; - UISprite window = component.sprites[1]; - UISprite box = component.sprites[2]; - box.atlas = UIManager.GetInstance().GetAtlasList().FirstOrDefault((UIAtlas s) => s.name == "Bingo"); - UILabel label = component.labels[0]; - label.text = message; - UIPanel panel = _boxOpenEffectObj.GetComponent(); - panel.alpha = 0f; - box.spriteName = $"box_2pick_0{maxGrade - 1}_close"; - string loadEffectName = $"cmn_arena_treasure_gp_{maxGrade}"; - List loadList = new List { Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D) }; - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _loadedResourceList.AddRange(loadList); - _treasureEffectObj = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _treasureEffectObj.transform.parent = _boxOpenEffectObj.transform; - _loadedResourceList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_treasureEffectObj, null)); - _boxOpenEffectObj.SetLayer(LayerMask.NameToLayer("MyPage"), isSetChildren: true); - bg.alpha = 0f; - box.alpha = 0f; - label.alpha = 0f; - panel.alpha = 1f; - TweenAlpha.Begin(bg.gameObject, 0.5f, 0.65f); - TweenAlpha.Begin(label.gameObject, 0.5f, 1f); - TweenAlpha.Begin(box.gameObject, 0.5f, 1f); - label.transform.localPosition = new Vector3(100f, 0f, 0f); - window.transform.localScale = new Vector3(1f, 0.01f, 1f); - box.transform.localPosition = new Vector3(180f, 0f, 0f); - iTween.MoveTo(label.gameObject, iTween.Hash("x", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(window.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.MoveTo(box.gameObject, iTween.Hash("y", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.8f); - TweenAlpha.Begin(label.gameObject, 0.5f, 0f); - iTween.MoveTo(box.gameObject, iTween.Hash("x", 0f, "time", 0.7f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - string text = $"se_bng_box_open_0{maxGrade}"; - GameMgr.GetIns().GetSoundMgr().PlaySeByStr(text, text, 0f, 0L); - yield return new WaitForSeconds(1f); - _treasureEffectObj.transform.localPosition = box.transform.localPosition; - _treasureEffectObj.transform.localScale = Vector3.one * 320f * 1.75f; - _treasureEffectObj.SetActive(value: true); - box.gameObject.SetActive(value: false); - yield return new WaitForSeconds(1.2f); - endAction.Call(); - UIManager.GetInstance().offNotTouch(); - _notTouchMypageCollider.enabled = false; - } - - private void HideBoxEffect() - { - if (_isPlayBoxOpenEffect) - { - _inProcessCoroutines.Add(UIManager.GetInstance().StartCoroutine(RunHideBoxEffect())); - } - } - - private IEnumerator RunHideBoxEffect() - { - NguiObjs component = _boxOpenEffectObj.GetComponent(); - UISprite uISprite = component.sprites[0]; - UISprite obj = component.sprites[1]; - TweenAlpha.Begin(uISprite.gameObject, 0.3f, 0f); - TweenAlpha.Begin(obj.gameObject, 0.3f, 0f); - _treasureEffectObj.SetActive(value: false); - yield return new WaitForSeconds(0.3f); - _boxOpenEffectObj.SetActive(value: false); - UnityEngine.Object.Destroy(_boxOpenEffectObj); - _isPlayBoxOpenEffect = false; - } - - private void ShowAllRewardsDialog() - { - UIManager.GetInstance().createInSceneCenterLoading(); - BingoDrawTask.BingoDrawTaskData bingoDrawTaskData = ((_bingoDrawTaskData == null) ? _bingoLoginDrawData : _bingoDrawTaskData); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(34); - dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0024")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.OnClose = delegate - { - BingoInfoUpdate(delegate - { - EnableTouchAndBackKey(); - DisplayFirstTips(_bingoInfoData.CampaignId, _bingoInfoData.IsMissionActivePeriod); - }); - }; - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, _rewardBase.gameObject).GetComponent(); - for (int num = 0; num < bingoDrawTaskData.LineRewardData.Count; num++) - { - component.AddReward(bingoDrawTaskData.LineRewardData[num]); - } - for (int num2 = 0; num2 < bingoDrawTaskData.TreasureBoxReawrdList.Count; num2++) - { - component.AddReward(bingoDrawTaskData.TreasureBoxReawrdList[num2]); - } - component.EndCreate(); - } - - private List GetBingoLineBlocks(int beginSquareId, int endSquareID, int squareNum) - { - List list = new List(); - Vector2 vector = new Vector2(beginSquareId / squareNum, beginSquareId % squareNum); - Vector2 vector2 = new Vector2(endSquareID / squareNum, endSquareID % squareNum); - if (vector.x == vector2.x) - { - for (int i = (int)vector.y; i <= endSquareID; i++) - { - list.Add(i); - } - return list; - } - if (vector.y == vector2.y) - { - for (int j = (int)vector.y; j <= endSquareID; j += squareNum) - { - list.Add(j); - } - return list; - } - if (vector.x == 0f) - { - for (int k = 0; k < squareNum * squareNum; k += squareNum + 1) - { - list.Add(k); - } - } - else - { - for (int l = squareNum - 1; l < squareNum * squareNum; l += squareNum - 1) - { - list.Add(l); - } - } - return list; - } - - public void LateUpdate() - { - AllLabelColorChanger.ChangeAllLabel(base.gameObject); - FixDialogRibbon(); - } - - public static void FixDialogRibbon() - { - DialogBase nowOpenDialog = UIManager.GetInstance().NowOpenDialog; - if (!(nowOpenDialog != null)) - { - return; - } - Transform transform = nowOpenDialog.transform.Find("Anchor/WindowBase/WindowTop"); - if (transform != null) - { - UISprite component = transform.GetComponent(); - if (component != null && component.atlas.name == "Quest") - { - component.bottomAnchor.absolute = -5; - component.topAnchor.absolute = 15; - } - } - Transform transform2 = nowOpenDialog.transform.Find("StoryRewardPanel(Clone)/CardDetailRoot/CardDetail(Clone)/DialogParts/Frame/Top"); - if (transform2 != null) - { - UISprite component2 = transform2.GetComponent(); - if (component2 != null && component2.atlas.name == "Quest") - { - component2.bottomAnchor.absolute = -5; - component2.topAnchor.absolute = 15; - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoRewardsDialog.cs b/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoRewardsDialog.cs deleted file mode 100644 index 910f2816..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Bingo/BingoRewardsDialog.cs +++ /dev/null @@ -1,179 +0,0 @@ -using UnityEngine; - -namespace Wizard.Bingo; - -public class BingoRewardsDialog : MonoBehaviour -{ - public enum MissionViewTab - { - First, - Second, - Third, - Fourth, - AfterFifth - } - - [SerializeField] - private GameObject _bingoMissionItemPrefab; - - [SerializeField] - private UIGrid _grid; - - private ResourceHandler _resourceHandler; - - [SerializeField] - private UIButton _firstRewardsButton; - - [SerializeField] - private UIButton _secondRewardsButton; - - [SerializeField] - private UIButton _thirdRewardsButton; - - [SerializeField] - private UIButton _fourthRewardsButton; - - [SerializeField] - private UIButton _fifthRewardsButton; - - [SerializeField] - private UIScrollView _scrollPanel; - - private BingoInfoTask.BingoInfoData _bingoInfoData; - - private MissionViewTab _currentViewTab; - - public static void Create(GameObject prefab, BingoInfoTask.BingoInfoData bingoData) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - BingoRewardsDialog rewardDialog = Object.Instantiate(prefab).GetComponent(); - rewardDialog._resourceHandler = rewardDialog.gameObject.AddMissingComponent(); - dialogBase.SetObj(rewardDialog.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Bingo_0006")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.OnClose = delegate - { - rewardDialog._resourceHandler.UnloadAll(); - }; - rewardDialog.Initialize(bingoData); - } - - private void Initialize(BingoInfoTask.BingoInfoData bingoInfoData) - { - _bingoInfoData = bingoInfoData; - MissionViewTab viewTab = (MissionViewTab)Mathf.Clamp(_bingoInfoData.SheetNum - 1, 0, 4); - OnPushTabButton(viewTab, firstCall: true); - _firstRewardsButton.onClick.Clear(); - _firstRewardsButton.GetComponentInChildren().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.First)); - _firstRewardsButton.onClick.Add(new EventDelegate(delegate - { - OnPushTabButton(MissionViewTab.First); - })); - _secondRewardsButton.onClick.Clear(); - _secondRewardsButton.GetComponentInChildren().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.Second)); - _secondRewardsButton.onClick.Add(new EventDelegate(delegate - { - OnPushTabButton(MissionViewTab.Second); - })); - _thirdRewardsButton.onClick.Clear(); - _thirdRewardsButton.GetComponentInChildren().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.Third)); - _thirdRewardsButton.onClick.Add(new EventDelegate(delegate - { - OnPushTabButton(MissionViewTab.Third); - })); - _fourthRewardsButton.onClick.Clear(); - _fourthRewardsButton.GetComponentInChildren().text = string.Format(Data.SystemText.Get("Bingo_0012"), GetCurrentTabIndex(MissionViewTab.Fourth)); - _fourthRewardsButton.onClick.Add(new EventDelegate(delegate - { - OnPushTabButton(MissionViewTab.Fourth); - })); - _fifthRewardsButton.onClick.Clear(); - _fifthRewardsButton.GetComponentInChildren().text = string.Format(Data.SystemText.Get("Bingo_0013"), GetCurrentTabIndex(MissionViewTab.AfterFifth)); - _fifthRewardsButton.onClick.Add(new EventDelegate(delegate - { - OnPushTabButton(MissionViewTab.AfterFifth); - })); - } - - private int GetCurrentTabIndex(MissionViewTab missionViewTab) - { - return (int)(missionViewTab + 1); - } - - private void OnPushTabButton(MissionViewTab viewTab, bool firstCall = false) - { - if (_currentViewTab != viewTab || firstCall) - { - _currentViewTab = viewTab; - UpdateMissionView(viewTab); - if (!firstCall) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - } - } - } - - private void UpdateMissionView(MissionViewTab viewTab) - { - ChangeTab(viewTab); - UpdateTabSprite(viewTab); - } - - public void ChangeTab(MissionViewTab viewTab) - { - _bingoInfoData.AllLineRewardsListDic.TryGetValue((int)viewTab, out var value); - _grid.transform.DestroyChildren(); - for (int i = 0; i < value.Count; i++) - { - bool flag = i + 1 == value.Count; - AchievementWindowBase component = NGUITools.AddChild(_grid.gameObject, _bingoMissionItemPrefab).GetComponent(); - component.gameObject.SetActive(value: true); - component.SetBingoRewardDetails(value[i], !flag, _resourceHandler); - } - _grid.Reposition(); - _scrollPanel.ResetPosition(); - } - - private void UpdateTabSprite(MissionViewTab scene) - { - switch (scene) - { - case MissionViewTab.First: - _firstRewardsButton.normalSprite = _firstRewardsButton.pressedSprite; - _secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite; - _thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite; - _fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite; - _fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite; - break; - case MissionViewTab.Second: - _firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite; - _secondRewardsButton.normalSprite = _secondRewardsButton.pressedSprite; - _thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite; - _fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite; - _fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite; - break; - case MissionViewTab.Third: - _firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite; - _secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite; - _thirdRewardsButton.normalSprite = _thirdRewardsButton.pressedSprite; - _fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite; - _fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite; - break; - case MissionViewTab.Fourth: - _firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite; - _secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite; - _thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite; - _fourthRewardsButton.normalSprite = _fourthRewardsButton.pressedSprite; - _fifthRewardsButton.normalSprite = _fifthRewardsButton.disabledSprite; - break; - case MissionViewTab.AfterFifth: - _firstRewardsButton.normalSprite = _firstRewardsButton.disabledSprite; - _secondRewardsButton.normalSprite = _secondRewardsButton.disabledSprite; - _thirdRewardsButton.normalSprite = _thirdRewardsButton.disabledSprite; - _fourthRewardsButton.normalSprite = _fourthRewardsButton.disabledSprite; - _fifthRewardsButton.normalSprite = _fifthRewardsButton.pressedSprite; - break; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CachingCardBundle.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CachingCardBundle.cs index 810ad3c5..0cae9c12 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CachingCardBundle.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CachingCardBundle.cs @@ -8,7 +8,6 @@ namespace Wizard.DeckCardEdit; public class CachingCardBundle : CardBundle { - public const int CACHE_NUM_MAX = 32; private List _cachedList; diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundle.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundle.cs index 16d5bb59..64db2fa8 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundle.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundle.cs @@ -9,9 +9,6 @@ namespace Wizard.DeckCardEdit; public class CardBundle { - private const float ROTATE_INTERVAL = 0.05f; - - protected const float ALPHA_DURATION = 0.3f; protected CardCreator _cardCreator; @@ -49,21 +46,6 @@ public class CardBundle } } - public Dictionary DictCardIdNum - { - get - { - Dictionary dictionary = new Dictionary(_cardList.Count); - foreach (CardObject card in _cardList) - { - dictionary.Add(card.CardId, card.TotalCardNum); - } - return dictionary; - } - } - - public List ObjectList => _cardList.ConvertAll((CardObject card) => card.CardObj); - public int CountSum => _cardList.Sum((CardObject card) => card.TotalCardNum); public virtual int CountKind => _cardList.Count; @@ -111,14 +93,6 @@ public class CardBundle fieldNum = tempFieldNum; } - public void UpdateCardCreator() - { - if (_cardCreator != null) - { - _cardCreator.Tick(); - } - } - public CardBundle(CardCreator cardCreator, Transform parent, UITexture sleeveOriginal, float scale, IFormatBehavior formatBehavior, bool isDisplaySpotCardNum = false, bool isHideZeroSpotCardNum = false, bool canUseNonPossessionCard = false) { FormatBehavior = formatBehavior; @@ -305,7 +279,7 @@ public class CardBundle } if (num4 > 0f) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARDLIST_REVERSE); + } if (isRotate) { @@ -526,14 +500,6 @@ public class CardBundle return cardObject; } - public void EnableAlpha(bool isEnable) - { - _cardList.ForEach(delegate(CardObject card) - { - card.EnableAlpha(isEnable); - }); - } - public virtual void DestroyAll() { _cardList.ForEach(delegate(CardObject card) @@ -577,11 +543,6 @@ public class CardBundle }); } - public bool IsEndRotateAnimation() - { - return _cardList.All((CardObject cardObj) => !cardObj.IsWaitingRotateAnimation); - } - public void CountUseCardNum(List cardIdList, int cardId, out int usePossessionCardNum, out int useSpotCardNum, out int useNonPossessionCardNum) { int possessionCardNum = FormatBehavior.GetPossessionCardNum(cardId, isIncludingSpotCard: false); diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleController.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleController.cs index bf903f2c..73450468 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleController.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleController.cs @@ -172,28 +172,6 @@ public class CardBundleController : CardBundleControllerBase return result; } - public void SetSelectionArea(List cardIdList, Action onFirstAnimationFinish = null, float cardRotateDelayTimeMax = float.MaxValue) - { - LoadDeckCard(cardIdList, onFirstAnimationFinish, cardRotateDelayTimeMax); - } - - public void ClearSelectionArea() - { - if (base.SelectionAreaList.CountSum == 0) - { - return; - } - foreach (CardObject card in base.SelectionAreaList.CardList) - { - for (int i = 0; i < card.TotalCardNum; i++) - { - base.PagingList.Insert(card, dontCreate: true); - } - } - base.SelectionAreaList.DestroyAll(); - UpdatePagingCardInfoAll(); - } - public void ChangeCraftMode(bool isCraft) { base.IsCraftMode = isCraft; @@ -332,7 +310,7 @@ public class CardBundleController : CardBundleControllerBase int usedNum = CountCardNumInSelectionArea(card.CardId, isStrictSameCard: true); int usedNumWithFoil = CountCardNumInSelectionArea(card.CardId, isStrictSameCard: false); int haveNumWithFoil = GetHaveNumTotalSameKindWithLimit(card.CardId); - bool isMaintenance = GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(card.CardId); + bool isMaintenance = false; // Pre-Phase-5b: no maintenance list headless if (base.FormatBehavior.IsConventionMode) { haveNum = 3; @@ -383,7 +361,7 @@ public class CardBundleController : CardBundleControllerBase { cardObject.SetCardToBanCard(_cardInfoOriginal); } - else if (GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(cardObject.CardId)) + else if (false /* Pre-Phase-5b: no maintenance list headless */) { cardObject.SetCardToMaintenance(_cardInfoOriginal); cardObject.AttachColorShader(); diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleControllerBase.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleControllerBase.cs index ce04950c..11c25596 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleControllerBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardBundleControllerBase.cs @@ -129,7 +129,7 @@ public class CardBundleControllerBase { for (int i = 0; i < _listNewCardDisplayedIds.Count(); i++) { - GameMgr.GetIns().GetDataMgr().SetIsNewCard(_listNewCardDisplayedIds[i], isNew: false); + /* Pre-Phase-5b: SetIsNewCard write dropped */ } } @@ -205,7 +205,7 @@ public class CardBundleControllerBase UIEventListener.Get(card.CardObj).onClick = this.OnClickSelectionAreaCard.Invoke; card.CardObj.AddComponent(); card.ResetMaterial(); - if (GameMgr.GetIns().GetDataMgr().IsNewCard(card.CardId) && !_listNewCardDisplayedIds.Contains(card.CardId)) + if (false /* Pre-Phase-5b: no user card state headless */) { _listNewCardDisplayedIds.Add(card.CardId); } @@ -223,7 +223,7 @@ public class CardBundleControllerBase UIEventListener.Get(card.CardObj).onScroll = this.OnScrollPagingCard.Invoke; card.ResetMaterial(); UpdateCardInfo(card); - if (GameMgr.GetIns().GetDataMgr().IsNewCard(card.CardId) && !_listNewCardDisplayedIds.Contains(card.CardId)) + if (false /* Pre-Phase-5b: no user card state headless */) { _listNewCardDisplayedIds.Add(card.CardId); } @@ -282,12 +282,6 @@ public class CardBundleControllerBase return _filteredAllCardIdListCache; } - public void EnableAlpha(bool isEnable) - { - SelectionAreaList.EnableAlpha(isEnable); - PagingList.EnableAlpha(isEnable); - } - public int GetHaveNum(int cardId) { return FormatBehavior.GetPossessionCardNum(cardId, isIncludingSpotCard: true); diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardCreator.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardCreator.cs index 47ad9a2c..f88fab06 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardCreator.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardCreator.cs @@ -19,8 +19,6 @@ public class CardCreator } } - private const int QUEUE_CAPACITY = 8; - private bool _isBusy; private List _taskQueue; diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardObject.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardObject.cs index b458058f..b190abfb 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardObject.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardObject.cs @@ -18,8 +18,6 @@ public class CardObject public GameObject BlackOut; - private const float ALPHA_TIME = 0.3f; - public UseInfo(GameObject parent, CardMaster.CardMasterId cardMasterId) { Parent = parent; @@ -67,41 +65,6 @@ public class CardObject } } - public void SetInfoDestruct(int haveNum, int destructNum, bool isMaintenance, bool isOnlySpotCard, CardMaster.CardMasterId cardMasterId) - { - if ((bool)CardInfoObj) - { - SystemText systemText = Data.SystemText; - if (isMaintenance) - { - SetMaintenance(); - } - else if (destructNum <= 0) - { - TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 0f); - } - else if (destructNum < haveNum) - { - TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 1f); - CardInfoText.text = systemText.Get("Card_0169", destructNum.ToString()); - } - else if (!isOnlySpotCard) - { - TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 1f); - CardInfoText.text = systemText.Get("Card_0170", destructNum.ToString()); - } - if (haveNum <= 0 && !isOnlySpotCard) - { - CardTemplateObj.AttachGrayShader(); - } - else - { - CardTemplateObj.AttachShaders(cardMasterId); - } - BlackOut.gameObject.SetActive((haveNum > 0 && (destructNum >= haveNum || isMaintenance)) || isOnlySpotCard); - } - } - public void SetMaintenance() { TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 1f); @@ -136,24 +99,6 @@ public class CardObject } } - private const float FADE_DURATION = 0.18f; - - private const float ROTATE_DURATION = 0.125f; - - private const float SCALE_DURATION = 0.1f; - - private const float SELECT_SCALE = 1.2f; - - private const float EFFECT_SCALE = 500f; - - private const float EFFECT_Z = -1f; - - public const string EFFECT_CHAR_PATH = "cmn_frame_card_1"; - - public const string EFFECT_SPELL_PATH = "cmn_frame_card_3"; - - public const string EFFECT_FIELD_PATH = "cmn_frame_card_2"; - private static readonly Vector3 SLEEVE_POSITION = new Vector3(0f, -0.5f, 0f); private static readonly Vector3 SLEEVE_SCALE = new Vector3(1.025f, 1.025f, 1f); @@ -288,7 +233,7 @@ public class CardObject private bool IsIncludingSpotCard() { - if (IsDisplaySpotCardNum && GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(BaseCard.ids)) + if (false /* Pre-Phase-5b: no spot card headless */) { if (IsHideZeroSpotCardNum) { @@ -463,7 +408,7 @@ public class CardObject public void UpdateCardInfo(GameObject original, int haveNum, int haveNumWithFoil, int usedNum, int usedNumWithFoil, int sameKindNumMax, bool isMaintenance) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr MainCardNum = Mathf.Max(_formatBehavior.GetPossessionCardNum(BaseCard.ids, isIncludingSpotCard: false) - usedNum, 0); SubCardNum = Mathf.Max(Mathf.Min(haveNum - usedNum, dataMgr.SpotCardData.GetSpotCardNum(BaseCard.ids)), 0); PrepareCardInfo(original); @@ -471,15 +416,6 @@ public class CardObject VisibleCardNumLabel(haveNum > 0); } - public void UpdateCardInfoDestruct(GameObject original, int haveNum, int destructNum, bool isMaintenance, bool isOnlySpotCard) - { - MainCardNum = haveNum - destructNum; - SubCardNum = GameMgr.GetIns().GetDataMgr().SpotCardData.GetSpotCardNum(BaseCard.ids); - PrepareCardInfo(original); - _info.SetInfoDestruct(haveNum, destructNum, isMaintenance, isOnlySpotCard, _formatBehavior.CardMasterId); - VisibleCardNumLabel(haveNum > 0 || isOnlySpotCard); - } - public void SetCardToMaintenance(GameObject original) { PrepareCardInfo(original); @@ -506,26 +442,6 @@ public class CardObject } } - public void EnableAlpha(bool isEnable) - { - if (BaseCard != null && !(BaseCard.CardObj == null)) - { - if (isEnable) - { - UITexture cardTexture = BaseCard.CardObj.GetComponent()._cardTexture; - Texture mainTexture = cardTexture.material.mainTexture; - cardTexture.mainTexture = mainTexture; - cardTexture.material = null; - cardTexture.depth = -1; - cardTexture.Invalidate(includeChildren: false); - } - else - { - ResetMaterial(); - } - } - } - public void ResetMaterial() { if (BaseCard != null && !(BaseCard.CardObj == null)) @@ -716,15 +632,6 @@ public class CardObject } } - public void AttachNormalShaderRotationOnlyIcon() - { - CardListTemplate component = CardObj.GetComponent(); - if (!(component == null)) - { - component.AttachNormalShaderRotationOnlyIcon(); - } - } - public void AttachRedShader() { CardListTemplate component = CardObj.GetComponent(); diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUIBase.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUIBase.cs index 8c8bd4e4..ed3fb5e9 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUIBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUIBase.cs @@ -15,18 +15,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase Prev } - public const int CARD_PER_PAGE_IN_SELECTION_AREA = 10; - - public const int CARD_PER_PAGE = 8; - - public const float CARD_WIDTH = 120f; - - private const float DRAG_DEGREE = 70f; - - public const float SELECTION_AREA_CARD_SCALE = 0.5f; - - public const float PAGE_CARD_SCALE = 0.6f; - [SerializeField] protected MecanimStateBase _stateDefaultView; @@ -76,9 +64,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase [SerializeField] protected GameObject m_cardInfoOriginal; - [SerializeField] - private GameObject _hideFilter; - [SerializeField] private FilterController _prefabFilter; @@ -165,8 +150,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase } } - public bool IsSliding => _slideType != SlideType.None; - protected bool IsShowCardDetailCraftPanel { get; set; } = true; public IFormatBehavior FormatBehavior { get; private set; } @@ -265,7 +248,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase if (!_isDisableTouchWhileLoading) { SearchApplyOwn(m_searchInput.value); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + } }; m_searchInput.onSubmit.Add(new EventDelegate(delegate @@ -299,8 +282,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase _selectCardFilter.Hide(); _pagingFilter.Hide(); RegistFilterEvent(); - GameMgr.GetIns().GetGameObjMgr().GetUIContainer() - .SetActive(value: false); + /* Pre-Phase-5b: GameObjMgr.GetUIContainer().SetActive(false) dropped; headless has no UIContainer. */ _stateEdit.ResetScroll(); m_searchInput.value = ""; m_searchCancelButton.gameObject.SetActive(value: false); @@ -336,7 +318,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_2", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)), Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) }; - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectObjList, callback); + /* Pre-Phase-5b: SetUIParticleShader dropped */ if (callback != null) callback(); } protected void SetupState() @@ -467,20 +449,9 @@ public abstract class CardSelectListUIBase : MecanimSceneBase } } - public void OnBtnPushSeachCancelOwn() - { - if (!IsLoading) - { - SearchApplyOwn(""); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - } - } - private void PagingBase(Action anim, int page, Action next) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_OUT); - GameMgr.GetIns().GetSoundMgr().StopSe(Se.TYPE.SYS_CARDLIST_REVERSE); + anim.Call(delegate { if (LoadPagingCard(page)) @@ -663,7 +634,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase private void SelectCard(GameObject obj, bool isSelectionArea) { - Se.TYPE setype = Se.TYPE.NONE; + int setype = 0; CardObject cardObject = SelectionAreaList.FindWithObject(_detailTargetObj); if (cardObject == null) { @@ -672,16 +643,16 @@ public abstract class CardSelectListUIBase : MecanimSceneBase if (cardObject != null && cardObject.IsVisibleCursorEffect) { cardObject.ChangeSelectingState(isSelect: false); - setype = Se.TYPE.SYS_CARD_INFO_CANCEL; + setype = 0; } CardObject cardObject2 = (isSelectionArea ? SelectionAreaList.FindWithObject(obj) : PagingList.FindWithObject(obj)); if (cardObject2 != null) { cardObject2.ChangeSelectingState(isSelect: true); - setype = Se.TYPE.SYS_CARD_INFO_SMALL; + setype = 0; } _detailTargetObj = obj; - GameMgr.GetIns().GetSoundMgr().PlaySe(setype); + } protected virtual void AccordCardInfo() @@ -710,23 +681,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase } } - protected void ShowFilterMenu(FilterController filter, string title) - { - HideDetail(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.XL); - dialogBase.SetTitleLabel(title); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetObj(filter.gameObject); - dialogBase.CloseOnOff(flag: false); - filter.Show(); - dialogBase.OnClose = delegate - { - filter.Hide(); - filter.transform.parent = _hideFilter.transform; - }; - } - protected virtual void OnValidateSelectionAreaFilter() { _stateCardDrag.OnChangeSelectionAreaFilter(); @@ -772,7 +726,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase { _cardBundle.OnCreateCard(_simpleDetail.CardID); AccordCardInfo(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr if (dataMgr.GetPossessionCardNum(_simpleDetail.CardID, _isSelectableSpotCard) == 1) { if (!_cardBundle.IsCraftMode) diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_CardDrag.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_CardDrag.cs index c1e24e94..1b15e812 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_CardDrag.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_CardDrag.cs @@ -95,19 +95,6 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase m_parentCloneCard.gameObject.layer = LayerMask.NameToLayer("Detail"); } - private void Start() - { - if (m_scene == null) - { - MonoBehaviour.print("シーンがセットされていません"); - } - _colliderSelectionArea.gameObject.SetActive(value: false); - _colliderPagingArea.gameObject.SetActive(value: false); - m_darkMask_Insert.gameObject.SetActive(value: false); - m_darkMask_Grab.gameObject.SetActive(value: false); - _sameCardAddCollider.gameObject.SetActive(value: false); - } - public override bool onCloseRequest(MecanimStateBase next, bool isSkip) { if (!(next == _stateEdit)) @@ -134,7 +121,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase m_removeInfo.SetActive(value: true); break; } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DRAG_CARD); + } public override void onFinishCloseAnim() @@ -276,14 +263,14 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase } base.CloseStateName = m_closeStateName_Insert; _isFlashWhenInsert = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_IN); + } else { m_parentClone_Insert.gameObject.SetActive(value: false); base.CloseStateName = m_closeStateName_Insert; _isFlashWhenInsert = false; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_IN); + } } @@ -305,7 +292,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase m_parentClone_Grab.alpha = 0f; base.CloseStateName = ""; m_darkMask_Grab.gameObject.SetActive(value: false); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_OUT); + break; } break; @@ -322,7 +309,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase m_parentClone_Grab.alpha = 0f; base.CloseStateName = ""; m_darkMask_Grab.gameObject.SetActive(value: false); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_OUT); + break; case Area.OutSelectionArea: { @@ -343,7 +330,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase _stateEdit.RefreshSelectionArea(isImmediate: false); _stateEdit.RefreshPage(isImmediate: true); base.CloseStateName = m_closeStateName_Remove; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_OUT); + break; } } @@ -375,7 +362,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase } if (_lastDragArea != Area.NoSelectionArea) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_IN); + } } } @@ -407,7 +394,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase { return null; } - bool flag = !IsDraggableMaintenance && GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(grabCard.CardId); + bool flag = false; // Pre-Phase-5b: no maintenance list headless if (grabCard.IsVisibleSleeve || flag) { return null; @@ -579,51 +566,4 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase { DestroyDragCard(); } - - public void DragEmulate(CardObject original, CardObject target) - { - CloneToGrab(original); - StartCoroutine(MoveToTarget(m_parentClone_Grab.transform, target.CardObj.transform)); - } - - public void DropDown(CardObject original) - { - CloneToGrab(original); - Vector3 point = m_parentClone_Grab.transform.position + Vector3.down * 0.5f; - StartCoroutine(MoveToPoint(m_parentClone_Grab.transform, point)); - TweenAlpha.Begin(m_parentClone_Grab.gameObject, 0.15f, 0f); - } - - private void CloneToGrab(CardObject original) - { - Vector3 position = original.CardObj.transform.position; - DestroyDragCard(); - CreateDragCard(original); - m_parentClone_Grab.transform.position = position; - m_parentClone_Grab.transform.localScale = Vector3.one; - m_parentClone_Grab.alpha = 1f; - m_darkMask_Grab.gameObject.SetActive(value: false); - m_darkMask_Insert.gameObject.SetActive(value: false); - m_parentClone_Insert.gameObject.SetActive(value: false); - } - - private IEnumerator MoveToTarget(Transform obj, Transform target) - { - for (float num = Vector3.Distance(target.position, obj.position); num >= 0.05f; num = Vector3.Distance(target.position, obj.position)) - { - obj.position += (target.position - obj.position) * 0.4f; - yield return null; - } - DestroyDragCard(); - } - - private IEnumerator MoveToPoint(Transform obj, Vector3 point) - { - for (float num = Vector3.Distance(point, obj.position); num >= 0.05f; num = Vector3.Distance(point, obj.position)) - { - obj.position += (point - obj.position) * 0.4f; - yield return null; - } - DestroyDragCard(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_Edit.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_Edit.cs index 8f4a2270..840f54b6 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_Edit.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/CardSelectListUI_State_Edit.cs @@ -8,13 +8,6 @@ namespace Wizard.DeckCardEdit; [RequireComponent(typeof(CardSelectListUI_Positioning))] public class CardSelectListUI_State_Edit : MecanimStateBase { - private const float PRESS_TIME_TO_DRAGMODE = 0.5f; - - private const float PRESS_POINT_DIST_TO_DRAGMODE = 35f; - - private const float PAGING_OFFSET = 1400f; - - private const float PAGING_SPEED = 0.4f; [SerializeField] private CardSelectListUIBase m_scene; @@ -53,23 +46,6 @@ public class CardSelectListUI_State_Edit : MecanimStateBase public bool IsClick { get; private set; } - private void Start() - { - if (m_scene == null) - { - MonoBehaviour.print("シーンがセットされていません"); - } - UIScrollView scrollView = m_scrollView; - scrollView.onDragStarted = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView.onDragStarted, (UIScrollView.OnDragNotification)delegate - { - m_scrollViewCenterOnChild.gameObject.SetActive(value: false); - }); - UIScrollView scrollView2 = m_scrollView; - scrollView2.onMomentumMove = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView2.onMomentumMove, new UIScrollView.OnDragNotification(Fit)); - UIScrollView scrollView3 = m_scrollView; - scrollView3.onStoppedMoving = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView3.onStoppedMoving, new UIScrollView.OnDragNotification(Fit)); - } - public override void onOpen() { base.onOpen(); @@ -235,11 +211,6 @@ public class CardSelectListUI_State_Edit : MecanimStateBase _selectionAreaCardPositioning.Clear(); } - public void RemovePaging() - { - _pagingAreaCardPositioning.Clear(); - } - private void StartDragState(bool immediate) { CardObject cardObject = m_stateDragMode.TryGetCard(_pressObj); @@ -337,14 +308,4 @@ public class CardSelectListUI_State_Edit : MecanimStateBase initPress(obj, mode); } } - - public void DragEmulate(CardObject original, CardObject target) - { - m_stateDragMode.DragEmulate(original, target); - } - - public void DropDown(CardObject original) - { - m_stateDragMode.DropDown(original); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckCardEditUI.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckCardEditUI.cs index fb11acb7..bb955862 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckCardEditUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckCardEditUI.cs @@ -174,8 +174,6 @@ public class DeckCardEditUI : CardSelectListUIBase } } - private const int DEPTH_RESULT_DIALOG = 100; - public static string CurrentDeckName = null; private static Format EditDeckFormat = Format.Max; @@ -204,20 +202,6 @@ public class DeckCardEditUI : CardSelectListUIBase private DeckGroupListData _deckGroupListData; - private const string CRAFT_BTN_LEFT_ON = "pilltab_02_left_on"; - - private const string CRAFT_BTN_LEFT_OFF = "pilltab_02_left_off"; - - private const string CRAFT_BTN_RIGHT_ON = "pilltab_02_right_on"; - - private const string CRAFT_BTN_RIGHT_OFF = "pilltab_02_right_off"; - - private const string MY_ROTATION_ALL_PACK_SPRITE = "btn_check_"; - - private const string BUTTON_SPRITE_FOOTER_OFF = "off"; - - private const string BUTTON_SPRITE_FOOTER_ON = "on"; - private readonly Vector3 MY_ROTATION_FORMAT_ICON_POSITION = new Vector3(45f, -47f, 0f); private readonly Vector3 MY_ROTATION_CARD_NUMBER_ICON_POSITION = new Vector3(68f, -62f, -1f); @@ -226,12 +210,6 @@ public class DeckCardEditUI : CardSelectListUIBase private readonly Vector3 MY_ROTATION_CARD_NUMBER_MAX_POSITION = new Vector3(58f, 0f, 0f); - private const int MY_ROTATION_CLASS_NAME_WIDTH = 107; - - private const int MY_ROTATION_CLASS_UNDER_LINE_WIDTH = 184; - - private const float BACK_BUTTON_POS_Y = -40.7f; - [SerializeField] private DeckBuildShortageCardView _prefabShortageCardView; @@ -429,12 +407,8 @@ public class DeckCardEditUI : CardSelectListUIBase } } - public bool IsCraftMode => _deckCardBundle.IsCraftMode; - public bool IsBattleRetry { get; set; } - public bool IsEditState => m_state == _stateEdit; - public event Action OnChangeDeckCardNum; private DeckData GetDeck(Format format, int deckId) @@ -464,81 +438,6 @@ public class DeckCardEditUI : CardSelectListUIBase UIManager.GetInstance().OverrideSceneParam(UIManager.ViewScene.DeckList, new DeckListUIParam(deck.Format, conventionDeckList?.Conventioninfo)); } - public static void SetDeckCopyParameter(DeckData deck, bool isCreatedByBuilder, bool isCopySubClass, ConventionDeckList conventionDeckList, MyRotationInfo myRotationInfo = null) - { - CopySrcDeckData = deck; - ClassSet = new ClassSet(deck.GetDeckClassID(), deck.GetDeckSubClassID()); - IsCopySkinAndSleeve = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SLEEVE_AND_SKIN); - IsCopySubClass = isCopySubClass; - IsCreatedByBuilder = isCreatedByBuilder; - _conventionDeckList = conventionDeckList; - CanUseNonPossessionCard = conventionDeckList == null; - if (deck.DeckAttributeType == DeckAttributeType.TrialDeck || deck.DeckAttributeType == DeckAttributeType.SampleDeck) - { - IsCreatedByBuilder = true; - } - if (myRotationInfo == null) - { - MyRotationInfo = Data.MyRotationAllInfo.Get(deck.MyRotationId); - } - else - { - MyRotationInfo = myRotationInfo; - } - } - - public static void SetCreateAutoParameter(Format format, bool canUseNonPossessionCard) - { - IsCreateAuto = true; - CanUseNonPossessionCard = canUseNonPossessionCard; - } - - public static void SetDeckCopyParameterForDeckIntroduction(DeckData emptyDeck, DeckData srcDeck, MyRotationInfo myRotationInfo = null) - { - CurrentDeckName = null; - CurrentDeckId = emptyDeck.GetDeckID(); - CurrentDeckData = emptyDeck; - EditDeckFormat = emptyDeck.Format; - ClassSet = new ClassSet(srcDeck.GetDeckClassID(), srcDeck.GetDeckSubClassID()); - CopySrcDeckData = srcDeck; - IsCopySkinAndSleeve = false; - IsCopySubClass = FormatBehaviorManager.GetDefaultBehaviour(srcDeck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS); - IsCreatedByBuilder = true; - IsCreateAuto = false; - _conventionDeckList = null; - CanUseNonPossessionCard = true; - if (EditDeckFormat == Format.MyRotation) - { - if (myRotationInfo == null) - { - MyRotationInfo = Data.MyRotationAllInfo.Get(srcDeck.MyRotationId); - } - else - { - MyRotationInfo = myRotationInfo; - } - } - UIManager.GetInstance().OverrideSceneParam(UIManager.ViewScene.DeckList, new DeckListUIParam(emptyDeck.Format, null)); - } - - public static void SetBuildDeckEditParameter(DeckData buildDeck, string deckName, DeckData emptyDeck) - { - CurrentDeckName = deckName; - CurrentDeckId = emptyDeck.GetDeckID(); - CurrentDeckData = emptyDeck; - ClassSet = new ClassSet(buildDeck.GetDeckClassID(), buildDeck.GetDeckSubClassID()); - EditDeckFormat = emptyDeck.Format; - CopySrcDeckData = buildDeck; - IsCopySkinAndSleeve = false; - IsCopySubClass = FormatBehaviorManager.GetDefaultBehaviour(buildDeck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS); - IsCreatedByBuilder = true; - IsCreateAuto = false; - _conventionDeckList = null; - CanUseNonPossessionCard = true; - MyRotationInfo = null; - UIManager.GetInstance().OverrideSceneParam(UIManager.ViewScene.DeckList, new DeckListUIParam(emptyDeck.Format, null)); - } - public override bool IsEnableSwipeAutoSameBasicCardAdd() { return true; @@ -789,7 +688,7 @@ public class DeckCardEditUI : CardSelectListUIBase private void SetupDeckViewerAndText() { m_labelDeckName.text = _deckCardBundle.DeckName; - m_labelClassName.text = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)ClassSet.MainClass); + m_labelClassName.text = ((int)ClassSet.MainClass).ToString(); // Pre-Phase-5b: no clan-name lookup _deckViewer.RemoveData(); _deckViewer.SetDeckName(_deckCardBundle.DeckName); _deckViewer.SetClassSet(ClassSet); @@ -913,18 +812,6 @@ public class DeckCardEditUI : CardSelectListUIBase InitUseSubClassDisplay(); } - public void OnBtnPushSelectCardFilter() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - ShowFilterMenu(_selectCardFilter, Data.SystemText.Get("Card_0126")); - } - - public void OnBtnPushOwnFilter() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - ShowFilterMenu(_pagingFilter, Data.SystemText.Get("Card_0021")); - } - protected override void OnFinishFadeIn() { _fadeInFinish = true; @@ -953,13 +840,6 @@ public class DeckCardEditUI : CardSelectListUIBase return false; } - public bool LoadDeckCard(List idList) - { - base.IsLoading = true; - HideDetail(); - return _deckCardBundle.LoadDeckCard(idList); - } - public void ChangeCraftMode(bool isCraft) { if (!base.IsLoading && base.CurrentState == _stateEdit) @@ -967,7 +847,7 @@ public class DeckCardEditUI : CardSelectListUIBase base.IsLoading = true; m_craftOnBtn.normalSprite = (isCraft ? "pilltab_02_right_on" : "pilltab_02_right_off"); m_craftOffBtn.normalSprite = (isCraft ? "pilltab_02_left_off" : "pilltab_02_left_on"); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + _deckCardBundle.ChangeCraftMode(isCraft); } } @@ -1035,7 +915,7 @@ public class DeckCardEditUI : CardSelectListUIBase bool flag = false; if (ConventionInfo == null) { - deckUpdateTask = GameMgr.GetIns().GetDeckUpdateTask(); + deckUpdateTask = null; // Pre-Phase-5b: no DeckUpdateTask headless flag = deckUpdateTask.AchievedInfo._rewards.Count > 0; } if (flag) @@ -1090,7 +970,7 @@ public class DeckCardEditUI : CardSelectListUIBase private void ChangeSceneToBattle() { - DataMgr dataManager = GameMgr.GetIns().GetDataMgr(); + DataMgr dataManager = null; // Pre-Phase-5b: headless has no DataMgr DeckInfoTask task = new DeckInfoTask(); task.SetParameter(Format.All); UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate @@ -1111,7 +991,7 @@ public class DeckCardEditUI : CardSelectListUIBase private string GetSaveAndRetryDialogText() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: DataMgr not reachable in DeckCardEdit UI headless switch (dataMgr.m_BattleType) { case DataMgr.BattleType.FreeBattle: @@ -1141,7 +1021,7 @@ public class DeckCardEditUI : CardSelectListUIBase private string GetRetryDialogText() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: DataMgr not reachable in DeckCardEdit UI headless switch (dataMgr.m_BattleType) { case DataMgr.BattleType.FreeBattle: @@ -1300,34 +1180,9 @@ public class DeckCardEditUI : CardSelectListUIBase UpdateCraftShortageButton(); } - private void OnChangeManyDeckCards() - { - _hasChanged = true; - m_costCurve.Refresh(_deckCardBundle.SelectionAreaList.IdList.ToArray()); - DeckCardNumAnim(); - UpdateCraftShortageButton(); - } - - public void SetAllDeckCards(List cardIdList, Action onFirstAnimationFinish = null, float cardRotateDelayTimeMax = float.MaxValue) - { - _deckCardBundle.SetSelectionArea(cardIdList, onFirstAnimationFinish, cardRotateDelayTimeMax); - OnChangeManyDeckCards(); - } - - public void RemoveAllDeckCards() - { - _deckCardBundle.ClearSelectionArea(); - OnChangeManyDeckCards(); - } - - public CardBundle GetDeckCardBundle() - { - return _deckCardBundle.SelectionAreaList; - } - private void OnClickAutoDeckBtn(GameObject obj) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.AUTO_DECK_CREATE)) { DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Card_0266")); @@ -1379,7 +1234,7 @@ public class DeckCardEditUI : CardSelectListUIBase private void OnClickSaveBtn(GameObject obj) { SaveDeck(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + } private DeckData CreateDeckData() @@ -1408,15 +1263,11 @@ public class DeckCardEditUI : CardSelectListUIBase HideDetail(); _deckViewer.gameObject.SetActive(value: true); _deckViewer.SetDeck(CreateDeckData(), _conventionDeckList); - if (QRCodeUtility.IsShowQRCode(_deckViewer, _formatBehavior, base.Format)) - { - _deckViewer.SetQRSmallTexture(); - } - else if (_formatBehavior.CanShowQRCode) + if (_formatBehavior.CanShowQRCode) { _deckViewer.SetQRCodeButtonToGray(); } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + } private void HideDeckViewer() @@ -1427,7 +1278,7 @@ public class DeckCardEditUI : CardSelectListUIBase private void OnClickCraftShortageCardButton(GameObject obj) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + if (!CanUseNonPossessionCard || base.IsLoading) { return; @@ -1475,7 +1326,7 @@ public class DeckCardEditUI : CardSelectListUIBase dialogBase.SetSize(DialogBase.Size.XL); dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_DeckEdit_014_Title")); dialogBase.SetPanelDepth(100); - dialogBase.OpenSe = Se.TYPE.NONE; + dialogBase.OpenSe = 0; DeckBuildShortageCardView _shortageCardView = UnityEngine.Object.Instantiate(_prefabShortageCardView); dialogBase.SetObj(_shortageCardView.gameObject); dialogBase.OnCloseStart = CloseShortageCardViewer; @@ -1519,7 +1370,7 @@ public class DeckCardEditUI : CardSelectListUIBase dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); List addIdList = _shortageIdList.FindAll(delegate(int id) { - if (GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(id)) + if (false /* Pre-Phase-5b: IsMaintenanceCard headless-false */) { return false; } @@ -1623,7 +1474,7 @@ public class DeckCardEditUI : CardSelectListUIBase if (_deckViewer.isActiveAndEnabled) { HideDeckViewer(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); + return false; } if (_hasChanged && DeckCardNum > 0) @@ -1709,7 +1560,7 @@ public class DeckCardEditUI : CardSelectListUIBase List list = new List(); List source = deckCardList.ConvertAll((int id) => CardMaster.GetInstance(formatBehavior.CardMasterId).GetCardParameterFromId(id).BaseCardId); List needBaseIdList = source.Distinct().ToList(); - Dictionary possessionBaseCardDictionary = GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardDictionary(isIncludingSpotCard: true, formatBehavior.CardMasterId); + Dictionary possessionBaseCardDictionary = new(); // Pre-Phase-5b: possession lookup not reachable headless int i; for (i = 0; i < needBaseIdList.Count; i++) { @@ -1799,7 +1650,7 @@ public class DeckCardEditUI : CardSelectListUIBase private void OnClickSwapClassButton(GameObject obj) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0274")); dialogBase.SetText(Data.SystemText.Get("Card_0275")); @@ -1813,7 +1664,7 @@ public class DeckCardEditUI : CardSelectListUIBase private void OnClickMyRotationChangeButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + MyRotationPeriodSelectDialog.Create(_myRotationInfo, ClassSet.MainClass, delegate(MyRotationInfo selectData) { if (_myRotationInfo.Id != selectData.Id) diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckSave.cs b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckSave.cs index 471144c3..c62f3186 100644 --- a/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckSave.cs +++ b/SVSim.BattleEngine/Engine/Wizard.DeckCardEdit/DeckSave.cs @@ -236,7 +236,7 @@ public class DeckSave } else { - DeckUpdateTask deckUpdateTask = GameMgr.GetIns().GetDeckUpdateTask(); + DeckUpdateTask deckUpdateTask = null; // Pre-Phase-5b: no wire task headless if (_formatBehavior.UseSubClass) { deckUpdateTask.SetParameterWithSubClass(_id, _class, _subClass, _rawSkinId, _isRandomLeaderSkin, _leaderSkinIdList.ToArray(), _sleeveId, _name, isDelete: false, _deck, _format); diff --git a/SVSim.BattleEngine/Engine/Wizard.DeckSelect.FirstDisplayPageIndexGetter/QuestFirstDisplayPageIndexGetter.cs b/SVSim.BattleEngine/Engine/Wizard.DeckSelect.FirstDisplayPageIndexGetter/QuestFirstDisplayPageIndexGetter.cs deleted file mode 100644 index 50270ba9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.DeckSelect.FirstDisplayPageIndexGetter/QuestFirstDisplayPageIndexGetter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard.DeckSelect.FirstDisplayPageIndexGetter; - -public class QuestFirstDisplayPageIndexGetter : FirstDisplayPageIndexGetterBase -{ - protected override int DerivedGet(List pageList, Format viewFormat, bool canUseNonPossessionCard) - { - int questStageId = GameMgr.GetIns().GetDataMgr().QuestBattleData.QuestStageId; - QuestLastUsedDeckSaveDataManager.ExtractedDeckData deck = new QuestLastUsedDeckSaveDataManager().GetDeck(questStageId); - if (deck == null || !TryGetPageIndex(pageList, deck, out var pageIndex)) - { - return new DefaultFirstDisplayPageIndexGetter().Get(pageList, viewFormat, null, canUseNonPossessionCard); - } - return pageIndex; - } - - private static bool TryGetPageIndex(List pageList, QuestLastUsedDeckSaveDataManager.ExtractedDeckData deckData, out int pageIndex) - { - for (int i = 0; i < pageList.Count; i++) - { - DeckSelectUI.PageData pageData = pageList[i]; - if (pageData.Format == deckData.Format && pageData.DeckViewList.Any((DeckUI.DeckViewData x) => x.Deck.GetDeckID() == deckData.ID)) - { - pageIndex = i; - return true; - } - } - pageIndex = 0; - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.DataLink/IdPasswordInput.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.DataLink/IdPasswordInput.cs deleted file mode 100644 index 95be8607..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.DataLink/IdPasswordInput.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; - -namespace Wizard.Dialog.DataLink; - -public class IdPasswordInput : MonoBehaviour -{ - [SerializeField] - public UIInputWizard _idInput; - - [SerializeField] - public UIInputWizard _passwordInput; - - public void ResetInputValue() - { - _idInput.value = string.Empty; - _passwordInput.value = string.Empty; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.DataLink/PasswordSetting.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.DataLink/PasswordSetting.cs deleted file mode 100644 index 1a7b4c64..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.DataLink/PasswordSetting.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; -using Wizard.Dialog.Setting; - -namespace Wizard.Dialog.DataLink; - -public class PasswordSetting : MonoBehaviour -{ - [SerializeField] - public UIInputWizard _firstInput; - - [SerializeField] - public UIInputWizard _secondInput; - - [SerializeField] - public UIButton _privacyPolicyButton; - - [SerializeField] - public ItemToggle _acceptToggle; - - public void ResetInputValue() - { - _firstInput.value = string.Empty; - _secondInput.value = string.Empty; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemButton.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemButton.cs deleted file mode 100644 index 8ab3b4f0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemButton.cs +++ /dev/null @@ -1,121 +0,0 @@ -using UnityEngine; - -namespace Wizard.Dialog.Setting; - -public class ItemButton : Item -{ - [SerializeField] - private UISprite _sprite; - - [SerializeField] - private UIButton _button; - - [SerializeField] - private UILabel _label; - - [SerializeField] - private UISprite _spriteOnButton; - - [SerializeField] - private BoxCollider _collider; - - [SerializeField] - private GameObject _separatorLineObj; - - [SerializeField] - private UILabel _subLabel; - - private void Awake() - { - _label.text = string.Empty; - _separatorLineObj.SetActive(value: false); - } - - public void SetSpritePos(Vector3 localPos) - { - _sprite.transform.localPosition = localPos; - } - - public void SetLabelPos(Vector3 localPos) - { - _label.transform.localPosition = localPos; - } - - public void SetSubLabelPos(Vector3 localPos) - { - _subLabel.transform.localPosition = localPos; - } - - public void SetValue(string text) - { - _label.text = text; - } - - public void SetSubLabelText(string text) - { - _subLabel.text = text; - } - - public string GetValue() - { - return _label.text; - } - - public void SetSpriteName(string spriteName, bool isMakePixelPerfect, bool isCollisionResize) - { - _sprite.spriteName = spriteName; - _button.normalSprite = spriteName; - if (isMakePixelPerfect) - { - _sprite.MakePixelPerfect(); - } - if (isCollisionResize) - { - _collider.size = new Vector3(_sprite.width, _sprite.height); - } - } - - public void SetSpriteNameOnPress(string spriteName) - { - _button.pressedSprite = spriteName; - } - - public void SetSpriteOnButtonName(string spriteName, bool isMakePixelPerfect) - { - _spriteOnButton.spriteName = spriteName; - if (isMakePixelPerfect) - { - _spriteOnButton.MakePixelPerfect(); - } - } - - public void SetSpriteOnButtonPos(Vector3 localPos) - { - _spriteOnButton.transform.localPosition = localPos; - } - - public void SetActive_SpriteOnButton(bool isActive) - { - if (_spriteOnButton.gameObject.activeSelf != isActive) - { - _spriteOnButton.gameObject.SetActive(isActive); - } - } - - public override void AddChangeCallback(EventDelegate.Callback callback) - { - EventDelegate.Add(_button.onClick, callback); - } - - public override void SetActive_SeparatorLine(bool isActive) - { - _separatorLineObj.SetActive(isActive); - } - - public void SetToGrey(bool isGrey) - { - UIManager.SetObjectToGrey(base.gameObject, isGrey); - UIManager.SetObjectToGrey(_separatorLineObj, b: false); - _button.enabled = !isGrey; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemGrid.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemGrid.cs deleted file mode 100644 index c97a51d6..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemGrid.cs +++ /dev/null @@ -1,52 +0,0 @@ -using UnityEngine; - -namespace Wizard.Dialog.Setting; - -public class ItemGrid : Item -{ - [SerializeField] - private UIGrid _grid; - - public UIGrid GetUIGrid() - { - return _grid; - } - - public void SetArangement(UIGrid.Arrangement arrangement) - { - _grid.arrangement = arrangement; - } - - public UIGrid.Arrangement GetArrangement() - { - return _grid.arrangement; - } - - public void SetCellWidth(float width) - { - _grid.cellWidth = width; - } - - public float GetCellWidth() - { - return _grid.cellWidth; - } - - public void SetCellHeight(float height) - { - _grid.cellHeight = height; - } - - public float GetCellHeight() - { - return _grid.cellHeight; - } - - public override void AddChangeCallback(EventDelegate.Callback callback) - { - } - - public override void SetActive_SeparatorLine(bool isActive) - { - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemLabel.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemLabel.cs deleted file mode 100644 index 494141c0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemLabel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using UnityEngine; - -namespace Wizard.Dialog.Setting; - -public class ItemLabel : Item -{ - [SerializeField] - private SettingBase _parant; - - [SerializeField] - private UILabel _label; - - [SerializeField] - private GameObject _separatorLineObj; - - private void Awake() - { - _label.text = string.Empty; - _separatorLineObj.SetActive(value: false); - } - - public void SetValue(string text) - { - _label.text = text; - } - - public string GetValue() - { - return _label.text; - } - - public override void AddChangeCallback(EventDelegate.Callback callback) - { - } - - public override void SetActive_SeparatorLine(bool isActive) - { - _separatorLineObj.SetActive(isActive); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSelect.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSelect.cs deleted file mode 100644 index 88b5d172..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSelect.cs +++ /dev/null @@ -1,305 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard.Dialog.Setting; - -public class ItemSelect : Item -{ - [SerializeField] - private UILabel _title; - - [SerializeField] - private GameObject _state; - - [SerializeField] - private GameObject _separatorLineObj; - - [SerializeField] - private UIButton _button; - - [SerializeField] - private GameObject _list; - - [SerializeField] - private UITable _table; - - [SerializeField] - private BoxCollider _listCollider; - - private EventDelegate.Callback _onClick; - - [SerializeField] - private GameObject _resolutionItem; - - [SerializeField] - private UIPanel _panel; - - private string _currentValue; - - private const int BOTTOM_PADDING = -10; - - private const int NORMAL_ITEM_SIZE = 188; - - private Color _originalColor; - - private const int PANEL_DEPTH_CLOSE = 30; - - private const int PANEL_DEPTH_OPEN = 50; - - private UIScrollView _parentScrollView; - - private List _possibleValues; - - private List _items; - - private const int DIRECTION_UP_TABLE_POSITION = 14; - - private const int DIRECTION_UP_LIST_POSITION = 12; - - public bool _isOpenDirectionUp; - - public List PossibleValues => _possibleValues; - - private void Awake() - { - _button.onClick.Add(new EventDelegate(delegate - { - if (_list.activeSelf) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - } - SetListVisible(!_list.activeSelf); - })); - UIEventListener.Get(_listCollider.gameObject).onPress = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - SetListVisible(b: false); - }; - } - - public void SetPossibleResolutionValues(List possibleValues, bool resizeListSprite) - { - for (int i = 0; i < possibleValues.Count; i++) - { - GameObject o = NGUITools.AddChild(_table.gameObject, _resolutionItem); - string str = possibleValues[i]; - string[] array = str.Split('×'); - o.transform.Find("width").gameObject.GetComponent().text = array[0]; - o.transform.Find("height").gameObject.GetComponent().text = array[1]; - o.SetActive(value: true); - if ((bool)_parentScrollView) - { - o.AddMissingComponent().scrollView = _parentScrollView; - } - if (resizeListSprite && i == possibleValues.Count - 1) - { - UISprite component = _list.GetComponent(); - component.bottomAnchor.target = o.transform; - component.bottomAnchor.relative = 0f; - component.bottomAnchor.absolute = -10; - } - _originalColor = o.GetComponentInChildren().color; - UIEventListener.Get(o).onHover = delegate(GameObject g, bool b) - { - o.GetComponentInChildren().enabled = b; - }; - UIEventListener.Get(o).onClick = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - o.GetComponentInChildren().enabled = false; - SetListVisible(b: false); - SetResolutionValue(str); - if (_onClick != null) - { - _onClick(); - } - }; - } - } - - public void SetPossibleIdValues(List possibleValues, bool resizeListSprite) - { - SetPossibleValues(possibleValues, resizeListSprite, (string s) => Data.SystemText.Get(s)); - } - - public void SetPossibleValues(List possibleValues, bool resizeListSprite, Func textChange = null) - { - if (_possibleValues != null) - { - _possibleValues.Clear(); - } - else - { - _possibleValues = new List(); - } - if (_items != null) - { - foreach (GameObject item in _items) - { - UnityEngine.Object.Destroy(item); - } - _items.Clear(); - } - else - { - _items = new List(); - } - List list = new List(possibleValues); - if (_isOpenDirectionUp) - { - list.Reverse(); - } - for (int i = 0; i < list.Count; i++) - { - if (string.IsNullOrEmpty(list[i])) - { - continue; - } - GameObject o = NGUITools.AddChild(_table.gameObject, _resolutionItem); - _items.Add(o); - string str = list[i]; - if (textChange != null) - { - str = textChange(str); - } - _possibleValues.Add(str); - o.transform.Find("width").gameObject.SetActive(value: false); - o.transform.Find("height").gameObject.SetActive(value: false); - UILabel component = o.transform.Find("center").gameObject.GetComponent(); - component.width = 188; - component.text = str; - o.SetActive(value: true); - if ((bool)_parentScrollView) - { - o.AddMissingComponent().scrollView = _parentScrollView; - } - _originalColor = o.GetComponentInChildren().color; - UIEventListener.Get(o).onHover = delegate(GameObject g, bool b) - { - o.GetComponentInChildren().enabled = b; - }; - UIEventListener.Get(o).onClick = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - o.GetComponentInChildren().enabled = false; - SetListVisible(b: false); - SetValue(str); - if (_onClick != null) - { - _onClick(); - } - }; - } - if (_isOpenDirectionUp) - { - _possibleValues.Reverse(); - } - if (resizeListSprite && _items.Count > 0) - { - GameObject gameObject = _items[_items.Count - 1]; - UISprite component2 = _list.GetComponent(); - if (_isOpenDirectionUp) - { - component2.topAnchor.target = gameObject.transform; - component2.topAnchor.relative = 1f; - component2.topAnchor.absolute = 10; - } - else - { - component2.bottomAnchor.target = gameObject.transform; - component2.bottomAnchor.relative = 0f; - component2.bottomAnchor.absolute = -10; - } - } - if (_isOpenDirectionUp) - { - _table.GetComponent().pivot = UIWidget.Pivot.BottomLeft; - Vector3 localPosition = _table.transform.localPosition; - localPosition.y = 14f; - _table.transform.localPosition = localPosition; - _table.direction = UITable.Direction.Up; - _list.GetComponent().pivot = UIWidget.Pivot.Bottom; - Vector3 localPosition2 = _list.transform.localPosition; - localPosition2.y = 12f; - _list.transform.localPosition = localPosition2; - } - _table.repositionNow = true; - _list.GetComponent().ResetAndUpdateAnchors(); - } - - private void SetListVisible(bool b) - { - _list.SetActive(b); - _listCollider.enabled = b; - _panel.depth = (b ? 50 : 30); - UISprite component = _list.GetComponent(); - component.ResetAndUpdateAnchors(); - component.gameObject.SetActive(b); - } - - public void SetResolutionValue(string value) - { - _currentValue = value; - string[] array = value.Split('×'); - _state.transform.Find("width").gameObject.GetComponent().text = array[0]; - _state.transform.Find("height").gameObject.GetComponent().text = array[1]; - } - - public void SetValue(string value) - { - _currentValue = value; - _state.transform.Find("width").gameObject.SetActive(value: false); - _state.transform.Find("height").gameObject.SetActive(value: false); - UILabel component = _state.transform.Find("center").gameObject.GetComponent(); - component.width = 188; - component.text = value; - } - - public string GetValue() - { - return _currentValue; - } - - public void SetTitleLabel(string title) - { - _title.text = title; - } - - public override void AddChangeCallback(EventDelegate.Callback callback) - { - _onClick = (EventDelegate.Callback)Delegate.Combine(_onClick, callback); - } - - public override void SetActive_SeparatorLine(bool isActive) - { - _separatorLineObj.SetActive(isActive); - } - - public void SetTitleTextLocalPos(Vector3 localPos) - { - _title.transform.localPosition = localPos; - } - - public void SetToGrey(bool b) - { - UIManager.SetObjectToGrey(base.gameObject, b); - UIManager.SetObjectToGrey(_separatorLineObj, b: false); - UISprite[] componentsInChildren = _table.GetComponentsInChildren(includeInactive: true); - for (int i = 0; i < componentsInChildren.Length; i++) - { - componentsInChildren[i].color = _originalColor; - } - } - - public void SetScrollView(UIScrollView view) - { - _listCollider.gameObject.AddMissingComponent().scrollView = view; - _parentScrollView = view; - _button.gameObject.AddMissingComponent().scrollView = view; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSlider.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSlider.cs deleted file mode 100644 index dcb34141..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSlider.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using UnityEngine; - -namespace Wizard.Dialog.Setting; - -public class ItemSlider : Item -{ - [SerializeField] - private SettingBase m_parant; - - [SerializeField] - private UILabel m_titleLabel; - - [SerializeField] - private UILabel m_valueLabel; - - [SerializeField] - private UISlider m_slider; - - [SerializeField] - private UISprite m_foregroundSprite; - - [SerializeField] - private UISprite _foregroundEdgeSprite; - - [SerializeField] - private UISprite m_thumbSprite; - - [SerializeField] - private GameObject m_separatorLineObj; - - private const string FOREGROUND_ON_SPRITE_NAME = "gauge_blue_bottom"; - - private const string FOREGROUND_OFF_SPRITE_NAME = "gauge_gray_bottom"; - - private const string FOREGROUND_EDGE_ON_SPRITE_NAME = "gauge_blue_edge"; - - private const string FOREGROUND_EDGE_OFF_SPRITE_NAME = "gauge_gray_edge"; - - private const string THUMB_ON_SPRITE_NAME = "btn_gauge_on"; - - private const string THUMB_OFF_SPRITE_NAME = "btn_gauge_off"; - - private bool m_isPlaySe; - - private void Awake() - { - m_titleLabel.text = string.Empty; - m_valueLabel.text = string.Empty; - m_separatorLineObj.SetActive(value: false); - AddChangeCallback(delegate - { - string text = Mathf.CeilToInt(m_slider.value * 10f).ToString(); - bool flag = m_valueLabel.text != text; - m_valueLabel.text = text; - if (m_isPlaySe) - { - if (flag) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BAR_SLIDE); - } - } - else - { - m_isPlaySe = true; - } - }); - } - - public void SetValue(float value) - { - m_slider.value = value; - m_isPlaySe = false; - } - - public float GetValue() - { - return m_slider.value; - } - - public void SetTitleLabel(string title) - { - m_titleLabel.text = title; - } - - public void SetLooks(bool isOn) - { - m_foregroundSprite.spriteName = (isOn ? "gauge_blue_bottom" : "gauge_gray_bottom"); - _foregroundEdgeSprite.spriteName = (isOn ? "gauge_blue_edge" : "gauge_gray_edge"); - m_thumbSprite.spriteName = (isOn ? "btn_gauge_on" : "btn_gauge_off"); - } - - public override void AddChangeCallback(EventDelegate.Callback callback) - { - EventDelegate.Add(m_slider.onChange, callback); - } - - public void AddDragFinishedCallback(UIProgressBar.OnDragFinished callback) - { - UISlider slider = m_slider; - slider.onDragFinished = (UIProgressBar.OnDragFinished)Delegate.Combine(slider.onDragFinished, callback); - } - - public override void SetActive_SeparatorLine(bool isActive) - { - m_separatorLineObj.SetActive(isActive); - } - - public void SetScrollView(UIScrollView view) - { - UIDragScrollView componentInChildren = m_slider.gameObject.GetComponentInChildren(); - componentInChildren.enabled = true; - componentInChildren._dragEnabled = false; - componentInChildren.scrollView = view; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemToggle.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemToggle.cs index e436e303..770253a1 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemToggle.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemToggle.cs @@ -4,8 +4,6 @@ namespace Wizard.Dialog.Setting; public class ItemToggle : Item { - [SerializeField] - private SettingBase m_parant; [SerializeField] private UILabel m_titleLabel; @@ -22,12 +20,6 @@ public class ItemToggle : Item [SerializeField] private GameObject m_separatorLineObj; - [SerializeField] - private UISprite _spriteON; - - [SerializeField] - private UISprite _spriteOFF; - [SerializeField] private BoxCollider _collider; @@ -59,7 +51,7 @@ public class ItemToggle : Item UpdateStateLabel(); if (m_isPlaySe) { - GameMgr.GetIns().GetSoundMgr().PlaySe(m_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + } else { @@ -87,39 +79,6 @@ public class ItemToggle : Item m_titleLabel.text = title; } - public void SetSutTextLabel(string text) - { - _subTextLabel.gameObject.SetActive(value: true); - _subTextLabel.text = text; - } - - public void SetStateText(string onText, string offText) - { - m_OnText = onText; - m_OffText = offText; - UpdateStateLabel(); - } - - public void SetActive_StateText(bool isActive) - { - m_stateLabel.gameObject.SetActive(isActive); - } - - public void SetTitleTextLocalPos(Vector3 localPos) - { - m_titleLabel.transform.localPosition = localPos; - } - - public void SetStateTextLocalPos(Vector3 localPos) - { - m_stateLabel.transform.localPosition = localPos; - } - - public void SetToggleLocalPos(Vector3 localPos) - { - m_toggle.transform.localPosition = localPos; - } - private void UpdateStateLabel() { if (!string.IsNullOrEmpty(m_OnText) && !string.IsNullOrEmpty(m_OffText)) @@ -128,56 +87,6 @@ public class ItemToggle : Item } } - public void SetToggleLooks(bool isNormal) - { - UIManager.SetObjectToGrey(m_toggle.gameObject, !isNormal); - bool value = GetValue(); - SetValue(!value, isDisablePlayse: false); - SetValue(value, isDisablePlayse: false); - _collider.enabled = isNormal; - } - - public void SetLabelLooks(bool isNormal) - { - UIManager.SetObjectToGrey(m_stateLabel.gameObject, !isNormal); - UIManager.SetObjectToGrey(m_titleLabel.gameObject, !isNormal); - } - - public void SetSpriteONName(string spriteName, bool isMakePixelPerfect, bool isCollisionResize) - { - _spriteON.spriteName = spriteName; - if (isMakePixelPerfect) - { - _spriteON.MakePixelPerfect(); - } - if (isCollisionResize) - { - _collider.size = new Vector3(_spriteON.width, _spriteON.height); - } - } - - public void SetSpriteOFFName(string spriteName, bool isMakePixelPerfect, bool isCollisionResize) - { - _spriteOFF.spriteName = spriteName; - if (isMakePixelPerfect) - { - _spriteOFF.MakePixelPerfect(); - } - if (isCollisionResize) - { - _collider.size = new Vector3(_spriteOFF.width, _spriteOFF.height); - } - } - - public void SetButtonEnable(bool isEnable) - { - UIButton component = m_toggle.GetComponent(); - if (null != component && component.enabled != isEnable) - { - component.enabled = isEnable; - } - } - public void SetValidator(UIToggle.Validate validator) { m_toggle.validator = validator; @@ -188,45 +97,8 @@ public class ItemToggle : Item EventDelegate.Add(m_toggle.onChange, callback); } - public void ClearChangeCallback() - { - m_toggle.onChange.Clear(); - } - - public void AddChangeCallback(EventDelegate callback) - { - m_toggle.onChange.Add(callback); - } - public override void SetActive_SeparatorLine(bool isActive) { m_separatorLineObj.SetActive(isActive); } - - public void SetScrollView(UIScrollView view) - { - _collider.gameObject.AddMissingComponent().scrollView = view; - } - - public void SetToggleEnable(bool isEnable) - { - if (!(m_toggle != null)) - { - return; - } - m_toggle.enabled = isEnable; - if (isEnable) - { - return; - } - TweenColor[] componentsInChildren = m_toggle.GetComponentsInChildren(); - if (componentsInChildren != null) - { - TweenColor[] array = componentsInChildren; - for (int i = 0; i < array.Length; i++) - { - array[i].enabled = true; - } - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/SettingBase.cs b/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/SettingBase.cs deleted file mode 100644 index ca48e758..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/SettingBase.cs +++ /dev/null @@ -1,688 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard.Dialog.Setting; - -public class SettingBase : MonoBehaviour -{ - public enum Type - { - NORMAL, - SCENARIO, - VIDEOHOSTING_SETTING_RECORD, - VIDEOHOSTING_SETTING_PUBLISH, - VIDEOHOSTING_MENU_RECORD, - VIDEOHOSTING_MENU_PUBLISH - } - - public enum ID - { - SOUND, - BGM, - SE, - VOICE, - MOVIE_SUBTITLES, - BATTLE_EFFECT_DISPLAY, - LEADER_ANIMATION_DISPLAY, - PREDICTION_ICONS_DISPLAY, - TURN_END_CONFIRM, - TURN_END_WITHOUT_USING_HERO_SKILL_CONFIRM, - EVOLVE_CONFIRM, - FIXEDUSE_COST_INFO, - OPPONENT_MESSAGE_DISPLAY, - OPPONENT_SHOW_DEFAULT_SKIN, - SHOW_FOIL_CARD_ANIMATION, - SELECT_WSS, - SELECT_IPV6, - PURCHASE_ALERT, - SCREEN_FIX, - INVITATION_FRIEND_ROOM, - INVITATION_IN_BATTLE, - INVITATION_IN_OFFLINE, - RECEIVED_FRIEND_APPLY, - SHOW_PANEL_ALWAYS, - SHOW_SIDE_LOG, - SHOW_FUSION_CARD_PLAY_DIALOG, - AUTO_MESSAGE, - SIMPLE_STAGE, - COLLABORATION_SOUND, - USE_STAGE_SELECT, - STAGE_SELECT, - ENEMYNAME_DISPLAY, - RECORD_MODE, - RECORD_UPLOAD, - RECORD_WATCH, - RECORD_PAUSE, - RECORD_RESUME, - RECORD_STOP, - RECORD_FACECAMERA, - RECORD_MICROPHONE, - RECORD_MICROPHONE_GAIN, - RECORD_PAUSE_IN_MENU, - RECORD_BUTTON_GRID, - PUBLISH_MODE, - PLAY_SOUND_IN_BG, - FULLSCREEN, - RESOLUTION, - FPS, - QRCode, - MOUSE_CONTROL, - MOUSE_SHORTCUT_PLAY, - MOUSE_SHORTCUT_EVOLUTION, - MOUSE_SHORTCUT_DETAIL, - BATTLE_DETAIL_PANEL_SIZE, - SHOW_DETAIL_LEFT_AND_RIGHT, - KEYBOARD_CONTROL, - KEYBOARD_SHORTCUT_EVOLUTION, - KEYBOARD_SHORTCUT_SPACE, - PLAY_BGM_ON_OTHER_BGM, - BATTLE_PASS_SHOW_RESULT - } - - [SerializeField] - private GameObject m_scrollView; - - [SerializeField] - private GameObject m_itemToggle; - - [SerializeField] - private GameObject m_itemSlider; - - [SerializeField] - private GameObject m_itemGrid; - - [SerializeField] - private GameObject m_itemLabel; - - [SerializeField] - private GameObject m_itemButton; - - [SerializeField] - private GameObject _itemSelect; - - protected static readonly Vector3 CHILD_STATE_LABEL_POS = new Vector3(-297f, 0f, 0f); - - private Dictionary m_dicItems = new Dictionary(); - - private Type m_type; - - private const string VOICE_NAME = "vo_test_01"; - - protected DialogBase _dialogObject; - - private static readonly Vector3 PUBLISHMODE_STATELABEL_POS = new Vector3(80f, 0f, 0f); - - private static readonly Vector3 PUBLISHMODE_TOGGLE_POS = new Vector3(275f, 0f, 0f); - - private static readonly Vector3 RECORDMODE_STATELABEL_POS = new Vector3(80f, 0f, 0f); - - private static readonly Vector3 RECORDMODE_TOGGLE_POS = new Vector3(275f, 0f, 0f); - - private static readonly Vector3 SPRITE_POS_RECORD_PLAYPAUSE = new Vector3(-93f, 0f, 0f); - - private static readonly Vector3 SPRITE_POS_RECORD_STOP = new Vector3(-93f, 0f, 0f); - - private static readonly Vector3 LABEL_POS_RECORD_PLAYPAUSE = new Vector3(20f, 0f, 0f); - - private static readonly Vector3 LABEL_POS_RECORD_STOP = new Vector3(20f, 0f, 0f); - - protected GameObject SingleTabRoot => m_scrollView; - - public static DialogBase CreateDialog(Type type = Type.NORMAL) - { - SettingBase settingBase = null; - settingBase = ((type != Type.NORMAL) ? Object.Instantiate(UIManager.GetInstance().SettingPrefab) : Object.Instantiate(UIManager.GetInstance().OptionSettingPrefab)); - settingBase.Create(type); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("OtherTop_0003")); - dialogBase.SetObj(settingBase.gameObject, settingBase.transform.localPosition); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - settingBase.SettingDialogObject(dialogBase); - return dialogBase; - } - - public void SettingDialogObject(DialogBase dialog) - { - _dialogObject = dialog; - } - - private void Start() - { - GameMgr.GetIns().GetSoundMgr().LoadVoice("vo_test_01"); - } - - public virtual void Create() - { - } - - public virtual void Create(Type type) - { - m_type = type; - Create(); - if (m_type != Type.NORMAL) - { - if (m_type == Type.SCENARIO) - { - CreateToggle_AutoMessage(isDispSeparatorLine: true); - CreateToggle_MovieSubtitles(isDispSeparatorLine: true, m_scrollView.gameObject); - CreateSoundItem(m_scrollView.gameObject); - } - else if (m_type == Type.VIDEOHOSTING_SETTING_RECORD) - { - CreateVideoHostingSettingRecord(); - } - else if (m_type == Type.VIDEOHOSTING_SETTING_PUBLISH) - { - CreateVideoHostingSettingPublish(); - } - else if (m_type == Type.VIDEOHOSTING_MENU_RECORD) - { - CreateVideoHostingMenuRecord(); - } - else if (m_type == Type.VIDEOHOSTING_MENU_PUBLISH) - { - CreateVideoHostingMenuPublish(); - } - } - } - - protected void ResetScroll() - { - m_scrollView.GetComponent().ResetPosition(); - } - - protected virtual void OnDestroy() - { - GameMgr.GetIns().GetSoundMgr().UnloadVoice("vo_test_01"); - } - - protected void CreateSoundItem(GameObject parent) - { - ItemToggle soundToggle = CreateToggle_Sound(isDispSeparatorLine: true, parent); - ItemSlider bgmSlider = AddSlider_BGM(isDispSeparatorLine: false, parent); - ItemSlider seSlider = AddSlider_SE(isDispSeparatorLine: false, parent); - ItemSlider voiceSlider = AddSlider_Voice(isDispSeparatorLine: true, parent); - soundToggle.AddChangeCallback(delegate - { - bool value = soundToggle.GetValue(); - bgmSlider.SetLooks(value); - seSlider.SetLooks(value); - voiceSlider.SetLooks(value); - }); - } - - public Item FindItem(ID id) - { - if (!m_dicItems.ContainsKey(id)) - { - return null; - } - return m_dicItems[id]; - } - - protected ItemToggle CreateToggle(ID id, bool isDispSeparatorLine, GameObject parent) - { - ItemToggle component = NGUITools.AddChild(parent, m_itemToggle).GetComponent(); - component.SetScrollView(m_scrollView.GetComponent()); - component.name = id.ToString(); - component.SetActive_SeparatorLine(isDispSeparatorLine); - m_dicItems.Add(id, component); - return component; - } - - protected ItemSlider CreateSlider(ID id, bool isDispSeparatorLine, GameObject parent) - { - ItemSlider component = NGUITools.AddChild(parent, m_itemSlider).GetComponent(); - component.SetScrollView(m_scrollView.GetComponent()); - component.name = id.ToString(); - component.SetActive_SeparatorLine(isDispSeparatorLine); - m_dicItems.Add(id, component); - return component; - } - - protected ItemGrid CreateGrid(ID id, bool isDispSeparatorLine, GameObject parent) - { - ItemGrid component = NGUITools.AddChild(parent, m_itemGrid).GetComponent(); - component.name = id.ToString(); - component.SetActive_SeparatorLine(isDispSeparatorLine); - m_dicItems.Add(id, component); - return component; - } - - protected ItemButton CreateButton(ID id, bool isDispSeparatorLine, GameObject parent) - { - ItemButton component = NGUITools.AddChild(parent, m_itemButton).GetComponent(); - component.name = id.ToString(); - component.SetActive_SeparatorLine(isDispSeparatorLine); - m_dicItems.Add(id, component); - return component; - } - - private ItemLabel CreateLabel(ID id, bool isDispSeparatorLine) - { - ItemLabel component = NGUITools.AddChild(m_scrollView, m_itemLabel).GetComponent(); - component.name = id.ToString(); - component.SetActive_SeparatorLine(isDispSeparatorLine); - m_dicItems.Add(id, component); - return component; - } - - protected ItemSelect CreateSelect(ID id, bool isDispSeparatorLine, GameObject parent) - { - ItemSelect component = NGUITools.AddChild(parent, _itemSelect).GetComponent(); - component.SetScrollView(m_scrollView.GetComponent()); - component.name = id.ToString(); - component.SetActive_SeparatorLine(isDispSeparatorLine); - m_dicItems.Add(id, component); - return component; - } - - protected ItemToggle CreateToggle_ScreenFix(bool isDispSeparatorLine, GameObject parent) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SCREEN_FIX, isDispSeparatorLine, parent); - item.SetTitleLabel(systemText.Get("OtherConfig_0011")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.DEVICE_ORIENTATION)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.DEVICE_ORIENTATION, item.GetValue()); - UIManager.GetInstance().SetDeviceOrientation(); - }); - return item; - } - - protected ItemToggle CreateToggle_MovieSubtitles(bool isDispSeparatorLine, GameObject parent) - { - ItemToggle item = CreateToggle(ID.MOVIE_SUBTITLES, isDispSeparatorLine, parent); - item.SetTitleLabel(Data.SystemText.Get("OtherConfig_0063")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_Sound(bool isDispSeparatorLine, GameObject parent) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SOUND, isDispSeparatorLine, parent); - item.SetTitleLabel(systemText.Get("OtherConfig_0017")); - item.SetValue(!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE)); - item.AddChangeCallback(delegate - { - bool flag = !item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SOUND_MUTE, flag); - GameMgr.GetIns().GetSoundMgr().AllMute(flag); - }); - return item; - } - - private ItemSlider AddSlider_BGM(bool isDispSeparatorLine, GameObject parent) - { - SystemText systemText = Data.SystemText; - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - ItemSlider item = CreateSlider(ID.BGM, isDispSeparatorLine, parent); - item.SetTitleLabel(systemText.Get("OtherConfig_0001")); - item.SetValue(soundMgr.GetBgmVolume()); - item.AddChangeCallback(delegate - { - float value = item.GetValue(); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BGM_VOLUME, value); - soundMgr.SetBgmVolume(value); - }); - return item; - } - - private ItemSlider AddSlider_SE(bool isDispSeparatorLine, GameObject parent) - { - SystemText systemText = Data.SystemText; - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - ItemSlider item = CreateSlider(ID.SE, isDispSeparatorLine, parent); - item.SetTitleLabel(systemText.Get("OtherConfig_0002")); - item.SetValue(soundMgr.GetSeVolume()); - item.AddChangeCallback(delegate - { - float value = item.GetValue(); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SE_VOLUME, value); - soundMgr.SetSeVolume(value); - }); - return item; - } - - private ItemSlider AddSlider_Voice(bool isDispSeparatorLine, GameObject parent) - { - SystemText systemText = Data.SystemText; - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - ItemSlider item = CreateSlider(ID.VOICE, isDispSeparatorLine, parent); - item.SetTitleLabel(systemText.Get("OtherConfig_0003")); - item.SetValue(soundMgr.GetVoiceVolume()); - item.AddChangeCallback(delegate - { - float value = item.GetValue(); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.VOICE_VOLUME, value); - soundMgr.SetVoiceVolume(value); - }); - item.AddDragFinishedCallback(delegate - { - soundMgr.PlayVoiceScenario("vo_test_01"); - }); - return item; - } - - private ItemToggle CreateToggle_AutoMessage(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.AUTO_MESSAGE, isDispSeparatorLine, m_scrollView.gameObject); - item.SetTitleLabel(systemText.Get("OtherConfig_0014")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.AUTO_MESSAGE)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.AUTO_MESSAGE, item.GetValue()); - }); - return item; - } - - private void CreateVideoHostingSettingRecord() - { - } - - private void CreateVideoHostingSettingPublish() - { - } - - private void CreateVideoHostingMenuRecord() - { - } - - private void CreateVideoHostingMenuPublish() - { - } - - private void CreateSetting_Publish_NicoNico() - { - CreateToggle_PublishMode(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - } - - private void CreateSetting_Record_NicoNico() - { - CreateToggle_RecordMode(isDispSeparatorLine: true); - CreateToggle_RecordFaceCamera(isDispSeparatorLine: true); - CreateToggle_RecordMicrophone(isDispSeparatorLine: true); - CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - } - - private void CreateMenu_Record_NicoNico_iOS() - { - ItemGrid itemGrid = CreateGrid_RecordButton(isDispSeparatorLine: true); - CreateButton_RecordPlayPause(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject); - CreateButton_RecordStop(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject); - CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - CreateSlider_RecordMicrophoneGain(isDispSeparatorLine: false); - } - - private void CreateSetting_Record_EveryPlay_iOS() - { - CreateToggle_RecordMode(isDispSeparatorLine: true); - CreateToggle_RecordFaceCamera(isDispSeparatorLine: true); - CreateToggle_RecordMicrophone(isDispSeparatorLine: true); - CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - } - - private void CreateSetting_Record_EveryPlay_Android() - { - CreateToggle_RecordMode(isDispSeparatorLine: true); - CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - } - - private void CreateMenu_Record_EveryPlay_iOS() - { - ItemGrid itemGrid = CreateGrid_RecordButton(isDispSeparatorLine: true); - CreateButton_RecordPlayPause(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject); - CreateButton_RecordStop(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject); - CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - } - - private void CreateMenu_Record_EveryPlay_Android() - { - ItemGrid itemGrid = CreateGrid_RecordButton(isDispSeparatorLine: true); - CreateButton_RecordPlayPause(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject); - CreateButton_RecordStop(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject); - CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true); - CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true); - } - - private ItemToggle CreateToggle_EnemyNameDisplay(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.ENEMYNAME_DISPLAY, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0013")); - item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS); - item.SetButtonEnable(isEnable: false); - item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.EnemyNameDisplay)); - item.AddChangeCallback(delegate - { - VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.EnemyNameDisplay, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_RecordMode(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.RECORD_MODE, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0006")); - item.SetStateText(systemText.Get("VideoHosting_0010"), systemText.Get("VideoHosting_0011")); - item.SetActive_StateText(isActive: true); - item.SetButtonEnable(isEnable: false); - item.SetToggleLocalPos(RECORDMODE_TOGGLE_POS); - item.SetStateTextLocalPos(RECORDMODE_STATELABEL_POS); - item.SetSpriteONName("btn_check_03_on", isMakePixelPerfect: true, isCollisionResize: true); - item.SetSpriteOFFName("btn_check_03_off", isMakePixelPerfect: true, isCollisionResize: true); - item.SetValue(VideoHostingUtil.GetRecordModeEnable()); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - VideoHostingUtil.SetRecordModeEnable(value); - if (value) - { - VideoHostingUtil.SetPublishModeEnable(isEnable: false); - } - _SetItemToggleLooks(ID.RECORD_FACECAMERA, value); - _SetItemToggleLooks(ID.RECORD_MICROPHONE, value); - _SetItemToggleLooks(ID.ENEMYNAME_DISPLAY, value); - _SetItemToggleLooks(ID.RECORD_PAUSE_IN_MENU, value); - VideoHostingUtil.CheckAndCreateHUD(VideoHostingUtil.HUDScene.Home); - UpdateRecordingFaceCameraStatus(); - }); - return item; - } - - private ItemButton CreateButton_RecordPlayPause(bool isDispSeparatorLine, GameObject parent) - { - ItemButton item = CreateButton(ID.RECORD_PAUSE, isDispSeparatorLine, parent); - item.SetSpriteName("btn_common_04_m_off", isMakePixelPerfect: true, isCollisionResize: true); - item.SetSpriteNameOnPress("btn_common_04_m_on"); - item.SetActive_SpriteOnButton(isActive: true); - ChangeSpriteNameRecordPlayPause(item); - item.SetLabelPos(LABEL_POS_RECORD_PLAYPAUSE); - item.SetSpriteOnButtonPos(SPRITE_POS_RECORD_PLAYPAUSE); - item.AddChangeCallback(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (SingletonMonoBehaviour.instance.IsRecording() && !SingletonMonoBehaviour.instance.IsRecordingPause()) - { - SingletonMonoBehaviour.instance.PauseRecording(); - } - else - { - SingletonMonoBehaviour.instance.ResumeRecording(); - UIManager.GetInstance().CloseLatestDialog(); - } - ChangeSpriteNameRecordPlayPause(item); - }); - return item; - } - - private void ChangeSpriteNameRecordPlayPause(ItemButton item) - { - if (SingletonMonoBehaviour.instance.IsRecording() && !SingletonMonoBehaviour.instance.IsRecordingPause()) - { - item.SetValue(Data.SystemText.Get("VideoHosting_0030")); - item.SetSpriteOnButtonName("icon_button_rec_stop", isMakePixelPerfect: true); - } - else - { - item.SetValue(Data.SystemText.Get("VideoHosting_0031")); - item.SetSpriteOnButtonName("icon_button_rec_resume", isMakePixelPerfect: true); - } - } - - private ItemButton CreateButton_RecordStop(bool isDispSeparatorLine, GameObject parent) - { - SystemText systemText = Data.SystemText; - ItemButton itemButton = CreateButton(ID.RECORD_STOP, isDispSeparatorLine, parent); - itemButton.SetValue(systemText.Get("VideoHosting_0020")); - itemButton.SetSpriteName("btn_common_02_m_off", isMakePixelPerfect: true, isCollisionResize: true); - itemButton.SetSpriteNameOnPress("btn_common_02_m_on"); - itemButton.SetSpriteOnButtonName("icon_button_rec_end", isMakePixelPerfect: true); - itemButton.SetActive_SpriteOnButton(isActive: true); - itemButton.SetLabelPos(LABEL_POS_RECORD_STOP); - itemButton.SetSpriteOnButtonPos(SPRITE_POS_RECORD_STOP); - itemButton.AddChangeCallback(delegate - { - if (SingletonMonoBehaviour.instance.IsRecording()) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SingletonMonoBehaviour.instance.StopRecording(); - VideoHostingUtil.CreateDialogStopRecording(VideoHostingUtil.CheckHUDSceneUploadEnable(VideoHostingUtil.GetHUDScene()), isTimeOut: false); - UIManager.GetInstance().GetVideoHostingHUD().CloseSettingMenuDialog(); - } - }); - return itemButton; - } - - private ItemToggle CreateToggle_RecordFaceCamera(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.RECORD_FACECAMERA, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0015")); - item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS); - item.SetButtonEnable(isEnable: false); - item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingFaceCamera)); - item.AddChangeCallback(delegate - { - VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingFaceCamera, item.GetValue()); - UpdateRecordingFaceCameraStatus(); - }); - return item; - } - - private ItemToggle CreateToggle_RecordMicrophone(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.RECORD_MICROPHONE, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0016")); - item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS); - item.SetButtonEnable(isEnable: false); - item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingMicrophone)); - item.AddChangeCallback(delegate - { - VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingMicrophone, item.GetValue()); - UpdateRecordingFaceCameraStatus(); - }); - return item; - } - - private void UpdateRecordingFaceCameraStatus() - { - bool isEnableCamera = VideoHostingUtil.GetRecordModeEnable() && VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingFaceCamera); - bool isEnableMicrophone = VideoHostingUtil.GetRecordModeEnable() && VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingMicrophone); - SingletonMonoBehaviour.instance.SetRecordingFaceCameraMicrophoneStatus(isEnableCamera, isEnableMicrophone); - SingletonMonoBehaviour.instance.SetFaceCameraWindowVisible(isVisible: false); - } - - private ItemSlider CreateSlider_RecordMicrophoneGain(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemSlider item = CreateSlider(ID.RECORD_MICROPHONE_GAIN, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0033")); - item.SetLooks(isOn: true); - item.SetValue(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VIDEOHOSTING_MICROPHONE_GAIN)); - item.AddChangeCallback(delegate - { - float value = item.GetValue(); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.VIDEOHOSTING_MICROPHONE_GAIN, value); - SingletonMonoBehaviour.instance.SetRecordingMicrophoneGain(value); - }); - return item; - } - - private ItemToggle CreateToggle_RecordPauseInMenu(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.RECORD_PAUSE_IN_MENU, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0017")); - item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS); - item.SetButtonEnable(isEnable: false); - item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.RecordPauseInMenu)); - item.AddChangeCallback(delegate - { - VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.RecordPauseInMenu, item.GetValue()); - }); - return item; - } - - private ItemGrid CreateGrid_RecordButton(bool isDispSeparatorLine) - { - ItemGrid itemGrid = CreateGrid(ID.RECORD_BUTTON_GRID, isDispSeparatorLine, m_scrollView); - itemGrid.SetArangement(UIGrid.Arrangement.Horizontal); - itemGrid.SetCellWidth(300f); - return itemGrid; - } - - private ItemToggle CreateToggle_PublishMode(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.PUBLISH_MODE, isDispSeparatorLine, SingleTabRoot); - item.SetTitleLabel(systemText.Get("VideoHosting_0009")); - item.SetStateText(systemText.Get("VideoHosting_0010"), systemText.Get("VideoHosting_0011")); - item.SetActive_StateText(isActive: true); - item.SetButtonEnable(isEnable: false); - item.SetToggleLocalPos(PUBLISHMODE_TOGGLE_POS); - item.SetStateTextLocalPos(PUBLISHMODE_STATELABEL_POS); - item.SetSpriteONName("btn_check_03_on", isMakePixelPerfect: true, isCollisionResize: true); - item.SetSpriteOFFName("btn_check_03_off", isMakePixelPerfect: true, isCollisionResize: true); - item.SetValue(VideoHostingUtil.GetPublishModeEnable()); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - VideoHostingUtil.SetPublishModeEnable(value); - if (value) - { - VideoHostingUtil.SetRecordModeEnable(isEnable: false); - UpdateRecordingFaceCameraStatus(); - } - _SetItemToggleLooks(ID.ENEMYNAME_DISPLAY, value); - VideoHostingUtil.CheckAndCreateHUD(VideoHostingUtil.HUDScene.Home); - }); - return item; - } - - protected void _SetItemToggleLooks(ID id, bool isNormal) - { - ItemToggle itemToggle = FindItem(id) as ItemToggle; - if (!(null == itemToggle)) - { - itemToggle.SetToggleLooks(isNormal); - itemToggle.SetLabelLooks(isNormal); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.ErrorDialog/Dialog.cs b/SVSim.BattleEngine/Engine/Wizard.ErrorDialog/Dialog.cs index 117b76e1..c5cd083f 100644 --- a/SVSim.BattleEngine/Engine/Wizard.ErrorDialog/Dialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard.ErrorDialog/Dialog.cs @@ -7,59 +7,11 @@ namespace Wizard.ErrorDialog; public static class Dialog { - public const int SORTING_ORDER = 2; - - private static bool _isInitialized; private static Dictionary _dataList = new Dictionary(); private static Data _defaultData; - public static void Initialize() - { - if (_isInitialized) - { - _dataList.Clear(); - _defaultData = null; - } - _isInitialized = true; - ArrayList arrayList = Utility.ConvertCSV((Resources.Load("CSV/error_dialog") as TextAsset).ToString()); - bool flag = true; - foreach (ArrayList item in arrayList) - { - string[] array = (string[])item.ToArray(typeof(string)); - if (flag) - { - flag = false; - continue; - } - string text = array[0]; - Data data = new Data(text, array[1], array[2], array[3], array[4], array[5], array[6]); - if (text != "DEFAULT") - { - _dataList.Add(text, data); - } - else - { - _defaultData = data; - } - } - } - - public static Data FindData(string errorId) - { - if (_dataList.ContainsKey(errorId)) - { - return _dataList[errorId]; - } - return null; - } - - public static Data FindData(int errorId) - { - return FindData(errorId.ToString()); - } - public static DialogBase Create(string errorId) { DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/DoubleChanceData.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/DoubleChanceData.cs deleted file mode 100644 index 2209f3e6..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/DoubleChanceData.cs +++ /dev/null @@ -1,16 +0,0 @@ -using LitJson; - -namespace Wizard.Lottery; - -public class DoubleChanceData -{ - public int RequireNum { get; private set; } - - public LotteryRewardData RewardData { get; private set; } - - public DoubleChanceData(JsonData data) - { - RequireNum = data["require_num"].ToInt(); - RewardData = new LotteryRewardData(data); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyData.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyData.cs index 9203de07..992eb7c8 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyData.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyData.cs @@ -4,7 +4,6 @@ namespace Wizard.Lottery; public class LotteryApplyData { - private const string LOTTERY_KEY = "application_data"; public bool IsEnable { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyDialog.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyDialog.cs index f24373ca..963b112d 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryApplyDialog.cs @@ -5,13 +5,6 @@ namespace Wizard.Lottery; public class LotteryApplyDialog : MonoBehaviour { - private const float DIALOG_AUTO_CLOSE_TIME = 5f; - - [SerializeField] - private UITexture _banner; - - [SerializeField] - private UILabel _label; private LotteryApplyData _data; @@ -35,10 +28,4 @@ public class LotteryApplyDialog : MonoBehaviour dialogBase.SetObj(gameObject); return dialogBase; } - - private void Start() - { - _banner.mainTexture = Toolbox.ResourcesManager.LoadObject(GetLotteryTexturePath(_data, isFetch: true)); - _label.text = _data.DialogMessage; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryBigChanceTreasureBox.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryBigChanceTreasureBox.cs deleted file mode 100644 index e4bd3b7a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryBigChanceTreasureBox.cs +++ /dev/null @@ -1,164 +0,0 @@ -using Cute; -using UnityEngine; - -namespace Wizard.Lottery; - -public class LotteryBigChanceTreasureBox : LotteryTreasureBox -{ - [SerializeField] - private GameObject _parentTreasureObj; - - [SerializeField] - private GameObject _centerLine; - - [SerializeField] - private UISprite _backGround; - - [SerializeField] - private UILabel _labelOverTrasureBox; - - [SerializeField] - private UISprite _touchBg; - - [SerializeField] - private UILabel _labelCenter; - - protected override void UpdateInfoLabel() - { - switch (_lotteryRewardData.state) - { - case LotteryRewardData.eLotteryRewardState.Unapplied: - _labelInfoText.gameObject.SetActive(value: true); - break; - case LotteryRewardData.eLotteryRewardState.Applied: - case LotteryRewardData.eLotteryRewardState.WaitResult: - _labelInfoText.fontSize = 13; - _labelInfoText.gameObject.SetActive(value: true); - break; - default: - _labelInfoText.gameObject.SetActive(value: false); - break; - } - } - - protected override void UpdateStatusText() - { - switch (_lotteryRewardData.state) - { - case LotteryRewardData.eLotteryRewardState.Unapplied: - _labelStatus.text = Data.SystemText.Get("Mission_0087"); - _labelInfoText.color = LabelDefine.TEXT_COLOR_ORANGE; - _labelOverTrasureBox.text = Data.SystemText.Get("Mission_0010"); - break; - case LotteryRewardData.eLotteryRewardState.Applied: - case LotteryRewardData.eLotteryRewardState.WaitResult: - _labelStatus.text = Data.SystemText.Get("Mission_0089"); - _labelStatus.color = LabelDefine.TEXT_COLOR_ORANGE; - break; - case LotteryRewardData.eLotteryRewardState.NotReceived: - _labelCenter.text = Data.SystemText.Get("Mission_0091"); - _labelCenter.color = LabelDefine.TEXT_COLOR_ORANGE; - break; - case LotteryRewardData.eLotteryRewardState.Received: - _labelCenter.text = Data.SystemText.Get("Mission_0092"); - break; - case LotteryRewardData.eLotteryRewardState.NotAchieved: - _labelCenter.text = Data.SystemText.Get("Mission_0059"); - break; - default: - _labelStatus.text = string.Empty; - break; - } - } - - protected override void UpdateRewardImage() - { - if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Received) - { - string textureRewardImage = string.Empty; - if (_lotteryRewardData.IsSpecial) - { - string path = "thumbnail_lottery"; - textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - _labelRewardNum.gameObject.SetActive(value: false); - } - else if (_lotteryRewardData.NormalGotRewardList.Count > 0) - { - string textureName = _lotteryRewardData.NormalGotRewardList[0].TextureName; - textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - _labelRewardNum.gameObject.SetActive(value: true); - _labelRewardNum.text = _lotteryRewardData.NormalGotRewardList[0].RewardGotNum.ToString(); - } - SetTextureRewardImage(textureRewardImage); - _labelCenter.gameObject.SetActive(value: true); - _backGround.gameObject.SetActive(value: false); - _labelTreasureTouch.gameObject.SetActive(value: false); - _touchBg.gameObject.SetActive(value: false); - return; - } - if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Unapplied) - { - _centerLine.SetActive(value: true); - UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: true); - _textureRewardImage.gameObject.SetActive(value: false); - _labelRewardNum.gameObject.SetActive(value: false); - _backGround.gameObject.SetActive(value: false); - _labelOverTrasureBox.gameObject.SetActive(value: true); - return; - } - _textureRewardImage.gameObject.SetActive(value: false); - _labelRewardNum.gameObject.SetActive(value: false); - _spriteTreasureImage.gameObject.SetActive(value: true); - if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotReceived) - { - _labelTreasureTouch.gameObject.SetActive(value: true); - _labelTreasureTouch.text = GetTouchText(); - _backGround.gameObject.SetActive(value: false); - _touchBg.gameObject.SetActive(value: true); - _labelCenter.gameObject.SetActive(value: true); - } - else - { - _labelTreasureTouch.gameObject.SetActive(value: false); - if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotAchieved) - { - _labelCenter.gameObject.SetActive(value: true); - _backGround.gameObject.SetActive(value: false); - } - } - } - - protected override void UpdateNonActiveColor() - { - switch (_lotteryRewardData.state) - { - case LotteryRewardData.eLotteryRewardState.Received: - if (_lotteryRewardData.IsSpecial) - { - SetNonActiveColor(isNonActive: false); - } - else - { - SetNonActiveColor(isNonActive: true); - } - break; - case LotteryRewardData.eLotteryRewardState.Unapplied: - case LotteryRewardData.eLotteryRewardState.NotAchieved: - SetNonActiveColor(isNonActive: true); - break; - case LotteryRewardData.eLotteryRewardState.Applied: - case LotteryRewardData.eLotteryRewardState.WaitResult: - case LotteryRewardData.eLotteryRewardState.NotReceived: - SetNonActiveColor(isNonActive: false); - break; - default: - _labelStatus.text = string.Empty; - break; - } - } - - protected override void SetNonActiveColor(bool isNonActive) - { - UIManager.SetObjectToGrey(_parentTreasureObj, isNonActive); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryInfoTask.cs deleted file mode 100644 index b05486ec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryInfoTask.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; - -namespace Wizard.Lottery; - -public class LotteryInfoTask : BaseTask -{ - public class LotteryInfoData - { - public List LotteryRewardList; - - public List LotteryMissionList; - - public List MissionRewardList; - - public LotteryRewardData BigChanceReward; - - public int CampaignId { get; private set; } - - public string InfoUrl { get; private set; } - - public DateTime StartTime { get; private set; } - - public DateTime OpenTime { get; private set; } - - public DateTime EndTime { get; private set; } - - public DateTime CloseTime { get; private set; } - - public DateTime BigChanceOpenTime { get; private set; } - - public DoubleChanceData DoubleChanceReward { get; private set; } - - public LotteryMissionData BigChanceMission { get; private set; } - - public string BannerFileName { get; private set; } - - public string BackGroundFileName { get; private set; } - - public string AnnounceId { get; private set; } - - public LotteryInfoData(JsonData responseData) - { - JsonData jsonData = responseData["data"]; - CampaignId = jsonData["campaign_id"].ToInt(); - InfoUrl = jsonData["info_url"].ToString(); - StartTime = DateTime.Parse(jsonData["start_time"].ToString()); - OpenTime = DateTime.Parse(jsonData["open_time"].ToString()); - EndTime = DateTime.Parse(jsonData["end_time"].ToString()); - CloseTime = DateTime.Parse(jsonData["close_time"].ToString()); - LotteryRewardList = new List(); - BannerFileName = jsonData["campaign_banner"].ToString(); - BackGroundFileName = jsonData["campaign_bg_image"].ToString(); - JsonData jsonData2 = jsonData["lottery_reward_list"]; - for (int i = 0; i < jsonData2.Count; i++) - { - LotteryRewardData item = new LotteryRewardData(jsonData2[i]); - LotteryRewardList.Add(item); - } - if (jsonData.Keys.Contains("double_chance")) - { - JsonData data = jsonData["double_chance"]; - DoubleChanceReward = new DoubleChanceData(data); - } - if (jsonData.TryGetValue("big_chance", out var value) && jsonData.TryGetValue("big_chance_reward", out var value2)) - { - BigChanceMission = new LotteryMissionData(value, responseData["data_headers"]["servertime"].ToDouble()); - BigChanceReward = new LotteryRewardData(value2); - BigChanceOpenTime = DateTime.Parse(value["open_time"].ToString()); - } - if (jsonData.TryGetValue("append_lottery_reward_list", out var value3)) - { - JsonData jsonData3 = jsonData["append_mission_info_list"]; - Dictionary dictionary = new Dictionary(); - LotteryMissionList = new List(); - for (int j = 0; j < jsonData3.Count; j++) - { - LotteryMissionData lotteryMissionData = new LotteryMissionData(jsonData3[j], responseData["data_headers"]["servertime"].ToDouble()); - LotteryMissionList.Add(lotteryMissionData); - dictionary.Add(lotteryMissionData.MissionId, lotteryMissionData); - } - MissionRewardList = new List(); - for (int k = 0; k < value3.Count; k++) - { - LotteryRewardData lotteryRewardData = new LotteryRewardData(value3[k]); - MissionRewardList.Add(lotteryRewardData); - lotteryRewardData.MissionData = dictionary[lotteryRewardData.MissionId]; - } - } - if (jsonData.TryGetValue("announce_id", out var value4)) - { - AnnounceId = value4.ToString(); - } - } - } - - public class LotteryInfoTaskParam : BaseParam - { - public int campaign_id; - } - - public LotteryInfoData Result { get; private set; } - - public LotteryInfoTask() - { - base.type = ApiType.Type.LotteryInfo; - } - - public void SetParameter(int campaign_id) - { - LotteryInfoTaskParam lotteryInfoTaskParam = new LotteryInfoTaskParam(); - lotteryInfoTaskParam.campaign_id = campaign_id; - base.Params = lotteryInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Result = new LotteryInfoData(base.ResponseData); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryLoadTaskData.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryLoadTaskData.cs index 816bec60..a77fdb7f 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryLoadTaskData.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryLoadTaskData.cs @@ -12,54 +12,15 @@ public class LotteryLoadTaskData private DateTime EndTime { get; set; } - private DateTime CloseTime { get; set; } - private int ReceiveServerTime { get; set; } private double ReceiveSinceStartUpTime { get; set; } - public bool IsExistReward { get; private set; } - - public static LotteryLoadTaskData Parse(JsonData json) - { - LotteryLoadTaskData lotteryLoadTaskData = new LotteryLoadTaskData(); - if (json["data"].Keys.Contains("lottery_period_info")) - { - JsonData jsonData = json["data"]["lottery_period_info"]; - if (jsonData != null) - { - DateTime startTime = DateTime.Parse(jsonData["start_time"].ToString()); - DateTime endTime = DateTime.Parse(jsonData["end_time"].ToString()); - lotteryLoadTaskData.IsEnable = true; - lotteryLoadTaskData.StartTime = startTime; - lotteryLoadTaskData.EndTime = endTime; - lotteryLoadTaskData.CloseTime = DateTime.Parse(jsonData["close_time"].ToString()); - lotteryLoadTaskData.ReceiveServerTime = json["data_headers"]["servertime"].ToInt(); - lotteryLoadTaskData.ReceiveSinceStartUpTime = Time.realtimeSinceStartup; - lotteryLoadTaskData.IsExistReward = jsonData["has_reward"].ToBoolean(); - } - else - { - lotteryLoadTaskData.IsEnable = false; - } - } - else - { - lotteryLoadTaskData.IsEnable = false; - } - return lotteryLoadTaskData; - } - public bool IsCampaignTimeNow() { return IsTimeEnablePeriod(StartTime, EndTime); } - public bool IsReceiveTimeNow() - { - return IsTimeEnablePeriod(StartTime, CloseTime); - } - private bool IsTimeEnablePeriod(DateTime start, DateTime end) { if (!IsEnable) diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionData.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionData.cs deleted file mode 100644 index de445cbc..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionData.cs +++ /dev/null @@ -1,57 +0,0 @@ -using LitJson; - -namespace Wizard.Lottery; - -public class LotteryMissionData -{ - public int MissionId { get; private set; } - - public string MissionTitle { get; private set; } - - public UserGoods.Type UserGoodsType { get; private set; } - - public int ItemId { get; private set; } - - public int ItemCount { get; private set; } - - public RemainTime StartTime { get; private set; } - - public RemainTime EndTime { get; private set; } - - public int MissionCurrent { get; private set; } - - public int MissionMax { get; private set; } - - public bool IsCleared { get; private set; } - - public bool IsTimeOver { get; private set; } - - public float MissionRatio - { - get - { - if (MissionMax == 0) - { - return 0f; - } - return (float)MissionCurrent / (float)MissionMax; - } - } - - public LotteryMissionData(JsonData json, double serverTime) - { - MissionId = json["mission_id"].ToInt(); - ItemId = json["reward_detail_id"].ToInt(); - UserGoodsType = (UserGoods.Type)json["reward_type"].ToInt(); - ItemCount = json["reward_number"].ToInt(); - MissionTitle = json["mission_name"].ToString(); - MissionCurrent = json["total_count"].ToInt(); - MissionMax = json["require_number"].ToInt(); - IsCleared = json["is_achieved"].ToInt() == 1; - IsTimeOver = json["is_failed"].ToInt() == 1; - string endTime = ConvertTime.UnixTimeToDateTime(json["start_time"].ToInt()).ToString(); - string endTime2 = ConvertTime.UnixTimeToDateTime(json["end_time"].ToInt()).ToString(); - StartTime = new RemainTime(endTime, serverTime); - EndTime = new RemainTime(endTime2, serverTime); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionDialog.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionDialog.cs deleted file mode 100644 index 49eb2208..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionDialog.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard.Lottery; - -public class LotteryMissionDialog : MonoBehaviour -{ - [SerializeField] - private GameObject _lotteryMissionItemPrefab; - - [SerializeField] - private UIGrid _grid; - - public static void Create(GameObject prefab, LotteryInfoTask.LotteryInfoData lotteryData) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - LotteryMissionDialog component = Object.Instantiate(prefab).GetComponent(); - dialogBase.SetObj(component.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Mission_0075")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - component.Initialize(lotteryData); - } - - private void Initialize(LotteryInfoTask.LotteryInfoData lotteryData) - { - List list = new List(lotteryData.LotteryMissionList); - if (lotteryData.BigChanceMission != null) - { - list.Add(lotteryData.BigChanceMission); - } - for (int i = 0; i < list.Count; i++) - { - LotteryMissionData lotteryData2 = list[i]; - bool flag = i + 1 == list.Count; - AchievementWindowBase component = NGUITools.AddChild(_grid.gameObject, _lotteryMissionItemPrefab).GetComponent(); - component.gameObject.SetActive(value: true); - component.SetLottery(lotteryData2, !flag); - } - _grid.Reposition(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionTreasureBox.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionTreasureBox.cs deleted file mode 100644 index 289c157d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryMissionTreasureBox.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using UnityEngine; - -namespace Wizard.Lottery; - -public class LotteryMissionTreasureBox : LotteryTreasureBox -{ - [SerializeField] - private UILabel _categoryLabel; - - [SerializeField] - protected UISprite _categoryLabelLine; - - public void Initialize(LotteryRewardData data, string categoryText, Action onClickEvent) - { - _categoryLabel.text = categoryText; - SetData(data, string.Empty, onClickEvent); - switch (data.state) - { - case LotteryRewardData.eLotteryRewardState.Applied: - case LotteryRewardData.eLotteryRewardState.Received: - case LotteryRewardData.eLotteryRewardState.NotAchieved: - UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: true); - break; - default: - UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: false); - break; - case LotteryRewardData.eLotteryRewardState.NotReceived: - break; - } - if (data.MissionData.IsTimeOver) - { - UIManager.SetObjectToGrey(_spriteTreasureImage.gameObject, b: true); - } - } - - protected override void UpdateStatusText() - { - LotteryRewardData.eLotteryRewardState state = _lotteryRewardData.state; - base.UpdateStatusText(); - if (state == LotteryRewardData.eLotteryRewardState.NotAchieved) - { - _labelStatus.text = Data.SystemText.Get("Mission_0059"); - } - if (_lotteryRewardData.MissionData != null && _lotteryRewardData.MissionData.IsTimeOver) - { - _labelStatus.text = Data.SystemText.Get("Mission_0078"); - } - } - - public virtual void SetCategoryLabelLineWitdh(int width) - { - _categoryLabelLine.width = width; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryPage.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryPage.cs deleted file mode 100644 index 6fb76b22..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryPage.cs +++ /dev/null @@ -1,859 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Bingo; - -namespace Wizard.Lottery; - -public class LotteryPage : UIBase -{ - private enum BoxType - { - NORMAL, - DOUBLE_CHANCE, - MISSION, - BIG_CHANCE - } - - public struct LayoutData - { - public Vector3 BackGroundPosition { get; private set; } - - public int BackGroundWidth { get; private set; } - - public Vector3 GridPosition { get; private set; } - - public Vector2 GridInterval { get; private set; } - - public bool EnableCategoryLabel { get; private set; } - - public Vector2 MissionBoxBackgroundInterval { get; private set; } - - public Vector2 MisshonBoxBackgroundPosition { get; private set; } - - public bool UseDefaultTreasureBox { get; private set; } - - public bool UseDefaultTodayEffect { get; private set; } - - public LayoutData(Vector3 backgroundPosition, int backGroundWidth, Vector3 gridPosition, Vector2 gridInterval, Vector2 missionBoxBackgroundInterval, Vector2 misshonBoxBackgroundPosition, bool enableCategoryLabel, bool useDefaultTreasureBox, bool useDefaultTodayEffect) - { - BackGroundPosition = backgroundPosition; - BackGroundWidth = backGroundWidth; - GridPosition = gridPosition; - GridInterval = gridInterval; - EnableCategoryLabel = enableCategoryLabel; - UseDefaultTreasureBox = useDefaultTreasureBox; - UseDefaultTodayEffect = useDefaultTodayEffect; - MissionBoxBackgroundInterval = missionBoxBackgroundInterval; - MisshonBoxBackgroundPosition = misshonBoxBackgroundPosition; - } - } - - private readonly Vector3[] MISSION_TREASURE_BOX_POSITION = new Vector3[4] - { - new Vector3(-88f, 46f, 0f), - new Vector3(90f, 46f, 0f), - new Vector3(-88f, -73f, 0f), - new Vector3(90f, -73f, 0f) - }; - - private readonly Vector3[] MISSION_TREASURE_BOX_POSITION_WITH_BIG_CHANCE = new Vector3[3] - { - new Vector3(-160f, -14f, 0f), - new Vector3(0f, -14f, 0f), - new Vector3(160f, -14f, 0f) - }; - - private readonly Vector3[] MISSION_TREASURE_BOX_POSITION_6TH_ANNIVERSARY = new Vector3[10] - { - new Vector3(-276f, 54f, 0f), - new Vector3(-138f, 54f, 0f), - new Vector3(0f, 54f, 0f), - new Vector3(138f, 54f, 0f), - new Vector3(276f, 54f, 0f), - new Vector3(-276f, -72f, 0f), - new Vector3(-138f, -72f, 0f), - new Vector3(0f, -72f, 0f), - new Vector3(138f, -72f, 0f), - new Vector3(276f, -72f, 0f) - }; - - private readonly string[] MISSION_TREASURE_BOX_CATEGORY_TEXT = new string[4] { "Story_0052", "Mission_0079", "MyPage_0009", "MyPage_0011" }; - - private readonly string[] MISSION_BIGCHANCE_TREASURE_BOX_CATEGORY_TEXT = new string[3] { "Mission_0093", "Mission_0094", "Mission_0095" }; - - private readonly string[] MISSION_6TH_ANNIVERSARY_TEXT = new string[10] { "Mission_0099", "Mission_0100", "Mission_0101", "Mission_0102", "Mission_0103", "Mission_0104", "Mission_0105", "Mission_0106", "Mission_0107", "Mission_0108" }; - - private const int SIXTH_ANNIVERSARY_ID = 11; - - private const int SEVENTH_ANNIVERSARY_ID = 13; - - private const int END_OF_YEAR_CAMPAIGN_ID = 14; - - private const int EIGHT_ANNIVERSARY_ID = 15; - - public const string TEXTURE_NAME_RECEIVED_LOTTERY_BOX = "thumbnail_lottery"; - - public const string TEXTURE_NAME_BLANK = "thumbnail_blank"; - - private const string TEXTURE_NAME_W_CHANCE_TITLE = "lottery_w_chance"; - - private const string TEXTURE_NAME_BIG_CHANCE_TITLE = "campaign_title_03"; - - private const string TODAY_EFFECT_DEFAULT = "cmn_login_icon_3"; - - private const string TODAY_EFFECT_SMALL = "cmn_campaign_icon_1"; - - public const string TEXTURE_LOTTERY_TICKET = "box_lottery_01_close"; - - public const string TEXTURE_LOTTERY_TICKET2 = "box_lottery_02_close"; - - public const string SE_BOX_OPEN_LOTTERY_TICKET_01 = "se_sys_box_open_lottery_ticket_01"; - - private Dictionary LAYOUT_SETTING = new Dictionary - { - { - 10, - new LayoutData(new Vector3(-184f, -50f, 0f), 912, new Vector3(0f, 0f, 0f), new Vector2(147f, 121f), new Vector2(349f, 254f), new Vector2(138f, -50f), enableCategoryLabel: false, useDefaultTreasureBox: true, useDefaultTodayEffect: true) - }, - { - 12, - new LayoutData(new Vector3(-184f, -50f, 0f), 912, new Vector3(0f, 0f, 0f), new Vector2(147f, 121f), new Vector2(349f, 254f), new Vector2(138f, -50f), enableCategoryLabel: false, useDefaultTreasureBox: false, useDefaultTodayEffect: true) - }, - { - 14, - new LayoutData(new Vector3(-177f, -50f, 0f), 1059, new Vector3(5f, -5f, 0f), new Vector2(145f, 118f), new Vector2(349f, 254f), new Vector2(138f, -50f), enableCategoryLabel: false, useDefaultTreasureBox: true, useDefaultTodayEffect: true) - }, - { - 0, - new LayoutData(new Vector3(0f, 0f, 0f), 623, new Vector3(0f, 0f, 0f), new Vector2(0f, 0f), new Vector2(912f, 285f), new Vector2(-180f, -55f), enableCategoryLabel: true, useDefaultTreasureBox: true, useDefaultTodayEffect: false) - } - }; - - private Dictionary LAYOUT_SETTING_BIG_CHANCE = new Dictionary { - { - 10, - new LayoutData(new Vector3(-431f, -50f, 0f), 610, new Vector3(0f, -14f, 0f), new Vector2(110f, 118f), new Vector2(488f, 133f), new Vector2(130f, 10f), enableCategoryLabel: true, useDefaultTreasureBox: true, useDefaultTodayEffect: false) - } }; - - [SerializeField] - private UITexture _textureTopImage; - - [SerializeField] - private UILabel _labelCampaignPeriod; - - [SerializeField] - private UITexture _backGround; - - [SerializeField] - private GameObject _originalTreasureBox; - - [SerializeField] - private GameObject _originalTreasureBox2; - - [SerializeField] - private UIGrid _gridTreasureBox; - - [SerializeField] - private LotterySpecialRewardDialog _prefabSpecialRewardDialog; - - [SerializeField] - private LotteryTreasureBox _doubleChanceTreasureBox; - - [SerializeField] - private LotteryTreasureBox _bigChanceTreasureBox; - - [SerializeField] - private UITexture _textureWChanceTitle; - - [SerializeField] - private UISprite _treasureBoxBackGround; - - [SerializeField] - private GameObject _missionListRoot; - - [SerializeField] - private GameObject _missionListParent; - - [SerializeField] - private GameObject _missionListTreasureBoxOriginal; - - [SerializeField] - private UIButton _missionFactorButton; - - [SerializeField] - private UISprite _missionBoxBackGround; - - [SerializeField] - private GameObject _missionDialogPrefab; - - [SerializeField] - private GameObject _rewardSiteButton; - - [SerializeField] - private GameObject _categoryLabel; - - [SerializeField] - private GameObject _itemListRoot; - - [SerializeField] - private GameObject _clickProtectCollider; - - private List _loadedResourceList = new List(); - - private Dictionary GRID_PER_LINE = new Dictionary - { - { 8, 4 }, - { 10, 5 }, - { 12, 6 }, - { 14, 7 }, - { 0, 0 } - }; - - private GameObject _boxOpenEffectObj; - - private GameObject _treasureEffectObj; - - private string _infoSiteUrl = string.Empty; - - private GameObject _effectCurrentBox; - - private bool _isPlayBoxOpenEffect; - - private static int _lotteryNo; - - private bool _isBigChance; - - private DateTime _bigChanceOpenTime; - - private readonly bool IS_ONE_MILLION_CAMPAIGN; - - public static void ChangeSceneLotteryPage(int no) - { - _lotteryNo = no; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.LotteryPage); - } - - private static bool Is6thAnniversary() - { - return _lotteryNo == 11; - } - - private static bool Is7thAnniversary() - { - return _lotteryNo == 13; - } - - private static bool Is8thAnniversary() - { - return _lotteryNo == 15; - } - - public override void onFirstStart() - { - base.IsShowFooterMenu = true; - base.onFirstStart(); - } - - public void OnClickInfoSiteBtn() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.ShowDialogUrl(Data.SystemText.Get("Mission_0049"), _infoSiteUrl); - } - - protected override void onOpen() - { - base.onOpen(); - _clickProtectCollider.SetActive(value: false); - string titleMsg = Data.SystemText.Get("Mission_0048"); - UIManager.GetInstance().CreateTopBar(base.gameObject, titleMsg, UIManager.ViewScene.MyPage).gameObject.layer = LayerMask.NameToLayer("MyPage"); - InitFooter(); - LotteryInfoTask task = new LotteryInfoTask(); - task.SetParameter(_lotteryNo); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Init(task.Result); - })); - } - - protected override void onClose() - { - base.onClose(); - UnloadResources(); - UIManager.GetInstance()._Footer.CancelOverwriteLabelColors(); - } - - private void Init(LotteryInfoTask.LotteryInfoData lotteryData) - { - _isBigChance = lotteryData.BigChanceMission != null && lotteryData.BigChanceReward != null; - _bigChanceOpenTime = lotteryData.BigChanceOpenTime; - string text = ConvertTime.ToLocal(lotteryData.StartTime, lotteryData.EndTime); - string text2 = ConvertTime.ToLocal(lotteryData.CloseTime); - if (Is6thAnniversary() || Is7thAnniversary() || Is8thAnniversary() || _lotteryNo == 14) - { - string text3 = ConvertTime.ToLocal(lotteryData.EndTime); - string text4 = ConvertTime.ToLocal(lotteryData.OpenTime); - string text5 = ConvertTime.ToLocal(lotteryData.CloseTime); - _labelCampaignPeriod.text = Data.SystemText.Get("Mission_0097", text3, text4, text5); - } - else - { - _labelCampaignPeriod.text = Data.SystemText.Get("Mission_0057", text, text2); - } - if (lotteryData.MissionRewardList != null && lotteryData.MissionRewardList.Count > 0) - { - _missionFactorButton.onClick.Add(new EventDelegate(delegate - { - OnClickMissionFactorButton(lotteryData); - })); - } - else - { - _missionFactorButton.gameObject.SetActive(value: false); - Vector3 localPosition = _rewardSiteButton.transform.localPosition; - localPosition.y = 0f; - _rewardSiteButton.transform.localPosition = localPosition; - } - _infoSiteUrl = lotteryData.InfoUrl; - _gridTreasureBox.maxPerLine = GRID_PER_LINE[lotteryData.LotteryRewardList.Count]; - bool useDefaultTreasureBox = true; - Dictionary dictionary = LAYOUT_SETTING; - if (_isBigChance) - { - dictionary = LAYOUT_SETTING_BIG_CHANCE; - } - if (dictionary.TryGetValue(lotteryData.LotteryRewardList.Count, out var value)) - { - _treasureBoxBackGround.width = value.BackGroundWidth; - _treasureBoxBackGround.transform.localPosition = value.BackGroundPosition; - _gridTreasureBox.transform.localPosition = value.GridPosition; - _gridTreasureBox.cellWidth = value.GridInterval.x; - _gridTreasureBox.cellHeight = value.GridInterval.y; - _categoryLabel.SetActive(value.EnableCategoryLabel); - useDefaultTreasureBox = value.UseDefaultTreasureBox; - _missionBoxBackGround.width = (int)value.MissionBoxBackgroundInterval.x; - _missionBoxBackGround.height = (int)value.MissionBoxBackgroundInterval.y; - _missionBoxBackGround.transform.localPosition = value.MisshonBoxBackgroundPosition; - } - StartCoroutine(LoadResources(lotteryData, delegate - { - CreateTreasureBoxGrid(lotteryData.LotteryRewardList, useDefaultTreasureBox); - if (lotteryData.DoubleChanceReward != null) - { - CreateDoubleChanceTreasureBox(lotteryData.DoubleChanceReward); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("lottery_w_chance", ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - _textureWChanceTitle.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath) as Texture; - } - else - { - _doubleChanceTreasureBox.gameObject.SetActive(value: false); - } - if (_isBigChance) - { - CreateBigChanceTreasureBox(lotteryData.BigChanceMission, lotteryData.BigChanceReward); - } - else - { - _bigChanceTreasureBox.gameObject.SetActive(value: false); - } - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(lotteryData.BannerFileName, ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - _textureTopImage.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath2) as Texture; - string assetTypePath3 = Toolbox.ResourcesManager.GetAssetTypePath(lotteryData.BackGroundFileName, ResourcesManager.AssetLoadPathType.Background, isfetch: true); - _backGround.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath3) as Texture; - InitializeMissionList(lotteryData); - UIManager.GetInstance().OnReadyViewScene(isFadein: true); - })); - AddSeCueSheet(); - UIButton component = _rewardSiteButton.GetComponent(); - component.onClick.Clear(); - component.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - OpenDetail(lotteryData); - })); - } - - private void InitializeMissionList(LotteryInfoTask.LotteryInfoData lotteryData) - { - if (lotteryData.MissionRewardList == null || lotteryData.MissionRewardList.Count == 0) - { - _missionListRoot.SetActive(value: false); - return; - } - for (int i = 0; i < lotteryData.MissionRewardList.Count; i++) - { - LotteryRewardData data = lotteryData.MissionRewardList[i]; - string categoryText = (_isBigChance ? Data.SystemText.Get(MISSION_BIGCHANCE_TREASURE_BOX_CATEGORY_TEXT[i]) : (Is6thAnniversary() ? Data.SystemText.Get(MISSION_6TH_ANNIVERSARY_TEXT[i]) : Data.SystemText.Get(MISSION_TREASURE_BOX_CATEGORY_TEXT[i]))); - GameObject gameObject = NGUITools.AddChild(_missionListParent.gameObject, _missionListTreasureBoxOriginal); - gameObject.transform.localPosition = (_isBigChance ? MISSION_TREASURE_BOX_POSITION_WITH_BIG_CHANCE[i] : (Is6thAnniversary() ? MISSION_TREASURE_BOX_POSITION_6TH_ANNIVERSARY[i] : MISSION_TREASURE_BOX_POSITION[i])); - LotteryMissionTreasureBox box = gameObject.GetComponent(); - box.Initialize(data, categoryText, delegate - { - OnClickTreasureBox(box, BoxType.MISSION); - }); - if (Is6thAnniversary()) - { - box.SetCategoryLabelLineWitdh(95); - } - } - _missionListTreasureBoxOriginal.SetActive(value: false); - } - - private IEnumerator LoadResources(LotteryInfoTask.LotteryInfoData lotteryInfoData, Action callBack) - { - ResourcesManager resMgr = Toolbox.ResourcesManager; - List assetList = new List(); - for (int i = 0; i < lotteryInfoData.LotteryRewardList.Count; i++) - { - if (lotteryInfoData.LotteryRewardList[i].NormalGotRewardList.Count > 0) - { - LotteryRewardData.NormalGotRewardData normalGotRewardData = lotteryInfoData.LotteryRewardList[i].NormalGotRewardList[0]; - string assetTypePath = resMgr.GetAssetTypePath(normalGotRewardData.TextureName, ResourcesManager.AssetLoadPathType.Item); - if (!assetList.Contains(assetTypePath) && !_loadedResourceList.Contains(assetTypePath)) - { - assetList.Add(assetTypePath); - } - } - } - if (lotteryInfoData.DoubleChanceReward != null) - { - List normalGotRewardList = lotteryInfoData.DoubleChanceReward.RewardData.NormalGotRewardList; - if (normalGotRewardList.Count > 0) - { - string assetTypePath2 = resMgr.GetAssetTypePath(normalGotRewardList[0].TextureName, ResourcesManager.AssetLoadPathType.Item); - if (!assetList.Contains(assetTypePath2) && !_loadedResourceList.Contains(assetTypePath2)) - { - assetList.Add(assetTypePath2); - } - } - assetList.Add(resMgr.GetAssetTypePath("lottery_w_chance", ResourcesManager.AssetLoadPathType.Lottery)); - } - if (lotteryInfoData.BigChanceReward != null) - { - List normalGotRewardList2 = lotteryInfoData.BigChanceReward.NormalGotRewardList; - if (normalGotRewardList2.Count > 0) - { - string assetTypePath3 = resMgr.GetAssetTypePath(normalGotRewardList2[0].TextureName, ResourcesManager.AssetLoadPathType.Item); - if (!assetList.Contains(assetTypePath3) && !_loadedResourceList.Contains(assetTypePath3)) - { - assetList.Add(assetTypePath3); - } - } - assetList.Add(resMgr.GetAssetTypePath("campaign_title_03", ResourcesManager.AssetLoadPathType.Arena)); - } - if (lotteryInfoData.LotteryMissionList != null) - { - foreach (LotteryMissionData lotteryMission in lotteryInfoData.LotteryMissionList) - { - string userGoodsImageName = UserGoods.GetUserGoodsImageName(lotteryMission.UserGoodsType, lotteryMission.ItemId); - string assetTypePath4 = resMgr.GetAssetTypePath(userGoodsImageName, ResourcesManager.AssetLoadPathType.Item); - assetList.Add(assetTypePath4); - } - } - for (int j = 0; j < lotteryInfoData.MissionRewardList.Count; j++) - { - if (lotteryInfoData.MissionRewardList[j].NormalGotRewardList.Count > 0) - { - LotteryRewardData.NormalGotRewardData normalGotRewardData2 = lotteryInfoData.MissionRewardList[j].NormalGotRewardList[0]; - string assetTypePath5 = resMgr.GetAssetTypePath(normalGotRewardData2.TextureName, ResourcesManager.AssetLoadPathType.Item); - if (!assetList.Contains(assetTypePath5) && !_loadedResourceList.Contains(assetTypePath5)) - { - assetList.Add(assetTypePath5); - } - } - } - assetList.Add(resMgr.GetAssetTypePath(lotteryInfoData.BannerFileName, ResourcesManager.AssetLoadPathType.Lottery)); - assetList.Add(resMgr.GetAssetTypePath("thumbnail_lottery", ResourcesManager.AssetLoadPathType.Lottery)); - assetList.Add(resMgr.GetAssetTypePath("thumbnail_blank", ResourcesManager.AssetLoadPathType.Lottery)); - assetList.Add(resMgr.GetAssetTypePath(lotteryInfoData.BackGroundFileName, ResourcesManager.AssetLoadPathType.Background)); - assetList.Add(resMgr.GetAssetTypePath("box_lottery_01_close", ResourcesManager.AssetLoadPathType.Lottery)); - assetList.Add(resMgr.GetAssetTypePath("box_lottery_02_close", ResourcesManager.AssetLoadPathType.Lottery)); - string effectPath = "cmn_login_icon_3"; - Dictionary dictionary = LAYOUT_SETTING; - if (_isBigChance) - { - dictionary = LAYOUT_SETTING_BIG_CHANCE; - } - if (dictionary.TryGetValue(lotteryInfoData.LotteryRewardList.Count, out var value) && !value.UseDefaultTodayEffect) - { - effectPath = "cmn_campaign_icon_1"; - } - assetList.Add(resMgr.GetAssetTypePath(effectPath, ResourcesManager.AssetLoadPathType.Effect2D)); - if (assetList.Count > 0) - { - yield return StartCoroutine(resMgr.LoadAssetGroupAsync(assetList, null)); - _loadedResourceList.AddRange(assetList); - } - _effectCurrentBox = UnityEngine.Object.Instantiate(resMgr.LoadObject(resMgr.GetAssetTypePath(effectPath, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true))) as GameObject; - _loadedResourceList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_effectCurrentBox, delegate - { - _effectCurrentBox.gameObject.SetActive(value: false); - callBack.Call(); - })); - } - - private void UnloadResources() - { - if (_loadedResourceList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private void CreateTreasureBoxGrid(List rewardDataList, bool useDefaultTeasureBox) - { - GameObject prefab = (useDefaultTeasureBox ? _originalTreasureBox : _originalTreasureBox2); - for (int i = 0; i < rewardDataList.Count; i++) - { - LotteryRewardData lotteryRewardData = rewardDataList[i]; - LotteryTreasureBox treasureBox = NGUITools.AddChild(_gridTreasureBox.gameObject, prefab).GetComponent(); - string infoText = Data.SystemText.Get("Mission_0056", (i + 1).ToString()); - treasureBox.SetData(lotteryRewardData, infoText, delegate - { - OnClickTreasureBox(treasureBox, BoxType.NORMAL); - }); - if (lotteryRewardData.IsCurrent) - { - PlayCurrentRewardEffect(treasureBox.gameObject); - } - } - if (rewardDataList.Count <= 0) - { - _itemListRoot.SetActive(value: false); - } - _originalTreasureBox.gameObject.SetActive(value: false); - _originalTreasureBox2.gameObject.SetActive(value: false); - _gridTreasureBox.repositionNow = true; - } - - private void CreateDoubleChanceTreasureBox(DoubleChanceData doubleChanceData) - { - string infoText = Data.SystemText.Get("Mission_0058", doubleChanceData.RequireNum.ToString()); - _doubleChanceTreasureBox.SetData(doubleChanceData.RewardData, infoText, delegate - { - OnClickTreasureBox(_doubleChanceTreasureBox, BoxType.DOUBLE_CHANCE); - }); - } - - private void CreateBigChanceTreasureBox(LotteryMissionData bigChanceMissionData, LotteryRewardData bigChanceReward) - { - string infoText = ""; - if (bigChanceReward.state == LotteryRewardData.eLotteryRewardState.Unapplied) - { - infoText = Data.SystemText.Get("Mission_0088", bigChanceMissionData.MissionCurrent.ToString(), bigChanceMissionData.MissionMax.ToString()); - } - else if (bigChanceReward.state == LotteryRewardData.eLotteryRewardState.Applied || bigChanceReward.state == LotteryRewardData.eLotteryRewardState.WaitResult) - { - string text = ConvertTime.ToLocal(_bigChanceOpenTime); - infoText = Data.SystemText.Get("Mission_0090", text); - } - _bigChanceTreasureBox.SetData(bigChanceReward, infoText, delegate - { - OnClickTreasureBox(_bigChanceTreasureBox, BoxType.BIG_CHANCE); - }); - } - - private void PlayCurrentRewardEffect(GameObject boxObj) - { - _effectCurrentBox.transform.parent = boxObj.transform; - _effectCurrentBox.transform.localPosition = Vector3.zero; - _effectCurrentBox.gameObject.SetActive(value: true); - } - - private void OnClickTreasureBox(LotteryTreasureBox treasureBox, BoxType boxType) - { - if (_isPlayBoxOpenEffect) - { - return; - } - LotteryRewardData lotteryRewardData = treasureBox.LotteryRewardData; - if (lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotReceived) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_LOTTERY_BOX_TOUCH); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - switch (boxType) - { - case BoxType.NORMAL: - case BoxType.MISSION: - { - LotteryReceiveTask task3 = new LotteryReceiveTask(); - task3.SetParameter(lotteryRewardData.MissionId); - StartCoroutine(Toolbox.NetworkManager.Connect(task3, delegate - { - OnSuccessLotteryReceive(treasureBox, task3.Result); - })); - break; - } - case BoxType.DOUBLE_CHANCE: - { - LotteryReceiveDoubleChanceTask task2 = new LotteryReceiveDoubleChanceTask(); - task2.SetParameter(_lotteryNo, lotteryRewardData.MissionId); - StartCoroutine(Toolbox.NetworkManager.Connect(task2, delegate - { - OnSuccessLotteryReceive(treasureBox, task2.Result); - })); - break; - } - case BoxType.BIG_CHANCE: - { - LotteryReceiveBigChanceTask task = new LotteryReceiveBigChanceTask(); - task.SetParameter(_lotteryNo, lotteryRewardData.MissionId); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - OnSuccessLotteryReceive(treasureBox, task.Result); - })); - break; - } - } - } - else if (lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Received && lotteryRewardData.IsSpecial) - { - ShowReceivedDialog(lotteryRewardData); - } - } - - private void OnSuccessLotteryReceive(LotteryTreasureBox treasureBox, LotteryRewardData receiveRewardData) - { - SetProtectColliderEnable(enableProtect: true); - List assetList = new List(); - List normalGotRewardList = receiveRewardData.NormalGotRewardList; - for (int i = 0; i < normalGotRewardList.Count; i++) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(normalGotRewardList[i].TextureName, ResourcesManager.AssetLoadPathType.Item); - if (!assetList.Contains(assetTypePath) && !_loadedResourceList.Contains(assetTypePath)) - { - assetList.Add(assetTypePath); - } - } - bool isBigChanceTreasureBox = treasureBox as LotteryBigChanceTreasureBox != null; - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(assetList, delegate - { - _loadedResourceList.AddRange(assetList); - StartCoroutine(RunOpenBoxEffect(receiveRewardData.DialogMessage, isBigChanceTreasureBox, delegate - { - receiveRewardData.UpdateHaveUserGoodsByNormalRwardList(); - treasureBox.UpdateData(receiveRewardData); - ShowReceivedDialog(receiveRewardData); - })); - })); - } - - private void SetProtectColliderEnable(bool enableProtect) - { - _clickProtectCollider.SetActive(enableProtect); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = !enableProtect; - } - - private void ShowReceivedDialog(LotteryRewardData lotteryRewardData) - { - SetProtectColliderEnable(enableProtect: false); - if (lotteryRewardData.IsSpecial && IS_ONE_MILLION_CAMPAIGN) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(lotteryRewardData.DialogMessage); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.OnClose = HideBoxEffect; - GameObject gameObject = UnityEngine.Object.Instantiate(_prefabSpecialRewardDialog.gameObject); - dialogBase.SetObj(gameObject); - gameObject.GetComponent().Init(lotteryRewardData); - return; - } - DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(); - dialogBase2.SetSize(DialogBase.Size.M); - dialogBase2.SetTitleLabel(lotteryRewardData.DialogMessage); - dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase2.SetLayer("Loading"); - dialogBase2.OnClose = HideBoxEffect; - GameObject gameObject2 = UnityEngine.Object.Instantiate(UIManager.GetInstance().GetRewardDialogPrefab().gameObject); - dialogBase2.SetObj(gameObject2); - RewardBase component = gameObject2.GetComponent(); - for (int i = 0; i < lotteryRewardData.NormalGotRewardList.Count; i++) - { - LotteryRewardData.NormalGotRewardData normalGotRewardData = lotteryRewardData.NormalGotRewardList[i]; - NguiObjs nguiObjs = component.AddReward(normalGotRewardData.RewardType, normalGotRewardData.RewardId, normalGotRewardData.RewardGotNum); - if (lotteryRewardData.LotteryId > 0 && lotteryRewardData.Description.IsNotNullOrEmpty()) - { - nguiObjs.labels[0].text = lotteryRewardData.Description; - } - } - component.EndCreate(); - if (!string.IsNullOrEmpty(lotteryRewardData.PrizeMessage)) - { - component.SetTitleLabel(isEnabled: true, lotteryRewardData.PrizeMessage); - } - else - { - component.SetTitleLabel(isEnabled: false, ""); - } - } - - private IEnumerator RunOpenBoxEffect(string message, bool isBigChanceTreasureBox, Action endAction) - { - _isPlayBoxOpenEffect = true; - UIManager.GetInstance().OpenNotTouch(); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; - _boxOpenEffectObj = NGUITools.AddChild(base.gameObject, Resources.Load("UI/layoutParts/RankWinnerRewardResultPanel") as GameObject); - NguiObjs component = _boxOpenEffectObj.GetComponent(); - UISprite bg = component.sprites[0]; - UISprite window = component.sprites[1]; - UISprite uISprite = component.sprites[2]; - UIWidget box = uISprite; - if (isBigChanceTreasureBox) - { - uISprite.spriteName = "box_2pick_06_close"; - UIManager.GetInstance().AttachAtlas(uISprite.gameObject); - } - else - { - uISprite.gameObject.SetActive(value: false); - UITexture uITexture = component.textures[0]; - uITexture.gameObject.SetActive(value: true); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("box_lottery_02_close", ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - uITexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath) as Texture; - box = uITexture; - } - UILabel label = component.labels[0]; - label.text = message; - UIPanel panel = _boxOpenEffectObj.GetComponent(); - panel.alpha = 0f; - string loadEffectName = (isBigChanceTreasureBox ? "cmn_arena_treasure_7" : "cmn_arena_treasure_6"); - List loadList = new List { Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D) }; - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _loadedResourceList.AddRange(loadList); - _treasureEffectObj = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _treasureEffectObj.transform.parent = _boxOpenEffectObj.transform; - _loadedResourceList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_treasureEffectObj, null)); - _boxOpenEffectObj.SetLayer(LayerMask.NameToLayer("MyPage"), isSetChildren: true); - bg.alpha = 0f; - box.alpha = 0f; - label.alpha = 0f; - panel.alpha = 1f; - TweenAlpha.Begin(bg.gameObject, 0.5f, 0.65f); - TweenAlpha.Begin(label.gameObject, 0.5f, 1f); - TweenAlpha.Begin(box.gameObject, 0.5f, 1f); - label.transform.localPosition = new Vector3(100f, 0f, 0f); - window.transform.localScale = new Vector3(1f, 0.01f, 1f); - box.transform.localPosition = new Vector3(180f, 0f, 0f); - iTween.MoveTo(label.gameObject, iTween.Hash("x", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(window.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.MoveTo(box.gameObject, iTween.Hash("y", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.8f); - TweenAlpha.Begin(label.gameObject, 0.5f, 0f); - iTween.MoveTo(box.gameObject, iTween.Hash("x", 0f, "time", 0.7f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_sys_box_open_lottery_ticket_01", "se_sys_box_open_lottery_ticket_01", 0f, 0L); - yield return new WaitForSeconds(1f); - _treasureEffectObj.transform.localPosition = box.transform.localPosition; - _treasureEffectObj.transform.localScale = Vector3.one * 320f * 1.75f; - _treasureEffectObj.SetActive(value: true); - box.gameObject.SetActive(value: false); - yield return new WaitForSeconds(1.2f); - endAction.Call(); - UIManager.GetInstance().offNotTouch(); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - } - - private void HideBoxEffect() - { - if (_isPlayBoxOpenEffect) - { - StartCoroutine(RunHideBoxEffect()); - } - } - - private IEnumerator RunHideBoxEffect() - { - NguiObjs component = _boxOpenEffectObj.GetComponent(); - UISprite uISprite = component.sprites[0]; - UISprite obj = component.sprites[1]; - TweenAlpha.Begin(uISprite.gameObject, 0.3f, 0f); - TweenAlpha.Begin(obj.gameObject, 0.3f, 0f); - _treasureEffectObj.SetActive(value: false); - yield return new WaitForSeconds(0.3f); - _boxOpenEffectObj.SetActive(value: false); - UnityEngine.Object.Destroy(_boxOpenEffectObj); - _isPlayBoxOpenEffect = false; - } - - private void OnClickMissionFactorButton(LotteryInfoTask.LotteryInfoData lotteryData) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - LotteryMissionDialog.Create(_missionDialogPrefab, lotteryData); - } - - private void AddSeCueSheet() - { - Toolbox.AudioManager.AddCueSheet("se_sys_box_open_lottery_ticket_01", "se_sys_box_open_lottery_ticket_01.acb", "s/"); - } - - private void InitFooter() - { - UIManager.GetInstance()._Footer.UpdateCurrentIndex(0); - } - - private void InitSpriteAtlasOverwriter() - { - UIAtlas component = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("dummy", ResourcesManager.AssetLoadPathType.QuestAtlas, isfetch: true)).GetComponent(); - UISpriteAtlasOverwriter.TargetObject[] targetObjects = new UISpriteAtlasOverwriter.TargetObject[2] - { - new UISpriteAtlasOverwriter.TargetObject(base.gameObject, includeChildren: true), - new UISpriteAtlasOverwriter.TargetObject(UIManager.GetInstance()._Footer.gameObject, includeChildren: true) - }; - base.gameObject.AddMissingComponent().Init(component, targetObjects); - } - - private void AddAtlasOverrider(DialogBase dialog) - { - UIAtlas component = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("dummy", ResourcesManager.AssetLoadPathType.QuestAtlas, isfetch: true)).GetComponent(); - UISpriteAtlasOverwriter.TargetObject[] targetObjects = new UISpriteAtlasOverwriter.TargetObject[1] - { - new UISpriteAtlasOverwriter.TargetObject(dialog.gameObject, includeChildren: true) - }; - dialog.gameObject.AddMissingComponent().Init(component, targetObjects); - } - - private void OpenDetail(LotteryInfoTask.LotteryInfoData lotteryData) - { - if (!string.IsNullOrEmpty(lotteryData.AnnounceId)) - { - UIManager.GetInstance().WebViewHelper.OpenAnnounceWebView(lotteryData.AnnounceId, delegate(DialogBase dialog) - { - SetExceptionDialog(dialog); - }); - return; - } - if (!string.IsNullOrEmpty(lotteryData.InfoUrl)) - { - UIManager.ShowDialogUrl(Data.SystemText.Get("Mission_0049"), lotteryData.InfoUrl); - return; - } - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(systemText.Get("Bingo_0007")); - dialogBase.SetText(systemText.Get("Quest_0034")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - SetExceptionDialog(dialogBase); - } - - private void SetExceptionDialog(DialogBase dialog) - { - List exceptionObjects = new List - { - new UISpriteAtlasOverwriter.TargetObject(dialog.gameObject, includeChildren: true) - }; - UISpriteAtlasOverwriter component = base.gameObject.GetComponent(); - if (component != null) - { - component.AddExceptionObjects(exceptionObjects); - } - } - - public void LateUpdate() - { - BingoPage.FixDialogRibbon(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveBigChanceTask.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveBigChanceTask.cs deleted file mode 100644 index 7a5a8aba..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveBigChanceTask.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Wizard.Lottery; - -public class LotteryReceiveBigChanceTask : BaseTask -{ - public class LotteryReceiveBigChanceTaskParam : BaseParam - { - public int campaign_id; - - public int mission_id; - } - - public LotteryRewardData Result { get; private set; } - - public LotteryReceiveBigChanceTask() - { - base.type = ApiType.Type.LotteryReceiveBigChance; - } - - public void SetParameter(int campaignId, int missionId) - { - LotteryReceiveBigChanceTaskParam lotteryReceiveBigChanceTaskParam = new LotteryReceiveBigChanceTaskParam(); - lotteryReceiveBigChanceTaskParam.campaign_id = campaignId; - lotteryReceiveBigChanceTaskParam.mission_id = missionId; - base.Params = lotteryReceiveBigChanceTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Result = new LotteryRewardData(base.ResponseData["data"]["lottery_reward"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveDoubleChanceTask.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveDoubleChanceTask.cs deleted file mode 100644 index 06e927ec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveDoubleChanceTask.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Wizard.Lottery; - -public class LotteryReceiveDoubleChanceTask : BaseTask -{ - public class LotteryReceiveDoubleChanceTaskParam : BaseParam - { - public int campaign_id; - - public int mission_id; - } - - public LotteryRewardData Result { get; private set; } - - public LotteryReceiveDoubleChanceTask() - { - base.type = ApiType.Type.LotteryReceiveDoubleChance; - } - - public void SetParameter(int campaignId, int missionId) - { - LotteryReceiveDoubleChanceTaskParam lotteryReceiveDoubleChanceTaskParam = new LotteryReceiveDoubleChanceTaskParam(); - lotteryReceiveDoubleChanceTaskParam.campaign_id = campaignId; - lotteryReceiveDoubleChanceTaskParam.mission_id = missionId; - base.Params = lotteryReceiveDoubleChanceTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Result = new LotteryRewardData(base.ResponseData["data"]["lottery_reward"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveTask.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveTask.cs deleted file mode 100644 index 1479973c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryReceiveTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace Wizard.Lottery; - -public class LotteryReceiveTask : BaseTask -{ - public class LotteryReceiveTaskParam : BaseParam - { - public int mission_id; - } - - public LotteryRewardData Result { get; private set; } - - public LotteryReceiveTask() - { - base.type = ApiType.Type.LotteryReceive; - } - - public void SetParameter(int mission_id) - { - LotteryReceiveTaskParam lotteryReceiveTaskParam = new LotteryReceiveTaskParam(); - lotteryReceiveTaskParam.mission_id = mission_id; - base.Params = lotteryReceiveTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Result = new LotteryRewardData(base.ResponseData["data"]["lottery_reward"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryRewardData.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryRewardData.cs deleted file mode 100644 index 60e9fe67..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryRewardData.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard.Lottery; - -public class LotteryRewardData -{ - public class NormalGotRewardData - { - private string _textureName = string.Empty; - - public UserGoods.Type RewardType { get; private set; } - - public long RewardId { get; private set; } - - public int RewardGotNum { get; private set; } - - public string TextureName - { - get - { - if (_textureName == string.Empty) - { - _textureName = UserGoods.GetUserGoodsImageName(RewardType, RewardId); - } - return _textureName; - } - } - - public NormalGotRewardData(UserGoods.Type reward_type, long reward_id, int reward_got_num) - { - RewardType = reward_type; - RewardId = reward_id; - RewardGotNum = reward_got_num; - } - } - - public enum eLotteryRewardState - { - None, - Unapplied, - Applied, - WaitResult, - NotReceived, - Received, - NotAchieved - } - - public eLotteryRewardState state; - - private JsonData NormalRewardList; - - public int MissionId { get; private set; } - - public int GradeId { get; private set; } - - public bool IsCurrent { get; private set; } - - public int LotteryId { get; private set; } - - public string LotteryUrl { get; private set; } - - public string DialogMessage { get; private set; } - - public string Description { get; private set; } - - public string PrizeMessage { get; private set; } - - public List NormalGotRewardList { get; private set; } - - public LotteryMissionData MissionData { get; set; } - - public bool IsSpecial - { - get - { - if (LotteryId <= 0) - { - return false; - } - return true; - } - } - - public LotteryRewardData(JsonData lotteryRewardData) - { - MissionId = lotteryRewardData["mission_id"].ToInt(); - state = (eLotteryRewardState)lotteryRewardData["status"].ToInt(); - GradeId = lotteryRewardData["grade_id"].ToInt(); - IsCurrent = lotteryRewardData["is_current"].ToInt() == 1; - LotteryId = lotteryRewardData["lottery_id"].ToInt(); - LotteryUrl = lotteryRewardData["lottery_url"].ToString(); - DialogMessage = lotteryRewardData["dialog_message"].ToString(); - NormalGotRewardList = ParseGotRewardList(lotteryRewardData["got_reward_list"]); - PrizeMessage = lotteryRewardData.GetValueOrDefault("prize_message", string.Empty); - if (lotteryRewardData.TryGetValue("reward_list", out var _)) - { - NormalRewardList = lotteryRewardData["reward_list"]; - } - Description = lotteryRewardData["description_message"].ToString().Replace("\\n", "\n"); - } - - public void UpdateHaveUserGoodsByNormalRwardList() - { - if (NormalRewardList != null) - { - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(NormalRewardList); - NormalRewardList = null; - } - } - - private List ParseGotRewardList(JsonData data) - { - List list = new List(); - for (int i = 0; i < data.Count; i++) - { - JsonData jsonData = data[i]; - UserGoods.Type reward_type = (UserGoods.Type)jsonData["reward_type"].ToInt(); - long reward_id = jsonData["reward_id"].ToLong(); - int reward_got_num = jsonData["reward_got_num"].ToInt(); - list.Add(new NormalGotRewardData(reward_type, reward_id, reward_got_num)); - } - return list; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotterySpecialRewardDialog.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotterySpecialRewardDialog.cs deleted file mode 100644 index 34ee9d07..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotterySpecialRewardDialog.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine; - -namespace Wizard.Lottery; - -public class LotterySpecialRewardDialog : MonoBehaviour -{ - [SerializeField] - private UILabel _labelDescription; - - private LotteryRewardData _lotteryRewardData; - - public void Init(LotteryRewardData lotteryRewardData) - { - _lotteryRewardData = lotteryRewardData; - _labelDescription.text = _lotteryRewardData.Description; - } - - public void OnClickSpecialRewardSiteBtn() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (_lotteryRewardData.IsSpecial) - { - UIManager.GetInstance().WebViewHelper.OpenUrl(_lotteryRewardData.LotteryUrl); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryTreasureBox.cs b/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryTreasureBox.cs deleted file mode 100644 index 22ae4f49..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryTreasureBox.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard.Lottery; - -public class LotteryTreasureBox : MonoBehaviour -{ - private static readonly Color COLOR_NON_ACTIVE_REWARD_IMAGE = new Color32(65, 65, 65, byte.MaxValue); - - private static readonly Color COLOR_NON_ACTIVE_NUM_TEXT = new Color32(100, 100, 100, byte.MaxValue); - - private static readonly Color COLOR_TICKET_WAIT = new Color32(90, 90, 90, byte.MaxValue); - - [SerializeField] - protected UILabel _labelInfoText; - - [SerializeField] - protected UILabel _labelStatus; - - [SerializeField] - protected UILabel _labelRewardNum; - - [SerializeField] - protected UITexture _textureRewardImage; - - [SerializeField] - protected UITexture _textureRewardImageFg; - - [SerializeField] - protected UISprite _spriteTreasureImage; - - [SerializeField] - protected UILabel _labelTreasureTouch; - - [SerializeField] - protected GameObject _touchObject; - - protected LotteryRewardData _lotteryRewardData; - - public LotteryRewardData LotteryRewardData => _lotteryRewardData; - - public void SetData(LotteryRewardData rewardData, string infoText, Action onClickEvent = null) - { - _labelInfoText.text = infoText; - UIEventListener.Get(base.gameObject).onClick = null; - UIEventListener.Get(base.gameObject).onClick = delegate - { - onClickEvent.Call(); - }; - UpdateData(rewardData); - } - - public void UpdateData(LotteryRewardData rewardData) - { - _lotteryRewardData = rewardData; - UpdateInfoLabel(); - UpdateStatusText(); - UpdateRewardImage(); - UpdateNonActiveColor(); - } - - protected virtual void UpdateInfoLabel() - { - if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotReceived) - { - _labelInfoText.gameObject.SetActive(value: false); - } - else - { - _labelInfoText.gameObject.SetActive(value: true); - } - } - - protected virtual void UpdateStatusText() - { - switch (_lotteryRewardData.state) - { - case LotteryRewardData.eLotteryRewardState.Unapplied: - _labelStatus.text = Data.SystemText.Get("Mission_0051"); - break; - case LotteryRewardData.eLotteryRewardState.Applied: - _labelStatus.text = Data.SystemText.Get("Mission_0053"); - break; - case LotteryRewardData.eLotteryRewardState.WaitResult: - _labelStatus.text = Data.SystemText.Get("Mission_0052"); - break; - case LotteryRewardData.eLotteryRewardState.NotReceived: - _labelStatus.text = string.Empty; - break; - case LotteryRewardData.eLotteryRewardState.Received: - if (_lotteryRewardData.IsSpecial) - { - _labelStatus.text = string.Empty; - } - else - { - _labelStatus.text = Data.SystemText.Get("Mission_0054"); - } - break; - default: - _labelStatus.text = string.Empty; - break; - } - } - - protected virtual void UpdateRewardImage() - { - bool flag = LotteryRewardData.state == LotteryRewardData.eLotteryRewardState.WaitResult || LotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Applied; - if (_textureRewardImageFg != null) - { - _textureRewardImageFg.gameObject.SetActive(flag); - } - if (_touchObject != null) - { - _touchObject.SetActive(LotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotReceived); - } - string textureRewardImage = string.Empty; - ChangeSpriteSizeForTicket(isExpandSize: false); - if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.NotReceived) - { - _labelRewardNum.gameObject.SetActive(value: false); - string path = "box_lottery_01_close"; - textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - SetTextureRewardImage(textureRewardImage); - ChangeSpriteSizeForTicket(isExpandSize: true); - _labelTreasureTouch.text = GetTouchText(); - } - else if (_lotteryRewardData.state == LotteryRewardData.eLotteryRewardState.Received) - { - if (_lotteryRewardData.IsSpecial) - { - string path2 = "thumbnail_lottery"; - textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(path2, ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - _labelRewardNum.gameObject.SetActive(value: false); - } - else if (_lotteryRewardData.NormalGotRewardList.Count > 0) - { - string textureName = _lotteryRewardData.NormalGotRewardList[0].TextureName; - textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true); - _labelRewardNum.gameObject.SetActive(value: true); - _labelRewardNum.text = _lotteryRewardData.NormalGotRewardList[0].RewardGotNum.ToString(); - } - SetTextureRewardImage(textureRewardImage); - } - else if (_textureRewardImageFg != null && flag) - { - _labelRewardNum.gameObject.SetActive(value: false); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("thumbnail_blank", ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - SetTextureRewardImage(assetTypePath); - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath("box_lottery_01_close", ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - SetTextureRewardImageFg(assetTypePath2); - } - else - { - string path3 = "thumbnail_blank"; - textureRewardImage = Toolbox.ResourcesManager.GetAssetTypePath(path3, ResourcesManager.AssetLoadPathType.Lottery, isfetch: true); - _labelRewardNum.gameObject.SetActive(value: false); - SetTextureRewardImage(textureRewardImage); - } - } - - protected string GetTouchText() - { - _ = string.Empty; - return Data.SystemText.Get("Common_0146"); - } - - private void ChangeSpriteSizeForTicket(bool isExpandSize) - { - _textureRewardImage.width = (isExpandSize ? 115 : 87); - _textureRewardImage.height = (isExpandSize ? 115 : 87); - } - - protected void SetTextureRewardImage(string imagePath) - { - _textureRewardImage.gameObject.SetActive(value: true); - _spriteTreasureImage.gameObject.SetActive(value: false); - _textureRewardImage.mainTexture = Toolbox.ResourcesManager.LoadObject(imagePath) as Texture; - } - - private void SetTextureRewardImageFg(string imagePath) - { - _textureRewardImageFg.gameObject.SetActive(value: true); - _textureRewardImageFg.mainTexture = Toolbox.ResourcesManager.LoadObject(imagePath) as Texture; - _textureRewardImageFg.color = COLOR_TICKET_WAIT; - } - - protected virtual void UpdateNonActiveColor() - { - switch (_lotteryRewardData.state) - { - case LotteryRewardData.eLotteryRewardState.Unapplied: - SetNonActiveColor(isNonActive: true); - break; - case LotteryRewardData.eLotteryRewardState.Received: - if (_lotteryRewardData.IsSpecial) - { - SetNonActiveColor(isNonActive: false); - } - else - { - SetNonActiveColor(isNonActive: true); - } - break; - case LotteryRewardData.eLotteryRewardState.Applied: - case LotteryRewardData.eLotteryRewardState.WaitResult: - case LotteryRewardData.eLotteryRewardState.NotReceived: - SetNonActiveColor(isNonActive: false); - break; - default: - _labelStatus.text = string.Empty; - break; - } - } - - protected virtual void SetNonActiveColor(bool isNonActive) - { - if (isNonActive) - { - _textureRewardImage.color = COLOR_NON_ACTIVE_REWARD_IMAGE; - _labelRewardNum.color = COLOR_NON_ACTIVE_NUM_TEXT; - _labelStatus.color = LabelDefine.TEXT_COLOR_CREAM; - } - else - { - _textureRewardImage.color = Color.white; - _labelRewardNum.color = LabelDefine.TEXT_COLOR_NORMAL; - _labelStatus.color = LabelDefine.TEXT_COLOR_NORMAL; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.QuestSpecialResult/QuestAssetManager.cs b/SVSim.BattleEngine/Engine/Wizard.QuestSpecialResult/QuestAssetManager.cs deleted file mode 100644 index b61ee9a5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.QuestSpecialResult/QuestAssetManager.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard.QuestSpecialResult; - -public class QuestAssetManager -{ - public enum AssetId - { - Max - } - - private enum AssetType - { - Effect, - Se, - Other, - Max - } - - private class AssetInfo - { - public AssetType AssetType { get; } - - public ResourcesManager.AssetLoadPathType? LoadPathType { get; } - - public string AssetName { get; } - - public string LoadPath { get; } - - public string FetchPath { get; } - - public AssetInfo(AssetType assetType, ResourcesManager.AssetLoadPathType? loadPathType, string assetName) - { - AssetType = assetType; - LoadPathType = loadPathType; - AssetName = assetName; - LoadPath = (loadPathType.HasValue ? Toolbox.ResourcesManager.GetAssetTypePath(assetName, loadPathType.Value) : string.Empty); - FetchPath = (loadPathType.HasValue ? Toolbox.ResourcesManager.GetAssetTypePath(assetName, loadPathType.Value, isfetch: true) : string.Empty); - } - } - - private readonly AssetInfo[] _assetInfoTable; - - private readonly Func, IEnumerator>[] _loadCoroutineTable; - - private readonly List _loadedAssets = new List(); - - public bool IsLoaded { get; private set; } - - public QuestAssetManager() - { - _assetInfoTable = CreateAssetInfoTable(); - _loadCoroutineTable = CreateLoadCoroutineTable(); - } - - private AssetInfo[] CreateAssetInfoTable() - { - return new AssetInfo[0]; - } - - private Func, IEnumerator>[] CreateLoadCoroutineTable() - { - return new Func, IEnumerator>[3] { LoadEffectCoroutine, LoadSeCoroutine, LoadOtherAssetCoroutine }; - } - - public IEnumerator LoadAllCoroutine() - { - if (!IsLoaded) - { - AssetInfo[] assetInfoTable = _assetInfoTable; - foreach (AssetInfo assetInfo in assetInfoTable) - { - yield return _loadCoroutineTable[(int)assetInfo.AssetType](assetInfo, _loadedAssets); - } - IsLoaded = true; - } - } - - private IEnumerator LoadEffectCoroutine(AssetInfo info, List loadedAssets) - { - List assets = new List { info.LoadPath }; - yield return Toolbox.ResourcesManager.LoadAssetGroupSync(assets, null); - loadedAssets.AddRange(assets); - yield return LoadEffectShaderCoroutine(info, loadedAssets); - } - - private IEnumerator LoadEffectShaderCoroutine(AssetInfo info, List loadedAssets) - { - bool isLoading = true; - GameObject effectObj = Toolbox.ResourcesManager.LoadObject(info.FetchPath); - List assets = GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectObj, delegate - { - isLoading = false; - }); - while (isLoading) - { - yield return null; - } - loadedAssets.AddRange(assets); - } - - private IEnumerator LoadSeCoroutine(AssetInfo info, List loadedAssets) - { - bool isLoading = true; - string asset = GameMgr.GetIns().GetSoundMgr().LoadSe(info.AssetName, delegate - { - isLoading = false; - }); - while (isLoading) - { - yield return null; - } - loadedAssets.Add(asset); - } - - private IEnumerator LoadOtherAssetCoroutine(AssetInfo info, List loadedAssets) - { - List assets = new List { info.LoadPath }; - yield return Toolbox.ResourcesManager.LoadAssetGroupSync(assets, null); - loadedAssets.AddRange(assets); - } - - public void UnloadAll() - { - if (IsLoaded) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedAssets); - _loadedAssets.Clear(); - IsLoaded = false; - } - } - - private AssetInfo GetAssetInfo(AssetId id) - { - return _assetInfoTable[(int)id]; - } - - public string GetAssetName(AssetId id) - { - return GetAssetInfo(id).AssetName; - } - - public string GetFetchPath(AssetId id) - { - return GetAssetInfo(id).FetchPath; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.RoomMatch/RoomParamKey.cs b/SVSim.BattleEngine/Engine/Wizard.RoomMatch/RoomParamKey.cs deleted file mode 100644 index 6d89b7a1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.RoomMatch/RoomParamKey.cs +++ /dev/null @@ -1,242 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Wizard.RoomMatch; - -public static class RoomParamKey -{ - public static class RoomEntry - { - public const string USER_NAME = "userName"; - - public const string EMBLEM_ID = "emblemId"; - - public const string DEGREE_ID = "degreeId"; - - public const string COUNTRY_CODE = "countryCode"; - - public const string RANK = "rank"; - - public const string MAX_RANK = "maxRank"; - - public const string IS_FRIEND = "isFriend"; - - public const string IS_GUILD_MEMBER = "isGuildMember"; - - public const string IS_GUILD_JOINED = "isGuildJoined"; - - public const string OPPONENT_ID = "oppoId"; - } - - public static class ChatStamp - { - public const string CHAT_STAMP = "chatStamp"; - - public const string STAMP = "stamp"; - } - - public static class RoomNotify - { - public const string NOTIFY = "notify"; - - public const string RETRY_DECK_CREATE = "retry_deck_create"; - - public const string DRAFT_DECK_RESET = "draftDeckReset"; - } - - public static class BeginCreateDeck - { - public const string CANDIDATE_CLASS_IDS = "candidateClassIds"; - - public const string CLASS_ID_1 = "classId1"; - - public const string CLASS_ID_2 = "classId2"; - - public const string CLASS_ID_3 = "classId3"; - - public const string CHARA_ID_1 = "charaId1"; - - public const string CHARA_ID_2 = "charaId2"; - - public const string CHARA_ID_3 = "charaId3"; - - public const string CHAOS_ID_1 = "chaosId1"; - - public const string CHAOS_ID_2 = "chaosId2"; - - public const string CHAOS_ID_3 = "chaosId3"; - - public const string CHAOS_USABLE_CLASS_IDS_1 = "usableClassIds1"; - - public const string CHAOS_USABLE_CLASS_IDS_2 = "usableClassIds2"; - - public const string CHAOS_USABLE_CLASS_IDS_3 = "usableClassIds3"; - } - - public static class SelectClass - { - public const string CLASS_INFO = "classInfo"; - - public const string SELECTED_CLASS_ID = "selectedClassId"; - - public const string SELECTED_CHARA_ID = "selectedCharaId"; - - public const string SELECTED_CHAOS_ID = "selectedChaosId"; - - public const string SELECTED_CARD_IDS = "selected_card_ids"; - } - - public static class DeckEntry - { - public const string DECK_LIST = "deckList"; - } - - public static class MultiDeckBan - { - public const string DECIDE_BAN_DECK = "banDeckIdxList"; - } - - public static class InitWatch - { - public static class DeckList - { - public const string CLASS_ID = "classId"; - - public const string SUB_CLASS_ID = "subclassId"; - - public const string SLEEVE_ID = "sleeveId"; - - public const string CHARA_ID = "charaId"; - - public const string DECK_ID = "deckId"; - - public const string CARD_ID_LIST = "cardIdList"; - - public const string MY_ROTATION_ID = "rotationId"; - } - - public const string LEAVE_COUNT = "leaveCount"; - - public const string WAIT_TIME = "waitTime"; - - public const string DECK_LIST = "deckList"; - - public const string USER_LIST = "userInfoList"; - - public const string BAN_DECK = "banDeckIdxList"; - - public const string TURN_SELECT = "turnSelect"; - } - - public static class BattleNum - { - public const string BATTLE_NUM = "battleNum"; - - public const string OWNER_WIN = "ownerWin"; - - public const string GUEST_WIN = "guestWin"; - } - - public static class Watch - { - public static class PlayList - { - public const string SEQUENCE = "seq"; - - public const string VIEWER_ID = "vid"; - - public const string TURN_SELECT = "turnSelect"; - } - - public const string LEAVE_COUNT = "leaveCount"; - - public const string RELEASE = "release"; - - public const string USER_INFO = "userInfo"; - - public const string ROOM_INFO = "roomInfo"; - - public const string BATTLE_NUM = "battleNum"; - - public const string FIRST_TURN = "firstTurn"; - - public const string USER_INFO_LIST = "uinfoList"; - - public const string FIELD_ID = "fieldId"; - - public const string SEED = "seed"; - - public const string PLAY_LIST_ROOM = "playlist_room"; - } - - public static class TwoPickDeckInfo - { - public const string TWO_PICK_DECK_INFO = "deckInfo"; - - public const string CANDIDATE_CARD_LIST = "candidateCardList"; - - public const string DECK_NUMBER = "deckNumber"; - - public const string DECK_FINISH = "isFinish"; - - public const string CLASS_ID = "classId"; - - public const string SKIN_ID = "skinId"; - - public const string CARD_IDS = "cardIds"; - - public const string CHAOS_ID = "chaosId"; - - public const string TURN = "turn"; - - public const string CARD_ID_1 = "cardId1"; - - public const string CARD_ID_2 = "cardId2"; - - public const string IS_SELF = "isSelf"; - } - - public static class WatchSendParam - { - public const string USERS = "users"; - - public const string W_SEQ = "wSeq"; - - public const string VIEWER_ID = "viewerId"; - } - - public static class Recovery - { - public const string NEED_MULTI_DECK_CLEAR = "isMultiInitialize"; - } - - public const string URI = "uri"; - - public const string IS_FORCE = "isForce"; - - public const string PLAY_SEQ = "playSeq"; - - public const string RETRY = "retry"; - - public const string TURN_SELECT = "turnSelect"; - - public const string USER_STATE = "userState"; - - public static readonly Dictionary UriNames; - - public static readonly Dictionary WatchUriNames; - - static RoomParamKey() - { - UriNames = new Dictionary(Enum.GetValues(typeof(PlayerController.ROOM_URI)).Length); - foreach (PlayerController.ROOM_URI value in Enum.GetValues(typeof(PlayerController.ROOM_URI))) - { - UriNames[value] = Enum.GetName(typeof(PlayerController.ROOM_URI), value); - } - WatchUriNames = new Dictionary(Enum.GetValues(typeof(PlayerControllerForWatching.SEND_PARAMETER)).Length); - foreach (PlayerControllerForWatching.SEND_PARAMETER value2 in Enum.GetValues(typeof(PlayerControllerForWatching.SEND_PARAMETER))) - { - WatchUriNames[value2] = Enum.GetName(typeof(PlayerControllerForWatching.SEND_PARAMETER), value2); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateChaos.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateChaos.cs index 6c5ba6d6..8a9baa7c 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateChaos.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateChaos.cs @@ -16,8 +16,6 @@ public class CandidateChaos public int[] SourceClassIds; } - private const int CHAOS_CHARA_DATA_NUM = 3; - public ChaosCharaData[] CharaData; public int SelectedChaosId; diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateClass.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateClass.cs index 39aac8a4..858cfdf5 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateClass.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Arena.TwoPick/CandidateClass.cs @@ -18,10 +18,6 @@ public class CandidateClass public int charaId2; - public int charaId3; - - public int selectedCharacterId; - public int SelectedChaosId { get; private set; } public CandidateClass() diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Ranking/RankingPeriod.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Ranking/RankingPeriod.cs index 0ff83814..7bba57a0 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Ranking/RankingPeriod.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TableData.Ranking/RankingPeriod.cs @@ -19,24 +19,11 @@ public class RankingPeriod public int IsAfter460; - private const string TYPE_KEY = "type"; - - private const string KEY_460 = "over_460"; - public RankingPeriod() { Initialize(); } - public bool IsSamePeriod(RankingPeriod time) - { - if (time.beginTime == beginTime) - { - return time.endTime == endTime; - } - return false; - } - public RankingPeriod(JsonData data) { if (data == null) diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.Arena/TwoPickInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.Arena/TwoPickInfo.cs index f0311c6a..772474a1 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.Arena/TwoPickInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.Arena/TwoPickInfo.cs @@ -10,10 +10,6 @@ public class TwoPickInfo { public enum PREPARE_STATE { - NO_ENTRY, - CLASS_SELECT, - CARD_SELECT, - SETTING_COMPLETED } public EntryInfo entryInfo; @@ -30,8 +26,6 @@ public class TwoPickInfo public CampaignBattleWin TreasureCP = new CampaignBattleWin(); - public List entryRewardList = new List(); - public TwoPickInfo() { } @@ -68,8 +62,7 @@ public class TwoPickInfo } if (data.Keys.Contains("leader_skin_id")) { - GameMgr.GetIns().GetDataMgr().GetClassPrm(classInfo.selectedClassId) - .SetCurrentCharaId(data["leader_skin_id"].ToInt()); + /* Pre-Phase-5b: ClassPrm.SetCurrentCharaId not reachable headless (no chara master) */ } if (data.TryGetValue("treasure_info", out var value)) { @@ -120,35 +113,4 @@ public class TwoPickInfo { battleResult = new BattleResult(battleResultInfoData); } - - public void SetEntryRewardList(JsonData rewards) - { - entryRewardList = new List(); - for (int i = 0; i < rewards.Count; i++) - { - ReceivedReward item = new ReceivedReward(rewards[i]); - entryRewardList.Add(item); - } - } - - public PREPARE_STATE GetPrepareState() - { - if (entryInfo == null) - { - return PREPARE_STATE.NO_ENTRY; - } - if (classInfo != null && classInfo.selectedClassId == 0) - { - return PREPARE_STATE.CLASS_SELECT; - } - if (deckInfo != null && !deckInfo.isSelectCompleted) - { - return PREPARE_STATE.CARD_SELECT; - } - if (deckInfo != null && deckInfo.isSelectCompleted) - { - return PREPARE_STATE.SETTING_COMPLETED; - } - return PREPARE_STATE.NO_ENTRY; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckBuyTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckBuyTask.cs index f2cc0ab0..b64ce8c0 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckBuyTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckBuyTask.cs @@ -9,8 +9,6 @@ public class BuildDeckBuyTask : BaseTask public class BuildDeckBuySingleTaskParam : BaseParam { public int product_id; - - public int sales_type; } public List _seriesRewardList = new List(); @@ -29,14 +27,6 @@ public class BuildDeckBuyTask : BaseTask LotteryData = LotteryApplyData.EmptyData(); } - public void SetParameter(int productId, ShopCommonUtility.SalesType sales_type) - { - BuildDeckBuySingleTaskParam buildDeckBuySingleTaskParam = new BuildDeckBuySingleTaskParam(); - buildDeckBuySingleTaskParam.product_id = productId; - buildDeckBuySingleTaskParam.sales_type = (int)sales_type; - base.Params = buildDeckBuySingleTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckDetailWindow.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckDetailWindow.cs deleted file mode 100644 index 9219c8ef..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckDetailWindow.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckDetailWindow : MonoBehaviour -{ - private const int SUPPLY_TYPE_LABEL_INDEX = 0; - - private const int SUPPLY_NAME_LABEL_INDEX = 1; - - private const int DEPTH_COPY_CONFIRM_DIALOG = 20; - - [SerializeField] - private BuildDeckProductDetail _buildDeckProductDetail; - - [SerializeField] - private UILabel _labelProductName; - - [SerializeField] - private UISprite _spriteClassColorIcon; - - [SerializeField] - private UILabel _labelDeckCode; - - private BuildDeckProductInfo _productInfo; - - private UICardList _uiCardList; - - private List _loadedCardList = new List(); - - public void SetSingleData(UICardList uiCardList, BuildDeckProductInfo productInfo) - { - _productInfo = productInfo; - _uiCardList = uiCardList; - _buildDeckProductDetail.SetSingleProductDetail(productInfo); - ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(productInfo.leader_id); - _labelProductName.text = productInfo.saleInfo.name; - ClassCharaPrm.SetClassLabelSetting(_labelProductName, charaPrmByClassId.ClassColorId); - _spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan); - _uiCardList.SetClan(charaPrmByClassId.clan); - _uiCardList.SetDeckName(productInfo.saleInfo.name); - _uiCardList.SetMaxCardNum(40); - _labelDeckCode.text = Wizard.Data.SystemText.Get("Shop_0117", productInfo.deck_code); - } - - public void OnCloseWindow() - { - _uiCardList.RemoveData(); - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedCardList); - } - - public void OnBtnCopyDeckCode() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - NativePluginWrapper.SetStringToClipboard(_productInfo.deck_code); - UIManager.GetInstance().CreateConfirmationDialog(Wizard.Data.SystemText.Get("Shop_0118", _productInfo.deck_code)).SetPanelDepth(20); - } - - public void OnBtnShowCardList() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (_uiCardList.getCardNum() > 0) - { - ShowUICardList(); - return; - } - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadCardAndShowUICardList()); - } - - private IEnumerator LoadCardAndShowUICardList() - { - List cardIdList = _productInfo.CardIdList; - List assetList = _uiCardList.GetLoadFileList(cardIdList); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(assetList, null)); - _loadedCardList.AddRange(assetList); - List list = UIManager.GetInstance().getUIBase_CardManager().SortIDList(cardIdList, CardMaster.CardMasterId.Default); - for (int i = 0; i < list.Count; i++) - { - _uiCardList.addScrollItem(list[i]); - } - _uiCardList.SetFormat(Format.Rotation, null); - yield return null; - UIManager.GetInstance().closeInSceneCenterLoading(); - ShowUICardList(); - } - - private void ShowUICardList() - { - _uiCardList.SetActive(in_Active: true); - _uiCardList.ResetScroll(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPlate.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPlate.cs deleted file mode 100644 index 06496903..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPlate.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckPlate : MonoBehaviour -{ - private const int MAX_LENGTH_VIEW_DECK_PRODUCT_NAME = 15; - - private const int MAX_LENGTH_VIEW_DECK_PRODUCT_NAME_ALPHABET = 35; - - private readonly Vector3 POS_VIEW_SINGLE_PRODUCT_NAME = new Vector3(13f, -52f, 0f); - - [SerializeField] - private UIEventListener _eventListenerDeckImage; - - [SerializeField] - private UILabel _labelCostCrystalLeft; - - [SerializeField] - private UILabel _labelCostCrystalCenter; - - [SerializeField] - private UIButton m_BtnBuy; - - [SerializeField] - private UILabel m_LabelBuy; - - [SerializeField] - private UILabel m_LabelPurchased; - - [SerializeField] - private UILabel _LabelPurchaseNum; - - [SerializeField] - private UILabel _LabelProductName; - - [SerializeField] - private UITexture _uiDeckTexture; - - [SerializeField] - private UISprite _spriteClassColorIcon; - - [SerializeField] - private UILabel _labelCostTicket; - - [SerializeField] - private UITexture _leaderSkinTicketIcon; - - public BuildDeckProductInfo ProductInfo { get; private set; } - - public Texture ImageTexture { get; private set; } - - private void Start() - { - m_LabelPurchased.text = Wizard.Data.SystemText.Get("Shop_0100"); - } - - public void SetData(BuildDeckProductInfo productInfo, EventDelegate onPushBuyBtnCallback, Action onTapDeckImage) - { - ProductInfo = productInfo; - ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(productInfo.leader_id); - _LabelProductName.transform.localPosition = POS_VIEW_SINGLE_PRODUCT_NAME; - int maxLength = (Global.IsAlphabetLanguage() ? 35 : 15); - _LabelProductName.text = ShopCommonUtility.TrimProductName(productInfo.saleInfo.name, maxLength); - ClassCharaPrm.SetClassLabelSetting(_LabelProductName, charaPrmByClassId.ClassColorId); - _uiDeckTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(productInfo.saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail, isfetch: true)); - _spriteClassColorIcon.gameObject.SetActive(value: true); - _spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan); - m_BtnBuy.onClick.Clear(); - m_BtnBuy.onClick.Add(onPushBuyBtnCallback); - _eventListenerDeckImage.onClick = null; - _eventListenerDeckImage.onClick = delegate - { - onTapDeckImage.Call(); - }; - _SetBuyButton(productInfo); - } - - private void _SetBuyButton(BuildDeckProductInfo productInfo) - { - int? num = null; - if (productInfo.saleInfo.costCrystal.HasValue) - { - num = productInfo.saleInfo.costCrystal.Value; - } - if (productInfo.saleInfo.costTicket.HasValue) - { - num = productInfo.saleInfo.costTicket.Value; - } - UIManager.SetObjectToGrey(m_BtnBuy.gameObject, b: false); - _labelCostTicket.gameObject.SetActive(value: false); - _leaderSkinTicketIcon.gameObject.SetActive(value: false); - int num2 = 0; - if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue) - { - num2 = PlayerStaticData.GetItemNum((int)productInfo.saleInfo.costTicketItemId.Value); - _labelCostTicket.text = Wizard.Data.SystemText.Get("Shop_0189", productInfo.saleInfo.costTicket.Value.ToString()); - _leaderSkinTicketIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(ShopCommonUtility.GetTicketIconPath(productInfo.saleInfo.costTicketItemId.Value.ToString(), isFetch: true)); - } - if (!productInfo.is_purchased) - { - m_BtnBuy.gameObject.SetActive(value: true); - m_BtnBuy.isEnabled = true; - m_LabelPurchased.gameObject.SetActive(value: false); - if (productInfo.saleInfo.isFree) - { - m_LabelBuy.text = Wizard.Data.SystemText.Get("Shop_0099"); - return; - } - m_LabelBuy.text = Wizard.Data.SystemText.Get("Shop_0095"); - if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue) - { - _labelCostTicket.gameObject.SetActive(value: true); - _leaderSkinTicketIcon.gameObject.SetActive(value: true); - UIManager.SetObjectToGrey(m_BtnBuy.gameObject, num2 < productInfo.saleInfo.costTicket.Value); - } - if (!productInfo.saleInfo.costCrystal.HasValue) - { - _labelCostCrystalLeft.gameObject.SetActive(value: false); - _labelCostCrystalCenter.gameObject.SetActive(value: false); - } - else if (productInfo.purchase_num_max == 1) - { - SetCostLabel(num.Value, isCenter: true); - } - else - { - SetCostLabel(num.Value, isCenter: false); - } - if (productInfo.purchase_num_max == 1) - { - _LabelPurchaseNum.gameObject.SetActive(value: false); - return; - } - if (productInfo.is_first_price && productInfo.purchase_num_current <= 0) - { - _LabelPurchaseNum.gameObject.SetActive(value: true); - _LabelPurchaseNum.text = Wizard.Data.SystemText.Get("Shop_0122"); - return; - } - _LabelPurchaseNum.gameObject.SetActive(value: true); - int num3 = productInfo.purchase_num_max - productInfo.purchase_num_current; - _LabelPurchaseNum.text = Wizard.Data.SystemText.Get("Shop_0123", num3.ToString()); - } - else - { - m_BtnBuy.gameObject.SetActive(value: false); - m_LabelPurchased.gameObject.SetActive(value: true); - _LabelPurchaseNum.gameObject.SetActive(value: false); - if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue) - { - _labelCostTicket.gameObject.SetActive(value: true); - _leaderSkinTicketIcon.gameObject.SetActive(value: true); - } - if (!productInfo.saleInfo.costCrystal.HasValue) - { - _labelCostCrystalLeft.gameObject.SetActive(value: false); - _labelCostCrystalCenter.gameObject.SetActive(value: false); - } - else - { - SetCostLabel(num.Value, isCenter: true); - } - } - } - - private void SetCostLabel(int cost, bool isCenter) - { - string text = Wizard.Data.SystemText.Get("Shop_0112", cost.ToString()); - if (isCenter) - { - _labelCostCrystalLeft.gameObject.SetActive(value: false); - _labelCostCrystalCenter.gameObject.SetActive(value: true); - _labelCostCrystalCenter.text = text; - } - else - { - _labelCostCrystalLeft.gameObject.SetActive(value: true); - _labelCostCrystalCenter.gameObject.SetActive(value: false); - _labelCostCrystalLeft.text = text; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckProductInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckProductInfo.cs deleted file mode 100644 index 796dc2ec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckProductInfo.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckProductInfo -{ - private List _cardList = new List(); - - private List _rewardInfoList = new List(); - - public int product_id { get; set; } - - public string deck_code { get; set; } - - public int leader_id { get; set; } - - public int featured_card_id { get; set; } - - public int purchase_num_max { get; set; } - - public int purchase_num_current { get; set; } - - public bool is_first_price { get; set; } - - public bool is_purchased - { - get - { - if (purchase_num_max <= purchase_num_current) - { - return true; - } - return false; - } - } - - public ShopCommonSaleInfo saleInfo { get; set; } - - public List cardList => _cardList; - - public List rewardInfoList => _rewardInfoList; - - public List CardIdList - { - get - { - List list = new List(); - for (int i = 0; i < cardList.Count; i++) - { - for (int j = 0; j < cardList[i]._number; j++) - { - list.Add(cardList[i]._cardId); - } - } - return list; - } - } - - public bool HasResurgentCard - { - get - { - CardMaster cardMaster = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - return _cardList.Any((BuildDeckCard card) => cardMaster.GetCardParameterFromId(card._cardId).IsResurgentCard); - } - } - - public bool ContainsOnlyRotationCards() - { - CardMaster master = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - List source = _cardList.ConvertAll((BuildDeckCard card) => master.GetCardParameterFromId(card._cardId).BaseCardId); - source = source.Distinct().ToList(); - for (int num = 0; num < source.Count; num++) - { - if (!master.GetCardParameterFromId(source[num]).IsAvailableFormat(Format.Rotation, ClassType.None)) - { - return false; - } - } - return true; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfo.cs index e4e57a06..a2d60b0d 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfo.cs @@ -4,37 +4,4 @@ namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; public class BuildDeckPurchaseInfo { - private List _seriesList = new List(); - - public List seriesList => _seriesList; - - public BuildDeckProductInfo GetProductInfo(int productID) - { - foreach (BuildDeckSeriesPurchaseInfo series in _seriesList) - { - foreach (BuildDeckProductInfo product in series.productList) - { - if (product.product_id == productID) - { - return product; - } - } - } - return null; - } - - public int GetSeriesId(int productID) - { - foreach (BuildDeckSeriesPurchaseInfo series in _seriesList) - { - foreach (BuildDeckProductInfo product in series.productList) - { - if (product.product_id == productID) - { - return series._seriesId; - } - } - } - return -1; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfoTask.cs deleted file mode 100644 index 25b64fa0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchaseInfoTask.cs +++ /dev/null @@ -1,123 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckPurchaseInfoTask : BaseTask -{ - public class BuildDeckPurchaseInfoTaskParam : BaseParam - { - public int add_series_id; - } - - public BuildDeckPurchaseInfoTask() - { - base.type = ApiType.Type.BuildDeckInfo; - } - - public void SetParameter(int add_series_id) - { - BuildDeckPurchaseInfoTaskParam buildDeckPurchaseInfoTaskParam = new BuildDeckPurchaseInfoTaskParam(); - buildDeckPurchaseInfoTaskParam.add_series_id = add_series_id; - base.Params = buildDeckPurchaseInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Wizard.Data.BuildDeckPurchaseInfo.seriesList.Clear(); - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - int num2 = jsonData[i]["series_id"].ToInt(); - if (!Wizard.Data.Master.BuildDeckSeriesIdDic.ContainsKey(num2)) - { - continue; - } - BuildDeckSeriesPurchaseInfo buildDeckSeriesPurchaseInfo = new BuildDeckSeriesPurchaseInfo(); - buildDeckSeriesPurchaseInfo._seriesId = num2; - buildDeckSeriesPurchaseInfo._introduction = Wizard.Data.Master.BuildDeckSeriesIdDic[buildDeckSeriesPurchaseInfo._seriesId].Introduction; - buildDeckSeriesPurchaseInfo._isNew = jsonData[i]["is_new"].ToBoolean(); - JsonData jsonData2 = jsonData[i]["products"]; - for (int j = 0; j < jsonData2.Count; j++) - { - BuildDeckProductInfo buildDeckProductInfo = new BuildDeckProductInfo(); - buildDeckProductInfo.product_id = jsonData2[j]["product_id"].ToInt(); - buildDeckProductInfo.leader_id = jsonData2[j]["leader_id"].ToInt(); - buildDeckProductInfo.deck_code = jsonData2[j]["deck_code"].ToString(); - buildDeckProductInfo.featured_card_id = jsonData2[j]["featured_card_id"].ToInt(); - buildDeckProductInfo.purchase_num_max = jsonData2[j]["purchase_num_max"].ToInt(); - buildDeckProductInfo.purchase_num_current = jsonData2[j]["purchase_num_current"].ToInt(); - buildDeckProductInfo.is_first_price = jsonData2[j]["is_first_price"].ToBoolean(); - ShopCommonSaleInfo shopCommonSaleInfo = new ShopCommonSaleInfo(); - string key = jsonData2[j]["product_name"].ToString(); - shopCommonSaleInfo.name = Wizard.Data.Master.GetBuildDeckProductText(key); - shopCommonSaleInfo.path = jsonData2[j]["product_id"].ToString(); - if (jsonData2[j].Keys.Contains("price_crystal")) - { - shopCommonSaleInfo.costCrystal = jsonData2[j]["price_crystal"].ToInt(); - } - if (jsonData2[j].Keys.Contains("price_rupy")) - { - shopCommonSaleInfo.costRupy = jsonData2[j]["price_rupy"].ToInt(); - } - if (jsonData2[j].Keys.Contains("price_ticket")) - { - shopCommonSaleInfo.costTicket = jsonData2[j]["price_ticket"].ToInt(); - } - if (jsonData2[j].Keys.Contains("ticket_id")) - { - shopCommonSaleInfo.costTicketItemId = jsonData2[j]["ticket_id"].ToInt(); - shopCommonSaleInfo.haveTicketNum = PlayerStaticData.GetHaveUserGoods(UserGoods.Type.Item, shopCommonSaleInfo.costTicketItemId.Value); - } - shopCommonSaleInfo.isFree = false; - if (shopCommonSaleInfo.costCrystal.HasValue && shopCommonSaleInfo.costRupy.HasValue && shopCommonSaleInfo.costCrystal <= 0 && shopCommonSaleInfo.costRupy <= 0) - { - shopCommonSaleInfo.isFree = true; - } - shopCommonSaleInfo.expirtyTimeInfo = new ShopExpirtyInfo(jsonData2[j]["sales_period_info"]); - buildDeckProductInfo.saleInfo = shopCommonSaleInfo; - JsonData jsonData3 = jsonData2[j]["rewards"]; - for (int k = 0; k < jsonData3.Count; k++) - { - ShopCommonRewardInfo shopCommonRewardInfo = new ShopCommonRewardInfo(); - shopCommonRewardInfo.Type = jsonData3[k]["reward_type"].ToInt(); - shopCommonRewardInfo.UserGoodsId = jsonData3[k]["reward_detail_id"].ToLong(); - shopCommonRewardInfo.Num = jsonData3[k]["reward_number"].ToInt(); - buildDeckProductInfo.rewardInfoList.Add(shopCommonRewardInfo); - } - if (Wizard.Data.Master.BuildDeckCardListDic.ContainsKey(buildDeckProductInfo.product_id)) - { - for (int l = 0; l < Wizard.Data.Master.BuildDeckCardListDic[buildDeckProductInfo.product_id].Count; l++) - { - buildDeckProductInfo.cardList.Add(Wizard.Data.Master.BuildDeckCardListDic[buildDeckProductInfo.product_id][l]); - } - buildDeckSeriesPurchaseInfo.productList.Add(buildDeckProductInfo); - } - } - JsonData jsonData4 = jsonData[i]["series_rewards"]; - for (int m = 0; m < jsonData4.Count; m++) - { - PurchaseRewardInfo purchaseRewardInfo = new PurchaseRewardInfo(); - JsonData jsonData5 = jsonData4[m]; - string key2 = $"Shop_BuildDeckRewardNum_{(m + 1).ToString()}"; - purchaseRewardInfo.PurchaseNthText = Wizard.Data.SystemText.Get(key2); - for (int n = 0; n < jsonData5["reward_list"].Count; n++) - { - ShopCommonRewardInfo shopCommonRewardInfo2 = new ShopCommonRewardInfo(); - shopCommonRewardInfo2.Type = jsonData5["reward_list"][n]["reward_type"].ToInt(); - shopCommonRewardInfo2.UserGoodsId = jsonData5["reward_list"][n]["reward_detail_id"].ToLong(); - shopCommonRewardInfo2.Num = jsonData5["reward_list"][n]["reward_number"].ToInt(); - purchaseRewardInfo.RewardInfoList.Add(shopCommonRewardInfo2); - } - purchaseRewardInfo.IsGet = jsonData4[m]["is_get"].ToBoolean(); - buildDeckSeriesPurchaseInfo.SeriesRewardList.Add(purchaseRewardInfo); - } - Wizard.Data.BuildDeckPurchaseInfo.seriesList.Add(buildDeckSeriesPurchaseInfo); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchasePage.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchasePage.cs deleted file mode 100644 index 084b1c77..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckPurchasePage.cs +++ /dev/null @@ -1,788 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.DeckCardEdit; -using Wizard.Lottery; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckPurchasePage : BaseShopPurchasePage -{ - private const int DEFAULT_INDEX = 0; - - private const string LAYER_DIALOG_PRODUCT_DETAIL = "MyPage"; - - private const int SORTODER_DIALOG_PRODUCT_DETAIL = 2; - - private const int DEPTH_DIALOG_PRODUCT_DETAIL = 140; - - private const string LAYER_DIALOG_PURCHASE_REWARD = "MyPage"; - - private const int SORTODER_DIALOG_PURCHASE_REWARD = 2; - - private const int DEPTH_DIALOG_PURCHASE_REWARD = 140; - - [SerializeField] - private GameObject _prefabDialogSelectBuyMeans; - - [SerializeField] - private PurchaseConfirm _prefabDialogPurchaseConfirm; - - [SerializeField] - private BuildDeckDetailWindow _prefabDialogBuildDeckDetail; - - [SerializeField] - private CardDetailUI _cardDetailPrefab; - - private CardDetailUI _cardDetail; - - [SerializeField] - private UICardList _cardListPrefab; - - private UICardList _uiCardListClass; - - [SerializeField] - private ShopDrumrollScrollManager _drumrollManager; - - [SerializeField] - private UIButton _btnSeriesRewards; - - [SerializeField] - private UIAnchor _achiveAnchor; - - private BuildDeckSeriesPurchaseInfo _selectSeriesInfo; - - private BuildDeckProductInfo _purchaseProductInfo; - - private string _purchaseDeckName = string.Empty; - - private int _purchaseDeckClassId; - - private List _purchaseDeckCardIds; - - private BuildDeckPlate _selectPlate; - - private DialogBase _dialogPurchaseConfirm; - - private DialogBase _dialogSelectBuyMeans; - - private DialogBase _dialogProductDetail; - - private DialogBase _dialogCrystalShortage; - - private BuildDeckBuyTask _buyTask; - - private bool _isBuyConnect; - - private static int _autoShowBuildDeckProductId; - - private static bool _autoShowBuildDeckEnable; - - private Format _deckCreateFormat; - - private List _loadResource = new List(); - - private int _addShowSeriesId; - - [SerializeField] - private NotificatonAnimation _notificationAnimationPrefab; - - [SerializeField] - private GameObject _achieveLog; - - private NotificatonAnimation _notificationAnimation; - - public static void BuildDeckConfirmDialogShow(int productID) - { - _autoShowBuildDeckEnable = true; - _autoShowBuildDeckProductId = productID; - } - - public override void onFirstStart() - { - _cardDetail = UnityEngine.Object.Instantiate(_cardDetailPrefab); - _cardDetail.transform.parent = base.transform; - _cardDetail.transform.localPosition = Vector3.zero; - _cardDetail.transform.localScale = Vector3.one; - _cardDetail.Initialize(LayerMask.NameToLayer("Detail"), CardMaster.CardMasterId.Default); - _cardDetail.gameObject.SetActive(value: false); - _uiCardListClass = UnityEngine.Object.Instantiate(_cardListPrefab).GetComponent(); - _uiCardListClass.SetActive(in_Active: false); - _uiCardListClass.Init(base.gameObject, _cardDetail, null, null, "Detail", in_DetailCameraUse: true); - CreateTopBar(Wizard.Data.SystemText.Get("Shop_0116"), delegate - { - MyPageMenu.Instance.GoToShopCard(); - }); - _achiveAnchor.uiCamera = UIManager.GetInstance().MyPageUICameraObj.GetComponent(); - base.onFirstStart(); - } - - protected override void onOpen() - { - base.onOpen(); - _loadedResourceList = new List(); - StartGetBuildDeckInfo(OnBuildDeckInfoRequestFinished); - } - - protected override void onClose() - { - base.onClose(); - DisposeResource(); - } - - private void DisposeResource() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadResource); - _loadResource.Clear(); - } - - private void StartGetBuildDeckInfo(Action callbackOnSuccess) - { - BuildDeckPurchaseInfoTask buildDeckPurchaseInfoTask = new BuildDeckPurchaseInfoTask(); - buildDeckPurchaseInfoTask.SetParameter(_addShowSeriesId); - StartCoroutine(Toolbox.NetworkManager.Connect(buildDeckPurchaseInfoTask, callbackOnSuccess)); - } - - private void StartBuyBuildDeck(ShopCommonUtility.SalesType costType, int id) - { - if (!_isBuyConnect) - { - _isBuyConnect = true; - UIManager.GetInstance().createInSceneCenterLoading(); - _buyTask = new BuildDeckBuyTask(); - _buyTask.SetParameter(id, costType); - StartCoroutine(Toolbox.NetworkManager.Connect(_buyTask, delegate(NetworkTask.ResultCode error) - { - onSuccessPurchase(error, costType); - }, _OnFailurePurchase, _OnResultCodeError)); - } - } - - private int GetViewSeriesId() - { - int seriesId = Wizard.Data.BuildDeckPurchaseInfo.seriesList[0]._seriesId; - int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LATEST_DECK_SERIES_ID); - if (seriesId != value) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LATEST_DECK_SERIES_ID, seriesId); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID, seriesId); - } - if (_autoShowBuildDeckEnable) - { - return Wizard.Data.BuildDeckPurchaseInfo.GetSeriesId(_autoShowBuildDeckProductId); - } - int value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.SCENE_TRANSITION_VIEW_DECK_SERIES_ID); - if (value2 > -1) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SCENE_TRANSITION_VIEW_DECK_SERIES_ID, -1); - return value2; - } - return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID); - } - - private void OnBuildDeckInfoRequestFinished(NetworkTask.ResultCode error) - { - List seriesIdList = GetSeriesIdList(); - Dictionary seriesMasterDic = GetSeriesDataDictionary(); - List seriesList = Wizard.Data.BuildDeckPurchaseInfo.seriesList; - DisposeResource(); - foreach (BuildDeckSeriesPurchaseInfo item in seriesList) - { - foreach (BuildDeckProductInfo product in item.productList) - { - if (product.saleInfo.costTicket.HasValue && product.saleInfo.costTicketItemId.HasValue) - { - _loadResource.Add(ShopCommonUtility.GetTicketIconPath(product.saleInfo.costTicketItemId.Value.ToString(), isFetch: false)); - _loadResource.Add(ShopCommonUtility.GetTicketIconRightDownPath(product.saleInfo.costTicketItemId.Value.ToString(), isFetch: false)); - } - } - } - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadResource, delegate - { - StartCoroutine(loadSeriesImages(ResourcesManager.AssetLoadPathType.ShopBuildDeck, seriesIdList, seriesMasterDic, delegate - { - if (_drumrollSeriesImageList.Count <= 0) - { - UIManager.GetInstance().OnReadyViewScene(isFadein: true); - } - else - { - int viewSeriesId = GetViewSeriesId(); - int seriesIndex = seriesList.FindIndex((BuildDeckSeriesPurchaseInfo data) => data._seriesId == viewSeriesId); - if (seriesIndex < 0) - { - seriesIndex = 0; - } - List itemList = _drumrollSeriesImageList.Select((Texture tex, int index) => new ShopDrumrollScrollManager.DrumrollItem(tex, seriesList[index]._isNew)).ToList(); - StartCoroutine(_drumrollManager.CreateDrumrollScroll_Coroutine(itemList, seriesIndex, onSelectSeries, delegate - { - onSelectSeries(seriesIndex, delegate - { - UIManager.GetInstance().OnReadyViewScene(isFadein: true); - if (_autoShowBuildDeckEnable) - { - _autoShowBuildDeckEnable = false; - BuildDeckProductInfo productInfo = Wizard.Data.BuildDeckPurchaseInfo.GetProductInfo(_autoShowBuildDeckProductId); - if (productInfo != null) - { - createBuildDeckSelectBuyMeansDialog(productInfo); - } - } - }); - })); - } - })); - })); - } - - private List GetSeriesIdList() - { - return Wizard.Data.BuildDeckPurchaseInfo.seriesList.ConvertAll((BuildDeckSeriesPurchaseInfo info) => info._seriesId); - } - - private Dictionary GetSeriesDataDictionary() - { - Dictionary dictionary = new Dictionary(); - foreach (KeyValuePair item in Wizard.Data.Master.BuildDeckSeriesIdDic) - { - dictionary.Add(item.Key, item.Value); - } - return dictionary; - } - - private void onSelectSeries(int seriesIndex) - { - onSelectSeries(seriesIndex, null); - } - - private void onSelectSeries(int seriesIndex, Action onFinish) - { - BuildDeckSeriesPurchaseInfo seriesInfo = Wizard.Data.BuildDeckPurchaseInfo.seriesList[seriesIndex]; - _selectSeriesInfo = seriesInfo; - _titleLogoTexture.mainTexture = _seriesTitleImageList[seriesIndex]; - _labelSeriesDescription.text = seriesInfo._introduction; - if (seriesInfo.SeriesRewardList.Count > 0) - { - _btnSeriesRewards.gameObject.SetActive(value: true); - _btnSeriesRewards.onClick.Clear(); - _btnSeriesRewards.onClick.Add(new EventDelegate(delegate - { - OnClickSeriesRewardButton(seriesIndex); - })); - } - else - { - _btnSeriesRewards.gameObject.SetActive(value: false); - } - int num = _cacheSeriesIdList.IndexOf(seriesInfo._seriesId); - if (num != -1) - { - _cacheRefCountList[num]++; - ResetProductListScroll(seriesInfo.productList.Count); - onFinish.Call(); - return; - } - if (_cacheSeriesIdList.Count >= 4) - { - int num2 = _cacheRefCountList[0]; - int cacheIndex = 0; - for (int num3 = 1; num3 < _cacheRefCountList.Count; num3++) - { - if (num2 > _cacheRefCountList[num3]) - { - num2 = _cacheRefCountList[num3]; - cacheIndex = num3; - } - } - DeleteCacheSeriesByCashIndex(cacheIndex); - } - UIManager.GetInstance().LoadingViewManager.CreateInSceneCenter(); - StartCoroutine(loadBuildDecks(delegate - { - UIManager.GetInstance().LoadingViewManager.CloseInSceneCenter(); - if (_selectSeriesInfo == seriesInfo) - { - ResetProductListScroll(seriesInfo.productList.Count); - } - _cacheSeriesIdList.Add(seriesInfo._seriesId); - _cacheRefCountList.Add(1); - onFinish.Call(); - })); - } - - private void DeleteCacheSeriesByCashIndex(int cacheIndex) - { - List list = new List(); - BuildDeckSeriesPurchaseInfo buildDeckSeriesPurchaseInfo = Wizard.Data.BuildDeckPurchaseInfo.seriesList.Find((BuildDeckSeriesPurchaseInfo m) => m._seriesId == _cacheSeriesIdList[cacheIndex]); - if (buildDeckSeriesPurchaseInfo != null) - { - for (int num = 0; num < buildDeckSeriesPurchaseInfo.productList.Count; num++) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(buildDeckSeriesPurchaseInfo.productList[num].saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail)); - } - } - Toolbox.ResourcesManager.RemoveAssetGroup(list); - _cacheSeriesIdList.RemoveAt(cacheIndex); - _cacheRefCountList.RemoveAt(cacheIndex); - for (int num2 = 0; num2 < list.Count; num2++) - { - _cacheResourceList.Remove(list[num2]); - } - } - - private IEnumerator loadBuildDecks(Action callBack = null) - { - UIManager.GetInstance().createInSceneCenterLoading(); - List listResource = new List(); - List productList = _selectSeriesInfo.productList; - for (int i = 0; i < productList.Count; i++) - { - listResource.Add(Toolbox.ResourcesManager.GetAssetTypePath(productList[i].saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail)); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(listResource, null)); - UIManager.GetInstance().closeInSceneCenterLoading(); - for (int j = 0; j < listResource.Count; j++) - { - _cacheResourceList.Add(listResource[j]); - } - callBack.Call(); - } - - protected override void OnInitializeItem(GameObject go, int wrapIndex, int realIndex) - { - if (_selectSeriesInfo == null) - { - return; - } - if (realIndex >= _selectSeriesInfo.productList.Count || realIndex < 0) - { - go.SetActive(value: false); - return; - } - go.SetActive(value: true); - BuildDeckPlate plate = go.GetComponent(); - EventDelegate eventDelegate = new EventDelegate(this, "onPushBuyButton"); - eventDelegate.parameters[0].value = plate; - plate.SetData(_selectSeriesInfo.productList[realIndex], eventDelegate, delegate - { - _onTapBuildDeckImage(plate); - }); - } - - private void _onTapBuildDeckImage(BuildDeckPlate plate) - { - if (!(_dialogProductDetail != null)) - { - _dialogProductDetail = UIManager.GetInstance().CreateDialogClose(); - _dialogProductDetail.SetSize(DialogBase.Size.M); - _dialogProductDetail.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_003_Title")); - _dialogProductDetail.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - _dialogProductDetail.gameObject.layer = LayerMask.NameToLayer("MyPage"); - _dialogProductDetail.SetBackViewLayer(LayerMask.NameToLayer("MyPage")); - _dialogProductDetail.SetDepthAndSortingOrder(140, 2); - BuildDeckDetailWindow component = UnityEngine.Object.Instantiate(_prefabDialogBuildDeckDetail).GetComponent(); - _dialogProductDetail.SetObj(component.gameObject); - component.SetSingleData(_uiCardListClass, plate.ProductInfo); - _dialogProductDetail.OnClose = component.OnCloseWindow; - } - } - - private void onPushBuyButton(BuildDeckPlate plate) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _selectPlate = plate; - createBuildDeckSelectBuyMeansDialog(plate.ProductInfo); - } - - private void OnClickSeriesRewardButton(int seriesIndex) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DialogBase dialogBase = PurchaseRewardDialog.Create(Wizard.Data.BuildDeckPurchaseInfo.seriesList[seriesIndex].SeriesRewardList, _cardDetail, useLargeDetailDialog: false, PurchaseRewardDialog.Layout.NORMAL); - dialogBase.SetLayer("MyPage"); - dialogBase.SetDepthAndSortingOrder(140, 2); - } - - private void createBuildDeckSelectBuyMeansDialog(BuildDeckProductInfo pInfo) - { - if (_dialogSelectBuyMeans != null) - { - return; - } - _ = pInfo.is_purchased; - _dialogSelectBuyMeans = _createBaseDialogForSelectBuyMeans(pInfo.saleInfo); - BuildDeckSelectBuyMeansDialog component = UnityEngine.Object.Instantiate(_prefabDialogSelectBuyMeans).GetComponent(); - _dialogSelectBuyMeans.SetObj(component.gameObject); - Action onPushBuyCrystalBtnCallBack = null; - Action onPushBuyRupyBtnCallBack = null; - Action onPushBuyTicketBtnCallBack = null; - if (pInfo.saleInfo.isFree) - { - _dialogSelectBuyMeans.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - _dialogSelectBuyMeans.SetButtonText(Wizard.Data.SystemText.Get("Shop_0082")); - _dialogSelectBuyMeans.onPushButton1 = delegate - { - _purchaseProductInfo = pInfo; - UIManager.GetInstance().createInSceneCenterLoading(); - StartBuyBuildDeck(ShopCommonUtility.SalesType.free, pInfo.product_id); - }; - } - else - { - _dialogSelectBuyMeans.SetButtonLayout(DialogBase.ButtonLayout.NONE); - onPushBuyCrystalBtnCallBack = delegate - { - _purchaseProductInfo = pInfo; - _createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.crystal, delegate - { - StartBuyBuildDeck(ShopCommonUtility.SalesType.crystal, pInfo.product_id); - }); - }; - onPushBuyRupyBtnCallBack = delegate - { - _purchaseProductInfo = pInfo; - _createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.rupy, delegate - { - StartBuyBuildDeck(ShopCommonUtility.SalesType.rupy, pInfo.product_id); - }); - }; - onPushBuyTicketBtnCallBack = delegate - { - _purchaseProductInfo = pInfo; - _createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.ticket, delegate - { - StartBuyBuildDeck(ShopCommonUtility.SalesType.ticket, pInfo.product_id); - }); - }; - } - component.Init(pInfo, _dialogSelectBuyMeans, onPushBuyCrystalBtnCallBack, onPushBuyRupyBtnCallBack, onPushBuyTicketBtnCallBack); - } - - private DialogBase _createBaseDialogForSelectBuyMeans(ShopCommonSaleInfo info) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_001_Title")); - dialogBase.SetReturnMsg(null, ""); - return dialogBase; - } - - private void _createPurchaseConfirmDialog(ShopCommonSaleInfo info, ShopCommonUtility.SalesType costType, Action buyApiFunc) - { - if (!(_dialogPurchaseConfirm != null) && ShopCommonUtility.IsHaveEnoughCost(info, costType, delegate - { - if (_dialogCrystalShortage == null) - { - _dialogCrystalShortage = ShopCommonUtility.CreateCrystalShortagePopup(); - } - })) - { - string warningTextId = (_purchaseProductInfo.ContainsOnlyRotationCards() ? null : "Shop_0139"); - _dialogPurchaseConfirm = ShopCommonUtility.CreatePurchaseConfirmPopup(info, costType, _prefabDialogPurchaseConfirm, buyApiFunc, warningTextId); - _dialogPurchaseConfirm.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_002_Title")); - } - } - - private void _OnFailurePurchase(NetworkTask.ResultCode code) - { - _isBuyConnect = false; - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - private void _OnResultCodeError(int code) - { - if (code != 110) - { - _isBuyConnect = false; - UIManager.GetInstance().closeInSceneCenterLoading(); - _ReloadBuildDeckInfo(); - } - } - - private void ShowRewardDialog(Action onFinish) - { - if (_buyTask.LotteryRewardList.Count == 0) - { - onFinish.Call(); - return; - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Story_0029")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent(); - foreach (ReceivedReward lotteryReward in _buyTask.LotteryRewardList) - { - component.AddReward(lotteryReward); - if (!string.IsNullOrEmpty(lotteryReward.reward_message)) - { - dialogBase.SetTitleLabel(lotteryReward.reward_message); - } - } - component.EndCreate(); - dialogBase.OnClose = delegate - { - onFinish.Call(); - }; - } - - private void ShowLotteryApplyDialog(Action onFinish) - { - UIManager.GetInstance().LoadingViewManager.CreateInSceneCenter(); - string lotteryTexturePath = LotteryApplyDialog.GetLotteryTexturePath(_buyTask.LotteryData, isFetch: false); - _loadResource.Add(lotteryTexturePath); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(lotteryTexturePath, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - LotteryApplyDialog.Create(_buyTask.LotteryData, autoClose: false).OnClose = delegate - { - ShowRewardDialog(delegate - { - onFinish.Call(); - }); - }; - })); - } - - private void onSuccessPurchase(NetworkTask.ResultCode error, ShopCommonUtility.SalesType salesType) - { - _isBuyConnect = false; - BuildDeckProductInfo savePurchaseProductInfo = _purchaseProductInfo; - if (_purchaseProductInfo != null) - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID, _selectSeriesInfo._seriesId); - if (salesType == ShopCommonUtility.SalesType.ticket) - { - _addShowSeriesId = _selectSeriesInfo._seriesId; - } - if (!_buyTask.LotteryData.IsEnable && _buyTask.MissionRewardList.Count == 0) - { - ShowCreateDeckDialog(savePurchaseProductInfo); - } - else if (_buyTask.LotteryData.IsEnable) - { - ShowLotteryApplyDialog(delegate - { - ShowCreateDeckDialog(savePurchaseProductInfo); - }); - } - else if (_buyTask.MissionRewardList.Count > 0) - { - ShowMissionRewardDialog(delegate - { - ShowCreateDeckDialog(savePurchaseProductInfo); - }); - } - } - _ReloadBuildDeckInfo(); - } - - private void ShowCreateDeckDialog(BuildDeckProductInfo savePurchaseProductInfo) - { - DialogBase diaChange = UIManager.GetInstance().CreateDialogClose(); - bool hasResurgentCard = savePurchaseProductInfo.HasResurgentCard; - string empty = string.Empty; - empty = ((_buyTask._seriesRewardList.Count > 0) ? Wizard.Data.SystemText.Get("Shop_0144", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")) : ((!hasResurgentCard) ? Wizard.Data.SystemText.Get("Shop_0124", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")) : Wizard.Data.SystemText.Get("Shop_0256", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")))); - diaChange.SetText(empty); - diaChange.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_004_Title")); - diaChange.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - diaChange.SetButtonText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_001_Button")); - _purchaseDeckName = savePurchaseProductInfo.saleInfo.name; - _purchaseDeckClassId = savePurchaseProductInfo.leader_id; - _purchaseDeckCardIds = savePurchaseProductInfo.CardIdList; - if (hasResurgentCard) - { - diaChange.onPushButton1 = delegate - { - CheckEmptyDeck(Format.Rotation); - }; - } - else - { - diaChange.onPushButton1 = OpenSelectFormatDialog; - } - diaChange.onPushButton2 = delegate - { - diaChange.CloseWithoutSelect(); - }; - diaChange.onCloseWithoutSelect = delegate - { - UIManager.GetInstance().StartCoroutine(ShowAchieveLog(_buyTask.NotificatonAnimationParams)); - _buyTask.NotificatonAnimationParams = null; - }; - } - - private void ShowMissionRewardDialog(Action onFinish) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Story_0029")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.OnClose = delegate - { - onFinish.Call(); - }; - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent(); - for (int num = 0; num < _buyTask.MissionRewardList.Count; num++) - { - component.AddReward(_buyTask.MissionRewardList[num]); - } - component.EndCreate(); - } - - private IEnumerator ShowAchieveLog(List paramList) - { - if (paramList != null) - { - if (_notificationAnimation != null) - { - UnityEngine.Object.Destroy(_notificationAnimation.gameObject); - _notificationAnimation = null; - } - _notificationAnimation = NGUITools.AddChild(_achieveLog, _notificationAnimationPrefab.gameObject).GetComponent(); - yield return StartCoroutine(_notificationAnimation.Exec(paramList)); - } - } - - private void CheckEmptyDeck(Format format) - { - _deckCreateFormat = format; - EmptyDeckInfoTask emptyDeckInfoTask = new EmptyDeckInfoTask(); - emptyDeckInfoTask.SetParameter(_deckCreateFormat); - StartCoroutine(Toolbox.NetworkManager.Connect(emptyDeckInfoTask, OnSuccessDeckListCheck)); - } - - private void OpenSelectFormatDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - SystemText systemText = Wizard.Data.SystemText; - dialogBase.SetText(systemText.Get("Shop_0138")); - dialogBase.SetTitleLabel(systemText.Get("Dia_BuyBuildDeck_004_Title")); - dialogBase.AddButton(DialogBase.ButtonType.Blue, isReflect: true, systemText.Get("Common_0155")); - dialogBase.AddButton(DialogBase.ButtonType.Blue, isReflect: true, systemText.Get("Common_0154")); - dialogBase.onPushButton1 = delegate - { - CheckEmptyDeck(Format.Unlimited); - }; - dialogBase.onPushButton2 = delegate - { - CheckEmptyDeck(Format.Rotation); - }; - dialogBase.onCloseWithoutSelect = delegate - { - UIManager.GetInstance().StartCoroutine(ShowAchieveLog(_buyTask.NotificatonAnimationParams)); - _buyTask.NotificatonAnimationParams = null; - }; - } - - private void OnSuccessDeckListCheck(NetworkTask.ResultCode errorcode) - { - if (Wizard.Data.EmptyDeckInfo.CanDeckCreate) - { - SetUpDeckDataAndChangeViewDeckEdit(); - return; - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Body")); - dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Title")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetButtonText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Button")); - dialogBase.onPushButton1 = delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - IsUpdateFooterMenuTexture = true - }; - DeckListUI.ChangeSceneToDeckList(_deckCreateFormat, param); - }; - } - - private void SetUpDeckDataAndChangeViewDeckEdit() - { - DeckData deckData = new DeckData(); - deckData.SetDeckClassID(_purchaseDeckClassId); - deckData.SetDeckSleeveID(3000011L); - deckData.SetDeckIsComplete(isComplete: true); - deckData.SetCardIdList(_purchaseDeckCardIds); - DeckData deckData2 = new DeckData(_deckCreateFormat, DeckAttributeType.CustomDeck); - deckData2.SetDeckID(Wizard.Data.EmptyDeckInfo.EmptyDeckID); - DeckCardEditUI.SetBuildDeckEditParameter(deckData, _purchaseDeckName, deckData2); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.DeckCardEdit); - } - - private void _ReloadBuildDeckInfo() - { - if (MyPageMenu.Instance != null) - { - MyPageMenu.Instance.UpdateCrystalCount(); - MyPageMenu.Instance.UpdateRupyCount(); - } - else - { - UIManager.GetInstance().UpDateCrystalNum(); - } - List oldSeriesList = new List(Wizard.Data.BuildDeckPurchaseInfo.seriesList); - StartGetBuildDeckInfo(delegate - { - bool flag = false; - List seriesList = Wizard.Data.BuildDeckPurchaseInfo.seriesList; - for (int i = 0; i < seriesList.Count; i++) - { - if (oldSeriesList[i]._seriesId != seriesList[i]._seriesId) - { - flag = true; - } - if (seriesList[i]._seriesId == _selectSeriesInfo._seriesId) - { - if (_selectPlate != null) - { - if (_selectPlate.ProductInfo.product_id == _purchaseProductInfo.product_id) - { - _selectSeriesInfo = seriesList[i]; - BuildDeckPlate[] componentsInChildren = _wrapContent.gameObject.GetComponentsInChildren(); - foreach (BuildDeckPlate plate in componentsInChildren) - { - int realIndex = _selectSeriesInfo.productList.FindIndex((BuildDeckProductInfo p) => p.product_id == plate.ProductInfo.product_id); - OnInitializeItem(plate.gameObject, 0, realIndex); - } - } - else - { - onSelectSeries(i); - } - } - else - { - onSelectSeries(i); - } - } - } - if (oldSeriesList.Count != seriesList.Count) - { - flag = true; - } - _purchaseProductInfo = null; - _selectPlate = null; - if (flag) - { - List seriesIdList = GetSeriesIdList(); - Dictionary seriesDataDictionary = GetSeriesDataDictionary(); - StartCoroutine(loadSeriesImages(ResourcesManager.AssetLoadPathType.ShopBuildDeck, seriesIdList, seriesDataDictionary, delegate - { - List itemList = _drumrollSeriesImageList.ConvertAll((Texture tex) => new ShopDrumrollScrollManager.DrumrollItem(tex)); - StartCoroutine(_drumrollManager.CreateDrumrollScroll_Coroutine(itemList, 0, onSelectSeries, delegate - { - onSelectSeries(0); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - })); - } - else - { - UIManager.GetInstance().closeInSceneCenterLoading(); - } - }); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckSelectBuyMeansDialog.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckSelectBuyMeansDialog.cs deleted file mode 100644 index 248af8e7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckSelectBuyMeansDialog.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using UnityEngine; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckSelectBuyMeansDialog : BaseSelectBuyMeansDialog -{ - [SerializeField] - private BuildDeckProductDetail _buildDeckProductDetail; - - public void Init(BuildDeckProductInfo productInfo, DialogBase dialog, Action onPushBuyCrystalBtnCallBack, Action onPushBuyRupyBtnCallBack, Action onPushBuyTicketBtnCallBack) - { - _buildDeckProductDetail.SetSingleProductDetail(productInfo); - _Init(productInfo.saleInfo, dialog, onPushBuyCrystalBtnCallBack, onPushBuyRupyBtnCallBack, onPushBuyTicketBtnCallBack); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckSeriesPurchaseInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckSeriesPurchaseInfo.cs deleted file mode 100644 index f53981b0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase/BuildDeckSeriesPurchaseInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -public class BuildDeckSeriesPurchaseInfo -{ - private List _productList = new List(); - - private List _seriesRewardList = new List(); - - public int _seriesId { get; set; } - - public string _introduction { get; set; } - - public bool _isNew { get; set; } - - public List productList => _productList; - - public List SeriesRewardList => _seriesRewardList; -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseBuyTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseBuyTask.cs index f3752158..5adf0098 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseBuyTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseBuyTask.cs @@ -4,9 +4,6 @@ public class ItemPurchaseBuyTask : BaseTask { public class ItemPurchaseBuyTaskParam : BaseParam { - public int purchase_id; - - public int rest; } public ItemPurchaseBuyTask() @@ -14,14 +11,6 @@ public class ItemPurchaseBuyTask : BaseTask base.type = ApiType.Type.ItemPurchaseBuy; } - public void SetParameter(int purchaseId, int rest) - { - ItemPurchaseBuyTaskParam itemPurchaseBuyTaskParam = new ItemPurchaseBuyTaskParam(); - itemPurchaseBuyTaskParam.purchase_id = purchaseId; - itemPurchaseBuyTaskParam.rest = rest; - base.Params = itemPurchaseBuyTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseData.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseData.cs deleted file mode 100644 index 6a954262..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseData.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase; - -public class ItemPurchaseData -{ - public int purchase_id { get; set; } - - public UserGoods.Type purchase_item_type { get; set; } - - public long PurchaseUserGoodsId { get; set; } - - public int purchase_item_num { get; set; } - - public string purchase_name { get; set; } - - public UserGoods.Type require_item_type { get; set; } - - public long RequireUserGoodsId { get; set; } - - public int require_item_num { get; set; } - - public bool isMonthryReset { get; set; } - - public string purchase_begin_time { get; set; } - - public string purchase_end_time { get; set; } - - public int rest { get; set; } - - public string textureName { get; set; } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfo.cs index c29dd8c4..7cecfc4d 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfo.cs @@ -4,7 +4,4 @@ namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase; public class ItemPurchaseInfo { - private List _itemPurchaseList = new List(); - - public List itemPurchaseList => _itemPurchaseList; } diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfoTask.cs deleted file mode 100644 index e00a28e1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.ItemPurchase/ItemPurchaseInfoTask.cs +++ /dev/null @@ -1,56 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase; - -public class ItemPurchaseInfoTask : BaseTask -{ - public ItemPurchaseInfoTask() - { - base.type = ApiType.Type.ItemPurchaseInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Wizard.Data.ItemPurchaseInfo.itemPurchaseList.Clear(); - JsonData jsonData = base.ResponseData["data"]["item_purchase_info"]; - for (int i = 0; i < jsonData.Count; i++) - { - ItemPurchaseData itemData = new ItemPurchaseData(); - itemData.purchase_id = jsonData[i]["purchase_id"].ToInt(); - itemData.purchase_item_type = (UserGoods.Type)jsonData[i]["purchase_item_type"].ToInt(); - itemData.PurchaseUserGoodsId = jsonData[i]["purchase_item_id"].ToLong(); - itemData.purchase_item_num = jsonData[i]["purchase_item_num"].ToInt(); - itemData.purchase_name = jsonData[i]["purchase_name"].ToString(); - if (string.IsNullOrEmpty(itemData.purchase_name)) - { - string userGoodsName = UserGoods.getUserGoodsName(itemData.purchase_item_type, itemData.PurchaseUserGoodsId); - itemData.purchase_name = Wizard.Data.SystemText.Get("Shop_0132", userGoodsName.ToString(), itemData.purchase_item_num.ToString()); - } - itemData.require_item_type = (UserGoods.Type)jsonData[i]["require_item_type"].ToInt(); - itemData.RequireUserGoodsId = jsonData[i]["require_item_id"].ToLong(); - itemData.require_item_num = jsonData[i]["require_item_num"].ToInt(); - itemData.isMonthryReset = ((jsonData[i]["is_monthly_reset"].ToInt() != 0) ? true : false); - itemData.rest = jsonData[i]["rest"].ToInt(); - if (itemData.purchase_item_type == UserGoods.Type.Item) - { - itemData.textureName = Wizard.Data.Master.ItemList.Find((Item data) => data.UserGoodsId == itemData.PurchaseUserGoodsId).thumbnail; - } - else - { - itemData.textureName = UserGoods.GetUserGoodsImageName(itemData.purchase_item_type, itemData.PurchaseUserGoodsId); - } - Wizard.Data.ItemPurchaseInfo.itemPurchaseList.Add(itemData); - } - JsonData jsonData2 = base.ResponseData["data"]["user_card_pack_ticket_list"]; - for (int num2 = 0; num2 < jsonData2.Count; num2++) - { - PlayerStaticData.UpdateItemNum(jsonData2[num2]["item_id"].ToInt(), jsonData2[num2]["number"].ToInt()); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinBuyMultiRewardTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinBuyMultiRewardTask.cs index edd658d5..99bbfde9 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinBuyMultiRewardTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinBuyMultiRewardTask.cs @@ -5,8 +5,6 @@ public class SkinBuyMultiRewardTask : BaseTask public class SkinBuyMultiRewardTaskParam : BaseParam { public int series_id; - - public int sales_type; } public SkinBuyMultiRewardTask() diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinSeriesPurchaseInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinSeriesPurchaseInfo.cs index 5d8fafff..1a09f2d1 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinSeriesPurchaseInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SkinPurchase/SkinSeriesPurchaseInfo.cs @@ -7,14 +7,11 @@ public class SkinSeriesPurchaseInfo public enum RewardStatus { none, - not_got, - got - } + not_got } public enum eSetSalesStatus { None, - Enable, Disable } diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleeveProductInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleeveProductInfo.cs deleted file mode 100644 index b4fc5b82..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleeveProductInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard.Scripts.Network.Data.TaskData.SleevePurchase; - -public class SleeveProductInfo -{ - private List _rewardInfoList = new List(); - - public int product_id { get; set; } - - public ShopCommonSaleInfo saleInfo { get; set; } - - public List rewardInfoList => _rewardInfoList; - - public bool is_purchased { get; set; } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleevePurchaseInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleevePurchaseInfo.cs index 9792a87c..607aa158 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleevePurchaseInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleevePurchaseInfo.cs @@ -4,7 +4,4 @@ namespace Wizard.Scripts.Network.Data.TaskData.SleevePurchase; public class SleevePurchaseInfo { - private List m_SeriesList = new List(); - - public List seriesList => m_SeriesList; } diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleeveSeriesPurchaseInfo.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleeveSeriesPurchaseInfo.cs deleted file mode 100644 index a969685f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SleevePurchase/SleeveSeriesPurchaseInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard.Scripts.Network.Data.TaskData.SleevePurchase; - -public class SleeveSeriesPurchaseInfo -{ - private List m_ProductList = new List(); - - public int series_id { get; set; } - - public List productList => m_ProductList; - - public bool IsNew { get; set; } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeInfoTask.cs deleted file mode 100644 index e4662c37..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeInfoTask.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard.Scripts.Network.Data.TaskData.SpotCardExchange; - -public class SpotCardExchangeInfoTask : BaseTask -{ - public class PrereleaseExchangeInfo - { - private int _exchangeablePrereleaseCardLimit; - - private int _exchangedPrereleaseCardCount; - - public bool IsPrerelease { get; private set; } - - public int RemainingExchangeableCount - { - get - { - if (IsPrerelease) - { - return _exchangeablePrereleaseCardLimit - _exchangedPrereleaseCardCount; - } - return 0; - } - } - - public PrereleaseExchangeInfo(JsonData jsonData) - { - IsPrerelease = jsonData["is_pre_release"].ToBoolean(); - _exchangeablePrereleaseCardLimit = jsonData["pre_release_spot_card_exchange_limit"].ToInt(); - _exchangedPrereleaseCardCount = jsonData["pre_release_spot_card_exchange_count"].ToInt(); - } - } - - public Dictionary> ExchangeableSpotCardListInClassDict { get; private set; } - - public int NextCycleOutPackId { get; private set; } - - public PrereleaseExchangeInfo PrereleaseInfo { get; private set; } - - public SpotCardExchangeInfoTask() - { - base.type = ApiType.Type.SpotCardInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - PlayerStaticData.UserSpotCardPointCount = jsonData["spot_point"].ToInt(); - ExchangeableSpotCardListInClassDict = new Dictionary>(); - for (CardBasePrm.ClanType clanType = CardBasePrm.ClanType.ALL; clanType < CardBasePrm.ClanType.MAX; clanType++) - { - ExchangeableSpotCardListInClassDict[clanType] = new List(); - JsonData jsonData2 = jsonData["exchangeable_card_list"][(int)clanType]; - List list = new List(jsonData2.Keys); - for (int i = 0; i < list.Count; i++) - { - JsonData jsonData3 = jsonData2[list[i]]; - for (int j = 0; j < jsonData3.Count; j++) - { - SpotCardExchangeInfo item = new SpotCardExchangeInfo(jsonData3[j], int.Parse(list[i])); - ExchangeableSpotCardListInClassDict[clanType].Add(item); - } - } - } - int.TryParse(jsonData["soon_cycle_out_card_set_id"].ToString(), out var result); - NextCycleOutPackId = result; - PrereleaseInfo = new PrereleaseExchangeInfo(jsonData["pre_relase_info"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeTask.cs index cce61d24..c0246275 100644 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeTask.cs @@ -5,8 +5,6 @@ public class SpotCardExchangeTask : BaseTask public class SpotCardExchangeTaskParam : BaseParam { public int card_id; - - public int exchange_point; } public SpotCardExchangeTask() @@ -14,14 +12,6 @@ public class SpotCardExchangeTask : BaseTask base.type = ApiType.Type.SpotCardExchange; } - public void SetParameter(int cardId, int exchangePoint) - { - SpotCardExchangeTaskParam spotCardExchangeTaskParam = new SpotCardExchangeTaskParam(); - spotCardExchangeTaskParam.card_id = cardId; - spotCardExchangeTaskParam.exchange_point = exchangePoint; - base.Params = spotCardExchangeTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.Competition/CardChooseTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.Competition/CardChooseTask.cs deleted file mode 100644 index d459430a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.Competition/CardChooseTask.cs +++ /dev/null @@ -1,45 +0,0 @@ -using LitJson; -using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; -using Wizard.Scripts.Network.Data.TaskData.Arena.TwoPick; - -namespace Wizard.Scripts.Network.Task.Arena.Competition; - -public class CardChooseTask : BaseTask -{ - public class CompetitionCardChooseTaskParam : BaseParam - { - public int selected_id; - } - - public CandidateCardInfo CandidateCardInfo; - - public Deck DeckInfo; - - public CardChooseTask() - { - base.type = ApiType.Type.CompetitionCardChoose; - } - - public void SetParameter(int selected_id) - { - CompetitionCardChooseTaskParam competitionCardChooseTaskParam = new CompetitionCardChooseTaskParam(); - competitionCardChooseTaskParam.selected_id = selected_id; - base.Params = competitionCardChooseTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - DeckInfo = new Deck(jsonData["deck_info"]); - if (!DeckInfo.isSelectCompleted) - { - CandidateCardInfo = new CandidateCardInfo(jsonData["candidate_card_list"]); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/CardChooseTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/CardChooseTask.cs deleted file mode 100644 index bdb55975..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/CardChooseTask.cs +++ /dev/null @@ -1,39 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class CardChooseTask : BaseTask -{ - public class ArenaTwoPickCardChooseTaskParam : BaseParam - { - public int selected_id; - } - - public CardChooseTask() - { - base.type = ApiType.Type.ArenaTwoPickCardChoose; - } - - public void SetParameter(int selected_id) - { - ArenaTwoPickCardChooseTaskParam arenaTwoPickCardChooseTaskParam = new ArenaTwoPickCardChooseTaskParam(); - arenaTwoPickCardChooseTaskParam.selected_id = selected_id; - base.Params = arenaTwoPickCardChooseTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - Wizard.Data.TwoPickInfo.SetDeckInfo(jsonData["deck_info"]); - if (!Wizard.Data.TwoPickInfo.deckInfo.isSelectCompleted) - { - Wizard.Data.TwoPickInfo.SetCandidateCardList(jsonData["candidate_card_list"]); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/ClassCharaChooseTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/ClassCharaChooseTask.cs deleted file mode 100644 index 89bd6380..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/ClassCharaChooseTask.cs +++ /dev/null @@ -1,37 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class ClassCharaChooseTask : BaseTask -{ - public class ArenaTwoPickClassCharaChooseTaskParam : BaseParam - { - public int class_id; - } - - public ClassCharaChooseTask() - { - base.type = ApiType.Type.ArenaTwoPickClassCharaChoose; - } - - public void SetParameter(int class_id) - { - ArenaTwoPickClassCharaChooseTaskParam arenaTwoPickClassCharaChooseTaskParam = new ArenaTwoPickClassCharaChooseTaskParam(); - arenaTwoPickClassCharaChooseTaskParam.class_id = class_id; - base.Params = arenaTwoPickClassCharaChooseTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - Wizard.Data.TwoPickInfo.SetClassInfo(jsonData["class_info"]); - Wizard.Data.TwoPickInfo.SetDeckInfo(jsonData["deck_info"]); - Wizard.Data.TwoPickInfo.SetCandidateCardList(jsonData["candidate_card_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/EntryTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/EntryTask.cs deleted file mode 100644 index 49c56a9d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/EntryTask.cs +++ /dev/null @@ -1,31 +0,0 @@ -using LitJson; -using Wizard.Scripts.Network.Data.TaskData.Arena; -using Wizard.Scripts.Network.Data.TaskData.Arena.TwoPick; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class EntryTask : ArenaEntryTaskBase -{ - public class ArenaTwoPickPrepareTaskParam : BaseParam - { - public int consume_item_type; - } - - public EntryTask() - { - base.type = ApiType.Type.ArenaTwoPickEntry; - } - - public override void SetParameter(int consumeItemType) - { - ArenaTwoPickPrepareTaskParam arenaTwoPickPrepareTaskParam = new ArenaTwoPickPrepareTaskParam(); - arenaTwoPickPrepareTaskParam.consume_item_type = consumeItemType; - base.Params = arenaTwoPickPrepareTaskParam; - } - - protected override void SetResponseParams(JsonData data, JsonData headerData) - { - Wizard.Data.TwoPickEntry = new Entry(data); - Wizard.Data.TwoPickInfo = new TwoPickInfo(data, headerData); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/FinishTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/FinishTask.cs deleted file mode 100644 index 5a794188..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/FinishTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class FinishTask : BaseTask -{ - public class FinishTaskParam : BaseParam - { - } - - public FinishTask() - { - base.type = ApiType.Type.ArenaTwoPickFinish; - } - - public void SetParameter() - { - FinishTaskParam finishTaskParam = new FinishTaskParam(); - base.Params = finishTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - Wizard.Data.TwoPickInfo.SetEntryRewardList(jsonData["rewards"]); - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/RetireTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/RetireTask.cs deleted file mode 100644 index 24b69094..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/RetireTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class RetireTask : ArenaRetireTaskBase -{ - public class RetireTaskParam : BaseParam - { - } - - public RetireTask() - { - base.type = ApiType.Type.ArenaTwoPickRetire; - } - - public override void SetParameter() - { - RetireTaskParam retireTaskParam = new RetireTaskParam(); - base.Params = retireTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - Wizard.Data.TwoPickInfo.SetEntryRewardList(jsonData["rewards"]); - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TopTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TopTask.cs deleted file mode 100644 index 15b33b1c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TopTask.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Wizard.Scripts.Network.Data.TaskData.Arena; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class TopTask : ArenaTopTaskBase -{ - public class ArenaTwoPickTopTaskParam : BaseParam - { - public int mode; - } - - public TopTask() - { - base.type = ApiType.Type.ArenaTwoPickTop; - } - - public override void SetParameter() - { - ArenaTwoPickTopTaskParam arenaTwoPickTopTaskParam = new ArenaTwoPickTopTaskParam(); - base.Params = arenaTwoPickTopTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Wizard.Data.TwoPickInfo = new TwoPickInfo(base.ResponseData["data"], base.ResponseData["data_headers"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TwoPickDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TwoPickDoMatchingTask.cs deleted file mode 100644 index 8fb77079..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TwoPickDoMatchingTask.cs +++ /dev/null @@ -1,53 +0,0 @@ -using LitJson; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class TwoPickDoMatchingTask : DoMatchingBase -{ - private const string DATA = "data"; - - private const string DISCOVERED_REWAED = "discovered_reward"; - - private const string GRADE_ID = "grade_id"; - - private const string REWARD_MESSAGE = "reward_message"; - - public TwoPickDoMatchingTask() - { - base.type = ApiType.Type.ArenaTwoPickDoMatching; - if (GameMgr.GetIns().GetDataMgr().TwoPickFormat == TwoPickFormat.Chaos) - { - base.type = ApiType.Type.ArenaTwoPickChaosDoMatching; - } - if (GameMgr.GetIns().GetDataMgr().TwoPickFormat == TwoPickFormat.Cube) - { - base.type = ApiType.Type.ArenaTwoPickCubeDoMatching; - } - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - SettingDoMatchingData(); - if (base.ResponseData["data"].Keys.Contains("discovered_reward")) - { - if (base.ResponseData["data"]["discovered_reward"].Keys.Contains("grade_id")) - { - JsonData jsonData = base.ResponseData["data"]["discovered_reward"]["grade_id"]; - JsonData jsonData2 = base.ResponseData["data"]["discovered_reward"]["reward_message"]; - Wizard.Data.DoMatchingDetail.data.SetWinnerRewardInfo(jsonData.ToInt(), jsonData2.ToString()); - } - } - else - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE, 0); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING, ""); - Wizard.Data.DoMatchingDetail.data.ClearWinnerRewardInfo(); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TwoPickFinishBattleTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TwoPickFinishBattleTask.cs deleted file mode 100644 index 44b52d5c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena.TwoPick/TwoPickFinishBattleTask.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Wizard.Scripts.Network.Data.TaskData.Arena; - -namespace Wizard.Scripts.Network.Task.Arena.TwoPick; - -public class TwoPickFinishBattleTask : FinishTaskBase -{ - public TwoPickFinishBattleTask() - { - base.type = ApiType.Type.ArenaTwoPickFinishBattle; - if (GameMgr.GetIns().GetDataMgr().TwoPickFormat == TwoPickFormat.Chaos) - { - base.type = ApiType.Type.ArenaTwoPickChaosFinishBattle; - } - if (GameMgr.GetIns().GetDataMgr().TwoPickFormat == TwoPickFormat.Cube) - { - base.type = ApiType.Type.ArenaTwoPickCubeFinishBattle; - } - Wizard.Data.ArenaBattleFinish = null; - } - - protected override int Parse() - { - int num = base.Parse(); - if (IsEffectiveErrorCode(num)) - { - return num; - } - Wizard.Data.ArenaBattleFinish = new Finish(); - if (!IsResponseDataExist(base.ResponseData)) - { - return num; - } - new BattleFinishResponsProcessing().Processing(base.ResponseData, Wizard.Data.ArenaBattleFinish.data); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaEntryTaskBase.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaEntryTaskBase.cs deleted file mode 100644 index 3416fde5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaEntryTaskBase.cs +++ /dev/null @@ -1,37 +0,0 @@ -using LitJson; -using Wizard.Scripts.Network.Task.Arena.TwoPick; - -namespace Wizard.Scripts.Network.Task.Arena; - -public abstract class ArenaEntryTaskBase : BaseTask -{ - public ArenaEntryTaskBase() - { - } - - public abstract void SetParameter(int consumeItemType); - - public static ArenaEntryTaskBase GetTaskInstance(int mode) - { - ArenaEntryTaskBase result = null; - if (mode == 1) - { - result = new EntryTask(); - } - return result; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - SetResponseParams(base.ResponseData["data"], base.ResponseData["data_headers"]); - return num; - } - - protected abstract void SetResponseParams(JsonData data, JsonData headerData); -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaRetireTaskBase.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaRetireTaskBase.cs deleted file mode 100644 index eca52125..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaRetireTaskBase.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Wizard.Scripts.Network.Task.Arena.TwoPick; - -namespace Wizard.Scripts.Network.Task.Arena; - -public abstract class ArenaRetireTaskBase : BaseTask -{ - public ArenaRetireTaskBase() - { - } - - public abstract void SetParameter(); - - public static ArenaRetireTaskBase GetTaskInstance(int mode) - { - ArenaRetireTaskBase result = null; - if (mode == 1) - { - result = new RetireTask(); - } - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaTopTaskBase.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaTopTaskBase.cs deleted file mode 100644 index 2cb64c72..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.Arena/ArenaTopTaskBase.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Wizard.Scripts.Network.Task.Arena.TwoPick; - -namespace Wizard.Scripts.Network.Task.Arena; - -public abstract class ArenaTopTaskBase : BaseTask -{ - public ArenaTopTaskBase() - { - } - - public abstract void SetParameter(); - - public static ArenaTopTaskBase GetTaskInstance(int mode) - { - ArenaTopTaskBase result = null; - if (mode == 1) - { - result = new TopTask(); - } - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.ItemAcquireHistory/ItemAcquireHistoryInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.ItemAcquireHistory/ItemAcquireHistoryInfoTask.cs deleted file mode 100644 index 9859856e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Task.ItemAcquireHistory/ItemAcquireHistoryInfoTask.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Wizard.Scripts.Network.Data.TaskData; - -namespace Wizard.Scripts.Network.Task.ItemAcquireHistory; - -public class ItemAcquireHistoryInfoTask : BaseTask -{ - public class ItemAcquireHistoryInfoTaskParam : BaseParam - { - } - - public ItemAcquireHistoryInfoTask() - { - base.type = ApiType.Type.ItemAcquireHistoryInfo; - } - - public void SetParameter() - { - ItemAcquireHistoryInfoTaskParam itemAcquireHistoryInfoTaskParam = new ItemAcquireHistoryInfoTaskParam(); - base.Params = itemAcquireHistoryInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Wizard.Data.ItemAcquireHistoryInfo = new ItemAcquireHistoryInfo(base.ResponseData["data"]["histories"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIActivateCountTagArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIActivateCountTagArgument.cs index c15b1b93..d0e2e750 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIActivateCountTagArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIActivateCountTagArgument.cs @@ -10,12 +10,6 @@ public class AIActivateCountTagArgument : AIScriptArgumentExpressions AIScriptTokenArgType.NONE }; - protected const int RESET_SIDE_TYPE_OFFSET = 3; - - protected const int SKILL_OWNER_ID_OFFSET = 2; - - protected const int SKILL_INDEX_OFFSET = 1; - public AIScriptTokenArgType ResetSideType { get; protected set; } public int SkillOwnerId { get; protected set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackBanish.cs b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackBanish.cs index 03ffce2d..ae723777 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackBanish.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackBanish.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIAfterAttackBanish : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_ARG_INDEX = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackDraw.cs index ed2df9aa..2a63db27 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackDraw.cs @@ -6,8 +6,6 @@ public class AIAfterAttackDraw : AIFiltersArgument { private AIPolishConvertedExpression _drawCountArg; - private const int DRAW_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIAfterAttackDraw(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackEvo.cs b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackEvo.cs index 91174551..bd874ac6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackEvo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackEvo.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIAfterAttackEvo : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_ARG_INDEX = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackHeal.cs index 885d968c..095e6751 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAfterAttackHeal.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIAfterAttackHeal : AITriggerAndTargetFiltersTagBase { - private const int HEAL_AMOUNT_ARG_INDEX = 1; public AIPolishConvertedExpression HealAmount { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttachEventToBattleModuleUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttachEventToBattleModuleUtility.cs index c63e44ea..dfd6fba4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttachEventToBattleModuleUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttachEventToBattleModuleUtility.cs @@ -14,80 +14,6 @@ public static class AIAttachEventToBattleModuleUtility SetupOperateMgrEvent(operateMgr, ai); } - public static void DepriveAttachedAIBattleModule(BattlePlayerBase ally, BattlePlayerBase opponent, OperateMgr operateMgr, EnemyAI ai) - { - DepriveAttachedPlayerBattleEvent(ally, opponent, ai.PlayerBattleEvent); - DepriveAttachedOperateMgrBattleEvent(operateMgr, ai.OprMgrBattleEvent); - } - - private static void DepriveAttachedPlayerBattleEvent(BattlePlayerBase ally, BattlePlayerBase opponent, AIAttachPlayerBattleEventCache playerBattleEvent) - { - if (playerBattleEvent.AllyAddCemeteryEvent != null) - { - ally.OnAddCemeteryEvent -= playerBattleEvent.AllyAddCemeteryEvent; - playerBattleEvent.AllyAddCemeteryEvent = null; - } - if (playerBattleEvent.OpponentAddCemeteryEvent != null) - { - opponent.OnAddCemeteryEvent -= playerBattleEvent.OpponentAddCemeteryEvent; - playerBattleEvent.OpponentAddCemeteryEvent = null; - } - if (playerBattleEvent.AllyTurnStartCompleteEvent != null) - { - ally.OnTurnStartComplete = (Action)Delegate.Remove(ally.OnTurnStartComplete, playerBattleEvent.AllyTurnStartCompleteEvent); - playerBattleEvent.AllyTurnStartCompleteEvent = null; - } - if (playerBattleEvent.OpponentTurnStartCompleteEvent != null) - { - opponent.OnTurnStartComplete = (Action)Delegate.Remove(opponent.OnTurnStartComplete, playerBattleEvent.OpponentTurnStartCompleteEvent); - playerBattleEvent.OpponentTurnStartCompleteEvent = null; - } - } - - private static void DepriveAttachedOperateMgrBattleEvent(OperateMgr oprMgr, AIAttachOperateMgrBattleEventCache oprMgrBattleEvent) - { - if (oprMgrBattleEvent.OnSetCardSuccessEvent != null) - { - oprMgr.OnSetCardSuccess -= oprMgrBattleEvent.OnSetCardSuccessEvent; - oprMgrBattleEvent.OnSetCardSuccessEvent = null; - } - if (oprMgrBattleEvent.OnSetCardExecutedEvent != null) - { - oprMgr.OnSetCardExecuted -= oprMgrBattleEvent.OnSetCardExecutedEvent; - oprMgrBattleEvent.OnSetCardExecutedEvent = null; - } - if (oprMgrBattleEvent.OnEvolveSuccessEvent != null) - { - oprMgr.OnEvolveSuccess -= oprMgrBattleEvent.OnEvolveSuccessEvent; - oprMgrBattleEvent.OnEvolveSuccessEvent = null; - } - if (oprMgrBattleEvent.OnEvolveCompleteEvent != null) - { - oprMgr.OnEvoleComplete -= oprMgrBattleEvent.OnEvolveCompleteEvent; - oprMgrBattleEvent.OnEvolveCompleteEvent = null; - } - if (oprMgrBattleEvent.OnBeforeAttackEvent != null) - { - oprMgr.OnBeforeAttack -= oprMgrBattleEvent.OnBeforeAttackEvent; - oprMgrBattleEvent.OnBeforeAttackEvent = null; - } - if (oprMgrBattleEvent.OnAttackExecutedEvent != null) - { - oprMgr.OnAttackExecuted -= oprMgrBattleEvent.OnAttackExecutedEvent; - oprMgrBattleEvent.OnAttackExecutedEvent = null; - } - if (oprMgrBattleEvent.OnBeforeFusionEvent != null) - { - oprMgr.OnBeforeFusion -= oprMgrBattleEvent.OnBeforeFusionEvent; - oprMgrBattleEvent.OnBeforeFusionEvent = null; - } - if (oprMgrBattleEvent.OnAfterFusionEvent != null) - { - oprMgr.OnAfterFusion -= oprMgrBattleEvent.OnAfterFusionEvent; - oprMgrBattleEvent.OnAfterFusionEvent = null; - } - } - private static void SetupOnAddCemeteryEvent(BattlePlayerBase ally, BattlePlayerBase opponent, EnemyAI ai) { ai.PlayerBattleEvent.AllyAddCemeteryEvent = delegate(BattleCardBase card, BattlePlayerBase.CEMETERY_TYPE cemeteryType, bool isOpen, SkillBase skill) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackAddDeck.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackAddDeck.cs index ffb1cf67..57ea04bf 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackAddDeck.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackAddDeck.cs @@ -8,10 +8,6 @@ public class AIAttackAddDeck : AIWhenAttackOrWhenFightTagArgument private AIPolishConvertedExpression _id; - private const int COUNT_ARG_INDEX = 1; - - private const int ID_ARG_INDEX = 0; - public AIAttackAddDeck(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackAttachTag.cs index db390607..28123af6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackAttachTag.cs @@ -6,10 +6,6 @@ public class AIAttackAttachTag : AIWhenAttackOrWhenFightTagArgument { private AIScriptTokenArgType _removeTiming; - private const int REMOVE_TIMING_OFFSET = 1; - - private const int TAG_WORD_START_INDEX = 1; - public AIPlayTag Tag { get; private set; } protected override int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackAttackableCount.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackAttackableCount.cs index b62e4f43..e4d35153 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackAttackableCount.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackAttackableCount.cs @@ -6,8 +6,6 @@ public class AIAttackAttackableCount : AIWhenAttackOrWhenFightTagArgument { private AIPolishConvertedExpression _attackableCountArg; - private const int ATTACKABLE_COUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIAttackAttackableCount(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackDiscard.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackDiscard.cs index 37edad52..80d6b300 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackDiscard.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackDiscard.cs @@ -6,8 +6,6 @@ public class AIAttackDiscard : AIWhenAttackOrWhenFightTagArgument { private AIPolishConvertedExpression _discardCountArg; - private const int DISCARD_COUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIAttackDiscard(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackMove.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackMove.cs deleted file mode 100644 index f77ddf64..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackMove.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -internal class AIAttackMove : AIMove -{ - public BattleCardBase Src { get; private set; } - - public BattleCardBase Target { get; private set; } - - public AIAttackMove(BattleCardBase src, BattleCardBase target) - : base(AIOperationType.ATTACK) - { - Src = src; - Target = target; - } - - public override void RunOperation(BattleManagerBase mgr, bool isPlayer) - { - mgr.VfxMgr.RegisterSequentialVfx(mgr.OperateMgr.Attack(Src, Target, isPlayer)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashDamageClip.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashDamageClip.cs index a3416ba6..d9aefe49 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashDamageClip.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashDamageClip.cs @@ -6,8 +6,6 @@ public class AIAttackOrClashDamageClip : AIAttackOrClashBarrierBase { private AIPolishConvertedExpression _clipAmount; - private const int CLIP_AMOUNT_OFFSET = 1; - protected override int _defaultDamageTypeOffset => 3; protected override int _stopTimingOffset => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashHeal.cs index 7921a0fa..db65c8b5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashHeal.cs @@ -6,8 +6,6 @@ public class AIAttackOrClashHeal : AIWhenAttackOrWhenFightTagArgument { private AIPolishConvertedExpression _healValueArg; - private const int HEAL_VALUE_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIAttackOrClashHeal(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashRemoveTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashRemoveTag.cs index 121467f0..5b0a836e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashRemoveTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashRemoveTag.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIAttackOrClashRemoveTag : AIWhenAttackOrWhenFightTagArgument, IAIRemoveTagArgument { - private const int NEEDS_SPLITED_WORDS_LENGS = 3; - - private const int REMOVE_TAG_START_SPLITED_INDEX = 0; public AIPlayTag RemoveTag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashSpellboost.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashSpellboost.cs index 1156b44c..d0b7e19b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashSpellboost.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashSpellboost.cs @@ -6,8 +6,6 @@ public class AIAttackOrClashSpellboost : AIWhenAttackOrWhenFightTagArgument { private AIPolishConvertedExpression _spellboostValue; - private const int SPELLBOOST_VALUE_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIAttackOrClashSpellboost(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashToken.cs index 06dc0c75..18a97b79 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackOrClashToken.cs @@ -6,8 +6,6 @@ public class AIAttackOrClashToken : AIWhenAttackOrWhenFightTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; protected override int SELECT_TYPE_OFFSET => 0; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIAttackSubtractCountdown.cs b/SVSim.BattleEngine/Engine/Wizard/AIAttackSubtractCountdown.cs index b6d717e9..f8311d9d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIAttackSubtractCountdown.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIAttackSubtractCountdown.cs @@ -6,8 +6,6 @@ public class AIAttackSubtractCountdown : AIWhenAttackOrWhenFightTagArgument { private AIPolishConvertedExpression _countChange; - private const int COUNT_CHANGE_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIAttackSubtractCountdown(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBanishAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIBanishAttachTag.cs index cd1ada12..6c33b6cd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBanishAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBanishAttachTag.cs @@ -8,8 +8,6 @@ public class AIBanishAttachTag : AITargetSelectTagArgument private readonly int REMOVE_TIMING_OFFSET = 1; - private const int TAG_WORD_START_INDEX = 1; - public AIPlayTag Tag { get; private set; } protected override int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBarrierGlobal.cs b/SVSim.BattleEngine/Engine/Wizard/AIBarrierGlobal.cs deleted file mode 100644 index a871a5a7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIBarrierGlobal.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Wizard; - -public static class AIBarrierGlobal -{ - public const int CLIPPING_RANGE_MAX = 9999; -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoBase.cs b/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoBase.cs index 8b4bcab2..05eed4cb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoBase.cs @@ -86,15 +86,6 @@ public abstract class AIBarrierInfoBase Hash = AIBarrierSimulationUtility.CalculateBarrierInfoBaseHash(DamageType, BarrierType, StopTimingList); } - public bool IsDuplicate(AIBarrierType barrierType, AIDamageType damageType, int barrierAmount) - { - if ((long)BarrierAmount * (long)AIBarrierSimulationUtility.BARRIER_AMOUNT_HASH_COEFFICIENT + (long)DamageType * (long)AIBarrierSimulationUtility.DAMAGE_TYPE_HASH_COEFFICIENT + (long)BarrierType * (long)AIBarrierSimulationUtility.BARRIER_TYPE_HASH_COEFFICIENT == (long)Hash) - { - return true; - } - return false; - } - public abstract AIBarrierInfoBase Clone(); public abstract bool IsShield(); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoCollection.cs b/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoCollection.cs index 7049327b..486a4141 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBarrierInfoCollection.cs @@ -157,22 +157,6 @@ public class AIBarrierInfoCollection } } - private bool HasDuplicateBarrier(AIBarrierType barrierType, AIDamageType damageType, int barrierAmount) - { - if (BarrierList == null || BarrierList.Count <= 0) - { - return false; - } - for (int i = 0; i < BarrierList.Count; i++) - { - if (BarrierList[i].IsDuplicate(barrierType, damageType, barrierAmount)) - { - return true; - } - } - return false; - } - public int CalcDamageAmount(AIVirtualCard owner, int damage, bool isSkillDamage, bool isSpellDamage) { if (BarrierList == null || BarrierList.Count <= 0) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBarrierSimulationUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIBarrierSimulationUtility.cs index ac51aeef..4ae24e61 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBarrierSimulationUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBarrierSimulationUtility.cs @@ -4,11 +4,6 @@ namespace Wizard; public static class AIBarrierSimulationUtility { - public static AIScriptTokenArgType[] LegalBarrierType = new AIScriptTokenArgType[2] - { - AIScriptTokenArgType.DAMAGE_CUT, - AIScriptTokenArgType.DAMAGE_CLIP - }; public static AIScriptTokenArgType[] LegalDamageType = new AIScriptTokenArgType[4] { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceivedData.cs b/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceivedData.cs index 390bbc08..9824dc26 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceivedData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceivedData.cs @@ -8,9 +8,4 @@ public class AIBattleInfoReceivedData { AttachedInfoReceiveCollection = new AttachedSkillInfoReceiveDataCollection(); } - - public void ClearAll() - { - AttachedInfoReceiveCollection.Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceiver.cs b/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceiver.cs index 345b86ee..69e02e09 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceiver.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBattleInfoReceiver.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIBattleInfoReceiver { - private const string NOT_FOUND_INSTANCE_LOG = "AIBattleInfoReceiver.GetInstance() error. battleMgr does not have battleInfoReceiver."; private IEnemyAIBattleInfoRecieveDataAccessor _enemyAI; @@ -28,22 +27,14 @@ public class AIBattleInfoReceiver public static bool CheckCreatedValidEnemyAI() { - return BattleManagerBase.GetIns().EnemyAI is IEnemyAIBattleInfoRecieveDataAccessor; + // Pre-Phase-5b: no mgr in static scope; headless has no AI battle path + return false; } public static AIBattleInfoReceiver GetInstance() { - AIBattleInfoReceiver result = null; - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins is SingleBattleMgr singleBattleMgr) - { - result = singleBattleMgr.BattleInfoReceiver; - } - else if (ins is AINetworkBattleManager aINetworkBattleManager) - { - result = aINetworkBattleManager.BattleInfoReceiver; - } - return result; + // Pre-Phase-5b: no mgr in static scope; headless has no SingleBattleMgr AI info receiver + return null; } public static void ShowNotFoundInstanceLog() diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBattleStartData.cs b/SVSim.BattleEngine/Engine/Wizard/AIBattleStartData.cs index 79126580..d3476a48 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBattleStartData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBattleStartData.cs @@ -4,8 +4,6 @@ public class AIBattleStartData : HeaderData { public AIBattleStartDetail Data; - public int TurnState = -1; - public AIBattleStartData() { Data = new AIBattleStartDetail(); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBattleStartDetail.cs b/SVSim.BattleEngine/Engine/Wizard/AIBattleStartDetail.cs index 635adedc..3de6197b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBattleStartDetail.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBattleStartDetail.cs @@ -14,8 +14,6 @@ public class AIBattleStartDetail } } - public int AIid; - public UserInfo SelfInfo; public UserInfo OppoInfo; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBattleStartTask.cs b/SVSim.BattleEngine/Engine/Wizard/AIBattleStartTask.cs deleted file mode 100644 index 911223c2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIBattleStartTask.cs +++ /dev/null @@ -1,54 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class AIBattleStartTask : BaseTask -{ - public AIBattleStartTask() - { - base.type = ((Data.CurrentFormat == Format.Rotation) ? ApiType.Type.AIRotationRankBattleStart : ApiType.Type.AIUnlimitedRankBattleStart); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - Data.AIBattleStartData = new AIBattleStartData(); - Data.AIBattleStartData.Data.AIid = (jsonData.Keys.Contains("ai_id") ? jsonData["ai_id"].ToInt() : (-1)); - Data.AIBattleStartData.TurnState = (jsonData.Keys.Contains("turnState") ? jsonData["turnState"].ToInt() : (-1)); - SetAIBattleStartDetail(Data.AIBattleStartData.Data.SelfInfo, jsonData, "self_info"); - SetAIBattleStartDetail(Data.AIBattleStartData.Data.OppoInfo, jsonData, "oppo_info"); - return num; - } - - private void SetAIBattleStartDetail(AIBattleStartDetail.UserInfo info, JsonData data, string userKey) - { - JsonData jsonData = null; - if (data.Keys.Contains(userKey)) - { - jsonData = data[userKey]; - } - if (jsonData != null) - { - info.DataDictionary.Add("country_code", jsonData.Keys.Contains("country_code") ? jsonData["country_code"] : ((JsonData)"NONE")); - info.DataDictionary.Add("userName", jsonData.Keys.Contains("userName") ? jsonData["userName"] : ((JsonData)"NONE")); - info.DataDictionary.Add("sleeveId", jsonData.Keys.Contains("sleeveId") ? jsonData["sleeveId"].ToInt() : (-1)); - info.DataDictionary.Add("emblemId", jsonData.Keys.Contains("emblemId") ? jsonData["emblemId"].ToInt() : (-1)); - info.DataDictionary.Add("degreeId", jsonData.Keys.Contains("degreeId") ? jsonData["degreeId"].ToInt() : (-1)); - info.DataDictionary.Add("fieldId", jsonData.Keys.Contains("fieldId") ? jsonData["fieldId"].ToInt() : (-1)); - info.DataDictionary.Add("isOfficial", jsonData.Keys.Contains("isOfficial") ? jsonData["isOfficial"].ToInt() : (-1)); - info.DataDictionary.Add("oppoId", jsonData.Keys.Contains("oppoId") ? jsonData["oppoId"].ToInt() : (-1)); - info.DataDictionary.Add("seed", jsonData.Keys.Contains("seed") ? jsonData["seed"].ToInt() : (-1)); - info.DataDictionary.Add("rank", jsonData.Keys.Contains("rank") ? jsonData["rank"].ToInt() : (-1)); - info.DataDictionary.Add("battlePoint", jsonData.Keys.Contains("battlePoint") ? jsonData["battlePoint"].ToInt() : (-1)); - info.DataDictionary.Add("classId", jsonData.Keys.Contains("classId") ? jsonData["classId"].ToInt() : (-1)); - info.DataDictionary.Add("charaId", jsonData.Keys.Contains("charaId") ? jsonData["charaId"].ToInt() : (-1)); - info.DataDictionary.Add("isMasterRank", jsonData.Keys.Contains("isMasterRank") ? jsonData["isMasterRank"].ToInt() : (-1)); - info.DataDictionary.Add("masterPoint", jsonData.Keys.Contains("masterPoint") ? jsonData["masterPoint"].ToInt() : (-1)); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBreakAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIBreakAttachTag.cs index 02d0f774..a915e207 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBreakAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBreakAttachTag.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIBreakAttachTag : AITriggerAndTargetFiltersTagBase { - private const int TIMING_OFFSET = 1; public AIPlayTag AttachedTag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBreakRecoverPp.cs b/SVSim.BattleEngine/Engine/Wizard/AIBreakRecoverPp.cs index b7a06bde..962285b4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBreakRecoverPp.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBreakRecoverPp.cs @@ -6,8 +6,6 @@ public class AIBreakRecoverPp : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _recoverPpValue; - private const int VALUE_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIBreakRecoverPp(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBreakSetLeaderMaxLife.cs b/SVSim.BattleEngine/Engine/Wizard/AIBreakSetLeaderMaxLife.cs index 38164958..2a0c9918 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBreakSetLeaderMaxLife.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBreakSetLeaderMaxLife.cs @@ -8,10 +8,6 @@ public class AIBreakSetLeaderMaxLife : AIFiltersArgument private AIPolishConvertedExpression _life; - private const int SIDE_OFFSET = 2; - - private const int VALUE_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 2; public AIBreakSetLeaderMaxLife(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffBuff.cs index b51d4786..8359aa10 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffBuff.cs @@ -18,14 +18,6 @@ public class AIBuffBuff : AITriggerAndTargetFiltersTagBase private AIScriptTokenArgType _permOrTemp; - private const int PERM_OR_TEMP_OFFSET = 1; - - private const int LIFE_BUFF_OFFSET = 2; - - private const int ATTACK_BUFF_OFFSET = 3; - - private const int SELECT_TYPE_OFFSET = 4; - protected override int NON_FILTER_FIRST_OFFSET => 4; public AIBuffBuff(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffDamage.cs index 780e4b08..8d984cd6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffDamage.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIBuffDamage : AITriggerAndTargetFiltersTagBase { - private const int DAMAGE_ARG_OFFSET = 1; private AIPolishConvertedExpression _damageArg; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffDraw.cs index ad8adc75..f7547096 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffDraw.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIBuffDraw : AIScriptArgumentExpressions { - private const int COUNT_ARG_INDEX = 1; public AIPolishConvertedExpression DrawCount { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffHeal.cs index 5b998ab4..55f19466 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffHeal.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIBuffHeal : AITriggerAndTargetFiltersTagBase { - private const int HEAL_AMOUNT_ARG_OFFSET = 1; private AIPolishConvertedExpression _healArg; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffRecorderCollection.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffRecorderCollection.cs index 7c96e03f..73ce8320 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffRecorderCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffRecorderCollection.cs @@ -93,12 +93,6 @@ public class AIBuffRecorderCollection return (atkSum: num, lifeSum: num2); } - public void Clear() - { - RecorderList.Clear(); - RecorderList = null; - } - public void CreateRecorderListFromTurnBuffCountList(List turnBuffCountList) { if (turnBuffCountList != null && turnBuffCountList.Count > 0) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffRecoverPp.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffRecoverPp.cs index 853c9f5b..70707c6c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffRecoverPp.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffRecoverPp.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIBuffRecoverPp : AITriggerAndTargetFiltersTagBase { - private const int HEAL_ARG_OFFSET = 1; private AIPolishConvertedExpression _healArg; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIBuffShield.cs b/SVSim.BattleEngine/Engine/Wizard/AIBuffShield.cs index dbc9c962..d6e6e0df 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIBuffShield.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIBuffShield.cs @@ -8,10 +8,6 @@ public class AIBuffShield : AIFiltersAndSelectTypeArgument private AIScriptTokenArgType _damageType; - private const int DEFAULT_DAMAGE_TYPE_OFFSET = 2; - - private const int STOP_TIMING_OFFSET = 1; - private bool _isDamageTypeDefinedByMaster; protected override int SELECT_TYPE_OFFSET => 1 + ((!_isDamageTypeDefinedByMaster) ? 1 : 2); diff --git a/SVSim.BattleEngine/Engine/Wizard/AICardDataAsset.cs b/SVSim.BattleEngine/Engine/Wizard/AICardDataAsset.cs index 76c79aac..98ffa484 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AICardDataAsset.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AICardDataAsset.cs @@ -50,9 +50,4 @@ public class AICardDataAsset TagList.Add(item); } } - - public bool IsSameCard(AICardDataAsset data) - { - return CardID == data.CardID; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayAttachTag.cs index 0be2b8e6..b32d692f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayAttachTag.cs @@ -8,8 +8,6 @@ public class AIChangeInplayAttachTag : AIWhenChangeInplayTagArgument private readonly int REMOVE_TIMING_OFFSET = 1; - private const int TAG_WORD_START_INDEX = 1; - public AIPlayTag Tag { get; private set; } protected override int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageClip.cs b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageClip.cs index e60633c7..2a4f03c6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageClip.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageClip.cs @@ -8,8 +8,6 @@ public class AIChangeInplayImmediateDamageClip : AIChangeInplayImmediateBarrierB private AIPolishConvertedExpression _clipRange; - private const int DEFAULT_CLIP_AMOUNT_OFFSET = 1; - private bool _isClipRangeDefinedByMaster; protected override int _stopTimingOffset diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageCut.cs b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageCut.cs index af9e957c..1280bcab 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageCut.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageCut.cs @@ -6,8 +6,6 @@ public class AIChangeInplayImmediateDamageCut : AIChangeInplayImmediateBarrierBa { private AIPolishConvertedExpression _cutAmount; - private const int CUT_AMOUNT_OFFSET = 1; - protected override int _stopTimingOffset => 2; protected override int _defaultDamageTypeOffset => 3; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageModifier.cs b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageModifier.cs index 978ce4d3..2d749f57 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageModifier.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateDamageModifier.cs @@ -14,10 +14,6 @@ public class AIChangeInplayImmediateDamageModifier : AIWhenChangeInplayTagArgume private AIPolishConvertedExpression _modifyValue; - private const int MODIFY_OPTION_ARG_OFFSET = 2; - - private const int MODIFY_VALUE_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => -1; protected override int NON_FILTER_FIRST_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateKeywordSkill.cs b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateKeywordSkill.cs index 714eee2f..43ac03c7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateKeywordSkill.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChangeInplayImmediateKeywordSkill.cs @@ -8,8 +8,6 @@ public class AIChangeInplayImmediateKeywordSkill : AIWhenChangeInplayTagArgument private readonly AIScriptTokenArgType _skillType; - private IEnumerable _giveCardList; - protected virtual int StopTimingOffset => 1; protected override int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChangePpTotalBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIChangePpTotalBuff.cs index deddcf36..0024825c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChangePpTotalBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChangePpTotalBuff.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIChangePpTotalBuff : AIWhenChangeInplayTagArgument { - private const int LIFE_OFFSET = 1; - - private const int ATTACK_OFFSET = 2; public AIPolishConvertedExpression Attack { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIChoiceTagArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIChoiceTagArgument.cs index ae107923..a3b70d49 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIChoiceTagArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIChoiceTagArgument.cs @@ -8,8 +8,6 @@ public class AIChoiceTagArgument : AIScriptArgumentExpressions protected AIPolishConvertedExpression _choiceCount; - private const int CHOICE_COUNT_OFFSET = 1; - private List _playerChoiceFakeCards; private List _enemyChoiceFakeCards; @@ -72,11 +70,6 @@ public class AIChoiceTagArgument : AIScriptArgumentExpressions return (int)_choiceCount.EvalArg(owner, null, field, situation); } - public List GetChoiceIdList() - { - return _choiceIds; - } - protected override AITokenIdCollection CreateRegisterTokenPoolInfo(AIVirtualCard owner, List idList) { return AISummonTokenUtility.CreateTokenIdCollectionFromIdList(owner, AIScriptTokenArgType.ALLY, idList, AITokenType.Choice); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIClashHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIClashHeal.cs deleted file mode 100644 index 59f66bea..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIClashHeal.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class AIClashHeal : AIFiltersAndSelectTypeArgument -{ - private readonly int HEAL_ARG_OFFSET = 1; - - private AIPolishConvertedExpression _healArg; - - protected override int SELECT_TYPE_OFFSET => 2; - - public AIClashHeal(string text) - : base(text) - { - } - - protected override void InitExpressions(string text) - { - base.InitExpressions(text); - _healArg = _exprList[_exprList.Count - HEAL_ARG_OFFSET]; - } - - public override void Execute(AIVirtualCard tagOwner, AIVirtualField field, List playPtn, AISituationInfo situation = null) - { - List targetsFromField = GetTargetsFromField(tagOwner, field, playPtn, situation); - if (targetsFromField != null && targetsFromField.Count > 0) - { - int heal = (int)_healArg.EvalArg(tagOwner, playPtn, field, situation); - if (base.SelectType == AIScriptTokenArgType.ALL_SELECT) - { - AISkillSimulationUtility.HealAll(targetsFromField, field, heal, playPtn, situation); - } - } - } - - public override List GetFilteredTargets(List candidates, AIVirtualCard tagOwner, List playPtn, AISituationInfo situation, bool isBlockDead = true) - { - return AIFilteringUtility.FilteringForStatusEffectiveAbility(candidates, tagOwner, base.Filters, playPtn, situation, isAttackEffective: false, isBlockDead); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIConsoleUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIConsoleUtility.cs index fc0f707c..63a715ef 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIConsoleUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIConsoleUtility.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIConsoleUtility { - private static StringBuilder _logBuilder; public static void Log(string log) { @@ -17,8 +16,4 @@ public class AIConsoleUtility public static void LogError(string log) { } - - private static void BuildLog(string text) - { - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDamageSelectLogicArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIDamageSelectLogicArgument.cs index a90152ce..d6b07edd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDamageSelectLogicArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDamageSelectLogicArgument.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIDamageSelectLogicArgument : AISelectLogicArgumentBase { - private const int DAMAGE_VALUE_ARG_INDEX = 0; public override AIScriptTokenArgType LogicType => AIScriptTokenArgType.DAMAGE_LOGIC; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDamagedBonus.cs b/SVSim.BattleEngine/Engine/Wizard/AIDamagedBonus.cs index 0f46c1a4..3a5accdd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDamagedBonus.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDamagedBonus.cs @@ -6,8 +6,6 @@ public class AIDamagedBonus : AIScriptArgumentExpressions { private AIPolishConvertedExpression _bonus; - private const int BONUS_ARG_INDEX = 0; - public AIDamagedBonus(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDamagedBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIDamagedBuff.cs index 8b44af60..93ddd817 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDamagedBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDamagedBuff.cs @@ -8,10 +8,6 @@ public class AIDamagedBuff : AIScriptArgumentExpressions private AIPolishConvertedExpression _lifeBuff; - private const int ATTACK_BUFF_INDEX = 0; - - private const int LIFE_BUFF_INDERX = 1; - public AIDamagedBuff(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDamagedDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIDamagedDamage.cs index 419fc71b..16809707 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDamagedDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDamagedDamage.cs @@ -8,10 +8,6 @@ public class AIDamagedDamage : AIFiltersAndSelectTypeArgument private AIPolishConvertedExpression _damageCount; - private const int DAMAGE_VALUE_OFFSET = 2; - - private const int DAMAGE_COUNT_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 3; public AIDamagedDamage(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDamagedHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIDamagedHeal.cs index 2863fd8f..3ddca2f2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDamagedHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDamagedHeal.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIDamagedHeal : AIFiltersAndSelectTypeArgument { - private const int HEAL_AMOUNT_OFFSET = 1; private AIPolishConvertedExpression _healAmount; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDamagedToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIDamagedToken.cs index 7503ca2b..d881c68e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDamagedToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDamagedToken.cs @@ -6,8 +6,6 @@ public class AIDamagedToken : AIFiltersArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIDamagedToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDataLibrary.cs b/SVSim.BattleEngine/Engine/Wizard/AIDataLibrary.cs index 6801f703..28ae0417 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDataLibrary.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDataLibrary.cs @@ -168,17 +168,4 @@ public class AIDataLibrary _deckStyleDic.Add(styleName, aIStyleData); return true; } - - public static List GetAIDeckCardList(string deckname) - { - List list = new List(); - foreach (AICardData value in GameMgr.GetIns().GetDataMgr().m_AIDataLibrary.SearchDeckData(deckname).CardDic.Values) - { - for (int i = 0; i < value.CardNum; i++) - { - list.Add(value.CardID); - } - } - return list; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDeckFileNameList.cs b/SVSim.BattleEngine/Engine/Wizard/AIDeckFileNameList.cs index db2876fd..a121a343 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDeckFileNameList.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDeckFileNameList.cs @@ -5,9 +5,6 @@ namespace Wizard; public class AIDeckFileNameList { - private const int DECK_ID_INDEX = 0; - - private const int FILE_NAME_INDEX = 1; private readonly Dictionary _dataTable = new Dictionary(); @@ -25,9 +22,4 @@ public class AIDeckFileNameList { return _dataTable[id]; } - - public List GetFileNameList() - { - return _dataTable.Values.ToList(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDiscardDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIDiscardDamage.cs index 9ab44884..374bb149 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDiscardDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDiscardDamage.cs @@ -6,8 +6,6 @@ public class AIDiscardDamage : AIFiltersAndSelectTypeArgument { private AIPolishConvertedExpression _damageArg; - private const int DAMAGE_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIDiscardDamage(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDiscardHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIDiscardHeal.cs index 4e236a92..5af3b2e4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDiscardHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDiscardHeal.cs @@ -6,8 +6,6 @@ public class AIDiscardHeal : AIFiltersAndSelectTypeArgument { private AIPolishConvertedExpression _healAmount; - private const int HEAL_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIDiscardHeal(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDiscardUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIDiscardUtility.cs index 273c510a..42198190 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDiscardUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDiscardUtility.cs @@ -43,8 +43,6 @@ public static class AIDiscardUtility } } - private const float TURN_COST_DIFF_BONUS_RATE = 0.001f; - public static float CalcAllDiscardedBonus(AIVirtualField field, AISituationInfo playSituation, List playPtn) { AIDiscardInfo discardInfo = playSituation.DiscardInfo; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIDiscardedToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIDiscardedToken.cs index 9aac45d8..7b3d552c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIDiscardedToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIDiscardedToken.cs @@ -6,8 +6,6 @@ public class AIDiscardedToken : AIFiltersArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIDiscardedToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEmoteCtrl.cs b/SVSim.BattleEngine/Engine/Wizard/AIEmoteCtrl.cs index d0db7451..65f05176 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEmoteCtrl.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEmoteCtrl.cs @@ -1,507 +1,497 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Wizard.Battle.Card; -using Wizard.Battle.View.Vfx; - -namespace Wizard; - -public class AIEmoteCtrl : IAIEmoteCtrl -{ - public static AIPlayTagType[] EMOTE_TAG_TYPES = new AIPlayTagType[6] - { - AIPlayTagType.EmoteOnPlay, - AIPlayTagType.EmoteOnAtk, - AIPlayTagType.EmoteOnEvo, - AIPlayTagType.EmoteOnDestroy, - AIPlayTagType.ForceEmoteOnDestroy, - AIPlayTagType.EmoteOnTurnEnd - }; - - private EnemyAI AI; - - private bool _isEmoOnDestroyPlayed; - - public AIEmoteCtrl(EnemyAI ai) - { - AI = ai; - } - - public void SetUpEmoteEvent(BattlePlayerBase self, BattlePlayerBase opponent, OperateMgr operateManager) - { - opponent.OnTurnStartBeforeDraw += (SkillProcessor arg) => GetEmoteWithTurnStartSimulate(isAllyTurnStart: false); - self.OnTurnStartBeforeDraw += delegate - { - AI.EmoteMng.ResetOpponentTurnEmoteFlag(); - return GetEmoteWithTurnStartSimulate(isAllyTurnStart: true); - }; - Func func = null; - func = delegate - { - VfxBase emote = AI.GetEmote(AIEmoteCmdType.ON_OPPONENT_TURN_END); - ImmediateVfxMgr.GetInstance().Register(emote); - return NullVfx.GetInstance(); - }; - opponent.OnTurnEnd += func; - self.OnAddCemeteryEvent += delegate(BattleCardBase card, BattlePlayerBase.CEMETERY_TYPE cemeteryType, bool isOpen, SkillBase skill) - { - if (cemeteryType == BattlePlayerBase.CEMETERY_TYPE.NORMAL && !(card is NullBattleCard) && !(card is IVirtualBattleCard) && card.SelfBattlePlayer.ClassAndInPlayCardList.Contains(card)) - { - AIUnknownAction situation = new AIUnknownAction(AI.CurrentVirtualField.SearchVirtualCard(card)); - SequentialVfxPlayer sequential = SequentialVfxPlayer.Create(); - VfxBase emote = AI.GetEmote(AIEmoteCmdType.ON_CARD_DESTROY, situation); - sequential.Register(emote); - if (emote != NullVfx.GetInstance()) - { - _isEmoOnDestroyPlayed = true; - card.OnDestroy += (BattleCardBase destroyCard, SkillProcessor skillProcessor) => sequential; - } - } - }; - self.Class.OnDamageAfter += (SkillProcessor skillProcessorOneTime) => (self.Class.Life <= 0) ? NullVfx.GetInstance() : AI.GetEmote(AIEmoteCmdType.ON_LEADER_DAMAGED); - opponent.Class.OnDamageAfter += (SkillProcessor skillProcessorOneTime) => (opponent.Class.Life <= 0) ? NullVfx.GetInstance() : AI.GetEmote(AIEmoteCmdType.ON_PLAYER_LEADER_DAMAGED); - operateManager.OnBeforeSetCard += delegate - { - AI.EmoteMng.EvalFieldOnBeforeSetCard(); - }; - operateManager.OnSetCardExecuted += delegate(BattleCardBase card) - { - AIUnknownAction situation = new AIUnknownAction(new AIVirtualCard(card, AI.CurrentVirtualField)); - return AI.GetEmote(AIEmoteCmdType.ON_CARD_PLAY_OPPONENT, situation); - }; - operateManager.OnBeforeAttack += delegate - { - AI.EmoteMng.EvalFieldOnBeforeAttack(); - return NullVfx.GetInstance(); - }; - operateManager.OnAttackExecuted += (BattleCardBase attacker, BattleCardBase target, bool needAttack) => AI.GetEmote(AIEmoteCmdType.ON_OPPONENT_ATTACK); - } - - private VfxBase GetEmoteWithTurnStartSimulate(bool isAllyTurnStart) - { - AIVirtualField aIVirtualField = new AIVirtualField((AI.BeforeLatestActionField != null) ? AI.BeforeLatestActionField : AI.CurrentVirtualField); - if (aIVirtualField.AllyTurnCount > 0 || aIVirtualField.EnemyTurnCount > 0) - { - AIVirtualTurnEndSimulator.TurnEnd(new AIVirtualTurnEndInfo(isAllyTurnStart ? aIVirtualField.EnemyClass : aIVirtualField.AllyClass), aIVirtualField); - } - AIVirtualTurnStartInfo situation = new AIVirtualTurnStartInfo(isAllyTurnStart ? aIVirtualField.AllyClass : aIVirtualField.EnemyClass); - aIVirtualField.TurnStartFieldProcess(situation); - return AI.GetEmote(isAllyTurnStart ? AIEmoteCmdType.ON_ALLY_TURN_START : AIEmoteCmdType.ON_OPPONENT_TURN_START, situation); - } - - public AIEmoteCmd OnOpponentEmotion(ClassCharaPrm.EmotionType emoteType) - { - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - if (AI.IsThisTurnEmotePlayed) - { - return null; - } - if (!AI.EmoteQuery.UseInnerEmote) - { - return null; - } - ClassCharaPrm.EmotionType replyEmote = ClassCharaPrm.EmotionType.NULL; - if (AI.EmoteMng.IsReplyAllowed(emoteType, ref replyEmote)) - { - return new AIEmoteCmd(replyEmote); - } - return null; - } - - public AIEmoteCmd OnAllyTurnStart(AISituationInfo situation) - { - AI.EmoteMng.SetUpOnAllyTurnStart(); - AI.EmoteMng.EvalFieldOnTurnStart(); - _isEmoOnDestroyPlayed = false; - int emoteOnTurnStart = AI.StyleQuery.GetEmoteOnTurnStart(isAllyTurn: true, situation.Actor.SelfField); - if (emoteOnTurnStart >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnStart); - } - return null; - } - - public AIEmoteCmd OnOpponentTurnStart(AISituationInfo situation) - { - AI.EmoteMng.EvalFieldOnOpponentTurnStart(); - _isEmoOnDestroyPlayed = false; - AIVirtualField selfField = situation.Actor.SelfField; - int emoteOnTurnStart = AI.StyleQuery.GetEmoteOnTurnStart(isAllyTurn: false, selfField); - if (emoteOnTurnStart >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnStart); - } - emoteOnTurnStart = AI.StyleQuery.GetPlayerEmoteOnTurnStart(selfField); - if (emoteOnTurnStart >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnStart, isAlly: false); - } - return null; - } - - public AIEmoteCmd OnAllyTurnEnd() - { - if (AI.IsTurnEndLethal) - { - return AI.EmoteQuery.SearchEmoteAtRandom(22); - } - for (int i = 0; i < AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards.Count; i++) - { - int emoteOnTurnEndCategory = AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards[i].GetEmoteOnTurnEndCategory(isAllyTurnEnd: true); - if (emoteOnTurnEndCategory >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEndCategory); - } - } - int emoteOnTurnEnd = AI.StyleQuery.GetEmoteOnTurnEnd(isAllyTurn: true); - if (emoteOnTurnEnd >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd); - } - emoteOnTurnEnd = AI.StyleQuery.GetPlayerEmoteOnTurnEnd(isPlayerTurn: false); - if (emoteOnTurnEnd >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd, isAlly: false); - } - if (AI.EmoteMng.IsCheckmated()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(13); - } - if (AI.EmoteMng.IsHuntDown()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(14); - } - if (AI.IsRoyal() && AI.EmoteMng.IsEnoughUnit()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(102); - } - if (AI.IsNecromancer() && AI.EmoteMng.IsEnoughGrave()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(501); - } - if (AI.EmoteMng.IsAwaking(1)) - { - return AI.EmoteQuery.SearchEmoteAtRandom(401); - } - if (AI.EmoteMng.IsUnexpectedBattle()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(11); - } - if (AI.ALLY.InPlayCards.Count() < 5 && AI.EmoteMng.IsRemainTooPP()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(15); - } - return null; - } - - public AIEmoteCmd OnOpponentTurnEnd() - { - if (AI.EmoteMng.IsOpponentTurnEmoteOccured) - { - return null; - } - for (int i = 0; i < AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards.Count; i++) - { - int emoteOnTurnEndCategory = AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards[i].GetEmoteOnTurnEndCategory(isAllyTurnEnd: false); - if (emoteOnTurnEndCategory >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEndCategory); - } - } - int emoteOnTurnEnd = AI.StyleQuery.GetEmoteOnTurnEnd(isAllyTurn: false); - if (emoteOnTurnEnd >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd); - } - emoteOnTurnEnd = AI.StyleQuery.GetPlayerEmoteOnTurnEnd(isPlayerTurn: true); - if (emoteOnTurnEnd >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd, isAlly: false); - } - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - if (AI.EmoteMng.IsOpponentEarnGreatMerit()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(33); - } - if (AI.OPPONENT.InPlayCards.Count() < 5 && AI.EmoteMng.IsOpponentRemainTooPP()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(31); - } - return null; - } - - public AIEmoteCmd OnIterationStart() - { - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - float num = AI.EmoteMng.EvalDisplacement_PlayedValue(); - AI.EmoteMng.ResetLastOpr(); - if (num < -4f) - { - return null; - } - if (num > 4f) - { - return AI.EmoteQuery.SearchEmoteAtRandom(1); - } - return null; - } - - public AIEmoteCmd OnCardPlay(AISituationInfo situation) - { - if (situation == null || situation.Actor == null) - { - return null; - } - int num = AI.CurrentVirtualField.AllyHandCards.FindIndex((AIVirtualCard c) => c.IsSameCard(situation.Actor)); - if (num < 0) - { - return null; - } - AIVirtualField aIVirtualField = new AIVirtualField(AI.CurrentVirtualField) - { - BestPlayPtn = new List { num } - }; - AIVirtualCard aIVirtualCard = aIVirtualField.SearchVirtualCard(situation.Actor); - AISelectedTargetInfoSet aISelectedTargetInfoSet = new AISelectedTargetInfoSet(); - if (situation.SelectedTargets != null) - { - for (int num2 = 0; num2 < AISelectedTargetInfoSet.LENGTH; num2++) - { - AISelectedTargetInfo aISelectedTargetInfo = situation.SelectedTargets.Get(num2); - if (aISelectedTargetInfo == null || !aISelectedTargetInfo.HasTarget) - { - continue; - } - AISelectedTargetInfo aISelectedTargetInfo2 = new AISelectedTargetInfo(aISelectedTargetInfo.Type); - int count = aISelectedTargetInfo.Targets.Count; - for (int num3 = 0; num3 < count; num3++) - { - if (aISelectedTargetInfo.Type == TargetSelectType.Choice) - { - aISelectedTargetInfo2.AddTarget(aISelectedTargetInfo.Targets[num3]); - continue; - } - AIVirtualCard target = aIVirtualField.SearchVirtualCard(aISelectedTargetInfo.Targets[num3]); - aISelectedTargetInfo2.AddTarget(target); - } - aISelectedTargetInfoSet.Set(aISelectedTargetInfo2, num2); - } - if (situation.SelectedTargets.HasChoiceTarget) - { - aISelectedTargetInfoSet.SetChoiceTarget(situation.SelectedTargets.ChoiceTarget); - } - } - AIVirtualTargetSelectAction aIVirtualTargetSelectAction = new AIVirtualTargetSelectAction(aIVirtualCard, aIVirtualCard, situation.ActionType, aISelectedTargetInfoSet); - PlaySimulationInfo playSimulationInfo = AIPlayCardSimulationUtility.CreatePlaySimulationInfo(aIVirtualCard, aIVirtualTargetSelectAction, aIVirtualField); - if (playSimulationInfo == null) - { - AIConsoleUtility.LogError("AIEmoteCtrl:OnCardPlay() playSimulationInfo is null. CardName:" + ((aIVirtualCard != null) ? aIVirtualCard.CardName : "")); - return null; - } - if (playSimulationInfo.Type == PlaySimulationType.Accelerate || playSimulationInfo.Type == PlaySimulationType.Crystalize) - { - AISinglePlayptnRecord playptnRecord = AI.PlayPtnRecorder.FindMatchedPlayPtnRecord(aIVirtualField.BestPlayPtn, aIVirtualField); - aIVirtualTargetSelectAction.SetActor(aIVirtualCard.FindRealActor(playptnRecord)); - } - AIVirtualPlaySimulator.PlayCard(aIVirtualTargetSelectAction, aIVirtualField, playSimulationInfo); - if (aIVirtualField.EnemyClass.Life <= 0 || aIVirtualField.EnemyClass.IsDead) - { - return AI.EmoteQuery.SearchEmoteAtRandom(22); - } - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - AIRealBattleCardSearcher.SearchBattleCardFromSituation(AI.PlayerPair, situation, out var actor, out var targetList); - if (actor == null || (situation.ActionTarget != null && (targetList == null || targetList.Count < 1 || targetList[0] == null)) || (situation.SecondActionTarget != null && (targetList == null || targetList.Count < 2 || targetList[1] == null))) - { - return null; - } - if (AI.ALLY.IsSelfTurn && AI.IsAllyCard(actor)) - { - AIVirtualCard actor2 = situation.Actor; - int emoteCategory = actor2.GetEmoteCategory(AIPlayTagType.EmoteOnPlay); - if (emoteCategory >= 0) - { - AIEmoteCmd result = AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); - AI.EmoteQuery.OnCardPlayEmotion(); - return result; - } - new BattlePlayerPair(actor.SelfBattlePlayer, actor.OpponentBattlePlayer); - int num4 = actor2.BattleSkills.Count(); - for (int num5 = 0; num5 < num4; num5++) - { - SkillBase skill = actor2.BattleSkills.ElementAt(num5); - if (AI.ParamQuery.IsBanishSkill(skill)) - { - return OnBanishSkill(actor, aIVirtualField); - } - } - } - return null; - } - - public AIEmoteCmd OnAllyAttack(AISituationInfo situation) - { - if (!(situation is AIVirtualAttackInfo { Actor: not null, AttackTarget: not null })) - { - AIConsoleUtility.LogError("OnAllyAttack() error!!! situation is not valid attackSituation"); - return null; - } - AI.EmoteMng.EvalFieldOnAttack(); - AIVirtualField aIVirtualField = new AIVirtualField(AI.CurrentVirtualField); - AIVirtualAttackInfo aIVirtualAttackInfo2 = AISimulationUtility.CreateActionInfoOnFieldFromSituation(aIVirtualField, situation) as AIVirtualAttackInfo; - if (!situation.IsSameSituation(aIVirtualAttackInfo2)) - { - AIConsoleUtility.LogError("OnAllyAttack() error!!! Failed situation clone"); - return null; - } - AIVirtualAttackSimulator.Attack(aIVirtualAttackInfo2, aIVirtualField); - if (aIVirtualField.EnemyClass.IsDead) - { - return AI.EmoteQuery.SearchEmoteAtRandom(22); - } - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - int emoteCategory = aIVirtualAttackInfo2.Actor.GetEmoteCategory(AIPlayTagType.EmoteOnAtk); - if (emoteCategory >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); - } - return null; - } - - public AIEmoteCmd OnAllyEvolution(AISituationInfo situation) - { - if (situation == null || situation.Actor == null || situation.ActionType != AIOperationType.EVOLVE) - { - return null; - } - AIVirtualField aIVirtualField = new AIVirtualField(AI.CurrentVirtualField); - AIVirtualActionInfo aIVirtualActionInfo = AISimulationUtility.CreateActionInfoOnFieldFromSituation(aIVirtualField, situation); - if (!situation.IsSameSituation(aIVirtualActionInfo)) - { - return null; - } - AIVirtualEvolutionSimulator.ManualEvolve(aIVirtualActionInfo, aIVirtualField); - if (aIVirtualField.EnemyClass.IsDead) - { - return AI.EmoteQuery.SearchEmoteAtRandom(22); - } - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - int emoteCategory = aIVirtualActionInfo.Actor.GetEmoteCategory(AIPlayTagType.EmoteOnEvo); - if (emoteCategory >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); - } - return null; - } - - public AIEmoteCmd OnBanishSkill(BattleCardBase actCard, AIVirtualField fieldAfterPlayed) - { - if (AI.EmoteMng.IsBanishOverExpected(actCard, fieldAfterPlayed)) - { - return AI.EmoteQuery.SearchEmoteAtRandom(21); - } - return null; - } - - public AIEmoteCmd OnOpponentPlayCardExecuted(AISituationInfo situation) - { - if (AI.EmoteMng.IsCheckmated() || situation == null || situation.Actor == null) - { - return null; - } - AIVirtualCard actor = situation.Actor; - if (AI.EmoteMng.IsOpponentBanishSplendid(actor)) - { - return AI.EmoteQuery.SearchEmoteAtRandom(35); - } - if (AI.EmoteMng.IsOpponentBanishBad(actor)) - { - return AI.EmoteQuery.SearchEmoteAtRandom(36); - } - if (!actor.IsAlly && AI.EmoteMng.IsGiantPlayed()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(34); - } - if (AI.EmoteMng.IsOpponentHealClassLifeLargeOnCardPlay()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(37); - } - return null; - } - - public AIEmoteCmd OnOpponentAttackExecuted() - { - if (AI.EmoteMng.IsCheckmated()) - { - return null; - } - if (AI.EmoteMng.IsOpponentHealClassLifeLargeOnAttack()) - { - return AI.EmoteQuery.SearchEmoteAtRandom(37); - } - return null; - } - - public AIEmoteCmd OnCardDestroy(AISituationInfo situation) - { - if (situation == null || situation.Actor == null || situation.ActionType != AIOperationType.UNKNOWN) - { - return null; - } - AIVirtualCard actor = situation.Actor; - if (actor.IsAlly) - { - int emoteCategory = actor.GetEmoteCategory(AIPlayTagType.ForceEmoteOnDestroy); - if (emoteCategory >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); - } - } - if (AI.EmoteMng.IsCheckmated() || _isEmoOnDestroyPlayed) - { - return null; - } - if (actor.IsAlly) - { - int emoteCategory2 = actor.GetEmoteCategory(AIPlayTagType.EmoteOnDestroy); - if (emoteCategory2 >= 0) - { - return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory2); - } - if (AI.OPPONENT.IsSelfTurn && AI.EmoteMng.IsEliminatedAllyLegion(situation.Actor)) - { - return AI.EmoteQuery.SearchEmoteAtRandom(101); - } - } - return null; - } - - public AIEmoteCmd OnLeaderDamaged(AIVirtualField field) - { - int emoteOnLeaderDamaged = AI.StyleQuery.GetEmoteOnLeaderDamaged(field); - return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnLeaderDamaged); - } - - public AIEmoteCmd OnPlayerLeaderDamaged(AIVirtualField field) - { - int playerEmoteOnLeaderDamaged = AI.StyleQuery.GetPlayerEmoteOnLeaderDamaged(field); - return AI.EmoteQuery.SearchEmoteAtRandom(playerEmoteOnLeaderDamaged, isAlly: false); - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Wizard.Battle.Card; +using Wizard.Battle.View.Vfx; + +namespace Wizard; + +public class AIEmoteCtrl : IAIEmoteCtrl +{ + + private EnemyAI AI; + + private bool _isEmoOnDestroyPlayed; + + public AIEmoteCtrl(EnemyAI ai) + { + AI = ai; + } + + public void SetUpEmoteEvent(BattlePlayerBase self, BattlePlayerBase opponent, OperateMgr operateManager) + { + opponent.OnTurnStartBeforeDraw += (SkillProcessor arg) => GetEmoteWithTurnStartSimulate(isAllyTurnStart: false); + self.OnTurnStartBeforeDraw += delegate + { + AI.EmoteMng.ResetOpponentTurnEmoteFlag(); + return GetEmoteWithTurnStartSimulate(isAllyTurnStart: true); + }; + Func func = null; + func = delegate + { + VfxBase emote = AI.GetEmote(AIEmoteCmdType.ON_OPPONENT_TURN_END); + return NullVfx.GetInstance(); + }; + opponent.OnTurnEnd += func; + self.OnAddCemeteryEvent += delegate(BattleCardBase card, BattlePlayerBase.CEMETERY_TYPE cemeteryType, bool isOpen, SkillBase skill) + { + if (cemeteryType == BattlePlayerBase.CEMETERY_TYPE.NORMAL && !(card is NullBattleCard) && !(card is IVirtualBattleCard) && card.SelfBattlePlayer.ClassAndInPlayCardList.Contains(card)) + { + AIUnknownAction situation = new AIUnknownAction(AI.CurrentVirtualField.SearchVirtualCard(card)); + SequentialVfxPlayer sequential = SequentialVfxPlayer.Create(); + VfxBase emote = AI.GetEmote(AIEmoteCmdType.ON_CARD_DESTROY, situation); + sequential.Register(emote); + if (emote != NullVfx.GetInstance()) + { + _isEmoOnDestroyPlayed = true; + card.OnDestroy += (BattleCardBase destroyCard, SkillProcessor skillProcessor) => sequential; + } + } + }; + self.Class.OnDamageAfter += (SkillProcessor skillProcessorOneTime) => (self.Class.Life <= 0) ? NullVfx.GetInstance() : AI.GetEmote(AIEmoteCmdType.ON_LEADER_DAMAGED); + opponent.Class.OnDamageAfter += (SkillProcessor skillProcessorOneTime) => (opponent.Class.Life <= 0) ? NullVfx.GetInstance() : AI.GetEmote(AIEmoteCmdType.ON_PLAYER_LEADER_DAMAGED); + operateManager.OnBeforeSetCard += delegate + { + AI.EmoteMng.EvalFieldOnBeforeSetCard(); + }; + operateManager.OnSetCardExecuted += delegate(BattleCardBase card) + { + AIUnknownAction situation = new AIUnknownAction(new AIVirtualCard(card, AI.CurrentVirtualField)); + return AI.GetEmote(AIEmoteCmdType.ON_CARD_PLAY_OPPONENT, situation); + }; + operateManager.OnBeforeAttack += delegate + { + AI.EmoteMng.EvalFieldOnBeforeAttack(); + return NullVfx.GetInstance(); + }; + operateManager.OnAttackExecuted += (BattleCardBase attacker, BattleCardBase target, bool needAttack) => AI.GetEmote(AIEmoteCmdType.ON_OPPONENT_ATTACK); + } + + private VfxBase GetEmoteWithTurnStartSimulate(bool isAllyTurnStart) + { + AIVirtualField aIVirtualField = new AIVirtualField((AI.BeforeLatestActionField != null) ? AI.BeforeLatestActionField : AI.CurrentVirtualField); + if (aIVirtualField.AllyTurnCount > 0 || aIVirtualField.EnemyTurnCount > 0) + { + AIVirtualTurnEndSimulator.TurnEnd(new AIVirtualTurnEndInfo(isAllyTurnStart ? aIVirtualField.EnemyClass : aIVirtualField.AllyClass), aIVirtualField); + } + AIVirtualTurnStartInfo situation = new AIVirtualTurnStartInfo(isAllyTurnStart ? aIVirtualField.AllyClass : aIVirtualField.EnemyClass); + aIVirtualField.TurnStartFieldProcess(situation); + return AI.GetEmote(isAllyTurnStart ? AIEmoteCmdType.ON_ALLY_TURN_START : AIEmoteCmdType.ON_OPPONENT_TURN_START, situation); + } + + public AIEmoteCmd OnOpponentEmotion(ClassCharaPrm.EmotionType emoteType) + { + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + if (AI.IsThisTurnEmotePlayed) + { + return null; + } + if (!AI.EmoteQuery.UseInnerEmote) + { + return null; + } + ClassCharaPrm.EmotionType replyEmote = ClassCharaPrm.EmotionType.NULL; + if (AI.EmoteMng.IsReplyAllowed(emoteType, ref replyEmote)) + { + return new AIEmoteCmd(replyEmote); + } + return null; + } + + public AIEmoteCmd OnAllyTurnStart(AISituationInfo situation) + { + AI.EmoteMng.SetUpOnAllyTurnStart(); + AI.EmoteMng.EvalFieldOnTurnStart(); + _isEmoOnDestroyPlayed = false; + int emoteOnTurnStart = AI.StyleQuery.GetEmoteOnTurnStart(isAllyTurn: true, situation.Actor.SelfField); + if (emoteOnTurnStart >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnStart); + } + return null; + } + + public AIEmoteCmd OnOpponentTurnStart(AISituationInfo situation) + { + AI.EmoteMng.EvalFieldOnOpponentTurnStart(); + _isEmoOnDestroyPlayed = false; + AIVirtualField selfField = situation.Actor.SelfField; + int emoteOnTurnStart = AI.StyleQuery.GetEmoteOnTurnStart(isAllyTurn: false, selfField); + if (emoteOnTurnStart >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnStart); + } + emoteOnTurnStart = AI.StyleQuery.GetPlayerEmoteOnTurnStart(selfField); + if (emoteOnTurnStart >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnStart, isAlly: false); + } + return null; + } + + public AIEmoteCmd OnAllyTurnEnd() + { + if (AI.IsTurnEndLethal) + { + return AI.EmoteQuery.SearchEmoteAtRandom(22); + } + for (int i = 0; i < AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards.Count; i++) + { + int emoteOnTurnEndCategory = AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards[i].GetEmoteOnTurnEndCategory(isAllyTurnEnd: true); + if (emoteOnTurnEndCategory >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEndCategory); + } + } + int emoteOnTurnEnd = AI.StyleQuery.GetEmoteOnTurnEnd(isAllyTurn: true); + if (emoteOnTurnEnd >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd); + } + emoteOnTurnEnd = AI.StyleQuery.GetPlayerEmoteOnTurnEnd(isPlayerTurn: false); + if (emoteOnTurnEnd >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd, isAlly: false); + } + if (AI.EmoteMng.IsCheckmated()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(13); + } + if (AI.EmoteMng.IsHuntDown()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(14); + } + if (AI.IsRoyal() && AI.EmoteMng.IsEnoughUnit()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(102); + } + if (AI.IsNecromancer() && AI.EmoteMng.IsEnoughGrave()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(501); + } + if (AI.EmoteMng.IsAwaking(1)) + { + return AI.EmoteQuery.SearchEmoteAtRandom(401); + } + if (AI.EmoteMng.IsUnexpectedBattle()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(11); + } + if (AI.ALLY.InPlayCards.Count() < 5 && AI.EmoteMng.IsRemainTooPP()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(15); + } + return null; + } + + public AIEmoteCmd OnOpponentTurnEnd() + { + if (AI.EmoteMng.IsOpponentTurnEmoteOccured) + { + return null; + } + for (int i = 0; i < AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards.Count; i++) + { + int emoteOnTurnEndCategory = AI.CurrentVirtualField.CardListSet.BothClassAndInplayCards[i].GetEmoteOnTurnEndCategory(isAllyTurnEnd: false); + if (emoteOnTurnEndCategory >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEndCategory); + } + } + int emoteOnTurnEnd = AI.StyleQuery.GetEmoteOnTurnEnd(isAllyTurn: false); + if (emoteOnTurnEnd >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd); + } + emoteOnTurnEnd = AI.StyleQuery.GetPlayerEmoteOnTurnEnd(isPlayerTurn: true); + if (emoteOnTurnEnd >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnTurnEnd, isAlly: false); + } + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + if (AI.EmoteMng.IsOpponentEarnGreatMerit()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(33); + } + if (AI.OPPONENT.InPlayCards.Count() < 5 && AI.EmoteMng.IsOpponentRemainTooPP()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(31); + } + return null; + } + + public AIEmoteCmd OnIterationStart() + { + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + float num = AI.EmoteMng.EvalDisplacement_PlayedValue(); + AI.EmoteMng.ResetLastOpr(); + if (num < -4f) + { + return null; + } + if (num > 4f) + { + return AI.EmoteQuery.SearchEmoteAtRandom(1); + } + return null; + } + + public AIEmoteCmd OnCardPlay(AISituationInfo situation) + { + if (situation == null || situation.Actor == null) + { + return null; + } + int num = AI.CurrentVirtualField.AllyHandCards.FindIndex((AIVirtualCard c) => c.IsSameCard(situation.Actor)); + if (num < 0) + { + return null; + } + AIVirtualField aIVirtualField = new AIVirtualField(AI.CurrentVirtualField) + { + BestPlayPtn = new List { num } + }; + AIVirtualCard aIVirtualCard = aIVirtualField.SearchVirtualCard(situation.Actor); + AISelectedTargetInfoSet aISelectedTargetInfoSet = new AISelectedTargetInfoSet(); + if (situation.SelectedTargets != null) + { + for (int num2 = 0; num2 < AISelectedTargetInfoSet.LENGTH; num2++) + { + AISelectedTargetInfo aISelectedTargetInfo = situation.SelectedTargets.Get(num2); + if (aISelectedTargetInfo == null || !aISelectedTargetInfo.HasTarget) + { + continue; + } + AISelectedTargetInfo aISelectedTargetInfo2 = new AISelectedTargetInfo(aISelectedTargetInfo.Type); + int count = aISelectedTargetInfo.Targets.Count; + for (int num3 = 0; num3 < count; num3++) + { + if (aISelectedTargetInfo.Type == TargetSelectType.Choice) + { + aISelectedTargetInfo2.AddTarget(aISelectedTargetInfo.Targets[num3]); + continue; + } + AIVirtualCard target = aIVirtualField.SearchVirtualCard(aISelectedTargetInfo.Targets[num3]); + aISelectedTargetInfo2.AddTarget(target); + } + aISelectedTargetInfoSet.Set(aISelectedTargetInfo2, num2); + } + if (situation.SelectedTargets.HasChoiceTarget) + { + aISelectedTargetInfoSet.SetChoiceTarget(situation.SelectedTargets.ChoiceTarget); + } + } + AIVirtualTargetSelectAction aIVirtualTargetSelectAction = new AIVirtualTargetSelectAction(aIVirtualCard, aIVirtualCard, situation.ActionType, aISelectedTargetInfoSet); + PlaySimulationInfo playSimulationInfo = AIPlayCardSimulationUtility.CreatePlaySimulationInfo(aIVirtualCard, aIVirtualTargetSelectAction, aIVirtualField); + if (playSimulationInfo == null) + { + AIConsoleUtility.LogError("AIEmoteCtrl:OnCardPlay() playSimulationInfo is null. CardName:" + ((aIVirtualCard != null) ? aIVirtualCard.CardName : "")); + return null; + } + if (playSimulationInfo.Type == PlaySimulationType.Accelerate || playSimulationInfo.Type == PlaySimulationType.Crystalize) + { + AISinglePlayptnRecord playptnRecord = AI.PlayPtnRecorder.FindMatchedPlayPtnRecord(aIVirtualField.BestPlayPtn, aIVirtualField); + aIVirtualTargetSelectAction.SetActor(aIVirtualCard.FindRealActor(playptnRecord)); + } + AIVirtualPlaySimulator.PlayCard(aIVirtualTargetSelectAction, aIVirtualField, playSimulationInfo); + if (aIVirtualField.EnemyClass.Life <= 0 || aIVirtualField.EnemyClass.IsDead) + { + return AI.EmoteQuery.SearchEmoteAtRandom(22); + } + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + AIRealBattleCardSearcher.SearchBattleCardFromSituation(AI.PlayerPair, situation, out var actor, out var targetList); + if (actor == null || (situation.ActionTarget != null && (targetList == null || targetList.Count < 1 || targetList[0] == null)) || (situation.SecondActionTarget != null && (targetList == null || targetList.Count < 2 || targetList[1] == null))) + { + return null; + } + if (AI.ALLY.IsSelfTurn && AI.IsAllyCard(actor)) + { + AIVirtualCard actor2 = situation.Actor; + int emoteCategory = actor2.GetEmoteCategory(AIPlayTagType.EmoteOnPlay); + if (emoteCategory >= 0) + { + AIEmoteCmd result = AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); + AI.EmoteQuery.OnCardPlayEmotion(); + return result; + } + new BattlePlayerPair(actor.SelfBattlePlayer, actor.OpponentBattlePlayer); + int num4 = actor2.BattleSkills.Count(); + for (int num5 = 0; num5 < num4; num5++) + { + SkillBase skill = actor2.BattleSkills.ElementAt(num5); + if (AI.ParamQuery.IsBanishSkill(skill)) + { + return OnBanishSkill(actor, aIVirtualField); + } + } + } + return null; + } + + public AIEmoteCmd OnAllyAttack(AISituationInfo situation) + { + if (!(situation is AIVirtualAttackInfo { Actor: not null, AttackTarget: not null })) + { + AIConsoleUtility.LogError("OnAllyAttack() error!!! situation is not valid attackSituation"); + return null; + } + AI.EmoteMng.EvalFieldOnAttack(); + AIVirtualField aIVirtualField = new AIVirtualField(AI.CurrentVirtualField); + AIVirtualAttackInfo aIVirtualAttackInfo2 = AISimulationUtility.CreateActionInfoOnFieldFromSituation(aIVirtualField, situation) as AIVirtualAttackInfo; + if (!situation.IsSameSituation(aIVirtualAttackInfo2)) + { + AIConsoleUtility.LogError("OnAllyAttack() error!!! Failed situation clone"); + return null; + } + AIVirtualAttackSimulator.Attack(aIVirtualAttackInfo2, aIVirtualField); + if (aIVirtualField.EnemyClass.IsDead) + { + return AI.EmoteQuery.SearchEmoteAtRandom(22); + } + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + int emoteCategory = aIVirtualAttackInfo2.Actor.GetEmoteCategory(AIPlayTagType.EmoteOnAtk); + if (emoteCategory >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); + } + return null; + } + + public AIEmoteCmd OnAllyEvolution(AISituationInfo situation) + { + if (situation == null || situation.Actor == null || situation.ActionType != AIOperationType.EVOLVE) + { + return null; + } + AIVirtualField aIVirtualField = new AIVirtualField(AI.CurrentVirtualField); + AIVirtualActionInfo aIVirtualActionInfo = AISimulationUtility.CreateActionInfoOnFieldFromSituation(aIVirtualField, situation); + if (!situation.IsSameSituation(aIVirtualActionInfo)) + { + return null; + } + AIVirtualEvolutionSimulator.ManualEvolve(aIVirtualActionInfo, aIVirtualField); + if (aIVirtualField.EnemyClass.IsDead) + { + return AI.EmoteQuery.SearchEmoteAtRandom(22); + } + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + int emoteCategory = aIVirtualActionInfo.Actor.GetEmoteCategory(AIPlayTagType.EmoteOnEvo); + if (emoteCategory >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); + } + return null; + } + + public AIEmoteCmd OnBanishSkill(BattleCardBase actCard, AIVirtualField fieldAfterPlayed) + { + if (AI.EmoteMng.IsBanishOverExpected(actCard, fieldAfterPlayed)) + { + return AI.EmoteQuery.SearchEmoteAtRandom(21); + } + return null; + } + + public AIEmoteCmd OnOpponentPlayCardExecuted(AISituationInfo situation) + { + if (AI.EmoteMng.IsCheckmated() || situation == null || situation.Actor == null) + { + return null; + } + AIVirtualCard actor = situation.Actor; + if (AI.EmoteMng.IsOpponentBanishSplendid(actor)) + { + return AI.EmoteQuery.SearchEmoteAtRandom(35); + } + if (AI.EmoteMng.IsOpponentBanishBad(actor)) + { + return AI.EmoteQuery.SearchEmoteAtRandom(36); + } + if (!actor.IsAlly && AI.EmoteMng.IsGiantPlayed()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(34); + } + if (AI.EmoteMng.IsOpponentHealClassLifeLargeOnCardPlay()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(37); + } + return null; + } + + public AIEmoteCmd OnOpponentAttackExecuted() + { + if (AI.EmoteMng.IsCheckmated()) + { + return null; + } + if (AI.EmoteMng.IsOpponentHealClassLifeLargeOnAttack()) + { + return AI.EmoteQuery.SearchEmoteAtRandom(37); + } + return null; + } + + public AIEmoteCmd OnCardDestroy(AISituationInfo situation) + { + if (situation == null || situation.Actor == null || situation.ActionType != AIOperationType.UNKNOWN) + { + return null; + } + AIVirtualCard actor = situation.Actor; + if (actor.IsAlly) + { + int emoteCategory = actor.GetEmoteCategory(AIPlayTagType.ForceEmoteOnDestroy); + if (emoteCategory >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory); + } + } + if (AI.EmoteMng.IsCheckmated() || _isEmoOnDestroyPlayed) + { + return null; + } + if (actor.IsAlly) + { + int emoteCategory2 = actor.GetEmoteCategory(AIPlayTagType.EmoteOnDestroy); + if (emoteCategory2 >= 0) + { + return AI.EmoteQuery.SearchEmoteAtRandom(emoteCategory2); + } + if (AI.OPPONENT.IsSelfTurn && AI.EmoteMng.IsEliminatedAllyLegion(situation.Actor)) + { + return AI.EmoteQuery.SearchEmoteAtRandom(101); + } + } + return null; + } + + public AIEmoteCmd OnLeaderDamaged(AIVirtualField field) + { + int emoteOnLeaderDamaged = AI.StyleQuery.GetEmoteOnLeaderDamaged(field); + return AI.EmoteQuery.SearchEmoteAtRandom(emoteOnLeaderDamaged); + } + + public AIEmoteCmd OnPlayerLeaderDamaged(AIVirtualField field) + { + int playerEmoteOnLeaderDamaged = AI.StyleQuery.GetPlayerEmoteOnLeaderDamaged(field); + return AI.EmoteQuery.SearchEmoteAtRandom(playerEmoteOnLeaderDamaged, isAlly: false); + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEmoteFileNameList.cs b/SVSim.BattleEngine/Engine/Wizard/AIEmoteFileNameList.cs index 3759a983..138f503d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEmoteFileNameList.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEmoteFileNameList.cs @@ -5,9 +5,6 @@ namespace Wizard; public class AIEmoteFileNameList { - private const int EMOTE_ID_INDEX = 0; - - private const int FILE_NAME_INDEX = 1; private readonly Dictionary _dataTable = new Dictionary(); @@ -29,9 +26,4 @@ public class AIEmoteFileNameList } return ""; } - - public List GetFileNameList() - { - return _dataTable.Values.ToList(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEmoteMng.cs b/SVSim.BattleEngine/Engine/Wizard/AIEmoteMng.cs index 9d46fa44..15d546aa 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEmoteMng.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEmoteMng.cs @@ -45,8 +45,6 @@ public class AIEmoteMng public bool IsOpponentTurnEmoteOccured => _isOpponentTurnEmoteOccured; - public Stopwatch Stopwatch => _stopwatch; - public int EmoteRandomSeed { get; private set; } public AIEmoteMng(EnemyAI ai) @@ -135,20 +133,6 @@ public class AIEmoteMng _isOpponentTurnEmoteOccured = false; } - public AIEmoteCmd OnAllyCardDestroy() - { - return null; - } - - public bool IsReverseDisAdv() - { - if (_allyAdvOnTurnStart >= 0f) - { - return false; - } - return AI.CalcFieldAdvantage() >= 0f; - } - public bool IsOpponentEarnGreatMerit() { float num = AI.CalcFieldAdvantage(); @@ -156,24 +140,6 @@ public class AIEmoteMng return _opponentAdvOnTurnStart - num > (float)ppTotal * 2f; } - public bool IsFailedReverseDisAdv() - { - if (_allyAdvOnTurnStart >= 0f) - { - return false; - } - return AI.CalcFieldAdvantage() < 0f; - } - - public bool IsOpponentFailedReverseDisAdv() - { - if (_opponentAdvOnTurnStart <= 0f) - { - return false; - } - return AI.CalcFieldAdvantage() > 0f; - } - public bool IsRemainTooPP() { return AI.ALLY.Pp >= 2; @@ -344,22 +310,6 @@ public class AIEmoteMng return false; } - public bool IsThinkingLong() - { - float num = 20000f; - if (!_isThinkingEmoteOccured) - { - return (float)_stopwatch.ElapsedMilliseconds > num; - } - return false; - } - - public void OnThinkingEmote() - { - _isThinkingEmoteOccured = true; - _stopwatch.Reset(); - } - public void OnOperationRequest() { if (!_isThinkingEmoteOccured) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEmoteQuery.cs b/SVSim.BattleEngine/Engine/Wizard/AIEmoteQuery.cs index e61fc211..787a92b7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEmoteQuery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEmoteQuery.cs @@ -7,28 +7,7 @@ public class AIEmoteQuery { public enum Category { - UnexpectedPlayResult_Good = 1, - UnexpectedPlayResult_Bad = 2, - LongThinking = 3, - UnexpectedBattleResult = 11, - ReverseDisAdv = 12, - CheckMated = 13, - HuntDown = 14, - RemainTooPP = 15, - SpellBanishOverExpected = 21, - FatalAttack = 22, - OpponentRemainTooPP = 31, - OpponentReverseDisAdvFail = 32, - OpponentGetGreatMerit = 33, - OpponentPlayGiant = 34, - OpponentBanishSpell_Good = 35, - OpponentBanishSpell_Bad = 36, - OpponentWellHealing = 37, - EliminatedAllyLegion = 101, - EnoughUnit = 102, - Awake = 401, - EnoughGrave = 501 - } + Awake = 401 } private EnemyAI enemyAI; @@ -46,8 +25,6 @@ public class AIEmoteQuery private Dictionary _categoryIntervalDic; - private const int EMOTE_QUEUE_LENGTH = 3; - public bool UseInnerEmote => _useInnerEmote; public AIEmoteQuery(EnemyAI ai) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvalAttackRemoveUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvalAttackRemoveUtility.cs index 44fe9f71..f93c0f2c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvalAttackRemoveUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvalAttackRemoveUtility.cs @@ -4,9 +4,6 @@ namespace Wizard; public static class AIEvalAttackRemoveUtility { - private const int REMOVE_TYPE_INDEX = 1; - - private const int REMOVE_COUNT_INDEX = 0; public static float EvalAttackRemove(AIVirtualCard tagOwner, AIVirtualField field, List playPtn, AISituationInfo situation, List argList) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvalReanimateUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvalReanimateUtility.cs index 66239cbc..39d07e68 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvalReanimateUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvalReanimateUtility.cs @@ -4,9 +4,6 @@ namespace Wizard; public static class AIEvalReanimateUtility { - private const int SIDE_INDEX = 0; - - private const int REANIMATE_COST_INDEX = 1; public static float EvalReanimate(AIVirtualCard tagOwner, List playPtn, AISituationInfo situation, List argList) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoAddDeck.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoAddDeck.cs index da62a4f5..0e12694a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoAddDeck.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoAddDeck.cs @@ -6,8 +6,6 @@ public class AIEvoAddDeck : AIEvoTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; protected override int SELECT_TYPE_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoAddStack.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoAddStack.cs index b547833f..43ca0965 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoAddStack.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoAddStack.cs @@ -6,8 +6,6 @@ public class AIEvoAddStack : AIEvoTagArgument { private AIPolishConvertedExpression _addStackCount; - private const int ADD_STACK_COUNT_ARG_INDEX = 0; - protected override int SELECT_TYPE_OFFSET => -1; protected override int NON_FILTER_FIRST_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoAttachTag.cs index 52b75c45..d569cc67 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoAttachTag.cs @@ -10,10 +10,6 @@ public class AIEvoAttachTag : AIEvoTagArgument private readonly int REMOVE_TIMING_OFFSET = 1; - private const int TAG_WORD_START_INDEX = 1; - - private const int SELECT_LOGIC_WORD_START_INDEX = 4; - public AIPlayTag Tag { get; private set; } protected override int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoAttackableCount.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoAttackableCount.cs index efd7e188..77323ff9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoAttackableCount.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoAttackableCount.cs @@ -6,8 +6,6 @@ public class AIEvoAttackableCount : AIEvoTagArgument { private AIPolishConvertedExpression _attackableCount; - private const int ATTACKABLE_COUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIEvoAttackableCount(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoChangeCost.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoChangeCost.cs index 982e0e2c..3eb8bebc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoChangeCost.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoChangeCost.cs @@ -12,10 +12,6 @@ public class AIEvoChangeCost : AIEvoTagArgument private AIPolishConvertedExpression _costValue; - private const int COST_VALUE_ARG_OFFSET = 1; - - private const int COST_TYPE_ARG_OFFSET = 2; - public AIScriptTokenArgType CostVariableType { get; private set; } public override TargetSelectType SimulationTargetSelectType => TargetSelectType.NormalRuleBase; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoDamageCut.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoDamageCut.cs index 46eb562d..27d0f7a7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoDamageCut.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoDamageCut.cs @@ -12,12 +12,6 @@ public class AIEvoDamageCut : AIEvoTagArgument private bool _isDamageTypeDefinedByMaster; - private const int CUT_AMOUNT_OFFSET = 1; - - private const int STOP_TIMING_OFFSET = 2; - - private const int DEFAULT_DAMAGE_TYPE_OFFSET = 3; - protected override int SELECT_TYPE_OFFSET => 1 + (_isDamageTypeDefinedByMaster ? 3 : 2); public AIEvoDamageCut(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoDiscard.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoDiscard.cs index 599f6e20..4cfe3588 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoDiscard.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoDiscard.cs @@ -6,8 +6,6 @@ public class AIEvoDiscard : AIEvoTagArgument { private AIPolishConvertedExpression _discardCountArg; - private const int DISCARD_COUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public override TargetSelectType SimulationTargetSelectType => TargetSelectType.NormalRuleBase; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoReanimate.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoReanimate.cs index 35176f28..c28a6857 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoReanimate.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoReanimate.cs @@ -6,8 +6,6 @@ public class AIEvoReanimate : AIEvoTagArgument { private AIPolishConvertedExpression _costArgument; - private const int REANIMATE_COST_ARG_INDEX = 0; - protected override int SELECT_TYPE_OFFSET => -1; protected override int NON_FILTER_FIRST_OFFSET => 0; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoSetLeaderMaxLife.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoSetLeaderMaxLife.cs index 644ccef0..ae072427 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoSetLeaderMaxLife.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoSetLeaderMaxLife.cs @@ -8,10 +8,6 @@ public class AIEvoSetLeaderMaxLife : AIEvoTagArgument private AIPolishConvertedExpression _life; - private const int SIDE_OFFSET = 2; - - private const int VALUE_OFFSET = 1; - public AIEvoSetLeaderMaxLife(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoShield.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoShield.cs index ce38ce95..4f6b26b4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoShield.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoShield.cs @@ -8,10 +8,6 @@ public class AIEvoShield : AIEvoTagArgument private AIScriptTokenArgType _damageType; - private const int DEFAULT_DAMAGE_TYPE_OFFSET = 2; - - private const int STOP_TIMING_OFFSET = 1; - private bool _isDamageTypeDefinedByMaster; protected override int SELECT_TYPE_OFFSET => 1 + ((!_isDamageTypeDefinedByMaster) ? 1 : 2); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoSubtractCountdown.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoSubtractCountdown.cs index 70e6d887..0737ecc3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoSubtractCountdown.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoSubtractCountdown.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIEvoSubtractCountdown : AIEvoTagArgument { - private const int COUNTDOWN_ARG_OFFSET = 1; private AIPolishConvertedExpression _countDownArg; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoToken.cs index 7ec5b6db..4fcead15 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoToken.cs @@ -6,8 +6,6 @@ public class AIEvoToken : AIEvoTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; protected override int SELECT_TYPE_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvoTokenDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvoTokenDraw.cs index 0b8dc231..8c466781 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvoTokenDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvoTokenDraw.cs @@ -6,8 +6,6 @@ public class AIEvoTokenDraw : AIEvoTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; protected override int SELECT_TYPE_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvolMove.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvolMove.cs deleted file mode 100644 index 5962817f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvolMove.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -internal class AIEvolMove : AIMove -{ - public BattleCardBase Src { get; private set; } - - public List Targets { get; private set; } - - public AIEvolMove(BattleCardBase src, List targets) - : base(AIOperationType.EVOLVE) - { - Src = src; - Targets = targets; - } - - public override void RunOperation(BattleManagerBase mgr, bool isPlayer) - { - mgr.VfxMgr.RegisterSequentialVfx(mgr.OperateMgr.EvolutionCard(Src, isPlayer, Targets)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIEvolvedAttackableCount.cs b/SVSim.BattleEngine/Engine/Wizard/AIEvolvedAttackableCount.cs index bc77e80f..048ed51c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIEvolvedAttackableCount.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIEvolvedAttackableCount.cs @@ -28,9 +28,4 @@ public class AIEvolvedAttackableCount : AIScriptArgumentExpressions tagOwner.GiveAttackableCount(count); } } - - public int GetAttackableCount(AIVirtualCard owner, List playPtn, AIVirtualField field, AISituationInfo situation) - { - return (int)Count.EvalArg(owner, playPtn, field, situation); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIFilteringActivateCountArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIFilteringActivateCountArgument.cs index cc70ff75..b74726f6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIFilteringActivateCountArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIFilteringActivateCountArgument.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIFilteringActivateCountArgument : AIActivateCountTagArgument { - private const int MAX_ACTIVATE_COUNT_OFFSET = 4; public List Filters { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIFusionDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIFusionDraw.cs index 3c9fe0a5..0cb3a73c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIFusionDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIFusionDraw.cs @@ -6,8 +6,6 @@ public class AIFusionDraw : AIScriptArgumentExpressions { private AIPolishConvertedExpression _drawCount; - private const int DRAW_COUNT_ARG_INDEX = 0; - public AIFusionDraw(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIFusionMove.cs b/SVSim.BattleEngine/Engine/Wizard/AIFusionMove.cs deleted file mode 100644 index ad191f59..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIFusionMove.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -internal class AIFusionMove : AIMove -{ - public BattleCardBase Src { get; private set; } - - public List Targets { get; private set; } - - public AIFusionMove(BattleCardBase src, List targets) - : base(AIOperationType.FUSION) - { - Src = src; - Targets = targets; - } - - public override void RunOperation(BattleManagerBase mgr, bool isPlayer) - { - mgr.VfxMgr.RegisterSequentialVfx(mgr.OperateMgr.FusionCard(Src, isPlayer, Targets)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIFusionSituationInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AIFusionSituationInfo.cs index 4c6f7a78..c646942c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIFusionSituationInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIFusionSituationInfo.cs @@ -12,18 +12,6 @@ public class AIFusionSituationInfo : AISituationInfo public AIPolishConvertedExpression PriorityExpression { get; private set; } - public bool HasTargets - { - get - { - if (Targets != null) - { - return Targets.Count > 0; - } - return false; - } - } - public AIFusionSituationInfo(AIVirtualCard actor, List targets) : base(actor, null, null, AIOperationType.FUSION) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGameStartAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIGameStartAttachTag.cs index 0346d6fd..05e253e8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGameStartAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGameStartAttachTag.cs @@ -8,8 +8,6 @@ public class AIGameStartAttachTag : AIFiltersAndSelectTypeArgument private AIScriptTokenArgType _removeTiming; - private const int REMOVE_TIMING_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIGameStartAttachTag(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGenerateTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIGenerateTag.cs index 4856e725..d6797a32 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGenerateTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGenerateTag.cs @@ -8,8 +8,6 @@ public class AIGenerateTag : AIScriptArgumentExpressions public AIPlayTag Tag; - private const int REMOVE_TIMING_ARG_OFFSET = 1; - public AIScriptTokenArgType RemoveTiming { get; private set; } private int HASH_ARG_END_OFFSET => 1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGenerateTagOwnerTable.cs b/SVSim.BattleEngine/Engine/Wizard/AIGenerateTagOwnerTable.cs index cb72c5a8..e64dab8f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGenerateTagOwnerTable.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGenerateTagOwnerTable.cs @@ -65,11 +65,6 @@ public class AIGenerateTagOwnerTable _ownerInfoList = new List(); } - public void ClearAll() - { - _ownerInfoList.Clear(); - } - public AIGenerateTagOwnerTable Clone() { AIGenerateTagOwnerTable aIGenerateTagOwnerTable = new AIGenerateTagOwnerTable(); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGetOffEvo.cs b/SVSim.BattleEngine/Engine/Wizard/AIGetOffEvo.cs index 5989a6db..7defc1ca 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGetOffEvo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGetOffEvo.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIGetOffEvo : AIFiltersAndSelectTypeArgument { - private AIPolishConvertedExpression _tokenId; protected override int SELECT_TYPE_OFFSET => 1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGetOffMetamorphose.cs b/SVSim.BattleEngine/Engine/Wizard/AIGetOffMetamorphose.cs index 6b213d17..8485eb88 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGetOffMetamorphose.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGetOffMetamorphose.cs @@ -6,10 +6,6 @@ public class AIGetOffMetamorphose : AIFiltersAndSelectTypeArgument { private AIPolishConvertedExpression _tokenId; - private const int INVALID_TOKEN_ID = -1; - - private const int TOKEN_ID_ARG_OFFSET = 1; - private AIScriptTokenArgType _registerSide = AIScriptTokenArgType.BOTH; protected override int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGetOnBanish.cs b/SVSim.BattleEngine/Engine/Wizard/AIGetOnBanish.cs index 0448a8a1..cedf0431 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGetOnBanish.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGetOnBanish.cs @@ -6,8 +6,6 @@ public class AIGetOnBanish : AITriggerAndTargetFiltersTagBase { private AIScriptTokenArgType _selectType; - private const int SELECT_TYPE_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIGetOnBanish(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGetOnDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIGetOnDamage.cs index 780d58b3..bfd7a1da 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGetOnDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGetOnDamage.cs @@ -8,10 +8,6 @@ public class AIGetOnDamage : AITriggerAndTargetFiltersTagBase public AIScriptTokenArgType SelectType; - private const int DAMAGE_VALUE_ARG_OFFSET = 1; - - private const int SELECT_TYPE_ARG_OFFSET = 2; - protected override int NON_FILTER_FIRST_OFFSET => 2; public AIGetOnDamage(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIGetOnEvo.cs b/SVSim.BattleEngine/Engine/Wizard/AIGetOnEvo.cs index 9f662807..f0ca2936 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIGetOnEvo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIGetOnEvo.cs @@ -6,8 +6,6 @@ public class AIGetOnEvo : AITriggerAndTargetFiltersTagBase { private AIScriptTokenArgType _selectType; - private const int SELECT_TYPE_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIGetOnEvo(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHandPtnCalculator.cs b/SVSim.BattleEngine/Engine/Wizard/AIHandPtnCalculator.cs index be71901d..dbccddc8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHandPtnCalculator.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHandPtnCalculator.cs @@ -111,17 +111,6 @@ public static class AIHandPtnCalculator } } - public static int ConvertPlayPtnToHandPtnIndex(List playPtn, int handNum) - { - int num = 0; - for (int i = 0; i < playPtn.Count; i++) - { - int num2 = (int)Mathf.Pow(2f, handNum - playPtn[i] - 1); - num += num2; - } - return num; - } - public static void PrioritySortHand(EnemyAI ai, List handList) { IComparer comparer = new PriorityComparer(ai, handList); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHealAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIHealAttachTag.cs index cc56f701..278c9918 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHealAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHealAttachTag.cs @@ -6,12 +6,6 @@ public class AIHealAttachTag : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _selectCountArg; - private const int SELECT_TYPE_ARG_OFFSET = 3; - - private const int SELECT_COUNT_ARG_OFFSET = 2; - - private const int REMOVE_TIMING_ARG_OFFSET = 1; - public AIPlayTag Tag { get; private set; } public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHealBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIHealBuff.cs index 1be48466..a2ea3870 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHealBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHealBuff.cs @@ -4,11 +4,6 @@ namespace Wizard; public class AIHealBuff : AITriggerAndTargetFiltersTagBase { - private const int LIFE_OFFSET = 1; - - private const int ATTACK_OFFSET = 2; - - private const int SELECT_TYPE_OFFSET = 3; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHealDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIHealDamage.cs index 1e75d083..1ad538a7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHealDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHealDamage.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIHealDamage : AITriggerAndTargetFiltersTagBase { - private const int DAMAGE_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 2; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHealHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIHealHeal.cs index 07fc5069..a75d6211 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHealHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHealHeal.cs @@ -6,10 +6,6 @@ public class AIHealHeal : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _healValue; - private const int SELECT_TYPE_ARG_OFFSET = 2; - - private const int HEAL_VALUE_ARG_OFFSET = 1; - public AIScriptTokenArgType SelectType { get; private set; } protected override int NON_FILTER_FIRST_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHealRecorderCollection.cs b/SVSim.BattleEngine/Engine/Wizard/AIHealRecorderCollection.cs index fdf5d568..775b634e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHealRecorderCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHealRecorderCollection.cs @@ -65,10 +65,4 @@ public class AIHealRecorderCollection { (isAlly ? AllyHealRecorderList : EnemyHealRecorderList).Add(new AIHealRecorder(turn, healedCard)); } - - public void Clear() - { - AllyHealRecorderList.Clear(); - EnemyHealRecorderList.Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIHealToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIHealToken.cs index 767bab4b..1fef968a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIHealToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIHealToken.cs @@ -6,8 +6,6 @@ public class AIHealToken : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIHealToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordAddDeck.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordAddDeck.cs index 33ef883c..2a37c102 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordAddDeck.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordAddDeck.cs @@ -8,10 +8,6 @@ public class AILastwordAddDeck : AIScriptArgumentExpressions private AIPolishConvertedExpression _addCountExpression; - private const int ADD_CARD_ID_ARG_INDEX = 0; - - private const int ADD_COUNT_ARG_INDEX = 1; - public AILastwordAddDeck(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordAttachTag.cs index 5ed2c478..74740893 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordAttachTag.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AILastwordAttachTag : AIFiltersArgument { - private const int SELECT_TYPE_OFFSET = 2; - - private const int TIMING_OFFSET = 1; public AIPlayTag Tag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordBuff.cs index 4f1f6b3e..a953dd89 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordBuff.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AILastwordBuff : AIFiltersAndSelectTypeArgument { - private const int LIFE_OFFSET = 1; - - private const int ATTACK_OFFSET = 2; public AIPolishConvertedExpression Attack { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordDamageClip.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordDamageClip.cs index 438e199c..f72be99c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordDamageClip.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordDamageClip.cs @@ -10,12 +10,6 @@ public class AILastwordDamageClip : AIFiltersAndSelectTypeArgument private AIPolishConvertedExpression _clipAmount; - private const int CLIP_AMOUNT_OFFSET = 1; - - private const int STOP_TIMING_OFFSET = 2; - - private const int DEFAULT_DAMAGE_TYPE_OFFSET = 3; - protected bool _isDamageTypeDefinedByMaster; protected override int SELECT_TYPE_OFFSET => 1 + (_isDamageTypeDefinedByMaster ? 3 : 2); diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordDraw.cs index 610b2196..78624244 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordDraw.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AILastwordDraw : AIScriptArgumentExpressions { - private const int COUNT_ARG_INDEX = 1; public AIPolishConvertedExpression DrawCount { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordReanimate.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordReanimate.cs index 9bc45e62..940c0adc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordReanimate.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordReanimate.cs @@ -8,10 +8,6 @@ public class AILastwordReanimate : AIFiltersArgument public AIScriptTokenArgType TokenSide; - private const int SIDE_OFFSET = 1; - - private const int REANIMATE_COST_ARG_OFFSET = 2; - private int _ommittedIndexOffset; private int _realNonFilterFirstOffset; diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordShield.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordShield.cs index 6793fbe5..46d52a93 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordShield.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordShield.cs @@ -8,10 +8,6 @@ public class AILastwordShield : AIFiltersAndSelectTypeArgument private AIScriptTokenArgType _damageType; - private const int STOP_TIMING_OFFSET = 1; - - private const int DEFAULT_DAMAGE_TYPE_OFFSET = 2; - protected bool _isDamageTypeDefinedByMaster; protected override int SELECT_TYPE_OFFSET => 1 + ((!_isDamageTypeDefinedByMaster) ? 1 : 2); diff --git a/SVSim.BattleEngine/Engine/Wizard/AILastwordToken.cs b/SVSim.BattleEngine/Engine/Wizard/AILastwordToken.cs index 2895c43d..269a0954 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILastwordToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILastwordToken.cs @@ -8,10 +8,6 @@ public class AILastwordToken : AIFiltersArgument private AIScriptTokenArgType _tokenSide; - private const int DEFAULT_TOKEN_COUNT_INDEX_OFFSET = 2; - - private const int TOKEN_SIDE_INDEX_OFFSET = 1; - private int _realTokenCountIndexOffset; protected override int NON_FILTER_FIRST_OFFSET => _realTokenCountIndexOffset; @@ -77,11 +73,6 @@ public class AILastwordToken : AIFiltersArgument return AISummonTokenUtility.GetBothSideTokenIdListFromFilter(tagOwner, field, targetsFromField, base.Filters, AITokenType.Default, _tokenSide, AIScriptTokenArgType.ALL_SELECT, num, playPtn, null); } - public AIScriptTokenArgType GetTokenSide() - { - return _tokenSide; - } - protected override AITokenIdCollection CreateRegisterTokenPoolInfo(AIVirtualCard owner, List idList) { return AISummonTokenUtility.CreateTokenIdCollectionFromIdList(owner, _tokenSide, idList, AITokenType.Default); diff --git a/SVSim.BattleEngine/Engine/Wizard/AILeaveHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AILeaveHeal.cs index 7c4349e1..bedc080e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILeaveHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILeaveHeal.cs @@ -6,8 +6,6 @@ public class AILeaveHeal : AIFiltersAndSelectTypeArgument { private AIPolishConvertedExpression _healValue; - private const int HEAL_VALUE_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AILeaveHeal(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AILeaveToken.cs b/SVSim.BattleEngine/Engine/Wizard/AILeaveToken.cs index 252db7f4..4df44b6a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILeaveToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILeaveToken.cs @@ -6,8 +6,6 @@ public class AILeaveToken : AIFiltersArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AILeaveToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AILethalSimulator.cs b/SVSim.BattleEngine/Engine/Wizard/AILethalSimulator.cs index 6bba56fe..d41cc175 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AILethalSimulator.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AILethalSimulator.cs @@ -14,8 +14,6 @@ public class AILethalSimulator private bool _isForceFailedSimulation; - public AIVirtualField CurrentField => _operator.CurrentField; - public AIVirtualField CurrentFieldForNewSimulator { get; private set; } public AILethalSimulator(EnemyAI ai) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIMathematicsLibrary.cs b/SVSim.BattleEngine/Engine/Wizard/AIMathematicsLibrary.cs index d591b931..f35dc8da 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIMathematicsLibrary.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIMathematicsLibrary.cs @@ -105,25 +105,4 @@ public static class AIMathematicsLibrary } } } - - public static List GetPatternList(List candidates, int patternIndex) - { - if (patternIndex <= 0) - { - return null; - } - int num = patternIndex; - int count = candidates.Count; - List list = new List(); - for (int i = 0; i < count; i++) - { - int num2 = (int)Mathf.Pow(2f, count - i - 1); - if (num / num2 > 0) - { - num -= num2; - list.Add(candidates[i]); - } - } - return list; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIMetamorphoseSelectLogicArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIMetamorphoseSelectLogicArgument.cs index b8188bf9..a70945e9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIMetamorphoseSelectLogicArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIMetamorphoseSelectLogicArgument.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIMetamorphoseSelectLogicArgument : AISelectLogicArgumentBase { - private const int INVALID_ID = -1; - - private const int METAMORPHOSE_ID_ARG_INDEX = 0; public override AIScriptTokenArgType LogicType => AIScriptTokenArgType.METAMORPHOSE_LOGIC; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIModifyValue.cs b/SVSim.BattleEngine/Engine/Wizard/AIModifyValue.cs index e8ae919d..fb70845e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIModifyValue.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIModifyValue.cs @@ -6,8 +6,6 @@ public class AIModifyValue : AIFiltersArgument { private AIPolishConvertedExpression _modifyValueArg; - private const int MODIFY_VALUE_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIModifyValue(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIMove.cs b/SVSim.BattleEngine/Engine/Wizard/AIMove.cs deleted file mode 100644 index afbea662..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIMove.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Wizard; - -public abstract class AIMove -{ - public AIOperationType Type { get; private set; } - - protected AIMove(AIOperationType type) - { - Type = type; - } - - public abstract void RunOperation(BattleManagerBase mgr, bool isPlayer); -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AINecromance.cs b/SVSim.BattleEngine/Engine/Wizard/AINecromance.cs index 81dc5e16..5850338b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AINecromance.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AINecromance.cs @@ -6,10 +6,6 @@ public class AINecromance : AIScriptArgumentExpressions { private AIPolishConvertedExpression valueArg; - private const int ValueArgIndex = 0; - - private const int TimingIndex = 1; - public AIScriptTokenArgType Timing { get; private set; } public AINecromance(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AINecromanceAddCemetery.cs b/SVSim.BattleEngine/Engine/Wizard/AINecromanceAddCemetery.cs index 4b40fc6a..adb106e0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AINecromanceAddCemetery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AINecromanceAddCemetery.cs @@ -6,8 +6,6 @@ public class AINecromanceAddCemetery : AIScriptArgumentExpressions { private AIPolishConvertedExpression _addCountArg; - private const int ADD_COUNT_ARG_OFFSET = 1; - public AINecromanceAddCemetery(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AINecromanceAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AINecromanceAttachTag.cs index e3e93d21..eff2ec66 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AINecromanceAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AINecromanceAttachTag.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AINecromanceAttachTag : AIFiltersAndSelectTypeArgument { - private const int TIMING_OFFSET = 1; public AIPlayTag AttachedTag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AINecromanceDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AINecromanceDamage.cs index e60c5c2b..b4ea7150 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AINecromanceDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AINecromanceDamage.cs @@ -6,8 +6,6 @@ public class AINecromanceDamage : AIFiltersAndSelectTypeArgument { private AIPolishConvertedExpression _damageAmount; - private const int DAMAGE_AMOUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; protected override int NON_FILTER_FIRST_OFFSET => SELECT_TYPE_OFFSET; diff --git a/SVSim.BattleEngine/Engine/Wizard/AINecromanceHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AINecromanceHeal.cs index 80218b4b..5d647352 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AINecromanceHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AINecromanceHeal.cs @@ -6,8 +6,6 @@ public class AINecromanceHeal : AIFiltersAndSelectTypeArgument { private AIPolishConvertedExpression _healAmout; - private const int HEAL_AMOUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; protected override int NON_FILTER_FIRST_OFFSET => SELECT_TYPE_OFFSET; diff --git a/SVSim.BattleEngine/Engine/Wizard/AINetworkBattleManager.cs b/SVSim.BattleEngine/Engine/Wizard/AINetworkBattleManager.cs deleted file mode 100644 index b6ffafe9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AINetworkBattleManager.cs +++ /dev/null @@ -1,503 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle; -using Wizard.Battle.Phase; -using Wizard.Battle.Recovery; -using Wizard.Battle.View.Vfx; -using Wizard.BattleMgr; - -namespace Wizard; - -public class AINetworkBattleManager : NetworkBattleManagerBase -{ - private AITurnControl _aiTurnControl; - - private Func _turnTransitionFunc; - - private VfxBase _initiateGameEndFunc; - - private bool _sendFinshBattleTask; - - private bool _isWin; - - public AIBattleInfoReceiver BattleInfoReceiver { get; protected set; } - - public AINetworkBattleManager(IBattleMgrContentsCreator contentsCreator) - : base(contentsCreator) - { - _turnTransitionFunc = null; - } - - protected override void NetworkBattleManagerSetup() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.SetDeckMaxCount(40, isSelf: true); - dataMgr.SetDeckMaxCount(40, isSelf: false); - IsShowDisconnectPanel = false; - IsShowOpponentDisconnectPanel = false; - NotReplaceCardList = new List(); - base.validateSkillIndexList = new List(); - RegisterActionManager = new RegisterActionManager(this); - base.RegisterUnapprovedList = new List(); - base.registerSelectTypeSkillIndexList = new List(); - sendKeyActionDataManager = new SendKeyActionDataManager(); - TouchControl = new NetworkTouchControl(this, _battleCamera, _backGround); - networkTouchControl = TouchControl as NetworkTouchControl; - JudgeResultReceiveCode = NetworkBattleReceiver.RESULT_CODE.NotFinish; - if (base.IsRecovery || GameMgr.GetIns().IsReplayBattle) - { - networkTouchControl.SetDisableTouch(); - base.networkBattleData = new NetworkRecoveryBattleData(this); - networkReceiver = new NetworkReplayBattleReceiver(this); - OperateReceive = new RecoveryOperateReceive(this, RegisterActionManager, OperateMgr, base.networkBattleData); - int selfIdxSeed = (base.IsRecovery ? _contentsCreator.RecoveryManager.IdxChangeSeed : Data.ReplayBattleInfo.IdxChangeSeed); - int oppIdxSeed = (GameMgr.GetIns().IsReplayBattle ? Data.ReplayBattleInfo.OppoIdxChangeSeed : (-1)); - CreateXorShift(selfIdxSeed, oppIdxSeed); - BattleEnemy.EnableEnemyAI = false; - } - else - { - base.networkBattleData = new NetworkBattleData(this); - networkReceiver = new NetworkBattleReceiver(this); - OperateReceive = new OperateReceive(this, RegisterActionManager, OperateMgr, base.networkBattleData); - } - OperateMgr.SetTouchControl(TouchControl); - networkConsistency = new NetworkConsistency(this); - _networkBattleSetupCardEventBase = new NetworkAIBattleSetupCardEvent(this, RegisterActionManager, base.networkBattleData); - operateReceiveChecker = new OperateReceiveChecker(this, base.networkBattleData); - _intervalCheckList = new List(); - base.opponentRecoveryToDispChecker = new OpponentRecoveryToDispChecker(); - base.disconnectToDispChecker = new DisconnectToDispChecker(); - _intervalCheckList.Add(base.disconnectToDispChecker); - base.disconnectToLoseChecker = new DisconnectToLoseChecker(); - base.disconnectToLoseChecker.OnDisconnectLose += delegate - { - DisconnectLose(); - }; - base.disconnectToLoseChecker.OnBeforeDisconnectLose += delegate - { - BeforeDisconnectLose(); - }; - _intervalCheckList.Add(base.disconnectToLoseChecker); - base.notMulliganEndToJudgeChecker = new NullNotMulliganEndToJudgeChecker(); - base.notTurnEndToLoseChecker = new NullNotTurnEndToLoseChecker(this); - base.receiveTurnEndToJudgeResult = new NullReceiveTurnEndToJudgeResult(); - _intervalCheckList.Add(base.notTurnEndToLoseChecker); - base.notTurnStartToLoseChecker = new NullNotTurnStartToLoseChecker(); - _intervalCheckList.Add(base.notTurnStartToLoseChecker); - SendIntervalTriggerMain = new AISendIntervalTrigger(); - base.NetworkSender = new NetworkBattleSender(this, RegisterActionManager, base.RegisterUnapprovedList, networkConsistency); - _aiTurnControl = new AITurnControl(); - if (!base.IsRecovery) - { - SettingOpponentAliveEvent(); - IsStopIntervalCheck = false; - ToolboxGame.RealTimeNetworkAgent.StartPreparedStartTimer(DateTime.Now); - ToolboxGame.RealTimeNetworkAgent.StartRecoveryRecording(); - } - } - - protected override void DisconnectLose() - { - JudgeErrorDialog(isError: false); - } - - public override VfxBase ChangePhase(IPhase phase) - { - if (phase is NetworkMulliganPhase || (phase is MainPhase && base.IsRecovery)) - { - base.notMulliganEndToJudgeChecker.StartChecker(); - base.disconnectToDispChecker.OnDisp += delegate - { - ControlDisconnectOffTouchAndView(flag: true); - }; - base.disconnectToDispChecker.OnErase += delegate - { - ControlDisconnectOffTouchAndView(flag: false); - }; - } - if (phase is OpeningPhase) - { - ConnectionReportTrigger.ConnectionReport(this); - } - return base.ChangePhase(phase); - } - - public override void Update(float dt) - { - base.Update(dt); - if (_turnTransitionFunc != null && ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive) - { - base.VfxMgr.RegisterSequentialVfx(_turnTransitionFunc.GetAllFuncVfxResults()); - _turnTransitionFunc = null; - } - if (_initiateGameEndFunc != null && ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive) - { - base.VfxMgr.RegisterSequentialVfx(_initiateGameEndFunc); - _initiateGameEndFunc = null; - } - if (ToolboxGame.RealTimeNetworkAgent != null && _turnTransitionFunc == null && !IsBattleEnd && BattleEnemy.IsSelfTurn) - { - _aiTurnControl.Update(EnemyAI); - } - } - - public override void SetupBattlePlayersEvent() - { - BattlePlayer.OnSetupCardEvent += SetupCardEvent; - BattleEnemy.OnSetupCardEvent += SetupCardEvent; - BattlePlayer.OnSetupClassEvent += SetupPlayerClassEvent; - BattleEnemy.OnSetupClassEvent += SetupOpponentClassEvent; - BattlePlayer.Setup(BattleEnemy); - BattleEnemy.Setup(BattlePlayer); - BattlePlayer.OnTurnEnd += delegate - { - base.VfxMgr.Cancel(); - return NullVfx.GetInstance(); - }; - } - - protected override void SetupNetworkEvent(bool isRecovery) - { - BattlePlayer.OnPlayerActive += delegate - { - if (turnEndTimeController != null) - { - turnEndTimeController.StartCountDown("AIOnPlayerActive"); - } - }; - BattlePlayer battlePlayer = BattlePlayer; - battlePlayer.OnPostTurnEndComplete = (Action)Delegate.Combine(battlePlayer.OnPostTurnEndComplete, (Action)delegate - { - if (turnEndTimeController != null) - { - turnEndTimeController.EndCountDown("AIOnTurnEndComplete"); - } - SendTurnEndAction(); - }); - BattleEnemy.OnTurnStartBeforeDraw += delegate - { - if (!IsVirtualBattle) - { - _aiTurnControl.StartTurnTimer(); - } - return NullVfx.GetInstance(); - }; - BattleEnemy battleEnemy = BattleEnemy; - battleEnemy.OnPostTurnEndComplete = (Action)Delegate.Combine(battleEnemy.OnPostTurnEndComplete, (Action)delegate - { - if (!IsVirtualBattle) - { - _aiTurnControl.StopTurnTimer(); - } - }); - } - - public override void InitiateGameEndSequence(bool hasWon) - { - if (ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive) - { - if (!_sendFinshBattleTask) - { - _sendFinshBattleTask = true; - _isWin = hasWon; - BattleFinishToEffectClear(); - BattleFinishToStopIntervalChecker(); - ToolboxGame.RealTimeNetworkAgent.FinishBattleTask(this); - } - } - else - { - _initiateGameEndFunc = InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon); - }); - } - } - - public override void FinishBattleEffect(bool classDead) - { - classDead = !_isWin; - if (classDead) - { - BattleCardBase battleCardBase = GetBattlePlayer(classDead).Class; - if (battleCardBase.Life >= 1 && !battleCardBase.IsDead) - { - battleCardBase.FlagCardAsDestroyedByKiller(); - FINISH_TYPE finishTypeByStatus = GetFinishTypeByStatus(); - base.VfxMgr.RegisterSequentialVfx(DeadClass(classDead, finishTypeByStatus)); - } - } - base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - base.InitiateGameEndSequence(!classDead); - })); - } - - public override VfxBase JudgeBattleResult() - { - if (BattlePlayer.Class.IsDead && BattleEnemy.Class.IsDead) - { - return InstantVfx.Create(delegate - { - InitiateGameEndSequence(!BattlePlayer.IsSelfTurn); - }); - } - if (BattlePlayer.Class.IsDead) - { - return InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon: false); - }); - } - if (BattleEnemy.Class.IsDead) - { - return InstantVfx.Create(delegate - { - InitiateGameEndSequence(hasWon: true); - }); - } - return NullVfx.GetInstance(); - } - - protected override void SetupEvent() - { - base.SetupEvent(); - BattlePlayer.OnShortageDeck += () => OnShortageDeck(BattlePlayer); - BattleEnemy.OnShortageDeck += () => OnShortageDeck(BattleEnemy); - SetUpTurnTransitionEvent(); - } - - private void SetUpTurnTransitionEvent() - { - BattlePlayer.OnTurnEndFinish += delegate - { - if (IsVirtualBattle || base.IsRecovery) - { - return NullVfx.GetInstance(); - } - _turnTransitionFunc = null; - _turnTransitionFunc = (Func)Delegate.Combine(_turnTransitionFunc, new Func(base.ControlTurnStartOpponent)); - return NullVfx.GetInstance(); - }; - BattleEnemy.OnTurnEndFinish += delegate - { - if (IsVirtualBattle || base.IsRecovery) - { - return NullVfx.GetInstance(); - } - _turnTransitionFunc = null; - _turnTransitionFunc = (Func)Delegate.Combine(_turnTransitionFunc, new Func(base.ControlTurnStartPlayer)); - return NullVfx.GetInstance(); - }; - } - - protected override void SetupBattlePlayerRegisterEvents(BattlePlayerBase battlePlayer) - { - } - - protected override void SetupNetworkActionProcessorEvent(ActionProcessor processor, bool isPlayer) - { - } - - public override void SetupFieldAndHandAfterRecovery(Action onEndRecoveryCallback, RecoveryOperationInfo aiBattleRecoveryData = null) - { - if (aiBattleRecoveryData.SetupInfo.HasMulliganInfo) - { - BattlePlayer.PlayerBattleView.ClearPlayQueue(); - BattleEnemy.BattleEnemyView.ClearPlayQueue(); - RecreateCardViews(BattlePlayer.InPlayCards); - RecreateCardViews(BattlePlayer.HandCardList); - RecreateCardViews(BattlePlayer.DeckCardList); - RecreateCardViews(BattlePlayer.ReservedCardList); - RecreateCardViews(BattleEnemy.InPlayCards); - RecreateCardViews(BattleEnemy.HandCardList); - RecreateCardViews(BattleEnemy.DeckCardList); - RecreateCardViews(BattleEnemy.ReservedCardList); - RefreshHealthVfx refreshHealthVfx = new RefreshHealthVfx(BattlePlayer); - RefreshHealthVfx refreshHealthVfx2 = new RefreshHealthVfx(BattleEnemy); - ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(BattlePlayer.BattleView.Recovery(doseFirst: false), BattleEnemy.BattleView.Recovery(doseFirst: false), refreshHealthVfx, refreshHealthVfx2); - VfxBase vfxBase = (BattleEnemy.IsSelfTurn ? BattleEnemy.CreateThinkingVfx(this) : NullVfx.GetInstance()); - SequentialVfxPlayer vfx = SequentialVfxPlayer.Create(RecoveryAfterMulliganPhase.RestoreUI(this), parallelVfxPlayer, HandViewBase.CreateHideCardMeshesVfx(BattleEnemy.HandCardList), vfxBase, InstantVfx.Create(delegate - { - ResetLeaderAnimation(BattlePlayer, BattleEnemy); - })); - base.VfxMgr.RegisterSequentialVfx(vfx); - } - } - - public override void RecoveryEnd() - { - base.IsRecovery = false; - SettingOpponentAliveEvent(); - IsStopIntervalCheck = false; - SetUpTurnTransitionEvent(); - networkTouchControl.SetEnableTouch(); - NetworkBattleData networkBattleData = base.networkBattleData; - base.networkBattleData = new NetworkBattleData(this); - base.networkBattleData.isPlayerMulliganEnd = networkBattleData.isPlayerMulliganEnd; - base.networkBattleData.isOppoMulliganEnd = networkBattleData.isOppoMulliganEnd; - base.networkBattleData.SetReceiveData(networkBattleData.GetReceiveData()); - base.networkBattleData.isEnemyFirstTurn = networkBattleData.isEnemyFirstTurn; - _networkBattleSetupCardEventBase.OverwriteNetworkBattleData(base.networkBattleData); - SetupCreateBattleCardFunc(createCardWithoutGameObject: false); - OperateMgr operateMgr = OperateMgr; - OperateMgr = CreateOperateMgr(); - OperateMgr.SetUpRecoveryEvent(operateMgr); - StartRecoveryRecording(); - operateMgr = null; - OperateReceive = new OperateReceive(this, RegisterActionManager, OperateMgr, base.networkBattleData); - if (_phase is NetworkMulliganPhase) - { - (_phase as NetworkMulliganPhase).MulliganEventSetting(); - } - operateReceiveChecker = new OperateReceiveChecker(this, base.networkBattleData); - networkReceiver = new NetworkBattleReceiver(this); - SetupNetworkEvent(isRecovery: true); - if (_specialWinVfx == null) - { - ClearRegisterCardList(); - } - BattleEnemy.EnableEnemyAI = true; - BattlePlayer.Emotion.Enable = true; - BattleEnemy.Emotion.Enable = true; - if (BattleEnemy.IsSelfTurn) - { - EnemyAI.StopEnemyAI(); - EnemyAI.ExecuteEnemyAI(useWait: true); - } - ConnectionReportTrigger.ConnectionReport(this); - } - - protected override void FirstRecoverySetting() - { - if (!base.IsRecovery) - { - StartRecoveryRecording(); - } - } - - protected override int CreateBackgroundId() - { - if (_contentsCreator is RecoveryNetworkBattleMgrContentsCreator) - { - int backGroundId = ((RecoveryNetworkBattleMgrContentsCreator)_contentsCreator).RecoveryControllerInstance.AIBattleRecoveryData.SetupInfo.BackGroundId; - if (backGroundId >= 0) - { - return backGroundId; - } - } - return CalculationRandomStage(); - } - - public override void FinishBattle() - { - EnemyAI.StopEnemyAI(); - } - - public override void RecoveryTimeOutSetting(float extendTime, bool isMulliganEnd, long startTime = -1L) - { - if (!isMulliganEnd) - { - if (MulliganMgr != null) - { - MulliganMgr.GetMulliganInfo().SetExtendTime(extendTime); - } - return; - } - if (!BattlePlayer.IsSelfTurn) - { - if (startTime != -1) - { - _aiTurnControl.SetAndStartTurnTimer(DateTimeOffset.FromUnixTimeSeconds(startTime).LocalDateTime); - } - return; - } - if (turnEndTimeController == null) - { - TurnEndButtonUI component = SBattleLoad.m_TurnEndBtnUI.GetComponent(); - turnEndTimeController = new TurnEndTimeController(this, BattlePlayer, component); - } - if (!turnEndTimeController.IsCountdownRunning()) - { - turnEndTimeController.StartCountDown("SetTimeoutSetting"); - } - turnEndTimeController.SetExtendTime(extendTime); - } - - public void SetupMulliganLaunchCompleteEvent() - { - _contentsCreator.RecoveryRecordManager.SetupMulliganStartTimeRecorderEvent(this); - } - - public override VfxBase StartBattle() - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - LocalLog.SetLastTraceLogTurn(1); - sequentialVfxPlayer.Register(ChangePhase(base.PhaseCreator.CreateMainPhase())); - if (IsFirst) - { - sequentialVfxPlayer.Register(BattlePlayer.StartTurnControl("AIFirst")); - } - else - { - sequentialVfxPlayer.Register(BattleEnemy.StartTurnControl()); - } - return sequentialVfxPlayer; - } - - public override void SetupEnemyAI() - { - EnemyAI enemyAI = new RankMatchEnemyAI(); - enemyAI.LoadBufferedBattleState(); - EnemyAI = enemyAI; - BattleInfoReceiver = new AIBattleInfoReceiver(EnemyAI); - EnemyAI.InitOnGame(BattleEnemy, BattlePlayer); - if (!base.IsRecovery) - { - BattleEnemy.EnableEnemyAI = true; - } - } - - public override BattleCardBase MetamorphoseCard(int cardId, bool isPlayer, int addIndex, SkillBase skill, bool isFusion = false) - { - return CreateBattleCardWithGameObject(new CardCreateInfo(cardId, isPlayer, skill.ApplyingTargetFilter is SkillTargetChosenCardsFilter, NetworkBattleDefine.NetworkCardPlaceState.None, isReferenceOpponentCard: false, skill), new IndexInfo(addIndex)); - } - - public override BattleCardBase CreateBattleCardWithGameObject(CardCreateInfo info, IndexInfo indexInfo, int repeatCount = -1, bool isVirtual = false, bool isActualCard = false) - { - CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(info.Id); - BattlePlayerBase battlePlayer = GetBattlePlayer(info.IsPlayer); - int cardIndex = SetupCardIndex(battlePlayer, indexInfo.AddIndex); - GameObject cardGameObject = null; - if (!base.IsRecovery || !isVirtual) - { - cardGameObject = CreateBaseCardGameObject(cardParameterFromId, info.IsPlayer, cardIndex); - } - BattleCardBase battleCardBase = CreateBattleCard(info.Id, info.IsPlayer, cardGameObject, cardParameterFromId, battlePlayer, cardIndex); - if (!base.IsRecovery || !isVirtual) - { - SetupCardObjectMaterials(cardGameObject, battleCardBase); - } - return battleCardBase; - } - - protected override void ControlDisconnectOffTouchAndView(bool flag) - { - if (!_sendFinshBattleTask) - { - base.ControlDisconnectOffTouchAndView(flag); - } - } - - public override void PlayRetire() - { - if (RecoveryRecordManagerBase.IsExistsAINetworkRecoveryFile()) - { - GameMgr.GetIns().GetDataMgr().SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_ai_network.json")); - RecoveryRecordManagerBase.DeleteRecoveryFile(); - } - base.PlayRetire(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOperationProcessor.cs b/SVSim.BattleEngine/Engine/Wizard/AIOperationProcessor.cs index 1d29e86c..024c2059 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOperationProcessor.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOperationProcessor.cs @@ -48,7 +48,7 @@ public class AIOperationProcessor int num2 = CalcFixedUseCostTransformId(actor, actor.SelfBattlePlayer.Pp); if (num2 > 0) { - battleCardBase2 = BattleManagerBase.GetIns().CreateTransformCardRegisterVfx(actor, num2, actor.IsPlayer); + battleCardBase2 = _battleMgr.CreateTransformCardRegisterVfx(actor, num2, actor.IsPlayer); } } else if (actor.Skills.CheckWhenPlayChoice && actor.Skills.Count() > 1) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOperationSimulatorAccessor.cs b/SVSim.BattleEngine/Engine/Wizard/AIOperationSimulatorAccessor.cs index 89280709..47e6cb59 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOperationSimulatorAccessor.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOperationSimulatorAccessor.cs @@ -35,16 +35,6 @@ public class AIOperationSimulatorAccessor GenerateTagOwnerTable = ai.GenerateTagOwnerTable.Clone(); } - public BattlePlayerPair CallAttack(BattlePlayerPair sourcePair, BattleCardBase attackCardId, BattleCardBase targetCardId, List playPtn) - { - UpdateCurrentField(sourcePair, playPtn); - SetUpBattleInfoReceiver(); - BattlePlayerPair battlePlayerPair = OperationSimulator.Attack(sourcePair, attackCardId, targetCardId, isPrediction: false, SetVirtualPairEvent); - CleanUpBattleInfoReceiver(); - UpdateCurrentField(battlePlayerPair, playPtn); - return battlePlayerPair; - } - public BattlePlayerPair CallPlay(BattlePlayerPair sourcePair, BattleCardBase playCardId, List skillTargets, List playPtn) { UpdateCurrentField(sourcePair, playPtn); @@ -80,23 +70,6 @@ public class AIOperationSimulatorAccessor return battlePlayerPair; } - public BattlePlayerPair CallTurnEnd(BattlePlayerPair sourcePair) - { - SetUpBattleInfoReceiver(); - BattlePlayerPair result = OperationSimulator.TurnEnd(sourcePair); - CleanUpBattleInfoReceiver(); - return result; - } - - public BattlePlayerPair CallOpponentTurnStart(BattlePlayerPair sourcePair) - { - BattlePlayerPair sourcePair2 = new BattlePlayerPair(sourcePair.Opponent, sourcePair.Self); - SetUpBattleInfoReceiver(); - BattlePlayerPair battlePlayerPair = OperationSimulator.TurnStart(sourcePair2); - CleanUpBattleInfoReceiver(); - return new BattlePlayerPair(battlePlayerPair.Opponent, battlePlayerPair.Self); - } - public void UpdateCurrentField(BattlePlayerPair sourcePair, List playPtn) { AIVirtualFieldBuildParameterCollction buildParameters = new AIVirtualFieldBuildParameterCollction(CurrentField); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackAttachTag.cs index ac51ff05..08b0a075 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackAttachTag.cs @@ -8,12 +8,6 @@ public class AIOtherAttackAttachTag : AIWhenAttackSelfAndOtherTagArgument private AIScriptTokenArgType _selectType; - private const int REMOVE_TIMING_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 2; - - private const int TAG_WORD_START_INDEX = 1; - public AIPlayTag Tag { get; private set; } protected override int NON_FILTER_FIRST_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackBuff.cs index b8492a66..97249470 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackBuff.cs @@ -85,13 +85,6 @@ public class AIOtherAttackBuff : AIWhenAttackSelfAndOtherTagArgument } } - private Tuple GetBuff(AIVirtualCard tagOwner, AIVirtualField field, AISituationInfo situation, List playPtn) - { - int first = (int)_attack.EvalArg(tagOwner, playPtn, field, situation); - int second = (int)_life.EvalArg(tagOwner, playPtn, field, situation); - return new Tuple(first, second); - } - public override void PseudoSimulateForEvalInstantAttack(AIVirtualCard tagOwner, AIVirtualField field, AIVirtualAttackInfo situation, List playPtn, EvalInstantAttackInformation information) { AIVirtualCard actor = situation.Actor; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackHeal.cs index eebf12d8..9303537d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackHeal.cs @@ -8,10 +8,6 @@ public class AIOtherAttackHeal : AIWhenAttackSelfAndOtherTagArgument private AIPolishConvertedExpression _heal; - private const int SELECT_TYPE_OFFSET = 2; - - private const int HEAL_VALUE_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 2; public AIOtherAttackHeal(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackRemoveTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackRemoveTag.cs index fed1613a..235e9a46 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackRemoveTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackRemoveTag.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherAttackRemoveTag : AIWhenAttackSelfAndOtherTagArgument, IAIRemoveTagArgument { - private const int NEEDS_SPLITED_WORDS_LENGS = 3; - - private const int REMOVE_TAG_START_SPLITED_INDEX = 1; public AIPlayTag RemoveTag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackToken.cs index d2b8d019..98b11a1e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherAttackToken.cs @@ -6,8 +6,6 @@ public class AIOtherAttackToken : AIWhenAttackSelfAndOtherTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIOtherAttackToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherBanishToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherBanishToken.cs index edbb0d00..f6a1b62c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherBanishToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherBanishToken.cs @@ -6,8 +6,6 @@ public class AIOtherBanishToken : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIOtherBanishToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedBanish.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedBanish.cs index 51bf601d..b9fc41cf 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedBanish.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedBanish.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherDamagedBanish : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_OFFSET = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedDamage.cs index cbc0ca56..a550f6e7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedDamage.cs @@ -8,12 +8,6 @@ public class AIOtherDamagedDamage : AITriggerAndTargetFiltersTagBase private AIPolishConvertedExpression _count; - private const int DAMAGE_INDEX_OFFSET = 2; - - private const int COUNT_INDEX_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 3; - protected override int NON_FILTER_FIRST_OFFSET => 3; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedHeal.cs index b07c0872..2051c0b7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedHeal.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherDamagedHeal : AITriggerAndTargetFiltersTagBase { - protected const int SELECT_TYPE_OFFSET = 2; - - private const int HEAL_ARG_OFFSET = 1; private AIPolishConvertedExpression _healArg; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSetLeaderMaxLife.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSetLeaderMaxLife.cs index defd7ebd..620e2b8e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSetLeaderMaxLife.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSetLeaderMaxLife.cs @@ -8,10 +8,6 @@ public class AIOtherDamagedSetLeaderMaxLife : AIFiltersArgument private AIPolishConvertedExpression _life; - private const int SIDE_OFFSET = 2; - - private const int VALUE_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 2; public AIOtherDamagedSetLeaderMaxLife(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSubtractCountdown.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSubtractCountdown.cs index c6c79155..ea6bdff0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSubtractCountdown.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherDamagedSubtractCountdown.cs @@ -8,10 +8,6 @@ public class AIOtherDamagedSubtractCountdown : AITriggerAndTargetFiltersTagBase private AIPolishConvertedExpression _count; - protected const int SELECT_TYPE_OFFSET = 2; - - private const int COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 2; public AIOtherDamagedSubtractCountdown(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAddCemetery.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAddCemetery.cs index 6a1169c3..e5f70963 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAddCemetery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAddCemetery.cs @@ -6,8 +6,6 @@ public class AIOtherEvoAddCemetery : AIOtherEvoTagArgument { private AIPolishConvertedExpression _addCemeteryCount; - private const int COUNT_ARG_INDEX = 1; - protected override int SELECT_TYPE_ARG_OFFSET => -1; protected override int NON_FILTER_FIRST_OFFSET => 1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAttachTag.cs index b904ebf6..423cbee0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoAttachTag.cs @@ -8,8 +8,6 @@ public class AIOtherEvoAttachTag : AIOtherEvoTagArgument private readonly int REMOVE_TIMING_OFFSET = 1; - private const int TAG_WORD_START_INDEX = 1; - public AIPlayTag Tag { get; private set; } protected override int SELECT_TYPE_ARG_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoBuff.cs index 95a76892..50d2f5cb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoBuff.cs @@ -10,12 +10,6 @@ public class AIOtherEvoBuff : AIOtherEvoTagArgument private AIScriptTokenArgType _permOrTemp; - private const int ATTACK_BUFF_ARG_OFFSET = 3; - - private const int LIFE_BUFF_ARG_OFFSET = 2; - - private const int PERM_OR_TEMP_ARG_OFFSET = 1; - protected override int SELECT_TYPE_ARG_OFFSET => 4; public AIOtherEvoBuff(string text) @@ -60,16 +54,6 @@ public class AIOtherEvoBuff : AIOtherEvoTagArgument } } - private int GetAttackBuff(AIVirtualCard tagOwner, AIVirtualField field, List playPtn, AISituationInfo situation) - { - if (_attackBuff == null) - { - AIConsoleUtility.LogError("AIOtherEvoBuff error!!! _attackBuff is null"); - return 0; - } - return (int)_attackBuff.EvalArg(tagOwner, playPtn, field, situation); - } - private int GetLifeBuff(AIVirtualCard tagOwner, AIVirtualField field, List playPtn, AISituationInfo situation) { if (_lifeBuff == null) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDamage.cs index 5ae2d038..29135503 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDamage.cs @@ -8,10 +8,6 @@ public class AIOtherEvoDamage : AIOtherEvoTagArgument private AIPolishConvertedExpression _count; - private const int DAMAGE_ARG_OFFSET = 2; - - private const int COUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_ARG_OFFSET => 3; public AIOtherEvoDamage(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDraw.cs index e328605b..d8e73f36 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoDraw.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherEvoDraw : AIOtherEvoTagArgument { - private const int COUNT_ARG_INDEX = 1; public AIPolishConvertedExpression DrawCount { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoHeal.cs index b77f0e85..01c93fe6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoHeal.cs @@ -6,8 +6,6 @@ public class AIOtherEvoHeal : AIOtherEvoTagArgument { private AIPolishConvertedExpression _heal; - private const int HEAL_ARG_OFFSET = 1; - protected override int SELECT_TYPE_ARG_OFFSET => 2; public AIOtherEvoHeal(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoShield.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoShield.cs index ab203de0..490db187 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoShield.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoShield.cs @@ -8,10 +8,6 @@ public class AIOtherEvoShield : AIOtherEvoTagArgument private AIScriptTokenArgType _damageType; - private const int DEFAULT_DAMAGE_TYPE_OFFSET = 2; - - private const int STOP_TIMING_OFFSET = 1; - private bool _isDamageTypeDefinedByMaster; protected override int SELECT_TYPE_ARG_OFFSET => 1 + ((!_isDamageTypeDefinedByMaster) ? 1 : 2); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoSubtractCountdown.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoSubtractCountdown.cs index 81106bdd..929a9cbb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoSubtractCountdown.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoSubtractCountdown.cs @@ -6,8 +6,6 @@ public class AIOtherEvoSubtractCountdown : AIOtherEvoTagArgument { private AIPolishConvertedExpression _countdownAmount; - private const int COUNTDOWN_ARG_OFFSET = 1; - protected override int SELECT_TYPE_ARG_OFFSET => 2; public AIOtherEvoSubtractCountdown(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoToken.cs index ca623cfe..4ed1ac1f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoToken.cs @@ -6,8 +6,6 @@ public class AIOtherEvoToken : AIOtherEvoTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIOtherEvoToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoTokenDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoTokenDraw.cs index c473c164..bfb0d2d7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoTokenDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherEvoTokenDraw.cs @@ -6,8 +6,6 @@ public class AIOtherEvoTokenDraw : AIOtherEvoTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; protected override int SELECT_TYPE_ARG_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveDamage.cs index eb665202..1598ed14 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveDamage.cs @@ -8,10 +8,6 @@ public class AIOtherLeaveDamage : AITriggerAndTargetFiltersTagBase private AIScriptTokenArgType _selectType; - private const int DAMAGE_AMOUNT_ARG_OFFSET = 1; - - private const int SELECT_TYPE_ARG_OFFSET = 2; - protected override int NON_FILTER_FIRST_OFFSET => 2; public AIOtherLeaveDamage(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveToken.cs index fb0b1f00..7ff1ea52 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherLeaveToken.cs @@ -6,8 +6,6 @@ public class AIOtherLeaveToken : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_INDEX_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIOtherLeaveToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherPlayBonus.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherPlayBonus.cs index ee18936b..8e8f227a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherPlayBonus.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherPlayBonus.cs @@ -6,8 +6,6 @@ public class AIOtherPlayBonus : AIUseMinArgument { private AIPolishConvertedExpression valueArg; - private const int MINIMUM_ARGUMENT_COUNT = 2; - public List Filters { get; private set; } public AIOtherPlayBonus(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAddCemetery.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAddCemetery.cs index a5e95089..3c1e163e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAddCemetery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAddCemetery.cs @@ -6,8 +6,6 @@ public class AIOtherSummonAddCemetery : AITriggerAndTargetFiltersTagBase { private AIPolishConvertedExpression _addCemeteryCount; - private const int ADD_CEMETERY_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIOtherSummonAddCemetery(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAttachTag.cs index 8f9f1e80..28ebd609 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonAttachTag.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherSummonAttachTag : AITriggerAndTargetFiltersTagBase { - private const int TIMING_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 2; private readonly AIScriptTokenArgType[] _legalSelectTypeArgs = new AIScriptTokenArgType[2] { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBanish.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBanish.cs index a3f1f7bc..35ceae8e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBanish.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBanish.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherSummonBanish : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_ARG_OFFSET = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBuff.cs index e77d88d7..76ad21ee 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonBuff.cs @@ -4,13 +4,6 @@ namespace Wizard; public class AIOtherSummonBuff : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_OFFSET = 4; - - private const int ATK_BUFF_OFFSET = 3; - - private const int LIFE_BUFF_OFFSET = 2; - - private const int PERM_OR_TEMP_OFFSET = 1; private readonly AIScriptTokenArgType[] _legalSelectTypeArgs = new AIScriptTokenArgType[2] { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamage.cs index dbef8fe2..ec9b8d4e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamage.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherSummonDamage : AITriggerAndTargetFiltersTagBase { - private const int DAMAGE_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 2; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageClip.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageClip.cs index d7c2f273..a802220f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageClip.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageClip.cs @@ -6,8 +6,6 @@ public class AIOtherSummonDamageClip : AIOtherSummonBarrierBase { private AIPolishConvertedExpression _clipAmount; - private const int CLIP_AMOUNT_OFFSET = 1; - protected override int _defaultDamageTypeOffset => 3; protected override int _stopTimingOffset => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageCut.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageCut.cs index 2645bcd6..b66bffc2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageCut.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDamageCut.cs @@ -6,8 +6,6 @@ public class AIOtherSummonDamageCut : AIOtherSummonBarrierBase { private AIPolishConvertedExpression _cutAmount; - private const int CUT_AMOUNT_OFFSET = 1; - protected override int _defaultDamageTypeOffset => 3; protected override int _stopTimingOffset => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDestroy.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDestroy.cs index 859feeab..73a43d1d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDestroy.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDestroy.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherSummonDestroy : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_ARG_OFFSET = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDraw.cs index 840a3451..5a6f58f8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonDraw.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherSummonDraw : AITriggerAndTargetFiltersTagBase { - private const int COUNT_ARG_INDEX = 1; public AIPolishConvertedExpression DrawCount { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonHeal.cs index 81b10f63..871fa77f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonHeal.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherSummonHeal : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_OFFSET = 2; - - private const int HEAL_ARG_OFFSET = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonSubtractCountdown.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonSubtractCountdown.cs index e047ef5d..99200c2c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonSubtractCountdown.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherSummonSubtractCountdown.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherSummonSubtractCountdown : AITriggerAndTargetFiltersTagBase { - private const int SELECT_TYPE_OFFSET = 2; - - private const int SUBTRACT_ARG_OFFSET = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayAttachTag.cs index 597943ab..dfd354dd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayAttachTag.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherWhenPlayAttachTag : AIOtherWhenPlayTagArgument { - private const int TIMING_OFFSET = 1; public AIPlayTag Tag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayDamage.cs index d029b509..0858a112 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayDamage.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIOtherWhenPlayDamage : AIOtherWhenPlayTagArgument { - private const int DAMAGE_OFFSET = 1; public AIPolishConvertedExpression Damage { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRecoverPp.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRecoverPp.cs index a7c8a641..525a77b9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRecoverPp.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRecoverPp.cs @@ -6,8 +6,6 @@ public class AIOtherWhenPlayRecoverPp : AIOtherWhenPlayTagArgument { private AIPolishConvertedExpression _recoverPpValue; - private const int RECOVER_PP_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; protected override int SELECT_TYPE_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRemoveTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRemoveTag.cs index 93aacfad..b004ebab 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRemoveTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayRemoveTag.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AIOtherWhenPlayRemoveTag : AIOtherWhenPlayTagArgument, IAIRemoveTagArgument { - private const int NEEDS_SPLITED_WORDS_LENGS = 3; - - private const int REMOVE_TAG_START_SPLITED_INDEX = 1; public AIPlayTag RemoveTag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayToken.cs b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayToken.cs index 26df3afa..3d11f3e3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIOtherWhenPlayToken.cs @@ -8,8 +8,6 @@ public class AIOtherWhenPlayToken : AIOtherWhenPlayTagArgument private AIScriptTokenArgType _sideType; - private const int TOKEN_COUNT_ARG_OFFSET = 1; - protected override int NON_FILTER_FIRST_OFFSET => 1; public AIOtherWhenPlayToken(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIParamQuery.cs b/SVSim.BattleEngine/Engine/Wizard/AIParamQuery.cs index 377595d2..9275df09 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIParamQuery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIParamQuery.cs @@ -8,7 +8,6 @@ namespace Wizard; public class AIParamQuery { - private const float MAX_ADVANTAGE = 1000f; public EnemyAI enemyAI; @@ -241,67 +240,6 @@ public class AIParamQuery return num; } - public List GetEvoSelectCandidates(BattleCardBase evoCard, BattlePlayerPair pair) - { - List list = evoCard.GetSelectTypeSkill(isEvolve: true).ToList(); - if (list.IsNotNullOrEmpty()) - { - return GetSkillTargetsForEstimator(evoCard, list, pair); - } - return null; - } - - public List GetSkillTargetsForEstimator(BattleCardBase actCard, List selectSkills, BattlePlayerPair pair) - { - List list = new List(); - for (int i = 0; i < selectSkills.Count; i++) - { - SkillBase skillBase = selectSkills[i]; - IEnumerable burialSelectableCards = AIBurialRiteSimulationUtility.GetBurialSelectableCards(skillBase, actCard); - if (burialSelectableCards.IsNotNullOrEmpty()) - { - List list2 = burialSelectableCards.ToList(); - for (int j = 0; j < list2.Count; j++) - { - BattleCardBase item = list2[j]; - if (!list.Contains(item)) - { - list.Add(item); - break; - } - } - } - IEnumerable selectableCards = GetSelectableCards(skillBase, pair); - if (!selectableCards.IsNotNullOrEmpty()) - { - continue; - } - List list3 = selectableCards.ToList(); - list3.AddRange(from c in GetSelectableCards(skillBase, pair, isSkipForceSelect: true) - where !selectableCards.Contains(c) - select c); - int num = Mathf.Min(skillBase.GetSkillSelectCount(), list3.Count()); - for (int num2 = 0; num2 < num; num2++) - { - if (list3.Contains(pair.Opponent.Class) && !list.Contains(pair.Opponent.Class)) - { - list.Add(pair.Opponent.Class); - continue; - } - for (int num3 = 0; num3 < list3.Count; num3++) - { - BattleCardBase item2 = list3[num3]; - if (!list.Contains(item2)) - { - list.Add(item2); - break; - } - } - } - } - return list; - } - public int CalcAllyUnitTotalDamage() { int num = 0; @@ -404,17 +342,4 @@ public class AIParamQuery } return new List(src); } - - public static AIVirtualCard FindSameCardFromList(AIVirtualCard origin, List list) where T : AIVirtualCard - { - for (int i = 0; i < list.Count; i++) - { - AIVirtualCard aIVirtualCard = list[i]; - if (aIVirtualCard.IsSameCard(origin)) - { - return aIVirtualCard; - } - } - return null; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayBounce.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayBounce.cs deleted file mode 100644 index 4e5c6b0c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayBounce.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Wizard; - -public class AIPlayBounce : AIFiltersAndSelectTypeArgument -{ - public AIPlayBounce(string text) - : base(text) - { - } - - protected override void CreateLegalSelectTypes() - { - base.LegalSelectTypes = new AIScriptTokenArgType[3] - { - AIScriptTokenArgType.ALL_SELECT, - AIScriptTokenArgType.RANDOM_SELECT, - AIScriptTokenArgType.TARGET_SELECT - }; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayMove.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayMove.cs deleted file mode 100644 index 410aa7cd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayMove.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -internal class AIPlayMove : AIMove -{ - public BattleCardBase Src { get; private set; } - - public List Targets { get; private set; } - - public AIPlayMove(BattleCardBase src, List targets) - : base(AIOperationType.PLAY) - { - Src = src; - Targets = targets; - } - - public override void RunOperation(BattleManagerBase mgr, bool isPlayer) - { - mgr.VfxMgr.RegisterSequentialVfx(mgr.OperateMgr.InitSetCard(Src, isPlayer)); - mgr.VfxMgr.RegisterSequentialVfx(mgr.OperateMgr.PlayCard(Src, isPlayer, Targets)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayOutAction.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayOutAction.cs deleted file mode 100644 index 1ec2dbd2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayOutAction.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class AIPlayOutAction -{ - public int UseCardIndex { get; private set; } - - public AIOperationType Command { get; private set; } - - public List TargetCardList { get; private set; } - - public AIPlayOutAction(AIOperationType command, BattleCardBase useCard, List targetCards) - { - Command = command; - if (useCard != null) - { - UseCardIndex = useCard.Index; - } - else - { - UseCardIndex = -1; - } - TargetCardList = new List(); - if (targetCards != null && targetCards.Count > 0) - { - TargetCardList.AddRange(targetCards); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayReanimate.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayReanimate.cs deleted file mode 100644 index b25a6da8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayReanimate.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class AIPlayReanimate : AIScriptArgumentExpressions -{ - private AIPolishConvertedExpression _reanimateCostArg; - - private AIPolishConvertedExpression _reanimateCountArg; - - private const int REANIMATE_COST_INDEX = 0; - - private const int REANIMATE_COUNT_INDEX = 1; - - public AIPlayReanimate(string text) - : base(text) - { - } - - protected override void InitExpressions(string text) - { - base.InitExpressions(text); - if (_exprList.Count > 1) - { - _reanimateCostArg = _exprList[0]; - _reanimateCountArg = _exprList[1]; - } - } - - public int GetReanimateCost(AIVirtualCard tagOwner, List playPtn) - { - if (_reanimateCostArg == null) - { - return -1; - } - return (int)_reanimateCostArg.EvalArg(tagOwner, playPtn, tagOwner.SelfField); - } - - public int GetReanimateCount(AIVirtualCard tagOwner, List playPtn) - { - if (_reanimateCountArg == null) - { - return 0; - } - return (int)_reanimateCountArg.EvalArg(tagOwner, playPtn, tagOwner.SelfField); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayTag.cs index e751e445..61a48f75 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIPlayTag.cs @@ -18,8 +18,6 @@ public class AIPlayTag public AIPlayTagType Type { get; private set; } - public string Arg => _argText; - public string Condition => _conditionText; public ulong Hash { get; private set; } @@ -855,11 +853,6 @@ public class AIPlayTag return argExpr.EvalID(index); } - public bool IsArgID(int index) - { - return argExpr.IsArgID(index); - } - public bool IsHoldingEVAL() { if (!ArgumentExpressions.IsHoldingEVAL()) @@ -869,24 +862,6 @@ public class AIPlayTag return true; } - public static bool IsAttachTagType(AIPlayTagType type) - { - if (type > AIPlayTagType.AttachTag_Start) - { - return type < AIPlayTagType.AttachTag_End; - } - return false; - } - - public static bool IsRemoveTagType(AIPlayTagType tagType) - { - if (tagType == AIPlayTagType.AttackRemoveTag || tagType == AIPlayTagType.ClashRemoveTag || tagType == AIPlayTagType.TurnEndRemoveTag) - { - return true; - } - return false; - } - public bool IsClashTagType() { if (Type != AIPlayTagType.ClashDestroy && Type != AIPlayTagType.ClashBanish && Type != AIPlayTagType.ClashDamage && Type != AIPlayTagType.ClashHeal && Type != AIPlayTagType.ClashKiller && Type != AIPlayTagType.ClashBuff && Type != AIPlayTagType.ClashRemoveSkill && Type != AIPlayTagType.ClashToken && Type != AIPlayTagType.ClashShield && Type != AIPlayTagType.ClashDamageClip && Type != AIPlayTagType.ClashRemoveTag) @@ -934,25 +909,6 @@ public class AIPlayTag } } - public bool IsTokenTag() - { - switch (Type) - { - case AIPlayTagType.FanfareToken: - case AIPlayTagType.PlayToken: - case AIPlayTagType.LastwordToken: - case AIPlayTagType.AttackToken: - case AIPlayTagType.EvoToken: - case AIPlayTagType.HealToken: - case AIPlayTagType.BuffToken: - case AIPlayTagType.OtherAttackToken: - case AIPlayTagType.OtherBanishToken: - return true; - default: - return false; - } - } - public ulong GetHash() { return (ulong)(_argText.GetHashCode() * 79 + _conditionText.GetHashCode() * 167 + Type.GetHashCode() * 2851); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayTagType.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayTagType.cs index afcda1c5..a09a57d0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayTagType.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIPlayTagType.cs @@ -68,7 +68,6 @@ public enum AIPlayTagType SummonQuick, SummonDamage, SummonBanish, - SummonRecoverPp, SummonHeal, SummonDestroy, SummonBanAttack, @@ -118,7 +117,6 @@ public enum AIPlayTagType PlayBounce, PlaySubtractCountdown, FanfareSubtractCountdown, - AllyClashDamage, CantBeAttacked, AttackableClass, ClashBuff, @@ -253,8 +251,6 @@ public enum AIPlayTagType ClashRemoveSkill, ClashRemoveTag, AttackRemoveSkill, - CantAttack, - ForceAttackUnit, OtherAttackBuff, OtherAttackDamage, OtherAttackHeal, @@ -321,7 +317,6 @@ public enum AIPlayTagType PlayChoice, FanfareChoice, ChoiceBrave, - AttachTag_Start, AttackAttachTag, LastwordAttachTag, EvoAttachTag, @@ -332,13 +327,11 @@ public enum AIPlayTagType TurnStartAttachTag, TurnEndAttachTag, HealAttachTag, - FusionAttachTag, PlayAttachTag, OtherPlayAttachTag, FanfareAttachTag, ChangeInplayAttachTag, FanfareAttachStyle, - AttachTag_End, TurnEndRemoveTag, PlayCopyTag, FanfareCopyTag, diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPlayedCardContainer.cs b/SVSim.BattleEngine/Engine/Wizard/AIPlayedCardContainer.cs index 1cfe6f49..ab0e52bb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIPlayedCardContainer.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIPlayedCardContainer.cs @@ -46,10 +46,6 @@ public class AIPlayedCardContainer return new AIPlayedCardContainer(this); } - public void Validate(AIPlayedCardContainer source) - { - } - private void CopyPreviousPlayCardOnTurnShift(AIVirtualTurnStartInfo turnStartSituation) { if (turnStartSituation != null) @@ -72,15 +68,6 @@ public class AIPlayedCardContainer _enemyTurnPlayedCardList.Clear(); } - public void ClearAll() - { - ClearInTurn(); - _allyInGamePlayedCardList.Clear(); - _enemyInGamePlayedCardList.Clear(); - _allyPreviousTurnPlayedCardList.Clear(); - _enemyPreviousTurnPlayedCardList.Clear(); - } - public int GetPlayedCountInTurn(List filters, AIVirtualCard tagOwner, List playPtn, AISituationInfo situation) { return AIFilteringUtility.MultipleFiltering(tagOwner.IsAlly ? _allyTurnPlayedCardList : _enemyTurnPlayedCardList, filters, tagOwner, playPtn, situation, isBlockDeadCard: false)?.Count ?? 0; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPolicyCollectionContainer.cs b/SVSim.BattleEngine/Engine/Wizard/AIPolicyCollectionContainer.cs index 9684059b..4529c8d1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIPolicyCollectionContainer.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIPolicyCollectionContainer.cs @@ -65,23 +65,6 @@ public class AIPolicyCollectionContainer } } - public void RemoveAttachedPolicies(List attachedPolicies) - { - for (int i = 0; i < attachedPolicies.Count; i++) - { - AIPolicyData aIPolicyData = attachedPolicies[i]; - PolicyCollectionWithTypeBase policyCollectionWithTypeBase = FindPolicyCollectionWityType(aIPolicyData.PolicyType, isCreateNewCollection: false); - if (policyCollectionWithTypeBase != null && policyCollectionWithTypeBase.RemovePolicyAndCheckIsNoLongerHoldThisType(aIPolicyData)) - { - _holdingPolicyTypes.Remove(aIPolicyData.PolicyType); - if (policyCollectionWithTypeBase is PolicyCollectionWithSingleType) - { - _policyCollectionTable.Remove(policyCollectionWithTypeBase); - } - } - } - } - private PolicyCollectionWithTypeBase FindPolicyCollectionWityType(AIPolicyType policyType, bool isCreateNewCollection = true) { if (_policyCollectionTable != null) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIPolishConvertedExpression.cs b/SVSim.BattleEngine/Engine/Wizard/AIPolishConvertedExpression.cs index 4cdaa494..9bcd7573 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIPolishConvertedExpression.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIPolishConvertedExpression.cs @@ -57,11 +57,6 @@ public class AIPolishConvertedExpression return (TokenList[0] as AIScriptIDToken).ID; } - public bool IsID() - { - return TokenList[0] is AIScriptIDToken; - } - public List GetReferringIDLists() { List list = null; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIReanimateSimulationUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AIReanimateSimulationUtility.cs index ed96727d..b3c207b5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIReanimateSimulationUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIReanimateSimulationUtility.cs @@ -6,9 +6,6 @@ namespace Wizard; public static class AIReanimateSimulationUtility { - public const int NONE_REANIMATE_COST = -1; - - public const int NONE_REANIMATE_ID = -1; public static bool IsReanimate(AIVirtualCard tagOwner, int cost) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIRemovedTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/AIRemovedTagCollection.cs index 9b15006a..7279461b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIRemovedTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIRemovedTagCollection.cs @@ -43,13 +43,4 @@ public class AIRemovedTagCollection } } } - - public void ClearAll() - { - if (AllList != null) - { - AllList.Clear(); - AllList = null; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIReverseDiscardSelectLogicArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIReverseDiscardSelectLogicArgument.cs index a82cc21e..84b87009 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIReverseDiscardSelectLogicArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIReverseDiscardSelectLogicArgument.cs @@ -26,14 +26,4 @@ public class AIReverseDiscardSelectLogicArgument : AISelectLogicArgumentBase AIConsoleUtility.Log("REVERSE_DISCARD_LOGIC は複数選択に未対応です"); return null; } - - private bool IsWellTarget(float maxHandBonus, float currentHandBonus, AISelectTargetPattern worstOrBest) - { - return worstOrBest switch - { - AISelectTargetPattern.Best => maxHandBonus < currentHandBonus, - AISelectTargetPattern.Worst => maxHandBonus > currentHandBonus, - _ => false, - }; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIRuleBaseBattleSimulator.cs b/SVSim.BattleEngine/Engine/Wizard/AIRuleBaseBattleSimulator.cs index dece465e..5929ce5f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIRuleBaseBattleSimulator.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIRuleBaseBattleSimulator.cs @@ -50,10 +50,6 @@ public class AIRuleBaseBattleSimulator ExecuteSimulationWithActionSequence(aIVirtualField, actionInfoSequence, enemyTargetSequence, simSetting, bestRecord, patternFilter); } - public void RunPlaySkipWithActionSequence(AIVirtualField originalField, List actionSequence, List enemyTargets, SimulationResult bestRecord, SimulationAdditionalActionInfoSet additionalOptions) - { - } - private void ExecuteSimulationWithActionSequence(AIVirtualField fieldTemp, List actionInfoSequence, List enemyTargetSequence, SimulationSetting simSetting, SimulationResult bestRecord, InplayMovePatternFilter patternFilter) { BattleSequencer.ExecSimulation(fieldTemp, actionInfoSequence, enemyTargetSequence, simSetting); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIScriptArgumentExpressions.cs b/SVSim.BattleEngine/Engine/Wizard/AIScriptArgumentExpressions.cs index 8210e5ed..6b9f701f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIScriptArgumentExpressions.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIScriptArgumentExpressions.cs @@ -57,11 +57,6 @@ public class AIScriptArgumentExpressions return new AIPolishConvertedExpression(expression); } - public bool IsArgID(int index) - { - return _exprList[index].IsID(); - } - public int EvalID(int index) { if (_exprList == null || index >= _exprList.Count) @@ -195,47 +190,6 @@ public class AIScriptArgumentExpressions return AISummonTokenUtility.CreateTokenIdCollectionFromIdList(owner, AIScriptTokenArgType.ALLY, idList, AITokenType.Default); } - protected bool IsFirstFiltersEnd(AIPolishConvertedExpression arg, AIScriptTokenArgType[] InitFilters, out AIScriptTokenArgType dstType) - { - dstType = AIScriptTokenArgType.NONE; - if (arg.TokenList != null && arg.TokenList.Count > 0) - { - AIScriptTokenBase aIScriptTokenBase = arg.TokenList[0]; - if (aIScriptTokenBase is AIScriptArgumentToken) - { - dstType = ((AIScriptArgumentToken)aIScriptTokenBase).ArgumentType; - if (InitFilters.Contains(dstType)) - { - return true; - } - } - } - return false; - } - - protected bool IsTimingTokenArgType(AIPolishConvertedExpression arg, out AIScriptTokenArgType dstTokenArgType) - { - dstTokenArgType = GetFirstTokenArgType(arg); - switch (dstTokenArgType) - { - case AIScriptTokenArgType.WHEN_PLAY: - case AIScriptTokenArgType.WHEN_DESTROY: - case AIScriptTokenArgType.WHEN_ATTACK: - case AIScriptTokenArgType.WHEN_CLASH: - case AIScriptTokenArgType.WHEN_DAMAGED: - case AIScriptTokenArgType.WHEN_EVO: - case AIScriptTokenArgType.WHEN_TURNEND: - case AIScriptTokenArgType.WHEN_ALLY_TURNEND: - case AIScriptTokenArgType.WHEN_OPPONENT_TURNEND: - case AIScriptTokenArgType.WHEN_ALLY_TURNSTART: - case AIScriptTokenArgType.WHEN_OPPONENT_TURNSTART: - case AIScriptTokenArgType.WHEN_FUSION: - return true; - default: - return false; - } - } - protected bool IsSideTokenArgType(AIPolishConvertedExpression arg, out AIScriptTokenArgType dstTokenARgType) { dstTokenARgType = GetFirstTokenArgType(arg); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIScriptTokenArgType.cs b/SVSim.BattleEngine/Engine/Wizard/AIScriptTokenArgType.cs index 6e532a1a..57696689 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIScriptTokenArgType.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIScriptTokenArgType.cs @@ -85,7 +85,6 @@ public enum AIScriptTokenArgType PREVIOUS_TURN_ATTACKED = 80, ATTACKED = 81, CONSUME_EP_ZERO = 82, - AI_FILTER_INITIAL_START = 83, ALLY = 84, OPPONENT = 85, BOTH = 86, @@ -108,7 +107,6 @@ public enum AIScriptTokenArgType FILTER_END = 103, BANISHED_TARGET = 104, GETOFF_CARD = 105, - AI_FILTER_INITIAL_END = 106, OTHER_FOLLOWER = 107, MIN_ATTACK = 108, MAX_ATTACK = 109, diff --git a/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfo.cs index 68395170..aae5d7ed 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfo.cs @@ -133,18 +133,4 @@ public class AISelectedTargetInfo } return false; } - - public List GetTargetIdList() - { - if (!HasTarget) - { - return null; - } - List list = new List(); - for (int i = 0; i < Targets.Count; i++) - { - list.Add(Targets[i].BaseId); - } - return list; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfoSet.cs b/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfoSet.cs index 4bb8d7ce..d719e5a7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfoSet.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISelectedTargetInfoSet.cs @@ -193,28 +193,6 @@ public class AISelectedTargetInfoSet return true; } - public List GetTargetIdList(AIScriptTokenArgType selectType) - { - AISelectedTargetInfo aISelectedTargetInfo; - switch (selectType) - { - case AIScriptTokenArgType.CHOICED_TARGET: - aISelectedTargetInfo = ChoiceTarget; - break; - case AIScriptTokenArgType.SELECTED_TARGET: - aISelectedTargetInfo = _set[0]; - break; - case AIScriptTokenArgType.SECOND_SELECTED_TARGET: - aISelectedTargetInfo = _set[1]; - break; - default: - AIConsoleUtility.LogError("AISelectedTargetInfoSet.GetTargetIdList() error!! selectType = " + selectType); - aISelectedTargetInfo = null; - break; - } - return aISelectedTargetInfo?.GetTargetIdList(); - } - public void UpdateRemovalType(AIScriptTokenArgType whichTarget, AIRemovalType removalType) { if (whichTarget != AIScriptTokenArgType.TARGET_SELECT && whichTarget != AIScriptTokenArgType.SECOND_TARGET_SELECT) diff --git a/SVSim.BattleEngine/Engine/Wizard/AISinglePlayptnRecord.cs b/SVSim.BattleEngine/Engine/Wizard/AISinglePlayptnRecord.cs index 6c10e27e..85ac5398 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISinglePlayptnRecord.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISinglePlayptnRecord.cs @@ -28,18 +28,6 @@ public class AISinglePlayptnRecord public List AllDiscardedCardList { get; private set; } - public int DiscardCount - { - get - { - if (AllDiscardedCardList != null) - { - return AllDiscardedCardList.Count; - } - return 0; - } - } - public int PlayPtnCount { get diff --git a/SVSim.BattleEngine/Engine/Wizard/AISituationCurrentProcessAccessExtension.cs b/SVSim.BattleEngine/Engine/Wizard/AISituationCurrentProcessAccessExtension.cs index 4d8f181b..7aa8a4ec 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISituationCurrentProcessAccessExtension.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISituationCurrentProcessAccessExtension.cs @@ -4,14 +4,6 @@ namespace Wizard; public static class AISituationCurrentProcessAccessExtension { - public static AIVirtualCard GetCurrentTriggerCard(this AISituationInfo situation) - { - if (situation.IsNull()) - { - return null; - } - return situation.CurrentSkillProcessInfo.TriggerInfo.TriggerCard; - } public static bool IsSameCurrentTriggerCardAndTriggerType(this AISituationInfo situation, AIVirtualCard card, AISituationTriggerInformation.TriggerType triggerType) { @@ -41,20 +33,6 @@ public static class AISituationCurrentProcessAccessExtension return triggerInfo.IsTriggerCard(card); } - public static bool IsBanishTrigger(this AISituationInfo situation) - { - if (situation.IsNull()) - { - return false; - } - AISituationTriggerInformation triggerInfo = situation.CurrentSkillProcessInfo.TriggerInfo; - if (triggerInfo.Type == AISituationTriggerInformation.TriggerType.Banish) - { - return triggerInfo.TriggerCard != null; - } - return false; - } - public static bool IsOwnSummonedCard(this AISituationInfo situation, AIVirtualCard card, AIScriptTokenArgType targetCardType, bool isLatest = false) { if (situation.IsNull()) diff --git a/SVSim.BattleEngine/Engine/Wizard/AISituationInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AISituationInfo.cs index 8e2a0a3a..20399fbf 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISituationInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISituationInfo.cs @@ -76,11 +76,6 @@ public abstract class AISituationInfo Actor = newActor; } - public void SetOriginalCard(AIVirtualCard card) - { - OriginalCard = card; - } - public AISelectedTargetInfo GetSituationTarget(AIScriptTokenArgType whichTarget) { switch (whichTarget) @@ -199,15 +194,6 @@ public abstract class AISituationInfo return true; } - public List GetTargetIdList(AIScriptTokenArgType selectType) - { - if (SelectedTargets == null) - { - return null; - } - return SelectedTargets.GetTargetIdList(selectType); - } - public void SetExecutingSkillProcess(AISkillProcessInformation processInfo) { CurrentSkillProcessInfo = processInfo; @@ -227,11 +213,6 @@ public abstract class AISituationInfo return aISkillProcessInformation; } - public void AddProcessInfos(List processInfo) - { - ProcessCollection.RegisterProcess(processInfo); - } - public void ExecuteAllSkillProcess() { ProcessCollection.ExecuteAllProcess(this); diff --git a/SVSim.BattleEngine/Engine/Wizard/AISkillActivateCountUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AISkillActivateCountUtility.cs index 94992f2e..c4b2ff3e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISkillActivateCountUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISkillActivateCountUtility.cs @@ -4,7 +4,6 @@ namespace Wizard; public static class AISkillActivateCountUtility { - public const int NONE_LIMIT_ACTIVATE_COUNT = -1; public static void AllActivateCountHolderIncrement(this AIVirtualField field, AISituationInfo situation, AIPlayTagType counterType, AIVirtualCard triggerCard = null) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIStack.cs b/SVSim.BattleEngine/Engine/Wizard/AIStack.cs index 7bc26773..c9a0bedd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIStack.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIStack.cs @@ -6,8 +6,6 @@ public class AIStack : AIScriptArgumentExpressions { private AIPolishConvertedExpression _defaultStackValue; - private const int STACK_VALUE_ARG_INDEX = 0; - public AIStack(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIStyleFileNameList.cs b/SVSim.BattleEngine/Engine/Wizard/AIStyleFileNameList.cs index 08a9c8b5..d7aeb189 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIStyleFileNameList.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIStyleFileNameList.cs @@ -5,9 +5,6 @@ namespace Wizard; public class AIStyleFileNameList { - private const int STYLE_ID_INDEX = 0; - - private const int FILE_NAME_INDEX = 1; private readonly Dictionary _dataTable = new Dictionary(); @@ -29,9 +26,4 @@ public class AIStyleFileNameList } return ""; } - - public List GetFileNameList() - { - return _dataTable.Values.ToList(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIStyleQuery.cs b/SVSim.BattleEngine/Engine/Wizard/AIStyleQuery.cs index 102c2eca..6286dc17 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIStyleQuery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIStyleQuery.cs @@ -30,8 +30,8 @@ public class AIStyleQuery public void UpdateStyle() { - AIDataLibrary aIDataLibrary = GameMgr.GetIns().GetDataMgr().m_AIDataLibrary; - _curStyle = aIDataLibrary.CreateStyle(GameMgr.GetIns().GetDataMgr().GetPlayerClassId(), _deckStyle); + AIDataLibrary aIDataLibrary = null; // Pre-Phase-5b: no AI lib headless + _curStyle = null; // Pre-Phase-5b: no AI style headless _curPolicies = _curStyle.ConvertToPolicyList(); _policyCollections = new AIPolicyCollectionContainer(); _policyCollections.InitializeAllCollections(_curPolicies); @@ -53,16 +53,6 @@ public class AIStyleQuery _policyCollections.RegisterNewPolicy(data); } - public void RemoveAllAttachedStyle() - { - if (_attachedPolicies != null) - { - _policyCollections.RemoveAttachedPolicies(_attachedPolicies); - _attachedPolicies.Clear(); - _attachedPolicies = null; - } - } - public float GetEpValue(AISituationInfo situation, List playPtn) { if (!_policyCollections.HasPolicy(AIPolicyType.EpValue)) diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonAttachTag.cs index 84ae9ddc..12275e25 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonAttachTag.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AISummonAttachTag : AIFiltersArgument { - private const int TIMING_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 2; private readonly AIScriptTokenArgType[] _legalSelectTypeArgs = new AIScriptTokenArgType[2] { diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonBanish.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonBanish.cs index cabe56b9..9feb44b9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonBanish.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonBanish.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AISummonBanish : AIFiltersAndSelectTypeArgument { - private const int SELECT_TYPE_ARG_OFFSET = 1; protected override int NON_FILTER_FIRST_OFFSET => 1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonBuff.cs index cdb81a3a..8f0746e9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonBuff.cs @@ -4,13 +4,6 @@ namespace Wizard; public class AISummonBuff : AIFiltersArgument { - private const int SELECT_TYPE_OFFSET = 4; - - private const int ATK_BUFF_OFFSET = 3; - - private const int LIFE_BUFF_OFFSET = 2; - - private const int PERM_OR_TEMP_OFFSET = 1; private readonly AIScriptTokenArgType[] _legalSelectTypeArgs = new AIScriptTokenArgType[2] { diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonDamage.cs index eed21d0a..dde2dd56 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonDamage.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AISummonDamage : AIFiltersArgument { - private const int DAMAGE_OFFSET = 1; - - private const int SELECT_TYPE_OFFSET = 2; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonDestroy.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonDestroy.cs index 902a75d9..de734e5e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonDestroy.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonDestroy.cs @@ -6,8 +6,6 @@ public class AISummonDestroy : AIFiltersArgument { private AIPolishConvertedExpression _destroyCount; - private const int DESTROY_COUNT_ARG_OFFSET = 1; - public AIScriptTokenArgType SelectType { get; private set; } protected int SELECT_TYPE_OFFSET => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonHeal.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonHeal.cs index d0441ccc..687a5d26 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonHeal.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonHeal.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AISummonHeal : AIFiltersArgument { - private const int SELECT_TYPE_OFFSET = 2; - - private const int HEAL_ARG_OFFSET = 1; public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonTokenUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonTokenUtility.cs index d18a6777..6a8c0795 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonTokenUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonTokenUtility.cs @@ -5,7 +5,6 @@ namespace Wizard; public static class AISummonTokenUtility { - private const int INPLAY_MAX_NUM = 5; public static void SummonAllTokenToField(this AITokenIdCollection tokenIdCollection, AIVirtualField field, AIVirtualCard owner, AISituationInfo situation, List condList = null) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AISummonedCardContainer.cs b/SVSim.BattleEngine/Engine/Wizard/AISummonedCardContainer.cs index b9679505..ed95cf32 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AISummonedCardContainer.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AISummonedCardContainer.cs @@ -45,7 +45,7 @@ public class AISummonedCardContainer public void LoadListSet(AIVirtualField field, BattlePlayerBase player) { - BattleManagerBase ins = BattleManagerBase.GetIns(); + BattleManagerBase ins = player.BattleMgr; int currentTurn = ins.CurrentTurn; bool isSelfTurn = ins.BattlePlayer.IsSelfTurn; for (int i = 0; i < player.GameSummonCards.Count; i++) diff --git a/SVSim.BattleEngine/Engine/Wizard/AITargetSelectFilteringUtility.cs b/SVSim.BattleEngine/Engine/Wizard/AITargetSelectFilteringUtility.cs index a3a8a01e..d352384e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITargetSelectFilteringUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITargetSelectFilteringUtility.cs @@ -113,30 +113,6 @@ public static class AITargetSelectFilteringUtility return candidates; } - public static IEnumerable RemoveDuplicatedCards(IEnumerable targetCards, IEnumerable filterCards) - { - if (!targetCards.IsNotNullOrEmpty() || !filterCards.IsNotNullOrEmpty()) - { - yield break; - } - foreach (BattleCardBase targetCard in targetCards) - { - bool flag = false; - foreach (BattleCardBase filterCard in filterCards) - { - if (filterCard != null && targetCard.IsPlayer == filterCard.IsPlayer && targetCard.Index == filterCard.Index) - { - flag = true; - break; - } - } - if (!flag) - { - yield return targetCard; - } - } - } - public static AISelectedTargetInfo GetRuleBaseTargets(AIPlayTag rule, List candidates, AIVirtualField field, AIVirtualTargetSelectAction situation, AIRemovalType removalType) { List targetList = null; diff --git a/SVSim.BattleEngine/Engine/Wizard/AITestGlobal.cs b/SVSim.BattleEngine/Engine/Wizard/AITestGlobal.cs deleted file mode 100644 index 961a0643..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AITestGlobal.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Wizard; - -public class AITestGlobal -{ - public static int AI_MAX_LIFE = 20; -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AITimeOverAttackSimulator.cs b/SVSim.BattleEngine/Engine/Wizard/AITimeOverAttackSimulator.cs index ae05c259..22e099e3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITimeOverAttackSimulator.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITimeOverAttackSimulator.cs @@ -9,7 +9,6 @@ namespace Wizard; public class AITimeOverAttackSimulator : IBattleSimulationAI { - private const int NONE_EVOLVE_INDEX = -1; private AIRuleBaseBattleSimulator _ruleBaseSimulator; diff --git a/SVSim.BattleEngine/Engine/Wizard/AITokenManager.cs b/SVSim.BattleEngine/Engine/Wizard/AITokenManager.cs index 0f6ef873..1c80f2ec 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITokenManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITokenManager.cs @@ -4,9 +4,6 @@ namespace Wizard; public class AITokenManager { - public const int ZOMBIE_ID = 900511030; - - public const int PUPPET_ID = 900811050; private EnemyAI _ai; diff --git a/SVSim.BattleEngine/Engine/Wizard/AITokenPool.cs b/SVSim.BattleEngine/Engine/Wizard/AITokenPool.cs index 594ac379..3c58b0ab 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITokenPool.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITokenPool.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AITokenPool { - private const int DEFAULT_TOKEN_INDEX = -1; private Dictionary tokenPool; diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndAddDeck.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndAddDeck.cs index 4930b875..666094d3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndAddDeck.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndAddDeck.cs @@ -8,12 +8,6 @@ public class AITurnEndAddDeck : AIScriptArgumentExpressions, IAITurnEndArgument private AIPolishConvertedExpression _addCountExpression; - private const int ADD_CARD_ID_ARG_INDEX = 0; - - private const int ADD_COUNT_ARG_INDEX = 1; - - private const int IS_ALLY_TURN_INDEX = 2; - public bool IsAllyTurn { get; private set; } public AITurnEndAddDeck(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndAttachTag.cs index 6eb1275e..2e898788 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndAttachTag.cs @@ -6,14 +6,6 @@ public class AITurnEndAttachTag : AIFiltersArgument, IAITurnEndArgument { private AIPolishConvertedExpression AttachCount; - private const int SELECT_TYPE_OFFSET = 4; - - private const int COUNT_OFFSET = 3; - - private const int TIMING_OFFSET = 2; - - private const int IS_ALLY_TURN_OFFSET = 1; - public AIPlayTag Tag { get; private set; } public AIScriptTokenArgType SelectType { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndBarrierBase.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndBarrierBase.cs index c06ed767..ec642e2f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndBarrierBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndBarrierBase.cs @@ -8,8 +8,6 @@ public abstract class AITurnEndBarrierBase : AIFiltersAndSelectTypeArgument, IAI protected AIScriptTokenArgType _damageType; - private const int IS_ALLY_TURN_OFFSET = 1; - protected bool _isDamageTypeDefinedByMaster; public bool IsAllyTurn { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageClip.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageClip.cs index 3e294962..35513ac8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageClip.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageClip.cs @@ -6,8 +6,6 @@ public class AITurnEndDamageClip : AITurnEndBarrierBase { private AIPolishConvertedExpression _clipAmount; - private const int CLIP_AMOUNT_OFFSET = 2; - protected override int _defaultDamageTypeOffset => 4; protected override int _stopTimingOffset => 3; diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageCut.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageCut.cs index 7617c432..a00e42cb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageCut.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndDamageCut.cs @@ -6,8 +6,6 @@ public class AITurnEndDamageCut : AITurnEndBarrierBase { private AIPolishConvertedExpression _cutAmount; - private const int CUT_AMOUNT_OFFSET = 2; - protected override int _stopTimingOffset => 3; protected override int _defaultDamageTypeOffset => 4; diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndDraw.cs index 47fec2c2..84d502c8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndDraw.cs @@ -8,12 +8,6 @@ public class AITurnEndDraw : AIScriptArgumentExpressions, IAITurnEndArgument private AIPolishConvertedExpression _drawCount; - private const int DRAW_SIDE_INDEX = 0; - - private const int DRAW_COUNT_INDEX = 1; - - private const int IS_ALLY_TURN_INDEX = 2; - private readonly AIScriptTokenArgType[] _legalDrawSideArgs = new AIScriptTokenArgType[3] { AIScriptTokenArgType.ALLY, diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndMove.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndMove.cs deleted file mode 100644 index e141b247..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndMove.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Wizard; - -internal class AITurnEndMove : AIMove -{ - public AITurnEndMove() - : base(AIOperationType.TURNEND) - { - } - - public override void RunOperation(BattleManagerBase mgr, bool isPlayer) - { - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndRemoveTag.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndRemoveTag.cs index 08f1aca2..4670909a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndRemoveTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndRemoveTag.cs @@ -4,11 +4,6 @@ namespace Wizard; public class AITurnEndRemoveTag : AIScriptArgumentExpressions, IAITurnEndArgument, IAIRemoveTagArgument { - private const int NEEDS_SPLITED_WORDS_LENGS = 4; - - private const int REMOVE_TAG_START_SPLITED_INDEX = 1; - - private const int IS_ALLY_TURN_ARG_OFFSET = 1; public AIPlayTag RemoveTag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnEndToken.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnEndToken.cs index 4a51893a..331b64b4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnEndToken.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnEndToken.cs @@ -8,12 +8,6 @@ public class AITurnEndToken : AIFiltersArgument, IAITurnEndArgument private AIPolishConvertedExpression _tokenCount; - private const int DEFAULT_TOKEN_COUNT_INDEX_OFFSET = 3; - - private const int DEFAULT_IS_ALLY_TURN_OFFSET = 2; - - private const int TOKEN_SIDE_INDEX_OFFSET = 1; - private int _realTokenCountIndexOffset; public bool IsAllyTurn { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnStartAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnStartAttachTag.cs index bb98562e..cd1c9f25 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnStartAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnStartAttachTag.cs @@ -6,12 +6,6 @@ public class AITurnStartAttachTag : AITurnStartTagArgument { private AIPolishConvertedExpression _selectCountArg; - private const int SELECT_COUNT_OFFSET = 3; - - private const int REMOVE_TIMING_OFFSET = 2; - - private const int TAG_WORD_START_INDEX = 1; - public AIScriptTokenArgType RemoveTiming { get; private set; } public AIPlayTag Tag { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamage.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamage.cs index 084d287e..6b8f2bce 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamage.cs @@ -8,10 +8,6 @@ public class AITurnStartDamage : AITurnStartTagArgument private AIPolishConvertedExpression _damageCount; - private const int DAMAGE_AMOUNT_ARG_OFFSET = 3; - - private const int DAMAGE_COUNT_ARG_OFFSET = 2; - protected override int SELECT_TYPE_OFFSET => 4; public AITurnStartDamage(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamageCut.cs b/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamageCut.cs index 010965db..c01b03e0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamageCut.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AITurnStartDamageCut.cs @@ -6,8 +6,6 @@ public class AITurnStartDamageCut : AITurnStartBarrierBase { private AIPolishConvertedExpression _cutAmount; - private const int CUT_AMOUNT_OFFSET = 2; - protected override int _stopTimingOffset => 3; protected override int _defaultDamageTypeOffset => 4; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualCard.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualCard.cs index b88ac833..7605136f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIVirtualCard.cs @@ -443,8 +443,6 @@ public class AIVirtualCard public int SuperSkyboundArtCount { get; private set; } - public bool IsFusionCard => TagCollectionContainer.HasTag(AIPlayTagType.Fusion); - public bool IsFusionable { get; private set; } public AIVirtualFusionIngredientsInfo FusionIngredients { get; protected set; } @@ -1427,15 +1425,6 @@ public class AIVirtualCard WhiteRitualCount += Mathf.Max(0, resetCount); } - public void ResetAllEvaluationUpdatedParameter() - { - if (WhiteRitualCount <= 0 && IsDead) - { - IsDead = false; - } - WhiteRitualCount = _originalWhiteRitualCount; - } - public void ChangeIsCantUnderAttack(bool isCantUnderAttack) { _isCantUnderAttack = isCantUnderAttack; @@ -1706,16 +1695,6 @@ public class AIVirtualCard _field.AllActivateCountHolderIncrement(situation, AIPlayTagType.BreakActivateCount, this); } - public void BurialRite() - { - if (IsInHand) - { - IsInHand = false; - _field.RemoveAllyHandCard(this); - _field.VirtualCemetery.AddCemetery(1, IsAlly); - } - } - private void ExecuteLastwordSkills(AISkillProcessInformation processInfo, AISituationInfo situation) { AIPreprocessSimulationUtility.SimulatePreprocess(this, situation, _field, AIScriptTokenArgType.WHEN_DESTROY, isPseudo: false); @@ -2290,20 +2269,6 @@ public class AIVirtualCard return false; } - public void ResetParameterAfterPlayPtnEvaluation() - { - SpellboostCount = RealSpellboostCount; - Cost = RealCost; - if (_originalWhiteRitualCount != WhiteRitualCount) - { - if (IsDead && WhiteRitualCount <= 0 && _originalWhiteRitualCount > 0) - { - IsDead = false; - } - WhiteRitualCount = _originalWhiteRitualCount; - } - } - public void RollBackFromOneRecord(AIVirtualFieldRollBackRecord.CardParamRecord record) { Cost = record.Cost; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualCardParameter.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualCardParameter.cs index b1296278..6bc6254b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualCardParameter.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIVirtualCardParameter.cs @@ -152,8 +152,4 @@ public class AIVirtualCardParameter } return num + simulateBuffValue; } - - public void Validate(AIVirtualCardParameter param) - { - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualCemetery.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualCemetery.cs index 98789b0c..22698585 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualCemetery.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIVirtualCemetery.cs @@ -14,11 +14,6 @@ public class AIVirtualCemetery CurrentCemetery = OriginalCemetery; } - public void Reset() - { - CurrentCemetery = OriginalCemetery; - } - public void ResetNecromance(int count) { CurrentCemetery += count; @@ -57,12 +52,6 @@ public class AIVirtualCemetery _enemyCemetery = new CemeteryInfo(enemyCemetery); } - public void ResetAllCemetery() - { - _allyCemetery.Reset(); - _enemyCemetery.Reset(); - } - public void ResetNecromance(bool isAlly, int count) { (isAlly ? _allyCemetery : _enemyCemetery).ResetNecromance(count); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualField.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualField.cs index 6b3a37cb..4b2f5877 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualField.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIVirtualField.cs @@ -296,7 +296,7 @@ public class AIVirtualField AllyGameUsedStackCount = pair.Self.GameUsedWhiteRitualCount; EnemyGameUsedStackCount = pair.Opponent.GameUsedWhiteRitualCount; List list = ParamQuery.GetBrokenAll(pair.Self.Class).ToList(); - int turn2 = BattleManagerBase.GetIns().CurrentTurn; + int turn2 = pair.Self.BattleMgr.CurrentTurn; List list2 = new List(); list2.AddRange(pair.Self.SkillInfoNecromanceZoneCards); list2.AddRange(pair.Self.SkillInfoCemeterys); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualFusionIngredientsInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualFusionIngredientsInfo.cs index f194f455..61c92574 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualFusionIngredientsInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIVirtualFusionIngredientsInfo.cs @@ -74,43 +74,6 @@ public class AIVirtualFusionIngredientsInfo FusionTurnList = AIParamQuery.AddElementToList(turn, FusionTurnList); } - public bool Validate(AIVirtualFusionIngredientsInfo info) - { - if (FusionTurnList == null != (info.FusionTurnList == null) || CardList == null != (info.CardList == null)) - { - return false; - } - if (FusionTurnList != null && info.FusionTurnList != null) - { - if (FusionTurnList.Count != info.FusionTurnList.Count) - { - return false; - } - for (int i = 0; i < FusionTurnList.Count; i++) - { - if (FusionTurnList[i] != info.FusionTurnList[i]) - { - return false; - } - } - } - if (CardList != null && info.CardList != null) - { - if (CardList.Count != info.CardList.Count) - { - return false; - } - for (int j = 0; j < CardList.Count; j++) - { - if (!CardList[j].IsSameCard(info.CardList[j])) - { - return false; - } - } - } - return true; - } - public ulong GetHash() { return (ulong)(0 + (long)FusionCount * 55351L); diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualRemovalInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualRemovalInfo.cs deleted file mode 100644 index 12337feb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualRemovalInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class AIVirtualRemovalInfo -{ - public bool IsFirstTargetSelected; - - public List Tags { get; private set; } - - public AIVirtualRemovalInfo(List tags) - { - Tags = tags; - IsFirstTargetSelected = false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AIVirtualTurnEndInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AIVirtualTurnEndInfo.cs index 8b30979d..3a93cb35 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIVirtualTurnEndInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIVirtualTurnEndInfo.cs @@ -11,29 +11,4 @@ public class AIVirtualTurnEndInfo : AIVirtualActionInfo { return 9999991uL; } - - public bool Validate(AIVirtualTurnEndInfo info) - { - if (info == null) - { - return false; - } - if (info.Actor == null || base.Actor == null) - { - return false; - } - if (!base.Actor.IsSameCard(info.Actor)) - { - return false; - } - if (base.CurrentCheckCard == null && info.CurrentCheckCard == null) - { - return true; - } - if (base.CurrentCheckCard != null && info.CurrentCheckCard != null) - { - return base.CurrentCheckCard.IsSameCard(info.CurrentCheckCard); - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttachTag.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttachTag.cs index f06035e9..70a7f93e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttachTag.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttachTag.cs @@ -6,12 +6,6 @@ public class AIWhenPlayAttachTag : AIWhenPlayTagArgument { private AISelectLogicArgumentBase _selectLogicArg; - private const int REMOVE_TIMING_OFFSET = 1; - - private const int TAG_WORD_START_INDEX = 1; - - private const int SELECT_LOGIC_WORD_START_INDEX = 4; - public AIPlayTag Tag { get; private set; } public AIScriptTokenArgType RemoveTiming { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttackableCount.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttackableCount.cs index b761c3f2..3480198c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttackableCount.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAttackableCount.cs @@ -6,10 +6,6 @@ public class AIWhenPlayAttackableCount : AIWhenPlayTagArgument { private AIPolishConvertedExpression _countArg; - private const int SELECT_TYPE_ARG_OFFSET = 2; - - private const int ATTACKABLE_COUNT_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIWhenPlayAttackableCount(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeClass.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeClass.cs index 19cb8b31..d9f96903 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeClass.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeClass.cs @@ -6,8 +6,6 @@ public class AIWhenPlayChangeClass : AIWhenPlayTagArgument { private CardBasePrm.ClanType _classType; - private const int CLASS_TYPE_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIWhenPlayChangeClass(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeCost.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeCost.cs index d043e79b..f5d0a0f0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeCost.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeCost.cs @@ -6,10 +6,6 @@ public class AIWhenPlayChangeCost : AIWhenPlayTagArgument { private AIPolishConvertedExpression _costValue; - private const int COST_VALUE_ARG_OFFSET = 1; - - private const int COST_TYPE_ARG_OFFSET = 2; - private readonly AIScriptTokenArgType[] _legalCostTypeArgs = new AIScriptTokenArgType[2] { AIScriptTokenArgType.ADD, diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeTribe.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeTribe.cs index 09b4d473..ccaca1c1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeTribe.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayChangeTribe.cs @@ -6,8 +6,6 @@ public class AIWhenPlayChangeTribe : AIWhenPlayTagArgument { private CardBasePrm.TribeType _tribeType = CardBasePrm.TribeType.MAX; - private const int TRIBE_TYPE_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 2; public AIWhenPlayChangeTribe(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageClip.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageClip.cs index 03d47f6e..e7876ba2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageClip.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageClip.cs @@ -6,8 +6,6 @@ public class AIWhenPlayDamageClip : AIWhenPlayBarrierBase { private AIPolishConvertedExpression _clipAmount; - private const int CLIP_AMOUNT_OFFSET = 1; - protected override int _defaultDamageTypeOffset => 3; protected override int _stopTimingOffset => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageCut.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageCut.cs index d1f336df..1a42b82b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageCut.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayDamageCut.cs @@ -6,8 +6,6 @@ public class AIWhenPlayDamageCut : AIWhenPlayBarrierBase { private AIPolishConvertedExpression _cutAmount; - private const int CUT_AMOUNT_OFFSET = 1; - protected override int _defaultDamageTypeOffset => 3; protected override int _stopTimingOffset => 2; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayHandBuff.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayHandBuff.cs index 5aac3248..641979ff 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayHandBuff.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayHandBuff.cs @@ -8,10 +8,6 @@ public class AIWhenPlayHandBuff : AIWhenPlayTagArgument private AIPolishConvertedExpression _lifeBuff; - private const int ATK_BUFF_ARG_OFFSET = 2; - - private const int LIFE_BUFF_ARG_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => 3; public AIWhenPlayHandBuff(string text) diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayReanimate.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayReanimate.cs index 61e13cae..eb26522b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayReanimate.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayReanimate.cs @@ -6,8 +6,6 @@ public class AIWhenPlayReanimate : AIWhenPlayTokenArgumentBase { private AIPolishConvertedExpression _costArgument; - private const int REANIMATE_COST_ARG_OFFSET = 2; - protected override int SELECT_COUNT_OFFSET => -1; protected override int SELECT_TYPE_OFFSET => -1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlaySetLeaderMaxLife.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlaySetLeaderMaxLife.cs index f0f1b0e3..acfc94d1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlaySetLeaderMaxLife.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlaySetLeaderMaxLife.cs @@ -8,10 +8,6 @@ public class AIWhenPlaySetLeaderMaxLife : AIWhenPlayTagArgument private AIPolishConvertedExpression _life; - private const int SIDE_OFFSET = 2; - - private const int VALUE_OFFSET = 1; - public AIWhenPlaySetLeaderMaxLife(string text) : base(text) { diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenArgumentBase.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenArgumentBase.cs index d8985428..db6afb9c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenArgumentBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenArgumentBase.cs @@ -8,8 +8,6 @@ public abstract class AIWhenPlayTokenArgumentBase : AIWhenPlayTagArgument protected AITokenIdHolderCandidateRangeInformation _candidateRangeInfo; - private const int SIDE_OFFSET = 1; - protected int _ommittedIndexOffset; protected int _realNonFilterFirstOffset; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenDraw.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenDraw.cs index 08eb6efe..9d912f71 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenDraw.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhenPlayTokenDraw.cs @@ -6,8 +6,6 @@ public class AIWhenPlayTokenDraw : AIWhenPlayTagArgument { private AIPolishConvertedExpression _tokenCount; - private const int TOKEN_COUNT_OFFSET = 1; - protected override int SELECT_TYPE_OFFSET => -1; protected override int NON_FILTER_FIRST_OFFSET => 1; diff --git a/SVSim.BattleEngine/Engine/Wizard/AIWhitefrostWhisperLogicArgument.cs b/SVSim.BattleEngine/Engine/Wizard/AIWhitefrostWhisperLogicArgument.cs index 2cc8dc1a..1e7dce16 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AIWhitefrostWhisperLogicArgument.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AIWhitefrostWhisperLogicArgument.cs @@ -4,7 +4,6 @@ namespace Wizard; public class AIWhitefrostWhisperLogicArgument : AISelectLogicArgumentBase { - private const int WHITEFROST_WHISPER_DAMAGE = 1; public override AIScriptTokenArgType LogicType => AIScriptTokenArgType.WHITEFROST_WHISPER_LOGIC; diff --git a/SVSim.BattleEngine/Engine/Wizard/AcceptAgreementTask.cs b/SVSim.BattleEngine/Engine/Wizard/AcceptAgreementTask.cs index 0c18e63b..940606de 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AcceptAgreementTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AcceptAgreementTask.cs @@ -4,9 +4,6 @@ public class AcceptAgreementTask : BaseTask { private class Param : BaseParam { - public int agreement_type; - - public int agreement_id; } public enum Type @@ -29,26 +26,6 @@ public class AcceptAgreementTask : BaseTask base.type = ApiType.Type.AcceptAgreement; } - public void SetParameter(Type agreedType) - { - _agreedType = agreedType; - Param param = new Param(); - param.agreement_type = (int)agreedType; - switch (agreedType) - { - case Type.TOS: - param.agreement_id = _tosId; - break; - case Type.PrivacyPolicy: - param.agreement_id = _privacyPolicyId; - break; - case Type.KorAuthority: - param.agreement_id = KorAuthorityId; - break; - } - base.Params = param; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard/AccountBase.cs b/SVSim.BattleEngine/Engine/Wizard/AccountBase.cs index ee12dd2d..81af340a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AccountBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AccountBase.cs @@ -1,7 +1,6 @@ using System; using Cute; using UnityEngine; -using Wizard.Dialog.DataLink; using Wizard.Dialog.Setting; namespace Wizard; @@ -11,58 +10,17 @@ public class AccountBase : MonoBehaviour public enum DisplayType { NONE, - TITLE, OTHER, - ACCOUNT_LINK, - ID_PASSWORD_INPUT, - PASSWORD_SETTING - } + ACCOUNT_LINK } public enum TransitionOriginalScreen { - TITLE, OTHER } - [SerializeField] - private GameObject TransferContainer; - - [SerializeField] - private GameObject InputContainer; - - [SerializeField] - public IdPasswordInput _idPasswordInput; - - [SerializeField] - public PasswordSetting _passwordSetting; - - [SerializeField] - private GameObject TopContainer; - - [SerializeField] - private Transform _topContainerLine; - - [SerializeField] - private GameObject TitleContainer; - - [SerializeField] - private GameObject OtherContainer; - [SerializeField] private UIButton _appleButton; - private const int INDEX_TOP_LABEL = 0; - - private const int INDEX_MID_LABEL = 1; - - private const int INDEX_INPUT_LABEL = 2; - - private const int INDEX_BOTTOM_LABEL = 3; - - private const int INDEX_BUTTON_LABEL = 4; - - private Vector3 AccountPos = new Vector3(0f, 70f, 0f); - [SerializeField] private UIGrid ButtonGrid; @@ -72,9 +30,6 @@ public class AccountBase : MonoBehaviour [SerializeField] public NguiObjs BtnGoogle; - [SerializeField] - public NguiObjs BtnFaceBook; - [SerializeField] public NguiObjs ButtonGetCode; @@ -84,12 +39,6 @@ public class AccountBase : MonoBehaviour [SerializeField] public UILabel CommonLabelBtm; - private readonly Vector3 TopContainerPosition = new Vector3(0f, -90f, 0f); - - private const int MIN_PASSWORD_LENGTH = 8; - - private const int MAX_PASSWORD_LENGTH = 16; - private void Awake() { SetLabels(); @@ -106,340 +55,4 @@ public class AccountBase : MonoBehaviour CommonLabelTop.text = systemText.Get("Account_0095"); CommonLabelBtm.text = systemText.Get("Account_0073"); } - - public void SetDisplayType(DisplayType type) - { - switch (type) - { - case DisplayType.TITLE: - TransferContainer.SetActive(value: true); - InputContainer.SetActive(value: false); - _idPasswordInput.gameObject.SetActive(value: false); - _passwordSetting.gameObject.SetActive(value: false); - OtherContainer.SetActive(value: false); - TitleContainer.SetActive(value: false); - UIUtil.SetPositionY(TopContainer.transform, -90f); - _topContainerLine.gameObject.SetActive(value: false); - break; - case DisplayType.OTHER: - TransferContainer.SetActive(value: true); - InputContainer.SetActive(value: false); - _idPasswordInput.gameObject.SetActive(value: false); - _passwordSetting.gameObject.SetActive(value: false); - TitleContainer.SetActive(value: false); - break; - case DisplayType.ACCOUNT_LINK: - TransferContainer.SetActive(value: true); - TransferContainer.transform.localPosition = AccountPos; - InputContainer.SetActive(value: false); - _idPasswordInput.gameObject.SetActive(value: false); - _passwordSetting.gameObject.SetActive(value: false); - TopContainer.SetActive(value: false); - OtherContainer.SetActive(value: false); - if (GetActiveChildCount(ButtonGrid.transform) <= 2) - { - UIUtil.SetPositionY(TitleContainer.transform, 50f); - UIUtil.SetPositionY(ButtonGrid.transform, -96f); - } - else - { - UIUtil.SetPositionY(TitleContainer.transform, 0f); - UIUtil.SetPositionY(ButtonGrid.transform, -60f); - } - break; - case DisplayType.ID_PASSWORD_INPUT: - TransferContainer.SetActive(value: false); - InputContainer.SetActive(value: false); - _idPasswordInput.gameObject.SetActive(value: true); - _passwordSetting.gameObject.SetActive(value: false); - break; - case DisplayType.PASSWORD_SETTING: - TransferContainer.SetActive(value: false); - InputContainer.SetActive(value: false); - _idPasswordInput.gameObject.SetActive(value: false); - _passwordSetting.gameObject.SetActive(value: true); - break; - } - } - - public DialogBase Init(DisplayType type, TransitionOriginalScreen from, Action close_callback = null) - { - SystemText text = Data.SystemText; - SetDisplayType(type); - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - dialog.SetSize(DialogBase.Size.M); - dialog.SetObj(base.gameObject); - if (type != DisplayType.PASSWORD_SETTING) - { - if (type == DisplayType.OTHER) - { - dialog.SetTitleLabel(text.Get("Account_0001")); - } - else - { - dialog.SetTitleLabel(text.Get("Account_0004")); - } - dialog.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - } - BtnTransferCode.buttons[0].onClick.Add(new EventDelegate(delegate - { - OnClickIdPasswordInputButton(dialog, from); - })); - BtnGoogle.buttons[0].onClick.Add(new EventDelegate(delegate - { - dialog.CloseWithoutSelect(); - UIManager.GetInstance().AccountTransferHelper.PressedTransitongButton = CuteNetworkDefine.ACCOUNT_TYPE.GOOGLE_PLAY; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(text.Get("Account_0015")); - dialogBase.SetText(text.Get("Account_0077")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dialogBase.SetButtonText(text.Get("Account_0084"), text.Get("Account_0080")); - EventDelegate method_btn = new EventDelegate(delegate - { - UIManager.GetInstance().AccountTransferHelper.DataTransfer(close_callback); - }); - dialogBase.SetButtonDelegate(method_btn); - })); - BtnFaceBook.buttons[0].onClick.Add(new EventDelegate(delegate - { - dialog.CloseWithoutSelect(); - UIManager.GetInstance().AccountTransferHelper.PressedTransitongButton = CuteNetworkDefine.ACCOUNT_TYPE.FACEBOOK; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(text.Get("Account_0058")); - dialogBase.SetText(text.Get("Account_0079")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dialogBase.SetButtonText(text.Get("Account_0084"), text.Get("Account_0080")); - EventDelegate method_btn = new EventDelegate(delegate - { - UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.FACEBOOK); - }); - dialogBase.SetButtonDelegate(method_btn); - })); - ButtonGetCode.buttons[0].onClick.Add(new EventDelegate(delegate - { - OnClickPasswordSettingButton(dialog, from); - })); - return dialog; - } - - private void OnClickIdPasswordInputButton(DialogBase previousDialog, TransitionOriginalScreen from) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - previousDialog.CloseWithoutSelect(); - DialogBase idPasswordInputDialog = UIManager.GetInstance().AccountTransferHelper.CreateAccountTransferDialog(DisplayType.ID_PASSWORD_INPUT, from); - IdPasswordInput idPasswordInputObject = idPasswordInputDialog.InsideObject.GetComponent()._idPasswordInput; - UIInputWizard idInput = idPasswordInputObject._idInput; - UIInputWizard passwordInput = idPasswordInputObject._passwordInput; - EventDelegate item = new EventDelegate(delegate - { - idPasswordInputDialog.SetButtonDisable(string.IsNullOrEmpty(idInput.value) || string.IsNullOrEmpty(passwordInput.value)); - }); - UIInputWizard[] array = new UIInputWizard[2] { idInput, passwordInput }; - foreach (UIInputWizard input in array) - { - EventDelegate item2 = new EventDelegate(delegate - { - InputDialog.TextInputLimitCheck(input.characterLimit); - }); - input.onChange.Add(item); - input.onSubmit.Add(item2); - input.onDeselect.Add(item2); - } - SystemText systemText = Data.SystemText; - idPasswordInputDialog.SetSize(DialogBase.Size.S); - idPasswordInputDialog.SetTitleLabel(systemText.Get("Account_0001")); - idPasswordInputDialog.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn); - idPasswordInputDialog.SetButtonDisable(isEnableOK: true); - idPasswordInputDialog.isNotCloseWindowButton1 = true; - idPasswordInputDialog.onPushButton1 = delegate - { - string userId = idInput.value; - string passwordHash = Cryptographer.MakeMd5(passwordInput.value); - CheckTimeSlipRotationPeriod(delegate - { - GetGameDataByTransitionCode getGameDataByTransitionCode = new GetGameDataByTransitionCode(); - getGameDataByTransitionCode.SetParameter(userId, passwordHash); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(getGameDataByTransitionCode, delegate(NetworkTask.ResultCode code) - { - idPasswordInputDialog.Close(); - UIManager.GetInstance().AccountTransferHelper.ShowAccountMagritionConfirmByTransferCode(code); - }, null, delegate - { - idPasswordInputObject.ResetInputValue(); - })); - }); - }; - } - - private static void CheckTimeSlipRotationPeriod(Action onFinish) - { - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Title) - { - onFinish.Call(); - return; - } - CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - onFinish.Call(); - })); - } - - private void OnClickPasswordSettingButton(DialogBase previousDialog, TransitionOriginalScreen from) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - previousDialog.CloseWithoutSelect(); - SystemText text = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(text.Get("Account_0101")); - dialogBase.SetText(text.Get("Account_0102")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(text.Get("Account_0103")); - dialogBase.onPushButton1 = delegate - { - DialogBase passwordSettingDialog = UIManager.GetInstance().AccountTransferHelper.CreateAccountTransferDialog(DisplayType.PASSWORD_SETTING, from); - AccountBase passwordSettingAccountBase = passwordSettingDialog.InsideObject.GetComponent(); - PasswordSetting passwordSettingObject = passwordSettingAccountBase._passwordSetting; - UIInputWizard firstInput = passwordSettingObject._firstInput; - UIInputWizard secondInput = passwordSettingObject._secondInput; - EventDelegate eventDelegate = new EventDelegate(delegate - { - passwordSettingDialog.SetButtonDisable(string.IsNullOrEmpty(firstInput.value) || string.IsNullOrEmpty(secondInput.value) || !passwordSettingObject._acceptToggle.GetValue()); - }); - UIInputWizard[] array = new UIInputWizard[2] { firstInput, secondInput }; - foreach (UIInputWizard input in array) - { - EventDelegate item = new EventDelegate(delegate - { - InputDialog.TextInputLimitCheck(input.characterLimit); - }); - input.onChange.Add(eventDelegate); - input.onSubmit.Add(item); - input.onDeselect.Add(item); - } - passwordSettingObject._privacyPolicyButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.PRIVACY_POLICY); - })); - ItemToggle acceptToggle = passwordSettingObject._acceptToggle; - acceptToggle.SetValue(value: false); - acceptToggle.AddChangeCallback(eventDelegate); - passwordSettingDialog.SetSize(DialogBase.Size.M); - passwordSettingDialog.SetTitleLabel(text.Get("Account_0101")); - passwordSettingDialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - passwordSettingDialog.SetButtonText(text.Get("Account_0103")); - passwordSettingDialog.SetButtonDisable(isEnableOK: true); - passwordSettingDialog.isNotCloseWindowButton1 = true; - passwordSettingDialog.onPushButton1 = delegate - { - if (!CheckDataLinkPassword(firstInput.value, secondInput.value)) - { - passwordSettingObject.ResetInputValue(); - DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(); - dialogBase2.SetPanelDepth(passwordSettingAccountBase.GetComponent().depth + 5); - dialogBase2.SetTitleLabel(text.Get("Account_0101")); - dialogBase2.SetText(text.Get("Account_0107")); - dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } - else - { - passwordSettingDialog.Close(); - UpdatePassword(firstInput.value); - } - }; - }; - } - - private static void UpdatePassword(string password) - { - SystemText text = Data.SystemText; - CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - string parameter = Cryptographer.MakeMd5(password); - PublistTransitionCode publistTransitionCode = new PublistTransitionCode(); - publistTransitionCode.SetParameter(parameter); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(publistTransitionCode, delegate - { - GameStartCheckTask.IsSetTransitionPassword = true; - GameMgr.GetIns().GetPrefabMgr().Load("UI/layoutParts/Dialog/PasswordConfirm"); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - NguiObjs component = NGUITools.AddChild(dialogBase.gameObject, GameMgr.GetIns().GetPrefabMgr().Get("UI/layoutParts/Dialog/PasswordConfirm")).GetComponent(); - component.labels[0].text = text.Get("Account_0108"); - component.labels[1].text = text.Get("Account_0109"); - component.labels[2].text = text.Get("Profile_0008") + ": " + VideoHostingUtil.GetUserIDHidden($"{PlayerStaticData.UserViewerID:#,0}".Replace(",", " ")); - component.labels[3].text = text.Get("Account_0110"); - component.labels[4].text = text.Get("Profile_0009"); - component.buttons[0].onClick.Add(new EventDelegate(delegate - { - NativePluginWrapper.SetStringToClipboard(PlayerStaticData.UserViewerID.ToString()); - DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(); - dialogBase2.SetPanelDepth(100); - dialogBase2.SetSize(DialogBase.Size.S); - dialogBase2.SetText(text.Get("Profile_0015")); - dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - })); - })); - })); - } - - private bool CheckDataLinkPassword(string firstPass, string secondPass) - { - if (firstPass != secondPass) - { - return false; - } - if (firstPass.Length < 8 || 16 < firstPass.Length) - { - return false; - } - int num = 0; - int num2 = 0; - int num3 = 0; - foreach (char c in firstPass) - { - if ('0' <= c && c <= '9') - { - num++; - continue; - } - if ('a' <= c && c <= 'z') - { - num2++; - continue; - } - if ('A' <= c && c <= 'Z') - { - num3++; - continue; - } - return false; - } - if (num <= 0 || num2 <= 0 || num3 <= 0) - { - return false; - } - return true; - } - - private int GetActiveChildCount(Transform parent) - { - int num = 0; - for (int i = 0; i < parent.childCount; i++) - { - if (parent.GetChild(i).gameObject.activeSelf) - { - num++; - } - } - return num; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AchievementImpl.cs b/SVSim.BattleEngine/Engine/Wizard/AchievementImpl.cs index 76050a60..9d758032 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AchievementImpl.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AchievementImpl.cs @@ -31,14 +31,6 @@ public class AchievementImpl : MonoBehaviour BSP10, BSP25, BSP40, - ARISA_CLR, - ERIKA_CLR, - ISABELLE_CLR, - ROWEN_CLR, - LUNA_CLR, - URIAS_CLR, - ERIS_CLR, - ALLSTORY_CLR, RANK_D, RANK_C, RANK_B, @@ -52,14 +44,6 @@ public class AchievementImpl : MonoBehaviour { private bool _bShowAchievementAfterSignIn; - public bool bShowAchievementAfterSignIn - { - set - { - _bShowAchievementAfterSignIn = value; - } - } - public void OnSignIn(bool success) { if (success) @@ -109,20 +93,6 @@ public class AchievementImpl : MonoBehaviour "CgkIz8_azvQHEAIQHw", "CgkIz8_azvQHEAIQIA", "CgkIz8_azvQHEAIQIQ", "CgkIz8_azvQHEAIQJA", "CgkIz8_azvQHEAIQJQ", "CgkIz8_azvQHEAIQJg" }; - private const int LEVEL_10 = 10; - - private const int LEVEL_25 = 25; - - private const int LEVEL_40 = 40; - - private const int RANK_ID_D0 = 5; - - private const int RANK_ID_C0 = 9; - - private const int RANK_ID_B0 = 13; - - private const int RANK_ID_A0 = 17; - private bool mIsSignIn; private AchievementCallbackImpl mCallbackImpl; @@ -144,64 +114,6 @@ public class AchievementImpl : MonoBehaviour instance = this; } - public void SignIn(Action callback = null) - { - if (mCallbackImpl != null) - { - mCallbackImpl.bShowAchievementAfterSignIn = false; - } - StartCoroutine(SocialServiceUtility.Instance.SignIn(delegate(bool success) - { - if (mCallbackImpl != null) - { - mCallbackImpl.OnSignIn(success); - } - if (callback != null) - { - callback(success); - } - })); - } - - public void SignOut(Action callback = null) - { - SocialServiceUtility.Instance.SignOut(delegate - { - if (mCallbackImpl != null) - { - mCallbackImpl.OnSignOut(); - } - if (callback != null) - { - callback(); - } - }); - mIsSignIn = false; - } - - public void ShowAchievements(Action callback = null) - { - if (mCallbackImpl != null) - { - mCallbackImpl.bShowAchievementAfterSignIn = true; - } - StartCoroutine(SocialServiceUtility.Instance.SignIn(delegate(bool success) - { - if (success) - { - ReleaseAchievementShouldBeReleased(); - } - if (mCallbackImpl != null) - { - mCallbackImpl.OnSignIn(success); - } - if (callback != null) - { - callback(success); - } - })); - } - public void ReleaseAchievement(eAchievementID id) { if (mIsSignIn) @@ -223,7 +135,7 @@ public class AchievementImpl : MonoBehaviour { for (int i = 1; i < 9; i++) { - ClassCharaPrm classPrm = GameMgr.GetIns().GetDataMgr().GetClassPrm(i); + ClassCharaPrm classPrm = null; // Pre-Phase-5b: no class prm headless Dictionary achievementIDsByClass = getAchievementIDsByClass((CardBasePrm.ClanType)i); int classCharaLv = classPrm.GetClassCharaLv(); if (classCharaLv >= 10) diff --git a/SVSim.BattleEngine/Engine/Wizard/ActivateCountTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/ActivateCountTagCollection.cs index c833f9e7..446413b3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ActivateCountTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ActivateCountTagCollection.cs @@ -91,24 +91,6 @@ public class ActivateCountTagCollection : TagCollection } } - public ulong GetTagHash(int index) - { - if (_duplicateTagHashList == null || index < 0 || index >= _duplicateTagHashList.Count) - { - return 0uL; - } - return _duplicateTagHashList[index]; - } - - public bool IsRegistedTagHash(ulong hash) - { - if (_duplicateTagHashList == null) - { - return false; - } - return _duplicateTagHashList.Contains(hash); - } - private ulong CalcDuplicateTagHash(AIPlayTag ownerTag, int duplicateIndex) { return ownerTag.Hash + (ulong)((long)duplicateIndex * 3457L); diff --git a/SVSim.BattleEngine/Engine/Wizard/AdjustSendSettingDialog.cs b/SVSim.BattleEngine/Engine/Wizard/AdjustSendSettingDialog.cs deleted file mode 100644 index 1b0fd1e0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AdjustSendSettingDialog.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class AdjustSendSettingDialog : MonoBehaviour -{ - [SerializeField] - private UIToggle _toggle; - - private bool _firstToggleCall = true; - - public Action OnChange; - - public static AdjustSendSettingDialog Create(GameObject prefab) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - SystemText systemText = Data.SystemText; - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetTitleLabel(systemText.Get("MyPage_0072")); - dialogBase.SetText(systemText.Get("MyPage_0073")); - dialogBase.SetSize(DialogBase.Size.M); - AdjustSendSettingDialog component = UnityEngine.Object.Instantiate(prefab).GetComponent(); - dialogBase.SetObj(component.gameObject); - return component; - } - - private void Start() - { - _toggle.value = Data.Load.data._userConfig.ArrowAdjustSend; - _toggle.onChange.Add(new EventDelegate(delegate - { - OnChangeToggle(); - })); - } - - private void OnChangeToggle() - { - if (!_firstToggleCall) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - OnChange.Call(_toggle.value); - } - _firstToggleCall = false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AdjustSettingUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/AdjustSettingUpdateTask.cs deleted file mode 100644 index d9b54c57..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/AdjustSettingUpdateTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class AdjustSettingUpdateTask : BaseTask -{ - public class TaskParam : BaseParam - { - public int is_allow_send_adjust; - } - - public AdjustSettingUpdateTask() - { - base.type = ApiType.Type.AdjustSettingUpdate; - } - - public void SetParameter(bool arrow) - { - TaskParam taskParam = new TaskParam(); - taskParam.is_allow_send_adjust = (arrow ? 1 : 0); - base.Params = taskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AfterDiscardTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/AfterDiscardTagCollection.cs index 10762dfe..a5d4679b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AfterDiscardTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AfterDiscardTagCollection.cs @@ -88,9 +88,4 @@ public class AfterDiscardTagCollection : TagCollection } return num; } - - public static bool IsAfterDiscardTagType(AIPlayTagType type) - { - return _managedTagTypes.Contains(type); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AllLabelColorChanger.cs b/SVSim.BattleEngine/Engine/Wizard/AllLabelColorChanger.cs index f702409d..d18be69f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AllLabelColorChanger.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AllLabelColorChanger.cs @@ -113,8 +113,6 @@ public class AllLabelColorChanger } }; - private static Dictionary COLOR_TABLE_BINGO = new Dictionary(); - private static Dictionary COLOR_TABLE_BINGO_BUTTON = new Dictionary { { @@ -157,10 +155,7 @@ public class AllLabelColorChanger { colorDict = COLOR_TABLE_DETAIL; } - if (root.GetComponent() != null) - { - colorDict = COLOR_TABLE_BINGO; - } + // BingoPage removed (DEAD-COLD engine cleanup Task 12) if (colorDict == COLOR_TABLE_DETAIL && (root.name == "CardTexture" || root.name == "CardText")) { return; diff --git a/SVSim.BattleEngine/Engine/Wizard/AreaSelectClearReward.cs b/SVSim.BattleEngine/Engine/Wizard/AreaSelectClearReward.cs index 5c9633b2..1c656bcb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AreaSelectClearReward.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AreaSelectClearReward.cs @@ -51,10 +51,6 @@ internal class AreaSelectClearReward : MonoBehaviour private readonly Quaternion CARDOBJECT_ROTATION_QUATERNION = new Quaternion(0f, 0f, 0f, 0f); - private const int MASK_DEPTHOFFSET_FROM_FRAME = -1; - - private const int CARD_DEPTHOFFSET_FROM_FRAME = -2; - private readonly Color32 ACQUIRED_GRAY_COLOR = new Color32(144, 144, 144, byte.MaxValue); private readonly Vector3 DEFAULT_NUM_POSITION = new Vector3(48f, -25f, 0f); diff --git a/SVSim.BattleEngine/Engine/Wizard/ArenaBuyDialog.cs b/SVSim.BattleEngine/Engine/Wizard/ArenaBuyDialog.cs deleted file mode 100644 index 31ffa5ef..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ArenaBuyDialog.cs +++ /dev/null @@ -1,131 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class ArenaBuyDialog : MonoBehaviour -{ - [SerializeField] - private UISprite m_SpriteConfirmClystal; - - [SerializeField] - private UISprite m_SpriteHaveClystal; - - [SerializeField] - private UISprite m_SpriteConfirmRupy; - - [SerializeField] - private UISprite m_SpriteHaveRupy; - - [SerializeField] - private UISprite m_SpriteConfirmTicket; - - [SerializeField] - private UISprite m_SpriteHaveTicket; - - [SerializeField] - private UILabel m_LabelUseItemCnt; - - [SerializeField] - private UILabel m_LabelBuyPack; - - [SerializeField] - private UILabel m_LabelItemName; - - [SerializeField] - private UILabel m_LabelBeforeItemCnt; - - [SerializeField] - private UILabel m_LabelAfterItemCnt; - - [SerializeField] - private GameObject _jpnLawRoot; - - [SerializeField] - private UIButton _jpnLawButton; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private GameObject _scrollBar; - - [SerializeField] - private UILabel _expirtyTextLabel; - - public void SetClystalConfirmDialog(int useItemNum, int haveItemCnt, string arenaModeNameId, ShopExpirtyInfo expirtyInfo) - { - m_SpriteConfirmClystal.gameObject.SetActive(value: true); - m_SpriteHaveClystal.gameObject.SetActive(value: true); - m_SpriteConfirmRupy.gameObject.SetActive(value: false); - m_SpriteHaveRupy.gameObject.SetActive(value: false); - m_SpriteConfirmTicket.gameObject.SetActive(value: false); - m_SpriteHaveTicket.gameObject.SetActive(value: false); - int num = haveItemCnt - useItemNum; - string useItemNumText = Data.SystemText.Get("Shop_0091", useItemNum.ToString()); - string afterItemNum = Data.SystemText.Get("Shop_0055", num.ToString()); - SetLabelText(Data.SystemText.Get("Common_0201"), useItemNumText, afterItemNum, haveItemCnt, arenaModeNameId); - _jpnLawButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.LEGALTEXT); - })); - if (expirtyInfo.IsEnableText) - { - _expirtyTextLabel.text = expirtyInfo.GetText(); - } - else - { - _expirtyTextLabel.gameObject.SetActive(value: false); - } - _jpnLawRoot.SetActive(value: false); - } - - private void HideScrollBar() - { - _scrollView.enabled = false; - _scrollBar.SetActive(value: false); - _jpnLawRoot.SetActive(value: false); - } - - public void SetTicketConfirmDialog(int useItemNum, int haveItemCnt, string arenaModeNameId, string ticketSpriteName) - { - m_SpriteConfirmClystal.gameObject.SetActive(value: false); - m_SpriteHaveClystal.gameObject.SetActive(value: false); - m_SpriteConfirmRupy.gameObject.SetActive(value: false); - m_SpriteHaveRupy.gameObject.SetActive(value: false); - m_SpriteConfirmTicket.gameObject.SetActive(value: true); - m_SpriteHaveTicket.gameObject.SetActive(value: true); - m_SpriteConfirmTicket.spriteName = ticketSpriteName; - m_SpriteHaveTicket.spriteName = ticketSpriteName; - int num = haveItemCnt - useItemNum; - string useItemNumText = Data.SystemText.Get("Shop_0042", useItemNum.ToString()); - string afterItemNum = Data.SystemText.Get("Shop_0054", num.ToString()); - SetLabelText(Data.SystemText.Get("Common_0114"), useItemNumText, afterItemNum, haveItemCnt, arenaModeNameId); - HideScrollBar(); - } - - public void SetRupyConfirmDialog(int useItemNum, int haveItemCnt, string arenaModeNameId) - { - m_SpriteConfirmClystal.gameObject.SetActive(value: false); - m_SpriteHaveClystal.gameObject.SetActive(value: false); - m_SpriteConfirmRupy.gameObject.SetActive(value: true); - m_SpriteHaveRupy.gameObject.SetActive(value: true); - m_SpriteConfirmTicket.gameObject.SetActive(value: false); - m_SpriteHaveTicket.gameObject.SetActive(value: false); - int num = haveItemCnt - useItemNum; - string useItemNumText = Data.SystemText.Get("Shop_0090", useItemNum.ToString()); - string afterItemNum = Data.SystemText.Get("Shop_0056", num.ToString()); - SetLabelText(Data.SystemText.Get("Common_0115"), useItemNumText, afterItemNum, haveItemCnt, arenaModeNameId); - HideScrollBar(); - } - - private void SetLabelText(string itemName, string useItemNumText, string afterItemNum, int haveItemCnt, string arenaModeNameId) - { - SystemText systemText = Data.SystemText; - m_LabelUseItemCnt.text = useItemNumText; - m_LabelBuyPack.text = systemText.Get(arenaModeNameId); - m_LabelItemName.text = itemName; - m_LabelBeforeItemCnt.text = haveItemCnt.ToString(); - m_LabelAfterItemCnt.text = afterItemNum; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobby.cs b/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobby.cs index c49b817b..40655fff 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobby.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobby.cs @@ -33,26 +33,6 @@ public class ArenaCommonLobby : MonoBehaviour [SerializeField] private UILabel _decisionButtonLabel; - private const ResourcesManager.AssetLoadPathType CHARA_TEXTURE_TYPE = ResourcesManager.AssetLoadPathType.ClassCharaBase; - - private const iTween.EaseType MOVE_EASE_TYPE = iTween.EaseType.easeOutExpo; - - private const float CHARA_MOVE_DIST = 4.6875f; - - private const float CHARA_MOVE_TIME = 0.5f; - - private const float MAIN_OBJECT_MOVE_DIST = 2.8125f; - - private const float MAIN_OBJECT_MOVE_TIME = 0.5f; - - private const float MAIN_OBJECT_MOVE_DELAY = 0.2f; - - private const float BUTTON_MOVE_DIST = 1.5625f; - - private const float BUTTON_MOVE_TIME = 0.5f; - - private const float BUTTON_MOVE_DELAY = 0.5f; - private List _unloadAssetList = new List(); private GameObject _decisionButtonEffect; @@ -102,8 +82,7 @@ public class ArenaCommonLobby : MonoBehaviour List loadAssetList = new List(); List loadEndCallbackList = new List(); ResourcesManager resMgr = Toolbox.ResourcesManager; - string strSkinId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(initParam.ClassId) - .skin_id.ToString(); + string strSkinId = "0"; // Pre-Phase-5b: no chara master headless loadAssetList.Add(resMgr.GetAssetTypePath(strSkinId, ResourcesManager.AssetLoadPathType.ClassCharaBase)); loadAssetList.Add(resMgr.GetAssetTypePath("cmn_ui_btn_1", ResourcesManager.AssetLoadPathType.Effect2D)); ArenaCommonLobbyLoadRequest arenaCommonLobbyLoadRequest = _battleInfo.Init(initParam, _unloadAssetList); @@ -151,7 +130,7 @@ public class ArenaCommonLobby : MonoBehaviour { yield return null; } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_WINDOW_MOVE); + iTween.MoveTo(_charaTexture.gameObject, iTween.Hash("position", _charaInitPos, "time", 0.5f, "islocal", false, "easetype", iTween.EaseType.easeOutExpo)); iTween.MoveTo(_mainObjectRoot, iTween.Hash("position", _mainObjectInitPos, "time", 0.5f, "delay", 0.2f, "islocal", false, "easetype", iTween.EaseType.easeOutExpo)); iTween.MoveTo(_decisionButton.gameObject, iTween.Hash("position", _buttonInitPos, "time", 0.5f, "delay", 0.5f, "islocal", false, "easetype", iTween.EaseType.easeOutExpo)); diff --git a/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyBattleStateObject.cs b/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyBattleStateObject.cs index 3fadf0b7..51033ca4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyBattleStateObject.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyBattleStateObject.cs @@ -9,9 +9,7 @@ public class ArenaCommonLobbyBattleStateObject : MonoBehaviour None, Won, Lost, - Next, - Max - } + Next } [SerializeField] private GameObject _nextBattleMark; diff --git a/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyTreasureBoxInfo.cs b/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyTreasureBoxInfo.cs index 98ed6e68..bc30afe6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyTreasureBoxInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ArenaCommonLobbyTreasureBoxInfo.cs @@ -25,12 +25,6 @@ public class ArenaCommonLobbyTreasureBoxInfo : MonoBehaviour [SerializeField] private UISprite _nextBoxSprite; - private const float MOVE_TIME = 0.5f; - - private const float OPEN_ANIMATION_START_TIME = 0.8f; - - private const float OPEN_ANIMATION_TIME = 1.5f; - private GameObject _openEffect; private Vector3 _backupNowBoxPos = Vector3.zero; @@ -70,7 +64,7 @@ public class ArenaCommonLobbyTreasureBoxInfo : MonoBehaviour private IEnumerator OpenBoxCoroutine(Action animationEndCallback) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_BOX_OPEN); + _backupNowBoxPos = _nowBoxSprite.transform.position; _backupNextBoxRootActive = _nextBoxRoot.activeSelf; _nowBoxTitleRoot.SetActive(value: false); diff --git a/SVSim.BattleEngine/Engine/Wizard/ArenaConfigDialog.cs b/SVSim.BattleEngine/Engine/Wizard/ArenaConfigDialog.cs deleted file mode 100644 index c5166738..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ArenaConfigDialog.cs +++ /dev/null @@ -1,235 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ArenaConfigDialog : MonoBehaviour -{ - [SerializeField] - private UITexture[] _sleeveTextureListTwoPick; - - [SerializeField] - private UIButton _sleeveChangeButtonTwoPick; - - [SerializeField] - private UIToggle _usePremiumCardToggleTwoPick; - - [SerializeField] - private FilteringSleeveSelection _sleeveSelectionPrefab; - - private const int SLEEVE_SELECTION_DIALOG_DEPTH = 400; - - private const long INVALID_SLEEVE_ID = -1L; - - private List _loadedSleeveIdList = new List(); - - private List _loadedSleeveTexturePathList = new List(); - - private FilteringImageSelection _sleeveSelection; - - private long _oldSleeveId = -1L; - - private bool _startUsePremiumCardToggleTwoPick; - - private bool _isFirstToggleChange = true; - - public void Initialize() - { - UIManager.GetInstance().createInSceneCenterLoading(); - bool twoPickSleeveLoading = true; - UIEventListener.Get(_sleeveChangeButtonTwoPick.gameObject).onClick = OnClickSleeveChangeButtonTwoPick; - _isFirstToggleChange = true; - _usePremiumCardToggleTwoPick.value = Data.Load.data._challengeConfig.UseTwoPickPremiumCard; - _usePremiumCardToggleTwoPick.onChange.Add(new EventDelegate(OnChangePremiumCardToggle)); - _startUsePremiumCardToggleTwoPick = Data.Load.data._challengeConfig.UseTwoPickPremiumCard; - UIManager.SetObjectToGrey(_usePremiumCardToggleTwoPick.gameObject, Data.ArenaData.TwoPickData.isJoin); - LoadSleeve(GetCurrentSleeveId(DataMgr.BattleType.ColosseumTwoPick), delegate - { - StartCoroutine(UpdateSleeveTexture(DataMgr.BattleType.ColosseumTwoPick)); - twoPickSleeveLoading = false; - if (!twoPickSleeveLoading) - { - UIManager.GetInstance().closeInSceneCenterLoading(); - } - }); - InitSleeveSelection(); - } - - public void Final() - { - if (_startUsePremiumCardToggleTwoPick != Data.Load.data._challengeConfig.UseTwoPickPremiumCard) - { - ArenaConfigUpdateTask arenaConfigUpdateTask = new ArenaConfigUpdateTask(); - arenaConfigUpdateTask.SetParameter(Data.Load.data._challengeConfig.UseTwoPickPremiumCard, Data.Load.data._challengeConfig.TwoPickSleeveId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(arenaConfigUpdateTask)); - } - UnloadAllSleeves(); - } - - private void OnClickSleeveChangeButtonTwoPick(GameObject g) - { - OnClickSleeveChangeButton(DataMgr.BattleType.ColosseumTwoPick); - } - - private void OnClickSleeveChangeButton(DataMgr.BattleType type) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OpenSleeveSelectionDialog(type); - } - - private void OnChangePremiumCardToggle() - { - if (!_isFirstToggleChange) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_usePremiumCardToggleTwoPick.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - _isFirstToggleChange = false; - Data.Load.data._challengeConfig.UseTwoPickPremiumCard = _usePremiumCardToggleTwoPick.value; - } - - private void LoadSleeve(long sleeveId, Action onFinish = null) - { - List first = CollectSleeveResourcePaths(sleeveId); - List loadPathList = first.Except(_loadedSleeveTexturePathList).ToList(); - if (loadPathList.Count == 0) - { - onFinish.Call(); - return; - } - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, delegate - { - _loadedSleeveIdList.Add(sleeveId); - _loadedSleeveTexturePathList.AddRange(loadPathList); - onFinish.Call(); - })); - } - - private void UnloadAllSleeves() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedSleeveTexturePathList); - _loadedSleeveIdList.Clear(); - _loadedSleeveTexturePathList.Clear(); - } - - private List CollectSleeveResourcePaths(long sleeveId) - { - sleeveId = Toolbox.ResourcesManager.GetExistingSleeveId(sleeveId); - string path = sleeveId.ToString(); - List loadPath = new List(); - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.SleeveTexture)); - Sleeve sleeve = Data.Master.SleeveMgr.Get(sleeveId); - if (sleeve.IsPremiumSleeve) - { - UIManager.GetInstance().getUIBase_CardManager().AddPremireSleevePath(ref loadPath, sleeve); - } - return loadPath; - } - - private void InitSleeveSelection() - { - _sleeveSelection = NGUITools.AddChild(base.gameObject, _sleeveSelectionPrefab.gameObject).GetComponent(); - _sleeveSelection.gameObject.SetActive(value: false); - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - List acquiredList = Data.Master.SleeveMgr.GetAcquiredList(); - List list = Data.Master.SleeveCategoryIdDic.Values.OrderBy((SleeveCategory category) => category.Id).ToList(); - _sleeveSelection.Initialize(acquiredList.Count, list.Count); - foreach (SleeveCategory item in list) - { - _sleeveSelection.AddSeries(item.Id, item.Name); - } - foreach (Sleeve sleeve in acquiredList) - { - string key = sleeve.sleeve_id.ToString(); - long existingSleeveId = Toolbox.ResourcesManager.GetExistingSleeveId(sleeve.sleeve_id); - Sleeve sleeve2 = Data.Master.SleeveMgr.Get(existingSleeveId); - List loadPath = new List(); - loadPath.Add(resourcesManager.GetAssetTypePath(existingSleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - if (sleeve2.IsPremiumSleeve) - { - UIManager.GetInstance().getUIBase_CardManager().AddPremireSleevePath(ref loadPath, sleeve2); - } - _sleeveSelection.AddItem(key, sleeve._categoryId, isSelectable: true, loadPath, null, isDisplaySprite: false, sleeve.sleeve_name, null, () => sleeve.IsNew, delegate - { - Data.Master.SleeveMgr.UnsetNew(sleeve.sleeve_id); - }, null, null, sleeve.IsFavorite); - } - } - - private void OpenSleeveSelectionDialog(DataMgr.BattleType type) - { - _oldSleeveId = GetCurrentSleeveId(type); - _sleeveSelection.SelectItemWithKey(GetCurrentSleeveId(type).ToString()); - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = DialogBase.CreateFilteringImageSelectionDialog(_sleeveSelection, "Card_0146"); - dialogBase.SetPanelDepth(400); - dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate - { - if (long.TryParse(_sleeveSelection.GetSelectedItemKey(), out var id) && id != _oldSleeveId) - { - LoadSleeve(id); - SleeveConfigUpdate(type, id, delegate(NetworkTask.ResultCode code) - { - OnSuccessChangeSleeve(code, type, id); - }); - } - }); - } - - private void SleeveConfigUpdate(DataMgr.BattleType type, long id, Action callBack = null) - { - ArenaConfigUpdateTask arenaConfigUpdateTask = new ArenaConfigUpdateTask(); - long useChallenge2pickSleeveId = ((type == DataMgr.BattleType.ColosseumTwoPick) ? id : Data.Load.data._challengeConfig.TwoPickSleeveId); - arenaConfigUpdateTask.SetParameter(Data.Load.data._challengeConfig.UseTwoPickPremiumCard, useChallenge2pickSleeveId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(arenaConfigUpdateTask, callBack)); - } - - private void OnSuccessChangeSleeve(NetworkTask.ResultCode code, DataMgr.BattleType type, long id) - { - SetCurrentSleeveId(type, id); - StartCoroutine(UpdateSleeveTexture(type)); - } - - private IEnumerator UpdateSleeveTexture(DataMgr.BattleType battleType) - { - long sleeveId = GetCurrentSleeveId(battleType); - while (!_loadedSleeveIdList.Contains(sleeveId)) - { - yield return null; - } - UITexture[] currentSleeveTextureList = GetCurrentSleeveTextureList(battleType); - for (int i = 0; i < currentSleeveTextureList.Length; i++) - { - UIManager.GetInstance().getUIBase_CardManager().SetSleeveTextureWithoutPremium(currentSleeveTextureList[i], sleeveId); - } - } - - private long GetCurrentSleeveId(DataMgr.BattleType battleType) - { - if (battleType == DataMgr.BattleType.ColosseumTwoPick) - { - return Data.Load.data._challengeConfig.TwoPickSleeveId; - } - return -1L; - } - - private void SetCurrentSleeveId(DataMgr.BattleType battleType, long sleeveId) - { - if (battleType == DataMgr.BattleType.ColosseumTwoPick) - { - Data.Load.data._challengeConfig.TwoPickSleeveId = sleeveId; - } - } - - private UITexture[] GetCurrentSleeveTextureList(DataMgr.BattleType battleType) - { - if (battleType == DataMgr.BattleType.ColosseumTwoPick) - { - return _sleeveTextureListTwoPick; - } - return null; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ArenaConfigUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/ArenaConfigUpdateTask.cs deleted file mode 100644 index 7b59da9c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ArenaConfigUpdateTask.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Wizard; - -public class ArenaConfigUpdateTask : BaseTask -{ - public class ArenaConfigUpdateTaskParam : BaseParam - { - public int use_challenge_two_pick_premium_card; - - public long challenge_two_pick_sleeve_id; - } - - public ArenaConfigUpdateTask() - { - base.type = ApiType.Type.ArenaConfigUpdate; - } - - public void SetParameter(bool useChallenge2pickPremiumCard, long useChallenge2pickSleeveId) - { - ArenaConfigUpdateTaskParam arenaConfigUpdateTaskParam = new ArenaConfigUpdateTaskParam(); - arenaConfigUpdateTaskParam.use_challenge_two_pick_premium_card = (useChallenge2pickPremiumCard ? 1 : 0); - arenaConfigUpdateTaskParam.challenge_two_pick_sleeve_id = useChallenge2pickSleeveId; - base.Params = arenaConfigUpdateTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/AttachedSkillInfoReceiveDataCollection.cs b/SVSim.BattleEngine/Engine/Wizard/AttachedSkillInfoReceiveDataCollection.cs index 02b34dfa..bf5bfbe9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AttachedSkillInfoReceiveDataCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AttachedSkillInfoReceiveDataCollection.cs @@ -11,11 +11,6 @@ public class AttachedSkillInfoReceiveDataCollection InfoList = new List(); } - public void AddInfo(AttachedSkillInfoReceiveData info) - { - InfoList.Add(info); - } - public void Clear() { InfoList.Clear(); diff --git a/SVSim.BattleEngine/Engine/Wizard/AvatarAbilityDetailDialog.cs b/SVSim.BattleEngine/Engine/Wizard/AvatarAbilityDetailDialog.cs index c58d1b4c..e42eb9e8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AvatarAbilityDetailDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AvatarAbilityDetailDialog.cs @@ -10,15 +10,6 @@ namespace Wizard; public class AvatarAbilityDetailDialog : MonoBehaviour { - private const int KEYWORD_DIALOG_DEPTH = 20; - - private const int KEYWORD_PANEL_DEPTH = 25; - - private const int TEXT_COLLIDER_HEIGHT_OFFSET = 22; - - private const float PASSIVE_TEXT_OFFSET = 140f; - - private const int DEFAULT_LABEL_HEIGHT = 60; [SerializeField] private UITexture _characterTexture; @@ -102,7 +93,7 @@ public class AvatarAbilityDetailDialog : MonoBehaviour private IEnumerator SetResources() { - ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(_deckData.GetSkinId()); + ClassCharacterMasterData charaPrmByCharaId = null; // Pre-Phase-5b: no chara master headless InitializeClassCharacter(_deckData.GetSkinId()); InitializeDescLabel(_avatarBattleInfo); _characterName.text = charaPrmByCharaId.chara_name; @@ -199,7 +190,7 @@ public class AvatarAbilityDetailDialog : MonoBehaviour { if (HasKeyword(abilityText)) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + IList keywords = BattleKeywordInfoListMgr.GetKeywords(abilityText); _keywordDialog = BattlePlayerView.CreateKeyPanel(textLabel, keywords, CardMaster.CardMasterId.Default); _keywordDialog.SetPanelDepth(20, isSetBackViewDepthImmediately: true); @@ -222,26 +213,6 @@ public class AvatarAbilityDetailDialog : MonoBehaviour return result; } - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadList); - _loadList.Clear(); - } - - public static bool LiveDialog() - { - return _avatarAbilityDialog != null; - } - - public static void CloseDialog() - { - _avatarAbilityDialog.Close(); - if (_keywordDialog != null) - { - _keywordDialog.Close(); - } - } - private IEnumerator LoadResources(int skinId, Action callBack) { _loadList.Add(GetCharacterTexturePath(skinId, isFetch: false)); diff --git a/SVSim.BattleEngine/Engine/Wizard/AvatarBattleAllInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AvatarBattleAllInfo.cs index 03e91058..7a9b4a47 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AvatarBattleAllInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AvatarBattleAllInfo.cs @@ -9,9 +9,6 @@ public class AvatarBattleAllInfo { public class PeriodData { - public DateTime BeginTime = DateTime.MaxValue; - - public DateTime EndTime = DateTime.MinValue; public double StartUnixTime { get; set; } @@ -22,50 +19,14 @@ public class AvatarBattleAllInfo public PeriodData FreeMatchPeriod = new PeriodData(); - public PeriodData GatheringPeriod = new PeriodData(); - private bool _avatarBattleScheduleExist; private float _receiveSinceTime; private double _receiveServerUnixTime; - public List AvatarBattleInfoList { get; } = new List(); - public bool IsWithinFreeMatchPeriod => IsWithinPeriod(FreeMatchPeriod); - public bool IsWithinGatheringPeriod => IsWithinPeriod(GatheringPeriod); - - public void Parse(JsonData json, JsonData headerData) - { - JsonData jsonData = json["abilities"]; - foreach (string key in jsonData.Keys) - { - AvatarBattleInfo avatarBattleInfo = new AvatarBattleInfo(jsonData[key]); - _avatarBattleDictionary[avatarBattleInfo.LeaderSkinId] = avatarBattleInfo; - avatarBattleInfo.SetAbility(jsonData[avatarBattleInfo.LeaderSkinId]); - AvatarBattleInfoList.Add(avatarBattleInfo); - } - JsonData jsonData2 = json["schedules"]; - if (jsonData2.IsObject) - { - if (jsonData2.TryGetValue("free_battle", out var value)) - { - SetPeriodData(FreeMatchPeriod, value); - _avatarBattleScheduleExist = true; - _receiveSinceTime = Time.realtimeSinceStartup; - _receiveServerUnixTime = headerData["servertime"].ToDouble(); - } - if (jsonData2.TryGetValue("gathering", out var value2)) - { - SetPeriodData(GatheringPeriod, value2); - _avatarBattleScheduleExist = true; - _receiveSinceTime = Time.realtimeSinceStartup; - _receiveServerUnixTime = headerData["servertime"].ToDouble(); - } - } - } - public AvatarBattleInfo Get(string id) { if (string.IsNullOrEmpty(id)) @@ -79,14 +40,6 @@ public class AvatarBattleAllInfo return null; } - private void SetPeriodData(PeriodData period, JsonData jsonData) - { - period.BeginTime = DateTime.Parse(jsonData["begin_time"].ToString()); - period.EndTime = DateTime.Parse(jsonData["end_time"].ToString()); - period.StartUnixTime = ConvertTime.DateTimeToUnixTime(DateTime.Parse(jsonData["begin_time"].ToString())); - period.EndUnixTime = ConvertTime.DateTimeToUnixTime(DateTime.Parse(jsonData["end_time"].ToString())); - } - private bool IsWithinPeriod(PeriodData period) { if (!_avatarBattleScheduleExist) diff --git a/SVSim.BattleEngine/Engine/Wizard/AvatarBattleInfo.cs b/SVSim.BattleEngine/Engine/Wizard/AvatarBattleInfo.cs index ab70fb04..4e887976 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AvatarBattleInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AvatarBattleInfo.cs @@ -46,9 +46,4 @@ public class AvatarBattleInfo { LeaderSkinId = json["leader_skin_id"].ToString(); } - - public void SetAbility(JsonData json) - { - Bonus = new AvatarBattleBonus(json); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/AvatarFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/AvatarFormatBehavior.cs index a6540ba0..4dcd3e89 100644 --- a/SVSim.BattleEngine/Engine/Wizard/AvatarFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/AvatarFormatBehavior.cs @@ -58,7 +58,7 @@ public class AvatarFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsConventionMode => false; @@ -69,21 +69,21 @@ public class AvatarFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/BGMManager.cs b/SVSim.BattleEngine/Engine/Wizard/BGMManager.cs index a80e2ee8..e88c4e92 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BGMManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BGMManager.cs @@ -2,48 +2,9 @@ namespace Wizard; public class BGMManager { - private Bgm.BGM_TYPE _nextPlayBGM; - - private readonly Bgm.BGM_TYPE[] BATTLE_LIST = new Bgm.BGM_TYPE[2] - { - Bgm.BGM_TYPE.BATTLE, - Bgm.BGM_TYPE.SYS_WIN_LOOP - }; - - private readonly Bgm.BGM_TYPE[] ARENA_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.BATTLE_STANDBY }; - - private readonly Bgm.BGM_TYPE[] COLOSSEUM_FINAL_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.COLOSSEUM_FINAL }; - - private readonly Bgm.BGM_TYPE[] GRAND_PRIX_SPECIAL_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.GRANDPRIX_SPECIAL }; - - private readonly Bgm.BGM_TYPE[] GRAND_PRIX_SPECIAL_FINAL_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.GRANDPRIX_SPECIAL_FINAL }; - - private readonly Bgm.BGM_TYPE[] SEALED_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.SEALED }; - - private readonly Bgm.BGM_TYPE[] QUEST_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.QUEST }; - - private readonly Bgm.BGM_TYPE[] TITLE_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.TITLE }; - - private readonly Bgm.BGM_TYPE[] HOME_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.HOME }; - - private readonly Bgm.BGM_TYPE[] COMPETITION_LOBBY_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.COMPETITION_LOBBY }; - - private readonly Bgm.BGM_TYPE[] BINGO_LIST = new Bgm.BGM_TYPE[1] { Bgm.BGM_TYPE.BINGO }; private static BGMManager _instance; - public static BGMManager Instance - { - get - { - if (_instance == null) - { - _instance = new BGMManager(); - } - return _instance; - } - } - public static void Dispose() { if (_instance != null) @@ -55,95 +16,4 @@ public class BGMManager private BGMManager() { } - - public void RegistBgmByScene(UIManager.ViewScene currentScene, UIManager.ViewScene nextScene, UIManager.ChangeViewSceneParam param) - { - Bgm.BGM_TYPE[] nowBgmList = GetBgmList(currentScene); - Bgm.BGM_TYPE[] bgmList = GetBgmList(nextScene); - if (nowBgmList == bgmList && currentScene != UIManager.ViewScene.Battle && nextScene != UIManager.ViewScene.Battle) - { - return; - } - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - if (bgmList != null) - { - _nextPlayBGM = bgmList[0]; - for (int i = 0; i < bgmList.Length; i++) - { - UIManager.GetInstance().Increment_LockCountChangeView(); - soundMgr.LoadBGM(bgmList[i], delegate - { - UIManager.GetInstance().Decrement_LockCountChangeView(); - }); - } - } - if (nowBgmList == null) - { - return; - } - UIManager.GetInstance().Increment_LockCountChangeView(); - soundMgr.StopBGM(delegate - { - for (int j = 0; j < nowBgmList.Length; j++) - { - soundMgr.UnloadBGM(nowBgmList[j]); - } - UIManager.GetInstance().Decrement_LockCountChangeView(); - }); - } - - public void OnChangeSceneStart() - { - _nextPlayBGM = Bgm.BGM_TYPE.NONE; - } - - public void OnUnLockUIManager() - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(_nextPlayBGM); - } - - private Bgm.BGM_TYPE[] GetBgmList(UIManager.ViewScene scene) - { - switch (scene) - { - case UIManager.ViewScene.Battle: - return BATTLE_LIST; - case UIManager.ViewScene.TwoPick: - return ARENA_LIST; - case UIManager.ViewScene.Sealed: - case UIManager.ViewScene.SealedDeckEdit: - return SEALED_LIST; - case UIManager.ViewScene.QuestSelectionPage: - return QUEST_LIST; - case UIManager.ViewScene.SealedCardPackOpen: - return null; - case UIManager.ViewScene.BossRushLobby: - return GRAND_PRIX_SPECIAL_LIST; - case UIManager.ViewScene.Colosseum: - { - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - if (colosseumData.GetStageNoFromRoundId(colosseumData.Round) == ArenaColosseum.eStageNo.FinalStage) - { - return COLOSSEUM_FINAL_LIST; - } - return ARENA_LIST; - } - case UIManager.ViewScene.Title: - case UIManager.ViewScene.Prologue: - case UIManager.ViewScene.Ending: - case UIManager.ViewScene.LoginBonus: - case UIManager.ViewScene.FreePackCampaign: - return TITLE_LIST; - case UIManager.ViewScene.Scenario: - case UIManager.ViewScene.Scenario2: - return null; - case UIManager.ViewScene.Competition2Pick: - case UIManager.ViewScene.CompetitionLobby: - return COMPETITION_LOBBY_LIST; - case UIManager.ViewScene.Bingo: - return BINGO_LIST; - default: - return HOME_LIST; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/BannerDialog.cs b/SVSim.BattleEngine/Engine/Wizard/BannerDialog.cs index 99b669e0..67f8f9b5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BannerDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BannerDialog.cs @@ -6,9 +6,6 @@ namespace Wizard; public class BannerDialog : MonoBehaviour { - private const float DRAG_DEGREE = 70f; - - private const float AUTO_SCROLL_TIME = 5f; [SerializeField] private UICenterOnChild _uiCenterOnChild; @@ -22,9 +19,6 @@ public class BannerDialog : MonoBehaviour [SerializeField] private UITexture _bannerObj_2; - [SerializeField] - private BoxCollider _flickCollider; - [SerializeField] private BoxCollider _leftButton; @@ -48,38 +42,8 @@ public class BannerDialog : MonoBehaviour private DialogBase _dialog; - private float _autoScrollTimer; - private bool _isCreateEnd; - private void Start() - { - UIEventListener uIEventListener = UIEventListener.Get(_flickCollider.gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDragPanel)); - UIEventListener uIEventListener2 = UIEventListener.Get(_rightButton.gameObject); - uIEventListener2.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onClick, (UIEventListener.VoidDelegate)delegate - { - NextPage(); - }); - UIEventListener uIEventListener3 = UIEventListener.Get(_leftButton.gameObject); - uIEventListener3.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener3.onClick, (UIEventListener.VoidDelegate)delegate - { - PrevPage(); - }); - } - - private void Update() - { - if (_isCreateEnd && _listBannerTexture.Count > 1 && !_isAnimation) - { - _autoScrollTimer += Time.deltaTime; - if (_autoScrollTimer >= 5f) - { - NextPage(); - } - } - } - public void Init(List bannerTextureList, List bannerTitleList, DialogBase dialog) { _listBannerTexture = bannerTextureList; @@ -121,67 +85,6 @@ public class BannerDialog : MonoBehaviour _isAnimation = false; } - private void OnDragPanel(GameObject obj, Vector2 dir) - { - if (!_isAnimation) - { - if (dir.x >= 70f) - { - PrevPage(); - } - else if (dir.x <= -70f) - { - NextPage(); - } - } - } - - private void NextPage() - { - ChangePage(_currentTextureIndex + 1); - } - - private void PrevPage() - { - ChangePage(_currentTextureIndex - 1); - } - - private void ChangePage(int index) - { - if (_currentTextureIndex != index && _listBannerTexture.Count > 1) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - _autoScrollTimer = 0f; - int num = index; - if (_listBannerTexture.Count <= index) - { - num = 0; - } - else if (index < 0) - { - num = _listBannerTexture.Count - 1; - } - UITexture uITexture = ((_currentBannerObj == _bannerObj_1) ? _bannerObj_2 : _bannerObj_1); - Vector3 localPosition = _currentBannerObj.transform.localPosition; - if (_currentTextureIndex > index) - { - localPosition.x -= _widthContentSize; - } - else - { - localPosition.x += _widthContentSize; - } - uITexture.transform.localPosition = localPosition; - uITexture.mainTexture = _listBannerTexture[num]; - _uiCenterOnChild.CenterOn(uITexture.transform); - _isAnimation = true; - _currentTextureIndex = num; - _currentBannerObj = uITexture; - UpdateDialogTitle(num); - UpdateIndicator(_currentTextureIndex); - } - } - private void UpdateDialogTitle(int index) { if (_dialog != null && _bannerTitleList != null) diff --git a/SVSim.BattleEngine/Engine/Wizard/BaseRoomBattleEnterRoomTask.cs b/SVSim.BattleEngine/Engine/Wizard/BaseRoomBattleEnterRoomTask.cs deleted file mode 100644 index 200b465b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BaseRoomBattleEnterRoomTask.cs +++ /dev/null @@ -1,92 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class BaseRoomBattleEnterRoomTask : BaseTask -{ - public int result_reason; - - public int battlePoint; - - public int degreeId; - - public long emblemId; - - public string countryCode; - - public int rank; - - public string userName; - - public int viewerId; - - public bool isFriend; - - public string node_server_url; - - public int HighFormatRank { get; private set; } - - public bool IsOfficialUser { get; set; } - - public BattleParameter BattleParameterInstance { get; private set; } - - public bool IsEnableInviteGuild { get; private set; } - - public bool IsSameGuildMember { get; private set; } - - public bool IsJoinGuildOpponent { get; private set; } - - public bool IsJoinGuildOwn { get; private set; } - - public bool CanUseNonPossessionCard { get; set; } - - public string BattleID { get; private set; } - - public static void GetGuildResponse(JsonData response, out bool isSameGuild, out bool isOpponentJoinGuild, out bool isOwnJoinGuild) - { - int num = response["data"]["guild_id"].ToInt(); - int num2 = response["data"]["oppo_guild_id"].ToInt(); - isSameGuild = num > 0 && num == num2; - isOpponentJoinGuild = num2 > 0; - isOwnJoinGuild = num > 0; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - result_reason = jsonData["result_reason"].ToInt(); - if (result_reason == 0) - { - isFriend = jsonData["is_friend"].ToInt() == 1; - GetGuildResponse(base.ResponseData, out var isSameGuild, out var isOpponentJoinGuild, out var isOwnJoinGuild); - IsSameGuildMember = isSameGuild; - IsJoinGuildOpponent = isOpponentJoinGuild; - IsJoinGuildOwn = isOwnJoinGuild; - JsonData jsonData2 = jsonData["oppo_info"]; - viewerId = jsonData2["oppoId"].ToInt(); - battlePoint = jsonData2["battlePoint"].ToInt(); - degreeId = jsonData2["degreeId"].ToInt(); - emblemId = jsonData2["emblemId"].ToLong(); - countryCode = jsonData2["country_code"].ToString(); - rank = jsonData2["rank"].ToInt(); - HighFormatRank = jsonData2["max_rank"].ToInt(); - userName = jsonData2["userName"].ToString(); - IsOfficialUser = jsonData2["isOfficial"].ToInt() == 1; - BattleParameterInstance = BattleParameter.JsonToBattleParameter(jsonData); - node_server_url = jsonData["node_server_url"].ToString(); - IsEnableInviteGuild = jsonData.GetValueOrDefault("is_invitation_user", defaultValue: false); - CanUseNonPossessionCard = jsonData.GetValueOrDefault("is_enabled_all_card", defaultValue: false); - } - if (jsonData.TryGetValue("battle_id", out var value)) - { - BattleID = value.ToString(); - Data.LastRoomBattleId = BattleID; - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BaseSelectBuyMeansDialog.cs b/SVSim.BattleEngine/Engine/Wizard/BaseSelectBuyMeansDialog.cs index 64efb9f6..5ab82ff4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BaseSelectBuyMeansDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BaseSelectBuyMeansDialog.cs @@ -45,18 +45,6 @@ public abstract class BaseSelectBuyMeansDialog : MonoBehaviour [SerializeField] private UILabel _labelTicketCostNum; - [SerializeField] - private UILabel m_labelRupyHaveName; - - [SerializeField] - private UILabel m_labelCrystalHaveName; - - [SerializeField] - private UILabel m_labelRupyCostName; - - [SerializeField] - private UILabel m_labelCrystalCostName; - [SerializeField] private UILabel m_labelRupyBtnBuy; @@ -71,17 +59,6 @@ public abstract class BaseSelectBuyMeansDialog : MonoBehaviour private DialogBase m_dialog; - private void Start() - { - SystemText systemText = Data.SystemText; - m_labelCrystalHaveName.text = systemText.Get("Shop_0064"); - m_labelRupyHaveName.text = systemText.Get("Shop_0065"); - m_labelCrystalCostName.text = systemText.Get("Shop_0061"); - m_labelRupyCostName.text = systemText.Get("Shop_0062"); - m_labelCrystalBtnBuy.text = systemText.Get("Shop_0098"); - m_labelRupyBtnBuy.text = systemText.Get("Shop_0097"); - } - protected void SetDescriptionLabel(string text) { _labelDescription.text = text; @@ -156,7 +133,7 @@ public abstract class BaseSelectBuyMeansDialog : MonoBehaviour _ticketButton.onClick.Clear(); _ticketButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + onPushTicketButtonCallBack(); m_dialog.CloseWithoutSelect(); })); @@ -170,7 +147,7 @@ public abstract class BaseSelectBuyMeansDialog : MonoBehaviour m_buttonCrystal.onClick.Clear(); m_buttonCrystal.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + onPushButtonCrystal(); m_dialog.CloseWithoutSelect(); })); @@ -192,7 +169,7 @@ public abstract class BaseSelectBuyMeansDialog : MonoBehaviour m_buttonRupy.onClick.Clear(); m_buttonRupy.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + onPushButtonRupy(); m_dialog.CloseWithoutSelect(); })); diff --git a/SVSim.BattleEngine/Engine/Wizard/BaseShopPurchasePage.cs b/SVSim.BattleEngine/Engine/Wizard/BaseShopPurchasePage.cs index ea80ad7c..92a15083 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BaseShopPurchasePage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BaseShopPurchasePage.cs @@ -8,9 +8,6 @@ namespace Wizard; public class BaseShopPurchasePage : UIBase { - private const int PRODUCT_SCROLL_OBJECT_NUM = 4; - - protected const int MAX_SERIES_CACHE_NUM = 4; [SerializeField] private UITexture _bgTexture; diff --git a/SVSim.BattleEngine/Engine/Wizard/BaseTask.cs b/SVSim.BattleEngine/Engine/Wizard/BaseTask.cs index e3943193..195d27c5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BaseTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BaseTask.cs @@ -30,10 +30,6 @@ public class BaseTask : NetworkTask return resultCode; } - public static void OnRequestFinishedEmpty(ResultCode successcode) - { - } - public static void OnRequestFailed(ResultCode errorcode) { } diff --git a/SVSim.BattleEngine/Engine/Wizard/BattleButtonControl.cs b/SVSim.BattleEngine/Engine/Wizard/BattleButtonControl.cs deleted file mode 100644 index ebb62cf2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattleButtonControl.cs +++ /dev/null @@ -1,330 +0,0 @@ -using System; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; - -namespace Wizard; - -public class BattleButtonControl : MonoBehaviour -{ - public bool _isBattleMenuOptionsButtonPressable = true; - - private bool _isBattleMenuOpen; - - private bool _isRetireMenuOpen; - - private bool _isSettingMenuOpen; - - private bool IsRetire; - - private BattleManagerBase _battleMgr; - - private IPlayerView _battlePlayerView; - - private BattleMenuMgr _battleMenu; - - private DialogBase _retireDialog; - - private DialogBase _settingDialog; - - private DialogBase _keyWordDialog; - - private DialogBase _questMissionDialog; - - private CanNotTouchCardVfx _canNotTouchCardVfx; - - public bool IsBattleMenuOpen => _isBattleMenuOpen; - - public bool IsRetireMenuOpen => _isRetireMenuOpen; - - public DialogBase RetireMenu => _retireDialog; - - public bool IsSettingMenuOpen => _isSettingMenuOpen; - - public DialogBase SettingMenu => _settingDialog; - - public bool IsQuestMissionOpen { get; private set; } - - public void Start() - { - _battleMgr = BattleManagerBase.GetIns(); - _battlePlayerView = _battleMgr.BattlePlayer.PlayerBattleView; - } - - public void OnPressTurnEnd() - { - if (_battleMgr.BattlePlayer._isPlayerActive) - { - if (_battleMgr.TouchControl.HasTouchProcessor) - { - _battleMgr.Pause(); - _battleMgr.Resume(); - } - else if (_battlePlayerView.IsShowTurnEndDialogOfNotAttackingOrPlaying || _battlePlayerView.IsShowTurnEndDialogOfNotUsingHeroSkill) - { - _battlePlayerView.ShowTurnEndDialog(base.gameObject); - } - else - { - TurnEndConfirm(); - } - } - } - - private void TurnEndConfirm() - { - _battleMgr.VfxMgr.RegisterSequentialVfx(_battleMgr.OperateMgr.PlayerTurnEnd()); - } - - public void OnPressKeyBtn(BattleCardBase card, GameObject labelObject, CardParameter baseParameter) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _keyWordDialog = _battlePlayerView.CreateKeyPanel(card, labelObject.GetComponent(), CardMaster.BatttleCardMasterId, baseParameter); - InitializeKeywordDialog(_keyWordDialog); - } - - public void OnPressKeyBtn(string text, GameObject labelObject) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _keyWordDialog = BattlePlayerView.CreateKeyPanel(text, labelObject.GetComponent(), CardMaster.CardMasterId.Default); - InitializeKeywordDialog(_keyWordDialog); - } - - public void InitializeKeywordDialog(DialogBase dialog) - { - if (dialog != null) - { - bool isUpdateHandCardsPlayability = true; - if (GameMgr.GetIns().IsWatchBattle) - { - isUpdateHandCardsPlayability = !(BattleManagerBase.GetIns() as NetworkBattleManagerBase).IsSkillSelectTiming; - } - CanNotTouchCardVfx canNotTouchVfx = new CanNotTouchCardVfx(isUpdateHandCardsPlayability); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(canNotTouchVfx); - dialog.OnClose = (Action)Delegate.Combine(dialog.OnClose, (Action)delegate - { - canNotTouchVfx.End(); - }); - } - } - - public void OnPressBuffBtn() - { - _battlePlayerView.ShowKeyPanel(2); - } - - public void KeyPanelCancel() - { - _battlePlayerView.HideKeyPanel(); - } - - public void OnPressMenuBtn() - { - if (!_battlePlayerView.IsMenuOpen && !_battleMgr.IsBattleEnd && !IsRetire) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ShowBattleMenu(); - } - } - - public void ShowBattleMenu() - { - if (_canNotTouchCardVfx == null) - { - bool isUpdateHandCardsPlayability = true; - if (GameMgr.GetIns().IsWatchBattle) - { - isUpdateHandCardsPlayability = !(BattleManagerBase.GetIns() as NetworkBattleManagerBase).IsSkillSelectTiming; - } - _canNotTouchCardVfx = new CanNotTouchCardVfx(isUpdateHandCardsPlayability); - BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx); - } - _battlePlayerView.IsMenuOpen = true; - _battlePlayerView.RearrangeHand(); - GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Menu/BattleMenu"), base.transform); - gameObject.transform.localScale = Vector3.one; - _battleMenu = gameObject.GetComponent(); - _battleMenu.DisplayBattleMenu(Retire, Setting, delegate - { - _battlePlayerView.IsMenuOpen = false; - if (_canNotTouchCardVfx != null) - { - _canNotTouchCardVfx.End(); - _canNotTouchCardVfx = null; - } - if (!_battlePlayerView.IsMenuCloseEscape) - { - _battlePlayerView.ResetTouchable(); - } - _battlePlayerView.IsMenuCloseEscape = false; - _battlePlayerView.RearrangeHand(); - if (_battleMgr.BattlePlayer.IsSelfTurn && !_battleMgr.BattlePlayer.IsTurnStartEffectNotFinished) - { - _battlePlayerView.ForceShowTurnEndButton(); - } - }, ShowQuestMissionDialog); - if (!_isBattleMenuOptionsButtonPressable) - { - _battleMenu.SetSettingButtonDisable(); - } - _battlePlayerView.AddPopUpPanel(_battleMenu, BattlePlayerViewBase.BattleDialogItem.Menu); - } - - public void HideBattleMenu(bool isWithoutSE = false) - { - if (_battleMenu != null) - { - if (!isWithoutSE) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - } - _battleMenu.Close(); - _battleMenu = null; - } - } - - public void Retire() - { - if (_isRetireMenuOpen || _isSettingMenuOpen || IsQuestMissionOpen) - { - return; - } - _isRetireMenuOpen = true; - DialogBase dialogBase = _battlePlayerView.ShowRetireConfirmPanel(); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - if (!_battleMgr.IsBattleEnd && !IsRetire) - { - ShowBattleMenu(); - } - _isRetireMenuOpen = false; - }); - dialogBase.SetReturnMsg(base.gameObject, "RetireConfirm"); - _retireDialog = dialogBase; - } - - public void HideRetireMenu(bool isNotCloseEvent) - { - if (_retireDialog != null) - { - if (isNotCloseEvent) - { - _retireDialog.OnClose = null; - } - _retireDialog.Close(); - _retireDialog = null; - } - } - - public void RetireConfirm() - { - if (!BattleManagerBase.GetIns().BattlePlayer.Class.IsDead && !BattleManagerBase.GetIns().BattleEnemy.Class.IsDead) - { - IsRetire = true; - if (!GameMgr.GetIns().IsWatchBattle) - { - BattleManagerBase.GetIns().MenuButtonObject.SetActive(value: false); - BattleManagerBase.GetIns().PlayRetire(); - } - } - } - - public void Recording() - { - } - - public void Setting() - { - if (_isRetireMenuOpen || _isSettingMenuOpen || IsQuestMissionOpen) - { - return; - } - _isSettingMenuOpen = true; - DialogBase dialogBase = _battlePlayerView.CreateBattleSetting(); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - if (!_battleMgr.IsBattleEnd && !IsRetire) - { - ShowBattleMenu(); - } - _isSettingMenuOpen = false; - }); - dialogBase.SetReturnMsg(base.gameObject, ""); - _settingDialog = dialogBase; - } - - public void HideSettingMenu(bool isNotCloseEvent) - { - if (_settingDialog != null) - { - if (isNotCloseEvent) - { - _settingDialog.OnClose = null; - } - _settingDialog.Close(); - _settingDialog = null; - } - } - - public void HideKeyWordDialog(bool isNotCloseEvent) - { - if (_keyWordDialog != null) - { - if (isNotCloseEvent) - { - _keyWordDialog.OnClose = null; - } - _keyWordDialog.Close(); - } - } - - private void ShowQuestMissionDialog() - { - if (_isRetireMenuOpen || _isSettingMenuOpen || IsQuestMissionOpen) - { - return; - } - IsQuestMissionOpen = true; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Quest_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - if (!_battleMgr.IsBattleEnd && !IsRetire) - { - ShowBattleMenu(); - } - IsQuestMissionOpen = false; - }); - QuestAllConfirmDialog component = UnityEngine.Object.Instantiate(_battleMenu.QuestMissionDialogPrefab).GetComponent(); - component.CreateQuestAllConfirmDialog(); - dialogBase.SetObj(component.gameObject); - } - - private void HideQuestMissionDialog(bool isNotCloseEvent) - { - if (!(_questMissionDialog == null)) - { - if (isNotCloseEvent) - { - _questMissionDialog.OnClose = null; - } - _questMissionDialog.Close(); - } - } - - public void HideAllMenu(bool isWithoutSE = false) - { - HideBattleMenu(isWithoutSE); - HideRetireMenu(isNotCloseEvent: true); - HideSettingMenu(isNotCloseEvent: true); - HideKeyWordDialog(isNotCloseEvent: true); - HideQuestMissionDialog(isNotCloseEvent: true); - } - - public void OnPressMulliganSubmit() - { - _battleMgr.MulliganSubmit(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattleMenuUserPanel.cs b/SVSim.BattleEngine/Engine/Wizard/BattleMenuUserPanel.cs deleted file mode 100644 index 98ddc3a3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattleMenuUserPanel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class BattleMenuUserPanel : MonoBehaviour -{ - [SerializeField] - private UISprite _officialUserIconSprite; - - public void SetActiveOfficialUserIconSprite(bool isActive) - { - _officialUserIconSprite.gameObject.SetActive(isActive); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattleParameter.cs b/SVSim.BattleEngine/Engine/Wizard/BattleParameter.cs index 5d3eba6a..c3ed3044 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BattleParameter.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BattleParameter.cs @@ -15,48 +15,6 @@ public class BattleParameter public bool IsOpenDeckRoom { get; private set; } - public bool IsTwoPick - { - get - { - if (BattleType != NetworkDefine.ServerBattleType.TwoPick && BattleType != NetworkDefine.ServerBattleType.RoomTwoPick && BattleType != NetworkDefine.ServerBattleType.ColosseumTwoPick) - { - return BattleType == NetworkDefine.ServerBattleType.CompetitionTwoPick; - } - return true; - } - } - - public bool IsDisplayTwoPickIcon - { - get - { - if (TwoPickFormat != TwoPickFormat.Normal && TwoPickFormat != TwoPickFormat.Backdraft && (TwoPickFormat != TwoPickFormat.Chaos || Data.MyPageNotifications.data.RoomRule.ChallengePickFormat != TwoPickFormat.Chaos) && (TwoPickFormat != TwoPickFormat.BackdraftChaos || Data.MyPageNotifications.data.RoomRule.ChallengePickFormat != TwoPickFormat.Chaos) && (TwoPickFormat != TwoPickFormat.Cube || Data.MyPageNotifications.data.RoomRule.ChallengePickFormat != TwoPickFormat.Cube)) - { - if (TwoPickFormat == TwoPickFormat.BackdraftCube) - { - return Data.MyPageNotifications.data.RoomRule.ChallengePickFormat == TwoPickFormat.Cube; - } - return false; - } - return true; - } - } - - public bool IsBackDraft - { - get - { - if (TwoPickFormat != TwoPickFormat.Backdraft && TwoPickFormat != TwoPickFormat.BackdraftCube) - { - return TwoPickFormat == TwoPickFormat.BackdraftChaos; - } - return true; - } - } - - public bool IsSealed => BattleType == NetworkDefine.ServerBattleType.Sealed; - public BattleParameter(NetworkDefine.ServerBattleType battleType, Format format, TwoPickFormat deckFormatType, RoomConnectController.BattleRule rule, bool isOpenDeckRoom) { BattleType = battleType; @@ -66,24 +24,6 @@ public class BattleParameter IsOpenDeckRoom = isOpenDeckRoom; } - public void SetBattleParameter(BattleParameter battleParameter) - { - BattleType = battleParameter.BattleType; - DeckFormat = battleParameter.DeckFormat; - Rule = battleParameter.Rule; - TwoPickFormat = battleParameter.TwoPickFormat; - IsOpenDeckRoom = battleParameter.IsOpenDeckRoom; - } - - public bool IsSame(BattleParameter battleParameter) - { - if (BattleType == battleParameter.BattleType && DeckFormat == battleParameter.DeckFormat && Rule == battleParameter.Rule && TwoPickFormat == battleParameter.TwoPickFormat) - { - return IsOpenDeckRoom == battleParameter.IsOpenDeckRoom; - } - return false; - } - public DataMgr.BattleType ConvertClientBattleType() { DataMgr.BattleType result = DataMgr.BattleType.None; diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassGaugeInfo.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassGaugeInfo.cs deleted file mode 100644 index 30f8ba4d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassGaugeInfo.cs +++ /dev/null @@ -1,91 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class BattlePassGaugeInfo -{ - public int CurrentPoint { get; private set; } - - public int CurrentLevel { get; private set; } - - public BattlePassLevelInfo BattlePassLevelInfo => Data.Load.data.BattlePassLevelInfoList[CurrentLevel]; - - public bool IsMaxPoint => CurrentPoint >= BattlePassUtility.BattlePassMaxPoint; - - public int BeforeCurrentPoint { get; private set; } - - public int BeforeCurrentLevel { get; private set; } - - public BattlePassLevelInfo BeforeBattlePassLevelInfo => Data.Load.data.BattlePassLevelInfoList[BeforeCurrentLevel]; - - public bool IsBeforeMaxPoint => BeforeCurrentPoint >= BattlePassUtility.BattlePassMaxPoint; - - public int PointAdd { get; private set; } - - public int DailryMissionPoint { get; private set; } - - public int BattlePassMissionPoint { get; private set; } - - public int BattleResultPoint { get; private set; } - - public int WeeklyBattlePassPoint { get; private set; } - - public int WeeklyLimitPoint { get; private set; } - - public bool IsPremium { get; private set; } - - public bool IsLevelChange => CurrentLevel != BeforeCurrentLevel; - - public float BeforeGaugeValue => (float)(BeforeCurrentPoint - BeforeBattlePassLevelInfo.RequiredPoint) / (float)BattlePassUtility.NextLevelRequiredPoint(BeforeCurrentLevel); - - public int NextLevelRequiredPoint - { - get - { - if (!IsMaxPoint) - { - return Data.Load.data.BattlePassLevelInfoList[CurrentLevel + 1].RequiredPoint - CurrentPoint; - } - return 0; - } - } - - public int BeforeLevelNextLevelRequiredPoint - { - get - { - if (!IsBeforeMaxPoint) - { - return Data.Load.data.BattlePassLevelInfoList[BeforeCurrentLevel + 1].RequiredPoint - BeforeCurrentPoint; - } - return 0; - } - } - - public BattlePassGaugeInfo(JsonData jsonData) - { - CurrentPoint = jsonData["current_point"].ToInt(); - CurrentLevel = jsonData["current_level"].ToInt(); - if (jsonData.Keys.Contains("point_add")) - { - BeforeCurrentPoint = jsonData["before_current_point"].ToInt(); - BeforeCurrentLevel = jsonData["before_target_level"].ToInt(); - DailryMissionPoint = jsonData["daily_mission_point"].ToInt(); - BattlePassMissionPoint = jsonData["battle_pass_mission_point"].ToInt(); - BattleResultPoint = jsonData["battle_result_point"].ToInt(); - IsPremium = jsonData["is_premium"].ToBoolean(); - PointAdd = jsonData["point_add"].ToInt(); - } - WeeklyBattlePassPoint = jsonData.GetValueOrDefault("weekly_battle_pass_point", 0); - WeeklyLimitPoint = jsonData.GetValueOrDefault("weekly_limit_point", 0); - } - - public float CurrentGaugeValue() - { - if (IsMaxPoint) - { - return 1f; - } - return (float)(CurrentPoint - BattlePassLevelInfo.RequiredPoint) / (float)BattlePassUtility.NextLevelRequiredPoint(CurrentLevel); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassGuage.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassGuage.cs deleted file mode 100644 index 25db2cfd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassGuage.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.Collections; -using UnityEngine; - -namespace Wizard; - -public class BattlePassGuage : MonoBehaviour -{ - [SerializeField] - public ParticleSystem GaugeEfc; - - [SerializeField] - private UIGauge _uIGauge; - - [SerializeField] - private UILabel _nextLevelTitleLabel; - - [SerializeField] - private UILabel _nextLevelPoint; - - [SerializeField] - private UILabel _level; - - [SerializeField] - private UISprite _battlePassIcon; - - private BattlePassGaugeInfo _battlePassGaugeInfo; - - private const float GAUGEUP_DURATION = 0.3f; - - private const float GAUGEUP_DELAY = 1f; - - private const float GAUGE_SIZE = 1.15f; - - private const int GAUGEUP_SE_CNT = 6; - - private int _nowLevel; - - private int _nowNextLevelPoint; - - public bool IsAnimationComplete { get; private set; } - - public void Initialize(BattlePassGaugeInfo battlePassGaugeInfo) - { - _uIGauge.Value = battlePassGaugeInfo.CurrentGaugeValue(); - _nextLevelTitleLabel.text = Data.SystemText.Get("BattlePass_0009"); - _nextLevelPoint.text = battlePassGaugeInfo.NextLevelRequiredPoint.ToString(); - _level.text = battlePassGaugeInfo.CurrentLevel.ToString(); - } - - public void LvUpInitialize(BattlePassGaugeInfo battlePassGaugeInfo) - { - _battlePassGaugeInfo = battlePassGaugeInfo; - _battlePassIcon.spriteName = (battlePassGaugeInfo.IsPremium ? "icon_battlepass_premium" : "icon_battlepass_normal"); - _uIGauge.Value = battlePassGaugeInfo.BeforeGaugeValue; - _nextLevelTitleLabel.text = Data.SystemText.Get("BattlePass_0009"); - _nowNextLevelPoint = battlePassGaugeInfo.BeforeLevelNextLevelRequiredPoint; - _nextLevelPoint.text = _nowNextLevelPoint.ToString(); - _level.text = battlePassGaugeInfo.BeforeCurrentLevel.ToString(); - } - - public void AddBattlePassPoint() - { - _nowLevel = _battlePassGaugeInfo.BeforeCurrentLevel; - StartCoroutine(AddBattlePassPointCor()); - } - - private IEnumerator AddBattlePassPointCor() - { - yield return new WaitForSeconds(0.5f); - if (_battlePassGaugeInfo.IsLevelChange) - { - SetGaugeAniamtion(_uIGauge.Value, 1f, "LvUp"); - } - else - { - SetGaugeAniamtion(_uIGauge.Value, _battlePassGaugeInfo.CurrentGaugeValue(), "LvupComplete"); - } - } - - private void LvUp() - { - _nowLevel++; - _level.text = _nowLevel.ToString(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_LVUP_1, _battlePassIcon.transform.position) - .gameObject.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); - Effect effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_2, _uIGauge.GetTransformGaugeStartEdge().position); - if (effect != null) - { - effect.transform.localScale = Vector3.one * 1.15f; - effect.gameObject.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); - } - if (_nowLevel == BattlePassUtility.BattlePassMaxLevel) - { - LvupComplete(); - } - else if (_nowLevel < _battlePassGaugeInfo.CurrentLevel) - { - SetGaugeAniamtion(0f, 1f, "LvUp"); - } - else - { - SetGaugeAniamtion(0f, _battlePassGaugeInfo.CurrentGaugeValue(), "LvupComplete"); - } - } - - private void SetGaugeAniamtion(float from, float to, string oncomp = "") - { - iTween.ValueTo(base.gameObject, iTween.Hash("from", from, "to", to, "time", 0.3f, "delay", 0.1f, "onstart", "StartBattlePassPoint", "onupdate", "UpdateBattlePassPoint", "oncomplete", oncomp, "easetype", iTween.EaseType.easeOutQuad)); - } - - private void StartBattlePassPoint() - { - PlayGaugeUpSE(); - GaugeEfc.gameObject.SetActive(value: true); - GaugeEfc.Play(); - } - - private void PlayGaugeUpSE() - { - StartCoroutine(GaugeUpSECoroutine()); - } - - private IEnumerator GaugeUpSECoroutine() - { - for (int i = 0; i < 6; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - } - - private void UpdateBattlePassPoint(float num) - { - _uIGauge.Value = num; - int num2 = BattlePassUtility.NextLevelRequiredPoint(_nowLevel); - _nowNextLevelPoint = num2 - (int)((float)num2 * num); - _nextLevelPoint.text = _nowNextLevelPoint.ToString(); - } - - private void CompleteBattlePassPoint() - { - GaugeEfc.Stop(); - } - - private void LvupComplete() - { - _nextLevelPoint.text = _battlePassGaugeInfo.NextLevelRequiredPoint.ToString(); - StartCoroutine(SetLvupCompletAnimation()); - } - - private IEnumerator SetLvupCompletAnimation() - { - yield return new WaitForSeconds(0.1f); - CompleteBattlePassPoint(); - IsAnimationComplete = true; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassLevelInfo.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassLevelInfo.cs deleted file mode 100644 index 08320a01..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassLevelInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class BattlePassLevelInfo -{ - public int Level { get; private set; } - - public int RequiredPoint { get; private set; } - - public BattlePassLevelInfo(JsonData jsonData) - { - Level = jsonData["level"].ToInt(); - RequiredPoint = jsonData["required_point"].ToInt(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassProductDetailDialog.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassProductDetailDialog.cs index d9012057..90b7cc0e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassProductDetailDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BattlePassProductDetailDialog.cs @@ -7,7 +7,6 @@ namespace Wizard; public class BattlePassProductDetailDialog : MonoBehaviour { - private const string PATH_DIALOG_PREFAB = "UI/layoutParts/BattlePass/DialogBattlePassProductDetail"; [SerializeField] private UILabel _descriptionLabel; @@ -39,11 +38,6 @@ public class BattlePassProductDetailDialog : MonoBehaviour }); } - private void OnDestroy() - { - UnloadResources(); - } - private void LoadResources(BattlePassProduct product, Action onFinishLoad) { UIManager.GetInstance().createInSceneCenterLoading(); @@ -56,10 +50,4 @@ public class BattlePassProductDetailDialog : MonoBehaviour onFinishLoad.Call(); })); } - - private void UnloadResources() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList = null; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseDialog.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseDialog.cs index 1980dd5a..44e08f5e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseDialog.cs @@ -7,7 +7,6 @@ namespace Wizard; public class BattlePassPurchaseDialog : MonoBehaviour { - private const string PATH_DIALOG_PREFAB = "UI/layoutParts/BattlePass/DialogBattlePassPurchase"; [SerializeField] private UILabel _descriptionLabel; @@ -53,11 +52,6 @@ public class BattlePassPurchaseDialog : MonoBehaviour SetViewUI(battlePassPurchaseInfo); } - private void OnDestroy() - { - UnloadResources(); - } - private void SetViewUI(BattlePassPurchaseInfo battlePassPurchaseInfo) { _descriptionLabel.text = battlePassPurchaseInfo.Description; @@ -90,12 +84,6 @@ public class BattlePassPurchaseDialog : MonoBehaviour })); } - private void UnloadResources() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList = null; - } - private void OnClickPoster(BattlePassProduct product) { BattlePassProductDetailDialog.Create(product); diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseProductView.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseProductView.cs index 7a11cdb9..805c1039 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseProductView.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BattlePassPurchaseProductView.cs @@ -26,7 +26,7 @@ public class BattlePassPurchaseProductView : MonoBehaviour _buyBtn.onClick.Clear(); _buyBtn.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + onClickBuyBtn.Call(product); })); } diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassResultPanel.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassResultPanel.cs deleted file mode 100644 index f0f89bc7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassResultPanel.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class BattlePassResultPanel : MonoBehaviour -{ - [SerializeField] - private BattlePassGuage _battlePassGuage; - - [SerializeField] - private UIButton _tapTrriger; - - [SerializeField] - private ParticleSystem _lineEfc; - - [Header("ラベル")] - [SerializeField] - private GameObject _battleWin; - - [SerializeField] - private UILabel _battleWinLabel; - - [SerializeField] - private UILabel _battleWinPointLabel; - - [SerializeField] - private GameObject _missionClear; - - [SerializeField] - private UILabel _missionClearLabel; - - [SerializeField] - private UILabel _missionClearPointLabel; - - [SerializeField] - private GameObject _battleMissionClear; - - [SerializeField] - private UILabel _battleMissionClearLabel; - - [SerializeField] - private UILabel _battleMissionClearPointLabel; - - [SerializeField] - private UILabel _weeklyGetLimitLabel; - - [SerializeField] - private UILabel _weeklyGetLimitPointLabel; - - [SerializeField] - private UIGrid _uiGrid; - - private float GAUGEUP_LABEL_DURATION = 0.5f; - - private float GAUGEUP_LABEL_MOVE_DISTANCE = 50f; - - private BattlePassGaugeInfo _battlePassGaugeInfo; - - private List _loadedEffectResources = new List(); - - private Action _closeAction; - - private bool _isClosePanel; - - public void Initialize(BattlePassGaugeInfo battlePassGaugeInfo) - { - _battlePassGuage.LvUpInitialize(battlePassGaugeInfo); - _tapTrriger.onClick.Add(new EventDelegate(Close)); - base.gameObject.SetActive(value: false); - _battleWinLabel.text = Data.SystemText.Get("BattlePass_0014"); - _battleWin.SetActive(value: false); - _battleWinPointLabel.text = "+" + battlePassGaugeInfo.BattleResultPoint; - _missionClearLabel.text = Data.SystemText.Get("BattlePass_0015"); - _missionClear.SetActive(value: false); - _missionClearPointLabel.text = "+" + battlePassGaugeInfo.DailryMissionPoint; - _battleMissionClearLabel.text = Data.SystemText.Get("BattlePass_0016"); - _battleMissionClear.SetActive(value: false); - _battleMissionClearPointLabel.text = "+" + battlePassGaugeInfo.BattlePassMissionPoint; - _weeklyGetLimitLabel.text = Data.SystemText.Get("BattlePass_0017"); - _weeklyGetLimitPointLabel.text = battlePassGaugeInfo.WeeklyBattlePassPoint + "/" + battlePassGaugeInfo.WeeklyLimitPoint; - _battlePassGaugeInfo = battlePassGaugeInfo; - } - - public void SetPointupAnimation(Action closeAction) - { - _closeAction = closeAction; - List list = new List(); - list.Add(_lineEfc.gameObject); - list.Add(_battlePassGuage.GaugeEfc.gameObject); - _loadedEffectResources.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list, delegate - { - base.gameObject.SetActive(value: true); - StartCoroutine(FadeAction(isIn: true)); - _lineEfc.gameObject.SetActive(value: true); - _lineEfc.Play(); - _battlePassGuage.AddBattlePassPoint(); - StartCoroutine(SetLvupAnimation()); - })); - } - - private IEnumerator SetLvupAnimation() - { - _battleWin.SetActive(_battlePassGaugeInfo.BattleResultPoint != 0); - _missionClear.SetActive(_battlePassGaugeInfo.DailryMissionPoint != 0); - _battleMissionClear.SetActive(_battlePassGaugeInfo.BattlePassMissionPoint != 0); - _uiGrid.Reposition(); - _battleWin.SetActive(value: false); - _missionClear.SetActive(value: false); - _battleMissionClear.SetActive(value: false); - yield return new WaitForSeconds(0.5f); - if (_battlePassGaugeInfo.BattleResultPoint != 0) - { - _battleWin.SetActive(value: true); - TextAnimation(_battleWinLabel.gameObject); - TextAnimation(_battleWinPointLabel.gameObject); - } - if (_battlePassGaugeInfo.DailryMissionPoint != 0) - { - _missionClear.SetActive(value: true); - TextAnimation(_missionClearLabel.gameObject); - TextAnimation(_missionClearPointLabel.gameObject); - } - if (_battlePassGaugeInfo.BattlePassMissionPoint != 0) - { - _battleMissionClear.SetActive(value: true); - TextAnimation(_battleMissionClearLabel.gameObject); - TextAnimation(_battleMissionClearPointLabel.gameObject); - } - } - - private void Close() - { - if (_battlePassGuage.IsAnimationComplete && !_isClosePanel) - { - _isClosePanel = true; - _lineEfc.Clear(); - StartCoroutine(FadeAction(isIn: false, delegate - { - base.gameObject.SetActive(value: false); - UnLoadEffect(); - _closeAction(); - })); - } - } - - private void UnLoadEffect() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedEffectResources); - _loadedEffectResources.Clear(); - } - - private void TextAnimation(GameObject label) - { - label.SetActive(value: true); - TweenAlpha.Begin(label.gameObject, GAUGEUP_LABEL_DURATION, 1f); - iTween.MoveFrom(label, iTween.Hash("x", label.transform.localPosition.x - GAUGEUP_LABEL_MOVE_DISTANCE, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - public IEnumerator FadeAction(bool isIn, Action fadeEndAction = null) - { - float num = 0.2f; - float alpha = (isIn ? 0f : 1f); - float alpha2 = (isIn ? 1f : 0f); - TweenAlpha.Begin(base.gameObject, 0f, alpha); - TweenAlpha.Begin(base.gameObject, num, alpha2); - yield return new WaitForSeconds(num); - fadeEndAction.Call(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePassUtility.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePassUtility.cs deleted file mode 100644 index b05311e4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePassUtility.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard; - -public class BattlePassUtility -{ - public static int BattlePassMaxLevel = BattlePassLevelInfoList.Keys.Max(); - - private static Dictionary BattlePassLevelInfoList => Data.Load.data.BattlePassLevelInfoList; - - public static int BattlePassMaxPoint => BattlePassLevelInfoList[BattlePassMaxLevel].RequiredPoint; - - public static int NextLevelRequiredPoint(int level) - { - if (level != BattlePassMaxLevel) - { - return BattlePassLevelInfoList[level + 1].RequiredPoint - BattlePassLevelInfoList[level].RequiredPoint; - } - return 0; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BattlePlayerPair.cs b/SVSim.BattleEngine/Engine/Wizard/BattlePlayerPair.cs index 504ccdbc..a3e4a2b1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BattlePlayerPair.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BattlePlayerPair.cs @@ -1,3 +1,7 @@ +// TODO(engine-cleanup-pass2): 1 of 5 methods unrun in baseline +// Type: Wizard.BattlePlayerPair +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; public class BattlePlayerPair : BattlePlayerReadOnlyInfoPair diff --git a/SVSim.BattleEngine/Engine/Wizard/BattleRecoveryInfo.cs b/SVSim.BattleEngine/Engine/Wizard/BattleRecoveryInfo.cs index ca65c151..76e80fed 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BattleRecoveryInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BattleRecoveryInfo.cs @@ -23,30 +23,6 @@ public class BattleRecoveryInfo : ReplayDetailInfo public string roomId; - private const string NODE_SERVER_URL_KEY = "node_server_url"; - - private const string TURN_STATE_KEY = "turn_state"; - - private const string PUB_SEQ_1_KEY = "pubSeq1"; - - private const string PLAY_SEQ_1_KEY = "playSeq1"; - - private const string IS_OWNER_KEY = "isOwner"; - - private const string IS_MASTER_RANK_2_KEY = "isMasterRank2"; - - private const string MAX_RANK_2_KEY = "maxRank2"; - - private const string IS_COLOSSEUM_RANK_BATTLE_KEY = "is_colosseum_rank_battle"; - - private const string IS_COMPETITION_RANK_BATTLE_KEY = "is_competition_rank_battle"; - - private const string ROOM_ID_KEY = "roomId"; - - private const string TOURNAMENT_KEY = "tournament"; - - private const string IS_INVITATION_USER_KEY = "is_invitation_user"; - public DataMgr.BattleType BattleType { get; private set; } = DataMgr.BattleType.None; public int Pub_seq { get; private set; } @@ -79,7 +55,7 @@ public class BattleRecoveryInfo : ReplayDetailInfo BattleType = DataMgr.BattleType.RoomBattle; } Data.CurrentFormat = BattleParameterInstance.DeckFormat; - GameMgr.GetIns().GetDataMgr().TwoPickFormat = BattleParameterInstance.TwoPickFormat; + /* Pre-Phase-5b: DataMgr.TwoPickFormat write dropped */ node_server_url = data["node_server_url"].ToString(); turn_state = data["turn_state"].ToInt(); Pub_seq = data["pubSeq1"].ToInt(); diff --git a/SVSim.BattleEngine/Engine/Wizard/BattleStartUserPanel.cs b/SVSim.BattleEngine/Engine/Wizard/BattleStartUserPanel.cs deleted file mode 100644 index 3cb225aa..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BattleStartUserPanel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class BattleStartUserPanel : MonoBehaviour -{ - [SerializeField] - private UISprite _officialUserIconSprite; - - public void SetActiveOfficialUserIconSprite(bool isActive) - { - _officialUserIconSprite.gameObject.SetActive(isActive); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BestInPlayMoveAI.cs b/SVSim.BattleEngine/Engine/Wizard/BestInPlayMoveAI.cs index 2a3d3c7d..05afdfac 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BestInPlayMoveAI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BestInPlayMoveAI.cs @@ -28,8 +28,6 @@ public class BestInPlayMoveAI : IBattleSimulationAI public List Cr_MaxActionInfoSequence => BestRecord.ActionSequence; - public int Cr_minimumActionLengthOnWinPlan => BestRecord.MinActionLengthOfLethal; - public BestInPlayMoveAI(EnemyAI ai) { AI = ai; diff --git a/SVSim.BattleEngine/Engine/Wizard/BingoSelectBuyNumPopup.cs b/SVSim.BattleEngine/Engine/Wizard/BingoSelectBuyNumPopup.cs deleted file mode 100644 index 95aecb95..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BingoSelectBuyNumPopup.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; -using Wizard.Bingo; - -namespace Wizard; - -public class BingoSelectBuyNumPopup : SelectBuyNumPopupBase -{ - [SerializeField] - private UILabel _sheetLabel; - - [SerializeField] - private UILabel _sheetNumLabel; - - [SerializeField] - private UILabel _remainedLabel; - - [SerializeField] - private UILabel _remainedNumLabel; - - [SerializeField] - private CenteringUIWidget _line1; - - [SerializeField] - private CenteringUIWidget _line2; - - protected override string _labelBuyNumPurchaseBtnTextId => "Bingo_0018"; - - public void Init(DialogBase dialog, int ableBuyNum, int openedNum, BingoInfoTask.BingoInfoData bingoInfoData, Action OnClickPurchase) - { - _dialog = dialog; - _gachaCostPerPack = 1; - _ableBuyNum = ableBuyNum; - InitBuyMeansDisplays(bingoInfoData, openedNum); - UpdateBuyNumDisplays(); - UIEventListener.Get(_buttonPlus.gameObject).onPress = base.OnPressToPlusBtn; - UIEventListener.Get(_buttonMinus.gameObject).onPress = base.OnPressToMinusBtn; - UIEventListener.Get(_buttonMax.gameObject).onClick = delegate - { - OnBtnMax(); - }; - UIEventListener.Get(_buttonPurchase.gameObject).onClick = delegate - { - dialog.Close(); - OnClickPurchase(_buyNum); - }; - } - - private void InitBuyMeansDisplays(BingoInfoTask.BingoInfoData bingoInfoData, int openedNum) - { - _buyPackLabel.text = Data.SystemText.Get("Bingo_0026"); - _sheetLabel.text = Data.SystemText.Get("Bingo_0027"); - _sheetNumLabel.text = Data.SystemText.Get("Bingo_0028", bingoInfoData.SheetNum.ToString()); - _remainedLabel.text = Data.SystemText.Get("Bingo_0029"); - _remainedNumLabel.text = Data.SystemText.Get("Bingo_0030", (bingoInfoData.MaxSquareNum - openedNum).ToString()); - UIManager.GetInstance().StartCoroutine(LineReposition()); - _labelCostNamePurchaseBtn.text = Data.SystemText.Get("Bingo_0019"); - _labelHaveItemName.text = Data.SystemText.Get("Bingo_0016"); - _labelHaveNumItems.text = bingoInfoData.BingoTicketNum.ToString(); - _labelCostPerPack.text = Data.SystemText.Get("Bingo_0017", bingoInfoData.BingoDrawCost.ToString()); - } - - private IEnumerator LineReposition() - { - _sheetLabel.ProcessText(); - _sheetNumLabel.ProcessText(); - _remainedLabel.ProcessText(); - _remainedNumLabel.ProcessText(); - yield return null; - _line1.Reposition(); - _line2.Reposition(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushClearDeckListTask.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushClearDeckListTask.cs deleted file mode 100644 index b6616e54..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushClearDeckListTask.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class BossRushClearDeckListTask : BaseTask -{ - public List DeckList { get; private set; } = new List(); - - public Dictionary> AbilityDictionary { get; private set; } = new Dictionary>(); - - public BossRushClearDeckListTask() - { - base.type = ApiType.Type.BossRushClearDeckList; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - JsonData jsonData2 = jsonData[i]; - DeckData deckData = new DeckData(Data.ParseApiFormat(jsonData2["deck_format"].ToInt())); - deckData.Initialize(jsonData2); - deckData.SetDeckID(jsonData2["challenge_count_num"].ToInt()); - DeckList.Add(deckData); - JsonData jsonData3 = jsonData2["special_ability_list"]; - List list = new List(); - for (int j = 0; j < jsonData3.Count; j++) - { - list.Add(new BossRushLobbyAbilityData(jsonData3[j])); - } - AbilityDictionary.Add(deckData.GetDeckID(), list); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushFinishTask.cs deleted file mode 100644 index 3b0dcc35..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushFinishTask.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; -using Wizard.Battle.Recovery; - -namespace Wizard; - -public class BossRushFinishTask : BaseTask -{ - public class BossRushFinishTaskParam : BaseParam - { - public int current_life; - - public int max_life; - - public int quest_stage_id; - - public int deck_no; - - public bool is_win; - - public int deck_format; - - public bool is_prebuild_deck; - - public bool is_trial_deck; - - public int total_turn; - - public int turn_state; - - public Dictionary mission; - - public string recovery_data; - - public string[] prosessing_time_data; - } - - private bool _isWin; - - public BossRushFinishTask() - { - base.type = ApiType.Type.BossRushFinish; - } - - public void SetParameter(int currentLife, int maxLife, int quest_stage_id, int deck_no, bool is_win, Format format, bool isPreBuildDeck, bool isTrialDeck, bool isFirst, int totalTurn) - { - _isWin = is_win; - BossRushFinishTaskParam bossRushFinishTaskParam = new BossRushFinishTaskParam(); - bossRushFinishTaskParam.current_life = Math.Max(0, currentLife); - bossRushFinishTaskParam.max_life = Math.Max(0, maxLife); - bossRushFinishTaskParam.quest_stage_id = quest_stage_id; - bossRushFinishTaskParam.deck_no = deck_no; - bossRushFinishTaskParam.is_win = is_win; - bossRushFinishTaskParam.deck_format = Data.FormatConvertApi(format); - bossRushFinishTaskParam.is_prebuild_deck = isPreBuildDeck; - bossRushFinishTaskParam.is_trial_deck = isTrialDeck; - bossRushFinishTaskParam.turn_state = ((!isFirst) ? 1 : 0); - bossRushFinishTaskParam.total_turn = totalTurn; - BattleManagerBase ins = BattleManagerBase.GetIns(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true); - BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class; - if (dataMgr.RecoveryData == null) - { - dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); - } - bossRushFinishTaskParam.recovery_data = dataMgr.RecoveryData.ToJson(); - bossRushFinishTaskParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass); - base.Params = bossRushFinishTaskParam; - } - - protected override int Parse() - { - GameMgr.GetIns().GetDataMgr().ClearSpecialBattleSettingInfo(); - int num = base.Parse(); - if (num != 1) - { - DeleteRecoveryFileIfBattleAlreadyEnded(num); - return num; - } - Data.QuestFinish.data = new QuestFinishDetail(); - Data.QuestFinish.data._responseData = base.ResponseData; - JsonData jsonData = base.ResponseData["data"]; - if (base.type == ApiType.Type.QuestPuzzleFinish) - { - Data.QuestFinish.data.PuzzleQuestInfo = new PuzzleQuestInfo(jsonData); - } - Data.QuestFinish.data.get_class_chara_experience = jsonData["get_class_experience"].ToInt(); - Data.QuestFinish.data.class_chara_experience = jsonData["class_experience"].ToInt(); - Data.QuestFinish.data.class_chara_level = jsonData["class_level"].ToInt(); - Data.QuestFinish.data.CurrentPoint = jsonData["current_point"].ToInt(); - Data.QuestFinish.data.AddPoint = jsonData["add_point"].ToInt(); - Data.QuestFinish.data.ClassBonusPoint = jsonData["class_bonus_point"].ToInt(); - Data.QuestFinish.data.FormatBonusPoint = jsonData["format_bonus_point"].ToInt(); - Data.QuestFinish.data.CommonMissionClearInfoList = new List(); - Data.QuestFinish.data.CharacterMissionClearInfoList = new List(); - Data.QuestFinish.data.WinBonusPoint = jsonData.GetValueOrDefault("win_bonus_point", 0); - Data.QuestFinish.data.WinCount = jsonData.GetValueOrDefault("win_count", 0); - Data.QuestFinish.data.WinCountForWinBonusPoint = jsonData.GetValueOrDefault("required_win_count_for_win_bonus_point", 0); - Data.QuestFinish.data.WinBonusPointStatus = (QuestFinishDetail.WinBonusStatus)jsonData.GetValueOrDefault("win_bonus_point_status", 0); - Data.QuestFinish.data.NecessaryPointList = new List(); - int num2 = 0; - for (int i = 0; i < jsonData["point_reward_list"].Count; i++) - { - int num3 = jsonData["point_reward_list"][i]["point"].ToInt(); - Data.QuestFinish.data.NecessaryPointList.Add(num3 - num2); - num2 = num3; - } - Data.QuestFinish.data.CurrentLife = jsonData["current_life"].ToInt(); - Data.QuestFinish.data.MaxLife = jsonData["max_life"].ToInt(); - Data.QuestFinish.data.NecessaryPointList.Add(-1); - Data.QuestFinish.data.IsSpecialResult = jsonData.GetValueOrDefault("is_special_result", defaultValue: false); - Data.QuestFinish.data.IsSpecialEffect = jsonData.GetValueOrDefault("is_special_effect", defaultValue: false); - int val = 9999; - Data.QuestFinish.data.BossRushShortestTurn = Math.Min(jsonData.GetValueOrDefault("shortest_clear_turns", 0), val); - Data.QuestFinish.data.BossRushTotalTurn = Math.Min(jsonData.GetValueOrDefault("total_turns", 0), val); - if (_isWin) - { - Data.QuestFinish.data.IsEnableBossRushShortestTurn = true; - } - else - { - Data.QuestFinish.data.IsEnableBossRushShortestTurn = Data.QuestFinish.data.BossRushShortestTurn != 0; - } - if (Data.QuestFinish.data.BossRushShortestTurn == 0 && _isWin) - { - Data.QuestFinish.data.IsBossRushNewRecord = true; - } - else if (_isWin && Data.QuestFinish.data.BossRushTotalTurn < Data.QuestFinish.data.BossRushShortestTurn) - { - Data.QuestFinish.data.IsBossRushNewRecord = true; - Data.QuestFinish.data.BossRushShortestTurn = Data.QuestFinish.data.BossRushTotalTurn; - } - if (Data.QuestFinish.data.BossRushTotalTurn > 0 && Data.QuestFinish.data.BossRushShortestTurn == 0) - { - Data.QuestFinish.data.BossRushShortestTurn = Data.QuestFinish.data.BossRushTotalTurn; - } - JsonData data = base.ResponseData["data"]["achieved_info"]; - Data.QuestFinish.data.AchievedInfo.Read(data); - Data.QuestFinish.data.HomeDialogData = new MyPageHomeDialogData(jsonData, "battle_dialog_list"); - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushHiddenBattleFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushHiddenBattleFinishTask.cs deleted file mode 100644 index 02860a9c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushHiddenBattleFinishTask.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard.Battle.Recovery; - -namespace Wizard; - -public class BossRushHiddenBattleFinishTask : BaseTask -{ - public class BossRushHiddenBattleFinishTaskParam : BaseParam - { - public bool is_win; - - public int deck_no; - - public int deck_format; - - public int class_id; - - public int enemy_class_id; - - public int total_turn; - - public int turn_state; - - public int evolve_count; - - public Dictionary mission; - - public string recovery_data; - - public string[] prosessing_time_data; - - public bool is_prebuild_deck; - - public bool is_trial_deck; - - public int challenge_count_num; - } - - public BossRushHiddenBattleFinishTask() - { - base.type = ApiType.Type.BossRushHiddenBattleFinish; - } - - public void SetParameter(int quest_stage_id, int deck_no, bool is_win, Format format, bool isPreBuildDeck, bool isTrialDeck, bool isFirst, int totalTurn) - { - BattleManagerBase ins = BattleManagerBase.GetIns(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - BossRushHiddenBattleFinishTaskParam bossRushHiddenBattleFinishTaskParam = new BossRushHiddenBattleFinishTaskParam(); - bossRushHiddenBattleFinishTaskParam.is_win = is_win; - bossRushHiddenBattleFinishTaskParam.deck_no = deck_no; - bossRushHiddenBattleFinishTaskParam.deck_format = Data.FormatConvertApi(format); - bossRushHiddenBattleFinishTaskParam.class_id = dataMgr.GetPlayerClassId(); - bossRushHiddenBattleFinishTaskParam.enemy_class_id = dataMgr.GetEnemyClassId(); - bossRushHiddenBattleFinishTaskParam.total_turn = totalTurn; - bossRushHiddenBattleFinishTaskParam.turn_state = ((!isFirst) ? 1 : 0); - bossRushHiddenBattleFinishTaskParam.evolve_count = ins.BattlePlayer._cumulativeEvolutionCount; - bossRushHiddenBattleFinishTaskParam.is_prebuild_deck = isPreBuildDeck; - bossRushHiddenBattleFinishTaskParam.is_trial_deck = isTrialDeck; - bossRushHiddenBattleFinishTaskParam.challenge_count_num = deck_no; - BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true); - BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class; - if (dataMgr.RecoveryData == null) - { - dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); - } - bossRushHiddenBattleFinishTaskParam.recovery_data = dataMgr.RecoveryData.ToJson(); - bossRushHiddenBattleFinishTaskParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass); - base.Params = bossRushHiddenBattleFinishTaskParam; - } - - protected override int Parse() - { - GameMgr.GetIns().GetDataMgr().ClearSpecialBattleSettingInfo(); - int num = base.Parse(); - if (num != 1) - { - DeleteRecoveryFileIfBattleAlreadyEnded(num); - return num; - } - Data.QuestFinish.data = new QuestFinishDetail(); - Data.QuestFinish.data._responseData = base.ResponseData; - JsonData jsonData = base.ResponseData["data"]; - Data.QuestFinish.data.get_class_chara_experience = jsonData["get_class_experience"].ToInt(); - Data.QuestFinish.data.class_chara_experience = jsonData["class_experience"].ToInt(); - Data.QuestFinish.data.class_chara_level = jsonData["class_level"].ToInt(); - Data.QuestFinish.data.CurrentPoint = (jsonData.Keys.Contains("current_point") ? jsonData["current_point"].ToInt() : 0); - Data.QuestFinish.data.AddPoint = (jsonData.Keys.Contains("add_point") ? jsonData["add_point"].ToInt() : 0); - Data.QuestFinish.data.CommonMissionClearInfoList = new List(); - if (jsonData.Keys.Contains("clear_mission_list") && jsonData["clear_mission_list"].Keys.Contains("common_mission")) - { - JsonData jsonData2 = jsonData["clear_mission_list"]["common_mission"]; - for (int i = 0; i < jsonData2.Count; i++) - { - Data.QuestFinish.data.CommonMissionClearInfoList.Add(new QuestFinishDetail.MissionClearInfo(jsonData2[i]["name"].ToString(), jsonData2[i]["point"].ToInt())); - } - } - Data.QuestFinish.data.CharacterMissionClearInfoList = new List(); - if (jsonData.Keys.Contains("clear_mission_list") && jsonData["clear_mission_list"].Keys.Contains("character_mission")) - { - JsonData jsonData3 = jsonData["clear_mission_list"]["character_mission"]; - for (int j = 0; j < jsonData3.Count; j++) - { - Data.QuestFinish.data.CharacterMissionClearInfoList.Add(new QuestFinishDetail.MissionClearInfo(jsonData3[j]["name"].ToString(), jsonData3[j]["point"].ToInt())); - } - } - Data.QuestFinish.data.AddPoint = Data.QuestFinish.data.AddPoint - Data.QuestFinish.data.GetTotalCommonMissionClearPoint() - Data.QuestFinish.data.GetTotalCharacterMissionClearPoint(); - Data.QuestFinish.data.NecessaryPointList = new List(); - if (jsonData.Keys.Contains("point_reward_list")) - { - int num2 = 0; - for (int k = 0; k < jsonData["point_reward_list"].Count; k++) - { - int num3 = jsonData["point_reward_list"][k]["point"].ToInt(); - Data.QuestFinish.data.NecessaryPointList.Add(num3 - num2); - num2 = num3; - } - } - Data.QuestFinish.data.NecessaryPointList.Add(-1); - JsonData data = jsonData["achieved_info"]; - Data.QuestFinish.data.AchievedInfo.Read(data); - Data.QuestFinish.data.HomeDialogData = new MyPageHomeDialogData(jsonData, "battle_dialog_list"); - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(jsonData["reward_list"]); - if (jsonData.Keys.Contains("hidden_boss_reward_list")) - { - _ = jsonData["hidden_boss_reward_list"]; - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushHiddenBattleStartTask.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushHiddenBattleStartTask.cs deleted file mode 100644 index f4944a4f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushHiddenBattleStartTask.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard; - -public class BossRushHiddenBattleStartTask : BaseTask -{ - private DeckData _deck; - - public QuestBossData QuestBossData { get; private set; } - - public List PlayerSkillList { get; private set; } - - public BossRushHiddenBattleStartTask(DeckData deck, List abilityList) - { - base.type = ApiType.Type.BossRushHiddenBattleStart; - _deck = deck; - PlayerSkillList = new List(); - for (int i = 0; i < abilityList.Count; i++) - { - BossRushLobbyAbilityData bossRushLobbyAbilityData = abilityList[i]; - BossRushSpecialSkill item = new BossRushSpecialSkill(bossRushLobbyAbilityData.DisplayCardId, bossRushLobbyAbilityData.Name, bossRushLobbyAbilityData.Skill, bossRushLobbyAbilityData.SkillDescText, bossRushLobbyAbilityData.IsFoil); - PlayerSkillList.Add(item); - } - } - - protected override int Parse() - { - int num = base.Parse(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.ClearSpecialBattleSettingInfo(); - if (num != 1) - { - return num; - } - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.SecretBossQuest; - Data.CurrentFormat = _deck.Format; - DeckListUtility.DataMgrSaveLastSelectDeckData(_deck); - dataMgr.Load(); - CardMaster.SetBattleCardMasterId(FormatBehaviorManager.GetDefaultBehaviour(_deck.Format).CardMasterId); - QuestBossData = new QuestBossData(base.ResponseData["data"]["hidden_boss_info"]); - BossRushSpecialSkill enemySkill = new BossRushSpecialSkill(-1, QuestBossData.Name, QuestBossData.Skill, QuestBossData.SkillDescText, isFoil: false); - BossRushBattleData bossRushBattleData = new BossRushBattleData(QuestBossData, PlayerSkillList, enemySkill); - dataMgr.SetBossRushBattleData(bossRushBattleData); - dataMgr.SetEnemyCharaId(dataMgr.BossRushBattleData.CharaId); - dataMgr.SetStoryBgmID(dataMgr.BossRushBattleData.BgmId); - dataMgr.SetSoroPlay3DFieldID(dataMgr.BossRushBattleData.Battle3dFieldID); - dataMgr.SetEnemySleeveId(3000011L); - int playerMaxLife = GetPlayerMaxLife(); - dataMgr.SetSpecialBattleSetting(null, playerLife: playerMaxLife, playerMaxLife: playerMaxLife, enemyMaxLife: QuestBossData.Life, playerSkill: string.Join(",", PlayerSkillList.Select((BossRushSpecialSkill s) => s.SkillText).ToList()), enemySkill: QuestBossData.Skill, playerPp: 0, enemyPp: 0, idOverrideBattleLogText: ""); - if (base.ResponseData["data"].Keys.Contains("mission_parameter")) - { - dataMgr.SetMissionNecessaryInformation(base.ResponseData["data"]["mission_parameter"]); - } - return num; - } - - private int GetPlayerMaxLife() - { - int num = 20; - for (int i = 0; i < PlayerSkillList.Count(); i++) - { - if (PlayerSkillList.ElementAt(i).OriginalCardId == 117031020) - { - num += 5; - } - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyAbilityDetailDialog.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyAbilityDetailDialog.cs deleted file mode 100644 index 47bf2661..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyAbilityDetailDialog.cs +++ /dev/null @@ -1,252 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Battle.View; - -namespace Wizard; - -public class BossRushLobbyAbilityDetailDialog : MonoBehaviour -{ - private const float SELECT_CARD_SCALE = 1.35f; - - private const float GRID_CARD_SCALE = 0.64f; - - private const int GRID_CARD_DEPTH = 5; - - private const int KEYWORD_DIALOG_DEPTH = 20; - - private const int KEYWORD_PANEL_DEPTH = 25; - - private static readonly Vector3 DIALOG_POSITION = new Vector3(0f, 0f, 2f); - - [SerializeField] - private CardImageHelpder _cardLoader; - - [SerializeField] - private UIButton _buttonOriginal; - - [SerializeField] - private UIGrid _cardGrid; - - [SerializeField] - private UILabel _nameLabel; - - [SerializeField] - private UIScrollView _descScrollView; - - [SerializeField] - private UILabel _descLabel; - - [SerializeField] - private GameObject _selectCardRoot; - - [SerializeField] - private GameObject _selectCursor; - - [SerializeField] - private TextLineCreater _descLineCreator; - - [SerializeField] - private GameObject _emptyOriginal; - - [SerializeField] - private GameObject _keywordCollider; - - private GameObject _selectCard; - - public static void Create(List abilityList, int maxBossCount, BossRushLobbyAbilityData defaultSelectAbility = null) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.L); - dialogBase.SetTitleLabel(Data.SystemText.Get("BossRush_0022")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.transform.localPosition = DIALOG_POSITION; - if (abilityList.Count == 0) - { - dialogBase.SetText(Data.SystemText.Get("BossRush_0024")); - return; - } - GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/BossRush/BossRushLobbyAbilityDetailDialog")) as GameObject; - dialogBase.SetObj(gameObject); - gameObject.GetComponent().Initialize(abilityList, maxBossCount, defaultSelectAbility); - } - - private void Initialize(List abilityList, int maxBossCount, BossRushLobbyAbilityData defaultSelectAbility) - { - _emptyOriginal.SetActive(value: false); - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadResources(abilityList, delegate - { - InitializeCardList(abilityList, maxBossCount, defaultSelectAbility); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private void InitializeCardList(List abilityList, int maxBossCount, BossRushLobbyAbilityData defaultSelectAbility) - { - _buttonOriginal.gameObject.SetActive(value: false); - int num = 0; - if (defaultSelectAbility != null) - { - for (int i = 0; i < abilityList.Count; i++) - { - if (abilityList[i] == defaultSelectAbility) - { - num = i; - break; - } - } - } - for (int j = 0; j < maxBossCount; j++) - { - if (j >= abilityList.Count) - { - AddEmptyAbilityFrame(); - } - else - { - AddAbilityCardObj(abilityList, j, num); - } - } - _cardGrid.Reposition(); - UIBase_CardManager.CardObjData cardObjData = _cardLoader.GetCardObjData(num); - _selectCursor.transform.position = cardObjData.CardObj.transform.position; - } - - private void AddEmptyAbilityFrame() - { - NGUITools.AddChild(_cardGrid.gameObject, _emptyOriginal).SetActive(value: true); - } - - private void AddAbilityCardObj(List abilityList, int index, int defaultSelectIndex) - { - GameObject gameObject = NGUITools.AddChild(_cardGrid.gameObject, _buttonOriginal.gameObject); - UIButton component = gameObject.GetComponent(); - gameObject.SetActive(value: true); - BossRushLobbyAbilityData abilityData = abilityList[index]; - UIBase_CardManager.CardObjData objData = _cardLoader.GetCardObjData(index); - GameObject cardObj = objData.CardObj; - Vector3 localScale = cardObj.transform.localScale; - component.onClick.Add(new EventDelegate(delegate - { - OnClickAbility(abilityData, objData); - })); - cardObj.transform.parent = gameObject.transform; - cardObj.transform.localPosition = Vector3.zero; - cardObj.transform.localScale = localScale; - if (index == defaultSelectIndex) - { - SelectAbility(abilityData, objData); - } - } - - private void OnClickAbility(BossRushLobbyAbilityData abilityData, UIBase_CardManager.CardObjData objData) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SelectAbility(abilityData, objData); - } - - private void SelectAbility(BossRushLobbyAbilityData abilityData, UIBase_CardManager.CardObjData objData) - { - SetNameLabel(abilityData); - _descLabel.SetWrapText(BattleCardBase.ConvertSkillDescriptionText(abilityData.SkillDescText)); - if (_selectCard != null) - { - UnityEngine.Object.Destroy(_selectCard); - } - _selectCursor.transform.position = objData.CardObj.transform.position; - _selectCard = NGUITools.AddChild(_selectCardRoot, objData.CardObj); - _selectCard.transform.localScale = new Vector3(1.35f, 1.35f, 1f); - CardListTemplate component = _selectCard.GetComponent(); - component.SetId(abilityData.DisplayCardId); - CardTemplateCustomize(component); - int textLineCount = Global.GetTextLineCount(_descLabel.text); - _descLineCreator.ShowLines(textLineCount); - _descScrollView.ResetPosition(); - UIEventListener.Get(_descLabel.gameObject).onClick = delegate - { - OnClickDescLabel(abilityData); - }; - UIEventListener.Get(_keywordCollider).onPress = delegate(GameObject g, bool b) - { - BattlePlayerView.PressKeyWordColorChange(_descLabel, b); - }; - UIEventListener.Get(_keywordCollider).onDragStart = delegate - { - BattlePlayerView.SetKeyWordLabelColor(_descLabel); - }; - } - - private void OnClickDescLabel(BossRushLobbyAbilityData abilityData) - { - if (abilityData.SkillDescText.Length > 0 && HasKeyword(abilityData.SkillDescText)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - IList keywords = BattleKeywordInfoListMgr.GetKeywords(abilityData.SkillDescText); - DialogBase dialogBase = BattlePlayerView.CreateKeyPanel(_descLabel, keywords, CardMaster.CardMasterId.Default); - dialogBase.SetPanelDepth(20, isSetBackViewDepthImmediately: true); - dialogBase.GetComponentInChildren().SetPanelDepth(25); - } - } - - public static bool HasKeyword(string skillDescText) - { - IList keywords = BattleKeywordInfoListMgr.GetKeywords(skillDescText); - bool result = false; - foreach (string item in keywords) - { - if (Data.Master.BattleKeyWordDic.ContainsKey(item)) - { - result = true; - break; - } - } - return result; - } - - private void SetNameLabel(BossRushLobbyAbilityData abilityData) - { - _nameLabel.text = abilityData.Name; - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(_nameLabel, abilityData.IsFoil); - } - - private IEnumerator LoadResources(List abilityList, Action callBack) - { - List list = new List(); - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - foreach (BossRushLobbyAbilityData ability in abilityList) - { - CardParameter cardParameterFromId = instance.GetCardParameterFromId(ability.DisplayCardId); - if (ability.IsFoil) - { - list.Add(cardParameterFromId.FoilCardId); - } - else - { - list.Add(ability.DisplayCardId); - } - } - float cardScale = 0.64f; - int depth = 5; - bool finish = false; - _cardLoader.Load(list, cardScale, depth, CardTemplateCustomize, delegate - { - finish = true; - }); - while (!finish) - { - yield return null; - } - callBack.Call(); - } - - private void CardTemplateCustomize(CardListTemplate cardTemplate) - { - cardTemplate.SetBossRushSkillFrame(); - cardTemplate.HideNum(); - cardTemplate.HideLabelsForBossRushSkill(); - cardTemplate.SetBossRushCardTexture(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyData.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyData.cs index b40061ac..58d6d634 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BossRushLobbyData.cs @@ -13,8 +13,6 @@ public class BossRushLobbyData FINISH_LOSE } - public const int MAX_TURN = 9999; - public List BossDataList { get; } public List AbilityList { get; } diff --git a/SVSim.BattleEngine/Engine/Wizard/BossRushSpecialSkill.cs b/SVSim.BattleEngine/Engine/Wizard/BossRushSpecialSkill.cs index 7a0149b9..4049ebea 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BossRushSpecialSkill.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BossRushSpecialSkill.cs @@ -12,8 +12,6 @@ public class BossRushSpecialSkill public string SkillDescText; - public bool IsEnemySkill => OriginalCardId == -1; - public bool IsFoil { get; set; } public BossRushSpecialSkill() diff --git a/SVSim.BattleEngine/Engine/Wizard/BreakTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/BreakTagCollection.cs index db707c7a..54805115 100644 --- a/SVSim.BattleEngine/Engine/Wizard/BreakTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/BreakTagCollection.cs @@ -73,9 +73,4 @@ public class BreakTagCollection : TagCollection } } } - - public static bool IsBreakTagType(AIPlayTagType type) - { - return _managedTagTypes.Contains(type); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/BuildDeckCard.cs b/SVSim.BattleEngine/Engine/Wizard/BuildDeckCard.cs deleted file mode 100644 index eefab52d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BuildDeckCard.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class BuildDeckCard -{ - public int _id; - - public int _cardId; - - public int _number; - - public bool IsSpotCard { get; private set; } - - public BuildDeckCard(string[] columns) - { - int num = 0; - _id = int.Parse(columns[num++]); - _cardId = int.Parse(columns[num++]); - _number = int.Parse(columns[num++]); - IsSpotCard = int.Parse(columns[num++]) != 0; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BuildDeckProductDetail.cs b/SVSim.BattleEngine/Engine/Wizard/BuildDeckProductDetail.cs deleted file mode 100644 index f62c100d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BuildDeckProductDetail.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System.Collections.Generic; -using System.Text; -using Cute; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase; - -namespace Wizard; - -public class BuildDeckProductDetail : BaseProductDetail -{ - [SerializeField] - private GameObject _labelSetHead; - - [SerializeField] - private GameObject _topLineCardList; - - [SerializeField] - private UILabel _labelCardNum; - - [SerializeField] - private GameObject _rewardCardParent; - - [SerializeField] - private GameObject _spotCardRoot; - - [SerializeField] - private GameObject _spotCardOriginal; - - [SerializeField] - private UIGrid _spotCardGrid; - - public void SetSingleProductDetail(BuildDeckProductInfo productInfo) - { - Texture textureProductImage = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(productInfo.saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail, isfetch: true)); - List list = new List(); - Dictionary dictionary = new Dictionary(); - Dictionary dictionary2 = new Dictionary(); - for (int i = 0; i < productInfo.rewardInfoList.Count; i++) - { - ShopCommonRewardInfo shopCommonRewardInfo = productInfo.rewardInfoList[i]; - if (shopCommonRewardInfo.Type == 5) - { - dictionary.Add((int)shopCommonRewardInfo.UserGoodsId, shopCommonRewardInfo.Num); - } - else - { - list.Add(productInfo.rewardInfoList[i]); - } - } - for (int j = 0; j < productInfo.cardList.Count; j++) - { - BuildDeckCard buildDeckCard = productInfo.cardList[j]; - if (CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(buildDeckCard._cardId).IsBasicCard) - { - continue; - } - if (buildDeckCard.IsSpotCard) - { - if (dictionary2.ContainsKey(buildDeckCard._cardId)) - { - dictionary2[buildDeckCard._cardId] = dictionary2[buildDeckCard._cardId] + buildDeckCard._number; - } - else - { - dictionary2[buildDeckCard._cardId] = buildDeckCard._number; - } - } - else if (dictionary.ContainsKey(buildDeckCard._cardId)) - { - dictionary[buildDeckCard._cardId] += buildDeckCard._number; - } - else - { - dictionary.Add(buildDeckCard._cardId, buildDeckCard._number); - } - } - _spotCardRoot.SetActive(dictionary2.Count > 0); - _spotCardOriginal.SetActive(value: true); - foreach (KeyValuePair item in dictionary2) - { - string userGoodsName = UserGoods.getUserGoodsName(UserGoods.Type.Card, item.Key); - NGUITools.AddChild(_spotCardOriginal.transform.parent.gameObject, _spotCardOriginal).GetComponent().text = Data.SystemText.Get("Shop_0121", userGoodsName, item.Value.ToString()); - } - _spotCardGrid.Reposition(); - _spotCardOriginal.SetActive(value: false); - List list2 = ConvertSortedCardList(dictionary, productInfo.featured_card_id); - if (_rewardCardParent != null) - { - _rewardCardParent.SetActive(list2.Count > 0); - } - StringBuilder stringBuilder = new StringBuilder(); - int num = 0; - for (int k = 0; k < list2.Count; k++) - { - int num2 = list2[k]; - string userGoodsName2 = UserGoods.getUserGoodsName(UserGoods.Type.Card, num2); - int num3 = dictionary[num2]; - stringBuilder.Append(Data.SystemText.Get("Shop_0121", userGoodsName2, num3.ToString())); - stringBuilder.Append("\n"); - num += num3; - } - _labelCardNum.text = Data.SystemText.Get("Shop_0119", num.ToString()); - if (list.Count <= 0 || productInfo.purchase_num_current > 0) - { - list.Clear(); - _labelSetHead.SetActive(value: false); - _topLineCardList.SetActive(value: false); - } - else - { - _labelSetHead.SetActive(value: true); - _topLineCardList.SetActive(value: true); - } - SetProductDetail(textureProductImage, list, stringBuilder.ToString()); - } - - private List ConvertSortedCardList(Dictionary rewardCardDict, int featuredCardId) - { - List list = new List(rewardCardDict.Keys); - list.Sort(delegate(int x, int y) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(x); - CardParameter cardParameterFromId2 = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(y); - if (cardParameterFromId.CardId == featuredCardId) - { - return -1; - } - if (cardParameterFromId2.CardId == featuredCardId) - { - return 1; - } - if (cardParameterFromId.IsPrizeCard && cardParameterFromId2.IsPrizeCard) - { - return 0; - } - if (cardParameterFromId.IsPrizeCard) - { - return -1; - } - if (cardParameterFromId2.IsPrizeCard) - { - return 1; - } - if (cardParameterFromId.Rarity != cardParameterFromId2.Rarity) - { - return cardParameterFromId2.Rarity.CompareTo(cardParameterFromId.Rarity); - } - return (cardParameterFromId.CardSetId != cardParameterFromId2.CardSetId) ? cardParameterFromId2.CardSetId.CompareTo(cardParameterFromId.CardSetId) : cardParameterFromId.CardId.CompareTo(cardParameterFromId2.CardId); - }); - return list; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/BuildDeckSeries.cs b/SVSim.BattleEngine/Engine/Wizard/BuildDeckSeries.cs deleted file mode 100644 index 867ce84c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/BuildDeckSeries.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class BuildDeckSeries : BaseSeriesData -{ - private int _index; - - public BuildDeckSeries(string[] columns) - { - base.Id = int.Parse(columns[_index++]); - base.Name = ConvSeriesText(columns[_index++]); - base.Introduction = ConvSeriesText(columns[_index++]); - base.TitlePath = columns[_index++]; - base.DrumrollPath = columns[_index++]; - } - - private string ConvSeriesText(string id) - { - return Data.Master.GetBuildDeckSeriesText(id); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CampaignBattleWin.cs b/SVSim.BattleEngine/Engine/Wizard/CampaignBattleWin.cs index 16c81687..920416c6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CampaignBattleWin.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CampaignBattleWin.cs @@ -8,14 +8,7 @@ public class CampaignBattleWin { public enum eBoxGrade { - None, - One, - Two, - Three, - Four, - Five, - Six - } + None } public enum eBoxStatus { @@ -62,16 +55,4 @@ public class CampaignBattleWin SpecialTreasureInfo = new SpecialTreasureInfo(json["special_treasure_info"]); } } - - public void Clear() - { - IsInSessionCampaign = false; - IsHaveSpecialWinReward = false; - RewardList = new List(); - } - - public void OnFinishCanpaignTime() - { - Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CardCSVData.cs b/SVSim.BattleEngine/Engine/Wizard/CardCSVData.cs index 9e3b3c8c..86d81464 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardCSVData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardCSVData.cs @@ -1,4 +1,8 @@ using System.Collections.Generic; +// TODO(engine-cleanup-pass2): 3 of 25 methods unrun in baseline +// Type: Wizard.CardCSVData +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -20,8 +24,6 @@ public class CardCSVData public string skill; - public string skill_name; - public string skill_timing; public string skill_condition; @@ -60,22 +62,6 @@ public class CardCSVData public string char_type; - public string evo_name; - - public string evo_skill; - - public string evo_skill_timing; - - public string evo_skill_condition; - - public string evo_skill_target; - - public string evo_skill_option; - - public string evo_skill_preprocess; - - public string evo_skill_name; - public string evo_skill_effect_path; public string evo_skill_se; @@ -270,24 +256,6 @@ public class CardCSVData } } - public void CorrectPremiumResourceId(Dictionary cardDictionary) - { - if (!string.IsNullOrEmpty(resource_card_id) && !(is_foil == "0")) - { - string text = cardDictionary[normal_card_id].resource_card_id; - if (text.Length > 9) - { - char c = text[text.Length - 1]; - text = text.Remove(text.Length - 1); - resource_card_id = cardDictionary[text].foil_card_id + c; - } - else - { - resource_card_id = cardDictionary[text].foil_card_id; - } - } - } - private string ConvOverwriteGetRedEther(string cardId, string getRedEther) { if (Data.Load.data.OverwriteGetRedEtherDict.ContainsKey(cardId)) diff --git a/SVSim.BattleEngine/Engine/Wizard/CardCraftPanel.cs b/SVSim.BattleEngine/Engine/Wizard/CardCraftPanel.cs index c7b43f95..ea205162 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardCraftPanel.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardCraftPanel.cs @@ -54,7 +54,7 @@ public class CardCraftPanel : MonoBehaviour { _redetherNumLabel.text = PlayerStaticData.UserRedEtherCount.ToString(); } - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr bool flag = dataMgr.FavoriteCardList.Contains(inCardParam.CardId); bool flag2 = dataMgr.GetPossessionCardNum(inCardParam.CardId, isIncludingSpotCard: false) == 0 && dataMgr.SpotCardData.ExistsSpotCard(inCardParam.CardId); bool flag3 = inCardParam.UseRedEther > 0; @@ -87,7 +87,7 @@ public class CardCraftPanel : MonoBehaviour _cantCreateDestructLabel.text = text; return; } - int possessionCardNum = GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(inCardParam.CardId, isIncludingSpotCard: true); + int possessionCardNum = 0; // Pre-Phase-5b: headless has no user inventory if (flag3) { _useRedetherLabel.text = inCardParam.UseRedEther.ToString(); diff --git a/SVSim.BattleEngine/Engine/Wizard/CardImageHelpder.cs b/SVSim.BattleEngine/Engine/Wizard/CardImageHelpder.cs deleted file mode 100644 index 45425049..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CardImageHelpder.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class CardImageHelpder : MonoBehaviour -{ - private List _loadList = new List(); - - private List _cardObjDataList; - - private static readonly List BOSS_RUSH_SPECIAL_CARD_ID = new List { 117231010, 117231011, 117241010, 117241011, 117341010, 117341011 }; - - public UIBase_CardManager.CardObjData GetCardObjData(int index) - { - return _cardObjDataList[index]; - } - - public void Load(List cardIdList, float cardScale, int depth, Action templateCustomize, Action onFinish) - { - StartCoroutine(LoadCoroutine(cardIdList, cardScale, depth, templateCustomize, onFinish)); - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadList); - _loadList.Clear(); - } - - public static string GetBossRushTexturePath(int id, bool isFetch) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(id); - return Toolbox.ResourcesManager.GetAssetTypePath(cardParameterFromId.BaseCardId.ToString(), ResourcesManager.AssetLoadPathType.BossRushSpecialCard, isFetch); - } - - public static bool IsSpecialCardId(int id) - { - return BOSS_RUSH_SPECIAL_CARD_ID.Contains(id); - } - - private IEnumerator LoadCoroutine(List cardIdList, float cardScale, int depth, Action templateCustomize, Action onFinish) - { - bool isLoaded = false; - List originalCardObjectList = null; - UIManager.GetInstance().CardLoadSelect(null, cardIdList, base.gameObject.layer, is2D: true, delegate - { - isLoaded = true; - originalCardObjectList = UIManager.GetInstance().getCardList2DObjs(); - foreach (UIBase_CardManager.CardObjData item in originalCardObjectList) - { - item.CardObj.SetActive(value: false); - } - }); - while (!isLoaded) - { - yield return null; - } - List specialCardLoadList = new List(); - foreach (int cardId in cardIdList) - { - if (IsSpecialCardId(cardId)) - { - specialCardLoadList.Add(GetBossRushTexturePath(cardId, isFetch: false)); - } - } - if (specialCardLoadList.Count > 0) - { - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(specialCardLoadList, delegate - { - })); - _loadList.AddRange(specialCardLoadList); - } - _cardObjDataList = new List(originalCardObjectList); - originalCardObjectList.Clear(); - List cardListAssetPathList = Toolbox.ResourcesManager.CardListAssetPathList; - _loadList.AddRange(new List(cardListAssetPathList)); - cardListAssetPathList.Clear(); - int num = 0; - List cloneCardList = new List(); - foreach (UIBase_CardManager.CardObjData cardObjData in _cardObjDataList) - { - int id = cardIdList[num]; - GameObject cardObj = cardObjData.CardObj; - CardListTemplate component = cardObj.GetComponent(); - GameObject gameObject = cardObj; - if (IsSpecialCardId(id)) - { - component.AttachCardTexture(Toolbox.ResourcesManager.LoadObject(GetBossRushTexturePath(id, isFetch: true)) as Texture); - } - cardObj = UnityEngine.Object.Instantiate(cardObjData.CardObj); - component = cardObj.GetComponent(); - _cardObjDataList[num].CardObj = cardObj; - cloneCardList.Add(cardObj); - cardObj.SetActive(value: true); - component.SetId(id); - component.SetScale(cardScale); - component.AddDepth(depth); - templateCustomize.Call(component); - gameObject.transform.parent = base.transform; - gameObject.SetActive(value: false); - num++; - } - foreach (GameObject item2 in cloneCardList) - { - item2.SetActive(value: false); - } - yield return null; - foreach (GameObject item3 in cloneCardList) - { - item3.SetActive(value: true); - } - onFinish(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CardListTemplate.cs b/SVSim.BattleEngine/Engine/Wizard/CardListTemplate.cs index f425ebe8..8b69b701 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardListTemplate.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardListTemplate.cs @@ -6,21 +6,6 @@ namespace Wizard; public class CardListTemplate : MonoBehaviour { - public static readonly Color NORMAL_COLOR_COST_LABEL_OUTLINE = new Color32(20, 71, 0, byte.MaxValue); - - public static readonly Color DARK_COLOR_COST_LABEL_OUTLINE = new Color32(7, 24, 0, byte.MaxValue); - - public static readonly Color NORMAL_COLOR_ATK_LABEL_OUTLINE = new Color32(0, 16, 96, byte.MaxValue); - - public static readonly Color DARK_COLOR_ATK_LABEL_OUTLINE = new Color32(0, 5, 32, byte.MaxValue); - - public static readonly Color NORMAL_COLOR_LIFE_LABEL_OUTLINE = new Color32(88, 0, 0, byte.MaxValue); - - public static readonly Color DARK_COLOR_LIFE_LABEL_OUTLINE = new Color32(29, 0, 0, byte.MaxValue); - - public static readonly Color NORMAL_COLOR_PREMIRE_CARD_NAME_OUTLINE = new Color32(92, 56, 3, byte.MaxValue); - - public static readonly Color DARK_COLOR_PREMIRE_CARD_NAME_OUTLINE = new Color32(31, 19, 1, byte.MaxValue); public static readonly Color RED_COLOR_NAME = new Color32(215, 142, 153, byte.MaxValue); @@ -28,32 +13,6 @@ public class CardListTemplate : MonoBehaviour public static readonly Color RED_COLOR_EFFECT = new Color32(121, 0, 41, byte.MaxValue); - private const string SHADER_NAME_DEFAULT = "Unlit/Transparent Colored"; - - private const string SHADER_NAME_GRAY = "Wizard/Card/GrayOut"; - - private const string SHADER_NAME_RED = "Wizard/Card/RedOut"; - - private const string SHADER_NAME_GRAY_SPRITE = "Wizard/Card/GrayOutSprite"; - - private const string SHADER_NAME_RED_SPRITE = "Wizard/Card/RedOutSprite"; - - private const string SPRITE_NORMAL_SHADER = "Unlit/JongTransparent Colored"; - - private const string FRAME_SPRITE_NAME_FORMAT_FOLLOWER = "frame_card_unit_{0:D2}{1}"; - - private const string FRAME_SPRITE_NAME_FORMAT_SPELL = "frame_card_spell_{0:D2}{1}"; - - private const string FRAME_SPRITE_NAME_FORMAT_AMULET = "frame_card_field_{0:D2}{1}"; - - private const string FRAME_SPRITE_NAME_SUFFIX_PHANTOM = "_phantom"; - - private const string FRAME_SKILL_NAME = "frame_skill"; - - public const string SPOT_CARD_COLOR_TEXT = "[fcd24a]"; - - public const string SPOT_CARD_TEXT_FORMAT = "{0}[fcd24a]+{1}"; - [SerializeField] private GameObject _numRoot; @@ -102,9 +61,6 @@ public class CardListTemplate : MonoBehaviour [SerializeField] private GameObject _infoRoot; - [SerializeField] - private UILabel _infoLabel; - private int _id; private int _num; @@ -171,11 +127,6 @@ public class CardListTemplate : MonoBehaviour _id = id; } - public int GetId() - { - return _id; - } - public void SetNum(int num, int spotCardNum = 0) { _num = num; @@ -186,7 +137,7 @@ public class CardListTemplate : MonoBehaviour normalNumLabel.text = text2; if (!_isHidingNum && _isFaceUp) { - if (_isShowingNormalNum || !GameMgr.GetIns().GetDataMgr().FavoriteCardList.Contains(_id)) + if (_isShowingNormalNum /* Pre-Phase-5b: no favorites headless */) { _normalNumRoot.SetActive(value: true); _favoriteNumRoot.SetActive(value: false); @@ -222,15 +173,6 @@ public class CardListTemplate : MonoBehaviour _favoriteNumRoot.SetActive(value: false); } - public void HideLabelsForBossRushSkill() - { - _nameLabel.gameObject.SetActive(value: false); - _atkLabel.gameObject.SetActive(value: false); - _lifeLabel.gameObject.SetActive(value: false); - _costLabel.gameObject.SetActive(value: false); - _newLabel.gameObject.SetActive(value: false); - } - public void ChangeShowNumType(bool isNormal) { _isShowingNormalNum = isNormal; @@ -260,36 +202,6 @@ public class CardListTemplate : MonoBehaviour _favoriteNumRoot.SetActive(value: false); } - private void RemoveDuplicatedCardMaterial() - { - if (_duplicatedCardMaterial != null) - { - Object.Destroy(_duplicatedCardMaterial); - _duplicatedCardMaterial = null; - } - } - - private void OnDestroy() - { - RemoveDuplicatedCardMaterial(); - } - - public void AttachCardTexture(Texture texture) - { - _cardTexture.mainTexture = texture; - if (_cardTexture.material != null) - { - if (_duplicatedCardMaterial == null) - { - _duplicatedCardMaterial = new Material(_cardTexture.material); - } - _duplicatedCardMaterial.mainTexture = texture; - _cardTexture.material = _duplicatedCardMaterial; - } - _cardTexture.enabled = false; - _cardTexture.enabled = true; - } - public void AttachNormalShaderRotationOnlyIcon() { _rotationOnlyIcon.SetShader(_spriteNormalShader); @@ -429,16 +341,6 @@ public class CardListTemplate : MonoBehaviour _infoRoot.SetActive(visible); } - public void SetInfoLabelText(string text) - { - _infoLabel.text = text; - } - - public void SetInfoLabelTextColor(Color color) - { - _infoLabel.color = color; - } - public void SetFrame(CardParameter cardParam) { string arg = string.Empty; @@ -466,30 +368,6 @@ public class CardListTemplate : MonoBehaviour UIManager.GetInstance().AttachAtlas(_frameSprite.gameObject); } - public void SetBossRushSkillFrame() - { - UIAtlas atlas = UIManager.GetInstance().GetAtlasList().FirstOrDefault((UIAtlas s) => s.name == "BossRush"); - _frameSprite.spriteName = "frame_skill"; - _frameSprite.atlas = atlas; - _classIconTexture.gameObject.SetActive(value: false); - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(_id); - _skillClassIconBossRush.atlas = atlas; - _skillClassIconBossRush.spriteName = "class_skill_" + ((int)cardParameterFromId.Clan).ToString("00"); - _skillClassIconBossRush.gameObject.SetActive(value: true); - } - - public void SetBossRushIconSprite(string spriteName) - { - _skillClassIconBossRush.spriteName = spriteName; - } - - public void SetBossRushCardTexture() - { - _cardTexture.uvRect = new Rect(0f, 0f, 1f, 1f); - _cardTexture.height = 207; - _cardTexture.transform.localPosition = new Vector3(_cardTexture.transform.localPosition.x, -10.5f, _cardTexture.transform.localPosition.z); - } - public void SetParentAndResetPos(Transform parent) { base.transform.parent = parent; @@ -520,24 +398,4 @@ public class CardListTemplate : MonoBehaviour obj.AddComponent().size = _frameSprite.localSize * scale; return UIEventListener.Get(obj); } - - public void HideNewLabel() - { - _newLabel.gameObject.SetActive(value: false); - } - - public void SetNewLabelPos(Vector3 pos) - { - _newLabel.transform.localPosition = pos; - } - - public void ReplaceMaterialToTexture() - { - Material material = _cardTexture.material; - if (material != null) - { - _cardTexture.mainTexture = material.mainTexture; - _cardTexture.material = null; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CardListsForReference.cs b/SVSim.BattleEngine/Engine/Wizard/CardListsForReference.cs index 57295335..dcd28280 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardListsForReference.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardListsForReference.cs @@ -25,7 +25,6 @@ public class CardListsForReference GetOn, WhenGetOff, OtherSummon, - RemoveTag, Bounce, RallyCountPlus, WhenNecromance, @@ -83,8 +82,6 @@ public class CardListsForReference public List OtherAttackDamageHolders => _tagHoldersList[TagHolderReferenceType.OtherAttackDamage]; - public List OtherAttackTokenHolders => _tagHoldersList[TagHolderReferenceType.OtherAttackToken]; - public List AllyPlayoutDamageBonusHolders => _tagHoldersList[TagHolderReferenceType.AllyPlayoutDamageBonus]; public List OtherBreakBonusHolders => _tagHoldersList[TagHolderReferenceType.OtherBreakBonus]; @@ -103,8 +100,6 @@ public class CardListsForReference public List GetOnTagHolders => _tagHoldersList[TagHolderReferenceType.GetOn]; - public List WhenGetoffTagHolders => _tagHoldersList[TagHolderReferenceType.WhenGetOff]; - public List BounceTagHolders => _tagHoldersList[TagHolderReferenceType.Bounce]; public List OtherSummonTagHolders => _tagHoldersList[TagHolderReferenceType.OtherSummon]; @@ -115,8 +110,6 @@ public class CardListsForReference public List TurnStartTagHolders => _tagHoldersList[TagHolderReferenceType.TurnStart]; - public List SelfTurnEndTagHolders => _tagHoldersList[TagHolderReferenceType.SelfTurnEnd]; - public List ForceBerserkTagHolders => _tagHoldersList[TagHolderReferenceType.ForceBerserk]; public List RemoveByDestroyHolders => _tagHoldersList[TagHolderReferenceType.RemoveByDestroy]; @@ -313,18 +306,6 @@ public class CardListsForReference } } - public bool HasSelfTurnEndHolder - { - get - { - if (SelfTurnEndTagHolders != null) - { - return SelfTurnEndTagHolders.Count > 0; - } - return false; - } - } - public bool HasWhenChangeInplayHolder { get diff --git a/SVSim.BattleEngine/Engine/Wizard/CardMaster.cs b/SVSim.BattleEngine/Engine/Wizard/CardMaster.cs index 3afd0dc7..46c0a4ae 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardMaster.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardMaster.cs @@ -4,6 +4,10 @@ using System.Linq; using Cute; using LitJson; using Wizard.Battle.Recovery; +// TODO(engine-cleanup-pass2): 19 of 25 methods unrun in baseline +// Type: Wizard.CardMaster +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -32,11 +36,7 @@ public class CardMaster public enum CardMasterId { - Default = 1, - NextCardMaster - } - - private const int CARD_ID_CLASS_CHECK = 100; + Default = 1 } private static Dictionary _dictCardMaster = null; @@ -80,101 +80,6 @@ public class CardMaster _classCardParam = new CardParameter(); } - public static void InitializeCardMaster(UpdateInfo cardMasterUpdateInfo, Action onSuccess) - { - Dictionary dictCardMasterCSV = null; - if (cardMasterUpdateInfo.NeedUpdateLocalCardMaster) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: false, notCollider: false, force: false, Data.SystemText.Get("System_0053")); - GetCardMasterTask task = new GetCardMasterTask(cardMasterUpdateInfo.NewCardMasterHash); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - dictCardMasterCSV = ParseJsonToCardMasterCSV(task.CardMasterJsonData); - SaveLocalCardMasterCSV(dictCardMasterCSV, cardMasterUpdateInfo.NewCardMasterHash); - CreateAllCardMasterByCSV(dictCardMasterCSV); - onSuccess.Call(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode, encrypt: true, useJson: false, showLoadingIcon: false)); - ClearSaveData(); - } - else if (CardMasterLocalFileUtility.ReadLocalCardMasterCSV(out dictCardMasterCSV)) - { - CreateAllCardMasterByCSV(dictCardMasterCSV); - onSuccess.Call(); - } - } - - private static void ClearSaveData() - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.DECK_INTRO_IS_MYROTATION_COPY_EQUAL_PERIOD, flag: false); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.DECK_INTRO_IS_MYROTATION_COPY_NOT_EQUAL_PERIOD, flag: true); - } - - private static void SaveLocalCardMasterCSV(Dictionary dictCardMasterCSV, string cardMasterHash) - { - CardMasterLocalFileUtility.WriteAllCardMasterLocalFile(dictCardMasterCSV, cardMasterHash); - RecoveryRecordManagerBase.DeleteRecoveryFile(); - } - - private static void CreateAllCardMasterByCSV(Dictionary dictCardMasterCSV) - { - if (_dictCardMaster == null) - { - _dictCardMaster = new Dictionary(); - } - foreach (KeyValuePair item in dictCardMasterCSV) - { - CardMaster cardMaster = CreateCardMaster(item.Key, item.Value); - if (cardMaster != null) - { - _dictCardMaster[item.Key] = cardMaster; - } - } - } - - private static Dictionary ParseJsonToCardMasterCSV(JsonData cardMaster) - { - Dictionary dictionary = new Dictionary(); - foreach (CardMasterId value in Enum.GetValues(typeof(CardMasterId))) - { - int num = (int)value; - string text = num.ToString(); - if (cardMaster.Keys.Contains(text)) - { - string text2 = cardMaster[text].ToString(); - if (text2 != "") - { - dictionary[value] = text2; - } - } - } - return dictionary; - } - - private static CardMaster CreateCardMaster(CardMasterId cardMasterId, string cardMasterCSV) - { - if (cardMasterCSV == "") - { - return null; - } - List list = Utility.ConvertCSV_Array(cardMasterCSV, removeTitle: false); - int count = list.Count; - List list2 = new List(count); - Dictionary dictionary = new Dictionary(count); - int num = 0; - foreach (string[] item in list) - { - CardCSVData cardCSVData = new CardCSVData(item, num); - list2.Add(cardCSVData); - dictionary.Add(cardCSVData.card_id, cardCSVData); - num++; - } - foreach (CardCSVData item2 in list2) - { - item2.CorrectPremiumResourceId(dictionary); - } - return new CardMaster(list2); - } - public static bool IsClass(int cardId) { return cardId < 100; @@ -214,12 +119,6 @@ public class CardMaster return value; } - public CardParameter GetCardParamFromCardHashId(string cardHashId) - { - _hashIdCardId.TryGetValue(cardHashId, out var value); - return GetCardParameterFromId(value); - } - public bool CardExists(int cardId) { return m_cardParameters.Keys.Contains(cardId); diff --git a/SVSim.BattleEngine/Engine/Wizard/CardMasterLocalFileUtility.cs b/SVSim.BattleEngine/Engine/Wizard/CardMasterLocalFileUtility.cs index 4324f6d4..7e5fefb7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardMasterLocalFileUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardMasterLocalFileUtility.cs @@ -39,102 +39,6 @@ public static class CardMasterLocalFileUtility return result; } - public static bool ReadLocalCardMasterCSV(out Dictionary dictCardMasterCsv) - { - dictCardMasterCsv = new Dictionary(); - foreach (CardMaster.CardMasterId value in Enum.GetValues(typeof(CardMaster.CardMasterId))) - { - string cardMasterFilePath = GetCardMasterFilePath(value); - if (!File.Exists(cardMasterFilePath)) - { - continue; - } - try - { - using StreamReader streamReader = new StreamReader(cardMasterFilePath); - if (value == CardMaster.CardMasterId.Default) - { - streamReader.ReadLine(); - } - dictCardMasterCsv[value] = CryptAES.decryptForNode(streamReader.ReadToEnd()); - } - catch (Exception ex) - { - WriteClientInfoLog("CardMasater: \"" + cardMasterFilePath + "\" の読み込みに失敗\n" + ex); - CreateMasterReadErrorDialog(); - return false; - } - } - return true; - } - - private static void CreateMasterReadErrorDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("System_0055")); - dialogBase.SetText(Data.SystemText.Get("System_0056")); - DeleteAllCardMasterLocalFile(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BackToTitleBtn); - dialogBase.SetFadeButtonEnabled(flag: false); - } - - public static void WriteAllCardMasterLocalFile(Dictionary dictCardMasterCSV, string cardMasterHash) - { - DeleteAllCardMasterLocalFile(); - Directory.CreateDirectory(CardMasterDirPath); - foreach (KeyValuePair item in dictCardMasterCSV) - { - CardMaster.CardMasterId key = item.Key; - string value = item.Value; - if (!(value == "")) - { - string text = null; - if (key == CardMaster.CardMasterId.Default) - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.AppendLine(CryptAES.encryptForNode(cardMasterHash)); - stringBuilder.AppendLine(CryptAES.encryptForNode(value)); - text = stringBuilder.ToString(); - } - else - { - text = CryptAES.encryptForNode(value); - } - WriteCardMasterLocalFile(key, text); - } - } - } - - private static void WriteCardMasterLocalFile(CardMaster.CardMasterId cardMasterId, string writeStr) - { - string cardMasterFilePath = GetCardMasterFilePath(cardMasterId); - try - { - File.WriteAllText(cardMasterFilePath, writeStr); - } - catch (Exception ex) - { - WriteClientInfoLog("CardMasater: \"" + cardMasterFilePath + "\" の書き込みに失敗\n" + ex); - DeleteAllCardMasterLocalFile(); - } - } - - public static void DeleteAllCardMasterLocalFile() - { - try - { - if (Directory.Exists(CardMasterDirPath)) - { - Directory.Delete(CardMasterDirPath, recursive: true); - } - } - catch (Exception ex) - { - WriteClientInfoLog("CardMasaterディレクトリ: \"" + CardMasterDirPath + "\" の削除に失敗\n" + ex); - } - } - private static void WriteClientInfoLog(string log) { LocalLog.AccumulateTraceLog(log); diff --git a/SVSim.BattleEngine/Engine/Wizard/CardParameter.cs b/SVSim.BattleEngine/Engine/Wizard/CardParameter.cs index 4685201e..f809a338 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardParameter.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardParameter.cs @@ -5,6 +5,10 @@ using System.Linq; using System.Text; using UnityEngine; using Wizard.Battle.View; +// TODO(engine-cleanup-pass2): 70 of 178 methods unrun in baseline +// Type: Wizard.CardParameter +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -12,9 +16,6 @@ public class CardParameter { public class AttackEffectParameter { - private const int NORMAL = 0; - - private const int EVOLVE = 1; private List _effectPath; @@ -77,34 +78,8 @@ public class CardParameter int index = (isEvolve ? 1 : 0); return _effectPath[index]; } - - public string GetSe(bool isEvolve) - { - int index = (isEvolve ? 1 : 0); - return _se[index]; - } - - public EffectMgr.MoveType GetMoveType(bool isEvolve) - { - int index = (isEvolve ? 1 : 0); - return _moveType[index]; - } - - public EffectMgr.EngineType GetEffectEnginType(bool isEvolve) - { - int index = (isEvolve ? 1 : 0); - return _effectEnginType[index]; - } - - public float GetTime(bool isEvolve) - { - int index = (isEvolve ? 1 : 0); - return _time[index]; - } } - public const string TRIBE_NAME_ALL = "ALL"; - private static readonly Vector4 DEFAULT_TEXTURE_TILLILNG_OFFSET = new Vector4(1f, 1f, 0f, 0f); private string _cardNameId = string.Empty; @@ -139,8 +114,6 @@ public class CardParameter private string _convertedEvoSkillDescription; - private const int VARIABLE_COST = -99; - public string CardName { get diff --git a/SVSim.BattleEngine/Engine/Wizard/CardProtectTask.cs b/SVSim.BattleEngine/Engine/Wizard/CardProtectTask.cs index 9a41b830..54fdf46f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardProtectTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardProtectTask.cs @@ -33,7 +33,7 @@ public class CardProtectTask : BaseTask { return num; } - List favoriteCardList = GameMgr.GetIns().GetDataMgr().FavoriteCardList; + List favoriteCardList = new List(); // Pre-Phase-5b: no favorites headless if (_param.is_protected) { favoriteCardList.Add(_param.card_id); diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/CardSelectDialog.cs index 59fa7205..3804f34c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardSelectDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardSelectDialog.cs @@ -38,12 +38,6 @@ public class CardSelectDialog : MonoBehaviour [SerializeField] private GameObject _cardDetailRoot; - private const int FIRST_PAGE_NO = 1; - - private const int MAX_NUM_PER_PAGE = 3; - - private const float DRAG_THRESHOLD = 70f; - private int _activePageNo = 1; private int _pageNum; @@ -100,12 +94,6 @@ public class CardSelectDialog : MonoBehaviour IsReady = true; } - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_unloadAssetList); - _unloadAssetList.Clear(); - } - private IEnumerator CreateCardObjectCoroutine(List cardList) { bool isCreated = false; @@ -149,7 +137,7 @@ public class CardSelectDialog : MonoBehaviour }; uIEventListener.onDragStart = OnDragStart; uIEventListener.onDrag = OnDrag; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr cardSelectDialogObject.PossessionNumLabel.text = string.Format(Data.SystemText.Get("Sealed_RewardCardSelect_0005"), dataMgr.GetPossessionCardNum(cardObjData.ids, isIncludingSpotCard: false).ToString(), dataMgr.SpotCardData.ExistsSpotCard(cardObjData.ids) ? $"[fcd24a]+{dataMgr.SpotCardData.GetSpotCardNum(cardObjData.ids).ToString()}[-]" : string.Empty); } _objectsGrid.Reposition(); @@ -199,7 +187,7 @@ public class CardSelectDialog : MonoBehaviour bool flag = _activePageNo == 1; if (!flag || _isLoopPage) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + SetActivePage(flag ? _pageNum : (_activePageNo - 1)); } } @@ -209,7 +197,7 @@ public class CardSelectDialog : MonoBehaviour bool flag = _activePageNo == _pageNum; if (!flag || _isLoopPage) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + SetActivePage(flag ? 1 : (_activePageNo + 1)); } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSelectListConfirmPagerView.cs b/SVSim.BattleEngine/Engine/Wizard/CardSelectListConfirmPagerView.cs index fa87074a..46379695 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardSelectListConfirmPagerView.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardSelectListConfirmPagerView.cs @@ -7,11 +7,6 @@ namespace Wizard; public class CardSelectListConfirmPagerView : MonoBehaviour { - private const float CARD_SCALE = 0.55f; - - private const int CARD_NUM_PER_PAGE = 8; - - private const float DRAG_VALUE = 70f; [SerializeField] private UIButton _buttonNext; @@ -19,9 +14,6 @@ public class CardSelectListConfirmPagerView : MonoBehaviour [SerializeField] private UIButton _buttonPrev; - [SerializeField] - private GameObject _pagingDragPanel; - [SerializeField] private UIGrid _gridCardList; @@ -44,8 +36,6 @@ public class CardSelectListConfirmPagerView : MonoBehaviour private Dictionary _dictCardIdNum = new Dictionary(); - public Action OnCallbackRemoveCard; - protected int _currentPage; private List _indicatorList = new List(); @@ -58,8 +48,6 @@ public class CardSelectListConfirmPagerView : MonoBehaviour private bool _isDrag; - public List LoadedAssetPathList => _loadedAssetPathList; - public Dictionary DictCardIdNum { get @@ -72,12 +60,6 @@ public class CardSelectListConfirmPagerView : MonoBehaviour } } - private void Start() - { - UIEventListener.Get(_pagingDragPanel).onDrag = OnDrag; - UIEventListener.Get(_pagingDragPanel).onDragEnd = OnDragEnd; - } - private void OnDrag(GameObject obj, Vector2 dir) { if (!_isDrag && Mathf.Abs(dir.x) >= 70f) @@ -262,7 +244,7 @@ public class CardSelectListConfirmPagerView : MonoBehaviour uIEventListener.onClick = _cardDetailUI.OnPushCardDetailOn; uIEventListener.onDrag = OnDrag; uIEventListener.onDragEnd = OnDragEnd; - if (GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(ids)) + if (false /* Pre-Phase-5b: no maintenance list */) { SetBlackOutCardInfoText(cardObj, text); } @@ -305,7 +287,7 @@ public class CardSelectListConfirmPagerView : MonoBehaviour if (_isInit && !_cardDetailUI.GetIsDetailOn() && _currentPage < _dictPageCardObj.Count) { ViewCardList(++_currentPage); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + } } @@ -314,7 +296,7 @@ public class CardSelectListConfirmPagerView : MonoBehaviour if (_isInit && !_cardDetailUI.GetIsDetailOn() && _currentPage > 1) { ViewCardList(--_currentPage); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + } } @@ -344,7 +326,7 @@ public class CardSelectListConfirmPagerView : MonoBehaviour private List SortCardIdList(List idList) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr List list = new List(); List list2 = new List(); List list3 = new List(); diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSetNameMgr.cs b/SVSim.BattleEngine/Engine/Wizard/CardSetNameMgr.cs index e30da26b..df606ab9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardSetNameMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardSetNameMgr.cs @@ -4,23 +4,6 @@ namespace Wizard; public class CardSetNameMgr { - public const int BASIC_CARD_SET_ID = 10000; - - private const int MIN_STANDARD_PACK_ID = 10001; - - private const int MAX_STANDARD_PACK_ID = 14999; - - private const int MIN_COLLABO_PACK_ID = 20001; - - private const int MAX_COLLABO_PACK_ID = 24999; - - private const int TOKEN_CARD_SET_ID = 90000; - - public const int SPECIAL_CARD_PACK_ID = 90002; - - private const int MIN_PRIZE_SET_ID = 70000; - - private const int MAX_PRIZE_SET_ID = 79999; private List _list = new List(); @@ -40,15 +23,6 @@ public class CardSetNameMgr return setId == 10000; } - public static bool IsStandardPackSetId(int setId) - { - if (10001 <= setId) - { - return setId <= 14999; - } - return false; - } - public static bool IsTokenSetId(int setId) { return setId == 90000; @@ -63,22 +37,6 @@ public class CardSetNameMgr return false; } - public void Add(CardSetName cardSetName) - { - _list.Add(cardSetName); - } - - public void Setup() - { - _list.Sort((CardSetName a, CardSetName b) => a.ID.CompareTo(b.ID)); - _listBasicAndPack = _list.FindAll((CardSetName cardSetName) => int.TryParse(cardSetName.ID, out var result) && IsBasicAndStandardPack(result)); - } - - public List GetList() - { - return _list; - } - public List GetListBasicAndPack() { return _listBasicAndPack; @@ -93,13 +51,4 @@ public class CardSetNameMgr } return cardSetName; } - - private bool IsBasicAndStandardPack(int setId) - { - if (!IsBasicSetId(setId)) - { - return IsStandardPackSetId(setId); - } - return true; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSkillHashUtility.cs b/SVSim.BattleEngine/Engine/Wizard/CardSkillHashUtility.cs index df54df05..4ba1e591 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CardSkillHashUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CardSkillHashUtility.cs @@ -4,22 +4,6 @@ namespace Wizard; public static class CardSkillHashUtility { - public static int NEWEST_CARD_SKILL_HASH_VERSION = 1; - - public static ulong GetSkillHash(BattleCardBase card, int skillHashVersion) - { - return 0 + GetSkillCollectionHash(card.Skills) * 2591 + GetSkillApplyInformationHash(card.SkillApplyInformation, skillHashVersion) * 131; - } - - private static ulong GetSkillCollectionHash(SkillCollectionBase skillCollection) - { - ulong num = 0uL; - foreach (SkillBase item in skillCollection) - { - num += GetSingleSkillBaseHash(item); - } - return num; - } public static List GetSingleSkillHashStringList(SkillCollectionBase skillCollection) { @@ -61,32 +45,4 @@ public static class CardSkillHashUtility } return num + (ulong)((long)text3.GetHashCode() * 227L); } - - private static ulong GetSkillApplyInformationHash(ISkillApplyInformation skillApplyInformation, int version) - { - ulong num = 0uL; - if (version >= 1) - { - num += GetRepeatSkillTimingInfoHash(skillApplyInformation.RepeatSkillTimingList); - } - return num; - } - - private static ulong GetRepeatSkillTimingInfoHash(List repeatSkillInfoList) - { - ulong num = 0uL; - if (repeatSkillInfoList == null || repeatSkillInfoList.Count <= 0) - { - return num; - } - for (int i = 0; i < repeatSkillInfoList.Count; i++) - { - RepeatSkillInfo repeatSkillInfo = repeatSkillInfoList[i]; - num += (ulong)((long)repeatSkillInfo.Timing.GetHashCode() * 37L); - num += (ulong)((long)repeatSkillInfo.Target.GetHashCode() * 67L); - num += GetSingleSkillBaseHash(repeatSkillInfo.Skill); - num += (ulong)(repeatSkillInfo.IsRemoveReservation ? 127 : 0); - } - return num; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSleeveDetailWindow.cs b/SVSim.BattleEngine/Engine/Wizard/CardSleeveDetailWindow.cs deleted file mode 100644 index e77eae49..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CardSleeveDetailWindow.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.SleevePurchase; - -namespace Wizard; - -public class CardSleeveDetailWindow : MonoBehaviour -{ - private const int GRID_CELL_WIDTH_BOUNDARY_COUNT = 5; - - private const int GRID_CELL_WIDTH_DEFAULT = 182; - - private const int GRID_CELL_WIDTH_5_ITEMS = 160; - - [SerializeField] - private UIGrid _rewardGrid; - - [SerializeField] - private GameObject _specialLayoutParent; - - [SerializeField] - private UILabel _labelDescription; - - [SerializeField] - private CardSleeveRewardView _cardSleeveRewardView; - - public void SetData(SleeveProductInfo productInfo, Dictionary cardPool) - { - string description = Data.SystemText.Get("Shop_0102", productInfo.saleInfo.name.Replace("\n", "")); - SetData(productInfo.rewardInfoList, description, cardPool); - } - - public void SetData(List rewardInfoList, string description, Dictionary cardPool) - { - _labelDescription.text = description; - GameObject parent = (_cardSleeveRewardView.IsSpecialLayout(rewardInfoList) ? _specialLayoutParent : _rewardGrid.gameObject); - _cardSleeveRewardView.SetRewardItems(rewardInfoList, parent, cardPool); - if (rewardInfoList.Count >= 5) - { - _rewardGrid.cellWidth = 160f; - } - else - { - _rewardGrid.cellWidth = 182f; - } - _rewardGrid.Reposition(); - _cardSleeveRewardView.CheckSpecialLayout(parent, rewardInfoList); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSleeveRewardItem.cs b/SVSim.BattleEngine/Engine/Wizard/CardSleeveRewardItem.cs deleted file mode 100644 index 7acab58b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CardSleeveRewardItem.cs +++ /dev/null @@ -1,96 +0,0 @@ -using Cute; -using UnityEngine; - -namespace Wizard; - -public class CardSleeveRewardItem : MonoBehaviour -{ - [SerializeField] - private UITexture _rewardTexture; - - [SerializeField] - private UILabel _rewardLabel; - - [SerializeField] - private UILabel _alreadyGetLabel; - - [SerializeField] - private GameObject _cardObjectParent; - - [SerializeField] - private GameObject _cardMask; - - public UITexture RewardTexture => _rewardTexture; - - public ShopCommonRewardInfo Info { get; private set; } - - public GameObject CardObjectParent => _cardObjectParent; - - public void SetReward(ShopCommonRewardInfo rewardInfo) - { - Info = rewardInfo; - if (RewardTexture != null) - { - if (rewardInfo.Type == 6) - { - Sleeve sleeve = Data.Master.SleeveMgr.Get(rewardInfo.UserGoodsId); - UIManager.GetInstance().getUIBase_CardManager().SetSleeveTexture(RewardTexture, sleeve.sleeve_id); - } - else if (rewardInfo.Type == 7) - { - string rewardImagePath = ShopCommonUtility.GetRewardImagePath(rewardInfo, isFetch: true); - RewardTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(rewardImagePath); - RewardTexture.material = null; - } - else - { - _ = rewardInfo.Type; - _ = 5; - } - } - if (_rewardLabel != null) - { - if (rewardInfo.Type == 5) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId((int)rewardInfo.UserGoodsId); - _rewardLabel.SetWrapText(cardParameterFromId.CardName); - } - else - { - _rewardLabel.SetWrapText(ShopCommonUtility.GetRewardDetailName(rewardInfo)); - } - } - } - - public void SetArleadyGetVisible(bool visible) - { - if (!(_alreadyGetLabel == null)) - { - _alreadyGetLabel.gameObject.SetActive(visible); - if (RewardTexture != null) - { - UIManager.SetObjectToGrey(RewardTexture.gameObject, visible); - } - if (_cardMask != null) - { - _cardMask.SetActive(visible); - } - } - } - - public void ChangeNameLabelPosition(Vector3 localPosition) - { - if (_rewardLabel != null) - { - _rewardLabel.transform.localPosition = localPosition; - } - } - - public void ChangeNameLabelWidth(int width) - { - if (_rewardLabel != null) - { - _rewardLabel.width = width; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CardSleeveRewardView.cs b/SVSim.BattleEngine/Engine/Wizard/CardSleeveRewardView.cs deleted file mode 100644 index 24eaf406..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CardSleeveRewardView.cs +++ /dev/null @@ -1,315 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace Wizard; - -public class CardSleeveRewardView : MonoBehaviour -{ - private const int MAX_VIEW_REWARD = 5; - - private readonly Vector3[] SPECIAL_LAYOUT_POSITION = new Vector3[5] - { - new Vector3(-303f, 0f, 0f), - new Vector3(-122f, 46f, 0f), - new Vector3(-51f, -51f, 0f), - new Vector3(127f, 0f, 0f), - new Vector3(303f, 0f, 0f) - }; - - private readonly Vector3[] SPECIAL_LAYOUT_SCALE = new Vector3[5] - { - Vector3.one, - new Vector3(0.9f, 0.9f, 1f), - new Vector3(0.9f, 0.9f, 1f), - Vector3.one, - Vector3.one - }; - - private readonly int[] LABEL_OVERRIDE_INDEX = new int[2] { 1, 2 }; - - private readonly Vector3[] LABEL_OVERRIDE_POSITION = new Vector3[2] - { - new Vector3(38f, -181f, 0f), - new Vector3(-41f, -124f, 0f) - }; - - private readonly int[] LABEL_OVERRIDE_WIDTH = new int[2] { 170, 170 }; - - [SerializeField] - private CardSleeveRewardItem _sleeveItemOriginal; - - [SerializeField] - private CardSleeveRewardItem _emblemItemOriginal; - - [SerializeField] - private CardSleeveRewardItem _cardItemOriginal; - - [SerializeField] - private bool _enableAlreadyGetCheck; - - [SerializeField] - private bool _isEnablePremiumShader; - - [SerializeField] - private bool _isEnableCardClickCollider; - - [SerializeField] - private int _cardDepthOffset; - - [SerializeField] - private bool _isEnableHaveCardCount = true; - - private List _cloneCardList = new List(); - - [SerializeField] - private GameObject _cardDetailPrefab; - - private static int DetailLayer; - - private CardDetailUI _cardDetail; - - private List _sleeveItemList = new List(); - - private List _emblemItemList = new List(); - - private List _cardItemList = new List(); - - public List SetRewardItems(List infoList, GameObject parent, Dictionary cardPool) - { - List viewRewardList = GetViewRewardList(infoList); - List list = SortRewardList(viewRewardList); - HideAllItems(); - int num = 0; - int num2 = 0; - List list2 = new List(); - int num3 = 0; - for (int i = 0; i < list.Count; i++) - { - CardSleeveRewardItem cardSleeveRewardItem = null; - switch ((UserGoods.Type)list[i].Type) - { - case UserGoods.Type.Card: - cardSleeveRewardItem = CreateCard(parent, viewRewardList[i], num3++, cardPool); - break; - case UserGoods.Type.Sleeve: - if (num < _sleeveItemList.Count) - { - cardSleeveRewardItem = _sleeveItemList[num]; - } - else - { - cardSleeveRewardItem = NGUITools.AddChild(parent, _sleeveItemOriginal.gameObject).GetComponent(); - cardSleeveRewardItem.transform.localPosition = new Vector3(cardSleeveRewardItem.transform.localPosition.x, cardSleeveRewardItem.transform.localPosition.y, 10f); - _sleeveItemList.Add(cardSleeveRewardItem); - } - if (_enableAlreadyGetCheck) - { - cardSleeveRewardItem.SetArleadyGetVisible(Data.Master.SleeveMgr.Get(list[i].UserGoodsId).IsAcquired); - } - num++; - break; - case UserGoods.Type.Emblem: - if (num2 < _emblemItemList.Count) - { - cardSleeveRewardItem = _emblemItemList[num2]; - } - else - { - cardSleeveRewardItem = NGUITools.AddChild(parent, _emblemItemOriginal.gameObject).GetComponent(); - _emblemItemList.Add(cardSleeveRewardItem); - } - if (_enableAlreadyGetCheck) - { - Emblem emblem = Data.Master.EmblemMgr.Get(list[i].UserGoodsId); - cardSleeveRewardItem.SetArleadyGetVisible(emblem.IsAcquired); - } - num2++; - break; - } - if (cardSleeveRewardItem != null) - { - if (list[i].Type != 5) - { - cardSleeveRewardItem.gameObject.SetActive(value: true); - } - cardSleeveRewardItem.SetReward(list[i]); - list2.Add(cardSleeveRewardItem); - } - } - return list2; - } - - public bool IsSpecialLayout(List infoList) - { - List viewRewardList = GetViewRewardList(infoList); - SortRewardList(viewRewardList); - int num = viewRewardList.Count((ShopCommonRewardInfo reward) => reward.Type == 6); - int num2 = viewRewardList.Count((ShopCommonRewardInfo reward) => reward.Type == 7); - int num3 = viewRewardList.Count((ShopCommonRewardInfo reward) => reward.Type == 5); - if (num == 1 && num2 == 2) - { - return num3 == 2; - } - return false; - } - - public void CheckSpecialLayout(GameObject parent, List infoList) - { - if (!IsSpecialLayout(infoList)) - { - return; - } - List viewRewardList = GetViewRewardList(infoList); - List list = SortRewardList(viewRewardList); - for (int i = 0; i < SPECIAL_LAYOUT_POSITION.Length; i++) - { - Transform child = parent.transform.GetChild(i); - child.localPosition = SPECIAL_LAYOUT_POSITION[i]; - child.localScale = SPECIAL_LAYOUT_SCALE[i]; - } - for (int j = 0; j < LABEL_OVERRIDE_INDEX.Length; j++) - { - int index = LABEL_OVERRIDE_INDEX[j]; - CardSleeveRewardItem component = parent.transform.GetChild(index).gameObject.GetComponent(); - if (component != null) - { - component.ChangeNameLabelPosition(LABEL_OVERRIDE_POSITION[j]); - component.ChangeNameLabelWidth(LABEL_OVERRIDE_WIDTH[j]); - component.SetReward(list[index]); - } - } - } - - private void Start() - { - InitializeCardDetail(); - } - - private CardSleeveRewardItem CreateCard(GameObject parent, ShopCommonRewardInfo viewReward, int cardCount, Dictionary cardPool) - { - CardSleeveRewardItem cardSleeveRewardItem; - if (cardCount < _cardItemList.Count) - { - cardSleeveRewardItem = _cardItemList[cardCount]; - } - else - { - cardSleeveRewardItem = NGUITools.AddChild(parent, _cardItemOriginal.gameObject).GetComponent(); - cardSleeveRewardItem.transform.localPosition = new Vector3(cardSleeveRewardItem.transform.localPosition.x, cardSleeveRewardItem.transform.localPosition.y, 10f); - _cardItemList.Add(cardSleeveRewardItem); - } - cardSleeveRewardItem.gameObject.SetActive(value: true); - UIBase_CardManager.CardObjData cardObjOriginal = cardPool[(int)viewReward.UserGoodsId]; - GameObject gameObject = NGUITools.AddChild(cardSleeveRewardItem.CardObjectParent, cardObjOriginal.CardObj); - gameObject.SetActive(value: true); - _cloneCardList.Add(gameObject); - CardListTemplate component = gameObject.GetComponent(); - component.AddDepth(_cardDepthOffset); - if (!_isEnablePremiumShader) - { - component.ReplaceMaterialToTexture(); - } - int possessionCardNum = GameMgr.GetIns().GetDataMgr().GetPossessionCardNum((int)viewReward.UserGoodsId, isIncludingSpotCard: false); - if (_isEnableHaveCardCount) - { - component.SetNum(viewReward.Num); - } - else - { - component.HideNum(); - } - component._newLabel.gameObject.SetActive(value: false); - if (_enableAlreadyGetCheck) - { - bool flag = possessionCardNum > 0; - cardSleeveRewardItem.SetArleadyGetVisible(flag); - UIManager.SetObjectToGrey(gameObject, flag); - component._frameSprite.depth = component._frameSprite.depth + 1; - } - component.RotationOnlyIconVisible = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardObjOriginal.ids).IsResurgentCard; - if (_isEnableCardClickCollider) - { - GameObject obj = component._frameSprite.gameObject; - obj.AddComponent().size = component._frameSprite.localSize; - UIEventListener uIEventListener = UIEventListener.Get(obj); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate - { - if (_cardDetail != null) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_INFO); - _cardDetail.IsShowFlavorTextButton = false; - _cardDetail.IsShowEvolutionButton = false; - _cardDetail.IsShowVoiceButton = false; - _cardDetail.gameObject.SetActive(value: true); - _cardDetail.ShowCardDetail(cardObjOriginal.CardObj); - } - }); - } - return cardSleeveRewardItem; - } - - private void InitializeCardDetail() - { - if (!(_cardDetailPrefab == null)) - { - DetailLayer = LayerMask.NameToLayer("Detail"); - _cardDetail = UnityEngine.Object.Instantiate(_cardDetailPrefab).GetComponent(); - _cardDetail.transform.parent = base.transform; - _cardDetail.transform.localPosition = Vector3.zero; - _cardDetail.transform.localScale = Vector3.one; - _cardDetail.Initialize(DetailLayer, CardMaster.CardMasterId.Default); - _cardDetail.IsShowFlavorTextButton = true; - _cardDetail.IsShowVoiceButton = true; - _cardDetail.IsShowEvolutionButton = true; - _cardDetail.gameObject.SetActive(value: false); - } - } - - private List GetViewRewardList(List infoList) - { - List list = new List(); - for (int i = 0; i < infoList.Count && i < 5; i++) - { - list.Add(infoList[i]); - } - return list; - } - - private List SortRewardList(List infoList) - { - List list = new List(); - list.AddRange(infoList.FindAll((ShopCommonRewardInfo info) => info.Type == 6)); - list.AddRange(infoList.FindAll((ShopCommonRewardInfo info) => info.Type == 7)); - list.AddRange(infoList.FindAll((ShopCommonRewardInfo info) => info.Type == 5)); - return list; - } - - private void HideAllItems() - { - _sleeveItemOriginal.gameObject.SetActive(value: false); - _emblemItemOriginal.gameObject.SetActive(value: false); - if (_cardItemOriginal != null) - { - _cardItemOriginal.gameObject.SetActive(value: false); - } - for (int i = 0; i < _sleeveItemList.Count; i++) - { - _sleeveItemList[i].gameObject.SetActive(value: false); - } - for (int j = 0; j < _emblemItemList.Count; j++) - { - _emblemItemList[j].gameObject.SetActive(value: false); - } - foreach (CardSleeveRewardItem cardItem in _cardItemList) - { - cardItem.gameObject.SetActive(value: false); - } - foreach (GameObject cloneCard in _cloneCardList) - { - UnityEngine.Object.Destroy(cloneCard); - } - _cloneCardList.Clear(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChangeableTitleUIParts.cs b/SVSim.BattleEngine/Engine/Wizard/ChangeableTitleUIParts.cs deleted file mode 100644 index 33996307..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChangeableTitleUIParts.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class ChangeableTitleUIParts : MonoBehaviour -{ - [SerializeField] - private UILabel _labelTapToStart; - - public void Init() - { - SetLabelTapToStart(); - } - - private void SetLabelTapToStart() - { - if (!(_labelTapToStart == null)) - { - _labelTapToStart.text = Data.SystemText.Get("System_0048"); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChaosUtil.cs b/SVSim.BattleEngine/Engine/Wizard/ChaosUtil.cs index 48ea5711..ade80920 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ChaosUtil.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ChaosUtil.cs @@ -6,14 +6,4 @@ public static class ChaosUtil { return Data.SystemText.Get($"Chaos_DeckName_{chaosId:0000}_{chaosNum}"); } - - public static string GetDeckDesc(int chaosId, int chaosNum) - { - return Data.SystemText.Get($"Chaos_DeckDesc_{chaosId:0000}_{chaosNum}"); - } - - public static string GetRoomDeckDesc(int chaosId, int chaosNum) - { - return Data.SystemText.Get($"Chaos_RoomDeckDesc_{chaosId:0000}_{chaosNum}"); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/ChapterSelectButton.cs b/SVSim.BattleEngine/Engine/Wizard/ChapterSelectButton.cs index f00c2c4e..f7ed98cd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ChapterSelectButton.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ChapterSelectButton.cs @@ -6,8 +6,6 @@ namespace Wizard; public class ChapterSelectButton : MonoBehaviour { - [SerializeField] - private UIButton _button; [SerializeField] private UISprite _notSelectMask; @@ -38,38 +36,12 @@ public class ChapterSelectButton : MonoBehaviour private StoryChapterData _chapterData; - private const float CHAPTERLIST_SCALE_ACTIVE = 1f; - - private const float CHAPTERLIST_SCALE_NOTACTIVE = 0.75f; - - private const float CHAPTERLIST_ALPHA_ACTIVE = 1f; - - private const float CHAPTERLIST_ALPHA_NOTACTIVE = 0.85f; - - private const int CHAPTERLIST_DEPTH_ACTIVE = 4; - - private const int CHAPTERLIST_DEPTH_NOTACTIVE = 3; - - private const float CHAPTERLIST_X_IN_CIRCLE = 190f; - - private const float CHAPTERLIST_X_OUT_CIRCLE = 530f; - - private const float CHAPTER_TITLE_WIDTH = 324f; - public Action OnClick { get; set; } public GameObject TapEffectLocator => _tapEffectLocator; public Transform ClearLabelTransform => _clearLabel.transform; - private void Start() - { - _button.onClick.Add(new EventDelegate(delegate - { - OnClick.Call(); - })); - } - public void SetScrollEnable(bool enable) { _dragScrollView.enabled = enable; diff --git a/SVSim.BattleEngine/Engine/Wizard/ChapterSelectSphere.cs b/SVSim.BattleEngine/Engine/Wizard/ChapterSelectSphere.cs index 03dccc06..3a3c7895 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ChapterSelectSphere.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ChapterSelectSphere.cs @@ -6,8 +6,6 @@ namespace Wizard; public class ChapterSelectSphere : MonoBehaviour { - [SerializeField] - private UIButton _button; [SerializeField] private UISprite _bodySprite; @@ -22,24 +20,12 @@ public class ChapterSelectSphere : MonoBehaviour private bool _isArrowAlphaDown = true; - private const float ARROW_ANIMATION_SPEED = 1f; - - private const float SCROLL_ROTATE_REVISION = 7f; - public Action OnClick { get; set; } public bool IsScrollUpEnable { get; set; } public bool IsScrollDownEnable { get; set; } - private void Start() - { - _button.onClick.Add(new EventDelegate(delegate - { - OnClick.Call(); - })); - } - public void UpdateChapterSelectStatus(bool isChapterSelectVisible, bool isSelectEnable) { _bodySprite.spriteName = GetBodySpriteName(isChapterSelectVisible, isSelectEnable); diff --git a/SVSim.BattleEngine/Engine/Wizard/Chat.cs b/SVSim.BattleEngine/Engine/Wizard/Chat.cs deleted file mode 100644 index 300e066c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Chat.cs +++ /dev/null @@ -1,419 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class Chat : UIBase -{ - public enum eRequestDirection - { - OLD = 1, - NEW, - BOTH - } - - private const int MAX_PAST_MESSAGE_REQUEST = 30; - - private int _pastMessageRequestCnt; - - private IChatSettings _chatSettings; - - [SerializeField] - private ChatConnectController _chatConnectController; - - [SerializeField] - private ChatLogUI _chatLogUI; - - [SerializeField] - private ChatSendTextUI _chatSendTextUI; - - [SerializeField] - private ChatSendStampUI _sendStampUI; - - [SerializeField] - private UIEventListener _sendUICloseArea; - - [SerializeField] - private RewardBase _rewardBase; - - private bool _isPastLogComplete; - - private int _pastVisibleMessageCnt; - - private bool _isInitComplete; - - public Action OnAddNewChatMessage { get; set; } - - public Action> OnMissionCleared { get; set; } - - public void Init(IChatSettings chatSettings, List chatActionUIList, List stampList, NetworkDefine.MAINTENANCE_TYPE maintenanceType, Action OnFinish) - { - _chatSettings = chatSettings; - _chatConnectController.Init(PollingChatLog, OnConnectResultError); - _chatSendTextUI.Init(SendTextMessage, OnOpenTextInputUI, OnCloseTextInputUI); - UIManager.SetObjectToGrey(_chatSendTextUI.gameObject, Data.MaintenanceCodeList.Contains(maintenanceType)); - _sendStampUI.Init(SendStamp, OnOpenStampUI, OnCloseStampUI, stampList); - _chatLogUI.Init(chatSettings, _chatConnectController, stampList); - foreach (IChatActionUI chatActionUI in chatActionUIList) - { - chatActionUI.Init(_chatSettings, _chatConnectController, _chatLogUI, AddNewChatLogAfterSendChat); - } - UIEventListener sendUICloseArea = _sendUICloseArea; - sendUICloseArea.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(sendUICloseArea.onClick, (UIEventListener.VoidDelegate)delegate - { - _chatSendTextUI.CloseInputUI(isClearText: false); - _sendStampUI.CloseStampList(); - }); - StartConnectChatInfo(delegate(ChatInfo chatInfo) - { - _isInitComplete = true; - OnFinish.Call(chatInfo); - }); - } - - public void ReadyClose() - { - _chatConnectController.Close(); - } - - public void ExecuteClose() - { - _chatLogUI.CloseChatLogView(); - UnityEngine.Object.Destroy(base.gameObject); - } - - private void OnConnectResultError() - { - UIManager.GetInstance().CloseNotLatestDialogAll(); - _chatLogUI.CloseDeckView(); - } - - private void OnOpenTextInputUI(ChatOpenCloseAnimation openCloseAnim) - { - _sendStampUI.CloseStampList(); - _chatLogUI.ChangeLogViewSizeByInputUIAnimation(openCloseAnim); - } - - private void OnCloseTextInputUI(ChatOpenCloseAnimation openCloseAnim) - { - if (!_sendStampUI.IsOpen) - { - _chatLogUI.ChangeLogViewSizeByInputUIAnimation(openCloseAnim); - } - } - - private void SendTextMessage(string text) - { - ChatPostTask chatPostTask = new ChatPostTask(_chatSettings.ApiSettings.ApiChatPost); - chatPostTask.SetParameter(0, text); - _chatConnectController.StartConnectCommon(chatPostTask, delegate - { - _chatConnectController.PausePolling(); - _chatSendTextUI.CloseInputUI(isClearText: true, delegate - { - AddNewChatLogAfterSendChat(); - _chatConnectController.ResumePolling(); - }); - }); - } - - private void OnOpenStampUI(ChatOpenCloseAnimation openCloseAnim) - { - _chatSendTextUI.CloseInputUI(isClearText: false); - _chatLogUI.ChangeLogViewSizeByInputUIAnimation(openCloseAnim); - } - - private void OnCloseStampUI(ChatOpenCloseAnimation openCloseAnim) - { - if (!_chatSendTextUI.IsOpen) - { - _chatLogUI.ChangeLogViewSizeByInputUIAnimation(openCloseAnim); - } - } - - private void SendStamp(int id) - { - ChatPostTask task = new ChatPostTask(_chatSettings.ApiSettings.ApiChatPost); - task.SetParameter(1, id.ToString()); - _chatConnectController.StartConnectCommon(task, delegate - { - _chatConnectController.PausePolling(); - _sendStampUI.CloseStampList(delegate - { - AddNewChatLogAfterSendChat(); - _chatConnectController.ResumePolling(); - }); - if (task.AchievedInfo != null && task.AchievedInfo._rewards.Count > 0) - { - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Story_0029")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, _rewardBase.gameObject).GetComponent(); - for (int num = 0; num < task.AchievedInfo._rewards.Count; num++) - { - component.AddReward(task.AchievedInfo._rewards[num]); - } - List messages = new List(); - for (int num2 = 0; num2 < task.AchievedInfo._missions.Count; num2++) - { - messages.Add(task.AchievedInfo._missions[num2].achieved_message); - } - dialogBase.OnClose = delegate - { - if (OnMissionCleared != null) - { - OnMissionCleared(messages); - } - }; - component.EndCreate(); - } - }); - } - - private void AddNewChatLogAfterSendChat() - { - AddNewChatLog(delegate - { - _chatLogUI.MoveNewMessagePosition(); - }); - } - - private bool GetCanUpdateUI() - { - if (UIManager.GetInstance().isOpenDialog()) - { - return false; - } - if (_chatLogUI.IsShowDeckView()) - { - return false; - } - return true; - } - - private void Update() - { - if (!_chatLogUI.IsEnableUpdateUI && GetCanUpdateUI()) - { - _chatLogUI.SetEnableUpdateUI(); - } - } - - private void PollingChatLog() - { - AddNewChatLog(null, isPolling: true); - } - - private void StartConnectChatInfo(Action callbackOnSuccess) - { - int value = PlayerPrefsWrapper.GetValue(_chatSettings.PlayerPrefsKeyLatestReadChatMessageId); - if (value >= 0) - { - CreateChatLogReadMessage(value, callbackOnSuccess); - } - else - { - CreateChatLog(callbackOnSuccess); - } - } - - private void CreateChatLogReadMessage(int latestMessageId, Action callbackOnSuccess) - { - ChatGetMessagesTask task = new ChatGetMessagesTask(_chatSettings.ApiSettings.ApiChatMessages); - task.SetParameter(latestMessageId, eRequestDirection.BOTH, 3); - _chatConnectController.StartConnectCommon(task, delegate - { - ChatInfo chatInfo = task.ChatInfo; - _chatConnectController.UpdatePollingInterval(chatInfo.WaitInterval); - int unreadMessageId = -1; - List visibleMessageList = chatInfo.VisibleMessageList; - if (visibleMessageList.Count > 0) - { - int messageId = visibleMessageList.Last().MessageId; - if (latestMessageId != messageId) - { - int num = visibleMessageList.FindIndex((ChatMessageInfo x) => x.MessageId == latestMessageId) + 1; - if (num > 0 && visibleMessageList.Count > num) - { - unreadMessageId = visibleMessageList[num].MessageId; - } - SaveReadLatestId(messageId); - } - } - _pastVisibleMessageCnt += chatInfo.VisibleMessageList.Count; - _chatLogUI.CreateChatLogView(chatInfo.MessageList, OnInitializeOldestLog, delegate - { - if (CheckNeedsPastVisibleMessage(chatInfo)) - { - AddPastChatLog(delegate - { - _chatLogUI.ResetScrollDefaultPosition(unreadMessageId); - callbackOnSuccess.Call(chatInfo); - }); - } - else - { - callbackOnSuccess.Call(chatInfo); - } - }, unreadMessageId); - }); - } - - private void CreateChatLog(Action callbackOnSuccess) - { - ChatGetMessagesTask task = new ChatGetMessagesTask(_chatSettings.ApiSettings.ApiChatMessages); - task.SetParameterLatestLog(3); - _chatConnectController.StartConnectCommon(task, delegate - { - ChatInfo chatInfo = task.ChatInfo; - _chatConnectController.UpdatePollingInterval(chatInfo.WaitInterval); - if (chatInfo.VisibleMessageList.Count > 0) - { - SaveReadLatestId(chatInfo.VisibleMessageList.Last().MessageId); - } - _pastVisibleMessageCnt += chatInfo.VisibleMessageList.Count; - _chatLogUI.CreateChatLogView(chatInfo.MessageList, OnInitializeOldestLog, delegate - { - if (CheckNeedsPastVisibleMessage(chatInfo)) - { - AddPastChatLog(delegate - { - _chatLogUI.ResetScrollDefaultPosition(); - callbackOnSuccess.Call(chatInfo); - }); - } - else - { - callbackOnSuccess.Call(chatInfo); - } - }); - }); - } - - private void OnInitializeOldestLog() - { - if (_isInitComplete) - { - AddPastChatLog(); - } - } - - private bool CheckNeedsPastVisibleMessage(ChatInfo chatInfo) - { - if (_pastMessageRequestCnt > 30) - { - ResetPastMessageCnt(); - return false; - } - bool num = NeedsPastMessage(chatInfo); - if (!num) - { - ResetPastMessageCnt(); - } - return num; - } - - private bool NeedsPastMessage(ChatInfo chatInfo) - { - if (_isPastLogComplete) - { - return false; - } - if (!chatInfo.IsIncludeInvisibleMessage) - { - return false; - } - if (_pastVisibleMessageCnt > 10) - { - return false; - } - return true; - } - - private void ResetPastMessageCnt() - { - _pastVisibleMessageCnt = 0; - _pastMessageRequestCnt = 0; - } - - private void AddNewChatLog(Action callbackOnSuccess = null, bool isPolling = false) - { - ChatGetMessagesTask task = new ChatGetMessagesTask(_chatSettings.ApiSettings.ApiChatMessages); - _chatConnectController.ResetPolling(); - if (_chatLogUI.ChatAllLogList.Count > 0) - { - int messageId = _chatLogUI.ChatAllLogList.Last().MessageId; - task.SetParameter(messageId, eRequestDirection.NEW, _chatConnectController.PollingInterval); - } - else - { - task.SetParameterLatestLog(_chatConnectController.PollingInterval); - } - _chatConnectController.StartConnectCommon(task, delegate - { - ChatInfo chatInfo = task.ChatInfo; - _chatConnectController.UpdatePollingInterval(chatInfo.WaitInterval); - if (chatInfo.MessageList.Count <= 0) - { - callbackOnSuccess.Call(); - } - else - { - if (chatInfo.VisibleMessageList.Count > 0) - { - SaveReadLatestId(chatInfo.VisibleMessageList.Last().MessageId); - } - _chatLogUI.AddChatLogView(chatInfo, eRequestDirection.NEW, GetCanUpdateUI(), callbackOnSuccess); - OnAddNewChatMessage.Call(chatInfo); - } - }, isPolling); - } - - private void AddPastChatLog(Action onFinish = null) - { - if (_isPastLogComplete) - { - ResetPastMessageCnt(); - onFinish.Call(); - return; - } - int messageId = _chatLogUI.ChatAllLogList[0].MessageId; - ChatGetMessagesTask task = new ChatGetMessagesTask(_chatSettings.ApiSettings.ApiChatMessages); - task.SetParameter(messageId, eRequestDirection.OLD, _chatConnectController.PollingInterval); - _chatConnectController.StartConnectCommon(task, delegate - { - _pastMessageRequestCnt++; - ChatInfo chatInfo = task.ChatInfo; - if (chatInfo.MessageList.Count <= 0) - { - _isPastLogComplete = true; - } - _chatConnectController.UpdatePollingInterval(chatInfo.WaitInterval); - _chatLogUI.AddChatLogView(chatInfo, eRequestDirection.OLD); - _pastVisibleMessageCnt += chatInfo.VisibleMessageList.Count; - if (CheckNeedsPastVisibleMessage(chatInfo)) - { - AddPastChatLog(onFinish); - } - else - { - onFinish.Call(); - } - }); - } - - private void SaveReadLatestId(int latestMessageId) - { - PlayerPrefsWrapper.SetValue(_chatSettings.PlayerPrefsKeyLatestReadChatMessageId, latestMessageId); - } - - public void StartConnectCommon(NetworkTask task, Action callbackOnSuccess, bool isPolling = false) - { - _chatConnectController.StartConnectCommon(task, callbackOnSuccess, isPolling); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatAddDeckTask.cs b/SVSim.BattleEngine/Engine/Wizard/ChatAddDeckTask.cs deleted file mode 100644 index 33afde67..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatAddDeckTask.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace Wizard; - -public class ChatAddDeckTask : BaseTask -{ - public class ChatAddDeckTaskParam : BaseParam - { - public int deck_format { get; set; } - - public int deck_no { get; set; } - } - - public ChatAddDeckTask(ApiType.Type apiType) - { - base.type = apiType; - } - - public void SetParameter(int deckFormat, int deckNo) - { - ChatAddDeckTaskParam chatAddDeckTaskParam = new ChatAddDeckTaskParam(); - chatAddDeckTaskParam.deck_format = deckFormat; - chatAddDeckTaskParam.deck_no = deckNo; - base.Params = chatAddDeckTaskParam; - } - - protected override int Parse() - { - int result = base.Parse(); - _ = 1; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatAddReplayTask.cs b/SVSim.BattleEngine/Engine/Wizard/ChatAddReplayTask.cs deleted file mode 100644 index ac423d03..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatAddReplayTask.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Wizard; - -public class ChatAddReplayTask : BaseTask -{ - public class ChatAddReplayTaskParam : BaseParam - { - public long battle_id { get; set; } - } - - public ChatAddReplayTask(ApiType.Type apiType) - { - base.type = apiType; - } - - public void SetParameter(long battleId) - { - ChatAddReplayTaskParam chatAddReplayTaskParam = new ChatAddReplayTaskParam(); - chatAddReplayTaskParam.battle_id = battleId; - base.Params = chatAddReplayTaskParam; - } - - protected override int Parse() - { - int result = base.Parse(); - _ = 1; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatConnectController.cs b/SVSim.BattleEngine/Engine/Wizard/ChatConnectController.cs deleted file mode 100644 index c7bdd6ef..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatConnectController.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.ErrorDialog; - -namespace Wizard; - -public class ChatConnectController : MonoBehaviour -{ - public const int DEFAULT_POLLING_TIME = 3; - - private const int INVALID_POLLING_TIME = 0; - - private static readonly int[] ERROR_CODE_NOT_STOP_POLLING = new int[1] { 207 }; - - private bool _isPausePolling; - - private bool _isConnectPolling; - - private float _pollingIntervalCount; - - private bool _isActiveCenterLoading; - - private static bool _isOpenChat = false; - - private Action _eventOnPolling; - - private Action _onConnectResultError; - - public int PollingInterval { get; private set; } = 3; - - public void Init(Action eventOnPolling, Action onConnectResultError) - { - _isOpenChat = true; - _eventOnPolling = eventOnPolling; - _onConnectResultError = onConnectResultError; - UpdatePollingInterval(3); - ResetPolling(); - } - - public void Close() - { - if (_isConnectPolling) - { - SetActiveCenterLoading(isActive: true, force: false); - } - StopPolling(); - _isOpenChat = false; - } - - public void StopPolling() - { - PollingInterval = 0; - _pollingIntervalCount = 0f; - } - - public void ResetPolling() - { - ResumePolling(); - _pollingIntervalCount = 0f; - } - - public void PausePolling() - { - _isPausePolling = true; - } - - public void ResumePolling() - { - _isPausePolling = false; - } - - public void UpdatePollingInterval(int intervalTime) - { - PollingInterval = intervalTime; - } - - private void OnDestroy() - { - _isOpenChat = false; - } - - private void Update() - { - UpdatePolling(); - } - - private void UpdatePolling() - { - if (PollingInterval == 0 || _isPausePolling) - { - return; - } - _pollingIntervalCount += Time.deltaTime; - if ((float)PollingInterval <= _pollingIntervalCount) - { - if (Toolbox.NetworkManager.isConnect || NetworkUI.GetInstance().IsOpenErrorDialog()) - { - ResetPolling(); - } - else - { - _eventOnPolling.Call(); - } - } - } - - public void StartConnectCommon(NetworkTask task, Action callbackOnSuccess, bool isPolling = false) - { - Action action = null; - Action action2 = null; - if (isPolling) - { - task.SkipCuteTimeOutPopup(); - task.SkipCuteHttpStatusErrorPopup(); - task.SkipAllCuteResultCodeCheckErrorPopup(); - _isConnectPolling = true; - action = OnConnectFailureErrorPolling; - action2 = OnConnectResultErrorPolling; - } - else - { - SetActiveCenterLoading(isActive: true); - action = OnConnectFailureError; - action2 = OnConnectResultError; - } - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate(NetworkTask.ResultCode code) - { - if (isPolling) - { - _isConnectPolling = false; - } - else - { - SetActiveCenterLoading(isActive: false); - } - if (_isOpenChat) - { - callbackOnSuccess.Call(code); - } - }, action, action2, encrypt: true, useJson: false, !isPolling)); - } - - private void OnConnectFailureErrorPolling(NetworkTask.ResultCode code) - { - _isConnectPolling = false; - ResetPolling(); - } - - private void OnConnectResultErrorPolling(int error) - { - if (_isOpenChat) - { - Wizard.ErrorDialog.Dialog.Create(error); - } - _isConnectPolling = false; - StopPolling(); - _onConnectResultError.Call(); - } - - private void OnConnectFailureError(NetworkTask.ResultCode code) - { - SetActiveCenterLoading(isActive: false); - } - - private void OnConnectResultError(int error) - { - SetActiveCenterLoading(isActive: false); - if (!ERROR_CODE_NOT_STOP_POLLING.Contains(error)) - { - StopPolling(); - } - _onConnectResultError.Call(); - } - - private void SetActiveCenterLoading(bool isActive, bool force = true) - { - if (_isActiveCenterLoading != isActive) - { - _isActiveCenterLoading = isActive; - if (isActive) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: false, notCollider: false, force); - } - else - { - UIManager.GetInstance().closeInSceneCenterLoading(force); - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatDeckLogTask.cs b/SVSim.BattleEngine/Engine/Wizard/ChatDeckLogTask.cs deleted file mode 100644 index 5ca65669..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatDeckLogTask.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ChatDeckLogTask : BaseTask -{ - public List DeckLogListRotation { get; private set; } - - public List DeckLogListUnlimited { get; private set; } - - public List DeckLogListPreRotation { get; private set; } - - public List DeckLogListCrossover { get; private set; } - - public List DeckLogListMyRotation { get; private set; } - - public ChatDeckLogTask(ApiType.Type apiType) - { - base.type = apiType; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]["deck_log"]; - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); - DeckLogListRotation = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Rotation).ToString()]); - DeckLogListUnlimited = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Unlimited).ToString()]); - DeckLogListPreRotation = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.PreRotation).ToString()]); - if (jsonData.TryGetValue(Data.FormatConvertApi(Format.Crossover).ToString(), out var value)) - { - DeckLogListCrossover = ChatMessageInfo.DeckLogData.ParseDeckDataList(value); - } - if (jsonData.TryGetValue(Data.FormatConvertApi(Format.MyRotation).ToString(), out var value2)) - { - DeckLogListMyRotation = ChatMessageInfo.DeckLogData.ParseDeckDataList(value2); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatDeckView.cs b/SVSim.BattleEngine/Engine/Wizard/ChatDeckView.cs deleted file mode 100644 index 80c68513..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatDeckView.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatDeckView : MonoBehaviour -{ - private const int DEPTH_CONFIRM_DIALOG = 100; - - [SerializeField] - private GameObject _deckViewPrefab; - - [SerializeField] - private GameObject _cardDetailPrefab; - - private GameObject _deckViewObj; - - private UICardList _uiCardList; - - private GameObject _cardDetailObj; - - private CardDetailUI _cardDetail; - - private List _loadCardAssetList; - - private IChatApiSettings _chatApiSettings; - - private ChatConnectController _chatConnectCtr; - - private Action _actionCloseChatLogContent; - - private Action _onOpen; - - private Action _onClose; - - private Action>> _onDeleteDeckSuccess; - - public void Init(IChatApiSettings chatApiSettings, ChatConnectController chatConnectCtr, Action actionCloseChatLogContent) - { - _chatApiSettings = chatApiSettings; - _chatConnectCtr = chatConnectCtr; - _actionCloseChatLogContent = actionCloseChatLogContent; - } - - public bool IsShowDeckCardView() - { - if (_deckViewObj == null) - { - return false; - } - return _deckViewObj.activeSelf; - } - - public void ShowDeckViewByDeckLog(ChatMessageInfo.DeckLogData deckLogData, Action onOpen = null, Action onClose = null, Action>> onDeleteDeckSuccess = null) - { - _onDeleteDeckSuccess = onDeleteDeckSuccess; - ShowDeckViewByDeckData(deckLogData.DeckData, onOpen, onClose, deckLogData.IsAbleDeleteDeck); - if (deckLogData.IsAbleDeleteDeck) - { - _uiCardList.SetRedButtonOnClickCallBack(Data.SystemText.Get("Guild_Chat_0034"), delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - CreateConfirmDialogDeleteDeckLog(deckLogData); - }); - } - } - - public void ShowDeckViewByDeckData(DeckData deck, Action onOpen, Action onClose, bool isActiveRedButton, bool isActiveDeckIntroductionObj = true) - { - _onOpen = onOpen; - _onClose = onClose; - string text = "Detail"; - if (_cardDetailObj == null) - { - _cardDetailObj = NGUITools.AddChild(base.gameObject, _cardDetailPrefab); - _cardDetail = _cardDetailObj.GetComponent(); - _cardDetail.Initialize(LayerMask.NameToLayer(text), CardMaster.CardMasterId.Default); - _cardDetailObj.SetActive(value: false); - } - if (_deckViewObj == null) - { - _deckViewObj = UnityEngine.Object.Instantiate(_deckViewPrefab); - _uiCardList = _deckViewObj.GetComponent(); - _uiCardList.Init(base.gameObject, _cardDetail, null, CloseDeckView, text, in_DetailCameraUse: true, null, 40); - _deckViewObj.SetActive(value: false); - } - _uiCardList.SetEnableRedButton(isActiveRedButton); - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(CardLoadCoroutine(deck, !isActiveDeckIntroductionObj, isActiveDeckIntroductionObj)); - } - - public void CloseDeckView() - { - if (IsShowDeckCardView()) - { - _deckViewObj.SetActive(value: false); - if (_loadCardAssetList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadCardAssetList); - _loadCardAssetList.Clear(); - } - _onClose.Call(); - _onOpen = null; - _onClose = null; - } - } - - private IEnumerator CardLoadCoroutine(DeckData deck, bool showQRCode, bool isActiveDeckIntroductionObj) - { - IList cardIdList = deck.GetCardIdList(); - _uiCardList.RemoveData(); - _loadCardAssetList = _uiCardList.GetLoadFileList(cardIdList as List); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadCardAssetList, null)); - _uiCardList.SetDeck(deck, null); - _uiCardList.UpdateShortageRedEther(); - _uiCardList.SetShortageCardVisible(_uiCardList.IsEnableShortageCardVisible); - if (showQRCode) - { - _uiCardList.SetQRSmallTexture(); - } - _uiCardList.SetActiveDeckIntroductionObj(isActiveDeckIntroductionObj); - yield return null; - _deckViewObj.SetActive(value: true); - UIManager.GetInstance().closeInSceneCenterLoading(); - _onOpen.Call(); - } - - private void CreateConfirmDialogDeleteDeckLog(ChatMessageInfo.DeckLogData deckLogData) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetTitleLabel(Data.SystemText.Get("Guild_Chat_0035")); - dialogBase.SetText(Data.SystemText.Get("Guild_Chat_0036")); - dialogBase.SetButtonText(Data.SystemText.Get("Guild_Chat_0037")); - dialogBase.SetPanelDepth(100); - dialogBase.onPushButton1 = delegate - { - DeleteDeckLog(deckLogData.DeckData.Format, deckLogData.MessageId); - }; - } - - private void DeleteDeckLog(Format format, int messageId) - { - CloseDeckView(); - ChatDeleteDeckTask task = new ChatDeleteDeckTask(_chatApiSettings.ApiChatDeleteDeck); - task.SetParameter(Data.FormatConvertApi(format), messageId); - _chatConnectCtr.StartConnectCommon(task, delegate - { - CreateCompleteDialogDeleteDeckLog(); - _actionCloseChatLogContent.Call(messageId); - _onDeleteDeckSuccess.Call(format, task.DictDeckLogList); - }); - } - - private void CreateCompleteDialogDeleteDeckLog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetText(Data.SystemText.Get("Guild_Chat_0038")); - dialogBase.SetPanelDepth(100); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatDeleteDeckTask.cs b/SVSim.BattleEngine/Engine/Wizard/ChatDeleteDeckTask.cs deleted file mode 100644 index 67c3bc4e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatDeleteDeckTask.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ChatDeleteDeckTask : BaseTask -{ - public class ChatDeleteDeckTaskParam : BaseParam - { - public int deck_format { get; set; } - - public int message_id { get; set; } - } - - public Dictionary> DictDeckLogList { get; private set; } - - public ChatDeleteDeckTask(ApiType.Type apiType) - { - base.type = apiType; - } - - public void SetParameter(int deckFormat, int messageId) - { - ChatDeleteDeckTaskParam chatDeleteDeckTaskParam = new ChatDeleteDeckTaskParam(); - chatDeleteDeckTaskParam.deck_format = deckFormat; - chatDeleteDeckTaskParam.message_id = messageId; - base.Params = chatDeleteDeckTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]["deck_log"]; - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); - DictDeckLogList = new Dictionary>(); - DictDeckLogList[Format.Rotation] = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Rotation).ToString()]); - DictDeckLogList[Format.Unlimited] = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.Unlimited).ToString()]); - DictDeckLogList[Format.PreRotation] = ChatMessageInfo.DeckLogData.ParseDeckDataList(jsonData[Data.FormatConvertApi(Format.PreRotation).ToString()]); - if (jsonData.TryGetValue(Data.FormatConvertApi(Format.Crossover).ToString(), out var value)) - { - DictDeckLogList[Format.Crossover] = ChatMessageInfo.DeckLogData.ParseDeckDataList(value); - } - if (jsonData.TryGetValue(Data.FormatConvertApi(Format.MyRotation).ToString(), out var value2)) - { - DictDeckLogList[Format.MyRotation] = ChatMessageInfo.DeckLogData.ParseDeckDataList(value2); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatGetMessagesTask.cs b/SVSim.BattleEngine/Engine/Wizard/ChatGetMessagesTask.cs deleted file mode 100644 index 4983b506..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatGetMessagesTask.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace Wizard; - -public class ChatGetMessagesTask : BaseTask -{ - public class ChatGetMessagesTaskParam : BaseParam - { - public int start_message_id { get; set; } - - public int direction { get; set; } - - public int wait_interval { get; set; } - } - - private const int LATEST_REQUEST_MESSAGE_ID = 0; - - private const Chat.eRequestDirection LATEST_REQUEST_DIRECTION = Chat.eRequestDirection.OLD; - - public ChatInfo ChatInfo { get; private set; } - - public ChatGetMessagesTask(ApiType.Type apiType) - { - base.type = apiType; - } - - public void SetParameter(int startMessageId, Chat.eRequestDirection direction, int waitInterval) - { - ChatGetMessagesTaskParam chatGetMessagesTaskParam = new ChatGetMessagesTaskParam(); - chatGetMessagesTaskParam.start_message_id = startMessageId; - chatGetMessagesTaskParam.direction = (int)direction; - chatGetMessagesTaskParam.wait_interval = waitInterval; - base.Params = chatGetMessagesTaskParam; - } - - public void SetParameterLatestLog(int waitInterval) - { - ChatGetMessagesTaskParam chatGetMessagesTaskParam = new ChatGetMessagesTaskParam(); - chatGetMessagesTaskParam.start_message_id = 0; - chatGetMessagesTaskParam.direction = 1; - chatGetMessagesTaskParam.wait_interval = waitInterval; - base.Params = chatGetMessagesTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); - ChatInfo = new ChatInfo(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatInfo.cs b/SVSim.BattleEngine/Engine/Wizard/ChatInfo.cs deleted file mode 100644 index 1d66a081..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatInfo.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using LitJson; - -namespace Wizard; - -public class ChatInfo -{ - public GatheringMatchedRoom GatheringMatchedRoom; - - public List MessageList { get; private set; } - - public List VisibleMessageList { get; private set; } - - public bool IsIncludeInvisibleMessage { get; private set; } - - public int WaitInterval { get; private set; } - - public ChatInfo(JsonData json) - { - initialize(); - ParseJsonData(json); - } - - private void initialize() - { - MessageList = new List(); - WaitInterval = 0; - GatheringMatchedRoom = null; - } - - private void ParseJsonData(JsonData json) - { - List list = new List(); - JsonData jsonData = json["users"]; - for (int i = 0; i < jsonData.Count; i++) - { - list.Add(new ChatUserInfo(jsonData[i])); - } - JsonData jsonData2 = json["chat_message"]; - for (int j = 0; j < jsonData2.Count; j++) - { - ChatMessageInfo chatMessageInfo = new ChatMessageInfo(jsonData2[j], list); - if (chatMessageInfo.UserInfo != null && (chatMessageInfo.MessageType != ChatMessageInfo.eMessageType.ROOM_MATCH || chatMessageInfo.RoomData == null || chatMessageInfo.UserInfo.ViewerId != PlayerStaticData.UserViewerID)) - { - MessageList.Add(new ChatMessageInfo(jsonData2[j], list)); - } - } - VisibleMessageList = MessageList.Where((ChatMessageInfo message) => message.IsVisibleMessage).ToList(); - IsIncludeInvisibleMessage = MessageList.Any((ChatMessageInfo message) => !message.IsVisibleMessage); - WaitInterval = json["wait_interval"].ToInt(); - if (json.Keys.Contains("matched_room_id")) - { - GatheringMatchedRoom = new GatheringMatchedRoom(json["matched_room_id"].ToString()); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogContentBase.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogContentBase.cs deleted file mode 100644 index cc1dc3a8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogContentBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public abstract class ChatLogContentBase : MonoBehaviour -{ - protected IChatSettings _chatSettings; - - protected ChatConnectController _chatConnectCtr; - - protected ChatLogUI.PartsForPlate _partsForPlate; - - public abstract List ListMessagetType { get; } - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectCtr, ChatLogUI.PartsForPlate partsForPlate) - { - _chatSettings = chatSettings; - _chatConnectCtr = chatConnectCtr; - _partsForPlate = partsForPlate; - OnInit(); - } - - protected virtual void OnInit() - { - } - - public abstract void SetData(ChatMessageInfo messageInfo); - - public abstract Vector2 GetSize(ChatMessageInfo messageInfo); -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogPartsNotice.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogPartsNotice.cs deleted file mode 100644 index 146f82bc..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogPartsNotice.cs +++ /dev/null @@ -1,45 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class ChatLogPartsNotice : MonoBehaviour -{ - private const int PADDING_NOTICE_MESSAGE_AND_FRAME = 42; - - [SerializeField] - private UILabel _labelEndNotice; - - [SerializeField] - private UILabel _labelShareNotice; - - public void SetText(string text, bool isEnd) - { - _labelEndNotice.gameObject.SetActive(isEnd); - _labelShareNotice.gameObject.SetActive(!isEnd); - if (isEnd) - { - _labelEndNotice.text = text; - } - else - { - _labelShareNotice.text = text; - } - } - - public Vector2 GetSize(string text, bool isEnd) - { - UILabel uILabel = _labelShareNotice; - if (isEnd) - { - uILabel = _labelEndNotice; - } - string text2 = uILabel.text; - uILabel.InitializeFont(); - uILabel.text = text; - uILabel.ProcessText(); - int num = 42 + uILabel.width; - int height = uILabel.height; - uILabel.text = text2; - return new Vector2(num, height); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlate.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogPlate.cs deleted file mode 100644 index 2146550e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlate.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatLogPlate : UIBase -{ - private const int MARGIN_UNREAD_MESSAGE = 26; - - [SerializeField] - private Transform _layoutRoot; - - [SerializeField] - private ChatLogPlateLayoutMember _layoutOwn; - - [SerializeField] - private ChatLogPlateLayoutMember _layoutOtherMember; - - [SerializeField] - private ChatLogPlateLayoutNoMember _layoutNoMember; - - [SerializeField] - private GameObject _unreadMessageUI; - - private ChatMessageInfo _messageInfo; - - private Func, bool> _funcIsLoadedResources; - - public int GetHeightSize(ChatMessageInfo messageInfo, bool isUnreadMessage) - { - int num = (int)GetDisplayByMessageInfo(messageInfo).GetPlateSize(messageInfo).y; - if (isUnreadMessage) - { - num += 26; - } - return num; - } - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI.PartsForPlate partsForPlate, Func, bool> funcIsLoadedResources) - { - _funcIsLoadedResources = funcIsLoadedResources; - _layoutOwn.Init(chatSettings, chatConnectController, partsForPlate); - _layoutOtherMember.Init(chatSettings, chatConnectController, partsForPlate); - _layoutNoMember.Init(chatSettings, chatConnectController, partsForPlate); - } - - public void SetData(ChatMessageInfo messageInfo, bool isUnreadMessage) - { - ClearDisplay(); - if (messageInfo != null) - { - _messageInfo = messageInfo; - UpdateUnreadMessage(isUnreadMessage); - UpdateDisplay(); - } - } - - private void ClearDisplay() - { - _layoutRoot.localPosition = Vector3.zero; - _unreadMessageUI.gameObject.SetActive(value: false); - _layoutOwn.ClearDisplay(); - _layoutOwn.gameObject.SetActive(value: false); - _layoutOtherMember.ClearDisplay(); - _layoutOtherMember.gameObject.SetActive(value: false); - _layoutNoMember.ClearDisplay(); - _layoutNoMember.gameObject.SetActive(value: false); - } - - private ChatLogPlateLayoutBase GetDisplayByMessageInfo(ChatMessageInfo info) - { - ChatLogPlateLayoutBase result = null; - switch (info.TalkerType) - { - case ChatMessageInfo.eTalkerType.NO_MEMBER: - result = _layoutNoMember; - break; - case ChatMessageInfo.eTalkerType.OTHER: - result = _layoutOtherMember; - break; - case ChatMessageInfo.eTalkerType.OWN: - result = _layoutOwn; - break; - } - return result; - } - - private void UpdateUnreadMessage(bool isUnreadMessage) - { - _unreadMessageUI.gameObject.SetActive(isUnreadMessage); - if (isUnreadMessage) - { - _layoutRoot.localPosition = Vector3.down * 26f; - } - else - { - _layoutRoot.localPosition = Vector3.zero; - } - } - - private void UpdateDisplay() - { - ChatLogPlateLayoutBase logDisplay = GetDisplayByMessageInfo(_messageInfo); - logDisplay.gameObject.SetActive(value: true); - logDisplay.SetDisplayBeforeLoad(_messageInfo); - StartCoroutine(CheckResouceLoaded(_messageInfo.MessageId, _messageInfo.GetResourcePathList(), delegate - { - logDisplay.SetDisplayAfterLoad(_messageInfo); - })); - } - - private IEnumerator CheckResouceLoaded(int messageId, List checkResourceList, Action onLoadEndCallback) - { - while (true) - { - if (_messageInfo.MessageId != messageId) - { - yield break; - } - if (_funcIsLoadedResources.Call(checkResourceList)) - { - break; - } - yield return null; - } - onLoadEndCallback.Call(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutBase.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutBase.cs deleted file mode 100644 index 76b89dd4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutBase.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public abstract class ChatLogPlateLayoutBase : MonoBehaviour -{ - protected ChatConnectController _chatConnectController; - - [SerializeField] - private List _listLogContent; - - private Dictionary _contentList; - - public abstract Vector2 GetPlateSize(ChatMessageInfo messageInfo); - - protected abstract void OnClearDisplay(); - - protected abstract void OnSetDisplayBeforeLoad(ChatMessageInfo messageInfo); - - protected abstract void OnSetDisplayAfterLoad(ChatMessageInfo messageInfo); - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI.PartsForPlate partsForPlate) - { - _chatConnectController = chatConnectController; - InitContentList(chatSettings, partsForPlate); - } - - public void ClearDisplay() - { - ClearAllContentDisplay(); - OnClearDisplay(); - } - - public void SetDisplayBeforeLoad(ChatMessageInfo messageInfo) - { - OnSetDisplayBeforeLoad(messageInfo); - } - - public void SetDisplayAfterLoad(ChatMessageInfo messageInfo) - { - SetContentDisplay(messageInfo); - OnSetDisplayAfterLoad(messageInfo); - } - - protected Vector2 GetContentSize(ChatMessageInfo messageInfo) - { - return GetContent(messageInfo.MessageType).GetSize(messageInfo); - } - - private void SetContentDisplay(ChatMessageInfo messageInfo) - { - ChatLogContentBase content = GetContent(messageInfo.MessageType); - content.gameObject.SetActive(value: true); - content.SetData(messageInfo); - } - - private void InitContentList(IChatSettings chatSettings, ChatLogUI.PartsForPlate partsForPlate) - { - _contentList = new Dictionary(); - foreach (ChatLogContentBase item in _listLogContent) - { - foreach (ChatMessageInfo.eMessageType item2 in item.ListMessagetType) - { - _contentList[item2] = item; - } - } - foreach (KeyValuePair content in _contentList) - { - content.Value.Init(chatSettings, _chatConnectController, partsForPlate); - } - } - - private ChatLogContentBase GetContent(ChatMessageInfo.eMessageType messageType) - { - _contentList.TryGetValue(messageType, out var value); - return value; - } - - private void ClearAllContentDisplay() - { - foreach (KeyValuePair content in _contentList) - { - ChatLogContentBase value = content.Value; - if (value != null) - { - value.gameObject.SetActive(value: false); - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutMember.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutMember.cs deleted file mode 100644 index 9a9afc38..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutMember.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatLogPlateLayoutMember : ChatLogPlateLayoutBase -{ - private readonly Vector2 BASE_SIZE_WITHOUT_CONTENT_DISPLAY = new Vector2(100f, 29f); - - private readonly Vector2 MIN_SIZE_SPRITE_FRAME = new Vector2(48f, 39f); - - [SerializeField] - private UISprite _spriteFrame; - - [SerializeField] - private UITexture _textureEmblem; - - [SerializeField] - private UILabel _labelUserName; - - [SerializeField] - private UILabel _labelSendTime; - - [SerializeField] - private ChatLogPartsNotice _noticeUI; - - public override Vector2 GetPlateSize(ChatMessageInfo messageInfo) - { - Vector2 result = GetContentSize(messageInfo) + BASE_SIZE_WITHOUT_CONTENT_DISPLAY; - result.y = Mathf.Max(result.y, _textureEmblem.height); - return result; - } - - protected override void OnClearDisplay() - { - _spriteFrame.gameObject.SetActive(value: false); - _textureEmblem.enabled = false; - _labelUserName.gameObject.SetActive(value: false); - _labelSendTime.gameObject.SetActive(value: false); - _noticeUI.gameObject.SetActive(value: false); - } - - protected override void OnSetDisplayBeforeLoad(ChatMessageInfo messageInfo) - { - SetUserDisplay(messageInfo); - } - - protected override void OnSetDisplayAfterLoad(ChatMessageInfo messageInfo) - { - SetUserEmblem(messageInfo.UserInfo.EmblemId); - SetDisplayFrame(messageInfo); - } - - private void SetDisplayFrame(ChatMessageInfo messageInfo) - { - _spriteFrame.gameObject.SetActive(value: true); - Vector2 contentSize = GetContentSize(messageInfo); - _spriteFrame.width = Mathf.Max((int)MIN_SIZE_SPRITE_FRAME.x, (int)contentSize.x); - _spriteFrame.height = Mathf.Max((int)MIN_SIZE_SPRITE_FRAME.y, (int)contentSize.y); - } - - private void SetUserDisplay(ChatMessageInfo messageInfo) - { - _labelUserName.text = messageInfo.UserInfo.Name; - _labelUserName.gameObject.SetActive(value: true); - _labelSendTime.text = messageInfo.GetCreateTimeText(); - _labelSendTime.gameObject.SetActive(value: true); - } - - private void SetUserEmblem(long emblemId) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(emblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true); - _textureEmblem.enabled = true; - _textureEmblem.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath) as Texture; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutNoMember.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutNoMember.cs deleted file mode 100644 index d34368d8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogPlateLayoutNoMember.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class ChatLogPlateLayoutNoMember : ChatLogPlateLayoutBase -{ - [SerializeField] - private UISprite _spriteBG; - - public override Vector2 GetPlateSize(ChatMessageInfo messageInfo) - { - return GetContentSize(messageInfo); - } - - protected override void OnClearDisplay() - { - _spriteBG.gameObject.SetActive(value: true); - } - - protected override void OnSetDisplayBeforeLoad(ChatMessageInfo messageInfo) - { - SetDisplayBG(messageInfo); - } - - protected override void OnSetDisplayAfterLoad(ChatMessageInfo messageInfo) - { - } - - private void SetDisplayBG(ChatMessageInfo messageInfo) - { - _spriteBG.gameObject.SetActive(value: true); - Vector2 plateSize = GetPlateSize(messageInfo); - _spriteBG.width = (int)plateSize.x; - _spriteBG.height = (int)plateSize.y; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatLogUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatLogUI.cs deleted file mode 100644 index a721acd4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatLogUI.cs +++ /dev/null @@ -1,511 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatLogUI : MonoBehaviour -{ - public class PartsForPlate - { - public ChatDeckView DeckView { get; private set; } - - public PartsForPlate(ChatDeckView chatDeckView) - { - DeckView = chatDeckView; - } - } - - public const int INVALID_UNREAD_MESSAGE_ID = -1; - - public const int SCROLL_OBJECT_NUM = 10; - - private const int SCROLL_OBJECT_MARGIN = 10; - - [SerializeField] - private UIButton _buttonToNewMessage; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private UIWrapVariableContentVertical _wrapVariableContent; - - [SerializeField] - private UIScrollBarWrapContent _scrollBarWrapContent; - - [SerializeField] - private WrapVariableContentsScrollBarSize _wrapContentScrollBarSize; - - private UIPanel _panelScrollView; - - private float _startBaseClipRegionY; - - private float _startBaseClipRegionW; - - private ChatLogPlate _logPlateOriginal; - - private ChatLogPlate _logPlateForSizeCalcDummyObject; - - private List _plateList = new List(); - - private List _loadedResourceList = new List(); - - [SerializeField] - private ChatDeckView _chatDeckView; - - private bool _isCreateFinish; - - private Action _onInitializeOldestLog; - - private int _unreadMessageId; - - private int _oldUnreadMessageId = -1; - - private List _dependOpenCloseAnimationList = new List(); - - private float _scrollViewBasePosY; - - private bool _isFollowingAnimation; - - private Coroutine _bottomScrollViewAnimationCoroutin; - - private float _bottomScrollViewAnimationDistance; - - private IChatSettings _chatSettings; - - private ChatConnectController _chatConnectController; - - private List _stampList; - - private PartsForPlate _partsForPlate; - - public bool IsEnableUpdateUI { get; private set; } - - public List ChatVisibleLogList { get; private set; } = new List(); - - public List ChatAllLogList { get; private set; } = new List(); - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, List stampList) - { - _chatSettings = chatSettings; - _chatConnectController = chatConnectController; - _stampList = stampList; - _logPlateOriginal = chatSettings.PrefabChatLogPlate; - _chatDeckView.Init(chatSettings.ApiSettings, chatConnectController, CloseChatLogContent); - _partsForPlate = new PartsForPlate(_chatDeckView); - } - - public void ShowDeckViewByDeckLog(ChatMessageInfo.DeckLogData deckLogData, Action onOpen = null, Action onClose = null, Action>> onDeleteDeckSuccess = null) - { - _chatDeckView.ShowDeckViewByDeckLog(deckLogData, onOpen, onClose, onDeleteDeckSuccess); - } - - public void ShowDeckViewByDeckData(DeckData deck, Action onOpen, Action onClose, bool isActiveRedButton, bool isActiveDeckIntroductionObj) - { - _chatDeckView.ShowDeckViewByDeckData(deck, onOpen, onClose, isActiveRedButton, isActiveDeckIntroductionObj); - } - - public void CloseDeckView() - { - _chatDeckView.CloseDeckView(); - } - - public bool IsShowDeckView() - { - return _chatDeckView.IsShowDeckCardView(); - } - - public void CreateChatLogView(List messageList, Action onInitializeOldestLog, Action onFinCallBack, int unreadMessageId = -1) - { - _onInitializeOldestLog = onInitializeOldestLog; - _panelScrollView = _scrollView.GetComponent(); - Vector4 baseClipRegion = _panelScrollView.baseClipRegion; - _startBaseClipRegionY = baseClipRegion.y; - _startBaseClipRegionW = baseClipRegion.w; - _buttonToNewMessage.onClick.Clear(); - _buttonToNewMessage.onClick.Add(new EventDelegate(delegate - { - MoveNewMessagePosition(); - })); - _buttonToNewMessage.gameObject.SetActive(value: false); - _unreadMessageId = unreadMessageId; - AddChatLogInfo(messageList, Chat.eRequestDirection.OLD); - List chatLogAssetPathList = GetChatLogAssetPathList(ChatVisibleLogList); - for (int num = 0; num < _stampList.Count; num++) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(_stampList[num].ToString(), ResourcesManager.AssetLoadPathType.Stamp); - chatLogAssetPathList.Add(assetTypePath); - } - LoadResources(chatLogAssetPathList, delegate - { - CreateScrollView(ChatVisibleLogList); - ResetScrollDefaultPosition(unreadMessageId); - onFinCallBack.Call(); - _isCreateFinish = true; - }); - } - - public void CloseChatLogView() - { - UnloadResources(); - } - - public void ResetScrollDefaultPosition(int unreadMessageId = -1) - { - int centerIndex = Mathf.Max(ChatVisibleLogList.Count - 1, 0); - if (unreadMessageId != -1) - { - int num = ChatVisibleLogList.FindIndex((ChatMessageInfo log) => log.MessageId == unreadMessageId); - if (num >= 0) - { - centerIndex = num; - } - } - _wrapVariableContent.ResetScrollPositionByIndex(centerIndex); - } - - public void SetEnableUpdateUI() - { - if (IsEnableUpdateUI) - { - return; - } - IsEnableUpdateUI = true; - if (_oldUnreadMessageId != -1) - { - UpdateChatLogSizeByIndex(ChatVisibleLogList.FindIndex((ChatMessageInfo info) => info.MessageId == _oldUnreadMessageId)); - _oldUnreadMessageId = -1; - } - _wrapContentScrollBarSize.ContentUpdate(); - _wrapVariableContent.WrapContent(); - } - - public void AddChatLogView(ChatInfo chatInfo, Chat.eRequestDirection eDirection, bool in_enableUpdateUI = true, Action onFinCallBack = null) - { - if (chatInfo.MessageList.Count <= 0) - { - onFinCallBack.Call(); - return; - } - AddChatLogInfo(chatInfo.MessageList, eDirection); - if (chatInfo.VisibleMessageList.Count <= 0) - { - onFinCallBack.Call(); - return; - } - if (eDirection == Chat.eRequestDirection.NEW && IsEnableUpdateUI && !in_enableUpdateUI) - { - _oldUnreadMessageId = _unreadMessageId; - _unreadMessageId = chatInfo.VisibleMessageList[0].MessageId; - } - IsEnableUpdateUI = in_enableUpdateUI; - bool flag = _wrapVariableContent.IsBottom(); - List chatLogAssetPathList = GetChatLogAssetPathList(chatInfo.VisibleMessageList); - LoadResources(chatLogAssetPathList); - AddScrollPlate(chatInfo.VisibleMessageList, eDirection); - if (eDirection == Chat.eRequestDirection.NEW && flag && IsEnableUpdateUI) - { - MoveNewMessagePosition(); - } - onFinCallBack.Call(); - } - - public void MoveNewMessagePosition() - { - if (_wrapVariableContent.IsScrollEnableSize()) - { - _wrapVariableContent.ResetScrollPositionBottomEasing(); - } - } - - public void ChangeLogViewSizeByInputUIAnimation(ChatOpenCloseAnimation sendUIAnimation) - { - _scrollBarWrapContent.gameObject.SetActive(value: false); - _buttonToNewMessage.gameObject.SetActive(value: false); - if (!_dependOpenCloseAnimationList.Contains(sendUIAnimation)) - { - _dependOpenCloseAnimationList.Add(sendUIAnimation); - } - if (_dependOpenCloseAnimationList.All((ChatOpenCloseAnimation x) => x.IsAnimationStartFromOpenedOrClosed)) - { - _isFollowingAnimation = IsEnableFollowAnimation(); - float num = (_isFollowingAnimation ? GetDependOpenCloseAnimationHeight() : 0f); - _scrollViewBasePosY = _scrollView.transform.localPosition.y - num; - if (_isFollowingAnimation && _bottomScrollViewAnimationCoroutin == null) - { - _bottomScrollViewAnimationCoroutin = StartCoroutine(CalcHeightBottomScrollViewAnimation()); - } - } - } - - private IEnumerator CalcHeightBottomScrollViewAnimation() - { - float distance = _wrapVariableContent.GetDistanceBetweenBottomItemAndScrollBottomPos(); - float durationTime = _dependOpenCloseAnimationList.Max((ChatOpenCloseAnimation x) => x.AnimationTime); - _bottomScrollViewAnimationDistance = 0f; - CustomEasing easing = new CustomEasing(CustomEasing.eType.outQuad, 0f, distance, durationTime); - while (easing.IsMoving) - { - _bottomScrollViewAnimationDistance = easing.GetCurVal(Time.deltaTime); - yield return null; - } - _bottomScrollViewAnimationDistance = distance; - _bottomScrollViewAnimationCoroutin = null; - } - - private void CloseChatLogContent(int messageId) - { - int num = ChatVisibleLogList.FindIndex((ChatMessageInfo log) => log.MessageId == messageId); - if (num >= 0) - { - ChatVisibleLogList[num].CloseContent(); - UpdateChatLogSizeByIndex(num); - } - } - - private void UpdateChatLogSizeByIndex(int index) - { - if (index >= 0 && ChatVisibleLogList.Count >= index) - { - _wrapVariableContent.UpdateItemSize(index, GetHeightPlateSize(ChatVisibleLogList[index])); - _wrapContentScrollBarSize.ContentUpdate(); - } - } - - private bool IsEnableFollowAnimation() - { - if (!_wrapVariableContent.IsScrollEnableSize()) - { - return false; - } - if (!_wrapVariableContent.IsBottom()) - { - return false; - } - if (_wrapVariableContent.TopOverflowItemSize() < GetDependOpenCloseAnimationHeight()) - { - return false; - } - return true; - } - - private float GetDependOpenCloseAnimationHeight() - { - float num = 0f; - foreach (ChatOpenCloseAnimation dependOpenCloseAnimation in _dependOpenCloseAnimationList) - { - float num2 = num; - num2 = ((!dependOpenCloseAnimation.IsMoving) ? ((!dependOpenCloseAnimation.IsOpen) ? 0f : dependOpenCloseAnimation.OpenHeight) : dependOpenCloseAnimation.CurrentPosHeight); - num = Mathf.Max(num, num2); - } - return num; - } - - private void Update() - { - UpdateButtonToNewMessage(); - } - - private void UpdateButtonToNewMessage() - { - if (IsEnableUpdateUI && _dependOpenCloseAnimationList.Count <= 0) - { - _buttonToNewMessage.gameObject.SetActive(!_wrapVariableContent.IsBottom()); - } - } - - private void LateUpdate() - { - if (IsUpdateLogViewSize()) - { - UpdateLogViewSizeDependAnimation(); - } - } - - private bool IsUpdateLogViewSize() - { - return _dependOpenCloseAnimationList.Any((ChatOpenCloseAnimation x) => x.IsMoving || !x.IsOpen); - } - - private void UpdateLogViewSizeDependAnimation() - { - float dependOpenCloseAnimationHeight = GetDependOpenCloseAnimationHeight(); - Vector4 baseClipRegion = _panelScrollView.baseClipRegion; - baseClipRegion.y = _startBaseClipRegionY + dependOpenCloseAnimationHeight * 0.5f; - baseClipRegion.w = _startBaseClipRegionW - dependOpenCloseAnimationHeight; - _panelScrollView.baseClipRegion = baseClipRegion; - float num = _scrollViewBasePosY; - if (_isFollowingAnimation) - { - num += dependOpenCloseAnimationHeight + _bottomScrollViewAnimationDistance; - } - _wrapVariableContent.MoveScrollPanel(num); - _dependOpenCloseAnimationList.RemoveAll((ChatOpenCloseAnimation x) => !x.IsMoving && !x.IsOpen); - _scrollBarWrapContent.gameObject.SetActive(_dependOpenCloseAnimationList.Count == 0 && _wrapVariableContent.IsScrollEnableSize()); - } - - private void AddChatLogInfo(List addChatLogList, Chat.eRequestDirection eDirection) - { - if (eDirection == Chat.eRequestDirection.OLD) - { - for (int num = addChatLogList.Count - 1; num >= 0; num--) - { - ChatAllLogList.Insert(0, addChatLogList[num]); - } - } - else - { - ChatAllLogList.AddRange(addChatLogList); - } - ChatVisibleLogList = ChatAllLogList.Where((ChatMessageInfo log) => log.IsVisibleMessage).ToList(); - } - - private List GetChatLogAssetPathList(List logList) - { - List list = new List(); - List list2 = new List(); - for (int i = 0; i < logList.Count; i++) - { - list.AddRange(logList[i].GetResourcePathList()); - } - list = list.Distinct().ToList(); - for (int j = 0; j < list.Count; j++) - { - string item = list[j]; - if (!_loadedResourceList.Contains(item)) - { - list2.Add(item); - } - } - return list2; - } - - private void LoadResources(List resourcePathList, Action callBack = null) - { - if (resourcePathList.Count <= 0) - { - callBack.Call(); - return; - } - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(resourcePathList, delegate - { - _loadedResourceList.AddRange(resourcePathList); - callBack.Call(); - })); - } - - private void CreateScrollView(List addChatLogList) - { - _wrapVariableContent.gameObject.SetActive(value: false); - _scrollBarWrapContent.m_WrapContents = _wrapVariableContent; - _scrollBarWrapContent.gameObject.SetActive(value: true); - _scrollView.gameObject.SetActive(value: true); - _wrapVariableContent.Init(10, 0, 0, OnInitializeItem); - _wrapVariableContent.gameObject.SetActive(value: true); - if (ChatVisibleLogList.Count > 0) - { - AddScrollPlate(addChatLogList, Chat.eRequestDirection.OLD); - } - } - - private void AddScrollPlate(List addChatLogList, Chat.eRequestDirection eDirection) - { - List list = new List(); - foreach (ChatMessageInfo addChatLog in addChatLogList) - { - int heightPlateSize = GetHeightPlateSize(addChatLog); - if (heightPlateSize > 0) - { - list.Add(heightPlateSize); - } - } - _wrapVariableContent.AddItemList(list, eDirection == Chat.eRequestDirection.NEW); - if (_plateList.Count < 10) - { - _wrapVariableContent.enabled = true; - for (int i = _plateList.Count; i < ChatVisibleLogList.Count && i < 10; i++) - { - ChatLogPlate item = CreateLogPlate(_wrapVariableContent.gameObject); - _plateList.Add(item); - } - for (int j = 0; j < _plateList.Count; j++) - { - _plateList[j].gameObject.SetActive(value: true); - } - _wrapVariableContent.SortBasedOnScrollMovement(); - if (!_wrapVariableContent.IsScrollEnableSize()) - { - _scrollView.ResetPosition(); - } - } - if (IsEnableUpdateUI) - { - _wrapContentScrollBarSize.ContentUpdate(); - _wrapVariableContent.WrapContent(); - } - } - - private int GetHeightPlateSize(ChatMessageInfo logInfo) - { - if (_logPlateForSizeCalcDummyObject == null) - { - _logPlateForSizeCalcDummyObject = CreateLogPlate(base.gameObject); - _logPlateForSizeCalcDummyObject.gameObject.SetActive(value: false); - } - return _logPlateForSizeCalcDummyObject.GetHeightSize(logInfo, logInfo.MessageId == _unreadMessageId) + 10; - } - - private ChatLogPlate CreateLogPlate(GameObject rootObj) - { - ChatLogPlate component = NGUITools.AddChild(rootObj, _logPlateOriginal.gameObject).GetComponent(); - component.Init(_chatSettings, _chatConnectController, _partsForPlate, IsLoadedResources); - return component; - } - - private void OnInitializeItem(GameObject go, int wrapIndex, int realIndex) - { - int num = -realIndex; - if (num >= ChatVisibleLogList.Count || num < 0) - { - go.SetActive(value: false); - return; - } - go.SetActive(value: true); - ChatMessageInfo chatMessageInfo = ChatVisibleLogList[num]; - go.GetComponent().SetData(chatMessageInfo, chatMessageInfo.MessageId == _unreadMessageId); - if (num == 0 && _isCreateFinish) - { - _onInitializeOldestLog.Call(); - } - } - - private void OnDestroy() - { - UnloadResources(); - } - - private bool IsLoadedResources(List checkResourceList) - { - for (int i = 0; i < checkResourceList.Count; i++) - { - if (!_loadedResourceList.Contains(checkResourceList[i])) - { - return false; - } - } - return true; - } - - private void UnloadResources() - { - if (_loadedResourceList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatMessageInfo.cs b/SVSim.BattleEngine/Engine/Wizard/ChatMessageInfo.cs deleted file mode 100644 index 24b536e0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatMessageInfo.cs +++ /dev/null @@ -1,411 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using LitJson; - -namespace Wizard; - -public class ChatMessageInfo -{ - public class RoomMatchData - { - public string RoomId { get; private set; } - - public BattleParameter BattleParameterInstance { get; private set; } - - public bool IsWatchEnabled { get; private set; } - - public RoomMatchData(JsonData json) - { - RoomId = json["room_id"].ToString(); - BattleParameterInstance = BattleParameter.JsonToBattleParameter(json); - IsWatchEnabled = json["is_watch_enabled"].ToInt() == 1; - } - } - - public class DeckLogData - { - public int MessageId { get; private set; } - - public bool IsAbleDeleteDeck { get; private set; } - - public DeckData DeckData { get; private set; } - - public DeckLogData(JsonData jsonData) - { - Format format = Data.ParseApiFormat(jsonData["deck_format"].ToInt()); - DeckData = new DeckData(format, DeckAttributeType.CustomDeck); - DeckData.Initialize(jsonData); - DeckData.SetDeckSleeveID(3000011L); - DeckData.SetSkinId(DeckData.GetSkinId(isDefaultSkin: true)); - MessageId = jsonData["message_id"].ToInt(); - IsAbleDeleteDeck = jsonData["delete_permission_exists"].ToBoolean(); - } - - public static List ParseDeckDataList(JsonData jsonDeckList) - { - List list = new List(); - for (int i = 0; i < jsonDeckList.Count; i++) - { - list.Add(new DeckLogData(jsonDeckList[i])); - } - return list; - } - - public static List ConvertDeckDataList(List deckLogDataList) - { - return deckLogDataList.ConvertAll((DeckLogData log) => log.DeckData); - } - - public static DeckLogData GetDeckLogDataByDeckId(List deckLogDataList, int deckId) - { - return deckLogDataList.Find((DeckLogData data) => data.DeckData.GetDeckID() == deckId); - } - } - - public class GatheringWinnerUsers - { - public List WinnerList { get; private set; } = new List(); - - public GatheringWinnerUsers(string message, List chatUserList) - { - if (message == "") - { - return; - } - string[] array = message.Split(','); - foreach (string s in array) - { - ChatUserInfo item = null; - if (int.TryParse(s, out var viewerId)) - { - item = chatUserList.First((ChatUserInfo data) => data.ViewerId == viewerId); - } - WinnerList.Add(item); - } - } - } - - public class GatheringTournamentRoomData - { - public RoomMatchData RoomData { get; private set; } - - public ChatUserInfo User1 { get; private set; } - - public ChatUserInfo User2 { get; private set; } - - public bool IsMyselfMathcedRoom - { - get - { - if (!User1.IsMyself()) - { - return User2.IsMyself(); - } - return true; - } - } - - public GatheringTournamentRoomData(JsonData jsonData, List chatUserList) - { - RoomData = new RoomMatchData(jsonData["room"]); - int viewerId1 = jsonData["viewer_id1"].ToInt(); - int viewerId2 = jsonData["viewer_id2"].ToInt(); - User1 = chatUserList.First((ChatUserInfo data) => data.ViewerId == viewerId1); - User2 = chatUserList.First((ChatUserInfo data) => data.ViewerId == viewerId2); - } - } - - public enum eMessageType - { - NORMAL = 0, - STAMP = 1, - DECK = 2, - JOIN = 3, - LEAVE = 4, - REPLAY = 5, - CHANGE_LEADER = 6, - CHANGE_SUB_LEADER = 7, - CREATE_GUILD = 8, - REMOVE = 9, - ROOM_MATCH = 10, - DESCRIPTION = 11, - GATHERING_CREATE = 12, - GATHERING_JOIN = 13, - GATHERING_LEAVE = 14, - GATHERING_REMOVE = 15, - GATHERING_BATTLE_START = 16, - GATHERING_BATTLE_END = 17, - GATHERING_TOURNAMENT_ROOM = 18, - INVALID_VALUE = -1 - } - - public enum eTalkerType - { - INVALID, - NO_MEMBER, - OWN, - OTHER - } - - public bool IsVisibleMessage { get; private set; } = true; - - public bool IsCloseContent { get; private set; } - - public eTalkerType TalkerType - { - get - { - eTalkerType result = eTalkerType.INVALID; - switch (MessageType) - { - case eMessageType.JOIN: - case eMessageType.LEAVE: - case eMessageType.CHANGE_LEADER: - case eMessageType.CHANGE_SUB_LEADER: - case eMessageType.CREATE_GUILD: - case eMessageType.REMOVE: - case eMessageType.DESCRIPTION: - case eMessageType.GATHERING_CREATE: - case eMessageType.GATHERING_JOIN: - case eMessageType.GATHERING_LEAVE: - case eMessageType.GATHERING_REMOVE: - case eMessageType.GATHERING_BATTLE_START: - case eMessageType.GATHERING_BATTLE_END: - case eMessageType.GATHERING_TOURNAMENT_ROOM: - result = eTalkerType.NO_MEMBER; - break; - case eMessageType.NORMAL: - case eMessageType.STAMP: - case eMessageType.DECK: - case eMessageType.REPLAY: - case eMessageType.ROOM_MATCH: - result = ((ViewerId != PlayerStaticData.UserViewerID) ? eTalkerType.OTHER : eTalkerType.OWN); - break; - } - return result; - } - } - - public int ViewerId { get; private set; } - - public ChatUserInfo UserInfo { get; private set; } - - public int MessageId { get; private set; } - - public eMessageType MessageType { get; private set; } - - public string Message { get; private set; } - - public int CreateTime { get; private set; } - - public int StampId { get; private set; } - - public ReplayInfoItem ReplayInfo { get; private set; } - - public DeckLogData DeckInfo { get; private set; } - - public RoomMatchData RoomData { get; private set; } - - public GatheringWinnerUsers GatheringWinnerUsersInfo { get; private set; } - - public GatheringTournamentRoomData GatheringTournamentRoom { get; private set; } - - public ChatMessageInfo(eMessageType messageType) - { - initialize(); - MessageType = messageType; - } - - public ChatMessageInfo(JsonData messageData, List userList) - { - initialize(); - ParseMessageData(messageData, userList); - } - - public string GetCreateTimeText() - { - return ConvertTime.DateTimeToAgoText(ConvertTime.ToLocalByDateTime(ConvertTime.UnixTimeToDateTime(CreateTime))); - } - - public List GetResourcePathList() - { - List loadPath = new List(); - switch (MessageType) - { - case eMessageType.STAMP: - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(StampId.ToString(), ResourcesManager.AssetLoadPathType.Stamp)); - break; - case eMessageType.DECK: - if (DeckInfo != null) - { - long existingSleeveId = Toolbox.ResourcesManager.GetExistingSleeveId(DeckInfo.DeckData.GetDeckSleeveID()); - Sleeve sleeve = Data.Master.SleeveMgr.Get(existingSleeveId); - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(existingSleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture)); - if (sleeve.IsPremiumSleeve) - { - UIManager.GetInstance().getUIBase_CardManager().AddPremireSleevePath(ref loadPath, sleeve); - } - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(DeckInfo.DeckData.GetSkinId().ToString(), ResourcesManager.AssetLoadPathType.DeckListTexture)); - } - break; - case eMessageType.REPLAY: - if (ReplayInfo != null) - { - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(UserInfo.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_S)); - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(ReplayInfo.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S)); - } - break; - case eMessageType.GATHERING_BATTLE_END: - foreach (ChatUserInfo winner in GatheringWinnerUsersInfo.WinnerList) - { - loadPath.Add(Toolbox.ResourcesManager.GetAssetTypePath(winner.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_S)); - } - break; - case eMessageType.GATHERING_TOURNAMENT_ROOM: - if (GatheringTournamentRoom != null) - { - loadPath.AddRange(GatheringTournamentRoom.User1.GetResourcePathList()); - loadPath.AddRange(GatheringTournamentRoom.User2.GetResourcePathList()); - } - break; - } - if ((TalkerType == eTalkerType.OWN || TalkerType == eTalkerType.OTHER) && UserInfo != null) - { - loadPath.AddRange(UserInfo.GetResourcePathList()); - } - return loadPath.Distinct().ToList(); - } - - public void CloseContent() - { - IsCloseContent = true; - ReplayInfo = null; - DeckInfo = null; - RoomData = null; - GatheringTournamentRoom = null; - } - - private void initialize() - { - ViewerId = 0; - MessageId = 0; - MessageType = eMessageType.NORMAL; - Message = null; - CreateTime = 0; - StampId = 0; - ReplayInfo = null; - DeckInfo = null; - } - - private void ParseMessageData(JsonData json, List userList) - { - ViewerId = json["viewer_id"].ToInt(); - MessageId = json["message_id"].ToInt(); - int num = json["message_type"].ToInt(); - if (Enum.IsDefined(typeof(eMessageType), num)) - { - MessageType = (eMessageType)num; - } - CreateTime = json["create_time"].ToInt(); - switch (MessageType) - { - case eMessageType.NORMAL: - Message = json["message"].ToString(); - break; - case eMessageType.STAMP: - StampId = json["message"].ToInt(); - break; - case eMessageType.REPLAY: - ParseReplayData(json); - break; - case eMessageType.DECK: - ParseDeckData(json); - break; - case eMessageType.ROOM_MATCH: - ParseRoomMatchData(json); - break; - case eMessageType.GATHERING_BATTLE_END: - GatheringWinnerUsersInfo = new GatheringWinnerUsers(json["message"].ToString(), userList); - break; - case eMessageType.GATHERING_TOURNAMENT_ROOM: - ParseGatheringTournamentRoomData(json, userList); - break; - } - SetUserInfo(userList); - } - - private void ParseReplayData(JsonData json) - { - if (json.Keys.Contains("replay")) - { - JsonData jsonData = json["replay"]; - if (jsonData == null) - { - ReplayInfo = null; - CloseContent(); - } - else - { - ReplayInfo = new ReplayInfoItem(jsonData); - } - } - } - - private void ParseDeckData(JsonData json) - { - if (json.Keys.Contains("deck")) - { - JsonData jsonData = json["deck"]; - if (jsonData == null) - { - DeckInfo = null; - CloseContent(); - } - else - { - DeckInfo = new DeckLogData(jsonData); - } - } - } - - private void ParseRoomMatchData(JsonData json) - { - if (json.Keys.Contains("room")) - { - JsonData jsonData = json["room"]; - if (jsonData == null) - { - RoomData = null; - CloseContent(); - } - else - { - RoomData = new RoomMatchData(jsonData); - } - } - } - - private void ParseGatheringTournamentRoomData(JsonData json, List userList) - { - if (json.Keys.Contains("room")) - { - IsVisibleMessage = json["viewer_id1"].ToInt() == PlayerStaticData.UserViewerID || json["viewer_id2"].ToInt() == PlayerStaticData.UserViewerID; - if (json["room"] == null) - { - GatheringTournamentRoom = null; - CloseContent(); - } - else - { - GatheringTournamentRoom = new GatheringTournamentRoomData(json, userList); - } - } - } - - private void SetUserInfo(List userList) - { - UserInfo = userList.Find((ChatUserInfo x) => x.ViewerId == ViewerId); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatOpenCloseAnimation.cs b/SVSim.BattleEngine/Engine/Wizard/ChatOpenCloseAnimation.cs deleted file mode 100644 index 777b43b3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatOpenCloseAnimation.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatOpenCloseAnimation : MonoBehaviour -{ - public enum eState - { - CLOSED, - OPENED, - CLOSING, - OPENING - } - - public const float CLOSE_HEIGHT = 0f; - - [SerializeField] - private GameObject _animationObj; - - [SerializeField] - private bool _isActiveUpdate; - - [SerializeField] - private float _openPositionY; - - [SerializeField] - private float _closePositionY = -60f; - - [SerializeField] - private float _openAnimationTime = 0.3f; - - [SerializeField] - private float _closeAnimationTime = 0.2f; - - private Coroutine _coroutinAnimation; - - public eState State { get; private set; } - - public bool IsOpen - { - get - { - if (State != eState.OPENED) - { - return State == eState.OPENING; - } - return true; - } - } - - public bool IsMoving { get; private set; } - - public float CurrentPosHeight => _animationObj.transform.localPosition.y - _closePositionY; - - public float OpenHeight => _openPositionY - _closePositionY; - - public float AnimationTime - { - get - { - if (!IsOpen) - { - return _closeAnimationTime; - } - return _openAnimationTime; - } - } - - public bool IsAnimationStartFromOpenedOrClosed - { - get - { - if (State != eState.OPENING || !Mathf.Approximately(CurrentPosHeight, 0f)) - { - if (State == eState.CLOSING) - { - return Mathf.Approximately(CurrentPosHeight, OpenHeight); - } - return false; - } - return true; - } - } - - public void Init(bool isOpenedDefault) - { - ChangeOpenedClosedState(isOpenedDefault); - } - - public void ToggleStateAndStartAnimation() - { - switch (State) - { - case eState.CLOSED: - case eState.CLOSING: - StartOpenAnimation(); - break; - case eState.OPENED: - case eState.OPENING: - StartCloseAnimation(); - break; - } - } - - public void StartCloseAnimation(Action onAnimationEndCallBack = null) - { - if (IsOpen) - { - if (_coroutinAnimation != null) - { - StopCoroutine(_coroutinAnimation); - } - _coroutinAnimation = StartCoroutine(CloseAnimation(onAnimationEndCallBack)); - } - } - - public void StartOpenAnimation() - { - if (!IsOpen) - { - if (_coroutinAnimation != null) - { - StopCoroutine(_coroutinAnimation); - } - _animationObj.SetActive(value: true); - _coroutinAnimation = StartCoroutine(OpenAnimation()); - } - } - - private IEnumerator OpenAnimation() - { - State = eState.OPENING; - Vector3 basePos = _animationObj.transform.localPosition; - IsMoving = true; - float durationTime = _openAnimationTime * (1f - CurrentPosHeight / OpenHeight); - CustomEasing easing = new CustomEasing(CustomEasing.eType.outQuad, basePos.y, _openPositionY, durationTime); - while (easing.IsMoving) - { - yield return null; - float curVal = easing.GetCurVal(Time.deltaTime); - _animationObj.transform.localPosition = new Vector3(basePos.x, curVal, basePos.z); - if (State != eState.OPENING) - { - yield break; - } - } - IsMoving = false; - ChangeOpenedClosedState(isOpened: true); - } - - private IEnumerator CloseAnimation(Action onAnimationEndCallBack) - { - State = eState.CLOSING; - Vector3 basePos = _animationObj.transform.localPosition; - IsMoving = true; - float durationTime = _closeAnimationTime * CurrentPosHeight / OpenHeight; - CustomEasing easing = new CustomEasing(CustomEasing.eType.outQuad, basePos.y, _closePositionY, durationTime); - while (easing.IsMoving) - { - yield return null; - float curVal = easing.GetCurVal(Time.deltaTime); - _animationObj.transform.localPosition = new Vector3(basePos.x, curVal, basePos.z); - if (State != eState.CLOSING) - { - yield break; - } - } - IsMoving = false; - ChangeOpenedClosedState(isOpened: false); - onAnimationEndCallBack.Call(); - } - - private void ChangeOpenedClosedState(bool isOpened) - { - State = (isOpened ? eState.OPENED : eState.CLOSED); - Vector3 localPosition = _animationObj.transform.localPosition; - float y = (isOpened ? _openPositionY : _closePositionY); - _animationObj.transform.localPosition = new Vector3(localPosition.x, y, localPosition.z); - if (_isActiveUpdate) - { - _animationObj.SetActive(isOpened); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatPostTask.cs b/SVSim.BattleEngine/Engine/Wizard/ChatPostTask.cs deleted file mode 100644 index 17b4e2bd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatPostTask.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace Wizard; - -public class ChatPostTask : BaseTask -{ - public class ChatPostTaskParam : BaseParam - { - public int type { get; set; } - - public string message { get; set; } - } - - public AchievedInfo AchievedInfo { get; private set; } - - public ChatPostTask(ApiType.Type apiType) - { - base.type = apiType; - } - - public void SetParameter(int type, string message) - { - ChatPostTaskParam chatPostTaskParam = new ChatPostTaskParam(); - chatPostTaskParam.type = type; - chatPostTaskParam.message = message; - base.Params = chatPostTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - if (base.ResponseData["data"].Count > 0) - { - if (base.ResponseData["data"].Keys.Contains("achieved_info")) - { - AchievedInfo = new AchievedInfo(base.ResponseData["data"]["achieved_info"]); - } - if (base.ResponseData["data"].Keys.Contains("reward_list")) - { - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - } - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatReplayListDialog.cs b/SVSim.BattleEngine/Engine/Wizard/ChatReplayListDialog.cs deleted file mode 100644 index 9d32d3af..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatReplayListDialog.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatReplayListDialog : MonoBehaviour -{ - [SerializeField] - private SimpleScrollViewUI _replayListScrollView; - - [SerializeField] - private UILabel _labelNoReplay; - - private List _listReplayInfoItem; - - private Action _onClickReplaySendBtn; - - private List _loadedResourceList = new List(); - - public void Init(List listReplayInfoItem, Action onClickReplaySendBtn) - { - _listReplayInfoItem = listReplayInfoItem; - _onClickReplaySendBtn = onClickReplaySendBtn; - CreateReplayList(); - } - - private void CreateReplayList() - { - bool flag = _listReplayInfoItem.Count <= 0; - _replayListScrollView.SetVisiable(!flag); - _labelNoReplay.gameObject.SetActive(flag); - if (!flag) - { - LoadResources(delegate - { - _replayListScrollView.CreateScrollView(_listReplayInfoItem.Count, OnInitializeContent); - }); - } - } - - private void OnInitializeContent(int index, GameObject plate) - { - ReplayInfoItem replayInfo = _listReplayInfoItem[index]; - plate.GetComponent().SetData(replayInfo, delegate - { - _onClickReplaySendBtn.Call(replayInfo); - }); - } - - private void LoadResources(Action callBack = null) - { - UIManager.GetInstance().createInSceneCenterLoading(); - List list = new List(); - foreach (ReplayInfoItem item in _listReplayInfoItem) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S)); - if (!string.IsNullOrEmpty(item.OpponentCountryCode)) - { - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentCountryCode, ResourcesManager.AssetLoadPathType.Country_S)); - } - } - List loadPathList = list.Distinct().Except(_loadedResourceList).ToList(); - if (loadPathList.Count > 0) - { - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, delegate - { - _loadedResourceList.AddRange(loadPathList); - UIManager.GetInstance().closeInSceneCenterLoading(); - callBack.Call(); - })); - } - } - - private void UnloadResources() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private void OnDestroy() - { - UnloadResources(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatReplayListDialogContent.cs b/SVSim.BattleEngine/Engine/Wizard/ChatReplayListDialogContent.cs deleted file mode 100644 index 1a0d839b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatReplayListDialogContent.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatReplayListDialogContent : MonoBehaviour -{ - [SerializeField] - private ReplayContentView _prefabReplayInfoView; - - [SerializeField] - private GameObject _rootReplayInfoView; - - [SerializeField] - private UIButton _btnReplaySend; - - private ReplayContentView _replayInfoView; - - public void SetData(ReplayInfoItem replayInfoItem, Action onClickReplaySend) - { - if (_replayInfoView == null) - { - _replayInfoView = NGUITools.AddChild(_rootReplayInfoView, _prefabReplayInfoView.gameObject).GetComponent(); - } - _replayInfoView.SetData(replayInfoItem); - _btnReplaySend.onClick.Clear(); - _btnReplaySend.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - onClickReplaySend.Call(); - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatReplaySendConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/ChatReplaySendConfirmDialog.cs deleted file mode 100644 index 8660a0c4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatReplaySendConfirmDialog.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class ChatReplaySendConfirmDialog : MonoBehaviour -{ - [SerializeField] - private ReplayContentView _replayInfoView; - - public void SetData(string ownName, long ownEmblemId, ReplayInfoItem replayInfoItem) - { - _replayInfoView.SetData(replayInfoItem); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatSendDeckUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatSendDeckUI.cs deleted file mode 100644 index 79d3122b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatSendDeckUI.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatSendDeckUI : MonoBehaviour, IChatActionUI -{ - private const int DEPTH_DECK_SHARE_CONFIRM_DIALOG = 15; - - [SerializeField] - private UIButton _buttonDeckShare; - - [SerializeField] - private DeckDecisionUI _prefabDeckDecisionUI; - - private DeckSelectUIDialog _deckSelectUIDialog; - - private IChatApiSettings _chatApiSettings; - - private ChatConnectController _chatConnectController; - - private Action _eventOnSendDeckSuccess; - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatApiSettings = chatSettings.ApiSettings; - _chatConnectController = chatConnectController; - _eventOnSendDeckSuccess = actionAddNewChatLogAfterSendChat; - _buttonDeckShare.onClick.Clear(); - _buttonDeckShare.onClick.Add(new EventDelegate(delegate - { - OnClickDeckShareButton(); - })); - } - - private void OnClickDeckShareButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - DeckMyListTask task = new DeckMyListTask(); - task.SetParameter(Format.All); - _chatConnectController.StartConnectCommon(task, delegate - { - List deckGroupList = task.DeckGroupListData.DeckGroupList.Where((DeckGroup deckGroup) => deckGroup.AttributeType == DeckAttributeType.CustomDeck).ToList(); - Format format = (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_SELECT_DECK_FORMAT); - if (format == Format.Avatar) - { - format = Format.Rotation; - } - DeckSelectUIDialog.eFormatChangeUIType formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.NormalFormatOnly; - if (Prerelease.Status != Prerelease.eStatus.NONE) - { - formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.WithPrerotation; - } - else if (DeckListUtility.DeckGroupDataBaseClone().Any((DeckGroup deckgroup) => deckgroup.DeckFormat == Format.Crossover)) - { - formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.WithCrossover; - } - else if (Data.MyRotationAllInfo.IsMyRotationEnable) - { - formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.WithMyRotation; - } - _deckSelectUIDialog = DeckSelectUIDialog.Create(Data.SystemText.Get("Guild_Chat_0011"), new DeckGroupListData(deckGroupList), format, formatChangeUIType, isVisibleCreateNew: false, delegate(DialogBase dialogDeckList, DeckData deckData) - { - CreateDeckSelectConfirmDialog(deckData); - }); - }); - } - - private void CreateDeckSelectConfirmDialog(DeckData deckData) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonText(systemText.Get("Common_0004"), systemText.Get("Card_0083")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dialogBase.SetPanelDepth(15); - DeckDecisionUI deckDecisionUI = UnityEngine.Object.Instantiate(_prefabDeckDecisionUI); - deckDecisionUI.SetText(systemText.Get("Guild_Chat_0012"), deckData.GetDeckName()); - deckDecisionUI.SetDeckData(deckData, null); - dialogBase.SetObj(deckDecisionUI.gameObject); - dialogBase.onPushButton2 = deckDecisionUI.OnClickCreateCardList; - dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_DECIDE; - dialogBase.isNotCloseWindowButton2 = true; - deckDecisionUI.DeckName = deckData.GetDeckName(); - dialogBase.onPushButton1 = delegate - { - OnDecideDeck(deckData); - _deckSelectUIDialog.Close(); - }; - } - - private void OnDecideDeck(DeckData deckData) - { - ChatAddDeckTask chatAddDeckTask = new ChatAddDeckTask(_chatApiSettings.ApiChatAddDeck); - int deckFormat = Data.FormatConvertApi(deckData.Format); - int deckID = deckData.GetDeckID(); - chatAddDeckTask.SetParameter(deckFormat, deckID); - _chatConnectController.StartConnectCommon(chatAddDeckTask, delegate - { - _eventOnSendDeckSuccess.Call(); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatSendReplayListUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatSendReplayListUI.cs deleted file mode 100644 index 93139cc3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatSendReplayListUI.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatSendReplayListUI -{ - private const int DEPTH_REPLAY_SHARE_CONFIRM_DIALOG = 15; - - private ChatReplayListDialog _prefabReplayShareDialog; - - private ChatReplaySendConfirmDialog _prefabReplaySendConfirmDialog; - - private Action _onDecideReplay; - - private DialogBase _dialogReplayList; - - public ChatSendReplayListUI(ChatReplayListDialog prefabReplayShareDialog, ChatReplaySendConfirmDialog prefabReplaySendConfirmDialog, Action onDecideDeck) - { - _prefabReplayShareDialog = prefabReplayShareDialog; - _prefabReplaySendConfirmDialog = prefabReplaySendConfirmDialog; - _onDecideReplay = onDecideDeck; - } - - public void CreateReplayListDialog() - { - _dialogReplayList = UIManager.GetInstance().CreateDialogClose(); - _dialogReplayList.SetSize(DialogBase.Size.XL); - _dialogReplayList.SetTitleLabel(Data.SystemText.Get("OtherTop_0033")); - _dialogReplayList.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - ChatReplayListDialog chatReplayListDialog = UnityEngine.Object.Instantiate(_prefabReplayShareDialog); - _dialogReplayList.SetObj(chatReplayListDialog.gameObject); - chatReplayListDialog.Init(Data.ReplayInfo.Items, CreateReplaySelectConfirmDialog); - } - - private void CreateReplaySelectConfirmDialog(ReplayInfoItem infoItem) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(Data.SystemText.Get("Guild_Chat_0003")); - dialogBase.SetButtonText(Data.SystemText.Get("Guild_Chat_0026")); - dialogBase.SetPanelDepth(15); - ChatReplaySendConfirmDialog chatReplaySendConfirmDialog = UnityEngine.Object.Instantiate(_prefabReplaySendConfirmDialog); - dialogBase.SetObj(chatReplaySendConfirmDialog.gameObject); - chatReplaySendConfirmDialog.SetData(PlayerStaticData.UserName, PlayerStaticData.UserEmblemID, infoItem); - dialogBase.onPushButton1 = delegate - { - _onDecideReplay.Call(infoItem); - _dialogReplayList.Close(); - }; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatSendReplayUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatSendReplayUI.cs deleted file mode 100644 index c34bf411..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatSendReplayUI.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatSendReplayUI : MonoBehaviour, IChatActionUI -{ - [SerializeField] - private UIButton _buttonReplayShare; - - [SerializeField] - private ChatReplayListDialog _prefabReplayShareDialog; - - [SerializeField] - private ChatReplaySendConfirmDialog _prefabReplaySendConfirmDialog; - - private ChatSendReplayListUI _chatSendReplayListUI; - - private IChatApiSettings _chatApiSettings; - - private ChatConnectController _chatConnectController; - - private Action _eventOnSendRepleySuccess; - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatApiSettings = chatSettings.ApiSettings; - _chatConnectController = chatConnectController; - _eventOnSendRepleySuccess = actionAddNewChatLogAfterSendChat; - _chatSendReplayListUI = new ChatSendReplayListUI(_prefabReplayShareDialog, _prefabReplaySendConfirmDialog, OnDecideReplay); - _buttonReplayShare.onClick.Clear(); - _buttonReplayShare.onClick.Add(new EventDelegate(delegate - { - OnClickReplayShareButton(); - })); - } - - private void OnClickReplayShareButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ReplayInfoTask task = new ReplayInfoTask(); - _chatConnectController.StartConnectCommon(task, delegate - { - _chatSendReplayListUI.CreateReplayListDialog(); - }); - } - - private void OnDecideReplay(ReplayInfoItem infoItem) - { - ChatAddReplayTask chatAddReplayTask = new ChatAddReplayTask(_chatApiSettings.ApiChatAddReplay); - chatAddReplayTask.SetParameter(infoItem.BattleId); - _chatConnectController.StartConnectCommon(chatAddReplayTask, delegate - { - _eventOnSendRepleySuccess.Call(); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatSendStampUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatSendStampUI.cs deleted file mode 100644 index 0f4408b6..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatSendStampUI.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatSendStampUI : MonoBehaviour -{ - private const int SCROLL_OBJECT_NUM = 8; - - [SerializeField] - private UIButton _buttonShowStampList; - - [SerializeField] - private ChatOpenCloseAnimation _uiOpenCloseAnimation; - - [SerializeField] - private UITexture _stampObjOrigin; - - [SerializeField] - protected UIScrollView _scrollView; - - [SerializeField] - private UIWrapMuchContent _wrapContent; - - [SerializeField] - private WrapContentsScrollBarSizeByDirection _wrapContentsScrollBarSize; - - private List _listStampUITexture = new List(8); - - private Action _onCloseStampListUI; - - private Action _OnClickStamp; - - private List _stampList; - - public bool IsOpen => _uiOpenCloseAnimation.IsOpen; - - public void Init(Action onClickStamp, Action onOpenStampListUI, Action onCloseStampListUI, List stampList) - { - _stampList = stampList; - _onCloseStampListUI = onCloseStampListUI; - _OnClickStamp = onClickStamp; - _uiOpenCloseAnimation.Init(isOpenedDefault: false); - _buttonShowStampList.onClick.Clear(); - _buttonShowStampList.onClick.Add(new EventDelegate(delegate - { - _uiOpenCloseAnimation.ToggleStateAndStartAnimation(); - if (_uiOpenCloseAnimation.IsOpen) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - ResetStampListScroll(); - onOpenStampListUI.Call(_uiOpenCloseAnimation); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); - _onCloseStampListUI.Call(_uiOpenCloseAnimation); - } - })); - CreateStampList(); - } - - public void CloseStampList(Action onAnimationEndCallBack = null) - { - if (IsOpen) - { - _uiOpenCloseAnimation.StartCloseAnimation(onAnimationEndCallBack); - _onCloseStampListUI.Call(_uiOpenCloseAnimation); - } - } - - private void Update() - { - if (_uiOpenCloseAnimation.State == ChatOpenCloseAnimation.eState.OPENING) - { - for (int i = 0; i < 8; i++) - { - _listStampUITexture[i].MarkAsChanged(); - } - } - } - - private void CreateStampList() - { - SetupScrollView(); - } - - private void SetupScrollView() - { - _listStampUITexture.Clear(); - for (int i = 0; i < 8; i++) - { - UITexture component = NGUITools.AddChild(_wrapContent.gameObject, _stampObjOrigin.gameObject).GetComponent(); - _listStampUITexture.Add(component); - } - _stampObjOrigin.gameObject.SetActive(value: false); - _wrapContent.onInitializeItem = OnInitializeItem; - _wrapContent.minIndex = 0; - _wrapContent.maxIndex = _stampList.Count - 1; - ResetStampListScroll(); - } - - private void OnInitializeItem(GameObject go, int wrapIndex, int realIndex) - { - if (_uiOpenCloseAnimation.IsOpen) - { - go.SetActive(value: true); - int id = _stampList[realIndex]; - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(id.ToString(), ResourcesManager.AssetLoadPathType.Stamp, isfetch: true)) as Texture; - go.GetComponent().mainTexture = mainTexture; - UIEventListener.Get(go).onClick = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - _OnClickStamp(id); - }; - } - } - - private void ResetStampListScroll() - { - _wrapContent.SortBasedOnScrollMovement(); - _scrollView.ResetPosition(); - _wrapContent.WrapContent(); - _wrapContentsScrollBarSize.ContentUpdate(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatSendTextUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatSendTextUI.cs deleted file mode 100644 index 61287b89..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatSendTextUI.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatSendTextUI : MonoBehaviour -{ - [SerializeField] - private UIButton _buttonStartInput; - - [SerializeField] - private ChatOpenCloseAnimation _uiOpenCloseAnimation; - - [SerializeField] - private UIButton _buttonSendMessage; - - [SerializeField] - private UIInputWizard _uiInputPC; - - [SerializeField] - private UIInputWizard _uiInputMobile; - - private UIInputWizard _uiInput; - - private Action _onCloseInputUI; - - public bool IsOpen => _uiOpenCloseAnimation.IsOpen; - - public void Init(Action onSendTextMessage, Action onOpenInputUI, Action onCloseStampListUI) - { - _uiInput = _uiInputPC; - _uiInputMobile.gameObject.SetActive(value: false); - _uiOpenCloseAnimation.Init(isOpenedDefault: false); - _onCloseInputUI = onCloseStampListUI; - _buttonStartInput.onClick.Clear(); - _buttonStartInput.onClick.Add(new EventDelegate(delegate - { - _uiOpenCloseAnimation.ToggleStateAndStartAnimation(); - if (_uiOpenCloseAnimation.IsOpen) - { - UICamera.selectedObject = _uiInput.gameObject; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - onOpenInputUI.Call(_uiOpenCloseAnimation); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); - _onCloseInputUI.Call(_uiOpenCloseAnimation); - } - })); - _uiInput.onSubmit.Clear(); - _uiInput.onSubmit.Add(new EventDelegate(delegate - { - _uiInput.value = _uiInput.value.Replace("\n", ""); - })); - _uiInput.onDeselect.Clear(); - _uiInput.onDeselect.Add(new EventDelegate(delegate - { - _uiInput.value = _uiInput.value.Replace("\n", ""); - })); - _buttonSendMessage.onClick.Clear(); - _buttonSendMessage.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - if (!(_uiInput.value == string.Empty)) - { - onSendTextMessage.Call(_uiInput.value); - } - })); - } - - public void CloseInputUI(bool isClearText, Action onAnimationEndCallBack = null) - { - if (IsOpen) - { - if (isClearText) - { - _uiInput.value = string.Empty; - } - _uiOpenCloseAnimation.StartCloseAnimation(onAnimationEndCallBack); - _onCloseInputUI.Call(_uiOpenCloseAnimation); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatShareDeckUI.cs b/SVSim.BattleEngine/Engine/Wizard/ChatShareDeckUI.cs deleted file mode 100644 index 7266d863..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatShareDeckUI.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ChatShareDeckUI : MonoBehaviour, IChatActionUI -{ - [SerializeField] - private UIButton _btnDeckLogList; - - private IChatApiSettings _chatApiSettings; - - private ChatConnectController _chatConnectCtr; - - private ChatLogUI _chatLogUI; - - private DialogBase _dialogDeckList; - - private Dictionary> _deckLogDataListFormatDict = new Dictionary>(); - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectCtr, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatApiSettings = chatSettings.ApiSettings; - _chatConnectCtr = chatConnectCtr; - _chatLogUI = chatLogUI; - _btnDeckLogList.onClick.Clear(); - _btnDeckLogList.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ShowDeckLogList(); - })); - } - - private void ShowDeckLogList() - { - ChatDeckLogTask task = new ChatDeckLogTask(_chatApiSettings.ApiChatDeckLog); - _chatConnectCtr.StartConnectCommon(task, delegate - { - Format defaultFormat = Format.Rotation; - if (task.DeckLogListRotation.Count <= 0) - { - if (task.DeckLogListUnlimited.Count > 0) - { - defaultFormat = Format.Unlimited; - } - else if (Prerelease.Status != Prerelease.eStatus.NONE && task.DeckLogListPreRotation.Count > 0) - { - defaultFormat = Format.PreRotation; - } - else if (Data.Crossover.IsWithinAnyPeriod && task.DeckLogListCrossover.Count > 0) - { - defaultFormat = Format.Crossover; - } - else if (Data.MyRotationAllInfo.IsMyRotationEnable && task.DeckLogListMyRotation != null && task.DeckLogListMyRotation.Count > 0) - { - defaultFormat = Format.MyRotation; - } - } - UpdateDeckLogListAndCreateDialog(task.DeckLogListRotation, task.DeckLogListUnlimited, task.DeckLogListPreRotation, task.DeckLogListCrossover, task.DeckLogListMyRotation, defaultFormat); - }); - } - - private void CreateDialogDeckList(Format format) - { - DeckData deckData = null; - List list = new List(); - foreach (KeyValuePair> item in _deckLogDataListFormatDict) - { - if (item.Value.Count <= 0) - { - continue; - } - List list2 = ChatMessageInfo.DeckLogData.ConvertDeckDataList(item.Value); - if (deckData == null) - { - deckData = list2.FirstOrDefault((DeckData deck) => deck.IsUsable()); - } - int num = list2.Count % 9; - if (num > 0) - { - int num2 = 9 - num; - for (int num3 = 0; num3 < num2; num3++) - { - list2.Add(new DeckData(item.Key)); - } - } - list.Add(new DeckGroup(list2, item.Key, DeckAttributeType.CustomDeck)); - } - DeckGroupListData deckGroupListData = new DeckGroupListData(list); - deckGroupListData.ForceVisiblePreRotation(Prerelease.Status != Prerelease.eStatus.NONE); - DeckSelectUIDialog.eFormatChangeUIType formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.NormalFormatOnly; - if (Prerelease.Status != Prerelease.eStatus.NONE) - { - formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.WithPrerotation; - } - else if (DeckListUtility.DeckGroupDataBaseClone().Any((DeckGroup deckgroup) => deckgroup.DeckFormat == Format.Crossover)) - { - formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.WithCrossover; - } - else if (Data.MyRotationAllInfo.IsMyRotationEnable) - { - formatChangeUIType = DeckSelectUIDialog.eFormatChangeUIType.WithMyRotation; - } - DeckSelectUI.InitOptions initOptions = new DeckSelectUI.InitOptions - { - PrimaryFirstDisplayDeck = deckData - }; - if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Jpn.ToString()) - { - initOptions.LongTextTitlePosition = 34; - } - DeckSelectUIDialog deckSelectUIDialog = DeckSelectUIDialog.Create(Data.SystemText.Get("Guild_Chat_0013"), deckGroupListData, format, formatChangeUIType, isVisibleCreateNew: false, delegate(DialogBase dialogDeckList, DeckData deck) - { - ShowDeckViewFromDeckLog(deck); - }, initOptions); - _dialogDeckList = deckSelectUIDialog.Dialog; - } - - private void ShowDeckViewFromDeckLog(DeckData deck) - { - ChatMessageInfo.DeckLogData deckLogDataByDeckId = ChatMessageInfo.DeckLogData.GetDeckLogDataByDeckId(_deckLogDataListFormatDict[deck.Format], deck.GetDeckID()); - _chatLogUI.ShowDeckViewByDeckLog(deckLogDataByDeckId, delegate - { - if (_dialogDeckList != null) - { - _dialogDeckList.SetDisp(inDisp: false); - _dialogDeckList.SetActive(inActive: false); - } - }, delegate - { - if (_dialogDeckList != null) - { - _dialogDeckList.SetActive(inActive: true); - _dialogDeckList.SetDisp(inDisp: true); - } - }, delegate(Format format, Dictionary> dictDeckLogList) - { - if (_dialogDeckList != null) - { - _dialogDeckList.SetActive(inActive: true); - _dialogDeckList.Close(); - _deckLogDataListFormatDict = dictDeckLogList; - CreateDialogDeckList(format); - } - }); - } - - private void UpdateDeckLogListAndCreateDialog(List deckLogListRotation, List deckLogListUnlimited, List deckLogListPreRotation, List deckLogListCrossover, List deckLogListMyRotation, Format defaultFormat) - { - _deckLogDataListFormatDict[Format.Rotation] = deckLogListRotation; - _deckLogDataListFormatDict[Format.Unlimited] = deckLogListUnlimited; - _deckLogDataListFormatDict[Format.PreRotation] = deckLogListPreRotation; - if (deckLogListCrossover != null) - { - _deckLogDataListFormatDict[Format.Crossover] = deckLogListCrossover; - } - if (deckLogListMyRotation != null) - { - _deckLogDataListFormatDict[Format.MyRotation] = deckLogListMyRotation; - } - CreateDialogDeckList(defaultFormat); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ChatUserInfo.cs b/SVSim.BattleEngine/Engine/Wizard/ChatUserInfo.cs deleted file mode 100644 index 2c625aae..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ChatUserInfo.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.Generic; -using Cute; -using LitJson; - -namespace Wizard; - -public class ChatUserInfo -{ - public int ViewerId { get; private set; } - - public string Name { get; private set; } - - public long EmblemId { get; private set; } - - public long DegreeId { get; private set; } - - public ChatUserInfo(JsonData json) - { - initialize(); - ParseJsonData(json); - } - - public bool IsMyself() - { - return ViewerId == PlayerStaticData.UserViewerID; - } - - public List GetResourcePathList() - { - List list = new List(); - list.Add(Toolbox.ResourcesManager.GetAssetTypePath(EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M)); - list.AddRange(DegreeHelper.GetDegreeResourceList(DegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - return list; - } - - private void initialize() - { - ViewerId = 0; - Name = null; - EmblemId = 0L; - DegreeId = 0L; - } - - private void ParseJsonData(JsonData json) - { - ViewerId = json["viewer_id"].ToInt(); - Name = json["name"].ToString(); - EmblemId = json["emblem_id"].ToLong(); - DegreeId = json["degree_id"].ToLong(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CheckSpecialTitleTask.cs b/SVSim.BattleEngine/Engine/Wizard/CheckSpecialTitleTask.cs index 73b0f333..786c9fe0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CheckSpecialTitleTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CheckSpecialTitleTask.cs @@ -17,7 +17,7 @@ public class CheckSpecialTitleTask : BaseTask return num; } JsonData jsonData = base.ResponseData["data"]; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr string text = "0"; dataMgr.TitleId = "0"; if (jsonData.Keys.Contains("title_image_id")) diff --git a/SVSim.BattleEngine/Engine/Wizard/ChoiceTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/ChoiceTagCollection.cs index c1c782a1..2803e8ec 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ChoiceTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ChoiceTagCollection.cs @@ -20,18 +20,6 @@ public class ChoiceTagCollection : TagCollection protected override AIPlayTagType[] MANAGED_TAG_TYPES => _managedTagTypes; - public bool HasWhenPlayChoice - { - get - { - if (_whenPlayChoiceList != null) - { - return _whenPlayChoiceList.Count > 0; - } - return false; - } - } - public ChoiceTagCollection() : base(TagCollectionType.Choice) { @@ -101,20 +89,6 @@ public class ChoiceTagCollection : TagCollection return new AIVirtualTargetSelectInfo(num, list2, TargetSelectType.Choice, isForbiddenSelectedTarget: false, rule); } - public List GetAllChoiceIdsWithoutConditionCheck() - { - if (!base.HasTag) - { - return null; - } - List list = null; - for (int i = 0; i < base.TagList.Count; i++) - { - list = AIParamQuery.AddRangeToList((base.TagList[i].ArgumentExpressions as AIChoiceTagArgument).GetChoiceIdList(), list); - } - return list; - } - public override void AddTag(AIPlayTag tag) { base.AddTag(tag); diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassCharacterMasterData.cs b/SVSim.BattleEngine/Engine/Wizard/ClassCharacterMasterData.cs index 152c8cc3..0c2ae790 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ClassCharacterMasterData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ClassCharacterMasterData.cs @@ -1,36 +1,17 @@ using System; using UnityEngine; +// TODO(engine-cleanup-pass2): 39 of 45 methods unrun in baseline +// Type: Wizard.ClassCharacterMasterData +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; public class ClassCharacterMasterData { - public const int ARISA_CHARA_ID = 1; - - public const int ERIKA_CHARA_ID = 2; - - public const int ISABELLE_CHARA_ID = 3; - - public const int ROWEN_CHARA_ID = 4; - - public const int LUNA_CHARA_ID = 5; - - public const int URIAS_CHARA_ID = 6; - - public const int ERIS_CHARA_ID = 7; - - public const int YUWAN_CHARA_ID = 8; - - public const int UTSUROI_ERIKA_CHARA_ID = 500002; - - public const int LOSARIA_CHARA_ID = 500008; - - public const int UTSUROI_1_CHARA_ID = 500010; private int index; - private const int NEED_COLUMN_LENGTH = 20; - public int chara_id { get; private set; } public string chara_name { get; private set; } @@ -90,7 +71,7 @@ public class ClassCharacterMasterData path = columns[index++]; clan = CardBasePrm.ToStrClanType(columns[index++]); class_id = (int)clan; - _className = GameMgr.GetIns().GetDataMgr().GetClanNameByKey(class_id); + _className = class_id.ToString(); // Pre-Phase-5b: no clan-name lookup index++; is_usable = Convert.ToBoolean(int.Parse(columns[index++])); skin_id = int.Parse(columns[index++]); diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassIconName.cs b/SVSim.BattleEngine/Engine/Wizard/ClassIconName.cs deleted file mode 100644 index 49d0472b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ClassIconName.cs +++ /dev/null @@ -1,20 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class ClassIconName : MonoBehaviour -{ - [SerializeField] - private UILabel _labelClassName; - - [SerializeField] - private UISprite _spriteClassIcon; - - public void SetClass(int classId) - { - ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(classId); - _labelClassName.text = charaPrmByClassId._className; - ClassCharaPrm.SetClassLabelSetting(_labelClassName, charaPrmByClassId.clan); - _spriteClassIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassInfoParts.cs b/SVSim.BattleEngine/Engine/Wizard/ClassInfoParts.cs index fab867e9..c60fa7b5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ClassInfoParts.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ClassInfoParts.cs @@ -61,7 +61,7 @@ public class ClassInfoParts : MonoBehaviour _labelClassName.gameObject.SetActive(value: true); if (chaosId != -1) { - switch (GameMgr.GetIns().GetDataMgr().m_BattleType) + switch (DataMgr.BattleType.FreeBattle) // Pre-Phase-5b: headless has no BattleType; FreeBattle default falls through { case DataMgr.BattleType.TwoPick: _labelClassName.text = ChaosUtil.GetDeckName(chaosId, Data.ArenaData.TwoPickData.ChallengeData.ChaosNum); @@ -98,8 +98,7 @@ public class ClassInfoParts : MonoBehaviour } if (_randomIcon != null) { - _randomIcon.SetActive(GameMgr.GetIns().GetDataMgr().GetClassPrm(charaPrm.class_id) - .IsRandomLeaderSkin); + _randomIcon.SetActive(false /* Pre-Phase-5b: headless has no class prm */); } SetSubClassVisible(visible: false); SetMyRotationVisible(visible: false); @@ -107,12 +106,14 @@ public class ClassInfoParts : MonoBehaviour public void InitByCharaId(int charaId) { - InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(charaId)); + // Pre-Phase-5b: no chara master headless + InitByCharaPrm(null); } public void InitBySkinId(int skinId) { - InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId(skinId)); + // Pre-Phase-5b: no chara master headless + InitByCharaPrm(null); } public void InitClassByDeckData(DeckData deck) @@ -124,7 +125,7 @@ public class ClassInfoParts : MonoBehaviour { _labelClassName.text = deck.GetMyRotationClassName(); } - SetMyRotationInfo(Data.MyRotationAllInfo.Get(deck.MyRotationId), GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(deck.GetSkinId())); + SetMyRotationInfo(Data.MyRotationAllInfo.Get(deck.MyRotationId), null /* Pre-Phase-5b: no chara master */); } else { @@ -145,7 +146,7 @@ public class ClassInfoParts : MonoBehaviour SetSubClassVisible(visible: true); if (_subClassNameLabel != null) { - _subClassNameLabel.text = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)subClass); + _subClassNameLabel.text = ((int)subClass).ToString(); // Pre-Phase-5b: no clan-name lookup ClassCharaPrm.SetClassLabelSetting(_subClassNameLabel, subClass); } if (_subClassIconSprite != null) diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassInfomationOrder.cs b/SVSim.BattleEngine/Engine/Wizard/ClassInfomationOrder.cs deleted file mode 100644 index 21393bb1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ClassInfomationOrder.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard; - -public class ClassInfomationOrder : Master.ReadFromCsv -{ - public int ChaosId; - - public List ClassIds; - - public void ReadCsvColumns(string[] columns) - { - int.TryParse(columns[0], out ChaosId); - ClassIds = columns[1].Split('|').Select(int.Parse).ToList(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassSelectionButton.cs b/SVSim.BattleEngine/Engine/Wizard/ClassSelectionButton.cs index c1bd3a1c..3cdb2719 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ClassSelectionButton.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ClassSelectionButton.cs @@ -7,8 +7,6 @@ public class ClassSelectionButton : MonoBehaviour { public delegate void OnClickClassButton(ClassSelectionButton classSelectionButton); - public const string CLASS_SELECT_BUTTON_EMPTY = "empty"; - [SerializeField] private UITexture _texture; @@ -26,11 +24,6 @@ public class ClassSelectionButton : MonoBehaviour public ClassCharacterMasterData ClassCharacterMasterData { get; private set; } - private void Start() - { - _notificationIcon.SetActive(value: false); - } - public void Init(ClassCharacterMasterData classCharacterMasterData, Texture texture, OnClickClassButton onClick, bool isShowStoryClearLabel, bool isShowUsedLabel, bool showNotificationIcon) { ClassCharacterMasterData = classCharacterMasterData; diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPage.cs b/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPage.cs index 37092929..2437870f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPage.cs @@ -236,12 +236,7 @@ public class ClassSelectionPage : UIBase } else { - int num = 9; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - for (int num2 = 1; num2 < num; num2++) - { - _classCharacterMasterDatas.Add(dataMgr.GetCharaPrmByClassId(num2, Mode == eMode.DeckEdit)); - } + // Pre-Phase-5b: chara master unavailable headless; leave the master list empty. } ResourcesManager resourcesManager = Toolbox.ResourcesManager; foreach (ClassCharacterMasterData classCharacterMasterData in _classCharacterMasterDatas) @@ -278,7 +273,7 @@ public class ClassSelectionPage : UIBase private ClassCharacterMasterData GetCharaPrmByCharaId(int charaId) { - return GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(charaId); + return null; // Pre-Phase-5b: headless has no chara master } private void CreateClassButton() @@ -354,7 +349,7 @@ public class ClassSelectionPage : UIBase private void OnClickClassButton(ClassSelectionButton classButton) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + if (_useSubClass) { SelectClassForUseSubClass(classButton); @@ -469,11 +464,11 @@ public class ClassSelectionPage : UIBase { case eMode.StorySelect: SelectedStoryInfo.SetSectionChara(_selectCharaMasterData); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); + UIManager.GetInstance().ChangeViewScene(SelectedStoryInfo.ChapterSelectionView); break; case eMode.PracticeSelect: - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ShowSelectDifficultyDialog(); break; case eMode.DeckEdit: @@ -486,7 +481,7 @@ public class ClassSelectionPage : UIBase { if (SceneParam.Format == Format.MyRotation) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + MyRotationPeriodSelectDialog.Create(null, (CardBasePrm.ClanType)_selectCharaMasterData.class_id, delegate(MyRotationInfo myRotationData) { OnDecideClassDeckEditMode(myRotationData); @@ -494,7 +489,7 @@ public class ClassSelectionPage : UIBase } else { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); + OnDecideClassDeckEditMode(null); } } @@ -561,33 +556,12 @@ public class ClassSelectionPage : UIBase dia.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn); dia.onPushButton1 = delegate { - UIManager.GetInstance().createInSceneCenterLoading(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.Load(); - dataMgr.SetEnemyCharaId(enemyClassId); - PracticeData practiceData = practiceDataList[selectIndex]; - PracticeAISettingData settingData = Data.Master.PracticeAISettingList.GetSettingData(enemyClassId, practiceData.AIDeckLevel); - Data.Master.LoadAICsv(new AICsvLoadingInfo(settingData.DeckId, settingData.StyleId, settingData.EmoteId), delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - dataMgr.SetCurrentEnemyDeckDataFromAIDeck(enemyClassId, settingData.Difficulty, settingData.LogicLevel, settingData.MaxLife, settingData.DeckId, settingData.StyleId, settingData.EmoteId, useInnerEmote: true); - dataMgr.LoadEnemyClassData(); - dataMgr.PracticeDifficultyDegreeId = practiceData.DegreeId; - dataMgr.SetSoroPlay3DFieldID(practiceData.Battle3dFieldId); - GameMgr.GetIns().GetDataMgr().Practice3DfieldId = practiceData.Battle3dFieldId; - dia.CloseWithoutSelect(); - PracticeStartTask task = new PracticeStartTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - IsShow_CardIntroduction = true - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle, param); - })); - }); + // Pre-Phase-5b: kicked off practice-battle setup via DataMgr writes + PracticeStartTask. + // Headless never runs practice UI; stub to close the dialog and change scene directly. + dia.CloseWithoutSelect(); + UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle); }; - dia.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + dia.ClickSe_Btn1 = 0; } private void OnFinishFadeIn() diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPageParam.cs b/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPageParam.cs index aa5c756d..0ebf9837 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPageParam.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ClassSelectionPageParam.cs @@ -17,16 +17,6 @@ public class ClassSelectionPageParam return new ClassSelectionPageParam(ClassSelectionPage.eMode.StorySelect, Format.Max, null, new List()); } - public static ClassSelectionPageParam CreatePracticeSelect() - { - return new ClassSelectionPageParam(ClassSelectionPage.eMode.PracticeSelect, Format.Max, null, new List()); - } - - public static ClassSelectionPageParam CreateDeckEdit(Format format, ConventionInfo conventionInfo, List usedClassIdList) - { - return new ClassSelectionPageParam(ClassSelectionPage.eMode.DeckEdit, format, conventionInfo, usedClassIdList); - } - private ClassSelectionPageParam(ClassSelectionPage.eMode mode, Format format, ConventionInfo conventionInfo, List usedClassIdList) { Mode = mode; diff --git a/SVSim.BattleEngine/Engine/Wizard/ClassSkinDetailWindow.cs b/SVSim.BattleEngine/Engine/Wizard/ClassSkinDetailWindow.cs deleted file mode 100644 index 16be6bd4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ClassSkinDetailWindow.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.SkinPurchase; - -namespace Wizard; - -public class ClassSkinDetailWindow : MonoBehaviour -{ - [SerializeField] - private SkinProductDetail _skinProductDetail; - - [SerializeField] - private UILabel _labelSingleProductName; - - [SerializeField] - private UILabel _labelMultiProductName; - - [SerializeField] - private UISprite _spriteClassColorIcon; - - [SerializeField] - private UILabel _labelCV; - - [SerializeField] - private UIButton _buttonVoice; - - public void SetMultiData(SkinSeriesPurchaseInfo seriesInfo) - { - _skinProductDetail.SetMultiProductDetail(seriesInfo); - _labelSingleProductName.gameObject.SetActive(value: false); - _labelMultiProductName.gameObject.SetActive(value: true); - _labelCV.gameObject.SetActive(value: false); - _labelMultiProductName.text = seriesInfo.saleInfo.name; - } - - public void SetSingleData(SkinProductInfo productInfo, List loadedVoiceList) - { - _skinProductDetail.SetSingleProductDetail(productInfo, productInfo.description); - _labelSingleProductName.gameObject.SetActive(value: true); - _labelMultiProductName.gameObject.SetActive(value: false); - _labelCV.gameObject.SetActive(value: true); - ClassCharacterMasterData charaPrmBySkinId = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId(productInfo.leader_skin_id); - _labelSingleProductName.text = productInfo.saleInfo.name; - ClassCharaPrm.SetClassLabelSetting(_labelSingleProductName, charaPrmBySkinId.ClassColorId); - _spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmBySkinId.clan); - _labelCV.text = productInfo.cv_name; - _buttonVoice.onClick.Clear(); - _buttonVoice.onClick.Add(new EventDelegate(delegate - { - if (Data.Master._emotionDic.ContainsKey(productInfo.leader_skin_id.ToString())) - { - GameMgr.GetIns().GetSoundMgr().PlayVoice(ClassCharaPrm.EmotionType.LEADER_SELECT, productInfo.leader_skin_id, loadedVoiceList); - } - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ClientCacheClearTask.cs b/SVSim.BattleEngine/Engine/Wizard/ClientCacheClearTask.cs deleted file mode 100644 index e445575b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ClientCacheClearTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Wizard; - -public class ClientCacheClearTask : BaseTask -{ - public ClientCacheClearTask() - { - base.type = ApiType.Type.ClientCacheClear; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CloneActualFlags.cs b/SVSim.BattleEngine/Engine/Wizard/CloneActualFlags.cs index ef2a05c0..645372a4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CloneActualFlags.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CloneActualFlags.cs @@ -2,16 +2,9 @@ namespace Wizard; public class CloneActualFlags { - private static readonly CloneActualFlags INPLAY_AND_HAND = new CloneActualFlags(inPlay: true, hand: true, deck: false, cemetery: false, banish: false, necromanceZone: false, fusionMaterial: false, unite: false, geton: false); - - private static readonly CloneActualFlags INPLAY = new CloneActualFlags(inPlay: true, hand: false, deck: false, cemetery: false, banish: false, necromanceZone: false, fusionMaterial: false, unite: false, geton: false); private static readonly CloneActualFlags ALL = new CloneActualFlags(inPlay: true, hand: true, deck: true, cemetery: true, banish: true, necromanceZone: true, fusionMaterial: true, unite: true, geton: true); - public static CloneActualFlags InPlayAndHand => INPLAY_AND_HAND; - - public static CloneActualFlags InPlayCards => INPLAY; - public static CloneActualFlags All => ALL; public bool InPlay { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/ColorCode.cs b/SVSim.BattleEngine/Engine/Wizard/ColorCode.cs index b8d68706..775f96f4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ColorCode.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ColorCode.cs @@ -7,35 +7,9 @@ namespace Wizard; public static class ColorCode { - public const string MASTER_NAME = "color_code"; - - private const char INFO_DELIMITER = ':'; private static Dictionary _colorCodeDic = new Dictionary(); - public static void BuildData() - { - string[] array = (Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("color_code", ResourcesManager.AssetLoadPathType.MasterEtc, isfetch: true)) as TextAsset).text.Trim().Replace("\r", "").Split('\n'); - for (int i = 0; i < array.Length; i++) - { - string[] array2 = array[i].Split(':'); - if (Enum.TryParse(array2[0], out var result)) - { - ColorUtility.TryParseHtmlString(array2[1], out var color); - _colorCodeDic[result] = color; - } - } - } - - public static Color GetWithString(string id) - { - if (Enum.TryParse(id, out var result)) - { - return Get(result); - } - return Color.red; - } - public static Color Get(eColorCodeId id) { if (_colorCodeDic.TryGetValue(id, out var value)) diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryAvatarTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryAvatarTask.cs deleted file mode 100644 index f5e06305..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryAvatarTask.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ColosseumDeckEntryAvatarTask : BaseTask -{ - public class ColosseumDeckEntryHOFTaskParam : BaseParam - { - public string deck_no_list; - } - - public ColosseumDeckEntryAvatarTask() - { - base.type = ApiType.Type.ColosseumAvatarDeckEntry; - } - - public void SetParameter(List deckList) - { - ColosseumDeckEntryHOFTaskParam colosseumDeckEntryHOFTaskParam = new ColosseumDeckEntryHOFTaskParam(); - List list = new List(); - for (int i = 0; i < deckList.Count; i++) - { - list.Add(deckList[i].GetDeckID()); - } - colosseumDeckEntryHOFTaskParam.deck_no_list = JsonMapper.ToJson(list); - base.Params = colosseumDeckEntryHOFTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryHOFTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryHOFTask.cs deleted file mode 100644 index 0d1340ae..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryHOFTask.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ColosseumDeckEntryHOFTask : BaseTask -{ - public class ColosseumDeckEntryHOFTaskParam : BaseParam - { - public string deck_no_list; - } - - public ColosseumDeckEntryHOFTask() - { - base.type = ApiType.Type.ColosseumHOFDeckEntry; - } - - public void SetParameter(List deckList) - { - ColosseumDeckEntryHOFTaskParam colosseumDeckEntryHOFTaskParam = new ColosseumDeckEntryHOFTaskParam(); - List list = new List(); - for (int i = 0; i < deckList.Count; i++) - { - list.Add(deckList[i].GetDeckID()); - } - colosseumDeckEntryHOFTaskParam.deck_no_list = JsonMapper.ToJson(list); - base.Params = colosseumDeckEntryHOFTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryTask.cs deleted file mode 100644 index 38e97503..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumDeckEntryTask.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ColosseumDeckEntryTask : BaseTask -{ - public class ColosseumDeckEntryTaskParam : BaseParam - { - public string deck_no_list; - - public bool is_published; - } - - public ColosseumDeckEntryTask() - { - base.type = ApiType.Type.ColosseumDeckEntry; - } - - public void SetParameter(List deckList, bool isPublished) - { - ColosseumDeckEntryTaskParam colosseumDeckEntryTaskParam = new ColosseumDeckEntryTaskParam(); - List list = new List(); - for (int i = 0; i < deckList.Count; i++) - { - list.Add(deckList[i].GetDeckID()); - } - colosseumDeckEntryTaskParam.deck_no_list = JsonMapper.ToJson(list); - colosseumDeckEntryTaskParam.is_published = isPublished; - base.Params = colosseumDeckEntryTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumDetailTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumDetailTask.cs deleted file mode 100644 index 44248cfe..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumDetailTask.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using LitJson; - -namespace Wizard; - -public class ColosseumDetailTask : BaseTask -{ - public const int COLOSSEUM_ANNOUNCE_ID_NOT_SET_ERROR_CODE = 4416; - - public ColosseumDetailTask() - { - base.type = ApiType.Type.ColosseumDetail; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - JsonData colosseumOwnStatus = jsonData["colosseum_status"]; - JsonData jsonData2 = jsonData["colosseum_info"]; - ArenaColosseum colosseumData = Data.ArenaData.ColosseumData; - colosseumData.ApiRuleParseAndSet(jsonData2["format"].ToInt()); - string text = ConvertTime.ToLocal(DateTime.Parse(jsonData2["start_time"].ToString())); - string text2 = ConvertTime.ToLocal(DateTime.Parse(jsonData2["end_time"].ToString())); - colosseumData.ColosseumTimeText = Data.SystemText.Get("Colosseum_0033", text, text2); - colosseumData.AnnounceNo = ((jsonData2["announce_id"] != null) ? jsonData2["announce_id"].ToString() : ""); - colosseumData.FinalRoundEliminateCount = jsonData2["final_round_eliminate_count"].ToInt(); - int num2 = 0; - colosseumData.FocusStageNo = ArenaColosseum.eStageNo.Max; - for (int i = 1; i <= 3; i++) - { - JsonData jsonData3 = jsonData[i.ToString()]; - text = ConvertTime.ToLocal(DateTime.Parse(jsonData3["start_time"].ToString()), ConvertTime.FORMAT.TIME_DATE_SHORT); - text2 = ConvertTime.ToLocal(DateTime.Parse(jsonData3["end_time"].ToString()), ConvertTime.FORMAT.TIME_DATE_SHORT); - if (jsonData3["is_now_round"].ToBoolean()) - { - colosseumData.FocusStageNo = (ArenaColosseum.eStageNo)i; - } - JsonData jsonData4 = jsonData3["round_detail"]; - for (int j = 0; j < jsonData4.Count; j++) - { - colosseumData.DetailData[num2].RoundTimeText = Data.SystemText.Get("Colosseum_0033", text, text2); - colosseumData.DetailData[num2].RoundTimeStartText = Data.SystemText.Get("Colosseum_0106", text); - colosseumData.DetailData[num2].RoundTimeEndText = Data.SystemText.Get("Colosseum_0107", text2); - colosseumData.DetailData[num2].GroupName = jsonData4[j]["group"].ToString(); - colosseumData.DetailData[num2].MaxBattleNum = jsonData4[j]["max_battle_count"].ToInt(); - colosseumData.DetailData[num2].BreakThroughNum = jsonData4[j]["breakthrough_number"].ToInt(); - colosseumData.DetailData[num2].MaxEntryNum = jsonData4[j]["entry_number"].ToInt(); - if (colosseumData.DetailData[num2].GroupName == "") - { - colosseumData.DetailData[num2].GroupName = Data.SystemText.Get("Colosseum_0079"); - } - num2++; - } - } - ColosseumEntryInfoTask.SetColosseumOwnStatus(colosseumOwnStatus); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumDoMatchingTask.cs deleted file mode 100644 index 5e5f9948..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumDoMatchingTask.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Wizard; - -public class ColosseumDoMatchingTask : DoMatchingBase -{ - public ColosseumDoMatchingTask() - { - if (!Data.ArenaData.ColosseumData.IsRankMatching) - { - base.type = ApiType.Type.ColosseumDoMatching; - } - else - { - base.type = ApiType.Type.ColosseumDoMatchingRankMatch; - } - } - - public override void SetParameter(int deck_no, int need_init, int log, bool includeCardMasterHash = false) - { - includeCardMasterHash = includeCardMasterHash || need_init == 1; - if (Data.ArenaData.ColosseumData.IsRankMatching) - { - need_init = 0; - } - base.SetParameter(deck_no, need_init, log, includeCardMasterHash); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - SettingDoMatchingData(); - if (Data.DoMatchingDetail.data.matchingState == 3008) - { - Data.ArenaData.ColosseumData.IsRankMatching = true; - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumEntryTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumEntryTask.cs deleted file mode 100644 index 670485bb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumEntryTask.cs +++ /dev/null @@ -1,39 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class ColosseumEntryTask : BaseTask -{ - public class ColosseumEntryTaskParam : BaseParam - { - public int now_round_id; - - public int consume_item_type; - } - - public ColosseumEntryTask() - { - base.type = ApiType.Type.ColosseumEntry; - } - - public void SetParameter(ArenaData.eARENA_PAY inPayType) - { - ColosseumEntryTaskParam colosseumEntryTaskParam = new ColosseumEntryTaskParam(); - colosseumEntryTaskParam.consume_item_type = (int)inPayType; - colosseumEntryTaskParam.now_round_id = Data.ArenaData.ColosseumData.ServerRoundId; - base.Params = colosseumEntryTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - JsonData jsonData = base.ResponseData["data"]; - Data.ArenaData.ColosseumData.ApiRuleParseAndSet(jsonData["entry_info"]["deck_format"].ToInt()); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumHOFDeckInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumHOFDeckInfoTask.cs deleted file mode 100644 index d7d13a06..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumHOFDeckInfoTask.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ColosseumHOFDeckInfoTask : BaseTask -{ - public List DeckList { get; private set; } - - public ColosseumHOFDeckInfoTask() - { - base.type = ApiType.Type.ColosseumHOFDeckInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - DeckList = new List(); - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - JsonData deckData = jsonData[i]; - DeckData deckData2 = new DeckData(Format.Max, DeckAttributeType.CustomDeck); - deckData2.Initialize(deckData); - DeckList.Add(deckData2); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumWindFallDeckEntry.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumWindFallDeckEntry.cs deleted file mode 100644 index 1aa69a1c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumWindFallDeckEntry.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ColosseumWindFallDeckEntry : BaseTask -{ - public class ColosseumWindFallDeckEntryTaskParam : BaseParam - { - public string deck_no_list; - } - - public ColosseumWindFallDeckEntry() - { - base.type = ApiType.Type.ColosseumWindFallDeckEntry; - } - - public void SetParameter(List deckList) - { - ColosseumWindFallDeckEntryTaskParam colosseumWindFallDeckEntryTaskParam = new ColosseumWindFallDeckEntryTaskParam(); - List list = new List(); - for (int i = 0; i < deckList.Count; i++) - { - list.Add(deckList[i].GetDeckID()); - } - colosseumWindFallDeckEntryTaskParam.deck_no_list = JsonMapper.ToJson(list); - base.Params = colosseumWindFallDeckEntryTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ColosseumWindFallDeckInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/ColosseumWindFallDeckInfoTask.cs deleted file mode 100644 index 01fb143a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ColosseumWindFallDeckInfoTask.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ColosseumWindFallDeckInfoTask : BaseTask -{ - public List DeckList { get; private set; } - - public ColosseumWindFallDeckInfoTask() - { - base.type = ApiType.Type.ColosseumWindFallDeckInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - DeckList = new List(); - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - JsonData deckData = jsonData[i]; - DeckData deckData2 = new DeckData(Format.Max, DeckAttributeType.CustomDeck); - deckData2.Initialize(deckData); - DeckList.Add(deckData2); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionBattleDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionBattleDoMatchingTask.cs deleted file mode 100644 index f2940edf..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionBattleDoMatchingTask.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Wizard; - -public class CompetitionBattleDoMatchingTask : DoMatchingBase -{ - public CompetitionBattleDoMatchingTask(int deckNo, int needInit, int log) - { - base.type = (Data.ArenaData.CompetitionData.IsRankMatching ? ApiType.Type.CompetitionBattleDoMatchingRankMatch : ApiType.Type.CompetitionBattleDoMatching); - base.SetParameter(deckNo, needInit, log); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - SettingDoMatchingData(); - if (Data.DoMatchingDetail.data.matchingState == 3012) - { - Data.ArenaData.CompetitionData.IsRankMatching = true; - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionCardPanel.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionCardPanel.cs deleted file mode 100644 index af45aa97..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionCardPanel.cs +++ /dev/null @@ -1,174 +0,0 @@ -using System.Collections; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class CompetitionCardPanel : MyPageCardPanel -{ - [SerializeField] - private UILabel _infoNextTimeLabel; - - [SerializeField] - private UILabel _infoTitleLabel; - - [SerializeField] - private UILabel _infoTimeLabel; - - [SerializeField] - private CompetitionEntry _competitionEntry; - - [SerializeField] - private GameObject _competitionEntryRoot; - - [SerializeField] - private GameObject _competitionBadge; - - [SerializeField] - private UISprite _panelLineSprite; - - [SerializeField] - private string _competitionCardPanelPath; - - [SerializeField] - private string _competition2PickCardPanelPath; - - private const int SECONDS_PER_MINUTE = 60; - - private static readonly Color PanelLineColor = new Color(64f / 85f, 2f / 15f, 2f / 15f); - - private bool _firstInitialize; - - private string _cardPanelPath; - - public bool IsEntry { get; set; } - - public bool IsEntryTimeEnd { get; set; } - - private void OnEnable() - { - PanelImageUpdate(); - } - - public override string GetResourcePath(bool isfetch) - { - _cardPanelPath = ((Data.ArenaData.CompetitionData.DeckFormat == Format.TwoPick) ? _competition2PickCardPanelPath : _competitionCardPanelPath); - return Toolbox.ResourcesManager.GetAssetTypePath(_cardPanelPath, ResourcesManager.AssetLoadPathType.CardMenu, isfetch); - } - - public void Update() - { - SetPanelLineColor(); - if (Data.ArenaData.CompetitionData != null) - { - if (_competitionEntryRoot.gameObject.activeSelf) - { - _competitionBadge.SetActive(value: false); - } - else - { - _competitionBadge.SetActive(Data.MyPageNotifications.data.IsCompetitionBadge); - } - } - } - - public void PanelImageUpdate(bool callEntryMenuUpdate = true) - { - ArenaCompetition competitionData = Data.ArenaData.CompetitionData; - SystemText systemText = Data.SystemText; - if (!_firstInitialize) - { - _firstInitialize = true; - IsEntryTimeEnd = competitionData.IsEntryTimeEnd; - } - base.TitleLabel.text = competitionData.CompetitionName; - string text = null; - double num = 0.0; - double num2 = competitionData.RemainingServerUnixTime + (double)Time.realtimeSinceStartup - (double)competitionData.RemainingSinceTime; - bool flag = Data.ArenaData.CompetitionData.RestEntryCount == 0 && Data.ArenaData.CompetitionData.IsRewardReceived; - bool flag2 = !IsEntry && !IsEntryTimeEnd && !flag; - if (flag2) - { - if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithFree) - { - _infoTitleLabel.text = systemText.Get("Competition_0064"); - } - else - { - _infoTitleLabel.text = systemText.Get("Competition_0009"); - } - num = competitionData.EntryRemainingUnixTime - num2; - _infoNextTimeLabel.text = systemText.Get("Competition_0070"); - } - else - { - if (IsEntry && Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithFree) - { - if (competitionData.FreebieStatus == ArenaCompetition.FreebieStatusType.InFreeBattle) - { - _infoTitleLabel.text = systemText.Get("Competition_0071"); - _infoNextTimeLabel.text = systemText.Get("Competition_0070"); - } - else if (competitionData.FreebieStatus == ArenaCompetition.FreebieStatusType.CanPermanentEntry) - { - _infoTitleLabel.text = systemText.Get("Competition_0009"); - _infoNextTimeLabel.text = systemText.Get("Competition_0048"); - } - else - { - _infoTitleLabel.text = systemText.Get("Competition_0010"); - _infoNextTimeLabel.text = systemText.Get("Competition_0049"); - } - } - else - { - _infoTitleLabel.text = systemText.Get("Competition_0010"); - _infoNextTimeLabel.text = systemText.Get("Competition_0049"); - } - num = competitionData.RemainingUnixTime - num2; - } - if (!(num <= 0.0)) - { - text = ((num < 3600.0) ? systemText.Get("Colosseum_0058", ((int)(num / 60.0) + 1).ToString()) : ((!(num < 86400.0)) ? systemText.Get("Colosseum_0044", ((int)(num / 86400.0)).ToString()) : systemText.Get("Colosseum_0057", ((int)(num / 3600.0)).ToString()))); - } - else - { - text = systemText.Get("Colosseum_0058", "0"); - if (flag2) - { - IsEntryTimeEnd = true; - PanelImageUpdate(); - return; - } - } - float seconds = (float)(60.0 - num2 % 60.0); - StartCoroutine(PanelImageUpdateTimer(seconds)); - _infoTimeLabel.text = text; - if (callEntryMenuUpdate) - { - _competitionEntry.EntryMenuUpdate(IsEntryTimeEnd); - } - } - - private IEnumerator PanelImageUpdateTimer(float seconds) - { - yield return new WaitForSeconds(seconds); - PanelImageUpdate(); - } - - private void OnApplicationPause(bool pause) - { - if (!pause) - { - PanelImageUpdate(); - } - } - - private void SetPanelLineColor() - { - if (_panelLineSprite.color == Color.white) - { - _panelLineSprite.color = PanelLineColor; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionDetail.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionDetail.cs deleted file mode 100644 index 5b97c5c1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionDetail.cs +++ /dev/null @@ -1,87 +0,0 @@ -using UnityEngine; -using Wizard.ErrorDialog; -using Wizard.Scripts.Network.Data.TaskData.Arena; - -namespace Wizard; - -public class CompetitionDetail : MonoBehaviour -{ - [SerializeField] - private GameObject _prefabRewardDialog; - - [SerializeField] - private CardDetailUI _cardDetailDialog; - - [SerializeField] - private GameObject _rewardRoot; - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UILabel _entryPeriodTimeLabel; - - [SerializeField] - private UILabel _openPeriodTimeLabel; - - [SerializeField] - private UILabel _maxNumLabel; - - [SerializeField] - private UILabel _conditionLable; - - [SerializeField] - private UILabel _entryNum; - - [SerializeField] - private UILabel _tryNum; - - private const int COMPETITION_ANNOUNCE_ID_NOT_SET_ERROR_CODE = 5516; - - public void Init(DialogBase inDialog, ArenaCompetition data, bool isEntry) - { - SystemText systemText = Data.SystemText; - inDialog.SetSize(DialogBase.Size.M); - inDialog.SetTitleLabel(systemText.Get("Common_0022")); - inDialog.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn_GrayBtn); - inDialog.SetButtonText(systemText.Get("Colosseum_0023"), systemText.Get("Colosseum_0025")); - string text = ""; - text = data.DeckFormat switch - { - Format.TwoPick => systemText.Get("Arena_0002"), - Format.Rotation => systemText.Get("Common_0154"), - _ => systemText.Get("Common_0155"), - }; - _formatLabel.text = systemText.Get("Colosseum_0054", text) + systemText.Get("Colosseum_0093"); - _openPeriodTimeLabel.text = systemText.Get("Competition_0029") + " : " + data.NowRoundTimeText; - _entryPeriodTimeLabel.text = systemText.Get("Competition_0028") + " : " + data.EntryTimeText; - _maxNumLabel.text = systemText.Get("Competition_0023", data.MaxBattleCount.ToString()); - _conditionLable.text = systemText.Get("Colosseum_0104", data.MaxLoseCount.ToString()); - _entryNum.text = systemText.Get("Colosseum_0088", data.MaxEntryCount.ToString()); - _tryNum.text = systemText.Get("Competition_0042", data.MaxChallengeCount.ToString()); - inDialog.onPushButton1 = delegate - { - if (!string.IsNullOrEmpty(data.AnnounceId)) - { - UIManager.GetInstance().WebViewHelper.OpenAnnounceWebView(data.AnnounceId); - } - else - { - Wizard.ErrorDialog.Dialog.Create(5516); - } - }; - inDialog.onPushButton2 = delegate - { - UIManager.GetInstance().StartFirstTips(CompetitionUtility.GetCompetitionTipsType(Data.ArenaData.CompetitionData.Rule)); - }; - RewardBase component = NGUITools.AddChild(_rewardRoot, _prefabRewardDialog).GetComponent(); - component.SetCardDetailUI(_cardDetailDialog); - foreach (Wizard.Scripts.Network.Data.TaskData.Arena.Reward entryReward in data.EntryRewardList) - { - component.AddReward(entryReward); - } - component.SetActiveRewardLabel(isShow: false); - component.SetOnlyIconEndCreate(); - base.transform.localPosition = Vector3.forward * 10f; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionEntry.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionEntry.cs deleted file mode 100644 index 35398a9a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionEntry.cs +++ /dev/null @@ -1,484 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class CompetitionEntry : ArenaEntryBase -{ - private const int CARD_LIST_SORT_ORDER = 100; - - private const int CARD_DETAIL_SORT_ORDER = 110; - - [SerializeField] - private UIButton _buttonFreeBattle; - - [SerializeField] - private GameObject _detailPrefab; - - [SerializeField] - private UIButton _detailButton; - - [SerializeField] - private GameObject _costRoot; - - [SerializeField] - private UILabel _periodTimeTitleLabel; - - [SerializeField] - private UILabel _periodTimeLabel; - - [SerializeField] - private UILabel _ownBeforeStatusLabel; - - [SerializeField] - private UILabel _ownAfterStatusLabel; - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UILabel _retryNumberLabel; - - [SerializeField] - public GameObject CompetitionEntryCompleteDialog; - - [SerializeField] - private GameObject _beforeEntryHeadLine; - - [SerializeField] - private GameObject _afterEntryHeadLine; - - [SerializeField] - private GameObject _competitionBadge; - - [SerializeField] - private GameObject _freeEntryBadge; - - public bool _isEntryTimeEnd; - - public bool IsEnableUpdate = true; - - public Action EntryAction; - - private ArenaCompetition.EntryStatusType _entryStatus; - - private int _restChallengeCount; - - private int _restEntryCount; - - private const float GLAY_SCALE = 0.33f; - - private Color baseStatusTextColor; - - private Color grayStatusTextColor; - - private const float NO_FREE_BATTLE_STATUS_LABEL_POSITION_X = 3f; - - private const float NO_FREE_BATTLE_STATUS_LABEL_POSITION_Y = 47f; - - private const int NO_FREE_BATTLE_TEXT_FONT_SIZE = 22; - - private const int LONG_TEXT_FONT_SIZE = 21; - - private bool _isEntry => _entryStatus != ArenaCompetition.EntryStatusType.NotEntry; - - private bool IsCompetitionComplete - { - get - { - if (_restEntryCount == 0 && Data.ArenaData.CompetitionData.IsRewardReceived) - { - return _entryStatus == ArenaCompetition.EntryStatusType.NotEntry; - } - return false; - } - } - - private bool IsEnableEntry - { - get - { - if (!_isEntry && !_isEntryTimeEnd) - { - return !IsCompetitionComplete; - } - return false; - } - } - - private void Awake() - { - _isCompetition = true; - IsEnableUpdate = true; - baseStatusTextColor = _ownAfterStatusLabel.color; - grayStatusTextColor = new Color(baseStatusTextColor.r * 0.33f, baseStatusTextColor.g * 0.33f, baseStatusTextColor.b * 0.33f, 255f); - EntryBaseInit(_costRoot); - } - - protected override void EntryBaseInit(GameObject costRootObject) - { - base.EntryBaseInit(costRootObject); - _entryDialogTitleText = Data.SystemText.Get("Competition_0017"); - _resumeFunc = Resume; - _isJoinFunc = IsJoin; - _freeBattleFunc = FreeBattle; - _isFreeBattleCompetition = IsFreeBattleCompetition; - _detailButton.onClick.Clear(); - _detailButton.onClick.Add(new EventDelegate(OnClickDetailButton)); - } - - protected override void EntryDialogCreate(GameObject inDialogObject) - { - CompetitionEntryDialog component = inDialogObject.GetComponent(); - component.SetRewardInfoEntryConfirm(); - component.CompleteEntryHandler = SetMyPageCompetitionReload; - component.CompleteJoinHandler = AdmissionCompetitionNotFree; - } - - private void EntryAndAdmissionCompetition() - { - CompetitionEntryTask competitionEntryTask = new CompetitionEntryTask(); - competitionEntryTask.SetParameter(ArenaData.eARENA_PAY.Crystal); - StartCoroutine(Toolbox.NetworkManager.Connect(competitionEntryTask, delegate - { - CompetitionUpdateEntryResumeButton(); - AdmissionCompetition(isFreeBattleJoin: true); - })); - } - - private void Resume() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - if (Data.ArenaData.CompetitionData.DeckFormat == Format.TwoPick) - { - if (_entryStatus == ArenaCompetition.EntryStatusType.NotChallenge) - { - AdmissionCompetition(isFreeBattleJoin: false); - } - else if (Data.ArenaData.CompetitionData.IsCompletedTwoPickDeck < 1) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Competition2Pick); - } - else - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.CompetitionLobby); - } - return; - } - switch (_entryStatus) - { - case ArenaCompetition.EntryStatusType.NotChallenge: - AdmissionCompetition(isFreeBattleJoin: false); - break; - case ArenaCompetition.EntryStatusType.NotRegistDeck: - DeckListOpen(); - break; - case ArenaCompetition.EntryStatusType.InBattle: - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.CompetitionLobby); - break; - } - } - - private void FreeBattle() - { - EntryAndAdmissionCompetition(); - } - - private bool IsJoin() - { - return _entryStatus != ArenaCompetition.EntryStatusType.NotEntry; - } - - private bool IsBeforePermanentEntry() - { - if (Data.ArenaData.CompetitionData.FreebieStatus < ArenaCompetition.FreebieStatusType.PermanentEntryDone) - { - return !IsCompetitionComplete; - } - return false; - } - - protected override IEnumerator _InitCoroutine() - { - _buttonFreeBattle.onClick.Clear(); - _buttonFreeBattle.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - _freeBattleFunc(); - })); - return base._InitCoroutine(); - } - - protected override void UpdateEntryResumeButton() - { - base.UpdateEntryResumeButton(); - _buttonFreeBattle.gameObject.SetActive(value: false); - if (_isCompetition && _isFreeBattleCompetition != null && _isFreeBattleCompetition()) - { - ButtonEntry.gameObject.SetActive(value: false); - ButtonResume.gameObject.SetActive(value: false); - _buttonFreeBattle.gameObject.SetActive(value: true); - } - } - - private bool IsFreeBattleCompetition() - { - if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithCost) - { - return false; - } - double num = Data.ArenaData.CompetitionData.RemainingServerUnixTime + (double)Time.realtimeSinceStartup - (double)Data.ArenaData.CompetitionData.RemainingSinceTime; - bool flag = Data.ArenaData.CompetitionData.EntryRemainingUnixTime - num < 0.0; - if (Data.ArenaData.CompetitionData.FreebieStatus == ArenaCompetition.FreebieStatusType.InFreeBattle && _entryStatus == ArenaCompetition.EntryStatusType.NotEntry && _restEntryCount > 0 && !flag) - { - return !IsCompetitionComplete; - } - return false; - } - - public void EntryMenuUpdate(bool isEntryTimeEnd) - { - _isEntryTimeEnd = isEntryTimeEnd; - Initialize(); - } - - private void Initialize() - { - ArenaCompetition competitionData = Data.ArenaData.CompetitionData; - SystemText systemText = Data.SystemText; - _isFreeEntry = false; - if (IsEnableUpdate) - { - IsEnableUpdate = false; - _entryStatus = competitionData.EntryStatus; - _restChallengeCount = competitionData.RestChallangeCount; - _restEntryCount = competitionData.RestEntryCount; - } - bool flag = competitionData.CompetitionId <= PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.COMPETITION_JOIN_BUTTON_LATEST_ID); - Data.MyPageNotifications.data.IsCompetitionBadge = !competitionData.IsRewardReceived && _entryStatus == ArenaCompetition.EntryStatusType.NotEntry && !_isEntryTimeEnd && !flag; - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - UpdateMenu(); - if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithCost) - { - _costRoot.SetActive(value: true); - _ownBeforeStatusLabel.transform.localPosition = new Vector3(3f, 47f, 0f); - } - UpdateCompetitionEntryBadge(); - _freeEntryBadge.SetActive(Data.MyPageNotifications.data.IsCompetitionBadge); - ButtonEntry.GetComponentInChildren().text = systemText.Get("Competition_0012"); - UILabel componentInChildren = ButtonResume.GetComponentInChildren(); - bool flag2 = _entryStatus == ArenaCompetition.EntryStatusType.NotRegistDeck || _entryStatus == ArenaCompetition.EntryStatusType.InBattle; - componentInChildren.text = (flag2 ? systemText.Get("Arena_0024") : systemText.Get("Arena_0034")); - _buttonFreeBattle.GetComponentInChildren().text = systemText.Get("Competition_0065"); - string text = ""; - text = competitionData.DeckFormat switch - { - Format.TwoPick => systemText.Get("Arena_0002"), - Format.Rotation => systemText.Get("Common_0154"), - _ => systemText.Get("Common_0155"), - }; - _formatLabel.text = systemText.Get("Colosseum_0054", text) + systemText.Get("Colosseum_0093"); - _beforeEntryHeadLine.SetActive(IsEnableEntry); - _afterEntryHeadLine.SetActive(!IsEnableEntry); - bool flag3 = true; - bool flag4 = true; - bool flag5 = false; - double num = Data.ArenaData.CompetitionData.RemainingServerUnixTime + (double)Time.realtimeSinceStartup - (double)Data.ArenaData.CompetitionData.RemainingSinceTime; - bool flag6 = Data.ArenaData.CompetitionData.EntryRemainingUnixTime - num < 0.0; - bool flag7 = IsJoin() || (flag6 && competitionData.FreebieChallengeCount > 0 && !competitionData.IsEntry); - _periodTimeTitleLabel.text = (flag7 ? systemText.Get("Competition_0029") : systemText.Get("Competition_0028")); - _periodTimeLabel.text = (flag7 ? competitionData.NowRoundTimeText : competitionData.EntryTimeText); - if (IsEnableEntry) - { - if (IsFreeBattleCompetition()) - { - _ownBeforeStatusLabel.text = systemText.Get("Competition_0063", competitionData.MaxFreebieChallengeCount.ToString()); - _ownBeforeStatusLabel.fontSize = 21; - _retryNumberLabel.text = systemText.Get("Competition_0024"); - flag3 = true; - } - else - { - _ownBeforeStatusLabel.text = systemText.Get("Competition_0073", Data.ArenaData.CompetitionData.RestEntryCount.ToString()); - _ownBeforeStatusLabel.fontSize = 22; - flag3 = true; - } - } - else - { - string freeEntryText = string.Empty; - if (!_isEntry && _isEntryTimeEnd) - { - freeEntryText = systemText.Get("Competition_0025"); - flag3 = false; - flag5 = true; - } - else if (competitionData.IsChampion) - { - freeEntryText = systemText.Get("Colosseum_0038", competitionData.CompetitionName); - flag3 = _entryStatus != ArenaCompetition.EntryStatusType.NotEntry; - flag5 = true; - } - else if (_restChallengeCount == 0) - { - freeEntryText = (IsCompetitionComplete ? systemText.Get("Competition_0026") : systemText.Get("Colosseum_0051")); - flag3 = _entryStatus != ArenaCompetition.EntryStatusType.NotEntry; - flag4 = IsCompetitionComplete; - flag5 = true; - } - else if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithFree) - { - flag5 = TryGetFreeEntryStatusText(out freeEntryText); - flag4 = !flag2; - } - if (!flag5) - { - freeEntryText = systemText.Get("Colosseum_0050", _restChallengeCount.ToString()); - flag4 = !flag2; - } - _ownAfterStatusLabel.text = freeEntryText; - } - _ownAfterStatusLabel.color = (flag4 ? baseStatusTextColor : grayStatusTextColor); - UIManager.SetObjectToGrey(ButtonEntry.gameObject, !flag3); - UIManager.SetObjectToGrey(ButtonResume.gameObject, !flag3); - } - - protected override void UpdateCompetitionEntryBadge() - { - base.UpdateCompetitionEntryBadge(); - _competitionBadge.SetActive(Data.MyPageNotifications.data.IsCompetitionBadge); - } - - public void AdmissionCompetition(bool isFreeBattleJoin) - { - CompetitionJoinTask task = new CompetitionJoinTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Data.MyPageNotifications.data.IsCompetitionBadge = false; - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.COMPETITION_JOIN_BUTTON_LATEST_ID, Data.ArenaData.CompetitionData.CompetitionId); - _entryStatus = ArenaCompetition.EntryStatusType.NotRegistDeck; - if (!isFreeBattleJoin) - { - _restChallengeCount--; - } - Initialize(); - if (Data.ArenaData.CompetitionData.DeckFormat == Format.TwoPick) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Competition2Pick); - } - else - { - DeckListOpen(); - } - })); - } - - public void DeckListOpen() - { - UpdateEntryResumeButton(); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.CompetitionNormal; - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Data.ArenaData.CompetitionData.DeckFormat); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - DeckSelectUIDialog.Create(Data.SystemText.Get("Competition_0006"), task.DeckGroupListData, Data.ArenaData.CompetitionData.DeckFormat, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: true, CreateDeckSelectConfirmDialog); - })); - } - - private void CreateDeckSelectConfirmDialog(DialogBase dialogDeckList, DeckData deck) - { - if (!deck.IsUsable()) - { - InCompleteDeckDecideDialog.Create(dialogDeckList, deck); - return; - } - CompleteDeckDecideDialog completeDeckDecideDialog = CompleteDeckDecideDialog.CreateForSingleDeck(dialogDeckList, deck, showSimpleStageOption: true, delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DeckSetAndMoveCompetition(deck); - }); - completeDeckDecideDialog.DecisionUI.CardDetailCustomize = delegate(CardDetailUI detailUI) - { - detailUI.IsShowFlavorTextButton = false; - detailUI.IsShowVoiceButton = false; - detailUI.IsShowEvolutionButton = false; - detailUI.SetSortOrder(110); - }; - completeDeckDecideDialog.DecisionUI.CardListCustomize = delegate(UICardList uiCardList) - { - uiCardList.SetPanelSortOrder(100); - }; - completeDeckDecideDialog.DecisionUI.gameObject.GetComponent().alpha = 0f; - DeckDecisionCompetition deckDecisionCompetition = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject("UI/DeckList/DeckDecisionCompetition", isServerResources: false)); - completeDeckDecideDialog.Dialog.SetObj(deckDecisionCompetition.gameObject); - deckDecisionCompetition.Init(deck); - completeDeckDecideDialog.DecisionUI.transform.SetParent(deckDecisionCompetition.transform.parent.transform); - } - - private void DeckSetAndMoveCompetition(DeckData inDeckData) - { - Data.ArenaData.CompetitionData.DeckList.Clear(); - Data.ArenaData.CompetitionData.DeckList.Add(inDeckData); - bool isPublished = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.COMPETITION_PUBLISHED_SETTING); - CompetitionRegisterDeckTask competitionRegisterDeckTask = new CompetitionRegisterDeckTask(); - competitionRegisterDeckTask.SetParameter(new List { inDeckData }, isPublished); - StartCoroutine(Toolbox.NetworkManager.Connect(competitionRegisterDeckTask, delegate - { - _entryStatus = ArenaCompetition.EntryStatusType.InBattle; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.CompetitionLobby); - })); - } - - public void CompetitionUpdateEntryResumeButton() - { - _restEntryCount = Data.ArenaData.CompetitionData.RestEntryCount; - _restChallengeCount = Data.ArenaData.CompetitionData.RestChallangeCount; - _entryStatus = ArenaCompetition.EntryStatusType.NotChallenge; - EntryAction(); - } - - public void OnClickDetailButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - GameObject gameObject = UnityEngine.Object.Instantiate(_detailPrefab); - dialogBase.SetObj(gameObject); - gameObject.GetComponent().Init(dialogBase, Data.ArenaData.CompetitionData, _isEntry); - } - - private bool TryGetFreeEntryStatusText(out string freeEntryText) - { - ArenaCompetition competitionData = Data.ArenaData.CompetitionData; - SystemText systemText = Data.SystemText; - freeEntryText = string.Empty; - bool result = true; - if (competitionData.FreebieStatus == ArenaCompetition.FreebieStatusType.InFreeBattle) - { - freeEntryText = systemText.Get("Competition_0072", competitionData.FreebieChallengeCount.ToString()); - } - else if (competitionData.FreebieStatus == ArenaCompetition.FreebieStatusType.CanPermanentEntry) - { - freeEntryText = systemText.Get("Competition_0073", _restChallengeCount.ToString()); - } - else - { - result = false; - } - return result; - } - - private void AdmissionCompetitionNotFree() - { - AdmissionCompetition(isFreeBattleJoin: false); - } - - private void SetMyPageCompetitionReload() - { - CompetitionUpdateEntryResumeButton(); - Initialize(); - UpdateEntryResumeButton(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionEntryDialog.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionEntryDialog.cs deleted file mode 100644 index be65624a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionEntryDialog.cs +++ /dev/null @@ -1,186 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.Arena; - -namespace Wizard; - -public class CompetitionEntryDialog : ArenaEntryDialogBase -{ - public delegate void OnCompleteEntry(); - - public delegate void OnCompleteJoin(); - - [SerializeField] - private GameObject _prefabRewardDialog; - - [SerializeField] - private CardDetailUI _cardDetailDialog; - - [SerializeField] - private UILabel _mainText; - - [SerializeField] - private GameObject _competitionEntryCompleteDialog; - - [SerializeField] - private GameObject _rewardRoot; - - [SerializeField] - private GameObject _freeEntryDialogLine; - - [SerializeField] - private UIButton _entryRupyButton; - - [SerializeField] - private UIButton _entryCrystalButton; - - [SerializeField] - private UIGrid _entryButtonGrid; - - [SerializeField] - private GameObject _rewardLabel; - - [SerializeField] - private GameObject _coutionLabel; - - public Action CompleteEntryHandler; - - public Action CompleteJoinHandler; - - private const int CELL_WIDTH_ADJUST = -12; - - private const int CELL_WIDTH_ADJUST_COUNT = 4; - - private readonly Vector3 FREE_BATTLE_LABEL_POS = new Vector3(0f, 198f, 0f); - - private readonly Vector3 FREE_BATTLE_COUTION_LABEL_POS = new Vector3(0f, 108f, 0f); - - private readonly Vector3 FREE_BATTLE_REWARD_LABEL_POS = new Vector3(0f, 29f, 0f); - - private readonly Vector3 FREE_BATTLE_REWARD_POS = new Vector3(0f, -96f, 0f); - - protected override void Init() - { - IsCompetition = true; - switch (Data.ArenaData.CompetitionData.CostType) - { - case ArenaCompetition.EntryCostType.EntryWithFree: - { - bool flag = Data.ArenaData.CompetitionData.CurrentWinCount > 0; - _mainText.text = (flag ? Data.SystemText.Get("Competition_0062", Data.ArenaData.CompetitionData.MaxChallengeCount.ToString()) : Data.SystemText.Get("Competition_0069", Data.ArenaData.CompetitionData.MaxChallengeCount.ToString())); - _freeEntryDialogLine.SetActive(value: true); - _mainText.gameObject.transform.localPosition = FREE_BATTLE_LABEL_POS; - _rewardRoot.transform.localPosition = FREE_BATTLE_REWARD_POS; - _rewardLabel.transform.localPosition = FREE_BATTLE_REWARD_LABEL_POS; - _coutionLabel.transform.localPosition = FREE_BATTLE_COUTION_LABEL_POS; - break; - } - case ArenaCompetition.EntryCostType.EntryWithCost: - _mainText.text = Data.SystemText.Get("Competition_0077", Data.ArenaData.CompetitionData.MaxChallengeCount.ToString()); - _freeEntryDialogLine.SetActive(value: false); - break; - } - _entryCrystalButton.gameObject.SetActive(Data.ArenaData.CompetitionData.crystalCost != 0); - _entryRupyButton.gameObject.SetActive(Data.ArenaData.CompetitionData.rupyCost != 0); - _entryButtonGrid.Reposition(); - _arenaNameTextId = "Competition_0035"; - _entryButtonSe = Se.TYPE.SYS_BTN_DECIDE; - } - - protected override int GetTicketNum() - { - return PlayerStaticData.UserColosseumTicketNum; - } - - protected override ArenaEntryDataBase GetEntryData() - { - return Data.ArenaData.CompetitionData; - } - - protected override void Entry() - { - base.Entry(); - if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithCost) - { - CompetitionEntryTask competitionEntryTask = new CompetitionEntryTask(); - competitionEntryTask.SetParameter(_payType); - StartCoroutine(Toolbox.NetworkManager.Connect(competitionEntryTask, EntryTaskSuccess)); - } - else - { - CompetitionPermanentEntryTask competitionPermanentEntryTask = new CompetitionPermanentEntryTask(); - competitionPermanentEntryTask.SetParameter(_payType); - StartCoroutine(Toolbox.NetworkManager.Connect(competitionPermanentEntryTask, EntryTaskSuccess)); - } - } - - private void EntryTaskSuccess(NetworkTask.ResultCode inResult) - { - base.ParentDialog.CloseWithoutSelect(); - CompleteEntryHandler.Call(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Competition_0018")); - GameObject gameObject = UnityEngine.Object.Instantiate(_competitionEntryCompleteDialog); - dialogBase.SetObj(gameObject); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - SetRewardInfo(gameObject, isOnlyIcon: false, isSetLabel: true); - gameObject.transform.localPosition = Vector3.forward * 10f; - dialogBase.OnClose = delegate - { - if (Data.ArenaData.CompetitionData.CostType == ArenaCompetition.EntryCostType.EntryWithFree) - { - UIManager.ViewScene nextScene = ((Data.ArenaData.CompetitionData.Rule == ArenaColosseum.eRule.TwoPick) ? UIManager.ViewScene.Competition2Pick : UIManager.ViewScene.CompetitionLobby); - UIManager.GetInstance().ChangeViewScene(nextScene); - } - else - { - CreateJoinCompetitionDialog(); - } - }; - } - - public void SetRewardInfoEntryConfirm() - { - SetRewardInfo(_rewardRoot, isOnlyIcon: true); - } - - public void SetRewardInfo(GameObject root, bool isOnlyIcon = false, bool isSetLabel = false) - { - RewardBase component = NGUITools.AddChild(root, _prefabRewardDialog).GetComponent(); - component.SetCardDetailUI(_cardDetailDialog); - foreach (Wizard.Scripts.Network.Data.TaskData.Arena.Reward entryReward in Data.ArenaData.CompetitionData.EntryRewardList) - { - component.AddReward(entryReward); - } - component.GetComponent().depth = 8; - if (component._rewardObjectInfoList.Count >= 4) - { - component.AllInEndCreate(0.8f, -12); - } - else - { - component.AllInEndCreate(1f); - } - if (isOnlyIcon) - { - component.SetOnlyIconEndCreate(isSleeveRotate: false); - } - component.SetActiveRewardLabel(isSetLabel); - } - - public void CreateJoinCompetitionDialog() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Competition_0039")); - dialogBase.SetText(systemText.Get("Competition_0078")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; - dialogBase.SetButtonDelegate(delegate - { - CompleteJoinHandler.Call(); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionEntryTask.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionEntryTask.cs deleted file mode 100644 index 1be9a71d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionEntryTask.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Wizard; - -public class CompetitionEntryTask : BaseTask -{ - public class CompetitionEntryTaskParam : BaseParam - { - public int consume_item_type; - } - - public CompetitionEntryTask() - { - base.type = ApiType.Type.CompetitionEntry; - } - - public void SetParameter(ArenaData.eARENA_PAY inPayType) - { - CompetitionEntryTaskParam competitionEntryTaskParam = new CompetitionEntryTaskParam(); - competitionEntryTaskParam.consume_item_type = (int)inPayType; - base.Params = competitionEntryTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - Data.ArenaData.CompetitionData.SetRestChallangeCountByEntry(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionJoinTask.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionJoinTask.cs deleted file mode 100644 index dfd131e7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionJoinTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Wizard; - -public class CompetitionJoinTask : BaseTask -{ - public CompetitionJoinTask() - { - base.type = ApiType.Type.CompetitionJoin; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionPermanentEntryTask.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionPermanentEntryTask.cs deleted file mode 100644 index 92a1ed95..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionPermanentEntryTask.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Wizard; - -public class CompetitionPermanentEntryTask : BaseTask -{ - public class CompetitionPermanentEntryTaskParam : BaseParam - { - public int consume_item_type; - } - - public CompetitionPermanentEntryTask() - { - base.type = ApiType.Type.CompetitionPermanentEntry; - } - - public void SetParameter(ArenaData.eARENA_PAY inPayType) - { - CompetitionPermanentEntryTaskParam competitionPermanentEntryTaskParam = new CompetitionPermanentEntryTaskParam(); - competitionPermanentEntryTaskParam.consume_item_type = (int)inPayType; - base.Params = competitionPermanentEntryTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - Data.ArenaData.CompetitionData.SetRestChallangeCountByEntry(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionRegisterDeckTask.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionRegisterDeckTask.cs deleted file mode 100644 index b4b26542..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionRegisterDeckTask.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class CompetitionRegisterDeckTask : BaseTask -{ - public class CompetitionRegisterDeckTaskParam : BaseParam - { - public string deck_no_list; - - public bool is_published; - } - - public CompetitionRegisterDeckTask() - { - base.type = ApiType.Type.CompetitionRegisterDeck; - } - - public void SetParameter(List deckList, bool isPublished) - { - CompetitionRegisterDeckTaskParam competitionRegisterDeckTaskParam = new CompetitionRegisterDeckTaskParam(); - List list = new List(); - for (int i = 0; i < deckList.Count; i++) - { - list.Add(deckList[i].GetDeckID()); - } - competitionRegisterDeckTaskParam.deck_no_list = JsonMapper.ToJson(list); - competitionRegisterDeckTaskParam.is_published = isPublished; - base.Params = competitionRegisterDeckTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionResultAnimationAgent.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionResultAnimationAgent.cs deleted file mode 100644 index 3ba2a1f8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionResultAnimationAgent.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System.Collections; -using UnityEngine; - -namespace Wizard; - -public class CompetitionResultAnimationAgent : ResultAnimationAgent -{ - private const float OBJECT_APPEAR_MOVE_SEC = 0.5f; - - private const float RESULT_TITLE_DELAY_SEC = 0f; - - private const float CLASS_CHAR_DELAY_SEC = 0.1f; - - private const float CLASS_INFO_DELAY_SEC = 0.3f; - - private const float GAUGE_WAIT_SEC = 0.5f; - - public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) - { - m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); - if (battleResultControl.IsDraw) - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleDraw.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 48, 16, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - else if (isWin) - { - battleResultControl.TitleWin.gameObject.SetActive(value: true); - battleResultControl.TitleLose.gameObject.SetActive(value: false); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleWin.alpha = 0f; - battleResultControl.Bg.color = new Color32(32, 24, 0, 0); - battleResultControl.ResultTitle.spriteName = "result_top_win"; - } - else - { - battleResultControl.TitleWin.gameObject.SetActive(value: false); - battleResultControl.TitleLose.gameObject.SetActive(value: true); - battleResultControl.TitleDraw.gameObject.SetActive(value: false); - battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; - battleResultControl.TitleLose.alpha = 0f; - battleResultControl.Bg.color = new Color32(0, 24, 48, 0); - battleResultControl.ResultTitle.spriteName = "result_top_lose"; - } - battleResultControl.MainPanel.alpha = 1f; - yield return new WaitForSeconds(0.1f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - else if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); - } - TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); - yield return new WaitForSeconds(0.2f); - TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); - TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); - iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - if (battleResultControl.IsDraw) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); - battleResultControl.TitleDraw.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else if (isWin) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); - battleResultControl.TitleWin.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - else - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); - battleResultControl.TitleLose.transform.localScale = Vector3.one; - iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); - } - HideEmotionMessage(); - if (battleResultControl.ResultMsgWindowFlag) - { - StartCoroutine(battleResultControl.ShowSpecialResultInfo()); - } - yield return new WaitForSeconds(2f); - if (battleResultControl.IsDraw) - { - TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - if (ShowRewardDialog(battleResultControl)) - { - while (battleResultControl.IsRewardWait) - { - yield return null; - } - } - if (isWin) - { - TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); - iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - else - { - TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); - } - } - yield return new WaitForSeconds(0.2f); - if (isWin) - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); - iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(1f); - if (isWin) - { - PlayWinVoice(); - } - if (battleResultControl.AddClassExp > 0) - { - battleResultControl.SettingAddClassExpTextAnimation(); - yield return new WaitForSeconds(0.5f); - yield return PlayGaugeUpSe(); - yield return new WaitForSeconds(0.5f); - } - if (Data.CompetitionBattleFinish.DetailData.IsChampion) - { - yield return PlayCompetitionChampionAnimationCoroutine(battleResultControl); - } - battleResultControl.SetBattlePassGauge(delegate - { - nextSceneSelector.Show(); - battleResultControl.PrepareAchievementLog(); - battleResultControl.FinishResult(); - battleResultControl.GreySpriteBGVisible = false; - }); - } - - private IEnumerator PlayGaugeUpSe() - { - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - int i = 0; - while (i < 10) - { - soundMgr.PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - int num = i + 1; - i = num; - } - } - - private IEnumerator PlayCompetitionChampionAnimationCoroutine(BattleResultUIController controller) - { - controller.TitleMatch.spriteName = "colosseum_battle_title_03"; - StartCoroutine(controller.RunMatch()); - yield return new WaitForSeconds(3f); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionResultAnimationHandler.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionResultAnimationHandler.cs deleted file mode 100644 index e1ab6106..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionResultAnimationHandler.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class CompetitionResultAnimationHandler : IResultAnimationHandler -{ - private readonly GameObject _resultAnimationAgentObj; - - private readonly CompetitionResultAnimationAgent _resultAnimationAgentIns; - - public ResultAnimationAgent m_resultAnimationAgent => _resultAnimationAgentIns; - - public CompetitionResultAnimationHandler(BattleCamera battleCamera) - { - _resultAnimationAgentObj = new GameObject(); - _resultAnimationAgentIns = _resultAnimationAgentObj.AddComponent(); - _resultAnimationAgentIns.GetComponent().SetBattleCamera(battleCamera); - } - - public void Destroy() - { - Object.Destroy(_resultAnimationAgentObj); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionResultReporter.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionResultReporter.cs deleted file mode 100644 index 4c2f47c8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionResultReporter.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard.Lottery; - -namespace Wizard; - -public class CompetitionResultReporter : IBattleResultReporter -{ - public bool IsEnd => Data.CompetitionBattleFinish.DetailData != null; - - public int ClassExp => GetClassExp(); - - public List UserAchievement => GetUserAchievementList(); - - public List UserMission => GetUserMissionList(); - - public List MissionRewards => Data.CompetitionBattleFinish.DetailData._missionRewards; - - public List VictoryRewards => null; - - public LotteryApplyData LotteryData => LotteryApplyData.EmptyData(); - - public bool IsDataExist - { - get - { - if (Data.CompetitionBattleFinish.DetailData != null) - { - return Data.CompetitionBattleFinish.DetailData.IsProcessed; - } - return false; - } - } - - public MyPageHomeDialogData HomeDialogData => null; - - public void Report(bool isWin) - { - } - - public void Destroy() - { - } - - public JsonData GetFinishResponseData() - { - return Data.CompetitionBattleFinish.DetailData._responseData; - } - - public List GetUserAchievementList() - { - return Data.CompetitionBattleFinish.DetailData.achieved_achievement_list; - } - - public List GetUserMissionList() - { - return Data.CompetitionBattleFinish.DetailData.achieved_mission_list; - } - - public int GetClassExp() - { - return Data.CompetitionBattleFinish.DetailData.get_class_chara_experience; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompetitionUtility.cs b/SVSim.BattleEngine/Engine/Wizard/CompetitionUtility.cs deleted file mode 100644 index d7a7372f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CompetitionUtility.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Wizard; - -public static class CompetitionUtility -{ - public static FirstTips.TipsType GetCompetitionTipsType(ArenaColosseum.eRule competitionRule) - { - if (competitionRule == ArenaColosseum.eRule.TwoPick) - { - return FirstTips.TipsType.CompetitionTwoPick; - } - return FirstTips.TipsType.CompetitionVer2; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CompleteDeckDecideDialog.cs b/SVSim.BattleEngine/Engine/Wizard/CompleteDeckDecideDialog.cs index 2bf99cc5..b7007a31 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CompleteDeckDecideDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CompleteDeckDecideDialog.cs @@ -6,9 +6,6 @@ namespace Wizard; public class CompleteDeckDecideDialog { - private const string DECK_DECISION_PATH = "UI/DeckList/DeckDecision"; - - private const int DECK_SELECT_DIALOG_PANEL_DEPTH = 15; public DialogBase Dialog { get; private set; } @@ -21,13 +18,6 @@ public class CompleteDeckDecideDialog return completeDeckDecideDialog; } - public static CompleteDeckDecideDialog CreateForMultiDeck(DialogBase dialogDeckList, string textBody, bool showSimpleStageOption, Action onDecide, Action onCancel) - { - CompleteDeckDecideDialog completeDeckDecideDialog = new CompleteDeckDecideDialog(showSimpleStageOption); - completeDeckDecideDialog.InitializeForMultiDeck(dialogDeckList, textBody, onDecide, onCancel); - return completeDeckDecideDialog; - } - private CompleteDeckDecideDialog(bool showSimpleStageOption) { CreateDialogBase(showSimpleStageOption); @@ -47,11 +37,11 @@ public class CompleteDeckDecideDialog { Dialog.SetButtonText(Data.SystemText.Get("Common_0004"), Data.SystemText.Get("Card_0083")); Dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - Dialog.ClickSe_Btn1 = Se.TYPE.NONE; + Dialog.ClickSe_Btn1 = 0; DecisionUI.SetDeckData(deck, conventionDeckList); DecisionUI.DeckName = deck.GetDeckName(); Dialog.onPushButton2 = DecisionUI.OnClickCreateCardList; - Dialog.ClickSe_Btn2 = Se.TYPE.SYS_BTN_DECIDE; + Dialog.ClickSe_Btn2 = 0; Dialog.isNotCloseWindowButton2 = true; Dialog.onPushButton1 = delegate { @@ -63,27 +53,4 @@ public class CompleteDeckDecideDialog onDecide.Call(); }; } - - private void InitializeForMultiDeck(DialogBase dialogDeckList, string textBody, Action onDecide, Action onCancel) - { - Dialog.SetButtonText(Data.SystemText.Get("Common_0004")); - Dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - Dialog.ClickSe_Btn1 = Se.TYPE.NONE; - DecisionUI.SetText(textBody, string.Empty); - Dialog.onPushButton1 = delegate - { - Dialog.button1.isEnabled = false; - dialogDeckList.CloseWithoutSelect(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - onDecide(); - }; - Dialog.onPushButton2 = delegate - { - onCancel(); - }; - Dialog.onCloseWithoutSelect = delegate - { - onCancel(); - }; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/ConventionDeckList.cs b/SVSim.BattleEngine/Engine/Wizard/ConventionDeckList.cs index 882f8533..fee7a85a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ConventionDeckList.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ConventionDeckList.cs @@ -53,37 +53,4 @@ public class ConventionDeckList DeckList[num].Initialize(jsonData); } } - - public DeckData GetDeckUsingOffset(int i) - { - return DeckList[DeckIdList[i]]; - } - - public int GetDeckNum() - { - return DeckIdList.Count; - } - - public List GetConventionDeckClassList() - { - List list = new List(DeckList.Count); - IFormatBehavior formatBehavior = FormatBehaviorManager.Create(Conventioninfo.BattleParameterInstance.DeckFormat, this); - foreach (KeyValuePair deck in DeckList) - { - if (!deck.Value.IsNoCard()) - { - list.Add(deck.Value.GetDeckClassID()); - if (formatBehavior.UseSubClass) - { - list.Add(deck.Value.GetDeckSubClassID()); - } - } - } - return list; - } - - public bool IsUseOkCard(int cardId) - { - return CardPool.ContainsKey(cardId); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/ConventionInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/ConventionInfoTask.cs deleted file mode 100644 index f61c162a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ConventionInfoTask.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Wizard; - -public class ConventionInfoTask : BaseTask -{ - public ConventionList OfflineConventionList { get; private set; } - - public ConventionInfoTask() - { - base.type = ApiType.Type.ConventionInfo; - OfflineConventionList = new ConventionList(); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - OfflineConventionList.Parse(base.ResponseData["data"]["tournament_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ConvertTime.cs b/SVSim.BattleEngine/Engine/Wizard/ConvertTime.cs index 972edfc1..9c472390 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ConvertTime.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ConvertTime.cs @@ -8,18 +8,11 @@ public class ConvertTime public enum FORMAT { TIME_DATE_LONG, - TIME_DATE_SHORT, - DATE_LONG, - DATE_SHORT, - TIME, - YEAR_MONTH, TIME_DATE_LONG_SPECIAL } private static string[] FORMAT_TEXT_ID = new string[7] { "System_TimeDateLong", "System_TimeDateShort", "System_DateLong", "System_DateShort", "System_Time", "System_YearMonth", "System_0068" }; - public const string CULTURE_INFO_ID = "System_CultureInfo"; - private static string ToLocal(DateTime dateTime, string outputFormat) { TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); @@ -28,11 +21,6 @@ public class ConvertTime return dateTime2.ToString(outputFormat, cultureInfo); } - public static DateTime LocalToUtc(DateTime localTime) - { - return TimeZoneInfo.ConvertTimeToUtc(localTime); - } - public static DateTime ToLocalByDateTime(DateTime dateTime) { TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); @@ -45,12 +33,6 @@ public class ConvertTime .Replace("PM", "p.m."); } - public static string ToLocal(string dateTime, FORMAT outputFormat = FORMAT.TIME_DATE_LONG) - { - string[] formats = new string[2] { "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" }; - return ToLocal(DateTime.ParseExact(dateTime, formats, CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault), outputFormat); - } - public static string ToLocal(DateTime beginDateTime, DateTime endDateTime, FORMAT outputFormat = FORMAT.TIME_DATE_LONG) { string text = ToLocal(beginDateTime, outputFormat); @@ -81,25 +63,6 @@ public class ConvertTime return dateTime.Subtract(value).TotalSeconds; } - public static string DateTimeToAgoText(DateTime pastLocalTime) - { - TimeSpan timeSpan = PlayerStaticData.UserTime.GetNowTime() - pastLocalTime; - SystemText systemText = Data.SystemText; - if (timeSpan >= TimeSpan.FromDays(1.0)) - { - return systemText.Get("OtherFriend_0010", timeSpan.Days.ToString()); - } - if (timeSpan >= TimeSpan.FromHours(1.0)) - { - return systemText.Get("OtherFriend_0009", timeSpan.Hours.ToString()); - } - if (timeSpan > TimeSpan.Zero) - { - return systemText.Get("OtherFriend_0008", timeSpan.Minutes.ToString()); - } - return systemText.Get("OtherFriend_0008", TimeSpan.Zero.Minutes.ToString()); - } - public static DateTime? GetDateTime(string endDateTime) { if (DateTime.TryParse(endDateTime, out var result)) diff --git a/SVSim.BattleEngine/Engine/Wizard/ConvertValue.cs b/SVSim.BattleEngine/Engine/Wizard/ConvertValue.cs index 6f81ce34..5302765c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ConvertValue.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ConvertValue.cs @@ -6,14 +6,4 @@ public static class ConvertValue { return int.Parse(obj.ToString()); } - - public static long ToLong(object obj) - { - return long.Parse(obj.ToString()); - } - - public static bool ToBool(object obj) - { - return bool.Parse(obj.ToString()); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Country.cs b/SVSim.BattleEngine/Engine/Wizard/Country.cs deleted file mode 100644 index 15817a42..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Country.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class Country -{ - public readonly string _countryId; - - public readonly string _categoryText; - - private int index = -1; - - public Country(string[] columns, Dictionary textDic) - { - _countryId = columns[++index]; - _categoryText = textDic[columns[++index]]; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CrossOverClassInfomationOrder.cs b/SVSim.BattleEngine/Engine/Wizard/CrossOverClassInfomationOrder.cs deleted file mode 100644 index 416e1db3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CrossOverClassInfomationOrder.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Wizard; - -public class CrossOverClassInfomationOrder : Master.ReadFromCsv -{ - public string KeyClassIds; - - public string ValueClassIds; - - public void ReadCsvColumns(string[] columns) - { - KeyClassIds = columns[0]; - ValueClassIds = columns[1]; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/Crossover.cs b/SVSim.BattleEngine/Engine/Wizard/Crossover.cs index 7ea112a8..103535f0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Crossover.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Crossover.cs @@ -13,12 +13,6 @@ public class Crossover public DateTime EndTime = DateTime.MinValue; } - public const int MAIN_CLASS_CARD_MIN_NUM = 24; - - public const int SUB_CLASS_CARD_MIN_NUM = 9; - - public const int AUTO_CREATE_NEUTRAL_MAX = 7; - public PeriodData RankMatchPeriod = new PeriodData(); public PeriodData FreeMatchPeriod = new PeriodData(); @@ -33,14 +27,6 @@ public class Crossover public CrossoverRestrictedCard RestrictedCard = new CrossoverRestrictedCard(); - private int _startRankId; - - private int _maxRankId; - - private Dictionary UserRankData = new Dictionary(); - - private List _userRankList = new List(); - public static int AUTO_CREATE_MAIN_AND_NEUTRAL_MAX => 31; public static int AUTO_CREATE_SUB_AND_NEUTRAL_MAX => 16; @@ -74,91 +60,4 @@ public class Crossover } return false; } - - public void Parse(JsonData data) - { - JsonData data2 = data["schedules"]; - if (data2.TryGetValue("rank_battle", out var value)) - { - SetPeriodData(RankMatchPeriod, value); - } - if (data2.TryGetValue("free_battle", out var value2)) - { - SetPeriodData(FreeMatchPeriod, value2); - } - if (data2.TryGetValue("gathering", out var value3)) - { - SetPeriodData(GatheringPeriod, value3); - } - if (data2.TryGetValue("practice", out var value4)) - { - SetPeriodData(PracticePeriod, value4); - } - if (data.TryGetValue("card_set_id_list", out var value5)) - { - for (int i = 0; i < value5.Count; i++) - { - CardSetIdList.Add(value5[i].ToInt()); - } - } - if (data.TryGetValue("reprinted_base_card_ids", out var value6)) - { - for (int j = 0; j < value6.Count; j++) - { - ReprintedBaseCardIds.Add(value6[j].ToInt()); - } - } - if (data.TryGetValue("restricted_base_card_id_list", out var value7)) - { - RestrictedCard.Parse(value7); - } - ParseRankData(data); - } - - public void ParseRankData(JsonData data) - { - JsonData jsonData = data["rank_info"]; - _startRankId = int.MaxValue; - _maxRankId = int.MinValue; - for (int i = 0; i < jsonData.Count; i++) - { - RankInfo rankInfo = new RankInfo(jsonData[i]); - _userRankList.Add(rankInfo); - UserRankData[rankInfo.RankId] = rankInfo; - if (rankInfo.RankId < _startRankId) - { - _startRankId = rankInfo.RankId; - } - if (rankInfo.RankId > _maxRankId) - { - _maxRankId = rankInfo.RankId; - } - } - } - - public RankInfo GetRankInfo(int rankId) - { - return UserRankData[rankId]; - } - - public bool IsStartRank(int rankId) - { - return rankId == _startRankId; - } - - public bool IsMaxRank(int rankId) - { - return rankId == _maxRankId; - } - - public List GetRankInfoRawList() - { - return _userRankList; - } - - private void SetPeriodData(PeriodData period, JsonData jsonData) - { - period.BeginTime = DateTime.Parse(jsonData["begin_time"].ToString()); - period.EndTime = DateTime.Parse(jsonData["end_time"].ToString()); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CrossoverFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/CrossoverFormatBehavior.cs index 84ed8849..bdd88ca5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CrossoverFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CrossoverFormatBehavior.cs @@ -2,6 +2,10 @@ using System; using System.Collections.Generic; using System.Linq; using Wizard.DeckCardEdit; +// TODO(engine-cleanup-pass2): 32 of 33 methods unrun in baseline +// Type: Wizard.CrossoverFormatBehavior +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -62,7 +66,7 @@ public class CrossoverFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsEnableDeckShareButton(int cardNum, int cardNumMax) { @@ -71,21 +75,21 @@ public class CrossoverFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/CrossoverPortalParam.cs b/SVSim.BattleEngine/Engine/Wizard/CrossoverPortalParam.cs index 70945df3..3d5bd5d7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CrossoverPortalParam.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CrossoverPortalParam.cs @@ -2,7 +2,6 @@ namespace Wizard; public class CrossoverPortalParam { - private const int IS_SKIP_FIRST_TIPS_STATUS = 1; public bool IsSkipFirstTips { get; set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/CrossoverReceiveRankRewardTask.cs b/SVSim.BattleEngine/Engine/Wizard/CrossoverReceiveRankRewardTask.cs deleted file mode 100644 index 06395361..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CrossoverReceiveRankRewardTask.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class CrossoverReceiveRankRewardTask : BaseTask -{ - private class QuestRewardReceiveTaskParam : BaseParam - { - public int reward_id; - } - - public List ReceivedRewardList { get; private set; } - - public CrossoverReceiveRankRewardTask() - { - base.type = ApiType.Type.CrossoverReceiveRankReward; - } - - public void SetParameter(int rewardId) - { - QuestRewardReceiveTaskParam questRewardReceiveTaskParam = new QuestRewardReceiveTaskParam - { - reward_id = rewardId - }; - base.Params = questRewardReceiveTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - ReceivedRewardList = new List(); - JsonData jsonData2 = jsonData["total_receive_count_list"]; - for (int i = 0; i < jsonData2.Count; i++) - { - ReceivedRewardList.Add(new ReceivedReward(jsonData2[i])); - } - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(jsonData["reward_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CrossoverRestrictedCard.cs b/SVSim.BattleEngine/Engine/Wizard/CrossoverRestrictedCard.cs index 5435f511..e96b086b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/CrossoverRestrictedCard.cs +++ b/SVSim.BattleEngine/Engine/Wizard/CrossoverRestrictedCard.cs @@ -1,5 +1,9 @@ using System.Collections.Generic; using LitJson; +// TODO(engine-cleanup-pass2): 1 of 2 methods unrun in baseline +// Type: Wizard.CrossoverRestrictedCard +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -22,31 +26,6 @@ public class CrossoverRestrictedCard private readonly List _subClassDataList = new List(); - public void Parse(JsonData jsonData) - { - if (jsonData.TryGetValue("main_class", out var value) && value.IsObject) - { - foreach (string key in value.Keys) - { - if (int.TryParse(key, out var result)) - { - _mainClassDataList.Add(new Data(result, value[key].ToInt())); - } - } - } - if (!jsonData.TryGetValue("sub_class", out var value2) || !value2.IsObject) - { - return; - } - foreach (string key2 in value2.Keys) - { - if (int.TryParse(key2, out var result2)) - { - _subClassDataList.Add(new Data(result2, value2[key2].ToInt())); - } - } - } - public int GetRestrictedCountOrDefault(int baseCardId, ClassType classType, int defaultCount) { List list = ((classType == ClassType.MainClass) ? _mainClassDataList : _subClassDataList); diff --git a/SVSim.BattleEngine/Engine/Wizard/CrossoverRewardInfo.cs b/SVSim.BattleEngine/Engine/Wizard/CrossoverRewardInfo.cs deleted file mode 100644 index b51db857..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CrossoverRewardInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class CrossoverRewardInfo -{ - public enum RewardStatus - { - NotAchieved, - NotReceived, - Received - } - - public int RewardId; - - public int Rank; - - public int RewardType; - - public int RewardDetailId; - - public int RewardCount; - - public RewardStatus Status; - - public CrossoverRewardInfo(JsonData data) - { - RewardId = data["reward_id"].ToInt(); - Rank = data["rank"].ToInt(); - RewardType = data["reward_type"].ToInt(); - RewardDetailId = data["reward_detail_id"].ToInt(); - RewardCount = data["reward_count"].ToInt(); - Status = (RewardStatus)data["status"].ToInt(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/CustomEasing.cs b/SVSim.BattleEngine/Engine/Wizard/CustomEasing.cs deleted file mode 100644 index b81f9f89..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/CustomEasing.cs +++ /dev/null @@ -1,411 +0,0 @@ -using System; - -namespace Wizard; - -public class CustomEasing -{ - public enum eType - { - linear, - inQuad, - outQuad, - inOutQuad, - inCubic, - outCubic, - inOutCubic, - inQuart, - outQuart, - inOutQuart, - inSine, - outSine, - inOutSine, - inExpo, - outExpo, - inOutExpo, - inCirc, - outCirc, - inOutCirc, - inElastic, - outElastic, - inOutElastic, - inBack, - outBack, - inOutBack, - inBounce, - outBounce, - inOutBounce - } - - private delegate float easingFunc(float curTime); - - private float beginVal; - - private float endVal; - - private float changeVal; - - private float duration; - - private float curTime; - - private easingFunc func; - - public bool IsMoving { get; private set; } - - public CustomEasing(eType type, float beginValue, float endValue, float durationTime) - { - switch (type) - { - case eType.linear: - func = linear; - break; - case eType.inQuad: - func = inQuad; - break; - case eType.outQuad: - func = outQuad; - break; - case eType.inOutQuad: - func = inOutQuad; - break; - case eType.inCubic: - func = inCubic; - break; - case eType.outCubic: - func = outCubic; - break; - case eType.inOutCubic: - func = inOutCubic; - break; - case eType.inQuart: - func = inQuart; - break; - case eType.outQuart: - func = outQuart; - break; - case eType.inOutQuart: - func = inOutQuart; - break; - case eType.inSine: - func = inSine; - break; - case eType.outSine: - func = outSine; - break; - case eType.inOutSine: - func = inOutSine; - break; - case eType.inExpo: - func = inExpo; - break; - case eType.outExpo: - func = outExpo; - break; - case eType.inOutExpo: - func = inOutExpo; - break; - case eType.inCirc: - func = inCirc; - break; - case eType.outCirc: - func = outCirc; - break; - case eType.inOutCirc: - func = inOutCirc; - break; - case eType.inElastic: - func = inElastic; - break; - case eType.outElastic: - func = outElastic; - break; - case eType.inOutElastic: - func = inOutElastic; - break; - case eType.inBack: - func = inBack; - break; - case eType.outBack: - func = outBack; - break; - case eType.inOutBack: - func = inOutBack; - break; - case eType.inBounce: - func = inBounce; - break; - case eType.outBounce: - func = outBounce; - break; - case eType.inOutBounce: - func = inOutBounce; - break; - } - beginVal = beginValue; - endVal = endValue; - duration = durationTime; - curTime = 0f; - changeVal = endValue - beginValue; - IsMoving = true; - } - - public float GetCurVal(float deltaTime, bool canOver = false) - { - curTime += deltaTime; - if (curTime >= duration && !canOver) - { - IsMoving = false; - return endVal; - } - return func(curTime) + beginVal; - } - - private float linear(float t) - { - return changeVal * t / duration; - } - - private float inQuad(float t) - { - float num = t / duration; - return changeVal * num * num; - } - - private float outQuad(float t) - { - float num = t / duration; - return (0f - changeVal) * num * (num - 2f); - } - - private float inOutQuad(float t) - { - float num = t * 2f / duration; - if (num < 1f) - { - return changeVal / 2f * num * num; - } - return (0f - changeVal) / 2f * ((num - 1f) * (num - 3f) - 1f); - } - - private float inCubic(float t) - { - float num = t / duration; - return changeVal * num * num * num; - } - - private float outCubic(float t) - { - float num = t / duration - 1f; - return changeVal * (num * num * num + 1f); - } - - private float inOutCubic(float t) - { - float num = t * 2f / duration; - if (num < 1f) - { - return changeVal / 2f * num * num * num; - } - num -= 2f; - return changeVal / 2f * (num * num * num + 2f); - } - - private float inQuart(float t) - { - float num = t / duration; - return changeVal * num * num * num * num; - } - - private float outQuart(float t) - { - float num = t / duration - 1f; - return (0f - changeVal) * (num * num * num * num - 1f); - } - - private float inOutQuart(float t) - { - float num = t * 2f / duration; - if (num < 1f) - { - return changeVal / 2f * num * num * num * num; - } - num -= 2f; - return (0f - changeVal) / 2f * (num * num * num * num - 2f); - } - - private float inSine(float t) - { - return (0f - changeVal) * (float)Math.Cos((double)(t / duration) * (Math.PI / 2.0)) + changeVal; - } - - private float outSine(float t) - { - return changeVal * (float)Math.Sin((double)(t / duration) * (Math.PI / 2.0)); - } - - private float inOutSine(float t) - { - return (0f - changeVal) / 2f * ((float)Math.Cos((double)(t / duration) * Math.PI) - 1f); - } - - private float inExpo(float t) - { - if (t == 0f) - { - return 0f; - } - return changeVal * (float)Math.Pow(2.0, 10f * (t / duration - 1f)); - } - - private float outExpo(float t) - { - return changeVal * (0f - (float)Math.Pow(2.0, -10f * t / duration) + 1f); - } - - private float inOutExpo(float t) - { - if (t == 0f) - { - return 0f; - } - float num = t * 2f / duration; - if (num < 1f) - { - return changeVal / 2f * (float)Math.Pow(2.0, 10f * (num - 1f)); - } - return changeVal / 2f * (0f - (float)Math.Pow(2.0, -10f * (num - 1f)) + 2f); - } - - private float inCirc(float t) - { - float num = t / duration; - return (0f - changeVal) * ((float)Math.Sqrt(1f - num * num) - 1f); - } - - private float outCirc(float t) - { - float num = t / duration - 1f; - return changeVal * (float)Math.Sqrt(1f - num * num); - } - - private float inOutCirc(float t) - { - float num = t * 2f / duration; - if (num < 1f) - { - return (0f - changeVal) / 2f * ((float)Math.Sqrt(1f - num * num) - 1f); - } - num -= 2f; - return changeVal / 2f * ((float)Math.Sqrt(1f - num * num) + 1f); - } - - private float inElastic(float t) - { - float num = t / duration; - float num2 = 1.70158f; - float num3 = changeVal; - if (num == 0f) - { - return 0f; - } - float num4 = duration * 0.3f; - num2 = ((!(num3 < Math.Abs(changeVal))) ? (num4 / ((float)Math.PI * 2f) * (float)Math.Asin(changeVal / num3)) : (num4 / 4f)); - num -= 1f; - return 0f - num3 * (float)Math.Pow(2.0, 10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f) / num4); - } - - private float outElastic(float t) - { - float num = t / duration; - float num2 = 1.70158f; - float num3 = changeVal; - if (num == 0f) - { - return 0f; - } - float num4 = duration * 0.3f; - num2 = ((!(num3 < Math.Abs(changeVal))) ? (num4 / ((float)Math.PI * 2f) * (float)Math.Asin(changeVal / num3)) : (num4 / 4f)); - return num3 * (float)Math.Pow(2.0, -10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f) / num4) + changeVal; - } - - private float inOutElastic(float t) - { - float num = t * 2f / duration; - float num2 = 1.70158f; - float num3 = changeVal; - if (num == 0f) - { - return 0f; - } - float num4 = duration * 0.45f; - num2 = ((!(num3 < Math.Abs(changeVal))) ? (num4 / ((float)Math.PI * 2f) * (float)Math.Asin(changeVal / num3)) : (num4 / 4f)); - if (num < 1f) - { - num -= 1f; - return -0.5f * (num3 * (float)Math.Pow(2.0, 10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f) / num4)); - } - num -= 1f; - return num3 * (float)Math.Pow(2.0, -10f * num) * (float)Math.Sin((num * duration - num2) * ((float)Math.PI * 2f / num4)) * 0.5f + changeVal; - } - - private float inBack(float t) - { - float num = t / duration; - float num2 = 1.70158f; - return changeVal * num * num * ((num2 + 1f) * num - num2); - } - - private float outBack(float t) - { - float num = t / duration - 1f; - float num2 = 1.70158f; - return changeVal * (num * num * ((num2 + 1f) * num + num2) + 1f); - } - - private float inOutBack(float t) - { - float num = t * 2f / duration; - float num2 = 2.5949094f; - if (num < 1f) - { - return changeVal / 2f * num * num * ((num2 + 1f) * num - num2); - } - num -= 2f; - return changeVal / 2f * (num * num * ((num2 + 1f) * num + num2) + 2f); - } - - private float inBounce(float t) - { - return changeVal - outBounce(duration - t); - } - - private float outBounce(float t) - { - float num = t / duration; - if (num < 0.36363637f) - { - return changeVal * (7.5625f * num * num); - } - if (num < 0.72727275f) - { - num -= 0.54545456f; - return changeVal * (7.5625f * num * num + 0.75f); - } - if (num < 0.90909094f) - { - num -= 0.8181818f; - return changeVal * (7.5625f * num * num + 0.9375f); - } - num -= 21f / 22f; - return changeVal * (7.5625f * num * num + 63f / 64f); - } - - private float inOutBounce(float t) - { - if (t * 2f < duration) - { - return inBounce(t * 2f) * 0.5f; - } - return 0.5f * outBounce(t * 2f - duration) + changeVal * 0.5f; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/DamagedTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/DamagedTagCollection.cs index 46fbf6c8..3a42150f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DamagedTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DamagedTagCollection.cs @@ -32,18 +32,6 @@ public class DamagedTagCollection : TagCollection } } - public bool HasDamagedToken - { - get - { - if (_damagedTokenList != null) - { - return _damagedTokenList.Count > 0; - } - return false; - } - } - public DamagedTagCollection() : base(TagCollectionType.WhenDamaged) { diff --git a/SVSim.BattleEngine/Engine/Wizard/Data.cs b/SVSim.BattleEngine/Engine/Wizard/Data.cs index 6483d562..95f1581d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Data.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Data.cs @@ -13,6 +13,10 @@ using Wizard.Scripts.Network.Data.TaskData.Ranking; using Wizard.Scripts.Network.Data.TaskData.SkinPurchase; using Wizard.Scripts.Network.Data.TaskData.SleevePurchase; using Wizard.Story; +// TODO(engine-cleanup-pass2): 156 of 165 methods unrun in baseline +// Type: Wizard.Data +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -20,32 +24,12 @@ public static class Data { private static Format _currentFormat; - public const int SERVER_FORMAT_NONE = 0; - - public const int SERVER_FORMAT_ROTATION = 1; - - public const int SERVER_FORMAT_UNLIMITED = 2; - - public const int SERVER_FORMAT_PRE_ROTATION = 3; - - public const int SERVER_FORMAT_CROSSOVER = 4; - - public const int SERVER_FORMAT_TWO_PICK = 10; - - public const int SERVER_FORMAT_SEALED = 20; - - public const int SERVER_FORMAT_HOF = 31; - - public const int SERVER_FORMAT_WIND_FALL = 33; - public static Master Master { get; set; } public static Mastershop ShopMaster { get; set; } public static SystemText SystemText { get; set; } - public static EncryptData EncryptData { get; set; } - public static Load Load { get; set; } public static MyPage MyPage { get; set; } @@ -66,12 +50,6 @@ public static class Data public static AIBattleStartData AIBattleStartData { get; set; } - public static RoomMatchFinish RoomMatchFinish { get; set; } - - public static string LastRoomBattleId { get; set; } - - public static RoomBattleMatching RoomBattleMatching { get; set; } - public static SelectedStoryInfo SelectedStoryInfo { get; set; } public static StoryWorldDataManager StoryWorldDataManager { get; set; } @@ -166,8 +144,6 @@ public static class Data public static GenerateDeckCode GenerateDeckCode { get; set; } - public static GetDeckDataFromCode DeckDataFromDeckCode { get; set; } - public static InviteFriendBattle InviteFriendBattle { get; set; } public static InitializeRoomBattle InitializeRoomBattle { get; set; } @@ -178,14 +154,13 @@ public static class Data public static BattleRecoveryInfo BattleRecoveryInfo { - // Soft read: returns null when no scope is active. The MulliganMgrBase.StartDeal call site - // reads this with a null-tolerant ??=-style pattern, so a null degrade is the historical - // fallback. Inside a scope, returns the per-session RecoveryInfo (SessionBattleEngine - // pre-seeds an uninitialized BattleRecoveryInfo on its ctx field initializer). - get => SVSim.BattleEngine.Ambient.BattleAmbient.Current?.RecoveryInfo; - // Strict setter: writes must land on the per-session ctx. No historical production caller - // writes this outside a scope; an unwrapped write now fails fast (forcing function). - set => SVSim.BattleEngine.Ambient.BattleAmbient.Require().RecoveryInfo = value; + // Instance-backed via BattleManagerBase.InstanceRecoveryInfo (Phase 5, chunk 40 — ambient + // fallback dropped after chunk 39 converted the last direct consumer). + get => BattleManagerBase.GetIns()?.InstanceRecoveryInfo; + set { + var m = BattleManagerBase.GetIns(); + if (m is not null) m.InstanceRecoveryInfo = value; + } } public static VoteData VoteInfo { get; set; } @@ -223,78 +198,6 @@ public static class Data public static bool IsBattlePassPeriod { get; private set; } - public static void Initialize() - { - Master = new Master(); - ShopMaster = new Mastershop(); - SystemText = new SystemText(); - Load = new Load(); - MyPage = new MyPage(); - MyPageNotifications = new MyPageNotifications(); - RankMatchFinish = new RankMatchFinish(); - FreeMatchFinish = new FreeMatchFinish(); - DoMatchingDetail = new DoMatchingData(); - AIBattleStartData = new AIBattleStartData(); - ColosseumBattleFinish = new ColosseumBattleFinish(); - CompetitionBattleFinish = new CompetitionBattleFinish(); - RoomMatchFinish = new RoomMatchFinish(); - RoomBattleMatching = new RoomBattleMatching(); - SelectedStoryInfo = null; - StoryWorldDataManager = new StoryWorldDataManager(); - StoryInfo = new StoryInfo(); - StoryFinish = new StoryFinish(); - StoryLeaderSelect = new StoryLeaderSelect(); - QuestMissionInfo = new QuestMissionInfo(); - QuestFinish = new QuestFinish(); - ArenaData = new ArenaData(); - MailTop = new MailTop(); - ReadMail = new ReadMail(); - PackInfo = new PackInfo(); - PackOpen = new PackOpen(); - SleevePurchaseInfo = new SleevePurchaseInfo(); - SkinPurchaseInfo = new SkinPurchaseInfo(); - BuildDeckPurchaseInfo = new BuildDeckPurchaseInfo(); - ItemPurchaseInfo = new ItemPurchaseInfo(); - EmptyDeckInfo = new EmptyDeckInfo(); - FriendInfo = new FriendInfo(); - PlayedTogetherInfo = new PlayedTogetherInfo(); - ReceiveFriendApplyInfo = new ReceiveFriendApplyInfo(); - SendFriendApplyInfo = new SendFriendApplyInfo(); - User = new User(); - UserConfig = new UserConfig(); - UserTutorial = new UserTutorial(); - MissionInfo = new MissionInfo(); - AchievementInfo = new AchievementInfo(); - EmblemInfo = new EmblemInfo(); - DegreeInfo = new DegreeInfo(); - SearchUserInfo = new SearchUserInfo(); - RankingRankMatchClassInfo = new Dictionary(); - RankingMasterInfo = new Dictionary(); - RankingMasterMyHistories = new Dictionary(); - TwoPickInfo = new TwoPickInfo(); - TwoPickEntry = new Entry(); - TwoPickDoMatching = new DoMatchingResponse(); - ArenaBattleFinish = new Finish(); - RoomTwoPickInfo = new RoomTwoPickInfo(); - RoomTwoPickBeforeBattleInfo = new RoomTwoPickBeforeBattleInfo(); - RoomTwoPickMultiDeckInfo = new RoomTwoPickMultiDeckInfo(); - PracticeDataMgr = new PracticeDataMgr(null); - PracticeFinish = new PracticeFinish(); - PracticePuzzleFinishData = new PracticePuzzleFinishData(); - ItemAcquireHistoryInfo = new ItemAcquireHistoryInfo(); - GenerateDeckCode = new GenerateDeckCode(); - DeckDataFromDeckCode = new GetDeckDataFromCode(); - InviteFriendBattle = new InviteFriendBattle(); - InitializeRoomBattle = new InitializeRoomBattle(); - ReplayInfo = new ReplayInfo(); - CurrentFormat = Format.Max; - MaintenanceCodeList = null; - DeckGroupDataBase = new List(); - Crossover = new Crossover(); - MyRotationAllInfo = new MyRotationAllInfo(); - TreasureBoxCp = new TreasureBoxCp(); - } - public static void Clear() { Master = null; @@ -430,15 +333,6 @@ public static class Data } } - public static void ParseMaintenance(JsonData mentenanceList) - { - MaintenanceCodeList = new List(); - for (int i = 0; i < mentenanceList.Count; i++) - { - MaintenanceCodeList.Add((NetworkDefine.MAINTENANCE_TYPE)mentenanceList[i].ToInt()); - } - } - public static void UpdateMaintenance(List checkList, List maintenanceList) { for (int i = 0; i < checkList.Count; i++) @@ -450,9 +344,4 @@ public static class Data } } } - - public static void ParseIsBattlePassPeriod(JsonData data) - { - IsBattlePassPeriod = data["is_battle_pass_period"].ToBoolean(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckAttributeType.cs b/SVSim.BattleEngine/Engine/Wizard/DeckAttributeType.cs index fcd6fbdd..cac61937 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckAttributeType.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckAttributeType.cs @@ -8,6 +8,4 @@ public enum DeckAttributeType TrialDeck, DefaultDeck, SampleDeck, - QuestSecretBoss, - Other -} + QuestSecretBoss} diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckBuildShortageCardView.cs b/SVSim.BattleEngine/Engine/Wizard/DeckBuildShortageCardView.cs index 346f7bee..1afa8a34 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckBuildShortageCardView.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckBuildShortageCardView.cs @@ -65,7 +65,7 @@ public class DeckBuildShortageCardView : MonoBehaviour } foreach (KeyValuePair item in dictionary) { - bool flag = GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(item.Key); + bool flag = false; // Pre-Phase-5b: no maintenance list headless if (!CardMaster.GetInstance(_cardMasterId).GetCardParameterFromId(item.Key).IsNotCraftDestruct && !flag) { _dictCreateCardIdNum.Add(item.Key, item.Value); diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckConventionUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/DeckConventionUpdateTask.cs index 791a1f97..65255835 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckConventionUpdateTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckConventionUpdateTask.cs @@ -52,14 +52,8 @@ public class DeckConventionUpdateTask : BaseTask public int[] card_id_array; } - private const int IS_DECK_DELETE_OFF = 0; - - private const int IS_DECK_DELETE_ON = 1; - private ConventionDeckList _deckList; - public AchievedInfo AchievedInfo { get; private set; } - public DeckConventionUpdateTask() { base.type = ApiType.Type.DeckUpdateConvention; diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckCopyDialog.cs b/SVSim.BattleEngine/Engine/Wizard/DeckCopyDialog.cs deleted file mode 100644 index f6e7da20..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/DeckCopyDialog.cs +++ /dev/null @@ -1,122 +0,0 @@ -using UnityEngine; -using Wizard.DeckCardEdit; -using Wizard.Dialog.Setting; - -namespace Wizard; - -public class DeckCopyDialog : MonoBehaviour -{ - [SerializeField] - private UILabel _textLabel; - - [SerializeField] - private ItemToggle _sleeveAndLeaderSkinRootItemToggle; - - [SerializeField] - private ItemToggle _subClassOptionRootItemToggle; - - [SerializeField] - private ItemToggle _foilPreferredItemToggle; - - [SerializeField] - private ItemToggle _prizePreferredItemToggle; - - [SerializeField] - private ClassInfoParts _selectClassInfo; - - [SerializeField] - private CenteringUIWidget _centeringUIWidget; - - [SerializeField] - private FlexibleGrid _flexibleGrid; - - private void Start() - { - if (_sleeveAndLeaderSkinRootItemToggle != null) - { - _sleeveAndLeaderSkinRootItemToggle.SetTitleLabel(Data.SystemText.Get("Card_0181")); - _sleeveAndLeaderSkinRootItemToggle.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SLEEVE_AND_SKIN)); - _sleeveAndLeaderSkinRootItemToggle.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_COPY_SLEEVE_AND_SKIN, _sleeveAndLeaderSkinRootItemToggle.GetValue()); - }); - } - if (_subClassOptionRootItemToggle != null) - { - _subClassOptionRootItemToggle.SetTitleLabel("Card_0281"); - _subClassOptionRootItemToggle.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS)); - _subClassOptionRootItemToggle.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS, _subClassOptionRootItemToggle.GetValue()); - }); - } - if (_foilPreferredItemToggle != null) - { - _foilPreferredItemToggle.SetValue(Data.Load.data._userConfig.IsFoilPreferred); - _foilPreferredItemToggle.AddChangeCallback(delegate - { - DeckCardEditUI.SendConfigUpdateFoilPreferred(_foilPreferredItemToggle.GetValue()); - }); - } - if (_prizePreferredItemToggle != null) - { - _prizePreferredItemToggle.SetValue(Data.Load.data._userConfig.IsPrizePreferred); - _prizePreferredItemToggle.AddChangeCallback(delegate - { - DeckCardEditUI.SendConfigUpdatePrizePreferred(_prizePreferredItemToggle.GetValue()); - }); - } - } - - private void SetText(string text) - { - _textLabel.text = text; - } - - private void SetClassesIconAndName(DeckData scrDeck) - { - if (!(_selectClassInfo == null) && !(_flexibleGrid == null) && !(_centeringUIWidget == null)) - { - int skinId = scrDeck.GetSkinId(); - _selectClassInfo.InitBySkinId(skinId); - _selectClassInfo.SetSubClass((CardBasePrm.ClanType)scrDeck.GetDeckSubClassID()); - _flexibleGrid.Reposition(); - _centeringUIWidget.Reposition(); - StartCoroutine(_flexibleGrid.RepositionNextFrame()); - } - } - - private static DialogBase CreateDialog(DeckCopyDialog dialogParts, DeckData srcDeck) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogParts.SetText(systemText.Get("Card_0112", srcDeck.GetDeckName())); - dialogBase.SetTitleLabel(systemText.Get("Card_0121")); - dialogBase.SetObj(dialogParts.gameObject); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Card_0122")); - return dialogBase; - } - - public static DialogBase CreateDeckCopyDialog(DeckCopyDialog deckCopyDialogPrefab, DeckData srcDeck) - { - return CreateDialog(Object.Instantiate(deckCopyDialogPrefab.gameObject).GetComponent(), srcDeck); - } - - public static DialogBase CreateDeckCopyDialogForMyRotation(DeckCopyDialog deckCopyDialogPrefab, DeckData srcDeck) - { - DeckCopyDialog component = Object.Instantiate(deckCopyDialogPrefab.gameObject).GetComponent(); - DialogBase result = CreateDialog(component, srcDeck); - component.SetText(Data.SystemText.Get("MyRotation_ID_06", srcDeck.GetDeckName())); - return result; - } - - public static DialogBase CreateDeckCopyDialogUseSubClass(DeckCopyDialog useSubClassDeckCopyDialogPrefab, DeckData srcDeck) - { - DeckCopyDialog component = Object.Instantiate(useSubClassDeckCopyDialogPrefab.gameObject).GetComponent(); - DialogBase dialogBase = CreateDialog(component, srcDeck); - component.SetClassesIconAndName(srcDeck); - dialogBase.SetSize(DialogBase.Size.M); - return dialogBase; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckDetailDialog.cs b/SVSim.BattleEngine/Engine/Wizard/DeckDetailDialog.cs index 487075de..f7e41288 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckDetailDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckDetailDialog.cs @@ -18,8 +18,6 @@ public class DeckDetailDialog : MonoBehaviour Gathering } - private const int CHARACTER_NAME_SMALL_SIZE = 31; - [SerializeField] private UILabel _deckNameLabel; @@ -59,22 +57,6 @@ public class DeckDetailDialog : MonoBehaviour [SerializeField] private FlexibleGrid _classDisplayGrid; - private const int DECKNAME_EDIT_DIALOG_DEPTH = 400; - - private const int DECKCODE_COPY_DIALOG_DEPTH = 400; - - private const int SKIN_SELECTION_DIALOG_DEPTH = 400; - - private const int SLEEVE_SELECTION_DIALOG_DEPTH = 400; - - private const int SKIN_RANDOM_SELECT_DIALOG_DEPTH = 600; - - private const long INVALID_SLEEVE_ID = -1L; - - private const string SKIN_SELECTED_RANDOM_KEY = "skin_random"; - - private const int CLASS_DISPLAY_WIDTH_MAX = 375; - private Action _onDeckUpdateSuccess; private DeckData _deck; @@ -121,12 +103,6 @@ public class DeckDetailDialog : MonoBehaviour InitializeCommon(deck, taskType, onDeckUpdateSuccess, loadedVoiceList, conventionDeckList); } - public void InitializeForGathering(DeckData deck, bool IsEntryDeckOnly, Action onDeckUpdateSuccess, List loadedVoiceList) - { - eTaskType taskType = (IsEntryDeckOnly ? eTaskType.Gathering : eTaskType.Normal); - InitializeCommon(deck, taskType, onDeckUpdateSuccess, loadedVoiceList, null); - } - private void InitializeCommon(DeckData deck, eTaskType taskType, Action onDeckUpdateSuccess, List loadedVoiceList, ConventionDeckList conventionDeckList) { _deck = deck; @@ -304,7 +280,7 @@ public class DeckDetailDialog : MonoBehaviour private void OnClickDeckNameEditButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + string oldDeckName = _deck.GetDeckName(); SystemText systemText = Data.SystemText; DialogBase dialogBase = InputDialog.Create(30, 24); @@ -350,7 +326,7 @@ public class DeckDetailDialog : MonoBehaviour private void OnClickDeckCodeCreateButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + GenerateDeckCodeTask generateDeckCodeTask = new GenerateDeckCodeTask(); SetGenerateDeckCodeTask(generateDeckCodeTask); StartCoroutine(Toolbox.NetworkManager.Connect(generateDeckCodeTask, OnSuccessCreateDeckCode, null, null, encrypt: false)); @@ -392,7 +368,7 @@ public class DeckDetailDialog : MonoBehaviour private void OnClickSkinChangeButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + StartCoroutine(OpenSkinSelectionDialog()); } @@ -459,8 +435,7 @@ public class DeckDetailDialog : MonoBehaviour if (_selectRandomSkinIdList.Contains(0)) { _selectRandomSkinIdList.Remove(0); - _selectRandomSkinIdList.Add(GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(_deck.GetDeckClassID()) - .skin_id); + // Pre-Phase-5b: chara master lookup dropped; headless has no default skin to add _selectRandomSkinIdList.Sort(); } _skinSelection.AddItem("skin_random", null, isSelectable: true, null, null, null, isDisplaySprite: true, string.Empty, new string[2] @@ -515,23 +490,18 @@ public class DeckDetailDialog : MonoBehaviour UpdateSkin(); DeckCardEditUI.CurrentDeckData = _deck; StopVoice(); - GameMgr.GetIns().GetSoundMgr().PlayVoice(ClassCharaPrm.EmotionType.LEADER_SELECT, _deck.GetSkinId(), _loadedVoiceCueSheetList); + } private void StopVoice() { - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - if (soundMgr.IsVoicePlaying()) - { - soundMgr.StopVoiceAll(0f); - } } private void UpdateSkin() { int currentSkinId = _currentSkinId; int newSkinId = _deck.GetSkinId(); - GameMgr.GetIns().GetDataMgr().GetClassPrm(_deck.GetDeckClassID()); + /* Pre-Phase-5b: class prm read dropped */ _skinRandomIcon.gameObject.SetActive(_deck.IsVisibleRandomIcon()); if (newSkinId != currentSkinId) { @@ -562,7 +532,7 @@ public class DeckDetailDialog : MonoBehaviour private void OnClickSleeveChangeButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + UIManager.GetInstance().createInSceneCenterLoading(); OpenSleeveSelectionDialog(); } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckGroupListData.cs b/SVSim.BattleEngine/Engine/Wizard/DeckGroupListData.cs index dbf83a67..f9444be6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckGroupListData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckGroupListData.cs @@ -35,11 +35,6 @@ public class DeckGroupListData VisiblePreRotation = Prerelease.Status == Prerelease.eStatus.PRE_ROTATION; } - public void ForceVisiblePreRotation(bool isVisible) - { - VisiblePreRotation = isVisible; - } - public List SelectDeckGroupList(Format format) { List list = new List(); @@ -65,30 +60,6 @@ public class DeckGroupListData return list; } - public void RemoveUseSubClassDeckList() - { - DeckGroupList = DeckGroupList.Where((DeckGroup deckGroup) => !FormatBehaviorManager.GetDefaultBehaviour(deckGroup.DeckFormat).UseSubClass).ToList(); - } - - public void RemoveFormat(Format format) - { - DeckGroupList = DeckGroupList.Where((DeckGroup deckGroup) => deckGroup.DeckFormat != format).ToList(); - } - - public bool IsDeckListByAttributeEmpty(DeckAttributeType deckAttributeType, Format format = Format.All) - { - List deckListByAttribute = GetDeckListByAttribute(deckAttributeType, format); - if (deckListByAttribute == null) - { - return true; - } - if (deckListByAttribute.Count == 0) - { - return true; - } - return false; - } - public List GetDeckListByAttribute(DeckAttributeType deckAttributeType, Format format = Format.All) { return (from deck in GetDeckListByFormat(format) diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/DeckInfoTask.cs index 4d7b9f6d..7ec54533 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckInfoTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckInfoTask.cs @@ -10,8 +10,6 @@ public class DeckInfoTask : BaseTask public class DeckInfoTaskParamForCopySrcGet : BaseParam { public int deck_format; - - public int create_deck_format; } private Format _format; @@ -38,15 +36,6 @@ public class DeckInfoTask : BaseTask _format = format; } - public void SetParameterForCopySrcGet(Format format, Format copyTargetFormat) - { - DeckInfoTaskParamForCopySrcGet deckInfoTaskParamForCopySrcGet = new DeckInfoTaskParamForCopySrcGet(); - deckInfoTaskParamForCopySrcGet.deck_format = Data.FormatConvertApi(format); - deckInfoTaskParamForCopySrcGet.create_deck_format = Data.FormatConvertApi(copyTargetFormat); - base.Params = deckInfoTaskParamForCopySrcGet; - _format = format; - } - protected override int Parse() { int num = base.Parse(); @@ -54,9 +43,9 @@ public class DeckInfoTask : BaseTask { return num; } - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); + /* Pre-Phase-5b: DataMgr.SetMaintenanceCardIds dropped */ DeckGroupListData = new DeckGroupListData(base.ResponseData["data"], _format); - GameMgr.GetIns().GetDataMgr().CurrentDeckListParamData = DeckGroupListData; + /* Pre-Phase-5b: DataMgr.CurrentDeckListParamData write dropped */ return num; } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckListUI.cs b/SVSim.BattleEngine/Engine/Wizard/DeckListUI.cs index 58812072..4fc3b031 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckListUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckListUI.cs @@ -11,11 +11,6 @@ namespace Wizard; public class DeckListUI : UIBase { - public const int DECK_DETAIL_DIALOG_DEPTH = 100; - - private const int TOP_BAR_WIDTH = 420; - - private const int TOP_BAR_WIDTH_CONVENTION = 400; [SerializeField] private DeckListMenuUI _deckListMenuPrefab; @@ -46,8 +41,6 @@ public class DeckListUI : UIBase private DeckData _deleteDefaultSelectDeck; - public Action OnGetConventionDeckList; - private ConventionDeckList _conventionDeckList; private DeckGroup _deckGroup; @@ -218,7 +211,7 @@ public class DeckListUI : UIBase _deckListMenu.OnSelectDeck -= OnSelectDeck; if (_loadedVoiceList.Count > 0) { - GameMgr.GetIns().GetSoundMgr().StopVoiceAll(0f); + Toolbox.ResourcesManager.RemoveAssetGroup(_loadedVoiceList); _loadedVoiceList.Clear(); } @@ -431,7 +424,7 @@ public class DeckListUI : UIBase dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_RedBtn_GrayBtn); dialog.SetButtonText(text.Get("Card_0007"), text.Get("Card_0008"), text.Get("Card_0083")); dialog.SetButtonDisable(isEnableOK: true, isEnableCancel: true); - dialog.ClickSe_Btn3 = Se.TYPE.SYS_BTN_DECIDE; + dialog.ClickSe_Btn3 = 0; dialog.onPushButton3 = action; return; } @@ -442,7 +435,7 @@ public class DeckListUI : UIBase dialog.SetButtonText(text.Get("Card_0007"), text.Get("Card_0008"), text.Get("Card_0083")); dialog.onPushButton1 = onPushButton; dialog.onPushButton2 = onPushButton2; - dialog.ClickSe_Btn3 = Se.TYPE.SYS_BTN_DECIDE; + dialog.ClickSe_Btn3 = 0; dialog.onPushButton3 = action; break; case DeckListMenuUI.eEditState.DeleteOnly: @@ -450,13 +443,13 @@ public class DeckListUI : UIBase dialog.SetButtonText(text.Get("Card_0007"), text.Get("Card_0008"), text.Get("Card_0083")); dialog.SetButtonDisable(isEnableOK: true); dialog.onPushButton2 = onPushButton2; - dialog.ClickSe_Btn3 = Se.TYPE.SYS_BTN_DECIDE; + dialog.ClickSe_Btn3 = 0; dialog.onPushButton3 = action; break; case DeckListMenuUI.eEditState.Lock: dialog.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); dialog.SetButtonText(text.Get("Card_0083")); - dialog.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE; + dialog.ClickSe_Btn1 = 0; dialog.onPushButton1 = action; break; } @@ -547,11 +540,7 @@ public class DeckListUI : UIBase _deckPreview.Init(null, _cardDetail, deckName, HideDeckViewer, "Detail", in_DetailCameraUse: true, (CardBasePrm.ClanType)deck.GetDeckClassID(), 40); _deckPreview.SetShareButtonUse(isUse: true); _deckPreview.SetDeck(deck, _conventionDeckList); - if (QRCodeUtility.IsShowQRCode(_deckPreview, _formatBehavior, deck.Format)) - { - _deckPreview.SetQRSmallTexture(); - } - else if (_formatBehavior.CanShowQRCode) + if (_formatBehavior.CanShowQRCode) { _deckPreview.SetQRCodeButtonToGray(); } @@ -574,7 +563,7 @@ public class DeckListUI : UIBase private void OnLongPressMultiDeckDelete(DeckData deck) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ShowDeckViewer(deck); _deckListMenu.EnableDrag = false; } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckListUtility.cs b/SVSim.BattleEngine/Engine/Wizard/DeckListUtility.cs index acf18448..75b9c0cb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckListUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckListUtility.cs @@ -104,25 +104,6 @@ public static class DeckListUtility return list; } - public static void SetDeckListDataWithLodeIndex() - { - LoadDetail data = Data.Load.data; - DeckListUpdate(CreateDeckGroup(data.UserDeckListUnlimited, Format.Unlimited, DeckAttributeType.CustomDeck)); - DeckListUpdate(CreateDeckGroup(data.UserDeckListRotation, Format.Rotation, DeckAttributeType.CustomDeck)); - if (data.UserDeckListPreRotation != null) - { - DeckListUpdate(CreateDeckGroup(data.UserDeckListPreRotation, Format.PreRotation, DeckAttributeType.CustomDeck)); - } - if (data.UserDeckListCrossover != null) - { - DeckListUpdate(CreateDeckGroup(data.UserDeckListCrossover, Format.Crossover, DeckAttributeType.CustomDeck)); - } - if (data.UserDeckListMyRotation != null) - { - DeckListUpdate(CreateDeckGroup(data.UserDeckListMyRotation, Format.MyRotation, DeckAttributeType.CustomDeck)); - } - } - private static void DeckListUpdate(DeckGroup receiveDeckGroup) { DeckGroup deckGroup = DeckGroupDataBase.FirstOrDefault((DeckGroup d) => d.DeckFormat == receiveDeckGroup.DeckFormat && d.AttributeType == receiveDeckGroup.AttributeType); @@ -196,7 +177,7 @@ public static class DeckListUtility public static void DataMgrSaveLastSelectDeckData(DeckData deckData) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr dataMgr.SetSelectDeckId(deckData.GetDeckID()); dataMgr.SetPlayerCharaIdBySkinId(deckData.GetSkinId()); dataMgr.SetCurrentDeckData(deckData.GetCardIdList()); @@ -267,42 +248,11 @@ public static class DeckListUtility } } - public static List ConvertSkinOverrideDeckGroupList(List deckGroupList, Dictionary dictDeckSkinIdOverride) - { - List list = new List(); - foreach (DeckGroup deckGroup in deckGroupList) - { - List list2 = new List(); - foreach (DeckData deckData in deckGroup.DeckDataList) - { - list2.Add(CopyAndReplaceDeckSkinOverride(deckData, dictDeckSkinIdOverride)); - } - list.Add(new DeckGroup(list2, deckGroup.DeckFormat, deckGroup.AttributeType)); - } - return list; - } - - private static DeckData CopyAndReplaceDeckSkinOverride(DeckData deck, Dictionary dictDeckSkinIdOverride) - { - DeckData deckData = deck.Clone(); - if (deckData.IsNoCard()) - { - return deckData; - } - int deckClassID = deckData.GetDeckClassID(); - if (dictDeckSkinIdOverride.TryGetValue(deckClassID, out var value)) - { - deckData.SetSkinId(value); - } - deckData.IsReplaceDeckSkin = true; - return deckData; - } - private static void SetLeaderSkinSetting(JsonData jsonData) { for (int i = 0; i < jsonData.Count; i++) { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr int classId = jsonData[i]["class_id"].ToInt(); ClassCharaPrm classPrm = dataMgr.GetClassPrm(classId); classPrm.IsRandomLeaderSkin = jsonData[i]["is_random_leader_skin"].ToBoolean(); @@ -311,19 +261,4 @@ public static class DeckListUtility classPrm.SetCurrentCharaId(charaPrmBySkinId.chara_id); } } - - public static List StoryDeckSelectClass(List deckGroups, int classId) - { - List list = new List(); - foreach (DeckGroup deckGroup in deckGroups) - { - List list2 = deckGroup.DeckDataList; - if (deckGroup.AttributeType == DeckAttributeType.BuildDeck || deckGroup.AttributeType == DeckAttributeType.TrialDeck) - { - list2 = list2.Where((DeckData d) => d.GetDeckClassID() == classId || d.IsNoCard()).ToList(); - } - list.Add(new DeckGroup(list2, deckGroup.DeckFormat, deckGroup.AttributeType)); - } - return list; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckMyListTask.cs b/SVSim.BattleEngine/Engine/Wizard/DeckMyListTask.cs index 2b0b1ae8..0bf499d5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckMyListTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckMyListTask.cs @@ -31,9 +31,9 @@ public class DeckMyListTask : BaseTask { return num; } - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); + /* Pre-Phase-5b: DataMgr.SetMaintenanceCardIds dropped */ DeckGroupListData = new DeckGroupListData(base.ResponseData["data"], _format); - GameMgr.GetIns().GetDataMgr().CurrentDeckListParamData = DeckGroupListData; + /* Pre-Phase-5b: DataMgr.CurrentDeckListParamData write dropped */ return num; } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckSelectUI.cs b/SVSim.BattleEngine/Engine/Wizard/DeckSelectUI.cs index 50e8e6ed..e867c75b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckSelectUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckSelectUI.cs @@ -131,14 +131,6 @@ public class DeckSelectUI : MonoBehaviour } } - private const int MAXNUM_DECK_PER_TABLE = 9; - - private const float DRAG_DEGREE = 70f; - - private const float PAGE_INTERVAL = 1400f; - - private const float MOVE_PAGE_DURATION = 0.2f; - private static readonly Vector3 VIEW_PAGE_POSITION = Vector3.zero; private static readonly Vector3 OUTSIDE_RIGHT_PAGE_POSITION = VIEW_PAGE_POSITION + Vector3.right * 1400f; @@ -180,9 +172,6 @@ public class DeckSelectUI : MonoBehaviour [SerializeField] private UIGrid[] _deckTableGrids = new UIGrid[2]; - [SerializeField] - private UIPanel _panel; - [SerializeField] private UIButton _infoButton; @@ -236,7 +225,7 @@ public class DeckSelectUI : MonoBehaviour UIEventListener uIEventListener4 = UIEventListener.Get(_infoButton.gameObject); uIEventListener4.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener4.onClick, (UIEventListener.VoidDelegate)delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + initOptions.OnClickInfoButton.Call(); }); } @@ -274,20 +263,9 @@ public class DeckSelectUI : MonoBehaviour }); } - public void ShowCautionText(string cautionText) - { - _cautionLabel.gameObject.SetActive(cautionText != string.Empty); - _cautionLabel.text = cautionText; - } - - public void UpdateAllDeckUICurrentPage() - { - _deckTables[_deckTableIndex].UpdateDeckViewList(_pageList[_currentPageIndex].DeckViewList, _canUseNonPossessionCard); - } - private void OnClickDeck(DeckUI deckUI) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + OnSelectDeck.Call(deckUI.Deck); } @@ -446,13 +424,7 @@ public class DeckSelectUI : MonoBehaviour { IsPageMoving = false; }); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - private void OnDestroy() - { - _isOnDestroy = true; - DeleteResource(); } private void DeleteResource() @@ -463,9 +435,4 @@ public class DeckSelectUI : MonoBehaviour _resourcePathList.Clear(); } } - - public void SetPanelDepth(int depth) - { - _panel.depth = depth; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialog.cs b/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialog.cs index e6abeedc..94cb7231 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialog.cs @@ -15,12 +15,9 @@ public class DeckSelectUIDialog WithPrerotation, WithCrossover, WithMyRotation, - WithAvatar, UseOtherCategory } - private const string PATH_DECK_LIST_PREFAB = "UI/DeckList/DeckSelectUI/DeckSelectUI"; - private static readonly Vector2 FORMAT_CHANGE_UI_POSITION = new Vector3(-508f, 65f); private DeckSelectUIDialogTitle _deckSelectDialogTitleUI; @@ -178,22 +175,6 @@ public class DeckSelectUIDialog return result; } - public void UpdateAllDeckUICurrentPage() - { - _deckSelectUI.UpdateAllDeckUICurrentPage(); - } - - public void ShowCautionText(string cautionText) - { - _deckSelectUI.ShowCautionText(cautionText); - } - - public void SetPanelDepth(int depth) - { - Dialog.SetPanelDepth(depth); - _deckSelectUI.GetComponent().depth = ++depth; - } - private void CreateFormatChangeUI(FormatChangeUI.FormatCategory defaultFormatCategory, eFormatChangeUIType formatChangeUIType) { if (formatChangeUIType != eFormatChangeUIType.SingleFormat) diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialogTitle.cs b/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialogTitle.cs index 6f233dae..9540d28b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialogTitle.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckSelectUIDialogTitle.cs @@ -5,19 +5,6 @@ namespace Wizard; public class DeckSelectUIDialogTitle : MonoBehaviour { - private const string PATH_DECK_SELECT_UI_DIALOG_TITLE_PREFAB = "UI/DeckList/DeckSelectUI/DeckSelectUIDialogTitle"; - - private const string FORMAT_ICON_ROTATION = "icon_timesliprotation_s"; - - private const string FORMAT_ICON_UNLIMITED = "icon_unlimited_s"; - - private const string FORMAT_ICON_PRE_ROTATION = "icon_prerotation_s"; - - private const string FORMAT_ICON_CROSSOVER = "icon_crossover_s"; - - private const string FORMAT_ICON_MYROTATION = "icon_myrotation_s"; - - private const string FORMAT_ICON_AVATAR = "icon_heroesbattle_s"; private static readonly Color32 FORMAT_COLOR_ROTATION = new Color32(43, 39, 144, byte.MaxValue); diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckUI.cs b/SVSim.BattleEngine/Engine/Wizard/DeckUI.cs index c8959cec..2fe8c2dd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckUI.cs @@ -67,10 +67,6 @@ public class DeckUI : MonoBehaviour private static readonly Color32 DECK_COLOR_DEFAULT = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); - private const float LONG_PRESS_TIME_SECOND = 1f; - - private const float PACK_NAME_LABEL_Y = -1f; - [SerializeField] private UIWidget _rootDeckUIWidget; @@ -316,15 +312,6 @@ public class DeckUI : MonoBehaviour _skinRandomIcon.gameObject.SetActive(isVisible); } - private void Update() - { - if (_isLongPress && Time.realtimeSinceStartup - _pressStartTime > 1f) - { - OnLongPress.Call(this); - ClearLongPress(); - } - } - private void PushedAnimation(bool isStart) { if (isStart) diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckUtil.cs b/SVSim.BattleEngine/Engine/Wizard/DeckUtil.cs index 91e4ff78..02246582 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DeckUtil.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DeckUtil.cs @@ -17,7 +17,7 @@ public class DeckUtil { return Data.SystemText.Get("MyRotation_ID_02", UIUtil.GetMyRotationDefaultDeckClassName(classSet.MainClass), myRotationInfo.LastPackText); } - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr if (useSubClass) { return $"{UIUtil.GetShortClassName(classSet.MainClass)}/{UIUtil.GetShortClassName(classSet.SubClass)}"; diff --git a/SVSim.BattleEngine/Engine/Wizard/DeckViewHelper.cs b/SVSim.BattleEngine/Engine/Wizard/DeckViewHelper.cs deleted file mode 100644 index 6cbc3abc..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/DeckViewHelper.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class DeckViewHelper : MonoBehaviour -{ - [SerializeField] - private GameObject _cardDetailPrefab; - - [SerializeField] - private GameObject _deckViewPrefab; - - private List _loadCardAssetList; - - private UICardList _uiCardList; - - private int _detailLayer; - - private CardDetailUI _cardDetail; - - private bool _isEnableShareButton = true; - - public UICardList UICardList => _uiCardList; - - public void Initialize(string detailLayerName = "Detail") - { - _detailLayer = LayerMask.NameToLayer(detailLayerName); - _cardDetail = UnityEngine.Object.Instantiate(_cardDetailPrefab).GetComponent(); - _cardDetail.transform.parent = base.transform; - _cardDetail.transform.localPosition = Vector3.zero; - _cardDetail.transform.localScale = Vector3.one; - _cardDetail.Initialize(_detailLayer, CardMaster.CardMasterId.Default); - SetEnableFlavorVoiceEvolution(enable: false); - _cardDetail.gameObject.SetActive(value: false); - _uiCardList = UnityEngine.Object.Instantiate(_deckViewPrefab).GetComponent(); - _uiCardList.Init(base.gameObject, _cardDetail, null, CloseDeckView, detailLayerName, in_DetailCameraUse: true, null, 40); - _uiCardList.SetActive(in_Active: false); - } - - public void SetDetailCameraEnable(bool enable) - { - _uiCardList.SetCameraEnable(enable); - } - - public void SetEnableDeckShareButton(bool enable) - { - _uiCardList.SetShareButtonUse(enable); - _isEnableShareButton = enable; - } - - public void SetEnableFlavorVoiceEvolution(bool enable) - { - _cardDetail.IsShowFlavorTextButton = enable; - _cardDetail.IsShowVoiceButton = enable; - _cardDetail.IsShowEvolutionButton = enable; - } - - public void ShowDeckView(DeckData deck) - { - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadDeckCard(deck, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - _uiCardList.SetDeck(deck, null); - _uiCardList.SetShareButtonUse(_isEnableShareButton); - _uiCardList.SetQRSmallTexture(); - StartCoroutine(WaitSingleFrame(delegate - { - _uiCardList.SetActive(in_Active: true); - })); - })); - } - - private IEnumerator WaitSingleFrame(Action onFinish) - { - yield return null; - onFinish.Call(); - } - - private IEnumerator LoadDeckCard(DeckData deck, Action onFinish) - { - IList cardIdList = deck.GetCardIdList(); - _uiCardList.RemoveData(); - _loadCardAssetList = _uiCardList.GetLoadFileList(cardIdList as List); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadCardAssetList, null)); - onFinish(); - } - - private void CloseDeckView() - { - if (_loadCardAssetList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadCardAssetList); - _loadCardAssetList = null; - } - _uiCardList.SetActive(in_Active: false); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/Degree.cs b/SVSim.BattleEngine/Engine/Wizard/Degree.cs index 02541459..e3d8f3d0 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Degree.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Degree.cs @@ -87,19 +87,4 @@ public class Degree IsNew = true; } } - - public void UnsetNew() - { - IsNew = false; - } - - public void SetNew() - { - IsNew = true; - } - - public void SetFavorite(bool favorite) - { - IsFavorite = favorite; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DegreeCategory.cs b/SVSim.BattleEngine/Engine/Wizard/DegreeCategory.cs deleted file mode 100644 index 537e40a0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/DegreeCategory.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class DegreeCategory -{ - public int Id { get; } - - public string Name { get; } - - public DegreeCategory(string[] columns) - { - int num = 0; - Id = int.Parse(columns[num++]); - Name = ConvertToCategoryText(columns[num++]); - } - - private string ConvertToCategoryText(string textId) - { - return Data.Master.GetDegreeCategoryText(textId); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/DegreeHelper.cs b/SVSim.BattleEngine/Engine/Wizard/DegreeHelper.cs index 4dc18b77..aeea3a63 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DegreeHelper.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DegreeHelper.cs @@ -9,9 +9,7 @@ public class DegreeHelper { public enum DegreeType { - SMALL, - MIDDLE - } + SMALL } private static ResourcesManager.AssetLoadPathType GetResourceType(DegreeType type) { @@ -74,14 +72,4 @@ public class DegreeHelper texture.material = null; } } - - public static void LoadInstant(UITexture texture, long id, DegreeType type, Action> onFinish) - { - List path = GetDegreeResourceList(id, type, isFetch: false); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupSync(path, delegate - { - InitializeDegree(texture, id, type); - onFinish(path); - })); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DegreeMgr.cs b/SVSim.BattleEngine/Engine/Wizard/DegreeMgr.cs index 061ff4b2..19e75a50 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DegreeMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DegreeMgr.cs @@ -8,16 +8,6 @@ public class DegreeMgr { private List _list = new List(); - public void Add(Degree degree) - { - _list.Add(degree); - } - - public List GetList() - { - return _list; - } - public bool IsContainsInMaster(int id) { return _list.Find((Degree x) => x._id == id) != null; @@ -51,24 +41,4 @@ public class DegreeMgr { Get(id).Acquired(); } - - public void UnsetNew(int id) - { - Get(id).UnsetNew(); - } - - public void SetNew(int id) - { - Get(id).SetNew(); - } - - public void SetFavorite(int id, bool favorite) - { - Get(id).SetFavorite(favorite); - } - - public IEnumerable GetFavorites() - { - return ((IEnumerable)_list.FindAll((Degree x) => x.IsFavorite)).Select((Func)((Degree x) => x._id)); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/DeleteUserDataTask.cs b/SVSim.BattleEngine/Engine/Wizard/DeleteUserDataTask.cs deleted file mode 100644 index 367db715..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/DeleteUserDataTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Wizard; - -public class DeleteUserDataTask : BaseTask -{ - public DeleteUserDataTask() - { - base.type = ApiType.Type.DeleteUserData; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/DialogCreator.cs b/SVSim.BattleEngine/Engine/Wizard/DialogCreator.cs index 3f0b08c6..c2a17c61 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DialogCreator.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DialogCreator.cs @@ -35,22 +35,6 @@ public static class DialogCreator return dialogBase; } - public static DialogBase CreateSupplyReceiveDialog(List supplyList) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_BuyCard_004_Title")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - RewardBase component = NGUITools.AddChild(dialogBase.gameObject, Resources.Load("UI/layoutParts/StoryRewardPanel")).GetComponent(); - for (int i = 0; i < supplyList.Count; i++) - { - component.AddReward(supplyList[i]); - } - component.EndCreate(); - dialogBase.SetObj(component.gameObject); - return dialogBase; - } - public static CardDetailUI CreateCardDetailDialog(GameObject rootObject, string layerName) { CardDetailUI component = NGUITools.AddChild(rootObject, Resources.Load("UI/CardDetail")).GetComponent(); diff --git a/SVSim.BattleEngine/Engine/Wizard/DialogItemPurchase.cs b/SVSim.BattleEngine/Engine/Wizard/DialogItemPurchase.cs deleted file mode 100644 index 2b5f2099..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/DialogItemPurchase.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class DialogItemPurchase : MonoBehaviour -{ - [SerializeField] - private ItemPurchase itemPurchaseOriginal; - - public void CreateItemPurcahseDialog() - { - ItemPurchase itemPurchase = Object.Instantiate(itemPurchaseOriginal); - itemPurchase.Init(delegate - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.XL); - dialogBase.SetObj(itemPurchase.gameObject); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0128")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - }); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/DrumrollScrollManager.cs b/SVSim.BattleEngine/Engine/Wizard/DrumrollScrollManager.cs index 5dd47f51..7c4bba34 100644 --- a/SVSim.BattleEngine/Engine/Wizard/DrumrollScrollManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/DrumrollScrollManager.cs @@ -8,9 +8,6 @@ namespace Wizard; public class DrumrollScrollManager : MonoBehaviour { - private const float SPRING_STRENGTH_FAST = 5000f; - - private const int MOMENTUM_AMOUNT = 70; [SerializeField] private UIScrollView _scrollView; @@ -105,7 +102,7 @@ public class DrumrollScrollManager : MonoBehaviour if (_CurrentIndex != num) { _CurrentIndex = num; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + if (!_isDrag) { _gridCenter.CenterOn(g.transform); diff --git a/SVSim.BattleEngine/Engine/Wizard/Effect2dCreateParam.cs b/SVSim.BattleEngine/Engine/Wizard/Effect2dCreateParam.cs index 781b65d1..6b419867 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Effect2dCreateParam.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Effect2dCreateParam.cs @@ -17,16 +17,4 @@ public class Effect2dCreateParam public Action MaterialSetEndCallback { get; set; } public List UnloadAssetList { get; set; } - - public bool IsValid - { - get - { - if (Parent != null && EffectName != null) - { - return UnloadAssetList != null; - } - return false; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/EffectUtility.cs b/SVSim.BattleEngine/Engine/Wizard/EffectUtility.cs index 70a90eae..246fb236 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EffectUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EffectUtility.cs @@ -14,7 +14,7 @@ public static class EffectUtility { MotionUtils.ChangeParticleSystemColor(gameObject, ColorCode.Get(param.ColorCode.Value)); } - param.UnloadAssetList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(gameObject, param.MaterialSetEndCallback)); + /* Pre-Phase-5b: SetUIParticleShader dropped */ gameObject.SetActive(param.InitActive); return gameObject; } diff --git a/SVSim.BattleEngine/Engine/Wizard/Emblem.cs b/SVSim.BattleEngine/Engine/Wizard/Emblem.cs index 2e3bd124..0a730c6c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Emblem.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Emblem.cs @@ -67,19 +67,4 @@ public class Emblem IsNew = true; } } - - public void UnsetNew() - { - IsNew = false; - } - - public void SetNew() - { - IsNew = true; - } - - public void SetFavorite(bool favorite) - { - IsFavorite = favorite; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/EmblemCategory.cs b/SVSim.BattleEngine/Engine/Wizard/EmblemCategory.cs deleted file mode 100644 index 7b1dad21..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/EmblemCategory.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class EmblemCategory -{ - public int Id { get; } - - public string Name { get; } - - public EmblemCategory(string[] columns) - { - int num = 0; - Id = int.Parse(columns[num++]); - Name = ConvertToCategoryText(columns[num++]); - } - - private string ConvertToCategoryText(string textId) - { - return Data.Master.GetEmblemCategoryText(textId); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/EmblemMgr.cs b/SVSim.BattleEngine/Engine/Wizard/EmblemMgr.cs index 8165ad54..1b216876 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EmblemMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EmblemMgr.cs @@ -7,16 +7,6 @@ public class EmblemMgr { private List _list = new List(); - public void Add(Emblem emblem) - { - _list.Add(emblem); - } - - public List GetList() - { - return _list; - } - public bool IsContainsInMaster(long id) { return _list.Find((Emblem x) => x._id == id) != null; @@ -45,25 +35,4 @@ public class EmblemMgr { Get(id).Acquired(); } - - public void UnsetNew(long id) - { - Get(id).UnsetNew(); - } - - public void SetNew(long id) - { - Get(id).SetNew(); - } - - public void SetFavorite(long id, bool favorite) - { - Get(id).SetFavorite(favorite); - } - - public IEnumerable GetFavorites() - { - return from x in _list.FindAll((Emblem x) => x.IsFavorite) - select x._id; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/EmoteUI.cs b/SVSim.BattleEngine/Engine/Wizard/EmoteUI.cs index 970610e5..1b02ea94 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EmoteUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EmoteUI.cs @@ -4,51 +4,4 @@ namespace Wizard; public class EmoteUI : MonoBehaviour { - [SerializeField] - public NguiObjs[] EmoteBtnList; - - [SerializeField] - public NguiObjs EmoteTextP; - - [SerializeField] - public NguiObjs EmoteTextE; - - [SerializeField] - public NguiObjs ThinkTextE; - - public float EmoteDelayTime; - - public bool isEmoteBtnEnabled = true; - - private void Update() - { - if (!isEmoteBtnEnabled) - { - emoteCheck(); - } - } - - private void emoteCheck() - { - bool flag = true; - if (EmoteDelayTime > 0f) - { - EmoteDelayTime -= Time.deltaTime; - flag = false; - } - if (flag) - { - onEmotes(); - } - } - - private void onEmotes() - { - isEmoteBtnEnabled = true; - for (int i = 0; i < EmoteBtnList.Length; i++) - { - EmoteBtnList[i].buttons[0].enabled = true; - EmoteBtnList[i].buttons[0].GetComponent().color = new Color(1f, 1f, 1f, 1f); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfo.cs b/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfo.cs index 1c19086d..b5bbda18 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfo.cs @@ -2,17 +2,4 @@ namespace Wizard; public class EmptyDeckInfo { - public int EmptyDeckID { get; set; } - - public bool CanDeckCreate - { - get - { - if (EmptyDeckID <= 0) - { - return false; - } - return true; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfoTask.cs deleted file mode 100644 index 7f6c8d90..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/EmptyDeckInfoTask.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Wizard; - -public class EmptyDeckInfoTask : BaseTask -{ - public class EmptyDeckInfoTaskParam : BaseParam - { - public int deck_format; - } - - public EmptyDeckInfoTask() - { - base.type = ApiType.Type.EmptyDeckInfo; - } - - public void SetParameter(Format f) - { - EmptyDeckInfoTaskParam emptyDeckInfoTaskParam = new EmptyDeckInfoTaskParam(); - emptyDeckInfoTaskParam.deck_format = Data.FormatConvertApi(f); - base.Params = emptyDeckInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.EmptyDeckInfo.EmptyDeckID = base.ResponseData["data"]["empty_deck_num"].ToInt(); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/EncryptData.cs b/SVSim.BattleEngine/Engine/Wizard/EncryptData.cs deleted file mode 100644 index b0ed341c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/EncryptData.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Wizard; - -public class EncryptData -{ -} diff --git a/SVSim.BattleEngine/Engine/Wizard/EnemyAI.cs b/SVSim.BattleEngine/Engine/Wizard/EnemyAI.cs index 4e71ec5e..42b05bb4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EnemyAI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EnemyAI.cs @@ -1,1700 +1,1648 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard; - -public abstract class EnemyAI : IEnemyAI, IEnemyAIBattleInfoRecieveDataAccessor -{ - public const int INPLAY_CARD_LIMIT = 5; - - public static float BREAKBONUS_RATE_IN_HAND = 0.75f; - - public static float BREAKBONUS_RATE_ON_FIELD = 0.1f; - - public const int VALUE_PRECISION = 1000; - - private static List _emptyPlayPtn = new List(); - - protected BattleManagerBase battleMgr; - - protected AIParamQuery paramQuery; - - protected AIStyleQuery styleQuery; - - protected AIEmoteMng emoteMng; - - protected AIEmoteCtrl emoteCtrl; - - protected AIEmoteQuery emoteQuery; - - public bool isUsedEvo; - - public List PlaySkipInfo; - - public bool IsBreakBeforePlay; - - private int spareSpace; - - protected bool isPlagueCityTagged; - - private float _previousFieldInplayValue; - - public List Cr_playoutActionSequence; - - public AILethalPlan OutputLethalPlan; - - protected float m_fieldAdvantage; - - public bool cr_isOprAtk; - - public bool cr_isOprPlay; - - public bool cr_isTerminate; - - public bool is_onSelectSkillTarget; - - public bool IsTurnEndLethal; - - public bool IsFullSimulation; - - public const int WeakLogicThresholdSecond = 7; - - protected int _timeOverLogicSec; - - protected Coroutine weakLogicCoroutine; - - protected int oprationQueueActCount; - - public AITokenManager tokenManager; - - private AIVirtualField _currentVirtualField; - - public AIRealActionInformation LatestAction; - - public AIVirtualField BeforeLatestActionField; - - public BattlePlayerBase ALLY; - - public BattlePlayerBase OPPONENT; - - public AISinglePlayptnRecord BestPlayPtnRecord; - - protected IEnumerator aiCoroutine; - - protected bool isForceBreak; - - protected Queue AIOperationQueue; - - protected AIOperationProcessor OperationProcessor; - - public bool IsOpponentBarbarossaDestroyed; - - public Dictionary ReferenceIdTable; - - public Dictionary> ReferenceTribeTable; - - protected bool isAIEmoteRegistered; - - public Dictionary FieldHashAndValueTable; - - public Dictionary FieldHashAndThreatenTable; - - private AIFunctionResultContainer _funcResultContainer; - - private AIVariableResultContainer _valResultContainer; - - private List _playerAbilityIdList; - - public const float DEFAULT_WAIT_TIME = 2f; - - private const int UNKNOWN_VALUE = -123456; - - public CardBasePrm.ClanType AISubClassType = CardBasePrm.ClanType.NONE; - - public CardBasePrm.ClanType PlayerSubClassType = CardBasePrm.ClanType.NONE; - - private AIBattleInfoReceivedData _battleInfoReceiveData; - - private System.Random stableRandom; - - protected bool _isStackAction; - - protected bool _isConnectNetwork = true; - - protected const float THINKING_INTERVAL_SEC = 3f; - - protected float _currentThinkingIntervalTime; - - protected bool _enabledThinkingCounter; - - protected float _elapsedThinkingTime; - - protected bool _isRunTurnEndLimitTimer; - - protected float _elapsedTurnTimeAfterTurnStartVfx; - - protected float _turnStartVfxFinishTime; - - public static List EmptyPlayPtn => _emptyPlayPtn; - - public EnemyAI_Play EnemyAIPlay { get; private set; } - - public EnemyAI_Attack EnemyAIAttack { get; private set; } - - public EnemyAI_Skill EnemyAISkill { get; private set; } - - public EnemyAI_WeakLogic EnemyAIWeakLogic { get; private set; } - - public EnemyAIFusion EnemyAIFusion { get; private set; } - - public BattleManagerBase BattleMgr => battleMgr; - - public bool IsThisTurnEmotePlayed { get; protected set; } - - public AIAttachPlayerBattleEventCache PlayerBattleEvent { get; private set; } - - public AIAttachOperateMgrBattleEventCache OprMgrBattleEvent { get; private set; } - - public int PlayerCharaId { get; private set; } - - public bool IsEvoPermissionOnSimu { get; private set; } - - public AIVirtualCard CurrentBattleSimEvoCard { get; set; } - - public int CurrentBattleBeforeSimEvoEvolCount { get; set; } - - public List AllySuicideList { get; protected set; } - - public bool IsPlagueCityTagged => isPlagueCityTagged; - - public float FieldInplayValueDifference - { - get - { - if (CurrentVirtualField != null) - { - return _previousFieldInplayValue - CurrentVirtualField.GetInplayTotalValue(); - } - return 0f; - } - } - - public bool IsAllyFirst => ALLY.IsGameFirst; - - public bool IsBattleEnd => battleMgr.IsBattleEnd; - - public bool _isSetCardReady { get; protected set; } - - public bool IsRunWeakLogic { get; private set; } - - public AIVirtualField CurrentVirtualField => _currentVirtualField; - - public List AllyDeckCards { get; private set; } - - public List EnemyDeckCards { get; private set; } - - public List DiscardedCards { get; private set; } - - public AIPlayptnRecorder PlayPtnRecorder { get; private set; } - - public AISelectedTargetInfoSet PreDecidedTargets { get; private set; } - - public List BeforeLatestActionAllyDeckCards { get; private set; } - - public List BeforeLatestActionEnemyDeckCards { get; private set; } - - public BattlePlayerPair PlayerPair { get; private set; } - - public List BestPlayPtn - { - get - { - if (BestPlayPtnRecord != null) - { - return BestPlayPtnRecord.PlayPtn; - } - return EmptyPlayPtn; - } - } - - public bool IsAIExecution => aiCoroutine != null; - - public float FieldAdvantage => m_fieldAdvantage; - - public int SpareSpace => spareSpace; - - public AIFunctionResultContainer FuncResultContainer => _funcResultContainer; - - public AIVariableResultContainer ValResultContainer => _valResultContainer; - - public AIEmoteMng EmoteMng => emoteMng; - - public AIEmoteQuery EmoteQuery => emoteQuery; - - public AIParamQuery ParamQuery => paramQuery; - - public AIStyleQuery StyleQuery => styleQuery; - - public static int EnemyAIID { get; set; } = -1; - - public AIGenerateTagOwnerTable GenerateTagOwnerTable { get; } - - public AIBattleInfoReceivedData BattleInfoReceivedData { get; } - - public bool IsInVirutalSimulation { get; set; } - - public int TurnCount => PlayerPair.Self.Turn; - - public int OpponentTurnCount => PlayerPair.Opponent.Turn; - - public bool IsRankMatchAI { get; protected set; } - - public abstract bool IsStackAction { get; } - - public abstract bool IsConnectNetwork { get; } - - public bool IsStopThinkingLogic { get; protected set; } - - protected bool IsThinkingInterval => _currentThinkingIntervalTime > 0f; - - public IAIEmoteCtrl EmoteCtrl() - { - return emoteCtrl; - } - - public EnemyAI() - { - battleMgr = BattleManagerBase.GetIns(); - EnemyAIPlay = new EnemyAI_Play(this); - EnemyAIAttack = new EnemyAI_Attack(this); - EnemyAISkill = new EnemyAI_Skill(this); - EnemyAIFusion = new EnemyAIFusion(this); - EnemyAIWeakLogic = new EnemyAI_WeakLogic(this); - PlayPtnRecorder = new AIPlayptnRecorder(); - paramQuery = new AIParamQuery(this); - styleQuery = new AIStyleQuery(this, paramQuery); - emoteCtrl = new AIEmoteCtrl(this); - emoteMng = new AIEmoteMng(this); - emoteQuery = new AIEmoteQuery(this); - paramQuery.SetUp(styleQuery); - stableRandom = new System.Random(emoteMng.EmoteRandomSeed); - AIOperationQueue = new Queue(); - OperationProcessor = new AIOperationProcessor(battleMgr, this); - IsOpponentBarbarossaDestroyed = false; - GenerateTagOwnerTable = new AIGenerateTagOwnerTable(); - BattleInfoReceivedData = new AIBattleInfoReceivedData(); - } - - public void ExecuteEnemyAI(bool useWait) - { - aiCoroutine = EnemyAI_Move(useWait); - EnemyAICoroutine.GetInstance().StartCoroutine(aiCoroutine); - } - - public void StopEnemyAI() - { - EnemyAICoroutine.GetInstance().StopAllCoroutines(); - aiCoroutine = null; - if (weakLogicCoroutine != null) - { - BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); - } - } - - public bool SetUpBattleState(int classId, AI_LOGIC_LV logicLv, string deckName, string styleName, string emoteName, int enemyAiID = -1) - { - AIDataLibrary aIDataLibrary = GameMgr.GetIns().GetDataMgr().m_AIDataLibrary; - AIDeckData curDeck = aIDataLibrary.SearchDeckData(deckName); - paramQuery.SetDeck(classId, logicLv, curDeck, aIDataLibrary.GetCommonDic(), aIDataLibrary.GetAllyCommonDic()); - AIStyleData deckStyle = aIDataLibrary.SearchDeckStyle(styleName); - styleQuery.SetDeckStyle(deckStyle); - styleQuery.UpdateStyle(); - EnemyAIID = enemyAiID; - if (!IsRankMatchAI && EmoteQuery != null && emoteName != "") - { - AIEmoteSet aIEmoteSet = aIDataLibrary.SearchEmoteSet(emoteName); - if (aIEmoteSet != null) - { - EmoteQuery.SetEmoteSet(aIEmoteSet); - } - } - return true; - } - - public void InitOnGame(BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer) - { - tokenManager = new AITokenManager(selfBattlePlayer, opponentBattlePlayer, this); - ALLY = selfBattlePlayer; - OPPONENT = opponentBattlePlayer; - PlayerPair = new BattlePlayerPair(selfBattlePlayer, opponentBattlePlayer); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - if (dataMgr != null) - { - PlayerCharaId = dataMgr.GetPlayerCharaId(); - AISubClassType = (CardBasePrm.ClanType)dataMgr.GetEnemySubClassId(); - PlayerSubClassType = (CardBasePrm.ClanType)dataMgr.GetPlayerSubClassId(); - } - styleQuery.UpdateStyle(); - isUsedEvo = false; - IsEvoPermissionOnSimu = true; - PlaySkipInfo = null; - IsBreakBeforePlay = false; - BestPlayPtnRecord = null; - m_fieldAdvantage = 0f; - is_onSelectSkillTarget = false; - IsOpponentBarbarossaDestroyed = false; - IsThisTurnEmotePlayed = false; - PlayerBattleEvent = new AIAttachPlayerBattleEventCache(); - OprMgrBattleEvent = new AIAttachOperateMgrBattleEventCache(); - OperateMgr operateMgr = selfBattlePlayer.BattleMgr.OperateMgr; - AIAttachEventToBattleModuleUtility.SetupEventWhenInitGame(selfBattlePlayer, opponentBattlePlayer, operateMgr, this); - IsTurnEndLethal = false; - FieldHashAndValueTable = new Dictionary(); - FieldHashAndThreatenTable = new Dictionary(); - _funcResultContainer = new AIFunctionResultContainer(); - _valResultContainer = new AIVariableResultContainer(); - LatestAction = null; - BeforeLatestActionField = null; - IsInVirutalSimulation = false; - } - - protected void UpdateCurrentVirtualField(AIParamQuery paramQuery, AIStyleQuery styleQuery, BattlePlayerPair pair, List bestPlayPtn, bool isUsePreviousFieldParameter) - { - AIVirtualField currentVirtualField = _currentVirtualField; - _previousFieldInplayValue = ((_currentVirtualField != null) ? _currentVirtualField.GetInplayTotalValue() : 0f); - AIVirtualFieldBuildParameterCollction buildParameters = ((!isUsePreviousFieldParameter) ? new AIVirtualFieldBuildParameterCollction(null) - { - PlayedCardContainer = currentVirtualField.PlayedCardContainer - } : new AIVirtualFieldBuildParameterCollction(currentVirtualField)); - _currentVirtualField = new AIVirtualField(this, paramQuery, styleQuery, pair, bestPlayPtn, buildParameters); - GenerateTagOwnerTable.RegisterAllGenerateTagOwner(_currentVirtualField); - UpdateDeckCards(pair); - UpdateDiscardedCards(pair.Self); - tokenManager.UpdateTokenPool(_currentVirtualField); - _currentVirtualField.InitializeBothDefValue(); - } - - private void UpdateDeckCards(BattlePlayerPair pair) - { - if (pair.Self.DeckCardList == null || pair.Opponent.DeckCardList == null) - { - AIConsoleUtility.LogError("UpdateDeckCards error!! deck is null!!!!!"); - } - List> list; - if (AllyDeckCards == null) - { - AllyDeckCards = new List(); - list = null; - } - else - { - list = new List>(); - for (int i = 0; i < AllyDeckCards.Count; i++) - { - AIVirtualCard aIVirtualCard = AllyDeckCards[i]; - list.Add(new Tuple(aIVirtualCard.CardIndex, aIVirtualCard.TagCollectionContainer.AttachedTags)); - } - AllyDeckCards.Clear(); - } - for (int j = 0; j < pair.Self.DeckCardList.Count; j++) - { - AIVirtualCard aIVirtualCard2 = new DeckVirtualCard(pair.Self.DeckCardList[j], CurrentVirtualField); - aIVirtualCard2.InitializeTags(ParamQuery, FindInheritanceAttachedTagForDeckCard(aIVirtualCard2.CardIndex, list), null); - AllyDeckCards.Add(aIVirtualCard2); - } - if (EnemyDeckCards == null) - { - EnemyDeckCards = new List(); - list = null; - } - else - { - list = new List>(); - for (int k = 0; k < EnemyDeckCards.Count; k++) - { - AIVirtualCard aIVirtualCard3 = EnemyDeckCards[k]; - list.Add(new Tuple(aIVirtualCard3.CardIndex, aIVirtualCard3.TagCollectionContainer.AttachedTags)); - } - EnemyDeckCards.Clear(); - } - for (int l = 0; l < pair.Opponent.DeckCardList.Count; l++) - { - AIVirtualCard aIVirtualCard4 = new DeckVirtualCard(pair.Opponent.DeckCardList[l], CurrentVirtualField); - aIVirtualCard4.InitializeTags(ParamQuery, FindInheritanceAttachedTagForDeckCard(aIVirtualCard4.CardIndex, list), null); - EnemyDeckCards.Add(aIVirtualCard4); - } - } - - private AIAttachedTagCollection FindInheritanceAttachedTagForDeckCard(int deckCardIndex, List> attachedTagPool) - { - if (attachedTagPool == null || attachedTagPool.Count <= 0) - { - return null; - } - for (int i = 0; i < attachedTagPool.Count; i++) - { - Tuple tuple = attachedTagPool[i]; - if (deckCardIndex == tuple.first) - { - return tuple.second; - } - } - return null; - } - - private void UpdateDiscardedCards(BattlePlayerBase self) - { - if (self.DiscardedCardList != null) - { - if (DiscardedCards == null) - { - DiscardedCards = new List(); - } - else - { - DiscardedCards.Clear(); - } - for (int i = 0; i < self.DiscardedCardList.Count; i++) - { - DiscardedCards.Add(new DiscardedVirtualCard(self.DiscardedCardList[i], _currentVirtualField)); - } - } - } - - public void SaveBeforeLatestActionInformation() - { - BeforeLatestActionField = new AIVirtualField(_currentVirtualField, isLatestAction: true); - BeforeLatestActionAllyDeckCards = new List(AllyDeckCards); - BeforeLatestActionEnemyDeckCards = new List(EnemyDeckCards); - } - - public void LoadBufferedBattleState() - { - AISetUpData setupInfoBuf = GameMgr.GetIns().GetDataMgr().m_AIDataLibrary.SetupInfoBuf; - if (setupInfoBuf != null) - { - SetUpBattleState(setupInfoBuf.classID, setupInfoBuf.logicLv, setupInfoBuf.deckName, setupInfoBuf.styleName, setupInfoBuf.emoteName, setupInfoBuf.enemyAiID); - if (!IsRankMatchAI && EmoteQuery != null) - { - EmoteQuery.SetOnOffEmote(setupInfoBuf.doesUseEmote, setupInfoBuf.useInnerEmote); - } - if (setupInfoBuf.specialAbilityList != null) - { - _playerAbilityIdList = new List(setupInfoBuf.specialAbilityList); - } - } - } - - private void InitOnTurnStart() - { - PlaySkipInfo = null; - IsBreakBeforePlay = false; - BestPlayPtnRecord = null; - m_fieldAdvantage = 0f; - EnemyAIAttack.InitOnTurnStart(); - CurrentBattleSimEvoCard = null; - CurrentBattleBeforeSimEvoEvolCount = ALLY.CurrentEpCount; - if (paramQuery.GetLogicLv() == AI_LOGIC_LV.MIDDLE) - { - int num = ((CalcFieldAdvantage() <= -8f) ? 100 : 30); - int num2 = AIStableRandom(100); - IsEvoPermissionOnSimu = num2 <= num; - } - else - { - IsEvoPermissionOnSimu = true; - } - IsInVirutalSimulation = false; - IsTurnEndLethal = false; - tokenManager.RegistPermanentlyToken(); - FieldHashAndValueTable.Clear(); - FieldHashAndThreatenTable.Clear(); - } - - public void Mulligan(List dstList, BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer) - { - UpdateCurrentVirtualField(paramQuery, styleQuery, new BattlePlayerPair(selfBattlePlayer, opponentBattlePlayer), EmptyPlayPtn, isUsePreviousFieldParameter: true); - _currentVirtualField.InitializeGameStartInnerTags(); - int count = CurrentVirtualField.AllyHandCards.Count; - int num = 0; - int[] array = new int[count]; - for (int i = 0; i < count; i++) - { - array[i] = 0; - } - for (int j = 0; j < count - 1; j++) - { - AIVirtualCard aIVirtualCard = CurrentVirtualField.AllyHandCards[j]; - for (int k = j + 1; k < count; k++) - { - if (CurrentVirtualField.AllyHandCards[k].BaseId == aIVirtualCard.BaseId) - { - array[j] = 2; - break; - } - } - } - for (int l = 0; l < count; l++) - { - if (array[l] == 0) - { - AIVirtualCard card = CurrentVirtualField.AllyHandCards[l]; - if (paramQuery.IsEnabledTag(card, CurrentVirtualField, AIPlayTagType.MulliganKeep, EmptyPlayPtn, null)) - { - array[l] = 1; - num++; - } - if (paramQuery.IsEnabledTag(card, CurrentVirtualField, AIPlayTagType.MulliganChange, EmptyPlayPtn, null)) - { - array[l] = 2; - } - } - } - if (num == count) - { - return; - } - bool flag = false; - for (int m = 0; m < count; m++) - { - AIVirtualCard aIVirtualCard2 = CurrentVirtualField.AllyHandCards[m]; - if (array[m] == 0 && aIVirtualCard2.Cost == 2 && isKeepableCard(aIVirtualCard2)) - { - array[m] = 1; - num++; - flag = true; - break; - } - } - if (num == count) - { - return; - } - bool flag2 = false; - bool flag3 = false; - if (num > 0 && flag) - { - for (int n = 0; n < count; n++) - { - AIVirtualCard aIVirtualCard3 = CurrentVirtualField.AllyHandCards[n]; - if ((aIVirtualCard3.Cost == 1 || aIVirtualCard3.Cost == 3) && array[n] == 0 && isKeepableCard(aIVirtualCard3)) - { - array[n] = 1; - num++; - if (aIVirtualCard3.Cost == 1) - { - flag2 = true; - } - else if (aIVirtualCard3.Cost == 3) - { - flag3 = true; - } - break; - } - } - } - if (num == count) - { - return; - } - if (num > 0 && flag && (flag2 || flag3)) - { - for (int num2 = 0; num2 < count; num2++) - { - AIVirtualCard aIVirtualCard4 = CurrentVirtualField.AllyHandCards[num2]; - if (array[num2] == 0) - { - if (!isKeepableCard(aIVirtualCard4)) - { - break; - } - if ((flag2 && aIVirtualCard4.Cost == 3) || (flag3 && aIVirtualCard4.Cost == 4)) - { - array[num2] = 1; - num++; - break; - } - } - } - } - if (num == count) - { - return; - } - for (int num3 = 0; num3 < count; num3++) - { - if (array[num3] == 2 || array[num3] == 0) - { - dstList.Add(CurrentVirtualField.AllyHandCards[num3].BaseCard); - } - } - bool isKeepableCard(AIVirtualCard aIVirtualCard5) - { - if (!aIVirtualCard5.IsUnit) - { - if (IsBishop()) - { - return aIVirtualCard5.IsAmulet; - } - return false; - } - return true; - } - } - - public void ChangeWeakLogic() - { - if (battleMgr is SingleBattleMgr singleBattleMgr) - { - singleBattleMgr.RecordChangeAI("weak", oprationQueueActCount); - oprationQueueActCount = 0; - } - IsRunWeakLogic = true; - } - - public void ChangeNormalLogic() - { - IsRunWeakLogic = false; - _timeOverLogicSec = 0; - } - - protected virtual IEnumerator WeakLogicTimerCoroutine() - { - _timeOverLogicSec = 0; - while (!IsBattleEnd) - { - if (!IsRunWeakLogic) - { - _timeOverLogicSec++; - if (_timeOverLogicSec > 7 && battleMgr.VfxMgr.IsEnd) - { - ChangeWeakLogic(); - } - } - yield return new WaitForSecondsRealtime(1f); - } - } - - public bool IsLethal(AIVirtualCard tagOwner, AIVirtualField field, List playPtn, AISituationInfo situation) - { - if (situation is AIVirtualTargetSelectAction { forceLethalMode: not false }) - { - return true; - } - AIVariableResultContainer valResultContainer = field.AI.ValResultContainer; - ulong hash = AIFunctionResultHashCalculator.GetHash(tagOwner, field, playPtn, situation, 0uL); - if (valResultContainer.GetContainsResultValue(AIScriptTokenVariableType.IS_LETHAL, hash, out var getResult)) - { - return getResult == 1f; - } - AISinglePlayptnRecord playPtnRecord = PlayPtnRecorder.FindMatchedPlayPtnRecord(playPtn, field); - bool flag = AIPlayOutChecker.CalculatePlayOutDamageProspected(paramQuery, field, playPtnRecord, this) >= field.EnemyClass.Life; - valResultContainer.CheckDuplicateAndAddRecord(AIScriptTokenVariableType.IS_LETHAL, hash, flag ? 1f : 0f, $"IsLethal(): Already hashed target and not equal value. CardName:[{tagOwner.CardName}] hash:[{hash}]"); - return flag; - } - - private IEnumerator EnemyAI_Move(bool useWait) - { - is_onSelectSkillTarget = false; - IsRunWeakLogic = false; - IsStopThinkingLogic = false; - if (weakLogicCoroutine != null) - { - BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); - weakLogicCoroutine = null; - } - if (!BattleMgr.IsRecovery) - { - weakLogicCoroutine = BattleCoroutine.GetInstance().StartCoroutine(WeakLogicTimerCoroutine()); - } - InitOnTurnStart(); - WaitForSeconds shortWait = new WaitForSeconds(0.2f); - WaitForSeconds longWait = new WaitForSeconds(0.5f); - isForceBreak = false; - oprationQueueActCount = 0; - while (true) - { - if (IsRankMatchAI && IsStopThinkingLogic) - { - continue; - } - yield return useWait ? shortWait : null; - if (AIOperationQueue.Count > 0) - { - if (!battleMgr.VfxMgr.IsEnd || (IsRankMatchAI && IsThinkingInterval)) - { - continue; - } - if (IsRankMatchAI) - { - if (_isConnectNetwork) - { - AIOperationQueue.Dequeue().Call(); - oprationQueueActCount++; - _isStackAction = false; - } - else - { - _isStackAction = true; - } - } - else - { - AIOperationQueue.Dequeue().Call(); - oprationQueueActCount++; - } - continue; - } - if (isForceBreak) - { - break; - } - if (battleMgr.IsBattleEnd || is_onSelectSkillTarget) - { - continue; - } - BestPlayPtnRecord = null; - ChangeNormalLogic(); - EnemyAIPlay.InitOnIterationStart(); - EnemyAIAttack.InitOnIterationStart(); - EnemyAIFusion.InitOnIterationStart(); - PlaySkipInfo = null; - IsBreakBeforePlay = false; - AllySuicideList = new List(); - spareSpace = 5; - IsFullSimulation = false; - PreDecidedTargets = null; - LatestAction = null; - BeforeLatestActionField = null; - _funcResultContainer.Clear(); - _valResultContainer.Clear(); - if (IsRankMatchAI) - { - _enabledThinkingCounter = true; - _elapsedThinkingTime = 0f; - } - AllySuicideList = GetSuicideAllyFollowerSequence(CurrentVirtualField, paramQuery, styleQuery); - PlayPtnRecorder = new AIPlayptnRecorder(); - PlayPtnRecorder.CreateValidPlayPtnList(_currentVirtualField); - BestPlayPtnRecord = PlayPtnRecorder.GetEmptyPlayPtnRecord(); - yield return EnemyAICoroutine.GetInstance().StartCoroutine(HandPlayEstimationCoroutine()); - m_fieldAdvantage = CalcFieldAdvantage(); - isPlagueCityTagged = CurrentVirtualField.IsPlagueCity(); - VfxBase emote = GetEmote(AIEmoteCmdType.ON_ITERATION_START); - ImmediateVfxMgr.GetInstance().Register(emote); - cr_isTerminate = false; - IsTurnEndLethal = false; - yield return EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAIAttack.Cr_BattleAI_ImmediateAttack()); - if (cr_isTerminate) - { - if (!IsTurnEndLethal) - { - continue; - } - break; - } - cr_isOprPlay = false; - IsTurnEndLethal = false; - yield return EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAIPlay.BattleAI_HandPlay()); - AIGetOnSimulationUtility.RegisterGetOnTokenInPlayPtn(this); - if (cr_isOprPlay) - { - if (!IsTurnEndLethal) - { - continue; - } - break; - } - if (paramQuery.GetLogicLv() == AI_LOGIC_LV.STRONG || paramQuery.GetLogicLv() == AI_LOGIC_LV.MIDDLE) - { - cr_isOprAtk = false; - yield return EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAIAttack.BattleAI_UseHighSimu()); - if (cr_isOprAtk) - { - continue; - } - } - else if (paramQuery.GetLogicLv() == AI_LOGIC_LV.WEAK && (EnemyAIWeakLogic.BattleAI_AttackWeak() || EnemyAIWeakLogic.BattleAI_EvoWeak())) - { - continue; - } - if ((PlaySkipInfo != null || IsBreakBeforePlay) && ((BestPlayPtn != null && BestPlayPtn.Count > 0) || EnemyAIPlay.IsFusion)) - { - yield return EnemyAICoroutine.GetInstance().StartCoroutine(HandCardAction()); - if (cr_isOprPlay) - { - if (IsTurnEndLethal) - { - break; - } - continue; - } - } - if ((paramQuery.GetLogicLv() != AI_LOGIC_LV.WEAK || !EnemyAIAttack.BattleAI_TurnEndAttack()) && AIOperationQueue.Count <= 0) - { - break; - } - } - yield return useWait ? longWait : null; - while (!battleMgr.VfxMgr.IsEnd) - { - yield return null; - } - if (IsRankMatchAI && !battleMgr.IsRecovery) - { - float delayTurnEndTime = StyleQuery.GetDelayTurnEndTime(CurrentVirtualField.AllyClass, BestPlayPtn); - while (_elapsedTurnTimeAfterTurnStartVfx < delayTurnEndTime) - { - yield return null; - } - } - emoteQuery.OnOperation(); - VfxBase vfxBase = ((TurnCount != 1) ? GetEmote(AIEmoteCmdType.ON_ALLY_TURN_END) : GetEmote(AIEmoteCmdType.ON_FIRST_TURN)); - if (vfxBase != null) - { - battleMgr.VfxMgr.RegisterSequentialVfx(vfxBase); - } - IsThisTurnEmotePlayed = false; - battleMgr.VfxMgr.RegisterSequentialVfx(battleMgr.OperateMgr.TurnEndOperation(ALLY.IsPlayer)); - if (weakLogicCoroutine != null) - { - BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); - weakLogicCoroutine = null; - } - } - - public IEnumerator HandCardAction() - { - if (EnemyAIPlay.PriorityCard == null) - { - AIConsoleUtility.LogError("HandCardAction error!! PriorityCard is null!!!!!"); - cr_isOprPlay = false; - yield break; - } - if (EnemyAIPlay.IsFusion && EnemyAIPlay.FusionPattern != null) - { - EnemyAIFusion.SetFusionSituation(EnemyAIPlay.FusionPattern); - if (EnemyAIFusion.FusionAI()) - { - cr_isOprPlay = true; - } - yield break; - } - AIVirtualCard aIVirtualCard = EnemyAIPlay.PriorityCard.FindRealActor(BestPlayPtnRecord); - AIVirtualTargetSelectAction situation = new AIVirtualTargetSelectAction(aIVirtualCard, EnemyAIPlay.PriorityCard, AIOperationType.PLAY); - int playSpaceRequired = CurrentVirtualField.GetPlaySpaceRequired(aIVirtualCard, BestPlayPtn, situation); - int num = 6 - CurrentVirtualField.CardListSet.AllyClassAndInplayCards.Count; - bool flag = true; - if (playSpaceRequired > num) - { - flag = false; - } - else if (EnemyAIPlay.BestPlayPtnWithToken != null) - { - bool num2 = StyleQuery.IsPlayBreak(EnemyAIPlay.PriorityCard, BestPlayPtn, null); - int count = EnemyAIPlay.BestPlayPtnWithToken.TokenPtn[0].TokenInfoPairList.Count; - if (num2) - { - int allyLastwordTokenCount = EnemyAIPlay.PriorityCard.GetAllyLastwordTokenCount(BestPlayPtn); - count += allyLastwordTokenCount; - } - else - { - count += playSpaceRequired; - } - if (count > num) - { - flag = false; - } - } - if (EnemyAIPlay.InstantAttackActionInfo != null && !flag) - { - int item = CurrentVirtualField.AllyHandCards.IndexOf(EnemyAIPlay.PriorityCard); - int index = EnemyAIPlay.BestPlayPtnWithToken.PlayPtn.IndexOf(item); - TokenPlayPattern tokenPlayPattern = EnemyAIPlay.BestPlayPtnWithToken.TokenPtn[index]; - if (CurrentVirtualField.GetPlaySpaceRequired(EnemyAIPlay.PriorityCard, BestPlayPtn, situation, needsTokenCount: false) + tokenPlayPattern.TokenInfoPairList.Count > 6 - CurrentVirtualField.CardListSet.AllyClassAndInplayCards.Count) - { - AIVirtualCard aIVirtualCard2 = null; - if (EnemyAIPlay.InstantAttackActionInfo is AIVirtualAttackInfo aIVirtualAttackInfo) - { - aIVirtualCard2 = aIVirtualAttackInfo.AttackTarget; - } - if (aIVirtualCard2 != null) - { - OprAttack(EnemyAIPlay.InstantAttackActionInfo); - cr_isOprPlay = true; - } - else - { - AIConsoleUtility.LogError("InstantAttack error!! Cannot find attack target!!!!!"); - } - yield break; - } - } - if (!EnemyAIPlay.PriorityCard.BaseCard.Movable()) - { - cr_isOprPlay = false; - yield break; - } - if (EnemyAIPlay.PriorityCardPlayInfo != null && EnemyAIPlay.PriorityCardPlayInfo.HasPreDecidedSelectTargets) - { - List list = new List(); - AISelectedTargetInfoSet preDecidedSelectTargets = EnemyAIPlay.PriorityCardPlayInfo.PreDecidedSelectTargets; - for (int i = 0; i < AISelectedTargetInfoSet.LENGTH; i++) - { - AISelectedTargetInfo aISelectedTargetInfo = preDecidedSelectTargets.Get(i); - if (aISelectedTargetInfo != null && aISelectedTargetInfo.HasTarget) - { - for (int j = 0; j < aISelectedTargetInfo.Targets.Count; j++) - { - list.Add(aISelectedTargetInfo.Targets[j].BaseCard); - } - } - } - EnemyAISkill.SetPreDecidedTarget(list); - SetPreDecidedTargets(preDecidedSelectTargets); - } - OprPlay(EnemyAIPlay.PriorityCard, BestPlayPtnRecord); - cr_isOprPlay = true; - } - - public void SelectSkillTarget(AIVirtualCard actCard, AIOperationType operationType, AISinglePlayptnRecord playptnRecord) - { - is_onSelectSkillTarget = true; - AISinglePlayptnRecord aISinglePlayptnRecord = playptnRecord; - List list = ((playptnRecord != null) ? playptnRecord.PlayPtn : EmptyPlayPtn); - AIVirtualCard aIVirtualCard = _currentVirtualField.SearchVirtualCard(actCard); - AIVirtualCard aIVirtualCard2 = ((operationType != AIOperationType.PLAY || list == null || list.Count <= 0) ? aIVirtualCard : aIVirtualCard.FindRealActor(aISinglePlayptnRecord)); - List list2 = list; - if (aIVirtualCard2.HasDestroyPlayPtnTag(operationType)) - { - list2 = ((operationType != AIOperationType.PLAY) ? EmptyPlayPtn : new List { _currentVirtualField.AllyHandCards.IndexOf(actCard) }); - aISinglePlayptnRecord = PlayPtnRecorder.FindMatchedPlayPtnRecord(list2, _currentVirtualField); - } - AIVirtualTargetSelectAction aIVirtualTargetSelectAction = new AIVirtualTargetSelectAction(aIVirtualCard2, aIVirtualCard, operationType, (AISelectedTargetInfoSet)null); - if (operationType == AIOperationType.PLAY && PreDecidedTargets != null) - { - aIVirtualTargetSelectAction.SelectedTargets = PreDecidedTargets; - } - List list3 = aIVirtualCard2.CreateAIVirtualSelectInfo(_currentVirtualField, aIVirtualTargetSelectAction); - if (aIVirtualTargetSelectAction.GetChoiceTarget() != null) - { - SetPreDecidedTargets(aIVirtualTargetSelectAction.SelectedTargets); - } - AIVirtualCard aIVirtualCard3 = null; - if (list2 != null) - { - switch (operationType) - { - case AIOperationType.EVOLVE: - if (list2.Count > 0) - { - aIVirtualCard3 = _currentVirtualField.AllyHandCards[list2[0]]; - } - break; - case AIOperationType.PLAY: - if (list2.Count > 1) - { - aIVirtualCard3 = _currentVirtualField.AllyHandCards[list2[1]]; - } - break; - } - } - PlayedCardInfo nextPlayCardInfo = null; - if (aIVirtualCard3 != null && aISinglePlayptnRecord != null) - { - nextPlayCardInfo = aISinglePlayptnRecord.FindPlayedCardInfo(aIVirtualCard3); - } - AIVirtualTargetSelectSimulationInfo simulationInfo = new AIVirtualTargetSelectSimulationInfo - { - OriginalActor = aIVirtualCard, - RealActor = aIVirtualCard2, - SelectInfoList = list3, - OperationType = operationType, - NextPlayCardInfo = nextPlayCardInfo, - IsFirstAction = true - }; - if (list3 != null && list3.Count > 0) - { - EnemyAICoroutine.GetInstance().StartCoroutine(AIVirtualTargetSelectSimulator.ExecuteTargetSelect(simulationInfo, _currentVirtualField, aISinglePlayptnRecord)); - } - else - { - EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAISkill._Cr_SelectSkillTarget(actCard, operationType, aISinglePlayptnRecord)); - } - PreDecidedTargets = null; - } - - protected IEnumerator HandPlayEstimationCoroutine() - { - int handCardCount = ALLY.HandCardList.Count; - BattlePlayerPair sourcePair = new BattlePlayerPair(ALLY, OPPONENT); - int index = 0; - while (index < handCardCount) - { - CurrentVirtualField.AllyHandCards[index].CreateHandPlayEstimator(paramQuery, index, sourcePair, this); - yield return null; - int num = index + 1; - index = num; - } - } - - public static List GetSuicideAllyFollowerSequence(AIVirtualField field, AIParamQuery ParamQuery, AIStyleQuery styleQuery) - { - AIVirtualField aIVirtualField = new AIVirtualField(field); - List list = new List(); - for (int i = 0; i < aIVirtualField.AllyInplayCards.Count; i++) - { - AIVirtualCard aIVirtualCard = aIVirtualField.AllyInplayCards[i]; - if (!aIVirtualCard.IsUnit || !aIVirtualCard.IsAttackable(EmptyPlayPtn)) - { - continue; - } - if (list.Count == 0) - { - list.Add(aIVirtualCard); - continue; - } - int num = 0; - for (num = 0; num < list.Count; num++) - { - AIVirtualCard aIVirtualCard2 = list[num]; - if (aIVirtualCard.Value < aIVirtualCard2.Value) - { - break; - } - } - list.Insert(num, aIVirtualCard); - } - if (list == null || list.Count <= 0) - { - return new List(); - } - List list2 = new List(); - for (int j = 0; j < list.Count; j++) - { - AIVirtualCard sourceCard = list[j]; - list2.Add(new AIVirtualAttackInfo(sourceCard, isAttackFollower: true)); - } - List list3 = new List(); - for (int k = 0; k < aIVirtualField.EnemyInplayCards.Count; k++) - { - AIVirtualCard aIVirtualCard3 = aIVirtualField.EnemyInplayCards[k]; - if (!aIVirtualCard3.IsUnit) - { - continue; - } - if (list3.Count == 0) - { - list3.Add(aIVirtualCard3); - continue; - } - int num2 = 0; - for (num2 = 0; num2 < list3.Count; num2++) - { - AIVirtualCard aIVirtualCard4 = list3[num2]; - if ((aIVirtualCard3.IsGuard || !aIVirtualCard4.IsGuard) && ((aIVirtualCard3.IsGuard && !aIVirtualCard4.IsGuard) || aIVirtualCard3.IsKiller || aIVirtualCard3.Attack > aIVirtualCard4.Attack)) - { - break; - } - } - list3.Insert(num2, aIVirtualCard3); - } - BattleSequencer.ExecSimulation(aIVirtualField, list2, list3, new SimulationSetting(isHandRemovalValid: false, useLeaderAttackPreCheck: false, noSkipAttack: true, checkAct: false)); - list.RemoveAll((AIVirtualCard c) => !c.IsDead); - List list4 = new List(); - for (int num3 = 0; num3 < list.Count; num3++) - { - for (int num4 = 0; num4 < field.AllyInplayCards.Count; num4++) - { - if (field.AllyInplayCards[num4].CardIndex == list[num3].CardIndex && field.AllyInplayCards[num4].BaseId == list[num3].BaseId) - { - list4.Add(field.AllyInplayCards[num4]); - break; - } - } - } - return list4; - } - - public float GetEvoPenalty() - { - float num = 4f; - if (!isUsedEvo && TurnCount >= 6) - { - num /= 2f; - } - return num; - } - - public static int GetBaseId(int id) - { - return CardMaster.GetInstanceForBattle().GetCardParameterFromId(id).BaseCardId; - } - - public int AIStableRandom() - { - return stableRandom.Next(); - } - - public int AIStableRandom(int val) - { - return (int)Math.Floor((double)val * stableRandom.NextDouble()); - } - - public float CalcFieldAdvantage() - { - float num = 0f; - for (int i = 0; i < CurrentVirtualField.AllyInplayCards.Count; i++) - { - float num2 = CurrentVirtualField.AllyInplayCards[i].EvaluateValueOnField(EmptyPlayPtn, null, useStyle: true); - if (num2 > 0f) - { - num += num2; - } - } - float num3 = 0f; - for (int j = 0; j < CurrentVirtualField.EnemyInplayCards.Count; j++) - { - float num4 = CurrentVirtualField.EnemyInplayCards[j].EvaluateValueOnField(EmptyPlayPtn, null, useStyle: true); - if (num4 > 0f) - { - num3 += num4; - } - } - return num - num3; - } - - public int GetAllySpaceNum() - { - return 5 - CurrentVirtualField.AllyInplayCards.Count; - } - - public void OprEvolution(AIVirtualCard virtualCard) - { - AIOperationQueue.Enqueue(delegate - { - SetupThinkingInterval(); - isUsedEvo = true; - emoteQuery.OnOperation(); - SelectSkillTarget(virtualCard, AIOperationType.EVOLVE, BestPlayPtnRecord); - emoteMng.OnOperationRequest(); - }); - } - - public void OprPlay(AIVirtualCard card, AISinglePlayptnRecord playptnRecord) - { - AIVirtualCard currentFieldCard = _currentVirtualField.SearchVirtualCard(card); - AIOperationQueue.Enqueue(delegate - { - SetupThinkingInterval(); - emoteMng.EvalAllyOnCardPlay(currentFieldCard, playptnRecord); - emoteQuery.OnOperation(); - _isSetCardReady = false; - SelectSkillTarget(currentFieldCard, AIOperationType.PLAY, playptnRecord); - _isSetCardReady = true; - emoteMng.OnOperationRequest(); - }); - } - - public void OprAttack(AISituationInfo situation) - { - AIVirtualAttackInfo attackSituation = situation as AIVirtualAttackInfo; - if (attackSituation == null || attackSituation.Actor == null || attackSituation.AttackTarget == null) - { - AIConsoleUtility.LogError("OprAttack error!!! situation is invalid"); - return; - } - AIOperationQueue.Enqueue(delegate - { - AIRealBattleCardSearcher.SearchAttackPairFromSituation(PlayerPair, attackSituation, out var attacker, out var attackTarget); - if (attackTarget != null && attackTarget != null) - { - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - VfxBase emote = GetEmote(AIEmoteCmdType.ON_ALLY_ATTACK, situation); - sequentialVfxPlayer.Register(emote); - if (AttackSelectControl.CanCardAttackTarget(attacker, attackTarget, attackTarget.SelfBattlePlayer.InPlayCards)) - { - VfxBase vfx = battleMgr.OperateMgr.Attack(attacker, attackTarget, ALLY.IsPlayer); - sequentialVfxPlayer.Register(vfx); - battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); - } - else - { - if (attackTarget != null) - { - _ = attacker.BaseParameter.CardName; - } - _ = attackTarget?.BaseParameter.CardName; - isForceBreak = true; - } - } - else - { - isForceBreak = true; - } - emoteMng.OnOperationRequest(); - if (IsRankMatchAI) - { - CheckIsStackAction(); - } - }); - } - - public void OprTargetSelect(AIVirtualCard virtualActor, AISelectedTargetInfoSet targetInfoSet, AIOperationType operationType) - { - AIOperationQueue.Enqueue(delegate - { - if (!battleMgr.IsBattleEnd) - { - AIVirtualTargetSelectAction situation = new AIVirtualTargetSelectAction(virtualActor, virtualActor, operationType, targetInfoSet); - VfxBase vfx = null; - switch (operationType) - { - case AIOperationType.EVOLVE: - vfx = OperationProcessor.AIEvolutionCard(situation); - break; - case AIOperationType.PLAY: - vfx = OperationProcessor.AIPlayCard(situation); - break; - case AIOperationType.FUSION: - vfx = OperationProcessor.AIFusionCard(situation); - break; - } - is_onSelectSkillTarget = false; - battleMgr.VfxMgr.RegisterSequentialVfx(vfx); - emoteMng.OnOperationRequest(); - if (IsRankMatchAI) - { - SetupThinkingInterval(); - CheckIsStackAction(); - } - } - }); - EnemyAISkill.ClearPreDecidedTarget(); - } - - public bool OprLethalAction(AISituationInfo action) - { - AIVirtualCard originalCard = action.OriginalCard; - AISelectedTargetInfoSet selectedTargets = action.SelectedTargets; - AIOperationType actionType = action.ActionType; - switch (actionType) - { - case AIOperationType.EVOLVE: - case AIOperationType.PLAY: - OprTargetSelect(originalCard, selectedTargets, actionType); - return true; - case AIOperationType.ATTACK: - OprAttack(action); - return true; - default: - return false; - } - } - - private static AIVirtualCard FindCardFromCardIndex(List cardList, int index) - { - if (cardList.Any((AIVirtualCard card) => card.CardIndex == index)) - { - return cardList.First((AIVirtualCard card) => card.CardIndex == index); - } - return null; - } - - public static bool IsSameValue(float value1, float value2) - { - return (int)Math.Round(value1 * 1000f) == (int)Math.Round(value2 * 1000f); - } - - public static bool IsLargerThan(float value1, float value2) - { - return (int)Math.Round(value1 * 1000f) > (int)Math.Round(value2 * 1000f); - } - - public virtual VfxBase GetEmote(AIEmoteCmdType cmdType, AISituationInfo situation = null, ClassCharaPrm.EmotionType receivedEmoteType = ClassCharaPrm.EmotionType.NULL, int emoteInput = -1) - { - if (IsBattleEnd) - { - return NullVfx.GetInstance(); - } - if (isAIEmoteRegistered && cmdType != AIEmoteCmdType.ON_OPPONENT_TURN_START && cmdType != AIEmoteCmdType.ON_ALLY_TURN_START) - { - AIConsoleUtility.Log("既にEmoteを登録中です!"); - return NullVfx.GetInstance(); - } - isAIEmoteRegistered = true; - float num = 0f; - float num2 = 0f; - AIEmoteCmd aIEmoteCmd = null; - VfxBase vfxBase = NullVfx.GetInstance(); - switch (cmdType) - { - case AIEmoteCmdType.ON_RECEIVE: - aIEmoteCmd = emoteCtrl.OnOpponentEmotion(receivedEmoteType); - if (aIEmoteCmd != null) - { - vfxBase = ALLY.Emotion.PlayEmotion(aIEmoteCmd.emoteType, 1.5f); - num = 2f; - } - break; - case AIEmoteCmdType.ON_FIRST_TURN: - vfxBase = ALLY.Emotion.PlayEmotion(ClassCharaPrm.EmotionType.PROVOCATION, 1.5f); - break; - case AIEmoteCmdType.ON_ITERATION_START: - aIEmoteCmd = emoteCtrl.OnIterationStart(); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_ALLY_TURN_START: - aIEmoteCmd = emoteCtrl.OnAllyTurnStart(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_OPPONENT_TURN_START: - aIEmoteCmd = emoteCtrl.OnOpponentTurnStart(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_ALLY_TURN_END: - aIEmoteCmd = emoteCtrl.OnAllyTurnEnd(); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_OPPONENT_TURN_END: - aIEmoteCmd = emoteCtrl.OnOpponentTurnEnd(); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_ALLY_ATTACK: - aIEmoteCmd = emoteCtrl.OnAllyAttack(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_OPPONENT_ATTACK: - aIEmoteCmd = emoteCtrl.OnOpponentAttackExecuted(); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_ALLY_EVOLUTION: - aIEmoteCmd = emoteCtrl.OnAllyEvolution(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_CARD_DESTROY: - aIEmoteCmd = emoteCtrl.OnCardDestroy(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_CARD_PLAY_ALLY: - aIEmoteCmd = emoteCtrl.OnCardPlay(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_CARD_PLAY_OPPONENT: - aIEmoteCmd = emoteCtrl.OnOpponentPlayCardExecuted(situation); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - } - break; - case AIEmoteCmdType.ON_LEADER_DAMAGED: - aIEmoteCmd = emoteCtrl.OnLeaderDamaged(_currentVirtualField); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - num = 2f; - } - break; - case AIEmoteCmdType.ON_PLAYER_LEADER_DAMAGED: - aIEmoteCmd = emoteCtrl.OnPlayerLeaderDamaged(_currentVirtualField); - if (aIEmoteCmd != null) - { - vfxBase = PlayEmotionDefault(aIEmoteCmd); - num = 2f; - } - break; - case AIEmoteCmdType.ON_DEBUG_SEARCH_ID: - aIEmoteCmd = emoteQuery.SearchEmoteByID(emoteInput); - if (aIEmoteCmd != null) - { - isAIEmoteRegistered = false; - return PlayEmotionDefault(aIEmoteCmd, isForcePlay: true); - } - break; - case AIEmoteCmdType.ON_DEBUG_SEARCH_CATEGORY: - { - IEnumerable enumerable = emoteQuery.SearchEmoteByCategory(emoteInput); - if (enumerable == null) - { - break; - } - SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); - foreach (AIEmoteCmd item in enumerable) - { - sequentialVfxPlayer.Register(PlayEmotionDefault(item, isForcePlay: true)); - sequentialVfxPlayer.Register(WaitVfx.Create(2f)); - } - ImmediateVfxMgr.GetInstance().Register(sequentialVfxPlayer); - isAIEmoteRegistered = false; - return NullVfx.GetInstance(); - } - } - if (vfxBase == NullVfx.GetInstance()) - { - isAIEmoteRegistered = false; - return NullVfx.GetInstance(); - } - IsThisTurnEmotePlayed = true; - SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); - if (num > 0f) - { - sequentialVfxPlayer2.Register(WaitVfx.Create(num)); - } - sequentialVfxPlayer2.Register(vfxBase); - if (num2 > 0f) - { - sequentialVfxPlayer2.Register(WaitVfx.Create(num2)); - } - sequentialVfxPlayer2.Register(InstantVfx.Create(delegate - { - isAIEmoteRegistered = false; - })); - return sequentialVfxPlayer2; - } - - private VfxBase PlayEmotionDefault(AIEmoteCmd emoteCmd, bool isForcePlay = false) - { - if (!isForcePlay) - { - if (emoteQuery.GetCategoryInterval(emoteCmd.CategoryKey) > 0) - { - return NullVfx.GetInstance(); - } - if (AIEmoteUtility.IsSystemEmoteKey(emoteCmd.CategoryKey) && ALLY.Turn < 4) - { - return NullVfx.GetInstance(); - } - if (!ALLY.IsSelfTurn) - { - emoteMng.OnOpponentTurnEmote(); - } - if (AIEmoteUtility.IsSystemEmoteKey(emoteCmd.CategoryKey)) - { - emoteQuery.SetInterval(emoteCmd.CategoryKey, AIStableRandom() % 2 + 1); - } - } - emoteMng.AddPlayedCountOnEmotePlaying(emoteCmd.CategoryKey); - if (emoteCmd.isAI) - { - return ALLY.Emotion.PlayEmotion((ClassCharaPrm.MotionType)emoteCmd.motionID, (ClassCharaPrm.FaceType)emoteCmd.faceID, emoteCmd.voiceID, emoteCmd.textID); - } - return OPPONENT.Emotion.PlayEmotion((ClassCharaPrm.MotionType)emoteCmd.motionID, (ClassCharaPrm.FaceType)emoteCmd.faceID, emoteCmd.voiceID, emoteCmd.textID); - } - - public bool IsBishop() - { - return paramQuery.GetClassID() == 7; - } - - public bool IsNecromancer() - { - return paramQuery.GetClassID() == 5; - } - - public bool IsRoyal() - { - return paramQuery.GetClassID() == 2; - } - - public bool IsAbleEvo() - { - if (ALLY.EvolveWaitTurnCount <= 0) - { - return ALLY.NowTurnEvol; - } - return false; - } - - public bool IsAllyCard(BattleCardBase card) - { - return PlayerPair.Self.IsPlayer == card.IsPlayer; - } - - public bool IsAllyCard(AIVirtualCard card) - { - return PlayerPair.Self.IsPlayer == card.IsPlayer; - } - - public bool IsOpponentCard(BattleCardBase card) - { - return PlayerPair.Self.IsPlayer != card.IsPlayer; - } - - public void SetPreDecidedTargets(AISelectedTargetInfoSet set) - { - PreDecidedTargets = set; - } - - public bool HasPlayerAbilityId(int id) - { - if (_playerAbilityIdList == null || _playerAbilityIdList.Count <= 0) - { - return false; - } - for (int i = 0; i < _playerAbilityIdList.Count; i++) - { - if (_playerAbilityIdList[i] == id) - { - return true; - } - } - return false; - } - - public void UpdateAICurrentVirtualField(bool isUsePreviousFieldParameter = true) - { - UpdateCurrentVirtualField(paramQuery, styleQuery, PlayerPair, EmptyPlayPtn, isUsePreviousFieldParameter); - } - - public abstract void Retire(); - - public abstract void Disconnect(); - - public abstract void Reconnect(); - - public abstract void CleanupStackedAction(); - - protected abstract void OnFinishOprAttack(); - - protected abstract void OnFinishOprTargetSelect(); - - protected abstract void OnBeforeTurnEnd(); - - public void TurnEnd() - { - OnBeforeTurnEnd(); - BattleCoroutine instance = BattleCoroutine.GetInstance(); - if (weakLogicCoroutine != null) - { - instance.StopCoroutine(weakLogicCoroutine); - weakLogicCoroutine = null; - } - EnemyAICoroutine.GetInstance().StopAllCoroutines(); - EnemyAIUtil.TurnEnd(BattleMgr, PlayerPair.Self.IsPlayer); - } - - public virtual void RegistActionOperationQueue(Action action) - { - AIOperationQueue.Enqueue(action); - } - - public virtual void ExecuteActionOperationQueue() - { - if (battleMgr.VfxMgr.IsEnd && AIOperationQueue.Count > 0) - { - AIOperationQueue.Dequeue().Call(); - if (!IsRunWeakLogic) - { - oprationQueueActCount++; - } - } - } - - protected abstract void CheckIsStackAction(); - - protected abstract void SetupThinkingInterval(); - - public int CalcHandNextTurnDamage(AIVirtualField field) - { - int num = 0; - List list = new List(); - List list2 = new List(); - foreach (AIVirtualCard allyHandCard in field.AllyHandCards) - { - if (allyHandCard.TagCollectionContainer.HasTag(AIPlayTagType.PlayoutNextTurn)) - { - list.Add(allyHandCard); - } - } - if (0 < list.Count) - { - int num2 = Mathf.Min(10, ALLY.PpTotal + 1); - int num3 = (int)Mathf.Pow(2f, list.Count); - for (int i = 0; i < num3; i++) - { - int num4 = 0; - int totalCost = 0; - ConvertPlayoutNextTurnHandPtnList(list, list2, i, out totalCost); - if (num2 < totalCost) - { - continue; - } - for (int j = 0; j < list2.Count; j++) - { - if (!list2[j].TagCollectionContainer.HasTag(AIPlayTagType.PlayoutNextTurn)) - { - continue; - } - PlayoutNextTurnTagCollection playoutNextTurnTags = list2[j].TagCollectionContainer.PlayoutNextTurnTags; - for (int k = 0; k < playoutNextTurnTags.TagList.Count; k++) - { - if (playoutNextTurnTags.TagList[k].CheckCondition(list[j], EmptyPlayPtn, field, null)) - { - num4 += (int)playoutNextTurnTags.TagList[k].EvalArg(list2[j], null, field, null); - } - } - } - if (num < num4) - { - num = num4; - } - } - } - return num; - } - - private void ConvertPlayoutNextTurnHandPtnList(List srcList, List dstList, int index, out int totalCost) - { - totalCost = 0; - int count = srcList.Count; - int num = index; - dstList.Clear(); - for (int i = 0; i < count; i++) - { - AIVirtualCard aIVirtualCard = srcList[i]; - int num2 = (int)Mathf.Pow(2f, count - i - 1); - if (0 < num / num2) - { - num -= num2; - dstList.Add(aIVirtualCard); - totalCost += aIVirtualCard.Cost; - } - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Cute; +using UnityEngine; +using Wizard.Battle.View.Vfx; + +namespace Wizard; + +public abstract class EnemyAI : IEnemyAI, IEnemyAIBattleInfoRecieveDataAccessor +{ + + public static float BREAKBONUS_RATE_IN_HAND = 0.75f; + + public static float BREAKBONUS_RATE_ON_FIELD = 0.1f; + + private static List _emptyPlayPtn = new List(); + + protected BattleManagerBase battleMgr; + + protected AIParamQuery paramQuery; + + protected AIStyleQuery styleQuery; + + protected AIEmoteMng emoteMng; + + protected AIEmoteCtrl emoteCtrl; + + protected AIEmoteQuery emoteQuery; + + public bool isUsedEvo; + + public List PlaySkipInfo; + + public bool IsBreakBeforePlay; + + private int spareSpace; + + protected bool isPlagueCityTagged; + + private float _previousFieldInplayValue; + + public AILethalPlan OutputLethalPlan; + + protected float m_fieldAdvantage; + + public bool cr_isOprAtk; + + public bool cr_isOprPlay; + + public bool cr_isTerminate; + + public bool is_onSelectSkillTarget; + + public bool IsTurnEndLethal; + + public bool IsFullSimulation; + + protected int _timeOverLogicSec; + + protected Coroutine weakLogicCoroutine; + + protected int oprationQueueActCount; + + public AITokenManager tokenManager; + + private AIVirtualField _currentVirtualField; + + public AIRealActionInformation LatestAction; + + public AIVirtualField BeforeLatestActionField; + + public BattlePlayerBase ALLY; + + public BattlePlayerBase OPPONENT; + + public AISinglePlayptnRecord BestPlayPtnRecord; + + protected IEnumerator aiCoroutine; + + protected bool isForceBreak; + + protected Queue AIOperationQueue; + + protected AIOperationProcessor OperationProcessor; + + public bool IsOpponentBarbarossaDestroyed; + + public Dictionary ReferenceIdTable; + + public Dictionary> ReferenceTribeTable; + + protected bool isAIEmoteRegistered; + + public Dictionary FieldHashAndValueTable; + + public Dictionary FieldHashAndThreatenTable; + + private AIFunctionResultContainer _funcResultContainer; + + private AIVariableResultContainer _valResultContainer; + + private List _playerAbilityIdList; + + public CardBasePrm.ClanType AISubClassType = CardBasePrm.ClanType.NONE; + + public CardBasePrm.ClanType PlayerSubClassType = CardBasePrm.ClanType.NONE; + + private System.Random stableRandom; + + protected bool _isStackAction; + + protected bool _isConnectNetwork = true; + + protected float _currentThinkingIntervalTime; + + protected bool _enabledThinkingCounter; + + protected float _elapsedThinkingTime; + + protected float _elapsedTurnTimeAfterTurnStartVfx; + + public static List EmptyPlayPtn => _emptyPlayPtn; + + public EnemyAI_Play EnemyAIPlay { get; private set; } + + public EnemyAI_Attack EnemyAIAttack { get; private set; } + + public EnemyAI_Skill EnemyAISkill { get; private set; } + + public EnemyAI_WeakLogic EnemyAIWeakLogic { get; private set; } + + public EnemyAIFusion EnemyAIFusion { get; private set; } + + public BattleManagerBase BattleMgr => battleMgr; + + public bool IsThisTurnEmotePlayed { get; protected set; } + + public AIAttachPlayerBattleEventCache PlayerBattleEvent { get; private set; } + + public AIAttachOperateMgrBattleEventCache OprMgrBattleEvent { get; private set; } + + public int PlayerCharaId { get; private set; } + + public bool IsEvoPermissionOnSimu { get; private set; } + + public AIVirtualCard CurrentBattleSimEvoCard { get; set; } + + public int CurrentBattleBeforeSimEvoEvolCount { get; set; } + + public List AllySuicideList { get; protected set; } + + public bool IsPlagueCityTagged => isPlagueCityTagged; + + public float FieldInplayValueDifference + { + get + { + if (CurrentVirtualField != null) + { + return _previousFieldInplayValue - CurrentVirtualField.GetInplayTotalValue(); + } + return 0f; + } + } + + public bool IsAllyFirst => ALLY.IsGameFirst; + + public bool IsBattleEnd => battleMgr.IsBattleEnd; + + public bool _isSetCardReady { get; protected set; } + + public bool IsRunWeakLogic { get; private set; } + + public AIVirtualField CurrentVirtualField => _currentVirtualField; + + public List AllyDeckCards { get; private set; } + + public List EnemyDeckCards { get; private set; } + + public List DiscardedCards { get; private set; } + + public AIPlayptnRecorder PlayPtnRecorder { get; private set; } + + public AISelectedTargetInfoSet PreDecidedTargets { get; private set; } + + public List BeforeLatestActionAllyDeckCards { get; private set; } + + public List BeforeLatestActionEnemyDeckCards { get; private set; } + + public BattlePlayerPair PlayerPair { get; private set; } + + public List BestPlayPtn + { + get + { + if (BestPlayPtnRecord != null) + { + return BestPlayPtnRecord.PlayPtn; + } + return EmptyPlayPtn; + } + } + + public bool IsAIExecution => aiCoroutine != null; + + public float FieldAdvantage => m_fieldAdvantage; + + public int SpareSpace => spareSpace; + + public AIFunctionResultContainer FuncResultContainer => _funcResultContainer; + + public AIVariableResultContainer ValResultContainer => _valResultContainer; + + public AIEmoteMng EmoteMng => emoteMng; + + public AIEmoteQuery EmoteQuery => emoteQuery; + + public AIParamQuery ParamQuery => paramQuery; + + public AIStyleQuery StyleQuery => styleQuery; + + public static int EnemyAIID { get; set; } = -1; + + public AIGenerateTagOwnerTable GenerateTagOwnerTable { get; } + + public AIBattleInfoReceivedData BattleInfoReceivedData { get; } + + public bool IsInVirutalSimulation { get; set; } + + public int TurnCount => PlayerPair.Self.Turn; + + public int OpponentTurnCount => PlayerPair.Opponent.Turn; + + public bool IsRankMatchAI { get; protected set; } + + public abstract bool IsStackAction { get; } + + public abstract bool IsConnectNetwork { get; } + + public bool IsStopThinkingLogic { get; protected set; } + + protected bool IsThinkingInterval => _currentThinkingIntervalTime > 0f; + + public IAIEmoteCtrl EmoteCtrl() + { + return emoteCtrl; + } + + public EnemyAI(BattleManagerBase mgr) + { + battleMgr = mgr; + EnemyAIPlay = new EnemyAI_Play(this); + EnemyAIAttack = new EnemyAI_Attack(this); + EnemyAISkill = new EnemyAI_Skill(this); + EnemyAIFusion = new EnemyAIFusion(this); + EnemyAIWeakLogic = new EnemyAI_WeakLogic(this); + PlayPtnRecorder = new AIPlayptnRecorder(); + paramQuery = new AIParamQuery(this); + styleQuery = new AIStyleQuery(this, paramQuery); + emoteCtrl = new AIEmoteCtrl(this); + emoteMng = new AIEmoteMng(this); + emoteQuery = new AIEmoteQuery(this); + paramQuery.SetUp(styleQuery); + stableRandom = new System.Random(emoteMng.EmoteRandomSeed); + AIOperationQueue = new Queue(); + OperationProcessor = new AIOperationProcessor(battleMgr, this); + IsOpponentBarbarossaDestroyed = false; + GenerateTagOwnerTable = new AIGenerateTagOwnerTable(); + BattleInfoReceivedData = new AIBattleInfoReceivedData(); + } + + public void ExecuteEnemyAI(bool useWait) + { + aiCoroutine = EnemyAI_Move(useWait); + EnemyAICoroutine.GetInstance().StartCoroutine(aiCoroutine); + } + + public void StopEnemyAI() + { + EnemyAICoroutine.GetInstance().StopAllCoroutines(); + aiCoroutine = null; + if (weakLogicCoroutine != null) + { + BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); + } + } + + public bool SetUpBattleState(int classId, AI_LOGIC_LV logicLv, string deckName, string styleName, string emoteName, int enemyAiID = -1) + { + AIDataLibrary aIDataLibrary = battleMgr.GameMgr.GetDataMgr().m_AIDataLibrary; + AIDeckData curDeck = aIDataLibrary.SearchDeckData(deckName); + paramQuery.SetDeck(classId, logicLv, curDeck, aIDataLibrary.GetCommonDic(), aIDataLibrary.GetAllyCommonDic()); + AIStyleData deckStyle = aIDataLibrary.SearchDeckStyle(styleName); + styleQuery.SetDeckStyle(deckStyle); + styleQuery.UpdateStyle(); + EnemyAIID = enemyAiID; + if (!IsRankMatchAI && EmoteQuery != null && emoteName != "") + { + AIEmoteSet aIEmoteSet = aIDataLibrary.SearchEmoteSet(emoteName); + if (aIEmoteSet != null) + { + EmoteQuery.SetEmoteSet(aIEmoteSet); + } + } + return true; + } + + public void InitOnGame(BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer) + { + tokenManager = new AITokenManager(selfBattlePlayer, opponentBattlePlayer, this); + ALLY = selfBattlePlayer; + OPPONENT = opponentBattlePlayer; + PlayerPair = new BattlePlayerPair(selfBattlePlayer, opponentBattlePlayer); + DataMgr dataMgr = battleMgr.GameMgr.GetDataMgr(); + if (dataMgr != null) + { + PlayerCharaId = dataMgr.GetPlayerCharaId(); + AISubClassType = (CardBasePrm.ClanType)dataMgr.GetEnemySubClassId(); + PlayerSubClassType = (CardBasePrm.ClanType)dataMgr.GetPlayerSubClassId(); + } + styleQuery.UpdateStyle(); + isUsedEvo = false; + IsEvoPermissionOnSimu = true; + PlaySkipInfo = null; + IsBreakBeforePlay = false; + BestPlayPtnRecord = null; + m_fieldAdvantage = 0f; + is_onSelectSkillTarget = false; + IsOpponentBarbarossaDestroyed = false; + IsThisTurnEmotePlayed = false; + PlayerBattleEvent = new AIAttachPlayerBattleEventCache(); + OprMgrBattleEvent = new AIAttachOperateMgrBattleEventCache(); + OperateMgr operateMgr = selfBattlePlayer.BattleMgr.OperateMgr; + AIAttachEventToBattleModuleUtility.SetupEventWhenInitGame(selfBattlePlayer, opponentBattlePlayer, operateMgr, this); + IsTurnEndLethal = false; + FieldHashAndValueTable = new Dictionary(); + FieldHashAndThreatenTable = new Dictionary(); + _funcResultContainer = new AIFunctionResultContainer(); + _valResultContainer = new AIVariableResultContainer(); + LatestAction = null; + BeforeLatestActionField = null; + IsInVirutalSimulation = false; + } + + protected void UpdateCurrentVirtualField(AIParamQuery paramQuery, AIStyleQuery styleQuery, BattlePlayerPair pair, List bestPlayPtn, bool isUsePreviousFieldParameter) + { + AIVirtualField currentVirtualField = _currentVirtualField; + _previousFieldInplayValue = ((_currentVirtualField != null) ? _currentVirtualField.GetInplayTotalValue() : 0f); + AIVirtualFieldBuildParameterCollction buildParameters = ((!isUsePreviousFieldParameter) ? new AIVirtualFieldBuildParameterCollction(null) + { + PlayedCardContainer = currentVirtualField.PlayedCardContainer + } : new AIVirtualFieldBuildParameterCollction(currentVirtualField)); + _currentVirtualField = new AIVirtualField(this, paramQuery, styleQuery, pair, bestPlayPtn, buildParameters); + GenerateTagOwnerTable.RegisterAllGenerateTagOwner(_currentVirtualField); + UpdateDeckCards(pair); + UpdateDiscardedCards(pair.Self); + tokenManager.UpdateTokenPool(_currentVirtualField); + _currentVirtualField.InitializeBothDefValue(); + } + + private void UpdateDeckCards(BattlePlayerPair pair) + { + if (pair.Self.DeckCardList == null || pair.Opponent.DeckCardList == null) + { + AIConsoleUtility.LogError("UpdateDeckCards error!! deck is null!!!!!"); + } + List> list; + if (AllyDeckCards == null) + { + AllyDeckCards = new List(); + list = null; + } + else + { + list = new List>(); + for (int i = 0; i < AllyDeckCards.Count; i++) + { + AIVirtualCard aIVirtualCard = AllyDeckCards[i]; + list.Add(new Tuple(aIVirtualCard.CardIndex, aIVirtualCard.TagCollectionContainer.AttachedTags)); + } + AllyDeckCards.Clear(); + } + for (int j = 0; j < pair.Self.DeckCardList.Count; j++) + { + AIVirtualCard aIVirtualCard2 = new DeckVirtualCard(pair.Self.DeckCardList[j], CurrentVirtualField); + aIVirtualCard2.InitializeTags(ParamQuery, FindInheritanceAttachedTagForDeckCard(aIVirtualCard2.CardIndex, list), null); + AllyDeckCards.Add(aIVirtualCard2); + } + if (EnemyDeckCards == null) + { + EnemyDeckCards = new List(); + list = null; + } + else + { + list = new List>(); + for (int k = 0; k < EnemyDeckCards.Count; k++) + { + AIVirtualCard aIVirtualCard3 = EnemyDeckCards[k]; + list.Add(new Tuple(aIVirtualCard3.CardIndex, aIVirtualCard3.TagCollectionContainer.AttachedTags)); + } + EnemyDeckCards.Clear(); + } + for (int l = 0; l < pair.Opponent.DeckCardList.Count; l++) + { + AIVirtualCard aIVirtualCard4 = new DeckVirtualCard(pair.Opponent.DeckCardList[l], CurrentVirtualField); + aIVirtualCard4.InitializeTags(ParamQuery, FindInheritanceAttachedTagForDeckCard(aIVirtualCard4.CardIndex, list), null); + EnemyDeckCards.Add(aIVirtualCard4); + } + } + + private AIAttachedTagCollection FindInheritanceAttachedTagForDeckCard(int deckCardIndex, List> attachedTagPool) + { + if (attachedTagPool == null || attachedTagPool.Count <= 0) + { + return null; + } + for (int i = 0; i < attachedTagPool.Count; i++) + { + Tuple tuple = attachedTagPool[i]; + if (deckCardIndex == tuple.first) + { + return tuple.second; + } + } + return null; + } + + private void UpdateDiscardedCards(BattlePlayerBase self) + { + if (self.DiscardedCardList != null) + { + if (DiscardedCards == null) + { + DiscardedCards = new List(); + } + else + { + DiscardedCards.Clear(); + } + for (int i = 0; i < self.DiscardedCardList.Count; i++) + { + DiscardedCards.Add(new DiscardedVirtualCard(self.DiscardedCardList[i], _currentVirtualField)); + } + } + } + + public void SaveBeforeLatestActionInformation() + { + BeforeLatestActionField = new AIVirtualField(_currentVirtualField, isLatestAction: true); + BeforeLatestActionAllyDeckCards = new List(AllyDeckCards); + BeforeLatestActionEnemyDeckCards = new List(EnemyDeckCards); + } + + public void LoadBufferedBattleState() + { + AISetUpData setupInfoBuf = battleMgr.GameMgr.GetDataMgr().m_AIDataLibrary.SetupInfoBuf; + if (setupInfoBuf != null) + { + SetUpBattleState(setupInfoBuf.classID, setupInfoBuf.logicLv, setupInfoBuf.deckName, setupInfoBuf.styleName, setupInfoBuf.emoteName, setupInfoBuf.enemyAiID); + if (!IsRankMatchAI && EmoteQuery != null) + { + EmoteQuery.SetOnOffEmote(setupInfoBuf.doesUseEmote, setupInfoBuf.useInnerEmote); + } + if (setupInfoBuf.specialAbilityList != null) + { + _playerAbilityIdList = new List(setupInfoBuf.specialAbilityList); + } + } + } + + private void InitOnTurnStart() + { + PlaySkipInfo = null; + IsBreakBeforePlay = false; + BestPlayPtnRecord = null; + m_fieldAdvantage = 0f; + EnemyAIAttack.InitOnTurnStart(); + CurrentBattleSimEvoCard = null; + CurrentBattleBeforeSimEvoEvolCount = ALLY.CurrentEpCount; + if (paramQuery.GetLogicLv() == AI_LOGIC_LV.MIDDLE) + { + int num = ((CalcFieldAdvantage() <= -8f) ? 100 : 30); + int num2 = AIStableRandom(100); + IsEvoPermissionOnSimu = num2 <= num; + } + else + { + IsEvoPermissionOnSimu = true; + } + IsInVirutalSimulation = false; + IsTurnEndLethal = false; + tokenManager.RegistPermanentlyToken(); + FieldHashAndValueTable.Clear(); + FieldHashAndThreatenTable.Clear(); + } + + public void Mulligan(List dstList, BattlePlayerBase selfBattlePlayer, BattlePlayerBase opponentBattlePlayer) + { + UpdateCurrentVirtualField(paramQuery, styleQuery, new BattlePlayerPair(selfBattlePlayer, opponentBattlePlayer), EmptyPlayPtn, isUsePreviousFieldParameter: true); + _currentVirtualField.InitializeGameStartInnerTags(); + int count = CurrentVirtualField.AllyHandCards.Count; + int num = 0; + int[] array = new int[count]; + for (int i = 0; i < count; i++) + { + array[i] = 0; + } + for (int j = 0; j < count - 1; j++) + { + AIVirtualCard aIVirtualCard = CurrentVirtualField.AllyHandCards[j]; + for (int k = j + 1; k < count; k++) + { + if (CurrentVirtualField.AllyHandCards[k].BaseId == aIVirtualCard.BaseId) + { + array[j] = 2; + break; + } + } + } + for (int l = 0; l < count; l++) + { + if (array[l] == 0) + { + AIVirtualCard card = CurrentVirtualField.AllyHandCards[l]; + if (paramQuery.IsEnabledTag(card, CurrentVirtualField, AIPlayTagType.MulliganKeep, EmptyPlayPtn, null)) + { + array[l] = 1; + num++; + } + if (paramQuery.IsEnabledTag(card, CurrentVirtualField, AIPlayTagType.MulliganChange, EmptyPlayPtn, null)) + { + array[l] = 2; + } + } + } + if (num == count) + { + return; + } + bool flag = false; + for (int m = 0; m < count; m++) + { + AIVirtualCard aIVirtualCard2 = CurrentVirtualField.AllyHandCards[m]; + if (array[m] == 0 && aIVirtualCard2.Cost == 2 && isKeepableCard(aIVirtualCard2)) + { + array[m] = 1; + num++; + flag = true; + break; + } + } + if (num == count) + { + return; + } + bool flag2 = false; + bool flag3 = false; + if (num > 0 && flag) + { + for (int n = 0; n < count; n++) + { + AIVirtualCard aIVirtualCard3 = CurrentVirtualField.AllyHandCards[n]; + if ((aIVirtualCard3.Cost == 1 || aIVirtualCard3.Cost == 3) && array[n] == 0 && isKeepableCard(aIVirtualCard3)) + { + array[n] = 1; + num++; + if (aIVirtualCard3.Cost == 1) + { + flag2 = true; + } + else if (aIVirtualCard3.Cost == 3) + { + flag3 = true; + } + break; + } + } + } + if (num == count) + { + return; + } + if (num > 0 && flag && (flag2 || flag3)) + { + for (int num2 = 0; num2 < count; num2++) + { + AIVirtualCard aIVirtualCard4 = CurrentVirtualField.AllyHandCards[num2]; + if (array[num2] == 0) + { + if (!isKeepableCard(aIVirtualCard4)) + { + break; + } + if ((flag2 && aIVirtualCard4.Cost == 3) || (flag3 && aIVirtualCard4.Cost == 4)) + { + array[num2] = 1; + num++; + break; + } + } + } + } + if (num == count) + { + return; + } + for (int num3 = 0; num3 < count; num3++) + { + if (array[num3] == 2 || array[num3] == 0) + { + dstList.Add(CurrentVirtualField.AllyHandCards[num3].BaseCard); + } + } + bool isKeepableCard(AIVirtualCard aIVirtualCard5) + { + if (!aIVirtualCard5.IsUnit) + { + if (IsBishop()) + { + return aIVirtualCard5.IsAmulet; + } + return false; + } + return true; + } + } + + public void ChangeWeakLogic() + { + if (battleMgr is SingleBattleMgr singleBattleMgr) + { + singleBattleMgr.RecordChangeAI("weak", oprationQueueActCount); + oprationQueueActCount = 0; + } + IsRunWeakLogic = true; + } + + public void ChangeNormalLogic() + { + IsRunWeakLogic = false; + _timeOverLogicSec = 0; + } + + protected virtual IEnumerator WeakLogicTimerCoroutine() + { + _timeOverLogicSec = 0; + while (!IsBattleEnd) + { + if (!IsRunWeakLogic) + { + _timeOverLogicSec++; + if (_timeOverLogicSec > 7 && battleMgr.VfxMgr.IsEnd) + { + ChangeWeakLogic(); + } + } + yield return new WaitForSecondsRealtime(1f); + } + } + + public bool IsLethal(AIVirtualCard tagOwner, AIVirtualField field, List playPtn, AISituationInfo situation) + { + if (situation is AIVirtualTargetSelectAction { forceLethalMode: not false }) + { + return true; + } + AIVariableResultContainer valResultContainer = field.AI.ValResultContainer; + ulong hash = AIFunctionResultHashCalculator.GetHash(tagOwner, field, playPtn, situation, 0uL); + if (valResultContainer.GetContainsResultValue(AIScriptTokenVariableType.IS_LETHAL, hash, out var getResult)) + { + return getResult == 1f; + } + AISinglePlayptnRecord playPtnRecord = PlayPtnRecorder.FindMatchedPlayPtnRecord(playPtn, field); + bool flag = AIPlayOutChecker.CalculatePlayOutDamageProspected(paramQuery, field, playPtnRecord, this) >= field.EnemyClass.Life; + valResultContainer.CheckDuplicateAndAddRecord(AIScriptTokenVariableType.IS_LETHAL, hash, flag ? 1f : 0f, $"IsLethal(): Already hashed target and not equal value. CardName:[{tagOwner.CardName}] hash:[{hash}]"); + return flag; + } + + private IEnumerator EnemyAI_Move(bool useWait) + { + is_onSelectSkillTarget = false; + IsRunWeakLogic = false; + IsStopThinkingLogic = false; + if (weakLogicCoroutine != null) + { + BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); + weakLogicCoroutine = null; + } + if (!BattleMgr.IsRecovery) + { + weakLogicCoroutine = BattleCoroutine.GetInstance().StartCoroutine(WeakLogicTimerCoroutine()); + } + InitOnTurnStart(); + WaitForSeconds shortWait = new WaitForSeconds(0.2f); + WaitForSeconds longWait = new WaitForSeconds(0.5f); + isForceBreak = false; + oprationQueueActCount = 0; + while (true) + { + if (IsRankMatchAI && IsStopThinkingLogic) + { + continue; + } + yield return useWait ? shortWait : null; + if (AIOperationQueue.Count > 0) + { + if (!battleMgr.VfxMgr.IsEnd || (IsRankMatchAI && IsThinkingInterval)) + { + continue; + } + if (IsRankMatchAI) + { + if (_isConnectNetwork) + { + AIOperationQueue.Dequeue().Call(); + oprationQueueActCount++; + _isStackAction = false; + } + else + { + _isStackAction = true; + } + } + else + { + AIOperationQueue.Dequeue().Call(); + oprationQueueActCount++; + } + continue; + } + if (isForceBreak) + { + break; + } + if (battleMgr.IsBattleEnd || is_onSelectSkillTarget) + { + continue; + } + BestPlayPtnRecord = null; + ChangeNormalLogic(); + EnemyAIPlay.InitOnIterationStart(); + EnemyAIAttack.InitOnIterationStart(); + EnemyAIFusion.InitOnIterationStart(); + PlaySkipInfo = null; + IsBreakBeforePlay = false; + AllySuicideList = new List(); + spareSpace = 5; + IsFullSimulation = false; + PreDecidedTargets = null; + LatestAction = null; + BeforeLatestActionField = null; + _funcResultContainer.Clear(); + _valResultContainer.Clear(); + if (IsRankMatchAI) + { + _enabledThinkingCounter = true; + _elapsedThinkingTime = 0f; + } + AllySuicideList = GetSuicideAllyFollowerSequence(CurrentVirtualField, paramQuery, styleQuery); + PlayPtnRecorder = new AIPlayptnRecorder(); + PlayPtnRecorder.CreateValidPlayPtnList(_currentVirtualField); + BestPlayPtnRecord = PlayPtnRecorder.GetEmptyPlayPtnRecord(); + yield return EnemyAICoroutine.GetInstance().StartCoroutine(HandPlayEstimationCoroutine()); + m_fieldAdvantage = CalcFieldAdvantage(); + isPlagueCityTagged = CurrentVirtualField.IsPlagueCity(); + VfxBase emote = GetEmote(AIEmoteCmdType.ON_ITERATION_START); + cr_isTerminate = false; + IsTurnEndLethal = false; + yield return EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAIAttack.Cr_BattleAI_ImmediateAttack()); + if (cr_isTerminate) + { + if (!IsTurnEndLethal) + { + continue; + } + break; + } + cr_isOprPlay = false; + IsTurnEndLethal = false; + yield return EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAIPlay.BattleAI_HandPlay()); + AIGetOnSimulationUtility.RegisterGetOnTokenInPlayPtn(this); + if (cr_isOprPlay) + { + if (!IsTurnEndLethal) + { + continue; + } + break; + } + if (paramQuery.GetLogicLv() == AI_LOGIC_LV.STRONG || paramQuery.GetLogicLv() == AI_LOGIC_LV.MIDDLE) + { + cr_isOprAtk = false; + yield return EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAIAttack.BattleAI_UseHighSimu()); + if (cr_isOprAtk) + { + continue; + } + } + else if (paramQuery.GetLogicLv() == AI_LOGIC_LV.WEAK && (EnemyAIWeakLogic.BattleAI_AttackWeak() || EnemyAIWeakLogic.BattleAI_EvoWeak())) + { + continue; + } + if ((PlaySkipInfo != null || IsBreakBeforePlay) && ((BestPlayPtn != null && BestPlayPtn.Count > 0) || EnemyAIPlay.IsFusion)) + { + yield return EnemyAICoroutine.GetInstance().StartCoroutine(HandCardAction()); + if (cr_isOprPlay) + { + if (IsTurnEndLethal) + { + break; + } + continue; + } + } + if ((paramQuery.GetLogicLv() != AI_LOGIC_LV.WEAK || !EnemyAIAttack.BattleAI_TurnEndAttack()) && AIOperationQueue.Count <= 0) + { + break; + } + } + yield return useWait ? longWait : null; + while (!battleMgr.VfxMgr.IsEnd) + { + yield return null; + } + if (IsRankMatchAI && !battleMgr.IsRecovery) + { + float delayTurnEndTime = StyleQuery.GetDelayTurnEndTime(CurrentVirtualField.AllyClass, BestPlayPtn); + while (_elapsedTurnTimeAfterTurnStartVfx < delayTurnEndTime) + { + yield return null; + } + } + emoteQuery.OnOperation(); + VfxBase vfxBase = ((TurnCount != 1) ? GetEmote(AIEmoteCmdType.ON_ALLY_TURN_END) : GetEmote(AIEmoteCmdType.ON_FIRST_TURN)); + if (vfxBase != null) + { + battleMgr.VfxMgr.RegisterSequentialVfx(vfxBase); + } + IsThisTurnEmotePlayed = false; + battleMgr.VfxMgr.RegisterSequentialVfx(battleMgr.OperateMgr.TurnEndOperation(ALLY.IsPlayer)); + if (weakLogicCoroutine != null) + { + BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); + weakLogicCoroutine = null; + } + } + + public IEnumerator HandCardAction() + { + if (EnemyAIPlay.PriorityCard == null) + { + AIConsoleUtility.LogError("HandCardAction error!! PriorityCard is null!!!!!"); + cr_isOprPlay = false; + yield break; + } + if (EnemyAIPlay.IsFusion && EnemyAIPlay.FusionPattern != null) + { + EnemyAIFusion.SetFusionSituation(EnemyAIPlay.FusionPattern); + if (EnemyAIFusion.FusionAI()) + { + cr_isOprPlay = true; + } + yield break; + } + AIVirtualCard aIVirtualCard = EnemyAIPlay.PriorityCard.FindRealActor(BestPlayPtnRecord); + AIVirtualTargetSelectAction situation = new AIVirtualTargetSelectAction(aIVirtualCard, EnemyAIPlay.PriorityCard, AIOperationType.PLAY); + int playSpaceRequired = CurrentVirtualField.GetPlaySpaceRequired(aIVirtualCard, BestPlayPtn, situation); + int num = 6 - CurrentVirtualField.CardListSet.AllyClassAndInplayCards.Count; + bool flag = true; + if (playSpaceRequired > num) + { + flag = false; + } + else if (EnemyAIPlay.BestPlayPtnWithToken != null) + { + bool num2 = StyleQuery.IsPlayBreak(EnemyAIPlay.PriorityCard, BestPlayPtn, null); + int count = EnemyAIPlay.BestPlayPtnWithToken.TokenPtn[0].TokenInfoPairList.Count; + if (num2) + { + int allyLastwordTokenCount = EnemyAIPlay.PriorityCard.GetAllyLastwordTokenCount(BestPlayPtn); + count += allyLastwordTokenCount; + } + else + { + count += playSpaceRequired; + } + if (count > num) + { + flag = false; + } + } + if (EnemyAIPlay.InstantAttackActionInfo != null && !flag) + { + int item = CurrentVirtualField.AllyHandCards.IndexOf(EnemyAIPlay.PriorityCard); + int index = EnemyAIPlay.BestPlayPtnWithToken.PlayPtn.IndexOf(item); + TokenPlayPattern tokenPlayPattern = EnemyAIPlay.BestPlayPtnWithToken.TokenPtn[index]; + if (CurrentVirtualField.GetPlaySpaceRequired(EnemyAIPlay.PriorityCard, BestPlayPtn, situation, needsTokenCount: false) + tokenPlayPattern.TokenInfoPairList.Count > 6 - CurrentVirtualField.CardListSet.AllyClassAndInplayCards.Count) + { + AIVirtualCard aIVirtualCard2 = null; + if (EnemyAIPlay.InstantAttackActionInfo is AIVirtualAttackInfo aIVirtualAttackInfo) + { + aIVirtualCard2 = aIVirtualAttackInfo.AttackTarget; + } + if (aIVirtualCard2 != null) + { + OprAttack(EnemyAIPlay.InstantAttackActionInfo); + cr_isOprPlay = true; + } + else + { + AIConsoleUtility.LogError("InstantAttack error!! Cannot find attack target!!!!!"); + } + yield break; + } + } + if (!EnemyAIPlay.PriorityCard.BaseCard.Movable()) + { + cr_isOprPlay = false; + yield break; + } + if (EnemyAIPlay.PriorityCardPlayInfo != null && EnemyAIPlay.PriorityCardPlayInfo.HasPreDecidedSelectTargets) + { + List list = new List(); + AISelectedTargetInfoSet preDecidedSelectTargets = EnemyAIPlay.PriorityCardPlayInfo.PreDecidedSelectTargets; + for (int i = 0; i < AISelectedTargetInfoSet.LENGTH; i++) + { + AISelectedTargetInfo aISelectedTargetInfo = preDecidedSelectTargets.Get(i); + if (aISelectedTargetInfo != null && aISelectedTargetInfo.HasTarget) + { + for (int j = 0; j < aISelectedTargetInfo.Targets.Count; j++) + { + list.Add(aISelectedTargetInfo.Targets[j].BaseCard); + } + } + } + EnemyAISkill.SetPreDecidedTarget(list); + SetPreDecidedTargets(preDecidedSelectTargets); + } + OprPlay(EnemyAIPlay.PriorityCard, BestPlayPtnRecord); + cr_isOprPlay = true; + } + + public void SelectSkillTarget(AIVirtualCard actCard, AIOperationType operationType, AISinglePlayptnRecord playptnRecord) + { + is_onSelectSkillTarget = true; + AISinglePlayptnRecord aISinglePlayptnRecord = playptnRecord; + List list = ((playptnRecord != null) ? playptnRecord.PlayPtn : EmptyPlayPtn); + AIVirtualCard aIVirtualCard = _currentVirtualField.SearchVirtualCard(actCard); + AIVirtualCard aIVirtualCard2 = ((operationType != AIOperationType.PLAY || list == null || list.Count <= 0) ? aIVirtualCard : aIVirtualCard.FindRealActor(aISinglePlayptnRecord)); + List list2 = list; + if (aIVirtualCard2.HasDestroyPlayPtnTag(operationType)) + { + list2 = ((operationType != AIOperationType.PLAY) ? EmptyPlayPtn : new List { _currentVirtualField.AllyHandCards.IndexOf(actCard) }); + aISinglePlayptnRecord = PlayPtnRecorder.FindMatchedPlayPtnRecord(list2, _currentVirtualField); + } + AIVirtualTargetSelectAction aIVirtualTargetSelectAction = new AIVirtualTargetSelectAction(aIVirtualCard2, aIVirtualCard, operationType, (AISelectedTargetInfoSet)null); + if (operationType == AIOperationType.PLAY && PreDecidedTargets != null) + { + aIVirtualTargetSelectAction.SelectedTargets = PreDecidedTargets; + } + List list3 = aIVirtualCard2.CreateAIVirtualSelectInfo(_currentVirtualField, aIVirtualTargetSelectAction); + if (aIVirtualTargetSelectAction.GetChoiceTarget() != null) + { + SetPreDecidedTargets(aIVirtualTargetSelectAction.SelectedTargets); + } + AIVirtualCard aIVirtualCard3 = null; + if (list2 != null) + { + switch (operationType) + { + case AIOperationType.EVOLVE: + if (list2.Count > 0) + { + aIVirtualCard3 = _currentVirtualField.AllyHandCards[list2[0]]; + } + break; + case AIOperationType.PLAY: + if (list2.Count > 1) + { + aIVirtualCard3 = _currentVirtualField.AllyHandCards[list2[1]]; + } + break; + } + } + PlayedCardInfo nextPlayCardInfo = null; + if (aIVirtualCard3 != null && aISinglePlayptnRecord != null) + { + nextPlayCardInfo = aISinglePlayptnRecord.FindPlayedCardInfo(aIVirtualCard3); + } + AIVirtualTargetSelectSimulationInfo simulationInfo = new AIVirtualTargetSelectSimulationInfo + { + OriginalActor = aIVirtualCard, + RealActor = aIVirtualCard2, + SelectInfoList = list3, + OperationType = operationType, + NextPlayCardInfo = nextPlayCardInfo, + IsFirstAction = true + }; + if (list3 != null && list3.Count > 0) + { + EnemyAICoroutine.GetInstance().StartCoroutine(AIVirtualTargetSelectSimulator.ExecuteTargetSelect(simulationInfo, _currentVirtualField, aISinglePlayptnRecord)); + } + else + { + EnemyAICoroutine.GetInstance().StartCoroutine(EnemyAISkill._Cr_SelectSkillTarget(actCard, operationType, aISinglePlayptnRecord)); + } + PreDecidedTargets = null; + } + + protected IEnumerator HandPlayEstimationCoroutine() + { + int handCardCount = ALLY.HandCardList.Count; + BattlePlayerPair sourcePair = new BattlePlayerPair(ALLY, OPPONENT); + int index = 0; + while (index < handCardCount) + { + CurrentVirtualField.AllyHandCards[index].CreateHandPlayEstimator(paramQuery, index, sourcePair, this); + yield return null; + int num = index + 1; + index = num; + } + } + + public static List GetSuicideAllyFollowerSequence(AIVirtualField field, AIParamQuery ParamQuery, AIStyleQuery styleQuery) + { + AIVirtualField aIVirtualField = new AIVirtualField(field); + List list = new List(); + for (int i = 0; i < aIVirtualField.AllyInplayCards.Count; i++) + { + AIVirtualCard aIVirtualCard = aIVirtualField.AllyInplayCards[i]; + if (!aIVirtualCard.IsUnit || !aIVirtualCard.IsAttackable(EmptyPlayPtn)) + { + continue; + } + if (list.Count == 0) + { + list.Add(aIVirtualCard); + continue; + } + int num = 0; + for (num = 0; num < list.Count; num++) + { + AIVirtualCard aIVirtualCard2 = list[num]; + if (aIVirtualCard.Value < aIVirtualCard2.Value) + { + break; + } + } + list.Insert(num, aIVirtualCard); + } + if (list == null || list.Count <= 0) + { + return new List(); + } + List list2 = new List(); + for (int j = 0; j < list.Count; j++) + { + AIVirtualCard sourceCard = list[j]; + list2.Add(new AIVirtualAttackInfo(sourceCard, isAttackFollower: true)); + } + List list3 = new List(); + for (int k = 0; k < aIVirtualField.EnemyInplayCards.Count; k++) + { + AIVirtualCard aIVirtualCard3 = aIVirtualField.EnemyInplayCards[k]; + if (!aIVirtualCard3.IsUnit) + { + continue; + } + if (list3.Count == 0) + { + list3.Add(aIVirtualCard3); + continue; + } + int num2 = 0; + for (num2 = 0; num2 < list3.Count; num2++) + { + AIVirtualCard aIVirtualCard4 = list3[num2]; + if ((aIVirtualCard3.IsGuard || !aIVirtualCard4.IsGuard) && ((aIVirtualCard3.IsGuard && !aIVirtualCard4.IsGuard) || aIVirtualCard3.IsKiller || aIVirtualCard3.Attack > aIVirtualCard4.Attack)) + { + break; + } + } + list3.Insert(num2, aIVirtualCard3); + } + BattleSequencer.ExecSimulation(aIVirtualField, list2, list3, new SimulationSetting(isHandRemovalValid: false, useLeaderAttackPreCheck: false, noSkipAttack: true, checkAct: false)); + list.RemoveAll((AIVirtualCard c) => !c.IsDead); + List list4 = new List(); + for (int num3 = 0; num3 < list.Count; num3++) + { + for (int num4 = 0; num4 < field.AllyInplayCards.Count; num4++) + { + if (field.AllyInplayCards[num4].CardIndex == list[num3].CardIndex && field.AllyInplayCards[num4].BaseId == list[num3].BaseId) + { + list4.Add(field.AllyInplayCards[num4]); + break; + } + } + } + return list4; + } + + public float GetEvoPenalty() + { + float num = 4f; + if (!isUsedEvo && TurnCount >= 6) + { + num /= 2f; + } + return num; + } + + public static int GetBaseId(int id) + { + return CardMaster.GetInstanceForBattle().GetCardParameterFromId(id).BaseCardId; + } + + public int AIStableRandom() + { + return stableRandom.Next(); + } + + public int AIStableRandom(int val) + { + return (int)Math.Floor((double)val * stableRandom.NextDouble()); + } + + public float CalcFieldAdvantage() + { + float num = 0f; + for (int i = 0; i < CurrentVirtualField.AllyInplayCards.Count; i++) + { + float num2 = CurrentVirtualField.AllyInplayCards[i].EvaluateValueOnField(EmptyPlayPtn, null, useStyle: true); + if (num2 > 0f) + { + num += num2; + } + } + float num3 = 0f; + for (int j = 0; j < CurrentVirtualField.EnemyInplayCards.Count; j++) + { + float num4 = CurrentVirtualField.EnemyInplayCards[j].EvaluateValueOnField(EmptyPlayPtn, null, useStyle: true); + if (num4 > 0f) + { + num3 += num4; + } + } + return num - num3; + } + + public int GetAllySpaceNum() + { + return 5 - CurrentVirtualField.AllyInplayCards.Count; + } + + public void OprEvolution(AIVirtualCard virtualCard) + { + AIOperationQueue.Enqueue(delegate + { + SetupThinkingInterval(); + isUsedEvo = true; + emoteQuery.OnOperation(); + SelectSkillTarget(virtualCard, AIOperationType.EVOLVE, BestPlayPtnRecord); + emoteMng.OnOperationRequest(); + }); + } + + public void OprPlay(AIVirtualCard card, AISinglePlayptnRecord playptnRecord) + { + AIVirtualCard currentFieldCard = _currentVirtualField.SearchVirtualCard(card); + AIOperationQueue.Enqueue(delegate + { + SetupThinkingInterval(); + emoteMng.EvalAllyOnCardPlay(currentFieldCard, playptnRecord); + emoteQuery.OnOperation(); + _isSetCardReady = false; + SelectSkillTarget(currentFieldCard, AIOperationType.PLAY, playptnRecord); + _isSetCardReady = true; + emoteMng.OnOperationRequest(); + }); + } + + public void OprAttack(AISituationInfo situation) + { + AIVirtualAttackInfo attackSituation = situation as AIVirtualAttackInfo; + if (attackSituation == null || attackSituation.Actor == null || attackSituation.AttackTarget == null) + { + AIConsoleUtility.LogError("OprAttack error!!! situation is invalid"); + return; + } + AIOperationQueue.Enqueue(delegate + { + AIRealBattleCardSearcher.SearchAttackPairFromSituation(PlayerPair, attackSituation, out var attacker, out var attackTarget); + if (attackTarget != null && attackTarget != null) + { + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + VfxBase emote = GetEmote(AIEmoteCmdType.ON_ALLY_ATTACK, situation); + sequentialVfxPlayer.Register(emote); + if (AttackSelectControl.CanCardAttackTarget(attacker, attackTarget, attackTarget.SelfBattlePlayer.InPlayCards)) + { + VfxBase vfx = battleMgr.OperateMgr.Attack(attacker, attackTarget, ALLY.IsPlayer); + sequentialVfxPlayer.Register(vfx); + battleMgr.VfxMgr.RegisterSequentialVfx(sequentialVfxPlayer); + } + else + { + if (attackTarget != null) + { + _ = attacker.BaseParameter.CardName; + } + _ = attackTarget?.BaseParameter.CardName; + isForceBreak = true; + } + } + else + { + isForceBreak = true; + } + emoteMng.OnOperationRequest(); + if (IsRankMatchAI) + { + CheckIsStackAction(); + } + }); + } + + public void OprTargetSelect(AIVirtualCard virtualActor, AISelectedTargetInfoSet targetInfoSet, AIOperationType operationType) + { + AIOperationQueue.Enqueue(delegate + { + if (!battleMgr.IsBattleEnd) + { + AIVirtualTargetSelectAction situation = new AIVirtualTargetSelectAction(virtualActor, virtualActor, operationType, targetInfoSet); + VfxBase vfx = null; + switch (operationType) + { + case AIOperationType.EVOLVE: + vfx = OperationProcessor.AIEvolutionCard(situation); + break; + case AIOperationType.PLAY: + vfx = OperationProcessor.AIPlayCard(situation); + break; + case AIOperationType.FUSION: + vfx = OperationProcessor.AIFusionCard(situation); + break; + } + is_onSelectSkillTarget = false; + battleMgr.VfxMgr.RegisterSequentialVfx(vfx); + emoteMng.OnOperationRequest(); + if (IsRankMatchAI) + { + SetupThinkingInterval(); + CheckIsStackAction(); + } + } + }); + EnemyAISkill.ClearPreDecidedTarget(); + } + + public bool OprLethalAction(AISituationInfo action) + { + AIVirtualCard originalCard = action.OriginalCard; + AISelectedTargetInfoSet selectedTargets = action.SelectedTargets; + AIOperationType actionType = action.ActionType; + switch (actionType) + { + case AIOperationType.EVOLVE: + case AIOperationType.PLAY: + OprTargetSelect(originalCard, selectedTargets, actionType); + return true; + case AIOperationType.ATTACK: + OprAttack(action); + return true; + default: + return false; + } + } + + public static bool IsSameValue(float value1, float value2) + { + return (int)Math.Round(value1 * 1000f) == (int)Math.Round(value2 * 1000f); + } + + public static bool IsLargerThan(float value1, float value2) + { + return (int)Math.Round(value1 * 1000f) > (int)Math.Round(value2 * 1000f); + } + + public virtual VfxBase GetEmote(AIEmoteCmdType cmdType, AISituationInfo situation = null, ClassCharaPrm.EmotionType receivedEmoteType = ClassCharaPrm.EmotionType.NULL, int emoteInput = -1) + { + if (IsBattleEnd) + { + return NullVfx.GetInstance(); + } + if (isAIEmoteRegistered && cmdType != AIEmoteCmdType.ON_OPPONENT_TURN_START && cmdType != AIEmoteCmdType.ON_ALLY_TURN_START) + { + AIConsoleUtility.Log("既にEmoteを登録中です!"); + return NullVfx.GetInstance(); + } + isAIEmoteRegistered = true; + float num = 0f; + float num2 = 0f; + AIEmoteCmd aIEmoteCmd = null; + VfxBase vfxBase = NullVfx.GetInstance(); + switch (cmdType) + { + case AIEmoteCmdType.ON_RECEIVE: + aIEmoteCmd = emoteCtrl.OnOpponentEmotion(receivedEmoteType); + if (aIEmoteCmd != null) + { + vfxBase = ALLY.Emotion.PlayEmotion(aIEmoteCmd.emoteType, 1.5f); + num = 2f; + } + break; + case AIEmoteCmdType.ON_FIRST_TURN: + vfxBase = ALLY.Emotion.PlayEmotion(ClassCharaPrm.EmotionType.PROVOCATION, 1.5f); + break; + case AIEmoteCmdType.ON_ITERATION_START: + aIEmoteCmd = emoteCtrl.OnIterationStart(); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_ALLY_TURN_START: + aIEmoteCmd = emoteCtrl.OnAllyTurnStart(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_OPPONENT_TURN_START: + aIEmoteCmd = emoteCtrl.OnOpponentTurnStart(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_ALLY_TURN_END: + aIEmoteCmd = emoteCtrl.OnAllyTurnEnd(); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_OPPONENT_TURN_END: + aIEmoteCmd = emoteCtrl.OnOpponentTurnEnd(); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_ALLY_ATTACK: + aIEmoteCmd = emoteCtrl.OnAllyAttack(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_OPPONENT_ATTACK: + aIEmoteCmd = emoteCtrl.OnOpponentAttackExecuted(); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_ALLY_EVOLUTION: + aIEmoteCmd = emoteCtrl.OnAllyEvolution(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_CARD_DESTROY: + aIEmoteCmd = emoteCtrl.OnCardDestroy(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_CARD_PLAY_ALLY: + aIEmoteCmd = emoteCtrl.OnCardPlay(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_CARD_PLAY_OPPONENT: + aIEmoteCmd = emoteCtrl.OnOpponentPlayCardExecuted(situation); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + } + break; + case AIEmoteCmdType.ON_LEADER_DAMAGED: + aIEmoteCmd = emoteCtrl.OnLeaderDamaged(_currentVirtualField); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + num = 2f; + } + break; + case AIEmoteCmdType.ON_PLAYER_LEADER_DAMAGED: + aIEmoteCmd = emoteCtrl.OnPlayerLeaderDamaged(_currentVirtualField); + if (aIEmoteCmd != null) + { + vfxBase = PlayEmotionDefault(aIEmoteCmd); + num = 2f; + } + break; + case AIEmoteCmdType.ON_DEBUG_SEARCH_ID: + aIEmoteCmd = emoteQuery.SearchEmoteByID(emoteInput); + if (aIEmoteCmd != null) + { + isAIEmoteRegistered = false; + return PlayEmotionDefault(aIEmoteCmd, isForcePlay: true); + } + break; + case AIEmoteCmdType.ON_DEBUG_SEARCH_CATEGORY: + { + IEnumerable enumerable = emoteQuery.SearchEmoteByCategory(emoteInput); + if (enumerable == null) + { + break; + } + SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(); + foreach (AIEmoteCmd item in enumerable) + { + sequentialVfxPlayer.Register(PlayEmotionDefault(item, isForcePlay: true)); + sequentialVfxPlayer.Register(WaitVfx.Create(2f)); + } + isAIEmoteRegistered = false; + return NullVfx.GetInstance(); + } + } + if (vfxBase == NullVfx.GetInstance()) + { + isAIEmoteRegistered = false; + return NullVfx.GetInstance(); + } + IsThisTurnEmotePlayed = true; + SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create(); + if (num > 0f) + { + sequentialVfxPlayer2.Register(WaitVfx.Create(num)); + } + sequentialVfxPlayer2.Register(vfxBase); + if (num2 > 0f) + { + sequentialVfxPlayer2.Register(WaitVfx.Create(num2)); + } + sequentialVfxPlayer2.Register(InstantVfx.Create(delegate + { + isAIEmoteRegistered = false; + })); + return sequentialVfxPlayer2; + } + + private VfxBase PlayEmotionDefault(AIEmoteCmd emoteCmd, bool isForcePlay = false) + { + if (!isForcePlay) + { + if (emoteQuery.GetCategoryInterval(emoteCmd.CategoryKey) > 0) + { + return NullVfx.GetInstance(); + } + if (AIEmoteUtility.IsSystemEmoteKey(emoteCmd.CategoryKey) && ALLY.Turn < 4) + { + return NullVfx.GetInstance(); + } + if (!ALLY.IsSelfTurn) + { + emoteMng.OnOpponentTurnEmote(); + } + if (AIEmoteUtility.IsSystemEmoteKey(emoteCmd.CategoryKey)) + { + emoteQuery.SetInterval(emoteCmd.CategoryKey, AIStableRandom() % 2 + 1); + } + } + emoteMng.AddPlayedCountOnEmotePlaying(emoteCmd.CategoryKey); + if (emoteCmd.isAI) + { + return ALLY.Emotion.PlayEmotion((ClassCharaPrm.MotionType)emoteCmd.motionID, (ClassCharaPrm.FaceType)emoteCmd.faceID, emoteCmd.voiceID, emoteCmd.textID); + } + return OPPONENT.Emotion.PlayEmotion((ClassCharaPrm.MotionType)emoteCmd.motionID, (ClassCharaPrm.FaceType)emoteCmd.faceID, emoteCmd.voiceID, emoteCmd.textID); + } + + public bool IsBishop() + { + return paramQuery.GetClassID() == 7; + } + + public bool IsNecromancer() + { + return paramQuery.GetClassID() == 5; + } + + public bool IsRoyal() + { + return paramQuery.GetClassID() == 2; + } + + public bool IsAbleEvo() + { + if (ALLY.EvolveWaitTurnCount <= 0) + { + return ALLY.NowTurnEvol; + } + return false; + } + + public bool IsAllyCard(BattleCardBase card) + { + return PlayerPair.Self.IsPlayer == card.IsPlayer; + } + + public bool IsAllyCard(AIVirtualCard card) + { + return PlayerPair.Self.IsPlayer == card.IsPlayer; + } + + public void SetPreDecidedTargets(AISelectedTargetInfoSet set) + { + PreDecidedTargets = set; + } + + public bool HasPlayerAbilityId(int id) + { + if (_playerAbilityIdList == null || _playerAbilityIdList.Count <= 0) + { + return false; + } + for (int i = 0; i < _playerAbilityIdList.Count; i++) + { + if (_playerAbilityIdList[i] == id) + { + return true; + } + } + return false; + } + + public void UpdateAICurrentVirtualField(bool isUsePreviousFieldParameter = true) + { + UpdateCurrentVirtualField(paramQuery, styleQuery, PlayerPair, EmptyPlayPtn, isUsePreviousFieldParameter); + } + + public abstract void Retire(); + + public abstract void Disconnect(); + + public abstract void Reconnect(); + + public abstract void CleanupStackedAction(); + + protected abstract void OnFinishOprAttack(); + + protected abstract void OnFinishOprTargetSelect(); + + protected abstract void OnBeforeTurnEnd(); + + public void TurnEnd() + { + OnBeforeTurnEnd(); + BattleCoroutine instance = BattleCoroutine.GetInstance(); + if (weakLogicCoroutine != null) + { + instance.StopCoroutine(weakLogicCoroutine); + weakLogicCoroutine = null; + } + EnemyAICoroutine.GetInstance().StopAllCoroutines(); + EnemyAIUtil.TurnEnd(BattleMgr, PlayerPair.Self.IsPlayer); + } + + protected abstract void CheckIsStackAction(); + + protected abstract void SetupThinkingInterval(); + + public int CalcHandNextTurnDamage(AIVirtualField field) + { + int num = 0; + List list = new List(); + List list2 = new List(); + foreach (AIVirtualCard allyHandCard in field.AllyHandCards) + { + if (allyHandCard.TagCollectionContainer.HasTag(AIPlayTagType.PlayoutNextTurn)) + { + list.Add(allyHandCard); + } + } + if (0 < list.Count) + { + int num2 = Mathf.Min(10, ALLY.PpTotal + 1); + int num3 = (int)Mathf.Pow(2f, list.Count); + for (int i = 0; i < num3; i++) + { + int num4 = 0; + int totalCost = 0; + ConvertPlayoutNextTurnHandPtnList(list, list2, i, out totalCost); + if (num2 < totalCost) + { + continue; + } + for (int j = 0; j < list2.Count; j++) + { + if (!list2[j].TagCollectionContainer.HasTag(AIPlayTagType.PlayoutNextTurn)) + { + continue; + } + PlayoutNextTurnTagCollection playoutNextTurnTags = list2[j].TagCollectionContainer.PlayoutNextTurnTags; + for (int k = 0; k < playoutNextTurnTags.TagList.Count; k++) + { + if (playoutNextTurnTags.TagList[k].CheckCondition(list[j], EmptyPlayPtn, field, null)) + { + num4 += (int)playoutNextTurnTags.TagList[k].EvalArg(list2[j], null, field, null); + } + } + } + if (num < num4) + { + num = num4; + } + } + } + return num; + } + + private void ConvertPlayoutNextTurnHandPtnList(List srcList, List dstList, int index, out int totalCost) + { + totalCost = 0; + int count = srcList.Count; + int num = index; + dstList.Clear(); + for (int i = 0; i < count; i++) + { + AIVirtualCard aIVirtualCard = srcList[i]; + int num2 = (int)Mathf.Pow(2f, count - i - 1); + if (0 < num / num2) + { + num -= num2; + dstList.Add(aIVirtualCard); + totalCost += aIVirtualCard.Cost; + } + } + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/EnemyAINull.cs b/SVSim.BattleEngine/Engine/Wizard/EnemyAINull.cs index 2e30043d..854574cf 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EnemyAINull.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EnemyAINull.cs @@ -36,16 +36,6 @@ public class EnemyAINull : IEnemyAI return 0f; } - public float Atk_EvaluateBattleCardOnErase(BattleCardBase card, List playPtn, bool useStyle) - { - return 0f; - } - - public float Atk_EvaluateBattleCardOnReturn(BattleCardBase card, List playPtn, int restPp, bool useStyle) - { - return 0f; - } - public IAIEmoteCtrl EmoteCtrl() { return new AIEmoteCtrlNull(); diff --git a/SVSim.BattleEngine/Engine/Wizard/EnemyAIUtil.cs b/SVSim.BattleEngine/Engine/Wizard/EnemyAIUtil.cs index 513a5bc3..05823213 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EnemyAIUtil.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EnemyAIUtil.cs @@ -21,243 +21,6 @@ internal static class EnemyAIUtil } } - public const int TempDeckNo = 36; - - public const int SERIES_ID = 25; - - private const int RETRY_MAX = 100; - - private const int LOOP_MAX = 10; - - private static System.Random _rnd = new System.Random(); - - public static bool IsSameVirtualCardList(List right, List left) - { - if (right.Count != left.Count) - { - return false; - } - for (int i = 0; i < right.Count; i++) - { - if (!right[i].IsSameCard(left[i])) - { - return false; - } - } - return true; - } - - public static List GetAllMoves(BattlePlayerPair pair) - { - List list = new List(); - List playMoves = GetPlayMoves(pair); - List attackMoves = GetAttackMoves(pair); - List evolveMoves = GetEvolveMoves(pair); - List fusionMoves = GetFusionMoves(pair); - for (int i = 0; i < playMoves.Count; i++) - { - list.Add(playMoves[i]); - } - for (int j = 0; j < attackMoves.Count; j++) - { - list.Add(attackMoves[j]); - } - for (int k = 0; k < evolveMoves.Count; k++) - { - list.Add(evolveMoves[k]); - } - for (int l = 0; l < fusionMoves.Count; l++) - { - list.Add(fusionMoves[l]); - } - list.Add(new AITurnEndMove()); - return list; - } - - public static List GetFusionMoves(BattlePlayerPair pair) - { - List list = new List(); - foreach (BattleCardBase handCard in pair.Self.HandCardList) - { - if (!handCard.IsFusionable) - { - continue; - } - List> targetsList = GetTargetsList(handCard.GetSelectTypeSkill(isEvolve: false, isFusion: true), pair, handCard, isFusion: true); - if (targetsList != null) - { - for (int i = 0; i < targetsList.Count; i++) - { - List targets = targetsList[i]; - list.Add(new AIFusionMove(handCard, targets)); - } - } - } - return list; - } - - public static List GetEvolveMoves(BattlePlayerPair pair) - { - List list = new List(); - foreach (BattleCardBase inPlayCard in pair.Self.InPlayCards) - { - if (!inPlayCard.IsUnit || !inPlayCard.CanEvolution(isSkill: false, isSelfBattlePlayer: true)) - { - continue; - } - List> targetsList = GetTargetsList(inPlayCard.EvolutionSkills, pair, inPlayCard); - if (targetsList != null) - { - for (int i = 0; i < targetsList.Count; i++) - { - List targets = targetsList[i]; - list.Add(new AIEvolMove(inPlayCard, targets)); - } - } - else - { - list.Add(new AIEvolMove(inPlayCard, null)); - } - } - return list; - } - - public static List GetAttackMoves(BattlePlayerPair pair) - { - List list = new List(); - foreach (BattleCardBase inPlayCard in pair.Self.InPlayCards) - { - if (!inPlayCard.Attackable) - { - continue; - } - foreach (BattleCardBase classAndInPlayCard in pair.Opponent.ClassAndInPlayCardList) - { - if (AttackSelectControl.CanCardAttackTarget(inPlayCard, classAndInPlayCard, pair.Opponent.InPlayCards)) - { - list.Add(new AIAttackMove(inPlayCard, classAndInPlayCard)); - } - } - } - return list; - } - - public static List GetPlayMoves(BattlePlayerPair pair, bool isCheckOnDraw = true) - { - List list = new List(); - foreach (BattleCardBase handCard in pair.Self.HandCardList) - { - if (!handCard.Movable(isCheckOnDraw)) - { - continue; - } - IEnumerable enumerable = null; - if (handCard.IsMutationPlayPp(handCard.SelfBattlePlayer.Pp)) - { - Skill_transform accelerateOrCrystallizeTransformSkill = handCard.GetAccelerateOrCrystallizeTransformSkill(); - if (accelerateOrCrystallizeTransformSkill != null) - { - enumerable = handCard.SelfBattlePlayer.BattleMgr.CreateTransformCardRegisterVfx(accelerateOrCrystallizeTransformSkill.SkillPrm.ownerCard, accelerateOrCrystallizeTransformSkill.TransformId, accelerateOrCrystallizeTransformSkill.SkillPrm.ownerCard.IsPlayer).GetSelectTypeSkill(); - } - } - if (enumerable == null) - { - enumerable = handCard.GetSelectTypeSkill(); - } - List> targetsList = GetTargetsList(enumerable, pair, handCard); - if (targetsList != null) - { - for (int i = 0; i < targetsList.Count; i++) - { - List targets = targetsList[i]; - list.Add(new AIPlayMove(handCard, targets)); - } - } - else - { - list.Add(new AIPlayMove(handCard, null)); - } - } - return list; - } - - private static List> GetTargetsList(IEnumerable skills, BattlePlayerPair pair, BattleCardBase card, bool isFusion = false) - { - List selectablesList = GetSelectablesList(skills, pair, card); - Dictionary> dictionary = new Dictionary>(); - foreach (SkillBase skill in skills) - { - if (!skill.IsChoiceType || !card.Skills.HaveChoiceTransformSkill()) - { - continue; - } - IEnumerable skillUserSelectableTargets = ActionProcessor.GetSkillUserSelectableTargets(skill, pair); - if (skillUserSelectableTargets == null) - { - continue; - } - foreach (BattleCardBase item in skillUserSelectableTargets) - { - dictionary[item.Index] = GetSelectablesList(item.GetSelectTypeSkill(), pair, item); - } - } - if (selectablesList.Count > 0) - { - List> list = new List>(); - SetupTargetsList(0, new List(), selectablesList, dictionary, list, isFusion); - return list; - } - return null; - } - - private static List GetSelectablesList(IEnumerable skills, BattlePlayerPair pair, BattleCardBase card) - { - List list = new List(); - foreach (SkillBase skill in skills) - { - if (skill.IsBurialRite) - { - List burialRiteTarget = SkillPreprocessBurialRite.GetBurialRiteTarget(card.SelfBattlePlayer, card); - if (burialRiteTarget != null && burialRiteTarget.Count > 0) - { - list.Add(new SelectableInfo(burialRiteTarget, 1)); - } - } - if (skill.IsUserSelectType) - { - IEnumerable skillUserSelectableTargets = ActionProcessor.GetSkillUserSelectableTargets(skill, pair); - int num = 1; - if (skillUserSelectableTargets != null) - { - num = Mathf.Min(skill.GetSkillSelectCount(), skillUserSelectableTargets.Count()); - list.Add(new SelectableInfo(new List(skillUserSelectableTargets), num)); - } - } - if (!skill.IsChoiceType) - { - continue; - } - IEnumerable skillUserSelectableTargets2 = ActionProcessor.GetSkillUserSelectableTargets(skill, pair); - if (skillUserSelectableTargets2 == null) - { - continue; - } - List list2 = new List(); - foreach (BattleCardBase item in skillUserSelectableTargets2) - { - card = card.SelfBattlePlayer.BattleMgr.CreateTransformCardRegisterVfx(card, item.CardId, card.SelfBattlePlayer.IsPlayer); - list2.Add(card); - } - int count = 1; - if (skill.ApplySelectFilter is SkillChoiceSelectFilter) - { - count = Math.Max(1, skill.ApplySelectFilter.CalcCount(skill.OptionValue)); - } - list.Add(new SelectableInfo(list2, count)); - } - return list; - } - private static void SetupTargetsList(int depth, List currentList, List selectablesList, Dictionary> choiceSelectableList, List> out_targetsList, bool isFusion = false) { if (depth == selectablesList.Count) @@ -353,57 +116,4 @@ internal static class EnemyAIUtil SkillCollectionBase.SetupOptionValue(item.OptionValue, pair, playCard, item); } } - - public static List GetRandomDeck(CardBasePrm.ClanType clan, int seriesRangeStart = 0, int seriesRangeEnd = 25) - { - int num = 0; - int num2 = 0; - int num3 = 40; - List deck = new List(); - IEnumerable allParameters = CardMaster.GetInstanceForBattle().GetAllParameters(); - while (true) - { - for (int i = 0; i < num3; i++) - { - CardBasePrm.ClanType card_clan = clan; - if (num2 < 10) - { - if (_rnd.Next(9) == 0) - { - card_clan = CardBasePrm.ClanType.ALL; - } - } - else if (_rnd.Next(9) != 0) - { - card_clan = CardBasePrm.ClanType.ALL; - } - IEnumerable source = allParameters.Where((CardParameter p) => p.Clan == card_clan && seriesRangeStart <= p.BaseCardId / 1000000 % 100 && p.BaseCardId / 1000000 % 100 <= seriesRangeEnd && p.BaseCardId / 100000000 % 10 == 1 && deck.Count((int id) => id == p.BaseCardId) < 3 && !GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(p.CardId) && !GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(p.BaseCardId)); - if (source.Count() == 0) - { - num++; - if (num >= 100) - { - break; - } - i--; - } - else - { - CardParameter cardParameter = source.ElementAt(_rnd.Next(source.Count())); - deck.Add(cardParameter.BaseCardId); - } - } - if (deck.Count == 40) - { - break; - } - if (num2 >= 100) - { - throw new Exception($"デッキ構築するための使用可能な{clan}カードが不足している可能性があります。カード未実装フラグを解除するか、実装が進んでから再度お試しください。"); - } - num2++; - num3 = 40 - deck.Count; - } - return deck; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/EnemyAI_Skill.cs b/SVSim.BattleEngine/Engine/Wizard/EnemyAI_Skill.cs index 510a76ce..0e0c3917 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EnemyAI_Skill.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EnemyAI_Skill.cs @@ -11,7 +11,6 @@ namespace Wizard; public class EnemyAI_Skill { - public static int CHOICE_CARD_INDEX_THRESHOLD = 10000; public static float PLAYOUT_VALUE = 9999f; diff --git a/SVSim.BattleEngine/Engine/Wizard/EvolvedResidentTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/EvolvedResidentTagCollection.cs index d83f6274..f1177e31 100644 --- a/SVSim.BattleEngine/Engine/Wizard/EvolvedResidentTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/EvolvedResidentTagCollection.cs @@ -55,32 +55,6 @@ public class EvolvedResidentTagCollection : TagCollection } } - public int GetMaxEvolvedAttackableCount(AIVirtualCard owner, AIVirtualField field, List playPtn, AISituationInfo situation) - { - if (_evolvedAttackableCountList == null || _evolvedAttackableCountList.Count <= 0) - { - return owner.AttackableCount; - } - int num = int.MinValue; - for (int i = 0; i < _evolvedAttackableCountList.Count; i++) - { - AIPlayTag aIPlayTag = _evolvedAttackableCountList[i]; - if (aIPlayTag.CheckCondition(owner, playPtn, field, situation)) - { - int attackableCount = (aIPlayTag.ArgumentExpressions as AIEvolvedAttackableCount).GetAttackableCount(owner, playPtn, field, situation); - if (attackableCount > num) - { - num = attackableCount; - } - } - } - if (num >= 0) - { - return num; - } - return owner.AttackableCount; - } - public override void AddTag(AIPlayTag tag) { base.AddTag(tag); diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1005.cs b/SVSim.BattleEngine/Engine/Wizard/Field1005.cs index ad3513f8..e49f0cb4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1005.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1005.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1005 : BackGroundBase { public override int FieldId => 1005; @@ -12,60 +13,4 @@ public class Field1005 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1005_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1005").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1005, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1005_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-2305f, -1938f, -227f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-42f, 90f, -90f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(332f, 300f, -218f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-42f, 112f, -104f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1006.cs b/SVSim.BattleEngine/Engine/Wizard/Field1006.cs index d533b585..66f69c48 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1006.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1006.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1006 : BackGroundBase { public override int FieldId => 1006; @@ -12,132 +13,4 @@ public class Field1006 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1006_root").gameObject; - _fieldObjDictionary.Add("main", _fieldModel.transform.Find("md_bf_1006_01_monitor_main").gameObject); - _fieldObjDictionary.Add("sub", _fieldModel.transform.Find("md_bf_1006_01_monitor_sub").gameObject); - _fieldObjDictionary.Add("noise", _fieldModel.transform.Find("md_bf_1006_01_noise").gameObject); - _fieldObjDictionary.Add("screen_01", _fieldModel.transform.Find("md_bf_1006_01_screen_01").gameObject); - _fieldObjDictionary.Add("screen_02", _fieldModel.transform.Find("md_bf_1006_01_screen_02").gameObject); - _fieldObjDictionary.Add("screen_03", _fieldModel.transform.Find("md_bf_1006_01_screen_03").gameObject); - _fieldObjDictionary.Add("screen_04", _fieldModel.transform.Find("md_bf_1006_01_screen_04").gameObject); - m_FieldAnimatorDictionary.Add("main", _fieldObjDictionary["main"].GetComponent()); - m_FieldAnimatorDictionary.Add("sub", _fieldObjDictionary["sub"].GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1006, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1006_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["main"].SetTrigger("opening"); - m_FieldAnimatorDictionary["sub"].SetTrigger("opening"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - _battleCamera.Camera.transform.localPosition = new Vector3(7f, -650f, -699f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-74.1f, -179.8f, 179.8f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-871f, -736f, -139f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-36f, 109f, -107f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(0, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_field_1006_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 0: - m_FieldAnimatorDictionary["sub"].SetTrigger("tap"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: false); - _fieldObjDictionary["noise"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(2f); - _fieldObjDictionary["screen_02"].gameObject.SetActive(value: false); - _fieldObjDictionary["noise"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _gimicCntDictionary[obj.tag]--; - break; - case 1: - m_FieldAnimatorDictionary["sub"].SetTrigger("tap"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: false); - _fieldObjDictionary["noise"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(2f); - _fieldObjDictionary["screen_03"].gameObject.SetActive(value: false); - _fieldObjDictionary["noise"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _gimicCntDictionary[obj.tag]--; - break; - case 2: - m_FieldAnimatorDictionary["sub"].SetTrigger("tap"); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: false); - _fieldObjDictionary["noise"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(2f); - _fieldObjDictionary["screen_04"].gameObject.SetActive(value: false); - _fieldObjDictionary["noise"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["noise"].gameObject.SetActive(value: false); - _fieldObjDictionary["screen_01"].gameObject.SetActive(value: true); - _gimicCntDictionary[obj.tag]--; - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return null; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1007.cs b/SVSim.BattleEngine/Engine/Wizard/Field1007.cs index 86d94ad1..fc490429 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1007.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1007.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1007 : BackGroundBase { public override int FieldId => 1007; @@ -12,69 +13,4 @@ public class Field1007 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1007_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1007").gameObject; - _fieldParticleSystemDictionary.Add("start", _fieldParticles.transform.Find("start").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1007, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1007_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1007_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["start"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-2454f, 22f, -1f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-0.5f, 93f, -90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(-2454f, 22f, -1f), new Vector3(-800f, 29f, -4f), new Vector3(66f, 8f, -992f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-0.45f, 113f, -90f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1008.cs b/SVSim.BattleEngine/Engine/Wizard/Field1008.cs index df56ee43..66ec6ee1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1008.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1008.cs @@ -1,172 +1,16 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1008 : BackGroundBase { - private readonly string[] MONITOR_OBJECT_PATH_LIST = new string[4] { "md_bf_1008_01_main/monitor/monitor000__combine_freeze_/monitor000_monitor", "md_bf_1008_01_main/monitor/monitor000__combine_freeze_/monitor000_monitor_L", "md_bf_1008_01_main/monitor/monitor000__combine_freeze_/monitor000_monitor_R", "md_bf_1008_01_monitor_2/monitor002" }; - - private const string MONITOR_TEXTURE_NAME = "tx_bf_1008_01_monitor_d"; - public override int FieldId => 1008; public Field1008(string bgmId = "NONE") : base(bgmId) { } - - protected override List CollectAdditionalAssets() - { - return new List { Toolbox.ResourcesManager.GetAssetTypePath("tx_bf_1008_01_monitor_d", ResourcesManager.AssetLoadPathType.Uilang3DField) }; - } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1008_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1008").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("base", _fieldParticles.transform.Find("base").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldObjDictionary.Add("monitor_1", _fieldModel.transform.Find("md_bf_1008_01_monitor_1").gameObject); - _fieldObjDictionary.Add("monitor_2", _fieldModel.transform.Find("md_bf_1008_01_monitor_2").gameObject); - _fieldObjDictionary.Add("monitor_3", _fieldModel.transform.Find("md_bf_1008_01_monitor_3").gameObject); - _fieldObjDictionary.Add("monitor_4", _fieldModel.transform.Find("md_bf_1008_01_monitor_4").gameObject); - _fieldObjDictionary.Add("monitor_5", _fieldModel.transform.Find("md_bf_1008_01_monitor_5").gameObject); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("tx_bf_1008_01_monitor_d", ResourcesManager.AssetLoadPathType.Uilang3DField, isfetch: true); - Texture texture = Toolbox.ResourcesManager.LoadObject(assetTypePath) as Texture; - if (texture != null) - { - for (int i = 0; i < MONITOR_OBJECT_PATH_LIST.Length; i++) - { - MeshRenderer component = _fieldModel.transform.Find(MONITOR_OBJECT_PATH_LIST[i]).GetComponent(); - if (component != null) - { - component.material.SetTexture("_MainTex", texture); - } - } - } - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int j = 0; j < _fieldObjDictionary.Count; j++) - { - list2.Add(_fieldObjDictionary[list[j]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - _fieldParticleSystemDictionary["base"].Play(); - _fieldObjDictionary["monitor_1"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_2"].gameObject.SetActive(value: true); - _fieldObjDictionary["monitor_3"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_4"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: false); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1008, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1008_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _fieldParticleSystemDictionary["base"].Play(); - _fieldObjDictionary["monitor_1"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_2"].gameObject.SetActive(value: true); - _fieldObjDictionary["monitor_3"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_4"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: false); - _battleCamera.Camera.transform.localPosition = new Vector3(3564f, -1182f, -224f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-18f, -88f, 94.4f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(197f, -103f, -224f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-18f, -88f, 94.4f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(0, 2); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr("se_field_1008_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 0: - _fieldObjDictionary["monitor_2"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_1"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(2f); - _fieldObjDictionary["monitor_1"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_2"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Play(); - _gimicCntDictionary[obj.tag]--; - break; - case 1: - _fieldObjDictionary["monitor_2"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_3"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(2f); - _fieldObjDictionary["monitor_3"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: true); - yield return new WaitForSeconds(0.3f); - _fieldObjDictionary["monitor_5"].gameObject.SetActive(value: false); - _fieldObjDictionary["monitor_2"].gameObject.SetActive(value: true); - _fieldParticleSystemDictionary["base"].Play(); - _gimicCntDictionary[obj.tag]--; - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return null; - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["base"].Clear(); - _fieldParticleSystemDictionary["base"].Stop(); - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(3f); - _fieldParticleSystemDictionary["base"].Play(); - yield return null; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1009.cs b/SVSim.BattleEngine/Engine/Wizard/Field1009.cs index a4a1b2ab..fb8bde76 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1009.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1009.cs @@ -1,96 +1,16 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1009 : BackGroundBase { - private const string MONITOR_TEXTURE_NAME = "tx_bf_1009_01_monitor_d"; - - private readonly string[] MONITOR_OBJECT_PATH_LIST = new string[6] { "md_bf_1009_01_main/monitor_set/monitor08", "md_bf_1009_01_main/monitor_set/monitor09", "md_bf_1009_01_main/monitor_set/monitor10", "md_bf_1009_01_main/monitor_set/monitor11", "md_bf_1009_01_main/monitor_set/monitor12", "md_bf_1009_01_main/monitor_set/monitor13" }; - public override int FieldId => 1009; public Field1009(string bgmId = "NONE") : base(bgmId) { } - - protected override List CollectAdditionalAssets() - { - return new List { Toolbox.ResourcesManager.GetAssetTypePath("tx_bf_1009_01_monitor_d", ResourcesManager.AssetLoadPathType.Uilang3DField) }; - } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1009_root").gameObject; - _fieldObjDictionary.Add("door", _fieldModel.transform.Find("md_bf_1009_01_door").gameObject); - m_FieldAnimatorDictionary.Add("door", _fieldObjDictionary["door"].GetComponent()); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("tx_bf_1009_01_monitor_d", ResourcesManager.AssetLoadPathType.Uilang3DField, isfetch: true); - Texture texture = Toolbox.ResourcesManager.LoadObject(assetTypePath) as Texture; - if (texture != null) - { - for (int i = 0; i < MONITOR_OBJECT_PATH_LIST.Length; i++) - { - MeshRenderer component = _fieldModel.transform.Find(MONITOR_OBJECT_PATH_LIST[i]).GetComponent(); - if (component != null) - { - component.material.SetTexture("_MainTex", texture); - } - } - } - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int j = 0; j < _fieldObjDictionary.Count; j++) - { - list2.Add(_fieldObjDictionary[list[j]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1009, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1009_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["door"].SetTrigger("Open"); - _battleCamera.Camera.transform.localPosition = new Vector3(1885f, 0f, -150f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(0f, -85f, 90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(1885f, 0f, -150f), new Vector3(300f, 0f, 100f), new Vector3(-596f, 0f, -170f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 1.7f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(0f, -103f, 90f), "time", 1.7f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - yield return null; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1010.cs b/SVSim.BattleEngine/Engine/Wizard/Field1010.cs index 0e6b6d43..e9c09e16 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1010.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1010.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1010 : BackGroundBase { public override int FieldId => 1010; @@ -12,66 +13,4 @@ public class Field1010 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1010_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1010").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldObjDictionary.Add("main", _fieldModel.transform.Find("md_bf_1010_01_main").gameObject); - _fieldObjDictionary.Add("move", _fieldModel.transform.Find("md_bf_1010_01_move").gameObject); - _fieldObjDictionary.Add("volume", _fieldModel.transform.Find("md_bf_1010_01_volume").gameObject); - m_FieldAnimatorDictionary.Add("volume", _fieldObjDictionary["volume"].GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1010, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1010_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(0f, 0f, -750f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 0f)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - m_FieldAnimatorDictionary["volume"].SetTrigger("shake"); - yield return new WaitForSeconds(3f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1011.cs b/SVSim.BattleEngine/Engine/Wizard/Field1011.cs index badb9b4b..504f2a16 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1011.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1011.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1011 : BackGroundBase { public override int FieldId => 1011; @@ -12,88 +13,4 @@ public class Field1011 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1011_01_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1011").gameObject; - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldObjDictionary.Add("lotuscenter", _fieldModel.transform.Find("md_bf_1011_01_lotuscenter").gameObject); - m_FieldAnimatorDictionary.Add("lotuscenter", _fieldObjDictionary["lotuscenter"].GetComponent()); - _fieldObjDictionary.Add("lotus_1", _fieldModel.transform.Find("md_bf_1011_01_lotuscenter/root/pibot/md_bf_1011_01_lotus_1").gameObject); - m_FieldAnimatorDictionary.Add("lotus_1", _fieldObjDictionary["lotus_1"].GetComponent()); - _fieldObjDictionary.Add("lotus_2", _fieldModel.transform.Find("md_bf_1011_01_lotuscenter/root/pibot/md_bf_1011_01_lotus_2").gameObject); - m_FieldAnimatorDictionary.Add("lotus_2", _fieldObjDictionary["lotus_2"].GetComponent()); - _fieldObjDictionary.Add("flower", _fieldModel.transform.Find("md_bf_1011_01_flower").gameObject); - m_FieldAnimatorDictionary.Add("flower", _fieldObjDictionary["flower"].GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1011, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1011_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(2078.8f, -637f, 5.5f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-18.9f, -87.8f, 88.9f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(55.6f, 28.2f, -121.5f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-17.2f, -106.5f, 94.9f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["flower"].SetTrigger("tap"); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(2f); - _gimicCntDictionary[obj.tag] = 0; - } - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - m_FieldAnimatorDictionary["lotus_1"].SetTrigger("shake"); - m_FieldAnimatorDictionary["lotus_2"].SetTrigger("shake"); - m_FieldAnimatorDictionary["flower"].SetTrigger("shake"); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field1012.cs b/SVSim.BattleEngine/Engine/Wizard/Field1012.cs index 1e415857..9d6d0cd8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field1012.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field1012.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field1012 : BackGroundBase { public override int FieldId => 1012; @@ -12,67 +13,4 @@ public class Field1012 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1012_01_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles1012").gameObject; - _fieldParticleSystemDictionary.Add("base", _fieldParticles.transform.Find("base").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1012, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1012_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["base"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-678f, -2223f, -8.5f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-69.4f, 54.5f, -56.56f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-380f, -1292f, -8.5f), "time", 1.5f, "islocal", true, "easetype", iTween.EaseType.easeInQuart)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-69.4f, 54.5f, -56.56f), "time", 1.5f, "islocal", true, "easetype", iTween.EaseType.easeInQuart)); - yield return new WaitForSeconds(1.5f); - _battleCamera.Camera.transform.localPosition = new Vector3(-380f, -1292f, -8.5f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-69.4f, 54.5f, -56.56f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-132.6f, -553.3f, -8.5f), "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-69.4f, 54.5f, -56.56f), "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field51.cs b/SVSim.BattleEngine/Engine/Wizard/Field51.cs index 18676081..e09cbc37 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field51.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field51.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field51 : BackGroundBase { public override int FieldId => 51; @@ -12,114 +13,4 @@ public class Field51 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0051_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles51").gameObject; - _fieldParticleSystemDictionary.Add("light", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_r/position/root/joint1/joint2/joint3/light").GetComponent()); - _fieldParticleSystemDictionary.Add("light_gimic", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_r/position/root/joint1/joint2/joint3/light_gimic").GetComponent()); - _fieldParticleSystemDictionary.Add("light_shake", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_r/position/root/joint1/joint2/joint3/light_shake").GetComponent()); - _fieldParticleSystemDictionary.Add("light_l", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_l/position/root/joint1/joint2/joint3/light_l").GetComponent()); - _fieldParticleSystemDictionary.Add("light_shake_l", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_l/position/root/joint1/joint2/joint3/light_shake_l").GetComponent()); - _fieldObjDictionary.Add("movebranch_a", _fieldModel.transform.Find("md_bf_0051_01_movebranch_a").gameObject); - _fieldObjDictionary.Add("movebranch_b", _fieldModel.transform.Find("md_bf_0051_01_movebranch_b").gameObject); - _fieldObjDictionary.Add("movebranch_c", _fieldModel.transform.Find("md_bf_0051_01_movebranch_c").gameObject); - _fieldObjDictionary.Add("movebranch_d", _fieldModel.transform.Find("md_bf_0051_01_movebranch_d").gameObject); - _fieldObjDictionary.Add("movebranch_e", _fieldModel.transform.Find("md_bf_0051_01_movebranch_e").gameObject); - _fieldObjDictionary.Add("movebranch_f", _fieldModel.transform.Find("md_bf_0051_01_movebranch_f").gameObject); - _fieldObjDictionary.Add("movebranchlight_l", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_l").gameObject); - _fieldObjDictionary.Add("movebranchlight_r", _fieldModel.transform.Find("md_bf_0051_01_movebranchlight_r").gameObject); - m_FieldAnimatorDictionary.Add("movebranch_a", _fieldObjDictionary["movebranch_a"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_b", _fieldObjDictionary["movebranch_b"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_c", _fieldObjDictionary["movebranch_c"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_d", _fieldObjDictionary["movebranch_d"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_e", _fieldObjDictionary["movebranch_e"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_f", _fieldObjDictionary["movebranch_f"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranchlight_l", _fieldObjDictionary["movebranchlight_l"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranchlight_r", _fieldObjDictionary["movebranchlight_r"].GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_51, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_51_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["light"].Play(); - _fieldParticleSystemDictionary["light_l"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(3322f, -1847f, 36f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-84f, -90f, 90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(3322f, -1847f, 36f), new Vector3(2800f, 40f, 36f), new Vector3(1036f, -27.7f, 0f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 1.5f, "islocal", true, "easetype", iTween.EaseType.easeInSine)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-8f, -90f, 90f), "time", 1.5f, "islocal", true, "easetype", iTween.EaseType.easeInSine)); - yield return new WaitForSeconds(1.5f); - _battleCamera.Camera.transform.localPosition = new Vector3(1036f, -27.7f, 0f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-8f, -90f, 90f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-323f, -19f, -18f), "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-1f, -90f, 90f), "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - m_FieldAnimatorDictionary["movebranchlight_r"].SetTrigger("tap"); - _fieldParticleSystemDictionary["light"].Stop(); - _fieldParticleSystemDictionary["light_gimic"].Play(); - yield return new WaitForSeconds(2f); - _fieldParticleSystemDictionary["light"].Play(); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["movebranch_a"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_b"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_c"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_d"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_e"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_f"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranchlight_l"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranchlight_r"].SetTrigger("shake"); - _fieldParticleSystemDictionary["shake"].Play(); - _fieldParticleSystemDictionary["light_shake"].Play(); - _fieldParticleSystemDictionary["light_shake_l"].Play(); - yield return new WaitForSeconds(3f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field52.cs b/SVSim.BattleEngine/Engine/Wizard/Field52.cs index 0529eaa0..2b2520d3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field52.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field52.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field52 : BackGroundBase { public override int FieldId => 52; @@ -12,115 +13,4 @@ public class Field52 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0052_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles52").gameObject; - _fieldParticleSystemDictionary.Add("light", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_r/position/root/joint1/joint2/joint3/light").GetComponent()); - _fieldParticleSystemDictionary.Add("light_gimic", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_r/position/root/joint1/joint2/joint3/light_gimic").GetComponent()); - _fieldParticleSystemDictionary.Add("light_shake", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_r/position/root/joint1/joint2/joint3/light_shake").GetComponent()); - _fieldParticleSystemDictionary.Add("light_l", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_l/position/root/joint1/joint2/joint3/light_l").GetComponent()); - _fieldParticleSystemDictionary.Add("light_shake_l", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_l/position/root/joint1/joint2/joint3/light_shake_l").GetComponent()); - AddParticleToFieldObjDictionary("base/emitter_T/ef_dust1_mlt_inv_1"); - AddParticleToFieldObjDictionary("base/emitter_B/ef_dust1_mlt_inv_1"); - AddParticleToFieldObjDictionary("base/emitter_L/ef_dust1_mlt_inv_1"); - AddParticleToFieldObjDictionary("shake/ef_dust1_mlt_inv_1"); - _fieldObjDictionary.Add("movebranch_a", _fieldModel.transform.Find("md_bf_0052_01_movebranch_a").gameObject); - _fieldObjDictionary.Add("movebranch_b", _fieldModel.transform.Find("md_bf_0052_01_movebranch_b").gameObject); - _fieldObjDictionary.Add("movebranch_c", _fieldModel.transform.Find("md_bf_0052_01_movebranch_c").gameObject); - _fieldObjDictionary.Add("movebranch_d", _fieldModel.transform.Find("md_bf_0052_01_movebranch_d").gameObject); - _fieldObjDictionary.Add("movebranch_e", _fieldModel.transform.Find("md_bf_0052_01_movebranch_e").gameObject); - _fieldObjDictionary.Add("movebranchlight_l", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_l").gameObject); - _fieldObjDictionary.Add("movebranchlight_r", _fieldModel.transform.Find("md_bf_0052_01_movebranchlight_r").gameObject); - m_FieldAnimatorDictionary.Add("movebranch_a", _fieldObjDictionary["movebranch_a"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_b", _fieldObjDictionary["movebranch_b"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_c", _fieldObjDictionary["movebranch_c"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_d", _fieldObjDictionary["movebranch_d"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranch_e", _fieldObjDictionary["movebranch_e"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranchlight_l", _fieldObjDictionary["movebranchlight_l"].GetComponent()); - m_FieldAnimatorDictionary.Add("movebranchlight_r", _fieldObjDictionary["movebranchlight_r"].GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_52, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_52_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["light"].Play(); - _fieldParticleSystemDictionary["light_l"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(3322f, -1847f, 36f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-84f, -90f, 90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(3322f, -1847f, 36f), new Vector3(2800f, 40f, 36f), new Vector3(1036f, -27.7f, 0f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 1.5f, "islocal", true, "easetype", iTween.EaseType.easeInSine)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-8f, -90f, 90f), "time", 1.5f, "islocal", true, "easetype", iTween.EaseType.easeInSine)); - yield return new WaitForSeconds(1.5f); - _battleCamera.Camera.transform.localPosition = new Vector3(1036f, -27.7f, 0f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-8f, -90f, 90f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-323f, -19f, -18f), "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-1f, -90f, 90f), "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad)); - yield return new WaitForSeconds(0.5f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - m_FieldAnimatorDictionary["movebranchlight_r"].SetTrigger("tap"); - _fieldParticleSystemDictionary["light"].Stop(); - _fieldParticleSystemDictionary["light_gimic"].Play(); - yield return new WaitForSeconds(2f); - _fieldParticleSystemDictionary["light"].Play(); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["movebranch_a"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_b"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_c"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_d"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranch_e"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranchlight_l"].SetTrigger("shake"); - m_FieldAnimatorDictionary["movebranchlight_r"].SetTrigger("shake"); - _fieldParticleSystemDictionary["shake"].Play(); - _fieldParticleSystemDictionary["light_shake"].Play(); - _fieldParticleSystemDictionary["light_shake_l"].Play(); - yield return new WaitForSeconds(3f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field61.cs b/SVSim.BattleEngine/Engine/Wizard/Field61.cs index c0f571d4..5c5b03ce 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field61.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field61.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field61 : BackGroundBase { public override int FieldId => 61; @@ -12,87 +13,4 @@ public class Field61 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0061_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles61").gameObject; - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldObjDictionary.Add("monster", _fieldModel.transform.Find("md_bf_0061_01_monster").gameObject); - m_FieldAnimatorDictionary.Add("monster", _fieldObjDictionary["monster"].GetComponent()); - _fieldObjDictionary.Add("monster_2", _fieldModel.transform.Find("md_bf_0061_01_monster_2").gameObject); - m_FieldAnimatorDictionary.Add("monster_2", _fieldObjDictionary["monster_2"].GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_61, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_61_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_61_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(0f, -3032f, -194f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-58f, 0f, 0f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(0f, -790f, -633f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-90f, 0f, 0f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - m_FieldAnimatorDictionary["monster"].SetTrigger("monster"); - m_FieldAnimatorDictionary["monster_2"].SetTrigger("monster"); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(10f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(3f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field62.cs b/SVSim.BattleEngine/Engine/Wizard/Field62.cs index 6cfccc19..10a23c91 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field62.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field62.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field62 : BackGroundBase { public override int FieldId => 62; @@ -12,78 +13,4 @@ public class Field62 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_0062_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles62").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_62, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_62_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(0f, -3032f, -194f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-58f, 0f, 0f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(0f, -790f, -633f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-90f, 0f, 0f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(2f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field71.cs b/SVSim.BattleEngine/Engine/Wizard/Field71.cs index b614a699..537bbaf2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field71.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field71.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field71 : BackGroundBase { public override int FieldId => 71; @@ -12,77 +13,4 @@ public class Field71 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - _fieldModel = base.Field.transform.Find("md_bf_0071_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles71").gameObject; - AddParticleToFieldObjDictionary("gimic_1/Null_Adjust/ef_circle4_mlt_inv_1"); - AddParticleToFieldObjDictionary("shake/Null_Adjust/ef_bird2_mlt_inv_1"); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_71, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_71_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(2127f, -563f, -362f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-16f, -47f, 80f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-308f, 102f, -142f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-20f, -88f, 89.3f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(5f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field72.cs b/SVSim.BattleEngine/Engine/Wizard/Field72.cs index 0a1838b9..20e3db0f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field72.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field72.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field72 : BackGroundBase { public override int FieldId => 72; @@ -12,72 +13,4 @@ public class Field72 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - _fieldModel = base.Field.transform.Find("md_bf_0072_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles72").gameObject; - _fieldObjDictionary.Add("fence", _fieldModel.transform.Find("md_bf_0072_01_fence").gameObject); - m_FieldAnimatorDictionary.Add("fence", _fieldObjDictionary["fence"].GetComponent()); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_72, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_72_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(2508f, -1012f, -111f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-22.5f, -80f, 86f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(-25f, 27f, -439f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-23f, -90f, 90f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(0.3f); - m_FieldAnimatorDictionary["fence"].SetTrigger("Open"); - yield return new WaitForSeconds(1.7f); - m_FieldAnimatorDictionary["fence"].SetTrigger("Close"); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field73.cs b/SVSim.BattleEngine/Engine/Wizard/Field73.cs index eb9afc94..70a46616 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field73.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field73.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field73 : BackGroundBase { public override int FieldId => 73; @@ -12,80 +13,4 @@ public class Field73 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - _fieldModel = base.Field.transform.Find("md_bf_0073_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles73").gameObject; - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("shake_1", _fieldParticles.transform.Find("shake_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_10, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - switch (areaId) - { - case 1: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_10_1, pos); - break; - case 2: - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_10_2, pos); - break; - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _battleCamera.Camera.transform.localPosition = new Vector3(-510f, 140f, -55f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-11f, -113f, 95f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(15f, -95f, -150f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-21f, -87f, 90f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(6f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake_1"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field74.cs b/SVSim.BattleEngine/Engine/Wizard/Field74.cs index 8babf640..25b6f8f4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field74.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field74.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field74 : BackGroundBase { public override int FieldId => 74; @@ -12,65 +13,4 @@ public class Field74 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - _fieldModel = base.Field.transform.Find("md_bf_0074_01").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles74").gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_74, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_74_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-20f, 80f, 700f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-10f, 0f, 0f)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field75.cs b/SVSim.BattleEngine/Engine/Wizard/Field75.cs index 6ddb40b3..2f4185a2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field75.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field75.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field75 : BackGroundBase { public override int FieldId => 75; @@ -12,93 +13,4 @@ public class Field75 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - _fieldModel = base.Field.transform.Find("md_bf_0075_root").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles75").gameObject; - _fieldObjDictionary.Add("gate", _fieldModel.transform.Find("md_bf_0075_01_gate").gameObject); - m_FieldAnimatorDictionary.Add("gate", _fieldObjDictionary["gate"].GetComponent()); - _fieldObjDictionary.Add("tub", _fieldModel.transform.Find("md_bf_0075_01_tub").gameObject); - m_FieldAnimatorDictionary.Add("tub", _fieldObjDictionary["tub"].GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_2", _fieldParticles.transform.Find("gimic_2").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_41, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_41_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - m_FieldAnimatorDictionary["gate"].SetTrigger("Open"); - _battleCamera.Camera.transform.localPosition = new Vector3(1742f, -485f, 51f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-12f, -90f, 90f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(1742f, -485f, 51f), new Vector3(900f, -285f, 18f), new Vector3(184f, 81f, -14f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-8f, -97f, 90.5f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutSine)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - int num = Random.Range(1, 3); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_{num}", "se_field_" + _str3DFieldNo, 0f, 0L); - switch (num) - { - case 1: - m_FieldAnimatorDictionary["tub"].SetTrigger("tap"); - yield return new WaitForSeconds(3f); - break; - case 2: - m_FieldAnimatorDictionary["tub"].SetTrigger("fall"); - _fieldParticleSystemDictionary["gimic_2"].Play(); - yield return new WaitForSeconds(6f); - break; - } - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - m_FieldAnimatorDictionary["tub"].SetTrigger("tap"); - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Field76.cs b/SVSim.BattleEngine/Engine/Wizard/Field76.cs index 4b97a010..9169ff65 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Field76.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Field76.cs @@ -1,9 +1,10 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class Field76 : BackGroundBase { public override int FieldId => 76; @@ -12,82 +13,4 @@ public class Field76 : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - _fieldModel = base.Field.transform.Find("md_bf_gate_01").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles76").gameObject; - AddParticleToFieldObjDictionary("gimic_1/Null_Adjust/ef_nemesis1_add_nor_1/ef_nemesis1_mlt_inv_1"); - AddParticleToFieldObjDictionary("gimic_1/Null_Adjust/ef_nemesis1_add_nor_1/ef_circle4_mlt_inv_1"); - AddParticleToFieldObjDictionary("gimic_1/Null_Adjust/ef_nemesis1_add_nor_1/ef_radial15_add_nor_1/ef_circle9_mlt_inv_1"); - AddParticleToFieldObjDictionary("gimic_1/Null_Adjust/ef_nemesis1_add_nor_1/ef_nemesis1_add_nor_1/ef_nemesis1_mlt_inv_1"); - AddParticleToFieldObjDictionary("shake/Null_Adjust/ef_circle4_mlt_inv_1"); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_76, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - if (areaId == 1) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_76_1, pos); - } - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(0f, -20f, -1330f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-3f, 0f, 0f)); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", new Vector3(0f, 0f, -700f), "time", 1.7f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuart)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(0f, 0f, 0f), "time", 1.7f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuart)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["gimic_1"].Play(); - yield return new WaitForSeconds(3f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/FilteringImageSelection.cs b/SVSim.BattleEngine/Engine/Wizard/FilteringImageSelection.cs index fa85ef54..0dc0ff41 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FilteringImageSelection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FilteringImageSelection.cs @@ -171,11 +171,6 @@ public class FilteringImageSelection : MonoBehaviour return true; } - public bool IsLoading() - { - return _loadState == LoadState.Loading; - } - public bool IsUnloaded() { return _loadState == LoadState.Unloaded; @@ -247,20 +242,6 @@ public class FilteringImageSelection : MonoBehaviour [SerializeField] private int _itemNumPerPage = 10; - private const int LOAD_GENERATION_MAX = 1024; - - private const int LOAD_GENERATION_MIN = -1024; - - private const float FLICK_MARGIN = 70f; - - private const int SERIES_DIALOG_DEPTH = 500; - - private const int SERIES_DIALOG_SORT_ORDER = 1; - - private const int SERIES_ALL_INDEX = -1; - - private const int CLOSE_BUTTON_DEPTH_COPY = 33; - private List _itemList; private List _dataList; @@ -295,7 +276,6 @@ public class FilteringImageSelection : MonoBehaviour protected UIManager _uiManager; - protected SoundMgr _soundManager; private bool _isFavoriteMode; @@ -322,8 +302,6 @@ public class FilteringImageSelection : MonoBehaviour } } - public bool IsDuringReset { get; private set; } - public UIButton DialogCloseButton { get; set; } protected virtual FavoriteTask.Kind TaskKind { get; } @@ -333,7 +311,6 @@ public class FilteringImageSelection : MonoBehaviour public virtual void Initialize(int itemMax, int seriesMax) { _uiManager = UIManager.GetInstance(); - _soundManager = GameMgr.GetIns().GetSoundMgr(); _itemList = new List(_itemNumPerPage); _dataList = new List(_itemNumPerPage); for (int i = 0; i < _itemNumPerPage; i++) @@ -361,7 +338,7 @@ public class FilteringImageSelection : MonoBehaviour SetMode(!_isFavoriteMode); if (_isFavoriteMode) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + if (_dialogCloseButtonCopy == null) { _dialogCloseButtonCopy = UnityEngine.Object.Instantiate(DialogCloseButton); @@ -373,7 +350,7 @@ public class FilteringImageSelection : MonoBehaviour } else { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); + } }); } @@ -387,13 +364,13 @@ public class FilteringImageSelection : MonoBehaviour { _toggleFavorite.normalSprite = "btn_favorite_off"; _selectedItemData.IsFavorite = false; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_OFF); + } else { _toggleFavorite.normalSprite = "btn_favorite_on"; _selectedItemData.IsFavorite = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } FilteringImageSelectionItem filteringImageSelectionItem = _itemList.FirstOrDefault((FilteringImageSelectionItem x) => x.Data == _selectedItemData); if (filteringImageSelectionItem != null) @@ -430,15 +407,6 @@ public class FilteringImageSelection : MonoBehaviour } } - public void AddItem(string key, int series, bool isSelectable, string loadTexturePath, string fetchTexturePath, bool isDisplaySprite, string name, string[] texts, Func isNewItemFunc, Action onDisplayAction, Action textureSetting = null, long? textureSettingItemId = null, bool isFavorite = false) - { - if (_dataList != null) - { - ItemData item = new ItemData(key, series, isSelectable, loadTexturePath, fetchTexturePath, isDisplaySprite, name, texts, isNewItemFunc, onDisplayAction, textureSetting, textureSettingItemId, isFavorite); - _dataList.Add(item); - } - } - public void AddItem(string key, int series, bool isSelectable, List loadTexturePaths, string fetchTexturePath, bool isDisplaySprite, string name, string[] texts, Func isNewItemFunc, Action onDisplayAction, Action textureSetting = null, long? textureSettingItemId = null, bool isFavorite = false) { if (_dataList != null) @@ -497,28 +465,6 @@ public class FilteringImageSelection : MonoBehaviour SetMode(isFavorite: false); } - public IEnumerator Reset() - { - IsDuringReset = true; - int i = 0; - for (int count = _dataList.Count; i < count; i++) - { - _dataList[i].Unload(); - } - int i2 = 0; - int count2 = _dataList.Count; - while (i2 < count2) - { - if (!_dataList[i2].IsUnloaded()) - { - yield return null; - } - int num = i2 + 1; - i2 = num; - } - IsDuringReset = false; - } - private void OnNextPage() { Paging(isNext: true); @@ -536,7 +482,7 @@ public class FilteringImageSelection : MonoBehaviour return; } _pageIndex = GetLoopPageIndex(isNext ? (_pageIndex + 1) : (_pageIndex - 1), _pageIndexMax); - _soundManager.PlaySe(Se.TYPE.SYS_SLIDE_BTN); + _canUpdateItems = false; _isPaging = true; StartPageMoveTween(isAppear: false, isNext, delegate @@ -726,14 +672,6 @@ public class FilteringImageSelection : MonoBehaviour } } - private void UnloadAllTexture() - { - foreach (ItemData item in _dataList.Where((ItemData data) => !data.IsUnloaded())) - { - item.Unload(); - } - } - private IEnumerator UpdateItems(Action onFinish = null) { while (!_canUpdateItems) @@ -764,7 +702,7 @@ public class FilteringImageSelection : MonoBehaviour component.onClick.Clear(); component.onClick.Add(new EventDelegate(delegate { - Se.TYPE setype = Se.TYPE.SYS_TOGGLE_ON; + int setype = 0; if (data._isSelectable) { OnClickSelectableItem(data); @@ -774,7 +712,7 @@ public class FilteringImageSelection : MonoBehaviour item.SetFavorite(data.IsFavorite); if (!data.IsFavorite) { - setype = Se.TYPE.SYS_TOGGLE_OFF; + setype = 0; } } UpdateToggleFavoriteButton(data.IsFavorite); @@ -783,7 +721,7 @@ public class FilteringImageSelection : MonoBehaviour { OnClickNonSelectableItem(data); } - _soundManager.PlaySe(setype); + })); } if (onFinish != null) @@ -839,7 +777,7 @@ public class FilteringImageSelection : MonoBehaviour private void CreateSeriesSelectionDialog() { - _soundManager.PlaySe(Se.TYPE.SYS_BTN_DECIDE); + List list = new List(_seriesList.Count + 1); list.Add(Data.SystemText.Get("Card_0186")); int i = 0; @@ -980,11 +918,6 @@ public class FilteringImageSelection : MonoBehaviour return dataList.Any((ItemData data) => data.IsLoaded()); } - private void OnDestroy() - { - UnloadAllTexture(); - } - public void DestroyDialogCloseButtonCopy() { if (_dialogCloseButtonCopy != null) diff --git a/SVSim.BattleEngine/Engine/Wizard/FilteringSleeveSelection.cs b/SVSim.BattleEngine/Engine/Wizard/FilteringSleeveSelection.cs index 822fee3e..33a93f97 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FilteringSleeveSelection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FilteringSleeveSelection.cs @@ -13,8 +13,6 @@ public class FilteringSleeveSelection : FilteringImageSelection [SerializeField] private UIPanel _zoomPanel; - private const float ZOOM_DURATION = 0.3f; - protected override FavoriteTask.Kind TaskKind => FavoriteTask.Kind.SLEEVE; protected override string SelectionButtonTextId => "Profile_0046"; @@ -28,7 +26,7 @@ public class FilteringSleeveSelection : FilteringImageSelection private void OpenZoom() { - _soundManager.PlaySe(Se.TYPE.SYS_CARD_INFO); + _zoomPanel.gameObject.SetActive(value: true); iTween.Stop(_zoomTexture.gameObject); _zoomTexture.transform.localScale = Vector3.zero; @@ -38,7 +36,7 @@ public class FilteringSleeveSelection : FilteringImageSelection private void CloseZoom() { iTween.Stop(_zoomTexture.gameObject); - _soundManager.PlaySe(Se.TYPE.SYS_BTN_CANCEL); + _zoomPanel.gameObject.SetActive(value: false); } diff --git a/SVSim.BattleEngine/Engine/Wizard/FirstTips.cs b/SVSim.BattleEngine/Engine/Wizard/FirstTips.cs index eb5b8b65..10034937 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FirstTips.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FirstTips.cs @@ -11,264 +11,23 @@ public class FirstTips : MonoBehaviour public enum TipsType { Deck = 0, - CardCreate = 1, - ChallengeTwoPick = 2, - SoroPlay = 3, Battle = 4, - Card = 5, - VideoSharing = 6, - VideoRecordingIosJpn = 7, - VideoRecordingIosEng = 8, - VideoRecordingAndroidEng = 9, ShopCardPack = 10, - CardDestruct = 11, - Convention = 12, BattleBeforeFormatUser = 13, - DeckBeforeFormatUser = 14, - DeckAfterFormatUser = 15, - Colosseum = 16, ColosseumInfo = 17, - Challenge = 18, - Sealed = 19, - GuildNotJoining = 20, - GuildJoining = 21, - SoroPlayOnlydAssist = 22, - SpotCardExchange = 23, GachaPointExchange = 24, Quest = 25, AdditionalPuzzle = 26, - Competition = 27, Crossover = 28, - Bingo = 29, - NeutralPopularityVote = 30, - LeaderPopularityVote = 31, - CompetitionVer2 = 32, MyRotationDeck = 33, BossRush = 34, - CompetitionTwoPick = 35, - RedEtherCampaign = 36, - SoroPlay2 = 37, - ResurgentCard = 38, - ColosseumWindFall = 39, HeroesFreeMatch = 40, - HeroesGrandPrix = 41, TimeslipResurgentCard = 42, - Colosseum2PickChaos = 43, - ChallengeTwoPickCube = 44, - ChallengeTwoPickChaos = 45, Max = 46, - MyPage = 1001, - BattlePathSeason = 1002 - } + MyPage = 1001 } protected enum Csv { - TipsType, - TextId, - Mask, - PrefabName, - ImageName - } - - public const float TWEEN_ALPHA_TIME = 0.5f; - - [SerializeField] - private UITexture m_ImageTex; - - [SerializeField] - private UILabel m_WindowLabel; - - [SerializeField] - private GameObject m_NextTextMarkObject; - - [SerializeField] - private GameObject m_MaskObject; - - [SerializeField] - private TweenAlpha m_TweenAlpha; - - [SerializeField] - private UIPanel _panel; - - private ArrayList m_Csv; - - private List m_TipsData; - - private IEnumerable _tipsTypes; - - private int m_PageNo; - - private int m_PageMaxNo; - - private GameObject m_TipsPrefab; - - private bool m_DestoryFlg; - - private bool _isResourceLoadFinish; - - private int _startPage; - - private List m_AssetFileList = new List(); - - private ResourcesManager.AssetLoadPathType m_AssetType = ResourcesManager.AssetLoadPathType.FirstTips; - - private bool _isEnableBackKeyChange = true; - - private Action _onFinish; - - private int _seasonId; - - private const string TIPS_CSV_NAME = "firsttips"; - - public bool IsEnableBackKeyChange - { - get - { - return _isEnableBackKeyChange; - } - set - { - _isEnableBackKeyChange = value; - } - } - - public void CreateTips(TipsType in_TipsType, Action onFinish) - { - CreateTips(new TipsType[1] { in_TipsType }, onFinish); - } - - public void CreateTips(IEnumerable tipsTypes, Action onFinish, int startPage = 0, int seasonId = 0) - { - _startPage = startPage; - _onFinish = onFinish; - _panel.alpha = 0f; - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; - m_TweenAlpha.enabled = false; - m_AssetFileList.Clear(); - _tipsTypes = tipsTypes; - _seasonId = seasonId; - List list = new List(); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("firsttips", ResourcesManager.AssetLoadPathType.Master); - list.Add(assetTypePath); - m_AssetFileList.Add(assetTypePath); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(list, _CsvLoadEnd)); - } - - protected void _CsvLoadEnd() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("etc/firsttips", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(assetTypePath); - m_Csv = Utility.ConvertCSV(textAsset.text); - m_TipsData = new List(); - foreach (TipsType tipsType in _tipsTypes) - { - foreach (ArrayList item in m_Csv) - { - string[] array = (string[])item.ToArray(typeof(string)); - if (int.Parse(array[0]) == (int)tipsType) - { - m_TipsData.Add(array); - } - } - } - m_PageMaxNo = m_TipsData.Count; - List list = new List(); - foreach (string[] tipsDatum in m_TipsData) - { - if (tipsDatum[4] != "") - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(tipsDatum[4], m_AssetType); - assetTypePath2 = ConvertSeasonImageFileName((TipsType)int.Parse(tipsDatum[0]), assetTypePath2); - if (!list.Contains(assetTypePath2)) - { - list.Add(assetTypePath2); - m_AssetFileList.Add(assetTypePath2); - } - } - if (tipsDatum[3] != "") - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(tipsDatum[3], m_AssetType); - if (!list.Contains(assetTypePath2)) - { - list.Add(assetTypePath2); - m_AssetFileList.Add(assetTypePath2); - } - } - } - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(list, _ResourceLoadEnd)); - } - - protected void _ResourceLoadEnd() - { - _isResourceLoadFinish = true; - m_TweenAlpha.enabled = true; - _PageSet(_startPage); - } - - public void TipsClickCallBack() - { - if (_isResourceLoadFinish && !m_DestoryFlg) - { - m_PageNo++; - if (m_PageMaxNo > m_PageNo) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_FEED_TEXT); - _PageSet(m_PageNo); - } - else if (m_PageNo == m_PageMaxNo) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL); - m_TweenAlpha.PlayReverse(); - m_DestoryFlg = true; - StartCoroutine(Destroy()); - } - } - } - - protected void _PageSet(int in_PageNo) - { - m_PageNo = in_PageNo; - SystemText systemText = Data.SystemText; - m_WindowLabel.SetWrapText(systemText.Get(m_TipsData[m_PageNo][1])); - if (m_PageMaxNo != 1) - { - m_NextTextMarkObject.SetActive(value: true); - } - else - { - m_NextTextMarkObject.SetActive(value: false); - } - if ("1" == m_TipsData[m_PageNo][2]) - { - m_MaskObject.SetActive(value: true); - } - else - { - m_MaskObject.SetActive(value: false); - } - string text = m_TipsData[m_PageNo][4]; - if (text != "") - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(text, m_AssetType, isfetch: true); - assetTypePath = ConvertSeasonImageFileName((TipsType)int.Parse(m_TipsData[m_PageNo][0]), assetTypePath); - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath); - m_ImageTex.mainTexture = mainTexture; - } - string path = m_TipsData[m_PageNo][3]; - if (m_TipsData[m_PageNo][3] != "") - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(path, m_AssetType, isfetch: true); - m_TipsPrefab = Toolbox.ResourcesManager.LoadObject(assetTypePath2); - m_TipsPrefab = UnityEngine.Object.Instantiate(m_TipsPrefab); - m_TipsPrefab.transform.parent = m_ImageTex.gameObject.transform; - m_TipsPrefab.transform.localPosition = Vector3.zero; - m_TipsPrefab.transform.localScale = Vector3.one; - } - else if (m_TipsPrefab != null) - { - UnityEngine.Object.Destroy(m_TipsPrefab); - m_TipsPrefab = null; - } } private static bool IsAllwaysDispaly(TipsType in_TipsType) @@ -280,15 +39,6 @@ public class FirstTips : MonoBehaviour return false; } - private string ConvertSeasonImageFileName(TipsType tipsType, string imagePath) - { - if (tipsType == TipsType.BattlePathSeason || tipsType == TipsType.Colosseum2PickChaos || tipsType == TipsType.ChallengeTwoPickChaos) - { - return string.Format(imagePath, _seasonId); - } - return imagePath; - } - public static bool IsFirstTipsOpen(TipsType in_TipsType) { if (IsAllwaysDispaly(in_TipsType)) @@ -306,27 +56,6 @@ public class FirstTips : MonoBehaviour return true; } - private IEnumerator Destroy() - { - float time = 0f; - while (time < 0.5f) - { - time += Time.deltaTime; - yield return null; - } - foreach (TipsType tipsType in _tipsTypes) - { - SaveFinishFirstTips(tipsType); - } - _onFinish.Call(); - UnityEngine.Object.Destroy(base.gameObject); - } - - public static void ClearTipsFlag() - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.FIRST_TIPS, 0.ToString()); - } - public static void SaveFinishFirstTips(TipsType tips) { if (!IsAllwaysDispaly(tips)) @@ -337,18 +66,6 @@ public class FirstTips : MonoBehaviour } } - protected void OnDestroy() - { - if (m_AssetFileList.Count != 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(m_AssetFileList); - } - if (IsEnableBackKeyChange) - { - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; - } - } - public static long Fix(long value) { if (value < 0) diff --git a/SVSim.BattleEngine/Engine/Wizard/Font.cs b/SVSim.BattleEngine/Engine/Wizard/Font.cs deleted file mode 100644 index cb11b1ae..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Font.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Wizard; - -public class Font -{ - private const int MIN_TsukuAOldMin = 32; - - private const int MAX_TsukuAOldMin = 126; - - public static bool IsSupported_TsukuAOldMin(string str) - { - for (int i = 0; i < str.Length; i++) - { - if (!IsSupported_TsukuAOldMin(str[i])) - { - return false; - } - } - return true; - } - - public static bool IsSupported_TsukuAOldMin(char ch) - { - if (' ' <= ch) - { - return ch <= '~'; - } - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/Footer.cs b/SVSim.BattleEngine/Engine/Wizard/Footer.cs index 58ea5082..d20bbce3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Footer.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Footer.cs @@ -159,7 +159,7 @@ public class Footer : UIBase private void buttonSoundMenu() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SWITCH_MENU); + } public void ShowFooterMenu(bool isShow) @@ -309,22 +309,6 @@ public class Footer : UIBase SoloPlayIconDisp(flag || flag2 || flag3); } - public void TurnOffStoryBadgeIcon(bool isTurnOffDisplayBadgeFlag) - { - bool flag = false; - bool flag2 = false; - if (Data.Load.data._userTutorial.TutorialStep == 100) - { - flag = Data.MyPageNotifications.data.QuestOpenInfo.IsDisplayBadge; - flag2 = Data.MyPageNotifications.data.IsPracticePuzzleBadgeEnable; - } - if (isTurnOffDisplayBadgeFlag) - { - Data.MyPageNotifications.data.StoryNotification.TurnOffIsDisplayBadge(); - } - SoloPlayIconDisp(flag || flag2); - } - public void UpdateOtherBadgeIcon() { OtherIconDisp(Data.MyPageNotifications.data.ReceiveFriendApplyCount > 0); diff --git a/SVSim.BattleEngine/Engine/Wizard/FormatBehaviorManager.cs b/SVSim.BattleEngine/Engine/Wizard/FormatBehaviorManager.cs index b2e4d23d..6bfd738f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FormatBehaviorManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FormatBehaviorManager.cs @@ -1,4 +1,8 @@ using System.Collections.Generic; +// TODO(engine-cleanup-pass2): 2 of 4 methods unrun in baseline +// Type: Wizard.FormatBehaviorManager +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -51,14 +55,4 @@ public static class FormatBehaviorManager _ => new NoneFormatBehavior(), }; } - - public static string GetFormatName(Format format) - { - return format switch - { - Format.Hof => Data.SystemText.Get("Colosseum_0108"), - Format.Windfall => Data.SystemText.Get("Colosseum_0115"), - _ => GetDefaultBehaviour(format).Name, - }; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/FormatChangeUI.cs b/SVSim.BattleEngine/Engine/Wizard/FormatChangeUI.cs index e76949ee..80405afe 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FormatChangeUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FormatChangeUI.cs @@ -22,18 +22,6 @@ public class FormatChangeUI : MonoBehaviour Other } - private const string UNLIMITED_CENTER_SPRITE_OFF = "btn_unlimited_center_off"; - - private const string UNLIMITED_CENTER_SPRITE_ON = "btn_unlimited_center_on"; - - private const string UNLIMITED_RIGHT_SPRITE_OFF = "btn_gacha_unlimited_off"; - - private const string UNLIMITED_RIGHT_SPRITE_ON = "btn_gacha_unlimited_on"; - - private const string OLD_ROTATION_SPRITE_ON = "btn_gacha_rotation_on"; - - private const string OLD_ROTATION_SPRITE_OFF = "btn_gacha_rotation_off"; - private static readonly Dictionary ANOTHER_BTN_SPRITES = new Dictionary { { @@ -75,12 +63,6 @@ public class FormatChangeUI : MonoBehaviour return component; } - public void ShowOldRotationIcon() - { - _btnRotation.normalSprite = "btn_gacha_rotation_on"; - _btnRotation.pressedSprite = "btn_gacha_rotation_off"; - } - public void ChangeFormat(FormatCategory inFormatCategory) { _currentFormatCategory = inFormatCategory; @@ -149,7 +131,7 @@ public class FormatChangeUI : MonoBehaviour { if (_currentFormatCategory != formatCategory) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + ChangeFormat(formatCategory); _onChangeFormat.Call(formatCategory); StartCoroutine(WaitForCanClickFormatBtns()); diff --git a/SVSim.BattleEngine/Engine/Wizard/FreeAndRankMatchDeckSelectConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/FreeAndRankMatchDeckSelectConfirmDialog.cs index ba62f6b6..f8ac53c2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FreeAndRankMatchDeckSelectConfirmDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FreeAndRankMatchDeckSelectConfirmDialog.cs @@ -22,7 +22,7 @@ public static class FreeAndRankMatchDeckSelectConfirmDialog { uiCardList.SetEnableBlueButton(isEnable: true, Data.SystemText.Get("Card_0007"), delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DeckCardEditUI.SetDeckEditParameter(deck, null); ChangeViewSceneAndSetBattleRetry(UIManager.ViewScene.DeckCardEdit); }); @@ -34,37 +34,23 @@ public static class FreeAndRankMatchDeckSelectConfirmDialog { DeckListUtility.DataMgrSaveLastSelectDeckData(deck); ToolboxGame.UIManager.createInSceneLoadingMatching(notBlack, notCollider); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); + UIManager.GetInstance().StartCoroutine(ChangeMatchingScene(isBattleEnd)); } private static IEnumerator ChangeMatchingScene(bool isBattleEnd) { yield return UIManager.GetInstance().StartCoroutine(MasterResetMonthTask.MasterReset()); - if (isBattleEnd) - { - if (BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().GetCurrentPhase() is MainPhase) - { - LocalLog.AccumulateTraceLog("Move Matching From deckSelectEnd"); - } - else - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.RankMatch); - } - } - else - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.RankMatch); - } + // Pre-Phase-5b: gated on mgr.GetCurrentPhase() to trace + BattleControl.BattleEnd + // on the way out. BattleControl is a stub (chunk 7); collapse to the else branch's + // UIManager scene change, which is the only observable output. + UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.RankMatch); } private static void ChangeViewSceneAndSetBattleRetry(UIManager.ViewScene viewScene) { - if (UIManager.GetInstance().IsCurrentScene(UIManager.ViewScene.Battle)) - { - GameMgr.GetIns().GetBattleCtrl().BattleEnd(viewScene, SetBattleRetryForDeckCardEdit); - return; - } + // Pre-Phase-5b: battle-scene branch routed through GameMgr.GetBattleCtrl().BattleEnd. + // BattleControl is a stub (chunk 7); collapse to the else branch. UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); changeViewSceneParam.OnChange = SetBattleRetryForDeckCardEdit; UIManager.GetInstance().ChangeViewScene(viewScene, changeViewSceneParam); diff --git a/SVSim.BattleEngine/Engine/Wizard/FreeBattleDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/FreeBattleDoMatchingTask.cs deleted file mode 100644 index c59df456..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/FreeBattleDoMatchingTask.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Wizard; - -public class FreeBattleDoMatchingTask : DoMatchingBase -{ - public FreeBattleDoMatchingTask() - { - switch (Data.CurrentFormat) - { - case Format.Rotation: - base.type = ApiType.Type.FreeBattleDoMatchingRotation; - break; - case Format.Unlimited: - base.type = ApiType.Type.FreeBattleDoMatchingUnlimited; - break; - case Format.PreRotation: - base.type = ApiType.Type.FreeBattleDoMatchingPreRotation; - break; - case Format.Crossover: - base.type = ApiType.Type.FreeBattleDoMatchingCrossover; - break; - case Format.MyRotation: - base.type = ApiType.Type.FreeBattleDoMatchingMyRotation; - break; - case Format.Avatar: - base.type = ApiType.Type.FreeBattleDoMatchingAvatar; - break; - } - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - SettingDoMatchingData(); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/FreeBattleFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/FreeBattleFinishTask.cs deleted file mode 100644 index bde62f52..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/FreeBattleFinishTask.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Wizard; - -public class FreeBattleFinishTask : FinishTaskBase -{ - public FreeBattleFinishTask() - { - switch (Data.CurrentFormat) - { - case Format.Rotation: - base.type = ApiType.Type.FreeMatchFinishRotation; - break; - case Format.Unlimited: - base.type = ApiType.Type.FreeMatchFinishUnlimited; - break; - case Format.PreRotation: - base.type = ApiType.Type.FreeMatchFinishPreRotation; - break; - case Format.Crossover: - base.type = ApiType.Type.FreeMatchFinishCrossover; - break; - case Format.MyRotation: - base.type = ApiType.Type.FreeMatchFinishMyRotation; - break; - case Format.Avatar: - base.type = ApiType.Type.FreeMatchFinishAvatar; - break; - } - Data.FreeMatchFinish.data = null; - } - - protected override int Parse() - { - int num = base.Parse(); - if (IsEffectiveErrorCode(num)) - { - return num; - } - Data.FreeMatchFinish.data = new FreeMatchFinishDetail(); - if (!IsResponseDataExist(base.ResponseData)) - { - return num; - } - new BattleFinishResponsProcessing().Processing(base.ResponseData, Data.FreeMatchFinish.data); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/FreeCardPackCampaignFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/FreeCardPackCampaignFinishTask.cs index d15777b2..f8f2e9c3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/FreeCardPackCampaignFinishTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/FreeCardPackCampaignFinishTask.cs @@ -4,11 +4,6 @@ public class FreeCardPackCampaignFinishTask : BaseTask { public class FreeCardPackCampaignFinishTaskParam : BaseParam { - public int campaign_id { get; set; } - - public int prize { get; set; } - - public int opened_box { get; set; } } public FreeCardPackCampaignFinishTask() @@ -16,15 +11,6 @@ public class FreeCardPackCampaignFinishTask : BaseTask base.type = ApiType.Type.FreeCardPackBoxFinish; } - public void SetParameter(int campaignId, int prizeId, int openedBox) - { - FreeCardPackCampaignFinishTaskParam freeCardPackCampaignFinishTaskParam = new FreeCardPackCampaignFinishTaskParam(); - freeCardPackCampaignFinishTaskParam.campaign_id = campaignId; - freeCardPackCampaignFinishTaskParam.prize = prizeId; - freeCardPackCampaignFinishTaskParam.opened_box = openedBox; - base.Params = freeCardPackCampaignFinishTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard/FriendApplySendTask.cs b/SVSim.BattleEngine/Engine/Wizard/FriendApplySendTask.cs deleted file mode 100644 index a5715040..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/FriendApplySendTask.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Wizard; - -public class FriendApplySendTask : BaseTask -{ - public class FriendApplySendTaskParam : BaseParam - { - public int friend_id; - } - - public FriendApplySendTask() - { - base.type = ApiType.Type.FriendApplySend; - } - - public void SetParameter(int friend_id) - { - FriendApplySendTaskParam friendApplySendTaskParam = new FriendApplySendTaskParam(); - friendApplySendTaskParam.friend_id = friend_id; - base.Params = friendApplySendTaskParam; - } - - protected override int Parse() - { - int result = base.Parse(); - _ = 1; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/FriendUserSearchTask.cs b/SVSim.BattleEngine/Engine/Wizard/FriendUserSearchTask.cs deleted file mode 100644 index fe538ae2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/FriendUserSearchTask.cs +++ /dev/null @@ -1,39 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class FriendUserSearchTask : BaseTask -{ - public class FriendUserSearchTaskParam : BaseParam - { - public int search_viewer_id; - } - - public FriendUserSearchTask() - { - base.type = ApiType.Type.FriendUserSearch; - } - - public void SetParameter(int search_viewer_id) - { - FriendUserSearchTaskParam friendUserSearchTaskParam = new FriendUserSearchTaskParam(); - friendUserSearchTaskParam.search_viewer_id = search_viewer_id; - base.Params = friendUserSearchTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.SearchUserInfo.Initizalize(); - JsonData jsonData = base.ResponseData["data"]["user_info"]; - if (jsonData.Count > 0) - { - Data.SearchUserInfo.data.user = new UserFriend(jsonData); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaLayoutEffect.cs b/SVSim.BattleEngine/Engine/Wizard/GachaLayoutEffect.cs index 38e512ad..cb12e152 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaLayoutEffect.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaLayoutEffect.cs @@ -19,8 +19,6 @@ public class GachaLayoutEffect : MonoBehaviour private GameObject _effectObj; - private const int EFFECT_SORTING_ORDER = 1; - public void Setup(string effectName, int stencil, List resourceList) { if (!_isChangingPack) @@ -78,7 +76,7 @@ public class GachaLayoutEffect : MonoBehaviour obj.sortingOrder = 1; obj.material = new Material(obj.material); } - GameMgr.GetIns().GetEffectMgr().ChangeMaskShader(_effectObj, stencil); + /* Pre-Phase-5b: ChangeMaskShader dropped */ } float num2 = 1f / _effectObj.transform.localScale.x; Transform[] componentsInChildren2 = _effectObj.GetComponentsInChildren(); diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaLayoutPurchaseButton.cs b/SVSim.BattleEngine/Engine/Wizard/GachaLayoutPurchaseButton.cs index e6cc4f9c..18b6f231 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaLayoutPurchaseButton.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaLayoutPurchaseButton.cs @@ -51,18 +51,6 @@ public class GachaLayoutPurchaseButton : MonoBehaviour [SerializeField] private UISprite _frame; - private const string RIBBON_SPRITE_RED = "campaign_title_02"; - - private const string RIBBON_SPRITE_PINK = "campaign_title_04"; - - private const float RIBBON_LABEL_POS_X = 5f; - - private const float RIBBON_LABEL_POS_X_WITH_ICON = 26.3f; - - private const int RIBBON_LABEL_WIDTH = 203; - - private const int RIBBON_LABEL_WIDTH_WITH_ICON = 167; - public Vector3 LayoutLocalPosition { get diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaPackAreaLayout.cs b/SVSim.BattleEngine/Engine/Wizard/GachaPackAreaLayout.cs index 06c5892c..3364c4c7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaPackAreaLayout.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaPackAreaLayout.cs @@ -7,28 +7,11 @@ namespace Wizard; public class GachaPackAreaLayout : MonoBehaviour { - private const int TICKET_BUTTON_TUTORIAL_GUIDE_ROTATION = -45; private readonly Vector3 DEFAULT_PACK_TICKET_POSITION = new Vector3(7f, 40.6f, 0f); private readonly Vector3 LEGEND_PACK_TICKET_POSITION = new Vector3(7f, -179.6f, 0f); - private const string REPLACE_REMAIN = "{remaining_purchase_time}"; - - private const int SECONDS_PER_DAY = 86400; - - private const int SECONDS_PER_HOUR = 3600; - - private const int SECONDS_PER_MINUTE = 60; - - private const int DEPTH_BANNER_DIALOG = 610; - - private const string LAYER_DIALOG_PURCHASE_REWARD = "MyPage"; - - private const int DEPTH_DIALOG_PURCHASE_REWARD = 140; - - private const int SORTODER_DIALOG_PURCHASE_REWARD = 2; - [SerializeField] private UITexture _packTitleTexture; @@ -378,7 +361,7 @@ public class GachaPackAreaLayout : MonoBehaviour private void OnBtnShowGachaRate(PackConfig packConfig) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate { @@ -612,7 +595,7 @@ public class GachaPackAreaLayout : MonoBehaviour uIButton.onClick.Clear(); uIButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ShowPurchaseRewardDialog(purchaseInfo.RewardsList); })); } @@ -748,7 +731,7 @@ public class GachaPackAreaLayout : MonoBehaviour _btnSpecialPackReward.onClick.Clear(); _btnSpecialPackReward.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ShowPurchaseRewardDialog(packConfig.SpecialPackRewardsList); })); } diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaPointExchange.cs b/SVSim.BattleEngine/Engine/Wizard/GachaPointExchange.cs index b971a292..3add295f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaPointExchange.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaPointExchange.cs @@ -10,19 +10,6 @@ namespace Wizard; public class GachaPointExchange : MonoBehaviour { - private const string SPRITE_CLASS_TAB_NEUTRAL = "class_tab_neutral"; - - private const int CONFIRM_DIALOG_DEPTH = 600; - - private const int CONFIRM_DIALOG_INNER_DEPTH = 610; - - private const int SORTING_ORDER_REWARD_DIALOG = 2; - - private const int CARD_OBJECT_DEPTH = 20; - - private const float CARD_OBJECT_SCALE = 0.36f; - - private const float CARD_OBJECT_COLLIDER_SCALE = 0.9f; [SerializeField] private SimpleScrollViewUI _gachaPointScrollView; @@ -103,18 +90,6 @@ public class GachaPointExchange : MonoBehaviour _atlasProfile = Toolbox.ResourcesManager.LoadObject(profileAtlasName).GetComponent(); } - private void UnloadResources() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - - private void OnDestroy() - { - UnloadResources(); - UnloadCardObject(); - } - private void InitCardDetail() { _cardDetail = DialogCreator.CreateCardDetailDialog(_cardDetailRoot, "Detail"); @@ -202,7 +177,7 @@ public class GachaPointExchange : MonoBehaviour int num = _cardDetailIndex + ((!(x > 0f)) ? 1 : (-1)); if (num >= 0 && _cardObjectList.Count > num) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + _cardDetail.CloseDefault(playSe: false); _cardDetail.ShowCardDetail(_cardObjectList[num].CardObj); _cardDetailIndex = num; @@ -310,7 +285,7 @@ public class GachaPointExchange : MonoBehaviour private void OnClickConfirmExchangeButton(GachaPointExchangeInfo gachaPointExchangeInfo) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ShowConfirmExchangeDialog(gachaPointExchangeInfo); } diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangeDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangeDialog.cs index fbff1c8a..8fc87b40 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangeDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangeDialog.cs @@ -5,9 +5,6 @@ namespace Wizard; public class GachaPointExchangeDialog : MonoBehaviour { - private const int EXCHANGE_DIALOG_DEPTH = 900; - - private const int EXCHANGE_DIALOG_SORTING_ORDER = 37; [SerializeField] private GachaPointExchange _gachaPointExchangeOriginal; diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangePlate.cs b/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangePlate.cs index baf358bb..3e63ebf9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangePlate.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaPointExchangePlate.cs @@ -10,8 +10,6 @@ public class GachaPointExchangePlate : MonoBehaviour { private readonly Quaternion CARDOBJECT_ROTATION_QUATERNION = new Quaternion(0f, 0f, 0f, 0f); - private const string SPOT_CARD_NUM_FORMAT = "[fcd24a]+{0}[-]"; - [SerializeField] private GameObject _objCardRoot; @@ -50,7 +48,7 @@ public class GachaPointExchangePlate : MonoBehaviour text = Data.SystemText.Get("Shop_0235") + " " + text; } _labelCardName.text = text; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr int possessionCardNum = dataMgr.GetPossessionCardNum(gachaPointInfo.CardId, isIncludingSpotCard: false); int spotCardNum = dataMgr.SpotCardData.GetSpotCardNum(gachaPointInfo.CardId); _labelCardPossessionNumNormal.text = possessionCardNum + ((spotCardNum > 0) ? $"[fcd24a]+{spotCardNum}[-]" : string.Empty); diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPack.cs b/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPack.cs index 08727c23..7194c2ea 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPack.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPack.cs @@ -8,20 +8,15 @@ namespace Wizard; public class GachaResultBuyCardPack : UIBase { - private const int MAX_ROW_IN_PAGE = 2; private readonly int[] MAX_COLUMN_RARELITY = new int[4] { 8, 8, 8, 8 }; - private const float CARD_SCALE = 0.55f; - private readonly Vector3 GRID_LOCAL_POSITION = Vector3.up * -6f; private readonly Vector3 GRID_ONLY_ONE_LOCAL_POSITION = Vector3.up * -15f; private readonly Vector3 NEW_LABEL_POSITION = Vector3.up * -150f; - private const string FREE_PACK_LEADER_SKIN_EFFECT = "gch_result_skin_1"; - private bool m_isCenterLoading; [SerializeField] @@ -117,22 +112,6 @@ public class GachaResultBuyCardPack : UIBase public bool IsDialogCloseStart { get; set; } - private void Update() - { - if (!m_isCenterLoading && m_isInitLoadFinish && GameMgr.GetIns().GetInputMgr().IsFlick() && IsFlickEnable) - { - if (GameMgr.GetIns().GetInputMgr().GetFlickVec() - .x < 0f) - { - OnNextButton(); - } - else - { - OnPrevButton(); - } - } - } - public void Init(List cardPackList, CardDetailUI cardDetailUI) { m_cardDetailUI = cardDetailUI; @@ -325,24 +304,6 @@ public class GachaResultBuyCardPack : UIBase } } - public void OnNextButton() - { - if (!m_isCenterLoading && m_isInitLoadFinish && !IsDialogCloseStart && !m_cardDetailUI.GetIsDetailOn() && currentPage < m_CardPackListPerPage.Count) - { - StartCoroutine(ViewCardList(++currentPage)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - - public void OnPrevButton() - { - if (!m_isCenterLoading && m_isInitLoadFinish && !IsDialogCloseStart && !m_cardDetailUI.GetIsDetailOn() && currentPage > 1) - { - StartCoroutine(ViewCardList(--currentPage)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - private List SortCardList(List cardList) { List idList = cardList.ConvertAll((CardPack conv) => conv.card_id); @@ -471,7 +432,7 @@ public class GachaResultBuyCardPack : UIBase _particleGroup.StartEffect(param, isEnableUpdateReposition: true); } cardObj.transform.localPosition += Vector3.back; - if (GameMgr.GetIns().GetDataMgr().IsNewCard(cardObjList[i].ids)) + if (false /* Pre-Phase-5b: no new-card state headless */) { cardObj.GetComponent()._newLabel.transform.localPosition = NEW_LABEL_POSITION; } diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPackDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPackDialog.cs index 4d24693e..f039b3f6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPackDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaResultBuyCardPackDialog.cs @@ -8,9 +8,6 @@ namespace Wizard; public class GachaResultBuyCardPackDialog : MonoBehaviour { - private const int PANEL_DEPTH_RESULT_DIALOG = 500; - - private const int PANEL_ORDER_RESULT_DIALOG = 2; [SerializeField] private GachaResultBuyCardPack _prefabGachaResultBuyCardPack; @@ -44,7 +41,7 @@ public class GachaResultBuyCardPackDialog : MonoBehaviour Dialog.SetSize(DialogBase.Size.XL); Dialog.SetTitleLabel(Data.SystemText.Get("Shop_0010")); Dialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - Dialog.OpenSe = Se.TYPE.NONE; + Dialog.OpenSe = 0; Dialog.OnCloseStart = OnCloseStartResultDialog; Dialog.OnClose = OnCloseResultDialog; _objGachaResultBuyCardPack = UnityEngine.Object.Instantiate(_prefabGachaResultBuyCardPack); @@ -54,12 +51,6 @@ public class GachaResultBuyCardPackDialog : MonoBehaviour StartCoroutine(_objGachaResultBuyCardPack.ViewCardList(1)); } - public void AddOnCloseStart(Action onCloseStart) - { - DialogBase dialog = Dialog; - dialog.OnCloseStart = (Action)Delegate.Combine(dialog.OnCloseStart, onCloseStart); - } - public void AddOnClose(Action onClose) { DialogBase dialog = Dialog; diff --git a/SVSim.BattleEngine/Engine/Wizard/GachaSelectBuyNumPopup.cs b/SVSim.BattleEngine/Engine/Wizard/GachaSelectBuyNumPopup.cs index fb9657a2..f7deffc4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GachaSelectBuyNumPopup.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GachaSelectBuyNumPopup.cs @@ -6,7 +6,6 @@ namespace Wizard; public class GachaSelectBuyNumPopup : SelectBuyNumPopupBase { - private const int LEADER_SKIN_PACK_WIDTH = 818; protected override string _labelBuyNumPurchaseBtnTextId => "Shop_0046"; diff --git a/SVSim.BattleEngine/Engine/Wizard/Gathering.cs b/SVSim.BattleEngine/Engine/Wizard/Gathering.cs deleted file mode 100644 index 1e3ab382..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Gathering.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class Gathering : UIBase -{ - [SerializeField] - private GatheringEntry _entryRoot; - - [SerializeField] - private GatheringJoining _joiningRoot; - - public override void onFirstStart() - { - _entryRoot.InitializeUI(); - _joiningRoot.InitializeUI(); - _entryRoot.gameObject.SetActive(value: false); - _joiningRoot.gameObject.SetActive(value: false); - base.IsShowFooterMenu = true; - base.onFirstStart(); - Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification = false; - if (Data.MyPage.data != null) - { - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - } - GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: false); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - Initialize(task); - })); - } - - private UIManager.ChangeViewSceneParam CreateBackButtonParam() - { - return new UIManager.ChangeViewSceneParam - { - MyPageMenuIndex = 3, - OnFinishChangeView = delegate - { - MyPageMenu.Instance.GoToGatheringActionMenu(); - } - }; - } - - public static void BackToMyPageForDrop() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 3; - changeViewSceneParam.OnFinishChangeView = delegate - { - MyPageMenu.Instance.GoToGatheringActionMenu(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - private void Initialize(GatheringGetSelfInfoTask task) - { - GatheringInfo info = task.Info; - string titleMsg; - if (info.Role == GatheringRule.eRole.NONE) - { - _entryRoot.Initialize(task); - titleMsg = Data.SystemText.Get("Gathering_0002"); - } - else - { - _joiningRoot.Initialize(); - titleMsg = Data.SystemText.Get("Gathering_0034"); - } - _entryRoot.gameObject.SetActive(info.Role == GatheringRule.eRole.NONE); - _joiningRoot.gameObject.SetActive(info.Role != GatheringRule.eRole.NONE); - _joiningRoot.OnReceiveSelfInfo(info); - UIManager.GetInstance().CreateTopBar(base.gameObject, titleMsg, UIManager.ViewScene.MyPage, MoneyDraw: true, CreateBackButtonParam()).gameObject.layer = LayerMask.NameToLayer("MyPage"); - StartCoroutine(WaitForCommonBackGround(delegate - { - UIManager.GetInstance().OnReadyViewScene(isFadein: true); - })); - } - - private IEnumerator WaitForCommonBackGround(Action onComplete) - { - while (!CommonBackGround.Instance.IsFinishLod) - { - yield return null; - } - while (!CommonBackGround.Instance.IsFinishEffectLoading()) - { - yield return null; - } - onComplete?.Invoke(); - } - - public override bool IsUseCommonBackground() - { - return true; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringAutoJoinTaskInfo.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringAutoJoinTaskInfo.cs deleted file mode 100644 index f2331348..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringAutoJoinTaskInfo.cs +++ /dev/null @@ -1,50 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class GatheringAutoJoinTaskInfo -{ - public BaseRoomBattleEnterRoomTask BaseRoomBattleEnterRoomTask { get; set; } - - public string RoomId { get; private set; } - - public string DisplayRoomId { get; private set; } - - public bool IsOwner { get; private set; } - - public bool NeedsRetry { get; private set; } - - public GatheringInfo GatheringInfo { get; private set; } - - public bool IsEntryRoom { get; private set; } - - public GatheringAutoJoinTaskInfo(JsonData ResponseData, BaseRoomBattleEnterRoomTask baseRoomBattleEnterRoomTask, GatheringInfo gatheringInfo) - { - GatheringInfo = gatheringInfo; - BaseRoomBattleEnterRoomTask = baseRoomBattleEnterRoomTask; - if (!ResponseData.TryGetValue("data", out var value)) - { - return; - } - if (value.TryGetValue("result_reason", out var value2)) - { - NeedsRetry = value2.ToInt() == 12; - } - if (value.IsObject && value.TryGetValue("is_owner", out var value3)) - { - IsOwner = value3.ToInt() != 0; - if (value.TryGetValue("room_id", out var value4)) - { - RoomId = value4.ToString(); - } - if (value.TryGetValue("display_room_id", out var value5)) - { - DisplayRoomId = value5.ToString(); - } - if (value.TryGetValue("oppo_info", out var value6)) - { - IsEntryRoom = value6 != null; - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChat.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChat.cs deleted file mode 100644 index 3c43a197..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChat.cs +++ /dev/null @@ -1,298 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringChat : MonoBehaviour -{ - [SerializeField] - private GameObject _rootObj; - - [SerializeField] - private Chat _chatPrefab; - - private Chat _chat; - - [SerializeField] - private GatheringChatSettings _chatSettings; - - [SerializeField] - private GatheringChatDeckList _gatheringDeckListUI; - - [SerializeField] - private GatheringChatAutoJoinRoomMatch _autoJoinRoomMatchUI; - - [SerializeField] - private ChatSendDeckUI _sendDeckUI; - - [SerializeField] - private ChatSendReplayUI _sendReplayUI; - - [SerializeField] - private GatheringChatSendRoomMatchUI _sendRoomMatchUI; - - [SerializeField] - private ChatShareDeckUI _shareDeckUI; - - [SerializeField] - private GatheringChatInterruptOrLeave _interruptOrLeaveUI; - - [SerializeField] - private NotificatonAnimation _notificationAnimationPrefab; - - [SerializeField] - private GameObject _notificationParent; - - private DialogBase _confirmStateChangeDialog; - - public void OpenCategory() - { - ClearActionUI(); - List chatActionUIList = new List { _gatheringDeckListUI, _autoJoinRoomMatchUI, _sendDeckUI, _sendReplayUI, _sendRoomMatchUI, _shareDeckUI, _interruptOrLeaveUI }; - GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _chatSettings.SetGatheringInfo(task.Info, task.EntrySetting); - _chat = NGUITools.AddChild(_rootObj, _chatPrefab.gameObject).GetComponent(); - _chat.OnAddNewChatMessage = OnAddNewChatMessage; - _chat.OnMissionCleared = ShowMissionClearedNotifications; - _chat.gameObject.transform.localPosition = new Vector3(2000f, 0f, 0f); - _chat.Init(_chatSettings, chatActionUIList, task.ChatStampList, NetworkDefine.MAINTENANCE_TYPE.CHAT_GATHERING, delegate(ChatInfo chatInfo) - { - ChangeActionUI(_chatSettings.GatheringInfo, chatInfo); - _chat.gameObject.transform.localPosition = Vector3.zero; - bool b = _chatSettings.GatheringInfo.Rule.BattleParameterInstance.DeckFormat == Format.Avatar; - UIManager.SetObjectToGrey(_shareDeckUI.gameObject, b); - UIManager.SetObjectToGrey(_sendDeckUI.gameObject, b); - }); - })); - } - - public void ReadyCloseCategory() - { - _chat.ReadyClose(); - } - - public void CloseCategory() - { - _chat.ExecuteClose(); - } - - private void ChangeActionUI(GatheringInfo gatheringInfo, ChatInfo chatInfo) - { - ClearActionUI(); - bool canBattleJoin = gatheringInfo.CanBattleJoin; - switch (gatheringInfo.State) - { - case GatheringInfo.eState.BEFORE_BATTLE: - _gatheringDeckListUI.gameObject.SetActive(canBattleJoin); - break; - case GatheringInfo.eState.ACTIVE_BATTLE: - _gatheringDeckListUI.gameObject.SetActive(canBattleJoin); - if (!gatheringInfo.Rule.IsTournament) - { - _sendRoomMatchUI.gameObject.SetActive(canBattleJoin); - } - UpdateActiveAutoJoinRoomMatchUI(chatInfo); - break; - case GatheringInfo.eState.AFTER_BATTLE: - _sendDeckUI.gameObject.SetActive(value: true); - _sendReplayUI.gameObject.SetActive(value: true); - _shareDeckUI.gameObject.SetActive(value: true); - _interruptOrLeaveUI.gameObject.SetActive(value: true); - break; - } - } - - private void ClearActionUI() - { - _gatheringDeckListUI.gameObject.SetActive(value: false); - _autoJoinRoomMatchUI.gameObject.SetActive(value: false); - _sendRoomMatchUI.gameObject.SetActive(value: false); - _sendDeckUI.gameObject.SetActive(value: false); - _sendReplayUI.gameObject.SetActive(value: false); - _shareDeckUI.gameObject.SetActive(value: false); - _interruptOrLeaveUI.gameObject.SetActive(value: false); - } - - private void OnAddNewChatMessage(ChatInfo chatInfo) - { - UpdateActiveAutoJoinRoomMatchUI(chatInfo); - UpdateStateByChatMessage(chatInfo.MessageList); - } - - private void UpdateActiveAutoJoinRoomMatchUI(ChatInfo chatInfo) - { - if (_chatSettings.GatheringInfo.State != GatheringInfo.eState.ACTIVE_BATTLE) - { - _autoJoinRoomMatchUI.gameObject.SetActive(value: false); - return; - } - if (!_chatSettings.GatheringInfo.CanBattleJoin) - { - _autoJoinRoomMatchUI.gameObject.SetActive(value: false); - return; - } - _autoJoinRoomMatchUI.gameObject.SetActive(value: true); - if (_chatSettings.GatheringInfo.Rule.Type == GatheringRule.eType.TOURNAMENT) - { - _autoJoinRoomMatchUI.SetViewTournamentRoomMatch(chatInfo.GatheringMatchedRoom); - } - } - - private void UpdateStateByChatMessage(List chatMessageList) - { - GatheringInfo.eState state = _chatSettings.GatheringInfo.State; - GatheringInfo.eState eState = state; - if (state == GatheringInfo.eState.AFTER_BATTLE) - { - return; - } - using (List.Enumerator enumerator = chatMessageList.GetEnumerator()) - { - while (enumerator.MoveNext()) - { - switch (enumerator.Current.MessageType) - { - case ChatMessageInfo.eMessageType.GATHERING_BATTLE_END: - eState = GatheringInfo.eState.AFTER_BATTLE; - goto end_IL_003e; - case ChatMessageInfo.eMessageType.GATHERING_BATTLE_START: - eState = GatheringInfo.eState.ACTIVE_BATTLE; - break; - } - continue; - end_IL_003e: - break; - } - } - if (eState != state) - { - CreateConfirmStateChangeDialog(eState); - } - } - - private void ChangeViewSceneGoToGatheringActionMenu() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 3; - changeViewSceneParam.OnFinishChangeView = delegate - { - MyPageMenu.Instance.GoToGatheringActionMenu(); - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam); - } - - private void CreateConfirmStateChangeDialog(GatheringInfo.eState state) - { - if (state != GatheringInfo.eState.BEFORE_BATTLE) - { - if (_confirmStateChangeDialog != null) - { - _confirmStateChangeDialog.OnCloseStart = null; - _confirmStateChangeDialog.Close(); - } - _confirmStateChangeDialog = UIManager.GetInstance().CreateDialogClose(); - string text = string.Empty; - switch (state) - { - case GatheringInfo.eState.ACTIVE_BATTLE: - text = Data.SystemText.Get("Gathering_Chat_0009"); - break; - case GatheringInfo.eState.AFTER_BATTLE: - text = Data.SystemText.Get("Gathering_Chat_0010"); - break; - } - _confirmStateChangeDialog.SetText(text); - _confirmStateChangeDialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - _confirmStateChangeDialog.OnCloseStart = delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - ChangeViewSceneGoToGatheringActionMenu(); - UIManager.GetInstance().dialogAllClear(); - }; - _confirmStateChangeDialog.SetPanelDepth(4000); - } - } - - public static bool IsMaintenance(List maintenanceCodeList, GatheringRule rule) - { - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_ALL_MAINTENANCE) || maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_BATTLE_MAINTENANCE)) - { - return true; - } - switch (rule.BattleParameterInstance.DeckFormat) - { - case Format.Rotation: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_ROTATION)) - { - return true; - } - break; - case Format.Unlimited: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_UNLIMITED)) - { - return true; - } - break; - case Format.PreRotation: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_PRE_ROTATION)) - { - return true; - } - break; - } - switch (rule.BattleParameterInstance.Rule) - { - case RoomConnectController.BattleRule.Bo1: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_RULE_BO1)) - { - return true; - } - break; - case RoomConnectController.BattleRule.Bo3: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_RULE_BO3)) - { - return true; - } - break; - case RoomConnectController.BattleRule.Bo5: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_RULE_BO5)) - { - return true; - } - break; - case RoomConnectController.BattleRule.Bo3Ban: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_RULE_BO3_BAN1)) - { - return true; - } - break; - case RoomConnectController.BattleRule.Bo5Ban: - if (maintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_RULE_BO5_BAN1)) - { - return true; - } - break; - } - return false; - } - - public static void ResetLatestReadChatMessageId() - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.READ_LATEST_GATHERING_CHAT_MESSAGE_ID, -1); - } - - private void ShowMissionClearedNotifications(List messages) - { - List list = new List(); - for (int i = 0; i < messages.Count; i++) - { - list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.MissionCleared, messages[i])); - } - NotificatonAnimation component = NGUITools.AddChild(_notificationParent, _notificationAnimationPrefab.gameObject).GetComponent(); - StartCoroutine(component.Exec(list)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChatApiSettings.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChatApiSettings.cs deleted file mode 100644 index f275d7e5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChatApiSettings.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Wizard; - -public class GatheringChatApiSettings : IChatApiSettings -{ - public ApiType.Type ApiChatMessages => ApiType.Type.GatheringChatMessages; - - public ApiType.Type ApiChatPost => ApiType.Type.GatheringChatPost; - - public ApiType.Type ApiChatAddReplay => ApiType.Type.GatheringChatAddReplay; - - public ApiType.Type ApiChatReplayDetail => ApiType.Type.GatheringChatReplayDetail; - - public ApiType.Type ApiChatAddDeck => ApiType.Type.GatheringChatAddDeck; - - public ApiType.Type ApiChatDeleteDeck => ApiType.Type.GatheringChatDeleteDeck; - - public ApiType.Type ApiChatDeckLog => ApiType.Type.GatheringChatDeckLog; -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChatAutoJoinRoomMatch.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChatAutoJoinRoomMatch.cs deleted file mode 100644 index 59082409..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChatAutoJoinRoomMatch.cs +++ /dev/null @@ -1,188 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; -using Wizard.ErrorDialog; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringChatAutoJoinRoomMatch : MonoBehaviour, IChatActionUI -{ - [SerializeField] - private UIButton _buttonAutoJoinRoomMatch; - - [SerializeField] - private UILabel _labelAutoJoinRoomMatchBtn; - - private ChatConnectController _chatConnectController; - - private GatheringChatSettings _gatheringChatSettings; - - private Action _startCreateRoomAction; - - private GatheringMatchedRoom _tournamentMatchedRoom; - - private const float RETRY_INTERVAL = 1f; - - private const int RETRY_COUNT_MAX = 5; - - private int _tournamentApiRetryCount; - - public void SetViewTournamentRoomMatch(GatheringMatchedRoom matchedRoom) - { - _tournamentMatchedRoom = matchedRoom; - UIManager.SetObjectToGrey(_buttonAutoJoinRoomMatch.gameObject, !matchedRoom.IsMatched); - } - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatConnectController = chatConnectController; - _gatheringChatSettings = chatSettings as GatheringChatSettings; - if (_gatheringChatSettings.SendRoomMatchUI != null) - { - _startCreateRoomAction = _gatheringChatSettings.SendRoomMatchUI.StartCreateRoom; - } - if (_gatheringChatSettings.GatheringInfo.Rule.IsTournament) - { - _labelAutoJoinRoomMatchBtn.text = Data.SystemText.Get("Gathering_Chat_0022"); - } - else - { - _labelAutoJoinRoomMatchBtn.text = Data.SystemText.Get("Gathering_Chat_0002"); - } - _buttonAutoJoinRoomMatch.onClick.Clear(); - _buttonAutoJoinRoomMatch.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - EnterAutoJoinRoomMatch(); - })); - } - - public void EnterAutoJoinRoomMatch() - { - if (GatheringChat.IsMaintenance(Data.MaintenanceCodeList, _gatheringChatSettings.GatheringInfo.Rule)) - { - Wizard.ErrorDialog.Dialog.Create(2030); - return; - } - GatheringInfo gatheringInfo = _gatheringChatSettings.GatheringInfo; - if (gatheringInfo.Rule.Type == GatheringRule.eType.FREE_BATTLE) - { - UIManager.GetInstance().StartCoroutine(EnterVacancyRoom(gatheringInfo)); - } - else if (gatheringInfo.Rule.Type == GatheringRule.eType.TOURNAMENT) - { - if (_tournamentMatchedRoom == null || !_tournamentMatchedRoom.IsMatched) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - Wizard.ErrorDialog.Dialog.Setup(dialogBase, 5315.ToString()); - dialogBase.SetPanelDepth(5400); - dialogBase.onPushButton1 = delegate - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); - }; - } - else - { - EnterTournamentRoom(gatheringInfo); - } - } - else - { - Debug.LogError("ユーザー大会タイプが不正です。:" + gatheringInfo.Rule.Type); - } - } - - private IEnumerator EnterVacancyRoom(GatheringInfo gatheringInfo) - { - bool isRoomReady = false; - int retryCount = 0; - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - _chatConnectController.PausePolling(); - GatheringAutoJoinTaskInfo gatheringAutoJoinTaskInfo = null; - string battleId = ""; - while (!isRoomReady) - { - GatheringRoomEnterVacancyRoomTask enterVacancyRoomTask = new GatheringRoomEnterVacancyRoomTask(gatheringInfo); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(enterVacancyRoomTask)); - gatheringAutoJoinTaskInfo = enterVacancyRoomTask.GatheringAutoJoinTaskInfo; - if (!enterVacancyRoomTask.IsResultSuccess) - { - _chatConnectController.ResetPolling(); - UIManager.GetInstance().closeInSceneCenterLoading(); - yield break; - } - battleId = enterVacancyRoomTask.BattleID; - if (gatheringAutoJoinTaskInfo.NeedsRetry) - { - int num = retryCount + 1; - retryCount = num; - if (num > 5) - { - _chatConnectController.ResetPolling(); - UIManager.GetInstance().closeInSceneCenterLoading(); - _startCreateRoomAction.Call(); - yield break; - } - yield return new WaitForSeconds(1f); - } - else - { - isRoomReady = true; - } - } - RoomConnectController.InitializeParameter initializeParameter = new RoomConnectController.InitializeParameter((!gatheringAutoJoinTaskInfo.IsOwner) ? RoomConnectController.PositionMode.VISITOR : RoomConnectController.PositionMode.OWNER, roomId: gatheringAutoJoinTaskInfo.IsOwner ? "" : gatheringAutoJoinTaskInfo.RoomId, battleParameter: gatheringInfo.Rule.BattleParameterInstance); - initializeParameter.IsGathering = true; - initializeParameter.GatheringAutoJoinTaskInfo = gatheringAutoJoinTaskInfo; - UIManager.GetInstance().StartCoroutine(GatheringUtility.JoinRoom(initializeParameter, battleId)); - } - - private void EnterTournamentRoom(GatheringInfo gatheringInfo) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - _chatConnectController.PausePolling(); - _tournamentApiRetryCount = 0; - GatheringRoomEnterTournamentRoom(gatheringInfo); - } - - private void GatheringRoomEnterTournamentRoom(GatheringInfo gatheringInfo) - { - GatheringRoomEnterTournamentRoomTask tournamentTask = new GatheringRoomEnterTournamentRoomTask(gatheringInfo); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(tournamentTask, delegate - { - UIManager.GetInstance().StartCoroutine(EnterTournamentSuccess(tournamentTask, gatheringInfo)); - }, null, delegate - { - _chatConnectController.ResetPolling(); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private IEnumerator EnterTournamentSuccess(GatheringRoomEnterTournamentRoomTask tournamentTask, GatheringInfo gatheringInfo) - { - GatheringAutoJoinTaskInfo gatheringAutoJoinTaskInfo = tournamentTask.GatheringAutoJoinTaskInfo; - if (gatheringAutoJoinTaskInfo.NeedsRetry) - { - _tournamentApiRetryCount++; - if (_tournamentApiRetryCount > 5) - { - _chatConnectController.ResetPolling(); - UIManager.GetInstance().closeInSceneCenterLoading(); - Wizard.ErrorDialog.Dialog.Create("TIMEOUT_NORETRY"); - } - else - { - yield return new WaitForSeconds(1f); - GatheringRoomEnterTournamentRoom(gatheringInfo); - } - } - else - { - RoomConnectController.InitializeParameter initializeParameter = new RoomConnectController.InitializeParameter((!gatheringAutoJoinTaskInfo.IsOwner) ? RoomConnectController.PositionMode.VISITOR : RoomConnectController.PositionMode.OWNER, roomId: gatheringAutoJoinTaskInfo.IsOwner ? "" : gatheringAutoJoinTaskInfo.RoomId, battleParameter: gatheringInfo.Rule.BattleParameterInstance); - initializeParameter.IsGathering = true; - initializeParameter.GatheringAutoJoinTaskInfo = gatheringAutoJoinTaskInfo; - UIManager.GetInstance().StartCoroutine(GatheringUtility.JoinRoom(initializeParameter, tournamentTask.BattleID)); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChatDeckList.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChatDeckList.cs deleted file mode 100644 index f517a3eb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChatDeckList.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringChatDeckList : MonoBehaviour, IChatActionUI -{ - private const int DECK_DETAIL_DIALOG_DEPTH = 100; - - [SerializeField] - private UIButton _buttonGatheringDeckList; - - [SerializeField] - private UILabel _labelGatheringDeckListButton; - - [SerializeField] - private DeckDetailDialog _deckDetailDialogPrefab; - - private DeckDetailDialog _deckDetailDialog; - - private GatheringInfo _gatheringInfo; - - private DialogBase _dialogDeckList; - - private ChatConnectController _chatConnectController; - - private ChatLogUI _chatLogUI; - - private readonly List _loadedVoiceList = new List(); - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatConnectController = chatConnectController; - _chatLogUI = chatLogUI; - GatheringChatSettings gatheringChatSettings = chatSettings as GatheringChatSettings; - _gatheringInfo = gatheringChatSettings.GatheringInfo; - _labelGatheringDeckListButton.text = GetTextDeckListTitle(_gatheringInfo); - _buttonGatheringDeckList.onClick.Clear(); - _buttonGatheringDeckList.onClick.Add(new EventDelegate(delegate - { - OnClickGatheringDeckList(); - })); - } - - private string GetTextDeckListTitle(GatheringInfo gatheringInfo) - { - if (gatheringInfo.Rule.IsEntryDeckOnly) - { - return Data.SystemText.Get("Gathering_Chat_0001"); - } - return Data.SystemText.Get("Gathering_Chat_0021"); - } - - private void OnClickGatheringDeckList() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - GatheringConfirmDeckListTask task = new GatheringConfirmDeckListTask(); - _chatConnectController.StartConnectCommon(task, delegate - { - CreateDeckList(task.DeckGroupListData, task.DeckFormat); - }); - } - - private void CreateDeckList(DeckGroupListData deckGroupListData, Format deckFormat, bool isFadeBackView = true, bool isOpenSE = true) - { - DeckSelectUIDialog deckSelectUIDialog = DeckSelectUIDialog.Create(GetTextDeckListTitle(_gatheringInfo), deckGroupListData, deckFormat, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: false, delegate(DialogBase dialog, DeckData deck) - { - CreateDeckDetailDialog(deck); - }); - _dialogDeckList = deckSelectUIDialog.Dialog; - _dialogDeckList.IsEnableOpenSe = isOpenSE; - if (!isFadeBackView) - { - _dialogDeckList.ResetBackViewAlpha(); - } - _dialogDeckList.SetLayer("Loading"); - } - - private void CreateDeckDetailDialog(DeckData deck) - { - _deckDetailDialog = UnityEngine.Object.Instantiate(_deckDetailDialogPrefab); - _deckDetailDialog.gameObject.SetActive(value: true); - _deckDetailDialog.InitializeForGathering(deck, _gatheringInfo.Rule.IsEntryDeckOnly, delegate - { - GatheringConfirmDeckListTask task = new GatheringConfirmDeckListTask(); - _chatConnectController.StartConnectCommon(task, delegate - { - _dialogDeckList.Close(); - CreateDeckList(task.DeckGroupListData, task.DeckFormat, isFadeBackView: false, isOpenSE: false); - }); - }, _loadedVoiceList); - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - dialog.SetSize(DialogBase.Size.M); - dialog.SetPanelDepth(100); - dialog.SetTitleLabel(""); - dialog.SetObj(_deckDetailDialog.gameObject); - DialogBase dialogBase = dialog; - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - _deckDetailDialog.Final(); - }); - Action OnOpenDeckView = delegate - { - if (_dialogDeckList != null) - { - _dialogDeckList.SetActive(inActive: false); - } - dialog.Close(); - }; - Action OnCloseDeckView = delegate - { - if (_dialogDeckList != null) - { - _dialogDeckList.SetActive(inActive: true); - } - }; - Action onPushButton = delegate - { - _chatLogUI.ShowDeckViewByDeckData(deck, OnOpenDeckView, OnCloseDeckView, isActiveRedButton: false, isActiveDeckIntroductionObj: false); - }; - dialog.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialog.SetButtonText(Data.SystemText.Get("Card_0083")); - dialog.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE; - dialog.onPushButton1 = onPushButton; - dialog.isNotCloseWindowButton1 = true; - } - - private void OnDestroy() - { - if (_loadedVoiceList.Count > 0) - { - GameMgr.GetIns().GetSoundMgr().StopVoiceAll(0f); - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedVoiceList); - _loadedVoiceList.Clear(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChatInterruptOrLeave.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChatInterruptOrLeave.cs deleted file mode 100644 index a77672ec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChatInterruptOrLeave.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using UnityEngine; - -namespace Wizard; - -public class GatheringChatInterruptOrLeave : MonoBehaviour, IChatActionUI -{ - [SerializeField] - private UIButton _button; - - [SerializeField] - private UILabel _label; - - private bool _isOwner; - - private ChatConnectController _chatConnectController; - - private const string BUTTON_SPRITE_NAME_DEFAULT_OFF = "btn_common_01_s_off"; - - private const string BUTTON_SPRITE_NAME_DEFAULT_ON = "btn_common_01_s_on"; - - private const string BUTTON_SPRITE_NAME_RED_OFF = "btn_common_04_s_off"; - - private const string BUTTON_SPRITE_NAME_RED_ON = "btn_common_04_s_on"; - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectController, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatConnectController = chatConnectController; - GatheringChatSettings gatheringChatSettings = chatSettings as GatheringChatSettings; - _isOwner = gatheringChatSettings.GatheringInfo.Role == GatheringRule.eRole.OWNER; - _button.onClick.Clear(); - if (_isOwner) - { - _label.text = Data.SystemText.Get("Gathering_Chat_0011"); - _button.onClick.Add(new EventDelegate(OnClickInterrupt)); - _button.normalSprite = "btn_common_04_s_off"; - _button.pressedSprite = "btn_common_04_s_on"; - } - else - { - _label.text = Data.SystemText.Get("Gathering_Chat_0015"); - _button.onClick.Add(new EventDelegate(OnClickLeave)); - _button.normalSprite = "btn_common_01_s_off"; - _button.pressedSprite = "btn_common_01_s_on"; - } - } - - private void OnClickInterrupt() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - PauseChatPolling(); - SystemText text = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(text.Get("Gathering_Chat_0012")); - dialogBase.SetText(text.Get("Gathering_Chat_0013")); - dialogBase.SetButtonText(text.Get("Gathering_Chat_0014"), text.Get("Common_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.onPushButton1 = delegate - { - GatheringInterruptTask task = new GatheringInterruptTask(); - _chatConnectController.StartConnectCommon(task, delegate - { - StopChatPolling(); - ChangeViewWithDialog(text.Get("Gathering_Chat_0019")); - }); - }; - dialogBase.onPushButton2 = ResumeChatPolling; - dialogBase.onCloseWithoutSelect = ResumeChatPolling; - } - - private void OnClickLeave() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - PauseChatPolling(); - SystemText text = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(text.Get("Gathering_Chat_0016")); - dialogBase.SetText(text.Get("Gathering_Chat_0017")); - dialogBase.SetButtonText(text.Get("Gathering_Chat_0018"), text.Get("Common_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.onPushButton1 = delegate - { - GatheringLeaveTask task = new GatheringLeaveTask(); - _chatConnectController.StartConnectCommon(task, delegate - { - StopChatPolling(); - ChangeViewWithDialog(text.Get("Gathering_Chat_0020")); - }); - }; - dialogBase.onPushButton2 = ResumeChatPolling; - dialogBase.onCloseWithoutSelect = ResumeChatPolling; - } - - private void ChangeViewWithDialog(string text) - { - UIManager.GetInstance().CreateConfirmationDialog(text).OnCloseStart = Gathering.BackToMyPageForDrop; - } - - private void PauseChatPolling() - { - _chatConnectController.PausePolling(); - } - - private void ResumeChatPolling() - { - _chatConnectController.ResumePolling(); - } - - private void StopChatPolling() - { - _chatConnectController.StopPolling(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChatSendRoomMatchUI.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChatSendRoomMatchUI.cs deleted file mode 100644 index d19b5edd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChatSendRoomMatchUI.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; -using Wizard.ErrorDialog; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringChatSendRoomMatchUI : MonoBehaviour, IChatActionUI -{ - [SerializeField] - private UIButton _buttonRoomMatch; - - private ChatConnectController _chatConnectCtr; - - public void Init(IChatSettings chatSettings, ChatConnectController chatConnectCtr, ChatLogUI chatLogUI, Action actionAddNewChatLogAfterSendChat) - { - _chatConnectCtr = chatConnectCtr; - _buttonRoomMatch.onClick.Clear(); - _buttonRoomMatch.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - GatheringInfo gatheringInfo = (chatSettings as GatheringChatSettings).GatheringInfo; - if (GatheringChat.IsMaintenance(Data.MaintenanceCodeList, gatheringInfo.Rule)) - { - Wizard.ErrorDialog.Dialog.Create(2030); - } - else - { - RoomConnectController.InitializeParameter param = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.OWNER, gatheringInfo.Rule.BattleParameterInstance, "") - { - IsGathering = true - }; - UIManager.GetInstance().StartCoroutine(CreateRoom(param)); - } - })); - } - - private IEnumerator CreateRoom(RoomConnectController.InitializeParameter param) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - RoomConnectController room = new RoomConnectController(param); - yield return UIManager.GetInstance().StartCoroutine(room.StartConnect()); - if (room.ConnectRoomResultType == RoomConnectController.ConnectRoomResult.SUCCESS) - { - _chatConnectCtr.StopPolling(); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle; - UIManager.GetInstance()._Footer.InviteIconDisp(inDisp: false); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Room); - } - UIManager.GetInstance().closeInSceneCenterLoading(); - } - - public void StartCreateRoom() - { - UIButton.current = _buttonRoomMatch; - EventDelegate.Execute(_buttonRoomMatch.onClick); - UIButton.current = null; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringChatSettings.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringChatSettings.cs deleted file mode 100644 index 803a7420..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringChatSettings.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringChatSettings : MonoBehaviour, IChatSettings -{ - [SerializeField] - private ChatLogPlate _prefabChatLogPlate; - - [SerializeField] - private GatheringChatSendRoomMatchUI _sendRoomMatchUI; - - [SerializeField] - private GatheringChatAutoJoinRoomMatch _autoJoinRoomMatchUI; - - public GatheringChatSendRoomMatchUI SendRoomMatchUI => _sendRoomMatchUI; - - public GatheringChatAutoJoinRoomMatch AutoJoinRoomMatchUI => _autoJoinRoomMatchUI; - - public KeyValuePair PlayerPrefsKeyLatestReadChatMessageId => PlayerPrefsWrapper.READ_LATEST_GATHERING_CHAT_MESSAGE_ID; - - public IChatApiSettings ApiSettings { get; } = new GatheringChatApiSettings(); - - public ChatLogPlate PrefabChatLogPlate => _prefabChatLogPlate; - - public UIManager.ViewScene ReplayBackScene => UIManager.ViewScene.Gathering; - - public UIManager.ChangeViewSceneParam ReplayBackSceneParam => new UIManager.ChangeViewSceneParam - { - IsUpdateFooterMenuTexture = true - }; - - public GatheringInfo GatheringInfo { get; private set; } - - public GatheringEntrySetting EntrySetting { get; private set; } - - public Action OnSetChatLogRoomInfoViewJoinButton => delegate(GameObject joinVisitorBtn) - { - bool active = true; - if (GatheringInfo.Role == GatheringRule.eRole.OWNER && !GatheringInfo.Rule.IsOwnerEntryBattle) - { - active = false; - } - joinVisitorBtn.gameObject.SetActive(active); - }; - - public Action OnClickBtnJoinRoomVisitor => delegate(string roomId) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - RoomConnectController.InitializeParameter param = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.VISITOR, GatheringInfo.Rule.BattleParameterInstance, roomId) - { - IsGathering = true - }; - UIManager.GetInstance().StartCoroutine(GatheringUtility.JoinRoom(param, "")); - }; - - public Action OnClickBtnJoinRoomWatcher => delegate(string roomId) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - RoomConnectController.InitializeParameter param = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.WATCHER, GatheringInfo.Rule.BattleParameterInstance, roomId) - { - IsGathering = true - }; - UIManager.GetInstance().StartCoroutine(GatheringUtility.JoinRoom(param, "")); - }; - - public void SetGatheringInfo(GatheringInfo info, GatheringEntrySetting entrySetting) - { - GatheringInfo = info; - EntrySetting = entrySetting; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringConfirmDeckListTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringConfirmDeckListTask.cs deleted file mode 100644 index 9d9b73f9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringConfirmDeckListTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringConfirmDeckListTask : BaseTask -{ - public Format DeckFormat { get; private set; } - - public List DeckGroupList { get; private set; } - - public DeckGroupListData DeckGroupListData { get; private set; } - - public GatheringConfirmDeckListTask() - { - base.type = ApiType.Type.GatheringConfirmDeckList; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(jsonData["maintenance_card_list"]); - DeckFormat = Data.ParseApiFormat(jsonData["deck_format"].ToInt()); - DeckGroupList = new List(); - DeckGroupList.Add(DeckListUtility.CreateDeckGroup(jsonData["deck_list"], DeckFormat, DeckAttributeType.CustomDeck)); - DeckGroupListData = new DeckGroupListData(DeckGroupList); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringCreateDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringCreateDialog.cs deleted file mode 100644 index 9ee7b51c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringCreateDialog.cs +++ /dev/null @@ -1,498 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringCreateDialog : MonoBehaviour -{ - [SerializeField] - private UIButton _typeChangeButton; - - [SerializeField] - private UILabel _typeLabel; - - [SerializeField] - private UIButton _battleStyleChangeButton; - - [SerializeField] - private UILabel _battleStyleLabel; - - [SerializeField] - private UIButton _maxMemberChangeButton; - - [SerializeField] - private UILabel _maxMemberLabel; - - [SerializeField] - private UIButton _formatChangeButton; - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UIButton _watchChangeButton; - - [SerializeField] - private UILabel _watchLabel; - - [SerializeField] - private UIButton _battleHourChangeButton; - - [SerializeField] - private UILabel _battleHourLabel; - - [SerializeField] - private UIButton _battleStartTimeChangeButton; - - [SerializeField] - private UILabel _battleStartTimeLabel; - - [SerializeField] - private UIToggle _isEntryDeckOnlyToggle; - - [SerializeField] - private GameObject _isEntryDeckOnlyObjectRoot; - - [SerializeField] - private GameObject _timeLimitObjectRoot; - - [SerializeField] - private UIGrid _ruleCategoryGrid; - - [SerializeField] - private GameObject _startTimeSelectPrefab; - - [SerializeField] - private UIToggle _ownerEntryBattleToggle; - - public Action OnDecideRule; - - private DialogBase _dialog; - - private GatheringRule _rule = new GatheringRule(); - - private bool _ownerEntryBattleToggleFirstCall = true; - - private bool _isEntryDeckOnlyToggleFirstCall = true; - - private List _formatList = new List(); - - private Format[] ALL_FORMAT = new Format[2] - { - Format.Rotation, - Format.Unlimited - }; - - private int[] BATTLE_HOUR_SETTING = new int[8] { 1, 2, 3, 4, 8, 12, 24, 48 }; - - private int[] BATTLE_START_MINUTE_SETTING = new int[8] { 5, 15, 30, 60, 120, 240, 480, 1440 }; - - private int[] MAX_MEMBER_SETTING = new int[7] { 2, 4, 8, 16, 32, 64, 128 }; - - private static List GetRuleListNormal(Format format) - { - List list = new List(); - list.Add(RoomConnectController.BattleRule.Bo1); - if (format != Format.Avatar) - { - list.Add(RoomConnectController.BattleRule.Bo3); - list.Add(RoomConnectController.BattleRule.Bo5); - list.Add(RoomConnectController.BattleRule.Bo3Ban); - list.Add(RoomConnectController.BattleRule.Bo5Ban); - } - return list; - } - - public static GatheringCreateDialog Create(GameObject prefab) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - GatheringCreateDialog component = UnityEngine.Object.Instantiate(prefab).GetComponent(); - component._dialog = dialogBase; - SystemText systemText = Data.SystemText; - dialogBase.SetObj(component.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Gathering_0020")); - dialogBase.SetTitleLabel(systemText.Get("Gathering_0006")); - component._rule.LoadFromPlayerPrefs(); - component._rule.BattleStartLocalTime = DefaultStartTime(); - component.Refresh(); - return component; - } - - private static DateTime DefaultStartTime() - { - DateTime nowTime = PlayerStaticData.UserTime.GetNowTime(); - int num = 15; - int minute = nowTime.Minute; - int num2 = minute / num * num; - nowTime = nowTime.AddMinutes(num2 - minute); - TimeSpan timeSpan = nowTime - PlayerStaticData.UserTime.GetNowTime(); - while (timeSpan.TotalMinutes < 16.0) - { - nowTime = nowTime.AddMinutes(15.0); - timeSpan = nowTime - PlayerStaticData.UserTime.GetNowTime(); - } - return nowTime; - } - - private void Start() - { - _typeChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickGatheringTypeChangeButton(); - })); - _maxMemberChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickMaxMemberChangeButton(); - })); - _battleStyleChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickBattleStyleChangeButton(); - })); - _formatChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickFormatChangeButton(); - })); - _ownerEntryBattleToggle.onChange.Add(new EventDelegate(delegate - { - OnClickOwnerEntryBattle(); - })); - _watchChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickWatchChangeButton(); - })); - _battleHourChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickBattleHourChangeButton(); - })); - _battleStartTimeChangeButton.onClick.Add(new EventDelegate(delegate - { - OnClickBattleStartHourChangeButton(); - })); - _isEntryDeckOnlyToggle.onChange.Add(new EventDelegate(delegate - { - OnClickIsEntryDeckOnlyButton(); - })); - _dialog.onPushButton1 = delegate - { - CreateGathering(); - }; - } - - private void OnClickGatheringTypeChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - List allGatheringRule = GatheringUtility.GetAllGatheringRule(); - GatheringUtility.RuleTypeInfo item = allGatheringRule.FirstOrDefault((GatheringUtility.RuleTypeInfo x) => x.Type == _rule.Type && x.TournamentType == _rule.TournamentType && x.IsReset == _rule.IsReset); - List textList = new List(); - allGatheringRule.ForEach(delegate(GatheringUtility.RuleTypeInfo rule) - { - textList.Add(rule.Name); - }); - DialogBase drumDialog = DrumrollDialog.Create(textList, allGatheringRule.IndexOf(item), null, null, OnDecideGatheringType, Data.SystemText.Get("Gathering_0036")); - OnDrumUICommonSetting(drumDialog); - } - - private void OnDecideGatheringType(int index) - { - GatheringUtility.RuleTypeInfo ruleTypeInfo = GatheringUtility.GetAllGatheringRule()[index]; - _rule.Type = ruleTypeInfo.Type; - _rule.TournamentType = ruleTypeInfo.TournamentType; - _rule.IsReset = ruleTypeInfo.IsReset; - _rule.SaveToPlayerPrefs(); - if (ruleTypeInfo.MaxMember < _rule.MaxMember) - { - int num = MAX_MEMBER_SETTING.ToList().IndexOf(ruleTypeInfo.MaxMember); - if (num == -1) - { - Debug.LogError("選択肢に含まれていない最大人数です"); - OnSelectMember(0); - } - else - { - OnSelectMember(num); - } - } - } - - private void OnClickBattleStyleChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - int defaultIndex = 0; - List list = new List(); - List ruleListNormal = GetRuleListNormal(_rule.BattleParameterInstance.DeckFormat); - for (int i = 0; i < ruleListNormal.Count; i++) - { - if (_rule.BattleParameterInstance.Rule == ruleListNormal[i]) - { - defaultIndex = i; - } - list.Add(RoomRuleSetting.GetWinTypeString(ruleListNormal[i])); - } - DialogBase drumDialog = DrumrollDialog.Create(list, defaultIndex, null, null, OnDecideBattleStyle, Data.SystemText.Get("Gathering_0037")); - OnDrumUICommonSetting(drumDialog); - } - - private void OnDecideBattleStyle(int index) - { - _rule.BattleParameterInstance.Rule = GetRuleListNormal(_rule.BattleParameterInstance.DeckFormat)[index]; - _rule.SaveToPlayerPrefs(); - } - - private void OnClickFormatChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - int defaultIndex = 0; - List list = new List(); - List maintenanceFormatList = new List(); - DialogBase dialog = null; - _formatList.Clear(); - for (int i = 0; i < ALL_FORMAT.Length; i++) - { - if (_rule.BattleParameterInstance.DeckFormat == ALL_FORMAT[i]) - { - defaultIndex = i; - } - list.Add(FormatBehaviorManager.GetFormatName(ALL_FORMAT[i])); - _formatList.Add(ALL_FORMAT[i]); - } - if (Prerelease.Status == Prerelease.eStatus.PRE_ROTATION) - { - if (_rule.BattleParameterInstance.DeckFormat == Format.PreRotation) - { - defaultIndex = _formatList.Count; - } - _formatList.Add(Format.PreRotation); - list.Add(FormatBehaviorManager.GetFormatName(Format.PreRotation)); - } - if (Data.Crossover.IsWithinGatheringPeriod) - { - if (_rule.BattleParameterInstance.DeckFormat == Format.Crossover) - { - defaultIndex = _formatList.Count; - } - _formatList.Add(Format.Crossover); - string text = FormatBehaviorManager.GetFormatName(Format.Crossover); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_CROSSOVER)) - { - maintenanceFormatList.Add(Format.Crossover); - text += Data.SystemText.Get("RoomBattle_0099"); - } - list.Add(text); - } - if (Data.MyRotationAllInfo.IsWithinGatheringPeriod) - { - if (_rule.BattleParameterInstance.DeckFormat == Format.MyRotation) - { - defaultIndex = _formatList.Count; - } - _formatList.Add(Format.MyRotation); - string text2 = FormatBehaviorManager.GetFormatName(Format.MyRotation); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_MYROTATION)) - { - maintenanceFormatList.Add(Format.MyRotation); - text2 += Data.SystemText.Get("RoomBattle_0099"); - } - list.Add(text2); - } - if (Data.AvatarBattleAllInfo.IsWithinGatheringPeriod) - { - if (_rule.BattleParameterInstance.DeckFormat == Format.Avatar) - { - defaultIndex = _formatList.Count; - } - _formatList.Add(Format.Avatar); - string text3 = FormatBehaviorManager.GetFormatName(Format.Avatar); - if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_AVATAR)) - { - maintenanceFormatList.Add(Format.Avatar); - text3 += Data.SystemText.Get("RoomBattle_0099"); - } - list.Add(text3); - } - Action selectCallback = delegate(int index) - { - UIManager.SetObjectToGrey(dialog.button1.gameObject, maintenanceFormatList.Contains(_formatList[index])); - if (_formatList[index] == Format.Avatar) - { - _rule.BattleParameterInstance.Rule = RoomConnectController.BattleRule.Bo1; - } - }; - dialog = DrumrollDialog.Create(list, defaultIndex, selectCallback, null, OnDecideFormat, Data.SystemText.Get("Gathering_0038")); - OnDrumUICommonSetting(dialog); - } - - private void OnDecideFormat(int index) - { - _rule.BattleParameterInstance.DeckFormat = _formatList[index]; - _rule.SaveToPlayerPrefs(); - } - - private void OnClickMaxMemberChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - int defaultIndex = 0; - List list = new List(); - for (int i = 0; i < MAX_MEMBER_SETTING.Length; i++) - { - if (_rule.MaxMember == MAX_MEMBER_SETTING[i]) - { - defaultIndex = i; - } - if (GatheringUtility.GetMaxMemberNumber(_rule.Type) < MAX_MEMBER_SETTING[i]) - { - break; - } - list.Add(Data.SystemText.Get("Gathering_0008", MAX_MEMBER_SETTING[i].ToString())); - } - DialogBase drumDialog = DrumrollDialog.Create(list, defaultIndex, null, null, OnSelectMember, Data.SystemText.Get("Gathering_0039")); - OnDrumUICommonSetting(drumDialog); - } - - private void OnSelectMember(int index) - { - _rule.MaxMember = MAX_MEMBER_SETTING[index]; - _rule.SaveToPlayerPrefs(); - } - - private void OnDrumUICommonSetting(DialogBase drumDialog) - { - _dialog.SetDisp(inDisp: false); - drumDialog.ResetBackViewAlpha(); - drumDialog.OnCloseStart = delegate - { - drumDialog.InactiveBackView(); - _dialog.ReOpen(isResetBackViewAlpha: true); - Refresh(); - }; - } - - private void OnClickOwnerEntryBattle() - { - _rule.IsOwnerEntryBattle = _ownerEntryBattleToggle.value; - if (!_ownerEntryBattleToggleFirstCall) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_ownerEntryBattleToggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - _rule.SaveToPlayerPrefs(); - } - _ownerEntryBattleToggleFirstCall = false; - } - - private void OnClickIsEntryDeckOnlyButton() - { - _rule.IsEntryDeckOnly = _isEntryDeckOnlyToggle.value; - if (!_isEntryDeckOnlyToggleFirstCall) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_isEntryDeckOnlyToggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - _rule.SaveToPlayerPrefs(); - } - _isEntryDeckOnlyToggleFirstCall = false; - } - - private void OnClickWatchChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - int defaultIndex = (int)(_rule.WatchSetting - 1); - List list = new List(); - SystemText systemText = Data.SystemText; - list.Add(systemText.Get("Gathering_0015")); - list.Add(systemText.Get("Gathering_0016")); - list.Add(systemText.Get("Gathering_0017")); - DialogBase drumDialog = DrumrollDialog.Create(list, defaultIndex, null, null, OnDecideWatchSetting, Data.SystemText.Get("Gathering_0042")); - OnDrumUICommonSetting(drumDialog); - } - - private void OnDecideWatchSetting(int index) - { - _rule.WatchSetting = (GatheringRule.eWatchSetting)(index + 1); - _rule.SaveToPlayerPrefs(); - } - - private void OnClickBattleHourChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - List list = new List(); - int defaultIndex = 0; - int num = 0; - int[] bATTLE_HOUR_SETTING = BATTLE_HOUR_SETTING; - for (int i = 0; i < bATTLE_HOUR_SETTING.Length; i++) - { - int num2 = bATTLE_HOUR_SETTING[i]; - list.Add(Data.SystemText.Get("Gathering_0013", num2.ToString())); - if (num2 == _rule.BattleTimeHour) - { - defaultIndex = num; - } - num++; - } - DialogBase drumDialog = DrumrollDialog.Create(list, defaultIndex, null, null, OnDecideBattleHour, Data.SystemText.Get("Gathering_0041")); - OnDrumUICommonSetting(drumDialog); - } - - private void OnDecideBattleHour(int index) - { - _rule.BattleTimeHour = BATTLE_HOUR_SETTING[index]; - _rule.SaveToPlayerPrefs(); - } - - private void OnClickBattleStartHourChangeButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase drumDialog = GatheringStartTimeSelectDialog.Create(_startTimeSelectPrefab, OnChangeBattleStartTime, _rule.BattleStartLocalTime); - OnDrumUICommonSetting(drumDialog); - } - - private void OnChangeBattleStartTime(DateTime time) - { - _rule.BattleStartLocalTime = time; - Refresh(); - } - - private void Refresh() - { - SystemText systemText = Data.SystemText; - _typeLabel.text = _rule.GetGatheringTypeString(); - _maxMemberLabel.text = systemText.Get("Gathering_0008", _rule.MaxMember.ToString()); - _battleStyleLabel.text = RoomRuleSetting.GetWinTypeString(_rule.BattleParameterInstance.Rule); - _formatLabel.text = FormatBehaviorManager.GetFormatName(_rule.BattleParameterInstance.DeckFormat); - _ownerEntryBattleToggle.value = _rule.IsOwnerEntryBattle; - _battleHourLabel.text = systemText.Get("Gathering_0013", _rule.BattleTimeHour.ToString()); - _isEntryDeckOnlyToggle.value = _rule.IsEntryDeckOnly; - _battleStartTimeLabel.text = ConvertTime.ToLocal(_rule.BattleStartUtcTime); - _isEntryDeckOnlyObjectRoot.SetActive(!_rule.IsTournament); - _timeLimitObjectRoot.SetActive(!_rule.IsTournament); - UIManager.SetObjectToGrey(_battleStyleChangeButton.gameObject, IsOnlyOneWinType()); - _ruleCategoryGrid.Reposition(); - switch (_rule.WatchSetting) - { - case GatheringRule.eWatchSetting.ALL_MEMBER: - _watchLabel.text = systemText.Get("Gathering_0016"); - break; - case GatheringRule.eWatchSetting.NONE: - _watchLabel.text = systemText.Get("Gathering_0017"); - break; - case GatheringRule.eWatchSetting.OWNER_ONLY: - _watchLabel.text = systemText.Get("Gathering_0015"); - break; - } - } - - private void CreateGathering() - { - if (_rule.IsTournament) - { - _rule.IsEntryDeckOnly = true; - } - OnDecideRule.Call(_rule); - } - - private bool IsOnlyOneWinType() - { - return GetRuleListNormal(_rule.BattleParameterInstance.DeckFormat).Count == 1; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringCreateTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringCreateTask.cs deleted file mode 100644 index 832b609e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringCreateTask.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class GatheringCreateTask : BaseTask -{ - public class DeckEntry - { - public int deck_no; - - public string deck_name; - - public DeckEntry(DeckData deck) - { - deck_no = deck.GetDeckID(); - deck_name = deck.GetDeckName(); - } - } - - public class GatheringCreateTaskParam : BaseParam - { - public int join_member_limit; - - public int is_master_joined; - - public int deck_format; - - public int battle_type; - - public int watch_type; - - public long battle_begin_timestamp; - - public int battle_hours; - - public int gathering_type; - - public int is_deck_entry; - - public int tournament_format; - - public Dictionary deck_list = new Dictionary(); - } - - public GatheringCreateTask() - { - base.type = ApiType.Type.GatheringCreate; - } - - public void SetParameter(GatheringRule rule, List deckList) - { - GatheringCreateTaskParam gatheringCreateTaskParam = new GatheringCreateTaskParam(); - gatheringCreateTaskParam.deck_format = Data.FormatConvertApi(rule.BattleParameterInstance.DeckFormat); - gatheringCreateTaskParam.join_member_limit = rule.MaxMember; - gatheringCreateTaskParam.is_master_joined = (rule.IsOwnerEntryBattle ? 1 : 0); - gatheringCreateTaskParam.battle_type = (int)rule.BattleParameterInstance.Rule; - gatheringCreateTaskParam.watch_type = (int)rule.WatchSetting; - gatheringCreateTaskParam.battle_begin_timestamp = (long)ConvertTime.DateTimeToUnixTime(rule.BattleStartUtcTime); - gatheringCreateTaskParam.battle_hours = rule.BattleTimeHour; - gatheringCreateTaskParam.is_deck_entry = (rule.IsEntryDeckOnly ? 1 : 0); - gatheringCreateTaskParam.gathering_type = (int)rule.Type; - gatheringCreateTaskParam.tournament_format = (int)rule.TournamentType; - if (deckList != null) - { - for (int i = 0; i < deckList.Count; i++) - { - gatheringCreateTaskParam.deck_list[i.ToString()] = new DeckEntry(deckList[i]); - } - } - base.Params = gatheringCreateTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringEntry.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringEntry.cs deleted file mode 100644 index c7d1837d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringEntry.cs +++ /dev/null @@ -1,123 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class GatheringEntry : MonoBehaviour -{ - private enum ViewMode - { - ID_INPUT, - INVITE - } - - [SerializeField] - private GameObject _idInputPrefab; - - [SerializeField] - private GameObject _entryConfirmPrefab; - - [SerializeField] - private GameObject _receiveInviteListPrefab; - - [SerializeField] - private UIButton _changeViewIdInputButton; - - [SerializeField] - private UIButton _changeViewInviteButton; - - [SerializeField] - private GameObject _activeTabSprite; - - [SerializeField] - private GameObject _inviteBadge; - - [SerializeField] - private UILabel[] _categoryLabel; - - private GatheringIDInput _input; - - private GatheringEntryConfirm _entryConfirm; - - private GatheringReceiveInviteList _receiveInviteList; - - public void InitializeUI() - { - _input = NGUITools.AddChild(base.gameObject, _idInputPrefab).GetComponent(); - } - - public void Initialize(GatheringGetSelfInfoTask task) - { - _input.OnGetInfo = OnGetEntryGetheringInfo; - _changeViewIdInputButton.onClick.Add(new EventDelegate(delegate - { - OnClickShowIdInputButton(); - })); - _changeViewInviteButton.onClick.Add(new EventDelegate(delegate - { - OnClickInviteButton(); - })); - _inviteBadge.SetActive(task.HasInvite); - SetViewMode(ViewMode.ID_INPUT); - } - - private void OnGetEntryGetheringInfo(GatheringGetInfoTask task) - { - GameObject gameObject = Object.Instantiate(_entryConfirmPrefab); - _entryConfirm = gameObject.GetComponent(); - _entryConfirm.StartConfirm(task); - } - - private void OnClickShowIdInputButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetViewMode(ViewMode.ID_INPUT); - } - - private void OnClickInviteButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetViewMode(ViewMode.INVITE); - } - - private void SetViewMode(ViewMode mode) - { - if (_receiveInviteList != null) - { - Object.Destroy(_receiveInviteList.gameObject); - } - _input.gameObject.SetActive(mode == ViewMode.ID_INPUT); - switch (mode) - { - case ViewMode.ID_INPUT: - _activeTabSprite.transform.parent = _changeViewIdInputButton.transform; - break; - case ViewMode.INVITE: - _activeTabSprite.transform.parent = _changeViewInviteButton.transform; - _receiveInviteList = NGUITools.AddChild(base.gameObject, _receiveInviteListPrefab).GetComponent(); - _receiveInviteList.Show(this); - break; - } - for (int i = 0; i < _categoryLabel.Length; i++) - { - if (i == (int)mode) - { - _categoryLabel[i].color = LabelDefine.TEXT_COLOR_NORMAL; - } - else - { - _categoryLabel[i].color = LabelDefine.TEXT_COLOR_B0B0B0; - } - } - _activeTabSprite.transform.localPosition = Vector3.zero; - } - - public void ReOpenInvite() - { - SetViewMode(ViewMode.INVITE); - } - - public void UpdateInviteBadge(GatheringGetReceiveInviteTask task) - { - _inviteBadge.SetActive(task.InviteList.Count > 0); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringEntryConfirm.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringEntryConfirm.cs deleted file mode 100644 index ffc27521..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringEntryConfirm.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringEntryConfirm : MonoBehaviour -{ - [SerializeField] - private GatheringRuleView _ruleView; - - [SerializeField] - private UserPlateBase _ownerPlate; - - private List _loadedResourceList = new List(); - - private GatheringInfo _info; - - private void Start() - { - } - - private void OnDestroy() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - public void StartConfirm(GatheringGetInfoTask task) - { - base.gameObject.SetActive(value: false); - _info = task.Info; - GatheringUserInfo ownerInfo = _info.OwnerInfo; - _loadedResourceList.AddRange(ownerInfo.GetUserAssetPathList()); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadedResourceList, delegate - { - base.gameObject.SetActive(value: true); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - _ruleView.SetGatheringInfo(task.Info); - dialogBase.SetObj(base.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Gathering_Join_0003")); - dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_Menu_0002")); - dialogBase.onPushButton1 = delegate - { - OnClickEntryButton(); - }; - _ownerPlate.InitializeSimplePlate(ownerInfo); - })); - } - - private void OnClickEntryButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (_info.Rule.IsEntryDeckOnly) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_0025")); - dialogBase.SetText(Data.SystemText.Get("Gathering_Join_0007")); - dialogBase.SetButtonText(Data.SystemText.Get("Gathering_0022")); - dialogBase.onPushButton1 = delegate - { - ShowDeckListDialog(_info); - }; - } - else - { - GatheringEntryTask gatheringEntryTask = new GatheringEntryTask(); - gatheringEntryTask.SetParameter(_info.Id, null); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(gatheringEntryTask, delegate - { - OnSuccessEntry(); - })); - } - } - - public static void ShowDeckListDialog(GatheringInfo info) - { - string deckListHeader = Data.SystemText.Get("Gathering_0026"); - MultiDeckSelectDialog.Create(RoomConnectController.RuleSelectDeckCount(info.Rule.BattleParameterInstance.Rule), info.Rule.BattleParameterInstance.DeckFormat, deckListHeader).OnDecide = delegate(List deckList) - { - EntryGathering(deckList, info); - }; - } - - public static void EntryGathering(List deckList, GatheringInfo info) - { - GatheringEntryTask gatheringEntryTask = new GatheringEntryTask(); - gatheringEntryTask.SetParameter(info.Id, deckList); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(gatheringEntryTask, delegate - { - OnSuccessEntry(); - })); - } - - public static void OnSuccessEntry() - { - GatheringChat.ResetLatestReadChatMessageId(); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Gathering); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringEntrySetting.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringEntrySetting.cs deleted file mode 100644 index 5a9966c2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringEntrySetting.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections.Generic; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringEntrySetting -{ - public GatheringRule Rule { get; private set; } - - public List DeckList { get; set; } - - public GatheringEntrySetting(GatheringRule rule) - { - Rule = rule; - int num = RoomConnectController.RuleSelectDeckCount(rule.BattleParameterInstance.Rule); - DeckList = new List(); - for (int i = 0; i < num; i++) - { - DeckData deckData = new DeckData(rule.BattleParameterInstance.DeckFormat); - deckData.SetDeckID(i + 1); - DeckList.Add(deckData); - } - } - - public DeckData GetDeck(int deckId) - { - return DeckList.Find((DeckData deck) => deck.GetDeckID() == deckId); - } - - public void RemoveDeck(int deckId) - { - List deckList = DeckList; - int count = deckList.Count; - Format format = deckList[0].Format; - DeckList = new List(); - for (int i = 0; i < count; i++) - { - if (deckList[i].GetDeckID() == deckId) - { - DeckData deckData = new DeckData(format); - deckData.SetDeckID(deckId); - DeckList.Add(deckData); - } - else - { - DeckList.Add(deckList[i]); - } - } - } - - public void DeckOrderChange(List order) - { - List deckList = DeckList; - int count = deckList.Count; - DeckList = new List(); - foreach (int deckId in order) - { - int index = deckList.FindIndex((DeckData d) => d.GetDeckID() == deckId); - DeckList.Add(deckList[index]); - deckList.RemoveAt(index); - } - foreach (DeckData item in deckList) - { - DeckList.Add(item); - } - for (int num = 0; num < count; num++) - { - DeckList[num].SetDeckID(num + 1); - } - } - - public bool IsEntryDeckOk() - { - foreach (DeckData deck in DeckList) - { - if (deck.IsNoCard()) - { - return false; - } - if (!deck.GetDeckIsComplete()) - { - return false; - } - } - return true; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringEntryTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringEntryTask.cs deleted file mode 100644 index 33f35086..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringEntryTask.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class GatheringEntryTask : BaseTask -{ - public class DeckEntry - { - public int deck_no; - - public string deck_name; - - public DeckEntry(DeckData deck) - { - deck_no = deck.GetDeckID(); - deck_name = deck.GetDeckName(); - } - } - - public class GatheringEntryTaskParam : BaseParam - { - public string gathering_id; - - public Dictionary deck_list = new Dictionary(); - } - - public GatheringEntryTask() - { - base.type = ApiType.Type.GatheringEntry; - } - - public void SetParameter(string id, List deckList) - { - GatheringEntryTaskParam gatheringEntryTaskParam = new GatheringEntryTaskParam(); - gatheringEntryTaskParam.gathering_id = id; - if (deckList != null) - { - for (int i = 0; i < deckList.Count; i++) - { - gatheringEntryTaskParam.deck_list[i.ToString()] = new DeckEntry(deckList[i]); - } - } - else - { - gatheringEntryTaskParam.deck_list = null; - } - base.Params = gatheringEntryTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.MyPageNotifications.data.IsInviteGathering = false; - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringFriendInviteListPlate.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringFriendInviteListPlate.cs deleted file mode 100644 index c627ba47..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringFriendInviteListPlate.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class GatheringFriendInviteListPlate : MonoBehaviour -{ - [SerializeField] - private GameObject _alreadyAddGathering; - - [SerializeField] - private GameObject _alreadyInvited; - - [SerializeField] - private UserListViewPlate _friendListPlate; - - public void Initialize(GatheringFriendListTask.InviteFriendData inviteData) - { - _alreadyAddGathering.SetActive(inviteData.IsJoinGathering); - _friendListPlate.SetButtonVisible(!inviteData.IsJoinGathering && !inviteData.IsInvited); - _alreadyInvited.SetActive(inviteData.IsInvited); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringFriendListTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringFriendListTask.cs deleted file mode 100644 index 006d064c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringFriendListTask.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringFriendListTask : BaseTask -{ - public class InviteFriendData : GatheringUserInfo - { - public bool IsJoinGathering { get; private set; } - - public bool IsInvited { get; private set; } - - public InviteFriendData(JsonData data, bool isJoinedGuild, bool isInvited) - : base(data) - { - IsJoinGathering = isJoinedGuild; - IsInvited = isInvited; - } - } - - public List InviteFriendList { get; private set; } - - public GatheringFriendListTask() - { - base.type = ApiType.Type.GatheringFriendList; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - InviteFriendList = new List(); - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - JsonData jsonData2 = jsonData[i]; - InviteFriendData item = new InviteFriendData(jsonData2, jsonData2["is_join_gathering"].ToBoolean(), jsonData2["is_invited"].ToBoolean()); - InviteFriendList.Add(item); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringGetInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringGetInfoTask.cs deleted file mode 100644 index 5bbd03e1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringGetInfoTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace Wizard; - -public class GatheringGetInfoTask : BaseTask -{ - public class GatheringGetInfoTaskParam : BaseParam - { - public string gathering_id; - } - - public GatheringInfo Info { get; private set; } - - public GatheringGetInfoTask() - { - base.type = ApiType.Type.GatheringGetInfo; - } - - public void SetParameter(string id) - { - GatheringGetInfoTaskParam gatheringGetInfoTaskParam = new GatheringGetInfoTaskParam(); - gatheringGetInfoTaskParam.gathering_id = id; - base.Params = gatheringGetInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Info = new GatheringInfo(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringGetReceiveInviteTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringGetReceiveInviteTask.cs deleted file mode 100644 index e4d50e28..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringGetReceiveInviteTask.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringGetReceiveInviteTask : BaseTask -{ - public class UserInfo - { - public GatheringUserInfo GatherintUserInfo { get; private set; } - - public string GatheringId { get; private set; } - - public string InviteId { get; private set; } - - public UserInfo(JsonData data) - { - JsonData jsonData = data["gathering"]; - InviteId = data["id"].ToString(); - GatheringId = jsonData["id"].ToString(); - GatherintUserInfo = new GatheringUserInfo(jsonData["master_user"]); - } - } - - public List InviteList { get; private set; } - - public GatheringGetReceiveInviteTask() - { - base.type = ApiType.Type.GatheringGetReceiveInvite; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - InviteList = new List(); - JsonData jsonData = base.ResponseData["data"]["invite_list"]; - for (int i = 0; i < jsonData.Count; i++) - { - InviteList.Add(new UserInfo(jsonData[i])); - } - Data.MyPageNotifications.data.IsInviteGathering = InviteList.Count > 0; - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringGetSelfInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringGetSelfInfoTask.cs deleted file mode 100644 index 971a3ab4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringGetSelfInfoTask.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringGetSelfInfoTask : BaseTask -{ - public GatheringInfo Info { get; private set; } - - public bool HasInvite { get; private set; } - - public GatheringEntrySetting EntrySetting { get; private set; } - - public List ChatStampList { get; private set; } = new List(); - - public string _hashTags { get; private set; } - - public GatheringGetSelfInfoTask(bool isDependGatheringInfo) - { - base.type = (isDependGatheringInfo ? ApiType.Type.GatheringInfoDependJoin : ApiType.Type.GatheringSelfInfo); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - if (jsonData.Keys.Contains("has_invite")) - { - HasInvite = jsonData["has_invite"].ToInt() != 0; - } - if (jsonData.Count == 0 || !jsonData.Keys.Contains("gathering")) - { - Info = new GatheringInfo(); - return num; - } - Info = new GatheringInfo(jsonData); - EntrySetting = new GatheringEntrySetting(Info.Rule); - JsonData jsonData2 = jsonData["usable_stamp_list"]; - for (int i = 0; i < jsonData2.Count; i++) - { - ChatStampList.Add(jsonData2[i].ToInt()); - } - _hashTags = jsonData["hash_tag"].ToString(); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringIDInput.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringIDInput.cs deleted file mode 100644 index 05a44d3c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringIDInput.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Text.RegularExpressions; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringIDInput : MonoBehaviour -{ - [SerializeField] - private UIButton _searchButton; - - [SerializeField] - private UIButton _pasteButton; - - [SerializeField] - private UIInputWizard _idInput; - - public Action OnGetInfo { get; set; } - - private void Start() - { - _searchButton.onClick.Add(new EventDelegate(delegate - { - OnClickSearchButton(); - })); - _idInput.onChange.Add(new EventDelegate(delegate - { - OnChangeInputId(); - })); - _pasteButton.onClick.Add(new EventDelegate(delegate - { - Paste(); - })); - UIManager.SetObjectToGrey(_searchButton.gameObject, b: true); - } - - private void OnChangeInputId() - { - UIManager.SetObjectToGrey(_searchButton.gameObject, !UIUtil.IsValidIdDigits(_idInput.value, 6)); - } - - private void OnClickSearchButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GatheringGetInfoTask task = new GatheringGetInfoTask(); - task.SetParameter(_idInput.value); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - OnSuccessGetGatheringInfo(task); - })); - } - - private void OnSuccessGetGatheringInfo(GatheringGetInfoTask task) - { - OnGetInfo(task); - } - - private void Paste() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - string clipboard = ClipboardHelper.Clipboard; - clipboard = Regex.Replace(clipboard, "[0-9]", (Match match) => ((char)(match.Value[0] - 65296 + 48)).ToString()); - clipboard = Regex.Replace(clipboard, "\\s", ""); - if (UIUtil.IsValidIdDigits(clipboard, 6)) - { - _idInput.value = clipboard; - OnChangeInputId(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInfo.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInfo.cs deleted file mode 100644 index 11d438dc..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInfo.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringInfo -{ - public enum eState - { - BEFORE_BATTLE = 1, - ACTIVE_BATTLE, - AFTER_BATTLE - } - - public GatheringRule Rule { get; private set; } - - public eState State { get; private set; } - - public GatheringRule.eRole Role { get; private set; } - - public string Id { get; private set; } - - public int CurrentMemberCount { get; private set; } - - public List MemberList { get; private set; } - - public GatheringUserInfo OwnerInfo { get; private set; } - - public string BattleStartTime { get; private set; } - - public string BattleStartTimeShort { get; private set; } - - public string FinishTime { get; private set; } - - public bool IsGatheringFinish { get; private set; } - - public string Description { get; private set; } - - public bool CanBattleJoin - { - get - { - if (Role == GatheringRule.eRole.OWNER && !Rule.IsOwnerEntryBattle) - { - return false; - } - return true; - } - } - - public GatheringInfo() - { - } - - public GatheringInfo(JsonData data) - { - JsonData jsonData = data["gathering"]; - Rule = new GatheringRule(jsonData, data["gathering_config"]); - CurrentMemberCount = jsonData["join_member_count"].ToInt(); - Id = jsonData["id"].ToString(); - int num = jsonData["master_viewer_id"].ToInt(); - Role = ((num == PlayerStaticData.UserViewerID) ? GatheringRule.eRole.OWNER : GatheringRule.eRole.GUEST); - MemberList = new List(); - if (data.Keys.Contains("members")) - { - JsonData jsonData2 = data["members"]; - for (int i = 0; i < jsonData2.Count; i++) - { - GatheringUserInfo gatheringUserInfo = new GatheringUserInfo(jsonData2[i]); - gatheringUserInfo.IsOwner = gatheringUserInfo.ViewerId == num; - MemberList.Add(gatheringUserInfo); - } - } - OwnerInfo = new GatheringUserInfo(jsonData["master_user"]); - DateTime dateTime = DateTime.Parse(jsonData["battle_begin_time"].ToString()); - BattleStartTime = ConvertTime.ToLocal(dateTime).ToString(); - BattleStartTimeShort = ConvertTime.ToLocal(dateTime, ConvertTime.FORMAT.TIME_DATE_SHORT).ToString(); - if (jsonData.TryGetValue("battle_end_time", out var value)) - { - FinishTime = ConvertTime.ToLocal(DateTime.Parse(value.ToString())).ToString(); - } - if (jsonData.TryGetValue("is_battle_finished", out var value2)) - { - IsGatheringFinish = value2.ToInt() != 0; - } - Description = jsonData["description"].ToString(); - State = (eState)jsonData["status"].ToInt(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInterruptTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInterruptTask.cs deleted file mode 100644 index 529a091a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInterruptTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Wizard; - -public class GatheringInterruptTask : BaseTask -{ - public GatheringInterruptTask() - { - base.type = ApiType.Type.GatheringInterrupt; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInvite.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInvite.cs deleted file mode 100644 index e4bc0788..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInvite.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringInvite : MonoBehaviour -{ - [SerializeField] - private UIButton _userIdSearchButton; - - [SerializeField] - private UIButton _friendInviteButton; - - [SerializeField] - private GameObject _idInputDialogPrefab; - - [SerializeField] - private GameObject _userDataDialogPrefab; - - [SerializeField] - private GameObject _friendListDialogPrefab; - - [SerializeField] - private UserListView _friendViewOriginal; - - [SerializeField] - private GameObject _inviteNoneRoot; - - [SerializeField] - private UIButton _twitterButton; - - [SerializeField] - private UILabel _twitterButtonText; - - private GatheringInviteUserListTask _inviteUserListTask; - - private GatheringJoining _parent; - - private GatheringGetSelfInfoTask _selfInfoTask; - - private const int ID_INPUT_PANEL_DEPTH = 19; - - private const int FRIEND_SELECT_PANEL_DEPTH = 30; - - private const int FRIEND_INVITE_CONFIRM_PANEL_DEPTH = 30; - - private void Start() - { - _userIdSearchButton.onClick.Add(new EventDelegate(delegate - { - OnClickUserIdSearch(); - })); - _friendInviteButton.onClick.Add(new EventDelegate(delegate - { - OnClickFriendInviteButton(); - })); - _twitterButtonText.text = Data.SystemText.Get("RoomBattle_0185"); - _twitterButton.onClick.Add(new EventDelegate(delegate - { - CopyInviteText(); - })); - } - - public void Show(GatheringJoining parent) - { - _parent = parent; - _selfInfoTask = new GatheringGetSelfInfoTask(isDependGatheringInfo: true); - StartCoroutine(Toolbox.NetworkManager.Connect(_selfInfoTask, delegate - { - if (!parent.CheckChangeStatus(_selfInfoTask.Info)) - { - GatheringInviteUserListTask inviteListTask = new GatheringInviteUserListTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(inviteListTask, delegate - { - OnReceiveInviteList(inviteListTask); - })); - } - })); - } - - private void OnReceiveInviteList(GatheringInviteUserListTask task) - { - _inviteUserListTask = task; - _inviteNoneRoot.SetActive(task.InviteUserInfoList.Count == 0); - string actionButtonLabel = Data.SystemText.Get("Guild_List_0014"); - List list = new List(); - foreach (GatheringInviteUserListTask.InviteUserInfo inviteUserInfo in task.InviteUserInfoList) - { - list.Add(inviteUserInfo.userInfo); - } - UserListView.CreateView(_friendViewOriginal.gameObject, base.gameObject, list, OnClickInviteCancel, actionButtonLabel); - } - - private void OnClickInviteCancel(UserInfoBase userInfo) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SystemText systemText = Data.SystemText; - UserDataDialog userDataDialog = UserDataDialog.Create(_userDataDialogPrefab, userInfo, systemText.Get("Gathering_Invite_0002")); - DialogBase dialog = userDataDialog.Dialog; - userDataDialog.SetDiscriptionLabel(systemText.Get("Guild_List_0015")); - dialog.SetButtonText(systemText.Get("Guild_List_0016")); - dialog.SetPanelDepth(30); - dialog.onPushButton1 = delegate - { - InviteCancel(userInfo as GatheringUserInfo); - }; - } - - private void InviteCancel(GatheringUserInfo userInfo) - { - GatheringInviteCancelTask gatheringInviteCancelTask = new GatheringInviteCancelTask(); - gatheringInviteCancelTask.SetParameter(_inviteUserListTask.GetInviteIdFromViewerId(userInfo.ViewerId)); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringInviteCancelTask, delegate - { - _parent.ReOpenCurrentCategory(); - })); - } - - private void OnClickFriendInviteButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GatheringFriendListTask task = new GatheringFriendListTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - OnReceiveFriendList(task); - })); - } - - private void OnReceiveFriendList(GatheringFriendListTask task) - { - if (task.InviteFriendList.Count <= 0) - { - ShowNoFriendDialog(); - return; - } - List list = new List(); - foreach (GatheringFriendListTask.InviteFriendData inviteFriend in task.InviteFriendList) - { - list.Add(inviteFriend); - } - string actionButtonLabel = Data.SystemText.Get("Guild_List_0007"); - UserListView friendList = UserListView.CreateDialog(_friendListDialogPrefab, list, OnSelectInviteFriend, actionButtonLabel); - friendList.Dialog.SetPanelDepth(30); - friendList.Dialog.SetTitleLabel(Data.SystemText.Get("Guild_List_0006")); - friendList.PanelDepth = 31; - friendList.PlateCustomize = FriendListePlateCustomize; - friendList.OnSelect = delegate(UserInfoBase userInfo) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - OnSelectInviteFriend(userInfo); - friendList.Dialog.Close(); - }; - } - - private void FriendListePlateCustomize(UserListViewPlate friendListPlate, UserInfoBase userInfoBase) - { - GatheringFriendListTask.InviteFriendData inviteData = userInfoBase as GatheringFriendListTask.InviteFriendData; - friendListPlate.gameObject.GetComponent().Initialize(inviteData); - } - - private void OnSelectInviteFriend(UserInfoBase userInfo) - { - SystemText systemText = Data.SystemText; - UserDataDialog userDataDialog = UserDataDialog.Create(_userDataDialogPrefab, userInfo, systemText.Get("Gathering_Invite_0002")); - DialogBase dialog = userDataDialog.Dialog; - userDataDialog.SetDiscriptionLabel(systemText.Get("Gathering_Invite_0003")); - dialog.SetButtonText(Data.SystemText.Get("Guild_List_0011")); - dialog.SetPanelDepth(30); - dialog.onPushButton1 = delegate - { - Invite(userInfo as GatheringUserInfo); - }; - } - - private void ShowNoFriendDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetText(Data.SystemText.Get("Gathering_Invite_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetSize(DialogBase.Size.S); - } - - private void OnClickUserIdSearch() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GuildInputViewerIdDialog inputDialog = Object.Instantiate(_idInputDialogPrefab).GetComponent(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("Guild_List_0002")); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetObj(inputDialog.gameObject); - dialogBase.SetPanelDepth(19); - inputDialog.InitializeDialog(dialogBase); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Guild_List_0005")); - dialogBase.onPushButton1 = delegate - { - FindViewerIdUser(inputDialog.InputValue); - }; - } - - private void FindViewerIdUser(int search_viewer_id) - { - FriendUserSearchTask friendUserSearchTask = new FriendUserSearchTask(); - friendUserSearchTask.SetParameter(search_viewer_id); - StartCoroutine(Toolbox.NetworkManager.Connect(friendUserSearchTask, delegate - { - GatheringUserInfo userInfo = new GatheringUserInfo(Data.SearchUserInfo.data.user); - SystemText systemText = Data.SystemText; - UserDataDialog userDataDialog = UserDataDialog.Create(_userDataDialogPrefab, userInfo, systemText.Get("Gathering_Invite_0002")); - DialogBase dialog = userDataDialog.Dialog; - userDataDialog.SetDiscriptionLabel(systemText.Get("Gathering_Invite_0003")); - dialog.SetButtonText(Data.SystemText.Get("Guild_List_0011")); - dialog.onPushButton1 = delegate - { - Invite(userInfo); - }; - })); - } - - private void Invite(GatheringUserInfo user) - { - GatheringInviteTask gatheringInviteTask = new GatheringInviteTask(); - gatheringInviteTask.SetParameter(user.ViewerId.ToString()); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringInviteTask, delegate - { - OnSuccessInvite(); - })); - } - - private void OnSuccessInvite() - { - UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Invite_0004")).OnClose = delegate - { - _parent.ReOpenCurrentCategory(); - }; - } - - private void CopyInviteText() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - CreateDialog(Data.SystemText.Get("RoomBattle_0186"), Data.SystemText.Get("Gathering_0044")); - NativePluginWrapper.SetStringToClipboard(GetTweetText()); - } - - private string GetTweetText() - { - string hashTags = _selfInfoTask._hashTags; - GatheringInfo info = _selfInfoTask.Info; - string gatheringTypeString = GatheringUtility.GetGatheringTypeString(info); - string text = GetFormatTexForHashTag(info.Rule.BattleParameterInstance.DeckFormat) + "/" + RoomRuleSetting.GetWinTypeString(info.Rule.BattleParameterInstance.Rule); - return Data.SystemText.Get("Gathering_0043", hashTags, info.Id, gatheringTypeString, text, info.BattleStartTimeShort); - } - - private string GetFormatTexForHashTag(Format deckFormat) - { - return deckFormat switch - { - Format.Hof => Data.SystemText.Get("RoomBattle_0188"), - Format.Windfall => Data.SystemText.Get("RoomBattle_0193"), - Format.Crossover => Data.SystemText.Get("RoomBattle_0194"), - Format.MyRotation => Data.SystemText.Get("RoomBattle_0205"), - Format.Avatar => Data.SystemText.Get("RoomBattle_0208"), - _ => FormatBehaviorManager.GetFormatName(deckFormat), - }; - } - - private void CreateDialog(string title, string msg) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(msg); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteCancelTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInviteCancelTask.cs deleted file mode 100644 index b51034ee..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteCancelTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class GatheringInviteCancelTask : BaseTask -{ - public class GatheringInviteCancelTaskParam : BaseParam - { - public string invite_id; - } - - public GatheringInviteCancelTask() - { - base.type = ApiType.Type.GatheringInviteCancel; - } - - public void SetParameter(string inviteId) - { - GatheringInviteCancelTaskParam gatheringInviteCancelTaskParam = new GatheringInviteCancelTaskParam(); - gatheringInviteCancelTaskParam.invite_id = inviteId; - base.Params = gatheringInviteCancelTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteRejectTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInviteRejectTask.cs deleted file mode 100644 index 437d5c9d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteRejectTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class GatheringInviteRejectTask : BaseTask -{ - public class GatheringInviteRejectTaskParam : BaseParam - { - public string invite_id; - } - - public GatheringInviteRejectTask() - { - base.type = ApiType.Type.GatheringInviteReject; - } - - public void SetParameter(string inviteId) - { - GatheringInviteRejectTaskParam gatheringInviteRejectTaskParam = new GatheringInviteRejectTaskParam(); - gatheringInviteRejectTaskParam.invite_id = inviteId; - base.Params = gatheringInviteRejectTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInviteTask.cs deleted file mode 100644 index 5b79b2f2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class GatheringInviteTask : BaseTask -{ - public class GatheringInviteTaskParam : BaseParam - { - public string target_viewer_id; - } - - public GatheringInviteTask() - { - base.type = ApiType.Type.GatheringInvite; - } - - public void SetParameter(string targetViewerId) - { - GatheringInviteTaskParam gatheringInviteTaskParam = new GatheringInviteTaskParam(); - gatheringInviteTaskParam.target_viewer_id = targetViewerId; - base.Params = gatheringInviteTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteUserListTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringInviteUserListTask.cs deleted file mode 100644 index e9cf8eac..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringInviteUserListTask.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringInviteUserListTask : BaseTask -{ - public class InviteUserInfo - { - public string InviteId { get; private set; } - - public GatheringUserInfo userInfo { get; private set; } - - public InviteUserInfo(JsonData json) - { - InviteId = json["id"].ToString(); - userInfo = new GatheringUserInfo(json["user_info"]); - } - } - - public class GatheringInviteUserListTaskParam : BaseParam - { - public int page; - - public int oldest_time; - } - - private Dictionary _inviteIdDictionary; - - public List InviteUserInfoList { get; private set; } - - public GatheringInviteUserListTask() - { - base.type = ApiType.Type.GatheringInviteUserList; - } - - public void SetParameter() - { - GatheringInviteUserListTaskParam gatheringInviteUserListTaskParam = new GatheringInviteUserListTaskParam(); - gatheringInviteUserListTaskParam.page = 0; - gatheringInviteUserListTaskParam.oldest_time = 0; - base.Params = gatheringInviteUserListTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - _inviteIdDictionary = new Dictionary(); - InviteUserInfoList = new List(); - JsonData jsonData = base.ResponseData["data"]["invite_list"]; - for (int i = 0; i < jsonData.Count; i++) - { - InviteUserInfo inviteUserInfo = new InviteUserInfo(jsonData[i]); - InviteUserInfoList.Add(inviteUserInfo); - _inviteIdDictionary[inviteUserInfo.userInfo.ViewerId] = inviteUserInfo.InviteId; - } - return num; - } - - public string GetInviteIdFromViewerId(int viewerId) - { - return _inviteIdDictionary[viewerId]; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringJoining.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringJoining.cs deleted file mode 100644 index 0713acc5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringJoining.cs +++ /dev/null @@ -1,148 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class GatheringJoining : MonoBehaviour -{ - [SerializeField] - private GameObject _categorySelectPrefab; - - [SerializeField] - private GameObject _chatPrefab; - - [SerializeField] - private GameObject _infoPrefab; - - [SerializeField] - private GameObject _memberListPrefab; - - [SerializeField] - private GameObject _rankingPrefab; - - [SerializeField] - private GameObject _invitePrefab; - - [SerializeField] - private GameObject _tournamentPrefab; - - private GatheringChat _chat; - - private GatheringJoiningCategorySelect _categorySelect; - - private GatheringMemberList _memberList; - - private GatheringInvite _invite; - - private GatheringRanking _ranking; - - private GatheringTournament _tournament; - - private GatheringJoiningInfo _info; - - private GatheringJoiningCategorySelect.Category _currentCategory; - - private GatheringInfo _gatheringInfo; - - public void InitializeUI() - { - _categorySelect = NGUITools.AddChild(base.gameObject, _categorySelectPrefab).GetComponent(); - _categorySelect.OnSelect = OnSelectCategory; - _info = NGUITools.AddChild(base.gameObject, _infoPrefab).GetComponent(); - _memberList = NGUITools.AddChild(base.gameObject, _memberListPrefab).GetComponent(); - } - - public void Initialize() - { - OnSelectCategory(GatheringJoiningCategorySelect.Category.CHAT); - } - - public void OnReceiveSelfInfo(GatheringInfo info) - { - _gatheringInfo = info; - _categorySelect.OnReceiveSelfInfo(info); - } - - public bool CheckChangeStatus(GatheringInfo currentInfo) - { - if (_gatheringInfo.State == currentInfo.State) - { - return false; - } - SystemText systemText = Data.SystemText; - DialogBase dialogBase = null; - dialogBase = ((currentInfo.State != GatheringInfo.eState.ACTIVE_BATTLE) ? UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Gathering_Chat_0010")) : UIManager.GetInstance().CreateConfirmationDialog(systemText.Get("Gathering_Chat_0009"))); - dialogBase.OnClose = delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - MyPageMenuIndex = 3, - OnFinishChangeView = delegate - { - MyPageMenu.Instance.GoToGatheringActionMenu(); - } - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, param); - }; - dialogBase.SetPanelDepth(4000); - return true; - } - - private void OnSelectCategory(GatheringJoiningCategorySelect.Category category) - { - _currentCategory = category; - if (_chat != null) - { - _chat.ReadyCloseCategory(); - _chat.CloseCategory(); - Object.Destroy(_chat.gameObject); - } - if (_memberList != null) - { - Object.Destroy(_memberList.gameObject); - } - if (_invite != null) - { - Object.Destroy(_invite.gameObject); - } - if (_ranking != null) - { - Object.Destroy(_ranking.gameObject); - } - if (_tournament != null) - { - Object.Destroy(_tournament.gameObject); - } - _info.gameObject.SetActive(category == GatheringJoiningCategorySelect.Category.INFO); - switch (category) - { - case GatheringJoiningCategorySelect.Category.CHAT: - _chat = NGUITools.AddChild(base.gameObject, _chatPrefab).GetComponent(); - _chat.OpenCategory(); - break; - case GatheringJoiningCategorySelect.Category.INFO: - _info.Show(this); - break; - case GatheringJoiningCategorySelect.Category.MEMBER_LIST: - _memberList = NGUITools.AddChild(base.gameObject, _memberListPrefab).GetComponent(); - _memberList.Show(this); - break; - case GatheringJoiningCategorySelect.Category.INVITE: - _invite = NGUITools.AddChild(base.gameObject, _invitePrefab).GetComponent(); - _invite.Show(this); - break; - case GatheringJoiningCategorySelect.Category.RANKING: - _ranking = NGUITools.AddChild(base.gameObject, _rankingPrefab).GetComponent(); - _ranking.Show(_gatheringInfo, this); - break; - case GatheringJoiningCategorySelect.Category.TOURNAMENT: - _tournament = NGUITools.AddChild(base.gameObject, _tournamentPrefab).GetComponent(); - _tournament.Show(_gatheringInfo, this); - break; - } - } - - public void ReOpenCurrentCategory() - { - OnSelectCategory(_currentCategory); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringJoiningCategorySelect.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringJoiningCategorySelect.cs deleted file mode 100644 index 71ccd8bb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringJoiningCategorySelect.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringJoiningCategorySelect : MonoBehaviour -{ - public enum Category - { - CHAT, - INFO, - MEMBER_LIST, - INVITE, - RANKING, - TOURNAMENT - } - - [SerializeField] - private UIButton _chatButton; - - [SerializeField] - private UIButton _infoButton; - - [SerializeField] - private UIButton _memberListButton; - - [SerializeField] - private UIButton _inviteButton; - - [SerializeField] - private UIButton _rankingButton; - - [SerializeField] - private GameObject _selectCursor; - - [SerializeField] - private UISprite _bottomSprite; - - [SerializeField] - private GameObject _bgSpriteInvite; - - [SerializeField] - private GameObject _bgSpriteMemberList; - - [SerializeField] - private GameObject _bgSpriteRanking; - - [SerializeField] - private UILabel[] _categoryLabel; - - [SerializeField] - private UIGrid _grid; - - public Action OnSelect; - - private bool _isTournament; - - private void Start() - { - _categoryLabel[0].color = LabelDefine.TEXT_COLOR_NORMAL; - SetCursor(_chatButton); - _chatButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetCursor(_chatButton); - OnSelectCategory(Category.CHAT); - })); - _infoButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetCursor(_infoButton); - OnSelectCategory(Category.INFO); - })); - _memberListButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetCursor(_memberListButton); - OnSelectCategory(Category.MEMBER_LIST); - })); - _inviteButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetCursor(_inviteButton); - OnSelectCategory(Category.INVITE); - })); - _rankingButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetCursor(_rankingButton); - Category category = (_isTournament ? Category.TOURNAMENT : Category.RANKING); - OnSelectCategory(category); - })); - } - - private void OnSelectCategory(Category category) - { - int num = (int)((category == Category.TOURNAMENT) ? Category.RANKING : category); - for (int i = 0; i < _categoryLabel.Length; i++) - { - if (i == num) - { - _categoryLabel[i].color = LabelDefine.TEXT_COLOR_NORMAL; - } - else - { - _categoryLabel[i].color = LabelDefine.TEXT_COLOR_B0B0B0; - } - } - OnSelect.Call(category); - } - - private void SetCursor(UIButton parent) - { - _selectCursor.transform.parent = parent.transform; - _selectCursor.transform.localPosition = Vector3.zero; - } - - public void OnReceiveSelfInfo(GatheringInfo info) - { - if (info.State == GatheringInfo.eState.BEFORE_BATTLE) - { - _inviteButton.gameObject.SetActive(info.Role == GatheringRule.eRole.OWNER); - _rankingButton.gameObject.SetActive(value: false); - } - else - { - _inviteButton.gameObject.SetActive(value: false); - _rankingButton.gameObject.SetActive(value: true); - } - _grid.Reposition(); - GameObject gameObject = null; - gameObject = ((info.Role != GatheringRule.eRole.OWNER) ? ((info.State == GatheringInfo.eState.BEFORE_BATTLE) ? _bgSpriteMemberList : _bgSpriteRanking) : ((info.State == GatheringInfo.eState.BEFORE_BATTLE) ? _bgSpriteInvite : _bgSpriteRanking)); - _bottomSprite.topAnchor.target = gameObject.transform; - _bottomSprite.bottomAnchor.target = gameObject.transform; - _bottomSprite.ResetAnchors(); - _bottomSprite.UpdateAnchors(); - if (info.Rule != null) - { - _isTournament = info.Rule.Type == GatheringRule.eType.TOURNAMENT; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringJoiningInfo.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringJoiningInfo.cs deleted file mode 100644 index 7068d53a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringJoiningInfo.cs +++ /dev/null @@ -1,134 +0,0 @@ -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringJoiningInfo : MonoBehaviour -{ - [SerializeField] - private GatheringRuleView _ruleView; - - [SerializeField] - private GatheringRuleView _eliminationRuleView; - - [SerializeField] - private GameObject _root; - - [SerializeField] - private UILabel _boardText; - - [SerializeField] - private UIButton _editBoardButton; - - [SerializeField] - private GameObject _editBoardInputDialogPrefab; - - [SerializeField] - private UIButton _idCopyButton; - - [SerializeField] - private UIButton _settingButton; - - [SerializeField] - private GameObject _gatheringSettingDialogPrefab; - - private GatheringGetSelfInfoTask _infoTask; - - private GatheringJoining _parent; - - private void Start() - { - _editBoardButton.onClick.Add(new EventDelegate(delegate - { - OnClickEditBoardButton(); - })); - _idCopyButton.onClick.Add(new EventDelegate(delegate - { - OnClickIdCopyButton(); - })); - _settingButton.onClick.Add(new EventDelegate(delegate - { - OnClickSettingButton(); - })); - } - - public void Show(GatheringJoining parent) - { - _parent = parent; - _root.SetActive(value: false); - GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - OnReceiveInfo(task); - })); - } - - private void OnReceiveInfo(GatheringGetSelfInfoTask task) - { - _parent.CheckChangeStatus(task.Info); - _infoTask = task; - bool isTournament = _infoTask.Info.Rule.IsTournament; - _ruleView.gameObject.SetActive(!isTournament); - _eliminationRuleView.gameObject.SetActive(isTournament); - if (isTournament) - { - _eliminationRuleView.SetGatheringInfo(task.Info); - } - else - { - _ruleView.SetGatheringInfo(task.Info); - } - _root.SetActive(value: true); - _boardText.text = task.Info.Description; - bool active = task.Info.Role == GatheringRule.eRole.OWNER; - _editBoardButton.gameObject.SetActive(active); - _settingButton.gameObject.SetActive(active); - } - - private void OnClickEditBoardButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GuildInputDescriptionDialog input = Object.Instantiate(_editBoardInputDialogPrefab).GetComponent(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetTitleLabel(Data.SystemText.Get("Guild_Profile_0007")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.DecisionBtn); - dialogBase.SetObj(input.gameObject); - input.InputValue = _infoTask.Info.Description; - dialogBase.onPushButton1 = delegate - { - UpdateBoardText(input.InputValue); - }; - } - - private void UpdateBoardText(string text) - { - GatheringUpdateDescriptionTask gatheringUpdateDescriptionTask = new GatheringUpdateDescriptionTask(); - gatheringUpdateDescriptionTask.SetParameter(text); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringUpdateDescriptionTask, delegate - { - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Guild_Profile_0010")); - dialogBase.onPushButton1 = delegate - { - _parent.ReOpenCurrentCategory(); - }; - dialogBase.onCloseWithoutSelect = delegate - { - _parent.ReOpenCurrentCategory(); - }; - })); - } - - private void OnClickIdCopyButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - NativePluginWrapper.SetStringToClipboard(_infoTask.Info.Id); - UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Information_0011")); - } - - private void OnClickSettingButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - GatheringSettingDialog.Create(_gatheringSettingDialogPrefab, _infoTask.Info); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringKickConfirm.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringKickConfirm.cs deleted file mode 100644 index 1e729ae8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringKickConfirm.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringKickConfirm : MonoBehaviour -{ - [SerializeField] - private UIToggle _toggleEternal; - - [SerializeField] - private UserPlateBase _userPlate; - - private Action OnKickDecide; - - private bool _toggleClickFirst = true; - - public static void Create(GameObject prefab, GatheringUserInfo userInfo, Action onKickDecide) - { - GatheringKickConfirm component = UnityEngine.Object.Instantiate(prefab).GetComponent(); - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - component.Initialize(dialog, userInfo, onKickDecide); - } - - private void Initialize(DialogBase dialog, GatheringUserInfo userInfo, Action onKickDecide) - { - OnKickDecide = onKickDecide; - SystemText systemText = Data.SystemText; - string titleLabel = systemText.Get("Gathering_Member_0012"); - string text_btn = systemText.Get("Gathering_Member_0005"); - dialog.SetTitleLabel(titleLabel); - dialog.SetButtonText(text_btn); - dialog.SetObj(base.gameObject); - dialog.SetSize(DialogBase.Size.S); - dialog.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - _userPlate.InitializeSimplePlate(userInfo); - dialog.onPushButton1 = delegate - { - OnKickDecide.Call(_toggleEternal.value); - }; - _toggleEternal.onChange.Add(new EventDelegate(delegate - { - OnClickToggle(); - })); - } - - private void OnClickToggle() - { - if (!_toggleClickFirst) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggleEternal.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - _toggleClickFirst = false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringKickTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringKickTask.cs deleted file mode 100644 index 660f7dc3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringKickTask.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Wizard; - -public class GatheringKickTask : BaseTask -{ - public class GatheringKickTaskParam : BaseParam - { - public string target_viewer_id; - - public int is_restrict; - } - - public GatheringKickTask() - { - base.type = ApiType.Type.GatheringKick; - } - - public void SetParameter(string targetViewerId, bool isRestrict) - { - GatheringKickTaskParam gatheringKickTaskParam = new GatheringKickTaskParam(); - gatheringKickTaskParam.target_viewer_id = targetViewerId; - gatheringKickTaskParam.is_restrict = (isRestrict ? 1 : 0); - base.Params = gatheringKickTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringLeaveTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringLeaveTask.cs deleted file mode 100644 index e295ba03..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringLeaveTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Wizard; - -public class GatheringLeaveTask : BaseTask -{ - public GatheringLeaveTask() - { - base.type = ApiType.Type.GatheringLeave; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringMatchedRoom.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringMatchedRoom.cs deleted file mode 100644 index a918cf1b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringMatchedRoom.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Wizard; - -public class GatheringMatchedRoom -{ - private const string NO_MATCHED_ROOM_ID = "0"; - - public string RoomId { get; private set; } - - public bool IsMatched => RoomId != "0"; - - public GatheringMatchedRoom(string roomId) - { - RoomId = roomId; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringMemberList.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringMemberList.cs deleted file mode 100644 index 79e4e8e0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringMemberList.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringMemberList : MonoBehaviour -{ - private List _loadedResourceList = new List(); - - [SerializeField] - private SimpleScrollViewUI _memberListScrollView; - - [SerializeField] - private GameObject _userDataDialog; - - [SerializeField] - private GameObject _kickConfirmPrefab; - - [SerializeField] - private UILabel _memberCount; - - [SerializeField] - private GameObject _memberNoneObject; - - private GatheringJoining _parent; - - private GatheringGetSelfInfoTask _task; - - public void Show(GatheringJoining parent) - { - _parent = parent; - GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true); - _memberCount.gameObject.SetActive(value: false); - _memberNoneObject.SetActive(value: false); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _memberCount.gameObject.SetActive(value: true); - OnReceiveInfo(task); - })); - } - - public void OnDestroy() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private void OnReceiveInfo(GatheringGetSelfInfoTask task) - { - _parent.CheckChangeStatus(task.Info); - _task = task; - UpdateMemberList(task); - GatheringInfo info = task.Info; - _memberCount.text = Data.SystemText.Get("Guild_0005", info.CurrentMemberCount.ToString(), info.Rule.MaxMember.ToString()); - _memberNoneObject.SetActive(info.CurrentMemberCount == 0); - } - - private void UpdateMemberList(GatheringGetSelfInfoTask task) - { - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadImages(task, delegate - { - _memberListScrollView.CreateScrollView(task.Info.MemberList.Count, InitializePlate); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private IEnumerator LoadImages(GatheringGetSelfInfoTask task, Action callBack = null) - { - List memberList = task.Info.MemberList; - List list = new List(); - for (int i = 0; i < memberList.Count; i++) - { - GatheringUserInfo gatheringUserInfo = memberList[i]; - list.AddRange(gatheringUserInfo.GetUserAssetPathList()); - } - List loadPathList = list.Distinct().Except(_loadedResourceList).ToList(); - if (loadPathList.Count > 0) - { - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null)); - _loadedResourceList.AddRange(loadPathList); - } - callBack.Call(); - } - - private void InitializePlate(int index, GameObject plate) - { - GatheringMemberPlate component = plate.GetComponent(); - component.Initialize(_task.Info, _task.Info.MemberList[index]); - component.OnClickFriendRequest = OnClickFriendRequest; - component.OnClickKick = OnClickKickButton; - component.OnClickDropOut = OnClickDropOutButton; - } - - private DialogBase CreateMemberActionDialog(GatheringUserInfo member, string title, string discription, string decideText, Action onDecide) - { - GuildUserDataDialog component = UnityEngine.Object.Instantiate(_userDataDialog).GetComponent(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(title); - dialogBase.SetObj(component.gameObject); - component.SetUserData(member); - component.SetDiscriptionLabel(discription); - dialogBase.SetButtonText(decideText); - dialogBase.onPushButton1 = delegate - { - onDecide(); - }; - return dialogBase; - } - - private void OnClickFriendRequest(GatheringUserInfo member) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - Action onDecide = delegate - { - ApplyFriend(member.ViewerId); - }; - SystemText systemText = Data.SystemText; - string title = systemText.Get("Guild_Profile_0014"); - string discription = systemText.Get("Guild_Profile_0015"); - string decideText = systemText.Get("OtherFriend_0032"); - CreateMemberActionDialog(member, title, discription, decideText, onDecide); - } - - private void OnClickKickButton(GatheringUserInfo member) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - Action onKickDecide = delegate(bool kickEternal) - { - Kick(member, kickEternal); - }; - GatheringKickConfirm.Create(_kickConfirmPrefab, member, onKickDecide); - } - - private void Kick(GatheringUserInfo member, bool kickEternal) - { - GatheringKickTask gatheringKickTask = new GatheringKickTask(); - gatheringKickTask.SetParameter(member.ViewerId.ToString(), kickEternal); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringKickTask, delegate - { - OnKickSuccess(); - })); - } - - private void OnKickSuccess() - { - UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Member_0006")).OnCloseStart = delegate - { - _parent.ReOpenCurrentCategory(); - }; - } - - private void OnClickDropOutButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SystemText systemText = Data.SystemText; - string titleLabel = systemText.Get("Gathering_Member_0011"); - string message = systemText.Get("Gathering_Member_0008"); - string text_btn = systemText.Get("Gathering_Member_0009"); - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(message); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetButtonText(text_btn); - dialogBase.SetTitleLabel(titleLabel); - dialogBase.onPushButton1 = delegate - { - DropOut(); - }; - } - - private void DropOut() - { - GatheringLeaveTask task = new GatheringLeaveTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - string message = Data.SystemText.Get("Gathering_Member_0010"); - UIManager.GetInstance().CreateConfirmationDialog(message).OnCloseStart = delegate - { - Gathering.BackToMyPageForDrop(); - }; - })); - } - - private void ApplyFriend(int viewerId) - { - FriendApplySendTask friendApplySendTask = new FriendApplySendTask(); - friendApplySendTask.SetParameter(viewerId); - StartCoroutine(Toolbox.NetworkManager.Connect(friendApplySendTask, OnSuccessApplyFriend)); - } - - private void OnSuccessApplyFriend(NetworkTask.ResultCode code) - { - UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Guild_Profile_0016")); - _parent.ReOpenCurrentCategory(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringMemberPlate.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringMemberPlate.cs deleted file mode 100644 index 7ffd3d3b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringMemberPlate.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringMemberPlate : UserPlateBase -{ - [SerializeField] - private UIButton _friendRequestButton; - - [SerializeField] - private UIButton _dropOutButton; - - [SerializeField] - private UIButton _kickButton; - - [SerializeField] - private UILabel _ownerOrGuestLabel; - - [SerializeField] - private GameObject _friendRequestSending; - - [SerializeField] - private GameObject _friendIcon; - - public Action OnClickFriendRequest; - - public Action OnClickDropOut; - - public Action OnClickKick; - - public void Initialize(GatheringInfo info, GatheringUserInfo userInfo) - { - InitializeBase(userInfo); - _dropOutButton.gameObject.SetActive(info.Role == GatheringRule.eRole.GUEST && userInfo.IsSelf); - _friendRequestButton.gameObject.SetActive(userInfo.IsFriend == false && !userInfo.IsSelf && userInfo.IsFriendRequestSending == false); - _friendIcon.SetActive(userInfo.IsFriend.Value); - _friendRequestSending.SetActive(userInfo.IsFriendRequestSending.Value); - _kickButton.gameObject.SetActive(info.Role == GatheringRule.eRole.OWNER && !userInfo.IsSelf); - _friendRequestButton.onClick.Clear(); - _dropOutButton.onClick.Clear(); - _kickButton.onClick.Clear(); - _friendRequestButton.onClick.Add(new EventDelegate(delegate - { - OnClickFriendRequest.Call(userInfo); - })); - _dropOutButton.onClick.Add(new EventDelegate(delegate - { - OnClickDropOut.Call(); - })); - _kickButton.onClick.Add(new EventDelegate(delegate - { - OnClickKick.Call(userInfo); - })); - SystemText systemText = Data.SystemText; - _ownerOrGuestLabel.text = (userInfo.IsOwner ? systemText.Get("Gathering_Information_0013") : systemText.Get("Gathering_Member_0001")); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRanking.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRanking.cs deleted file mode 100644 index 9c5a3b9f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRanking.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringRanking : MonoBehaviour -{ - [SerializeField] - private GameObject _rankingPlateOriginal; - - [SerializeField] - private UIGrid _grid; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private GameObject _rootObject; - - [SerializeField] - private UILabel _ruleLabel; - - [SerializeField] - private UILabel _timeLabel; - - private List _loadedResourceList = new List(); - - private void Start() - { - _rankingPlateOriginal.SetActive(value: false); - UIManager.GetInstance().AttachAtlas(base.gameObject); - } - - public void Show(GatheringInfo info, GatheringJoining parent) - { - GatheringRule rule = info.Rule; - _rootObject.SetActive(value: false); - GatheringGetSelfInfoTask selfInfoTask = new GatheringGetSelfInfoTask(isDependGatheringInfo: true); - StartCoroutine(Toolbox.NetworkManager.Connect(selfInfoTask, delegate - { - if (!parent.CheckChangeStatus(selfInfoTask.Info)) - { - GatheringRankingTask task = new GatheringRankingTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _rootObject.SetActive(value: true); - StartCoroutine(InitRanking(task)); - })); - } - _timeLabel.text = Data.SystemText.Get("Gathering_Information_0014", info.BattleStartTime, info.FinishTime); - _ruleLabel.text = RoomRuleSetting.GetWinTypeString(rule.BattleParameterInstance.Rule) + " " + FormatBehaviorManager.GetFormatName(rule.BattleParameterInstance.DeckFormat); - })); - } - - public void OnDestroy() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private IEnumerator LoadImages(GatheringRankingTask task) - { - List list = new List(); - foreach (GatheringRankingTask.RankingUserInfo ranking in task.RankingList) - { - list.Add(ranking.gatheringUserInfo); - } - List list2 = new List(); - for (int i = 0; i < list.Count; i++) - { - list2.AddRange(list[i].GetUserAssetPathList()); - } - List loadPathList = list2.Distinct().Except(_loadedResourceList).ToList(); - if (loadPathList.Count > 0) - { - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null)); - _loadedResourceList.AddRange(loadPathList); - } - } - - private IEnumerator InitRanking(GatheringRankingTask task) - { - yield return LoadImages(task); - foreach (GatheringRankingTask.RankingUserInfo ranking in task.RankingList) - { - GatheringRankingPlate component = NGUITools.AddChild(_grid.gameObject, _rankingPlateOriginal).GetComponent(); - component.gameObject.SetActive(value: true); - component.Initialize(ranking); - } - _grid.Reposition(); - _scrollView.ResetPosition(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRankingPlate.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRankingPlate.cs deleted file mode 100644 index 0f789cd2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRankingPlate.cs +++ /dev/null @@ -1,49 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class GatheringRankingPlate : UserPlateBase -{ - private const string BG_RANK_1 = "ranking_plate_01"; - - private const string BG_RANK_2 = "ranking_plate_02"; - - private const string BG_RANK_3 = "ranking_plate_03"; - - private const string BG_RANK_OTHER = "ranking_plate_common"; - - [SerializeField] - private UILabel _winCount; - - [SerializeField] - private UILabel _ranking; - - [SerializeField] - private GameObject _youMark; - - [SerializeField] - private UISprite _bg; - - public void Initialize(GatheringRankingTask.RankingUserInfo userInfo) - { - InitializeBase(userInfo.gatheringUserInfo); - _winCount.text = Data.SystemText.Get("Gathering_Ranking_0001", userInfo.WinCount.ToString()); - _ranking.text = userInfo.Order.ToString(); - _youMark.SetActive(userInfo.gatheringUserInfo.IsSelf); - switch (userInfo.Order) - { - case 1: - _bg.spriteName = "ranking_plate_01"; - break; - case 2: - _bg.spriteName = "ranking_plate_02"; - break; - case 3: - _bg.spriteName = "ranking_plate_03"; - break; - default: - _bg.spriteName = "ranking_plate_common"; - break; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRankingTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRankingTask.cs deleted file mode 100644 index f5890b1a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRankingTask.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class GatheringRankingTask : BaseTask -{ - public class RankingUserInfo - { - public GatheringUserInfo gatheringUserInfo { get; private set; } - - public int Order { get; private set; } - - public int WinCount { get; private set; } - - public RankingUserInfo(JsonData data) - { - gatheringUserInfo = new GatheringUserInfo(data["user"]); - Order = data["rank"].ToInt(); - WinCount = data["score"].ToInt(); - } - } - - public List RankingList { get; private set; } - - public GatheringRankingTask() - { - base.type = ApiType.Type.GatheringRanking; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]["ranking"]; - RankingList = new List(); - for (int i = 0; i < jsonData.Count; i++) - { - RankingUserInfo item = new RankingUserInfo(jsonData[i]); - RankingList.Add(item); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInfoDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInfoDialog.cs deleted file mode 100644 index e4781625..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInfoDialog.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringReceiveInfoDialog : MonoBehaviour -{ - [SerializeField] - private GatheringRuleView _ruleView; - - private Action _onReject; - - private const int ADDITIONAL_DIALOG_DEPTH = 10; - - public static void Create(GameObject prefab, string id, Action onReject) - { - GatheringGetInfoTask task = new GatheringGetInfoTask(); - task.SetParameter(id); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - CreateDialog(prefab, task, onReject); - })); - } - - public static void CreateDialog(GameObject prefab, GatheringGetInfoTask task, Action onReject) - { - GatheringInfo info = task.Info; - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - UnityEngine.Object.Instantiate(prefab).GetComponent().Initialize(info, dialog, onReject); - } - - private void Initialize(GatheringInfo info, DialogBase dialog, Action onReject) - { - _onReject = onReject; - SystemText systemText = Data.SystemText; - dialog.SetObj(base.gameObject); - dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_RedBtn); - dialog.SetTitleLabel(systemText.Get("Gathering_Menu_0002")); - dialog.SetSize(DialogBase.Size.M); - dialog.SetButtonText(systemText.Get("Gathering_Join_0003"), systemText.Get("Gathering_Join_0004")); - dialog.onPushButton1 = delegate - { - OnClickJoinButton(info); - }; - dialog.onPushButton2 = delegate - { - _onReject.Call(); - }; - _ruleView.SetGatheringInfo(info); - } - - private static void OnClickJoinButton(GatheringInfo info) - { - if (info.Rule.IsEntryDeckOnly || info.Rule.IsTournament) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Gathering_0022")); - dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_0025")); - dialogBase.SetText(Data.SystemText.Get("Gathering_Join_0007")); - dialogBase.onPushButton1 = delegate - { - GatheringEntryConfirm.ShowDeckListDialog(info); - }; - } - else - { - GatheringEntryConfirm.EntryGathering(null, info); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInviteList.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInviteList.cs deleted file mode 100644 index 7e71f52e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringReceiveInviteList.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringReceiveInviteList : MonoBehaviour -{ - [SerializeField] - private SimpleScrollViewUI _inviteListScrollView; - - [SerializeField] - private GameObject _infoDialogPrefab; - - [SerializeField] - private GameObject _inviteNoneRoot; - - private List _loadedResourceList = new List(); - - private GatheringGetReceiveInviteTask _receiveInviteTask; - - private GatheringEntry _parent; - - public void Show(GatheringEntry parent) - { - _parent = parent; - _receiveInviteTask = new GatheringGetReceiveInviteTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(_receiveInviteTask, delegate - { - OnReceiveInfo(_receiveInviteTask); - })); - } - - public void OnDestroy() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private void OnReceiveInfo(GatheringGetReceiveInviteTask task) - { - _parent.UpdateInviteBadge(task); - _inviteNoneRoot.SetActive(task.InviteList.Count == 0); - UIManager.GetInstance()._Footer.UpdateArenaBadgeIcon(); - UpdateInviteList(task); - } - - private void InitializePlate(int index, GameObject plate) - { - UserListViewPlate component = plate.GetComponent(); - component.Initialize(_receiveInviteTask.InviteList[index].GatherintUserInfo, Data.SystemText.Get("Gathering_Menu_0002")); - component.OnAction = delegate - { - OnClickInviteGatheringInfoButton(_receiveInviteTask.InviteList[index]); - }; - } - - private void UpdateInviteList(GatheringGetReceiveInviteTask task) - { - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadImages(task, delegate - { - _inviteListScrollView.CreateScrollView(task.InviteList.Count, InitializePlate); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private IEnumerator LoadImages(GatheringGetReceiveInviteTask task, Action callBack = null) - { - List inviteList = task.InviteList; - List list = new List(); - for (int i = 0; i < inviteList.Count; i++) - { - GatheringUserInfo gatherintUserInfo = inviteList[i].GatherintUserInfo; - list.AddRange(gatherintUserInfo.GetUserAssetPathList()); - } - List loadPathList = list.Distinct().Except(_loadedResourceList).ToList(); - if (loadPathList.Count > 0) - { - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null)); - _loadedResourceList.AddRange(loadPathList); - } - callBack.Call(); - } - - private void OnClickInviteGatheringInfoButton(GatheringGetReceiveInviteTask.UserInfo userInfo) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - Action onReject = delegate - { - OnClickRejectInvite(userInfo); - }; - GatheringReceiveInfoDialog.Create(_infoDialogPrefab, userInfo.GatheringId, onReject); - } - - private void OnClickRejectInvite(GatheringGetReceiveInviteTask.UserInfo userInfo) - { - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Join_0005")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_Menu_0004")); - dialogBase.SetButtonText(Data.SystemText.Get("Gathering_Join_0004")); - dialogBase.onPushButton1 = delegate - { - InviteReject(userInfo); - }; - } - - private void InviteReject(GatheringGetReceiveInviteTask.UserInfo userInfo) - { - GatheringInviteRejectTask gatheringInviteRejectTask = new GatheringInviteRejectTask(); - gatheringInviteRejectTask.SetParameter(userInfo.InviteId); - StartCoroutine(Toolbox.NetworkManager.Connect(gatheringInviteRejectTask, delegate - { - UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Join_0006")).OnClose = delegate - { - _parent.ReOpenInvite(); - }; - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRoomEnterTournamentRoomTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRoomEnterTournamentRoomTask.cs deleted file mode 100644 index 71e0afb8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRoomEnterTournamentRoomTask.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Cute; - -namespace Wizard; - -public class GatheringRoomEnterTournamentRoomTask : BaseRoomBattleEnterRoomTask -{ - private GatheringInfo _gatheringInfo; - - public GatheringAutoJoinTaskInfo GatheringAutoJoinTaskInfo { get; private set; } - - public GatheringRoomEnterTournamentRoomTask(GatheringInfo gatheringInfo) - { - _gatheringInfo = gatheringInfo; - base.type = ApiType.Type.GatheringRoomEnterRoomForTournament; - } - - protected override int Parse() - { - if (base.ResponseData.TryGetValue("data", out var value) && value.IsObject && value.TryGetValue("is_owner", out var value2)) - { - bool flag = false; - if (value.TryGetValue("oppo_info", out var value3)) - { - flag = value3 != null; - } - if (value2.ToInt() != 0 && value.Keys.Contains("result_reason") && !flag) - { - value["result_reason"] = "-1"; - } - } - int num = base.Parse(); - if (num != 1) - { - return num; - } - GatheringAutoJoinTaskInfo = new GatheringAutoJoinTaskInfo(base.ResponseData, this, _gatheringInfo); - if (GatheringAutoJoinTaskInfo.IsOwner) - { - CustomPreference.SetNodeServerURL(value["node_server_url"].ToString()); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRoomEnterVacancyRoomTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRoomEnterVacancyRoomTask.cs deleted file mode 100644 index de4cae2a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRoomEnterVacancyRoomTask.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Cute; - -namespace Wizard; - -public class GatheringRoomEnterVacancyRoomTask : BaseRoomBattleEnterRoomTask -{ - private GatheringInfo _gatheringInfo; - - public GatheringAutoJoinTaskInfo GatheringAutoJoinTaskInfo { get; private set; } - - public GatheringRoomEnterVacancyRoomTask(GatheringInfo gatheringInfo) - { - _gatheringInfo = gatheringInfo; - base.type = ApiType.Type.GatheringRoomEnterVacancyRoom; - } - - protected override int Parse() - { - if (base.ResponseData.TryGetValue("data", out var value) && value.IsObject && value.TryGetValue("is_owner", out var value2) && value2.ToInt() != 0 && value.Keys.Contains("result_reason")) - { - value["result_reason"] = "-1"; - } - int num = base.Parse(); - if (num != 1) - { - return num; - } - GatheringAutoJoinTaskInfo = new GatheringAutoJoinTaskInfo(base.ResponseData, this, _gatheringInfo); - if (GatheringAutoJoinTaskInfo.NeedsRetry) - { - return num; - } - if (GatheringAutoJoinTaskInfo.IsOwner) - { - CustomPreference.SetNodeServerURL(value["node_server_url"].ToString()); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRule.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRule.cs deleted file mode 100644 index 5a21104f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRule.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using LitJson; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringRule -{ - public enum eRole - { - NONE, - OWNER, - GUEST - } - - public enum eWatchSetting - { - OWNER_ONLY = 1, - ALL_MEMBER, - NONE - } - - public enum eType - { - FREE_BATTLE = 1, - TOURNAMENT - } - - public enum eTournamentType - { - NONE, - SINGLE_ELIMINATION, - DOUBLE_ELIMINATION - } - - public const int DEFAULT_DECK_ENTRY_MINUTE = 5; - - public const int ID_NUMBER_OF_DIGIT = 6; - - public const int DEFAULT_MAX_MEMBER = 2; - - public const int DEFAULT_BATTLE_HOUR = 1; - - public const eWatchSetting DEFAULT_WATCH_SETTING = eWatchSetting.OWNER_ONLY; - - public bool IsReset; - - public eType Type { get; set; } = eType.FREE_BATTLE; - - public eTournamentType TournamentType { get; set; } - - public bool IsTournament - { - get - { - if (TournamentType != eTournamentType.SINGLE_ELIMINATION) - { - return TournamentType == eTournamentType.DOUBLE_ELIMINATION; - } - return true; - } - } - - public int MaxMember { get; set; } = 2; - - public BattleParameter BattleParameterInstance { get; private set; } - - public int BattleTimeHour { get; set; } = 1; - - public DateTime BattleStartLocalTime - { - get - { - return ConvertTime.ToLocalByDateTime(BattleStartUtcTime); - } - set - { - BattleStartUtcTime = ConvertTime.LocalToUtc(value); - } - } - - public DateTime BattleStartUtcTime { get; private set; } - - public bool IsOwnerEntryBattle { get; set; } = true; - - public bool IsEntryDeckOnly { get; set; } - - public eWatchSetting WatchSetting { get; set; } = eWatchSetting.OWNER_ONLY; - - public string GetGatheringTypeString() - { - return GatheringUtility.GetGatheringTypeString(Type, TournamentType, IsReset); - } - - public string GetGatheringResetString() - { - if (!IsReset) - { - return "仮リセットなし"; - } - return "仮リセットあり"; - } - - public GatheringRule() - { - } - - public GatheringRule(JsonData data, JsonData config) - { - BattleParameterInstance = BattleParameter.JsonToBattleParameter(data); - MaxMember = data["join_member_limit"].ToInt(); - IsOwnerEntryBattle = data["is_master_joined"].ToInt() == 1; - WatchSetting = (eWatchSetting)data["watch_type"].ToInt(); - Type = (eType)data["gathering_type"].ToInt(); - if (Type == eType.TOURNAMENT) - { - IsEntryDeckOnly = true; - } - else if (config.Keys.Contains("is_deck_entry")) - { - IsEntryDeckOnly = config["is_deck_entry"].ToInt() == 1; - } - if (config.TryGetValue("format", out var value)) - { - TournamentType = (eTournamentType)value.ToInt(); - } - if (config.TryGetValue("is_reset", out var value2)) - { - IsReset = value2.ToInt() == 1; - } - } - - public void SaveToPlayerPrefs() - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_MAX_MEMBER, MaxMember); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_FORMAT, (int)BattleParameterInstance.DeckFormat); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_BATTLE_STYLE, (int)BattleParameterInstance.Rule); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_BATTLE_TYPE, (int)Type); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_BATTLE_TORNAMENT_TYPE, (int)TournamentType); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.GATHERING_IS_RESET, IsReset); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.GATHERING_OWNER_ENTRY_BATTLE, IsOwnerEntryBattle); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_WATCH_SETTING, (int)WatchSetting); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.GATHERING_BATTLE_HOUR, BattleTimeHour); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.GATHERING_IS_ENTRY_DECK_ONLY, IsEntryDeckOnly); - } - - public void LoadFromPlayerPrefs() - { - MaxMember = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_MAX_MEMBER); - Format format = (Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_FORMAT); - if (format == Format.PreRotation && Prerelease.Status != Prerelease.eStatus.PRE_ROTATION) - { - format = Format.Rotation; - } - if (format == Format.Crossover && (!Data.Crossover.IsWithinGatheringPeriod || Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.ROOM_FORMAT_CROSSOVER))) - { - format = Format.Rotation; - } - else if (format == Format.MyRotation && (!Data.MyRotationAllInfo.IsWithinGatheringPeriod || Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_MYROTATION))) - { - format = Format.Rotation; - } - else if (format == Format.Avatar && (!Data.AvatarBattleAllInfo.IsWithinGatheringPeriod || Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.GATHERING_AVATAR))) - { - format = Format.Rotation; - } - BattleParameterInstance = new BattleParameter(NetworkDefine.ServerBattleType.Gathering, format, TwoPickFormat.None, (RoomConnectController.BattleRule)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_BATTLE_STYLE), isOpenDeckRoom: false); - IsOwnerEntryBattle = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.GATHERING_OWNER_ENTRY_BATTLE); - WatchSetting = (eWatchSetting)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_WATCH_SETTING); - BattleTimeHour = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_BATTLE_HOUR); - IsEntryDeckOnly = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.GATHERING_IS_ENTRY_DECK_ONLY); - Type = (eType)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_BATTLE_TYPE); - TournamentType = (eTournamentType)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.GATHERING_BATTLE_TORNAMENT_TYPE); - IsReset = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.GATHERING_IS_RESET); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringRuleView.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringRuleView.cs deleted file mode 100644 index c385b0c7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringRuleView.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringRuleView : MonoBehaviour -{ - [SerializeField] - private UILabel _baseType; - - [SerializeField] - private UILabel _baseRule; - - [SerializeField] - private UILabel _memberCount; - - [SerializeField] - private UILabel _ownerName; - - [SerializeField] - private UILabel _ownerIsEntryBattle; - - [SerializeField] - private UILabel _ownerWatchBattle; - - [SerializeField] - private UILabel _timeTitle; - - [SerializeField] - private UILabel _startTime; - - [SerializeField] - private UILabel _endTime; - - [SerializeField] - private UILabel _battlePeriodLabel; - - [SerializeField] - private UILabel _battlePeriodLabelSingleLine; - - [SerializeField] - private UILabel _isDeckEntryLabel; - - [SerializeField] - private GameObject _isDeckEntryRoot; - - [SerializeField] - private UILabel _id; - - [SerializeField] - private UserPlateBase _ownerPlate; - - private List _loadResourcePath = new List(); - - public void SetGatheringInfo(GatheringInfo info) - { - SystemText systemText = Data.SystemText; - SetRule(info.Rule, info.CurrentMemberCount); - if (_baseType != null) - { - _baseType.text = GatheringUtility.GetGatheringTypeString(info); - } - if (_id != null) - { - _id.text = info.Id; - } - if (_ownerName != null) - { - _ownerName.text = info.OwnerInfo.Name; - } - if (_timeTitle != null) - { - _timeTitle.text = (info.Rule.IsTournament ? systemText.Get("Gathering_0009") : systemText.Get("Gathering_0012")); - } - if (_startTime != null) - { - _startTime.text = info.BattleStartTime; - } - if (_endTime != null) - { - _endTime.text = info.FinishTime; - } - if (_battlePeriodLabel != null && !info.Rule.IsTournament) - { - _battlePeriodLabel.text = systemText.Get("Gathering_Information_0005", info.BattleStartTime, info.FinishTime); - } - if (_battlePeriodLabelSingleLine != null && !info.Rule.IsTournament) - { - _battlePeriodLabelSingleLine.text = systemText.Get("Gathering_Information_0014", info.BattleStartTime, info.FinishTime); - } - if (_ownerWatchBattle != null) - { - switch (info.Rule.WatchSetting) - { - case GatheringRule.eWatchSetting.ALL_MEMBER: - _ownerWatchBattle.text = systemText.Get("Gathering_0016"); - break; - case GatheringRule.eWatchSetting.OWNER_ONLY: - _ownerWatchBattle.text = systemText.Get("Gathering_0015"); - break; - case GatheringRule.eWatchSetting.NONE: - _ownerWatchBattle.text = systemText.Get("Gathering_0017"); - break; - } - } - List loadResourceList = info.OwnerInfo.GetUserAssetPathList().Except(_loadResourcePath).ToList(); - UIManager.GetInstance().StartCoroutine(LoadResource(info, loadResourceList)); - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadResourcePath); - _loadResourcePath.Clear(); - } - - private IEnumerator LoadResource(GatheringInfo info, List loadResourceList) - { - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadResourceList, delegate - { - _loadResourcePath.AddRange(loadResourceList); - })); - if (_ownerPlate != null) - { - _ownerPlate.InitializeSimplePlate(info.OwnerInfo); - } - } - - private void SetRule(GatheringRule rule, int memberCount) - { - SystemText systemText = Data.SystemText; - _baseRule.text = RoomRuleSetting.GetWinTypeString(rule.BattleParameterInstance.Rule) + " " + FormatBehaviorManager.GetFormatName(rule.BattleParameterInstance.DeckFormat); - _memberCount.text = systemText.Get("Gathering_Information_0003", memberCount.ToString(), rule.MaxMember.ToString()); - if (_ownerIsEntryBattle != null) - { - _ownerIsEntryBattle.text = (rule.IsOwnerEntryBattle ? systemText.Get("Gathering_Information_0008") : systemText.Get("Gathering_Information_0009")); - } - if (_isDeckEntryRoot != null) - { - _isDeckEntryRoot.SetActive(!rule.IsTournament); - } - if (_isDeckEntryLabel != null) - { - _isDeckEntryLabel.text = (rule.IsEntryDeckOnly ? systemText.Get("Gathering_Information_0022") : systemText.Get("Gathering_Information_0023")); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringSettingDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringSettingDialog.cs deleted file mode 100644 index 57e799c8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringSettingDialog.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringSettingDialog : MonoBehaviour -{ - [SerializeField] - private GatheringRuleView _ruleView; - - [SerializeField] - private UIButton _stopButton; - - private const int ADDITIONAL_DIALOG_DEPTH = 15; - - private DialogBase _dialog; - - public static void Create(GameObject prefab, GatheringInfo info) - { - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - Object.Instantiate(prefab).GetComponent().Initialize(info, dialog); - } - - private void Initialize(GatheringInfo info, DialogBase dialog) - { - _dialog = dialog; - dialog.SetObj(base.gameObject); - dialog.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialog.SetTitleLabel(Data.SystemText.Get("Gathering_Information_0012")); - dialog.SetSize(DialogBase.Size.M); - _ruleView.SetGatheringInfo(info); - } - - private void Start() - { - _stopButton.onClick.Add(new EventDelegate(delegate - { - OnClickStopButton(); - })); - } - - private void OnClickStopButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - SystemText systemText = Data.SystemText; - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Gathering_Information_0018"), systemText.Get("Common_0005")); - dialogBase.SetText(systemText.Get("Gathering_Information_0017")); - dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_Information_0020")); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetPanelDepth(15); - dialogBase.onPushButton1 = delegate - { - StopGathering(); - }; - } - - private void StopGathering() - { - GatheringInterruptTask task = new GatheringInterruptTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _dialog.SetActive(inActive: false); - DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Information_0019")); - dialogBase.SetPanelDepth(15); - dialogBase.OnCloseStart = delegate - { - Gathering.BackToMyPageForDrop(); - }; - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringStartTimeSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringStartTimeSelectDialog.cs deleted file mode 100644 index 3306fe7c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringStartTimeSelectDialog.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class GatheringStartTimeSelectDialog : MonoBehaviour -{ - [SerializeField] - private UtilityDrumrollScroll _daySelectDrum; - - [SerializeField] - private UtilityDrumrollScroll _hourSelectDrum; - - [SerializeField] - private UtilityDrumrollScroll _minuteSelectDrum; - - [SerializeField] - private UtilityDrumrollScroll _amPmSelectDrum; - - [SerializeField] - private UIPanel[] _alphaAnimationPanel; - - [SerializeField] - private GameObject _daySelectArrowUp; - - [SerializeField] - private GameObject _daySelectArrowDown; - - [SerializeField] - private GameObject _hourSelectArrowUp; - - [SerializeField] - private GameObject _hourSelectArrowDown; - - [SerializeField] - private GameObject _minuteSelectArrowUp; - - [SerializeField] - private GameObject _minuteSelectArrowDown; - - [SerializeField] - private GameObject _ampmSelectArrowUp; - - [SerializeField] - private GameObject _ampmSelectArrowDown; - - [SerializeField] - private GameObject _amPmSelectRoot; - - [SerializeField] - private GameObject _rootObject; - - private DialogBase _parentDialog; - - private List _dayList = new List(); - - private List _hourList = new List(); - - private List _minuteList = new List(); - - private DateTime _selectDay; - - private int _selectHour; - - private int _selectMinute; - - private bool _isAm; - - private readonly Vector3 ENG_ROOT_POSITION = new Vector3(-65f, 0f, 0f); - - private const int DAY_SELECT_LIMIT = 5; - - public const int MINUTE_SELECT_INTERVAL = 15; - - public const int DEFAULT_START_TIME_MINUTE = 16; - - private const int AM_INDEX = 0; - - private const int PM_INDEX = 1; - - private int SelectHour - { - get - { - if (!IsEnableAmPmSelect) - { - return _selectHour; - } - if (_selectHour == 12) - { - if (!_isAm) - { - return 12; - } - return 0; - } - if (_isAm) - { - return _selectHour; - } - return _selectHour + 12; - } - } - - private DateTime SelectTime => new DateTime(_selectDay.Year, _selectDay.Month, _selectDay.Day, SelectHour, _selectMinute, 0); - - private bool IsEnableAmPmSelect => CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Eng.ToString(); - - public static DialogBase Create(GameObject prefab, Action onDecide, DateTime defaultTime) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(14); - dialogBase.SetTitleLabel(Data.SystemText.Get("MyPage_0082")); - GatheringStartTimeSelectDialog startDialog = UnityEngine.Object.Instantiate(prefab).GetComponent(); - dialogBase.SetObj(startDialog.gameObject); - startDialog.Initialize(defaultTime, dialogBase); - dialogBase.onPushButton1 = delegate - { - onDecide(startDialog.SelectTime); - }; - return dialogBase; - } - - private void Initialize(DateTime defaultTime, DialogBase parent) - { - _parentDialog = parent; - InitializeDaySelectDrum(defaultTime); - InitializeHourSelectDrum(defaultTime); - InitializeMinuteSelectDrum(defaultTime); - if (IsEnableAmPmSelect) - { - _rootObject.transform.localPosition = ENG_ROOT_POSITION; - InitializeAmPmSelectDrum(); - } - _amPmSelectRoot.SetActive(IsEnableAmPmSelect); - } - - private void InitializeDaySelectDrum(DateTime defaultTime) - { - int num = 0; - List list = new List(); - DateTime item = PlayerStaticData.UserTime.GetNowTime().AddMinutes(15.0); - string text = Data.SystemText.Get("System_DateLong"); - CultureInfo cultureInfo = new CultureInfo(Data.SystemText.Get("System_CultureInfo"), useUserOverride: false); - for (int i = 0; i < 5; i++) - { - int year = item.Year; - int month = item.Month; - int day = item.Day; - if (year == defaultTime.Year && month == defaultTime.Month && day == defaultTime.Day) - { - num = i; - } - list.Add(item.ToString(text, cultureInfo)); - _dayList.Add(item); - item = item.AddDays(1.0); - } - _selectDay = _dayList[num]; - DaySelectCallBack(num); - StartCoroutine(_daySelectDrum.CreateDrumrollScroll_Coroutine(list, num, DaySelectCallBack)); - } - - private void InitializeHourSelectDrum(DateTime defaultTime) - { - int num = 0; - List list = new List(); - int num2 = 0; - int num3 = 23; - int num4 = defaultTime.Hour; - if (IsEnableAmPmSelect) - { - num2 = 1; - num3 = 12; - _isAm = true; - if (num4 == 0) - { - num4 = 12; - } - else if (num4 == 12) - { - _isAm = false; - } - else if (num4 > 12) - { - num4 -= 12; - _isAm = false; - } - } - for (int i = num2; i <= num3; i++) - { - list.Add(i.ToString("00")); - if (i == num4) - { - num = i - num2; - } - _hourList.Add(i); - } - _selectHour = _hourList[num]; - HourSelectCallBack(num); - StartCoroutine(_hourSelectDrum.CreateDrumrollScroll_Coroutine(list, num, HourSelectCallBack)); - } - - private void InitializeMinuteSelectDrum(DateTime defaultTime) - { - int num = 0; - List list = new List(); - for (int i = 0; i < 60; i += 15) - { - list.Add(i.ToString("00")); - if (i == defaultTime.Minute) - { - num = i / 15; - } - _minuteList.Add(i); - } - _selectMinute = _minuteList[num]; - MinuteSelectCallback(num); - StartCoroutine(_minuteSelectDrum.CreateDrumrollScroll_Coroutine(list, num, MinuteSelectCallback)); - } - - private void DaySelectCallBack(int index) - { - _selectDay = _dayList[index]; - _daySelectArrowUp.SetActive(index > 0); - _daySelectArrowDown.SetActive(index < _dayList.Count - 1); - } - - private void HourSelectCallBack(int index) - { - _selectHour = _hourList[index]; - _hourSelectArrowUp.SetActive(index > 0); - _hourSelectArrowDown.SetActive(index < _hourList.Count - 1); - } - - private void MinuteSelectCallback(int index) - { - _selectMinute = _minuteList[index]; - _minuteSelectArrowUp.SetActive(index > 0); - _minuteSelectArrowDown.SetActive(index < _minuteList.Count - 1); - } - - private void InitializeAmPmSelectDrum() - { - int num = ((!_isAm) ? 1 : 0); - List list = new List(); - list.Add(Data.SystemText.Get("System_0059")); - list.Add(Data.SystemText.Get("System_0060")); - StartCoroutine(_amPmSelectDrum.CreateDrumrollScroll_Coroutine(list, num, AmPmSelectCallBack)); - AmPmSelectCallBack(num); - } - - private void AmPmSelectCallBack(int index) - { - _isAm = index == 0; - _ampmSelectArrowUp.SetActive(index != 0); - _ampmSelectArrowDown.SetActive(index == 0); - } - - private void Update() - { - float panelAlpha = _parentDialog.PanelAlpha; - UIPanel[] alphaAnimationPanel = _alphaAnimationPanel; - foreach (UIPanel uIPanel in alphaAnimationPanel) - { - if (uIPanel != null) - { - uIPanel.alpha = panelAlpha; - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringTornamentCreateTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringTornamentCreateTask.cs deleted file mode 100644 index 98fd1ee0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringTornamentCreateTask.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class GatheringTornamentCreateTask : BaseTask -{ - public class DeckEntry - { - public int deck_no; - - public string deck_name; - - public DeckEntry(DeckData deck) - { - deck_no = deck.GetDeckID(); - deck_name = deck.GetDeckName(); - } - } - - public class TornamentGatheringCreateTaskParam : BaseParam - { - public int gathering_type; - - public int is_reset; - - public int join_member_limit; - - public int is_master_joined; - - public int deck_format; - - public int battle_type; - - public int watch_type; - - public long battle_begin_timestamp; - - public Dictionary deck_list = new Dictionary(); - - public int tournament_format; - } - - public GatheringTornamentCreateTask() - { - base.type = ApiType.Type.GatheringCreate; - } - - public void SetParameter(GatheringRule rule, List deckList) - { - TornamentGatheringCreateTaskParam tornamentGatheringCreateTaskParam = new TornamentGatheringCreateTaskParam(); - tornamentGatheringCreateTaskParam.gathering_type = (int)rule.Type; - tornamentGatheringCreateTaskParam.join_member_limit = rule.MaxMember; - tornamentGatheringCreateTaskParam.is_master_joined = (rule.IsOwnerEntryBattle ? 1 : 0); - tornamentGatheringCreateTaskParam.deck_format = Data.FormatConvertApi(rule.BattleParameterInstance.DeckFormat); - tornamentGatheringCreateTaskParam.battle_type = (int)rule.BattleParameterInstance.Rule; - tornamentGatheringCreateTaskParam.watch_type = (int)rule.WatchSetting; - tornamentGatheringCreateTaskParam.battle_begin_timestamp = (long)ConvertTime.DateTimeToUnixTime(rule.BattleStartUtcTime); - if (deckList != null) - { - for (int i = 0; i < deckList.Count; i++) - { - tornamentGatheringCreateTaskParam.deck_list[i.ToString()] = new DeckEntry(deckList[i]); - } - } - tornamentGatheringCreateTaskParam.tournament_format = (int)rule.TournamentType; - if (rule.TournamentType == GatheringRule.eTournamentType.DOUBLE_ELIMINATION) - { - tornamentGatheringCreateTaskParam.is_reset = (rule.IsReset ? 1 : 0); - } - else - { - tornamentGatheringCreateTaskParam.is_reset = 0; - } - base.Params = tornamentGatheringCreateTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringTournament.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringTournament.cs deleted file mode 100644 index c26f2fe1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringTournament.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringTournament : MonoBehaviour -{ - private enum DoubleTab - { - Winners, - Losers - } - - [SerializeField] - private GameObject _originalTournament; - - [SerializeField] - private GameObject _tournamentRoot; - - [SerializeField] - private UILabel _ruleLabel; - - [SerializeField] - private GameObject _singleRoot; - - [SerializeField] - private GameObject _doubleRoot; - - [SerializeField] - private UIButton _winnersButton; - - [SerializeField] - private UIButton _losersButton; - - [SerializeField] - private GameObject _messageRoot; - - [SerializeField] - private UILabel _messageLabel; - - private List _tournamentControllers; - - private List _tournamentDataList; - - private List _resourceList; - - private DoubleTab _doubleTab; - - public void Show(GatheringInfo info, GatheringJoining parent) - { - UIManager.GetInstance().AttachAtlas(base.gameObject); - _originalTournament.SetActive(value: false); - _singleRoot.SetActive(value: false); - _doubleRoot.SetActive(value: false); - _ruleLabel.text = RoomRuleSetting.GetWinTypeString(info.Rule.BattleParameterInstance.Rule) + " " + FormatBehaviorManager.GetFormatName(info.Rule.BattleParameterInstance.DeckFormat); - GatheringGetSelfInfoTask task = new GatheringGetSelfInfoTask(isDependGatheringInfo: true); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - GatheringTournamentInfoTask tournamentInfoTask = new GatheringTournamentInfoTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(tournamentInfoTask, delegate - { - if (tournamentInfoTask.TournamentDataList != null) - { - Setup(tournamentInfoTask.TournamentDataList, info); - } - else - { - SetMessage(Data.SystemText.Get("Gathering_Tournament_0009")); - } - })); - })); - } - - private void Setup(List tournamentDataList, GatheringInfo info) - { - _tournamentDataList = tournamentDataList; - _tournamentRoot.SetActive(value: true); - _messageRoot.SetActive(value: false); - bool flag = !info.OwnerInfo.IsSelf || info.Rule.IsOwnerEntryBattle; - _doubleTab = GetCurrentTabAndCell(out var currentCells, tournamentDataList, flag); - if (flag && currentCells.All((TournamentCellData c) => c == null)) - { - _doubleTab = GetCurrentTabAndCell(out currentCells, tournamentDataList, isEntry: false); - } - SetupTournamentType(info.Rule.TournamentType); - _resourceList = CollectResourcePath(tournamentDataList); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_resourceList, delegate - { - _originalTournament.SetActive(value: true); - _tournamentControllers = new List(tournamentDataList.Count); - for (int i = 0; i < tournamentDataList.Count; i++) - { - TournamentController componentInChildren = NGUITools.AddChild(_tournamentRoot, _originalTournament).GetComponentInChildren(); - _tournamentControllers.Add(componentInChildren); - StartCoroutine(componentInChildren.Setup(tournamentDataList[i], currentCells[i], info, i == (int)_doubleTab)); - } - _originalTournament.SetActive(value: false); - })); - } - - private void SetupTournamentType(GatheringRule.eTournamentType type) - { - _singleRoot.SetActive(type == GatheringRule.eTournamentType.SINGLE_ELIMINATION); - _doubleRoot.SetActive(type == GatheringRule.eTournamentType.DOUBLE_ELIMINATION); - _winnersButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetDoubleTab(DoubleTab.Winners); - })); - _losersButton.onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SetDoubleTab(DoubleTab.Losers); - })); - UpdateDoubleTab(); - } - - private DoubleTab GetCurrentTabAndCell(out List currentCells, List tournamentDataList, bool isEntry) - { - currentCells = new List(tournamentDataList.Count); - foreach (TournamentData tournamentData in tournamentDataList) - { - bool flag = false; - for (int num = tournamentData.Rounds.Count - 1; num >= 0; num--) - { - foreach (TournamentCellData cell in tournamentData.Rounds[num].Cells) - { - if (IsCurrentCell(cell)) - { - currentCells.Add(cell); - flag = true; - break; - } - } - if (flag) - { - break; - } - } - if (!flag) - { - currentCells.Add(null); - } - } - if (currentCells.Count > 1) - { - if (currentCells[0] == null) - { - return DoubleTab.Winners; - } - if (currentCells[0].Round == tournamentDataList[0].Rounds[tournamentDataList[0].Rounds.Count - 2]) - { - return DoubleTab.Winners; - } - if (currentCells[0].State != TournamentCellData.CellState.Lose || currentCells[1] == null) - { - return DoubleTab.Winners; - } - return DoubleTab.Losers; - } - return DoubleTab.Winners; - bool IsCurrentCell(TournamentCellData targetCell) - { - if (targetCell == null) - { - return false; - } - TournamentCellData.CellState state = targetCell.State; - if (state == TournamentCellData.CellState.Unresolved || state == TournamentCellData.CellState.Active || state == TournamentCellData.CellState.Win || state == TournamentCellData.CellState.Lose) - { - if (isEntry) - { - return targetCell.ViewerId == PlayerStaticData.UserViewerID; - } - return true; - } - return false; - } - } - - private void UpdateDoubleTab() - { - _winnersButton.normalSprite = ((_doubleTab == DoubleTab.Winners) ? "pilltab_02_left_on" : "pilltab_02_left_off"); - _losersButton.normalSprite = ((_doubleTab == DoubleTab.Losers) ? "pilltab_02_right_on" : "pilltab_02_right_off"); - } - - private void SetDoubleTab(DoubleTab tab) - { - if (_doubleTab != tab) - { - _doubleTab = tab; - UpdateDoubleTab(); - for (int i = 0; i < _tournamentControllers.Count; i++) - { - _tournamentControllers[i].SetVisible(i == (int)tab); - } - } - } - - private List CollectResourcePath(List dataList) - { - List resourceList = new List(); - foreach (TournamentData data in dataList) - { - data.CollectResourcePath(ref resourceList); - } - return resourceList; - } - - private void OnDestroy() - { - if (_resourceList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_resourceList); - _resourceList.Clear(); - } - } - - private void SetMessage(string message) - { - _tournamentRoot.SetActive(value: false); - _messageRoot.SetActive(value: true); - _messageLabel.text = message; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringTournamentInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringTournamentInfoTask.cs deleted file mode 100644 index ef385e47..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringTournamentInfoTask.cs +++ /dev/null @@ -1,304 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using LitJson; - -namespace Wizard; - -public class GatheringTournamentInfoTask : BaseTask -{ - private class Match - { - public int MatchId; - - public int ParentMatchId; - - public int ParentMatchUserIndex; - - public int Status; - - public int ViewerId1; - - public int ViewerId2; - - public int WinnerViewerId; - - public int RoomId; - - public bool IsForceLose1; - - public bool IsForceLose2; - - public bool IsForceLoseWinner; - - public bool IsExtra; - - public bool IsFinalMatchReset; - - public bool IsActive - { - get - { - if (ViewerId1 > 0 && ViewerId2 > 0) - { - return WinnerViewerId == 0; - } - return false; - } - } - } - - public List TournamentDataList { get; private set; } - - public GatheringTournamentInfoTask() - { - base.type = ApiType.Type.GatheringTournamentInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - TournamentDataList = ParseTournamentDataList(base.ResponseData["data"]); - return num; - } - - private List ParseTournamentDataList(JsonData data) - { - if (data == null) - { - return null; - } - Dictionary userInfo = CollectUserInfo(data); - List list = new List(); - if (data.TryGetValue("1", out var value)) - { - list.Add(ParseTournamentData(value, isWinners: true, userInfo)); - } - if (data.TryGetValue("2", out var value2)) - { - list.Add(ParseTournamentData(value2, isWinners: false, userInfo)); - } - return list; - } - - private TournamentData ParseTournamentData(JsonData data, bool isWinners, Dictionary userInfo) - { - Match[][] matches = ConvertToMatch(data); - Dictionary cellMatchIdDict = new Dictionary(); - TournamentData tournamentData = new TournamentData(); - int num = matches.Length + 1; - List list = (tournamentData.Rounds = new List(num)); - for (int i = 0; i < num; i++) - { - TournamentRoundData item = new TournamentRoundData - { - RoundNo = i + 1, - Cells = new List(), - Watchs = new List() - }; - list.Add(item); - } - Match match = matches[matches.Length - 1][0]; - TournamentCellData.CellState cellState = GetCellState(match, match.WinnerViewerId, match.IsForceLoseWinner); - CreateCell(list[num - 1], match.WinnerViewerId, match.MatchId, cellState, isWinners).IsTerminal = true; - int i2 = matches.Length - 1; - while (i2 >= 0) - { - Match[] source = matches[i2]; - TournamentRoundData tournamentRoundData = list[i2 + 1]; - TournamentRoundData tournamentRoundData2 = list[i2]; - foreach (TournamentCellData cell in tournamentRoundData.Cells) - { - if (cell == null || !cellMatchIdDict.ContainsKey(cell)) - { - continue; - } - int matchId = cellMatchIdDict[cell]; - Match match2 = source.FirstOrDefault((Match m) => m.MatchId == matchId); - TournamentCellData tournamentCellData = CreateCell(tournamentRoundData2, match2.ViewerId1, GetChildMatchId(1), GetCellState(match2, match2.ViewerId1, match2.IsForceLose1), isChampion: false); - tournamentCellData.Line = TournamentCellData.LineType.Down; - tournamentCellData.Parent = cell; - tournamentCellData.IsFinalMatchReset = false; - TournamentCellData tournamentCellData2 = CreateCell(tournamentRoundData2, match2.ViewerId2, GetChildMatchId(2), GetCellState(match2, match2.ViewerId2, match2.IsForceLose2), isChampion: false); - tournamentCellData2.Line = TournamentCellData.LineType.Up; - tournamentCellData2.Parent = cell; - tournamentCellData2.IsFinalMatchReset = match2.IsFinalMatchReset; - cell.Children = new TournamentCellData[2] { tournamentCellData, tournamentCellData2 }; - tournamentRoundData2.IsExtraRound = match2.IsExtra; - if (match2.RoomId > 0) - { - CreateWatch(tournamentRoundData2, match2); - } - if (match2.IsExtra) - { - i2--; - match2 = matches[i2][0]; - matchId = match2.MatchId; - tournamentRoundData2 = list[i2]; - tournamentCellData = CreateCell(tournamentRoundData2, match2.ViewerId1, GetChildMatchId(1), GetCellState(match2, match2.ViewerId1, match2.IsForceLose1), isChampion: false); - tournamentCellData.Line = TournamentCellData.LineType.Down; - tournamentCellData.IsPreExtra = true; - tournamentCellData2 = CreateCell(tournamentRoundData2, match2.ViewerId2, GetChildMatchId(2), GetCellState(match2, match2.ViewerId2, match2.IsForceLose2), isChampion: false); - tournamentCellData2.Line = TournamentCellData.LineType.Up; - tournamentCellData2.IsPreExtra = true; - if (match2.RoomId > 0) - { - CreateWatch(tournamentRoundData2, match2); - } - } - int GetChildMatchId(int parentMatchUserIndex) - { - if (i2 == 0) - { - return 0; - } - return matches[i2 - 1].FirstOrDefault((Match m) => m.ParentMatchId == matchId && m.ParentMatchUserIndex == parentMatchUserIndex)?.MatchId ?? 0; - } - } - int num2 = i2 - 1; - i2 = num2; - } - return tournamentData; - TournamentCellData CreateCell(TournamentRoundData round, int viewerId, int num3, TournamentCellData.CellState state, bool isChampion) - { - TournamentCellData tournamentCellData3 = new TournamentCellData - { - State = state - }; - (string, long) tuple = userInfo[viewerId]; - tournamentCellData3.Name = tuple.Item1; - tournamentCellData3.EmblemId = tuple.Item2; - tournamentCellData3.ViewerId = viewerId; - tournamentCellData3.IsChampion = isChampion; - tournamentCellData3.Round = round; - round.Cells.Add(tournamentCellData3); - if (num3 > 0) - { - cellMatchIdDict.Add(tournamentCellData3, num3); - } - return tournamentCellData3; - } - static TournamentWatchData CreateWatch(TournamentRoundData round, Match match3) - { - TournamentWatchData tournamentWatchData = new TournamentWatchData - { - RoomId = match3.RoomId, - ViewerId0 = match3.ViewerId1, - ViewerId1 = match3.ViewerId2 - }; - round.Watchs.Add(tournamentWatchData); - return tournamentWatchData; - } - } - - private TournamentCellData.CellState GetCellState(Match match, int viewerId, bool isForceLose) - { - if (isForceLose) - { - if (viewerId != 0) - { - return TournamentCellData.CellState.LoseByDefault; - } - return TournamentCellData.CellState.Blank; - } - if (match.Status == 5) - { - if (viewerId == 0) - { - return TournamentCellData.CellState.LoseByDefault; - } - if (match.WinnerViewerId != viewerId) - { - return TournamentCellData.CellState.Lose; - } - return TournamentCellData.CellState.Win; - } - if (viewerId == 0) - { - return TournamentCellData.CellState.Blank; - } - if (match.IsActive) - { - return TournamentCellData.CellState.Active; - } - return TournamentCellData.CellState.Unresolved; - } - - private Dictionary CollectUserInfo(JsonData data) - { - Dictionary dictionary = new Dictionary { - { - 0, - (string.Empty, 0L) - } }; - foreach (string key2 in data.Keys) - { - JsonData jsonData = data[key2]; - foreach (string key3 in jsonData.Keys) - { - JsonData jsonData2 = jsonData[key3]; - for (int i = 0; i < jsonData2.Count; i++) - { - JsonData jsonData3 = jsonData2[i]; - Add(jsonData3["user1"], dictionary); - Add(jsonData3["user2"], dictionary); - } - } - } - return dictionary; - static void Add(JsonData userData, Dictionary dict) - { - if (userData != null) - { - int key = userData["viewer_id"].ToInt(); - if (!dict.ContainsKey(key)) - { - string item = userData["name"].ToString(); - long item2 = userData["emblem_id"].ToLong(); - dict.Add(key, (item, item2)); - } - } - } - } - - private Match[][] ConvertToMatch(JsonData data) - { - Match[][] array = new Match[data.Count][]; - for (int i = 0; i < data.Count; i++) - { - JsonData jsonData = data[(i + 1).ToString()]; - Match[] array2 = new Match[jsonData.Count]; - for (int j = 0; j < jsonData.Count; j++) - { - JsonData jsonData2 = jsonData[j]; - bool isFinalMatchReset = false; - if (jsonData2.TryGetValue("is_show_one_more_win", out var value)) - { - isFinalMatchReset = value.ToInt() == 1; - } - Match match = new Match - { - MatchId = jsonData2["matching_id"].ToInt(), - ParentMatchId = jsonData2["winner_parent_matching_id"].ToInt(), - ParentMatchUserIndex = jsonData2["winner_parent_matching_viewer_id_suffix"].ToInt(), - Status = jsonData2["status"].ToInt(), - ViewerId1 = jsonData2["viewer_id1"].ToInt(), - ViewerId2 = jsonData2["viewer_id2"].ToInt(), - WinnerViewerId = jsonData2["winner_viewer_id"].ToInt(), - RoomId = jsonData2["display_room_id"].ToInt(), - IsForceLose1 = (jsonData2["is_force_lose1"].ToInt() == 1), - IsForceLose2 = (jsonData2["is_force_lose2"].ToInt() == 1), - IsExtra = (jsonData2["side_type"].ToInt() == 3), - IsFinalMatchReset = isFinalMatchReset - }; - match.IsForceLoseWinner = ((match.ViewerId1 == match.WinnerViewerId) ? match.IsForceLose1 : match.IsForceLose2); - array2[j] = match; - } - array[i] = array2; - } - return array; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringUpdateDescriptionTask.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringUpdateDescriptionTask.cs deleted file mode 100644 index 74e56095..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringUpdateDescriptionTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class GatheringUpdateDescriptionTask : BaseTask -{ - public class GatheringUpdateDescriptionTaskParam : BaseParam - { - public string description; - } - - public GatheringUpdateDescriptionTask() - { - base.type = ApiType.Type.GatheringUpdateDescription; - } - - public void SetParameter(string description) - { - GatheringUpdateDescriptionTaskParam gatheringUpdateDescriptionTaskParam = new GatheringUpdateDescriptionTaskParam(); - gatheringUpdateDescriptionTaskParam.description = description; - base.Params = gatheringUpdateDescriptionTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringUserInfo.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringUserInfo.cs deleted file mode 100644 index 464d800e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringUserInfo.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Collections.Generic; -using Cute; -using LitJson; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringUserInfo : UserInfoBase -{ - public bool IsOwner { get; set; } - - public GatheringUserInfo(int viewerId, string name, long emblemId, string country, int rank, int degreeId, bool isFriend) - : base(viewerId, name, emblemId, country, rank, degreeId, isFriend) - { - } - - public GatheringUserInfo(Player player) - : base(player) - { - } - - public GatheringUserInfo(JsonData json) - : base(json) - { - } - - public GatheringUserInfo(UserFriend friend) - : base(friend) - { - } - - public override Texture GetUserEmblemTexture() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(base.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_S, isfetch: true); - return Toolbox.ResourcesManager.LoadObject(assetTypePath); - } - - public override Texture GetUserRankTexture() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(base.Rank.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true); - return Toolbox.ResourcesManager.LoadObject(assetTypePath); - } - - public override void InitializeDegreeTexture(UITexture texture) - { - DegreeHelper.InitializeDegree(texture, base.DegreeId, DegreeHelper.DegreeType.SMALL); - } - - public override Texture GetUserCountryTexture() - { - if (string.IsNullOrEmpty(base.CountryCode)) - { - return null; - } - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(base.CountryCode, ResourcesManager.AssetLoadPathType.Country_S, isfetch: true); - return Toolbox.ResourcesManager.LoadObject(assetTypePath); - } - - public override List GetUserAssetPathList() - { - List list = new List(); - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(base.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_S); - list.Add(assetTypePath); - assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(base.Rank.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S); - list.Add(assetTypePath); - list.AddRange(DegreeHelper.GetDegreeResourceList(base.DegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false)); - if (!string.IsNullOrEmpty(base.CountryCode)) - { - assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(base.CountryCode, ResourcesManager.AssetLoadPathType.Country_S); - list.Add(assetTypePath); - } - return list; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GatheringUtility.cs b/SVSim.BattleEngine/Engine/Wizard/GatheringUtility.cs deleted file mode 100644 index db1fac74..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GatheringUtility.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class GatheringUtility : MonoBehaviour -{ - public class RuleTypeInfo - { - public string Name { get; private set; } - - public GatheringRule.eType Type { get; private set; } - - public GatheringRule.eTournamentType TournamentType { get; private set; } - - public int MaxMember { get; private set; } - - public bool IsReset { get; private set; } - - public RuleTypeInfo(GatheringRule.eType _eType, GatheringRule.eTournamentType _eTournamentType = GatheringRule.eTournamentType.NONE, bool _isReset = false) - { - Type = _eType; - TournamentType = _eTournamentType; - Name = GetGatheringTypeString(Type, TournamentType, _isReset); - MaxMember = GetMaxMemberNumber(Type); - IsReset = _isReset; - } - } - - public static List GetAllGatheringRule() - { - List list = new List(); - foreach (GatheringRule.eType value in Enum.GetValues(typeof(GatheringRule.eType))) - { - if (value == GatheringRule.eType.TOURNAMENT) - { - foreach (GatheringRule.eTournamentType value2 in Enum.GetValues(typeof(GatheringRule.eTournamentType))) - { - switch (value2) - { - case GatheringRule.eTournamentType.DOUBLE_ELIMINATION: - list.Add(new RuleTypeInfo(value, value2, _isReset: true)); - list.Add(new RuleTypeInfo(value, value2)); - break; - default: - list.Add(new RuleTypeInfo(value, value2)); - break; - case GatheringRule.eTournamentType.NONE: - break; - } - } - } - else - { - list.Add(new RuleTypeInfo(value)); - } - } - return list; - } - - public static string GetGatheringTypeString(GatheringInfo gatheringInfo) - { - return GetGatheringTypeString(gatheringInfo.Rule.Type, gatheringInfo.Rule.TournamentType, gatheringInfo.Rule.IsReset); - } - - public static string GetGatheringTypeString(GatheringRule.eType _eType, GatheringRule.eTournamentType _eTournamentType = GatheringRule.eTournamentType.NONE, bool isReset = false) - { - SystemText systemText = Data.SystemText; - switch (_eType) - { - case GatheringRule.eType.FREE_BATTLE: - return systemText.Get("Gathering_0033"); - case GatheringRule.eType.TOURNAMENT: - switch (_eTournamentType) - { - case GatheringRule.eTournamentType.SINGLE_ELIMINATION: - return systemText.Get("Gathering_0030"); - case GatheringRule.eTournamentType.DOUBLE_ELIMINATION: - if (!isReset) - { - return systemText.Get("Gathering_0035"); - } - return systemText.Get("Gathering_0031"); - default: - Debug.LogError("未知のトーナメントタイプが追加されています:" + _eTournamentType); - return ""; - } - default: - Debug.LogError("未知のタイプが追加されています:" + _eType); - return ""; - } - } - - public static int GetMaxMemberNumber(GatheringRule.eType _eType) - { - if (_eType == GatheringRule.eType.TOURNAMENT) - { - return 64; - } - return 128; - } - - public static IEnumerator JoinRoom(RoomConnectController.InitializeParameter param, string battleId) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle; - RoomConnectController room = new RoomConnectController(param); - yield return UIManager.GetInstance().StartCoroutine(room.StartConnect(battleId)); - if (room.ConnectRoomResultType == RoomConnectController.ConnectRoomResult.SUCCESS) - { - UIManager.GetInstance()._Footer.InviteIconDisp(inDisp: false); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Room); - } - UIManager.GetInstance().closeInSceneCenterLoading(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GenerateDeckCodeTask.cs b/SVSim.BattleEngine/Engine/Wizard/GenerateDeckCodeTask.cs index 5f35d3da..9de153a4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GenerateDeckCodeTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GenerateDeckCodeTask.cs @@ -7,9 +7,7 @@ public class GenerateDeckCodeTask : BaseTask public enum SubmitDeckType { NORMAL = 1, - TWO_PICK = 2, SEALED = 4, - Chaos = 5, Crossover = 6, MY_ROTATION = 7 } diff --git a/SVSim.BattleEngine/Engine/Wizard/GenerateDeckImageTask.cs b/SVSim.BattleEngine/Engine/Wizard/GenerateDeckImageTask.cs index aadf74c3..1d844d0f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GenerateDeckImageTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GenerateDeckImageTask.cs @@ -34,8 +34,6 @@ public class GenerateDeckImageTask : BaseTask public int[] phantomCardID; } - private const string HEADER_TWITTER_KEY = "X-TWITTER-MESSAGE"; - public override string Url { get diff --git a/SVSim.BattleEngine/Engine/Wizard/GetCardMasterTask.cs b/SVSim.BattleEngine/Engine/Wizard/GetCardMasterTask.cs deleted file mode 100644 index 197ba62b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GetCardMasterTask.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Text; -using BestHTTP.Decompression.Zlib; -using LitJson; - -namespace Wizard; - -public class GetCardMasterTask : BaseTask -{ - public class CardMasterTaskParam : BaseParam - { - public string card_master_hash { get; private set; } - - public CardMasterTaskParam(string cardMasterHash) - { - card_master_hash = cardMasterHash; - } - } - - public JsonData CardMasterJsonData { get; private set; } - - public GetCardMasterTask(string cardMasterHash) - { - base.type = ApiType.Type.GetCardMaster; - base.Params = new CardMasterTaskParam(cardMasterHash); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - byte[] compressed = Convert.FromBase64String(base.ResponseData["data"]["card_master"].ToString()); - string json = Encoding.UTF8.GetString(GZipStream.UncompressBuffer(compressed)); - CardMasterJsonData = JsonMapper.ToObject(json); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GetDeckDataFromCodeTask.cs b/SVSim.BattleEngine/Engine/Wizard/GetDeckDataFromCodeTask.cs deleted file mode 100644 index adc67497..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GetDeckDataFromCodeTask.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Cute; -using DeckBuilder; -using LitJson; - -namespace Wizard; - -public class GetDeckDataFromCodeTask : BaseTask -{ - public class GetDeckDataFromCodeTaskParam : BaseParam - { - public string deck_code; - } - - public override string Url => $"{CustomPreference.GetDeckBuilderServerURL()}{ApiType.ApiList[base.type]}"; - - public GetDeckDataFromCodeTask() - { - base.type = ApiType.Type.GetDeckInfoFromDeckCode; - } - - public void SetParameter(string deck_code) - { - GetDeckDataFromCodeTaskParam getDeckDataFromCodeTaskParam = new GetDeckDataFromCodeTaskParam(); - getDeckDataFromCodeTaskParam.deck_code = deck_code; - base.Params = getDeckDataFromCodeTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.DeckDataFromDeckCode = new GetDeckDataFromCode(); - JsonData jsonData = base.ResponseData["data"]["deck"]; - int clanId = int.Parse(jsonData["clan"].ToString()); - int valueOrDefault = jsonData.GetValueOrDefault("sub_clan", 10); - Data.DeckDataFromDeckCode.ClanId = clanId; - Data.DeckDataFromDeckCode.SubClanId = valueOrDefault; - Data.DeckDataFromDeckCode.IsSubClanSet = CardBasePrm.ClanTypeIsUseable((CardBasePrm.ClanType)Data.DeckDataFromDeckCode.SubClanId); - string defaultValue = null; - Data.DeckDataFromDeckCode.MyRotationId = jsonData.GetValueOrDefault("rotation_id", defaultValue); - JsonData jsonData2 = jsonData["cardID"]; - int count = jsonData2.Count; - Data.DeckDataFromDeckCode.CardIds = new int[count]; - for (int i = 0; i < count; i++) - { - Data.DeckDataFromDeckCode.CardIds[i] = jsonData2[i].ToInt(); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GuildInputDescriptionDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GuildInputDescriptionDialog.cs deleted file mode 100644 index 466f7081..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GuildInputDescriptionDialog.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class GuildInputDescriptionDialog : MonoBehaviour -{ - [SerializeField] - private UIInput _inputText; - - [SerializeField] - private UILabel _labelText; - - public string InputValue - { - get - { - return _inputText.value; - } - set - { - _inputText.value = value; - _labelText.text = value; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GuildInputViewerIdDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GuildInputViewerIdDialog.cs deleted file mode 100644 index d6ff60ca..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GuildInputViewerIdDialog.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using UnityEngine; - -namespace Wizard; - -public class GuildInputViewerIdDialog : MonoBehaviour -{ - [SerializeField] - private UIInput _inputId; - - public int InputValue => int.Parse(_inputId.value); - - public void InitInput(Action onChangeInputLength) - { - _inputId.value = string.Empty; - _inputId.onChange.Clear(); - _inputId.onChange.Add(new EventDelegate(delegate - { - onChangeInputLength(); - })); - } - - public void InitializeDialog(DialogBase dialog) - { - UIManager.SetObjectToGrey(dialog.button1.gameObject, b: true); - InitInput(delegate - { - if (UIUtil.IsValidViewerId(_inputId.value)) - { - UIManager.SetObjectToGrey(dialog.button1.gameObject, b: false); - } - else - { - UIManager.SetObjectToGrey(dialog.button1.gameObject, b: true); - } - }); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/GuildNotification.cs b/SVSim.BattleEngine/Engine/Wizard/GuildNotification.cs index 72b42157..09f4b319 100644 --- a/SVSim.BattleEngine/Engine/Wizard/GuildNotification.cs +++ b/SVSim.BattleEngine/Engine/Wizard/GuildNotification.cs @@ -11,12 +11,4 @@ public class GuildNotification public bool IsJoinRequest { get; private set; } public bool IsInvited { get; private set; } - - public void SetGuildNotification(JsonData json) - { - GuildId = json["guild_id"]?.ToInt(); - GuildRoomMessageId = json["guild_room_message_id"]?.ToInt(); - IsJoinRequest = json["is_join_request"].ToBoolean(); - IsInvited = json["is_invited"].ToBoolean(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/GuildUserDataDialog.cs b/SVSim.BattleEngine/Engine/Wizard/GuildUserDataDialog.cs deleted file mode 100644 index 467154ba..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/GuildUserDataDialog.cs +++ /dev/null @@ -1,38 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class GuildUserDataDialog : MonoBehaviour -{ - [SerializeField] - private UITexture _textureEmblem; - - [SerializeField] - private UITexture _textureCountry; - - [SerializeField] - private UITexture _textureRank; - - [SerializeField] - private UITexture _textureDegree; - - [SerializeField] - private UILabel _labelName; - - [SerializeField] - private UILabel _labelDiscription; - - public void SetUserData(UserInfoBase userInfo) - { - _textureEmblem.mainTexture = userInfo.GetUserEmblemTexture(); - _textureRank.mainTexture = userInfo.GetUserRankTexture(); - userInfo.InitializeDegreeTexture(_textureDegree); - _textureCountry.mainTexture = userInfo.GetUserCountryTexture(); - _labelName.text = userInfo.Name; - } - - public void SetDiscriptionLabel(string text) - { - _labelDiscription.text = text; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/HealTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/HealTagCollection.cs index 321092da..07dc718a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/HealTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/HealTagCollection.cs @@ -21,18 +21,6 @@ public class HealTagCollection : TagCollection protected override AIPlayTagType[] MANAGED_TAG_TYPES => _managedTagTypes; - public bool HasHealToken - { - get - { - if (_healTokenTags != null) - { - return _healTokenTags.Count > 0; - } - return false; - } - } - public bool HasHealAttachTag { get @@ -143,9 +131,4 @@ public class HealTagCollection : TagCollection RemoveTagFromList(_healTokenTags, tag); } } - - public static bool IsHealTagType(AIPlayTagType type) - { - return _managedTagTypes.Contains(type); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/HighRankEffectInfo.cs b/SVSim.BattleEngine/Engine/Wizard/HighRankEffectInfo.cs deleted file mode 100644 index a6fb3c4e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/HighRankEffectInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using Wizard.Battle.Player.ClassCharacter; - -namespace Wizard; - -public class HighRankEffectInfo -{ - public string Prefab = ""; - - public int Delay; - - public int Layer; - - public List Motions = new List(); - - public string TargetBoneName = ""; - - public bool IsTrackRotation; - - public bool IsEffectMotion(ClassCharaPrm.MotionType motion) - { - if (HighRankSpineClassCharacter.IsEvolveMotion(motion)) - { - if (Motions.Count != 0) - { - return Motions.Contains("extra"); - } - return true; - } - return Motions.Contains(motion.ToString()); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/HofFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/HofFormatBehavior.cs index 55692256..dbb238b6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/HofFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/HofFormatBehavior.cs @@ -58,7 +58,7 @@ public class HofFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsConventionMode => false; @@ -69,21 +69,21 @@ public class HofFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/IChatActionUI.cs b/SVSim.BattleEngine/Engine/Wizard/IChatActionUI.cs deleted file mode 100644 index 362f3e95..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/IChatActionUI.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Wizard; - -public interface IChatActionUI -{ - void Init(IChatSettings chatSettings, ChatConnectController chatConnectCtr, ChatLogUI _chatLogUI, Action actionAddNewChatLogAfterSendChat); -} diff --git a/SVSim.BattleEngine/Engine/Wizard/IChatApiSettings.cs b/SVSim.BattleEngine/Engine/Wizard/IChatApiSettings.cs deleted file mode 100644 index a1d80b1a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/IChatApiSettings.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Wizard; - -public interface IChatApiSettings -{ - ApiType.Type ApiChatMessages { get; } - - ApiType.Type ApiChatPost { get; } - - ApiType.Type ApiChatAddReplay { get; } - - ApiType.Type ApiChatReplayDetail { get; } - - ApiType.Type ApiChatAddDeck { get; } - - ApiType.Type ApiChatDeleteDeck { get; } - - ApiType.Type ApiChatDeckLog { get; } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/IChatSettings.cs b/SVSim.BattleEngine/Engine/Wizard/IChatSettings.cs deleted file mode 100644 index 243d8bc3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/IChatSettings.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public interface IChatSettings -{ - KeyValuePair PlayerPrefsKeyLatestReadChatMessageId { get; } - - IChatApiSettings ApiSettings { get; } - - ChatLogPlate PrefabChatLogPlate { get; } - - UIManager.ViewScene ReplayBackScene { get; } - - UIManager.ChangeViewSceneParam ReplayBackSceneParam { get; } - - Action OnSetChatLogRoomInfoViewJoinButton { get; } - - Action OnClickBtnJoinRoomVisitor { get; } - - Action OnClickBtnJoinRoomWatcher { get; } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/InCompleteDeckDecideDialog.cs b/SVSim.BattleEngine/Engine/Wizard/InCompleteDeckDecideDialog.cs index 4395fb5b..92f8d2aa 100644 --- a/SVSim.BattleEngine/Engine/Wizard/InCompleteDeckDecideDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/InCompleteDeckDecideDialog.cs @@ -6,7 +6,6 @@ namespace Wizard; public static class InCompleteDeckDecideDialog { - private const int DIALOG_PANEL_DEPTH = 100; public static void Create(DialogBase dialogDeckList, DeckData deck, ConventionDeckList conventionDeckList = null, bool canUseNonPossessionCard = false, Action unusableDeckChangeViewSceneAction = null) { @@ -45,7 +44,7 @@ public static class InCompleteDeckDecideDialog { if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.DECK_MAINTENANCE)) { - Toolbox.NetworkManager.NetworkUI.OpenEachFunctionMaintenancePopUp(2019); + } else { @@ -65,7 +64,7 @@ public static class InCompleteDeckDecideDialog } } }; - dialogBase2.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + dialogBase2.ClickSe_Btn1 = 0; dialogBase2.SetPanelDepth(100); } diff --git a/SVSim.BattleEngine/Engine/Wizard/InviteConfigUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/InviteConfigUpdateTask.cs deleted file mode 100644 index a91dd625..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/InviteConfigUpdateTask.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Wizard; - -public class InviteConfigUpdateTask : BaseTask -{ - public class InviteConfigUpdateTaskParam : BaseParam - { - public int receive_invitation; - - public int receive_invitation_in_battle; - - public int receive_invitation_in_offline; - - public int receive_friend_apply; - } - - public InviteConfigUpdateTask() - { - base.type = ApiType.Type.InviteConfigUpdate; - } - - public void SetParameter(bool receiveInvite, bool receiveInviteInBattle, bool receiveInviteInOffline, bool receiveFriendApply) - { - InviteConfigUpdateTaskParam inviteConfigUpdateTaskParam = new InviteConfigUpdateTaskParam(); - inviteConfigUpdateTaskParam.receive_invitation = (receiveInvite ? 1 : 0); - inviteConfigUpdateTaskParam.receive_invitation_in_battle = (receiveInviteInBattle ? 1 : 0); - inviteConfigUpdateTaskParam.receive_invitation_in_offline = (receiveInviteInOffline ? 1 : 0); - inviteConfigUpdateTaskParam.receive_friend_apply = (receiveFriendApply ? 1 : 0); - base.Params = inviteConfigUpdateTaskParam; - } - - protected override int Parse() - { - int result = base.Parse(); - _ = 1; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/Item.cs b/SVSim.BattleEngine/Engine/Wizard/Item.cs index 9280f825..27997c5e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Item.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Item.cs @@ -13,32 +13,6 @@ public class Item LeaderSkinTicket } - public const int ID_CHALLENGE_TICKET = 1; - - public const int ID_COLOSSEUM_TICKET = 2; - - public const int ID_ORB = 1000; - - public const int ID_ORB_PIECE = 1001; - - public const int BINGO_TICKET = 2001; - - public const int BINGO_TICKET_2 = 2002; - - public const int BINGO_TICKET_HOCHAN = 2004; - - public const int ID_CARD_PACK_TICKET_MIN = 10001; - - private const int ID_SPOT_CARD_BUILD_DECK_TICKET_MIN = 60000; - - private const int ID_SPOT_CARD_BUILD_DECK_TICKET_MAX = 69999; - - private const int ID_LEADER_SKIN_TICKET_MIN = 70000; - - private const int ID_LEADER_SKIN_TICKET_MAX = 79999; - - public const int ID_TICKET_MAX = 99999; - public Type type; public int UserGoodsId; @@ -53,24 +27,6 @@ public class Item private int index; - public static bool IsLeaderSkinTicket(int itemId) - { - if (itemId >= 70000) - { - return itemId <= 79999; - } - return false; - } - - public static bool IsSpotCardBuildDeckTicket(int itemId) - { - if (itemId >= 60000) - { - return itemId <= 69999; - } - return false; - } - public Item() { } @@ -110,25 +66,4 @@ public class Item } return result; } - - public static Type GetItemType(UserGoods.Type goodsType, int userGoodsId) - { - return GetItemData(goodsType, userGoodsId).type; - } - - public static bool IsTicket(UserGoods.Type userGoodsType, int userGoodsId) - { - if (userGoodsType == UserGoods.Type.Item) - { - if ((uint)(userGoodsId - 1) <= 1u || (uint)(userGoodsId - 2001) <= 1u || userGoodsId == 2004) - { - return true; - } - if (userGoodsId >= 10001 && userGoodsId <= 99999) - { - return true; - } - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/ItemPurchase.cs b/SVSim.BattleEngine/Engine/Wizard/ItemPurchase.cs deleted file mode 100644 index 07d91053..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ItemPurchase.cs +++ /dev/null @@ -1,279 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.ItemPurchase; - -namespace Wizard; - -public class ItemPurchase : MonoBehaviour -{ - private const int PRODUCT_SCROLL_OBJECT_NUM = 5; - - private const int DEPTH_PURCHASE_SUCCESS_DIALOG = 100; - - [SerializeField] - private UILabel _redEtherLabel; - - [SerializeField] - private UILabel _premierOrbOrbPieceLabel; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private UIWrapContent _wrapContent; - - [SerializeField] - private UIScrollBarWrapContent _scrollBarWrapContent; - - [SerializeField] - private WrapContentsScrollBarSize _wrapContentScrollBarSize; - - [SerializeField] - private GameObject _itemPlateOriginal; - - [SerializeField] - private PurchaseConfirm _prefabConfirmDialog; - - [SerializeField] - private UILabel _labelNoItem; - - private List _itemDataList; - - private List _plateList = new List(); - - private List _loadedResourceList = new List(); - - private ItemPurchaseData _purchaseItemData; - - public void Init(Action onInitFinCallBack) - { - _labelNoItem.gameObject.SetActive(value: false); - _itemPlateOriginal.gameObject.SetActive(value: false); - _scrollBarWrapContent.m_WrapContents = _wrapContent; - StartConnectItemPurchaseInfo(delegate - { - _itemDataList = Data.ItemPurchaseInfo.itemPurchaseList; - CreateItemView(onInitFinCallBack); - }); - UserItemCountUpdate(); - } - - private void CreateItemView(Action onFinCallBack = null) - { - if (_itemDataList.Count <= 0) - { - _labelNoItem.gameObject.SetActive(value: true); - _scrollView.gameObject.SetActive(value: false); - _scrollBarWrapContent.gameObject.SetActive(value: false); - onFinCallBack.Call(); - return; - } - _labelNoItem.gameObject.SetActive(value: false); - _scrollView.gameObject.SetActive(value: true); - _scrollBarWrapContent.gameObject.SetActive(value: true); - StartCoroutine(LoadImages(delegate - { - StartCoroutine(CreateScrollView(onFinCallBack)); - })); - } - - private void StartConnectItemPurchaseInfo(Action callbackOnSuccess) - { - ItemPurchaseInfoTask task = new ItemPurchaseInfoTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, callbackOnSuccess)); - } - - private IEnumerator LoadImages(Action callBack = null) - { - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - List assetList = new List(); - for (int i = 0; i < _itemDataList.Count; i++) - { - ItemPurchaseData itemPurchaseData = _itemDataList[i]; - string assetTypePath = resourcesManager.GetAssetTypePath(itemPurchaseData.textureName, ResourcesManager.AssetLoadPathType.Item); - if (!assetList.Contains(assetTypePath) && !_loadedResourceList.Contains(assetTypePath)) - { - assetList.Add(assetTypePath); - } - if (IsCardPackTicket(itemPurchaseData.require_item_type, itemPurchaseData.RequireUserGoodsId)) - { - string assetTypePath2 = resourcesManager.GetAssetTypePath($"card_pack_{itemPurchaseData.RequireUserGoodsId}_icon", ResourcesManager.AssetLoadPathType.ShopCardPack); - if (!assetList.Contains(assetTypePath2) && !_loadedResourceList.Contains(assetTypePath2)) - { - assetList.Add(assetTypePath2); - } - } - } - if (assetList.Count > 0) - { - yield return StartCoroutine(resourcesManager.LoadAssetGroupAsync(assetList, null)); - _loadedResourceList.AddRange(assetList); - } - callBack.Call(); - } - - private void UnloadImages() - { - if (_loadedResourceList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList = null; - } - } - - private IEnumerator CreateScrollView(Action onFinishCallback = null) - { - _wrapContent.gameObject.SetActive(value: false); - if (_plateList.Count > 0) - { - for (int i = 0; i < _plateList.Count; i++) - { - UnityEngine.Object.Destroy(_plateList[i].gameObject); - } - _plateList.Clear(); - } - if (_itemDataList.Count == 1) - { - _wrapContent.enabled = false; - ItemPurchasePlate component = NGUITools.AddChild(_scrollView.gameObject, _itemPlateOriginal).GetComponent(); - component._buyBtnCallBack = OnPushBuyButton; - component.SetData(0); - _plateList.Add(component); - } - else - { - _wrapContent.enabled = true; - for (int j = 0; j < _itemDataList.Count && j < 5; j++) - { - ItemPurchasePlate component2 = NGUITools.AddChild(_wrapContent.gameObject, _itemPlateOriginal).GetComponent(); - component2._buyBtnCallBack = OnPushBuyButton; - _plateList.Add(component2); - } - } - yield return null; - for (int k = 0; k < _plateList.Count; k++) - { - _plateList[k].gameObject.SetActive(value: true); - } - _wrapContent.minIndex = -(_itemDataList.Count - 1); - _wrapContent.maxIndex = 0; - _wrapContent.onInitializeItem = OnInitializeItem; - _wrapContent.gameObject.SetActive(value: true); - ResetScrollView(); - onFinishCallback.Call(); - } - - private void ResetScrollView() - { - _wrapContentScrollBarSize.ContentUpdate(); - _wrapContent.SortBasedOnScrollMovement(); - _scrollView.ResetPosition(); - _wrapContent.WrapContent(); - } - - private void OnInitializeItem(GameObject go, int wrapIndex, int realIndex) - { - int num = -realIndex; - if (num >= _itemDataList.Count || num < 0) - { - go.SetActive(value: false); - return; - } - go.SetActive(value: true); - go.GetComponent().SetData(num); - } - - private void OnDestroy() - { - UnloadImages(); - } - - private void OnPushBuyButton(ItemPurchaseData itemData) - { - if (itemData != null) - { - DialogBase dialogBase = ShopCommonUtility.CreateBasePopupPurchaseConfirm(new EventDelegate(delegate - { - _purchaseItemData = itemData; - ItemPurchaseBuyTask itemPurchaseBuyTask = new ItemPurchaseBuyTask(); - itemPurchaseBuyTask.SetParameter(itemData.purchase_id, itemData.rest); - StartCoroutine(Toolbox.NetworkManager.Connect(itemPurchaseBuyTask, OnSuccessItemPurchaseBuy)); - })); - PurchaseConfirm purchaseConfirm = UnityEngine.Object.Instantiate(_prefabConfirmDialog); - dialogBase.SetObj(purchaseConfirm.gameObject); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0135")); - string purchaseText = Data.SystemText.Get("Shop_0101", itemData.purchase_name); - int haveUserGoods = PlayerStaticData.GetHaveUserGoods(itemData.require_item_type, itemData.RequireUserGoodsId); - if (IsCardPackTicket(itemData.require_item_type, itemData.RequireUserGoodsId)) - { - Texture texture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath($"card_pack_{itemData.RequireUserGoodsId}_icon", ResourcesManager.AssetLoadPathType.ShopCardPack, isfetch: true)) as Texture; - purchaseConfirm.SetConfirmDialog(itemData.require_item_num, purchaseText, haveUserGoods, itemData.require_item_type, itemData.RequireUserGoodsId, null, texture); - } - else - { - purchaseConfirm.SetConfirmDialog(itemData.require_item_num, purchaseText, haveUserGoods, itemData.require_item_type, itemData.RequireUserGoodsId, null); - } - } - } - - private bool IsCardPackTicket(UserGoods.Type itemType, long userGoodsId) - { - if (itemType != UserGoods.Type.Item) - { - return false; - } - if (Item.GetItemType(itemType, (int)userGoodsId) == Item.Type.CardPackTicket) - { - return true; - } - return false; - } - - private void OnSuccessItemPurchaseBuy(NetworkTask.ResultCode e) - { - MyPageMenu.Instance.UpdateCrystalCount(); - MyPageMenu.Instance.UpdateRupyCount(); - ShopCommonUtility.CreatePurchaseSuccess(_purchaseItemData.purchase_name).SetPanelDepth(100); - List oldItemDataList = new List(_itemDataList); - StartConnectItemPurchaseInfo(delegate - { - bool flag = false; - if (oldItemDataList.Count != _itemDataList.Count) - { - flag = true; - } - else - { - for (int i = 0; i < _itemDataList.Count; i++) - { - if (oldItemDataList[i].purchase_id != _itemDataList[i].purchase_id) - { - flag = true; - break; - } - } - } - if (flag) - { - CreateItemView(); - } - else - { - for (int j = 0; j < _plateList.Count; j++) - { - _plateList[j].UpdatePlate(); - } - } - UserItemCountUpdate(); - }); - } - - private void UserItemCountUpdate() - { - _redEtherLabel.text = PlayerStaticData.UserRedEtherCount.ToString(); - _premierOrbOrbPieceLabel.text = PlayerStaticData.GetItemNum(1001).ToString(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ItemPurchasePlate.cs b/SVSim.BattleEngine/Engine/Wizard/ItemPurchasePlate.cs deleted file mode 100644 index 572e14ed..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ItemPurchasePlate.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using Cute; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.ItemPurchase; - -namespace Wizard; - -public class ItemPurchasePlate : MonoBehaviour -{ - [SerializeField] - private UITexture _textureThumbnail; - - [SerializeField] - private UILabel _labelItemName; - - [SerializeField] - private UILabel _labelCostName; - - [SerializeField] - private UILabel _labelStockNum; - - [SerializeField] - private UIButton _btnBuyItem; - - [SerializeField] - private UISprite _useItemIconSprite; - - private ItemPurchaseData _itemData; - - public Action _buyBtnCallBack; - - private int _dataIndex; - - public void SetData(int dataIndex) - { - _dataIndex = dataIndex; - UpdateDisplay(Data.ItemPurchaseInfo.itemPurchaseList[dataIndex]); - } - - public void UpdatePlate() - { - UpdateDisplay(Data.ItemPurchaseInfo.itemPurchaseList[_dataIndex]); - } - - private void UpdateDisplay(ItemPurchaseData data) - { - _itemData = data; - _textureThumbnail.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(data.textureName, ResourcesManager.AssetLoadPathType.Item, isfetch: true)) as Texture; - _labelItemName.text = data.purchase_name; - string typeName = ""; - string detailName = ""; - ShopCommonUtility.GetRewardNames((int)data.require_item_type, data.RequireUserGoodsId, data.require_item_num, out typeName, out detailName); - _labelCostName.text = Data.SystemText.Get("Shop_0129", typeName, detailName); - _useItemIconSprite.gameObject.SetActive(value: true); - if (data.require_item_type == UserGoods.Type.RedEther) - { - _useItemIconSprite.spriteName = "icon_liquid_s"; - } - else if (data.require_item_type == UserGoods.Type.Item && data.RequireUserGoodsId == 1001) - { - _useItemIconSprite.spriteName = "icon_orb_piece_s"; - } - else - { - _useItemIconSprite.gameObject.SetActive(value: false); - } - if (data.isMonthryReset) - { - _labelStockNum.text = Data.SystemText.Get("Shop_0130", data.rest.ToString()); - } - else - { - _labelStockNum.text = Data.SystemText.Get("Shop_0131", data.rest.ToString()); - } - int haveUserGoods = PlayerStaticData.GetHaveUserGoods(_itemData.require_item_type, _itemData.RequireUserGoodsId); - if (_itemData.rest > 0 && haveUserGoods >= _itemData.require_item_num) - { - UIManager.SetObjectToGrey(_btnBuyItem.gameObject, b: false); - _btnBuyItem.isEnabled = true; - } - else - { - UIManager.SetObjectToGrey(_btnBuyItem.gameObject, b: true); - _btnBuyItem.isEnabled = false; - } - } - - public void OnPushBuyButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _buyBtnCallBack.Call(_itemData); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/LabelDefine.cs b/SVSim.BattleEngine/Engine/Wizard/LabelDefine.cs index 7759b093..ee380319 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LabelDefine.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LabelDefine.cs @@ -6,10 +6,6 @@ public class LabelDefine : MonoBehaviour { public static readonly Color32 TEXT_COLOR_NORMAL = new Color32(byte.MaxValue, 253, 235, byte.MaxValue); - public static readonly Color32 TEXT_COLOR_DESC_ON_CARDPANEL = new Color32(204, 204, 204, byte.MaxValue); - - public static readonly Color32 TEXT_COLOR_NAME_ON_CARDPANEL = new Color32(byte.MaxValue, 253, 235, byte.MaxValue); - public static readonly Color32 TEXT_COLOR_KEYWORD = new Color32(byte.MaxValue, 205, 69, byte.MaxValue); public static readonly Color32 TEXT_COLOR_CREAM = new Color32(200, 200, 176, byte.MaxValue); @@ -18,33 +14,17 @@ public class LabelDefine : MonoBehaviour public static readonly Color32 TEXT_COLOR_ORANGE = new Color32(byte.MaxValue, 211, 66, byte.MaxValue); - public static readonly Color32 TEXT_COLOR_BLACK = new Color32(18, 19, 17, byte.MaxValue); - public static readonly Color32 TEXT_COLOR_BUTTON_ENABLE = new Color32(byte.MaxValue, 253, 235, byte.MaxValue); public static readonly Color32 TEXT_COLOR_BUTTON_DISABLE = new Color32(85, 85, 85, byte.MaxValue); - public static readonly Color32 TEXT_COLOR_B0B0B0 = new Color32(176, 176, 176, byte.MaxValue); - - public static readonly UILabel.Effect OUTLINE_STYLE_ON_BUTTON = UILabel.Effect.Outline8; - - public static readonly Vector2 OUTLINE_DISTANCE_ON_BUTTON = new Vector2(2f, 2f); - - public static readonly Color32 OUTLINE_COLOR_ON_BUTTON = new Color32(81, 63, 48, byte.MaxValue); - public static readonly Color32 OUTLINE_COLOR_FOOTER_DEFAULT = new Color32(51, 34, 0, byte.MaxValue); public static readonly Color32 OUTLINE_COLOR_FOOTER_DISABLE_DEFAULT = new Color32(19, 20, 12, byte.MaxValue); public static readonly Color32 OUTLINE_COLOR_FOOTER_DISABLE_PUSH = new Color32(29, 28, 19, byte.MaxValue); - public static readonly Color32 OUTLINE_COLOR_PRACTICE_CARDPANEL_DEFAULT = new Color32(31, 211, 236, 20); - - public static readonly Color32 OUTLINE_COLOR_PRACTICE_CARDPANEL_DISABLE = new Color32(14, 64, 71, 19); - public static readonly UILabel.Effect OUTLINE_STYLE_CLASS_NAME = UILabel.Effect.Outline8; public static readonly Vector2 OUTLINE_DISTANCE_CLASS_NAME = new Vector2(1.5f, 1.5f); - - public static readonly Color32 OUTLINE_COLOR_AREA_SELECT_NONCHARA_TITLE = new Color32(38, 36, 32, byte.MaxValue); } diff --git a/SVSim.BattleEngine/Engine/Wizard/LastwordTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/LastwordTagCollection.cs index 409fe081..a0d1bfb2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LastwordTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LastwordTagCollection.cs @@ -36,18 +36,6 @@ public class LastwordTagCollection : TagCollection public List LastwordAddDeckList { get; private set; } - public int LastwordAttachTagCount - { - get - { - if (_lastwordAttachTagList != null) - { - return _lastwordAttachTagList.Count; - } - return 0; - } - } - public LastwordTagCollection() : base(TagCollectionType.Lastword) { diff --git a/SVSim.BattleEngine/Engine/Wizard/LeaderSkinUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/LeaderSkinUpdateTask.cs index abed9950..2c7e37bc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LeaderSkinUpdateTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LeaderSkinUpdateTask.cs @@ -32,15 +32,6 @@ public class LeaderSkinUpdateTask : BaseTask base.Params = _param; } - public void SetRandomParameter(int class_id, int[] leader_skin_id_list) - { - _param = new LeaderSkinUpdateTaskParam(); - _param.class_id = class_id; - _param.leader_skin_id_list = leader_skin_id_list; - _param.is_random_leader_skin = true; - base.Params = _param; - } - protected override int Parse() { int num = base.Parse(); @@ -48,7 +39,7 @@ public class LeaderSkinUpdateTask : BaseTask { return num; } - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr ClassCharaPrm classPrm = dataMgr.GetClassPrm(_param.class_id); JsonData jsonData = base.ResponseData["data"]; bool flag = jsonData["is_random_leader_skin"].ToBoolean(); diff --git a/SVSim.BattleEngine/Engine/Wizard/LoadQueue.cs b/SVSim.BattleEngine/Engine/Wizard/LoadQueue.cs index f8b3f015..aef12375 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LoadQueue.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LoadQueue.cs @@ -41,23 +41,6 @@ public class LoadQueue public bool IsClearing { get; private set; } - public bool IsEmpty - { - get - { - if (_loadList.Count <= 0) - { - return _state == State.IDLE; - } - return false; - } - } - - public void AddToFirst(string id, List pathList, Callback onStart, Callback onEnd) - { - Add(isFirst: true, id, pathList, onStart, onEnd); - } - public void AddToLast(string id, List pathList, Callback onStart, Callback onEnd) { Add(isFirst: false, id, pathList, onStart, onEnd); @@ -146,14 +129,6 @@ public class LoadQueue } } - public void PauseLoad() - { - if (_state == State.LOAD) - { - IsChangingPauseLoad = true; - } - } - public void Clear() { _loadList.Clear(); diff --git a/SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs b/SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs deleted file mode 100644 index 286d9248..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/LoadSceneStoryData.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Wizard; - -public class LoadSceneStoryData -{ - private const string FORMAT_STORY_TITLE_NAME = "StoryTitle_{0:0000}_1"; - - private const string FORMAT_STORY_VALUE_NAME = "StoryText_{0:0000}_1"; - - private const string STILL_TEXTURE_NAME = "bg_story_section_{0}"; - - public int StoryId { get; private set; } - - public string StoryTitle { get; private set; } - - public string StoryValue { get; private set; } - - public string StillImageName { get; private set; } - - public LoadSceneStoryData(int _storyId) - { - StoryId = _storyId; - SystemText systemText = Data.SystemText; - StoryTitle = systemText.Get($"StoryTitle_{StoryId:0000}_1"); - StoryValue = systemText.Get($"StoryText_{StoryId:0000}_1"); - StillImageName = "Images/Loading/" + $"bg_story_section_{StoryId}"; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/LoadTask.cs b/SVSim.BattleEngine/Engine/Wizard/LoadTask.cs deleted file mode 100644 index 33341a3b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/LoadTask.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using Cute; -using LitJson; - -namespace Wizard; - -public class LoadTask : BaseTask -{ - public enum AccountDeleteStatus - { - NONE, - CAN_RESET_RESERVE, - CAN_NOT_RESET_RESERVE - } - - public class LoadTaskParam : BaseParam - { - public string carrier = ""; - - public string card_master_hash = ""; - } - - public LoadDetail LoadDetailInstance { get; private set; } - - public AccountDeleteStatus DeleteStatus { get; private set; } - - public string DeleteLimitDate { get; private set; } - - public LoadTask() - { - base.type = ApiType.Type.Load; - } - - public void SetParameter() - { - LoadTaskParam loadTaskParam = new LoadTaskParam(); - loadTaskParam.carrier = Toolbox.DeviceManager.GetCarrier(); - loadTaskParam.card_master_hash = CardMasterLocalFileUtility.GetCardMasterHash(); - base.Params = loadTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - if (jsonData.Keys.Contains("account_delete_reservation_status")) - { - DeleteStatus = (AccountDeleteStatus)jsonData["account_delete_reservation_status"].ToInt(); - double timeLimitUnixTime = ConvertTime.DateTimeToUnixTime(DateTime.Parse(jsonData["account_delete_reservation_cancelable_deadline"].ToString())); - double nowUnixTime = base.ResponseData["data_headers"]["servertime"].ToDouble(); - DeleteLimitDate = GetLateTime(timeLimitUnixTime, nowUnixTime); - return num; - } - LoadDetailInstance = new LoadDetail(); - Data.Load.data = LoadDetailInstance; - Data.Load.data.ConvertJsonData(base.ResponseData); - return num; - } - - private static string GetLateTime(double timeLimitUnixTime, double nowUnixTime) - { - double num = timeLimitUnixTime - nowUnixTime; - if (num < 0.0) - { - num = 0.0; - } - int num2 = 0; - if (num >= 86400.0) - { - num2 = (int)(num / 86400.0); - } - int num3 = 0; - if (num >= 3600.0) - { - num3 = (int)(num / 3600.0); - num3 %= 24; - } - int num4 = 0; - if (num >= 60.0) - { - num4 = (int)(num / 60.0); - num4 %= 60; - } - if (num >= 86400.0) - { - return Data.SystemText.Get("System_0065", num2.ToString(), num3.ToString(), num4.ToString()); - } - if (num >= 3600.0) - { - return Data.SystemText.Get("System_0066", num3.ToString(), num4.ToString()); - } - return Data.SystemText.Get("System_0067", num4.ToString()); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs b/SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs deleted file mode 100644 index 9ea571f6..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/LoadingDownLoadStoryView.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public class LoadingDownLoadStoryView : MonoBehaviour -{ - [SerializeField] - private UITexture _stillTexture; - - [SerializeField] - private UILabel _storyTitleLabel; - - [SerializeField] - private UILabel _storyValueLabel; - - [SerializeField] - private UIToggle _indicatorBase; - - private List _indicatorList = new List(); - - private List _loadSceneStoryDatas = new List(); - - private const string FORMAT_STORY_NUMBER = "LoadStory_Number_1"; - - private int _currentIndex; - - public void Initialize() - { - _ = Data.SystemText; - int result = 0; - int.TryParse(Data.SystemText.Get("LoadStory_Number_1"), out result); - GameObject gameObject = _indicatorBase.transform.parent.gameObject; - for (int i = 1; i <= result; i++) - { - _loadSceneStoryDatas.Add(new LoadSceneStoryData(i)); - _indicatorList.Add(NGUITools.AddChild(gameObject, _indicatorBase.gameObject).GetComponent()); - } - _indicatorBase.gameObject.SetActive(value: false); - gameObject.GetComponent().Reposition(); - SetStoryInfo(_currentIndex); - } - - private void SetStoryInfo(int index) - { - LoadSceneStoryData loadSceneStoryData = _loadSceneStoryDatas[index]; - _storyTitleLabel.text = loadSceneStoryData.StoryTitle; - _storyValueLabel.text = loadSceneStoryData.StoryValue; - _stillTexture.mainTexture = Resources.Load(loadSceneStoryData.StillImageName); - UpdateIndicator(index); - } - - public void ChangeStoryImage(bool isRight) - { - if (isRight) - { - UpdateIndexToNext(); - } - else - { - UpdateIndexToPrev(); - } - } - - private void UpdateIndexToNext() - { - _currentIndex = (_currentIndex + 1) % _loadSceneStoryDatas.Count; - SetStoryInfo(_currentIndex); - } - - private void UpdateIndexToPrev() - { - if (_currentIndex > 0) - { - _currentIndex--; - } - else - { - _currentIndex = _loadSceneStoryDatas.Count - 1; - } - SetStoryInfo(_currentIndex); - } - - private void UpdateIndicator(int index) - { - if (_indicatorList.Count > 1) - { - _indicatorList[index].value = true; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/LocalLog.cs b/SVSim.BattleEngine/Engine/Wizard/LocalLog.cs index 50e4281e..6d666e7d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LocalLog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LocalLog.cs @@ -4,6 +4,10 @@ using System.Text; using Cute; using UnityEngine; using Wizard.RoomMatch; +// TODO(engine-cleanup-pass2): 37 of 55 methods unrun in baseline +// Type: Wizard.LocalLog +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -20,14 +24,10 @@ public class LocalLog { TRACE_ALL_LOG, TRACE_LOG, - TRACE_LAST_LOG, - TRACE_INQUIRY_LOG - } + TRACE_LAST_LOG } public enum RecordType { - CERBERUS, - HADES } private static string AccumulateLogPath = Application.persistentDataPath + "/accumulate_log"; @@ -42,26 +42,10 @@ public class LocalLog private static string _failureWriteClientLog = ""; - private const string TRACELASTLOG_KEY1 = "LastTraceLog1"; - - private const string TRACELASTLOG_KEY2 = "LastTraceLog2"; - private static int nowTraceTurn = 0; - private const string TRACELOG_KEY = "TraceLog"; - - private const string TRACE_SETTING_LOG_KEY = "TraceSettingLog"; - - private const string BATTLE_SETTING_INFO_TOP = "BattleSetting:"; - - private const string TRACE_INQUIRY_LOG_KEY = "TraceInquiryLog"; - private static int currentTurn = -1; - private static string _roomCreateLog = ""; - - private static bool _isRoomCreateLogEnd = false; - private static string _loadResourceLog = ""; private static string _gungnirLog = ""; @@ -76,8 +60,6 @@ public class LocalLog private static bool _isLastTraceLogTimeAdd = false; - private const string _resourceLoadErrorText = "ResourcesManager ParallelAssetListExec Error"; - private static StringBuilder _lastTraceLogStringBuilder = null; [RuntimeInitializeOnLoadMethod] @@ -123,11 +105,6 @@ public class LocalLog MakeTreceLogToSend(TRACELOG_TYPE.TRACE_ALL_LOG, onSended); } - public static void SendClientInfoTraceLog(Action onSended) - { - MakeTreceLogToSend(TRACELOG_TYPE.TRACE_LOG, onSended); - } - public static void SendLastTraceLog(Action onSended) { MakeTreceLogToSend(TRACELOG_TYPE.TRACE_LAST_LOG, onSended); @@ -143,7 +120,7 @@ public class LocalLog private static void MakeTreceLogToSendLocked(TRACELOG_TYPE logType, Action onSended) { - if (string.IsNullOrEmpty(Certification.Udid) || Certification.ViewerId == 0) + if (string.IsNullOrEmpty(Certification.Udid) /* Pre-Phase-5 chunk 39: Certification.ViewerId dropped — LocalLog is static-scope */) { onSended.Call(); return; @@ -192,9 +169,9 @@ public class LocalLog { case TRACELOG_TYPE.TRACE_ALL_LOG: log = text2; - if (ToolboxGame.RealTimeNetworkAgent != null) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach; log skips battle-id/socket-id { - text = text + "bId" + ToolboxGame.RealTimeNetworkAgent.GetBattleId() + "\n"; + text = text + "bId0\n"; /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ } text += AppendLastLog(text3, text4); log2 = text5; @@ -268,7 +245,7 @@ public class LocalLog lock (_gate) { UIManager.ViewScene currentScene = UIManager.GetInstance().GetCurrentScene(); - string text = ((currentScene == UIManager.ViewScene.Battle && ToolboxGame.RealTimeNetworkAgent != null) ? "NetworkBattle" : currentScene.ToString()); + string text = (false /* Pre-Phase-5 (chunk 38): RTA has no static reach */ ? "NetworkBattle" : currentScene.ToString()); AccumulateTraceLogLocked("ResourcesManager ParallelAssetListExec Error in " + text + " : " + errorFlag); } } @@ -284,25 +261,6 @@ public class LocalLog } } - public static void RecordFreezeLogIfLoadErrorOccured() - { - lock (_gate) - { - if (ExistResourceLoadErrorInNetWorkBattleLocked()) - { - AccumulateTraceLogLocked("ResourceLoadFreeze in NetworkBattleScene"); - } - } - } - - public static bool ExistResourceLoadErrorInNetWorkBattle() - { - lock (_gate) - { - return ExistResourceLoadErrorInNetWorkBattleLocked(); - } - } - private static bool ExistResourceLoadErrorInNetWorkBattleLocked() { return ReadLogFile(AccumulateLogPath).Contains("ResourcesManager ParallelAssetListExec Error in NetworkBattle"); @@ -328,7 +286,7 @@ public class LocalLog private static string GetShapedLog(string log) { log = log.Replace("\n", "&&").Replace("\r", ""); - string text = "ID:" + PlayerStaticData.UserViewerID + " {\n" + log + " \n}"; + string text = "ID:" + 0 + " {\n" + log + " \n}"; text.Replace("\n", "\\n"); return text; } @@ -392,7 +350,7 @@ public class LocalLog { lock (_gate) { - if (!(ToolboxGame.RealTimeNetworkAgent == null)) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach { string battleAndViewIdText = GetBattleAndViewIdText(); string text = (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT) ? "1" : "0"); @@ -408,10 +366,10 @@ public class LocalLog { lock (_gate) { - if (ToolboxGame.RealTimeNetworkAgent != null) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach; log skips battle-id/socket-id { DateTime dateTime = DateTime.Now.ToUniversalTime(); - log = dateTime.Day + "/" + dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000") + ":[" + ToolboxGame.RealTimeNetworkAgent.NowSocketID + "]" + log + "\n"; + log = dateTime.Day + "/" + dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000") + ":[0]" + log + "\n"; /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ _gungnirLog += log; } } @@ -422,74 +380,27 @@ public class LocalLog lock (_gate) { _gungnirLog = ""; - if (ToolboxGame.RealTimeNetworkAgent != null && _isSendGungnirLog) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach { - ToolboxGame.RealTimeNetworkAgent.NetworkLogger.LogInfo("OffGungnirLog"); + /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ } _isSendGungnirLog = false; } } - public static void AddSocketFrameLog(string log) - { - lock (_gate) - { - if (ToolboxGame.RealTimeNetworkAgent != null) - { - DateTime dateTime = DateTime.Now.ToUniversalTime(); - log = dateTime.Day + "/" + dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000") + ":[" + ToolboxGame.RealTimeNetworkAgent.NowSocketID + "]" + log + "\n"; - _socketFrameLog += log; - } - } - } - public static void InitSocketFrameLog() { lock (_gate) { _socketFrameLog = ""; - if (ToolboxGame.RealTimeNetworkAgent != null && _isSendSocketFrameLog) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach { - ToolboxGame.RealTimeNetworkAgent.NetworkLogger.LogInfo("OffSocketFrameLog"); + /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ } _isSendSocketFrameLog = false; } } - public static void AccumulateTraceLogAddRoomCreateLog() - { - lock (_gate) - { - if (!_isRoomCreateLogEnd) - { - _isRoomCreateLogEnd = true; - AccumulateTraceLogLocked("#696951 " + _roomCreateLog); - _roomCreateLog = ""; - } - } - } - - public static void AddRoomCreateLog(string log) - { - lock (_gate) - { - if (!_isRoomCreateLogEnd) - { - DateTime dateTime = DateTime.Now.ToUniversalTime(); - log = dateTime.Day + "/" + dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000") + log + "\n"; - _roomCreateLog += log; - } - } - } - - public static void InitRoomCreateLog() - { - lock (_gate) - { - _roomCreateLog = ""; - } - } - public static void UpdateLoadResourceLog(string log) { lock (_gate) @@ -498,14 +409,6 @@ public class LocalLog } } - public static string GetLoadResourceLog() - { - lock (_gate) - { - return _loadResourceLog; - } - } - public static void SetDisconnectLog(string log) { lock (_gate) @@ -513,7 +416,7 @@ public class LocalLog if (_disconnectLog == "") { DateTime dateTime = DateTime.Now.ToUniversalTime(); - log = dateTime.Day + "/" + dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000") + ":[" + ToolboxGame.RealTimeNetworkAgent.NowSocketID + "]" + log + "\n"; + log = dateTime.Day + "/" + dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second + ":" + dateTime.Millisecond.ToString("000") + ":[0]" + log + "\n"; /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ _disconnectLog = log; } } @@ -770,28 +673,12 @@ public class LocalLog } } - public static void ClearTraceLog() - { - lock (_gate) - { - ClearTraceLogLocked(); - } - } - private static void ClearTraceLogLocked() { ClearLog("TraceLog"); ClearLog("TraceSettingLog"); } - public static void ClearLastTraceLog(string key) - { - lock (_gate) - { - ClearLog(key); - } - } - private static void ClearInquiryLogKey() { ClearLog("TraceInquiryLog"); @@ -837,14 +724,6 @@ public class LocalLog } } - public static void ClearLastLogKey() - { - lock (_gate) - { - ClearLastLogKeyLocked(); - } - } - private static void ClearLastLogKeyLocked() { ClearLog("LastTraceLog1"); @@ -852,73 +731,6 @@ public class LocalLog currentTurn = -1; } - public static void ClearAllLog() - { - lock (_gate) - { - ClearTraceLogLocked(); - ClearLastLogKeyLocked(); - ClearInquiryLogKey(); - } - } - - public static void RecordCheckLog(RecordType type, bool isWin) - { - lock (_gate) - { - RecordCheckLogLocked(type, isWin); - } - } - - private static void RecordCheckLogLocked(RecordType type, bool isWin) - { - if (BattleManagerBase.GetIns() == null || !isWin) - { - return; - } - switch (type) - { - case RecordType.CERBERUS: - if (BattleManagerBase.GetIns().BattlePlayer.Turn <= 1) - { - AccumulateLastTraceLog("CERBERUS AWAKEN"); - } - break; - case RecordType.HADES: - { - NetworkBattleManagerBase networkBattleManagerBase = (NetworkBattleManagerBase)BattleManagerBase.GetIns(); - if (networkBattleManagerBase.JudgeResultReceiveCode == NetworkBattleReceiver.RESULT_CODE.RetireWin || networkBattleManagerBase.JudgeResultReceiveCode == NetworkBattleReceiver.RESULT_CODE.DisconnectWin || networkBattleManagerBase.JudgeResultReceiveCode == NetworkBattleReceiver.RESULT_CODE.FirstcardWin || networkBattleManagerBase.BattlePlayer.PlayCardTouchCount != 0) - { - break; - } - long num = ((ToolboxGame.RealTimeNetworkAgent != null) ? ToolboxGame.RealTimeNetworkAgent.GetBattleId() : 0); - if (num <= 0 && Data.DoMatchingDetail.data != null) - { - num = Data.DoMatchingDetail.data.GetBattleId(); - } - if (num <= 0) - { - RoomConnectController connectController = RoomBase.ConnectController; - if (connectController != null && connectController.OwnCtrl is PlayerControllerForOwn playerControllerForOwn) - { - num = playerControllerForOwn.GetBattleId(); - } - } - AccumulateTraceLog("HADES AWAKEN BattleID:" + num); - break; - } - } - } - - public static void RecordMemoryOnLastTurnLog() - { - } - - private static float ConvertByteToMegaByte(float _byte) - { - return _byte / 1024f / 1024f; - } - private static string GetBattleAndViewIdText() { string battleIdText = GetBattleIdText(); @@ -932,9 +744,9 @@ public class LocalLog private static string GetBattleIdText() { - if (ToolboxGame.RealTimeNetworkAgent != null) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach; log skips battle-id/socket-id { - long battleId = ToolboxGame.RealTimeNetworkAgent.GetBattleId(); + long battleId = 0; /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ if (battleId == -1) { return string.Empty; @@ -946,9 +758,9 @@ public class LocalLog private static string GetViewIdText() { - if (ToolboxGame.RealTimeNetworkAgent != null) + if (false) // Pre-Phase-5 (chunk 38): RTA has no static reach; log skips battle-id/socket-id { - int viewId = ToolboxGame.RealTimeNetworkAgent.GetViewId(); + int viewId = 0; /* Pre-Phase-5 chunk 38: dead branch (RTA static removed) */ if (viewId == 0) { return string.Empty; diff --git a/SVSim.BattleEngine/Engine/Wizard/LocalizeJson.cs b/SVSim.BattleEngine/Engine/Wizard/LocalizeJson.cs index 1945c8ef..5312d76d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LocalizeJson.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LocalizeJson.cs @@ -202,25 +202,4 @@ public class LocalizeJson } } } - - public static void LegacyParse(IDictionary dic, string region, string fileName, bool isTrimKey = false) - { - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset; - IDictionary dictionary = JsonMapper.ToObject(textAsset.ToString())[textAsset.name]; - foreach (string key in dictionary.Keys) - { - if (key != region) - { - continue; - } - IDictionary dictionary2 = (IDictionary)dictionary[region]; - { - foreach (string key2 in dictionary2.Keys) - { - dic.Add(isTrimKey ? key2.Trim() : key2, dictionary2[key2].ToString()); - } - break; - } - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/LootBoxDialogUtility.cs b/SVSim.BattleEngine/Engine/Wizard/LootBoxDialogUtility.cs index 557f2a8a..6ddaf684 100644 --- a/SVSim.BattleEngine/Engine/Wizard/LootBoxDialogUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/LootBoxDialogUtility.cs @@ -4,7 +4,6 @@ namespace Wizard; public static class LootBoxDialogUtility { - private const int LOOT_BOX_DIALOG_DEPTH = 3000; public static void CreateLootBoxRegulationDialog(PlayerStaticData.LootBoxType type) { @@ -46,26 +45,4 @@ public static class LootBoxDialogUtility dialogBase.SetTitleLabel(Data.SystemText.Get(key)); dialogBase.SetText(Data.SystemText.Get(key2)); } - - public static void CreatePurchaseNotificationLootBoxDialog(string titleLabel, string itemText, Action onClickPayment, Action onClickCancel) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(titleLabel); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Dia_BuyCrystal_004_Button")); - dialogBase.SetPanelDepth(3000); - dialogBase.onPushButton1 = onClickPayment; - dialogBase.onPushButton2 = onClickCancel; - string text = Data.SystemText.Get("Dia_LootBox_001", itemText); - if (PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.GACHA)) - { - text = text + "\n" + Data.SystemText.Get("Dia_LootBox_Item_001"); - } - if (PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.TWOPICK) || PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.SEALED) || PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.COLOSSEUM) || PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.COMPETITION)) - { - text = text + "\n" + Data.SystemText.Get("Dia_LootBox_Item_002"); - } - dialogBase.SetText(text); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MailReadTask.cs b/SVSim.BattleEngine/Engine/Wizard/MailReadTask.cs index 13d6492a..ce86c4e9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MailReadTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MailReadTask.cs @@ -12,10 +12,6 @@ public class MailReadTask : BaseTask public int state; } - public const int MAIL_READ = 1; - - public const int MAIL_DELETE = 3; - public MailReadTask(int state) { base.type = ApiType.Type.MailRead; @@ -39,7 +35,7 @@ public class MailReadTask : BaseTask } Data.ReadMail.data = new ReadMailDetail(); Data.ReadMail.data.total_recieve_count_list = new List(); - GameMgr.GetIns().GetMailTopTask().SetToFirstPage(); + /* Pre-Phase-5b: MailTopTask.SetToFirstPage dropped */ Data.MailTop.data = new MailDataDetail(); Data.MailTop.data.mail_data_list = new List(); Data.MailTop.data.mail_history_list = new List(); diff --git a/SVSim.BattleEngine/Engine/Wizard/Master.cs b/SVSim.BattleEngine/Engine/Wizard/Master.cs index cdb9fab7..0e864680 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Master.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Master.cs @@ -5,6 +5,10 @@ using System.Linq; using Cute; using LitJson; using UnityEngine; +// TODO(engine-cleanup-pass2): 310 of 317 methods unrun in baseline +// Type: Wizard.Master +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -15,10 +19,6 @@ public class Master void ReadCsvColumns(string[] columns); } - private List _twoPickBattleInfo; - - private List _chaosBattleInfo; - private List _roomChaosBattleInfo; private List _colosseumChaosBattleInfo; @@ -33,73 +33,27 @@ public class Master private List>> _classInfomationOrderList; - private List Paths = new List(); - - private const string AI_DECK_FILELIST_NAME = "ai_deck_filelist"; - - private const string AI_EMOTE_FILELIST_NAME = "ai_emote_filelist"; - - private const string AI_STYLE_COMMON_NAME = "ai_style_common"; - - private const string AI_STYLE_FILELIST_NAME = "ai_style_filelist"; - - private const string AI_COMMON_FILELIST_NAME = "ai_common_list"; - - private const string AI_ALLY_COMMON_FILELIST_NAME = "ai_ally_common_list"; - - private const string AI_BASIC_MASTER_FILENAME = "ai_basic"; - - private const int BATTLE_INFO_CHAOS_NUM = 5; - - public bool isMasterDataLoaded; - public List ClassCharacterList { get; private set; } - public Dictionary PackRarityEffectOverrideDic { get; private set; } - - public Dictionary GachaMaskDarkDic { get; private set; } - - public Dictionary SleeveSeriesIdDic { get; set; } - public Dictionary SleeveCategoryIdDic { get; set; } public Dictionary LeaderSkinSeriesIdDic { get; set; } - public Dictionary BuildDeckSeriesIdDic { get; set; } - - public Dictionary EmblemCategoryIdDic { get; set; } - - public Dictionary DegreeCategoryIdDic { get; set; } - - public Dictionary> BuildDeckCardListDic { get; set; } - - public Dictionary> HighRankEffect { get; set; } - - public List RankList { get; set; } - public SleeveMgr SleeveMgr { get; private set; } public EmblemMgr EmblemMgr { get; private set; } public DegreeMgr DegreeMgr { get; private set; } - public List CountryList { get; set; } - public List ItemList { get; set; } public List GiftTransitionList { get; set; } - public List RotationBattleInfo { get; set; } - - public List UnlimitedBattleInfo { get; set; } - - public List AvatarBattleInfo { get; set; } - public Dictionary> ClassInfomationOrder { get { - switch (GameMgr.GetIns().GetDataMgr().m_BattleType) + switch (DataMgr.BattleType.FreeBattle) // Pre-Phase-5b: headless has no BattleType { case DataMgr.BattleType.RoomTwoPick: case DataMgr.BattleType.TwoPickBackdraft: @@ -116,16 +70,10 @@ public class Master public Dictionary> AvatarClassInformationOrder { get; set; } - public List FusionBattleInfo { get; set; } - public List WhenPlayEffectKeywordMaster { get; set; } public List PuzzleQuestDataList { get; private set; } - public List PuzzleBattleMasterList { get; private set; } - - public Dictionary> TutorialDictionary { get; set; } - public List TutorialAreaSelectList { get; set; } public AICardDataAssetSet AIBasicDataList { get; set; } @@ -146,12 +94,8 @@ public class Master public PracticeAISettingDataSet PracticeAISettingList { get; set; } - public StoryAISettingDataSet StoryAISettingList { get; set; } - public StoryAISettingDataSet QuestAISettingList { get; set; } - public RankMatchAISettingDataSet RankMatchAISettingList { get; set; } - public List AICommonFileNameList { get; set; } public List AIAllyCommonFileNameList { get; set; } @@ -162,16 +106,10 @@ public class Master public AIStyleFileNameList AIStyleFileNameList { get; set; } - private IDictionary TutorialDic { get; set; } - public IDictionary BattleKeyWordDic { get; private set; } - public IDictionary BattleKeywordReplaceDic { get; private set; } - public IDictionary CardFilterKeywordReplaceDic { get; private set; } - public IDictionary BattleKeyWordTitleDic { get; private set; } - private IDictionary EmoteWordDic { get; set; } private IDictionary CardNameDic { get; set; } @@ -184,38 +122,22 @@ public class Master private IDictionary ItemTextDic { get; set; } - private IDictionary ArenaTextDic { get; set; } - public IDictionary SleeveTextDic { get; private set; } - private IDictionary SleeveSeriesTextDic { get; set; } - private IDictionary SleeveCategoryTextDic { get; set; } - private IDictionary SleeveProductTextDic { get; set; } - private IDictionary LeaderSkinProductTextDic { get; set; } private IDictionary LeaderSkinSeriesTextDic { get; set; } - private IDictionary BuildDeckProductTextDic { get; set; } - - private IDictionary BuildDeckSeriesTextDic { get; set; } - public IDictionary ClassCharaTextDic { get; private set; } public IDictionary EmblemTextDic { get; private set; } - private IDictionary EmblemCategoryTextDic { get; set; } - public IDictionary DegreeTextDic { get; private set; } - private IDictionary DegreeCategoryTextDic { get; set; } - private IDictionary DegreeAchievementTextDic { get; set; } - private IDictionary MasterRankingSeasonTextDic { get; set; } - private Dictionary MyPageBGTextDic { get; set; } public CardSetNameMgr CardSetNameMgr { get; private set; } @@ -230,8 +152,6 @@ public class Master public IDictionary> RelationCardSortDic { get; private set; } - public CardFilterKeyWordMaster CardFilterKeyWord { get; private set; } - public Dictionary> GleamingGemListMaster { get; set; } public Dictionary MyPageCustomBGMaster { get; private set; } @@ -280,266 +200,6 @@ public class Master return null; } - public void Refresh(AICsvLoadingInfo aiLoadInfo) - { - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("tutorialtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("tutorial_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("tutorial_areaselect_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("story_tutorial_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("cardnametext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("tribenametext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("skilldesctext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("flavourtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleevenametext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeveseriestext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleevecategorytext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("builddeckproducttext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("builddeckseriestext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeveproducttext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("leaderskinproducttext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("leaderskinseriestext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("classcharanametext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("emblemtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("emblemcategorytext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("degreetext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("degreecategorytext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("degreeachievementtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("masterrankingseasontext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battlekeyword", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battlekeywordreplace", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("cardfilterkeywordreplace", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("emotetext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("itemtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("arenatext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("cardsetnametext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("cardvoicetext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("practicetext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("countrytext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("storysectiontitletext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("mypagebgtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("redethercampaign", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("card_detail_voice_ignore_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("relationcardsort", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("class_chara_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("pack_rarity_effect_override", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("gacha_mask_dark", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("build_deck_package_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("build_deck_series_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_series_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("sleeve_category_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("leader_skin_series_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("emblem_data", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("emblem_category_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("degree_data", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("degree_category_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("country_data", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("rank_data", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("item_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("gift_transition", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battle_info_ts_rotation_" + Data.Load.data.RotationLatestCardPackId, ResourcesManager.AssetLoadPathType.Master)); - if (Data.ArenaData.TwoPickData.ChallengeData.LatestCardPackId > 0) - { - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battle_info_ts_rotation_" + Data.ArenaData.TwoPickData.ChallengeData.LatestCardPackId, ResourcesManager.AssetLoadPathType.Master)); - } - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battle_info_unlimited", ResourcesManager.AssetLoadPathType.Master)); - for (int i = 1; i < 6; i++) - { - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battle_info_chaos_" + i, ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("class_info_list_" + i, ResourcesManager.AssetLoadPathType.Master)); - } - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battle_info_avatar", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("fusion_info", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("puzzle_data", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("puzzle_battle_data", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("crossover_class_info_list", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("class_info_list_avatar", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("color_code", ResourcesManager.AssetLoadPathType.MasterEtc)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("card_filter_keyword_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("when_play_effect_keyword_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("high_rank_effect", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("mypage_custom_bg_master", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("gleaming_gem_list", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("radiant_crystal_list", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("gleaming_gem_list_v2", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("radiant_crystal_list_v2", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battlelogtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battlekeywordcategory", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("battleinfotext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("fusioninfotext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("arenatext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("firsttipstext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("chaostext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("puzzletext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("questtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("bingotext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("popularityvotetext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("storyroottext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("bossrushtext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("treasureboxcptext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("roombattletext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("beyondhandovertext", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("ai_style_common", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("practice_ai_setting", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("story_ai_setting", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("quest_ai_setting", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("rm_ai_setting", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("ai_deck_filelist", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("ai_common_list", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("ai_ally_common_list", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("ai_emote_filelist", ResourcesManager.AssetLoadPathType.Master)); - Paths.Add(Toolbox.ResourcesManager.GetAssetTypePath("ai_style_filelist", ResourcesManager.AssetLoadPathType.Master)); - Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupSync(Paths, delegate - { - LoadCardData(aiLoadInfo); - DeckListUtility.SetDeckListDataWithLodeIndex(); - }); - } - - private void LoadCardData(AICsvLoadingInfo aiLoadInfo) - { - StartLoadTutorialText(Toolbox.ResourcesManager.GetAssetTypePath("text/tutorialtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadTutorial(Toolbox.ResourcesManager.GetAssetTypePath("tutorial/tutorial_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadTutorialAreaSelect(Toolbox.ResourcesManager.GetAssetTypePath("tutorial/tutorial_areaselect_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadTutorial(Toolbox.ResourcesManager.GetAssetTypePath("tutorial/story_tutorial_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadCardNameText(Toolbox.ResourcesManager.GetAssetTypePath("text/cardnametext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadTribeNameText(Toolbox.ResourcesManager.GetAssetTypePath("text/tribenametext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSkillDescText(Toolbox.ResourcesManager.GetAssetTypePath("text/skilldesctext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadFlavourText(Toolbox.ResourcesManager.GetAssetTypePath("text/flavourtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeveText(Toolbox.ResourcesManager.GetAssetTypePath("text/sleevenametext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeveSeriesText(Toolbox.ResourcesManager.GetAssetTypePath("text/sleeveseriestext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeveCategoryText(Toolbox.ResourcesManager.GetAssetTypePath("text/sleevecategorytext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeveProductText(Toolbox.ResourcesManager.GetAssetTypePath("text/sleeveproducttext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadLeaderSkinProductText(Toolbox.ResourcesManager.GetAssetTypePath("text/leaderskinproducttext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadLeaderSkinSeriesText(Toolbox.ResourcesManager.GetAssetTypePath("text/leaderskinseriestext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadBuildDeckProductText(Toolbox.ResourcesManager.GetAssetTypePath("text/builddeckproducttext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadBuildDeckSeriesText(Toolbox.ResourcesManager.GetAssetTypePath("text/builddeckseriestext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadClassCharaText(Toolbox.ResourcesManager.GetAssetTypePath("text/classcharanametext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadEmblemText(Toolbox.ResourcesManager.GetAssetTypePath("text/emblemtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadEmblemCategoryText(Toolbox.ResourcesManager.GetAssetTypePath("text/emblemcategorytext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadDegreeText(Toolbox.ResourcesManager.GetAssetTypePath("text/degreetext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadDegreeCategoryText(Toolbox.ResourcesManager.GetAssetTypePath("text/degreecategorytext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadDegreeAchievementText(Toolbox.ResourcesManager.GetAssetTypePath("text/degreeachievementtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadMasterRankingSeazonText(Toolbox.ResourcesManager.GetAssetTypePath("text/masterrankingseasontext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadBattleKeyWordText(Toolbox.ResourcesManager.GetAssetTypePath("text/battlekeyword", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadBattleKeyWordReplaceText(Toolbox.ResourcesManager.GetAssetTypePath("text/battlekeywordreplace", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadCardFilterKeyWordReplaceText(Toolbox.ResourcesManager.GetAssetTypePath("text/cardfilterkeywordreplace", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadEmoteMasterText(Toolbox.ResourcesManager.GetAssetTypePath("text/emotetext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadItemMasterText(Toolbox.ResourcesManager.GetAssetTypePath("text/itemtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadArenaMasterText(Toolbox.ResourcesManager.GetAssetTypePath("text/arenatext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadCardSetNameText(Toolbox.ResourcesManager.GetAssetTypePath("text/cardsetnametext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadCardVoiceText(Toolbox.ResourcesManager.GetAssetTypePath("text/cardvoicetext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadPracticeText(Toolbox.ResourcesManager.GetAssetTypePath("text/practicetext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadStorySectionTitleText(Toolbox.ResourcesManager.GetAssetTypePath("text/storysectiontitletext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadMyPageBGText(Toolbox.ResourcesManager.GetAssetTypePath("text/mypagebgtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/battlelogtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/battlekeywordcategory", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/battleinfotext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/fusioninfotext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/arenatext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/firsttipstext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/chaostext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/puzzletext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/questtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/bingotext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/popularityvotetext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/storyroottext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/bossrushtext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/treasureboxcptext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/redethercampaign", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/roombattletext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSystemText(Toolbox.ResourcesManager.GetAssetTypePath("text/beyondhandovertext", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadCardDetailVoiceIgnoreData(Toolbox.ResourcesManager.GetAssetTypePath("card/card_detail_voice_ignore_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadRelationCardSort(Toolbox.ResourcesManager.GetAssetTypePath("card/relationcardsort", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadClassCharacter(Toolbox.ResourcesManager.GetAssetTypePath("chara/class_chara_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadPackRarityEffectOverride(Toolbox.ResourcesManager.GetAssetTypePath("pack/pack_rarity_effect_override", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadGachaMaskDark(Toolbox.ResourcesManager.GetAssetTypePath("pack/gacha_mask_dark", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadBuildDeckCards(Toolbox.ResourcesManager.GetAssetTypePath("builddeck/build_deck_package_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadBuildDeckSeries(Toolbox.ResourcesManager.GetAssetTypePath("builddeck/build_deck_series_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeve(Toolbox.ResourcesManager.GetAssetTypePath("sleeve/sleeve_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeveSeries(Toolbox.ResourcesManager.GetAssetTypePath("sleeve/sleeve_series_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSleeveCategory(Toolbox.ResourcesManager.GetAssetTypePath("sleeve/sleeve_category_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadSkinSeries(Toolbox.ResourcesManager.GetAssetTypePath("skin/leader_skin_series_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadEmblem(Toolbox.ResourcesManager.GetAssetTypePath("emblem/emblem_data", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadEmblemCategory(Toolbox.ResourcesManager.GetAssetTypePath("emblem/emblem_category_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadDegree(Toolbox.ResourcesManager.GetAssetTypePath("degree/degree_data", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadDegreeCategory(Toolbox.ResourcesManager.GetAssetTypePath("degree/degree_category_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadCountry(Toolbox.ResourcesManager.GetAssetTypePath("etc/country_data", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadRank(Toolbox.ResourcesManager.GetAssetTypePath("rank/rank_data", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadItem(Toolbox.ResourcesManager.GetAssetTypePath("item/item_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - GiftTransitionList = LoadList(GetFilename("item/gift_transition")); - StartLoadBattleInfos(); - LoadClassInfoList(); - LoadCrossOverClassInfoList(); - LoadAvatarClassInfoList(); - FusionBattleInfo = LoadList(GetFilename("battle/fusion_info")); - WhenPlayEffectKeywordMaster = LoadStringList(GetFilename("battle/when_play_effect_keyword_master")); - PuzzleQuestDataList = LoadList(GetFilename("battle/puzzle_data")); - PuzzleBattleMasterList = LoadList(GetFilename("battle/puzzle_battle_data")); - StartLoadCardFilterKeyword(Toolbox.ResourcesManager.GetAssetTypePath("card/card_filter_keyword_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - ColorCode.BuildData(); - StartLoadAIStyleCommonParam(Toolbox.ResourcesManager.GetAssetTypePath("ai/ai_style_common", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadPracticeAISettingData(Toolbox.ResourcesManager.GetAssetTypePath("ai/practice_ai_setting", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadStoryAISettingData(Toolbox.ResourcesManager.GetAssetTypePath("ai/story_ai_setting", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadQuestAISettingData(Toolbox.ResourcesManager.GetAssetTypePath("ai/quest_ai_setting", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadRankMatchAISettingData(Toolbox.ResourcesManager.GetAssetTypePath("ai/rm_ai_setting", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadHighRankEffect(Toolbox.ResourcesManager.GetAssetTypePath("chara/high_rank_effect", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadMyPageCustomBG(Toolbox.ResourcesManager.GetAssetTypePath("etc/mypage_custom_bg_master", ResourcesManager.AssetLoadPathType.Master, isfetch: true)); - StartLoadAICommonFileNameList(); - StartLoadAIAllyCommonFileNameList(); - StargLoadAIDeckFileNameList(); - StartLoadAIStyleFileNameList(); - StartLoadAIEmoteFileNameList(); - foreach (PuzzleQuestData puzzleQuestData in PuzzleQuestDataList) - { - puzzleQuestData.InitializeBattleMasterData(PuzzleBattleMasterList); - } - GleamingGemListMaster = StartLoadGofCards(GetFilename("battle/gleaming_gem_list")); - RadiantCrystalListMaster = StartLoadGofCards(GetFilename("battle/radiant_crystal_list")); - GleamingGemListV2Master = StartLoadGofCards(GetFilename("battle/gleaming_gem_list_v2")); - RadiantCrystalListV2Master = StartLoadGofCards(GetFilename("battle/radiant_crystal_list_v2")); - if (aiLoadInfo != null) - { - LoadAICsv(aiLoadInfo, delegate - { - LoadEmoteData(); - }); - } - else - { - LoadEmoteData(); - } - Data.Load.data.InitializeAfterMasterLoading(); - } - - private void StartLoadBattleInfos() - { - UnlimitedBattleInfo = LoadBattleInfo("battle/battle_info_unlimited"); - RotationBattleInfo = LoadBattleInfo("battle/battle_info_ts_rotation_" + Data.Load.data.RotationLatestCardPackId); - if (Data.ArenaData.TwoPickData.ChallengeData.LatestCardPackId > 0) - { - _twoPickBattleInfo = LoadBattleInfo("battle/battle_info_ts_rotation_" + Data.ArenaData.TwoPickData.ChallengeData.LatestCardPackId); - } - AvatarBattleInfo = LoadBattleInfo("battle/battle_info_avatar"); - _chaosBattleInfoList = new List>(); - for (int i = 1; i < 6; i++) - { - _chaosBattleInfoList.Add(LoadBattleInfo("battle/battle_info_chaos_" + i)); - } - if (Data.ArenaData.TwoPickData.ChallengeData.ChaosNum > 0) - { - _chaosBattleInfo = _chaosBattleInfoList[Data.ArenaData.TwoPickData.ChallengeData.ChaosNum - 1]; - } - if (Data.MyPageNotifications.data.RoomRule.RoomChaosNum > 0) - { - _roomChaosBattleInfo = _chaosBattleInfoList[Data.MyPageNotifications.data.RoomRule.RoomChaosNum - 1]; - } - if (Data.ArenaData.ColosseumData.ChaosNum > 0) - { - _colosseumChaosBattleInfo = _chaosBattleInfoList[Data.ArenaData.ColosseumData.ChaosNum - 1]; - } - } - public void LoadRoomChaosBattleInfo(int num) { if (num > 0 && _chaosBattleInfoList != null) @@ -556,102 +216,6 @@ public class Master } } - private List LoadBattleInfo(string data) - { - List source = LoadList(GetFilename(data)); - List validatedBattleInfo = source.Where((BattleInformation x) => x.Priority != -1).ToList(); - validatedBattleInfo = validatedBattleInfo.Where((BattleInformation x) => validatedBattleInfo.Where((BattleInformation y) => x.Priority == y.Priority).Count() == 1).ToList(); - return validatedBattleInfo.OrderBy((BattleInformation x) => x.Priority).ToList(); - } - - public List GetBattleInfo(bool isPlayer) - { - DataMgr.BattleType battleType = GameMgr.GetIns().GetDataMgr().m_BattleType; - switch (battleType) - { - case DataMgr.BattleType.Story: - case DataMgr.BattleType.Practice: - case DataMgr.BattleType.Quest: - case DataMgr.BattleType.BossRushQuest: - case DataMgr.BattleType.SecretBossQuest: - if (isPlayer && (Data.CurrentFormat == Format.Rotation || Data.CurrentFormat == Format.Crossover)) - { - return RotationBattleInfo; - } - if (isPlayer && Data.CurrentFormat == Format.Avatar) - { - return AvatarBattleInfo; - } - return UnlimitedBattleInfo; - case DataMgr.BattleType.Sealed: - return RotationBattleInfo; - default: - switch (Data.CurrentFormat) - { - case Format.Rotation: - case Format.Crossover: - return RotationBattleInfo; - case Format.TwoPick: - switch (GameMgr.GetIns().GetDataMgr().TwoPickFormat) - { - case TwoPickFormat.Cube: - case TwoPickFormat.BackdraftCube: - return UnlimitedBattleInfo; - case TwoPickFormat.Chaos: - case TwoPickFormat.BackdraftChaos: - switch (battleType) - { - case DataMgr.BattleType.RoomTwoPick: - case DataMgr.BattleType.TwoPickBackdraft: - return _roomChaosBattleInfo; - case DataMgr.BattleType.ColosseumTwoPick: - return _colosseumChaosBattleInfo; - default: - return _chaosBattleInfo; - } - default: - return _twoPickBattleInfo; - } - case Format.Unlimited: - case Format.Max: - case Format.Hof: - case Format.Windfall: - return UnlimitedBattleInfo; - case Format.Avatar: - return AvatarBattleInfo; - default: - return UnlimitedBattleInfo; - } - } - } - - private void LoadClassInfoList() - { - _classInfomationOrderList = new List>>(); - for (int i = 1; i < 6; i++) - { - List list = LoadList(GetFilename("battle/class_info_list_" + i)); - Dictionary> dictionary = new Dictionary>(); - for (int j = 0; j < list.Count; j++) - { - dictionary.Add(list[j].ChaosId, list[j].ClassIds); - } - _classInfomationOrderList.Add(dictionary); - } - if (Data.ArenaData.TwoPickData.ChallengeData.ChaosNum > 0) - { - _classInfomationOrder = _classInfomationOrderList[Data.ArenaData.TwoPickData.ChallengeData.ChaosNum - 1]; - } - if (Data.MyPageNotifications.data.RoomRule.RoomChaosNum > 0) - { - _roomClassInfomationOrder = _classInfomationOrderList[Data.MyPageNotifications.data.RoomRule.RoomChaosNum - 1]; - } - if (Data.ArenaData.ColosseumData.ChaosNum > 0) - { - _colosseumClassInfomationOrder = _classInfomationOrderList[Data.ArenaData.ColosseumData.ChaosNum - 1]; - } - } - public void SetRoomClassInfomationOrder(int num) { if (num > 0 && _classInfomationOrderList != null) @@ -668,360 +232,11 @@ public class Master } } - private void LoadCrossOverClassInfoList() - { - _crossOverClassInfomationOrder = new Dictionary(); - List list = LoadList(GetFilename("battle/crossover_class_info_list")); - for (int i = 0; i < list.Count; i++) - { - _crossOverClassInfomationOrder.Add(list[i].KeyClassIds, list[i].ValueClassIds); - } - } - public List GetCrossOverClassInfoListOrNull(int mainClass, int subClass) { return _crossOverClassInfomationOrder.GetValueOrDefault(mainClass + "|" + subClass, null)?.Split('|').Select(int.Parse).ToList(); } - private void LoadAvatarClassInfoList() - { - AvatarClassInformationOrder = new Dictionary>(); - List list = LoadList(GetFilename("battle/class_info_list_avatar")); - for (int i = 0; i < list.Count; i++) - { - AvatarClassInformationOrder.Add(list[i].ChaosId, list[i].ClassIds); - } - } - - public void LoadEmoteData() - { - List emotionCsvDownLoadPath = new List(); - List emotionCsvLoadPath = new List(); - List skinidList = new List(); - for (int i = 0; i < ClassCharacterList.Count; i++) - { - int skin_id = ClassCharacterList[i].skin_id; - string text = $"emote_chara_{skin_id}"; - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(text, ResourcesManager.AssetLoadPathType.CharaMaster); - if (Toolbox.ResourcesManager.CheckBeforeFileRequeset(assetTypePath)) - { - emotionCsvDownLoadPath.Add(assetTypePath); - emotionCsvLoadPath.Add(text); - skinidList.Add(skin_id); - } - } - Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupSync(emotionCsvDownLoadPath, delegate - { - StartLoadEmoteData(emotionCsvLoadPath, skinidList); - Toolbox.ResourcesManager.RemoveAssetGroup(emotionCsvDownLoadPath); - Toolbox.ResourcesManager.RemoveAssetGroup(Paths); - isMasterDataLoaded = true; - }); - } - - public void StartLoadCardDetailVoiceIgnoreData(string fileName) - { - CardDetailVoiceIgnoreList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - CardDetailVoiceIgnoreList.Add(item[0]); - } - } - - public void StartLoadRelationCardSort(string fileName) - { - RelationCardSortDic = new Dictionary>(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - int key = int.Parse(item[0]); - List sortList = new List(); - item[1].Split(':').ToList().ForEach(delegate(string c) - { - sortList.Add(int.Parse(c)); - }); - RelationCardSortDic.Add(key, sortList); - } - } - - public void StartLoadTutorialText(string fileName) - { - TutorialDic = new Dictionary(); - LoadLocalizeJsonAndParse(TutorialDic, fileName); - } - - public void StartLoadCardNameText(string fileName) - { - CardNameDic = new Dictionary(); - LoadLocalizeJsonAndParse(CardNameDic, fileName); - } - - public void StartLoadBattleKeyWordText(string fileName) - { - Dictionary dictionary = new Dictionary(); - LoadLocalizeJsonAndParse(dictionary, fileName); - BattleKeyWordTitleDic = new Dictionary(); - BattleKeyWordDic = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (KeyValuePair item in dictionary) - { - string text = item.Key.Replace("Battle_keyword_Title_", "Battle_keyword_"); - if (text == item.Key) - { - break; - } - string value = item.Value; - string value2 = dictionary[text]; - if (!BattleKeyWordDic.ContainsKey(value)) - { - BattleKeyWordDic.Add(value, value2); - BattleKeyWordTitleDic.Add(item.Key, value); - } - } - } - - public void StartLoadBattleKeyWordReplaceText(string filename) - { - Dictionary dictionary = new Dictionary(); - LoadLocalizeJsonAndParse(dictionary, filename); - char[] separator = new char[1] { ',' }; - BattleKeywordReplaceDic = new Dictionary(dictionary.Count); - foreach (string value in dictionary.Values) - { - if (!string.IsNullOrEmpty(value)) - { - string[] array = value.Split(separator); - BattleKeywordReplaceDic.Add(array[0], array[1]); - } - } - } - - public void StartLoadCardFilterKeyWordReplaceText(string filename) - { - Dictionary dictionary = new Dictionary(); - LoadLocalizeJsonAndParse(dictionary, filename); - char[] separator = new char[1] { ',' }; - CardFilterKeywordReplaceDic = new Dictionary(dictionary.Count); - foreach (string value in dictionary.Values) - { - if (!string.IsNullOrEmpty(value)) - { - string[] array = value.Split(separator); - CardFilterKeywordReplaceDic.Add(array[0], array[1]); - } - } - } - - public void StartLoadEmoteMasterText(string fileName) - { - EmoteWordDic = new Dictionary(); - LoadLocalizeJsonAndParse(EmoteWordDic, fileName); - } - - public void StartLoadItemMasterText(string fileName) - { - ItemTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(ItemTextDic, fileName); - } - - public void StartLoadArenaMasterText(string fileName) - { - ArenaTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(ArenaTextDic, fileName); - } - - public void StartLoadTribeNameText(string fileName) - { - TribeNameDic = new Dictionary(); - LoadLocalizeJsonAndParse(TribeNameDic, fileName); - } - - public void StartLoadSkillDescText(string fileName) - { - SkillDescDic = new Dictionary(); - LoadLocalizeJsonAndParse(SkillDescDic, fileName); - } - - public void StartLoadFlavourText(string fileName) - { - FlavourTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(FlavourTextDic, fileName); - } - - public void StartLoadSleeveText(string fileName) - { - SleeveTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(SleeveTextDic, fileName); - } - - public void StartLoadSleeveSeriesText(string fileName) - { - SleeveSeriesTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(SleeveSeriesTextDic, fileName); - } - - public void StartLoadSleeveCategoryText(string fileName) - { - SleeveCategoryTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(SleeveCategoryTextDic, fileName); - } - - public void StartLoadSleeveProductText(string fileName) - { - SleeveProductTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(SleeveProductTextDic, fileName); - } - - public void StartLoadLeaderSkinProductText(string fileName) - { - LeaderSkinProductTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(LeaderSkinProductTextDic, fileName); - } - - public void StartLoadLeaderSkinSeriesText(string fileName) - { - LeaderSkinSeriesTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(LeaderSkinSeriesTextDic, fileName); - } - - public void StartLoadBuildDeckSeriesText(string fileName) - { - BuildDeckSeriesTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(BuildDeckSeriesTextDic, fileName); - } - - public void StartLoadBuildDeckProductText(string fileName) - { - BuildDeckProductTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(BuildDeckProductTextDic, fileName); - } - - public void StartLoadClassCharaText(string fileName) - { - ClassCharaTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(ClassCharaTextDic, fileName); - } - - private void StartLoadEmblemText(string fileName) - { - EmblemTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(EmblemTextDic, fileName, isTrimKey: true); - } - - public void StartLoadEmblemCategoryText(string fileName) - { - EmblemCategoryTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(EmblemCategoryTextDic, fileName); - } - - private void StartLoadDegreeText(string fileName) - { - DegreeTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(DegreeTextDic, fileName, isTrimKey: true); - } - - public void StartLoadDegreeCategoryText(string fileName) - { - DegreeCategoryTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(DegreeCategoryTextDic, fileName); - } - - public void StartLoadDegreeAchievementText(string fileName) - { - DegreeAchievementTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(DegreeAchievementTextDic, fileName); - } - - public void StartLoadMyPageBGText(string fileName) - { - MyPageBGTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(MyPageBGTextDic, fileName); - } - - private void StartLoadMasterRankingSeazonText(string fileName) - { - MasterRankingSeasonTextDic = new Dictionary(); - IDictionary dictionary = new Dictionary(); - LoadLocalizeJsonAndParse(dictionary, fileName, isTrimKey: true); - foreach (KeyValuePair item in dictionary) - { - MasterRankingSeasonTextDic.Add(int.Parse(item.Key), item.Value); - } - } - - private void StartLoadCardSetNameText(string fileName) - { - Dictionary dictionary = new Dictionary(); - LoadLocalizeJsonAndParse(dictionary, fileName, isTrimKey: true); - string text = "_long"; - string text2 = "_short"; - Dictionary dictionary2 = new Dictionary(); - Dictionary dictionary3 = new Dictionary(); - foreach (KeyValuePair item in dictionary) - { - string key = item.Key; - string empty = string.Empty; - Dictionary dictionary4 = null; - if (key.EndsWith(text)) - { - empty = text; - dictionary4 = dictionary2; - } - else - { - if (!key.EndsWith(text2)) - { - Data.SystemText.TextDictionary.Add(item.Key, item.Value); - continue; - } - empty = text2; - dictionary4 = dictionary3; - } - dictionary4.Add(key.Remove(key.Length - empty.Length), item.Value); - } - CardSetNameMgr = new CardSetNameMgr(); - foreach (string key2 in dictionary2.Keys) - { - CardSetNameMgr.Add(new CardSetName(key2, dictionary2[key2], dictionary3[key2])); - } - CardSetNameMgr.Setup(); - } - - public void StartLoadCardVoiceText(string fileName) - { - CardVoiceTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(CardVoiceTextDic, fileName); - } - - public void StartLoadPracticeText(string fileName) - { - PracticeTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(PracticeTextDic, fileName); - } - - public void StartLoadStorySectionTitleText(string fileName) - { - StorySectionTitleTextDic = new Dictionary(); - LoadLocalizeJsonAndParse(StorySectionTitleTextDic, fileName); - } - - private void StartLoadSystemText(string fileName) - { - LoadLocalizeJsonAndParseWithRegion(Data.SystemText.TextDictionary, Data.SystemText.RegionCode, fileName); - } - - public void LoadLocalizeJsonAndParse(IDictionary dic, string fileName, bool isTrimKey = false) - { - LoadLocalizeJsonAndParseWithRegion(dic, Data.SystemText.RegionCode, fileName, isTrimKey); - } - - public void LoadLocalizeJsonAndParseWithRegion(IDictionary dic, string region, string fileName, bool isTrimKey = false) - { - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset; - if (textAsset != null) - { - LocalizeJson.Parse(dic, region, textAsset.ToString(), isTrimKey); - } - } - public string GetText(Type key, IDictionary dic) { if (!dic.TryGetValue(key, out var value)) @@ -1031,11 +246,6 @@ public class Master return value; } - public string GetTutorialText(string key) - { - return GetText(key, TutorialDic); - } - public string GetEmoteWordText(string key) { return GetText(key, EmoteWordDic); @@ -1066,31 +276,16 @@ public class Master return GetText(key, ItemTextDic); } - public string GetArenaText(string key) - { - return GetText(key, ArenaTextDic); - } - public string GetSleeveText(string key) { return GetText(key, SleeveTextDic); } - public string GetSleeveSeriesText(string key) - { - return GetText(key, SleeveSeriesTextDic); - } - public string GetSleeveCategoryText(string key) { return GetText(key, SleeveCategoryTextDic); } - public string GetSleeveProductText(string key) - { - return GetText(key, SleeveProductTextDic); - } - public string GetLeaderSkinProductText(string key) { return GetText(key, LeaderSkinProductTextDic); @@ -1101,16 +296,6 @@ public class Master return GetText(key, LeaderSkinSeriesTextDic); } - public string GetBuildDeckProductText(string key) - { - return GetText(key, BuildDeckProductTextDic); - } - - public string GetBuildDeckSeriesText(string key) - { - return GetText(key, BuildDeckSeriesTextDic); - } - public string GetClassCharaText(string key) { return GetText(key, ClassCharaTextDic); @@ -1121,31 +306,16 @@ public class Master return GetText(key, EmblemTextDic); } - public string GetEmblemCategoryText(string key) - { - return GetText(key, EmblemCategoryTextDic); - } - public string GetDegreeText(string key) { return GetText(key, DegreeTextDic); } - public string GetDegreeCategoryText(string key) - { - return GetText(key, DegreeCategoryTextDic); - } - public string GetDegreeAchievementText(string key) { return GetText(key, DegreeAchievementTextDic); } - public string GetMasterRankingSeasonText(int key) - { - return GetText(key, MasterRankingSeasonTextDic); - } - public string GetCardVoiceText(string key) { return GetText(key, CardVoiceTextDic); @@ -1176,380 +346,6 @@ public class Master return list; } - public void StartLoadTutorial(string fileName) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - list.Add(new TutorialData(item)); - } - if (TutorialDictionary == null) - { - TutorialDictionary = new Dictionary>(); - } - for (int i = 0; i < list.Count; i++) - { - int tutorial_id = list[i].tutorial_id; - if (!TutorialDictionary.ContainsKey(tutorial_id)) - { - TutorialDictionary.Add(tutorial_id, new List()); - } - if (!string.IsNullOrEmpty(list[i].popup_title)) - { - list[i].popup_title = GetTutorialText(list[i].popup_title); - } - if (!string.IsNullOrEmpty(list[i].text1)) - { - list[i].text1 = GetTutorialText(list[i].text1); - } - if (!string.IsNullOrEmpty(list[i].text2)) - { - list[i].text2 = GetTutorialText(list[i].text2); - } - if (!string.IsNullOrEmpty(list[i].text3)) - { - list[i].text3 = GetTutorialText(list[i].text3); - } - TutorialDictionary[tutorial_id].Add(list[i]); - } - } - - public void StartLoadTutorialAreaSelect(string fileName) - { - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString()); - if (TutorialAreaSelectList == null) - { - TutorialAreaSelectList = new List(); - } - foreach (string[] item in list) - { - TutorialAreaSelectList.Add(new TutorialAreaSelect(item)); - } - } - - public void StartLoadClassCharacter(string fileName) - { - ClassCharacterList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - ClassCharacterList.Add(new ClassCharacterMasterData(item)); - } - foreach (int acquiredSkin in Data.Load.data.AcquiredSkinList) - { - ClassCharacterMasterData charaPrmBySkinId = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId(acquiredSkin); - if (charaPrmBySkinId != null) - { - charaPrmBySkinId.Acquired(); - charaPrmBySkinId.UnsetNew(); - } - } - } - - public void StartLoadPackRarityEffectOverride(string fileName) - { - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString()); - PackRarityEffectOverrideDic = new Dictionary(); - foreach (string[] item in list) - { - int key = int.Parse(item[0]); - int value = int.Parse(item[1]); - PackRarityEffectOverrideDic.Add(key, value); - } - } - - public void StartLoadGachaMaskDark(string filename) - { - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(filename) as TextAsset).ToString()); - GachaMaskDarkDic = new Dictionary(list.Count); - foreach (string[] item in list) - { - int key = int.Parse(item[0]); - CardPackManager.GachaMaskDark value = new CardPackManager.GachaMaskDark(item); - GachaMaskDarkDic.Add(key, value); - } - } - - public void StartLoadBuildDeckCards(string fileName) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - list.Add(new BuildDeckCard(item)); - } - BuildDeckCardListDic = new Dictionary>(); - for (int i = 0; i < list.Count; i++) - { - int id = list[i]._id; - List list2 = null; - if (!BuildDeckCardListDic.ContainsKey(id)) - { - list2 = new List(); - BuildDeckCardListDic.Add(id, list2); - } - else - { - list2 = BuildDeckCardListDic[id]; - } - list2.Add(list[i]); - } - } - - public void StartLoadBuildDeckSeries(string fileName) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - list.Add(new BuildDeckSeries(item)); - } - BuildDeckSeriesIdDic = new Dictionary(list.Count); - for (int i = 0; i < list.Count; i++) - { - BuildDeckSeriesIdDic.Add(list[i].Id, list[i]); - } - } - - public void StartLoadSleeve(string fileName) - { - SleeveMgr = new SleeveMgr(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - SleeveMgr.Add(new Sleeve(item)); - } - } - - public void StartLoadSleeveSeries(string fileName) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - list.Add(new SleeveSeries(item)); - } - SleeveSeriesIdDic = new Dictionary(list.Count); - for (int i = 0; i < list.Count; i++) - { - SleeveSeriesIdDic.Add(list[i].Id, list[i]); - } - } - - public void StartLoadSleeveCategory(string fileName) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - list.Add(new SleeveCategory(item)); - } - SleeveCategoryIdDic = new Dictionary(list.Count); - for (int i = 0; i < list.Count; i++) - { - SleeveCategoryIdDic.Add(list[i].Id, list[i]); - } - } - - public void StartLoadSkinSeries(string fileName) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - list.Add(new LeaderSkinSeries(item)); - } - LeaderSkinSeriesIdDic = new Dictionary(list.Count); - for (int i = 0; i < list.Count; i++) - { - LeaderSkinSeriesIdDic.Add(list[i].Id, list[i]); - } - } - - public void StartLoadEmblem(string fileName) - { - EmblemMgr = new EmblemMgr(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - EmblemMgr.Add(new Emblem(item)); - } - } - - public void StartLoadEmblemCategory(string fileName) - { - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString()); - List list2 = new List(list.Count); - foreach (string[] item in list) - { - list2.Add(new EmblemCategory(item)); - } - EmblemCategoryIdDic = new Dictionary(list2.Count); - int i = 0; - for (int count = list2.Count; i < count; i++) - { - EmblemCategoryIdDic.Add(list2[i].Id, list2[i]); - } - } - - public void StartLoadDegree(string fileName) - { - DegreeMgr = new DegreeMgr(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - DegreeMgr.Add(new Degree(item)); - } - } - - public void StartLoadDegreeCategory(string fileName) - { - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString()); - List list2 = new List(list.Count); - foreach (string[] item in list) - { - list2.Add(new DegreeCategory(item)); - } - DegreeCategoryIdDic = new Dictionary(list2.Count); - int i = 0; - for (int count = list2.Count; i < count; i++) - { - DegreeCategoryIdDic.Add(list2[i].Id, list2[i]); - } - } - - public void StartLoadCountry(string fileName) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("text/countrytext", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - Dictionary dictionary = new Dictionary(); - LoadLocalizeJsonAndParse(dictionary, assetTypePath); - CountryList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - CountryList.Add(new Country(item, dictionary)); - } - } - - public void StartLoadEmoteData(List fileNameList, List skinidList) - { - _emotionDic = new Dictionary>(); - for (int i = 0; i < skinidList.Count; i++) - { - int num = skinidList[i]; - string path = fileNameList[i]; - if (_emotionDic.ContainsKey(num.ToString())) - { - continue; - } - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.CharaMaster, isfetch: true)) as TextAsset; - if (!(textAsset != null)) - { - continue; - } - List list = Utility.ConvertCSV_Array(textAsset.ToString()); - Dictionary dictionary = new Dictionary(); - foreach (string[] item in list) - { - Emotion emotion = new Emotion(item); - ClassCharaPrm.EmotionType emotion_id = (ClassCharaPrm.EmotionType)emotion.emotion_id; - if (!dictionary.ContainsKey(emotion_id)) - { - dictionary.Add(emotion_id, emotion); - } - } - _emotionDic.Add(num.ToString(), dictionary); - textAsset = null; - } - } - - public void DynamicLoadEmoteData(List loadPathList, List keyList) - { - for (int i = 0; i < loadPathList.Count; i++) - { - if (_emotionDic.ContainsKey(keyList[i])) - { - continue; - } - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadPathList[i], ResourcesManager.AssetLoadPathType.CharaMaster, isfetch: true)) as TextAsset; - if (!(textAsset != null)) - { - continue; - } - List list = Utility.ConvertCSV_Array(textAsset.ToString()); - Dictionary dictionary = new Dictionary(); - foreach (string[] item in list) - { - Emotion emotion = new Emotion(item); - ClassCharaPrm.EmotionType emotion_id = (ClassCharaPrm.EmotionType)emotion.emotion_id; - if (!dictionary.ContainsKey(emotion_id)) - { - dictionary.Add(emotion_id, emotion); - } - } - _emotionDic.Add(keyList[i], dictionary); - textAsset = null; - } - } - - public string GetEmotionTypePath(string emotionId, ref List emotionCsvLoadPath) - { - string text = $"emote_chara_{emotionId}"; - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(text, ResourcesManager.AssetLoadPathType.CharaMaster); - emotionCsvLoadPath.Add(text); - return assetTypePath; - } - - public void StartLoadItem(string fileName) - { - ItemList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - ItemList.Add(new Item(item)); - } - } - - private string GetFilename(string data) - { - return Toolbox.ResourcesManager.GetAssetTypePath(data, ResourcesManager.AssetLoadPathType.Master, isfetch: true); - } - - private List LoadList(string filename) where T : ReadFromCsv, new() - { - List list = new List(); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(filename) as TextAsset; - if (textAsset == null) - { - return list; - } - foreach (string[] item2 in Utility.ConvertCSV_Array(textAsset.ToString())) - { - T item = new T(); - item.ReadCsvColumns(item2); - list.Add(item); - } - textAsset = null; - return list; - } - - private List LoadStringList(string filename) - { - List list = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(filename) as TextAsset).ToString())) - { - list.Add(item[0]); - } - return list; - } - - public void StartLoadRank(string fileName) - { - RankList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - RankList.Add(new Rank(item)); - } - } - - public void StartLoadCardFilterKeyword(string fileName) - { - CardFilterKeyWord = new CardFilterKeyWordMaster(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - CardFilterKeyWord.Add(item); - } - } - public void StartLoadAIBasicData() { AIBasicDataList = new AICardDataAssetSet(); @@ -1558,44 +354,6 @@ public class Master AIBasicDataList.ConvertCsvTextToAsset(csv); } - public void StartLoadHighRankEffect(string fileName) - { - HighRankEffect = new Dictionary>(); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset; - if (textAsset == null) - { - return; - } - JsonData jsonData = JsonMapper.ToObject(textAsset.text); - foreach (string key in jsonData.Keys) - { - JsonData jsonData2 = jsonData[key]; - List list = new List(); - for (int i = 0; i < jsonData2.Count; i++) - { - HighRankEffectInfo highRankEffectInfo = new HighRankEffectInfo(); - highRankEffectInfo.Prefab = jsonData2[i]["effect"].ToString(); - highRankEffectInfo.Delay = jsonData2[i]["delay"].ToInt(); - highRankEffectInfo.Layer = jsonData2[i]["layer"].ToInt(); - highRankEffectInfo.TargetBoneName = jsonData2[i]["bone"].ToString(); - list.Add(highRankEffectInfo); - } - HighRankEffect.Add(key, list); - } - } - - public void StartLoadMyPageCustomBG(string fileName) - { - MyPageCustomBGMaster = new Dictionary(); - MyPageCustomBGMasterList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - MyPageCustomBGMasterData myPageCustomBGMasterData = new MyPageCustomBGMasterData(item); - MyPageCustomBGMasterList.Add(myPageCustomBGMasterData); - MyPageCustomBGMaster.Add(myPageCustomBGMasterData.Id, myPageCustomBGMasterData); - } - } - public void StartLoadAICommonData(List fileList) { AICommonDataList = new AICardDataAssetSet(); @@ -1642,15 +400,6 @@ public class Master AIDeckDic.Add(fileName, aICardDataAssetSet); } - public void StartLoadAIStyleCommonParam(string fileName) - { - AIStyleCommonDataList = new List(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - AIStyleCommonDataList.Add(new AIPolicyDataAsset(item)); - } - } - public void StartLoadAIStyleData(int styleID) { if (AIStyleDic == null) @@ -1679,44 +428,6 @@ public class Master AIStyleDic.Add(fileName, list); } - public void StartLoadPracticeAISettingData(string fileName) - { - PracticeAISettingList = new PracticeAISettingDataSet(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - PracticeAISettingList.AddData(new PracticeAISettingData(item)); - } - } - - public void StartLoadStoryAISettingData(string fileName) - { - StoryAISettingList = new StoryAISettingDataSet(); - foreach (string[] item in Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - StoryAISettingList.AddData(new StoryAISettingData(item)); - } - } - - public void StartLoadQuestAISettingData(string fileName) - { - QuestAISettingList = new StoryAISettingDataSet(); - foreach (ArrayList item in Utility.ConvertCSV((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - string[] columns = (string[])item.ToArray(typeof(string)); - QuestAISettingList.AddData(new StoryAISettingData(columns)); - } - } - - public void StartLoadRankMatchAISettingData(string fileName) - { - RankMatchAISettingList = new RankMatchAISettingDataSet(); - foreach (ArrayList item in Utility.ConvertCSV((Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset).ToString())) - { - string[] columns = (string[])item.ToArray(typeof(string)); - RankMatchAISettingList.AddData(new RankMatchAISettingData(columns)); - } - } - public void StartLoadAIEmoteData(int emoteID) { if (AIEmoteDic == null) @@ -1745,13 +456,6 @@ public class Master AIEmoteDic.Add(fileName, list); } - private void StargLoadAIDeckFileNameList() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("ai/ai_deck_filelist", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(assetTypePath) as TextAsset; - AIDeckFileNameList = new AIDeckFileNameList(Utility.ConvertCSV_Array(textAsset.ToString())); - } - private void RegisterAIDeckCsvFilePath(List aiPaths, int deckID) { string fileName = AIDeckFileNameList.GetFileName(deckID); @@ -1761,18 +465,6 @@ public class Master } } - private void StartLoadAICommonFileNameList() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("ai/ai_common_list", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(assetTypePath) as TextAsset).ToString()); - AICommonFileNameList = new List(); - foreach (string[] item2 in list) - { - string item = item2[0]; - AICommonFileNameList.Add(item); - } - } - private void RegisterAICommonCsvFilePaths(List aiPaths) { for (int i = 0; i < AICommonFileNameList.Count; i++) @@ -1781,18 +473,6 @@ public class Master } } - private void StartLoadAIAllyCommonFileNameList() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("ai/ai_ally_common_list", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - List list = Utility.ConvertCSV_Array((Toolbox.ResourcesManager.LoadObject(assetTypePath) as TextAsset).ToString()); - AIAllyCommonFileNameList = new List(); - foreach (string[] item2 in list) - { - string item = item2[0]; - AIAllyCommonFileNameList.Add(item); - } - } - private void RegisterAIAllyCommonCsvFilePaths(List aiPaths) { for (int i = 0; i < AIAllyCommonFileNameList.Count; i++) @@ -1801,13 +481,6 @@ public class Master } } - private void StartLoadAIEmoteFileNameList() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("ai/ai_emote_filelist", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(assetTypePath) as TextAsset; - AIEmoteFileNameList = new AIEmoteFileNameList(Utility.ConvertCSV_Array(textAsset.ToString())); - } - private void RegisterAIEmoteCsvFilePath(List aiPaths, int emoteID) { string fileName = AIEmoteFileNameList.GetFileName(emoteID); @@ -1817,13 +490,6 @@ public class Master } } - private void StartLoadAIStyleFileNameList() - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath("ai/ai_style_filelist", ResourcesManager.AssetLoadPathType.Master, isfetch: true); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(assetTypePath) as TextAsset; - AIStyleFileNameList = new AIStyleFileNameList(Utility.ConvertCSV_Array(textAsset.ToString())); - } - private void RegisterAIStyleCsvFilePath(List aiPaths, int styleID) { string fileName = AIStyleFileNameList.GetFileName(styleID); @@ -1842,30 +508,7 @@ public class Master { StartLoadAIBasicAndCommonData(); StartLoadAIIndividualData(info); - GameMgr.GetIns().GetDataMgr().RegisterAllAIData(); - Toolbox.ResourcesManager.RemoveAssetGroup(aiPaths); - callBack.Call(); - }); - } - - public void LoadAICsvList(List infoList, Action callBack) - { - List aiPaths = new List(); - RegisterAICommonCsvPath(aiPaths); - for (int i = 0; i < infoList.Count; i++) - { - AICsvLoadingInfo info = infoList[i]; - RegisterAIIndividualCsvPath(aiPaths, info); - } - Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupSync(aiPaths, delegate - { - StartLoadAIBasicAndCommonData(); - for (int j = 0; j < infoList.Count; j++) - { - AICsvLoadingInfo info2 = infoList[j]; - StartLoadAIIndividualData(info2); - } - GameMgr.GetIns().GetDataMgr().RegisterAllAIData(); + /* Pre-Phase-5b: RegisterAllAIData dropped */ Toolbox.ResourcesManager.RemoveAssetGroup(aiPaths); callBack.Call(); }); @@ -1919,25 +562,4 @@ public class Master StartLoadAIEmoteData(info.EmoteId); StartLoadAIStyleData(info.StyleId); } - - public Dictionary> StartLoadGofCards(string fileName) - { - Dictionary> dictionary = new Dictionary>(); - TextAsset textAsset = Toolbox.ResourcesManager.LoadObject(fileName) as TextAsset; - if (textAsset == null) - { - return dictionary; - } - foreach (string[] item in Utility.ConvertCSV_Array(textAsset.ToString())) - { - int result = 0; - if (int.TryParse(item[0], out result)) - { - string[] source = item[1].Split(':'); - dictionary[result] = source.Select((string str) => int.Parse(str)).ToList(); - } - } - textAsset = null; - return dictionary; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MasterResetMonthTask.cs b/SVSim.BattleEngine/Engine/Wizard/MasterResetMonthTask.cs index ced9d93b..de2f906d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MasterResetMonthTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MasterResetMonthTask.cs @@ -8,7 +8,6 @@ namespace Wizard; public class MasterResetMonthTask : BaseTask { - private const int MASTER_RANK_NUMBER = 25; public MasterResetMonthTask() { diff --git a/SVSim.BattleEngine/Engine/Wizard/Mastershop.cs b/SVSim.BattleEngine/Engine/Wizard/Mastershop.cs index f8114cff..716ee0ec 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Mastershop.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Mastershop.cs @@ -23,18 +23,8 @@ public class Mastershop public int id => _id; - public string store_product_id => _store_product_id; - public string name => _name; - public string text => _text; - - public int price => _price; - - public int charge_jewel => _charge_jewel; - - public int free_jewel => _free_jewel; - public Shop(string[] record) { _id = int.Parse(record[0]); @@ -49,8 +39,6 @@ public class Mastershop private Dictionary _dictionary = new Dictionary(); - public Dictionary dictionary => _dictionary; - public string[] ProductIdList { get; private set; } public Mastershop(ArrayList list) diff --git a/SVSim.BattleEngine/Engine/Wizard/Matching_Competition.cs b/SVSim.BattleEngine/Engine/Wizard/Matching_Competition.cs deleted file mode 100644 index 2bded5ec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Matching_Competition.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using Cute; - -namespace Wizard; - -public class Matching_Competition : Matching -{ - public Matching_Competition() - { - errorDialogReturnText = Data.SystemText.Get("Sealed_BattleResult_0001"); - } - - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, need_init, log); - CompetitionBattleDoMatchingTask task = new CompetitionBattleDoMatchingTask(selectDeckID, need_init, (int)log); - ConnectAPI(task, delegate - { - if (Data.DoMatchingDetail.data.matchingState != 3009) - { - DoMatchingResultSetting(); - onFinished.Call(); - } - }); - } - - protected override void TimeOutMessageToRetry() - { - SystemText systemText = Data.SystemText; - ErrorDialogWithRetry(systemText.Get("Battle_0461"), systemText.Get("Battle_0412")); - Data.ArenaData.CompetitionData.IsRankMatching = false; - } - - public override FinishTaskBase GetBattleFinishTask() - { - return new CompetitionBattleFinishTask(); - } - - protected override void GotoDeckSelectScene() - { - UIManager uiMgr = UIManager.GetInstance(); - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - OnFinishChangeView = delegate - { - uiMgr.CloseInSceneLoadingMatching(); - uiMgr.CloseInSceneLoadingBattle(); - } - }; - uiMgr.ChangeViewScene(UIManager.ViewScene.CompetitionLobby, param); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/Matching_Sealed.cs b/SVSim.BattleEngine/Engine/Wizard/Matching_Sealed.cs deleted file mode 100644 index a8890bc9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Matching_Sealed.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Cute; - -namespace Wizard; - -public class Matching_Sealed : Matching -{ - public Matching_Sealed() - { - errorDialogReturnText = Data.SystemText.Get("Sealed_BattleResult_0001"); - } - - public override void DoMatching(Action onFinished, int need_init, DO_MATCHING_LOG log) - { - base.DoMatching(onFinished, need_init, log); - SealedBattleDoMatchingTask task = new SealedBattleDoMatchingTask(selectDeckID, need_init, (int)log); - ConnectAPI(task, delegate - { - if (Data.DoMatchingDetail.data.matchingState != 3009) - { - DoMatchingResultSetting(); - onFinished.Call(); - } - }); - } - - protected override void TimeOutMessageToRetry() - { - SystemText systemText = Data.SystemText; - ErrorDialogWithRetry(systemText.Get("Battle_0461"), systemText.Get("Battle_0412")); - } - - public override FinishTaskBase GetBattleFinishTask() - { - return new SealedBattleFinishTask(); - } - - protected override void GotoDeckSelectScene() - { - UIManager uiMgr = UIManager.GetInstance(); - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - OnFinishChangeView = delegate - { - uiMgr.CloseInSceneLoadingMatching(); - uiMgr.CloseInSceneLoadingBattle(); - } - }; - uiMgr.ChangeViewScene(UIManager.ViewScene.Sealed, param); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MovieSubtitles.cs b/SVSim.BattleEngine/Engine/Wizard/MovieSubtitles.cs deleted file mode 100644 index 86075c5f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MovieSubtitles.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class MovieSubtitles : MonoBehaviour -{ - private class SubtitlesData - { - public string Text { get; private set; } - - public int StartPositionTime { get; private set; } - - public int EndPositionTime { get; private set; } - - public SubtitlesData(string text, int startPositionTime, int endPositionTime) - { - Text = text; - StartPositionTime = startPositionTime; - EndPositionTime = endPositionTime; - } - } - - private enum eStateSubtitles - { - READY, - WAIT_DISPLAY_START, - WAIT_DISPLAY_END, - FINISH - } - - [SerializeField] - private UILabel _labelMovieSubtitles; - - public void PlaySubtitles(string subtitlesCSV) - { - if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES)) - { - Finish(); - return; - } - List subtitlesDataList = ParseSubtitlesData(subtitlesCSV); - base.gameObject.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); - _labelMovieSubtitles.gameObject.SetActive(value: true); - StartCoroutine(ISubtitlesOnPlayMovie(subtitlesDataList)); - } - - public void Finish() - { - Object.Destroy(base.gameObject); - } - - private List ParseSubtitlesData(string subtitlesCSV) - { - List list = new List(); - foreach (ArrayList item in Utility.ConvertCSV(subtitlesCSV)) - { - string[] obj = (string[])item.ToArray(typeof(string)); - string text = obj[0]; - int startPositionTime = int.Parse(obj[1]); - int endPositionTime = int.Parse(obj[2]); - list.Add(new SubtitlesData(text, startPositionTime, endPositionTime)); - } - return list; - } - - private IEnumerator ISubtitlesOnPlayMovie(List subtitlesDataList) - { - int index = 0; - SubtitlesData data = null; - eStateSubtitles state = eStateSubtitles.READY; - _labelMovieSubtitles.text = string.Empty; - while (true) - { - switch (state) - { - case eStateSubtitles.READY: - if (index < subtitlesDataList.Count) - { - data = subtitlesDataList[index]; - state = eStateSubtitles.WAIT_DISPLAY_START; - } - else - { - state = eStateSubtitles.FINISH; - } - continue; - case eStateSubtitles.WAIT_DISPLAY_START: - if (Toolbox.MovieManager.GetSeekPosition() > data.StartPositionTime) - { - _labelMovieSubtitles.text = data.Text; - state = eStateSubtitles.WAIT_DISPLAY_END; - continue; - } - break; - case eStateSubtitles.WAIT_DISPLAY_END: - if (Toolbox.MovieManager.GetSeekPosition() > data.EndPositionTime) - { - _labelMovieSubtitles.text = string.Empty; - state = eStateSubtitles.READY; - index++; - continue; - } - break; - } - if (state == eStateSubtitles.FINISH) - { - break; - } - yield return null; - } - Finish(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MultiDeckSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/MultiDeckSelectDialog.cs deleted file mode 100644 index 9089270c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MultiDeckSelectDialog.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class MultiDeckSelectDialog : MonoBehaviour -{ - private int _deckCount; - - private List _deckList; - - private DeckSelectUIDialog _deckSelectDialog; - - private int _deckIndex; - - private const int CARD_VIEW_DEPTH_OFFSET = 800; - - public Action OnClose; - - public Action> OnDecide { get; set; } - - public static MultiDeckSelectDialog Create(int deckCount, Format format, string deckListHeader) - { - MultiDeckSelectDialog multiDeckSelectDialog = new GameObject().AddComponent(); - multiDeckSelectDialog.Initialize(deckCount, format, deckListHeader); - return multiDeckSelectDialog; - } - - private void Initialize(int deckCount, Format format, string deckListHeader) - { - _deckCount = deckCount; - _deckList = new List(); - for (int i = 0; i < deckCount; i++) - { - _deckList.Add(null); - } - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(format); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _deckSelectDialog = DeckSelectUIDialog.Create(deckListHeader, task.DeckGroupListData, format, DeckSelectUIDialog.eFormatChangeUIType.SingleFormat, isVisibleCreateNew: false, OnSelectDeck, new DeckSelectUI.InitOptions - { - OnUpdateDeckUICustomize = OnUpDateDeckUICustomize - }); - })); - } - - private void OnSelectDeck(DialogBase dialogDeckList, DeckData deck) - { - int num = SearchDeckIndex(deck); - if (num >= 0) - { - _deckList[num] = null; - for (int i = num + 1; i < _deckList.Count; i++) - { - _deckList[i - 1] = _deckList[i]; - _deckList[i] = null; - } - _deckIndex--; - } - else - { - _deckList[_deckIndex] = deck; - _deckIndex++; - if (_deckIndex >= _deckCount) - { - string text = Data.SystemText.Get("RoomBattle_0091"); - text += "\n\n"; - CompleteDeckDecideDialog completeDeckDecideDialog = CompleteDeckDecideDialog.CreateForMultiDeck(dialogDeckList, text, showSimpleStageOption: false, OnDecideDeckList, OnCancelDeckList); - DeckDecisionUI decisionUI = completeDeckDecideDialog.DecisionUI; - decisionUI.OptionLabel.text = Data.SystemText.Get("Gathering_0027"); - if (_deckCount == 1) - { - DialogBase dialog = completeDeckDecideDialog.Dialog; - dialog.SetButtonText(null, Data.SystemText.Get("Card_0083")); - dialog.onPushButton2 = decisionUI.OnClickCreateCardList; - dialog.ClickSe_Btn2 = Se.TYPE.SYS_BTN_DECIDE; - dialog.isNotCloseWindowButton2 = true; - decisionUI.SetDeckData(deck, null); - decisionUI.DeckName = deck.GetDeckName(); - decisionUI.CardListCustomize = delegate(UICardList uiCardList) - { - uiCardList.SetPanelDepthOffset(800); - UIPanel[] componentsInChildren = uiCardList.CardDetail.gameObject.GetComponentsInChildren(includeInactive: true); - for (int j = 0; j < componentsInChildren.Length; j++) - { - componentsInChildren[j].depth += 800; - } - }; - } - } - } - _deckSelectDialog.UpdateAllDeckUICurrentPage(); - } - - private void OnDecideDeckList() - { - OnDecide.Call(_deckList); - UnityEngine.Object.Destroy(base.gameObject); - OnClose.Call(); - } - - private void OnCancelDeckList() - { - for (int i = 0; i < _deckList.Count; i++) - { - _deckList[i] = null; - } - _deckIndex = 0; - _deckSelectDialog.UpdateAllDeckUICurrentPage(); - } - - private static bool IsSameDeck(DeckData deck1, DeckData deck2) - { - if (deck1.IsDefaultDeck() != deck2.IsDefaultDeck()) - { - return false; - } - return deck1.GetDeckID() == deck2.GetDeckID(); - } - - private int SearchDeckIndex(DeckData deck) - { - return _deckList.FindIndex((DeckData tempDeck) => tempDeck != null && IsSameDeck(tempDeck, deck)); - } - - private void OnUpDateDeckUICustomize(DeckUI deckUI) - { - if (deckUI.ViewType == DeckUI.eViewType.CreateNew || deckUI.ViewType == DeckUI.eViewType.Empty) - { - return; - } - if (_deckIndex >= _deckCount) - { - deckUI.SetSelectable(isSelectable: false); - return; - } - DeckData deck = deckUI.Deck; - if (!deck.IsUsable()) - { - deckUI.SetSelectable(isSelectable: false); - } - else if (_deckCount > 1) - { - int num = SearchDeckIndex(deck); - if (num >= 0) - { - deckUI.SetTextCenterLabe(Data.SystemText.Get("RoomBattle_0084", (num + 1).ToString())); - deckUI.SetSelectable(isSelectable: true); - deckUI.SetColorToGrey(isGrey: true); - } - else if (IsSelectedClass(deck)) - { - deckUI.SetTextCenterLabe(Data.SystemText.Get("RoomBattle_0085")); - deckUI.SetSelectable(isSelectable: false); - } - } - } - - private bool IsSelectedClass(DeckData deck) - { - List list = new List(); - bool useSubClass = FormatBehaviorManager.GetDefaultBehaviour(deck.Format).UseSubClass; - foreach (DeckData deck2 in _deckList) - { - if (deck2 != null) - { - list.Add(deck2.GetDeckClassID()); - if (useSubClass) - { - list.Add(deck2.GetDeckSubClassID()); - } - } - } - if (list.Contains(deck.GetDeckClassID())) - { - return true; - } - if (useSubClass && list.Contains(deck.GetDeckSubClassID())) - { - return true; - } - return false; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPage.cs b/SVSim.BattleEngine/Engine/Wizard/MyPage.cs index a2a8ec1b..04ba3476 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPage.cs @@ -3,6 +3,4 @@ namespace Wizard; public class MyPage : HeaderData { public MyPageDetail data; - - public bool CardUpdateFlag { get; set; } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageBGCustomDialog.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageBGCustomDialog.cs index cdd33e25..c24190e7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageBGCustomDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageBGCustomDialog.cs @@ -8,11 +8,6 @@ namespace Wizard; public class MyPageBGCustomDialog : MonoBehaviour { - private const string DECK_BUTTON_KEY = "deck"; - - private const string RANDOM_BUTTON_KEY = "random"; - - private const int RANDOM_PANEL_DEPTH = 650; [SerializeField] private ImageSelection _imageSelection; @@ -174,8 +169,4 @@ public class MyPageBGCustomDialog : MonoBehaviour _randomIdList = newSelectList; }); } - - private void OnDestroy() - { - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageBGRandomSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageBGRandomSelectDialog.cs index 050907fa..9605bcdc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageBGRandomSelectDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageBGRandomSelectDialog.cs @@ -40,7 +40,7 @@ public class MyPageBGRandomSelectDialog : MonoBehaviour _btnAllOff.onClick.Clear(); _btnAllOff.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + OnClickAllOffButton(); })); _imageSelection.Create(panelDepth, dialog); diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageCodeInputTask.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageCodeInputTask.cs deleted file mode 100644 index 03961403..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageCodeInputTask.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace Wizard; - -public class MyPageCodeInputTask : BaseTask -{ - public class MyPageCodeInputTaskParam : BaseParam - { - public string serial_code; - } - - public bool IsComplete { get; private set; } - - public MyPageCodeInputTask() - { - base.type = ApiType.Type.MyPageCodeInput; - } - - public void SetParameter(string inCode) - { - MyPageCodeInputTaskParam myPageCodeInputTaskParam = new MyPageCodeInputTaskParam(); - myPageCodeInputTaskParam.serial_code = inCode; - base.Params = myPageCodeInputTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - IsComplete = base.ResponseData["data"]["is_complete"].ToBoolean(); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGControl.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGControl.cs index 36ed214b..874871f8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGControl.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGControl.cs @@ -8,394 +8,33 @@ namespace Wizard; public class MyPageCustomBGControl : MonoBehaviour { - private const string PARTICLE_SORT_LAYER = "Default"; - - private const int CHARACTER_BACK_EFFECT_SORT_ORDER = 15; - - private const int RENDER_TEXTURE_DEPTH_BIT = 16; - - private const float FADE_TIME = 0.3f; - - private readonly Vector3 FADE_DESTROY_OFFSET = new Vector3(6000f, 0f, 0f); - - private const float RENDER_TEXTURE_BASE_SIZE = 2048f; - - private const float ASPECT_RATIO = 0.5625f; - - private const float ASPECT_RATIO_2 = 0.46153846f; - - private const float ASPECT_RATIO_REVERSE = 1.7777778f; - - [SerializeField] - private UITexture _bg; [SerializeField] private UITexture _character; - [SerializeField] - private GameObject _effectRoot; - - [SerializeField] - private GameObject _effectRootBG; - [SerializeField] private GameObject _root; [SerializeField] private UITexture _customBGTexture; - [SerializeField] - private Camera _customBGCamera; - - [SerializeField] - private GameObject _spineRoot; - - [SerializeField] - private GameObject _spineCameraPrefab; - - [SerializeField] - private GameObject _spineCameraParent; - - [SerializeField] - private SpineDisplay _spineDiaplay; - - [SerializeField] - private UITexture _spineTexture; - - [SerializeField] - private Camera _myPageParticleCamera; - - [SerializeField] - private GameObject _effectPositionDecideObject; - - [SerializeField] - private UIPanel _panel; - - private List _loadFileList = new List(); - private GameObject _frontEffect; - private List _frontEffectChild = new List(); - - private List _frontEffectLocalPosition = new List(); - private GameObject _backEffect; - private RenderTexture _renderTexture; - - private Camera _spineCamera; - - private float _characterAspectFixRate = 1f; - - private Vector3 _characterAspectOffset = Vector3.zero; - private float _fadeOutTimer; private bool _isFadeOut = true; - private bool _isFadeOutDestroy; - - private int _saveScreenWidth; - - private int _saveScreenHeight; - - private bool _isFadeOutStandbyCalled; - - private Shader _fadeoutShader; - - private Shader _normalShader; - private Action _onFadeFinish; private float _startShowTime; - public bool IsLoading { get; private set; } - - public string Id { get; private set; } = string.Empty; - - public bool IsLoadRequestEnd => Id != string.Empty; - - private string GetBackGroundTexturePath(string id, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(id, ResourcesManager.AssetLoadPathType.MyPageBackGround, isFetch); - } - - private string GetBackGroundMaterialPath(string id, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(id + "_M", ResourcesManager.AssetLoadPathType.MyPageBackGround, isFetch); - } - - private string GetBackGroundMaskPath(string id, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(id + "_mask", ResourcesManager.AssetLoadPathType.MyPageBackGround, isFetch); - } - - private string GetCharacterPath(string id, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(id, ResourcesManager.AssetLoadPathType.MyPageCharacter, isFetch); - } - - private string GetCharacterMaskPath(string id, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(id, ResourcesManager.AssetLoadPathType.MyPageCharacterMask, isFetch); - } - - private string GetEffectPath(string id, string footer, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath("scn_bg_mypage_" + id + "_" + footer, ResourcesManager.AssetLoadPathType.Effect2D, isFetch); - } - - private string GetSpineFileName(string id) - { - return "spine_mypage_" + id + "_body"; - } - - public void Load(string id, bool isDisplaySoon, Action onLoadFinish) - { - IsLoading = true; - Id = id; - _fadeoutShader = Shader.Find("Unlit/Transparent Colored MyPageFinal"); - _normalShader = Shader.Find("Unlit/Texture"); - _spineCamera = NGUITools.AddChild(_spineCameraParent, _spineCameraPrefab).GetComponent(); - _spineCamera.enabled = false; - _myPageParticleCamera.enabled = false; - _customBGTexture.alpha = 0f; - StartCoroutine(LoadResources(id, isDisplaySoon, onLoadFinish)); - } - public void SetEnable(bool enable) { _root.SetActive(enable); } - private IEnumerator LoadResources(string id, bool isDisplaySoon, Action onLoadFinish) - { - _loadFileList.Add(GetBackGroundTexturePath(id, isFetch: false)); - _loadFileList.Add(GetCharacterPath(id, isFetch: false)); - _loadFileList.Add(GetCharacterMaskPath(id, isFetch: false)); - _loadFileList.Add(GetEffectPath(id, "1", isFetch: false)); - _loadFileList.Add(GetEffectPath(id, "2", isFetch: false)); - _loadFileList.AddRange(_spineDiaplay.GetLoadPath(GetSpineFileName(id), fetch: false)); - if (Data.Master.MyPageCustomBGMaster[id].IsBGCardShader) - { - _loadFileList.Add(GetBackGroundMaterialPath(id, isFetch: false)); - _loadFileList.Add(GetBackGroundMaskPath(id, isFetch: false)); - } - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadFileList, null)); - InitializeBG(id); - _character.material = Toolbox.ResourcesManager.LoadObject(GetCharacterPath(id, isFetch: true)) as Material; - _character.onRender = SetCharacterMaterial; - _spineDiaplay.Initialize(GetSpineFileName(id), _spineTexture, _spineCamera); - _spineTexture.enabled = false; - _spineDiaplay.gameObject.SetActive(value: false); - _spineDiaplay.gameObject.SetActive(value: true); - _character.material.mainTexture = _spineTexture.mainTexture; - _character.material.SetTexture("_MaskTex", Toolbox.ResourcesManager.LoadObject(GetCharacterMaskPath(id, isFetch: true)) as Texture); - yield return InitializeEffect(id); - CreateRenderTexture(); - SetMasterData(id); - if (isDisplaySoon) - { - Show(); - } - else - { - SetEnable(enable: false); - } - _spineCamera.enabled = true; - _myPageParticleCamera.enabled = true; - _customBGTexture.onRender = SetRenderFinalTexture; - onLoadFinish.Call(); - IsLoading = false; - } - - private void InitializeBG(string id) - { - MyPageCustomBGMasterData myPageCustomBGMasterData = Data.Master.MyPageCustomBGMaster[id]; - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(GetBackGroundTexturePath(id, isFetch: true)) as Texture; - _bg.mainTexture = mainTexture; - if (myPageCustomBGMasterData.IsBGCardShader) - { - Material material = Toolbox.ResourcesManager.LoadObject(GetBackGroundMaterialPath(id, isFetch: true)) as Material; - Texture value = Toolbox.ResourcesManager.LoadObject(GetBackGroundMaskPath(id, isFetch: true)) as Texture; - material.SetTexture("_MainTex", _bg.mainTexture); - material.SetTexture("_MaskTex", value); - _bg.material = material; - } - } - - private void CreateRenderTexture() - { - if (!(_renderTexture != null)) - { - _renderTexture = new RenderTexture(2048, 1152, 16, RenderTextureFormat.ARGB32); - _renderTexture.name = "bgControl"; - _customBGCamera.targetTexture = _renderTexture; - _customBGTexture.mainTexture = _renderTexture; - UpdateUITextureSize(); - } - } - - private void UpdateUITextureSize() - { - Camera frontCamera = UIManager.GetInstance().FrontCamera; - _saveScreenWidth = frontCamera.pixelWidth; - _saveScreenHeight = frontCamera.pixelHeight; - Vector3 position = new Vector3(0f, 1f, 0f); - Vector3 position2 = new Vector3(1f, 0f, 0f); - Vector3 position3 = frontCamera.ViewportToWorldPoint(position); - Vector3 position4 = frontCamera.ViewportToWorldPoint(position2); - Vector3 vector = _customBGTexture.transform.InverseTransformPoint(position3); - Vector3 vector2 = _customBGTexture.transform.InverseTransformPoint(position4); - float num = frontCamera.pixelHeight; - float num2 = frontCamera.pixelWidth; - float num3 = num / num2; - if (num3 < 0.5625f) - { - float num4 = vector2.x - vector.x; - float num5 = num4 * 0.5625f; - _customBGTexture.width = (int)Math.Ceiling(num4); - _customBGTexture.height = (int)Math.Ceiling(num5); - } - else - { - float num6 = vector.y - vector2.y; - float num7 = num6 * 1.7777778f; - _customBGTexture.width = (int)Math.Ceiling(num7); - _customBGTexture.height = (int)Math.Ceiling(num6); - } - if (!string.IsNullOrEmpty(Id)) - { - MyPageCustomBGMasterData myPageCustomBGMasterData = Data.Master.MyPageCustomBGMaster[Id]; - _characterAspectFixRate = myPageCustomBGMasterData.Scale; - _characterAspectOffset = myPageCustomBGMasterData.Position; - if (num3 < 0.5625f) - { - float num8 = (0.5625f - num3) / 0.100961536f; - float num9 = myPageCustomBGMasterData.Scale2 - myPageCustomBGMasterData.Scale; - _characterAspectFixRate = num9 * num8 + myPageCustomBGMasterData.Scale; - _characterAspectOffset = (myPageCustomBGMasterData.Position2 - myPageCustomBGMasterData.Position) * num8 + myPageCustomBGMasterData.Position; - } - if (myPageCustomBGMasterData.IsFrontEffectAttachCharacter) - { - FixEffectPosition(); - } - } - if (!string.IsNullOrEmpty(Id)) - { - SetMasterData(Id); - } - } - - private void FixEffectPosition() - { - if (string.IsNullOrEmpty(Id)) - { - return; - } - MyPageCustomBGMasterData myPageCustomBGMasterData = Data.Master.MyPageCustomBGMaster[Id]; - float num = 1f + (_characterAspectFixRate - myPageCustomBGMasterData.Scale); - _effectRoot.transform.localScale = new Vector3(num, num, 1f); - if (myPageCustomBGMasterData.IsFrontEffectAttachCharacter) - { - for (int i = 0; i < _frontEffectChild.Count; i++) - { - _effectPositionDecideObject.transform.localPosition = _frontEffectLocalPosition[i]; - _frontEffectChild[i].transform.localPosition = _frontEffect.transform.InverseTransformPoint(_effectPositionDecideObject.transform.position); - } - } - } - - private IEnumerator InitializeEffect(string id) - { - MyPageCustomBGMasterData myPageCustomBGMasterData = Data.Master.MyPageCustomBGMaster[id]; - GameObject effectCharacterFront = (_frontEffect = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(GetEffectPath(id, "1", isFetch: true))) as GameObject); - effectCharacterFront.transform.parent = (myPageCustomBGMasterData.IsFrontEffectAttachCharacter ? _effectRoot.transform : _effectRootBG.transform); - effectCharacterFront.SetLayer(28, isSetChildren: true); - effectCharacterFront.transform.localPosition = new Vector3(0f, 0f, -6f); - effectCharacterFront.transform.localScale = Vector3.one * 320f; - if (myPageCustomBGMasterData.IsFrontEffectAttachCharacter) - { - Vector3 localPosition = _character.transform.localPosition; - Vector3 localScale = _character.transform.localScale; - _character.transform.localPosition = myPageCustomBGMasterData.Position; - _character.transform.localScale = new Vector3(myPageCustomBGMasterData.Scale, myPageCustomBGMasterData.Scale, 1f); - for (int i = 0; i < effectCharacterFront.transform.childCount; i++) - { - Transform child = effectCharacterFront.transform.GetChild(i); - _effectPositionDecideObject.transform.position = child.position; - _frontEffectChild.Add(child.gameObject); - _frontEffectLocalPosition.Add(_effectPositionDecideObject.transform.localPosition); - } - _character.transform.localPosition = localPosition; - _character.transform.localScale = localScale; - } - GameObject effectCharacterBack = (_backEffect = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(GetEffectPath(id, "2", isFetch: true))) as GameObject); - effectCharacterBack.transform.parent = (myPageCustomBGMasterData.IsBackEffectAttachCharacter ? _effectRoot.transform : _effectRootBG.transform); - effectCharacterBack.SetLayer(28, isSetChildren: true); - effectCharacterBack.transform.localPosition = new Vector3(0f, 0f, 7f); - effectCharacterBack.transform.localScale = Vector3.one * 320f; - Renderer[] componentsInChildren = effectCharacterBack.GetComponentsInChildren(); - foreach (Renderer obj in componentsInChildren) - { - obj.sortingLayerName = "Default"; - obj.sortingOrder = 15; - } - bool isLoading = true; - bool isLoading2 = true; - _loadFileList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectCharacterBack, delegate - { - isLoading = false; - })); - _loadFileList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectCharacterFront, delegate - { - isLoading2 = false; - })); - while (isLoading || isLoading2) - { - yield return null; - } - effectCharacterFront.SetActive(value: true); - effectCharacterBack.SetActive(value: true); - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - if (_renderTexture != null) - { - _renderTexture.Release(); - UnityEngine.Object.Destroy(_renderTexture); - _renderTexture = null; - } - } - - public void FadeOut() - { - _fadeOutTimer = 0.3f; - _isFadeOut = true; - } - - public void FadeoutStandby() - { - _spineRoot.transform.localPosition += FADE_DESTROY_OFFSET; - _root.transform.localPosition += FADE_DESTROY_OFFSET; - _isFadeOutStandbyCalled = true; - _panel.Refresh(); - } - - public void FadeOutDestroy() - { - if (!_isFadeOutStandbyCalled) - { - FadeoutStandby(); - } - _fadeOutTimer = 0.3f; - _isFadeOut = true; - _isFadeOutDestroy = true; - } - public void Show(Action onFadeFinish = null) { SetEnable(enable: true); @@ -444,77 +83,4 @@ public class MyPageCustomBGControl : MonoBehaviour { return material.shader.name.Contains("VariantMypage"); } - - private void SetMasterData(string id) - { - MyPageCustomBGMasterData myPageCustomBGMasterData = Data.Master.MyPageCustomBGMaster[id]; - _character.transform.localPosition = _characterAspectOffset; - Vector3 localScale = new Vector3(_characterAspectFixRate, _characterAspectFixRate, 1f); - _character.transform.localScale = localScale; - _spineTexture.transform.localPosition = myPageCustomBGMasterData.Position; - _spineTexture.transform.localScale = new Vector3(myPageCustomBGMasterData.Scale, myPageCustomBGMasterData.Scale, 1f); - _spineCamera.orthographicSize = myPageCustomBGMasterData.SpineCameraSize; - FixEffectPosition(); - } - - private void SetCharacterMaterial(Material material) - { - material.SetFloat("_SleeveSrcFactor", 5f); - material.SetFloat("_SleeveDstFactor", 10f); - if (!string.IsNullOrEmpty(Id)) - { - MyPageCustomBGMasterData myPageCustomBGMasterData = Data.Master.MyPageCustomBGMaster[Id]; - material.SetFloat("_MypageBoundaryAlpha", myPageCustomBGMasterData.ShaderAlphaBorder); - material.SetFloat("_MypageDivisionValue", myPageCustomBGMasterData.ShaderAlphaDevide); - } - } - - private void SetRenderFinalTexture(Material material) - { - material.shader = ((_fadeOutTimer > 0f) ? _fadeoutShader : _normalShader); - } - - private void CheckScreenSizeChange() - { - if (UIManager.GetInstance().FrontCameraPixelWidth != _saveScreenWidth || UIManager.GetInstance().FrontCameraPixelHeight != _saveScreenHeight) - { - UpdateUITextureSize(); - } - } - - private void Update() - { - CheckScreenSizeChange(); - if (_customBGTexture.alpha > 0.01f) - { - SetSpecialResetShaderParameter(); - } - if (_fadeOutTimer <= 0f || IsLoading) - { - return; - } - _fadeOutTimer -= Time.deltaTime; - if (_fadeOutTimer <= 0f) - { - _fadeOutTimer = 0f; - _onFadeFinish.Call(); - _onFadeFinish = null; - if (_isFadeOutDestroy) - { - UnityEngine.Object.Destroy(base.gameObject); - return; - } - } - float num = _fadeOutTimer / 0.3f; - float num2 = num; - if (!_isFadeOut) - { - num2 = 1f - num; - } - _customBGTexture.alpha = num2; - if ((num2 < 0.01f) & _isFadeOut) - { - _character.gameObject.SetActive(value: false); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGMasterData.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGMasterData.cs index 9f0d0373..a0e6ae94 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGMasterData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageCustomBGMasterData.cs @@ -22,10 +22,6 @@ public class MyPageCustomBGMasterData public float Scale2 { get; private set; } - public Vector3 Position => new Vector3(PositionX, PositionY, 0f); - - public Vector3 Position2 => new Vector3(PositionX2, PositionY2, 0f); - public bool IsFrontEffectAttachCharacter { get; private set; } public bool IsBackEffectAttachCharacter { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageDetail.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageDetail.cs index fd109638..ec8eed2d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageDetail.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageDetail.cs @@ -16,8 +16,6 @@ public class MyPageDetail public int unread_mail_count; - public int last_announce_id; - public DateTime last_announce_time; public int unreceived_mission_reward_count; @@ -28,32 +26,14 @@ public class MyPageDetail public List _subBannerInfoList; - public bool _isJoinConvention; - - public bool _isAdminWatcher; - - public string _conventionBattleStartTime; - - public bool IsExistUnfinishedBattle { get; set; } - - public bool IsExistUnfinishedRoom { get; set; } - - public int BattleFinishWaitTime { get; set; } - public float SinceTime { get; set; } public double ServerUnixTime { get; set; } public MyPageHomeDialogData MyPageHomeDialogData { get; set; } = new MyPageHomeDialogData(); - public bool IsChallangeMissionEnable { get; set; } - public RoomNonPossessionCardCampaign RoomNonPossessionCardCampaign { get; set; } - public bool IsPracticePuzzleBadgeEnable { get; set; } - - public bool CanGiveDailyLoginBonus { get; set; } - public MyPageBGInfo BGInfo { get; set; } = new MyPageBGInfo(); public SpeedChallengeInfo SpeedChallengeInfo { get; set; } @@ -72,11 +52,6 @@ public class MyPageDetail return true; } - public int GetRoomNonPossessionCardCampaignRemainTimeSec() - { - return (int)RoomNonPossessionCardCampaign.EndUnixTime - (int)GetNowUnixTime(); - } - private double GetNowUnixTime() { return ServerUnixTime + (double)Time.realtimeSinceStartup - (double)SinceTime; diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageFinishBattleTask.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageFinishBattleTask.cs deleted file mode 100644 index e0dd4fbe..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageFinishBattleTask.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using LitJson; - -namespace Wizard; - -public class MyPageFinishBattleTask : BaseTask -{ - public class MyPageFinishBattleParam : BaseParam - { - public int SDTRB; - } - - public Action UnfinishedBattleDialogCloseCallBack { get; set; } - - public MyPageFinishBattleTask() - { - base.type = ApiType.Type.MypageFinishBattle; - } - - public void SetParameter() - { - MyPageFinishBattleParam myPageFinishBattleParam = new MyPageFinishBattleParam(); - myPageFinishBattleParam.SDTRB = (int)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG, 0f); - base.Params = myPageFinishBattleParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - int num2 = 0; - string text = "check_unfinished_battle"; - if (base.ResponseData["data"].Keys.Contains(text) && base.ResponseData["data"][text] != null) - { - num2 = base.ResponseData["data"][text].ToInt(); - } - if (base.ResponseData["data"].Keys.Contains("treasure_info")) - { - JsonData jsonData = base.ResponseData["data"]["treasure_info"]; - if (jsonData != null) - { - Data.MyPageNotifications.data.CampaignBattleWin.Parse(jsonData); - } - } - if (base.ResponseData["data"].TryGetValue("upgrade_treasure_box_info", out var value)) - { - Data.TreasureBoxCp.Parse(value, base.ResponseData["data_headers"]); - } - if (num2 != 0) - { - GameMgr.GetIns().GetDataMgr().SetClassPrm(base.ResponseData["data"]["user_class_list"], base.ResponseData["data"]["user_rank_match_list"]); - Data.Load.data.ParseUserRank(base.ResponseData["data"]); - if (Data.MyPage.data.IsExistUnfinishedBattle) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetPanelDepth(15); - if (UnfinishedBattleDialogCloseCallBack != null) - { - dialogBase.OnClose = UnfinishedBattleDialogCloseCallBack; - } - switch (num2) - { - case 1: - try - { - switch (base.ResponseData["data"]["is_win"].ToInt()) - { - case 0: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0410")); - dialogBase.SetText(Data.SystemText.Get("Battle_0478")); - dialogBase.SetSize(DialogBase.Size.M); - break; - case 1: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0410")); - dialogBase.SetText(Data.SystemText.Get("Battle_0479")); - dialogBase.SetSize(DialogBase.Size.M); - break; - case 2: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0410")); - dialogBase.SetText(Data.SystemText.Get("Battle_0480")); - dialogBase.SetSize(DialogBase.Size.M); - break; - } - } - catch - { - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0410")); - dialogBase.SetText(Data.SystemText.Get("Battle_0402")); - dialogBase.SetSize(DialogBase.Size.M); - } - break; - case 2: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0412")); - dialogBase.SetText(Data.SystemText.Get("Battle_0401")); - break; - case 3: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0410")); - dialogBase.SetText(Data.SystemText.Get("Battle_0413")); - break; - case 4: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0410")); - dialogBase.SetText(Data.SystemText.Get("Battle_0474")); - break; - default: - dialogBase.SetTitleLabel(Data.SystemText.Get("Battle_0412")); - dialogBase.SetText(Data.SystemText.Get("Battle_0401")); - break; - } - if (base.ResponseData["data"].Keys.Contains("reward_list")) - { - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - } - if (base.ResponseData["data"].Keys.Contains("freebie_status")) - { - Data.ArenaData.CompetitionData.FreebieStatus = (ArenaCompetition.FreebieStatusType)base.ResponseData["data"]["freebie_status"].ToInt(); - } - } - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageHomeDialog.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageHomeDialog.cs index a593de59..db99229f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageHomeDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageHomeDialog.cs @@ -12,11 +12,6 @@ public class MyPageHomeDialog : MonoBehaviour private MyPageHomeDialogData _homeDialogData; - private List _loadPath = new List(); - - [SerializeField] - private UITexture _image; - public static void Create(GameObject prefab, MyPageHomeDialogData data, Action onFinish) { DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); @@ -34,84 +29,4 @@ public class MyPageHomeDialog : MonoBehaviour component._homeDialogData = data; UIManager.GetInstance().createInSceneCenterLoading(); } - - private void Start() - { - StartCoroutine(LoadResource(delegate - { - _dialog.SetObj(base.gameObject); - _dialog.gameObject.SetActive(value: true); - InitializeButtonAction(); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private void InitializeButtonAction() - { - List transitionList = _homeDialogData.TransitionList; - switch (transitionList.Count) - { - case 0: - _dialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - break; - case 1: - _dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueButton); - _dialog.SetButtonText(transitionList[0].ButtonText); - break; - case 2: - _dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueButton_BlueButton); - _dialog.SetButtonText(transitionList[0].ButtonText, transitionList[1].ButtonText); - break; - case 3: - _dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueButton_BlueButton_BlueButton); - _dialog.SetButtonText(transitionList[0].ButtonText, transitionList[1].ButtonText, transitionList[2].ButtonText); - break; - } - if (_homeDialogData.TransitionList.Count >= 1) - { - _dialog.onPushButton1 = delegate - { - OnClickButton(_homeDialogData.TransitionList[0]); - }; - } - if (_homeDialogData.TransitionList.Count >= 2) - { - _dialog.onPushButton2 = delegate - { - OnClickButton(_homeDialogData.TransitionList[1]); - }; - } - if (_homeDialogData.TransitionList.Count >= 3) - { - _dialog.onPushButton3 = delegate - { - OnClickButton(_homeDialogData.TransitionList[2]); - }; - } - } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadPath); - _loadPath.Clear(); - } - - private string GetImageFilePath(bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(_homeDialogData.FilePath, ResourcesManager.AssetLoadPathType.UiDownLoad, isFetch); - } - - private IEnumerator LoadResource(Action onFinish) - { - _loadPath.Add(GetImageFilePath(isFetch: false)); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadPath, null)); - _image.mainTexture = Toolbox.ResourcesManager.LoadObject(GetImageFilePath(isFetch: true)); - onFinish.Call(); - } - - private void OnClickButton(MyPageHomeDialogData.TransitionData transitionData) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - MyPageBannerBase.SceneChangeBySetting(transitionData.TransitionTarget, transitionData.Status); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageMaintenanceNotification.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageMaintenanceNotification.cs deleted file mode 100644 index 1e326c93..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageMaintenanceNotification.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public class MyPageMaintenanceNotification : MonoBehaviour -{ - [SerializeField] - private NotificatonAnimation _notificationAnimationPrefab; - - private NotificatonAnimation _notificationAnimation; - - private bool _isShow; - - private const float WAIT_TIME = 0.5f; - - private void Awake() - { - _notificationAnimation = NGUITools.AddChild(base.gameObject, _notificationAnimationPrefab.gameObject).GetComponent(); - _isShow = false; - } - - private void Update() - { - if (_isShow && (UIManager.GetInstance().WebViewHelper.IsOpenWebViewDialog() || UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.MyPage)) - { - Object.Destroy(base.gameObject); - } - } - - public IEnumerator Show(List paramList) - { - int waitCount = 0; - while (UIManager.GetInstance().isFading() || UIManager.GetInstance().WebViewHelper.IsOpenWebViewDialog() || waitCount <= 0) - { - yield return new WaitForSeconds(0.5f); - int num = waitCount + 1; - waitCount = num; - } - _isShow = true; - yield return StartCoroutine(_notificationAnimation.Exec(paramList)); - _isShow = false; - Object.Destroy(base.gameObject); - } - - private void OnDisable() - { - Object.Destroy(base.gameObject); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageOtherButtons.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageOtherButtons.cs index 99cb1c1d..9d72add8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageOtherButtons.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageOtherButtons.cs @@ -10,331 +10,12 @@ namespace Wizard; public class MyPageOtherButtons : UIBase { - [SerializeField] - private GameObject _dialogNotificationMenu; - - [SerializeField] - private GameObject _dialogContactMenu; - - [SerializeField] - private GameObject _dialogRewardScroll; - - [SerializeField] - private GameObject _dialogUserTicketCountPrefab; - - [SerializeField] - private UILabel _labelVideoHosting; - - [SerializeField] - private GameObject _buttonPool; - - [SerializeField] - private UIGrid _girdButtons; - - [SerializeField] - private UIButton _btnProfile; - - [SerializeField] - private UIButton _btnFriend; - - [SerializeField] - private UIButton _btnRanking; - - [SerializeField] - private GameObject _achievementIcon; - - [SerializeField] - private GameObject _achievementIconAndroid; - - [SerializeField] - private UIButton _btnSetting; - - [SerializeField] - private UIButton _btnReplay; - - [SerializeField] - private UIButton _btnHelp; - - [SerializeField] - private UIButton _btnGameGuide; - - [SerializeField] - private UIButton _btnItemsHistory; - - [SerializeField] - private UIButton _btnAchievement; - - [SerializeField] - private UIButton _btnData; - - [SerializeField] - private UIButton _btnAccountConnect; - - [SerializeField] - private UIButton _btnContact; - - [SerializeField] - private UIButton _btnNotification; - - [SerializeField] - private UIButton _btnSwitchLanguage; - - [SerializeField] - private UIButton _btnVideoHosting; - - [SerializeField] - private UIButton _btnCodeInput; - - [SerializeField] - private UIButton _btnReturnTitle; - - [SerializeField] - private UIButton _btnPortalSite; - - [SerializeField] - private UIButton _btnOffcialSite; - - [SerializeField] - private UIButton _btnSignInOut; - - [SerializeField] - private UIButton _btnTicketCount; - - [SerializeField] - private UIButton _informationButton; - - [SerializeField] - private GameObject _adjustSettingDialogPrefab; - - [SerializeField] - private UIButton _btnAdjustSetting; - - [SerializeField] - private UILabel _btnSignInOutLabel; - - private const int CODE_NUMBER_MAX = 16; - - private DialogBase _dialogCodeInput; - - private UIInput _codeInput; - - [SerializeField] - private UILabel _friendBadgeLabel; - - [SerializeField] - private UIButton _smallResourceButton; - - public List _enableOtherButtons { get; private set; } - - public UIButton btnAchievement => _btnAchievement; - - public UILabel FriendBadgeLabel => _friendBadgeLabel; - - public UIButton FriendButton => _btnFriend; - - private void Start() - { - _labelVideoHosting.text = VideoHostingUtil.GetVideoHostingSettingTitle(); - } - - public void Init() - { - List list = new List(); - list.Add(_btnSetting); - list.Add(_btnReplay); - list.Add(_btnHelp); - list.Add(_informationButton); - list.Add(_btnGameGuide); - list.Add(_btnTicketCount); - list.Add(_btnItemsHistory); - list.Add(_btnNotification); - list.Add(_btnData); - list.Add(_btnContact); - list.Add(_btnPortalSite); - list.Add(_btnOffcialSite); - list.Add(_btnSwitchLanguage); - list.Add(_btnCodeInput); - list.Add(_btnAdjustSetting); - list.Add(_btnReturnTitle); - for (int i = 0; i < list.Count; i++) - { - list[i].transform.parent = _girdButtons.transform; - } - if (_enableOtherButtons == null) - { - _enableOtherButtons = new List(); - } - _enableOtherButtons.Clear(); - _enableOtherButtons.Add(_btnProfile); - _enableOtherButtons.Add(_btnFriend); - _enableOtherButtons.Add(_btnRanking); - _enableOtherButtons.AddRange(list); - for (int j = 0; j < _enableOtherButtons.Count; j++) - { - _enableOtherButtons[j].gameObject.SetActive(value: true); - } - base.gameObject.SetActive(value: true); - _girdButtons.Reposition(); - _girdButtons.enabled = false; - _buttonPool.SetActive(value: false); - _btnAdjustSetting.onClick.Clear(); - _btnAdjustSetting.onClick.Add(new EventDelegate(delegate - { - OnClickAdjustSetting(); - })); - _informationButton.onClick.Clear(); - _informationButton.onClick.Add(new EventDelegate(delegate - { - OnClickInformation(); - })); - _smallResourceButton.onClick.Clear(); - _smallResourceButton.onClick.Add(new EventDelegate(delegate - { - OnClickSmallResourceButton(); - })); - } - - private void OnClickSmallResourceButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - int beforeSetting = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS); - Action onFinish = delegate - { - int value = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS); - if (beforeSetting != value) - { - SoftwareReset.exec(); - } - }; - Action onCancel = delegate - { - }; - SmallResourceSelectDialog.Create(onFinish, onCancel, isTitle: false); - } - - private void OnClickInformation() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.INFO); - })); - } - - private void UpdateSignInOutText() - { - if (!(_btnSignInOutLabel == null)) - { - SystemText systemText = Data.SystemText; - if (SocialServiceUtility.Instance.IsLoggedIn) - { - _btnSignInOutLabel.text = systemText.Get("OtherTop_0036"); - } - else - { - _btnSignInOutLabel.text = systemText.Get("OtherTop_0035"); - } - } - } protected override void OnDestroy() { base.OnDestroy(); } - public void OnBtnProfile() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Profile); - } - - public void OnBtnFriend() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Friend); - } - - public void OnBtnRanking() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Ranking); - } - - public void OnBtnSetting() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SettingBase.CreateDialog(); - } - - public void OnBtnReplay() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ReplayInfoTask replayInfoTask = new ReplayInfoTask(); - replayInfoTask.SetParameter(); - StartCoroutine(Toolbox.NetworkManager.Connect(replayInfoTask, delegate - { - ReplayDialog.Create(); - })); - } - - public void OnBtnHelp() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.HELP); - } - - public void OnBtnGameGuide() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.GAME_GUIDE); - } - - public void OnBtnUserTicketCount() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("OtherTop_0062")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - UserTicketCountDialog component = UnityEngine.Object.Instantiate(_dialogUserTicketCountPrefab).GetComponent(); - component.Init(dialogBase); - dialogBase.SetObj(component.gameObject); - } - - public void OnBtnItemHistory() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ItemAcquireHistoryInfoTask itemAcquireHistoryInfoTask = new ItemAcquireHistoryInfoTask(); - itemAcquireHistoryInfoTask.SetParameter(); - StartCoroutine(Toolbox.NetworkManager.Connect(itemAcquireHistoryInfoTask, _DisplayItemHistory, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } - - public void OnBtnAchievement() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - VideoHostingUtil.CheckVideoHostingAndShowAchievement(delegate - { - AchievementImpl.instance.ShowAchievements(delegate - { - UpdateSignInOutText(); - }); - }); - } - - public void OnBtnData() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (SingletonMonoBehaviour.instance.IsRecording() || SingletonMonoBehaviour.instance.IsPublising()) - { - VideoHostingUtil.CreateDialogPrivacyAccount(); - } - else - { - CreateDataLinkDialog(); - } - } - public static void CreateDataLinkDialog() { SystemText systemText = Data.SystemText; @@ -352,19 +33,6 @@ public class MyPageOtherButtons : UIBase dialogBase.SetSize(DialogBase.Size.M); } - public void OnBtnAccountConnect() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - if (SingletonMonoBehaviour.instance.IsRecording() || SingletonMonoBehaviour.instance.IsPublising()) - { - VideoHostingUtil.CreateDialogPrivacyAccount(); - } - else - { - CreateDialogAccountLink(); - } - } - public static void CreateDialogAccountLink(Action close_callback = null) { SystemText systemText = Data.SystemText; @@ -381,210 +49,4 @@ public class MyPageOtherButtons : UIBase dialogBase.SetText(text); dialogBase.SetSize(DialogBase.Size.M); } - - public void OnBtnContactSupport() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Con_Management_001_Title")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - GameObject gameObject = UnityEngine.Object.Instantiate(_dialogContactMenu); - gameObject.GetComponent().SetDialog(dialogBase); - dialogBase.SetObj(gameObject); - } - - public void OnBtnNotification() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("OtherTop_0014")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - GameObject obj = UnityEngine.Object.Instantiate(_dialogNotificationMenu); - dialogBase.SetObj(obj); - } - - public void OnBtnSwitchLanguage() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SwitchLanguage.Create(isForceConfirmDialog: false, isTitle: false, delegate(bool isChangeLanguage) - { - if (isChangeLanguage) - { - Toolbox.SavedataManager.SetString(SavedataManager.LANGUAGE_CHANGE, "TRUE"); - } - SoftwareReset.exec(); - }); - } - - public void OnBtnReturnTitle() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("OtherTop_0026")); - dialogBase.SetText(systemText.Get("OtherTop_0027")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("OtherTop_0028")); - dialogBase.onPushButton1 = delegate - { - SoftwareReset.exec(); - }; - } - - public void OnBtnVideoHosting() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ActivateVideoHosting(); - } - - private void ActivateVideoHosting() - { - if (SingletonMonoBehaviour.instance.IsVideoHostingSupported()) - { - VideoHostingUtil.CreateVideoHostingSetting(); - } - else - { - VideoHostingUtil.CreateDialogNotSupported(); - } - } - - public void OnBtnPortalSite() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - UIManager.ShowDialogUrl(Data.SystemText.Get("OtherTop_0030"), Data.SystemText.Get("URL_0002")); - } - - public void OnBtnOffcialSite() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SystemText systemText = Data.SystemText; - string text = "URL_0014"; - text += "_steam"; - UIManager.ShowDialogUrl(systemText.Get("OtherTop_0031"), systemText.Get(text)); - } - - public void OnBtnCodeInput() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - _dialogCodeInput = InputDialog.Create(16, 16); - _dialogCodeInput.InputAreaObjs.labels[2].text = Data.SystemText.Get("OtherCode_0009"); - _dialogCodeInput.InputAreaObjs.labels[3].text = ""; - _dialogCodeInput.SetTitleLabel(Data.SystemText.Get("OtherCode_0005")); - _dialogCodeInput.onPushButton1 = ReturnCodeInput; - _dialogCodeInput.SetButtonDisable(isEnableOK: true); - _codeInput = _dialogCodeInput.GetComponentInChildren(); - _codeInput.onChange.Add(new EventDelegate(OnChangeCodeInput)); - } - - private void OnChangeCodeInput() - { - _dialogCodeInput.SetButtonDisable(_codeInput.value.Length < 16); - } - - private void ReturnCodeInput() - { - string text = _dialogCodeInput.InputAreaObjs.labels[0].text; - MyPageCodeInputTask task = new MyPageCodeInputTask(); - task.SetParameter(text); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate(NetworkTask.ResultCode errorCode) - { - OnSuccessCodeInput(errorCode, task); - })); - } - - private void OnSuccessCodeInput(NetworkTask.ResultCode errorcode, MyPageCodeInputTask inputTask) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(Data.SystemText.Get("OtherCode_0011")); - if (inputTask.IsComplete) - { - dialogBase.SetText(Data.SystemText.Get("OtherCode_0012")); - } - else - { - dialogBase.SetText(Data.SystemText.Get("OtherCode_0010")); - } - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.onPushButton1 = delegate - { - MailTopTask mailTopTask = GameMgr.GetIns().GetMailTopTask(); - mailTopTask.SetParameter(isTutorial: false); - StartCoroutine(Toolbox.NetworkManager.Connect(mailTopTask, delegate - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Mail); - })); - }; - } - - public void OnBtnShutdown() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - Application.Quit(); - } - - public void OnBtnSignInOut() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - SystemText text = Data.SystemText; - try - { - if (SocialServiceUtility.Instance.IsLoggedIn) - { - SocialServiceUtility.Instance.SignOut(delegate - { - _btnSignInOutLabel.text = text.Get("OtherTop_0035"); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SOCIAL_ACHIEVEMENT_SIGNIN, flag: false); - }); - return; - } - StartCoroutine(SocialServiceUtility.Instance.SignIn(delegate(bool success) - { - if (success) - { - _btnSignInOutLabel.text = text.Get("OtherTop_0036"); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SOCIAL_ACHIEVEMENT_SIGNIN, flag: true); - } - })); - } - catch (Exception ex) - { - LocalLog.AccumulateTraceLog("サインイン・アウト処理失敗:" + ex); - } - } - - private void _DisplayItemHistory(NetworkTask.ResultCode result) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Mail_0050")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - UIManager.GetInstance().closeInSceneCenterLoading(); - GameObject gameObject = UnityEngine.Object.Instantiate(_dialogRewardScroll); - dialogBase.SetObj(gameObject); - DialogRewardScroll component = gameObject.GetComponent(); - ResourceHandler resourceHandler = base.gameObject.AddMissingComponent(); - component.Handler = resourceHandler; - component.CurrentList = Data.ItemAcquireHistoryInfo.Histories; - component.resetScrollWrap(); - dialogBase.OnClose = delegate - { - resourceHandler.UnloadAll(); - UnityEngine.Object.Destroy(resourceHandler); - }; - } - - private void OnClickAdjustSetting() - { - AdjustSendSettingDialog.Create(_adjustSettingDialogPrefab).OnChange = delegate(bool enable) - { - AdjustSettingUpdateTask adjustSettingUpdateTask = new AdjustSettingUpdateTask(); - adjustSettingUpdateTask.SetParameter(enable); - StartCoroutine(Toolbox.NetworkManager.Connect(adjustSettingUpdateTask, delegate - { - Data.Load.data._userConfig.SetArrowAdjustSend(enable); - })); - }; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageRefreshTask.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageRefreshTask.cs deleted file mode 100644 index 224ed896..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageRefreshTask.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Wizard; - -public class MyPageRefreshTask : BaseTask -{ - public class MyPageRefreshTaskParam : BaseParam - { - } - - public MyPageRefreshTask() - { - base.type = ApiType.Type.MypageRefresh; - } - - public void SetParameter() - { - MyPageRefreshTaskParam myPageRefreshTaskParam = new MyPageRefreshTaskParam(); - base.Params = myPageRefreshTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.Load.data._receiveInviteCount = base.ResponseData["data"]["friend_battle_invite_count"].ToInt(); - Data.MyPageNotifications.data.ShopNotification.SetShopNotification(base.ResponseData); - Data.MyPageNotifications.data.GatheringMyPageInfo.IsMatchingNotification = !string.IsNullOrEmpty(base.ResponseData["data"]["gathering_notification"]["matching_established_message"].ToString()); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MyPageSpecialWinRewardDialog.cs b/SVSim.BattleEngine/Engine/Wizard/MyPageSpecialWinRewardDialog.cs index 94c12d3d..62eb425d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyPageSpecialWinRewardDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyPageSpecialWinRewardDialog.cs @@ -9,7 +9,6 @@ namespace Wizard; public class MyPageSpecialWinRewardDialog : MonoBehaviour { - private const string GRADE_GAUGE_NAME = "gauge_bg_scale_15"; private float[] _memoryValue = new float[16] { @@ -17,8 +16,6 @@ public class MyPageSpecialWinRewardDialog : MonoBehaviour 0.67f, 0.738f, 0.806f, 0.875f, 0.943f, 1f }; - private const int TREASURE_BOX_SPRITE_GRADE = 5; - [SerializeField] private UISprite _boxSprite; @@ -92,8 +89,7 @@ public class MyPageSpecialWinRewardDialog : MonoBehaviour private void OnClickBoxReceiveRewards(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_LOTTERY_BOX_TOUCH); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + MypageReceiveSpecialTreasureTask receiveSpecialTreasureTask = new MypageReceiveSpecialTreasureTask(); receiveSpecialTreasureTask.SetParameter(); UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(receiveSpecialTreasureTask, delegate @@ -129,7 +125,7 @@ public class MyPageSpecialWinRewardDialog : MonoBehaviour yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(list, null)); _treasureEffectObj = UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); _treasureEffectObj.transform.parent = _boxOpenEffectObj.transform; - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_treasureEffectObj, null); + /* Pre-Phase-5b: SetUIParticleShader dropped */ _boxOpenEffectObj.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true); bg.alpha = 0f; box.alpha = 0f; @@ -147,7 +143,7 @@ public class MyPageSpecialWinRewardDialog : MonoBehaviour yield return new WaitForSeconds(0.8f); TweenAlpha.Begin(label.gameObject, 0.5f, 0f); iTween.MoveTo(box.gameObject, iTween.Hash("x", 0f, "time", 0.7f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_BOX_OPEN); + yield return new WaitForSeconds(1f); _treasureEffectObj.transform.localPosition = box.transform.localPosition; _treasureEffectObj.transform.localScale = Vector3.one * 320f * 1.75f; diff --git a/SVSim.BattleEngine/Engine/Wizard/MyRotationAllInfo.cs b/SVSim.BattleEngine/Engine/Wizard/MyRotationAllInfo.cs index 81c9c2dc..2777b329 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyRotationAllInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyRotationAllInfo.cs @@ -9,9 +9,6 @@ public class MyRotationAllInfo { public class PeriodData { - public DateTime BeginTime = DateTime.MaxValue; - - public DateTime EndTime = DateTime.MinValue; public double StartUnixTime { get; set; } @@ -20,8 +17,6 @@ public class MyRotationAllInfo private Dictionary _myRotationDictionary = new Dictionary(); - public PeriodData GatheringPeriod = new PeriodData(); - public PeriodData FreeMatchPeriod = new PeriodData(); private bool _myRotationScheduleExist; @@ -32,63 +27,14 @@ public class MyRotationAllInfo public List MyRotationInfoList { get; } = new List(); - public MyRotationInfo FirstPackInfo { get; private set; } - - public MyRotationInfo FirstPackInfoNemesis { get; private set; } - public List AbilityGroup { get; private set; } = new List(); public List DisableCardPackIdList { get; private set; } = new List(); - public bool IsFinishInitializeText { get; private set; } - public bool IsMyRotationEnable => IsWithinPeriod(FreeMatchPeriod); - public bool IsWithinGatheringPeriod => IsWithinPeriod(GatheringPeriod); - public bool IsWithinFreeMatchPeriod => IsWithinPeriod(FreeMatchPeriod); - public bool IsWithinCopyDeckIntroductionPeriod => IsWithinFreeMatchPeriod; - - public void InitializeText() - { - IsFinishInitializeText = true; - int num = int.MaxValue; - int num2 = int.MaxValue; - foreach (MyRotationInfo myRotationInfo in MyRotationInfoList) - { - myRotationInfo.InitializeText(); - int num3 = int.Parse(myRotationInfo.LastPackId); - if (num3 < num) - { - num = num3; - FirstPackInfo = myRotationInfo; - } - if (myRotationInfo.IsEnableNemesis && num3 < num2) - { - num2 = num3; - FirstPackInfoNemesis = myRotationInfo; - } - } - InitializeAbilityGroup(); - InitializeRePrintCard(); - } - - private void InitializeRePrintCard() - { - CardMaster instance = CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format.MyRotation).CardMasterId); - List allCardIds = instance.GetAllCardIds(); - List list = new List(allCardIds.Count); - foreach (int item in allCardIds) - { - list.Add(instance.GetCardParameterFromId(item)); - } - foreach (MyRotationInfo myRotationInfo in MyRotationInfoList) - { - myRotationInfo.InitializeRePrintCard(list); - } - } - public MyRotationInfo Get(string id) { if (string.IsNullOrEmpty(id)) @@ -102,111 +48,6 @@ public class MyRotationAllInfo return null; } - private void InitializeAbilityGroup() - { - if (MyRotationInfoList.Count == 0) - { - return; - } - MyRotationInfo myRotationInfo = MyRotationInfoList[0]; - MyRotationInfo lastPack = MyRotationInfoList[0]; - bool isFirst = true; - for (int i = 0; i < MyRotationInfoList.Count; i++) - { - MyRotationInfo myRotationInfo2 = MyRotationInfoList[i]; - if (!MyRotationInfo.IsEqualAbility(myRotationInfo, myRotationInfo2)) - { - AbilityGroup.Add(CreateGroup(myRotationInfo, lastPack, isFirst)); - isFirst = false; - myRotationInfo = (lastPack = myRotationInfo2); - } - else - { - lastPack = myRotationInfo2; - } - } - AbilityGroup.Add(CreateGroup(myRotationInfo, lastPack, isFirst)); - } - - private static MyRotationAbilityGroup CreateGroup(MyRotationInfo startPack, MyRotationInfo lastPack, bool isFirst) - { - int startNumber = int.Parse(startPack.LastPackId) - 10000; - int lastNumber = int.Parse(lastPack.LastPackId) - 10000; - string shortName = Data.Master.CardSetNameMgr.Get(startPack.LastPackId).ShortName; - string shortName2 = Data.Master.CardSetNameMgr.Get(lastPack.LastPackId).ShortName; - if (isFirst) - { - startNumber = int.Parse(startPack.FirstPackId) - 10000; - shortName = Data.Master.CardSetNameMgr.Get(startPack.FirstPackId).ShortName; - } - return new MyRotationAbilityGroup(startNumber, lastNumber, shortName, shortName2, startPack.Abilities); - } - - public void Parse(JsonData json, JsonData headerData) - { - JsonData jsonData = json["setting"]; - JsonData jsonData2 = json["restricted_base_card_id_list"]; - JsonData jsonData3 = json["abilities"]; - foreach (string key in jsonData.Keys) - { - MyRotationInfo myRotationInfo = new MyRotationInfo(jsonData[key]); - _myRotationDictionary[myRotationInfo.Id] = myRotationInfo; - MyRotationInfoList.Add(myRotationInfo); - } - if (jsonData2.IsObject) - { - foreach (string key2 in jsonData2.Keys) - { - _myRotationDictionary[key2].ParseRestrictJson(jsonData2[key2]); - } - } - JsonData jsonData4 = json["reprinted_base_card_ids"]; - if (jsonData4.IsObject) - { - foreach (string key3 in jsonData4.Keys) - { - _myRotationDictionary[key3].ParseRePrintJson(jsonData4[key3]); - } - } - if (jsonData3.IsObject) - { - foreach (MyRotationInfo myRotationInfo2 in MyRotationInfoList) - { - myRotationInfo2.ParseAbilitiesJson(jsonData3); - } - } - JsonData jsonData5 = json["schedules"]; - if (jsonData5.IsObject) - { - if (jsonData5.TryGetValue("gathering", out var value)) - { - SetPeriodData(GatheringPeriod, value); - } - if (jsonData5.TryGetValue("free_battle", out var value2)) - { - SetPeriodData(FreeMatchPeriod, value2); - _myRotationScheduleExist = true; - _receiveSinceTime = Time.realtimeSinceStartup; - _receiveServerUnixTime = headerData["servertime"].ToDouble(); - } - } - if (json.TryGetValue("disable_card_set_ids", out var value3)) - { - for (int i = 0; i < value3.Count; i++) - { - DisableCardPackIdList.Add(value3[i].ToString()); - } - } - } - - private void SetPeriodData(PeriodData period, JsonData jsonData) - { - period.BeginTime = DateTime.Parse(jsonData["begin_time"].ToString()); - period.EndTime = DateTime.Parse(jsonData["end_time"].ToString()); - period.StartUnixTime = ConvertTime.DateTimeToUnixTime(DateTime.Parse(jsonData["begin_time"].ToString())); - period.EndUnixTime = ConvertTime.DateTimeToUnixTime(DateTime.Parse(jsonData["end_time"].ToString())); - } - private bool IsWithinPeriod(PeriodData period) { if (!_myRotationScheduleExist) diff --git a/SVSim.BattleEngine/Engine/Wizard/MyRotationFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/MyRotationFormatBehavior.cs index bcf8e8f2..95055410 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyRotationFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyRotationFormatBehavior.cs @@ -61,7 +61,7 @@ public class MyRotationFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsEnableDeckShareButton(int cardNum, int cardNumMax) { @@ -70,22 +70,22 @@ public class MyRotationFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } private List GetAvailableCardSetNameList() diff --git a/SVSim.BattleEngine/Engine/Wizard/MyRotationInfo.cs b/SVSim.BattleEngine/Engine/Wizard/MyRotationInfo.cs index 43244548..2a954a68 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyRotationInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyRotationInfo.cs @@ -49,19 +49,8 @@ public class MyRotationInfo IconName = "my_rotation_ability_icon_" + abilityId; DarkIconName = "my_rotation_ability_icon_dark_" + abilityId; } - - public static bool IsEqual(MyRotationBonus left, MyRotationBonus right) - { - if (left.AbilityId == right.AbilityId && left.OriginalAbilityText == right.OriginalAbilityText && left.AddStartPp == right.AddStartPp && left.AddStartLife == right.AddStartLife && left.IncreaseAddPptotalTurn == right.IncreaseAddPptotalTurn) - { - return left.IncreaseAddPptotalAmount == right.IncreaseAddPptotalAmount; - } - return false; - } } - private const int NEMESIS_START_PACK_NUMBER = 7; - private List _restrictedCardData = new List(); private List _rePrintCardList = new List(); @@ -72,10 +61,6 @@ public class MyRotationInfo public string PackSelectText { get; private set; } - public string FirstPackId { get; private set; } - - public string LastPackId { get; private set; } - public string LastPackText { get; private set; } public List AbilityIdList { get; private set; } @@ -86,22 +71,6 @@ public class MyRotationInfo public bool IsEnableNemesis { get; private set; } - public static bool IsEqualAbility(MyRotationInfo left, MyRotationInfo right) - { - if (left.Abilities.Count != right.Abilities.Count) - { - return false; - } - for (int i = 0; i < left.Abilities.Count; i++) - { - if (!MyRotationBonus.IsEqual(left.Abilities[i], right.Abilities[i])) - { - return false; - } - } - return true; - } - public MyRotationInfo(JsonData json) { Id = json["rotation_id"].ToString(); @@ -109,84 +78,11 @@ public class MyRotationInfo AbilityIdList = new List(json["abilities"].ToString().Split('|')); } - public void ParseRestrictJson(JsonData rotationRoot) - { - List list = new List(); - foreach (string key in rotationRoot.Keys) - { - if (int.TryParse(key, out var result)) - { - list.Add(new UnlimitedRestrictedCard(result, rotationRoot[key].ToInt())); - } - } - _restrictedCardData = list; - } - public bool IsRePrintCard(int baseCardId) { return _rePrintCardList.Contains(baseCardId); } - public void ParseRePrintJson(JsonData rotationRoot) - { - List list = new List(); - if (rotationRoot.Count == 0) - { - _rePrintCardList = list; - return; - } - foreach (string key in rotationRoot.Keys) - { - list.Add(rotationRoot[key].ToInt()); - } - _rePrintCardList = list; - } - - public void ParseAbilitiesJson(JsonData abilities) - { - List list = new List(); - foreach (JsonData value in abilities.Values) - { - if (AbilityIdList.Contains(value["ability_id"].ToString())) - { - MyRotationBonus item = new MyRotationBonus(value["ability_id"].ToString(), value["ability"].ToString(), value["add_start_pp"].ToInt(), value["add_start_life"].ToInt(), value["increase_add_pptotal_turn"].ToInt(), value["increase_add_pptotal_amount"].ToInt(), value["ability_desc"].ToString()); - list.Add(item); - } - } - Abilities = list; - } - - public void InitializeText() - { - string text = null; - foreach (string cardPadkId in CardPadkIdList) - { - if (cardPadkId != 10000.ToString()) - { - text = cardPadkId; - break; - } - } - string text2 = CardPadkIdList[CardPadkIdList.Count - 1]; - string shortName = Data.Master.CardSetNameMgr.Get(text).ShortName; - string shortName2 = Data.Master.CardSetNameMgr.Get(text2).ShortName; - FirstPackId = text; - LastPackId = text2; - int num = int.Parse(text) - 10000; - int num2 = int.Parse(text2) - 10000; - PackSelectText = Data.SystemText.Get("Card_0296", shortName, shortName2, num.ToString(), num2.ToString()); - LastPackText = shortName2; - IsEnableNemesis = num2 >= 7; - } - - public void InitializeRePrintCard(List allCardParameter) - { - foreach (int rePrintCard in _rePrintCardList) - { - RePrintDictionary.Add(rePrintCard, new MyRotationRePrintInfo(rePrintCard, allCardParameter)); - } - } - public bool IsRePrintCardAvailablePack(int baseCardId, string cardPackId) { if (!RePrintDictionary.TryGetValue(baseCardId, out var value)) diff --git a/SVSim.BattleEngine/Engine/Wizard/MyRotationParts.cs b/SVSim.BattleEngine/Engine/Wizard/MyRotationParts.cs deleted file mode 100644 index b3049556..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/MyRotationParts.cs +++ /dev/null @@ -1,57 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class MyRotationParts : MonoBehaviour -{ - [SerializeField] - private UISprite _backGround; - - [SerializeField] - private UILabel _packNameLabel; - - [SerializeField] - private FlexibleGrid _backGroundGrid; - - [SerializeField] - private UIGrid _bonusIconGrid; - - [SerializeField] - private GameObject _bonusIconOriginal; - - private const int BACK_GROUND_PACK_NAME_OFFSET = 20; - - private const int BACK_GROUND_ICON_OFFSET = 28; - - public void SetMyRotationInfo(MyRotationInfo myRotationInfo) - { - if (myRotationInfo == null) - { - return; - } - if (_packNameLabel != null) - { - _packNameLabel.text = myRotationInfo.LastPackText; - } - _bonusIconOriginal.SetActive(value: false); - _bonusIconGrid.transform.DestroyChildren(); - foreach (MyRotationInfo.MyRotationBonus ability in myRotationInfo.Abilities) - { - GameObject obj = NGUITools.AddChild(_bonusIconGrid.gameObject, _bonusIconOriginal); - obj.GetComponent().spriteName = ability.IconName; - obj.SetActive(value: true); - } - _bonusIconGrid.Reposition(); - if (_backGround != null) - { - _backGround.rightAnchor.target = ((myRotationInfo.Abilities.Count > 0) ? _bonusIconGrid.transform : _packNameLabel.transform); - _backGround.rightAnchor.absolute = ((myRotationInfo.Abilities.Count > 0) ? 28 : 20); - } - } - - public void Reposition() - { - _backGroundGrid.Reposition(); - StartCoroutine(_backGroundGrid.RepositionNextFrame()); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/MyRotationPeriodSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/MyRotationPeriodSelectDialog.cs index 823e7c3c..899646da 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MyRotationPeriodSelectDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MyRotationPeriodSelectDialog.cs @@ -47,7 +47,7 @@ public class MyRotationPeriodSelectDialog : MonoBehaviour dialog.isNotCloseWindowButton2 = true; if (defaultSelectInfo == null) { - dialog.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + dialog.ClickSe_Btn1 = 0; } selectDialog.OnSelect(num); } @@ -66,9 +66,4 @@ public class MyRotationPeriodSelectDialog : MonoBehaviour { SelectInfo = _selectData[index]; } - - public MyRotationInfo GetMyRotationInfo(int index) - { - return _selectData[index]; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/MypageTreasureBoxCpOpenTask.cs b/SVSim.BattleEngine/Engine/Wizard/MypageTreasureBoxCpOpenTask.cs index 1df0ab6e..ff7c7287 100644 --- a/SVSim.BattleEngine/Engine/Wizard/MypageTreasureBoxCpOpenTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/MypageTreasureBoxCpOpenTask.cs @@ -29,12 +29,6 @@ public class MypageTreasureBoxCpOpenTask : BaseTask base.type = ApiType.Type.ReceiveUpgradeTreasureBox; } - public void SetParameter() - { - MypageTreasureBoxCpOpenTaskParam mypageTreasureBoxCpOpenTaskParam = new MypageTreasureBoxCpOpenTaskParam(); - base.Params = mypageTreasureBoxCpOpenTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard/NetworkDefine.cs b/SVSim.BattleEngine/Engine/Wizard/NetworkDefine.cs index 2c6588c5..a0ff3f5c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/NetworkDefine.cs +++ b/SVSim.BattleEngine/Engine/Wizard/NetworkDefine.cs @@ -7,102 +7,40 @@ public static class NetworkDefine public enum MAINTENANCE_TYPE { PROFILE_MAINTENANCE = 2001, - MYPAGE_MAINTENANCE = 2002, GIFT_MAINTENANCE = 2003, - SIGNUP_MAINTENANCE = 2004, - PAYMENT_MAINTENANCE_iOS = 2005, - PAYMENT_MAINTENANCE_ANDROID = 2006, - PAYMENT_MAINTENANCE_DMM = 2025, - PAYMENT_MAINTENANCE_STEAM = 2026, SHOP_CARDPACK_MAINTENANCE = 2007, SHOP_BUILDDECK_MAINTENANCE = 2032, SHOP_SLEEVE_MAINTENANCE = 2008, SHOP_SKIN_MAINTENANCE = 2024, SHOP_ITEM_MAINTENANCE = 2037, - ACHIEVEMENT_MAINTENANCE = 2009, MISSION_MAINTENANCE = 2010, - BP_POINT_MAINTENANCE = 2011, - FREEBATTLE_MAINTENANCE = 2012, - RANKBATTLE_MAINTENANCE = 2013, ROOM_BATTLE_MAINTENANCE = 2014, STORY_MAINTENANCE = 2015, - PRACTICE_MAINTENANCE = 2016, - ARENA_TWOPICK_MAINTENANCE = 2017, CARD_MAINTENANCE = 2018, DECK_MAINTENANCE = 2019, - TUTORIAL_MAINTENANCE = 2020, - ACCOUNT_MAINTENANCE = 2021, - FRIEND_MAINTENANCE = 2022, - ARENA_TWOPICK_BATTLE_MAINTENANCE = 2023, ROOM_TWOPICK_MAINTENANCE = 2029, ROOM_ALL_MAINTENANCE = 2030, ROOM_WATCHING_MAINTENANCE = 2031, - ROOM_RULE_BO1 = 2038, - ROOM_RULE_TWO_PICK = 2039, - ROOM_RULE_TWO_PICK_BACKDRAFT = 2040, - ROOM_RULE_BO3 = 2041, - ROOM_RULE_BO5 = 2042, - ROOM_RULE_BO3_BAN1 = 2071, - ROOM_RULE_BO5_BAN1 = 2072, - ARENA_CONVENTION = 2043, FREEBATTLE_UNLIMITED = 2044, FREEBATTLE_ROTATION = 2045, RANKBATTLE_UNLIMITED = 2046, RANKBATTLE_ROTATION = 2047, - ROOM_UNLIMITED = 2048, ROOM_ROTATION = 2049, COLOSSEUM = 2050, - COLOSSEUM_BATTLE = 2051, - COLOSSEUM_RANK_MATCH_USER = 2052, - ROOM_RULE_TWO_PICK_QUBE = 2053, GUILD_MAINTENANCE = 2054, - ARENA_SEALED_MAINTENANCE = 2055, ARENA_SEALED_BATTLE_MAINTENANCE = 2056, - ROOM_FORMAT_HOF = 2057, - SEALED_DECK_CODE = 2059, - SPOTCARD_EXCHANGE = 2060, - ROOM_PRE_ROTATION = 2061, - ROOM_RULE_TWO_PICK_BO3 = 2062, - ROOM_RULE_TWO_PICK_BO5 = 2063, FREEBATTLE_PREROTATION = 2065, - GATHERING_ALL = 2066, - GATHERING_CREATE = 2067, BATTLE_PASS = 2070, - ROOM_RULE_TWO_PICK_CHAOS = 2073, - QUEST = 2077, - ROOM_FORMAT_WINDFALL = 2078, - DECK_QR_CODE = 2079, AUTO_DECK_CREATE = 2080, - COMPETITION_ALL = 2081, - COMPETITION_BATTLE = 2082, - COMPETITION_RANK_MATCH_USER = 2083, FREEBATTLE_CROSSOVER = 2084, RANKBATTLE_CROSSOVER = 2085, - ROOM_FORMAT_CROSSOVER = 2086, - GATHERING_CROSSOVER = 2087, - PRACTICE_PUZZLE = 2088, FREEBATTLE_MYROTATION = 2093, - ROOM_FORMAT_MYROTATION = 2094, - GATHERING_MYROTATION = 2095, BOSS_RUSH = 2096, - SECRET_BOSS_BATTLE = 2100, REPLAY_ALL = 2034, NEWREPLAY_ALL = 2097, NEWREPLAY_EXCLUDE_ROTATION = 2098, NEWREPLAY_RECORD = 2099, - CHAT_GUILD = 2101, - CHAT_GATHERING = 2102, - FREEBATTLE_AVATAR = 2103, - ROOM_FORMAT_AVATAR = 2104, - GATHERING_AVATAR = 2105, - ROOM_RULE_TWO_PICK_CUBE_BACKDRAFT = 2106, - ROOM_RULE_TWO_PICK_CUBE_BO3 = 2107, - ROOM_RULE_TWO_PICK_CUBE_BO5 = 2108, - ROOM_RULE_TWO_PICK_CHAOS_BACKDRAFT = 2109, - ROOM_RULE_TWO_PICK_CHAOS_BO3 = 2110, - ROOM_RULE_TWO_PICK_CHAOS_BO5 = 2111, - INVALID_VALUE = 0 - } + FREEBATTLE_AVATAR = 2103} public enum ServerBattleType { @@ -118,62 +56,10 @@ public static class NetworkDefine Quest = 37, Sealed = 32, Gathering = 34, - Avatar = 39, OfflineEvent = 40, Competition = 42, BossRushQuest = 45, SecretBossQuest = 46, CompetitionTwoPick = 47 } - - private static Dictionary closeDialogErrorCode = new Dictionary - { - { 1401, "RC_CARD_NUMBER_DESTRUCT_ERROR" }, - { 1402, "RC_CARD_NOT_DESTRUCT_ERROR" }, - { 1403, "RC_CARD_NOT_CREATE_ERROR" }, - { 1026, "RC_RED_ETHER_NOT_ENOUGH_ERROR" }, - { 1551, "RC_FRINED_COUNT_OVER_ERROR" }, - { 1552, "RC_PARTNER_FRIEND_COUNT_OVER_ERROR" }, - { 1553, "RC_IS_FRIEND_ERROR" }, - { 1554, "RC_REQUEST_MAX_ERROR" }, - { 1555, "RC_IS_FRIEND_APPLY_ERROR" }, - { 1556, "RC_GET_UNREAD_FRIEND_REQUEST" }, - { 1557, "RC_SEARCH_USER_NOT_FOUND" }, - { 1558, "RC_FRIEND_UNREAD_REQUEST_MAX_ERROR" }, - { 1559, "RC_FRIEND_APPLY_NOT_FOUND_ERROR" }, - { 1560, "RC_FRIEND_DENY_NOT_FOUND_ERROR" }, - { 1561, "RC_FRIEND_CANSEL_NOT_FOUND_ERROR" }, - { 1562, "RC_FRIEND_ACCEPT_NOT_FOUND_ERROR" }, - { 1601, "RC_NG_PRESENT_INVALID_ACCESS" }, - { 207, "RC_NG_WORD_ERROR" }, - { 2001, "RC_PRESENT_RECEIVE_ERROR_NO_PRESRNT" }, - { 2051, "RC_NOT_ENOUGH_ERROR" }, - { 2102, "RC_STAMINA_MAX_ERROR" }, - { 2103, "RC_USER_STATUS_ERROR" }, - { 300, "RC_PAYMENT_HISTORY_ERROR" }, - { 301, "RC_PAYMENT_ALREADY_ERROR" }, - { 302, "RC_PRODUCT_DATA_CSV_ERROR" }, - { 303, "RC_PAYMENT_RECEIPT_ERROR" }, - { 304, "RC_PAYMENT_LIMIT_ERROR" }, - { 305, "RC_PAYMENT_TIMEOUT_ERROR" }, - { 306, "RC_PAYMENT_RESPONSE_ERROR" }, - { 307, "RC_PAYMENT_AGE_GROUP_ERROR" }, - { 308, "RC_PAYMENT_VALIDATION_ERROR" }, - { 513, "RC_TRANSITION_CODE_NODATA_ERROR" }, - { 514, "RC_TRANSITION_CODE_PUBLIC_ERROR" }, - { 515, "RC_TRANSITION_CODE_EXPIRE_ERROR" }, - { 530, "RC_EMAIL_VALIDATION_ERROR" }, - { 531, "RC_EMAIL_SEND_ERROR" } - }; - - public static bool IsCloseOnlyDialogError(int ResultCode) - { - string value = ""; - closeDialogErrorCode.TryGetValue(ResultCode, out value); - if (!string.IsNullOrEmpty(value)) - { - return true; - } - return false; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/NetworkSkill_spell_charge.cs b/SVSim.BattleEngine/Engine/Wizard/NetworkSkill_spell_charge.cs index 11832864..5550e043 100644 --- a/SVSim.BattleEngine/Engine/Wizard/NetworkSkill_spell_charge.cs +++ b/SVSim.BattleEngine/Engine/Wizard/NetworkSkill_spell_charge.cs @@ -22,7 +22,8 @@ public class NetworkSkill_spell_charge : Skill_spell_charge private void RegisterSkillEndEvent() { - if (GameMgr.GetIns().IsWatchBattle || GameMgr.GetIns().IsReplayBattle || (!base.SkillPrm.ownerCard.IsPlayer && RegisterFilter.IsFilterCard(this))) + // IsWatchBattle and IsReplayBattle are both const-false in headless (Phase 4). + if (!base.SkillPrm.ownerCard.IsPlayer && RegisterFilter.IsFilterCard(this)) { return; } @@ -31,7 +32,7 @@ public class NetworkSkill_spell_charge : Skill_spell_charge if (localCards.Count() > 0) { RegisterSpellboost data = new RegisterSpellboost(localCards, localSkill, base.AddCount, base.DiffAddCount); - (BattleManagerBase.GetIns() as NetworkBattleManagerBase).RegisterActionManager.Add(data); + (base.SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr as NetworkBattleManagerBase).RegisterActionManager.Add(data); } return NullVfx.GetInstance(); }; diff --git a/SVSim.BattleEngine/Engine/Wizard/NetworkUI.cs b/SVSim.BattleEngine/Engine/Wizard/NetworkUI.cs deleted file mode 100644 index fdecc48d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/NetworkUI.cs +++ /dev/null @@ -1,278 +0,0 @@ -using Cute; -using Wizard.ErrorDialog; - -namespace Wizard; - -public class NetworkUI : INetworkUI -{ - private static NetworkUI instance; - - private DialogBase _errorDialog; - - private const int DEAPTH = 6000; - - private const int PC_ERROR_NEW_VERSION_AVAILABLE = 214; - - public bool keepLastRequest; - - public static NetworkUI GetInstance() - { - if (instance == null) - { - instance = new NetworkUI(); - } - return instance; - } - - public NetworkUI() - { - keepLastRequest = false; - } - - public bool IsKeepLastRequest() - { - return keepLastRequest; - } - - public void SetKeepLastRequest(bool flag) - { - keepLastRequest = flag; - } - - public void StartLoading(bool notEditor) - { - if (notEditor) - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true, notCollider: false, force: false); - } - else - { - UIManager.GetInstance().createInSceneCenterLoading(notBlack: true, notCollider: false, force: false); - } - } - - public void StopLoading() - { - UIManager.GetInstance().closeInSceneCenterLoading(force: false); - } - - public string GetText(string code) - { - string text = ""; - text = Data.SystemText.Get(code); - if (string.IsNullOrEmpty(text)) - { - text = code; - } - return text; - } - - public void GoToMypage() - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); - } - - public void SoftwareRest() - { - SoftwareReset.exec(); - } - - public void OpenRetryAndToTitleErrorPopUp(string title, string message, string errorCode) - { - if (!keepLastRequest) - { - keepLastRequest = true; - UIManager.GetInstance().closeInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetPanelDepth(6000); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(message); - dialogBase.SetReturnMsg(Toolbox.NetworkManager.gameObject, "Retry", "ReturnToTitle"); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dialogBase.SetButtonText(GetText("System_0012"), GetText("System_0006")); - dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - dialogBase.SetVisibleContactButton(isVisible: true, errorCode); - dialogBase.OnClose = delegate - { - keepLastRequest = false; - }; - } - } - - public void OpenGoToMypageErrorPopUp(string title, string message, string errorCode) - { - if (!keepLastRequest) - { - keepLastRequest = true; - UIManager.GetInstance().closeInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetPanelDepth(6000); - dialogBase.SetTitleLabel((title == "") ? GetText("Error_0002") : title); - dialogBase.SetText((message == "") ? GetText("System_0011") : message); - dialogBase.SetReturnMsg(Toolbox.NetworkManager.gameObject, "GoToMypage"); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialogBase.SetButtonText(GetText("System_0010")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - dialogBase.SetVisibleContactButton(isVisible: true, errorCode); - dialogBase.OnClose = delegate - { - keepLastRequest = false; - }; - _errorDialog = dialogBase; - } - } - - public void OpenGoToTitleErrorPopUp(string title, string message, string errorCode) - { - keepLastRequest = false; - UIManager.GetInstance().closeInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetPanelDepth(6000); - dialogBase.SetTitleLabel(title); - dialogBase.SetText(message); - dialogBase.SetReturnMsg(Toolbox.NetworkManager.gameObject, "ReturnToTitle"); - if (title == GetText("System_0022")) - { - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - } - else - { - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialogBase.SetButtonText(GetText("System_0006")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - } - dialogBase.SetVisibleContactButton(isVisible: true, errorCode); - _errorDialog = dialogBase; - } - - public void OpenCloseOnlyErrorPopUp(int resultCode) - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(resultCode); - } - - public void OpenAccountBlockErrorPopUp(int resultCode) - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(resultCode); - } - - public void OpenAccountLimitedBlockErrorPopUp(int resultCode, string endTimeText) - { - SystemText systemText = Data.SystemText; - Wizard.ErrorDialog.Data data = Wizard.ErrorDialog.Dialog.FindData(resultCode); - DialogBase dialogBase = Wizard.ErrorDialog.Dialog.Create(resultCode); - dialogBase.SetText(systemText.Get(data.BodyId, ConvertTime.ToLocal(endTimeText))); - _errorDialog = dialogBase; - } - - public void OpenOtherServerErrorPopUp(int resultCode) - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(resultCode); - } - - public void OpenGotoStoreErrorPopup() - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(214); - } - - public void OpenRetryFailErrorPopup() - { - keepLastRequest = false; - UIManager.GetInstance().CreatFadeOpen(); - UIManager.GetInstance().closeInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetPanelDepth(6000); - dialogBase.SetTitleLabel(GetText("Error_0002")); - dialogBase.SetText(GetText("System_0018")); - dialogBase.SetReturnMsg(Toolbox.NetworkManager.gameObject, "ReturnToTitle"); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialogBase.SetButtonText(GetText("System_0006")); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; - _errorDialog = dialogBase; - } - - public void OpenTimeOutErrorPopUp() - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create("TIMEOUT"); - } - - public void OpenHttpStatusErrorPopUp() - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create("COMMUNICATION"); - } - - public void OpenResourceVersionUpPopUp() - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create("RES_VERSION_UP"); - } - - public void OpenSessionErrorPopUp() - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(201); - } - - public bool isCloseDialogGroupError(int resultCode) - { - return NetworkDefine.IsCloseOnlyDialogError(resultCode); - } - - public void OpenAllMaintenancePopUp(int resultCode, string endTime) - { - SystemText systemText = Data.SystemText; - if (string.IsNullOrEmpty(endTime)) - { - Wizard.ErrorDialog.Data data = Wizard.ErrorDialog.Dialog.FindData("URGENCY_MAINTENANCE"); - DialogBase dialogBase = Wizard.ErrorDialog.Dialog.Create("URGENCY_MAINTENANCE"); - dialogBase.SetText(systemText.Get(data.BodyId, systemText.Get("Common_0118"))); - _errorDialog = dialogBase; - } - else - { - Wizard.ErrorDialog.Data data2 = Wizard.ErrorDialog.Dialog.FindData(resultCode); - DialogBase dialogBase2 = Wizard.ErrorDialog.Dialog.Create(resultCode); - dialogBase2.SetText(systemText.Get(data2.BodyId, ConvertTime.ToLocal(endTime))); - _errorDialog = dialogBase2; - } - } - - public void OpenStrictServerErrorPopUp(int resultCode) - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(resultCode); - } - - public void OpenEachFunctionMaintenancePopUp(int resultCode) - { - _errorDialog = Wizard.ErrorDialog.Dialog.Create(resultCode); - } - - public void OpenSocialServiceNoResponseErrorPopup() - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = Wizard.ErrorDialog.Dialog.Create("SOCIAL_SERVICE_NO_RESPONSE"); - string socialServiceName = SocialServiceUtility.GetSocialServiceName(); - Wizard.ErrorDialog.Data data = Wizard.ErrorDialog.Dialog.FindData("SOCIAL_SERVICE_NO_RESPONSE"); - dialogBase.SetText(systemText.Get(data.BodyId, socialServiceName)); - _errorDialog = dialogBase; - } - - public bool IsOpenErrorDialog() - { - return _errorDialog != null; - } - - public void CloseErrorDialog() - { - if (_errorDialog != null) - { - _errorDialog.Close(); - } - _errorDialog = null; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/NoneFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/NoneFormatBehavior.cs index 99ec8adb..5d476007 100644 --- a/SVSim.BattleEngine/Engine/Wizard/NoneFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/NoneFormatBehavior.cs @@ -58,7 +58,7 @@ public class NoneFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsConventionMode => false; @@ -69,21 +69,21 @@ public class NoneFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/NotificatonAnimation.cs b/SVSim.BattleEngine/Engine/Wizard/NotificatonAnimation.cs index c458c1c7..d203dce8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/NotificatonAnimation.cs +++ b/SVSim.BattleEngine/Engine/Wizard/NotificatonAnimation.cs @@ -40,32 +40,6 @@ public class NotificatonAnimation : MonoBehaviour private Vector3 _labelInitialPos; - private const float ROOT_MOVE_DIST = 100f; - - private const float ROOT_MOVE_TIME = 1f; - - private const float BREAK_TIME_1 = 0.5f; - - private const float LABEL_MOVE_DIST = 2000f; - - private const float LABEL_MOVE_TIME = 0.5f; - - private const float BREAK_TIME_2 = 0.3f; - - private const float LABEL_WAIT_TIME_RESULT = 1.4f; - - private const float LABEL_WAIT_TIME_MAINTENANCE_ON_HOME = 4f; - - private const float LABEL_WAIT_TIME_MAINTENANCE_ON_RESULT = 4f; - - private const float LABEL_WAIT_TIME_GATHERING_MATCHING = 2f; - - private const float LABEL_WAIT_TIME_GACHA_RESULT = 1.4f; - - private const float LABEL_WAIT_TIME_TEMPORARY_DECK_RESULT = 1.4f; - - private const float LABEL_WAIT_TIME_MISSION_CLEARED = 1.4f; - private void Awake() { _rootInitialPos = _root.transform.localPosition; diff --git a/SVSim.BattleEngine/Engine/Wizard/NullReceiveTurnEndToJudgeResult.cs b/SVSim.BattleEngine/Engine/Wizard/NullReceiveTurnEndToJudgeResult.cs deleted file mode 100644 index 53918852..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/NullReceiveTurnEndToJudgeResult.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class NullReceiveTurnEndToJudgeResult : ReceiveTurnEndToJudgeResult -{ - public override void StopChecker() - { - } - - protected override void IntervalCheck() - { - } - - public override void FinishChecker() - { - } - - public override void StartChecker(string log = "") - { - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/OptionSettingWindow.cs b/SVSim.BattleEngine/Engine/Wizard/OptionSettingWindow.cs deleted file mode 100644 index 9fe7ff90..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/OptionSettingWindow.cs +++ /dev/null @@ -1,1232 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Battle.View.Vfx; -using Wizard.Dialog.Setting; - -namespace Wizard; - -public class OptionSettingWindow : SettingBase -{ - private enum Category - { - SOUND_VISUAL, - BATTLE, - STAGE, - OTHER - } - - public enum Shortcut - { - Off, - RightClick, - DoubleClick, - MiddleClick - } - - public enum ShortcutDetail - { - RightClick, - MiddleClick, - LongPress, - Auto, - DoubleClick - } - - [SerializeField] - private GameObject _soundVisualRoot; - - [SerializeField] - private GameObject _battleRoot; - - [SerializeField] - private GameObject _stageRoot; - - [SerializeField] - private GameObject _otherRoot; - - [SerializeField] - private UIButton _buttonSoundVisualForBattleScene; - - [SerializeField] - private UIButton _buttonBattleForBattleScene; - - [SerializeField] - private UIButton _buttonSoundVisualForRoomScene; - - [SerializeField] - private UIButton _buttonBattleForRoomScene; - - [SerializeField] - private UIButton _buttonOtherForRoomScene; - - [SerializeField] - private UIButton _buttonSoundVisual; - - [SerializeField] - private UIButton _buttonBattle; - - [SerializeField] - private UIButton _buttonStage; - - [SerializeField] - private UIButton _buttonOther; - - [SerializeField] - private GameObject _battleSceneRoot; - - [SerializeField] - private GameObject _normalSceneRoot; - - [SerializeField] - private GameObject _roomSceneRoot; - - [SerializeField] - private BattleStageChoiceWindow _activeStageSelectWindow; - - private Category _currentCategory; - - private readonly List _resolutions = new List - { - "1024×768", "1280×720", "1280×800", "1280×960", "1360×768", "1600×900", "1600×1200", "1680×1050", "1920×1080", "1920×1200", - "2560×1440", "3840×2160" - }; - - private const int RES_MAX_WIDTH = 3840; - - private float _wantedScreenWidth = Screen.width; - - private float _wantedScreenHeight = Screen.height; - - private static List _battleDetailSizes = new List { "100%", "90%", "80%", "70%", "60%", "50%" }; - - private static Shortcut? _shortcutPlay; - - private static Shortcut? _shortcutEvolution; - - private static ShortcutDetail? _shortcutDetail; - - private List _mouseShortcuts = new List { "OtherConfig_0042", "OtherConfig_0043", "OtherConfig_0044", "OtherConfig_0052" }; - - private List _mouseShortcutsDetail = new List { "OtherConfig_0043", "OtherConfig_0052", "OtherConfig_0053", "OtherConfig_0054" }; - - private bool _startInvitationFriendRoom; - - private bool _startInvitationInBattle; - - private bool _startInvitationInOffline; - - private bool _startReceivedFriendApply; - - private const float STAGE_SELECT_LABEL_POSITION_X = -5f; - - private const float STAGE_SELECT_SPRITE_POSITION_X = 205f; - - public static Shortcut ShortcutPlay - { - get - { - if (!_shortcutPlay.HasValue) - { - _shortcutPlay = (Shortcut)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.MOUSE_SHORTCUT_PLAY); - } - return _shortcutPlay.Value; - } - private set - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.MOUSE_SHORTCUT_PLAY, (int)value); - _shortcutPlay = value; - } - } - - public static Shortcut ShortcutEvolution - { - get - { - if (!_shortcutEvolution.HasValue) - { - _shortcutEvolution = (Shortcut)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.MOUSE_SHORTCUT_EVOLUTION); - } - return _shortcutEvolution.Value; - } - private set - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.MOUSE_SHORTCUT_EVOLUTION, (int)value); - _shortcutEvolution = value; - } - } - - public static ShortcutDetail ShortcutDetailPanel - { - get - { - if (!_shortcutDetail.HasValue) - { - _shortcutDetail = (ShortcutDetail)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.MOUSE_SHORTCUT_DETAIL); - } - return _shortcutDetail.Value; - } - private set - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.MOUSE_SHORTCUT_DETAIL, (int)value); - _shortcutDetail = value; - } - } - - private UIButton BattleButton - { - get - { - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle) - { - return _buttonBattleForBattleScene; - } - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Room) - { - return _buttonBattleForRoomScene; - } - return _buttonBattle; - } - } - - private UIButton StageButton => _buttonStage; - - private UIButton SoundVisualButton - { - get - { - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle) - { - return _buttonSoundVisualForBattleScene; - } - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Room) - { - return _buttonSoundVisualForRoomScene; - } - return _buttonSoundVisual; - } - } - - private UIButton OtherButton - { - get - { - if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Room) - { - return _buttonOtherForRoomScene; - } - return _buttonOther; - } - } - - public override void Create() - { - base.Create(); - CreateSoundItem(); - CreateBattleItem(); - CreateStageItem(); - CreateOtherItem(); - ChangeCategory(Category.SOUND_VISUAL, playSE: false); - SoundVisualButton.onClick.Add(new EventDelegate(delegate - { - ChangeCategory(Category.SOUND_VISUAL, playSE: true); - })); - BattleButton.onClick.Add(new EventDelegate(delegate - { - ChangeCategory(Category.BATTLE, playSE: true); - })); - StageButton.onClick.Add(new EventDelegate(delegate - { - ChangeCategory(Category.STAGE, playSE: true); - })); - OtherButton.onClick.Add(new EventDelegate(delegate - { - ChangeCategory(Category.OTHER, playSE: true); - })); - bool num = UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle; - _battleSceneRoot.SetActive(value: false); - _normalSceneRoot.SetActive(value: false); - _roomSceneRoot.SetActive(value: false); - if (num) - { - _battleSceneRoot.SetActive(value: true); - } - else if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Room) - { - _roomSceneRoot.SetActive(value: true); - } - else - { - _normalSceneRoot.SetActive(value: true); - } - _startInvitationFriendRoom = Data.Load.data._userConfig.ReceivedInvite; - _startInvitationInBattle = Data.Load.data._userConfig.ReceivedInviteInBattle; - _startInvitationInOffline = Data.Load.data._userConfig.ReceivedInviteInOffline; - _startReceivedFriendApply = Data.Load.data._userConfig.ReceivedFriendApply; - } - - private void CreateSoundItem() - { - CreateSoundItem(_soundVisualRoot); - CreateToggle_PlayMusicInBackground(isDispSeparatorLine: true); - CreateSelectResolution(isDispSeparatorLine: true); - CreateToggle_Fullscreen(isDispSeparatorLine: true); - CreateSelect_Fps(isDispSeparatorLine: true); - bool isDispSeparatorLine = false; - CreateToggle_MovieSubtitles(isDispSeparatorLine, _soundVisualRoot); - } - - private void CreateBattleItem() - { - bool flag = UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Battle; - bool flag2 = !flag; - bool flag3 = UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Room; - CreateBattleDetailPanelSize(isDispSeparatorLine: true); - CreateToggleBattleLightEffect(isDispSeparatorLine: true); - if (flag) - { - CreateToggle_FoilCardAnimation(isDispSeparatorLine: true); - } - CreateToggle_LeaderAnimation(isDispSeparatorLine: true); - if (flag) - { - CreateToggle_OpponentShowDefaultSkin(isDispSeparatorLine: true); - } - CreateToggle_TurnEndConfirm(isDispSeparatorLine: true); - bool flag4 = Data.MyPageNotifications.data.RoomRule.NormalRuleFormatList.Contains(Format.Avatar); - if ((Data.CurrentFormat == Format.Avatar && flag2) || (flag4 && flag)) - { - CreateToggle_TurnEndWithoutUsingHeroSkillConfirm(isDispSeparatorLine: true); - } - CreateToggle_EvolveConfirm(isDispSeparatorLine: true); - CreateToggle_FusionCardPlayConfirm(isDispSeparatorLine: true); - CreateToggle_FixedUseCostInfo(isDispSeparatorLine: true); - CreateToggle_ShowSideLog(isDispSeparatorLine: true); - CreateToggle_OpponentMessageDisplay(isDispSeparatorLine: true); - if (flag && flag3) - { - CreateToggle_Wss(isDispSeparatorLine: true); - CreateToggle_Ipv6(isDispSeparatorLine: true); - } - CreateMouseControl(isDispSeparatorLine: true); - CreateMouseShortcutPlay(isDispSeparatorLine: false); - CreateMouseShortcutEvolution(isDispSeparatorLine: false); - CreateMouseShortcutDetail(isDispSeparatorLine: false); - if (Prediction._isFeatureEnabled) - { - CreateToggle_PredictionIconDisplay(isDispSeparatorLine: true); - } - } - - private void CreateStageItem() - { - CreateToggleUseSimpleRoom(isDispSeparatorLine: true); - CreateToggle_UseStageSwitch(isDispSeparatorLine: true); - CreateButtonBattleStageSelect(isDispSeparatorLine: true); - UpdateStageSettingView(); - } - - private ItemToggle CreateToggleUseSimpleRoom(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SIMPLE_STAGE, isDispSeparatorLine, _stageRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0022")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SIMPLE_STAGE)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SIMPLE_STAGE, item.GetValue()); - UpdateStageSettingView(); - }); - return item; - } - - private ItemToggle CreateToggle_UseStageSwitch(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.USE_STAGE_SELECT, isDispSeparatorLine, _stageRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0078")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.USE_OFF_STAGE)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.USE_OFF_STAGE, item.GetValue()); - bool toGrey = !item.GetValue(); - if ((FindItem(ID.SIMPLE_STAGE) as ItemToggle).GetValue()) - { - toGrey = true; - } - (FindItem(ID.STAGE_SELECT) as ItemButton).SetToGrey(toGrey); - }); - return item; - } - - private ItemButton CreateButtonBattleStageSelect(bool isDispSeparatorLine) - { - ItemButton itemButton = CreateButton(ID.STAGE_SELECT, isDispSeparatorLine, _stageRoot); - itemButton.SetSpriteName("btn_common_02_m_off", isMakePixelPerfect: true, isCollisionResize: true); - itemButton.SetSpriteNameOnPress("btn_common_02_m_on"); - itemButton.SetLabelPos(new Vector3(-5f, 0f, 0f)); - itemButton.SetSpritePos(new Vector3(205f, 0f, 0f)); - SystemText systemText = Data.SystemText; - itemButton.SetValue(systemText.Get("Dia_StageChoice_001")); - itemButton.SetSubLabelPos(new Vector3(-180f, 0f, 0f)); - itemButton.SetSubLabelText(systemText.Get("OtherConfig_0075")); - itemButton.AddChangeCallback(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - CreateStageChoiceWindow(); - }); - return itemButton; - } - - private void UpdateStageSettingView() - { - ItemToggle itemToggle = FindItem(ID.SIMPLE_STAGE) as ItemToggle; - if (itemToggle != null) - { - bool flag = itemToggle.GetValue(); - ItemToggle obj = FindItem(ID.USE_STAGE_SELECT) as ItemToggle; - obj.SetLabelLooks(!flag); - obj.SetToggleLooks(!flag); - if (!obj.GetValue()) - { - flag = true; - } - (FindItem(ID.STAGE_SELECT) as ItemButton).SetToGrey(flag); - } - } - - private void CreateStageChoiceWindow() - { - BattleStageChoiceWindow stageChoice = UnityEngine.Object.Instantiate(_activeStageSelectWindow); - StartCoroutine(stageChoice.LoadResource(delegate - { - SystemText systemText = Data.SystemText; - DialogBase stageSelectDialog = UIManager.GetInstance().CreateDialogClose(); - stageSelectDialog.SetSize(DialogBase.Size.XL); - bool isAllOff = false; - BattleStageChoiceWindow battleStageChoiceWindow = stageChoice; - battleStageChoiceWindow.OnAllOff = (Action)Delegate.Combine(battleStageChoiceWindow.OnAllOff, (Action)delegate(bool alloff) - { - isAllOff = alloff; - stageSelectDialog.SetButtonDisable(alloff); - }); - stageChoice.Initialize(); - stageSelectDialog.SetObj(stageChoice.gameObject); - stageSelectDialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - stageSelectDialog.SetTitleLabel(systemText.Get("Dia_StageChoice_001")); - _dialogObject.gameObject.SetActive(value: false); - _dialogObject.backView.SetActive(value: false); - DialogBase dialogBase = stageSelectDialog; - dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate - { - stageChoice.SaveSetting(); - }); - DialogBase dialogBase2 = stageSelectDialog; - dialogBase2.OnClose = (Action)Delegate.Combine(dialogBase2.OnClose, (Action)delegate - { - _dialogObject.gameObject.SetActive(value: true); - _dialogObject.backView.SetActive(value: true); - }); - })); - } - - private ItemToggle CreateToggle_UseCollaborationSound(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.COLLABORATION_SOUND, isDispSeparatorLine, _stageRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0077")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.COLLABORATION_SOUND)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.COLLABORATION_SOUND, item.GetValue()); - }); - return item; - } - - private void CreateOtherItem() - { - bool num = UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Battle; - bool flag = UIManager.GetInstance().GetCurrentScene() != UIManager.ViewScene.Room; - if (num && flag) - { - CreateToggle_PurchaseAlert(isDispSeparatorLine: true); - } - if (num) - { - CreateToggle_InvitationFriendRoom(isDispSeparatorLine: true); - CreateToggle_InvitationInBattle(isDispSeparatorLine: true); - CreateToggleReceivedFriendApply(isDispSeparatorLine: true); - } - CreateToggleShowBattlePassResult(isDispSeparatorLine: true); - CreateSelect_ShowQrCode(isDispSeparatorLine: false); - } - - protected override void OnDestroy() - { - base.OnDestroy(); - if (_startInvitationFriendRoom != Data.Load.data._userConfig.ReceivedInvite || _startInvitationInBattle != Data.Load.data._userConfig.ReceivedInviteInBattle || _startInvitationInOffline != Data.Load.data._userConfig.ReceivedInviteInOffline || _startReceivedFriendApply != Data.Load.data._userConfig.ReceivedFriendApply) - { - InviteConfigUpdateTask inviteConfigUpdateTask = new InviteConfigUpdateTask(); - inviteConfigUpdateTask.SetParameter(Data.Load.data._userConfig.ReceivedInvite, Data.Load.data._userConfig.ReceivedInviteInBattle, Data.Load.data._userConfig.ReceivedInviteInOffline, Data.Load.data._userConfig.ReceivedFriendApply); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(inviteConfigUpdateTask)); - } - } - - private void ChangeCategory(Category category, bool playSE) - { - if (playSE && category != _currentCategory) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - } - _currentCategory = category; - ResetScroll(); - _soundVisualRoot.gameObject.SetActive(category == Category.SOUND_VISUAL); - _battleRoot.gameObject.SetActive(category == Category.BATTLE); - _stageRoot.gameObject.SetActive(category == Category.STAGE); - _otherRoot.gameObject.SetActive(category == Category.OTHER); - RenameBtnSprite(SoundVisualButton, category == Category.SOUND_VISUAL); - RenameBtnSprite(BattleButton, category == Category.BATTLE); - RenameBtnSprite(StageButton, category == Category.STAGE); - RenameBtnSprite(OtherButton, category == Category.OTHER); - } - - private void RenameBtnSprite(UIButton button, bool isEnable) - { - button.normalSprite = RenameSpriteString(button.normalSprite, isEnable); - } - - private string RenameSpriteString(string str, bool isEnable) - { - string oldValue = (isEnable ? "_off" : "_on"); - string newValue = (isEnable ? "_on" : "_off"); - return str.Replace(oldValue, newValue); - } - - private ItemToggle CreateToggle_InvitationInBattle(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.INVITATION_IN_BATTLE, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0038")); - item.SetValue(Data.Load.data._userConfig.ReceivedInviteInBattle); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - item.SetButtonEnable(isEnable: false); - item.AddChangeCallback(delegate - { - Data.Load.data._userConfig.ReceivedInviteInBattle = item.GetValue(); - }); - return item; - } - - private ItemToggle CreateToggleShowBattlePassResult(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.BATTLE_PASS_SHOW_RESULT, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("BattlePass_0011")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.BATTLE_PASS_SHOW_RESULT)); - item.SetButtonEnable(isEnable: false); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.BATTLE_PASS_SHOW_RESULT, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_InvitationInOffline(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.INVITATION_IN_OFFLINE, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0039")); - item.SetValue(Data.Load.data._userConfig.ReceivedInviteInOffline); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - item.SetButtonEnable(isEnable: false); - item.AddChangeCallback(delegate - { - Data.Load.data._userConfig.ReceivedInviteInOffline = item.GetValue(); - }); - return item; - } - - private ItemToggle CreateToggleReceivedFriendApply(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.RECEIVED_FRIEND_APPLY, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0068")); - item.SetValue(Data.Load.data._userConfig.ReceivedFriendApply); - item.AddChangeCallback(delegate - { - Data.Load.data._userConfig.ReceivedFriendApply = item.GetValue(); - }); - return item; - } - - private ItemToggle CreateToggle_PurchaseAlert(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.PURCHASE_ALERT, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0065")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.PURCHASE_ALERT)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.PURCHASE_ALERT, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_Wss(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SELECT_WSS, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0060")); - bool isSetting = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_WSS); - item.SetValue(isSetting); - item.AddChangeCallback(delegate - { - if (isSetting != item.GetValue()) - { - isSetting = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_SELECT_WSS, item.GetValue()); - CustomPreference.SetOptionalNodeSceme(); - LocalLog.AccumulateSettingLog(); - } - }); - return item; - } - - private ItemToggle CreateToggle_Ipv6(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SELECT_IPV6, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0083")); - bool isSetting = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_IPV6); - item.SetValue(isSetting); - item.AddChangeCallback(delegate - { - if (isSetting != item.GetValue()) - { - isSetting = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_SELECT_IPV6, item.GetValue()); - } - }); - return item; - } - - private ItemToggle CreateSelect_Fps(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.FPS, isDispSeparatorLine, _soundVisualRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0045")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FRAMERATE)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - int frameRate = (Application.targetFrameRate = (value ? 60 : 30)); - Toolbox.QualityManager.SetFrameRate(frameRate); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.FRAMERATE, value); - }); - return item; - } - - private ItemToggle CreateSelect_ShowQrCode(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.QRCode, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0081")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOWQRCODE)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOWQRCODE, value); - }); - return item; - } - - private ItemToggle CreateToggle_InvitationFriendRoom(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.INVITATION_FRIEND_ROOM, isDispSeparatorLine, _otherRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0037")); - item.SetValue(Data.Load.data._userConfig.ReceivedInvite); - item.AddChangeCallback(delegate - { - Data.Load.data._userConfig.ReceivedInvite = item.GetValue(); - SetRelationFriendRoomToggleLook(item); - }); - SetRelationFriendRoomToggleLook(item); - return item; - } - - private void SetRelationFriendRoomToggleLook(ItemToggle friendRoomToggle) - { - _SetItemToggleLooks(ID.INVITATION_IN_BATTLE, friendRoomToggle.GetValue()); - _SetItemToggleLooks(ID.INVITATION_IN_OFFLINE, friendRoomToggle.GetValue()); - } - - private ItemToggle CreateToggle_LeaderAnimation(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.LEADER_ANIMATION_DISPLAY, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0031")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION, item.GetValue()); - if (ToolboxGame.UIManager.IsCurrentScene(UIManager.ViewScene.Battle)) - { - bool isAnimation = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_LEADER_ANIMATION); - BattleManagerBase.GetIns().VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - ((ClassBattleCardBase)BattleManagerBase.GetIns().BattlePlayer.Class).ClassBattleCardView.ClassCharacter.SetAnimationEnable(isAnimation); - ((ClassBattleCardBase)BattleManagerBase.GetIns().BattleEnemy.Class).ClassBattleCardView.ClassCharacter.SetAnimationEnable(isAnimation); - })); - } - }); - return item; - } - - private ItemToggle CreateToggleBattleLightEffect(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.BATTLE_EFFECT_DISPLAY, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0010")); - bool isSetting = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT); - item.SetValue(isSetting); - item.AddChangeCallback(delegate - { - if (isSetting != item.GetValue()) - { - isSetting = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT, item.GetValue()); - LocalLog.AccumulateSettingLog(); - } - }); - return item; - } - - private ItemToggle CreateToggle_FoilCardAnimation(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SHOW_FOIL_CARD_ANIMATION, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0067")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_FOIL_CARD_ANIMATION)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_FOIL_CARD_ANIMATION, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_TurnEndConfirm(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.TURN_END_CONFIRM, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0004")); - bool isSetting = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.CONFIRM_TURN_END); - item.SetValue(isSetting); - item.AddChangeCallback(delegate - { - if (isSetting != item.GetValue()) - { - isSetting = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.CONFIRM_TURN_END, item.GetValue()); - LocalLog.AccumulateSettingLog(); - } - }); - return item; - } - - private ItemToggle CreateToggle_TurnEndWithoutUsingHeroSkillConfirm(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.TURN_END_WITHOUT_USING_HERO_SKILL_CONFIRM, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0084")); - bool isSetting = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.CONFIRM_TURN_END_WITHOUT_USING_HERO_SKILL); - item.SetValue(isSetting); - item.AddChangeCallback(delegate - { - if (isSetting != item.GetValue()) - { - isSetting = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.CONFIRM_TURN_END_WITHOUT_USING_HERO_SKILL, item.GetValue()); - } - }); - return item; - } - - private ItemToggle CreateToggle_EvolveConfirm(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.EVOLVE_CONFIRM, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0025")); - bool isSetting = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.CONFIRM_EVOLVE); - item.SetValue(isSetting); - item.AddChangeCallback(delegate - { - if (isSetting != item.GetValue()) - { - isSetting = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.CONFIRM_EVOLVE, item.GetValue()); - LocalLog.AccumulateSettingLog(); - } - }); - return item; - } - - private ItemToggle CreateToggle_FusionCardPlayConfirm(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SHOW_FUSION_CARD_PLAY_DIALOG, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0072")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_FUSION_CARD_PLAY_DIALOG)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_FUSION_CARD_PLAY_DIALOG, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_FixedUseCostInfo(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.FIXEDUSE_COST_INFO, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0059")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FIXEDUSE_COST_INFO)); - item.AddChangeCallback(delegate - { - if (item.GetValue() != PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FIXEDUSE_COST_INFO)) - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.FIXEDUSE_COST_INFO, item.GetValue()); - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins != null) - { - if (ins.BattlePlayer != null) - { - ins.BattlePlayer.ApplyFixedUseCostInfo(); - } - if (ins.BattleEnemy != null) - { - ins.BattleEnemy.ApplyFixedUseCostInfo(); - } - } - } - }); - return item; - } - - private ItemToggle CreateToggle_OpponentMessageDisplay(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.OPPONENT_MESSAGE_DISPLAY, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0005")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_OTHER_PLAYER_EMOTE)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_OTHER_PLAYER_EMOTE, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_OpponentShowDefaultSkin(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.OPPONENT_SHOW_DEFAULT_SKIN, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0066")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_OPPONENT_DEFAULT_SKIN)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_OPPONENT_DEFAULT_SKIN, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_ShowPanelAlways(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SHOW_PANEL_ALWAYS, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0061")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_PANEL_ALWAYS)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_PANEL_ALWAYS, item.GetValue()); - BattleManagerBase ins = BattleManagerBase.GetIns(); - if (ins != null) - { - ClassInformationUIController classInformationUIController = ins.BattlePlayer.ClassInformationUIController; - ClassInformationUIController classInformationUIController2 = ins.BattleEnemy.ClassInformationUIController; - if (!ins.IsMulliganEnd && GameMgr.GetIns().IsNetworkBattle && !GameMgr.GetIns().IsAINetwork) - { - classInformationUIController.SetClassInformationUiPosition(isPlayer: true); - classInformationUIController2.SetClassInformationUiPosition(isPlayer: false); - } - else - { - ins.BattlePlayer.StatusPanelControl.ShowStatusPanelOnBattle(); - ins.BattleEnemy.StatusPanelControl.ShowStatusPanelOnBattle(); - classInformationUIController.UpdateStatusPanelOnBattle(isPlayer: true); - classInformationUIController2.UpdateStatusPanelOnBattle(isPlayer: false); - } - } - }); - return item; - } - - private ItemToggle CreateToggle_ShowSideLog(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.SHOW_SIDE_LOG, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0062")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_SIDE_LOG)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_SIDE_LOG, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_PredictionIconDisplay(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.PREDICTION_ICONS_DISPLAY, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0028")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_PREDICTION_ICONS)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SHOW_PREDICTION_ICONS, item.GetValue()); - }); - return item; - } - - private ItemToggle CreateToggle_PlayMusicInBackground(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.PLAY_SOUND_IN_BG, isDispSeparatorLine, _soundVisualRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0036")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.PLAY_SOUND_IN_BACKGROUND)); - item.AddChangeCallback(delegate - { - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.PLAY_SOUND_IN_BACKGROUND, item.GetValue()); - }); - return item; - } - - private ItemSelect CreateSelectResolution(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemSelect item = CreateSelect(ID.RESOLUTION, isDispSeparatorLine, _soundVisualRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0034")); - string[] array = _resolutions[0].Split('×'); - int num = int.Parse(array[0]); - int num2 = int.Parse(array[1]); - int num3 = num; - int num4 = num2; - Display[] displays = Display.displays; - foreach (Display display in displays) - { - if (display.systemWidth > display.systemHeight) - { - num3 = Mathf.Max(num3, display.systemWidth); - num4 = Mathf.Max(num4, display.systemHeight); - } - else - { - num3 = Mathf.Max(num3, display.systemWidth); - num4 = Mathf.Max(num4, display.systemWidth); - } - } - List list = new List(); - foreach (string resolution in _resolutions) - { - string[] array2 = resolution.Split('×'); - int num5 = int.Parse(array2[0]); - int num6 = int.Parse(array2[1]); - if (num5 <= num3 && num6 <= num4) - { - list.Add(resolution); - } - } - item.SetPossibleResolutionValues(list, resizeListSprite: true); - string resolutionValue = Screen.width + "×" + Screen.height; - item.SetResolutionValue(resolutionValue); - _wantedScreenWidth = Screen.width; - _wantedScreenHeight = Screen.height; - item.AddChangeCallback(delegate - { - string[] array3 = item.GetValue().Split('×'); - float num7 = int.Parse(array3[0]); - float num8 = int.Parse(array3[1]); - _wantedScreenWidth = num7; - _wantedScreenHeight = num8; - WindowResize.SetResolution((int)num7, (int)num8); - }); - return item; - } - - private ItemToggle CreateToggle_Fullscreen(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.FULLSCREEN, isDispSeparatorLine, _soundVisualRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0035")); - item.SetValue(Screen.fullScreen); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - if (value != Screen.fullScreen) - { - Toolbox.QualityManager.ChangeResolution(Screen.width, Screen.height, value); - } - }); - return item; - } - - private ItemToggle CreateMouseControl(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.MOUSE_CONTROL, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0040")); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.MOUSE_CONTROL)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.MOUSE_CONTROL, value); - InputMgr.MouseControl = value; - (FindItem(ID.MOUSE_SHORTCUT_PLAY) as ItemSelect).SetToGrey(!value); - (FindItem(ID.MOUSE_SHORTCUT_EVOLUTION) as ItemSelect).SetToGrey(!value); - (FindItem(ID.MOUSE_SHORTCUT_DETAIL) as ItemSelect).SetToGrey(!value); - }); - return item; - } - - private ItemSelect CreateMouseShortcutPlay(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemSelect item = CreateSelect(ID.MOUSE_SHORTCUT_PLAY, isDispSeparatorLine, _battleRoot); - item._isOpenDirectionUp = true; - item.SetTitleLabel(systemText.Get("OtherConfig_0049")); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - SetShortcut(item); - item.SetValue(item.PossibleValues[(int)ShortcutPlay]); - item.AddChangeCallback(delegate - { - string value = item.GetValue(); - int num = 0; - for (num = 0; num < item.PossibleValues.Count && !(value == item.PossibleValues[num]); num++) - { - } - ShortcutPlay = (Shortcut)num; - ItemSelect shortcutDetail = FindItem(ID.MOUSE_SHORTCUT_DETAIL) as ItemSelect; - SetShortcutDetail(shortcutDetail); - }); - return item; - } - - private ItemSelect CreateMouseShortcutEvolution(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemSelect item = CreateSelect(ID.MOUSE_SHORTCUT_EVOLUTION, isDispSeparatorLine, _battleRoot); - item._isOpenDirectionUp = true; - item.SetTitleLabel(systemText.Get("OtherConfig_0050")); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - SetShortcut(item); - item.SetValue(item.PossibleValues[(int)ShortcutEvolution]); - item.AddChangeCallback(delegate - { - string value = item.GetValue(); - int num = 0; - for (num = 0; num < item.PossibleValues.Count && !(value == item.PossibleValues[num]); num++) - { - } - ShortcutEvolution = (Shortcut)num; - ItemSelect shortcutDetail = FindItem(ID.MOUSE_SHORTCUT_DETAIL) as ItemSelect; - SetShortcutDetail(shortcutDetail); - }); - return item; - } - - private ItemSelect CreateBattleDetailPanelSize(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemSelect item = CreateSelect(ID.BATTLE_DETAIL_PANEL_SIZE, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0055")); - item.SetPossibleValues(_battleDetailSizes, resizeListSprite: true); - item.SetValue(_battleDetailSizes[PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_DETAIL_PANEL_SIZE)]); - item.AddChangeCallback(delegate - { - string value = item.GetValue(); - int value2 = 0; - for (int i = 0; i < _battleDetailSizes.Count; i++) - { - value2 = i; - if (value == _battleDetailSizes[i]) - { - break; - } - } - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_DETAIL_PANEL_SIZE, value2); - UIManager instance = UIManager.GetInstance(); - if (instance != null && instance.GetCurrentScene() == UIManager.ViewScene.Battle && BattleManagerBase.GetIns() != null) - { - DetailMgr detailMgr = BattleManagerBase.GetIns().DetailMgr; - detailMgr.DetailPanelControl.SetSize(GetBattleDetailPanelSizePercent()); - detailMgr.SubDetailPanelControl.SetSize(GetBattleDetailPanelSizePercent()); - } - }); - return item; - } - - private ItemSelect CreateMouseShortcutDetail(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemSelect item = CreateSelect(ID.MOUSE_SHORTCUT_DETAIL, isDispSeparatorLine, _battleRoot); - item._isOpenDirectionUp = true; - item.SetTitleLabel(systemText.Get("OtherConfig_0051")); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - SetShortcutDetail(item); - item.SetValue(item.PossibleValues[(int)ShortcutDetailPanel]); - item.AddChangeCallback(delegate - { - string value = item.GetValue(); - int num = 0; - for (num = 0; num < item.PossibleValues.Count && !(value == item.PossibleValues[num]); num++) - { - } - ShortcutDetailPanel = (ShortcutDetail)num; - ItemSelect shortcut = FindItem(ID.MOUSE_SHORTCUT_PLAY) as ItemSelect; - SetShortcut(shortcut); - ItemSelect shortcut2 = FindItem(ID.MOUSE_SHORTCUT_EVOLUTION) as ItemSelect; - SetShortcut(shortcut2); - }); - return item; - } - - private void SetShortcut(ItemSelect item) - { - item.SetPossibleValues(_mouseShortcuts, resizeListSprite: true, (string t) => Data.SystemText.Get(t)); - if (ShortcutDetailPanel == ShortcutDetail.RightClick) - { - if (item.name == ID.MOUSE_SHORTCUT_PLAY.ToString() && ShortcutPlay == Shortcut.RightClick) - { - ShortcutPlay = Shortcut.Off; - item.SetValue(item.PossibleValues[0]); - } - else if (item.name == ID.MOUSE_SHORTCUT_EVOLUTION.ToString() && ShortcutEvolution == Shortcut.RightClick) - { - ShortcutEvolution = Shortcut.Off; - item.SetValue(item.PossibleValues[0]); - } - } - if (ShortcutDetailPanel == ShortcutDetail.MiddleClick) - { - if (item.name == ID.MOUSE_SHORTCUT_PLAY.ToString() && ShortcutPlay == Shortcut.MiddleClick) - { - ShortcutPlay = Shortcut.Off; - item.SetValue(item.PossibleValues[0]); - } - else if (item.name == ID.MOUSE_SHORTCUT_EVOLUTION.ToString() && ShortcutEvolution == Shortcut.MiddleClick) - { - ShortcutEvolution = Shortcut.Off; - item.SetValue(item.PossibleValues[0]); - } - } - if (ShortcutDetailPanel == ShortcutDetail.DoubleClick) - { - if (item.name == ID.MOUSE_SHORTCUT_PLAY.ToString() && ShortcutPlay == Shortcut.DoubleClick) - { - ShortcutPlay = Shortcut.Off; - item.SetValue(item.PossibleValues[0]); - } - else if (item.name == ID.MOUSE_SHORTCUT_EVOLUTION.ToString() && ShortcutEvolution == Shortcut.DoubleClick) - { - ShortcutEvolution = Shortcut.Off; - item.SetValue(item.PossibleValues[0]); - } - } - } - - private void SetShortcutDetail(ItemSelect item) - { - item.SetPossibleValues(_mouseShortcutsDetail, resizeListSprite: true, (string t) => Data.SystemText.Get(t)); - int index = item.PossibleValues.Count - 1; - if ((ShortcutPlay == Shortcut.RightClick || ShortcutEvolution == Shortcut.RightClick) && ShortcutDetailPanel == ShortcutDetail.RightClick) - { - ShortcutDetailPanel = ShortcutDetail.Auto; - item.SetValue(item.PossibleValues[index]); - } - if ((ShortcutPlay == Shortcut.MiddleClick || ShortcutEvolution == Shortcut.MiddleClick) && ShortcutDetailPanel == ShortcutDetail.MiddleClick) - { - ShortcutDetailPanel = ShortcutDetail.Auto; - item.SetValue(item.PossibleValues[index]); - } - } - - private ItemToggle CreateKeyboardControl(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.KEYBOARD_CONTROL, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0056")); - bool value = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.KEYBOARD_CONTROL); - item.SetValue(value: true); - item.AddChangeCallback(delegate - { - bool value2 = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.KEYBOARD_CONTROL, value2); - ItemToggle obj = FindItem(ID.KEYBOARD_SHORTCUT_EVOLUTION) as ItemToggle; - obj.SetLabelLooks(value2); - obj.SetToggleLooks(value2); - obj.SetButtonEnable(value2); - obj.SetToggleEnable(value2); - ItemToggle obj2 = FindItem(ID.KEYBOARD_SHORTCUT_SPACE) as ItemToggle; - obj2.SetToggleLooks(value2); - obj2.SetLabelLooks(value2); - obj2.SetButtonEnable(value2); - obj2.SetToggleEnable(value2); - InputMgr.KeyboardControl = value2; - }); - StartCoroutine(InitializeKeyboardControlToggle(item, value)); - return item; - } - - private IEnumerator InitializeKeyboardControlToggle(ItemToggle item, bool value) - { - yield return null; - item.SetValue(value); - } - - private ItemToggle CreateKeyboardShortcutEvolution(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.KEYBOARD_SHORTCUT_EVOLUTION, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0057")); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.KEYBOARD_SHORTCUT_EVOLUTION)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.KEYBOARD_SHORTCUT_EVOLUTION, value); - InputMgr.KeyboardControlEvolution = value; - }); - return item; - } - - private ItemToggle CreateKeyboardShortcutSpace(bool isDispSeparatorLine) - { - SystemText systemText = Data.SystemText; - ItemToggle item = CreateToggle(ID.KEYBOARD_SHORTCUT_SPACE, isDispSeparatorLine, _battleRoot); - item.SetTitleLabel(systemText.Get("OtherConfig_0058")); - item.SetTitleTextLocalPos(SettingBase.CHILD_STATE_LABEL_POS); - item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.KEYBOARD_SHORTCUT_SPACE)); - item.AddChangeCallback(delegate - { - bool value = item.GetValue(); - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.KEYBOARD_SHORTCUT_SPACE, value); - InputMgr.KeyboardControlSpace = value; - }); - return item; - } - - public static int GetBattleDetailPanelSizePercent() - { - string text = _battleDetailSizes[PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_DETAIL_PANEL_SIZE)]; - return int.Parse(text.Remove(text.Length - 1)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/OutOfService.cs b/SVSim.BattleEngine/Engine/Wizard/OutOfService.cs deleted file mode 100644 index 57d7e699..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/OutOfService.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Wizard.ErrorDialog; - -namespace Wizard; - -public static class OutOfService -{ - private static readonly DateTime RefundEndTime = new DateTime(2026, 10, 31, 14, 59, 59, DateTimeKind.Utc); - - public const int ERROR_CODE_OUT_OF_SERVICE = 9999; - - public static void ShowRefundDialog(string refundUrl) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(systemText.Get("System_0070")); - dialogBase.SetText(systemText.Get("System_0071")); - dialogBase.SetRefund(refundUrl, systemText.Get("System_0072")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetPanelDepth(6000); - dialogBase.SetPanelSortingOrder(2); - UIManager.GetInstance().WebViewHelper.CloseWebViewDialog(); - } - - public static bool IsServiceEnded() - { - return DateTime.UtcNow > RefundEndTime; - } - - public static bool ShowServiceEndedDialogIfNeeded() - { - if (IsServiceEnded()) - { - ShowServiceEndedDialog(); - return true; - } - return false; - } - - private static void ShowServiceEndedDialog() - { - Wizard.ErrorDialog.Dialog.Create(9999); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PackChildGachaInfo.cs b/SVSim.BattleEngine/Engine/Wizard/PackChildGachaInfo.cs index 2c7838de..0e2b0ab9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PackChildGachaInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PackChildGachaInfo.cs @@ -2,15 +2,6 @@ namespace Wizard; public class PackChildGachaInfo { - private const int CAMPAIGN_EVERYDAY_10_FREE_PACKS_ID = 15; - - private const int CAMPAIGN_LEGEND_AND_SKIN_ID = 16; - - private const int CAMPAIGN_8TH_10_FREE_PACKS_ID = 24; - - private const int CAMPAIGN_8TH_LEGEND_AND_SKIN_ID = 25; - - private const int CAMPAIGN_2024_WINTER_FREE_PACKS_ID = 50; public int GachaId { get; set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/PackConfig.cs b/SVSim.BattleEngine/Engine/Wizard/PackConfig.cs index c58c7139..e068bed7 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PackConfig.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PackConfig.cs @@ -120,19 +120,6 @@ public class PackConfig public ShopExpirtyInfo ExpirtyInfo { get; set; } - public int GetGachaIdForEffectResource() - { - if (Category == PackCategory.LeaderSkinPack) - { - return OverrideDrawEffectPackId; - } - if (IsSpecialLayout || GachaUI.IsAdditionalPackId(PackId) || GachaUI.IsTsSkinPickupPackId(PackId)) - { - return OverrideDrawEffectPackId; - } - return PackId; - } - public int GetGachaIdForUIResource() { if (!IsSpecialCardPack) diff --git a/SVSim.BattleEngine/Engine/Wizard/PackInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/PackInfoTask.cs index f4652863..121f1752 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PackInfoTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PackInfoTask.cs @@ -35,16 +35,10 @@ public class PackInfoTask : BaseTask { } - public bool isNewCardPack; - public bool NeedsFooterBadgeIcon; public PackFirstTransition PackFirstTransitionData { get; private set; } - public List NotificatonAnimationParams { get; private set; } - - public AchievedInfo AchievedInfo { get; private set; } - public PackInfoTask(ApiType.Type apiType) { base.type = apiType; diff --git a/SVSim.BattleEngine/Engine/Wizard/ParameterOverwriterBase.cs b/SVSim.BattleEngine/Engine/Wizard/ParameterOverwriterBase.cs index daa43c29..014571c8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ParameterOverwriterBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ParameterOverwriterBase.cs @@ -8,9 +8,7 @@ public abstract class ParameterOverwriterBase : MonoBehaviour private enum State { None, - RequestOverwrite, - Overwrote - } + RequestOverwrite } private State _state; @@ -22,29 +20,6 @@ public abstract class ParameterOverwriterBase : MonoBehaviour _state = State.None; } - private void OnEnable() - { - _state = State.RequestOverwrite; - } - - private void OnDisable() - { - if (_state == State.Overwrote) - { - UndoParameters(); - } - _state = State.None; - } - - private void Update() - { - if (_state == State.RequestOverwrite && NGUITools.GetActive(TargetObject)) - { - OverwriteParameters(); - _state = State.Overwrote; - } - } - protected void RequestOverwrite() { if (base.enabled) diff --git a/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherHistory.cs b/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherHistory.cs deleted file mode 100644 index b0eb4fd5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherHistory.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using LitJson; - -namespace Wizard; - -public class PlayedTogetherHistory : HeaderData -{ - public const int FRIEND_STATUS_NO_ACTION = 0; - - public const int FRIEND_STATUS_IS_FRIEND = 1; - - public const int FRIEND_STATUS_IS_SEND = 2; - - public const int FRIEND_STATUS_IS_RECEIVED = 3; - - public int ViewerId; - - public string Name; - - public string CountryCode; - - public int Rank; - - public long EmblemId; - - public int DegreeId; - - public DateTime LastPlayTime; - - public int FriendStatus; - - public DateTime PlayedTime; - - public int ApplyId; - - public BattleParameter BattleParameter; - - public PlayedTogetherHistory(JsonData data) - { - ViewerId = data["viewer_id"].ToInt(); - Name = data["name"].ToString(); - CountryCode = data["country_code"].ToString(); - Rank = data["rank"].ToInt(); - EmblemId = data["emblem_id"].ToLong(); - DegreeId = data["degree_id"].ToInt(); - LastPlayTime = DateTime.Parse(data["last_play_time"].ToString()); - FriendStatus = data["friend_status"].ToInt(); - PlayedTime = DateTime.Parse(data["played_time"].ToString()); - ApplyId = data["friend_apply_id"].ToInt(); - BattleParameter = BattleParameter.JsonToBattleParameter(data); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherInfo.cs b/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherInfo.cs index 222f6463..c1b6e27a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PlayedTogetherInfo.cs @@ -4,5 +4,4 @@ namespace Wizard; public class PlayedTogetherInfo : HeaderData { - public List HistoryList = new List(); } diff --git a/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsCache.cs b/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsCache.cs index d39b533c..cc986d53 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsCache.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsCache.cs @@ -4,7 +4,6 @@ namespace Wizard; public class PlayerPrefsCache { - private Dictionary _boolCache = new Dictionary(); private Dictionary _intCache = new Dictionary(); @@ -37,27 +36,4 @@ public class PlayerPrefsCache _intCache.Add(id.Key, value); return value; } - - public void SetValue(KeyValuePair id, int value) - { - PlayerPrefsWrapper.SetValue(id, value); - _intCache[id.Key] = value; - } - - public bool GetBool(KeyValuePair id) - { - if (_boolCache.TryGetValue(id.Key, out var value)) - { - return value; - } - value = PlayerPrefsWrapper.GetBool(id); - _boolCache.Add(id.Key, value); - return value; - } - - public void SetBool(KeyValuePair id, bool value) - { - PlayerPrefsWrapper.SetBool(id, value); - _boolCache[id.Key] = value; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsWrapper.cs b/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsWrapper.cs index 6efe543e..0c1e9414 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsWrapper.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PlayerPrefsWrapper.cs @@ -1,5 +1,9 @@ using System.Collections.Generic; using UnityEngine; +// TODO(engine-cleanup-pass2): 14 of 15 methods unrun in baseline +// Type: Wizard.PlayerPrefsWrapper +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -9,12 +13,6 @@ public static class PlayerPrefsWrapper public static readonly int FALSE = 0; - public static readonly KeyValuePair BGM_VOLUME = new KeyValuePair("BGMVOLUME", 1f); - - public static readonly KeyValuePair SE_VOLUME = new KeyValuePair("SEVOLUME", 1f); - - public static readonly KeyValuePair VOICE_VOLUME = new KeyValuePair("VOICEVOLUME", 1f); - public static readonly KeyValuePair SOUND_MUTE = new KeyValuePair("SOUND_MUTE", FALSE); public static readonly KeyValuePair MOVIE_SUBTITLES = new KeyValuePair("MOVIE_SUBTITLES", FALSE); @@ -51,16 +49,10 @@ public static class PlayerPrefsWrapper public static readonly KeyValuePair CARDPACK_CARD_AUTO_OPEN = new KeyValuePair("SKIPCARDPACK", value: false); - public static readonly KeyValuePair HOME_CENTER_CARD_INDEX = new KeyValuePair("HOME_CARD_INDEX", 0); - public static readonly KeyValuePair LAST_BATTLE_DECK_ID = new KeyValuePair("LAST_BATTLE_DECK_ID", -1); - public static readonly KeyValuePair LAST_BATTLE_DECK_FORMAT_FOR_MYPAGE = new KeyValuePair("LAST_BATTLE_DECK_FORMAT", 2); - public static readonly KeyValuePair LAST_BATTLE_DECK_ID_FOR_MYPAGE = new KeyValuePair("LAST_BATTLE_DECK_ID_FOR_MYPAGE", 1); - public static readonly KeyValuePair LAST_BATTLE_IS_DEFAULT_DECK_FOR_MYPAGE = new KeyValuePair("LAST_BATTLE_IS_DEFDECK", TRUE); - public static readonly KeyValuePair LAST_BATTLE_DECK_FORMAT_FOR_SINGLE_RECOVER = new KeyValuePair("LAST_BATTLE_DECK_FORMAT_FOR_SINGLE_RECOVER", 2); public static readonly KeyValuePair LAST_BATTLE_LEADER_ID = new KeyValuePair("LAST_BATTLE_LEADER_ID", 0); @@ -75,22 +67,6 @@ public static class PlayerPrefsWrapper public static readonly KeyValuePair LAST_BATTLE_DECK_SLEEVE_ID = new KeyValuePair("LAST_BATTLE_DECK_SLEEVE_ID", ""); - public static readonly KeyValuePair LAST_BATTLE_DECK_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_DECK_ID1", 1); - - public static readonly KeyValuePair LAST_BATTLE_DECK_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_DECK_ID2", 1); - - public static readonly KeyValuePair LAST_BATTLE_DECK_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_DECK_ID3", 1); - - public static readonly KeyValuePair LAST_BATTLE_DECK_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_DECK_ID4", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_DECK_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_DECK_ID1", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_DECK_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_DECK_ID2", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_DECK_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_DECK_ID3", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_DECK_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_DECK_ID4", 1); - public static readonly KeyValuePair LAST_BATTLE_ENEMY_CARD_ID_ROOM1 = new KeyValuePair("LAST_BATTLE_ENEMY_CARD_ID_ROOM1", string.Empty); public static readonly KeyValuePair LAST_BATTLE_ENEMY_CARD_ID_ROOM2 = new KeyValuePair("LAST_BATTLE_ENEMY_CARD_ID_ROOM2", string.Empty); @@ -107,52 +83,10 @@ public static class PlayerPrefsWrapper public static readonly KeyValuePair LAST_BATTLE_ENEMY_CARD_ID_FORMAT4 = new KeyValuePair("LAST_BATTLE_ENEMY_CARD_ID_FORMAT4", 2); - public static readonly KeyValuePair LAST_BATTLE_ENEMY_CLASS_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_CLASS1", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_CLASS_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_CLASS2", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_CLASS_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_CLASS3", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_CLASS_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_CLASS4", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SUB_CLASS_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SUB_CLASS1", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SUB_CLASS_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SUB_CLASS2", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SUB_CLASS_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SUB_CLASS3", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SUB_CLASS_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SUB_CLASS4", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_MY_ROTATION_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_MY_ROTATION1", string.Empty); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_MY_ROTATION_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_MY_ROTATION2", string.Empty); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_MY_ROTATION_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_MY_ROTATION3", string.Empty); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_MY_ROTATION_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_MY_ROTATION4", string.Empty); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SLEEVE_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SLEEVE1", "1"); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SLEEVE_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SLEEVE2", "1"); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SLEEVE_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SLEEVE3", "1"); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SLEEVE_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SLEEVE4", "1"); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SKIN_ID_MULTI_DECK_ROOM1 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SKIN1", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SKIN_ID_MULTI_DECK_ROOM2 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SKIN2", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SKIN_ID_MULTI_DECK_ROOM3 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SKIN3", 1); - - public static readonly KeyValuePair LAST_BATTLE_ENEMY_SKIN_ID_MULTI_DECK_ROOM4 = new KeyValuePair("LAST_ROOM_BATTLE_ENEMY_SKIN4", 1); - public static readonly KeyValuePair LAST_BATTLE_PLAYER_BAN_DECK_ID = new KeyValuePair("LAST_BATTLE_PLAYER_BAN_DECK_ID", 1); public static readonly KeyValuePair LAST_BATTLE_ENEMY_BAN_DECK_ID = new KeyValuePair("LAST_BATTLE_ENEMY_BAN_DECK_ID", 1); - public static readonly KeyValuePair ROOM_MATCH_2PICK_DRAFT_MY_SELECT_DECK = new KeyValuePair("ROOM_MATCHI_2PICK_DRAFT_MY_SELECT_DECK", ""); - public static readonly KeyValuePair QUEST_LAST_USED_DECK_INFO = new KeyValuePair("QUEST_LAST_USED_DECK_INFO", string.Empty); public static readonly KeyValuePair FIRST_TIPS = new KeyValuePair("FIRST_TIPS", "0"); @@ -319,8 +253,6 @@ public static class PlayerPrefsWrapper public static readonly KeyValuePair AUTO_CACHE_CLEAR_FLAG = new KeyValuePair("AUTO_CACHE_CLEAR_FLAG", FALSE); - public static readonly KeyValuePair ASSET_FILE_ERROR_LATE = new KeyValuePair("ASSET_FILE_ERROR_IN_BATTLE", FALSE); - public static readonly KeyValuePair PURCHASE_ALERT = new KeyValuePair("PURCHASE_ALERT", TRUE); public static readonly KeyValuePair JOINING_GUILD_ID = new KeyValuePair("JOINING_GUILD_ID", -1); @@ -394,11 +326,6 @@ public static class PlayerPrefsWrapper return PlayerPrefs.GetInt(id.Key, id.Value); } - public static float GetValue(KeyValuePair id) - { - return PlayerPrefs.GetFloat(id.Key, id.Value); - } - public static string GetValue(KeyValuePair id) { return PlayerPrefs.GetString(id.Key, id.Value); @@ -419,51 +346,11 @@ public static class PlayerPrefsWrapper PlayerPrefs.SetInt(id.Key, value); } - public static void SetValue(KeyValuePair id, float value) - { - PlayerPrefs.SetFloat(id.Key, value); - } - public static void SetValue(KeyValuePair id, string value) { PlayerPrefs.SetString(id.Key, value); } - public static void ConvertOldStageIdListToNewStageIdList() - { - int value = GetValue(OFF_STAGE); - if (value == 0) - { - return; - } - bool[] array = new bool[Data.Load.data.OpenBattleFieldIdList.Count]; - string[] array2 = new string[12] - { - "1", "2", "3", "4", "5", "6", "7", "10", "18", "30", - "31", "1005" - }; - new List(); - int num = value; - int num2 = 1; - for (int i = 0; i < array2.Length; i++) - { - if ((num & num2) != 0) - { - for (int j = 0; j < Data.Load.data.OpenBattleFieldIdList.Count; j++) - { - if (array2[i] == Data.Load.data.OpenBattleFieldIdList[j].ToString()) - { - array[j] = true; - break; - } - } - } - num2 *= 2; - } - SetValue(OFF_STAGE, 0); - SetValue(OFF_STAGE_ID, ConvertStageIdListToSaveData(array)); - } - public static void TurnOnFirsStageIfStageIdListAllOff() { List list = CreateStageOffList(); diff --git a/SVSim.BattleEngine/Engine/Wizard/PlayerStaticData.cs b/SVSim.BattleEngine/Engine/Wizard/PlayerStaticData.cs index ffe2921f..cdad6943 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PlayerStaticData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PlayerStaticData.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; using Cute; using LitJson; using UnityEngine; +// TODO(engine-cleanup-pass2): 74 of 75 methods unrun in baseline +// Type: Wizard.PlayerStaticData +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -193,7 +197,7 @@ public class PlayerStaticData : MonoBehaviour return m_type switch { Type.Emblem => UserEmblemID.ToString(), - Type.RankIcon => (GameMgr.GetIns().GetDataMgr().IsDipslayHighRankFormat() ? UserRankHighAllFormat() : UserRank(Format)).ToString("00"), + Type.RankIcon => UserRank(Format).ToString("00"), // Pre-Phase-5b: headless has no display-high-rank flag Type.Country => UserCountryCode, _ => "", }; @@ -202,24 +206,16 @@ public class PlayerStaticData : MonoBehaviour public enum EmblemTexSize { - S, - M, - MAX - } + S} public enum RankTexSize { S, - L, - MAX - } + L } public enum CountryTexSize { - S, - M, - MAX - } + S} public enum AgreementState { @@ -235,9 +231,7 @@ public class PlayerStaticData : MonoBehaviour SEALED, COLOSSEUM, COMPETITION, - SPECIAL_CRYSTAL, - MAX - } + SPECIAL_CRYSTAL } public static AgreementState _tosAgreementState = AgreementState.NotAgree; @@ -251,30 +245,10 @@ public class PlayerStaticData : MonoBehaviour public static TimeData UserTime = new TimeData(); - public static int UserViewerID => Certification.ViewerId; - - public static string UserName - { - get - { - if (Data.Load.data == null) - { - return ""; - } - return Data.Load.data._userInfo.name; - } - set - { - Data.Load.data._userInfo.name = value; - } - } + public static int UserViewerID => 0; // Pre-Phase-5 chunk 39: aliased Certification.ViewerId — client-only UI accessor, dead headless public static string UserRegionCode => PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.CURRENT_REGION_CODE); - public static bool IsOfficialUser { get; set; } - - public static bool IsOfficialUserDisplay { get; set; } - public static AgreementState KorAuthorityAgreementState { get; set; } = AgreementState.NotAgree; public static int UserCrystalCount @@ -353,30 +327,6 @@ public class PlayerStaticData : MonoBehaviour } } - public static int UserChallengeTicketNum - { - get - { - return GetItemNum(1); - } - set - { - UpdateItemNum(1, value); - } - } - - public static int UserColosseumTicketNum - { - get - { - return GetItemNum(2); - } - set - { - UpdateItemNum(2, value); - } - } - public static long UserEmblemID { get @@ -395,18 +345,6 @@ public class PlayerStaticData : MonoBehaviour } } - public static int UserDegreeID - { - get - { - return Data.Load.data._userInfo.selected_degree_id; - } - set - { - Data.Load.data._userInfo.selected_degree_id = value; - } - } - public static string UserCountryCode { get @@ -425,83 +363,11 @@ public class PlayerStaticData : MonoBehaviour } } - public static bool UserPromotionFlag - { - get - { - return Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.is_promotion; - } - set - { - Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.is_promotion = value; - } - } - - public static int UserPromotionMatchCount - { - get - { - return Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.match_count; - } - set - { - Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.match_count = value; - } - } - - public static int UserPromotionWinCount - { - get - { - return Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.win; - } - set - { - Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.win = value; - } - } - - public static int UserPromotionLoseCount - { - get - { - return Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.lose; - } - set - { - Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.lose = value; - } - } - - public static string UserBirthDay - { - get - { - return Data.Load.data._userInfo.birth_day; - } - set - { - Data.Load.data._userInfo.birth_day = value; - } - } - public static bool IsLootBoxRegulation(LootBoxType type) { return Data.Load.data.LootBoxReguration[(int)type]; } - public static bool IsPurchaseNotificationOfLootBox() - { - for (int i = 0; i < 6; i++) - { - if (IsLootBoxRegulation((LootBoxType)i)) - { - return true; - } - } - return false; - } - public static int GetItemNum(int itemId) { if (Data.Load.data._userItemDict == null) @@ -515,11 +381,6 @@ public class PlayerStaticData : MonoBehaviour return 0; } - public static void InitializeItemNum(int itemId, int num) - { - UpdateItemNum(itemId, num); - } - public static void UpdateItemNum(int itemId, int num) { if (Data.Load.data._userItemDict == null) @@ -543,107 +404,6 @@ public class PlayerStaticData : MonoBehaviour UserRankTexture = new UserTex(UserTex.Type.RankIcon); } - public static void LoadUserEmblemTexture() - { - UserEmblemTexture.LoadTexture(); - } - - public static void AttachUserEmblemTexture(UITexture uiTexture, EmblemTexSize size) - { - UserEmblemTexture.AttachTexture(uiTexture, (int)size); - } - - public static void LoadUserCountryTexture() - { - if (!string.IsNullOrEmpty(UserCountryCode)) - { - UserCountryTexture.LoadTexture(); - } - } - - public static void AttachUserCountryTexture(UITexture uiTexture, CountryTexSize size) - { - UserCountryTexture.AttachTexture(uiTexture, (int)size); - } - - public static int UserBattlePointCurrentFormat() - { - return UserBattlePoint(Data.CurrentFormat); - } - - public static int UserBattlePoint(Format inFormat) - { - return Data.Load.data._userRank[(int)inFormat].battle_point; - } - - public static int UserBattlePointHighFormat() - { - int val = UserBattlePoint(Format.Rotation); - int val2 = UserBattlePoint(Format.Unlimited); - return Math.Max(val, val2); - } - - public static int UserMasterPointCurrentFormat() - { - return UserMasterPoint(Data.CurrentFormat); - } - - public static int UserMasterPoint(Format inFormat) - { - return Data.Load.data._userRank[(int)inFormat].master_point; - } - - public static int UserMasterPointHighAllFormat() - { - return UserMasterPoint(HighRankFormat()); - } - - public static Format HighRankFormat() - { - int num = UserRank(Format.Rotation); - int num2 = UserRank(Format.Unlimited); - if (num == num2) - { - int num3 = UserBattlePoint(Format.Rotation); - int num4 = UserBattlePoint(Format.Unlimited); - if (IsMasterRank(Format.Rotation)) - { - num3 = UserMasterPoint(Format.Rotation); - num4 = UserMasterPoint(Format.Unlimited); - } - if (num3 <= num4) - { - return Format.Unlimited; - } - return Format.Rotation; - } - if (num <= num2) - { - return Format.Unlimited; - } - return Format.Rotation; - } - - public static int UserBattlePointEachRankCurrentFormat() - { - return UserBattlePointEachRank(Data.CurrentFormat); - } - - public static int UserBattlePointEachRank(Format inFormat) - { - if (IsMasterRank(inFormat)) - { - return Data.Load.data._userRank[(int)inFormat].grandMasterData.currentMasterPoint; - } - int num = ((!Data.Load.data.IsStartRank(inFormat, UserRank(inFormat))) ? Data.Load.data.GetRankInfo(inFormat, UserRank(inFormat) - 1).accumulate_point : 0); - return UserBattlePoint(inFormat) - num; - } - - public static int UserRankCurrentFormat() - { - return UserRank(Data.CurrentFormat); - } - public static int UserRank(Format inFormat) { if (inFormat == Format.PreRotation) @@ -670,12 +430,6 @@ public class PlayerStaticData : MonoBehaviour UserRankTexture.LoadTexture(); } - public static void ReLoadUserRankTexture(string inOldId, string inNewId, Format inFormat) - { - UserRankTexture.Format = inFormat; - UserRankTexture.ReLoadTexture(inOldId, inNewId); - } - public static void AttachUserRankTexture(UITexture uiTexture, RankTexSize size) { UserRankTexture.AttachTexture(uiTexture, (int)size); @@ -691,36 +445,6 @@ public class PlayerStaticData : MonoBehaviour return Data.Load.data._userRank[(int)inFormat].is_master_rank; } - public static bool IsGrandMasterRankCurrentFormat() - { - return IsGrandMasterRank(Data.CurrentFormat); - } - - public static bool IsGrandMasterRank(Format inFormat) - { - return Data.Load.data._userRank[(int)inFormat].is_grand_master_rank; - } - - public static bool IsMaxRank(Format inFormat) - { - List rankInfoRawList = Data.Load.data.GetRankInfoRawList(inFormat); - return UserRank(inFormat) >= rankInfoRawList[rankInfoRawList.Count - 1].RankId; - } - - public static int UserNextRankExp(Format inFormat) - { - if (IsMasterRank(inFormat)) - { - return Data.Load.data._userRank[(int)inFormat].grandMasterData.targetMasterPoint; - } - return Mathf.Max(0, Data.Load.data.GetRankInfo(inFormat, UserRank(inFormat)).necessary_point - UserBattlePointEachRank(inFormat)); - } - - public static bool UserPromotionIsWin(int matchNum) - { - return (Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match.battle_result >> matchNum) % 2 != 0; - } - public static void UpdateHaveUserGoodsNumByJsonData(JsonData userGoodsList) { for (int i = 0; i < userGoodsList.Count; i++) @@ -753,14 +477,14 @@ public class PlayerStaticData : MonoBehaviour case UserGoods.Type.Card: { int cardId = (int)userGoodsId; - GameMgr.GetIns().GetDataMgr().UpdateUserOwnCardData(cardId, num); + /* Pre-Phase-5b: headless has no user card data */ break; } case UserGoods.Type.SpotCard: case UserGoods.Type.SpotCardOnlyLatestCardPack: { int cardId = (int)userGoodsId; - GameMgr.GetIns().GetDataMgr().SpotCardData.SetSpotCardNum(cardId, num); + /* Pre-Phase-5b: headless has no spot card data */ break; } case UserGoods.Type.Rupy: @@ -771,7 +495,7 @@ public class PlayerStaticData : MonoBehaviour } break; case UserGoods.Type.Skin: - GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId((int)userGoodsId)?.Acquired(); + /* Pre-Phase-5b: headless has no chara master */ break; case UserGoods.Type.Sleeve: Data.Master.SleeveMgr.Acquired(userGoodsId); diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticeAISettingDataSet.cs b/SVSim.BattleEngine/Engine/Wizard/PracticeAISettingDataSet.cs index 8c45b621..1af291fa 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PracticeAISettingDataSet.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PracticeAISettingDataSet.cs @@ -12,21 +12,8 @@ public class PracticeAISettingDataSet _dataTable = new List(); } - public void AddData(PracticeAISettingData data) - { - if (!_dataTable.Any((PracticeAISettingData d) => d.ClassId == data.ClassId && d.Difficulty == data.Difficulty)) - { - _dataTable.Add(data); - } - } - public PracticeAISettingData GetSettingData(int classId, int difficulty) { return _dataTable.First((PracticeAISettingData d) => d.ClassId == classId && d.Difficulty == difficulty); } - - public List GetSettingDataTable() - { - return _dataTable; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticeDeckInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticeDeckInfoTask.cs deleted file mode 100644 index 92838959..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticeDeckInfoTask.cs +++ /dev/null @@ -1,36 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class PracticeDeckInfoTask : BaseTask -{ - public class PracticeDeckInfoTaskParam : BaseParam - { - public int deck_format; - } - - public DeckGroupListData DeckGroupListData { get; private set; } - - public PracticeDeckInfoTask() - { - base.type = ApiType.Type.PracticeDeckInfo; - base.Params = new PracticeDeckInfoTaskParam - { - deck_format = Data.FormatConvertApi(Format.All) - }; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); - DeckGroupListData = new DeckGroupListData(jsonData, Format.All); - GameMgr.GetIns().GetDataMgr().CurrentDeckListParamData = DeckGroupListData; - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticeDeckSelectConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/PracticeDeckSelectConfirmDialog.cs deleted file mode 100644 index 31fdb4a9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticeDeckSelectConfirmDialog.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Cute; - -namespace Wizard; - -public static class PracticeDeckSelectConfirmDialog -{ - private const int DECK_SELECT_DIALOG_PANEL_DEPTH = 15; - - private const string DECK_DECISION_PATH = "UI/DeckList/DeckDecision"; - - public static void Create(DialogBase dialogDeckList, DeckData deck, bool isBattleAgain) - { - if (!deck.IsUsable()) - { - InCompleteDeckDecideDialog.Create(dialogDeckList, deck); - return; - } - CompleteDeckDecideDialog.CreateForSingleDeck(dialogDeckList, deck, showSimpleStageOption: true, delegate - { - DecideDeck(deck, isBattleAgain); - }); - } - - public static void DecideDeck(DeckData deck, bool isBattleAgain) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.Load(); - DeckListUtility.DataMgrSaveLastSelectDeckData(deck); - dataMgr.SetEnemySubClassID(10); - dataMgr.SetEnemyMyRotationInfo(""); - dataMgr.SetEnemySleeveId(3000011L); - Data.CurrentFormat = deck.Format; - CardMaster.SetBattleCardMasterId(FormatBehaviorManager.GetDefaultBehaviour(deck.Format).CardMasterId); - DataMgr dataMgr2 = GameMgr.GetIns().GetDataMgr(); - if (isBattleAgain) - { - dataMgr2.Load(); - int enemyCharaOld = dataMgr2.GetEnemyCharaId(); - dataMgr2.SetSoroPlay3DFieldID(dataMgr2.Practice3DfieldId); - GameMgr.GetIns().GetSoundMgr().StopAllBGM(0.5f); - UIManager.GetInstance().CreatFadeClose(delegate - { - StartBattleAgain(enemyCharaOld); - }); - } - else - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.ClassSelectionPage, null, ClassSelectionPageParam.CreatePracticeSelect()); - } - } - - private static void StartBattleAgain(int enemyCharaOld) - { - UIManager.GetInstance().StartCoroutine(BattleManagerBase.GetIns().GetBattleControl().BattleEnd(delegate - { - UIManager.GetInstance().CreatFadeOpen(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.SetEnemyCharaId(enemyCharaOld); - dataMgr.SetCurrentEnemyDeckDataFromAIDeck(dataMgr.GetEnemyClassId(), dataMgr.m_EnemyAIDifficulty, dataMgr.m_EnemyAILogicLevel, dataMgr.m_EnemyAIMaxLife, dataMgr.m_EnemyAIDeckId, dataMgr.m_EnemyAIStyleId, dataMgr.m_EnemyAIEmoteId, dataMgr.m_EnemyAIUseInnerEmote); - dataMgr.LoadEnemyClassData(); - PracticeStartTask task = new PracticeStartTask(); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - IsShow_CardIntroduction = true - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle, param); - })); - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticeFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticeFinishTask.cs index 19575363..2f655be2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PracticeFinishTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PracticeFinishTask.cs @@ -10,25 +10,11 @@ public class PracticeFinishTask : BaseTask { public int deck_no; - public int is_win; - - public int evolve_count; - - public int total_turn; - - public int enemy_class_id; - - public int difficulty; - public int deck_format; public int class_id; public Dictionary mission; - - public string recovery_data; - - public string[] prosessing_time_data; } public PracticeFinishTask() @@ -36,32 +22,6 @@ public class PracticeFinishTask : BaseTask base.type = ApiType.Type.PracticeFinish; } - public void SetParameter(int deck_no, int is_win, int evolve_count, int total_turn, int enemy_class_id, int difficulty, Format format, int class_id) - { - BattleManagerBase ins = BattleManagerBase.GetIns(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - PracticeFinishTaskParam practiceFinishTaskParam = new PracticeFinishTaskParam - { - deck_no = deck_no, - is_win = is_win, - evolve_count = evolve_count, - total_turn = total_turn, - enemy_class_id = enemy_class_id, - difficulty = difficulty, - deck_format = Data.FormatConvertApi(format), - class_id = class_id - }; - if (dataMgr.RecoveryData == null) - { - dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); - } - practiceFinishTaskParam.recovery_data = dataMgr.RecoveryData.ToJson(); - BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true); - BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class; - practiceFinishTaskParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass); - base.Params = practiceFinishTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleBattleFinish.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleBattleFinish.cs deleted file mode 100644 index e75d950a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleBattleFinish.cs +++ /dev/null @@ -1,53 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class PracticePuzzleBattleFinish : BaseTask -{ - public class PracticePuzzleBattleFinishParam : BaseParam - { - public int puzzle_id; - - public int retry_count; - - public bool is_win; - } - - public PracticePuzzleBattleFinish() - { - base.type = ApiType.Type.PracticePuzzleBattleFinish; - } - - public void SetParameter(int puzzleId, int retryCount, bool isWin) - { - PracticePuzzleBattleFinishParam practicePuzzleBattleFinishParam = new PracticePuzzleBattleFinishParam(); - practicePuzzleBattleFinishParam.puzzle_id = puzzleId; - practicePuzzleBattleFinishParam.retry_count = retryCount; - practicePuzzleBattleFinishParam.is_win = isWin; - base.Params = practicePuzzleBattleFinishParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - DeleteRecoveryFileIfBattleAlreadyEnded(num); - return num; - } - Data.PracticePuzzleFinishData = new PracticePuzzleFinishData(); - Data.PracticePuzzleFinishData._responseData = base.ResponseData; - Data.PracticePuzzleFinishData.class_chara_experience = 0; - Data.PracticePuzzleFinishData.class_chara_level = 0; - Data.PracticePuzzleFinishData.get_class_chara_experience = base.ResponseData["data"]["get_class_experience"].ToInt(); - Data.PracticePuzzleFinishData.class_chara_experience = base.ResponseData["data"]["class_experience"].ToInt(); - Data.PracticePuzzleFinishData.class_chara_level = base.ResponseData["data"]["class_level"].ToInt(); - JsonData jsonData = base.ResponseData["data"]["achieved_info"]; - if (jsonData.GetJsonType() == JsonType.Object) - { - Data.PracticePuzzleFinishData.AchievedInfo.Read(jsonData); - } - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleBattleStartTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleBattleStartTask.cs deleted file mode 100644 index e133929e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleBattleStartTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class PracticePuzzleBattleStartTask : BaseTask -{ - public class PracticePuzzleBattleStartTaskTaskParam : BaseParam - { - public int puzzle_id; - } - - public PracticePuzzleBattleStartTask() - { - base.type = ApiType.Type.PracticePuzzleBattleStart; - } - - public void SetParameter(int puzzleId) - { - PracticePuzzleBattleStartTaskTaskParam practicePuzzleBattleStartTaskTaskParam = new PracticePuzzleBattleStartTaskTaskParam(); - practicePuzzleBattleStartTaskTaskParam.puzzle_id = puzzleId; - base.Params = practicePuzzleBattleStartTaskTaskParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleData.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleData.cs deleted file mode 100644 index 5551a587..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleData.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using LitJson; - -namespace Wizard; - -public class PracticePuzzleData -{ - public int GroupdId { get; private set; } - - public string Title { get; private set; } - - public int CurrentClearCount { get; private set; } - - public int MaxClearCount { get; private set; } - - public bool IsMissionTarget { get; private set; } - - public bool IsClear => CurrentClearCount >= MaxClearCount; - - public PracticePuzzleData(JsonData json) - { - GroupdId = json["puzzle_master_id"].ToInt(); - IsMissionTarget = json["is_mission_target"].ToBoolean(); - Title = Data.SystemText.Get(json["basic_title_text_id"].ToString()); - List list = PuzzleQuestSelectDialog.CreateDisplayData(isDisplayNew: true, json["puzzle_data"]); - MaxClearCount = list.Count; - CurrentClearCount = list.Count((PuzzleQuestSelectDialog.DisplayData puzzle) => puzzle.IsCleared); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleInfoTask.cs deleted file mode 100644 index 763c59e3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleInfoTask.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class PracticePuzzleInfoTask : BaseTask -{ - public List PuzzleDataList { get; private set; } = new List(); - - public PracticePuzzleInfoTask() - { - base.type = ApiType.Type.PracticePuzzleInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - PuzzleDataList.Add(new PracticePuzzleData(jsonData[i])); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleListTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleListTask.cs deleted file mode 100644 index d20cecbf..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleListTask.cs +++ /dev/null @@ -1,40 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class PracticePuzzleListTask : BaseTask -{ - public class PracticePuzzleListTaskParam : BaseParam - { - public int puzzle_master_id; - } - - public bool IsDisplayBadge { get; private set; } - - public PuzzleQuestInfo PuzzleQuestInfo { get; private set; } - - public PracticePuzzleListTask() - { - base.type = ApiType.Type.PracticePuzzleList; - } - - public void SetParameter(int puzzleGroupId) - { - PracticePuzzleListTaskParam practicePuzzleListTaskParam = new PracticePuzzleListTaskParam(); - practicePuzzleListTaskParam.puzzle_master_id = puzzleGroupId; - base.Params = practicePuzzleListTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - IsDisplayBadge = jsonData["is_display_badge"].ToBoolean(); - PuzzleQuestInfo = new PuzzleQuestInfo(jsonData); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionData.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionData.cs deleted file mode 100644 index 513f9fb0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionData.cs +++ /dev/null @@ -1,32 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class PracticePuzzleMissionData -{ - public string Name { get; private set; } - - public UserGoods.Type UserGoodsType { get; private set; } - - public long ItemId { get; private set; } - - public int ItemCount { get; private set; } - - public int CurrentClearCount { get; private set; } - - public int TotalMissionCount { get; private set; } - - public bool IsCleared { get; private set; } - - public PracticePuzzleMissionData(JsonData json) - { - Name = json["mission_name"].ToString(); - JsonData jsonData = json["reward_list"][0]; - UserGoodsType = (UserGoods.Type)jsonData["reward_type"].ToInt(); - ItemId = jsonData["reward_detail_id"].ToLong(); - ItemCount = jsonData["reward_number"].ToInt(); - CurrentClearCount = json["total_count"].ToInt(); - TotalMissionCount = json["require_number"].ToInt(); - IsCleared = json["is_achieved"].ToBoolean(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionDialog.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionDialog.cs deleted file mode 100644 index e341faca..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionDialog.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public class PracticePuzzleMissionDialog : MonoBehaviour -{ - [SerializeField] - private SimpleScrollViewUI _simpleScrollView; - - [SerializeField] - private ResourceHandler _resourceHandler; - - [SerializeField] - private GameObject _missionNotExist; - - private List _missionList; - - public static void Create(List missionList, GameObject prefab) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Mission_0003")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - PracticePuzzleMissionDialog component = Object.Instantiate(prefab).GetComponent(); - dialogBase.SetObj(component.gameObject); - component.Initialize(missionList); - } - - private void Initialize(List missionList) - { - _missionList = missionList; - _missionNotExist.SetActive(missionList.Count == 0); - _simpleScrollView.CreateScrollView(missionList.Count, UpdateMissionPlate); - } - - private void UpdateMissionPlate(int index, GameObject plateObject) - { - PracticePuzzleMissionData mission = _missionList[index]; - plateObject.GetComponent().width = 800; - plateObject.GetComponent().SetPracticePuzzleMission(mission, _resourceHandler, canChangeMissions: false, index != _missionList.Count - 1, displayChange: false); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionListTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionListTask.cs deleted file mode 100644 index fbae5a69..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleMissionListTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class PracticePuzzleMissionListTask : BaseTask -{ - public List MissionData { get; private set; } - - public PracticePuzzleMissionListTask() - { - base.type = ApiType.Type.PracticePuzzleMissionList; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - MissionData = new List(); - JsonData jsonData = base.ResponseData["data"]; - for (int i = 0; i < jsonData.Count; i++) - { - MissionData.Add(new PracticePuzzleMissionData(jsonData[i])); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzlePlate.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzlePlate.cs deleted file mode 100644 index 2d6bd42a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzlePlate.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class PracticePuzzlePlate : MonoBehaviour -{ - [SerializeField] - private UILabel _title; - - [SerializeField] - private UIButton _button; - - [SerializeField] - private UILabel _clearCountLabel; - - [SerializeField] - private UITexture _plateTexture; - - [SerializeField] - private GameObject _selectSprite; - - [SerializeField] - private GameObject _alreadyClear; - - [SerializeField] - private TweenAlpha _selectSpriteTween; - - [SerializeField] - private GameObject _missionTarget; - - public PracticePuzzleData PuzzleData { get; private set; } - - public void UpdateView(PracticePuzzleData data, Action onSelect, bool isSelected) - { - PuzzleData = data; - _title.text = data.Title; - _clearCountLabel.text = $"{data.CurrentClearCount}/{data.MaxClearCount}"; - _alreadyClear.gameObject.SetActive(data.IsClear); - _clearCountLabel.gameObject.SetActive(!data.IsClear); - _missionTarget.SetActive(data.IsMissionTarget); - _plateTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(GetPlateTexturePath(data, isFetch: true)); - UpdateSelectSpriteVisible(isSelected); - UIEventListener.Get(_button.gameObject).onClick = delegate - { - onSelect.Call(data); - }; - } - - public static string GetPlateTexturePath(PracticePuzzleData data, bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(data.GroupdId.ToString(), ResourcesManager.AssetLoadPathType.PracticePuzzleThumbnail, isFetch); - } - - public void UpdateSelectSpriteVisible(bool visible) - { - _selectSprite.SetActive(visible); - if (visible) - { - _selectSpriteTween.PlayPingPong(isIncreaseAlpha: false); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleUI.cs b/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleUI.cs deleted file mode 100644 index bd7cc09c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/PracticePuzzleUI.cs +++ /dev/null @@ -1,222 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class PracticePuzzleUI : UIBase -{ - private const int INVALID_GROUP_ID = 0; - - private const string BG_TEXTURE_PATH = "bg_puzzle"; - - private const int CHARACTER_ID = 3704; - - [SerializeField] - private UITexture _character; - - [SerializeField] - private SimpleScrollViewUI _puzzleListScrollView; - - [SerializeField] - private UIButton _decideButton; - - [SerializeField] - private UIButton _missionButton; - - [SerializeField] - private UITexture _backGround; - - [SerializeField] - private GameObject _puzzleMissionDialogPrefab; - - private List _loadFileList = new List(); - - private List _puzzleListData; - - private PracticePuzzleData _selectData; - - public static void ClearInMyPageScene() - { - GameMgr.GetIns().GetDataMgr().PracticePuzzleGroupId = 0; - } - - public override void onFirstStart() - { - base.onFirstStart(); - Data.MyPageNotifications.data.IsPracticePuzzleBadgeEnable = false; - UIManager.GetInstance().ShowFooterMenu(isShow: true); - UIManager.GetInstance()._Footer.UpdateCurrentIndex(1); - UIManager.GetInstance()._Footer.UpdateSoloPlayBadgeIcon(); - InitializeTopBar(); - UIEventListener.Get(_decideButton.gameObject).onClick = delegate - { - OnClickDecideButton(); - }; - UIEventListener.Get(_missionButton.gameObject).onClick = delegate - { - OnClickMissionButton(); - }; - PracticePuzzleInfoTask task = new PracticePuzzleInfoTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _puzzleListData = task.PuzzleDataList; - LoadResource(delegate - { - InitializeCharacterTexture(); - InitializeBackGround(); - InitializeButtonEffect(); - _puzzleListScrollView.CreateScrollView(_puzzleListData.Count, InitializePlate); - int defaultScrollIndex = GetDefaultScrollIndex(_puzzleListData); - _puzzleListScrollView.MovePlateByIndex(defaultScrollIndex, SimpleScrollViewUI.VerticalMovement.Center); - _selectData = _puzzleListData[defaultScrollIndex]; - UpdateSelectCursor(_selectData); - UIManager.GetInstance().OnReadyViewScene(isFadein: true); - }); - })); - } - - private int GetDefaultScrollIndex(List list) - { - for (int i = 0; i < list.Count; i++) - { - if (list[i].GroupdId == GameMgr.GetIns().GetDataMgr().PracticePuzzleGroupId) - { - return i; - } - } - return 0; - } - - protected override void OnDestroy() - { - base.OnDestroy(); - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - } - - private void LoadResource(Action onFinish) - { - _loadFileList.Add(GetCharacterTexturePath(isFetch: false)); - _loadFileList.Add(GetBackGroundTexturePath(isFetch: false)); - _loadFileList.Add(Toolbox.ResourcesManager.GetAssetTypePath("cmn_ui_btn_1", ResourcesManager.AssetLoadPathType.Effect2D)); - foreach (PracticePuzzleData puzzleListDatum in _puzzleListData) - { - _loadFileList.Add(PracticePuzzlePlate.GetPlateTexturePath(puzzleListDatum, isFetch: false)); - } - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadFileList, delegate - { - onFinish.Call(); - })); - } - - private string GetBackGroundTexturePath(bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath("bg_puzzle", ResourcesManager.AssetLoadPathType.Background, isFetch); - } - - private void InitializeButtonEffect() - { - EffectUtility.CreateEffect2D(new Effect2dCreateParam - { - Parent = _decideButton.gameObject, - EffectName = "cmn_ui_btn_1", - ColorCode = eColorCodeId.DECISION_BTN_2_COLOR, - InitActive = false, - UnloadAssetList = _loadFileList - }).SetActive(value: true); - } - - private void InitializePlate(int index, GameObject plateObject) - { - plateObject.GetComponent().UpdateView(_puzzleListData[index], OnSelectPuzzle, _puzzleListData[index] == _selectData); - } - - private void InitializeBackGround() - { - _backGround.mainTexture = Toolbox.ResourcesManager.LoadObject(GetBackGroundTexturePath(isFetch: true)); - } - - private void OnSelectPuzzle(PracticePuzzleData data) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - _selectData = data; - UpdateSelectCursor(data); - } - - private void UpdateSelectCursor(PracticePuzzleData selectData) - { - foreach (GameObject activePlate in _puzzleListScrollView.ActivePlateList) - { - PracticePuzzlePlate component = activePlate.GetComponent(); - component.UpdateSelectSpriteVisible(component.PuzzleData == selectData); - } - } - - private string GetCharacterTexturePath(bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(3704.ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isFetch); - } - - private void InitializeCharacterTexture() - { - _character.mainTexture = Toolbox.ResourcesManager.LoadObject(GetCharacterTexturePath(isFetch: true)) as Texture; - } - - private void InitializeTopBar() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 1; - changeViewSceneParam.IsCutCardMotion = true; - changeViewSceneParam.OnFinishChangeView = delegate - { - MyPageMenu.Instance.GoToPracticeTypeSelect(); - }; - string titleMsg = Data.SystemText.Get("Mission_0095"); - UIManager.GetInstance().CreateTopBar(base.gameObject, titleMsg, UIManager.ViewScene.MyPage, MoneyDraw: false, changeViewSceneParam).gameObject.layer = LayerMask.NameToLayer("FrontUI"); - } - - private void OnClickDecideButton() - { - if (_selectData == null) - { - return; - } - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - PracticePuzzleListTask task = new PracticePuzzleListTask(); - task.SetParameter(_selectData.GroupdId); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - List loadList = PuzzleQuestSelectDialog.CollectResourcePath(task.PuzzleQuestInfo.DisplayDatas); - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - PuzzleQuestSelectDialog.CreateDialog(task.PuzzleQuestInfo, delegate(PuzzleQuestData puzzleData, int difficulty) - { - StartBattle(_selectData.GroupdId, puzzleData, difficulty); - }).OnClose = delegate - { - Toolbox.ResourcesManager.RemoveAssetGroup(loadList); - }; - })); - })); - } - - public static void StartBattle(int groupId, PuzzleQuestData data, int difficulty) - { - PuzzleUtil.SetPracticePuzzleData(groupId, data, difficulty, DataMgr.BattleType.Practice); - PuzzleUtil.ChangeSceneToPracticePuzzle(data); - } - - private void OnClickMissionButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - PracticePuzzleMissionListTask puzzleMissionTask = new PracticePuzzleMissionListTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(puzzleMissionTask, delegate - { - PracticePuzzleMissionDialog.Create(puzzleMissionTask.MissionData, _puzzleMissionDialogPrefab); - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/PracticeStartTask.cs b/SVSim.BattleEngine/Engine/Wizard/PracticeStartTask.cs index 578602ef..d008df39 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PracticeStartTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PracticeStartTask.cs @@ -9,7 +9,7 @@ public class PracticeStartTask : BaseTask protected override int Parse() { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr int num = base.Parse(); if (num != 1) { diff --git a/SVSim.BattleEngine/Engine/Wizard/PreRotationFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/PreRotationFormatBehavior.cs index d13b0bdf..f1542395 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PreRotationFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PreRotationFormatBehavior.cs @@ -62,7 +62,7 @@ public class PreRotationFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsEnableDeckShareButton(int cardNum, int cardNumMax) { @@ -71,21 +71,21 @@ public class PreRotationFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Prerelease.cs b/SVSim.BattleEngine/Engine/Wizard/Prerelease.cs index ecea47e3..387fa59e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Prerelease.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Prerelease.cs @@ -33,11 +33,6 @@ public class Prerelease public bool IsEnableFreeMatch { get; private set; } - public static void Create(JsonData json) - { - Instance = new Prerelease(json); - } - public static void Clear() { Instance = null; diff --git a/SVSim.BattleEngine/Engine/Wizard/PurchaseConfirm.cs b/SVSim.BattleEngine/Engine/Wizard/PurchaseConfirm.cs index 612ff60e..8aab8058 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PurchaseConfirm.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PurchaseConfirm.cs @@ -6,19 +6,6 @@ namespace Wizard; public class PurchaseConfirm : MonoBehaviour { - private const string SPRITE_NAME_CRYSTAL = "icon_crystal_s"; - - private const string SPRITE_NAME_RUPY = "icon_rupy_s"; - - private const string SPRITE_NAME_2PICK_TICKET = "icon_2pick_s"; - - private const string SPRITE_NAME_ORB = "icon_orb_s"; - - private const string SPRITE_NAME_ORB_PIECE = "icon_orb_piece_s"; - - private const string SPRITE_NAME_RED_ETHER = "icon_liquid_s"; - - private const string SPRITE_NAME_SPOT_CARD_POINT = "icon_spotpoint_s"; [SerializeField] private UISprite _spriteConfirmItemIcon; @@ -59,8 +46,6 @@ public class PurchaseConfirm : MonoBehaviour [SerializeField] private GameObject _haveObj; - private const float WARNING_TEXT_OBJ_Y = -40f; - [SerializeField] private UITable _tablePackPoint; @@ -103,15 +88,9 @@ public class PurchaseConfirm : MonoBehaviour [SerializeField] private UILabel _campaignNameLabel; - [SerializeField] - private UIScrollView _scrollView; - [SerializeField] private GameObject _rootObj; - [SerializeField] - private UIScrollBar _scrollBar; - [SerializeField] private GameObject _jpnLawRoot; @@ -121,76 +100,9 @@ public class PurchaseConfirm : MonoBehaviour [SerializeField] private GameObject _saleTimeNoneLayout; - [SerializeField] - private UIButton[] _showJpnLawButton; - [SerializeField] private UILabel _expiryTimeLabel; - private const float CONFIRM_OBJ_Y_WITH_PACKPOINT = -32f; - - private const float HAVE_OBJ_Y_WITH_PACKPOINT = 0f; - - private const float PACK_POINT_Y_WITH_PRE_RELEASE_POINT = -60f; - - private const float NON_ITEM_Y_WITH_PACKPOINT = -12f; - - private void Start() - { - UIButton[] showJpnLawButton = _showJpnLawButton; - for (int i = 0; i < showJpnLawButton.Length; i++) - { - showJpnLawButton[i].onClick.Add(new EventDelegate(delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.LEGALTEXT); - })); - } - showJpnLawButton = _showJpnLawButton; - for (int i = 0; i < showJpnLawButton.Length; i++) - { - showJpnLawButton[i].gameObject.SetActive(value: false); - } - _expiryTimeLabel.gameObject.SetActive(value: false); - } - - public void SetConfirmDialog(int useNum, string purchaseText, int haveNum, UserGoods.Type type, long userGoodsId, ShopExpirtyInfo expirtyInfo, Texture texture = null) - { - switch (type) - { - case UserGoods.Type.Crystal: - SetClystalConfirmDialog(useNum, purchaseText, haveNum, expirtyInfo); - break; - case UserGoods.Type.Rupy: - SetRupyConfirmDialog(useNum, purchaseText, haveNum); - break; - case UserGoods.Type.Item: - switch (Item.GetItemType(type, (int)userGoodsId)) - { - case Item.Type.TwoPickTicket: - Set2PickTicketConfirmDialog(useNum, purchaseText, haveNum); - break; - case Item.Type.CardPackTicket: - SetTicketConfirmDialog(useNum, purchaseText, haveNum, texture); - break; - case Item.Type.Orb: - SetOrbConfirmDialog(useNum, purchaseText, haveNum); - break; - case Item.Type.OrbPiece: - SetOrbPieceConfirmDialog(useNum, purchaseText, haveNum); - break; - } - break; - case UserGoods.Type.RedEther: - SetRedEtherConfirmDialog(useNum, purchaseText, haveNum); - break; - case UserGoods.Type.SpotCardPoint: - SetSpotCardPointConfirmDialog(useNum, purchaseText, haveNum); - break; - } - UpdateJpnLawObj(); - } - private void UpdateJpnLawObj() { _ = _rootObj == null; @@ -246,56 +158,6 @@ public class PurchaseConfirm : MonoBehaviour HideJpnLawObj(); } - public void Set2PickTicketConfirmDialog(int useItemNum, string purchaseText, int haveItemCnt) - { - SetIconImage(UserGoods.Type.Item, Item.Type.TwoPickTicket); - int afterItemNum = haveItemCnt - useItemNum; - string unit = Data.SystemText.Get("Common_0117"); - string useItemNumText = Data.SystemText.Get("Shop_0042", useItemNum.ToString()); - SetLabelText(Data.SystemText.Get("Mail_0037"), useItemNumText, afterItemNum, unit, purchaseText, haveItemCnt); - HideJpnLawObj(); - } - - public void SetOrbConfirmDialog(int useItemNum, string purchaseText, int haveItemCnt) - { - SetIconImage(UserGoods.Type.Item, Item.Type.Orb); - int afterItemNum = haveItemCnt - useItemNum; - string unit = Data.SystemText.Get("Common_0116"); - string useItemNumText = Data.SystemText.Get("Shop_0133", useItemNum.ToString()); - SetLabelText(Data.SystemText.Get("Common_0158"), useItemNumText, afterItemNum, unit, purchaseText, haveItemCnt); - HideJpnLawObj(); - } - - public void SetOrbPieceConfirmDialog(int useItemNum, string purchaseText, int haveItemCnt) - { - SetIconImage(UserGoods.Type.Item, Item.Type.OrbPiece); - int afterItemNum = haveItemCnt - useItemNum; - string unit = Data.SystemText.Get("Common_0116"); - string useItemNumText = Data.SystemText.Get("Shop_0140", useItemNum.ToString()); - SetLabelText(Data.SystemText.Get("Common_0159"), useItemNumText, afterItemNum, unit, purchaseText, haveItemCnt); - HideJpnLawObj(); - } - - public void SetRedEtherConfirmDialog(int useItemNum, string purchaseText, int haveItemCnt) - { - SetIconImage(UserGoods.Type.RedEther); - int afterItemNum = haveItemCnt - useItemNum; - string unit = Data.SystemText.Get("Common_0116"); - string useItemNumText = Data.SystemText.Get("Shop_0134", useItemNum.ToString()); - SetLabelText(Data.SystemText.Get("Common_0205"), useItemNumText, afterItemNum, unit, purchaseText, haveItemCnt); - HideJpnLawObj(); - } - - public void SetSpotCardPointConfirmDialog(int useItemNum, string purchaseText, int haveItemCnt) - { - SetIconImage(UserGoods.Type.SpotCardPoint); - int afterItemNum = haveItemCnt - useItemNum; - string unit = Data.SystemText.Get("Common_0116"); - string useItemNumText = Data.SystemText.Get("Shop_0151", useItemNum.ToString()); - SetLabelText(Data.SystemText.Get("Common_0161"), useItemNumText, afterItemNum, unit, purchaseText, haveItemCnt); - HideJpnLawObj(); - } - public void SetLeaderSkinTicketConfirmDialog(int cost, string purchaseText, int haveItem, long itemId) { int afterItemNum = haveItem - cost; diff --git a/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardDialog.cs b/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardDialog.cs index 4d99011b..60b6c784 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardDialog.cs @@ -15,14 +15,6 @@ public class PurchaseRewardDialog : MonoBehaviour TITLE_BOTTOM_LARGE_FONT } - private const int LARGE_FONT_GRID_WIDTH = 275; - - private const float FLICK_MARGIN = 70f; - - private const int CARD_OBJECT_DEPTH = 23; - - private const int CARD_TEXTURE_DEPTH = 21; - private readonly Vector3 CARDOBJECT_COLLIDER_SIZE = new Vector3(175f, 230f, 1f); [SerializeField] @@ -72,16 +64,6 @@ public class PurchaseRewardDialog : MonoBehaviour private Layout _layout; - private const string PATH_NORMAL_LAYOUT = "UI/layoutParts/Dialog/PurchaseRewardDialog"; - - private const string PATH_LAYOUT_10 = "UI/layoutParts/Dialog/PurchaseRewardDialog10"; - - private const string PATH_NORMAL_LAYOUT_TITLE_BOTTOM = "UI/layoutParts/Dialog/PurchaseRewardDialogTitleBottom"; - - private const string PATH_LAYOUT_10_TITLE_BOTTOM = "UI/layoutParts/Dialog/PurchaseRewardDialog10TitleBottom"; - - private const string PATH_LAYOUT_TITLE_BOTTOM_LARGE_FONT = "UI/layoutParts/Dialog/PurchaseRewardDialogTitleBottomLargeFont"; - private bool IsFirstPage => _currentPageIndex <= 1; private bool IsLastPage => _currentPageIndex >= _lastPageIndex; @@ -248,7 +230,7 @@ public class PurchaseRewardDialog : MonoBehaviour { if (!IsFirstPage) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + ShowPage(_currentPageIndex - 1); } } @@ -257,7 +239,7 @@ public class PurchaseRewardDialog : MonoBehaviour { if (!IsLastPage) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + ShowPage(_currentPageIndex + 1); } } @@ -419,21 +401,4 @@ public class PurchaseRewardDialog : MonoBehaviour } return result; } - - private void OnDestroy() - { - if (_cardObjList != null) - { - for (int i = 0; i < _cardObjList.Count; i++) - { - UnityEngine.Object.Destroy(_cardObjList[i].CardObj.gameObject); - } - _cardObjList.Clear(); - } - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardItem.cs b/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardItem.cs index ab4e90d9..65ba1f0c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardItem.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PurchaseRewardItem.cs @@ -84,16 +84,9 @@ public class PurchaseRewardItem : MonoBehaviour [SerializeField] private GameObject[] _objLayouts; - private const string PATH_REWARD_DETAIL_NORMAL = "UI/layoutParts/Dialog/DialogSleeveDetail"; - - private const string PATH_REWARD_DETAIL_LARGE = "UI/layoutParts/Dialog/DialogSleeveDetailLarge"; - public string DetailDialogTitleOverride { get; set; } - private static CardSleeveDetailWindow InstantiateDetailPrefab(bool useLargeDetailDialog) - { - return (Object.Instantiate(Resources.Load(useLargeDetailDialog ? "UI/layoutParts/Dialog/DialogSleeveDetailLarge" : "UI/layoutParts/Dialog/DialogSleeveDetail")) as GameObject).GetComponent(); - } + // InstantiateDetailPrefab removed: CardSleeveDetailWindow deleted (DEAD-COLD engine cleanup Task 13) public void SetUserGoods(PurchaseRewardInfo purchaseReward, bool useLargeDetailDialog, GameObject cardObj, bool isPaging, bool isEnableItemNumber) { @@ -309,10 +302,8 @@ public class PurchaseRewardItem : MonoBehaviour } else { + // CardSleeveDetailWindow removed (DEAD-COLD engine cleanup Task 13) dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - CardSleeveDetailWindow cardSleeveDetailWindow = InstantiateDetailPrefab(useLargeDetailDialog); - dialogBase.SetObj(cardSleeveDetailWindow.gameObject); - cardSleeveDetailWindow.SetData(rewardList, string.Empty, null); } }; } diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleAnimation.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleAnimation.cs index 010c5986..4a5cedb4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleAnimation.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleAnimation.cs @@ -27,14 +27,6 @@ public class PuzzleAnimation : MonoBehaviour [SerializeField] private UISprite ArcaneOut; - private const float TextFadeDuration = 0.15f; - - private const float WaitTimeAfterTextFade = 0.075f; - - private const float BGFadeDuration = 0.15f; - - private const int LOADING_LAYER = 26; - private bool _isEndFadeOut; public float FadeOutDuration { get; private set; } = 0.7f; @@ -64,7 +56,7 @@ public class PuzzleAnimation : MonoBehaviour TitleFailed.spriteName = "result_text_failed"; TitleReset.atlas = atlas; TitleReset.spriteName = "result_text_resetting"; - GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectResultData", isBattle: true, isField: false, isBattleEffect: true); + /* Pre-Phase-5b: InitCommonEffect dropped */ base.gameObject.SetLayer(26, isSetChildren: true); Bg.gameObject.SetActive(value: false); FieldHideBg.gameObject.SetActive(value: false); @@ -98,13 +90,13 @@ public class PuzzleAnimation : MonoBehaviour { TweenAlpha.Begin(TitleReset.gameObject, 0.2f, 1f); iTween.ScaleTo(TitleReset.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_PUZZLE_RESET); + } else { TweenAlpha.Begin(TitleFailed.gameObject, 0.2f, 1f); iTween.ScaleTo(TitleFailed.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_PUZZLE_RESET); + } TweenAlpha.Begin(Bg.gameObject, 0.5f, 0.75f); TweenAlpha.Begin(FieldHideBg.gameObject, 0.5f, 1f); @@ -115,13 +107,13 @@ public class PuzzleAnimation : MonoBehaviour iTween.ScaleTo(ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); if (isReset) { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero, Quaternion.identity, 26); + /* Pre-Phase-5b: Start CMN_RESULT_TITLE_3 dropped */ TitleReset.transform.localScale = Vector3.one; iTween.ScaleTo(TitleReset.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); } else { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero, Quaternion.identity, 26); + /* Pre-Phase-5b: Start CMN_RESULT_TITLE_2 dropped */ TitleFailed.transform.localScale = Vector3.one; iTween.ScaleTo(TitleFailed.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); } diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleBattleMasterData.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleBattleMasterData.cs index 7918b31d..8a994959 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleBattleMasterData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleBattleMasterData.cs @@ -4,7 +4,6 @@ namespace Wizard; public class PuzzleBattleMasterData : Master.ReadFromCsv { - private const string DEFAULT_WIN_CONDITION = "{me.inplay.class.life}>0&{op.inplay.class.life}<=0"; public int Id { get; private set; } diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestData.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestData.cs index a9cb6b94..411d1c88 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestData.cs @@ -20,30 +20,6 @@ public class PuzzleQuestData : Master.ReadFromCsv public int PlayerSkin { get; private set; } - public long PlayerEmblemId - { - get - { - if (_playerEmblemId == -1) - { - return PlayerStaticData.UserEmblemID; - } - return _playerEmblemId; - } - } - - public int PlayerDegreeId - { - get - { - if (_playerDegreeId == -1) - { - return PlayerStaticData.UserDegreeID; - } - return _playerDegreeId; - } - } - public int EnemySkin { get; private set; } public int EnemyEmblemId { get; private set; } @@ -78,9 +54,4 @@ public class PuzzleQuestData : Master.ReadFromCsv _puzzleBattelMasterId = int.Parse(columns[num]); num++; } - - public void InitializeBattleMasterData(List list) - { - BattleData = list.Find((PuzzleBattleMasterData data) => data.Id == _puzzleBattelMasterId); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectDialog.cs index d9ee48bc..97c92509 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectDialog.cs @@ -34,10 +34,6 @@ public class PuzzleQuestSelectDialog : MonoBehaviour private Action _onDecide; - private const int DIFFICULTY_COUNT = 4; - - private const int BATTLE_CONFIRM_DIALOG_DEPTH = 20; - public static List CollectResourcePath(List displayDataList) { List list = new List(); @@ -139,14 +135,14 @@ public class PuzzleQuestSelectDialog : MonoBehaviour private void OnClickItem(DisplayData displayData) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetTitleLabel(Data.SystemText.Get("Common_0021")); dialogBase.SetSize(DialogBase.Size.S); dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); dialogBase.SetButtonText(Data.SystemText.Get("Common_0004"), Data.SystemText.Get("Common_0005")); dialogBase.SetPanelDepth(20); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + dialogBase.ClickSe_Btn1 = 0; dialogBase.onPushButton1 = delegate { _onDecide(displayData.Data, displayData.Difficulty); diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectGroup.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectGroup.cs index 3b642ae8..37f0d167 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectGroup.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectGroup.cs @@ -21,10 +21,6 @@ public class PuzzleQuestSelectGroup : MonoBehaviour [SerializeField] private GameObject _itemOrigin; - private const float HEADER_HEIGHT = 56f; - - private const float ITEM_HEIGHT = 137f; - public void Setup(string difficultyName, List displayDataList, Action onClick) { _difficultyLabel.text = difficultyName; diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectItem.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectItem.cs index 236600ac..50c5a570 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectItem.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleQuestSelectItem.cs @@ -26,8 +26,6 @@ public class PuzzleQuestSelectItem : MonoBehaviour private PuzzleQuestSelectDialog.DisplayData _displayData; - private const float PUSH_ANIMATION_DURATION = 0.03f; - private static readonly Vector3 PushAnimationScale = new Vector3(0.95f, 0.95f, 1f); public void Setup(PuzzleQuestSelectDialog.DisplayData displayData, Action onClick) diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleUtil.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleUtil.cs index 6db95304..95f82ccc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleUtil.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleUtil.cs @@ -8,18 +8,14 @@ namespace Wizard; public class PuzzleUtil { - public static void SetPracticePuzzleData(int groupId, PuzzleQuestData data, int difficulty, DataMgr.BattleType battleType) - { - GameMgr.GetIns().GetDataMgr().PracticePuzzleGroupId = groupId; - SetPuzzleQuestData(data, difficulty, battleType); - } public static void SetPuzzleQuestData(PuzzleQuestData data, int difficulty, DataMgr.BattleType battleType) { CardMaster.SetBattleCardMasterId(FormatBehaviorManager.GetDefaultBehaviour(Format.Unlimited).CardMasterId); - GameMgr.GetIns().IsPuzzleQuest = true; + // GameMgr.IsPuzzleQuest is const-false in headless (Phase 4); the assignment was a no-op + // signal for a UI branch headless never runs. Data.CurrentFormat = Format.Unlimited; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr dataMgr.m_BattleType = battleType; dataMgr.SetPlayerCharaIdBySkinId(data.PlayerSkin); dataMgr.SetPlayerSleeveId(3000011L); @@ -50,20 +46,6 @@ public class PuzzleUtil })); } - public static void ChangeSceneToPracticePuzzle(PuzzleQuestData data) - { - PracticePuzzleBattleStartTask practicePuzzleBattleStartTask = new PracticePuzzleBattleStartTask(); - practicePuzzleBattleStartTask.SetParameter(data.Id); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(practicePuzzleBattleStartTask, delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - IsShow_CardIntroduction = true - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle, param); - })); - } - public static IEnumerator OpenPuzzleSelectDialogCoroutine(Action onDecide, Action onOpen = null, Action onClose = null) { QuestOpenPuzzleDialogTask task = new QuestOpenPuzzleDialogTask(); diff --git a/SVSim.BattleEngine/Engine/Wizard/PuzzleWinConditionDisplay.cs b/SVSim.BattleEngine/Engine/Wizard/PuzzleWinConditionDisplay.cs index d2f6f746..4fb2988d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/PuzzleWinConditionDisplay.cs +++ b/SVSim.BattleEngine/Engine/Wizard/PuzzleWinConditionDisplay.cs @@ -18,10 +18,6 @@ public class PuzzleWinConditionDisplay : MonoBehaviour private Action _onComplete; - private const float APPEAR_DURATION = 0.5f; - - private const float DISAPPEAR_DURATION = 0.1f; - public void Setup(string winConditionText, Action onComplete) { _winConditionLabel.text = winConditionText; @@ -38,7 +34,7 @@ public class PuzzleWinConditionDisplay : MonoBehaviour { if (_isAppeared) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + TweenAlpha.Begin(base.gameObject, 0.1f, 0f).onFinished.Add(new EventDelegate(delegate { _onComplete(); diff --git a/SVSim.BattleEngine/Engine/Wizard/QRCodeUtility.cs b/SVSim.BattleEngine/Engine/Wizard/QRCodeUtility.cs deleted file mode 100644 index 0bca6a98..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/QRCodeUtility.cs +++ /dev/null @@ -1,311 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; -using Cute; -using UnityEngine; -using ZXing; -using ZXing.QrCode; -using ZXing.QrCode.Internal; - -namespace Wizard; - -public class QRCodeUtility -{ - public struct DeckDataFromQRCode - { - public CardBasePrm.ClanType ClanId; - - public CardBasePrm.ClanType SubClanId; - - public int[] CardIds; - - public bool IsSubClassSet; - - public Format Format; - - public MyRotationInfo MyRotationInfo { get; } - - public DeckDataFromQRCode(Format format, CardBasePrm.ClanType clanId, CardBasePrm.ClanType subClanId, int[] cardIds, MyRotationInfo myRotationInfo) - { - ClanId = clanId; - CardIds = cardIds; - SubClanId = subClanId; - IsSubClassSet = CardBasePrm.ClanTypeIsUseable(subClanId); - Format = format; - MyRotationInfo = myRotationInfo; - } - } - - public const int SIZE_SMALL = 207; - - public const int SIZE_BIG = 508; - - public const int BIGQRCODE_TEXTURE_WIDGIT_SIZE = 400; - - private const string NORMAL_URL_TAIL = "/deck/"; - - private const string CROSSOVER_URL_TAIL = "/deck_co/"; - - private const string MY_ROTATION_URL_TAIL = "/deck_my/"; - - public static DeckDataFromQRCode deckDataFromQRCode; - - public static Texture2D CreateQrCodeTexture(int width, int height, string content) - { - BarcodeWriter barcodeWriter = new BarcodeWriter - { - Format = BarcodeFormat.QR_CODE, - Options = new QrCodeEncodingOptions - { - ErrorCorrection = ErrorCorrectionLevel.L, - Width = width, - Height = height - } - }; - Texture2D texture2D = new Texture2D(width, height, TextureFormat.ARGB32, mipChain: false); - Color32[] pixels = barcodeWriter.Write(content); - texture2D.SetPixels32(pixels); - texture2D.Apply(); - return texture2D; - } - - private static string GetAppendUrlFromDeckType(IFormatBehavior formatBehavior, Format format) - { - if (formatBehavior.UseSubClass) - { - return "/deck_co/"; - } - if (format == Format.MyRotation) - { - return "/deck_my/"; - } - return "/deck/"; - } - - public static string GenerateQRCodeText(List deckList, CardBasePrm.ClanType? clanType, ClassSet classSet, IFormatBehavior formatBehavior, Format format, MyRotationInfo myRotationInfo) - { - bool useSubClass = formatBehavior.UseSubClass; - StringBuilder tempStringBuilder = UIUtil.GetTempStringBuilder(); - tempStringBuilder.Append("https://").Append("shadowverse-portal.com/api/v1/game_api/".Split('/')[0]); - tempStringBuilder.Append(GetAppendUrlFromDeckType(formatBehavior, format)); - tempStringBuilder.Append(((int)formatBehavior.DeckCodeType).ToString()).Append("."); - string value; - if (classSet == null) - { - value = ((int)clanType.Value).ToString(); - } - else - { - int mainClass = (int)classSet.MainClass; - value = mainClass.ToString(); - } - tempStringBuilder.Append(value).Append("."); - if (useSubClass) - { - int mainClass = (int)classSet.SubClass; - tempStringBuilder.Append(mainClass.ToString()).Append("."); - } - if (format == Format.MyRotation) - { - tempStringBuilder.Append(myRotationInfo.Id).Append("."); - } - CardMaster instance = CardMaster.GetInstance(formatBehavior.CardMasterId); - for (int i = 0; i < deckList.Count; i++) - { - int normalCardId = instance.GetCardParameterFromId(deckList[i]).NormalCardId; - tempStringBuilder.Append(instance.GetCardParameterFromId(normalCardId).CardHashId); - if (i != deckList.Count - 1) - { - tempStringBuilder.Append("."); - } - } - tempStringBuilder.Append("?lang=").Append(GetLanguageCode()); - return tempStringBuilder.ToString(); - } - - public static string GetLanguageCode() - { - string result = ""; - switch (CustomPreference.GetTextLanguage()) - { - case "Jpn": - result = "ja"; - break; - case "Ger": - result = "de"; - break; - case "Fre": - result = "fr"; - break; - case "Ita": - result = "it"; - break; - case "Cht": - result = "zh-tw"; - break; - case "Kor": - result = "ko"; - break; - case "Spa": - result = "es"; - break; - case "Chs": - case "Eng": - result = "en"; - break; - } - return result; - } - - public static string DecodeContentText(WebCamTexture webCamTexture) - { - if (webCamTexture == null) - { - return string.Empty; - } - return DecodeContentText(webCamTexture.GetPixels32(), webCamTexture.width, webCamTexture.height, isFromCamera: true); - } - - public static string DecodeContentText(Color32[] pixels, int width, int height, bool isFromCamera) - { - BarcodeReader barcodeReader = new BarcodeReader - { - AutoRotate = !isFromCamera - }; - Result result; - try - { - result = barcodeReader.Decode(pixels, width, height); - } - catch (Exception ex) - { - LocalLog.AccumulateTraceLog("#699501 :" + ex); - result = null; - } - if (result == null) - { - return string.Empty; - } - return result.Text; - } - - public static bool SetDeckFromQRCodeText(string qrCodeText, CardMaster.CardMasterId cardMasterId) - { - bool result = false; - string text = "https://" + "shadowverse-portal.com/api/v1/game_api/".Split('/')[0] + "/deck/"; - string text2 = "https://" + "shadowverse-portal.com/api/v1/game_api/".Split('/')[0] + "/deck_co/"; - string text3 = "https://" + "shadowverse-portal.com/api/v1/game_api/".Split('/')[0] + "/deck_my/"; - bool flag = qrCodeText.StartsWith(text); - bool flag2 = qrCodeText.StartsWith(text2); - bool flag3 = qrCodeText.StartsWith(text3); - if (!flag && !flag2 && !flag3) - { - return result; - } - if (!Regex.IsMatch(qrCodeText, "\\?lang=(\\w+$|zh-tw)")) - { - return result; - } - if (flag) - { - qrCodeText = Regex.Replace(qrCodeText, text, ""); - } - else if (flag2) - { - qrCodeText = Regex.Replace(qrCodeText, text2, ""); - } - else if (flag3) - { - qrCodeText = Regex.Replace(qrCodeText, text3, ""); - } - qrCodeText = Regex.Replace(qrCodeText, "\\?lang=(\\w+$|zh-tw)", ""); - string[] array = qrCodeText.Split('.'); - CardBasePrm.ClanType clanType = CardBasePrm.ClanType.NONE; - CardBasePrm.ClanType subClanId = CardBasePrm.ClanType.NONE; - MyRotationInfo myRotationInfo = null; - Format format = Format.Max; - try - { - format = GetFormatFromDeckCodeType((GenerateDeckCodeTask.SubmitDeckType)int.Parse(array[0])); - clanType = (CardBasePrm.ClanType)int.Parse(array[1]); - if (flag2) - { - subClanId = (CardBasePrm.ClanType)int.Parse(array[2]); - } - if (flag3) - { - myRotationInfo = Data.MyRotationAllInfo.Get(array[2]); - } - if (clanType < CardBasePrm.ClanType.MIN || clanType > CardBasePrm.ClanType.MAX) - { - return result; - } - } - catch (Exception ex) - { - if (array.Length >= 3) - { - Debug.LogError($"フォーマット: {array[0].ToString()}、クラス: {array[1].ToString()}、サブクラス: {array[2].ToString()}のいずれかの情報取得に失敗。{ex.ToString()}"); - } - else - { - Debug.LogError($"cardHashIdListの長さが{array.Length.ToString()}です。{ex.ToString()}"); - } - return result; - } - List list = new List(); - int num = 2; - if (flag2 || flag3) - { - num = 3; - } - for (int i = num; i < array.Length; i++) - { - try - { - int cardId = CardMaster.GetInstance(cardMasterId).GetCardParamFromCardHashId(array[i]).CardId; - if (!CardMaster.GetInstance(cardMasterId).CardExists(cardId)) - { - return result; - } - list.Add(cardId); - } - catch (Exception ex2) - { - Debug.LogError($"カードリストの{i.ToString()}番目要素の取得に失敗。{ex2.ToString()}"); - return result; - } - } - deckDataFromQRCode = new DeckDataFromQRCode(format, clanType, subClanId, list.ToArray(), myRotationInfo); - return true; - } - - public static Format GetFormatFromDeckCodeType(GenerateDeckCodeTask.SubmitDeckType type) - { - return type switch - { - GenerateDeckCodeTask.SubmitDeckType.NORMAL => Format.Unlimited, - GenerateDeckCodeTask.SubmitDeckType.Crossover => Format.Crossover, - _ => Format.Max, - }; - } - - public static bool IsShowQRCode(UICardList deckViewer, IFormatBehavior formatBehavior, Format format) - { - bool flag = deckViewer.getCardNum() == 40; - if (formatBehavior.UseSubClass) - { - flag &= deckViewer.CanShowQRCodeUseSubclass(); - } - if (format == Format.MyRotation && !deckViewer.IsDeckNull()) - { - flag &= deckViewer.IsAllCardCorrectMyRotation(); - } - if (format == Format.Avatar) - { - flag = false; - } - return flag; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/QrCamera.cs b/SVSim.BattleEngine/Engine/Wizard/QrCamera.cs deleted file mode 100644 index d24e7b97..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/QrCamera.cs +++ /dev/null @@ -1,320 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using Cute; -using SFB; -using UnityEngine; - -namespace Wizard; - -public class QrCamera : MonoBehaviour -{ - private enum Mode - { - None, - Camera, - CameraRoll - } - - [SerializeField] - private GameObject _cameraRoot; - - [SerializeField] - private UITexture _halfTransparentTexture; - - [SerializeField] - private UITexture _backGroundTexture; - - [SerializeField] - private UITexture _cameraTexture; - - [SerializeField] - private UISprite _blueFrameTexture; - - [SerializeField] - private UITexture _cameraRollTexture; - - private string _qrCodeCameraText; - - [SerializeField] - private UIButton _backButton; - - [SerializeField] - private UILabel _descriptionTextLabel; - - private WebCamTexture _webCamTexture; - - private Action _qrScanSuccessee; - - private Action _qrScanFailed; - - private GameObject _qrCameraObject; - - private const float DESCRIPTION_TEXT_OFFSET = 30f; - - private ScreenOrientation _preScreenOrientation = ScreenOrientation.LandscapeLeft; - - private List _resourcePathList = new List(); - - private const string HALF_TRANSPARENT_TEXTURE_PATH = "512black_82transparent"; - - private bool loadCameraRollImageCalled; - - private CardMaster.CardMasterId _cardMasterId = CardMaster.CardMasterId.Default; - - private bool webCameraSetSuccess; - - private Mode _currentMode; - - public UIButton backButton - { - get - { - return _backButton; - } - private set - { - _backButton = value; - } - } - - private void Awake() - { - _cameraRoot.gameObject.SetActive(value: false); - } - - public void SetCallBacks(Action qrScanSuccessee, Action qrScanFailed) - { - _qrScanSuccessee = qrScanSuccessee; - _qrScanFailed = qrScanFailed; - } - - public IEnumerator StartQRCamera(GameObject qrCameraObject, CardMaster.CardMasterId cardMasterId, Action onComplete, Action onFailed) - { - SetupWebCam(); - _cardMasterId = cardMasterId; - if (!webCameraSetSuccess) - { - onFailed.Call(); - yield break; - } - _cameraRoot.gameObject.SetActive(value: true); - _qrCameraObject = qrCameraObject; - _preScreenOrientation = Screen.orientation; - if (_preScreenOrientation == ScreenOrientation.LandscapeRight) - { - Vector3 localScale = _cameraTexture.transform.localScale; - localScale.x = 0f - localScale.x; - localScale.y = 0f - localScale.y; - _cameraTexture.transform.localScale = localScale; - } - _currentMode = Mode.Camera; - StartCoroutine(PlayCamera()); - onComplete.Call(); - } - - public void StartGetQRCodeFromImageFile(GameObject qrCameraObject, CardMaster.CardMasterId cardMasterId) - { - _cameraRollTexture.gameObject.SetActive(value: true); - _cardMasterId = cardMasterId; - _qrCameraObject = qrCameraObject; - _currentMode = Mode.CameraRoll; - ExtensionFilter[] extensions = new ExtensionFilter[1] - { - new ExtensionFilter("Image Files", "png", "jpg", "jpeg") - }; - string[] array = StandaloneFileBrowser.OpenFilePanel(Data.SystemText.Get("Card_0271"), "", extensions, multiselect: false); - if (array.Length != 0 && !string.IsNullOrEmpty(array[0])) - { - LoadCameraRollImage(array[0]); - } - else - { - UnityEngine.Object.Destroy(_qrCameraObject); - } - } - - public void StopQRCamera() - { - _cameraRoot.gameObject.SetActive(value: false); - _currentMode = Mode.None; - Toolbox.ResourcesManager.RemoveAssetGroup(_resourcePathList); - _resourcePathList.Clear(); - StopCamera(); - } - - private void Update() - { - if (_currentMode != Mode.Camera || !(_webCamTexture != null) || !_webCamTexture.isPlaying) - { - return; - } - if (_preScreenOrientation != Screen.orientation) - { - ChangeCameraTextrueDirection(); - } - _qrCodeCameraText = QRCodeUtility.DecodeContentText(_webCamTexture); - if (!string.IsNullOrEmpty(_qrCodeCameraText)) - { - StopCamera(); - if (QRCodeUtility.SetDeckFromQRCodeText(_qrCodeCameraText, _cardMasterId)) - { - _qrScanSuccessee.Call(); - } - else - { - _qrScanFailed.Call(Data.SystemText.Get("Card_0267")); - } - UnityEngine.Object.Destroy(_qrCameraObject); - } - } - - private void ChangeCameraTextrueDirection() - { - switch (Screen.orientation) - { - case ScreenOrientation.LandscapeLeft: - { - _preScreenOrientation = Screen.orientation; - Vector3 localScale2 = _cameraTexture.transform.localScale; - localScale2.x = 0f - localScale2.x; - localScale2.y = 0f - localScale2.y; - _cameraTexture.transform.localScale = localScale2; - break; - } - case ScreenOrientation.LandscapeRight: - { - _preScreenOrientation = Screen.orientation; - Vector3 localScale = _cameraTexture.transform.localScale; - localScale.x = 0f - localScale.x; - localScale.y = 0f - localScale.y; - _cameraTexture.transform.localScale = localScale; - break; - } - } - } - - private void SetupWebCam() - { - ResourcesManager resMgr = Toolbox.ResourcesManager; - _resourcePathList.Add(resMgr.GetAssetTypePath("512black_82transparent", ResourcesManager.AssetLoadPathType.UiOtherTexture)); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_resourcePathList, delegate - { - _halfTransparentTexture.mainTexture = resMgr.LoadObject(resMgr.GetAssetTypePath("512black_82transparent", ResourcesManager.AssetLoadPathType.UiOtherTexture, isfetch: true)) as Texture; - })); - WebCamDevice[] devices = WebCamTexture.devices; - if (devices != null && devices.Length != 0) - { - float num = (float)Screen.width / (float)Screen.height; - if (num != 1.7777778f) - { - float aspectRatio = _cameraTexture.aspectRatio; - float num2 = ((num < 1.7777778f) ? 1f : (num / aspectRatio)); - float num3 = ((num < 1.7777778f) ? (aspectRatio / num) : 1f); - _halfTransparentTexture.SetDimensions(Mathf.CeilToInt((float)_halfTransparentTexture.width * num2), Mathf.CeilToInt((float)_halfTransparentTexture.height * num3)); - _backGroundTexture.SetDimensions(Mathf.CeilToInt(_halfTransparentTexture.width), Mathf.CeilToInt(_halfTransparentTexture.height)); - } - _webCamTexture = new WebCamTexture(devices[0].name, Screen.width, Screen.height, 30); - webCameraSetSuccess = true; - } - else - { - webCameraSetSuccess = false; - } - } - - private IEnumerator PlayCamera() - { - if (!(_webCamTexture == null) && !_webCamTexture.isPlaying) - { - _halfTransparentTexture.ResizeCollider(); - _backGroundTexture.ResizeCollider(); - _cameraTexture.mainTexture = _webCamTexture; - _descriptionTextLabel.gameObject.SetActive(value: false); - _blueFrameTexture.gameObject.SetActive(value: false); - _cameraTexture.gameObject.SetActive(value: false); - _halfTransparentTexture.gameObject.SetActive(value: false); - _webCamTexture.Play(); - while (_webCamTexture.width <= 16 && _webCamTexture.height <= 16) - { - yield return null; - } - float num = (float)_halfTransparentTexture.width / (float)_halfTransparentTexture.height; - float num2 = (float)_webCamTexture.width / (float)_webCamTexture.height; - if (num > num2) - { - _cameraTexture.SetDimensions(Mathf.CeilToInt((float)_halfTransparentTexture.height / (float)_webCamTexture.height * (float)_webCamTexture.width), _halfTransparentTexture.height); - } - else if (Mathf.Approximately(num, num2)) - { - _cameraTexture.SetDimensions(_halfTransparentTexture.width, _halfTransparentTexture.height); - } - else - { - _cameraTexture.SetDimensions(_halfTransparentTexture.width, Mathf.CeilToInt((float)_halfTransparentTexture.width / (float)_webCamTexture.width * (float)_webCamTexture.height)); - } - _cameraTexture.SetDimensions(Mathf.CeilToInt((float)_cameraTexture.width * 0.8f), Mathf.CeilToInt((float)_cameraTexture.height * 0.8f)); - int num3 = Mathf.FloorToInt((float)Mathf.Min(_halfTransparentTexture.width, _halfTransparentTexture.height) * 0.5f); - _blueFrameTexture.SetDimensions(num3, num3); - _blueFrameTexture.gameObject.SetActive(value: true); - Vector3 localPosition = _descriptionTextLabel.transform.localPosition; - localPosition.y = (float)num3 * 0.5f; - localPosition.y += 30f; - _descriptionTextLabel.transform.localPosition = localPosition; - _descriptionTextLabel.gameObject.SetActive(value: true); - float num4 = (float)Screen.width / (float)Screen.height; - Rect uvRect = default(Rect); - if (num4 > 1f) - { - uvRect.height = 1.359375f; - uvRect.width = uvRect.height * num4; - uvRect.x = (1f - uvRect.width) * 0.5f; - uvRect.y = (1f - uvRect.height) * 0.5f; - } - else - { - uvRect.width = 1.359375f; - uvRect.height = uvRect.width / num4; - uvRect.x = (1f - uvRect.width) * 0.5f; - uvRect.y = (1f - uvRect.height) * 0.5f; - } - _halfTransparentTexture.uvRect = uvRect; - _halfTransparentTexture.gameObject.SetActive(value: true); - yield return null; - _cameraTexture.gameObject.SetActive(value: true); - } - } - - private void StopCamera() - { - if (!(_webCamTexture == null) && _webCamTexture.isPlaying) - { - _webCamTexture.Stop(); - } - } - - private void LoadCameraRollImage(string path) - { - if (!loadCameraRollImageCalled) - { - loadCameraRollImageCalled = true; - byte[] data = File.ReadAllBytes(path); - Texture2D texture2D = new Texture2D(2, 2); - texture2D.LoadImage(data); - _qrCodeCameraText = QRCodeUtility.DecodeContentText(texture2D.GetPixels32(), texture2D.width, texture2D.height, isFromCamera: false); - bool flag = false; - if (!string.IsNullOrEmpty(_qrCodeCameraText) && QRCodeUtility.SetDeckFromQRCodeText(_qrCodeCameraText, _cardMasterId)) - { - _qrScanSuccessee.Call(); - flag = true; - } - if (!flag) - { - string arg = ((!string.IsNullOrEmpty(_qrCodeCameraText)) ? Data.SystemText.Get("Card_0267") : Data.SystemText.Get("Card_0268")); - _qrScanFailed.Call(arg); - } - UnityEngine.Object.Destroy(_qrCameraObject); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestDeckListTask.cs b/SVSim.BattleEngine/Engine/Wizard/QuestDeckListTask.cs deleted file mode 100644 index 8b8053af..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/QuestDeckListTask.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class QuestDeckListTask : BaseTask -{ - public class QuestDeckListTaskParam : BaseParam - { - public int quest_stage_id; - } - - public DeckGroupListData DeckGroupListData { get; private set; } - - public List BonusFormatList { get; private set; } - - public List BonusClassList { get; private set; } - - public QuestDeckListTask() - { - base.type = ApiType.Type.QuestGetDeckList; - } - - public void SetParameter(int questStageId) - { - QuestDeckListTaskParam questDeckListTaskParam = new QuestDeckListTaskParam(); - questDeckListTaskParam.quest_stage_id = questStageId; - base.Params = questDeckListTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]); - DeckGroupListData = new DeckGroupListData(jsonData, Format.All); - DeckGroupListData.RemoveUseSubClassDeckList(); - BonusFormatList = new List(); - for (int i = 0; i < jsonData["bonus_deck_format"].Count; i++) - { - BonusFormatList.Add(Data.ParseApiFormat(jsonData["bonus_deck_format"][i].ToInt())); - } - BonusClassList = new List(); - for (int j = 0; j < jsonData["bonus_class_id"].Count; j++) - { - BonusClassList.Add((CardBasePrm.ClanType)jsonData["bonus_class_id"][j].ToInt()); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestDeckSelectConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/QuestDeckSelectConfirmDialog.cs index b25f42d8..9e0371ba 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestDeckSelectConfirmDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestDeckSelectConfirmDialog.cs @@ -2,81 +2,18 @@ using Cute; namespace Wizard; +// Post-Phase-5b (2026-07-03) UI stub. QuestDeckSelectConfirmDialog was the quest +// mode deck-select confirmation dialog — DataMgr writes for enemy AI setup + +// BattleControl.BattleEnd + scene change via QuestStartTask. Every path is +// UI-driven and unreachable headless. Class body stubbed to preserve the two +// external entry points (DecideDeck static, referenced by MyPage flows). public static class QuestDeckSelectConfirmDialog { - public static void Create(DialogBase dialogDeckList, DeckData deck, bool isBattleAgain) - { - if (!deck.IsUsable()) - { - InCompleteDeckDecideDialog.Create(dialogDeckList, deck); - return; - } - CompleteDeckDecideDialog completeDeckDecideDialog = CompleteDeckDecideDialog.CreateForSingleDeck(dialogDeckList, deck, showSimpleStageOption: false, delegate - { - DecideDeck(deck, isBattleAgain); - }); - if (GameMgr.GetIns().GetDataMgr().QuestBattleData.IsMockBattle) - { - completeDeckDecideDialog.DecisionUI.SetText(string.Empty, string.Empty); - completeDeckDecideDialog.Dialog.SetText(Data.SystemText.Get("Quest_0026", deck.GetDeckName())); - } - } - public static void DecideDeck(DeckData deck, bool isBattleAgain) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.Load(); - DeckListUtility.DataMgrSaveLastSelectDeckData(deck); - dataMgr.SetEnemySleeveId(3000011L); + // Pre-Phase-5b: full quest-battle setup via DataMgr + BattleControl. Preserved just + // the format update since Data.CurrentFormat may still be observed. Data.CurrentFormat = deck.Format; - new QuestLastUsedDeckSaveDataManager().SaveDeck(dataMgr.QuestBattleData.QuestStageId, deck); - dataMgr.Load(); CardMaster.SetBattleCardMasterId(FormatBehaviorManager.GetDefaultBehaviour(deck.Format).CardMasterId); - if (isBattleAgain) - { - GameMgr.GetIns().GetSoundMgr().StopAllBGM(0.5f); - UIManager.GetInstance().CreatFadeClose(delegate - { - UIManager.GetInstance().StartCoroutine(BattleManagerBase.GetIns().GetBattleControl().BattleEnd(delegate - { - UIManager.GetInstance().CreatFadeOpen(); - int enemyAiID = ((dataMgr.QuestBattleData != null) ? dataMgr.QuestBattleData.EnemyAiId : (-1)); - dataMgr.SetEnemyCharaId(dataMgr.GetEnemyCharaId()); - dataMgr.SetCurrentEnemyDeckDataFromAIDeck(dataMgr.GetEnemyClassId(), dataMgr.m_EnemyAIDifficulty, dataMgr.m_EnemyAILogicLevel, dataMgr.m_EnemyAIMaxLife, dataMgr.m_EnemyAIDeckId, dataMgr.m_EnemyAIStyleId, dataMgr.m_EnemyAIEmoteId, dataMgr.m_EnemyAIUseInnerEmote, enemyAiID); - dataMgr.LoadEnemyClassData(); - ChangeQuestBattleScene(); - })); - }); - return; - } - QuestBattleData battleData = dataMgr.QuestBattleData; - dataMgr.SetEnemyCharaId(battleData.CharaId); - dataMgr.SetStoryBgmID(battleData.BgmId); - dataMgr.SetSoroPlay3DFieldID(battleData.Battle3dFieldID); - StoryAISettingData settingData = Data.Master.QuestAISettingList.GetSettingData(battleData.EnemyAiId); - UIManager.GetInstance().createInSceneCenterLoading(); - Data.Master.LoadAICsv(new AICsvLoadingInfo(settingData.DeckId, settingData.StyleId, settingData.EmoteId), delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - dataMgr.SetQuestAILogicAndDeckData(battleData.EnemyClass, settingData.EnemyAiId); - dataMgr.LoadEnemyClassData(); - ChangeQuestBattleScene(); - }); - } - - private static void ChangeQuestBattleScene() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - QuestStartTask questStartTask = new QuestStartTask(); - questStartTask.SetParameter(dataMgr.QuestBattleData.QuestStageId, dataMgr.QuestBattleData.ExtraDeckScheduleId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(questStartTask, delegate - { - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - IsShow_CardIntroduction = true - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle, param); - })); } } diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/QuestFinishTask.cs deleted file mode 100644 index 3b7e0050..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/QuestFinishTask.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using Wizard.Battle.Recovery; - -namespace Wizard; - -public class QuestFinishTask : BaseTask -{ - public class QuestFinishTaskParam : BaseParam - { - public int quest_stage_id; - - public int deck_no; - - public bool is_win; - - public int deck_format; - - public bool is_prebuild_deck; - - public bool is_trial_deck; - - public int total_turn; - - public int turn_state; - - public Dictionary mission; - - public string recovery_data; - - public string[] prosessing_time_data; - } - - public class QuestFinishTaskParamForPuzzle : BaseParam - { - public int puzzle_id; - - public bool is_win; - - public int retry_count; - } - - public QuestFinishTask(bool isPuzzle = false) - { - base.type = (isPuzzle ? ApiType.Type.QuestPuzzleFinish : ApiType.Type.QuestFinish); - } - - public void SetParameter(int quest_stage_id, int deck_no, bool is_win, Format format, bool isPreBuildDeck, bool isTrialDeck, bool isFirst, int totalTurn) - { - QuestFinishTaskParam questFinishTaskParam = new QuestFinishTaskParam(); - questFinishTaskParam.quest_stage_id = quest_stage_id; - questFinishTaskParam.deck_no = deck_no; - questFinishTaskParam.is_win = is_win; - questFinishTaskParam.deck_format = Data.FormatConvertApi(format); - questFinishTaskParam.is_prebuild_deck = isPreBuildDeck; - questFinishTaskParam.is_trial_deck = isTrialDeck; - questFinishTaskParam.turn_state = ((!isFirst) ? 1 : 0); - questFinishTaskParam.total_turn = totalTurn; - BattleManagerBase ins = BattleManagerBase.GetIns(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true); - BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class; - if (dataMgr.RecoveryData == null) - { - dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); - } - questFinishTaskParam.recovery_data = dataMgr.RecoveryData.ToJson(); - questFinishTaskParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass); - base.Params = questFinishTaskParam; - } - - public void SetParameterForPuzzle(int puzzleId, bool isWin) - { - base.Params = new QuestFinishTaskParamForPuzzle - { - puzzle_id = puzzleId, - is_win = isWin, - retry_count = (BattleManagerBase.GetIns() as PuzzleBattleManager).RetryCount - }; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - DeleteRecoveryFileIfBattleAlreadyEnded(num); - return num; - } - Data.QuestFinish.data = new QuestFinishDetail(); - Data.QuestFinish.data._responseData = base.ResponseData; - JsonData jsonData = base.ResponseData["data"]; - if (base.type == ApiType.Type.QuestPuzzleFinish) - { - Data.QuestFinish.data.PuzzleQuestInfo = new PuzzleQuestInfo(jsonData); - } - Data.QuestFinish.data.get_class_chara_experience = jsonData["get_class_experience"].ToInt(); - Data.QuestFinish.data.class_chara_experience = jsonData["class_experience"].ToInt(); - Data.QuestFinish.data.class_chara_level = jsonData["class_level"].ToInt(); - Data.QuestFinish.data.CurrentPoint = jsonData["current_point"].ToInt(); - Data.QuestFinish.data.AddPoint = jsonData["add_point"].ToInt(); - Data.QuestFinish.data.ClassBonusPoint = jsonData["class_bonus_point"].ToInt(); - Data.QuestFinish.data.FormatBonusPoint = jsonData["format_bonus_point"].ToInt(); - JsonData jsonData2 = jsonData["clear_mission_list"]["common_mission"]; - Data.QuestFinish.data.CommonMissionClearInfoList = new List(); - for (int i = 0; i < jsonData2.Count; i++) - { - Data.QuestFinish.data.CommonMissionClearInfoList.Add(new QuestFinishDetail.MissionClearInfo(jsonData2[i]["name"].ToString(), jsonData2[i]["point"].ToInt())); - } - JsonData jsonData3 = jsonData["clear_mission_list"]["character_mission"]; - Data.QuestFinish.data.CharacterMissionClearInfoList = new List(); - for (int j = 0; j < jsonData3.Count; j++) - { - Data.QuestFinish.data.CharacterMissionClearInfoList.Add(new QuestFinishDetail.MissionClearInfo(jsonData3[j]["name"].ToString(), jsonData3[j]["point"].ToInt())); - } - Data.QuestFinish.data.WinBonusPoint = jsonData.GetValueOrDefault("win_bonus_point", 0); - Data.QuestFinish.data.WinCount = jsonData.GetValueOrDefault("win_count", 0); - Data.QuestFinish.data.WinCountForWinBonusPoint = jsonData.GetValueOrDefault("required_win_count_for_win_bonus_point", 0); - Data.QuestFinish.data.WinBonusPointStatus = (QuestFinishDetail.WinBonusStatus)jsonData.GetValueOrDefault("win_bonus_point_status", 0); - Data.QuestFinish.data.AddPoint = Data.QuestFinish.data.AddPoint - Data.QuestFinish.data.WinBonusPoint - Data.QuestFinish.data.GetTotalBonusPoint() - Data.QuestFinish.data.GetTotalCommonMissionClearPoint() - Data.QuestFinish.data.GetTotalCharacterMissionClearPoint(); - Data.QuestFinish.data.NecessaryPointList = new List(); - int num2 = 0; - for (int k = 0; k < jsonData["point_reward_list"].Count; k++) - { - int num3 = jsonData["point_reward_list"][k]["point"].ToInt(); - Data.QuestFinish.data.NecessaryPointList.Add(num3 - num2); - num2 = num3; - } - Data.QuestFinish.data.NecessaryPointList.Add(-1); - Data.QuestFinish.data.IsSpecialResult = jsonData.GetValueOrDefault("is_special_result", defaultValue: false); - Data.QuestFinish.data.IsSpecialEffect = jsonData.GetValueOrDefault("is_special_effect", defaultValue: false); - JsonData data = base.ResponseData["data"]["achieved_info"]; - Data.QuestFinish.data.AchievedInfo.Read(data); - Data.QuestFinish.data.HomeDialogData = new MyPageHomeDialogData(jsonData, "battle_dialog_list"); - Data.MyPageNotifications.ParseBadgeInfos(base.ResponseData); - PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestLastUsedDeckSaveDataManager.cs b/SVSim.BattleEngine/Engine/Wizard/QuestLastUsedDeckSaveDataManager.cs index 5d6cd665..b28ea850 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestLastUsedDeckSaveDataManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestLastUsedDeckSaveDataManager.cs @@ -15,42 +15,6 @@ public class QuestLastUsedDeckSaveDataManager public DateTime? CreatedTime { get; } - public bool IsValid - { - get - { - if (!CreatedTime.HasValue) - { - return true; - } - DeckGroup deckGroup = DeckListUtility.DeckGroupDataBaseClone().FirstOrDefault((DeckGroup x) => x.DeckFormat == Format); - if (deckGroup == null) - { - return false; - } - DeckData deckData = deckGroup.DeckDataList.FirstOrDefault((DeckData x) => x.GetDeckID() == ID); - if (deckData == null) - { - return false; - } - if (!deckData.IsNoCard()) - { - DateTime? createdTime = deckData.CreatedTime; - DateTime? createdTime2 = CreatedTime; - if (createdTime.HasValue != createdTime2.HasValue) - { - return false; - } - if (!createdTime.HasValue) - { - return true; - } - return createdTime.GetValueOrDefault() == createdTime2.GetValueOrDefault(); - } - return false; - } - } - public ExtractedDeckData(DeckData deckData) { Format = deckData.Format; @@ -171,16 +135,6 @@ public class QuestLastUsedDeckSaveDataManager } } - public ExtractedDeckData GetDeck(int stage) - { - _saveData.StageDeckTable.TryGetValue(stage, out var value); - if (value == null || !value.IsValid) - { - return null; - } - return value; - } - private static SaveData DeserializeSaveData(string serializedData) { if (serializedData == string.Empty) diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestOpenInfo.cs b/SVSim.BattleEngine/Engine/Wizard/QuestOpenInfo.cs index 289f8542..7175bd60 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestOpenInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestOpenInfo.cs @@ -5,26 +5,9 @@ namespace Wizard; public class QuestOpenInfo { - public bool IsOpen { get; private set; } public bool IsDisplayBadge { get; private set; } - public string QuestPanelBandText { get; private set; } - - public DateTime EndTime { get; private set; } - - public void SetOpenInfo(JsonData jsonData, JsonData responseData) - { - bool flag = responseData["is_hidden_boss_appeared"].ToBoolean(); - IsOpen = jsonData["is_open"].ToBoolean(); - QuestPanelBandText = jsonData["name"].ToString(); - IsDisplayBadge = jsonData["is_display_badge"].ToBoolean() || flag; - if (!string.IsNullOrEmpty(jsonData["end_time"].ToString())) - { - EndTime = DateTime.Parse(jsonData["end_time"].ToString()); - } - } - public void SetIsDisplayBadge(JsonData jsonData) { IsDisplayBadge = jsonData["is_display_badge"].ToBoolean(); diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestOpponentData.cs b/SVSim.BattleEngine/Engine/Wizard/QuestOpponentData.cs index a077331c..4b1eca2a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestOpponentData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestOpponentData.cs @@ -25,18 +25,6 @@ public class QuestOpponentData public QuestFinishDetail.WinBonusStatus WinBonusPointStatus { get; } - public bool IsEnableWinBonusPoint - { - get - { - if (WinBonusPointStatus != QuestFinishDetail.WinBonusStatus.NowAchieved) - { - return WinBonusPointStatus == QuestFinishDetail.WinBonusStatus.AlreadyAchieved; - } - return true; - } - } - public bool IsPlayable { get; private set; } public string PlayFactor { get; private set; } = string.Empty; diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestPointConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/QuestPointConfirmDialog.cs index f286126a..3b66f527 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestPointConfirmDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestPointConfirmDialog.cs @@ -101,7 +101,7 @@ public class QuestPointConfirmDialog : MonoBehaviour _receiveButton.onClick.Clear(); _receiveButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ReceiveAllPointRewards(); })); } diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestPuzzleSelectionButton.cs b/SVSim.BattleEngine/Engine/Wizard/QuestPuzzleSelectionButton.cs index 8c729d99..ba40e1f1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestPuzzleSelectionButton.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestPuzzleSelectionButton.cs @@ -54,7 +54,7 @@ public class QuestPuzzleSelectionButton : QuestSelectionButtonBase onClick(); }; } - ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(info.CharaId); + ClassCharacterMasterData charaPrmByCharaId = null; // Pre-Phase-5b: no chara master headless _charaNameLabel.text = charaPrmByCharaId.chara_name; _puzzleLabel.text = Data.SystemText.Get("Puzzle_QuestSelect_0002"); SetTexture(info.CharaId.ToString()); diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonBase.cs b/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonBase.cs index 4e91b83d..14d69162 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonBase.cs @@ -7,10 +7,6 @@ public abstract class QuestSelectionButtonBase : MonoBehaviour { public enum ButtonType { - QUEST = 0, - PUZZLE = 1, - EVENT_STORY = 2, - BOSS_RUSH = 3, None = 99 } diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonData.cs b/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonData.cs index 402bdb69..437cc9e6 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestSelectionButtonData.cs @@ -4,7 +4,6 @@ public class QuestSelectionButtonData { public enum SortPriority { - START_OFFSET, CLEAR_PUZZLE, CLEAR_SECRET_BOSS, CLEAR_BOSS_RUSH, @@ -25,8 +24,6 @@ public class QuestSelectionButtonData SECRET_BOSS } - private const int PRIORITY_RATE = 1000; - private int _sortIndex; public QuestOpponentData QuestData { get; } diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestSelectionPage.cs b/SVSim.BattleEngine/Engine/Wizard/QuestSelectionPage.cs index 769a00c0..58836823 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestSelectionPage.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestSelectionPage.cs @@ -14,11 +14,7 @@ public class QuestSelectionPage : UIBase { NONE, PUZZLE, - BOSS_RUSH, - SECRET_BOSS - } - - private const int BEGINNER_CHARACTER_ID = 4403; + BOSS_RUSH } [SerializeField] private UISpriteAtlasOverwriter _spriteAtlasOverwriter; @@ -80,27 +76,9 @@ public class QuestSelectionPage : UIBase [SerializeField] private GameObject _winBonusRoot; - [SerializeField] - private GameObject _winBonusBeforeRoot; - - [SerializeField] - private GameObject _winBonusAfterRoot; - - [SerializeField] - private UILabel _winBonusCountLabel; - - [SerializeField] - private UISprite _winBonusCountSprite; - [SerializeField] private GameObject _bossRushTurnDisplayRoot; - [SerializeField] - private UILabel _bossRushShortestClearLabel; - - [SerializeField] - private UISprite _bossRushShortestClearClassIcon; - [SerializeField] private UIButton _tweetBannerButton; @@ -137,16 +115,6 @@ public class QuestSelectionPage : UIBase private List _buttonData; - private const string BG_TEXTURE_NAME = "bg_quest"; - - private const int REWARD_DISPLAY_MAX_COUNT = 99; - - private const int QUEST_POINT_CONFIRM_DIALOG_DEPTH = 1; - - private const string POINT_UP_SPRITE_PREFIX = "point_up_"; - - private const int WIN_COUNT_MAX = 3; - public override bool IsUseCommonBackground() { return false; @@ -422,7 +390,7 @@ public class QuestSelectionPage : UIBase private QuestSelectionButtonData GetDefaultSelectData() { - QuestBattleData questBattleData = GameMgr.GetIns().GetDataMgr().QuestBattleData; + QuestBattleData questBattleData = null; // Pre-Phase-5b: headless has no QuestBattleData if (questBattleData != null) { QuestSelectionButtonData questSelectionButtonData = null; @@ -452,9 +420,9 @@ public class QuestSelectionPage : UIBase return questSelectionButtonData; } } - if (GameMgr.GetIns().GetDataMgr().QuestFirstSelectType == FirstSelectType.PUZZLE) + if (false /* Pre-Phase-5b: headless has no QuestFirstSelectType */) { - GameMgr.GetIns().GetDataMgr().QuestFirstSelectType = FirstSelectType.NONE; + // Pre-Phase-5b: headless has no QuestFirstSelectType write if (_puzzleQuestInfo.Status == PuzzleQuestStatus.InProgress) { foreach (QuestSelectionButtonData buttonDatum2 in _buttonData) @@ -467,7 +435,7 @@ public class QuestSelectionPage : UIBase } } bool flag = Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.BOSS_RUSH); - if (GameMgr.GetIns().GetDataMgr().QuestFirstSelectType == FirstSelectType.BOSS_RUSH && !flag) + if (false && !flag /* Pre-Phase-5b: headless has no QuestFirstSelectType */) { foreach (QuestSelectionButtonData buttonDatum3 in _buttonData) { @@ -524,7 +492,7 @@ public class QuestSelectionPage : UIBase private void OnClickClassButton(int index) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + if (_currentIndex != index) { _currentIndex = index; @@ -532,30 +500,6 @@ public class QuestSelectionPage : UIBase } } - public void SelectCharaQuestButton(QuestOpponentData buttonData) - { - UpdateTweetButtonVisible(buttonData.BattleData.CharaId == 4403); - ChangeChara(buttonData.BattleData.CharaId); - if (buttonData.WinCountForWinBonusPoint == 0) - { - _winBonusRoot.SetActive(value: false); - } - else - { - _winBonusRoot.SetActive(value: true); - _winBonusBeforeRoot.SetActive(value: true); - _winBonusAfterRoot.SetActive(buttonData.IsEnableWinBonusPoint); - _winBonusCountLabel.text = string.Format(Data.SystemText.Get("Quest_0036"), buttonData.WinCount, buttonData.WinCountForWinBonusPoint); - int num = Math.Min(buttonData.WinCount, 3); - _winBonusCountSprite.spriteName = "point_up_" + (num + 1).ToString("D2"); - } - bool flag = _isOpenExtra || !buttonData.BattleData.IsExtra; - UIManager.SetObjectToGrey(_decideButton.gameObject, !flag, ColorCode.Get(eColorCodeId.QuestSelectButtonTextColor)); - _decisionButtonEffect.SetActive(flag); - _decideButtonTextLabel.text = Data.SystemText.Get("Quest_0022"); - _bossRushTurnDisplayRoot.SetActive(value: false); - } - public void SelectCharaPuzzleButton(PuzzleQuestInfo buttonData) { UpdateTweetButtonVisible(isSelectBeginner: false); @@ -567,54 +511,6 @@ public class QuestSelectionPage : UIBase _bossRushTurnDisplayRoot.SetActive(value: false); } - public void SelectEventStoryButton(EventStoryQuestInfo buttonData) - { - UpdateTweetButtonVisible(isSelectBeginner: false); - ChangeEventStoryTexture(); - _winBonusRoot.SetActive(value: false); - _decisionButtonEffect.SetActive(value: true); - _decideButtonTextLabel.text = Data.SystemText.Get("Quest_0052"); - _bossRushTurnDisplayRoot.SetActive(value: false); - } - - public void SelectBossRushButton(BossRushInfo buttonData) - { - UpdateTweetButtonVisible(isSelectBeginner: false); - ChangeBossRushTexture(); - _winBonusRoot.SetActive(value: false); - _decisionButtonEffect.SetActive(value: true); - if (buttonData.IsDeckRegistered) - { - _decideButtonTextLabel.text = Data.SystemText.Get("BossRush_0008"); - } - else - { - _decideButtonTextLabel.text = Data.SystemText.Get("BossRush_0009"); - } - _bossRushTurnDisplayRoot.SetActive(value: true); - if (buttonData.ShortestClearTurn.HasValue && buttonData.ShortestClearTurn.Value > 0) - { - _bossRushShortestClearLabel.text = buttonData.ShortestClearTurn.Value.ToString(); - _bossRushShortestClearClassIcon.gameObject.SetActive(value: true); - _bossRushShortestClearClassIcon.spriteName = ClassCharaPrm.GetLargeIconSpriteName((CardBasePrm.ClanType)buttonData.ShortestClearClass.Value); - } - else - { - _bossRushShortestClearLabel.text = Data.SystemText.Get("BossRush_0040"); - _bossRushShortestClearClassIcon.gameObject.SetActive(value: false); - } - } - - public void SelectSecretBossButton(SecretBossInfo bossInfo) - { - UpdateTweetButtonVisible(isSelectBeginner: false); - ChangeChara(bossInfo.CharaId); - _winBonusRoot.SetActive(value: false); - _decisionButtonEffect.SetActive(value: true); - _decideButtonTextLabel.text = Data.SystemText.Get("Quest_0022"); - _bossRushTurnDisplayRoot.SetActive(value: false); - } - private void ChangeChara(int charaId, bool isPlayChangeAnimation = true) { if (!(_currentTextureId == charaId.ToString())) @@ -629,28 +525,6 @@ public class QuestSelectionPage : UIBase } } - private void ChangeEventStoryTexture() - { - if (!(_currentTextureId == "event_story")) - { - _currentTextureId = "event_story"; - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - _selectCharaTexture.mainTexture = resourcesManager.LoadObject(resourcesManager.GetAssetTypePath("event_story", ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)); - PlayCharaChangeAnimation(); - } - } - - private void ChangeBossRushTexture() - { - if (!(_currentTextureId == "boss_rush")) - { - _currentTextureId = "boss_rush"; - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - _selectCharaTexture.mainTexture = resourcesManager.LoadObject(resourcesManager.GetAssetTypePath("boss_rush", ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)); - PlayCharaChangeAnimation(); - } - } - private void PlayCharaChangeAnimation() { GameObject obj = _selectCharaTexture.gameObject; @@ -664,74 +538,16 @@ public class QuestSelectionPage : UIBase _selectionButtonList[_currentIndex].OnDecideButtonClick(); } - public void OnClassDecideButtonClick(QuestOpponentData buttonData) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.m_BattleType = DataMgr.BattleType.Quest; - dataMgr.SetQuestBattleData(buttonData.BattleData); - CreateDeckSelectForQuest(); - } - public void OnPuzzleDecideButtonClick() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + CreatePuzzleQuestSelectDialog(); - GameMgr.GetIns().GetDataMgr().SetQuestBattleData(null); - } - - public static void CreateDeckSelectForQuest() - { - QuestDeckListTask task = new QuestDeckListTask(); - task.SetParameter(GameMgr.GetIns().GetDataMgr().QuestBattleData.QuestStageId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - CreateQuestDeckDialog(task.DeckGroupListData, task.BonusFormatList, task.BonusClassList, isBattleAgain: false); - })); - } - - public static void CreateQuestDeckDialog(DeckGroupListData deckGroupListData, List bonusFormatList, List bonusClassList, bool isBattleAgain) - { - int questStageId = GameMgr.GetIns().GetDataMgr().QuestBattleData.QuestStageId; - QuestLastUsedDeckSaveDataManager.ExtractedDeckData deck = new QuestLastUsedDeckSaveDataManager().GetDeck(questStageId); - Format defaultFormat = ((deck != null) ? deck.Format : ((Format)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_SELECT_DECK_FORMAT))); - Action onUpdateDeckUICustomize = delegate(DeckUI deckUI) - { - SetDeckPointUpText(deckUI, bonusFormatList, bonusClassList); - if (isBattleAgain) - { - if (deckUI.Deck.Format == GameMgr.GetIns().GetDataMgr().GetSelectDeckFormat() && deckUI.Deck.GetDeckID() == GameMgr.GetIns().GetDataMgr().GetSelectDeckId()) - { - deckUI.SetTextAppealLabelLeft(Data.SystemText.Get("Card_0235")); - } - deckUI.SetSelectable(deckUI.Deck.IsUsable()); - } - }; - DeckSelectUIDialog.Create(Data.SystemText.Get("Quest_0017"), deckGroupListData, defaultFormat, DeckSelectUIDialog.eFormatChangeUIType.UseOtherCategory, !isBattleAgain, delegate(DialogBase dialog, DeckData deck2) - { - QuestDeckSelectConfirmDialog.Create(dialog, deck2, isBattleAgain); - }, new DeckSelectUI.InitOptions - { - OnUpdateDeckUICustomize = onUpdateDeckUICustomize, - FirstDisplayPageIndexGetter = new QuestFirstDisplayPageIndexGetter() - }); - } - - private static void SetDeckPointUpText(DeckUI deckUI, List bonusFormatList, List bonusClassList) - { - if (!GameMgr.GetIns().GetDataMgr().QuestBattleData.IsMockBattle) - { - DeckData deck = deckUI.Deck; - if (bonusFormatList.Contains(deck.Format) && bonusClassList.Contains((CardBasePrm.ClanType)deck.GetDeckClassID())) - { - deckUI.SetTextAppealLabelRight(Data.SystemText.Get("Quest_0029")); - } - } + // Pre-Phase-5b: headless has no QuestBattleData } private void OnQuestConfirmButtonClick(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetSize(DialogBase.Size.M); dialogBase.SetTitleLabel(Data.SystemText.Get("Quest_0005")); @@ -743,7 +559,7 @@ public class QuestSelectionPage : UIBase private void OnPointConfirmButtonClick(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); dialogBase.SetSize(DialogBase.Size.M); dialogBase.SetTitleLabel(Data.SystemText.Get("Quest_0006")); @@ -761,7 +577,7 @@ public class QuestSelectionPage : UIBase private void OnClickBonusDetailButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + if (string.IsNullOrEmpty(_announceId)) { SystemText systemText = Data.SystemText; @@ -817,7 +633,7 @@ public class QuestSelectionPage : UIBase private void OnDecidePuzzleQuest(PuzzleQuestData data, int difficulty) { - GameMgr.GetIns().GetDataMgr().QuestFirstSelectType = FirstSelectType.PUZZLE; + // Pre-Phase-5b: headless has no QuestFirstSelectType write PuzzleUtil.SetPuzzleQuestData(data, difficulty, DataMgr.BattleType.Quest); PuzzleUtil.ChangeSceneToPuzzleQuest(data); } @@ -858,7 +674,7 @@ public class QuestSelectionPage : UIBase private void OnClickTweetBanner() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + QuestCampaignDialog.Create(null, OnTweet); } @@ -867,9 +683,4 @@ public class QuestSelectionPage : UIBase _isTweetFinish = true; UpdateTweetButtonVisible(isSelectBeginner: false); } - - private void LateUpdate() - { - AllLabelColorChanger.ChangeAllLabel(base.gameObject); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/QuestStartTask.cs b/SVSim.BattleEngine/Engine/Wizard/QuestStartTask.cs index 5f3c9aff..62dfc93c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/QuestStartTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/QuestStartTask.cs @@ -40,7 +40,7 @@ public class QuestStartTask : BaseTask protected override int Parse() { int num = base.Parse(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr dataMgr.ClearSpecialBattleSettingInfo(); if (num != 1) { diff --git a/SVSim.BattleEngine/Engine/Wizard/Rank.cs b/SVSim.BattleEngine/Engine/Wizard/Rank.cs deleted file mode 100644 index c6316279..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/Rank.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Wizard; - -public class Rank -{ - public int rank_id; - - public string rank_name; - - public string rank_path; - - private int index; - - public Rank(string[] columns) - { - rank_id = int.Parse(columns[index++]); - rank_name = columns[index++]; - rank_path = columns[index++]; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RankBattleDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/RankBattleDoMatchingTask.cs deleted file mode 100644 index c785dcc8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RankBattleDoMatchingTask.cs +++ /dev/null @@ -1,59 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class RankBattleDoMatchingTask : DoMatchingBase -{ - private const string DATA = "data"; - - private const string DISCOVERED_REWAED = "discovered_reward"; - - private const string GRADE_ID = "grade_id"; - - private const string REWARD_MESSAGE = "reward_message"; - - public RankBattleDoMatchingTask() - { - switch (Data.CurrentFormat) - { - case Format.Rotation: - base.type = ApiType.Type.RankBattleDoMatchingRotation; - break; - case Format.Unlimited: - base.type = ApiType.Type.RankBattleDoMatchingUnlimited; - break; - case Format.Crossover: - base.type = ApiType.Type.RankBattleDoMatchingCrossover; - break; - default: - Debug.LogError("UnknownFormat:" + Data.CurrentFormat); - break; - } - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - SettingDoMatchingData(); - if (base.ResponseData["data"].Keys.Contains("discovered_reward")) - { - if (base.ResponseData["data"]["discovered_reward"].Keys.Contains("grade_id")) - { - JsonData jsonData = base.ResponseData["data"]["discovered_reward"]["grade_id"]; - JsonData jsonData2 = base.ResponseData["data"]["discovered_reward"]["reward_message"]; - Data.DoMatchingDetail.data.SetWinnerRewardInfo(jsonData.ToInt(), jsonData2.ToString()); - } - } - else - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE, 0); - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING, ""); - Data.DoMatchingDetail.data.ClearWinnerRewardInfo(); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RankBattleFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/RankBattleFinishTask.cs deleted file mode 100644 index ad7b0d02..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RankBattleFinishTask.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using LitJson; - -namespace Wizard; - -public class RankBattleFinishTask : FinishTaskBase -{ - public class RankBattleFinishParam : BattleFinishParam - { - } - - public RankBattleFinishTask() - { - if (GameMgr.GetIns().IsAINetwork) - { - base.type = ((Data.CurrentFormat == Format.Rotation) ? ApiType.Type.AIRotationRankBattleFinish : ApiType.Type.AIUnlimitedRankBattleFinish); - } - else - { - switch (Data.CurrentFormat) - { - case Format.Rotation: - base.type = ApiType.Type.RankMatchFinishRotation; - break; - case Format.Unlimited: - base.type = ApiType.Type.RankMatchFinishUnlimited; - break; - case Format.Crossover: - base.type = ApiType.Type.RankMatchFinishCrossover; - break; - default: - Debug.LogError("UnknownFormat:" + Data.CurrentFormat); - break; - } - } - Data.RankMatchFinish.data = new RankMatchFinishDetail(); - } - - protected override int Parse() - { - int num = base.Parse(); - if (IsEffectiveErrorCode(num)) - { - return num; - } - Data.RankMatchFinish.data = new RankMatchFinishDetail(); - if (!IsResponseDataExist(base.ResponseData)) - { - return num; - } - RankMatchFinishDetail data = Data.RankMatchFinish.data; - data.class_chara_experience = 0; - data.class_chara_level = 0; - Data.Load.data._userRank[(int)Data.CurrentFormat].user_promotion_match = new UserPromotionMatch(); - new BattleFinishResponsProcessing().Processing(base.ResponseData, Data.RankMatchFinish.data); - JsonData jsonData = base.ResponseData["data"]; - data.UserRank = jsonData.GetValueOrDefault("rank", 0); - data.AfterBattlePoint = jsonData.GetValueOrDefault("after_battle_point", 0); - data.AfterMasterPoint = jsonData.GetValueOrDefault("after_master_point", 0); - data.BasicBattlePoint_and_SuperiorBonus = jsonData.GetValueOrDefault("battle_point", 0); - data.BasicMasterPoint_and_SuperiorBonus = jsonData.GetValueOrDefault("master_point", 0); - data.SuccessiveWinNumber = jsonData.GetValueOrDefault("successive_win_number", 0); - data.SuccessiveWinBonus = jsonData.GetValueOrDefault("successive_win_bonus", 0); - if (jsonData.Keys.Contains("upgrade_treasure_box_info")) - { - data.TreasureBoxCpResultInfo.Parse(jsonData["upgrade_treasure_box_info"]); - } - if (jsonData.TryGetValue("speed_challenge_schedule", out var value) && value.TryGetValue("announce_time", out var value2)) - { - data.SpeedChallengeAnnounceTime = DateTime.Parse(value2.ToString()); - } - int num2 = PlayerStaticData.UserRankCurrentFormat(); - if (num2 != data.UserRank) - { - PlayerStaticData.ReLoadUserRankTexture(num2.ToString("00"), data.UserRank.ToString("00"), Data.CurrentFormat); - } - ClassCharaPrm classPrm = GameMgr.GetIns().GetDataMgr().GetClassPrm(classId); - classPrm.AddClassCharaBattleCount(); - if (data.battleResult == BattleManagerBase.BATTLE_RESULT_TYPE.WIN) - { - classPrm.AddClassCharaWin(); - } - return num; - } - - protected override BattleFinishParam CreateBattleFinishParam(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire) - { - BattleFinishParam battleFinishParam = base.CreateBattleFinishParam(class_id, total_turn, evolve_count, enemy_evolve_count, battle_result, is_retire); - battleFinishParam.SDTRB = (int)PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG); - return battleFinishParam; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RankMatchAISettingData.cs b/SVSim.BattleEngine/Engine/Wizard/RankMatchAISettingData.cs deleted file mode 100644 index 4f0a67bf..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RankMatchAISettingData.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class RankMatchAISettingData -{ - public int EnemyAiId { get; private set; } - - public int ClassId { get; private set; } - - public int DeckId { get; private set; } - - public int StyleId { get; private set; } - - public RankMatchAISettingData(string[] columns) - { - int num = 0; - EnemyAiId = AIScriptParser.ParseInt(columns[num++]); - ClassId = AIScriptParser.ParseInt(columns[num++]); - DeckId = AIScriptParser.ParseInt(columns[num++]); - StyleId = AIScriptParser.ParseInt(columns[num++]); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RankMatchAISettingDataSet.cs b/SVSim.BattleEngine/Engine/Wizard/RankMatchAISettingDataSet.cs deleted file mode 100644 index 16538799..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RankMatchAISettingDataSet.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard; - -public class RankMatchAISettingDataSet -{ - private List _dataTable; - - public RankMatchAISettingDataSet() - { - _dataTable = new List(); - } - - public void AddData(RankMatchAISettingData data) - { - if (!_dataTable.Any((RankMatchAISettingData d) => d.EnemyAiId == data.EnemyAiId)) - { - _dataTable.Add(data); - } - } - - public RankMatchAISettingData GetSettingData(int enemyAiId) - { - return _dataTable.First((RankMatchAISettingData d) => d.EnemyAiId == enemyAiId); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RankMatchEnemyAI.cs b/SVSim.BattleEngine/Engine/Wizard/RankMatchEnemyAI.cs deleted file mode 100644 index fbdf420c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RankMatchEnemyAI.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Collections; -using System.Diagnostics; -using UnityEngine; -using Wizard.Battle.View.Vfx; - -namespace Wizard; - -public class RankMatchEnemyAI : EnemyAI -{ - private Stopwatch _turnTimeStopWatch = new Stopwatch(); - - public override bool IsStackAction => _isStackAction; - - public override bool IsConnectNetwork => _isConnectNetwork; - - public RankMatchEnemyAI() - { - base.IsRankMatchAI = true; - } - - public override VfxBase GetEmote(AIEmoteCmdType cmdType, AISituationInfo situation = null, ClassCharaPrm.EmotionType receivedEmoteType = ClassCharaPrm.EmotionType.NULL, int emoteInput = -1) - { - return NullVfx.GetInstance(); - } - - protected override IEnumerator WeakLogicTimerCoroutine() - { - float currentMilliSec = 0f; - float currentTimeOverLogicSec = 0f; - _elapsedThinkingTime = 0f; - _currentThinkingIntervalTime = 0f; - _isRunTurnEndLimitTimer = false; - _turnStartVfxFinishTime = 0f; - _elapsedTurnTimeAfterTurnStartVfx = 0f; - _turnTimeStopWatch.Reset(); - _turnTimeStopWatch.Start(); - while (true) - { - yield return null; - if (base.IsBattleEnd) - { - break; - } - float num = (float)(_turnTimeStopWatch.Elapsed.TotalMilliseconds - (double)currentMilliSec) / 1000f; - currentMilliSec = (float)_turnTimeStopWatch.Elapsed.TotalMilliseconds; - float num2 = currentMilliSec / 1000f; - if (_isRunTurnEndLimitTimer) - { - _elapsedTurnTimeAfterTurnStartVfx = num2 - _turnStartVfxFinishTime; - } - if (battleMgr.VfxMgr.IsEnd) - { - if (_enabledThinkingCounter) - { - _elapsedThinkingTime += num; - } - if (base.IsThinkingInterval) - { - _currentThinkingIntervalTime -= num; - } - if (!_isRunTurnEndLimitTimer) - { - _turnStartVfxFinishTime = num2; - _isRunTurnEndLimitTimer = true; - } - } - if (!base.IsRunWeakLogic) - { - currentTimeOverLogicSec += num; - _timeOverLogicSec = (int)currentTimeOverLogicSec; - if (_timeOverLogicSec > 7 && battleMgr.VfxMgr.IsEnd && AIOperationQueue.Count <= 0) - { - ChangeWeakLogic(); - currentTimeOverLogicSec = 0f; - } - } - } - } - - public override void Retire() - { - EnemyAICoroutine.GetInstance().StopAllCoroutines(); - BattleCoroutine instance = BattleCoroutine.GetInstance(); - if (weakLogicCoroutine != null) - { - instance.StopCoroutine(weakLogicCoroutine); - weakLogicCoroutine = null; - } - battleMgr.VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx()); - if (!battleMgr.GetBattlePlayer(isPlayer: true).Class.IsDead) - { - battleMgr.VfxMgr.RegisterSequentialVfx(battleMgr.DeadClass(PlayerDead: false, BattleManagerBase.FINISH_TYPE.RETIRE)); - battleMgr.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate - { - battleMgr.InitiateGameEndSequence(hasWon: true); - })); - } - } - - public override void Disconnect() - { - _isConnectNetwork = false; - } - - public override void Reconnect() - { - _isConnectNetwork = true; - } - - public override void CleanupStackedAction() - { - base.IsStopThinkingLogic = true; - ExecuteActionOperationQueue(); - } - - public override void RegistActionOperationQueue(Action action) - { - base.RegistActionOperationQueue(action); - CheckIsStackAction(); - } - - public override void ExecuteActionOperationQueue() - { - base.ExecuteActionOperationQueue(); - CheckIsStackAction(); - } - - protected override void OnBeforeTurnEnd() - { - if (weakLogicCoroutine != null) - { - BattleCoroutine.GetInstance().StopCoroutine(weakLogicCoroutine); - weakLogicCoroutine = null; - } - } - - protected override void OnFinishOprAttack() - { - CheckIsStackAction(); - } - - protected override void OnFinishOprTargetSelect() - { - SetupThinkingInterval(); - CheckIsStackAction(); - } - - protected override void CheckIsStackAction() - { - _isStackAction = AIOperationQueue.Count > 0; - } - - protected override void SetupThinkingInterval() - { - _enabledThinkingCounter = false; - float num = UnityEngine.Random.Range(0f, 3f); - num = ((num <= _elapsedThinkingTime) ? 0f : num); - _currentThinkingIntervalTime = num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RankWinnerReward.cs b/SVSim.BattleEngine/Engine/Wizard/RankWinnerReward.cs deleted file mode 100644 index ca04d5f3..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RankWinnerReward.cs +++ /dev/null @@ -1,177 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class RankWinnerReward : MonoBehaviour -{ - [SerializeField] - private NguiObjs _rewardObjs; - - private GameObject _rewardObject; - - private int _rewardGrade; - - private string _rewardMessage = ""; - - private const string ITEM_BOX_FILE_NAME = "box_2pick_{0}_close"; - - private List _assetPathList = new List(); - - public int RewardGrade => _rewardGrade; - - public string RewardString - { - get - { - if (_rewardMessage == "") - { - _rewardMessage = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING); - } - return _rewardMessage; - } - } - - public NguiObjs RewardObjs => _rewardObjs; - - public void SetInfomation(int grade, string message) - { - UILabel obj = _rewardObjs.labels[0]; - UISprite uISprite = _rewardObjs.sprites[2]; - SetRewardString(message); - obj.text = _rewardMessage; - SetRewardGrade(grade); - uISprite.spriteName = GetBoxSpriteName(); - } - - public void SetRewardGrade(int grade) - { - _rewardGrade = grade; - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE, grade); - } - - public void SetRewardString(string text) - { - _rewardMessage = text; - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING, text); - } - - public IEnumerator ResultWinnerReward() - { - GameObject obj = Object.Instantiate(Resources.Load("UI/layoutParts/RankWinnerRewardResultPanel")) as GameObject; - obj.transform.parent = UIManager.GetInstance().UIManagerRoot.transform; - obj.transform.localScale = Vector3.one; - _rewardObject = obj; - NguiObjs component = _rewardObject.GetComponent(); - UISprite bg = component.sprites[0]; - UISprite window = component.sprites[1]; - UISprite box = component.sprites[2]; - UIManager.GetInstance().AttachAtlas(box.gameObject); - UILabel label = component.labels[0]; - label.text = GameMgr.GetIns()._rankWinnerReward.RewardString; - UIPanel panel = _rewardObject.GetComponent(); - panel.alpha = 0f; - box.spriteName = GetBoxSpriteName(); - string loadEffectName = "cmn_arena_treasure_" + _rewardGrade; - List loadList = new List { Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D) }; - MonoBehaviour component2 = base.transform.parent.gameObject.GetComponent(); - yield return component2.StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _assetPathList.AddRange(loadList); - GameObject treasureEffectObject = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - treasureEffectObject.transform.parent = obj.transform; - _assetPathList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(treasureEffectObject, null)); - bg.alpha = 0f; - box.alpha = 0f; - label.alpha = 0f; - panel.alpha = 1f; - TweenAlpha.Begin(bg.gameObject, 0.5f, 0.65f); - TweenAlpha.Begin(label.gameObject, 0.5f, 1f); - TweenAlpha.Begin(box.gameObject, 0.5f, 1f); - label.transform.localPosition = new Vector3(100f, 0f, 0f); - window.transform.localScale = new Vector3(1f, 0.01f, 1f); - box.transform.localPosition = new Vector3(180f, 0f, 0f); - iTween.MoveTo(label.gameObject, iTween.Hash("x", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - iTween.ScaleTo(window.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.MoveTo(box.gameObject, iTween.Hash("y", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - yield return new WaitForSeconds(0.8f); - TweenAlpha.Begin(label.gameObject, 0.5f, 0f); - iTween.MoveTo(box.gameObject, iTween.Hash("x", 0f, "time", 0.7f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_BOX_OPEN); - yield return new WaitForSeconds(1f); - treasureEffectObject.transform.localPosition = box.transform.localPosition; - treasureEffectObject.transform.localScale = Vector3.one * 320f * 1.75f; - treasureEffectObject.SetActive(value: true); - box.gameObject.SetActive(value: false); - } - - public string GetBoxSpriteName() - { - return string.Format("box_2pick_{0}_close", (PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE) - 1).ToString("00")); - } - - public IEnumerator HideRewardObject() - { - NguiObjs component = _rewardObject.GetComponent(); - UISprite uISprite = component.sprites[0]; - UISprite obj = component.sprites[1]; - TweenAlpha.Begin(uISprite.gameObject, 0.3f, 0f); - TweenAlpha.Begin(obj.gameObject, 0.3f, 0f); - yield return new WaitForSeconds(0.3f); - _rewardObject.SetActive(value: false); - } - - public void RemoveObject() - { - if (_rewardObject != null) - { - _rewardObject.SetActive(value: false); - } - if (_assetPathList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList); - _assetPathList.Clear(); - } - } - - public Color GetGradeColor() - { - return _rewardGrade switch - { - 1 => new Color(0.5f, 1f, 0.75f), - 2 => new Color(1f, 0.85f, 0.25f), - 3 => new Color(1f, 0.5f, 0.2f), - 4 => new Color(1f, 0.25f, 0.25f), - 5 => new Color(0.75f, 0.35f, 1f), - 6 => Color.white, - _ => Color.white, - }; - } - - public Vector3 GetBattleMenuBoxPosition() - { - return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE) switch - { - 1 => Vector3.up * 4.3f, - 2 => Vector3.up * 6.8f, - 3 => Vector3.up * 10.9f, - 4 => Vector3.up * 10.9f, - 5 => Vector3.up * 11.9f, - 6 => Vector3.up * 27.14f, - _ => Vector3.up * 27.14f, - }; - } - - public void PlayOpeningSE() - { - if (PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE) == 6) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SE_SYS_WIN_REWARD_BOX_BIG); - } - else - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SE_SYS_WIN_REWARD_BOX_SMALL); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReceiveTurnEndToJudgeResult.cs b/SVSim.BattleEngine/Engine/Wizard/ReceiveTurnEndToJudgeResult.cs index fa3bae87..557e94bb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ReceiveTurnEndToJudgeResult.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ReceiveTurnEndToJudgeResult.cs @@ -5,7 +5,6 @@ namespace Wizard; public class ReceiveTurnEndToJudgeResult : NetworkBattleIntervalCheckerBase { - private const float INTERVAL = 30f; public event Action OnIntervalTime; diff --git a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignMissionLabel.cs b/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignMissionLabel.cs deleted file mode 100644 index 25be1940..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignMissionLabel.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class RedEtherCampaignMissionLabel : MonoBehaviour -{ - [SerializeField] - public UILabel _missionName; - - [SerializeField] - public UILabel _redEtherCount; - - public void Initialize(RedEtherCampaignResultData.ClearMissionInfo info) - { - _missionName.text = info.MissionText; - _redEtherCount.text = "+" + info.RedEther; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignPanel.cs b/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignPanel.cs deleted file mode 100644 index 1811736c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignPanel.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class RedEtherCampaignPanel : MonoBehaviour -{ - private const float GAUGEUP_DELAY = 0.1f; - - private const float GAUGEUP_DURATION = 0.3f; - - private const int GAUGEUP_SE_CNT = 6; - - private const float FADE_TIME = 0.2f; - - [SerializeField] - public ParticleSystem _gaugeEffect; - - [SerializeField] - private ParticleSystem _lineEffect; - - [SerializeField] - private UIGauge _uIGauge; - - [SerializeField] - private UITexture _redEtherIcon; - - [SerializeField] - private UIButton _tocuhCollider; - - [SerializeField] - private UILabel _battleRewardLabel; - - [SerializeField] - private GameObject _missionEtherRoot; - - [SerializeField] - private GameObject _battleEtherRoot; - - [SerializeField] - private UILabel _battleWinPoint; - - [SerializeField] - private UILabel _battleWinTitle; - - [SerializeField] - private RedEtherCampaignMissionLabel _missionLabelOriginal; - - [SerializeField] - private GameObject[] _redEtherAtlasList; - - [SerializeField] - private UIPanel _panel; - - [SerializeField] - private UIGrid _missionTextGrid; - - private List _loadFileList = new List(); - - private RedEtherCampaignResultData _data; - - private List _clearMissionList = new List(); - - private bool _isTouchColliderClicked; - - private const float GAUGEUP_LABEL_DURATION = 0.5f; - - private const float GAUGEUP_LABEL_MOVE_DISTANCE = 50f; - - private const float WAIT_GAUGE_ANIMATION_AFTER = 1f; - - private Action OnFinish { get; set; } - - public bool IsAnimationComplete { get; private set; } - - public static void Create(GameObject parent, RedEtherCampaignResultData data, BattleResultUIController controller, Action onFinish) - { - controller.GreySpriteBGVisible = true; - NGUITools.AddChild(parent, Resources.Load("UI/layoutParts/Other/RedEtherCampaignPanel") as GameObject).GetComponent().Initialize(data, onFinish); - } - - public void Initialize(RedEtherCampaignResultData data, Action onFinish) - { - _panel.alpha = 0f; - _data = data; - _uIGauge.Value = data.BeforeGaugeValue; - OnFinish = onFinish; - UpdateGaugeAnimation(0f); - _missionEtherRoot.SetActive(value: false); - _battleEtherRoot.SetActive(value: false); - _battleWinPoint.text = "+" + data.BattleRewardEther; - _battleRewardLabel.text = data.BeforeDailyEther + "/" + data.MaxDailyEther; - foreach (RedEtherCampaignResultData.ClearMissionInfo clearMission in data.ClearMissionList) - { - RedEtherCampaignMissionLabel component = NGUITools.AddChild(_missionLabelOriginal.transform.parent.gameObject, _missionLabelOriginal.gameObject).GetComponent(); - component.Initialize(clearMission); - _clearMissionList.Add(component); - } - _battleWinTitle.text = Data.SystemText.Get("RedEther_0010", _data.CanGainBattleWin.ToString()); - _missionTextGrid.Reposition(); - StartCoroutine(LoadResources(delegate - { - TweenAlpha.Begin(_panel.gameObject, 0.2f, 1f); - UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.RedEtherCampaign); - List obj_list = new List(_redEtherAtlasList); - UIManager.GetInstance().AttachAtlas(obj_list); - _redEtherIcon.mainTexture = Toolbox.ResourcesManager.LoadObject(GetIconTextureName(isFetch: true)) as Texture; - _tocuhCollider.onClick.Add(new EventDelegate(delegate - { - OnClickTouchCollider(); - })); - StartCoroutine(AnimationCoroutine()); - StartCoroutine(MissionLabelAnimation()); - _lineEffect.gameObject.SetActive(value: true); - _lineEffect.Play(); - })); - } - - private void StartAnimation() - { - SetGaugeAniamtion(); - } - - private IEnumerator LoadResources(Action callBack) - { - List loadList = new List - { - GetIconTextureName(isFetch: false), - GetAtlasName(isFetch: false) - }; - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null)); - _loadFileList.AddRange(loadList); - List list = new List(); - list.Add(_gaugeEffect.gameObject); - list.Add(_lineEffect.gameObject); - _loadFileList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list, delegate - { - callBack.Call(); - })); - } - - private void OnDestroy() - { - UIManager.GetInstance().RemoveResidentAtlas(UIAtlasManager.AssetBundleNames.RedEtherCampaign); - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - } - - private string GetIconTextureName(bool isFetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath("icon_liquid_m", ResourcesManager.AssetLoadPathType.Item, isFetch); - } - - private string GetAtlasName(bool isFetch) - { - return UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.RedEtherCampaign, "", isFetch); - } - - private IEnumerator MissionLabelAnimation() - { - _battleEtherRoot.SetActive(_data.BattleRewardEther > 0); - foreach (RedEtherCampaignMissionLabel clearMission in _clearMissionList) - { - clearMission.gameObject.SetActive(value: true); - } - _missionTextGrid.Reposition(); - _battleEtherRoot.SetActive(value: false); - foreach (RedEtherCampaignMissionLabel clearMission2 in _clearMissionList) - { - clearMission2.gameObject.SetActive(value: false); - } - yield return new WaitForSeconds(0.5f); - if (_data.BattleRewardEther > 0) - { - _battleEtherRoot.SetActive(value: true); - TextAnimation(_battleWinTitle.gameObject); - TextAnimation(_battleWinPoint.gameObject); - } - foreach (RedEtherCampaignMissionLabel clearMission3 in _clearMissionList) - { - clearMission3.gameObject.SetActive(value: true); - TextAnimation(clearMission3._missionName.gameObject); - TextAnimation(clearMission3._redEtherCount.gameObject); - } - } - - private void TextAnimation(GameObject label) - { - label.SetActive(value: true); - TweenAlpha.Begin(label.gameObject, 0.5f, 1f); - iTween.MoveFrom(label, iTween.Hash("x", label.transform.localPosition.x - 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); - } - - private IEnumerator AnimationCoroutine() - { - yield return new WaitForSeconds(0.5f); - StartAnimation(); - yield return new WaitForSeconds(1.4f); - _isTouchColliderClicked = false; - while (!_isTouchColliderClicked) - { - yield return null; - } - FadeOutAnimation(0.2f); - yield return new WaitForSeconds(0.2f); - _lineEffect.gameObject.SetActive(value: false); - OnFinish.Call(); - } - - private void OnClickTouchCollider() - { - _isTouchColliderClicked = true; - } - - private void SetGaugeAniamtion() - { - _uIGauge.Value = _data.BeforeGaugeValue; - iTween.ValueTo(base.gameObject, iTween.Hash("from", 0f, "to", 1f, "time", 0.3f, "delay", 0.1f, "onstart", "StartGaugeAnimation", "onupdate", "UpdateGaugeAnimation", "oncomplete", "OnFinishGaugeAnimation", "easetype", iTween.EaseType.easeOutQuad)); - } - - private void StartGaugeAnimation() - { - PlayGaugeUpSE(); - _gaugeEffect.gameObject.SetActive(value: true); - _gaugeEffect.Play(); - } - - private void UpdateGaugeAnimation(float t) - { - _uIGauge.Value = Mathf.Lerp(_data.BeforeGaugeValue, _data.AfterGaugeValue, t); - int num = (int)Mathf.Lerp(_data.BeforeDailyEther, _data.AfterDailyEther, t); - _battleRewardLabel.text = num + "/" + _data.MaxDailyEther; - } - - private void OnFinishGaugeAnimation() - { - _gaugeEffect.Stop(); - } - - private void PlayGaugeUpSE() - { - StartCoroutine(GaugeUpSECoroutine()); - } - - private IEnumerator GaugeUpSECoroutine() - { - for (int i = 0; i < 6; i++) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); - yield return new WaitForSeconds(0.05f); - } - } - - private void FadeOutAnimation(float fadeTime) - { - TweenAlpha.Begin(base.gameObject, 0f, 1f); - TweenAlpha.Begin(base.gameObject, fadeTime, 0f); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignResultData.cs b/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignResultData.cs index 80a4e448..3a61c9ef 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignResultData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignResultData.cs @@ -24,8 +24,6 @@ public class RedEtherCampaignResultData } } - public bool IsEnable { get; private set; } - public int BeforeDailyEther { get; private set; } public int AfterDailyEther { get; private set; } @@ -40,26 +38,6 @@ public class RedEtherCampaignResultData public List RewardList { get; private set; } = new List(); - public float BeforeGaugeValue - { - get - { - float num = BeforeDailyEther; - float num2 = MaxDailyEther; - return num / num2; - } - } - - public float AfterGaugeValue - { - get - { - float num = AfterDailyEther; - float num2 = MaxDailyEther; - return num / num2; - } - } - public RedEtherCampaignResultData(JsonData json) { BeforeDailyEther = json["before_red_ether"].ToInt(); diff --git a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignRewardData.cs b/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignRewardData.cs deleted file mode 100644 index 3091d5f2..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RedEtherCampaignRewardData.cs +++ /dev/null @@ -1,31 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class RedEtherCampaignRewardData -{ - public UserGoods.Type UserGoodsType { get; private set; } - - public int ItemCount { get; private set; } - - public bool IsCleared { get; private set; } - - public string MissionText { get; private set; } - - public RedEtherCampaignRewardData(JsonData json, bool isCleared) - { - MissionText = json["mission_name"].ToString(); - IsCleared = isCleared; - JsonData jsonData = json["reward_list"][0]; - ItemCount = jsonData["reward_number"].ToInt(); - UserGoodsType = (UserGoods.Type)jsonData["reward_type"].ToInt(); - } - - public RedEtherCampaignRewardData(UserGoods.Type type, int count, bool cleared, string missionText) - { - UserGoodsType = type; - ItemCount = count; - IsCleared = cleared; - MissionText = missionText; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RefundWarningDialog.cs b/SVSim.BattleEngine/Engine/Wizard/RefundWarningDialog.cs deleted file mode 100644 index 0b908b1e..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RefundWarningDialog.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using Cute; - -namespace Wizard; - -public class RefundWarningDialog -{ - private const int PANEL_DEPTH = 25; - - public static void Start(PaymentBase.RefundWarningType warningType, Action onFinish) - { - if (warningType == PaymentBase.RefundWarningType.NONE) - { - onFinish.Call(); - return; - } - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetPanelDepth(25); - if (warningType == PaymentBase.RefundWarningType.WARNING) - { - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("Shop_0215")); - dialogBase.SetText(systemText.Get("Shop_0216")); - dialogBase.SetButtonText(systemText.Get("Dia_BuyCrystal_004_Button")); - dialogBase.onPushButton1 = delegate - { - onFinish.Call(); - }; - dialogBase.onPushButton2 = delegate - { - OnPaymentCancel(); - }; - dialogBase.onCloseWithoutSelect = delegate - { - OnPaymentCancel(); - }; - } - else - { - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetTitleLabel(systemText.Get("Shop_0218")); - dialogBase.SetText(systemText.Get("Shop_0217")); - dialogBase.OnClose = delegate - { - OnPaymentCancel(); - }; - } - } - - private static void OnPaymentCancel() - { - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RegionCodeUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/RegionCodeUpdateTask.cs deleted file mode 100644 index 8cc376b4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RegionCodeUpdateTask.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Wizard; - -public class RegionCodeUpdateTask : BaseTask -{ - public class RegionCodeUpdateTaskParam : BaseParam - { - public int initialize_flag; - } - - public RegionCodeUpdateTask() - { - base.type = ApiType.Type.RegionCodeUpdate; - } - - public void SetParameter(int initialize_flag) - { - RegionCodeUpdateTaskParam regionCodeUpdateTaskParam = new RegionCodeUpdateTaskParam(); - regionCodeUpdateTaskParam.initialize_flag = initialize_flag; - base.Params = regionCodeUpdateTaskParam; - } - - protected override int Parse() - { - int result = base.Parse(); - _ = 1; - return result; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RemainTime.cs b/SVSim.BattleEngine/Engine/Wizard/RemainTime.cs index 1cea7d85..4beaca92 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RemainTime.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RemainTime.cs @@ -44,11 +44,6 @@ public class RemainTime TimeInLocal = ConvertTime.ToLocalByDateTime(dateTime); } - public string GetShowText() - { - return GetShowText("MyPage_0058", "MyPage_0057", "MyPage_0056"); - } - public string GetShowText(string minuteId, string hourId, string dayId) { SystemText systemText = Data.SystemText; diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayContentView.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayContentView.cs deleted file mode 100644 index 10ae2f30..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayContentView.cs +++ /dev/null @@ -1,235 +0,0 @@ -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ReplayContentView : MonoBehaviour -{ - [SerializeField] - private UITexture _emblemTexture; - - [SerializeField] - private UITexture _countoryTexture; - - [SerializeField] - private UILabel _nameLabel; - - [SerializeField] - private UILabel _descriptionLabel; - - [SerializeField] - private UILabel _classNameLabel; - - [SerializeField] - private UISprite _classIconSprite; - - [SerializeField] - private UISprite _subClassIconSprite; - - [SerializeField] - private UILabel _winLabel; - - [SerializeField] - private UILabel _loseLabel; - - [SerializeField] - private UISprite _formatIconSprite; - - [SerializeField] - private UILabel _formatLabel; - - [SerializeField] - private UILabel _oldReplayLabel; - - [SerializeField] - private UIGrid _abilityRoot; - - [SerializeField] - private UISprite _abilityIcon; - - private List _abilityIcons = new List(); - - private const float ABILITY_ORIGINAL_POS_X = -405.6f; - - private const int ABILITY_ICON_WIDTH = 25; - - private const int CLASS_LABEL_ORIGINAL_WIDTH = 237; - - private const int CLASS_LABEL_AND_ICON_GAP = 4; - - public void SetData(ReplayInfoItem item) - { - ClearTexture(); - SetOpponentPlayerInfo(item); - SetBattleInfo(item); - SetTexture(item); - } - - public void ClearTexture() - { - _emblemTexture.mainTexture = null; - _countoryTexture.mainTexture = null; - } - - public void SetOpponentPlayerInfo(ReplayInfoItem item) - { - _classIconSprite.spriteName = ClassCharaPrm.GetIconSpriteName((CardBasePrm.ClanType)item.OpponentClassId); - _nameLabel.text = item.OpponentName; - if (FormatBehaviorManager.GetDefaultBehaviour(item.BattleFormat).UseSubClass) - { - _classNameLabel.gameObject.SetActive(value: false); - _subClassIconSprite.gameObject.SetActive(value: true); - _subClassIconSprite.spriteName = ClassCharaPrm.GetIconSpriteName((CardBasePrm.ClanType)item.OpponentSubClassId); - _abilityRoot.gameObject.SetActive(value: false); - return; - } - _classNameLabel.gameObject.SetActive(value: true); - _subClassIconSprite.gameObject.SetActive(value: false); - _abilityIcon.gameObject.SetActive(value: false); - MyRotationInfo myRotationInfo = null; - if (!string.IsNullOrEmpty(item.OpponentRotationId)) - { - myRotationInfo = Data.MyRotationAllInfo.Get(item.OpponentRotationId); - } - _abilityRoot.gameObject.SetActive(myRotationInfo != null); - if (myRotationInfo != null) - { - _classNameLabel.text = DeckData.CreateMyRotationClassName(item.OpponentClassId, myRotationInfo); - _classNameLabel.width = 233 - myRotationInfo.Abilities.Count * 25; - _classNameLabel.InitializeFont(); - Vector3 localPosition = _abilityRoot.transform.localPosition; - localPosition.x = -401.6f + _classNameLabel.printedSize.x; - _abilityRoot.transform.localPosition = localPosition; - for (int i = 0; i < _abilityIcons.Count; i++) - { - _abilityIcons[i].gameObject.SetActive(value: false); - Object.Destroy(_abilityIcons[i].gameObject); - } - _abilityIcons.Clear(); - for (int j = 0; j < myRotationInfo.Abilities.Count; j++) - { - UISprite component = NGUITools.AddChild(_abilityRoot.gameObject, _abilityIcon.gameObject).GetComponent(); - component.spriteName = myRotationInfo.Abilities[j].IconName; - component.gameObject.SetActive(value: true); - _abilityIcons.Add(component); - } - _abilityRoot.Reposition(); - } - else if (item.BattleFormat == Format.Avatar) - { - ClassCharacterMasterData charaPrmByCharaId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(item.OpponentCharaId); - _classNameLabel.text = charaPrmByCharaId.chara_name; - } - else - { - _classNameLabel.text = GameMgr.GetIns().GetDataMgr().GetClanNameByKey(item.OpponentClassId); - } - ClassCharaPrm.SetClassLabelSetting(_classNameLabel, (CardBasePrm.ClanType)item.OpponentClassId); - } - - public void SetBattleInfo(ReplayInfoItem item) - { - string battleTypeName = UIUtil.GetBattleTypeName(item.BattleParameter.BattleType); - string clanNameByKey = GameMgr.GetIns().GetDataMgr().GetClanNameByKey(item.ClassId); - string text = ConvertTime.ToLocal(item.BattleStartTime, ConvertTime.FORMAT.TIME_DATE_SHORT); - if (item.BattleFormat == Format.Avatar) - { - string chara_name = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(item.CharaId) - .chara_name; - _descriptionLabel.text = Data.SystemText.Get("Dia_Replay_002", battleTypeName, chara_name, text); - } - else - { - _descriptionLabel.text = Data.SystemText.Get("Dia_Replay_002", battleTypeName, clanNameByKey, text); - } - _winLabel.gameObject.SetActive(item.IsWin); - _loseLabel.gameObject.SetActive(!item.IsWin); - if (item.BattleParameter.IsTwoPick || item.BattleParameter.IsSealed) - { - if (UIUtil.IsTwoPickForReplay(item.BattleParameter)) - { - _formatIconSprite.gameObject.SetActive(value: true); - _formatLabel.gameObject.SetActive(value: true); - _formatIconSprite.spriteName = "icon_2pick"; - _formatLabel.text = Data.SystemText.Get("Battle_0004"); - } - else if (item.BattleParameter.IsSealed) - { - _formatIconSprite.gameObject.SetActive(value: true); - _formatLabel.gameObject.SetActive(value: true); - _formatIconSprite.spriteName = "icon_sealed_s"; - _formatLabel.text = Data.SystemText.Get("BattleName_Sealed"); - } - else if (item.BattleParameter.TwoPickFormat == TwoPickFormat.Cube || item.BattleParameter.TwoPickFormat == TwoPickFormat.BackdraftCube) - { - if (Data.MyPageNotifications.data.RoomRule.ChallengePickFormat == TwoPickFormat.Cube) - { - _formatIconSprite.gameObject.SetActive(value: true); - _formatIconSprite.spriteName = "icon_2pick"; - } - else - { - _formatIconSprite.gameObject.SetActive(value: false); - } - _formatLabel.gameObject.SetActive(value: true); - _formatLabel.text = Data.SystemText.Get("RoomBattle_0113"); - } - else if (item.BattleParameter.TwoPickFormat == TwoPickFormat.Chaos || item.BattleParameter.TwoPickFormat == TwoPickFormat.BackdraftChaos) - { - if (Data.MyPageNotifications.data.RoomRule.ChallengePickFormat == TwoPickFormat.Chaos) - { - _formatIconSprite.gameObject.SetActive(value: true); - _formatIconSprite.spriteName = "icon_2pick"; - } - else - { - _formatIconSprite.gameObject.SetActive(value: false); - } - _formatLabel.gameObject.SetActive(value: true); - _formatLabel.text = Data.SystemText.Get("Chaos_FormatName"); - } - else - { - _formatIconSprite.gameObject.SetActive(value: false); - _formatLabel.gameObject.SetActive(value: false); - } - } - else if (item.BattleFormat == Format.Hof) - { - _formatIconSprite.gameObject.SetActive(value: false); - _formatLabel.gameObject.SetActive(value: true); - _formatLabel.text = Data.SystemText.Get("Colosseum_0108"); - } - else if (item.BattleFormat == Format.Windfall) - { - _formatIconSprite.gameObject.SetActive(value: false); - _formatLabel.gameObject.SetActive(value: true); - _formatLabel.text = Data.SystemText.Get("Colosseum_0115"); - } - else - { - _formatIconSprite.gameObject.SetActive(value: true); - _formatLabel.gameObject.SetActive(value: true); - _formatIconSprite.spriteName = FormatBehaviorManager.GetDefaultBehaviour(item.BattleFormat).SmallIconSpriteName; - _formatLabel.text = FormatBehaviorManager.GetFormatName(item.BattleFormat); - } - } - - public void SetTexture(ReplayInfoItem item) - { - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S, isfetch: true); - _emblemTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath); - if (!string.IsNullOrEmpty(item.OpponentCountryCode)) - { - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentCountryCode, ResourcesManager.AssetLoadPathType.Country_S, isfetch: true); - _countoryTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(assetTypePath2); - } - } - - public void SetOldReplayLabel(bool isActive) - { - _oldReplayLabel.text = Data.SystemText.Get("Dia_Replay_003"); - _oldReplayLabel.gameObject.SetActive(isActive); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayDetailTask.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayDetailTask.cs deleted file mode 100644 index 03085670..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayDetailTask.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Wizard; - -public class ReplayDetailTask : BaseTask -{ - public class ReplayDetailTaskParam : BaseParam - { - public new int viewer_id; - - public long battle_id; - } - - public ReplayDetailTask() - { - base.type = ApiType.Type.ReplayDetail; - } - - public void SetParameter(int viewerId, long battleId) - { - ReplayDetailTaskParam replayDetailTaskParam = new ReplayDetailTaskParam(); - replayDetailTaskParam.viewer_id = viewerId; - replayDetailTaskParam.battle_id = battleId; - base.Params = replayDetailTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.ReplayBattleInfo = new ReplayDetailInfo(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayDialog.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayDialog.cs deleted file mode 100644 index 909ed248..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayDialog.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ReplayDialog : MonoBehaviour -{ - [SerializeField] - private GameObject _replayDialogContent; - - [SerializeField] - private GameObject _noReplayLabel; - - [SerializeField] - private UIWrapContent _wrapContent; - - [SerializeField] - private UIScrollView _scrollView; - - public Action OnClickReplayButton; - - private List _initTextures = new List(); - - private List _loadedTextures = new List(); - - private LoadQueue _loadQueue = new LoadQueue(); - - private List _items; - - public static void Create() - { - GameObject gameObject = UnityEngine.Object.Instantiate(UIManager.GetInstance().ReplayDialogPrefab); - ReplayDialog script = gameObject.GetComponent(); - DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); - dialog.SetSize(DialogBase.Size.XL); - dialog.SetTitleLabel(Data.SystemText.Get("OtherTop_0033")); - dialog.SetObj(gameObject); - dialog.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - dialog.SetDisp(inDisp: false); - script.SetupContents(Data.ReplayInfo.Items, delegate - { - dialog.SetDisp(inDisp: true); - script.OnClickReplayButton = delegate - { - dialog.Close(); - }; - }); - } - - public void SetupContents(List items, Action onLoaded) - { - _items = items; - _wrapContent.onInitializeItem = OnInitializeItem; - _noReplayLabel.SetActive(items.Count == 0); - _wrapContent.minIndex = -(items.Count - 1); - _wrapContent.maxIndex = 0; - int num = (int)(_scrollView.panel.height / (float)_wrapContent.itemSize) + 1; - bool active = num <= items.Count; - num = Math.Min(num, items.Count); - for (int i = 0; i < num; i++) - { - string emblemTexturePath = GetEmblemTexturePath(_items[i], isfetch: false); - string countryTexturePath = GetCountryTexturePath(_items[i], isfetch: false); - if (!_initTextures.Contains(emblemTexturePath)) - { - _initTextures.Add(emblemTexturePath); - } - if (!string.IsNullOrEmpty(countryTexturePath) && !_initTextures.Contains(countryTexturePath)) - { - _initTextures.Add(countryTexturePath); - } - } - List list = new List(); - for (int j = num; j < items.Count; j++) - { - string emblemTexturePath2 = GetEmblemTexturePath(_items[j], isfetch: false); - string countryTexturePath2 = GetCountryTexturePath(_items[j], isfetch: false); - if (!_initTextures.Contains(emblemTexturePath2) && !list.Contains(emblemTexturePath2)) - { - list.Add(emblemTexturePath2); - } - if (!string.IsNullOrEmpty(countryTexturePath2) && !_initTextures.Contains(countryTexturePath2) && !list.Contains(countryTexturePath2)) - { - list.Add(countryTexturePath2); - } - } - for (int k = 0; k < list.Count; k++) - { - string path = list[k]; - _loadQueue.AddToLast(path, new List { path }, null, delegate - { - _loadedTextures.Add(path); - }); - } - if (num == 1) - { - GameObject gameObject = AddContent(_scrollView.gameObject); - StartCoroutine(gameObject.GetComponent().Setup(_items[0], _loadedTextures)); - } - else - { - for (int num2 = 0; num2 < num; num2++) - { - AddContent(_wrapContent.gameObject); - } - } - _scrollView.ResetPosition(); - _scrollView.enabled = active; - _scrollView.verticalScrollBar.gameObject.SetActive(active); - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_initTextures, delegate - { - _loadedTextures.AddRange(_initTextures); - _loadQueue.StartLoad(); - onLoaded.Call(); - })); - } - - private void OnInitializeItem(GameObject go, int wrapIndex, int realIndex) - { - ReplayInfoItem item = _items[-realIndex]; - StartCoroutine(go.GetComponent().Setup(item, _loadedTextures)); - } - - private string GetEmblemTexturePath(ReplayInfoItem item, bool isfetch) - { - return Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S, isfetch); - } - - private string GetCountryTexturePath(ReplayInfoItem item, bool isfetch) - { - if (string.IsNullOrEmpty(item.OpponentCountryCode)) - { - return ""; - } - return Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentCountryCode, ResourcesManager.AssetLoadPathType.Country_S, isfetch); - } - - private void OnDestroy() - { - UIManager.GetInstance().StartCoroutine(UnloadTextures()); - } - - private IEnumerator UnloadTextures() - { - _loadQueue.Clear(); - while (_loadQueue.IsClearing) - { - yield return null; - } - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedTextures); - } - - private GameObject AddContent(GameObject gameObject) - { - GameObject obj = NGUITools.AddChild(gameObject, _replayDialogContent); - ReplayDialogContent component = obj.GetComponent(); - component.GetComponent().scrollView = _scrollView; - component.OnClickReplayButton = delegate - { - OnClickReplayButton.Call(); - }; - return obj; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayDialogContent.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayDialogContent.cs deleted file mode 100644 index 189d4e76..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayDialogContent.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Cute; -using UnityEngine; -using Wizard.Replay; - -namespace Wizard; - -public class ReplayDialogContent : MonoBehaviour -{ - [SerializeField] - private GameObject _rootReplayContentView; - - [SerializeField] - private ReplayContentView _prefabReplayContentView; - - private ReplayContentView _replayContentView; - - public Action OnClickReplayButton; - - private long _battle_id; - - private ReplayInfoItem _replayInfo; - - public void ReplayButtonClicked() - { - OnClickReplayButton.Call(); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - long battleId = _battle_id; - ReplayInfoItem replayInfo = _replayInfo; - CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - GoReplay(battleId, replayInfo); - })); - } - - private static void GoReplay(long battleId, ReplayInfoItem replayInfo) - { - string replayDataDirectoryPath = Application.persistentDataPath + "/NewReplay"; - string text = (Directory.Exists(replayDataDirectoryPath) ? (from d in Directory.GetDirectories(replayDataDirectoryPath, "*", SearchOption.TopDirectoryOnly) - select d.Replace("\\", "/")).FirstOrDefault((string f) => f == replayDataDirectoryPath + "/" + battleId) : null); - bool num = (text == null) | (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_ALL) || (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_EXCLUDE_ROTATION) && replayInfo.BattleFormat != Format.Rotation)); - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam(); - param.MyPageMenuIndex = 6; - param.IsCutCardMotion = true; - param.OnFinishChangeView = delegate - { - ReplayDialog.Create(); - }; - param.IsUpdateFooterMenuTexture = true; - if (num) - { - ReplayDetailTask replayDetailTask = new ReplayDetailTask(); - replayDetailTask.SetParameter(PlayerStaticData.UserViewerID, battleId); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(replayDetailTask, delegate - { - ReplayController.StartPlayReplay(replayInfo, UIManager.ViewScene.MyPage, param); - })); - return; - } - Data.ReplayBattleInfo = new ReplayDetailInfo(NewReplayBattleMgr.ReadJson(Directory.GetFiles(text, "*", SearchOption.TopDirectoryOnly).ToList().FirstOrDefault((string x) => x.Contains("replay_info.json")))); - Data.ReplayBattleInfo.is_two_pick = replayInfo.BattleParameter.IsTwoPick; - Data.ReplayBattleInfo._battleType = (int)replayInfo.BattleParameter.BattleType; - Data.ReplayBattleInfo._twoPickFormat = replayInfo.BattleParameter.TwoPickFormat; - Data.CurrentFormat = replayInfo.BattleFormat; - ReplayController.StartPlayReplay(UIManager.ViewScene.MyPage, param, isNewReplay: true, battleId.ToString()); - } - - public IEnumerator Setup(ReplayInfoItem item, List loadedTextures) - { - if (_replayContentView == null) - { - _replayContentView = NGUITools.AddChild(_rootReplayContentView, _prefabReplayContentView.gameObject).GetComponent(); - } - _replayInfo = item; - _battle_id = item.BattleId; - _replayContentView.SetOpponentPlayerInfo(item); - _replayContentView.SetBattleInfo(item); - string text = Application.persistentDataPath + "/NewReplay"; - if ((!Directory.Exists(text) || !(from d in Directory.GetDirectories(text, "*", SearchOption.TopDirectoryOnly) - select d.Replace("\\", "/")).Contains(text + "/" + _battle_id)) | (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_ALL) || (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_EXCLUDE_ROTATION) && _replayInfo.BattleFormat != Format.Rotation))) - { - _replayContentView.SetOldReplayLabel(isActive: true); - } - else - { - _replayContentView.SetOldReplayLabel(isActive: false); - } - _replayContentView.ClearTexture(); - while (true) - { - if (item.BattleId != _battle_id) - { - yield break; - } - string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S); - string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentCountryCode, ResourcesManager.AssetLoadPathType.Country_S); - if (!loadedTextures.Contains(assetTypePath)) - { - yield return null; - continue; - } - if (string.IsNullOrEmpty(assetTypePath2) || loadedTextures.Contains(assetTypePath2)) - { - break; - } - yield return null; - } - _replayContentView.SetTexture(item); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayInfo.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayInfo.cs index 9ddae823..e86b2bfb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ReplayInfo.cs @@ -4,5 +4,4 @@ namespace Wizard; public class ReplayInfo : HeaderData { - public List Items; } diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayInfoItem.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayInfoItem.cs deleted file mode 100644 index ac21bce6..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayInfoItem.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using LitJson; - -namespace Wizard; - -public class ReplayInfoItem -{ - public BattleParameter BattleParameter; - - public long BattleId; - - public string OpponentName; - - public int ClassId; - - public int SubClassId; - - public int OpponentClassId; - - public int OpponentSubClassId; - - public int CharaId; - - public int OpponentCharaId; - - public string OpponentCountryCode; - - public string OpponentEmblemId; - - public string OpponentDegreeId; - - public bool IsWin; - - public DateTime BattleStartTime; - - public Format BattleFormat { get; set; } - - public string OpponentRotationId { get; private set; } - - public string RotationId { get; private set; } - - public ReplayInfoItem(JsonData data) - { - BattleParameter = BattleParameter.JsonToBattleParameter(data); - BattleId = data["battle_id"].ToLong(); - OpponentName = data["opponent_name"].ToString(); - ClassId = data["class_id"].ToInt(); - SubClassId = data.GetValueOrDefault("sub_class_id", 10); - OpponentClassId = data["opponent_class_id"].ToInt(); - OpponentSubClassId = data.GetValueOrDefault("opponent_sub_class_id", 10); - CharaId = data.GetValueOrDefault("chara_id", 0); - OpponentCharaId = data.GetValueOrDefault("opponent_chara_id", 0); - OpponentCountryCode = data["opponent_country_code"].ToString(); - OpponentEmblemId = data["opponent_emblem_id"].ToString(); - OpponentDegreeId = data["opponent_degree_id"].ToString(); - IsWin = data["is_win"].ToString().Equals("1"); - BattleStartTime = DateTime.Parse(data["battle_start_time"].ToString()); - BattleFormat = Data.ParseApiFormat(data["deck_format"].ToInt()); - OpponentRotationId = data.GetValueOrDefault("opponent_rotation_id", null); - RotationId = data.GetValueOrDefault("rotation_id", null); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplayInfoTask.cs b/SVSim.BattleEngine/Engine/Wizard/ReplayInfoTask.cs deleted file mode 100644 index 9bce7a98..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplayInfoTask.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class ReplayInfoTask : BaseTask -{ - public class ReplayInfoTaskParam : BaseParam - { - } - - public ReplayInfoTask() - { - base.type = ApiType.Type.ReplayInfo; - } - - public void SetParameter() - { - ReplayInfoTaskParam replayInfoTaskParam = new ReplayInfoTaskParam(); - base.Params = replayInfoTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - List list = new List(); - JsonData jsonData = base.ResponseData["data"]["replay_list"]; - for (int i = 0; i < jsonData.Count; i++) - { - list.Add(new ReplayInfoItem(jsonData[i])); - } - Data.ReplayInfo.Items = list; - if (base.ResponseData["data"].Keys.Contains("feature_maintenance_list")) - { - List list2 = new List(); - for (int j = 0; j < base.ResponseData["data"]["feature_maintenance_list"].Count; j++) - { - list2.Add((NetworkDefine.MAINTENANCE_TYPE)base.ResponseData["data"]["feature_maintenance_list"][j].ToInt()); - } - Data.UpdateMaintenance(new List - { - NetworkDefine.MAINTENANCE_TYPE.REPLAY_ALL, - NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_ALL, - NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_EXCLUDE_ROTATION, - NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_RECORD - }, list2); - } - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ReplaySkipAnimation.cs b/SVSim.BattleEngine/Engine/Wizard/ReplaySkipAnimation.cs deleted file mode 100644 index 4f488ffb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ReplaySkipAnimation.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ReplaySkipAnimation : MonoBehaviour -{ - [SerializeField] - private UISprite TitleSkip; - - [SerializeField] - private UITexture Bg; - - [SerializeField] - private UITexture FieldHideBg; - - [SerializeField] - private UIPanel MainPanel; - - [SerializeField] - private UISprite ArcaneIn; - - [SerializeField] - private UISprite ArcaneOut; - - private List _loadFileList = new List(); - - private GameObject _effectObject; - - private const int LOADING_LAYER = 26; - - private const string REPLAY_SKIP_EFFECT = "cmn_replay_skipping_1"; - - public const float FADE_IN_TIME = 0.1f; - - public const float FADE_OUT_TIME = 0.1f; - - public void SetUp() - { - ArcaneIn.alpha = 0f; - ArcaneOut.alpha = 0f; - ArcaneIn.transform.localScale = Vector3.one; - ArcaneOut.transform.localScale = Vector3.one; - Bg.alpha = 0f; - FieldHideBg.alpha = 0f; - UIAtlas atlas = UIManager.GetInstance().GetAtlasList().FirstOrDefault((UIAtlas s) => s.name == "BattleLang"); - TitleSkip.atlas = atlas; - TitleSkip.spriteName = "result_text_skipping"; - _loadFileList = new List { Toolbox.ResourcesManager.GetAssetTypePath("cmn_replay_skipping_1", ResourcesManager.AssetLoadPathType.Effect2D) }; - StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadFileList, delegate - { - _effectObject = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_replay_skipping_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); - _effectObject.transform.SetParent(base.gameObject.transform); - _effectObject.SetLayer(26, isSetChildren: true); - _effectObject.transform.localPosition = Vector3.zero; - _loadFileList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_effectObject, null)); - _effectObject.SetActive(value: false); - })); - base.gameObject.SetLayer(26, isSetChildren: true); - Bg.gameObject.SetActive(value: false); - FieldHideBg.gameObject.SetActive(value: false); - } - - public void Unload() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - } - - public void Run() - { - Bg.gameObject.SetActive(value: true); - FieldHideBg.gameObject.SetActive(value: true); - FieldHideBg.alpha = 0f; - TitleSkip.gameObject.SetActive(value: true); - TitleSkip.transform.localScale = Vector3.one; - TitleSkip.alpha = 0f; - Bg.color = new Color32(0, 102, 153, 0); - MainPanel.alpha = 1f; - ArcaneIn.gameObject.SetActive(value: true); - ArcaneOut.gameObject.SetActive(value: true); - _effectObject.SetActive(value: true); - TweenAlpha.Begin(TitleSkip.gameObject, 0.1f, 1f); - TweenAlpha.Begin(Bg.gameObject, 0.1f, 0.25f); - TweenAlpha.Begin(FieldHideBg.gameObject, 0.1f, 1f); - TweenAlpha.Begin(ArcaneIn.gameObject, 0.1f, 0.75f); - TweenAlpha.Begin(ArcaneOut.gameObject, 0.1f, 1f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_REPLAY_TURN_SKIPPING); - } - - public void End() - { - TweenAlpha.Begin(TitleSkip.gameObject, 0.1f, 0f); - TweenAlpha.Begin(Bg.gameObject, 0.1f, 0f); - TweenAlpha.Begin(FieldHideBg.gameObject, 0.1f, 0f); - TweenAlpha.Begin(ArcaneIn.gameObject, 0.1f, 0f); - TweenAlpha.Begin(ArcaneOut.gameObject, 0.1f, 0f); - _effectObject.SetActive(value: false); - } - - public void Hide() - { - Bg.gameObject.SetActive(value: false); - FieldHideBg.gameObject.SetActive(value: false); - TitleSkip.gameObject.SetActive(value: false); - ArcaneIn.gameObject.SetActive(value: false); - ArcaneOut.gameObject.SetActive(value: false); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs b/SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs deleted file mode 100644 index e7661d42..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ResourceDownloadCardFactory.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class ResourceDownloadCardFactory : MonoBehaviour -{ - private List _loadFileList = new List(); - - private static string GetClassIconPath(CardBasePrm.ClanType classType, bool isFetch) - { - int num = (int)classType; - return Toolbox.ResourcesManager.GetAssetTypePath("class_card_" + num.ToString("00"), ResourcesManager.AssetLoadPathType.CardFrameClassIcon, isFetch); - } - - public bool CanView(List cardIdList) - { - foreach (string load in GetLoadList(cardIdList, needCardFrame: true)) - { - AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(load); - if (load == null) - { - return false; - } - if (assetHandle.isReDownloadAsset(CustomPreference.IsNormalResource)) - { - return false; - } - } - return true; - } - - private List GetLoadList(List cardIdList, bool needCardFrame) - { - List cardPath = GetCardPath(cardIdList); - if (needCardFrame) - { - cardPath.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame)); - } - for (int i = 0; i < 9; i++) - { - cardPath.Add(GetClassIconPath((CardBasePrm.ClanType)i, isFetch: false)); - } - return cardPath; - } - - public void Load(List cardIdList, GameObject parent, Action> onFinish) - { - bool preferSynchronousLoad = true; - List loadList = GetLoadList(cardIdList, needCardFrame: false); - _loadFileList.AddRange(loadList); - loadList.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.CardFrame)); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroup(loadList, delegate - { - UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.CardFrame); - CreateAllCard(cardIdList, parent, onFinish); - }, isProgress: true, preferSynchronousLoad)); - } - - private List GetCardPath(List cardIdList) - { - CardMaster.CardMasterId cardMasterId = CardMaster.CardMasterId.Default; - List list = new List(); - foreach (int cardId in cardIdList) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(cardMasterId).GetCardParameterFromId(cardId); - string requestPath = GetRequestPath(cardParameterFromId); - if (!string.IsNullOrEmpty(requestPath)) - { - list.Add(requestPath); - } - } - return list; - } - - private string GetRequestPath(CardParameter param) - { - int resourceCardId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(param.NormalCardId).ResourceCardId; - if (param.CharType == CardBasePrm.CharaType.NORMAL) - { - return Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial); - } - return Toolbox.ResourcesManager.GetAssetTypePath(resourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial); - } - - private void CreateAllCard(List cardIdList, GameObject parent, Action> onFinish) - { - GameObject prefab = Resources.Load("Prefab/Cards/CardListTemplate") as GameObject; - List list = new List(); - foreach (int cardId in cardIdList) - { - list.Add(CreateCard(cardId, parent, prefab)); - } - onFinish.Call(list); - } - - private CardListTemplate CreateCard(int cardId, GameObject parent, GameObject prefab) - { - CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(cardId); - CardListTemplate component = NGUITools.AddChild(parent, prefab).GetComponent(); - component.SetId(cardId); - string text = Data.SystemText.Get($"LoadCard_{cardId}"); - component._nameLabel.text = text; - component._newLabel.gameObject.SetActive(value: false); - component.RotationOnlyIconVisible = cardParameterFromId.IsResurgentCard; - if (cardParameterFromId.CharType == CardBasePrm.CharaType.NORMAL) - { - component._atkLabel.text = cardParameterFromId.Atk.ToString(); - component._lifeLabel.text = cardParameterFromId.Life.ToString(); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._atkLabel, cardParameterFromId.IsFoil); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._lifeLabel, cardParameterFromId.IsFoil); - } - component._costLabel.text = cardParameterFromId.Cost.ToString(); - UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(component._costLabel, cardParameterFromId.IsFoil); - component._cardTexture.material = UIBase_CardManager.Get2dCardMaterial(cardParameterFromId); - component._cardTexture.transform.localPosition += new Vector3(0f, 0f, 3f); - component._frameSprite.transform.localPosition += new Vector3(0f, 0f, 1f); - component._cardTexture.uvRect = Global.CARD_2D_UV_RECT; - component.SetFrame(cardParameterFromId); - Global.SetRepositionNameLabel(component._nameLabel, text, is2D: true); - UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(component._nameLabel, cardParameterFromId.IsFoil); - component._classIconTexture.mainTexture = ClassCharaPrm.GetClassIconTexture((int)cardParameterFromId.Clan); - component.SetBossRushIconSprite(string.Empty); - return component; - } - - private void OnDestroy() - { - Release(); - } - - public void Release() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RewardBase.cs b/SVSim.BattleEngine/Engine/Wizard/RewardBase.cs index 98f63fc7..d74851f1 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RewardBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RewardBase.cs @@ -80,20 +80,6 @@ public class RewardBase : MonoBehaviour private Vector3 _cardScale = new Vector3(0.93f, 0.93f, 1f); - private const int SKIN_SPECIAL_SIZE_ID = 4403; - - private const float DRAG_DEGREE = 70f; - - private const int SLEEVE_WIDTH = 170; - - private const int SLEEVE_HEIGHT = 230; - - private const int SKIN_WIDTH = 170; - - private const int SKIN_HEIGHT = 136; - - private const int REWARD_NUM_PER_PAGE = 3; - private readonly Vector3 POS_GRID_CENTER = new Vector3(0f, 50f, 0f); private readonly Vector3 POS_GRID_LEFT = new Vector3(-270f, 50f, 0f); @@ -108,11 +94,6 @@ public class RewardBase : MonoBehaviour private bool _isDragStart; - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_rewardThumbnailAssetList); - } - private void CreateDetail() { if (!(CardDetail != null)) @@ -176,48 +157,6 @@ public class RewardBase : MonoBehaviour } } - public void SetOnlyIconEndCreate(bool isSleeveRotate = true) - { - _isPaging = false; - _buttonPrev.gameObject.SetActive(value: false); - _buttonNext.gameObject.SetActive(value: false); - _flickCollider.gameObject.SetActive(value: false); - RewardGrid.cellWidth = 135f; - foreach (RewardObjectInfo rewardObjectInfo in _rewardObjectInfoList) - { - switch (rewardObjectInfo.GoodsType) - { - case UserGoods.Type.Sleeve: - if (isSleeveRotate) - { - rewardObjectInfo.ObjectData.textures[0].transform.localRotation = Quaternion.Euler(0f, 0f, -5f); - } - rewardObjectInfo.ObjectData.textures[0].transform.localScale = Vector3.one * 0.5f; - break; - case UserGoods.Type.Emblem: - rewardObjectInfo.ObjectData.textures[0].transform.localScale = Vector3.one * 0.6f; - break; - } - rewardObjectInfo.ObjectData.labels[0].gameObject.SetActive(value: false); - } - EndCreate(); - } - - public void AllInEndCreate(float sizeAjust, int cellWidthAdjust = 0) - { - _isPaging = false; - _buttonPrev.gameObject.SetActive(value: false); - _buttonNext.gameObject.SetActive(value: false); - _flickCollider.gameObject.SetActive(value: false); - RewardGrid.transform.localScale = RewardGrid.transform.localScale * sizeAjust; - RewardGrid.cellWidth = RewardGrid.cellWidth * sizeAjust + (float)cellWidthAdjust; - foreach (RewardObjectInfo rewardObjectInfo in _rewardObjectInfoList) - { - rewardObjectInfo.ObjectData.labels[0].width = (int)((float)rewardObjectInfo.ObjectData.labels[0].width * sizeAjust); - } - EndCreate(); - } - public void EndCreate() { if (_rewardCardDataList.Count > 0) @@ -371,7 +310,7 @@ public class RewardBase : MonoBehaviour { if (_currentPage < GetLastPage()) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + ShowPage(_currentPage + 1); } } @@ -380,7 +319,7 @@ public class RewardBase : MonoBehaviour { if (_currentPage > 1) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + ShowPage(_currentPage - 1); } } @@ -517,9 +456,4 @@ public class RewardBase : MonoBehaviour _labelTitle.gameObject.SetActive(isEnabled); _labelTitle.text = title; } - - public void SetActiveMyPageLayerCamera(bool isActive) - { - _mypageCamera.gameObject.SetActive(isActive); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/RewardConfirmView.cs b/SVSim.BattleEngine/Engine/Wizard/RewardConfirmView.cs index 05a0f51d..9f336fab 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RewardConfirmView.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RewardConfirmView.cs @@ -104,12 +104,4 @@ public class RewardConfirmView : MonoBehaviour onFinish.Call(); })); } - - private void OnDestroy() - { - if (_loadedResourceList != null && _loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattle2PickDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattle2PickDoMatchingTask.cs deleted file mode 100644 index 3f231904..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattle2PickDoMatchingTask.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Wizard.RoomMatch; - -namespace Wizard; - -public class RoomBattle2PickDoMatchingTask : RoomBattleDoMatchingTask -{ - public class RoomBattle2PickDoMatchingTaskParam : BaseParam - { - public int deck_no; - } - - public RoomBattle2PickDoMatchingTask(TwoPickFormat deckFormatType, RoomConnectController.BattleRule rule) - : base(isConvention: false, isGathering: false) - { - base.type = RoomTwoPickApiVariation.GetApiType(deckFormatType, rule, RoomTwoPickApiVariation.VariationType.DoMatching); - SkipCuteTimeOutPopup(); - SkipCuteHttpStatusErrorPopup(); - SkipAllCuteResultCodeCheckErrorPopup(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattle2PickFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattle2PickFinishTask.cs deleted file mode 100644 index 8f15ab80..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattle2PickFinishTask.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Wizard.RoomMatch; - -namespace Wizard; - -public class RoomBattle2PickFinishTask : RoomBattleFinishTask -{ - public RoomBattle2PickFinishTask(TwoPickFormat deckFormatType, RoomConnectController.BattleRule rule) - : base(isConvention: false, isGathering: false) - { - base.type = RoomTwoPickApiVariation.GetApiType(deckFormatType, rule, RoomTwoPickApiVariation.VariationType.Finish); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTask.cs deleted file mode 100644 index c4918f1d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTask.cs +++ /dev/null @@ -1,49 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class RoomBattleDoMatchingTask : DoMatchingBase -{ - public RoomBattleDoMatchingTask(bool isConvention, bool isGathering) - { - if (isConvention) - { - base.type = ApiType.Type.EventRoomBattleBattleDoMatching; - } - else if (isGathering) - { - base.type = ApiType.Type.GatheringRoomBattleDoMatching; - } - else - { - base.type = ApiType.Type.OpenRoomBattleBattleDoMatching; - } - SkipCuteTimeOutPopup(); - SkipCuteHttpStatusErrorPopup(); - SkipAllCuteResultCodeCheckErrorPopup(); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.RoomBattleMatching.data = new RoomBattleMatchingDetail(); - Data.RoomBattleMatching.data.battle_state = 0; - Data.RoomBattleMatching.data.matching_state = 0; - JsonData jsonData = base.ResponseData["data"]; - Data.RoomBattleMatching.data.matching_state = jsonData["matching_state"].ToInt(); - if (jsonData.Keys.Contains("battle_state")) - { - Data.RoomBattleMatching.data.battle_state = jsonData["battle_state"].ToInt(); - } - if (jsonData.TryGetValue("battle_id", out var value)) - { - Data.LastRoomBattleId = value.ToString(); - } - Data.RoomBattleMatching.data.battleId = Data.LastRoomBattleId; - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskAvatar.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskAvatar.cs deleted file mode 100644 index 270e319c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskAvatar.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Wizard; - -public class RoomBattleDoMatchingTaskAvatar : RoomBattleDoMatchingTask -{ - public RoomBattleDoMatchingTaskAvatar(bool isGathering) - : base(isConvention: false, isGathering: false) - { - if (isGathering) - { - base.type = ApiType.Type.GatheringRoomBattleDoMatching; - } - else - { - base.type = ApiType.Type.OpenRoomBattleDoMatchingAvatar; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskHOF.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskHOF.cs deleted file mode 100644 index 3cdb389a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskHOF.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wizard; - -public class RoomBattleDoMatchingTaskHOF : RoomBattleDoMatchingTask -{ - public RoomBattleDoMatchingTaskHOF() - : base(isConvention: false, isGathering: false) - { - base.type = ApiType.Type.OpenRoomBattleBattleDoMatchingHOF; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskWindFall.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskWindFall.cs deleted file mode 100644 index 737fe891..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleDoMatchingTaskWindFall.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wizard; - -public class RoomBattleDoMatchingTaskWindFall : RoomBattleDoMatchingTask -{ - public RoomBattleDoMatchingTaskWindFall() - : base(isConvention: false, isGathering: false) - { - base.type = ApiType.Type.OpenRoomBattleBattleDoMatchingWindFall; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTask.cs deleted file mode 100644 index bbc2591c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTask.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Wizard; - -public class RoomBattleFinishTask : FinishTaskBase -{ - public RoomBattleFinishTask(bool isConvention, bool isGathering) - { - if (isConvention) - { - base.type = ApiType.Type.EventRoomMatchFinish; - } - else if (isGathering) - { - base.type = ApiType.Type.GatheringRoomBattleFinish; - } - else - { - base.type = ApiType.Type.OpenRoomMatchFinish; - } - } - - protected override int Parse() - { - int num = base.Parse(); - if (IsEffectiveErrorCode(num)) - { - return num; - } - if (!IsResponseDataExist(base.ResponseData)) - { - return num; - } - Data.RoomMatchFinish.data = new RoomMatchFinishDetail(); - Data.RoomMatchFinish.data.class_chara_experience = 0; - Data.RoomMatchFinish.data.class_chara_level = 0; - new BattleFinishResponsProcessing().Processing(base.ResponseData, Data.RoomMatchFinish.data); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskAvatar.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskAvatar.cs deleted file mode 100644 index bb792802..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskAvatar.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Wizard; - -public class RoomBattleFinishTaskAvatar : RoomBattleFinishTask -{ - public RoomBattleFinishTaskAvatar(bool isGathering) - : base(isConvention: false, isGathering: false) - { - if (isGathering) - { - base.type = ApiType.Type.GatheringRoomBattleFinish; - } - else - { - base.type = ApiType.Type.OpenRoomMatchFinishAvatar; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskHOF.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskHOF.cs deleted file mode 100644 index b44d24b0..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskHOF.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wizard; - -public class RoomBattleFinishTaskHOF : RoomBattleFinishTask -{ - public RoomBattleFinishTaskHOF() - : base(isConvention: false, isGathering: false) - { - base.type = ApiType.Type.OpenRoomMatchFinishHof; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskWindFall.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskWindFall.cs deleted file mode 100644 index 0e7ac28d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleFinishTaskWindFall.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wizard; - -public class RoomBattleFinishTaskWindFall : RoomBattleFinishTask -{ - public RoomBattleFinishTaskWindFall() - : base(isConvention: false, isGathering: false) - { - base.type = ApiType.Type.OpenRoomMatchFinishWindFall; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs b/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs deleted file mode 100644 index db0607c8..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; - -namespace Wizard; - -public class RoomBattleWatchTaskBase : BaseTask -{ - public class UserInfo - { - public int battlePoint; - - public int degreeId; - - public long emblemId; - - public string countryCode; - - public int rank; - - public string userName; - - public int viewerId; - - public bool IsOfficialUser { get; set; } - - public UserInfo() - { - } - - public UserInfo(Dictionary data) - { - viewerId = Convert.ToInt32(data["viewerId"]); - countryCode = data["country_code"].ToString(); - userName = data["userName"].ToString(); - rank = Convert.ToInt32(data["rank"]); - battlePoint = Convert.ToInt32(data["battlePoint"]); - emblemId = Convert.ToInt32(data["emblemId"]); - degreeId = Convert.ToInt32(data["degreeId"]); - IsOfficialUser = Convert.ToInt32(data["isOfficial"]) == 1; - } - } - - public int result_reason; - - public string node_server_url; - - public UserInfo owner_info; - - public UserInfo visitor_info; - - public BattleParameter BattleParameterInstance { get; private set; } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - JsonData jsonData = base.ResponseData["data"]; - result_reason = jsonData["result_reason"].ToInt(); - if (result_reason == 0) - { - if (jsonData.Keys.Contains("owner_info")) - { - ParseUserInfo(jsonData["owner_info"], ref owner_info); - } - if (jsonData.Keys.Contains("visitor_info")) - { - ParseUserInfo(jsonData["visitor_info"], ref visitor_info); - } - node_server_url = jsonData["node_server_url"].ToString(); - } - if (jsonData.Keys.Contains("is_admin")) - { - bool flag = Convert.ToBoolean(jsonData["is_admin"].ToInt()); - GameMgr.GetIns().IsAdmin = flag; - GameMgr.GetIns().HasAuthAdmin = flag; - } - else - { - GameMgr.GetIns().IsAdmin = false; - GameMgr.GetIns().HasAuthAdmin = false; - } - BattleParameterInstance = BattleParameter.JsonToBattleParameter(base.ResponseData["data"]); - if (BattleParameterInstance.BattleType == NetworkDefine.ServerBattleType.RoomTwoPick) - { - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomTwoPick; - GameMgr.GetIns().GetDataMgr().TwoPickFormat = BattleParameterInstance.TwoPickFormat; - } - else - { - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle; - } - return num; - } - - private void ParseUserInfo(JsonData receive, ref UserInfo info) - { - if (receive != null) - { - info = new UserInfo(); - info.viewerId = receive["viewer_id"].ToInt(); - info.battlePoint = receive["battlePoint"].ToInt(); - info.degreeId = receive["degreeId"].ToInt(); - info.emblemId = receive["emblemId"].ToLong(); - info.countryCode = receive["country_code"].ToString(); - info.rank = receive["rank"].ToInt(); - info.userName = receive["userName"].ToString(); - info.IsOfficialUser = receive["isOfficial"].ToInt() == 1; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickApiVariation.cs b/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickApiVariation.cs deleted file mode 100644 index f129863b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickApiVariation.cs +++ /dev/null @@ -1,299 +0,0 @@ -using System.Collections.Generic; -using Wizard.RoomMatch; - -namespace Wizard; - -public static class RoomTwoPickApiVariation -{ - public enum VariationType - { - DoMatching, - Finish, - ResetDeck, - BeginCreateDeck, - SelectClass, - SelectCardSet - } - - private static readonly Dictionary NormalApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoomBattle2PickBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickMatchFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickBattleDeckReset - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickBattleSelectCard - } - }; - - private static readonly Dictionary MultiApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoomBattle2PickMultiBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickMultiBattleMatchFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickMultiBattleDeckReset - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickMultiBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickMultiBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickMultiBattleSelectCard - } - }; - - private static readonly Dictionary BackdraftApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoomBattle2PickDraftBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickDraftMatchFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickDraftBattleDeckReset - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickDraftBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickDraftBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickDraftBattleSelectCard - } - }; - - private static readonly Dictionary CubeApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoom2PickCubeBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickCubeBattleFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickCubeBattleResetDeck - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickCubeBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickCubeBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickCubeBattleSelectCardSet - } - }; - - private static readonly Dictionary MultiCubeApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoom2PickCubeMultiBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickCubeMultiBattleFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickCubeMultiBattleResetDeck - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickCubeMultiBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickCubeMultiBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickCubeMultiBattleSelectCardSet - } - }; - - private static readonly Dictionary BackDraftCubeApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoomBattle2PickCubeDraftBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickCubeDraftMatchFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickCubeDraftBattleDeckReset - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickCubeDraftBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickCubeDraftBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickCubeDraftBattleSelectCard - } - }; - - private static readonly Dictionary ChaosApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoom2PickChaosBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickChaosBattleFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickChaosBattleResetDeck - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickChaosBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickChaosBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickChaosBattleSelectCardSet - } - }; - - private static readonly Dictionary MultiChaosApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoom2PickChaosMultiBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickChaosMultiBattleFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickChaosMultiBattleResetDeck - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickChaosMultiBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickChaosMultiBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickChaosMultiBattleSelectCardSet - } - }; - - private static readonly Dictionary BackdraftChaosApiTypes = new Dictionary - { - { - VariationType.DoMatching, - ApiType.Type.OpenRoomBattle2PickChaosDraftBattleDoMatching - }, - { - VariationType.Finish, - ApiType.Type.OpenRoom2PickChaosDraftMatchFinish - }, - { - VariationType.ResetDeck, - ApiType.Type.OpenRoom2PickChaosDraftBattleDeckReset - }, - { - VariationType.BeginCreateDeck, - ApiType.Type.OpenRoom2PickChaosDraftBattleBeginCreateDeck - }, - { - VariationType.SelectClass, - ApiType.Type.OpenRoom2PickChaosDraftBattleSelectClass - }, - { - VariationType.SelectCardSet, - ApiType.Type.OpenRoom2PickChaosDraftBattleSelectCard - } - }; - - public static ApiType.Type GetApiType(TwoPickFormat twoPickFormat, RoomConnectController.BattleRule rule, VariationType type) - { - Dictionary dictionary = NormalApiTypes; - switch (twoPickFormat) - { - case TwoPickFormat.Backdraft: - dictionary = BackdraftApiTypes; - break; - case TwoPickFormat.BackdraftCube: - dictionary = BackDraftCubeApiTypes; - break; - case TwoPickFormat.BackdraftChaos: - dictionary = BackdraftChaosApiTypes; - break; - case TwoPickFormat.Cube: - dictionary = ((rule != RoomConnectController.BattleRule.Bo3 && rule != RoomConnectController.BattleRule.Bo5) ? CubeApiTypes : MultiCubeApiTypes); - break; - case TwoPickFormat.Chaos: - dictionary = ((rule != RoomConnectController.BattleRule.Bo3 && rule != RoomConnectController.BattleRule.Bo5) ? ChaosApiTypes : MultiChaosApiTypes); - break; - default: - if (rule == RoomConnectController.BattleRule.Bo3 || rule == RoomConnectController.BattleRule.Bo5) - { - dictionary = MultiApiTypes; - } - break; - } - return dictionary[type]; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickMultiDeckInfo.cs b/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickMultiDeckInfo.cs index 821c8724..457df0b8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickMultiDeckInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RoomTwoPickMultiDeckInfo.cs @@ -49,40 +49,4 @@ public class RoomTwoPickMultiDeckInfo _isWin = ConvertValue.ToInt(data["isWin"]) == 1; } } - - public DeckResultInfo[] DeckList { get; private set; } - - public void Reset() - { - DeckList = null; - } - - public void SetDeckList(JsonData data) - { - if (data == null || !data.IsObject) - { - return; - } - ICollection keys = data.Keys; - DeckResultInfo[] array = new DeckResultInfo[keys.Count]; - foreach (string item in keys) - { - JsonData jsonData = data[item]; - int num = ConvertValue.ToInt(jsonData["entry_no"]); - array[num - 1] = new DeckResultInfo(jsonData); - } - DeckList = array; - } - - public void SetDeckList(Dictionary data) - { - List list = data["ownerList"] as List; - DeckResultInfo[] array = new DeckResultInfo[list.Count]; - for (int i = 0; i < list.Count; i++) - { - Dictionary data2 = list[i] as Dictionary; - array[i] = new DeckResultInfo(data2); - } - DeckList = array; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/RotationFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/RotationFormatBehavior.cs index def90bd5..8493d9a5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RotationFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RotationFormatBehavior.cs @@ -60,7 +60,7 @@ public class RotationFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsConventionMode => false; @@ -71,21 +71,21 @@ public class RotationFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/RubyText.cs b/SVSim.BattleEngine/Engine/Wizard/RubyText.cs index ea919cfa..201b8de8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/RubyText.cs +++ b/SVSim.BattleEngine/Engine/Wizard/RubyText.cs @@ -8,19 +8,8 @@ public static class RubyText { private enum eSubscriptMode { - NORMAL, - SUBSCRIPT, - SUPERSCRIPT, - RUBYSTART, - RUBYEND } - private const string rubStartStr = "[rub<"; - - private const string rubEndStr = ">]"; - - private const string rubTagEndStr = "[/rub]"; - private static Color mInvisible = new Color(0f, 0f, 0f, 0f); private static float mAlpha = 1f; @@ -42,26 +31,6 @@ public static class RubyText return true; } - public static string ReplaceDotTagToRubyTag(string text) - { - return Regex.Replace(text, "(\\[dot\\])(.+?)(\\[\\/dot\\])", (Match m) => ConvertRubyTagForDotText(m.Groups[2].Value)); - } - - public static string RemoveRubyTag(string text) - { - return Regex.Replace(Regex.Replace(text, "\\[rub<.*?>\\]", ""), "\\[/rub\\]", ""); - } - - private static string ConvertRubyTagForDotText(string text) - { - StringBuilder stringBuilder = new StringBuilder(); - foreach (char c in text) - { - stringBuilder.Append($"[rub<・>]{c}[/rub]"); - } - return stringBuilder.ToString(); - } - public static bool ParseSymbol(string text, ref int index, BetterList colors, bool premultiply, ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike, ref bool ignoreColor) { float rubyTotalAdvanceRaw = 0f; diff --git a/SVSim.BattleEngine/Engine/Wizard/ScenarioPart.cs b/SVSim.BattleEngine/Engine/Wizard/ScenarioPart.cs deleted file mode 100644 index 7e3d11b9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ScenarioPart.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Wizard; - -public enum ScenarioPart -{ - None, - FirstHalf, - SecondHalf -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ScenarioSummary.cs b/SVSim.BattleEngine/Engine/Wizard/ScenarioSummary.cs index d4643eb8..c19b7a3f 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ScenarioSummary.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ScenarioSummary.cs @@ -30,8 +30,6 @@ public class ScenarioSummary } } - private const string FILE_NAME_PREFIX = "scenario_text_summary_"; - private static readonly int CLASS_NONE; private Dictionary _dataTable = new Dictionary(); diff --git a/SVSim.BattleEngine/Engine/Wizard/SceneTransition.cs b/SVSim.BattleEngine/Engine/Wizard/SceneTransition.cs index 98f1e7df..83ff3e25 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SceneTransition.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SceneTransition.cs @@ -23,34 +23,6 @@ public class SceneTransition } } - public const string ARENA = "arena"; - - public const string CHALLENGE = "2pick"; - - private const string SUPPLY = "supplies"; - - private const string BUY_CARD = "buy_cards"; - - public const string LEADER_SKIN = "leader_skin"; - - public const string DECK_PACK = "deck_pack"; - - public const string CARD_PACK = "card_pack"; - - private const string SLEEVE = "sleeve"; - - public const string COLOSSEUM = "colosseum"; - - private const string QUEST = "quest"; - - private const string STORY_SECTION_SELECT = "story_section_select"; - - private const string LIMITED_STORY = "limited_story"; - - private const string MYPAGE_BG = "mypage_bg"; - - private const string FREE_MATCH = "free_match"; - private static readonly Dictionary _transitionDictScene = new Dictionary { { @@ -241,11 +213,6 @@ public class SceneTransition } } - public static string GetTransitionText(string key) - { - return Data.SystemText.Get(_transitionDictScene[key].textId); - } - public static bool HasTransitionData(string s) { return _transitionDictScene.ContainsKey(s); @@ -261,7 +228,7 @@ public class SceneTransition private static void GoToMission(int status) { - MissionInfoTask missionInfoTask = GameMgr.GetIns().GetMissionInfoTask(); + MissionInfoTask missionInfoTask = null; // Pre-Phase-5b: headless has no MissionInfoTask missionInfoTask.SetParameter(); UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(missionInfoTask, delegate { @@ -368,10 +335,7 @@ public class SceneTransition } if (data.Scene == UIManager.ViewScene.StorySelectPage) { - if (data.Status.HasValue) - { - StorySelectPage.SelectSectionId = data.Status.Value; - } + // StorySelectPage removed (DEAD-COLD engine cleanup Task 12) } else if (data.Scene == UIManager.ViewScene.StorySelectionWorld && data.Status.HasValue) { @@ -404,7 +368,7 @@ public class SceneTransition } param.IsUpdateFooterMenuTexture = true; }; - GameMgr.GetIns().GetBattleCtrl().BattleEnd(data.Scene, null, paramCustomize); + /* Pre-Phase-5b: BattleCtrl.BattleEnd dropped (BattleControl stubbed chunk 7) */ } else { diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedBattleDoMatchingTask.cs b/SVSim.BattleEngine/Engine/Wizard/SealedBattleDoMatchingTask.cs deleted file mode 100644 index e1ccc750..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SealedBattleDoMatchingTask.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Wizard; - -public class SealedBattleDoMatchingTask : DoMatchingBase -{ - public SealedBattleDoMatchingTask(int deckNo, int needInit, int log) - { - base.type = ApiType.Type.ArenaSealedBattleDoMatching; - base.SetParameter(deckNo, needInit, log); - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - SettingDoMatchingData(); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedBattleFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/SealedBattleFinishTask.cs deleted file mode 100644 index eb50ba9f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SealedBattleFinishTask.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Wizard.Scripts.Network.Data.TaskData.Arena; - -namespace Wizard; - -public class SealedBattleFinishTask : FinishTaskBase -{ - public SealedBattleFinishTask() - { - base.type = ApiType.Type.ArenaSealedBattleFinish; - Data.ArenaBattleFinish = null; - } - - protected override int Parse() - { - int num = base.Parse(); - if (IsEffectiveErrorCode(num)) - { - return num; - } - Finish finish = (Data.ArenaBattleFinish = new Finish()); - if (!IsResponseDataExist(base.ResponseData)) - { - return num; - } - new BattleFinishResponsProcessing().Processing(base.ResponseData, finish.data); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelect.cs b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelect.cs index 08f9c4ec..4b0cd475 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelect.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelect.cs @@ -28,12 +28,6 @@ public class SealedClassSelect : MonoBehaviour private readonly Dictionary> _cardObjectsDic = new Dictionary>(); - private const float CARD_SCALE = 0.64f; - - private const float CARD_COLLIDER_SCALE = 0.85f; - - private const int CARD_DEPTH_ADD_VALUE = 5; - private CardDetailUI _cardDetailDialog; private List _cardDetailCardObjectList; @@ -80,11 +74,11 @@ public class SealedClassSelect : MonoBehaviour int classId = classInfo.ClassId; SealedClassSelectObjectInitParam initParam = new SealedClassSelectObjectInitParam { - CharaParam = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(classId), + CharaParam = null, // Pre-Phase-5b: no chara master headless CardObjectList = _cardObjectsDic[classId], SelectButtonClickCallback = delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OnSelectClass(classId); }, EffectRoot = _effectsRoot, @@ -148,7 +142,7 @@ public class SealedClassSelect : MonoBehaviour private void OnSelectClass(int classId) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OpenClassSelectConfirmDialog(classId); } @@ -176,8 +170,8 @@ public class SealedClassSelect : MonoBehaviour { decideClassFunc(SealedController.GoToSealedCardPackOpen); }; - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; - dialogBase.ClickSe_Btn3 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + dialogBase.ClickSe_Btn1 = 0; + dialogBase.ClickSe_Btn3 = 0; SealedClassSelectConfirmDialog component = UnityEngine.Object.Instantiate(_classSelectConfirmDialogPrefab.gameObject).GetComponent(); component.Init(classId, SealedData.ClassInfoList.Find((SealedClassInfo x) => x.ClassId == classId).PublishedCardInfoList.Select((SealedCardInfo x) => x.SealedCardId).ToList()); dialogBase.SetObj(component.gameObject); @@ -195,7 +189,7 @@ public class SealedClassSelect : MonoBehaviour int num = _cardDetailCardIndex + ((!(x > 0f)) ? 1 : (-1)); if (num >= 0 && _cardDetailCardObjectList.Count > num) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + _cardDetailDialog.CloseDefault(playSe: false); _cardDetailDialog.ShowCardDetail(_cardDetailCardObjectList[num].gameObject); _cardDetailCardIndex = num; diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectConfirmDialog.cs index 6a6a4817..f008f3d8 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectConfirmDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectConfirmDialog.cs @@ -18,7 +18,7 @@ public class SealedClassSelectConfirmDialog : MonoBehaviour public void Init(int classId, List cardList) { - _classInfoParts.InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(classId)); + _classInfoParts.InitByCharaPrm(null); // Pre-Phase-5b: no chara master headless _cardListLabel.text = string.Empty; for (int i = 0; i < cardList.Count; i++) { @@ -40,7 +40,7 @@ public class SealedClassSelectConfirmDialog : MonoBehaviour return; } bool value = _cardAutoOpenToggleButton.value; - GameMgr.GetIns().GetSoundMgr().PlaySe(value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.CARDPACK_CARD_AUTO_OPEN, value); } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObject.cs b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObject.cs index fd43189c..4d50451e 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObject.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObject.cs @@ -21,10 +21,6 @@ public class SealedClassSelectObject : MonoBehaviour [SerializeField] private UITexture _effectMask; - private const ResourcesManager.AssetLoadPathType CHARA_TEX_LOAD_TYPE = ResourcesManager.AssetLoadPathType.ClassCharaBase; - - private const int EFFECT_SORTING_ORDER = 2; - private readonly eColorCodeId[] EFFECT_COLORCODEID_TABLE = new eColorCodeId[9] { eColorCodeId.MAX, @@ -102,7 +98,7 @@ public class SealedClassSelectObject : MonoBehaviour obj.sortingOrder = 2; obj.material = new Material(obj.material); } - GameMgr.GetIns().GetEffectMgr().ChangeMaskShader(_effect.gameObject, stencil); + /* Pre-Phase-5b: ChangeMaskShader dropped */ } private void InitEffectMask(int stencil) diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObjectInitParam.cs b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObjectInitParam.cs index 1ac51128..a71225cb 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObjectInitParam.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedClassSelectObjectInitParam.cs @@ -15,16 +15,4 @@ public class SealedClassSelectObjectInitParam public GameObject EffectRoot { get; set; } public List UnloadAssetList { get; set; } - - public bool IsValid - { - get - { - if (CharaParam != null && CardObjectList != null && SelectButtonClickCallback != null && EffectRoot != null) - { - return UnloadAssetList != null; - } - return false; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedController.cs b/SVSim.BattleEngine/Engine/Wizard/SealedController.cs index c6ffd0f0..121b51ef 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedController.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedController.cs @@ -12,9 +12,7 @@ public class SealedController : UIBase { None, ClassSelect, - Lobby, - Max - } + Lobby } [SerializeField] private UISprite _bgMask; diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedData.cs b/SVSim.BattleEngine/Engine/Wizard/SealedData.cs index c7387a37..254f258d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedData.cs @@ -7,19 +7,6 @@ namespace Wizard; public class SealedData { - private const int ACQUIRED_NORMAL_CARDID_END = 6; - - private const int ACQUIRED_PREMIUM_CARDID_END = 7; - - private const int PHANTOM_NORMAL_CARDID_END = 8; - - private const int PHANTOM_PREMIUM_CARDID_END = 9; - - public const int PHANTOM_CARD_SLEEVE_ID = 5070001; - - public const int GACHA_RESOURCE_ID = 70; - - public const GenerateDeckCodeTask.SubmitDeckType DECK_CODE_TYPE = GenerateDeckCodeTask.SubmitDeckType.SEALED; private List _registeredSealedCardInfoList = new List(); @@ -65,8 +52,6 @@ public class SealedData public bool? IsCompletedDeck { get; private set; } - public bool RegisteredSealedCardExists => _registeredSealedCardInfoList.Count > 0; - public bool IsSpecialEffect { get; private set; } public void SetEntryInfo(JsonData rootData) @@ -85,8 +70,7 @@ public class SealedData if (jsonData2 != null) { SelectedClassId = jsonData2.ToInt(); - GameMgr.GetIns().GetDataMgr().GetClassPrm(SelectedClassId.Value) - .SetCurrentCharaId(jsonData["leader_skin_id"].ToInt()); + // Pre-Phase-5b: dropped class-prm chara-id write; headless has no class prm map. } } } @@ -187,7 +171,7 @@ public class SealedData list.ForEach(RegisterSealedCard); list.ForEach(delegate(SealedCardInfo info) { - GameMgr.GetIns().GetDataMgr().SetIsNewCard(info.OriginalCardId, isNew: false); + // Pre-Phase-5b: SetIsNewCard write dropped; headless has no user card state. }); } list.Sort(delegate(SealedCardInfo a, SealedCardInfo b) @@ -283,17 +267,13 @@ public class SealedData private void RegisterSealedCard(SealedCardInfo cardInfo) { CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); int sealedCardId = cardInfo.SealedCardId; int originalCardId = cardInfo.OriginalCardId; _registeredSealedCardInfoList.Add(cardInfo); CardParameter cardParam = instance.GetCardParameterFromId(originalCardId).Clone(sealedCardId); - if (!cardInfo.IsPhantom) - { - dataMgr.SetIsNewCard(sealedCardId, dataMgr.IsNewCard(originalCardId)); - } + // Pre-Phase-5b: DataMgr.SetIsNewCard + RegisterUserOwnCardData dropped; headless has + // no user card state to update. instance.RegisterCardParameter(sealedCardId, cardParam); - dataMgr.RegisterUserOwnCardData(sealedCardId, cardInfo.OwnNum); RegisterSealedCardInAllCardIdList(sealedCardId); } @@ -326,9 +306,8 @@ public class SealedData private void UnregisterSealedCard(int sealedCardId) { _registeredSealedCardInfoList.RemoveAll((SealedCardInfo x) => x.SealedCardId == sealedCardId); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); CardMaster.GetInstance(CardMaster.CardMasterId.Default).UnregisterCardParameter(sealedCardId); - dataMgr.UnregisterUserOwnCardData(sealedCardId); + // Pre-Phase-5b: DataMgr.UnregisterUserOwnCardData dropped; headless has no user card state. CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetAllCardIds().Remove(sealedCardId); } @@ -340,11 +319,6 @@ public class SealedData return originalCardId / 10 * 10 + num; } - private static int? ConvertToOriginalCardId(int sealedCardId) - { - return Data.ArenaData.SealedData.GetSealedCardInfo(sealedCardId)?.OriginalCardId; - } - public static bool IsPhantomCard(int cardId) { return Data.ArenaData.SealedData.GetSealedCardInfo(cardId)?.IsPhantom ?? false; diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/SealedFormatBehavior.cs index c66b737e..61b1fed9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedFormatBehavior.cs @@ -120,11 +120,11 @@ public class SealedFormatBehavior : IFormatBehavior public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedGetMaintCardListTask.cs b/SVSim.BattleEngine/Engine/Wizard/SealedGetMaintCardListTask.cs index 428198ec..11ffc029 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedGetMaintCardListTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedGetMaintCardListTask.cs @@ -27,7 +27,7 @@ public class SealedGetMaintCardListTask : BaseTask array[num2++] = SealedData.ConvertToSealedCardId(num3, isPhantomCard: false); array[num2++] = SealedData.ConvertToSealedCardId(num3, isPhantomCard: true); } - GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(array); + /* Pre-Phase-5b: SetMaintenanceCardIds dropped */ return num; } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedLobby.cs b/SVSim.BattleEngine/Engine/Wizard/SealedLobby.cs index 06cd19b6..26c3e596 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedLobby.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedLobby.cs @@ -36,8 +36,6 @@ public class SealedLobby : MonoBehaviour [SerializeField] private CardSelectDialog _cardSelectDialogPrefab; - private const int BATTLE_MAX_NUM = 5; - private List _unloadAssetList = new List(); private ArenaCommonLobby _commonLobby; @@ -75,7 +73,7 @@ public class SealedLobby : MonoBehaviour bool flag2 = !SealedData.IsCompletedDeck.Value && !flag; _commonLobby.SetDecisionButtonToDark(flag2); UIManager.SetObjectToGrey(_deckCodeGenerateButton.gameObject, flag2); - _incompleteDeckIcon.gameObject.SetActive(flag2 || SealedData.DeckData.GetCardIdList().Any((int id) => GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(id))); + _incompleteDeckIcon.gameObject.SetActive(flag2 || false /* Pre-Phase-5b: headless has no maintenance card list */); } public void Final() @@ -89,13 +87,13 @@ public class SealedLobby : MonoBehaviour private void OnClickDeckEditButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + SealedController.GoToSealedDeckEdit(); } private void OnClickDeckViewButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + StartCoroutine(OpenDeckViewerDialogCoroutine()); } @@ -127,19 +125,19 @@ public class SealedLobby : MonoBehaviour private void OnClickDeckCodeGenerateButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ArenaCommonLobby.GenerateDeckCode(GenerateDeckCodeTask.SubmitDeckType.SEALED, SealedData.SelectedClassId.Value, SealedData.DeckOriginalExcludedPhantomCardList, SealedData.DeckOriginalPhantomCardList); } private void OnClickStageSelectButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + DialogCreator.CreateStageSelectDialog(); } private void OnClickRetireButton(GameObject g) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + ArenaCommonLobby.OpenRetireConfirmDialog().onPushButton1 = delegate { StartCoroutine(Toolbox.NetworkManager.Connect(new SealedRetireTask(), delegate @@ -151,20 +149,17 @@ public class SealedLobby : MonoBehaviour private void OnClickBattleButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + // Pre-Phase-5b: DataMgr writes for sealed-mode deck selection (battle type, deck id, + // chara/deck data). Purely UI-driven pre-battle setup; headless never runs this + // coroutine, and Data.CurrentFormat / UIManager view change are the only observable + // outputs the surviving caller cares about. Data.CurrentFormat = Format.Sealed; - dataMgr.m_BattleType = DataMgr.BattleType.Sealed; - dataMgr.SetSelectDeckId(SealedData.EntryId.Value); - dataMgr.LastSelectDeckAttributeType = DeckAttributeType.Invalid; - dataMgr.SetPlayerCharaIdByClassId(SealedData.SelectedClassId.Value); - dataMgr.SetCurrentDeckData(SealedData.SortedDeckOriginalCardList); UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.RankMatch); } private void OnClickRewardReceiveButton() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + StartCoroutine(Toolbox.NetworkManager.Connect(new SealedFinishTask(), delegate { ReceiveReward(); @@ -174,11 +169,11 @@ public class SealedLobby : MonoBehaviour private void ReceiveReward() { _commonLobby.ClickProtectionCollider.gameObject.SetActive(value: true); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = false; + // Pre-Phase-5b: headless has no InputMgr _commonLobby.TreasureBoxInfo.OpenBox(delegate { _commonLobby.ClickProtectionCollider.gameObject.SetActive(value: false); - GameMgr.GetIns().GetInputMgr().isBackKeyEnable = true; + // Pre-Phase-5b: headless has no InputMgr if (SealedData.RewardCardCandidates.Count <= 0) { OpenRewardReceiveDialog(); @@ -194,7 +189,7 @@ public class SealedLobby : MonoBehaviour { DialogBase dialogBase = DialogCreator.CreateRewardReceiveDialog(SealedData.RewardList); dialogBase.SetLayer("Loading"); - dialogBase.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS; + dialogBase.ClickSe_Btn1 = 0; dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate { UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage); @@ -220,7 +215,7 @@ public class SealedLobby : MonoBehaviour CardSelectDialog dialogObject = NGUITools.AddChild(dialog.gameObject, _cardSelectDialogPrefab.gameObject).GetComponent(); dialogObject.Init(SealedData.RewardCardCandidates, delegate(int cardId) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OpenCardSelectConfirmDialog(dialog, cardId); }, systemText.Get("Sealed_RewardCardSelect_0002")); while (!dialogObject.IsReady) diff --git a/SVSim.BattleEngine/Engine/Wizard/SealedUpdateDeckTask.cs b/SVSim.BattleEngine/Engine/Wizard/SealedUpdateDeckTask.cs index ecfa5df7..91e1d7ea 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SealedUpdateDeckTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SealedUpdateDeckTask.cs @@ -7,9 +7,6 @@ public class SealedUpdateDeckTask : BaseTask { private enum eArrayIndex { - AcquiredCard, - PhantomCard, - Max } public class Param : BaseParam diff --git a/SVSim.BattleEngine/Engine/Wizard/SecretBossDeckConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SecretBossDeckConfirmDialog.cs deleted file mode 100644 index 4033b21d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SecretBossDeckConfirmDialog.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class SecretBossDeckConfirmDialog : MonoBehaviour -{ - private const int DIALOG_PANEL_DEPTH = 50; - - private const float GRID_CARD_SCALE = 0.97f; - - private const int GRID_CARD_DEPTH = 5; - - public const string LAYER_NAME = "MyPage"; - - [SerializeField] - private UIGrid _cardGrid; - - [SerializeField] - private CardImageHelpder _cardLoader; - - [SerializeField] - private DeckViewHelper _deckViewHelper; - - [SerializeField] - private UILabel _deckNameLabel; - - [SerializeField] - private UIButton _buttonOriginal; - - private List _loadPathList = new List(); - - private DeckData _deck; - - private List _abilityList; - - private bool _isBattleAgain; - - public static void Create(DeckData deck, List abilityList, bool isBattleAgain) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Common_0021")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Common_0004"), Data.SystemText.Get("Card_0210")); - dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_DECIDE; - dialogBase.isNotCloseWindowButton2 = true; - GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/BossRush/SecretBossDeckConfirmDialog")) as GameObject; - dialogBase.SetObj(gameObject); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(50); - gameObject.GetComponent().Initialize(dialogBase, deck, abilityList, isBattleAgain); - } - - private void Initialize(DialogBase dialog, DeckData deck, List abilityList, bool isBattleAgain) - { - _deck = deck; - _abilityList = abilityList; - _isBattleAgain = isBattleAgain; - CardMaster instance = CardMaster.GetInstance(CardMaster.CardMasterId.Default); - List cardIdLIst = new List(); - foreach (BossRushLobbyAbilityData ability in abilityList) - { - CardParameter cardParameterFromId = instance.GetCardParameterFromId(ability.DisplayCardId); - if (ability.IsFoil) - { - cardIdLIst.Add(cardParameterFromId.FoilCardId); - } - else - { - cardIdLIst.Add(ability.DisplayCardId); - } - } - _deckNameLabel.text = deck.GetDeckName(); - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadResources(cardIdLIst, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - InitializeCardList(cardIdLIst); - InitializeDeckView(); - dialog.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; - dialog.onPushButton1 = delegate - { - OnClickOkButton(); - }; - dialog.onPushButton2 = delegate - { - OnClickDeckViewButton(); - }; - })); - } - - private void InitializeDeckView() - { - _deckViewHelper.Initialize(); - _deckViewHelper.UICardList.SetEnableBlueButton(isEnable: true, Data.SystemText.Get("BossRush_0038"), delegate - { - OnClickAbilityView(); - }); - _deckViewHelper.SetEnableDeckShareButton(enable: false); - } - - private void OnClickAbilityView() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - BossRushLobbyAbilityDetailDialog.Create(_abilityList, _abilityList.Count); - } - - private void OnClickDeckViewButton() - { - _deckViewHelper.ShowDeckView(_deck); - } - - private IEnumerator LoadResources(List cardNoList, Action onFinish) - { - if (_isBattleAgain) - { - _loadPathList.Add(UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.BossRush)); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadPathList, null)); - UIManager.GetInstance().AddResidentAtlas(UIAtlasManager.AssetBundleNames.BossRush); - } - float cardScale = 0.97f; - int depth = 5; - bool finish = false; - _cardLoader.Load(cardNoList, cardScale, depth, CardTemplateCustomize, delegate - { - finish = true; - }); - while (!finish) - { - yield return null; - } - onFinish.Call(); - } - - private void OnDestroy() - { - if (_isBattleAgain) - { - UIManager.GetInstance().RemoveResidentAtlas(UIAtlasManager.AssetBundleNames.BossRush); - } - Toolbox.ResourcesManager.RemoveAssetGroup(_loadPathList); - _loadPathList.Clear(); - } - - private void CardTemplateCustomize(CardListTemplate cardTemplate) - { - cardTemplate.SetBossRushSkillFrame(); - cardTemplate.HideNum(); - cardTemplate.HideLabelsForBossRushSkill(); - cardTemplate.SetBossRushCardTexture(); - } - - private void InitializeCardList(List cardNoList) - { - for (int i = 0; i < cardNoList.Count; i++) - { - BossRushLobbyAbilityData ability = _abilityList[i]; - UIButton component = NGUITools.AddChild(_cardGrid.gameObject, _buttonOriginal.gameObject).GetComponent(); - UIEventListener.Get(component.gameObject).onClick = delegate - { - OnClickCard(ability); - }; - GameObject cardObj = _cardLoader.GetCardObjData(i).CardObj; - Vector3 localScale = cardObj.transform.localScale; - cardObj.transform.parent = component.transform; - cardObj.transform.localPosition = Vector3.zero; - cardObj.transform.localScale = localScale; - } - _cardGrid.Reposition(); - } - - private void OnClickCard(BossRushLobbyAbilityData selectAbility) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - BossRushLobbyAbilityDetailDialog.Create(_abilityList, _abilityList.Count, selectAbility); - } - - private void OnClickOkButton() - { - BossRushHiddenBattleStartTask battleStartTask = new BossRushHiddenBattleStartTask(_deck, _abilityList); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(battleStartTask, delegate - { - MoveBattle(battleStartTask); - })); - } - - private void MoveBattle(BossRushHiddenBattleStartTask battleStartTask) - { - StoryAISettingData settingData = Data.Master.QuestAISettingList.GetSettingData(battleStartTask.QuestBossData.AI); - GameMgr.GetIns().GetSoundMgr().StopAllBGM(0.5f); - UIManager.GetInstance().CreatFadeClose(delegate - { - BattleCleanIfNeed(delegate - { - Data.Master.LoadAICsv(new AICsvLoadingInfo(settingData.DeckId, settingData.StyleId, settingData.EmoteId), delegate - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - dataMgr.SetCurrentEnemyDeckDataFromAIDeck(dataMgr.GetEnemyClassId(), -1, settingData.LogicLevel, battleStartTask.QuestBossData.Life, settingData.DeckId, settingData.StyleId, settingData.EmoteId, settingData.UseInnerEmote, settingData.EnemyAiId, battleStartTask.PlayerSkillList.Select((BossRushSpecialSkill s) => s.OriginalCardId).ToList()); - dataMgr.LoadEnemy(); - UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam - { - IsFadeout = false, - IsShow_CardIntroduction = true - }; - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.Battle, param); - }); - }); - }); - } - - private void BattleCleanIfNeed(Action onFinish) - { - if (!_isBattleAgain) - { - onFinish.Call(); - return; - } - UIManager.GetInstance().StartCoroutine(BattleManagerBase.GetIns().GetBattleControl().BattleEnd(delegate - { - onFinish(); - })); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SelectBuyNumPopupBase.cs b/SVSim.BattleEngine/Engine/Wizard/SelectBuyNumPopupBase.cs index 97e7b446..7799a8bd 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SelectBuyNumPopupBase.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SelectBuyNumPopupBase.cs @@ -5,22 +5,6 @@ namespace Wizard; public class SelectBuyNumPopupBase : UIBase { - private const int DEFAULT_BUY_NUM = 1; - - protected const string BUY_BTN_OFF_CRYSTAL_SPRITE = "btn_input_03_off"; - - protected const string BUY_BTN_ON_CRYSTAL_SPRITE = "btn_input_03_on"; - - protected const string BUY_BTN_OFF_TICKET_SPRITE = "btn_input_04_off"; - - protected const string BUY_BTN_ON_TICKET_SPRITE = "btn_input_04_on"; - - protected const string BUY_BTN_OFF_RUPY_SPRITE = "btn_input_01_off"; - - protected const string BUY_BTN_ON_RUPY_SPRITE = "btn_input_01_on"; - - [SerializeField] - protected float PRESS_TIME_FOR_CHANGE_NUM = 0.4f; [SerializeField] protected UITexture _PackLogo; @@ -111,7 +95,7 @@ public class SelectBuyNumPopupBase : UIBase } else { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } _timePressingPlusBtn = 0f; _isChangedNum = false; @@ -129,41 +113,12 @@ public class SelectBuyNumPopupBase : UIBase } else { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } _timePressingMinusBtn = 0f; _isChangedNum = false; } - protected void Update() - { - if (_isPressingPlusBtn) - { - if (!_isPressingMinusBtn) - { - _timePressingPlusBtn += Time.deltaTime; - if (_timePressingPlusBtn >= PRESS_TIME_FOR_CHANGE_NUM) - { - _timePressingPlusBtn = 0f; - _isChangedNum = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BAR_SLIDE); - PlusBuyNum(); - } - } - } - else if (_isPressingMinusBtn && !_isPressingPlusBtn) - { - _timePressingMinusBtn += Time.deltaTime; - if (_timePressingMinusBtn >= PRESS_TIME_FOR_CHANGE_NUM) - { - _timePressingMinusBtn = 0f; - _isChangedNum = true; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BAR_SLIDE); - MinusBuyNum(); - } - } - } - protected void PlusBuyNum() { if (_buyNum < _ableBuyNum) @@ -206,14 +161,14 @@ public class SelectBuyNumPopupBase : UIBase protected void OnBtnPurchase(Action OnClickPurchase, PackConfig packConfig, PackChildGachaInfo gachaInfo) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + OnClickPurchase(packConfig, gachaInfo, _buyNum); _dialog.CloseWithoutSelect(); } protected void OnBtnMax() { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + _buyNum = _ableBuyNum; UpdateBuyNumDisplays(); } diff --git a/SVSim.BattleEngine/Engine/Wizard/SelectCardPurchaseConfirmDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SelectCardPurchaseConfirmDialog.cs index cd8c7e4a..ef636cee 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SelectCardPurchaseConfirmDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SelectCardPurchaseConfirmDialog.cs @@ -7,9 +7,6 @@ namespace Wizard; public class SelectCardPurchaseConfirmDialog : MonoBehaviour { - private const int SKIN_WARNING_LINE_BOTTOM_ANCHOR_ABSOLUTE = -43; - - private const int SKIN_WARNING_LINE_TOP_ANCHOR_ABSOLUTE = -35; [SerializeField] private UIScrollView _scrollView; @@ -53,7 +50,7 @@ public class SelectCardPurchaseConfirmDialog : MonoBehaviour _dialog.SetSize(DialogBase.Size.M); _dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); _dialog.SetButtonText(Data.SystemText.Get("Shop_0082")); - _dialog.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + _dialog.ClickSe_Btn1 = 0; _dialog.SetButtonDelegate(delegate { onDecide(); diff --git a/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinButton.cs b/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinButton.cs index 17899ef2..841cd018 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinButton.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinButton.cs @@ -22,7 +22,7 @@ public class SelectRandomSkinButton : MonoBehaviour UIEventListener.Get(_button.gameObject).onClick = delegate { bool flag = !_isSelectStatus; - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + SetSelectStatus(flag); onClick(skinId, flag); }; diff --git a/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinDialog.cs index ab586707..99f8312c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SelectRandomSkinDialog.cs @@ -9,9 +9,6 @@ namespace Wizard; public class SelectRandomSkinDialog : MonoBehaviour { - private const int ITEM_NUM_PAR_PAGE = 21; - - private const float FLICK_MARGIN = 70f; [SerializeField] private UIGrid _itemGrid; @@ -105,15 +102,6 @@ public class SelectRandomSkinDialog : MonoBehaviour onFinish.Call(); } - private void OnDestroy() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - private void GenerateSkinButtons(List usableSkinIdList, List selectedSkinIdList) { _usableSkinIdList = usableSkinIdList; @@ -173,7 +161,7 @@ public class SelectRandomSkinDialog : MonoBehaviour _btnAllOff.onClick.Clear(); _btnAllOff.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + OnClickAllOffButton(); })); UpdateAllButton(); @@ -238,7 +226,7 @@ public class SelectRandomSkinDialog : MonoBehaviour { if (!IsFirstPage) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + ShowPage(_currentPageIndex - 1); } } @@ -247,7 +235,7 @@ public class SelectRandomSkinDialog : MonoBehaviour { if (!IsLastPage) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + ShowPage(_currentPageIndex + 1); } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardDialog.cs index 94170de2..7a311616 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardDialog.cs @@ -10,15 +10,6 @@ namespace Wizard; public class SelectSkinCardDialog : MonoBehaviour { - private const int DIALOG_DEPTH = 900; - - private const int DIALOG_SORTING_ORDER = 37; - - private const int CARD_OBJECT_DEPTH = 20; - - private const float CARD_OBJECT_SCALE = 0.36f; - - private const float CARD_OBJECT_COLLIDER_SCALE = 0.9f; [SerializeField] private SimpleScrollViewUI _cardListScrollView; @@ -62,8 +53,6 @@ public class SelectSkinCardDialog : MonoBehaviour private Action _onClickAcquireButton; - private const int TAB_POS_Y_BY_ACQUIRE_SKIN_CARD_PACK = -255; - public static void Create(Dictionary> selectSkinCardListInClassDic, Action> onClickOk, bool isDefaultExclude, bool isAcquireSkinCardPack, Action onClickAcquireButton) { DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); @@ -89,7 +78,7 @@ public class SelectSkinCardDialog : MonoBehaviour InitializeSelectSkinCardState(isDefaultExclude); _btnExclude.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + ExcludeSkinCardAlreadyHave(); })); } @@ -139,18 +128,6 @@ public class SelectSkinCardDialog : MonoBehaviour _atlasProfile = Toolbox.ResourcesManager.LoadObject(profileAtlasName).GetComponent(); } - private void UnloadResources() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - - private void OnDestroy() - { - UnloadResources(); - UnloadCardObject(); - } - private void InitCardDetail() { _cardDetail = DialogCreator.CreateCardDetailDialog(_cardDetailRoot, "Detail"); @@ -171,7 +148,7 @@ public class SelectSkinCardDialog : MonoBehaviour int num = _cardDetailIndex + ((!(x > 0f)) ? 1 : (-1)); if (num >= 0 && _cardObjectList.Count > num) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); + _cardDetail.CloseDefault(playSe: false); _cardDetail.ShowCardDetail(_cardObjectList[num].CardObj); _cardDetailIndex = num; diff --git a/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardPlate.cs b/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardPlate.cs index ba8a06c5..67d18501 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardPlate.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SelectSkinCardPlate.cs @@ -10,8 +10,6 @@ public class SelectSkinCardPlate : MonoBehaviour { private readonly Quaternion CARDOBJECT_ROTATION_QUATERNION = new Quaternion(0f, 0f, 0f, 0f); - private const string SPOT_CARD_NUM_FORMAT = "[fcd24a]+{0}[-]"; - [SerializeField] private GameObject _objCardRoot; @@ -57,7 +55,7 @@ public class SelectSkinCardPlate : MonoBehaviour { _skinCardInfo = skinCardInfo; _labelCardName.text = UserGoods.getUserGoodsName(UserGoods.Type.Card, _skinCardInfo.CardId); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); + DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr int possessionCardNum = dataMgr.GetPossessionCardNum(_skinCardInfo.CardId, isIncludingSpotCard: false); int spotCardNum = dataMgr.SpotCardData.GetSpotCardNum(_skinCardInfo.CardId); _labelCardPossessionNumNormal.text = possessionCardNum + ((spotCardNum > 0) ? $"[fcd24a]+{spotCardNum}[-]" : string.Empty); @@ -74,7 +72,7 @@ public class SelectSkinCardPlate : MonoBehaviour _buttonAcquire.onClick.Clear(); _buttonAcquire.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); + onClickAcquireButton(_skinCardInfo.CardId, _skinCardInfo.HasSkin); })); _toggleSelect.gameObject.SetActive(value: false); @@ -132,7 +130,7 @@ public class SelectSkinCardPlate : MonoBehaviour _toggleSelect.value = !selectCardStateDict[_skinCardInfo.CardId]; if (isOnClickToggle) { - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggleSelect.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + } if (_cardObject != null) { diff --git a/SVSim.BattleEngine/Engine/Wizard/SetUp.cs b/SVSim.BattleEngine/Engine/Wizard/SetUp.cs deleted file mode 100644 index d3257f24..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SetUp.cs +++ /dev/null @@ -1,261 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using Cute; -using LitJson; -using UnityEngine; -using Wizard.ErrorDialog; - -namespace Wizard; - -public class SetUp : MonoBehaviour -{ - private JsonReader defaultReader; - - private NetworkManager networkManager; - - private IEnumerator Start() - { - Object.DontDestroyOnLoad(this); - ToolboxGame.SetUp = this; - if (string.IsNullOrEmpty(Toolbox.SavedataManager.GetString("LANG_SETTING"))) - { - CustomPreference.SetTextLanguage("Eng"); - CustomPreference.SetSoundLanguage("Eng"); - } - Data.SystemText = new SystemText(); - Data.SystemText.Initialize(); - InitFrameWorkSettings(); - Data.Initialize(); - Data.SystemText.Initialize(); - Wizard.ErrorDialog.Dialog.Initialize(); - while (ToolboxGame.UIManager == null) - { - yield return 0; - } - InitGameManger(); - Toolbox.SceneManager.SceneChangeParameter.KeepAssets = true; - } - - public void InitFrameWorkSettings() - { - CustomPreference.SetScemeMode(CustomPreference.eSchemeType.Https); - CustomPreference.SetScemeModeCDN(CustomPreference.eSchemeType.Https); - CustomPreference.SetOptionalNodeSceme(); - CustomPreference.SetSignature("Shadowverse"); - CustomPreference.SetApplicationServerURL("utoongaize.shadowverse.jp/shadowverse/"); - CustomPreference.SetResourceServerURL("shadowverse.akamaized.net/"); - CustomPreference.SetNodeServerURL(""); - CustomPreference.SetDeckBuilderServerURL("shadowverse-portal.com/api/v1/game_api/"); - CustomPreference.SetLocale("Eng"); - int num = (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FRAMERATE) ? 60 : 30); - Toolbox.QualityManager.SetFrameRate(num); - Application.targetFrameRate = num; - Toolbox.DeviceManager.SetVersionName(); - Toolbox.AssetManager.AddNoUnloadAssetGroupName("card_shader_common"); - Toolbox.AssetManager.AddNoUnloadAssetGroupName("card_foil"); - Toolbox.AssetManager.AddNoUnloadAssetGroupName("effect_md_eff"); - string text = Toolbox.SavedataManager.GetString("LANG_SETTING", "Eng"); - string soundLanguage = Toolbox.SavedataManager.GetString("LANG_SOUND_SETTING", SwitchLanguage.GetDefaultVoiceLanguage(text)); - string text2 = ""; - for (int i = 0; i < AssetBundleEditorTag.categoryNameList.Length; i++) - { - if (text2 != "") - { - text2 += ","; - } - text2 += AssetBundleEditorTag.categoryNameList[i].name; - } - string[] categoryList = text2.Split(','); - Toolbox.AssetManager.SetCategoryList(categoryList); - Toolbox.AssetManager.createSavePath(); - Toolbox.AssetManager.createPackagePath(); - Toolbox.NetworkManager.NetworkUI = NetworkUI.GetInstance(); - SoftwareReset.setAction(); - CustomPreference.isPreferenceComplete = true; - CustomPreference.SetTextLanguage(text); - CustomPreference.SetSoundLanguage(soundLanguage); - SetLanguageData(); - Toolbox.NetworkManager.Certification(); - StartTitleCheckTask(); - } - - private void StartTitleCheckTask() - { - CheckSpecialTitleTask checkSpecialTitleTask = new CheckSpecialTitleTask(); - checkSpecialTitleTask.SkipAllNetworkChecks(); - StartCoroutine(Toolbox.NetworkManager.Connect(checkSpecialTitleTask, null, null, null, encrypt: true, useJson: false, showLoadingIcon: false)); - } - - public void InitGameSetting() - { - SetNetworkManager(); - WaitSetUp(); - } - - private void InitGameManger() - { - GameMgr.CreateIns(); - GameMgr.GetIns().CreateMgrIns(base.gameObject); - GameMgr.GetIns().GetSoundMgr().SetCueInfo(); - GameMgr.GetIns().GetSoundMgr().AssignSe(); - GameMgr.GetIns().GetSoundMgr().CreateBGMList(); - } - - private void WaitSetUp() - { - StartDownLoad(); - } - - private void StartDownLoad() - { - GameMgr.GetIns().GetSoundMgr().LoadBGM(Bgm.BGM_TYPE.HOME, delegate - { - StartCoroutine(LoadAssetBundles()); - }); - } - - private void errorCallBack() - { - UIManager.GetInstance().isErrorProc = false; - string titleLabel = Data.SystemText.Get("System_0020"); - if (UIManager.GetInstance().NowOpenDialog != null) - { - UIManager.GetInstance().NowOpenDialog.CloseWithoutSelect(); - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetFadeButtonEnabled(flag: false); - dialogBase.SetTitleLabel(titleLabel); - dialogBase.SetText(Data.SystemText.Get("System_0021")); - dialogBase.SetReturnMsg(UIManager.GetInstance().gameObject, "CommonResetGame"); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn); - dialogBase.SetButtonText(Data.SystemText.Get("System_0006")); - UIManager.GetInstance().isRetryProc = false; - if (UIManager.GetInstance().isErrorProc && !UIManager.GetInstance().isRetryProc) - { - SoftwareReset.exec(); - } - } - - [DllImport("CyCrypt")] - public static extern string EncodePost(string input, string opt); - - [DllImport("CyCrypt")] - public static extern string DecodePost(string input, string opt); - - [DllImport("CyCrypt")] - public static extern void DestoryEncodeText(); - - [DllImport("CyCrypt")] - public static extern void DestoryDecodeText(); - - private void SetNetworkManager() - { - if (networkManager == null) - { - networkManager = Toolbox.NetworkManager; - } - } - - public void BuildFirstScene() - { - PlayerStaticData.LoadUserEmblemTexture(); - PlayerStaticData.LoadUserCountryTexture(); - IDictionary dictionary = new Dictionary(); - foreach (UserCard userCard in Data.Load.data.UserCardList) - { - if (!dictionary.ContainsKey(userCard.card_id)) - { - dictionary.Add(userCard.card_id, userCard.number); - } - } - GameMgr.GetIns().GetDataMgr().SetUserOwnCardData(dictionary); - LoadComplete(); - } - - private void LoadComplete() - { - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - if (Data.Load.data._userTutorial.tutorial_step != 100) - { - dataMgr.SetPlayerCharaId(500008); - Global.IS_LOAD_ALLDONE = true; - return; - } - DeckInfoTask task = new DeckInfoTask(); - task.SetParameter(Format.All); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - bool flag = false; - DeckGroupListData deckGroupListData = task.DeckGroupListData; - foreach (DeckData item in deckGroupListData.GetDeckListByAttribute(DeckAttributeType.CustomDeck)) - { - if (!item.IsNoCard()) - { - dataMgr.SetPlayerCharaIdBySkinId(item.GetSkinId()); - dataMgr.SetCurrentDeckData(item.GetCardIdList()); - flag = true; - break; - } - } - if (!flag) - { - DeckData deckData = deckGroupListData.GetDeckListByAttribute(DeckAttributeType.DefaultDeck).First(); - dataMgr.SetPlayerCharaIdByClassId(deckData.GetDeckClassID()); - dataMgr.SetCurrentDeckData(deckData.GetCardIdList()); - } - GameMgr.GetIns().BuildDeckData(); - Global.IS_LOAD_ALLDONE = true; - })); - } - - private IEnumerator LoadAssetBundles() - { - GameMgr.GetIns().Init(); - yield return StartCoroutine(UIManager.GetInstance().CardLoadResident()); - BuildFirstScene(); - } - - private void OnUpdateDeckRequestFinished(NetworkTask.ResultCode error) - { - LoadComplete(); - } - - private void Update() - { - if (GameMgr.GetIns() != null) - { - GameMgr.GetIns().Update(); - } - } - - private void SetLanguageData() - { - string text = Toolbox.SavedataManager.GetString("LANG_SETTING"); - if (string.IsNullOrEmpty(text)) - { - string systemLanguage = Global.GetSystemLanguage(); - if (Global.IsSupportedSystemLanguage(systemLanguage)) - { - text = Global.GetLanguageType(systemLanguage); - Toolbox.SavedataManager.SetString("LANG_SETTING", text); - Toolbox.SavedataManager.SetString("LANG_FONT", Global.GetFontLangType(text)); - Toolbox.SavedataManager.SetString("LANG_SOUND_SETTING", SwitchLanguage.GetDefaultVoiceLanguage(text)); - CustomPreference.SetTextLanguage(Toolbox.SavedataManager.GetString("LANG_SETTING")); - CustomPreference.SetSoundLanguage(Toolbox.SavedataManager.GetString("LANG_SOUND_SETTING")); - Data.SystemText = new SystemText(); - Data.SystemText.Initialize(); - CustomPreference.createResourcePath(); - } - if (string.IsNullOrEmpty(text)) - { - Toolbox.SavedataManager.SetString("LANG_SETTING", "Eng"); - Toolbox.SavedataManager.SetString("LANG_FONT", Global.GetFontLangType(Global.LANG_TYPE.Eng.ToString())); - Toolbox.SavedataManager.SetString("LANG_SOUND_SETTING", SwitchLanguage.GetDefaultVoiceLanguage("Eng")); - CustomPreference.SetTextLanguage(Toolbox.SavedataManager.GetString("LANG_SETTING")); - CustomPreference.SetSoundLanguage(Toolbox.SavedataManager.GetString("LANG_SOUND_SETTING")); - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/ShopCommonUtility.cs b/SVSim.BattleEngine/Engine/Wizard/ShopCommonUtility.cs index 3b2e6c24..a1b4af82 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ShopCommonUtility.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ShopCommonUtility.cs @@ -15,24 +15,6 @@ public static class ShopCommonUtility ticket } - public const float SUPPLY_LIST_LASTLINE_MARGIN = 30f; - - private const string SPRITE_FORMAT_CLASS_COLOR = "icon_class_color_{0}"; - - private const int MAX_LENGTH_VIEW_PRODUCT_NAME = 18; - - private const int MAX_LENGTH_VIEW_PRODUCT_NAME_ALPHABET = 35; - - private const string OVER_MAX_TEXT_REPLACE_CHAR = "..."; - - public const string CMN_SHOP_ICON_1 = "cmn_shop_icon_1"; - - public const string TEXTURE_NAME_PRE_PACK_ICON = "card_pack_{0}_icon"; - - private const int ERROR_CODE_NOTFOUND_DECKCODE = 10001; - - private const int ERROR_CODE_2PICK_DECKCODE = 10005; - private static readonly Vector3 POS_COST_LABLE_RIGHT = new Vector3(40f, -86f, 0f); private static readonly Vector3 POS_COST_LABLE_LEFT = new Vector3(-141f, -86f, 0f); @@ -224,8 +206,7 @@ public static class ShopCommonUtility } case UserGoods.Type.Skin: typeName = Data.SystemText.Get("Common_0143"); - detailName = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId((int)userGoodsId) - .chara_name; + detailName = ""; // Pre-Phase-5b: no chara master headless break; case UserGoods.Type.SpotCardPoint: typeName = Data.SystemText.Get("Common_0161"); @@ -237,37 +218,6 @@ public static class ShopCommonUtility } } - public static string GetRewardDetailName(ShopCommonRewardInfo rewardInfo) - { - int type = rewardInfo.Type; - long userGoodsId = rewardInfo.UserGoodsId; - int num = rewardInfo.Num; - string typeName = null; - string detailName = null; - GetRewardNames(type, userGoodsId, num, out typeName, out detailName); - return detailName; - } - - public static string GetRewardImagePath(ShopCommonRewardInfo rewardInfo, bool isFetch = false) - { - int type = rewardInfo.Type; - long userGoodsId = rewardInfo.UserGoodsId; - string result = ""; - switch ((UserGoods.Type)type) - { - case UserGoods.Type.Sleeve: - { - long existingSleeveId = Toolbox.ResourcesManager.GetExistingSleeveId(userGoodsId); - result = Toolbox.ResourcesManager.GetAssetTypePath(existingSleeveId.ToString(), ResourcesManager.AssetLoadPathType.SleeveTexture, isFetch); - break; - } - case UserGoods.Type.Emblem: - result = Toolbox.ResourcesManager.GetAssetTypePath(userGoodsId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isFetch); - break; - } - return result; - } - public static string TrimProductName(string text) { int maxLength = (Global.IsAlphabetLanguage() ? 35 : 18); @@ -340,30 +290,6 @@ public static class ShopCommonUtility } } - public static void OnResultCodeErrorDeckCodeInfo(int code) - { - switch (code) - { - case 10001: - { - DialogBase dialogBase2 = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase2.SetTitleLabel(Data.SystemText.Get("Dia_BuyBuildDeck_006_Title")); - dialogBase2.SetText(Data.SystemText.Get("Dia_BuyBuildDeck_006_Body")); - break; - } - case 10005: - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(isSystem: true); - dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_BuyBuildDeck_007_Title")); - dialogBase.SetText(Data.SystemText.Get("Dia_BuyBuildDeck_007_Body")); - break; - } - default: - Wizard.ErrorDialog.Dialog.Create(code); - break; - } - } - public static string GetTicketIconPath(string itemId, bool isFetch) { return Toolbox.ResourcesManager.GetAssetTypePath("ticket_" + itemId + "_icon", ResourcesManager.AssetLoadPathType.ShopItem, isFetch); diff --git a/SVSim.BattleEngine/Engine/Wizard/ShopDrumrollScrollItem.cs b/SVSim.BattleEngine/Engine/Wizard/ShopDrumrollScrollItem.cs index 7a643a69..cecfd2d3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ShopDrumrollScrollItem.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ShopDrumrollScrollItem.cs @@ -15,8 +15,6 @@ public class ShopDrumrollScrollItem : MonoBehaviour [SerializeField] private GameObject _objBadge; - private GameObject _objNewEffect; - private List _assetPathList = new List(); private void Awake() @@ -24,15 +22,6 @@ public class ShopDrumrollScrollItem : MonoBehaviour _ = _objNewMark != null; } - private void OnDestroy() - { - if (_assetPathList != null) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList); - _assetPathList.Clear(); - } - } - public void SetActiveNewMark(bool isActive) { if (_objNewMark == null) @@ -48,10 +37,7 @@ public class ShopDrumrollScrollItem : MonoBehaviour GameObject _objNewEffect = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_shop_icon_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); _objNewEffect.transform.SetParent(_objNewMark.transform); _objNewEffect.transform.localPosition = Vector3.zero; - _assetPathList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(_objNewEffect, delegate - { - GameMgr.GetIns().GetEffectMgr().ChangeMaskShader(_objNewEffect); - })); + // Pre-Phase-5b: SetUIParticleShader + ChangeMaskShader dropped; headless has no EffectMgr. _objNewEffect.SetActive(value: true); } } @@ -79,10 +65,7 @@ public class ShopDrumrollScrollItem : MonoBehaviour GameObject effectObj = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("cmn_shop_icon_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject); effectObj.transform.SetParent(_objPrerelease.transform); effectObj.transform.localPosition = Vector3.zero; - _assetPathList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectObj, delegate - { - GameMgr.GetIns().GetEffectMgr().ChangeMaskShader(effectObj); - })); + // Pre-Phase-5b: SetUIParticleShader + ChangeMaskShader dropped; headless has no EffectMgr. effectObj.SetActive(value: true); } } diff --git a/SVSim.BattleEngine/Engine/Wizard/ShopExpirtyInfo.cs b/SVSim.BattleEngine/Engine/Wizard/ShopExpirtyInfo.cs index 26c9f0af..2c3eb028 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ShopExpirtyInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ShopExpirtyInfo.cs @@ -5,7 +5,6 @@ namespace Wizard; public class ShopExpirtyInfo { - public const string JSON_KEY = "sales_period_info"; public int? SaleEndSeries { get; private set; } @@ -28,11 +27,6 @@ public class ShopExpirtyInfo } } - public static ShopExpirtyInfo CreateNullData() - { - return new ShopExpirtyInfo(null); - } - public ShopExpirtyInfo(string dummyText) { SaleEndTimeText = dummyText; diff --git a/SVSim.BattleEngine/Engine/Wizard/ShopNotification.cs b/SVSim.BattleEngine/Engine/Wizard/ShopNotification.cs index 9c9d4171..56cd4660 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ShopNotification.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ShopNotification.cs @@ -50,16 +50,6 @@ public class ShopNotification public ShopAppealInfo AppealLeaderSkin { get; private set; } - public void SetShopNotification(JsonData data) - { - double serverTime = data["data_headers"]["servertime"].ToDouble(); - JsonData jsonData = data["data"]["shop_notification"]; - AppealCardPack = new ShopAppealInfo(jsonData["card_pack"], serverTime); - AppealBuildDeck = new ShopAppealInfo(jsonData["build_deck"], serverTime); - AppealSleeve = new ShopAppealInfo(jsonData["sleeve"], serverTime); - AppealLeaderSkin = new ShopAppealInfo(jsonData["leader_skin"], serverTime); - } - public void SetShopBadgeEnable(JsonData data) { JsonData jsonData = data["data"]["shop_notification"]; diff --git a/SVSim.BattleEngine/Engine/Wizard/ShopPanelAppealItem.cs b/SVSim.BattleEngine/Engine/Wizard/ShopPanelAppealItem.cs deleted file mode 100644 index 51aa0927..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/ShopPanelAppealItem.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.Collections; -using UnityEngine; - -namespace Wizard; - -public class ShopPanelAppealItem : MonoBehaviour -{ - [SerializeField] - private GameObject _rootAppealObj; - - [SerializeField] - private GameObject _objNewMark; - - [SerializeField] - private UILabel _labelRemainTime; - - [SerializeField] - [Tooltip("残り{0}日")] - private string _remainDayTextId = "MyPage_0062"; - - [SerializeField] - [Tooltip("残り{0}時間")] - private string _remainHourTextId = "MyPage_0063"; - - [SerializeField] - [Tooltip("残り{0}分")] - private string _remainMinuteTextId = "MyPage_0064"; - - public void SetActiveAppealObj(bool isActive) - { - _rootAppealObj.SetActive(isActive); - } - - public void DelaySetActiveAppealObj(bool isActive, float delayTime) - { - if (base.gameObject.activeInHierarchy) - { - StartCoroutine(DelaySetActiveCoroutin(isActive, delayTime)); - } - } - - private IEnumerator DelaySetActiveCoroutin(bool isActive, float delayTime) - { - yield return new WaitForSeconds(delayTime); - SetActiveAppealObj(isActive); - } - - public void SetAppeal(ShopNotification.ShopAppealInfo appealInfo) - { - if (appealInfo.NeedsCampaignDisplay) - { - SetCampaignDisplay(); - SetActiveNewMark(appealInfo.IsNew); - } - else if (appealInfo.RemainTime != null) - { - SetRemainTimeLabel(appealInfo.RemainTime.Second); - SetActiveNewMark(isActive: false); - } - else - { - SetActiveNewMark(appealInfo.IsNew); - SetActiveRemainTime(isActive: false); - } - } - - public void SetActiveNewMark(bool isActive) - { - _objNewMark?.SetActive(isActive); - } - - public void SetActiveRemainTime(bool isActive) - { - _labelRemainTime?.gameObject.SetActive(isActive); - } - - private void SetRemainTimeLabel(int limitTime) - { - if (_labelRemainTime == null) - { - return; - } - if (limitTime <= 0) - { - _labelRemainTime.gameObject.SetActive(value: false); - return; - } - _labelRemainTime.gameObject.SetActive(value: true); - SystemText systemText = Data.SystemText; - if (limitTime < 3600) - { - int num = limitTime / 60 + 1; - _labelRemainTime.text = systemText.Get(_remainMinuteTextId, num.ToString()); - } - else if (limitTime < 86400) - { - int num2 = limitTime / 3600; - _labelRemainTime.text = systemText.Get(_remainHourTextId, num2.ToString()); - } - else - { - int num3 = limitTime / 86400; - _labelRemainTime.text = systemText.Get(_remainDayTextId, num3.ToString()); - } - } - - private void SetCampaignDisplay() - { - _labelRemainTime.text = Data.SystemText.Get("MyPage_0076"); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SimpleScrollViewUI.cs b/SVSim.BattleEngine/Engine/Wizard/SimpleScrollViewUI.cs index 0c06d7e0..1749f1e9 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SimpleScrollViewUI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SimpleScrollViewUI.cs @@ -41,8 +41,6 @@ public class SimpleScrollViewUI : MonoBehaviour private Action _initializePlate; - public int ScrollObjectNum => SCROLL_OBJECT_NUM; - public List ActivePlateList => _plateList.Where((GameObject p) => p.activeInHierarchy).ToList(); public void CreateScrollView(int contentsNum, Action InitializePlate) @@ -153,32 +151,6 @@ public class SimpleScrollViewUI : MonoBehaviour _initializePlate(num, obj); } - public void CenteringPlate() - { - if (_scrollView.movement == UIScrollView.Movement.Vertical) - { - UIPanel component = _scrollView.GetComponent(); - float num = component.height / 2f - component.clipSoftness.y; - float y = (float)_wrapContent.itemSize * (float)_contentsNum / 2f - num; - Vector3 relative = new Vector3(0f, y, 0f); - _scrollView.ResetPosition(); - _scrollView.MoveRelative(relative); - _wrapContent.WrapContent(); - } - } - - public bool IsAllPlateWithinPanel() - { - if (_scrollView.movement != UIScrollView.Movement.Vertical) - { - return false; - } - UIPanel component = _scrollView.GetComponent(); - float num = component.height - 2f * component.clipSoftness.y; - float num2 = (float)_wrapContent.itemSize * (float)_contentsNum; - return num > num2; - } - public void MovePlateByIndex(int index, VerticalMovement move, bool allowMargin = false) { if (index < 0 || _contentsNum <= index || _scrollView.movement != UIScrollView.Movement.Vertical) diff --git a/SVSim.BattleEngine/Engine/Wizard/SimulationAdditionalActionInfoSet.cs b/SVSim.BattleEngine/Engine/Wizard/SimulationAdditionalActionInfoSet.cs index 8eaba165..a875236a 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SimulationAdditionalActionInfoSet.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SimulationAdditionalActionInfoSet.cs @@ -9,16 +9,4 @@ public class SimulationAdditionalActionInfoSet public List ExtraActionBaseList; public AISinglePlayptnRecord PlayPtnRecord; - - public bool HasPlaySkipWithAction - { - get - { - if (ExtraActionBaseList != null) - { - return ExtraActionBaseList.Count > 0; - } - return false; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SkinProductDetail.cs b/SVSim.BattleEngine/Engine/Wizard/SkinProductDetail.cs index 2fd9af9b..4e307fec 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SkinProductDetail.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SkinProductDetail.cs @@ -6,13 +6,6 @@ namespace Wizard; public class SkinProductDetail : BaseProductDetail { - private const int WIDTH_PRODUCT_IMG_NORMAL = 249; - - private const int HEIGHT_PRODUCT_IMG_NORMAL = 199; - - private const int WIDTH_PRODUCT_IMG_LARGE = 370; - - private const int HEIGHT_PRODUCT_IMG_LARGE = 213; [SerializeField] private GameObject _detailObjsParent; @@ -56,7 +49,7 @@ public class SkinProductDetail : BaseProductDetail GameObject obj = NGUITools.AddChild(_detailObjsParent.gameObject, _productTemplate.gameObject); obj.transform.localPosition = Vector3.up * TailPosY; ProductDetailPlate component = obj.GetComponent(); - ClassCharacterMasterData charaPrmBySkinId = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId(skinProductInfo.leader_skin_id); + ClassCharacterMasterData charaPrmBySkinId = null; // Pre-Phase-5b: no chara master headless TailPosY -= component.SetProductData(skinProductInfo.saleInfo.name, charaPrmBySkinId, skinProductInfo.rewardInfoList); } } diff --git a/SVSim.BattleEngine/Engine/Wizard/Sleeve.cs b/SVSim.BattleEngine/Engine/Wizard/Sleeve.cs index 4847951f..68b14908 100644 --- a/SVSim.BattleEngine/Engine/Wizard/Sleeve.cs +++ b/SVSim.BattleEngine/Engine/Wizard/Sleeve.cs @@ -14,10 +14,6 @@ public class Sleeve private bool _isAcquired; - public const float REGULAR_SPEC_POWER = 20f; - - public const float EX_SPEC_POWER = 40f; - public bool IsAcquired { get @@ -75,11 +71,6 @@ public class Sleeve IsNew = false; } - public void SetNew() - { - IsNew = true; - } - public void SetFavorite(bool favorite) { IsFavorite = favorite; diff --git a/SVSim.BattleEngine/Engine/Wizard/SleeveBuyTask.cs b/SVSim.BattleEngine/Engine/Wizard/SleeveBuyTask.cs index 1ad16300..2ac21e09 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SleeveBuyTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SleeveBuyTask.cs @@ -7,8 +7,6 @@ public class SleeveBuyTask : BaseTask public int series_id; public int product_id; - - public int sales_type; } public SleeveBuyTask() @@ -16,15 +14,6 @@ public class SleeveBuyTask : BaseTask base.type = ApiType.Type.SleeveBuy; } - public void SetParameter(int series_id, int productId, ShopCommonUtility.SalesType sales_type) - { - SleeveBuyTaskParam sleeveBuyTaskParam = new SleeveBuyTaskParam(); - sleeveBuyTaskParam.series_id = series_id; - sleeveBuyTaskParam.product_id = productId; - sleeveBuyTaskParam.sales_type = (int)sales_type; - base.Params = sleeveBuyTaskParam; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard/SleeveMgr.cs b/SVSim.BattleEngine/Engine/Wizard/SleeveMgr.cs index 2f693df0..83b7beec 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SleeveMgr.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SleeveMgr.cs @@ -7,16 +7,6 @@ public class SleeveMgr { private List _list = new List(); - public void Add(Sleeve sleeve) - { - _list.Add(sleeve); - } - - public List GetList() - { - return _list; - } - public List GetAcquiredList() { return _list.FindAll((Sleeve x) => x.IsAcquired); @@ -62,11 +52,6 @@ public class SleeveMgr Get(id).UnsetNew(); } - public void SetNew(long id) - { - Get(id).SetNew(); - } - public void SetFavorite(long id, bool b) { Get(id).SetFavorite(b); diff --git a/SVSim.BattleEngine/Engine/Wizard/SleeveSeries.cs b/SVSim.BattleEngine/Engine/Wizard/SleeveSeries.cs deleted file mode 100644 index 27ef231b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SleeveSeries.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class SleeveSeries : BaseSeriesData -{ - private int index; - - public SleeveSeries(string[] columns) - { - base.Id = int.Parse(columns[index++]); - base.Name = ConvName(columns[index++]); - base.Introduction = ConvName(columns[index++]); - base.TitlePath = columns[index++]; - base.DrumrollPath = columns[index++]; - } - - private string ConvName(string id) - { - return Data.Master.GetSleeveSeriesText(id); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SmallResourceSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SmallResourceSelectDialog.cs deleted file mode 100644 index ff021dab..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SmallResourceSelectDialog.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class SmallResourceSelectDialog : MonoBehaviour -{ - [SerializeField] - private UILabel _downloadSizeLabel; - - [SerializeField] - private UIToggle _useSmallResource; - - [SerializeField] - private UILabel _noticeLabel; - - private bool _isTitle; - - private Action _onFinish; - - private bool _isFirstCallUseSmallResourceToggleChange = true; - - public static void Create(Action onFinish, Action onCancel, bool isTitle) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get(isTitle ? "OtherTop_0017" : "MyPage_0088")); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(systemText.Get("Common_0004")); - dialogBase.SetPanelDepth(2000); - GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/SmallResourceSelectDialog")) as GameObject; - dialogBase.SetObj(gameObject); - SmallResourceSelectDialog selectDialog = gameObject.GetComponent(); - dialogBase.onPushButton1 = delegate - { - selectDialog.OnSelectOk(); - }; - dialogBase.onPushButton2 = delegate - { - onCancel.Call(); - }; - dialogBase.onCloseWithoutSelect = delegate - { - onCancel.Call(); - }; - selectDialog.Initialize(isTitle, onFinish); - } - - private void Initialize(bool isTitle, Action onFinish) - { - _isTitle = isTitle; - _onFinish = onFinish; - } - - private void Start() - { - float totalStrageUseSize = Toolbox.AssetManager.GetTotalStrageUseSize(isNormalResource: true); - float totalStrageUseSize2 = Toolbox.AssetManager.GetTotalStrageUseSize(isNormalResource: false); - string suffixByDigit = AssetManager.GetSuffixByDigit(totalStrageUseSize); - string suffixByDigit2 = AssetManager.GetSuffixByDigit(totalStrageUseSize2); - _downloadSizeLabel.text = Data.SystemText.Get("Title_0052", suffixByDigit, suffixByDigit2); - _useSmallResource.value = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 2; - _noticeLabel.text = Data.SystemText.Get(_isTitle ? "Title_0054" : "Title_0058"); - _useSmallResource.onChange.Add(new EventDelegate(delegate - { - OnClickUseSmallResource(); - })); - } - - private void OnClickUseSmallResource() - { - if (!_isFirstCallUseSmallResourceToggleChange) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_useSmallResource.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - } - _isFirstCallUseSmallResourceToggleChange = false; - } - - private void OnSelectOk() - { - int value = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS); - bool num = PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 2; - bool value2 = _useSmallResource.value; - if (num == value2) - { - if (value == 0) - { - DecideResourceType(_useSmallResource.value); - } - _onFinish.Call(); - return; - } - if (_isTitle) - { - DecideResourceType(_useSmallResource.value); - _onFinish.Call(); - return; - } - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - string text = Data.SystemText.Get(value2 ? "System_0062" : "System_0061"); - dialogBase.SetText(Data.SystemText.Get("MyPage_0089", text)); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.onPushButton1 = delegate - { - DecideResourceType(_useSmallResource.value); - }; - dialogBase.OnClose = delegate - { - _onFinish.Call(); - }; - } - - private void DecideResourceType(bool isSmall) - { - PlayerPrefsCache.Instance.SetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS, (!isSmall) ? 1 : 2); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SoftwareReset.cs b/SVSim.BattleEngine/Engine/Wizard/SoftwareReset.cs index 8df6d449..4173b3a3 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SoftwareReset.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SoftwareReset.cs @@ -1,67 +1,51 @@ -using Convention; -using Cute; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public static class SoftwareReset -{ - private const float BGM_FADE_OUT_TIME = 1f; - - private static string _bootScene; - - private static void resetAction() - { - Data.Clear(); - PaymentImpl.GetInstance().finalize(); - GameObject gameObject = GameObject.Find("_GameMgr"); - if (gameObject != null) - { - Object.Destroy(gameObject); - } - GameObject gameObject2 = GameObject.Find("_Game"); - if (gameObject2 != null) - { - Object.Destroy(gameObject2); - } - BGMManager.Dispose(); - Global.GAME_FONT = null; - Global.IS_LOAD_ALLDONE = false; - } - - public static void setAction() - { - SoftwareResetBase.setSoftwareResetAction(resetAction); - } - - public static void BgmFadeEndCallBack() - { - SoftwareResetBase.SoftwareReset(_bootScene, resetAction); - _bootScene = null; - } - - public static void exec(string sceneName = null, bool isFromUserDelete = false) - { - UIManager.GetInstance().isBattleRecovery = false; - _bootScene = sceneName; - SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); - soundMgr.StopBGM(BgmFadeEndCallBack, 1f); - soundMgr.StopSeAll(0f); - soundMgr.PlaySe(Se.TYPE.SYS_BTN_CANCEL_TRANS); - UIManager.GetInstance().CreatFadeClose(); - VideoHostingUtil.OnSoftwareReset(); - RoomBase.OnSoftwareReset(); - Offline.OnSoftwareReset(); - SealedController.OnSoftwareReset(); - PlayerPrefsCache.OnSoftwareReset(); - if (null != GameMgr.GetIns().GetBattleCtrl()) - { - GameMgr.GetIns().GetBattleCtrl().BattleRelease(); - } - if (BattleManagerBase.GetIns() != null) - { - BattleManagerBase.GetIns().DisposeBattleGameObj(); - } - } -} +using Convention; +using Cute; +using UnityEngine; +using Wizard.RoomMatch; + +namespace Wizard; + +public static class SoftwareReset +{ + + private static string _bootScene; + + private static void resetAction() + { + Data.Clear(); + GameObject gameObject = GameObject.Find("_GameMgr"); + if (gameObject != null) + { + Object.Destroy(gameObject); + } + GameObject gameObject2 = GameObject.Find("_Game"); + if (gameObject2 != null) + { + Object.Destroy(gameObject2); + } + BGMManager.Dispose(); + Global.GAME_FONT = null; + Global.IS_LOAD_ALLDONE = false; + } + + public static void setAction() + { + SoftwareResetBase.setSoftwareResetAction(resetAction); + } + + public static void exec(string sceneName = null, bool isFromUserDelete = false) + { + UIManager.GetInstance().isBattleRecovery = false; + _bootScene = sceneName; + + UIManager.GetInstance().CreatFadeClose(); + VideoHostingUtil.OnSoftwareReset(); + RoomBase.OnSoftwareReset(); + Offline.OnSoftwareReset(); + SealedController.OnSoftwareReset(); + PlayerPrefsCache.OnSoftwareReset(); + // Pre-Phase-5b: released the battle mgr's UI GameObjects via BattleCtrl.BattleRelease + // + BattleManagerBase.DisposeBattleGameObj. BattleControl is a stub (chunk 7) and headless + // has nothing to dispose; both branches are unreachable safely. + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/SoloBattleEnemyAI.cs b/SVSim.BattleEngine/Engine/Wizard/SoloBattleEnemyAI.cs index f9fb6543..9b6afeed 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SoloBattleEnemyAI.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SoloBattleEnemyAI.cs @@ -8,7 +8,7 @@ public class SoloBattleEnemyAI : EnemyAI public override bool IsConnectNetwork => false; - public SoloBattleEnemyAI() + public SoloBattleEnemyAI(BattleManagerBase mgr) : base(mgr) { base.IsRankMatchAI = false; } diff --git a/SVSim.BattleEngine/Engine/Wizard/SpecialCrystalTaskInfo.cs b/SVSim.BattleEngine/Engine/Wizard/SpecialCrystalTaskInfo.cs deleted file mode 100644 index 98319312..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpecialCrystalTaskInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class SpecialCrystalTaskInfo : BaseTask -{ - public SpecialCrystalTaskInfo() - { - base.type = ApiType.Type.SpecialCrystalInfo; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.Load.data._userCrystalCount.ParseSpecialCrystal(base.ResponseData); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SpecialTitleAssetBundle.cs b/SVSim.BattleEngine/Engine/Wizard/SpecialTitleAssetBundle.cs index 0be4cf7d..ec032c47 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SpecialTitleAssetBundle.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SpecialTitleAssetBundle.cs @@ -6,13 +6,6 @@ namespace Wizard; public class SpecialTitleAssetBundle : MonoBehaviour { - private AssetHandle _handle; - - private string _id; - - public GameObject _specialTitle; - - public bool IsSetupFinish { get; private set; } private static string GetSpecialTitlePath(string id, bool isFetch) { @@ -37,52 +30,4 @@ public class SpecialTitleAssetBundle : MonoBehaviour } return File.Exists(new AssetHandle(GetSpecialTitlePath(id, isFetch: false), null, null, null, null, null).BuildLocalCachePath()); } - - public void Initialize(string id) - { - if (!IsAvailableTitleAssetBundle(id)) - { - return; - } - _id = id; - _handle = new AssetHandle(GetSpecialTitlePath(id, isFetch: false), null, null, null, null, null); - _handle.Load(delegate - { - _specialTitle = NGUITools.AddChild(base.gameObject, Toolbox.ResourcesManager.LoadObject(GetSpecialTitlePath(id, isFetch: true)) as GameObject); - ChangeableTitleUIParts component = _specialTitle.gameObject.GetComponent(); - if (component != null) - { - component.Init(); - } - IsSetupFinish = true; - }); - } - - public void PlayBGM() - { - GameMgr.GetIns().GetSoundMgr().PlayBGM(GetBGMCueName(_id), 0f, 0L); - } - - public void UnloadBGM() - { - Toolbox.AudioManager.RemoveCueSheet(GetBGMCueName(_id)); - GameMgr.GetIns().GetSoundMgr().UnloadBGM(GetBGMCueName(_id)); - } - - public void RemoveSpecialTitle() - { - if (_specialTitle != null) - { - Object.Destroy(_specialTitle); - _specialTitle = null; - } - } - - private void OnDestroy() - { - if (_handle != null) - { - _handle.Unload(); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/SpineDisplay.cs b/SVSim.BattleEngine/Engine/Wizard/SpineDisplay.cs deleted file mode 100644 index 5b038dba..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpineDisplay.cs +++ /dev/null @@ -1,223 +0,0 @@ -using System.Collections.Generic; -using Cute; -using Spine.Unity; -using UnityEngine; - -namespace Wizard; - -public class SpineDisplay : MonoBehaviour -{ - private const string ANIMATION_TRANSFORM_NAME = "AnimationTransform"; - - private const string MASK_MATERIAL = "mt_encampment_mask"; - - private const int STENCIL_VALUE = 3; - - [SerializeField] - private bool _isEnableAspectFix = true; - - [SerializeField] - private bool _isEnableRenderTextureSizeSetting; - - [SerializeField] - private int _renderTextureSize = 2048; - - [SerializeField] - private int _renderTextureMobileSize = 1024; - - private GameObject _spineObject; - - private Animator[] _animators; - - private int _saveScreenWidth; - - private int _saveScreenHeight; - - private RenderTexture _renderTexture; - - private UITexture _uiTexture; - - private Camera _camera; - - private List _materialList = new List(); - - private const float RENDER_TEXTURE_BASE_SIZE_DEFAULT = 2048f; - - private const float ASPECT_RATIO = 0.5625f; - - private const float ASPECT_RATIO_REVERSE = 1.7777778f; - - private float RenderTextureSize - { - get - { - if (_isEnableRenderTextureSizeSetting) - { - return _renderTextureSize; - } - return 2048f; - } - } - - public List GetLoadPath(string path, bool fetch) - { - return new List - { - Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.UISpine, fetch), - Toolbox.ResourcesManager.GetAssetTypePath("mt_encampment_mask", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, fetch), - Toolbox.ResourcesManager.GetAssetTypePath(MaskTextureName(), ResourcesManager.AssetLoadPathType.ClassCharaTexture, fetch) - }; - } - - public void Initialize(string path, UITexture texture, Camera camera) - { - _uiTexture = texture; - _camera = camera; - SpriteRenderer spriteRenderer = base.gameObject.AddComponent(); - Material material = new Material(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("mt_encampment_mask", ResourcesManager.AssetLoadPathType.ClassCharaMaterial, isfetch: true))); - material.SetInt("_Stencil", 3); - _materialList.Add(spriteRenderer.material); - spriteRenderer.material = material; - _materialList.Add(material); - spriteRenderer.sprite = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(MaskTextureName(), ResourcesManager.AssetLoadPathType.ClassCharaTexture, isfetch: true)); - GameObject original = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.UISpine, isfetch: true)); - _spineObject = Object.Instantiate(original); - MotionUtils.SetLayerAll(_spineObject, base.gameObject.layer); - Transform transform = _spineObject.transform; - transform.parent = base.transform; - transform.localPosition = Vector3.zero; - transform.localScale = Vector3.one; - transform.localEulerAngles = Vector3.zero; - MeshRenderer component = transform.GetComponentInChildren().GetComponent(); - _animators = transform.GetComponentsInChildren(); - Animator[] animators = _animators; - for (int i = 0; i < animators.Length; i++) - { - animators[i].speed = 1f; - } - StartMotion("NONE"); - SetMaterialInfo(component, 3); - CreateRenderTexture(); - UpdateUITextureSize(_uiTexture); - } - - public void StartMotion(string motionName) - { - Animator[] animators = _animators; - for (int i = 0; i < animators.Length; i++) - { - animators[i].SetTrigger(motionName); - } - } - - public bool IsPlaying() - { - Animator[] animators = _animators; - for (int i = 0; i < animators.Length; i++) - { - if ((double)animators[i].GetCurrentAnimatorStateInfo(0).normalizedTime < 1.0) - { - return true; - } - } - return false; - } - - private void CreateRenderTexture() - { - if (!(_renderTexture != null)) - { - if (_isEnableAspectFix) - { - _renderTexture = new RenderTexture((int)RenderTextureSize, (int)(RenderTextureSize * 0.5625f), 0, RenderTextureFormat.ARGB32); - } - else - { - _renderTexture = new RenderTexture((int)RenderTextureSize, (int)RenderTextureSize, 0, RenderTextureFormat.ARGB32); - } - _renderTexture.name = "SpineDisplay"; - _camera.targetTexture = _renderTexture; - _uiTexture.mainTexture = _renderTexture; - } - } - - private void OnDestroy() - { - if (_renderTexture != null) - { - _renderTexture.Release(); - Object.Destroy(_renderTexture); - _renderTexture = null; - } - foreach (Material material in _materialList) - { - Object.Destroy(material); - } - _materialList.Clear(); - } - - private string MaskTextureName() - { - return "tx_encampment_mask"; - } - - private void Update() - { - if (!(_camera == null) && !(_uiTexture == null) && (UIManager.GetInstance().FrontCameraPixelWidth != _saveScreenWidth || UIManager.GetInstance().FrontCameraPixelHeight != _saveScreenHeight)) - { - UpdateUITextureSize(_uiTexture); - } - } - - private void UpdateUITextureSize(UITexture uiTexture) - { - Camera frontCamera = UIManager.GetInstance().FrontCamera; - Vector3 localScale = uiTexture.transform.localScale; - uiTexture.transform.localScale = Vector3.one; - _saveScreenWidth = UIManager.GetInstance().FrontCameraPixelWidth; - _saveScreenHeight = UIManager.GetInstance().FrontCameraPixelHeight; - Vector3 position = new Vector3(0f, 1f, 0f); - Vector3 position2 = new Vector3(1f, 0f, 0f); - Vector3 position3 = frontCamera.ViewportToWorldPoint(position); - Vector3 position4 = frontCamera.ViewportToWorldPoint(position2); - Vector3 vector = uiTexture.transform.InverseTransformPoint(position3); - Vector3 vector2 = uiTexture.transform.InverseTransformPoint(position4); - uiTexture.transform.localScale = localScale; - float num = 0.5625f; - float num2 = frontCamera.pixelHeight; - float num3 = frontCamera.pixelWidth; - if (num2 / num3 < num) - { - float num4 = vector2.x - vector.x; - float num5 = num4 * num; - uiTexture.width = (int)num4; - uiTexture.height = (int)num5; - } - else - { - float num6 = vector.y - vector2.y; - float num7 = num6 * 1.7777778f; - uiTexture.width = (int)num7; - uiTexture.height = (int)num6; - } - } - - private void SetMaterialInfo(MeshRenderer meshRenderer, int stencil) - { - Material material = new Material(meshRenderer.material); - material.SetInt("_Stencil", stencil); - _materialList.Add(meshRenderer.material); - meshRenderer.material = material; - _materialList.Add(material); - for (int i = 0; i < meshRenderer.materials.Length; i++) - { - Material material2 = meshRenderer.materials[i]; - if (material2 != null && material2.GetInt("_Stencil") != stencil) - { - meshRenderer.materials[i] = new Material(material2); - meshRenderer.materials[i].SetInt("_Stencil", stencil); - _materialList.Add(meshRenderer.materials[i]); - } - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SpotCardData.cs b/SVSim.BattleEngine/Engine/Wizard/SpotCardData.cs index 00f5ff89..545840cc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SpotCardData.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SpotCardData.cs @@ -7,23 +7,6 @@ public class SpotCardData { private Dictionary _spotCardDict = new Dictionary(); - public void SetSpotCardData(JsonData jsonData) - { - if (jsonData == null || jsonData.Count == 0) - { - return; - } - _spotCardDict = new Dictionary(jsonData.Count); - foreach (string key in jsonData.Keys) - { - if (int.TryParse(key, out var result)) - { - _spotCardDict[result] = jsonData[key].ToInt(); - } - } - GameMgr.GetIns().GetDataMgr().SetDirtyPossessionCardDict(); - } - public bool ExistsSpotCard() { return _spotCardDict.Count > 0; @@ -44,7 +27,7 @@ public class SpotCardData public void SetSpotCardNum(int cardId, int num) { _spotCardDict[cardId] = num; - GameMgr.GetIns().GetDataMgr().SetDirtyPossessionCardDict(); + /* Pre-Phase-5b: SetDirtyPossessionCardDict dropped */ } public Dictionary CreateDictionaryIncludingSpotCard(IDictionary srcDict) diff --git a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchange.cs b/SVSim.BattleEngine/Engine/Wizard/SpotCardExchange.cs deleted file mode 100644 index 9b8a8527..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchange.cs +++ /dev/null @@ -1,350 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.SpotCardExchange; -using Wizard.UI.Common; - -namespace Wizard; - -public class SpotCardExchange : MonoBehaviour -{ - private const string SPRITE_CLASS_TAB_NEUTRAL = "class_tab_neutral"; - - private const int CONFIRM_DIALOG_DEPTH = 100; - - private const int CARD_OBJECT_DEPTH = 20; - - private const float CARD_OBJECT_SCALE = 0.36f; - - private const float CARD_OBJECT_COLLIDER_SCALE = 0.9f; - - [SerializeField] - private UILabel _labelSpotCardPoint; - - [SerializeField] - private SimpleScrollViewUI _spotCardScrollView; - - [SerializeField] - private UILabel _labelNoSpotCardList; - - [SerializeField] - private TabList _tabListClass; - - [SerializeField] - private UISprite _spriteClassTab; - - [SerializeField] - private PurchaseConfirm _purchaseConfirmDialog; - - private List _loadedResourceList = new List(); - - private UIAtlas _atlasProfile; - - private List _cardObjectList; - - [SerializeField] - private GameObject _cardObjectRoot; - - [SerializeField] - private GameObject _cardDetailRoot; - - private CardDetailUI _cardDetail; - - private List _loadedCardResourceList = new List(); - - private int _cardDetailIndex; - - private CardBasePrm.ClanType _displayClassType; - - private Dictionary> _spotCardListInClassDict = new Dictionary>(); - - private SpotCardExchangeInfoTask.PrereleaseExchangeInfo _prereleaseExchangeInfo; - - public void Init() - { - _labelSpotCardPoint.gameObject.SetActive(value: false); - InitCardDetail(); - StartCoroutine(LoadInitialResources(delegate - { - InitClassTab(); - UpdateExchangeableSpotCardList(CardBasePrm.ClanType.ALL); - })); - } - - private IEnumerator LoadInitialResources(Action onFinish) - { - UIManager.GetInstance().createInSceneCenterLoading(); - yield return StartCoroutine(LoadProfileAtlas()); - UIManager.GetInstance().closeInSceneCenterLoading(); - onFinish.Call(); - } - - private IEnumerator LoadProfileAtlas() - { - string profileAtlasName = UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.Profile, null); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(profileAtlasName, null)); - _loadedResourceList.Add(profileAtlasName); - profileAtlasName = UIManager.GetInstance().GetSceneAssetPath(UIAtlasManager.AssetBundleNames.Profile, null, isload: true); - _atlasProfile = Toolbox.ResourcesManager.LoadObject(profileAtlasName).GetComponent(); - } - - private void UnloadResources() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - - private void OnDestroy() - { - UnloadResources(); - UnloadCardObject(); - } - - private void InitCardDetail() - { - _cardDetail = DialogCreator.CreateCardDetailDialog(_cardDetailRoot, "Detail"); - _cardDetail.OnDragCard = CardDetailDragCallback; - _cardDetail.OnDetailCardUpdate = UpdateCardDetailArrowButtonVisible; - _cardDetail.gameObject.SetActive(value: false); - } - - private IEnumerator LoadCardObject(List cardIdList, Action onFinish) - { - if (cardIdList.Count == 0) - { - onFinish.Call(); - yield break; - } - UnloadCardObject(); - UIManager uiMgr = UIManager.GetInstance(); - uiMgr.createInSceneCenterLoading(); - bool isLoaded = false; - uiMgr.CardLoadSelect(null, cardIdList, base.gameObject.layer, is2D: true, delegate - { - isLoaded = true; - }); - while (!isLoaded) - { - yield return null; - } - InitCardObject(); - uiMgr.closeInSceneCenterLoading(); - onFinish.Call(); - } - - private void InitCardObject() - { - List cardList2DObjs = UIManager.GetInstance().getCardList2DObjs(); - _cardObjectList = new List(cardList2DObjs); - cardList2DObjs.Clear(); - List cardListAssetPathList = Toolbox.ResourcesManager.CardListAssetPathList; - _loadedCardResourceList.AddRange(new List(cardListAssetPathList)); - cardListAssetPathList.Clear(); - if (_cardObjectList == null) - { - return; - } - for (int i = 0; i < _cardObjectList.Count; i++) - { - GameObject cardObject = _cardObjectList[i].CardObj; - cardObject.SetActive(value: false); - UITexture[] componentsInChildren = cardObject.GetComponentsInChildren(); - foreach (UITexture uITexture in componentsInChildren) - { - if (uITexture.name.Contains("CardTexture")) - { - UITexture component = uITexture.GetComponent(); - Material material = component.material; - component.mainTexture = material.mainTexture; - component.material = null; - } - } - cardObject.transform.parent = _cardObjectRoot.transform; - CardListTemplate component2 = cardObject.GetComponent(); - component2.HideNum(); - component2._newLabel.gameObject.SetActive(value: false); - component2.SetId(_cardObjectList[i].ids); - component2.SetScale(0.36f); - component2.AddDepth(20); - int tempIndex = i; - component2.AddColliderToFrame(0.9f).onClick = delegate - { - _cardDetailIndex = tempIndex; - _cardDetail.OnPushCardDetailOn(cardObject); - }; - } - } - - private void CardDetailDragCallback(Vector2 vec) - { - if (!_cardDetail.IsEnableShowDetail) - { - return; - } - float x = vec.x; - if (!(Mathf.Abs(x) < 70f)) - { - int num = _cardDetailIndex + ((!(x > 0f)) ? 1 : (-1)); - if (num >= 0 && _cardObjectList.Count > num) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - _cardDetail.CloseDefault(playSe: false); - _cardDetail.ShowCardDetail(_cardObjectList[num].CardObj); - _cardDetailIndex = num; - UpdateCardDetailArrowButtonVisible(); - } - } - } - - private void UpdateCardDetailArrowButtonVisible() - { - _cardDetail.LeftButtonVisible = _cardDetailIndex > 0; - _cardDetail.RightButtonVisible = _cardDetailIndex < _cardObjectList.Count - 1; - } - - private void UnloadCardObject() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedCardResourceList); - _loadedCardResourceList.Clear(); - if (_cardObjectList != null) - { - for (int i = 0; i < _cardObjectList.Count; i++) - { - UnityEngine.Object.Destroy(_cardObjectList[i].CardObj.gameObject); - } - _cardObjectList.Clear(); - } - } - - private void InitClassTab() - { - _spriteClassTab.atlas = _atlasProfile; - for (int i = 0; i < 9; i++) - { - CardBasePrm.ClanType classType = (CardBasePrm.ClanType)i; - string spriteBaseName = ((classType != CardBasePrm.ClanType.ALL) ? ("class_tab_" + i.ToString("00")) : "class_tab_neutral"); - _tabListClass.AddTab(delegate - { - if (classType != _displayClassType) - { - ShowExchangeableSpotCardList(classType); - } - }, spriteBaseName).name = "Class_" + i + "(Clone)"; - } - _tabListClass.Reset(); - } - - private void UpdateDisplaySpotCardPoint() - { - _labelSpotCardPoint.text = GetHaveSpotCardPoint().ToString(); - } - - private int GetHaveSpotCardPoint() - { - return PlayerStaticData.UserSpotCardPointCount; - } - - private void UpdateExchangeableSpotCardList(CardBasePrm.ClanType displayClassType) - { - SpotCardExchangeInfoTask task = new SpotCardExchangeInfoTask(); - StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate - { - _spotCardListInClassDict = task.ExchangeableSpotCardListInClassDict; - _prereleaseExchangeInfo = task.PrereleaseInfo; - UpdateDisplaySpotCardPoint(); - _labelSpotCardPoint.gameObject.SetActive(value: true); - ShowExchangeableSpotCardList(displayClassType); - })); - } - - private void ShowExchangeableSpotCardList(CardBasePrm.ClanType classType) - { - _displayClassType = classType; - List cardList = _spotCardListInClassDict[_displayClassType]; - _spotCardScrollView.SetVisiable(isVisiable: false); - if (cardList.Count > 0) - { - List list = new List(cardList.Count); - CardMaster.GetInstance(CardMaster.CardMasterId.Default); - for (int i = 0; i < cardList.Count; i++) - { - list.Add(cardList[i].CardId); - } - StartCoroutine(LoadCardObject(list, delegate - { - _spotCardScrollView.SetVisiable(isVisiable: true); - _spotCardScrollView.CreateScrollView(cardList.Count, InitializePlate); - _labelNoSpotCardList.gameObject.SetActive(value: false); - })); - } - else - { - _labelNoSpotCardList.gameObject.SetActive(value: true); - } - } - - private void InitializePlate(int index, GameObject plate) - { - List list = _spotCardListInClassDict[_displayClassType]; - if (index >= list.Count) - { - plate.SetActive(value: false); - return; - } - SpotCardExchangePlate component = plate.GetComponent(); - component.SetData(list[index], GetHaveSpotCardPoint(), _prereleaseExchangeInfo, OnClickConfirmExchangeButton); - component.SetCardObject(_cardObjectList[index].CardObj, _cardObjectRoot); - } - - private void OnClickConfirmExchangeButton(SpotCardExchangeInfo spotCardExchangeInfo) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - ShowConfirmExchangeDialog(spotCardExchangeInfo); - } - - private void ShowConfirmExchangeDialog(SpotCardExchangeInfo spotCardExchangeInfo) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("Shop_0153")); - dialogBase.SetButtonText(systemText.Get("Shop_0154")); - dialogBase.SetPanelDepth(100); - dialogBase.onPushButton1 = (Action)Delegate.Combine(dialogBase.onPushButton1, (Action)delegate - { - OnClickExchangeButton(spotCardExchangeInfo); - }); - PurchaseConfirm purchaseConfirm = UnityEngine.Object.Instantiate(_purchaseConfirmDialog); - dialogBase.SetObj(purchaseConfirm.gameObject); - purchaseConfirm.SetSpotCardPointConfirmDialog(spotCardExchangeInfo.ExchangePoint, systemText.Get("Shop_0152", spotCardExchangeInfo.GetExchangeCardText()), GetHaveSpotCardPoint()); - if (_prereleaseExchangeInfo.IsPrerelease && spotCardExchangeInfo.IsPrereleaseCard) - { - purchaseConfirm.SetWarningText(systemText.Get("Shop_0184", _prereleaseExchangeInfo.RemainingExchangeableCount.ToString())); - } - } - - private void OnClickExchangeButton(SpotCardExchangeInfo spotCardExchangeInfo) - { - SpotCardExchangeTask spotCardExchangeTask = new SpotCardExchangeTask(); - spotCardExchangeTask.SetParameter(spotCardExchangeInfo.CardId, spotCardExchangeInfo.ExchangePoint); - StartCoroutine(Toolbox.NetworkManager.Connect(spotCardExchangeTask, delegate - { - ShowSuccessExchangeDialog(spotCardExchangeInfo.GetExchangeCardText()); - UpdateDisplaySpotCardPoint(); - UpdateExchangeableSpotCardList(_displayClassType); - })); - } - - private void ShowSuccessExchangeDialog(string exchangedCardName) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(systemText.Get("Common_0021")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetText(systemText.Get("Shop_0155", exchangedCardName), isWrapText: true); - dialogBase.SetPanelDepth(100); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangeDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangeDialog.cs deleted file mode 100644 index 9dd70f75..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangeDialog.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Collections; -using UnityEngine; - -namespace Wizard; - -public class SpotCardExchangeDialog : MonoBehaviour -{ - private const int EXCHANGE_DIALOG_DEPTH = 900; - - [SerializeField] - private SpotCardExchange _spotCardExchangeOriginal; - - public void CreateSpotCardExchangeDialog() - { - if (FirstTips.IsFirstTipsOpen(FirstTips.TipsType.SpotCardExchange)) - { - CreateDialogWithFirstTips(); - } - else - { - CreateDialog(); - } - } - - private void CreateDialog() - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.XL); - dialogBase.SetTitleLabel(Data.SystemText.Get("Shop_0149")); - dialogBase.SetLayer("MyPage"); - dialogBase.SetPanelDepth(900); - SpotCardExchange spotCardExchange = Object.Instantiate(_spotCardExchangeOriginal); - dialogBase.SetObj(spotCardExchange.gameObject); - spotCardExchange.Init(); - } - - private void CreateDialogWithFirstTips() - { - UIManager.GetInstance().StartFirstTips(FirstTips.TipsType.SpotCardExchange); - StartCoroutine(CreateDialogAfterOpenFirstTips()); - } - - private IEnumerator CreateDialogAfterOpenFirstTips() - { - UIManager uiMgr = UIManager.GetInstance(); - while (!uiMgr.IsActiveFirstTips()) - { - yield return null; - } - yield return new WaitForSeconds(0.5f); - CreateDialog(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangeInfo.cs b/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangeInfo.cs deleted file mode 100644 index e3a0f9c1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangeInfo.cs +++ /dev/null @@ -1,50 +0,0 @@ -using LitJson; - -namespace Wizard; - -public class SpotCardExchangeInfo -{ - public enum ExchangeStatus - { - EnableExchange, - AlreadyExchange, - LimitOver - } - - public int CardId { get; private set; } - - public CardBasePrm.ClanType Class { get; private set; } - - public int PackId { get; private set; } - - public ExchangeStatus SpotCardExchangeStatus { get; private set; } - - public int ExchangePoint { get; private set; } - - public int ExchangeNum { get; private set; } - - public bool IsPrereleaseCard { get; private set; } - - public SpotCardExchangeInfo(JsonData data, int packId) - { - CardId = data["card_id"].ToInt(); - Class = (CardBasePrm.ClanType)data["class"].ToInt(); - PackId = packId; - SpotCardExchangeStatus = (ExchangeStatus)data["exchange_status"].ToInt(); - ExchangePoint = data["exchange_point"].ToInt(); - IsPrereleaseCard = data["is_pre_release"].ToBoolean(); - ExchangeNum = 1; - } - - public string GetExchangeCardText() - { - string userGoodsName = UserGoods.getUserGoodsName(UserGoods.Type.SpotCard, CardId); - return Data.SystemText.Get("Shop_0150", userGoodsName, ExchangeNum.ToString()); - } - - public string GetExchangeCardTextSmall() - { - string text = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(CardId).CardName + " " + Data.SystemText.Get("Shop_0248"); - return Data.SystemText.Get("Shop_0150", text, ExchangeNum.ToString()); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangePlate.cs b/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangePlate.cs deleted file mode 100644 index ef337eab..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpotCardExchangePlate.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using UnityEngine; -using Wizard.Scripts.Network.Data.TaskData.SpotCardExchange; - -namespace Wizard; - -public class SpotCardExchangePlate : MonoBehaviour -{ - private readonly Quaternion CARDOBJECT_ROTATION_QUATERNION = new Quaternion(0f, 0f, 0f, 0f); - - private const string SPOT_CARD_NUM_FORMAT = "[fcd24a]+{0}[-]"; - - [SerializeField] - private GameObject _objCardRoot; - - [SerializeField] - private UILabel _labelSpotCardName; - - [SerializeField] - private UILabel _labelCardPossessionNum; - - [SerializeField] - private UILabel _labelCardPossessionNumNormal; - - [SerializeField] - private UILabel _labelCardPossessionNumPremium; - - [SerializeField] - private UILabel _labelCostSpotCardPoint; - - [SerializeField] - private UIButton _btnExchangeSpotCard; - - [SerializeField] - private UILabel _labelExchanged; - - private GameObject _cardObject; - - public void SetData(SpotCardExchangeInfo spotCardInfo, int haveSpotCardPoint, SpotCardExchangeInfoTask.PrereleaseExchangeInfo prereleaseInfo, Action onClickExchangButton) - { - SystemText systemText = Data.SystemText; - string text = spotCardInfo.GetExchangeCardTextSmall(); - if (spotCardInfo.IsPrereleaseCard) - { - text = systemText.Get("Shop_0183", text); - } - _labelSpotCardName.text = text; - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - int possessionCardNum = dataMgr.GetPossessionCardNum(spotCardInfo.CardId, isIncludingSpotCard: false); - int spotCardNum = dataMgr.SpotCardData.GetSpotCardNum(spotCardInfo.CardId); - _labelCardPossessionNumNormal.text = possessionCardNum + ((spotCardNum > 0) ? $"[fcd24a]+{spotCardNum}[-]" : string.Empty); - int cardId = spotCardInfo.CardId + 1; - int possessionCardNum2 = dataMgr.GetPossessionCardNum(cardId, isIncludingSpotCard: false); - _labelCardPossessionNumPremium.text = possessionCardNum2.ToString(); - int num = possessionCardNum + possessionCardNum2 + spotCardNum; - _labelCardPossessionNum.text = num.ToString(); - string typeName = ""; - string detailName = ""; - ShopCommonUtility.GetRewardNames(12, 0L, spotCardInfo.ExchangePoint, out typeName, out detailName); - _labelCostSpotCardPoint.text = systemText.Get("Shop_0129", typeName, detailName); - switch (spotCardInfo.SpotCardExchangeStatus) - { - case SpotCardExchangeInfo.ExchangeStatus.AlreadyExchange: - _btnExchangeSpotCard.gameObject.SetActive(value: false); - _labelExchanged.gameObject.SetActive(value: true); - break; - case SpotCardExchangeInfo.ExchangeStatus.EnableExchange: - { - _btnExchangeSpotCard.onClick.Clear(); - _btnExchangeSpotCard.onClick.Add(new EventDelegate(delegate - { - onClickExchangButton(spotCardInfo); - })); - _btnExchangeSpotCard.gameObject.SetActive(value: true); - _labelExchanged.gameObject.SetActive(value: false); - bool flag = haveSpotCardPoint < spotCardInfo.ExchangePoint; - if (prereleaseInfo.IsPrerelease && spotCardInfo.IsPrereleaseCard) - { - flag |= prereleaseInfo.RemainingExchangeableCount <= 0; - } - UIManager.SetObjectToGrey(_btnExchangeSpotCard.gameObject, flag); - break; - } - case SpotCardExchangeInfo.ExchangeStatus.LimitOver: - _btnExchangeSpotCard.gameObject.SetActive(value: true); - _labelExchanged.gameObject.SetActive(value: false); - UIManager.SetObjectToGrey(_btnExchangeSpotCard.gameObject, b: true); - break; - } - } - - public void SetCardObject(GameObject cardObject, GameObject evacuationParent) - { - if (_cardObject != null) - { - _cardObject.SetActive(value: false); - _cardObject.transform.parent = evacuationParent.transform; - } - cardObject.transform.parent = _objCardRoot.transform; - cardObject.transform.localPosition = Vector3.zero; - cardObject.transform.rotation = CARDOBJECT_ROTATION_QUATERNION; - cardObject.SetActive(value: true); - _cardObject = cardObject; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SpringPanelWithUpdate.cs b/SVSim.BattleEngine/Engine/Wizard/SpringPanelWithUpdate.cs deleted file mode 100644 index ed627b42..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SpringPanelWithUpdate.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class SpringPanelWithUpdate : SpringPanel -{ - public Action onUpdate; - - public static SpringPanelWithUpdate Begin(GameObject go, Vector3 pos, float strength, Action onUpdate) - { - SpringPanelWithUpdate springPanelWithUpdate = go.GetComponent(); - if (springPanelWithUpdate == null) - { - springPanelWithUpdate = go.AddComponent(); - } - springPanelWithUpdate.target = pos; - springPanelWithUpdate.strength = strength; - springPanelWithUpdate.onFinished = null; - springPanelWithUpdate.onUpdate = onUpdate; - springPanelWithUpdate.enabled = true; - return springPanelWithUpdate; - } - - protected override void AdvanceTowardsPosition() - { - base.AdvanceTowardsPosition(); - onUpdate.Call(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StarterClassSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/StarterClassSelectDialog.cs index 80d821bb..1e930f2c 100644 --- a/SVSim.BattleEngine/Engine/Wizard/StarterClassSelectDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/StarterClassSelectDialog.cs @@ -67,7 +67,7 @@ public class StarterClassSelectDialog : MonoBehaviour { if (playSE) { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); + } if (classId != _selectedClassId) { diff --git a/SVSim.BattleEngine/Engine/Wizard/StarterPurchaseConfirmationDialog.cs b/SVSim.BattleEngine/Engine/Wizard/StarterPurchaseConfirmationDialog.cs index 5880e963..5daa6356 100644 --- a/SVSim.BattleEngine/Engine/Wizard/StarterPurchaseConfirmationDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/StarterPurchaseConfirmationDialog.cs @@ -73,10 +73,10 @@ public class StarterPurchaseConfirmationDialog : MonoBehaviour { onPurchase.Call(packConfig, info, 10, null, (CardBasePrm.ClanType)selectedClassId, null); }; - inDialog.ClickSe_Btn1 = Se.TYPE.SYS_BTN_DECIDE_TRANS; + inDialog.ClickSe_Btn1 = 0; _jpnLawButton.onClick.Add(new EventDelegate(delegate { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.LEGALTEXT); })); _jpaLawLine.gameObject.SetActive(value: true); @@ -111,7 +111,7 @@ public class StarterPurchaseConfirmationDialog : MonoBehaviour { int num = 10 * info.Cost; inDialog.SetButtonText(Data.SystemText.Get("Shop_0082")); - string clanNameByKey = GameMgr.GetIns().GetDataMgr().GetClanNameByKey(selectedClassId); + string clanNameByKey = selectedClassId.ToString(); // Pre-Phase-5b: no clan-name lookup _packPriceLabel.text = Data.SystemText.Get("Shop_0241", num.ToString()); _packConfirmLabel.text = Data.SystemText.Get("Shop_0242", packConfig.Title); _currentClassLabel.text = Data.SystemText.Get("Shop_0243", clanNameByKey); diff --git a/SVSim.BattleEngine/Engine/Wizard/StoryAISettingDataSet.cs b/SVSim.BattleEngine/Engine/Wizard/StoryAISettingDataSet.cs index 576d41c8..b0615fab 100644 --- a/SVSim.BattleEngine/Engine/Wizard/StoryAISettingDataSet.cs +++ b/SVSim.BattleEngine/Engine/Wizard/StoryAISettingDataSet.cs @@ -12,21 +12,8 @@ public class StoryAISettingDataSet _dataTable = new List(); } - public void AddData(StoryAISettingData data) - { - if (!_dataTable.Any((StoryAISettingData d) => d.EnemyAiId == data.EnemyAiId)) - { - _dataTable.Add(data); - } - } - public StoryAISettingData GetSettingData(int enemyAiId) { return _dataTable.First((StoryAISettingData d) => d.EnemyAiId == enemyAiId); } - - public List GetSettingDataTable() - { - return _dataTable; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/StoryChapterSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/StoryChapterSelectDialog.cs deleted file mode 100644 index e97ff65f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StoryChapterSelectDialog.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Linq; -using UnityEngine; - -namespace Wizard; - -public class StoryChapterSelectDialog : MonoBehaviour -{ - [SerializeField] - private GameObject _originalObject; - - [SerializeField] - private Transform _objRoot; - - [SerializeField] - private UILabel _descriptionText; - - public void Initialize(ScenarioSummary scenarioSummary, StoryChapterData chapterData, Action unitReadAction, Action allReadAction) - { - string chapterId = chapterData.ChapterId; - _descriptionText.text = Data.SystemText.Get("Story_0074", chapterId, chapterData.NextChapterId); - _originalObject.gameObject.SetActive(value: false); - bool isExistMaintenanceSubChapter = chapterData.SubChapterDatas.Any((StoryChapterData.SubChapterData item) => item.IsMaintenanceChapter); - GameObject obj = UnityEngine.Object.Instantiate(_originalObject, _objRoot); - obj.SetActive(value: true); - obj.GetComponent().AllRead(allReadAction, chapterData.AllReadButtonPath, isExistMaintenanceSubChapter); - foreach (StoryChapterData.SubChapterData subChapterData in chapterData.SubChapterDatas) - { - GameObject obj2 = UnityEngine.Object.Instantiate(_originalObject, _objRoot); - obj2.SetActive(value: true); - obj2.GetComponent().UnitRead(scenarioSummary.GetData(chapterId, subChapterData.SubChapterId), subChapterData, unitReadAction); - } - _objRoot.GetComponent().Reposition(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StoryFinishTask.cs b/SVSim.BattleEngine/Engine/Wizard/StoryFinishTask.cs index ffda418a..f6840288 100644 --- a/SVSim.BattleEngine/Engine/Wizard/StoryFinishTask.cs +++ b/SVSim.BattleEngine/Engine/Wizard/StoryFinishTask.cs @@ -14,23 +14,13 @@ public class StoryFinishTask : BaseTask public int is_finish; - public int evolve_count; - - public int total_turn; - public int deck_no; - public int use_build_deck; - public int deck_format; public int class_id; public Dictionary mission; - - public string recovery_data; - - public string[] prosessing_time_data; } public class StoryFinishTaskParamNoBattle : BaseParam @@ -38,10 +28,6 @@ public class StoryFinishTask : BaseTask public int story_id; public int is_finish; - - public string selection_chapter_id; - - public bool is_select_another_end; } private readonly int _storyId; @@ -63,44 +49,6 @@ public class StoryFinishTask : BaseTask }; } - public void SetParameter(int is_finish, int evolve_count, int total_turn, int deck_no, bool is_build_deck, Format format, int class_id) - { - StoryFinishTaskParam storyFinishTaskParam = new StoryFinishTaskParam(); - BattleManagerBase ins = BattleManagerBase.GetIns(); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - storyFinishTaskParam.story_id = _storyId; - storyFinishTaskParam.is_finish = is_finish; - storyFinishTaskParam.evolve_count = evolve_count; - storyFinishTaskParam.total_turn = total_turn; - storyFinishTaskParam.deck_no = deck_no; - storyFinishTaskParam.use_build_deck = (is_build_deck ? 1 : 0); - storyFinishTaskParam.deck_format = Data.FormatConvertApi(format); - storyFinishTaskParam.class_id = class_id; - if (RecoveryRecordManagerBase.IsExistsSingleRecoveryFile()) - { - if (dataMgr.RecoveryData == null) - { - dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_single.json")); - } - storyFinishTaskParam.recovery_data = dataMgr.RecoveryData.ToJson(); - } - BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true); - BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class; - storyFinishTaskParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass); - base.Params = storyFinishTaskParam; - } - - public void SetParameterNoBattle(bool isFinish, bool isSelectAnotherEnding, string chosenUnlockChapterId) - { - base.Params = new StoryFinishTaskParamNoBattle - { - story_id = _storyId, - is_finish = (isFinish ? 1 : 0), - is_select_another_end = isSelectAnotherEnding, - selection_chapter_id = (isFinish ? chosenUnlockChapterId : null) - }; - } - protected override int Parse() { int num = base.Parse(); diff --git a/SVSim.BattleEngine/Engine/Wizard/StoryLeaderSelectSummaryDialog.cs b/SVSim.BattleEngine/Engine/Wizard/StoryLeaderSelectSummaryDialog.cs deleted file mode 100644 index 7cd7fe8d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StoryLeaderSelectSummaryDialog.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class StoryLeaderSelectSummaryDialog : StorySummaryDialog -{ - [SerializeField] - private GameObject _charaSelectionButton; - - [SerializeField] - private UISprite _selectMarkSprite; - - [SerializeField] - private UIGrid _charaButtonGrid; - - private List _loadPathList = new List(); - - private List _charaSelectionButtons = new List(); - - private ClassSelectionButton _selectCharaSelectionButton; - - private TweenAlpha _selectMarkTweenAlpha; - - private Action _selectCharaAction; - - public void SetLeaderSelectSummary(string summary, bool isBattleSkipToggle, bool isMovieSubtitles, StoryChapterData chapterData, Action selectCharaAction) - { - _selectCharaAction = selectCharaAction; - _selectMarkTweenAlpha = _selectMarkSprite.GetComponent(); - List _classCharacterMasterDatas = new List(); - foreach (int charaId in chapterData.CharaIdList) - { - _classCharacterMasterDatas.Add(GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(charaId)); - } - ResourcesManager resMgr = Toolbox.ResourcesManager; - foreach (ClassCharacterMasterData item in _classCharacterMasterDatas) - { - _loadPathList.Add(resMgr.GetAssetTypePath(item.skin_id.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaButton)); - } - StartCoroutine(resMgr.LoadAssetGroupAsync(_loadPathList, delegate - { - SetSummary(summary, isBattleSkipToggle, isMovieSubtitles, chapterData, SummaryType.CharaSelect); - _charaSelectionButton.gameObject.SetActive(value: false); - foreach (ClassCharacterMasterData item2 in _classCharacterMasterDatas) - { - ClassSelectionButton component = UnityEngine.Object.Instantiate(_charaSelectionButton, _charaSelectionButton.transform.parent).GetComponent(); - component.gameObject.SetActive(value: true); - component.Init(item2, resMgr.LoadObject(resMgr.GetAssetTypePath(item2.skin_id.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaButton, isfetch: true)), OnClickCharaButton, isShowStoryClearLabel: false, isShowUsedLabel: false, showNotificationIcon: false); - _charaSelectionButtons.Add(component); - } - _charaButtonGrid.Reposition(); - SelectChara(_charaSelectionButtons.First()); - })); - } - - private void OnClickCharaButton(ClassSelectionButton classButton) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - SelectChara(classButton); - } - - private void SelectChara(ClassSelectionButton charaButton) - { - if (!(_selectCharaSelectionButton == charaButton)) - { - _selectCharaSelectionButton = charaButton; - _selectMarkSprite.transform.position = charaButton.transform.position; - _selectMarkTweenAlpha.PlayPingPong(isIncreaseAlpha: false); - _selectCharaAction(_selectCharaSelectionButton.ClassCharacterMasterData); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StoryNotification.cs b/SVSim.BattleEngine/Engine/Wizard/StoryNotification.cs index 5d4fdfce..6e5b4569 100644 --- a/SVSim.BattleEngine/Engine/Wizard/StoryNotification.cs +++ b/SVSim.BattleEngine/Engine/Wizard/StoryNotification.cs @@ -4,24 +4,11 @@ namespace Wizard; public class StoryNotification { - public bool IsDisplayRibbon { get; private set; } public bool IsDisplayBadge { get; private set; } - public void SetStoryNotification(JsonData data) - { - JsonData data2 = data["data"]["story_notification"]; - IsDisplayRibbon = data2.GetValueOrDefault("is_display_ribbon", defaultValue: false); - IsDisplayBadge = data2.GetValueOrDefault("is_display_badge", defaultValue: false); - } - public void SetIsDisplayBadge(JsonData data) { IsDisplayBadge = data.GetValueOrDefault("is_display_badge", defaultValue: false); } - - public void TurnOffIsDisplayBadge() - { - IsDisplayBadge = false; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/StorySectionBtn.cs b/SVSim.BattleEngine/Engine/Wizard/StorySectionBtn.cs deleted file mode 100644 index f622067c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StorySectionBtn.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class StorySectionBtn : MonoBehaviour -{ - public const string BTN_IMAGE_NAME_SUFFIX_OFF = "{0}_off"; - - public const string BTN_IMAGE_NAME_SUFFIX_ON = "{0}_on"; - - private const int POS_Y_NAME_LABEL = 14; - - private const int POS_Y_NAME_LABEL_COMPLETE = 0; - - private const int PROLOGUE_SECTION_ID = 0; - - [SerializeField] - private UILabel _labelSectionNo; - - [SerializeField] - private UILabel _labelSectionName; - - [SerializeField] - private UILabel _labelSectionClearClassNum; - - [SerializeField] - private Transform _labelSectionCenterRoot; - - [SerializeField] - private UILabel _labelSectionNameCenter; - - [SerializeField] - private UILabel _labelSectionClearClassNumCenter; - - [SerializeField] - private GameObject _labelNewMark; - - [SerializeField] - private UITexture _textureBtnImage; - - [SerializeField] - private UISprite _textureCompleteImage; - - private Texture _textureNormalImage; - - private Texture _texturePressImage; - - [SerializeField] - private UIButton _btnSectionSummary; - - public int SectionId { get; private set; } - - public void SetData(StorySectionData sectionData, Action onClickSectionBtn, bool isLimitedOrEventStory) - { - SectionId = sectionData.Id; - UILabel uILabel; - if (!isLimitedOrEventStory && Data.SystemText.Get("Dialog_Text_Alignment") == "Left") - { - _labelSectionNameCenter.gameObject.SetActive(value: false); - _labelSectionClearClassNumCenter.gameObject.SetActive(value: false); - _labelSectionNo.gameObject.SetActive(value: true); - _labelSectionName.gameObject.SetActive(value: true); - _labelSectionClearClassNum.gameObject.SetActive(value: true); - _labelSectionNo.text = sectionData.NameNo; - _labelSectionName.text = sectionData.Name; - uILabel = _labelSectionClearClassNum; - } - else - { - _labelSectionNameCenter.gameObject.SetActive(value: true); - _labelSectionClearClassNumCenter.gameObject.SetActive(value: true); - _labelSectionNo.gameObject.SetActive(value: false); - _labelSectionName.gameObject.SetActive(value: false); - _labelSectionClearClassNum.gameObject.SetActive(value: false); - _labelSectionNameCenter.text = sectionData.NameNo + sectionData.Name; - uILabel = _labelSectionClearClassNumCenter; - } - Vector3 localPosition = uILabel.transform.parent.transform.localPosition; - if (sectionData.ReleasedCharaCount > 0 && !sectionData.IsFinish) - { - uILabel.gameObject.SetActive(value: true); - uILabel.text = Data.SystemText.Get("Story_0063", sectionData.FinishedCharaCount.ToString(), sectionData.ReleasedCharaCount.ToString()); - uILabel.transform.parent.transform.localPosition = new Vector3(localPosition.x, 14f, localPosition.z); - } - else - { - uILabel.gameObject.SetActive(value: false); - uILabel.transform.parent.transform.localPosition = new Vector3(localPosition.x, 0f, localPosition.z); - } - _textureNormalImage = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath($"{sectionData.ImageName}_off", ResourcesManager.AssetLoadPathType.UiStory, isfetch: true)) as Texture; - _texturePressImage = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath($"{sectionData.ImageName}_on", ResourcesManager.AssetLoadPathType.UiStory, isfetch: true)) as Texture; - _textureBtnImage.mainTexture = _textureNormalImage; - if (sectionData.IsFinish) - { - _textureCompleteImage.gameObject.SetActive(value: true); - } - else - { - _textureCompleteImage.gameObject.SetActive(value: false); - } - UIEventListener uIEventListener = UIEventListener.Get(base.gameObject); - uIEventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener.onClick, (UIEventListener.VoidDelegate)delegate - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - onClickSectionBtn.Call(); - }); - UIEventListener uIEventListener2 = UIEventListener.Get(base.gameObject); - uIEventListener2.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(uIEventListener2.onPress, (UIEventListener.BoolDelegate)delegate - { - StartCoroutine(OnPressImage()); - }); - if (sectionData.IsUnderMaintenance) - { - SetDisableBtn(isDisable: true); - GameMgr.GetIns().GetPrefabMgr().Load("Prefab/UI/Menu/CardPanelMaintenancePlate"); - GameObject prefab = GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Menu/CardPanelMaintenancePlate"); - NGUITools.AddChild(base.gameObject, prefab).GetComponent().SetDepth(_labelSectionName.depth + 1); - } - if (sectionData.Id != 0 && !isLimitedOrEventStory) - { - _btnSectionSummary.gameObject.SetActive(value: true); - _btnSectionSummary.onClick.Clear(); - _btnSectionSummary.onClick.Add(new EventDelegate(delegate - { - OnClickSectionSummaryBtn(sectionData.Id); - })); - } - else - { - _btnSectionSummary.gameObject.SetActive(value: false); - } - DispNewMark(inDisp: false); - if (isLimitedOrEventStory) - { - LimitedStoryAjustPosition(); - } - } - - private void LimitedStoryAjustPosition() - { - _textureCompleteImage.transform.localPosition = new Vector3(178f, _textureCompleteImage.transform.localPosition.y, _textureCompleteImage.transform.localPosition.z); - _labelSectionCenterRoot.transform.localPosition = Vector3.zero; - _labelSectionNameCenter.width = 280; - _labelSectionNameCenter.height = 60; - } - - public void SetDisableBtn(bool isDisable) - { - UIManager.SetObjectToGrey(_textureBtnImage.gameObject, isDisable); - } - - private IEnumerator OnPressImage() - { - _textureBtnImage.mainTexture = _texturePressImage; - while (Input.GetMouseButton(0)) - { - yield return null; - } - _textureBtnImage.mainTexture = _textureNormalImage; - } - - private void OnClickSectionSummaryBtn(int sectionId) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - StorySectionSummaryDialog.Create(sectionId); - } - - public void DispNewMark(bool inDisp) - { - _labelNewMark.SetActive(inDisp); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StorySectionSummaryDialog.cs b/SVSim.BattleEngine/Engine/Wizard/StorySectionSummaryDialog.cs deleted file mode 100644 index f483d18f..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StorySectionSummaryDialog.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class StorySectionSummaryDialog : MonoBehaviour -{ - private const int FRAME_DEFAULT_HEIGHT = 87; - - private const int FRAME_OFFSET_HEIGHT_PER_LINE_COUNT = 28; - - private const int GRID_DEFAULT_CELL_HIEGHT = 28; - - private const string SUMMARY_TITLE_KEY_FORMAT = "story_section_summary_title_{0:D2}"; - - private const string SUMMARY_TEXT_KEY_FORMAT = "story_section_summary_text_{0:D2}"; - - private const string SUMMARTY_BG_TEXTURE_FORMAT = "bg_story_section_summary_{0:D2}"; - - [SerializeField] - private UITexture _textureBackGround; - - [SerializeField] - private UISprite _spriteSummaryFrame; - - [SerializeField] - private UISprite _spriteSummaryFramePanel; - - [SerializeField] - private UILabel _labelSectionSummary; - - [SerializeField] - private UIGrid _gridSummaryDetailLines; - - [SerializeField] - private UISprite _spriteSummaryDetailLine; - - private string _bgTexturePath; - - private int SummaryDefaultFontSize => _labelSectionSummary.fontSize; - - public static void Create(int sectionId) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/Dialog/StorySectionSummaryDialog")) as GameObject; - dialogBase.SetObj(gameObject); - gameObject.GetComponent().Initialize(dialogBase, sectionId); - } - - private void Initialize(DialogBase dialog, int sectionId) - { - string storySectionTitleText = Data.Master.GetStorySectionTitleText($"story_section_summary_title_{sectionId:D2}"); - dialog.SetTitleLabel(storySectionTitleText); - dialog.SetSize(DialogBase.Size.XL); - string storySectionTitleText2 = Data.Master.GetStorySectionTitleText($"story_section_summary_text_{sectionId:D2}"); - SetSummaryText(storySectionTitleText2); - SetFramePanelAtlas(); - UIManager.GetInstance().createInSceneCenterLoading(); - string bgTextureName = $"bg_story_section_summary_{sectionId:D2}"; - StartCoroutine(LoadBgTexture(bgTextureName, delegate - { - SetBackGroundTexture(bgTextureName); - DialogBase dialogBase = dialog; - dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, (Action)delegate - { - UnloadTexture(); - }); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private IEnumerator LoadBgTexture(string bgTextureName, Action onFinish) - { - _bgTexturePath = Toolbox.ResourcesManager.GetAssetTypePath(bgTextureName, ResourcesManager.AssetLoadPathType.UiStorySectionSummary); - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(_bgTexturePath, null)); - onFinish.Call(); - } - - private void UnloadTexture() - { - Toolbox.ResourcesManager.RemoveAsset(_bgTexturePath); - _bgTexturePath = null; - } - - private void SetBackGroundTexture(string bgTextureName) - { - Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(bgTextureName, ResourcesManager.AssetLoadPathType.UiStorySectionSummary, isfetch: true)) as Texture; - _textureBackGround.mainTexture = mainTexture; - } - - private void SetFramePanelAtlas() - { - UIManager.GetInstance().AttachAtlas(_spriteSummaryFramePanel.gameObject, isTargetChildren: false); - } - - private void SetSummaryText(string summaryText) - { - _labelSectionSummary.SetWrapText(summaryText); - int textLineCount = Global.GetTextLineCount(_labelSectionSummary.text); - int fontSizeDelta = SummaryDefaultFontSize - _labelSectionSummary.finalFontSize; - SetSummaryLayout(textLineCount, fontSizeDelta); - } - - private void SetSummaryLayout(int lineCount, int fontSizeDelta) - { - ResizeSummaryFrame(lineCount, fontSizeDelta); - GenerateDetailLineGrid(lineCount, fontSizeDelta); - } - - private void ResizeSummaryFrame(int lineCount, int fontSizeDelta) - { - int num = (28 - fontSizeDelta) * lineCount; - _spriteSummaryFrame.height = 87 + num; - } - - private void GenerateDetailLineGrid(int lineCount, int fontSizeDelta) - { - for (int i = 1; i < lineCount; i++) - { - NGUITools.AddChild(_gridSummaryDetailLines.gameObject, _spriteSummaryDetailLine.gameObject); - } - _gridSummaryDetailLines.cellHeight = 28 - fontSizeDelta; - UIUtil.AddPositionY(_gridSummaryDetailLines.transform, fontSizeDelta); - _gridSummaryDetailLines.Reposition(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StorySectionTask.cs b/SVSim.BattleEngine/Engine/Wizard/StorySectionTask.cs deleted file mode 100644 index 1e1262bb..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StorySectionTask.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using Wizard.Story; - -namespace Wizard; - -public class StorySectionTask : BaseTask -{ - public class StorySectionTaskParam : BaseParam - { - public bool is_disp_first_tips; - } - - public StorySectionTask(SelectedStoryInfo storyInfo) - { - base.type = GetApiType(storyInfo.StoryEntranceType); - } - - private static ApiType.Type GetApiType(StoryEntranceType storyType) - { - return storyType switch - { - StoryEntranceType.AllStory => ApiType.Type.AllStorySection, - StoryEntranceType.MainStory => ApiType.Type.MainStorySection, - StoryEntranceType.LimitedStory => ApiType.Type.LimitedStorySection, - StoryEntranceType.EventStory => ApiType.Type.EventStorySection, - _ => throw new NotImplementedException(), - }; - } - - public void SetParameter(bool isDispFirstTips) - { - StorySectionTaskParam storySectionTaskParam = new StorySectionTaskParam(); - storySectionTaskParam.is_disp_first_tips = isDispFirstTips; - base.Params = storySectionTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.StoryWorldDataManager.SetData(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StorySelectPage.cs b/SVSim.BattleEngine/Engine/Wizard/StorySelectPage.cs deleted file mode 100644 index aec96773..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StorySelectPage.cs +++ /dev/null @@ -1,408 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -using Wizard.Story; - -namespace Wizard; - -public class StorySelectPage : UIBase -{ - private const int NO_SECTION_ID = -1; - - private const int PROLOGUE_SECTION_ID = 0; - - private const int MAX_NUM_BTN_IN_TABLE = 6; - - private const float DRAG_DEGREE = 70f; - - private const float MOVE_PAGE_DURATION = 0.2f; - - [SerializeField] - private GameObject _backGroundObj; - - [SerializeField] - private UIAnchor _backGroundEffectAnchor; - - [SerializeField] - private UIGrid _sectionTableParent; - - [SerializeField] - private UIGrid _originalSectionTable; - - [SerializeField] - private StorySectionBtn _originalSectionBtn; - - [SerializeField] - private BoxCollider _flickCollider; - - [SerializeField] - private BoxCollider _leftButton; - - [SerializeField] - private BoxCollider _rightButton; - - [SerializeField] - private UIPageIndicator _indicator; - - [SerializeField] - private GameObject _mainStoryBgRoot; - - [SerializeField] - private GameObject _limitedStoryBgRoot; - - [SerializeField] - private UITexture _limitedStoryBgTexture; - - [SerializeField] - private GameObject _bgEffectRoot; - - private string _limitedStoryBgTextureName = "bg_limited_story"; - - private string _limitedStoryBgEffectName = "cmn_bg_limited_story_1"; - - private readonly Vector3 EFFECT_SCALE = new Vector3(320f, 320f, 320f); - - private List _sectionTableList = new List(); - - private List _sectionBtnList = new List(); - - private List _loadPathList = new List(); - - private TopBar _topBar; - - private Vector3 _parentFirstPos; - - private int _currentPage; - - private bool _isChangePage; - - private string _lastChapterClearTextId; - - public static int SelectSectionId = -1; - - private SelectedStoryInfo SelectedStoryInfo => Data.SelectedStoryInfo; - - private UIManager.ViewScene ChapterSelectionView => SelectedStoryInfo.ChapterSelectionView; - - private bool IsEntranceLimitedStory => SelectedStoryInfo.StoryEntranceType == StoryEntranceType.LimitedStory; - - public override void onFirstStart() - { - _backGroundObj.SetLayer(LayerMask.NameToLayer("FrontUI"), isSetChildren: true); - _backGroundEffectAnchor.uiCamera = NGUITools.FindCameraForLayer(_backGroundEffectAnchor.gameObject.layer); - base.IsShowFooterMenu = true; - base.onFirstStart(); - } - - protected override void onOpen() - { - base.onOpen(); - ResetSelectedStoryInfo(); - _mainStoryBgRoot.SetActive(!IsEntranceLimitedStory); - _limitedStoryBgRoot.SetActive(IsEntranceLimitedStory); - StorySectionTask storySectionTask = new StorySectionTask(SelectedStoryInfo); - storySectionTask.SetParameter(isDispFirstTips: false); - StartCoroutine(Toolbox.NetworkManager.Connect(storySectionTask, delegate - { - InitOrRedirect(); - })); - } - - protected override void onClose() - { - Final(); - base.onClose(); - } - - private void InitOrRedirect() - { - StorySectionData storySectionData = null; - if (SelectSectionId != -1) - { - storySectionData = Data.StoryWorldDataManager.FindSectionData(SelectSectionId); - SelectSectionId = -1; - } - if (storySectionData != null) - { - ChangeViewBySectionData(storySectionData, isRedirect: true); - } - else - { - Init(); - } - UIManager.GetInstance()._Footer.TurnOffStoryBadgeIcon(isTurnOffDisplayBadgeFlag: true); - } - - private void Init() - { - InitTopBar(); - InitFooter(); - InitStorySelect(); - } - - private void Final() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadPathList); - _loadPathList.Clear(); - } - - private void InitTopBar() - { - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - changeViewSceneParam.MyPageMenuIndex = 1; - changeViewSceneParam.IsCutCardMotion = true; - _topBar = UIManager.GetInstance().CreateTopBar(base.gameObject, Data.SystemText.Get("Story_0059"), UIManager.ViewScene.MyPage, MoneyDraw: false, changeViewSceneParam); - _topBar.gameObject.layer = LayerMask.NameToLayer("MyPage"); - } - - private void InitFooter() - { - UIManager instance = UIManager.GetInstance(); - instance.setBackScene(base.gameObject, UIManager.ViewScene.MyPage); - instance._Footer.UpdateCurrentIndex(1); - } - - private void InitStorySelect() - { - _parentFirstPos = _sectionTableParent.transform.localPosition; - UIEventListener uIEventListener = UIEventListener.Get(_flickCollider.gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDragPanel)); - UIEventListener uIEventListener2 = UIEventListener.Get(_rightButton.gameObject); - uIEventListener2.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener2.onClick, (UIEventListener.VoidDelegate)delegate - { - NextPage(); - }); - UIEventListener uIEventListener3 = UIEventListener.Get(_leftButton.gameObject); - uIEventListener3.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uIEventListener3.onClick, (UIEventListener.VoidDelegate)delegate - { - PrevPage(); - }); - StartCoroutine(LoadImages(delegate - { - SetSectionBtn(); - _indicator.Init(_sectionTableList.Count); - ChangePage(1); - UIManager.GetInstance().OnReadyViewScene(isFadein: true, null, OnFinishFadeIn); - })); - } - - private void OnDragPanel(GameObject obj, Vector2 dir) - { - if (dir.x >= 70f) - { - PrevPage(); - } - else if (dir.x <= -70f) - { - NextPage(); - } - } - - private void NextPage() - { - if (ChangePage(_currentPage + 1)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - - private void PrevPage() - { - if (ChangePage(_currentPage - 1)) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - - private bool ChangePage(int page, bool isAnimation = true) - { - if (_isChangePage) - { - return false; - } - if (!IsValidPage(page)) - { - return false; - } - _currentPage = page; - Vector3 vector = _parentFirstPos + Vector3.left * _sectionTableParent.cellWidth * (page - 1); - if (isAnimation) - { - TweenPosition tweenPosition = TweenPosition.Begin(_sectionTableParent.gameObject, 0.2f, vector); - _isChangePage = true; - tweenPosition.SetOnFinished(delegate - { - _isChangePage = false; - }); - } - else - { - _sectionTableParent.transform.localPosition = vector; - _isChangePage = false; - } - _rightButton.gameObject.SetActive(IsValidPage(page + 1)); - _leftButton.gameObject.SetActive(IsValidPage(page - 1)); - _indicator.UpdateIndicator(page); - return true; - } - - private bool IsValidPage(int page) - { - if (_sectionTableList.Count > 0 && page > 0) - { - return page <= _sectionTableList.Count; - } - return false; - } - - private void ChangeViewBySectionData(StorySectionData inSectionData, bool isRedirect = false) - { - if (inSectionData.Id == 0) - { - OnClickTutorialSectionBtn(); - return; - } - SelectedStoryInfo.SetSection(inSectionData); - GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.Story; - UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam(); - if (isRedirect) - { - changeViewSceneParam.WaitTime = 0f; - } - if (inSectionData.IsLeaderSelect) - { - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.ClassSelectionPage, changeViewSceneParam, ClassSelectionPageParam.CreateStorySelect()); - } - else - { - UIManager.GetInstance().ChangeViewScene(ChapterSelectionView, changeViewSceneParam); - } - } - - private void OnClickTutorialSectionBtn() - { - SelectedStoryInfo.SetSection(StorySection.TUTORIAL_SECTION_ID); - SelectedStoryInfo.SetSectionChara(500008); - UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.AreaSelect); - } - - private IEnumerator LoadImages(Action callBack) - { - IReadOnlyList sectionDatas = Data.StoryWorldDataManager.SectionDatas; - ResourcesManager resMgr = Toolbox.ResourcesManager; - List assetList = new List(); - for (int i = 0; i < sectionDatas.Count; i++) - { - string imageName = sectionDatas[i].ImageName; - assetList.Add(resMgr.GetAssetTypePath($"{imageName}_off", ResourcesManager.AssetLoadPathType.UiStory)); - assetList.Add(resMgr.GetAssetTypePath($"{imageName}_on", ResourcesManager.AssetLoadPathType.UiStory)); - } - if (IsEntranceLimitedStory) - { - assetList.Add(resMgr.GetAssetTypePath(_limitedStoryBgTextureName, ResourcesManager.AssetLoadPathType.UiStory)); - assetList.Add(resMgr.GetAssetTypePath(_limitedStoryBgEffectName, ResourcesManager.AssetLoadPathType.Effect2D)); - } - yield return StartCoroutine(resMgr.LoadAssetGroupAsync(assetList, null)); - _loadPathList.AddRange(assetList); - if (IsEntranceLimitedStory) - { - bool isLoadBGEffect = false; - GameObject effectObject = UnityEngine.Object.Instantiate(resMgr.LoadObject(resMgr.GetAssetTypePath(_limitedStoryBgEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true))); - effectObject.transform.SetParent(_bgEffectRoot.transform); - effectObject.transform.localScale = EFFECT_SCALE; - _limitedStoryBgTexture.mainTexture = resMgr.LoadObject(resMgr.GetAssetTypePath(_limitedStoryBgTextureName, ResourcesManager.AssetLoadPathType.UiStory, isfetch: true)) as Texture; - _loadPathList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectObject, delegate - { - isLoadBGEffect = true; - })); - while (!isLoadBGEffect) - { - yield return null; - } - effectObject.SetActive(value: true); - } - callBack.Call(); - } - - private void SetSectionBtn() - { - IReadOnlyList sectionDatas = Data.StoryWorldDataManager.SectionDatas; - _sectionBtnList.Clear(); - for (int i = 0; i < sectionDatas.Count; i++) - { - StorySectionData data = sectionDatas[i]; - CreateSectionBtn(onClickSectionBtn: (!data.IsSpoiler) ? ((Action)delegate - { - ChangeViewBySectionData(data); - }) : ((Action)delegate - { - CreateSpoilerConfirmationDialog(data); - }), sectionData: data); - } - _originalSectionBtn.gameObject.SetActive(value: false); - for (int num = 0; num < _sectionTableList.Count; num++) - { - _sectionTableList[num].Reposition(); - } - _sectionTableParent.Reposition(); - } - - public void CreateSpoilerConfirmationDialog(StorySectionData inSectionData) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetTitleLabel(systemText.Get("Story_0080")); - dialogBase.SetButtonText(systemText.Get("Story_0081")); - string text = inSectionData.Name; - text = text.Replace("\n", " "); - string text2 = systemText.Get("Story_0076", text, Data.Master.GetStorySectionTitleText(inSectionData.SpoilerMessage)); - dialogBase.SetText(text2); - dialogBase.onPushButton1 = delegate - { - ChangeViewBySectionData(inSectionData); - }; - } - - private void CreateSectionBtn(StorySectionData sectionData, Action onClickSectionBtn) - { - if (_sectionBtnList.Count % 6 == 0) - { - _sectionTableList.Add(NGUITools.AddChild(_sectionTableParent.gameObject, _originalSectionTable.gameObject).GetComponent()); - } - GameObject obj = NGUITools.AddChild(_sectionTableList[_sectionTableList.Count - 1].gameObject, _originalSectionBtn.gameObject); - StorySectionBtn component = obj.GetComponent(); - bool isLimitedOrEventStory = sectionData.StoryApiType == StoryApiType.LimitedStory || sectionData.StoryApiType == StoryApiType.EventStory; - component.SetData(sectionData, onClickSectionBtn, isLimitedOrEventStory); - component.DispNewMark(sectionData.IsNew); - _sectionBtnList.Add(component); - UIEventListener uIEventListener = UIEventListener.Get(obj.gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDragPanel)); - } - - private void OnFinishFadeIn() - { - if (_lastChapterClearTextId != null) - { - SystemText systemText = Data.SystemText; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetTitleLabel(systemText.Get("Common_0021")); - dialogBase.SetButtonText(systemText.Get("Common_0004")); - dialogBase.SetText(systemText.Get(_lastChapterClearTextId)); - dialogBase.OnClose = delegate - { - AreaSelectUI.CheckPreBuildDeckConfirmDialog(); - }; - _lastChapterClearTextId = null; - } - } - - private void ResetSelectedStoryInfo() - { - _lastChapterClearTextId = SelectedStoryInfo.LastChapterClearTextId; - SelectedStoryInfo.ClearInfoForSectionSelectionScene(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/StorySummaryDialog.cs b/SVSim.BattleEngine/Engine/Wizard/StorySummaryDialog.cs deleted file mode 100644 index 67b39d3a..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/StorySummaryDialog.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public class StorySummaryDialog : MonoBehaviour -{ - public enum SummaryType - { - SummaryOnly, - ClassNameList, - CharaSelect - } - - private readonly Vector3 SUMMARY_LABEL_POS = Vector3.zero; - - private readonly Vector3 SUMMARY_LABEL_POS_BATTLESKIP = new Vector3(0f, 52f, 0f); - - private readonly Vector3 SUMMARY_LABEL_POS_CLASSLIST = new Vector3(0f, 62f, 0f); - - private readonly Vector3 SUMMARY_LABEL_POS_CHARALIST = new Vector3(0f, 131f, 0f); - - private readonly Vector3 SUMMARY_LABEL_POS_BATTLESKIP_CLASSLIST = new Vector3(0f, 96f, 0f); - - private readonly Vector3 SUMMARY_LABEL_POS_BATTLESKIP_CHARALIST = new Vector3(0f, 131f, 0f); - - private readonly Vector3 CLASS_PARENT_POS = new Vector3(0f, -70f, 0f); - - private readonly Vector3 CLASS_PARENT_POS_BATTLESKIP = Vector3.zero; - - private readonly Vector3 CHARA_PARENT_POS = new Vector3(0f, -53f, 0f); - - private readonly Vector3 CHARA_LINE_POS = new Vector3(0f, 24f, 0f); - - [SerializeField] - private UILabel _summaryLabel; - - [SerializeField] - private GameObject _toggleParent; - - [SerializeField] - private UIToggle _toggleSingle; - - [SerializeField] - private UILabel _labelToggleSingle; - - [SerializeField] - private UIToggle _toggleBattleSkip; - - [SerializeField] - private UIToggle _toggleMovieSubtitles; - - [SerializeField] - private GameObject _iconObjectParent; - - [SerializeField] - private UITable _classIconNameTable_1; - - [SerializeField] - private UITable _classIconNameTable_2; - - [SerializeField] - private ClassIconName _classIconNameOriginal; - - [SerializeField] - private GameObject _charaSlectLineObject; - - private SummaryType _summaryType; - - public void SetSummary(string summary, bool isBattleSkipToggle, bool isMovieSubtitles, StoryChapterData chapterData, SummaryType summaryType) - { - _summaryType = summaryType; - SetToggleButtons(isBattleSkipToggle, isMovieSubtitles); - bool flag = isBattleSkipToggle || isMovieSubtitles; - _summaryLabel.height = (flag ? 208 : 264); - _summaryLabel.SetWrapText(summary); - switch (_summaryType) - { - case SummaryType.SummaryOnly: - SetLayoutSummaryOnly(flag); - break; - case SummaryType.ClassNameList: - SetLayoutClassNameList(flag, chapterData); - break; - case SummaryType.CharaSelect: - SetLayoutCharaSelect(flag); - break; - } - } - - public void SetLayoutSummaryOnly(bool isToggle) - { - _iconObjectParent.gameObject.SetActive(value: false); - _summaryLabel.transform.localPosition = (isToggle ? SUMMARY_LABEL_POS_BATTLESKIP : SUMMARY_LABEL_POS); - } - - public void SetLayoutClassNameList(bool isToggle, StoryChapterData chapterData) - { - SetAbleDeckClassList(chapterData.AvailableDeckClassList); - _iconObjectParent.gameObject.SetActive(value: true); - _summaryLabel.transform.localPosition = (isToggle ? SUMMARY_LABEL_POS_BATTLESKIP_CLASSLIST : SUMMARY_LABEL_POS_CLASSLIST); - _iconObjectParent.transform.localPosition = (isToggle ? CLASS_PARENT_POS_BATTLESKIP : CLASS_PARENT_POS); - } - - public void SetLayoutCharaSelect(bool isToggle) - { - _summaryLabel.transform.localPosition = (isToggle ? SUMMARY_LABEL_POS_BATTLESKIP_CHARALIST : SUMMARY_LABEL_POS_CHARALIST); - if (!isToggle) - { - _iconObjectParent.transform.localPosition = CHARA_PARENT_POS; - _charaSlectLineObject.transform.localPosition = CHARA_LINE_POS; - } - } - - private void SetToggleButtons(bool isBattleSkip, bool isMovieSubtitles) - { - if (!isBattleSkip && !isMovieSubtitles) - { - _toggleParent.SetActive(value: false); - return; - } - _toggleParent.SetActive(value: true); - _toggleSingle.gameObject.SetActive(value: false); - _toggleBattleSkip.gameObject.SetActive(value: false); - _toggleMovieSubtitles.gameObject.SetActive(value: false); - if (isBattleSkip && isMovieSubtitles) - { - SetBattleSkipToggle(_toggleBattleSkip); - SetMovieSubtitlesToggle(_toggleMovieSubtitles); - } - else if (isBattleSkip) - { - SetBattleSkipToggle(_toggleSingle); - _labelToggleSingle.text = Data.SystemText.Get("Story_0035"); - } - else if (isMovieSubtitles) - { - SetMovieSubtitlesToggle(_toggleSingle); - _labelToggleSingle.text = Data.SystemText.Get("OtherConfig_0064"); - } - } - - private void SetBattleSkipToggle(UIToggle toggle) - { - toggle.gameObject.SetActive(value: true); - toggle.value = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SKIP_CLEARED_STORY_BATTLE); - bool isFirst = true; - EventDelegate.Add(toggle.onChange, delegate - { - if (!isFirst) - { - GameMgr.GetIns().GetSoundMgr().PlayToggleSe(toggle.value); - } - isFirst = false; - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.IS_SKIP_CLEARED_STORY_BATTLE, toggle.value); - }); - } - - private void SetMovieSubtitlesToggle(UIToggle toggle) - { - toggle.gameObject.SetActive(value: true); - toggle.value = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES); - bool isFirst = true; - EventDelegate.Add(toggle.onChange, delegate - { - if (!isFirst) - { - GameMgr.GetIns().GetSoundMgr().PlayToggleSe(toggle.value); - } - isFirst = false; - PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES, toggle.value); - }); - } - - private void SetAbleDeckClassList(List classIds) - { - _classIconNameOriginal.gameObject.SetActive(value: false); - _classIconNameTable_1.gameObject.SetActive(value: true); - if (classIds.Count > _classIconNameTable_1.columns) - { - _classIconNameTable_2.gameObject.SetActive(value: true); - } - else - { - _classIconNameTable_2.gameObject.SetActive(value: false); - } - for (int i = 0; i < classIds.Count; i++) - { - ClassIconName classIconName = null; - classIconName = ((i >= _classIconNameTable_1.columns) ? NGUITools.AddChild(_classIconNameTable_2.gameObject, _classIconNameOriginal.gameObject).GetComponent() : NGUITools.AddChild(_classIconNameTable_1.gameObject, _classIconNameOriginal.gameObject).GetComponent()); - classIconName.SetClass(classIds[i]); - classIconName.gameObject.SetActive(value: true); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SubClassSelectDialog.cs b/SVSim.BattleEngine/Engine/Wizard/SubClassSelectDialog.cs deleted file mode 100644 index 8e744cc1..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/SubClassSelectDialog.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class SubClassSelectDialog : MonoBehaviour -{ - [SerializeField] - private UIGrid _subClassButtonGrid; - - [SerializeField] - private ClassSelectionButton _classButtonParts; - - [SerializeField] - private GameObject _selectMarkSubClass; - - private ClassSelectionButton _firstSelectClassButton; - - private List _loadPathList = new List(); - - public ClassCharacterMasterData SelectCharaMasterData { get; private set; } - - public static DialogBase Create(DeckData srcDeck, SubClassSelectDialog prefab, List usedClass, Action onClickButton1) - { - UIManager.GetInstance().createInSceneCenterLoading(); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0282")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - dialogBase.SetButtonText(Data.SystemText.Get("Card_0284")); - dialogBase.SetPanelDepth(100); - SubClassSelectDialog subClassSelectParts = UnityEngine.Object.Instantiate(prefab.gameObject).GetComponent(); - dialogBase.SetObj(subClassSelectParts.gameObject); - UIManager.GetInstance().StartCoroutine(subClassSelectParts.Init(srcDeck, usedClass, delegate - { - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - dialogBase.onPushButton1 = delegate - { - onClickButton1.Call(subClassSelectParts.SelectCharaMasterData.class_id); - }; - return dialogBase; - } - - private IEnumerator Init(DeckData srcDeck, List usedClass, Action onComplete) - { - int num = 9; - _selectMarkSubClass.SetActive(value: false); - _classButtonParts.gameObject.SetActive(value: false); - DataMgr dataMgr = GameMgr.GetIns().GetDataMgr(); - List classCharacterMasterDatas = new List(); - for (int i = 1; i < num; i++) - { - classCharacterMasterDatas.Add(dataMgr.GetCharaPrmByClassId(i)); - } - ResourcesManager resMgr = Toolbox.ResourcesManager; - foreach (ClassCharacterMasterData item in classCharacterMasterDatas) - { - _loadPathList.Add(resMgr.GetAssetTypePath(item.skin_id.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaButton)); - } - _loadPathList.Add(resMgr.GetAssetTypePath("empty", ResourcesManager.AssetLoadPathType.ClassCharaButton)); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadPathList, null)); - foreach (ClassCharacterMasterData item2 in classCharacterMasterDatas) - { - if (item2.class_id != srcDeck.GetDeckClassID()) - { - GameObject obj = NGUITools.AddChild(_subClassButtonGrid.gameObject, _classButtonParts.gameObject); - bool flag = usedClass.Contains(item2.class_id); - ClassSelectionButton component = obj.GetComponent(); - component.Init(item2, resMgr.LoadObject(resMgr.GetAssetTypePath(item2.skin_id.ToString(), ResourcesManager.AssetLoadPathType.ClassCharaButton, isfetch: true)), OnClickClassButton, isShowStoryClearLabel: false, flag, showNotificationIcon: false); - obj.SetActive(value: true); - if (_firstSelectClassButton == null && !flag) - { - _firstSelectClassButton = component; - } - } - } - _subClassButtonGrid.Reposition(); - SetSelection(_firstSelectClassButton); - _selectMarkSubClass.SetActive(value: true); - onComplete.Call(); - } - - private void OnClickClassButton(ClassSelectionButton classButton) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON); - SelectSubClass(classButton); - } - - private void SelectSubClass(ClassSelectionButton classButton) - { - if (SelectCharaMasterData != classButton.ClassCharacterMasterData) - { - SetSelection(classButton); - } - } - - private void SetSelection(ClassSelectionButton classButton) - { - SelectCharaMasterData = classButton.ClassCharacterMasterData; - _selectMarkSubClass.transform.position = classButton.transform.position; - } - - private void OnDestroy() - { - if (_loadPathList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadPathList); - _loadPathList.Clear(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/SystemText.cs b/SVSim.BattleEngine/Engine/Wizard/SystemText.cs index f3e3b3c9..46619169 100644 --- a/SVSim.BattleEngine/Engine/Wizard/SystemText.cs +++ b/SVSim.BattleEngine/Engine/Wizard/SystemText.cs @@ -12,9 +12,7 @@ public class SystemText private enum PARSE_TYPE { NORMAL, - SINGULAR_PLURAL, - MAX - } + SINGULAR_PLURAL } private string[] patternTbl = new string[2] { "{(?[^@{}]*?(?-?\\d+)[^@{}]*?)}", "{(?[^@{}]*?(?-?\\d+)[^@{}]*?)@(?[^@{}]+?)@(?[^@{}]+?)}" }; @@ -22,21 +20,6 @@ public class SystemText public string RegionCode { get; private set; } - public Global.LANG_TYPE RegionCodeLangType - { - get - { - foreach (Global.LANG_TYPE item in Enum.GetValues(typeof(Global.LANG_TYPE)).Cast()) - { - if (item.ToString() == RegionCode) - { - return item; - } - } - return Global.LANG_TYPE.Jpn; - } - } - public SystemText() { RegionCode = CustomPreference.GetTextLanguage(); @@ -57,41 +40,6 @@ public class SystemText LocalizeJson.Parse(dic, RegionCode, textAsset.ToString()); } - public void Initialize() - { - LoadAndParse("commontext", TextDictionary); - LoadAndParse("dialogtext", TextDictionary); - LoadAndParse("loadtext", TextDictionary); - LoadAndParse("titletext", TextDictionary); - LoadAndParse("mypagetext", TextDictionary); - LoadAndParse("accounttext", TextDictionary); - LoadAndParse("mailtext", TextDictionary); - LoadAndParse("missiontext", TextDictionary); - LoadAndParse("storytext", TextDictionary); - LoadAndParse("battletext", TextDictionary); - LoadAndParse("tutorialtext", TextDictionary); - LoadAndParse("cardtext", TextDictionary); - LoadAndParse("shoptext", TextDictionary); - LoadAndParse("othertoptext", TextDictionary); - LoadAndParse("otherfriendtext", TextDictionary); - LoadAndParse("otherconfigtext", TextDictionary); - LoadAndParse("otherprofiletext", TextDictionary); - LoadAndParse("otherrankingtext", TextDictionary); - LoadAndParse("othersharemovietext", TextDictionary); - LoadAndParse("othercodetext", TextDictionary); - LoadAndParse("videohostingtext", TextDictionary); - LoadAndParse("urltext", TextDictionary); - LoadAndParse("loginbonus", TextDictionary); - LoadAndParse("ranknametext", TextDictionary); - LoadAndParse("guildtext", TextDictionary); - LoadAndParse("sealedtext", TextDictionary); - LoadAndParse("gatheringtext", TextDictionary); - LoadAndParse("battlepasstext", TextDictionary); - LoadAndParse("myrotationtext", TextDictionary); - LoadAndParse("heroesbattletext", TextDictionary); - LoadAndParse("speedchallengetext", TextDictionary); - } - public string Get(string key) { return Get(key, enableDebugReturn: true); @@ -155,9 +103,4 @@ public class SystemText } return text; } - - public int Count(string searchStr) - { - return TextDictionary.Keys.Where((string c) => c.Contains(searchStr)).Count(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/TagCollectionType.cs b/SVSim.BattleEngine/Engine/Wizard/TagCollectionType.cs index a7d52fe5..a974902d 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TagCollectionType.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TagCollectionType.cs @@ -68,7 +68,6 @@ public enum TagCollectionType MemberBattleBonusRate, MemberBattleBonus, MemberEvoBonus, - MetamorphoseToken, ModifyHeal, NoInstantAttack, NoNormalEvo, diff --git a/SVSim.BattleEngine/Engine/Wizard/ToolboxGame.cs b/SVSim.BattleEngine/Engine/Wizard/ToolboxGame.cs index f7cf9482..1af396ac 100644 --- a/SVSim.BattleEngine/Engine/Wizard/ToolboxGame.cs +++ b/SVSim.BattleEngine/Engine/Wizard/ToolboxGame.cs @@ -1,96 +1,32 @@ -using System.Collections; -using UnityEngine; - -namespace Wizard; - -public static class ToolboxGame -{ - private enum SYSTEM_INIT - { - SYSTEM_NOT_READY, - SYSTEM_READY - } - - public static SetUp SetUp = null; - - public static UIManager UIManager = null; - - public static GameMgr GameManager = null; - - public static bool isLoadFromLocal = false; - - public static bool isLoadLocalSound = false; - - public static bool bDebugLogMode = true; - - private static Transform _gameTransform = null; - - public static RealTimeNetworkAgent RealTimeNetworkAgent - { - // Soft read: returns null when no scope is active, mirroring GetIns. Engine code reads this - // via `ToolboxGame.RealTimeNetworkAgent?.Foo`-style patterns (network-send paths gated on a - // non-null agent), so a null on the unwrapped path is the correct degrade — not a throw. - get => SVSim.BattleEngine.Ambient.BattleAmbient.Current?.NetworkAgent; - } - - public static Transform GameTransform - { - get - { - if (!_gameTransform) - { - GameObject gameObject = GameObject.Find("_Game"); - if ((bool)gameObject) - { - _gameTransform = gameObject.transform; - } - } - return _gameTransform; - } - } - - public static void Clear() - { - UIManager = null; - GameManager = null; - } - - public static void ClearUIManager() - { - UIManager = null; - } - - public static void SetRealTimeNetworkBattle(RealTimeNetworkAgent agent) - { - // Strict: must be inside a scope to set the per-session agent. Forcing-function — any - // historical unwrapped caller (no production callsite remains) now fails fast. - SVSim.BattleEngine.Ambient.BattleAmbient.Require().NetworkAgent = agent; - } - - public static void DestroyNetworkAgent() - { - var c = SVSim.BattleEngine.Ambient.BattleAmbient.Current; - var current = c?.NetworkAgent; - if (current != null) - { - Object.DestroyImmediate(current.gameObject); - c.NetworkAgent = null; - } - } - - public static IEnumerator CreateRealTimeNetworkBattleAgent(Matching matching = null) - { - string loadObjectPath = "TurnBase/_TurnBaseManager"; - if (GameMgr.GetIns().IsAINetwork) - { - loadObjectPath = "TurnBase/_AINetworkBaseManager"; - } - yield return BattleCoroutine.GetInstance().StartCoroutine(GameMgr.GetIns().GetPrefabMgr().LoadAync(loadObjectPath)); - NGUITools.AddChild(GameObject.Find("_Game"), GameMgr.GetIns().GetPrefabMgr().Get(loadObjectPath)); - yield return null; - if (matching != null) - { - RealTimeNetworkAgent.SettingMatchingClass(matching); - } - } -} +using UnityEngine; + +namespace Wizard; + +public static class ToolboxGame +{ + public static UIManager UIManager = null; + + public static RealTimeNetworkAgent RealTimeNetworkAgent + { + // Instance-backed via BattleManagerBase.InstanceNetworkAgent (Phase 5, chunk 40 — ambient + // fallback dropped after chunk 38 converted all 60 consumers to per-mgr reads). + get => BattleManagerBase.GetIns()?.InstanceNetworkAgent; + } + + public static void SetRealTimeNetworkBattle(RealTimeNetworkAgent agent) + { + var mgr = BattleManagerBase.GetIns() + ?? throw new System.InvalidOperationException("SetRealTimeNetworkBattle called with no attached mgr."); + mgr.InstanceNetworkAgent = agent; + } + + public static void DestroyNetworkAgent() + { + var mgr = BattleManagerBase.GetIns(); + if (mgr?.InstanceNetworkAgent is { } m) + { + Object.DestroyImmediate(m.gameObject); + mgr.InstanceNetworkAgent = null; + } + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentCell.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentCell.cs deleted file mode 100644 index 4870a204..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentCell.cs +++ /dev/null @@ -1,178 +0,0 @@ -using Cute; -using UnityEngine; - -namespace Wizard; - -public class TournamentCell : MonoBehaviour -{ - [SerializeField] - private UITexture _emblemTexture; - - [SerializeField] - private UILabel _nameLabel; - - [SerializeField] - private GameObject _activePlate; - - [SerializeField] - private GameObject _winPlate; - - [SerializeField] - private GameObject _losePlate; - - [SerializeField] - private GameObject _loseByDefaultPlate; - - [SerializeField] - private GameObject _championPlate; - - [SerializeField] - private GameObject _youMark; - - [SerializeField] - private UISprite _lineDownSprite; - - [SerializeField] - private UISprite _lineUpSprite; - - [SerializeField] - private Transform _leftConnectorTransform; - - [SerializeField] - private Transform _rightConnectorTransform; - - [SerializeField] - private UILabel _isFinalMatchResetLabel; - - private Transform _lineEndTransform; - - private const string DEFAULT_LINE_SPRITE_NAME = "Line_tournament"; - - private const string ACTIVE_LINE_SPRITE_NAME = "Line_tournament_active"; - - private const string PRE_EXTRA_LINE_SPRITE_NAME = "Line_tournament_Final"; - - private const string WIN_PRE_EXTRA_LINE_SPRITE_NAME = "Line_win_tournament_Final"; - - private const string WIN_LINE_SPRITE_NAME = "Line_win_tournament"; - - public TournamentCellData Data { get; private set; } - - public Transform LeftConnectorTransform => _leftConnectorTransform; - - public Transform RightConnectorTransform => _rightConnectorTransform; - - public void Setup(TournamentCellData data) - { - Data = data; - _nameLabel.gameObject.SetActive(data.Name != string.Empty); - _nameLabel.text = data.Name; - _emblemTexture.gameObject.SetActive(data.EmblemId > 0); - _emblemTexture.mainTexture = Toolbox.ResourcesManager.LoadObject(Data.GetEmblemPath()) as Texture; - _isFinalMatchResetLabel.gameObject.SetActive(data.IsFinalMatchReset); - SetupState(); - SetupLineVisible(); - SetYouMarkVisible(isVisible: false); - } - - private void SetupState() - { - TournamentCellData.CellState state = Data.State; - _activePlate.SetActive(state == TournamentCellData.CellState.Active); - _winPlate.SetActive(state == TournamentCellData.CellState.Win); - _losePlate.SetActive(state == TournamentCellData.CellState.Lose); - _loseByDefaultPlate.SetActive(state == TournamentCellData.CellState.LoseByDefault); - _championPlate.SetActive(Data.IsChampion); - switch (state) - { - case TournamentCellData.CellState.Blank: - case TournamentCellData.CellState.LoseByDefault: - _emblemTexture.gameObject.SetActive(value: false); - _nameLabel.gameObject.SetActive(value: false); - break; - case TournamentCellData.CellState.Lose: - { - UIManager.SetObjectToGrey(base.gameObject, b: true); - UISprite lineSprite = GetLineSprite(); - if (lineSprite != null) - { - lineSprite.color = Color.white; - } - break; - } - } - } - - private void SetupLineVisible() - { - UISprite lineSprite = GetLineSprite(); - _lineDownSprite.gameObject.SetActive(lineSprite == _lineDownSprite); - _lineUpSprite.gameObject.SetActive(lineSprite == _lineUpSprite); - if (!(lineSprite == null)) - { - string spriteName = "Line_tournament"; - if (Data.State == TournamentCellData.CellState.Active) - { - spriteName = "Line_tournament_active"; - } - else if (Data.IsPreExtra) - { - spriteName = ((Data.State == TournamentCellData.CellState.Win) ? "Line_win_tournament_Final" : "Line_tournament_Final"); - } - else if (Data.State == TournamentCellData.CellState.Win) - { - spriteName = "Line_win_tournament"; - } - lineSprite.spriteName = spriteName; - } - } - - private UISprite GetLineSprite() - { - if (Data.IsTerminal) - { - return null; - } - if (Data.Line != TournamentCellData.LineType.Down) - { - return _lineUpSprite; - } - return _lineDownSprite; - } - - public void SetLineEndTransform(Transform lineEndTransform) - { - _lineEndTransform = lineEndTransform; - } - - public void UpdateLine() - { - UISprite lineSprite = GetLineSprite(); - if (!(lineSprite == null)) - { - Vector3 localPosition = _rightConnectorTransform.localPosition; - Vector3 vector; - if (Data.IsPreExtra) - { - vector = (localPosition + base.transform.InverseTransformPoint(_lineEndTransform.position)) * 0.5f; - vector.x += 48f; - } - else - { - vector = base.transform.InverseTransformPoint(_lineEndTransform.position); - } - lineSprite.transform.localPosition = (localPosition + vector) * 0.5f; - lineSprite.width = (int)(vector.x - localPosition.x); - lineSprite.height = (int)(Mathf.Abs(vector.y - localPosition.y) + 14f); - } - } - - public void SetYouMarkVisible(bool isVisible) - { - _youMark.SetActive(isVisible); - if (isVisible) - { - _youMark.GetComponent().color = LabelDefine.TEXT_COLOR_NORMAL; - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentCellData.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentCellData.cs deleted file mode 100644 index f9027c4b..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentCellData.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections.Generic; -using Cute; - -namespace Wizard; - -public class TournamentCellData -{ - public enum CellState - { - Blank, - Unresolved, - Active, - Win, - Lose, - LoseByDefault - } - - public enum LineType - { - Down, - Up - } - - public CellState State; - - public LineType Line; - - public bool IsChampion; - - public bool IsTerminal; - - public bool IsPreExtra; - - public long EmblemId; - - public string Name; - - public TournamentCellData Parent; - - public TournamentCellData[] Children; - - public TournamentRoundData Round; - - public int ViewerId; - - public bool IsFinalMatchReset; - - public string GetEmblemPath() - { - return Toolbox.ResourcesManager.GetAssetTypePath(EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_S, isfetch: true); - } - - public void CollectResourcePath(ref List resourceList) - { - resourceList.Add(Toolbox.ResourcesManager.GetAssetTypePath(EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_S)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentController.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentController.cs deleted file mode 100644 index 368fc299..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentController.cs +++ /dev/null @@ -1,715 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace Wizard; - -public class TournamentController : MonoBehaviour -{ - [SerializeField] - private GameObject _tournamentRoot; - - [SerializeField] - private Transform _roundsRoot; - - [SerializeField] - private GameObject _originalRound; - - [SerializeField] - private UIDragMultiScrollView _dragMultiScrollView; - - [SerializeField] - private UIButton _prevButton; - - [SerializeField] - private UIButton _nextButton; - - [SerializeField] - private UIPanel _panel; - - [SerializeField] - private UISprite _leftCurtainSprite; - - [SerializeField] - private UISprite _rightCurtainSprite; - - [SerializeField] - private Transform _scrollBarRoot; - - [SerializeField] - private GameObject _originalScrollBarObj; - - [SerializeField] - private UIGrid _radioIconGrid; - - [SerializeField] - private GameObject _originalRadioIconObj; - - private List _rounds; - - private bool _isChangeableSelectRound = true; - - private int _selectRoundIndex; - - private (float, float)[][] _cellPosBank; - - private SpringPanelWithUpdate _currentSpring; - - private List _radioIcons; - - private const float ROUND_OFFSET_X = -16f; - - private const float ROUND_WIDTH = 240f; - - private const float PARENT_CELL_INTERVAL = 200f; - - private const float CHANGE_SELECT_ROUND_DRAG_THRESHOLD_X = 45.5f; - - private const float CHANGE_SELECT_ROUND_DRAG_NG_THRESHOLD_Y = 16.25f; - - private const float CHANGE_SELECT_ROUND_DURATION = 0.15f; - - private const float CURTAIN_ALPHA_MAX = 0.5f; - - private void Start() - { - _originalRound.SetActive(value: false); - UIEventListener uIEventListener = UIEventListener.Get(_dragMultiScrollView.gameObject); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDrag)); - _prevButton.onClick.Add(new EventDelegate(ChangeSelectRoundToPrevious)); - _nextButton.onClick.Add(new EventDelegate(ChangeSelectRoundToNext)); - } - - public IEnumerator Setup(TournamentData data, TournamentCellData currentCell, GatheringInfo info, bool isVisible) - { - int count = data.Rounds.Count; - _rounds = new List(count); - _radioIcons = new List(count); - _originalRound.SetActive(value: true); - _originalRadioIconObj.SetActive(value: true); - _originalScrollBarObj.SetActive(value: true); - Vector3 localPosition = _originalScrollBarObj.transform.localPosition; - int currentRound = 0; - for (int i = 0; i < count; i++) - { - TournamentRoundData tournamentRoundData = data.Rounds[i]; - TournamentRound component = NGUITools.AddChild(_roundsRoot.gameObject, _originalRound).GetComponent(); - UIScrollBar component2 = NGUITools.AddChild(_scrollBarRoot.gameObject, _originalScrollBarObj).GetComponent(); - component2.transform.localPosition = localPosition; - component.ScrollView.verticalScrollBar = component2; - component.ScrollBarPanel = component2.GetComponent(); - component.ScrollBarCollider = component2.backgroundWidget.GetComponent(); - component.Setup(tournamentRoundData, info); - component.transform.localPosition = new Vector3(240f * (float)i, 0f, 0f); - _dragMultiScrollView.AddScrollView(component.ScrollView); - _rounds.Add(component); - _radioIcons.Add(NGUITools.AddChild(_radioIconGrid.gameObject, _originalRadioIconObj).GetComponent()); - if (currentCell != null && tournamentRoundData.Cells.Contains(currentCell)) - { - currentRound = i; - } - } - _originalRound.SetActive(value: false); - _originalRadioIconObj.SetActive(value: false); - _originalScrollBarObj.SetActive(value: false); - _radioIconGrid.Reposition(); - _cellPosBank = new(float, float)[_rounds.Count][]; - for (int j = 0; j < _cellPosBank.Length; j++) - { - (float, float)[] array = new(float, float)[_rounds[j].Cells.Count]; - for (int k = 0; k < array.Length; k++) - { - array[k] = (0f, 0f); - } - _cellPosBank[j] = array; - } - _dragMultiScrollView.OnPressCallback = OnPressScrollView; - _dragMultiScrollView.OnScrollCallback = OnScrollWheel; - if (count > 0) - { - _rounds[0].ScrollView.onMomentumMove = OnMomentumMove; - } - _panel.alpha = 0f; - yield return null; - AppendScrollBarEvent(); - foreach (TournamentRound round in _rounds) - { - round.SetCellEnable(isEnabled: true); - } - SetupCellLineEnd(); - PropagateScrollValue(currentRound); - ChangeSelectRoundIndex(currentRound, isImmediate: true, isPlaySe: false); - ChangeFocusCellImmediate(currentCell); - RestrictWithinBounds(isImmediate: true); - SetVisible(isVisible); - if (isVisible && currentCell != null && currentCell.ViewerId == PlayerStaticData.UserViewerID) - { - TournamentCell tournamentCell = GetTournamentCell(currentCell); - if (tournamentCell != null) - { - tournamentCell.SetYouMarkVisible(isVisible: true); - } - } - yield return null; - _panel.alpha = 1f; - } - - private void OnDrag(GameObject obj, Vector2 delta) - { - if (!(delta.y > 16.25f) && !(delta.y < -16.25f)) - { - if (delta.x > 45.5f) - { - ChangeSelectRoundToPrevious(); - } - else if (delta.x < -45.5f) - { - ChangeSelectRoundToNext(); - } - } - } - - private void ChangeSelectRoundToPrevious() - { - if (_isChangeableSelectRound && _selectRoundIndex > 0) - { - ChangeSelectRoundIndex(_selectRoundIndex - 1); - } - } - - private void ChangeSelectRoundToNext() - { - if (_isChangeableSelectRound && _selectRoundIndex < _rounds.Count - 1) - { - ChangeSelectRoundIndex(_selectRoundIndex + 1); - } - } - - private void ChangeSelectRoundIndex(int index, bool isImmediate = false, bool isPlaySe = true) - { - if (!_isChangeableSelectRound) - { - return; - } - SetupCellPosition(index); - Vector3 vector = new Vector3((float)(-index) * 240f + -16f, 0f, 0f); - if (isImmediate) - { - _roundsRoot.localPosition = vector; - ApplyCellPosition(1f); - UpdateCellLine(); - UpdateWatchPosition(); - UpdateRoundAlpha(_selectRoundIndex, index, 1f); - UpdateCurtainAlpha(_selectRoundIndex, index, 1f); - UpdateScrollViewBounds(); - _panel.SetDirty(); - } - else - { - _isChangeableSelectRound = false; - AdjustCellPositionToFocusCell(index); - UpdateRoundWatchEnable(-1); - int beforeIndex = _selectRoundIndex; - TweenPosition tweenPosition = TweenPositionWithUpdate.Begin(_roundsRoot.gameObject, 0.15f, vector, delegate(float factor) - { - ApplyCellPosition(factor); - UpdateCellLine(); - UpdateWatchPosition(); - UpdateRoundAlpha(beforeIndex, index, factor); - UpdateCurtainAlpha(beforeIndex, index, factor); - UpdateScrollViewBounds(); - RestrictWithinBounds(isImmediate: true); - _panel.SetDirty(); - }); - tweenPosition.method = UITweener.Method.EaseOut; - tweenPosition.onFinished.Add(new EventDelegate(delegate - { - _isChangeableSelectRound = true; - RestrictWithinBounds(isImmediate: false); - })); - } - _selectRoundIndex = index; - UpdateRoundWatchEnable(index); - ChangeScrollBarController(); - UpdateRadioIcon(); - UpdateArrowButton(); - if (isPlaySe) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN); - } - } - - private void ChangeFocusCellImmediate(TournamentCellData focusCell) - { - if (focusCell != null) - { - TournamentRound tournamentRound = _rounds[_selectRoundIndex]; - TournamentCell tournamentCell = tournamentRound.Cells.FirstOrDefault((TournamentCell c) => c != null && c.Data == focusCell); - if (!(tournamentCell == null)) - { - Transform transform = tournamentRound.ScrollView.panel.transform; - Vector3 relative = -transform.transform.InverseTransformPoint(tournamentCell.transform.position); - relative.x = transform.localPosition.x; - tournamentRound.ScrollView.MoveRelative(relative); - PropagateScrollValue(_selectRoundIndex); - } - } - } - - private void UpdateRadioIcon() - { - int i = 0; - for (int count = _radioIcons.Count; i < count; i++) - { - _radioIcons[i].spriteName = ((i == _selectRoundIndex) ? "carousel_marker_on" : "carousel_marker_off"); - } - } - - private void UpdateArrowButton() - { - _prevButton.gameObject.SetActive(_selectRoundIndex > 0); - _nextButton.gameObject.SetActive(_selectRoundIndex < _rounds.Count - 1); - } - - private void SetupCellPosition(int selectRoundIndex) - { - for (int i = 0; i < _rounds.Count; i++) - { - TournamentRound tournamentRound = _rounds[i]; - for (int j = 0; j < tournamentRound.Cells.Count; j++) - { - _cellPosBank[i][j].Item1 = tournamentRound.Cells[j].transform.localPosition.y; - } - } - int num = 0; - float num2 = 200f; - for (int num3 = selectRoundIndex + 1; num3 >= selectRoundIndex - 1; num3--) - { - if (num3 < _rounds.Count && num3 >= 0) - { - num = num3; - TournamentRound tournamentRound2 = _rounds[num3]; - for (int k = 0; k < tournamentRound2.Cells.Count; k++) - { - _cellPosBank[num3][k].Item2 = -200f * (float)k; - } - break; - } - } - float num4 = num2 * 0.5f; - for (int num5 = num - 1; num5 >= 0; num5--) - { - TournamentRound tournamentRound3 = _rounds[num5]; - TournamentRound tournamentRound4 = _rounds[num5 + 1]; - if (tournamentRound4.Data.IsExtraRound) - { - for (int l = 0; l < tournamentRound3.Cells.Count; l++) - { - _cellPosBank[num5][l].Item2 = _cellPosBank[num5 + 1][l].Item2; - } - } - else - { - num2 *= 0.5f; - num4 = num2 * 0.5f; - for (int m = 0; m < tournamentRound3.Cells.Count; m++) - { - TournamentCell childCell = tournamentRound3.Cells[m]; - int childIndex; - int parentCellIndex = GetParentCellIndex(childCell, tournamentRound4, out childIndex); - float item = _cellPosBank[num5 + 1][parentCellIndex].Item2; - _cellPosBank[num5][m].Item2 = item + num4 - num2 * (float)childIndex; - } - } - } - for (int n = num + 1; n < _rounds.Count; n++) - { - TournamentRound tournamentRound5 = _rounds[n]; - TournamentRound childRound = _rounds[n - 1]; - if (tournamentRound5.Data.IsExtraRound) - { - for (int num6 = 0; num6 < tournamentRound5.Cells.Count; num6++) - { - _cellPosBank[n][num6].Item2 = _cellPosBank[n - 1][num6].Item2; - } - continue; - } - float num7 = 0f; - for (int num8 = 0; num8 < tournamentRound5.Cells.Count; num8++) - { - TournamentCell parentCell = tournamentRound5.Cells[num8]; - int childCellIndex = GetChildCellIndex(parentCell, childRound); - if (childCellIndex >= 0) - { - num7 = (_cellPosBank[n][num8].Item2 = (_cellPosBank[n - 1][childCellIndex].Item2 + _cellPosBank[n - 1][childCellIndex + 1].Item2) * 0.5f); - } - else - { - _cellPosBank[n][num8].Item2 = num7 - 200f; - } - } - } - } - - private int GetParentCellIndex(TournamentCell childCell, TournamentRound parentRound, out int childIndex) - { - TournamentCellData data = childCell.Data; - List cells = parentRound.Cells; - for (int i = 0; i < cells.Count; i++) - { - TournamentCellData data2 = cells[i].Data; - if (data2.Children == null) - { - continue; - } - for (int j = 0; j < data2.Children.Length; j++) - { - if (data2.Children[j] == data) - { - childIndex = j; - return i; - } - } - } - childIndex = -1; - return -1; - } - - private int GetChildCellIndex(TournamentCell parentCell, TournamentRound childRound) - { - TournamentCellData data = parentCell.Data; - List cells = childRound.Cells; - for (int i = 0; i < cells.Count; i++) - { - if (cells[i].Data.Parent == data) - { - return i; - } - } - return -1; - } - - private void AdjustCellPositionToFocusCell(int selectRoundIndex) - { - int num = selectRoundIndex - _selectRoundIndex; - if (num < -1 || num > 1 || num == 0) - { - return; - } - TournamentRound tournamentRound = _rounds[_selectRoundIndex]; - float y = tournamentRound.ScrollView.panel.clipOffset.y; - int num2 = -1; - float num3 = float.MaxValue; - for (int i = 0; i < tournamentRound.Cells.Count; i++) - { - float num4 = Mathf.Abs(tournamentRound.Cells[i].transform.localPosition.y - y); - if (!(num4 > num3)) - { - num3 = num4; - num2 = i; - } - } - (float, float) tuple = _cellPosBank[_selectRoundIndex][num2]; - float item = tuple.Item1; - float item2 = tuple.Item2; - float num5 = item - item2; - int j = 0; - for (int count = _rounds.Count; j < count; j++) - { - int k = 0; - for (int count2 = _rounds[j].Cells.Count; k < count2; k++) - { - _cellPosBank[j][k].Item2 += num5; - } - } - } - - private void ApplyCellPosition(float factor) - { - int i = 0; - for (int count = _rounds.Count; i < count; i++) - { - TournamentRound tournamentRound = _rounds[i]; - int j = 0; - for (int count2 = tournamentRound.Cells.Count; j < count2; j++) - { - TournamentCell tournamentCell = tournamentRound.Cells[j]; - (float, float) tuple = _cellPosBank[i][j]; - UIUtil.SetLocalPositionY(tournamentCell.transform, Mathf.Lerp(tuple.Item1, tuple.Item2, factor)); - } - } - } - - private void UpdateWatchPosition() - { - foreach (TournamentRound round in _rounds) - { - round.UpdateWatchPosition(); - } - } - - private void UpdateRoundAlpha(int beforeIndex, int afterIndex, float factor) - { - int i = 0; - for (int count = _rounds.Count; i < count; i++) - { - TournamentRound tournamentRound = _rounds[i]; - float a = CalcRoundAlpha(i - beforeIndex); - float b = CalcRoundAlpha(i - afterIndex); - tournamentRound.ScrollView.panel.alpha = Mathf.Lerp(a, b, factor); - a = CalcWatchAlpha(i - beforeIndex); - b = CalcWatchAlpha(i - afterIndex); - tournamentRound.SetWatchAlpha(Mathf.Lerp(a, b, factor)); - } - static float CalcRoundAlpha(int indexDiff) - { - return Mathf.Max(0f, Mathf.Min(1f, 2f - (float)Mathf.Abs(indexDiff))); - } - static float CalcWatchAlpha(int indexDiff) - { - return Mathf.Max(0f, Mathf.Min(1f, 1f - (float)Mathf.Abs(indexDiff))); - } - } - - private void UpdateRoundWatchEnable(int selectRoundIndex) - { - for (int i = 0; i < _rounds.Count; i++) - { - _rounds[i].SetWatchEnable(i == selectRoundIndex); - } - } - - private void UpdateCurtainAlpha(int beforeIndex, int afterIndex, float factor) - { - float a = ((beforeIndex <= 0) ? 0f : 0.5f); - float b = ((afterIndex <= 0) ? 0f : 0.5f); - _leftCurtainSprite.alpha = Mathf.Lerp(a, b, factor); - int num = _rounds.Count - 1; - float a2 = ((beforeIndex >= num) ? 0f : 0.5f); - float b2 = ((afterIndex >= num) ? 0f : 0.5f); - _rightCurtainSprite.alpha = Mathf.Lerp(a2, b2, factor); - } - - private void UpdateCellLine() - { - int i = 0; - for (int count = _rounds.Count; i < count; i++) - { - List cells = _rounds[i].Cells; - int j = 0; - for (int count2 = cells.Count; j < count2; j++) - { - cells[j].UpdateLine(); - } - } - } - - private void SetupCellLineEnd() - { - int i = 0; - for (int num = _rounds.Count - 1; i < num; i++) - { - List cells = _rounds[i].Cells; - List cells2 = _rounds[i + 1].Cells; - int j = 0; - for (int count = cells.Count; j < count; j++) - { - TournamentCell cell = cells[j]; - if (cell.Data.IsPreExtra) - { - cell.SetLineEndTransform(cells.Find((TournamentCell c) => c != cell).RightConnectorTransform); - continue; - } - TournamentCellData parentCellData = cell.Data.Parent; - TournamentCell tournamentCell = cells2.Find((TournamentCell c) => c != null && c.Data == parentCellData); - if (tournamentCell != null) - { - cell.SetLineEndTransform(tournamentCell.LeftConnectorTransform); - } - } - } - } - - private void UpdateScrollViewBounds() - { - foreach (TournamentRound round in _rounds) - { - round.ScrollView.NeedsCalculateBounds = true; - } - } - - private void ChangeScrollBarController() - { - int scrollTargetRoundIndex = GetScrollTargetRoundIndex(); - int i = 0; - for (int count = _rounds.Count; i < count; i++) - { - _rounds[i].SetScrollBarEnable(i == scrollTargetRoundIndex); - } - } - - private int GetScrollTargetRoundIndex() - { - return Mathf.Max(0, _selectRoundIndex - 1); - } - - private void AppendScrollBarEvent() - { - foreach (TournamentRound round in _rounds) - { - UIEventListener uIEventListener = UIEventListener.Get(round.ScrollView.verticalScrollBar.backgroundWidget.gameObject); - uIEventListener.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(uIEventListener.onPress, new UIEventListener.BoolDelegate(OnPressScrollBar)); - uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, new UIEventListener.VectorDelegate(OnDragScrollBar)); - } - } - - private void OnPressScrollBar(GameObject go, bool isPressed) - { - PropagateScrollValue(GetRoundIndexByScrollBar(go.GetComponentInParent())); - } - - private void OnDragScrollBar(GameObject go, Vector2 delta) - { - PropagateScrollValue(GetRoundIndexByScrollBar(go.GetComponentInParent())); - } - - private int GetRoundIndexByScrollBar(UIScrollBar scrollBar) - { - int i = 0; - for (int count = _rounds.Count; i < count; i++) - { - if (!(_rounds[i].ScrollView.verticalScrollBar != scrollBar)) - { - return i; - } - } - return -1; - } - - private void PropagateScrollValue(int roundIndex) - { - TournamentRound tournamentRound = _rounds[roundIndex]; - UIScrollView scrollView = tournamentRound.ScrollView; - Vector3 localPosition = scrollView.transform.localPosition; - Vector2 clipOffset = scrollView.panel.clipOffset; - Vector3 currentMomentum = scrollView.currentMomentum; - foreach (TournamentRound round in _rounds) - { - if (!(round == tournamentRound)) - { - UIScrollView scrollView2 = round.ScrollView; - scrollView2.transform.localPosition = localPosition; - scrollView2.panel.clipOffset = clipOffset; - scrollView2.panel.SetDirty(); - scrollView2.currentMomentum = currentMomentum; - } - } - } - - private void OnPressScrollView(bool isPressed) - { - if (!isPressed) - { - RestrictWithinBounds(isImmediate: false); - } - } - - private void OnScrollWheel(float delta) - { - RestrictWithinBounds(isImmediate: false); - } - - private void OnMomentumMove() - { - RestrictWithinBounds(isImmediate: false); - } - - private void RestrictWithinBounds(bool isImmediate) - { - int targetIndex = GetScrollTargetRoundIndex(); - UIScrollView scrollView = _rounds[targetIndex].ScrollView; - Bounds bounds = scrollView.bounds; - for (int i = Mathf.Max(0, _selectRoundIndex - 1); i <= Mathf.Min(_selectRoundIndex + 1, _rounds.Count - 1); i++) - { - Bounds bounds2 = _rounds[i].ScrollView.bounds; - if (bounds2.min.y < bounds.min.y) - { - Vector3 min = bounds.min; - min.y = bounds2.min.y; - bounds.min = min; - } - if (bounds2.max.y > bounds.max.y) - { - Vector3 max = bounds.max; - max.y = bounds2.max.y; - bounds.max = max; - } - } - Vector3 vector = scrollView.panel.CalculateConstrainOffset(bounds.min, bounds.max); - vector.x = 0f; - if (!(vector.sqrMagnitude > 0.1f)) - { - return; - } - if (isImmediate) - { - scrollView.MoveRelative(vector); - scrollView.currentMomentum = Vector3.zero; - scrollView.CurrentScroll = 0f; - PropagateScrollValue(targetIndex); - return; - } - Vector3 pos = scrollView.transform.localPosition + vector; - pos.x = Mathf.Round(pos.x); - pos.y = Mathf.Round(pos.y); - StopSpring(); - SpringPanelWithUpdate springPanelWithUpdate = SpringPanelWithUpdate.Begin(scrollView.gameObject, pos, 8f, delegate - { - PropagateScrollValue(targetIndex); - }); - springPanelWithUpdate.onUpdate = delegate - { - PropagateScrollValue(targetIndex); - }; - _currentSpring = springPanelWithUpdate; - } - - private void StopSpring() - { - if (_currentSpring == null) - { - return; - } - if (!_currentSpring.enabled) - { - _currentSpring = null; - return; - } - if (_currentSpring.onFinished != null) - { - _currentSpring.onFinished(); - } - _currentSpring.enabled = false; - _currentSpring = null; - } - - public void SetVisible(bool isVisible) - { - _tournamentRoot.SetActive(isVisible); - } - - private TournamentCell GetTournamentCell(TournamentCellData cellData) - { - foreach (TournamentRound round in _rounds) - { - TournamentCell tournamentCell = round.Cells.FirstOrDefault((TournamentCell cell) => cell.Data == cellData); - if (tournamentCell != null) - { - return tournamentCell; - } - } - return null; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentData.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentData.cs deleted file mode 100644 index ab3bd055..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentData.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class TournamentData -{ - public List Rounds; - - public void CollectResourcePath(ref List resourceList) - { - foreach (TournamentRoundData round in Rounds) - { - round.CollectResourcePath(ref resourceList); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentRound.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentRound.cs deleted file mode 100644 index b36318f5..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentRound.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Wizard; - -public class TournamentRound : MonoBehaviour -{ - [SerializeField] - private UILabel _nameLabel; - - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private GameObject _originalCell; - - [SerializeField] - private GameObject _originalWatch; - - [NonSerialized] - public List Cells; - - [NonSerialized] - public List Watchs; - - public TournamentRoundData Data { get; private set; } - - public UIScrollView ScrollView => _scrollView; - - public UIPanel ScrollBarPanel { private get; set; } - - public BoxCollider ScrollBarCollider { private get; set; } - - private void Start() - { - _originalCell.SetActive(value: false); - } - - public void Setup(TournamentRoundData data, GatheringInfo info) - { - Data = data; - _nameLabel.text = GetName(data); - Cells = new List(data.Cells.Count); - _originalCell.SetActive(value: true); - foreach (TournamentCellData cell in data.Cells) - { - TournamentCell component = NGUITools.AddChild(_scrollView.gameObject, _originalCell).GetComponent(); - component.Setup(cell); - Cells.Add(component); - } - _originalCell.SetActive(value: false); - Watchs = new List(data.Watchs.Count); - _originalWatch.SetActive(value: true); - foreach (TournamentWatchData watch in data.Watchs) - { - TournamentWatch component2 = NGUITools.AddChild(_scrollView.gameObject, _originalWatch).GetComponent(); - component2.Setup(watch, Cells, info); - Watchs.Add(component2); - } - _originalWatch.SetActive(value: false); - SetCellEnable(isEnabled: false); - } - - private string GetName(TournamentRoundData data) - { - return string.Format(Wizard.Data.SystemText.Get("Gathering_Tournament_0003"), data.RoundNo); - } - - public void SetCellEnable(bool isEnabled) - { - foreach (TournamentCell cell in Cells) - { - cell.gameObject.SetActive(isEnabled); - } - } - - public void SetScrollBarEnable(bool isEnabled) - { - ScrollBarPanel.alpha = (isEnabled ? 1f : 0f); - ScrollBarCollider.enabled = isEnabled; - } - - public void SetWatchAlpha(float alpha) - { - if (Watchs == null) - { - return; - } - foreach (TournamentWatch watch in Watchs) - { - watch.SetAlpha(alpha); - } - } - - public void SetWatchEnable(bool isEnabled) - { - if (Watchs == null) - { - return; - } - foreach (TournamentWatch watch in Watchs) - { - watch.SetEnable(isEnabled); - } - } - - public void UpdateWatchPosition() - { - if (Watchs == null) - { - return; - } - foreach (TournamentWatch watch in Watchs) - { - watch.UpdatePosition(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentRoundData.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentRoundData.cs deleted file mode 100644 index 7300c05c..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentRoundData.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; - -namespace Wizard; - -public class TournamentRoundData -{ - public int RoundNo; - - public List Cells; - - public List Watchs; - - public bool IsExtraRound; - - public void CollectResourcePath(ref List resourceList) - { - foreach (TournamentCellData cell in Cells) - { - cell?.CollectResourcePath(ref resourceList); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentWatch.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentWatch.cs deleted file mode 100644 index 574c0683..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentWatch.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public class TournamentWatch : MonoBehaviour -{ - [SerializeField] - private UIButton _watchButton; - - [SerializeField] - private UIPanel _panel; - - [SerializeField] - private BoxCollider _collider; - - private Transform _cellTransform0; - - private Transform _cellTransform1; - - private BattleParameter _battleParameter; - - public TournamentWatchData Data { get; private set; } - - public void Setup(TournamentWatchData data, List roundCells, GatheringInfo info) - { - Data = data; - _cellTransform0 = roundCells.FirstOrDefault((TournamentCell c) => c.Data.ViewerId == data.ViewerId0).transform; - _cellTransform1 = roundCells.FirstOrDefault((TournamentCell c) => c.Data.ViewerId == data.ViewerId1).transform; - _watchButton.onClick.Add(new EventDelegate(Watch)); - _battleParameter = info.Rule.BattleParameterInstance; - } - - public void SetEnable(bool isEnabled) - { - _collider.enabled = isEnabled; - } - - public void SetAlpha(float alpha) - { - _panel.alpha = alpha; - } - - public void UpdatePosition() - { - base.transform.localPosition = (_cellTransform0.localPosition + _cellTransform1.localPosition) * 0.5f; - } - - public void Watch() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE); - RoomConnectController.InitializeParameter initializeParameter = new RoomConnectController.InitializeParameter(RoomConnectController.PositionMode.WATCHER, _battleParameter, Data.RoomId.ToString()); - initializeParameter.IsGathering = true; - UIManager.GetInstance().StartCoroutine(GatheringUtility.JoinRoom(initializeParameter, "")); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TournamentWatchData.cs b/SVSim.BattleEngine/Engine/Wizard/TournamentWatchData.cs deleted file mode 100644 index e7c8ace4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TournamentWatchData.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wizard; - -public class TournamentWatchData -{ - public int RoomId; - - public int ViewerId0; - - public int ViewerId1; -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TransitionDialog.cs b/SVSim.BattleEngine/Engine/Wizard/TransitionDialog.cs index 302c66c5..52973126 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TransitionDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TransitionDialog.cs @@ -60,7 +60,7 @@ public class TransitionDialog : MonoBehaviour { if (!_firstToggleCall) { - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); + OnChange.Call(_toggle.value); base.transform.parent.GetComponent().SetButtonDisable(!_toggle.value); } diff --git a/SVSim.BattleEngine/Engine/Wizard/TransitionPublishDialog.cs b/SVSim.BattleEngine/Engine/Wizard/TransitionPublishDialog.cs index 39e580d2..f4e1e854 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TransitionPublishDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TransitionPublishDialog.cs @@ -1,60 +1,60 @@ -using Cute; -using UnityEngine; - -namespace Wizard; - -public class TransitionPublishDialog : MonoBehaviour -{ - [SerializeField] - private UILabel _idLabel; - - [SerializeField] - private UILabel _passwardLabel; - - [SerializeField] - private UIButton _idCopyButton; - - [SerializeField] - private UIButton _passwardButton; - - public static void Create(string pass) - { - GameObject gameObject = Object.Instantiate(Resources.Load("UI/layoutParts/TransitionToTwo/TransitionPublishDialog")) as GameObject; - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - dialogBase.SetTitleLabel(Data.SystemText.Get("BeyondHandover_0001")); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetObj(gameObject); - TransitionPublishDialog component = gameObject.GetComponent(); - component.SetIdText(pass); - component.SetCopyButtonEvent(pass); - } - - private void SetIdText(string pass) - { - _idLabel.text = $"{PlayerStaticData.UserViewerID:#,0}".Replace(",", " "); - _passwardLabel.text = pass; - } - - private void SetCopyButtonEvent(string pass) - { - _idCopyButton.onClick.Add(new EventDelegate(delegate - { - NativePluginWrapper.SetStringToClipboard(PlayerStaticData.UserViewerID.ToString()); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetPanelDepth(100); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetText(Data.SystemText.Get("BeyondHandover_0014")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - })); - _passwardButton.onClick.Add(new EventDelegate(delegate - { - NativePluginWrapper.SetStringToClipboard(pass); - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetPanelDepth(100); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetText(Data.SystemText.Get("BeyondHandover_0015")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); - })); - } -} +using Cute; +using UnityEngine; + +namespace Wizard; + +public class TransitionPublishDialog : MonoBehaviour +{ + [SerializeField] + private UILabel _idLabel; + + [SerializeField] + private UILabel _passwardLabel; + + [SerializeField] + private UIButton _idCopyButton; + + [SerializeField] + private UIButton _passwardButton; + + public static void Create(string pass) + { + GameObject gameObject = Object.Instantiate(Resources.Load("UI/layoutParts/TransitionToTwo/TransitionPublishDialog")) as GameObject; + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); + dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); + dialogBase.SetTitleLabel(Data.SystemText.Get("BeyondHandover_0001")); + dialogBase.SetSize(DialogBase.Size.M); + dialogBase.SetObj(gameObject); + TransitionPublishDialog component = gameObject.GetComponent(); + component.SetIdText(pass); + component.SetCopyButtonEvent(pass); + } + + private void SetIdText(string pass) + { + _idLabel.text = $"{0:#,0}".Replace(",", " "); + _passwardLabel.text = pass; + } + + private void SetCopyButtonEvent(string pass) + { + _idCopyButton.onClick.Add(new EventDelegate(delegate + { + NativePluginWrapper.SetStringToClipboard(0.ToString()); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); + dialogBase.SetPanelDepth(100); + dialogBase.SetSize(DialogBase.Size.S); + dialogBase.SetText(Data.SystemText.Get("BeyondHandover_0014")); + dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); + })); + _passwardButton.onClick.Add(new EventDelegate(delegate + { + NativePluginWrapper.SetStringToClipboard(pass); + DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); + dialogBase.SetPanelDepth(100); + dialogBase.SetSize(DialogBase.Size.S); + dialogBase.SetText(Data.SystemText.Get("BeyondHandover_0015")); + dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); + })); + } +} diff --git a/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCp.cs b/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCp.cs index 24aa8c27..c7728e37 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCp.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCp.cs @@ -6,20 +6,9 @@ namespace Wizard; public class TreasureBoxCp { - public const string TREASURE_BOX_OPEN_EFFECT = "cmn_arena_treasure_{0}"; - - public const string GRADE_UP_EFFECT = "cmn_treasure_gradeup_gp_{0}"; - - private const string TREASURE_GET_SPRITE_NAME = "treasure_get"; - - private const string TREASURE_RANK_UP_SPRITE_NAME = "treasure_rank_up"; - - private const string TREASURE_RANK_MAX_SPRITE_NAME = "treasure_rank_max"; private bool _treasureBoxCpNotExist = true; - public static readonly float[] OPEN_TREASURE_BOX_TIME = new float[4] { 1f, 1.5f, 1.5f, 4f }; - public static readonly int[] GRADE_TO_TREASURE_BOX_ID = new int[5] { -1, 0, 2, 4, 5 }; private double _receiveServerUnixTime; @@ -62,46 +51,4 @@ public class TreasureBoxCp _receiveServerUnixTime = headerData["servertime"].ToDouble(); _receiveSinceTime = Time.realtimeSinceStartup; } - - public bool IsWithinPeriod() - { - if (_treasureBoxCpNotExist) - { - return false; - } - double num = _receiveServerUnixTime + (double)Time.realtimeSinceStartup - _receiveSinceTime; - if (num >= EndUnixTime) - { - return false; - } - return num > StartUnixTime; - } - - public static Se.TYPE GetGradeSE(int grade) - { - return grade switch - { - 1 => Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_01, - 2 => Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_02, - 3 => Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_03, - 4 => Se.TYPE.SE_SYS_UPGRADE_TREASURE_BOX_04, - _ => Se.TYPE.NONE, - }; - } - - public static string GetTreasureSpriteName(int grade) - { - switch (grade) - { - case 1: - return "treasure_get"; - case 2: - case 3: - return "treasure_rank_up"; - case 4: - return "treasure_rank_max"; - default: - return ""; - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpDialog.cs b/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpDialog.cs index fe60dbfe..0b292806 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpDialog.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpDialog.cs @@ -9,12 +9,6 @@ public class TreasureBoxCpDialog : MonoBehaviour { private UIAtlas _arenaAtlas; - private const string GRADE_STAR_ON_SPRITE_NAME = "icon_diamond_mark_on"; - - private const string GRADE_STAR_OFF_SPRITE_NAME = "icon_diamond_mark_off"; - - private const string GRADE_GAUGE_NAME = "gauge_bg_scale_{0}"; - private List _loadFileList = new List(); [SerializeField] @@ -79,7 +73,7 @@ public class TreasureBoxCpDialog : MonoBehaviour treasureBoxCpDialog._treasureBoxGradeUpMethodButton.onClick.Add(new EventDelegate(delegate { dialog.SetDisp(inDisp: false); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); + treasureBoxCpDialog.CreateDetailDialog(dialog); })); treasureBoxCpDialog.SetData(); @@ -111,7 +105,7 @@ public class TreasureBoxCpDialog : MonoBehaviour private static GameObject LoadPrefab(string path) { - PrefabMgr prefabMgr = GameMgr.GetIns().GetPrefabMgr(); + PrefabMgr prefabMgr = null; // Pre-Phase-5b: no PrefabMgr headless prefabMgr.Load(path); return prefabMgr.Get(path); } @@ -170,10 +164,4 @@ public class TreasureBoxCpDialog : MonoBehaviour int num = ((nextGrade == 0) ? maxGrade : nextGrade); _gaugeBackground.spriteName = $"gauge_bg_scale_{num}"; } - - private void OnDestroy() - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadFileList); - _loadFileList.Clear(); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpResultInfo.cs b/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpResultInfo.cs index 2a0cd049..f66194df 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpResultInfo.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TreasureBoxCpResultInfo.cs @@ -23,18 +23,4 @@ public class TreasureBoxCpResultInfo RewardDataList.Add(item); } } - - public bool IsBoxOpened() - { - if (RewardDataList != null) - { - return RewardDataList.Count > 0; - } - return false; - } - - public bool IsPlayGradeUpAnimation() - { - return AfterGrade > BeforeGrade; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/TreasureCpBoxTextPanel.cs b/SVSim.BattleEngine/Engine/Wizard/TreasureCpBoxTextPanel.cs deleted file mode 100644 index b2afddb4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TreasureCpBoxTextPanel.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class TreasureCpBoxTextPanel : MonoBehaviour -{ - [SerializeField] - public UISprite _treasureCpBoxText; -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TurnEndTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/TurnEndTagCollection.cs index 6a90953d..ba0045cc 100644 --- a/SVSim.BattleEngine/Engine/Wizard/TurnEndTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/TurnEndTagCollection.cs @@ -302,18 +302,4 @@ public class TurnEndTagCollection : TagCollection } return HasAllyTurnTag; } - - public bool HasTagExecuteWhenEnemyTurnEnd(bool isOwnerAlly) - { - if (!isOwnerAlly) - { - return HasAllyTurnTag; - } - return HasEnemyTurnTag; - } - - public static bool IsTurnEndTagType(AIPlayTagType type) - { - return _managedTagTypes.Contains(type); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/TutorialData.cs b/SVSim.BattleEngine/Engine/Wizard/TutorialData.cs deleted file mode 100644 index f1fbc910..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TutorialData.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace Wizard; - -public class TutorialData -{ - public enum POPUP_TYPE - { - TutorialPopupTypeA, - TutorialPopupTypeB, - TutorialPopupTypeC, - TutorialPopupTypeD - } - - public int popup_id; - - public int tutorial_id; - - public string popup_title; - - public POPUP_TYPE popup_type; - - public List effect_path = new List(); - - public List effect_position = new List(); - - public string text1; - - public string text2; - - public string text3; - - private int index; - - public TutorialData(string[] columns) - { - popup_id = int.Parse(columns[index++]); - tutorial_id = int.Parse(columns[index++]); - popup_title = columns[index++]; - popup_type = (POPUP_TYPE)int.Parse(columns[index++]); - string[] source = columns[index++].Split(","[0]); - effect_path = source.ToList(); - string[] source2 = columns[index++].Split(","[0]); - effect_position = source2.ToList(); - text1 = columns[index++]; - text2 = columns[index++]; - text3 = columns[index++]; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TutorialUpdateTask.cs b/SVSim.BattleEngine/Engine/Wizard/TutorialUpdateTask.cs deleted file mode 100644 index 803f63ec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TutorialUpdateTask.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace Wizard; - -public class TutorialUpdateTask : BaseTask -{ - public class TutorialUpdateTaskParam : BaseParam - { - public int tutorial_step; - - public int is_skip; - } - - public TutorialUpdateTask() - { - base.type = ApiType.Type.TutorialUpdate; - } - - public void SetParameter(int tutorial_step, bool isSkip) - { - TutorialUpdateTaskParam tutorialUpdateTaskParam = new TutorialUpdateTaskParam(); - tutorialUpdateTaskParam.tutorial_step = tutorial_step; - tutorialUpdateTaskParam.is_skip = (isSkip ? 1 : 0); - base.Params = tutorialUpdateTaskParam; - } - - protected override int Parse() - { - int num = base.Parse(); - if (num != 1) - { - return num; - } - Data.UserTutorial = new UserTutorial(); - Data.Load.data._userTutorial.Update(base.ResponseData["data"]); - return num; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TweenAnimation.cs b/SVSim.BattleEngine/Engine/Wizard/TweenAnimation.cs deleted file mode 100644 index 9123aea9..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TweenAnimation.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace Wizard; - -[ExecuteAlways] -public class TweenAnimation : MonoBehaviour -{ - [SerializeField] - private float _duration; - - private List _tweenList = new List(); - - private bool _isPlaying; - - public void Play() - { - _isPlaying = true; - CollectTween(); - SetupTweenParam(); - foreach (UITweener tween in _tweenList) - { - tween.ResetToBeginning(); - tween.PlayForward(); - tween.SetOnFinished(delegate - { - _isPlaying = false; - }); - } - } - - private void CollectTween() - { - _tweenList = base.gameObject.GetComponents().ToList(); - } - - private void SetupTweenParam() - { - foreach (UITweener tween in _tweenList) - { - tween.duration = _duration - tween.delay; - } - } - - public bool IsPlayEnd() - { - return !_isPlaying; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TweenAnimationGroup.cs b/SVSim.BattleEngine/Engine/Wizard/TweenAnimationGroup.cs deleted file mode 100644 index 3171ba09..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TweenAnimationGroup.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -[ExecuteAlways] -public class TweenAnimationGroup : MonoBehaviour -{ - private List _tweenAnimationList = new List(); - - [SerializeField] - private ParticleSystem _effect; - - [SerializeField] - private float _effectDelayTime; - - [SerializeField] - private GameObject[] _gameObjects; - - public void Play(Action onComplete) - { - CollectTweenAnimation(); - foreach (TweenAnimation tweenAnimation in _tweenAnimationList) - { - tweenAnimation.Play(); - } - if (UIManager.GetInstance() != null) - { - UIManager.GetInstance().StartCoroutine(OnPlayComplete(onComplete)); - UIManager.GetInstance().StartCoroutine(PlayEffect(_effectDelayTime)); - } - else - { - StartCoroutine(OnPlayComplete(onComplete)); - StartCoroutine(PlayEffect(_effectDelayTime)); - } - } - - private IEnumerator OnPlayComplete(Action onComplete) - { - if (onComplete != null) - { - while (!AnimationAllEnd()) - { - yield return null; - } - onComplete.Call(); - } - } - - private IEnumerator PlayEffect(float delay) - { - if (!(_effect == null)) - { - _effect.gameObject.SetActive(value: false); - _effect.gameObject.transform.position = base.gameObject.transform.position; - yield return new WaitForSeconds(delay); - _effect.gameObject.SetActive(value: true); - } - } - - private bool AnimationAllEnd() - { - bool flag = true; - foreach (TweenAnimation tweenAnimation in _tweenAnimationList) - { - flag &= tweenAnimation.IsPlayEnd(); - } - return flag; - } - - private void CollectTweenAnimation() - { - _tweenAnimationList = base.gameObject.GetComponentsInChildren().ToList(); - } - - public GameObject GetChildObject(int index) - { - if (index < _gameObjects.Length) - { - return _gameObjects[index]; - } - return null; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TweenPositionWithUpdate.cs b/SVSim.BattleEngine/Engine/Wizard/TweenPositionWithUpdate.cs deleted file mode 100644 index 03f381dd..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TweenPositionWithUpdate.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class TweenPositionWithUpdate : TweenPosition -{ - private Action _onUpdate; - - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, Action onUpdate) - { - TweenPositionWithUpdate tweenPositionWithUpdate = UITweener.Begin(go, duration); - tweenPositionWithUpdate.from = tweenPositionWithUpdate.value; - tweenPositionWithUpdate.to = pos; - if (duration <= 0f) - { - tweenPositionWithUpdate.Sample(1f, isFinished: true); - tweenPositionWithUpdate.enabled = false; - } - tweenPositionWithUpdate._onUpdate = onUpdate; - return tweenPositionWithUpdate; - } - - public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, bool worldSpace, Action onUpdate) - { - TweenPositionWithUpdate tweenPositionWithUpdate = UITweener.Begin(go, duration); - tweenPositionWithUpdate.worldSpace = worldSpace; - tweenPositionWithUpdate.from = tweenPositionWithUpdate.value; - tweenPositionWithUpdate.to = pos; - if (duration <= 0f) - { - tweenPositionWithUpdate.Sample(1f, isFinished: true); - tweenPositionWithUpdate.enabled = false; - } - tweenPositionWithUpdate._onUpdate = onUpdate; - return tweenPositionWithUpdate; - } - - protected override void OnUpdate(float factor, bool isFinished) - { - base.value = from * (1f - factor) + to * factor; - _onUpdate.Call(factor); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TypeFilterDialog.cs b/SVSim.BattleEngine/Engine/Wizard/TypeFilterDialog.cs deleted file mode 100644 index d92a1c56..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TypeFilterDialog.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class TypeFilterDialog : MonoBehaviour -{ - private const int DIALOG_PANEL_DEPTH = 15; - - [SerializeField] - private TypeFilterSingle _singleOriginal; - - [SerializeField] - private UIGrid _grid; - - [SerializeField] - private UIButton _resetButton; - - [SerializeField] - private UILabel _noTypeLabel; - - private List _allTypeList = new List(); - - private List _firstSelectType; - - private List _displayTypeList; - - public DialogBase Dialog { get; private set; } - - public Action OnChange { get; set; } - - public static TypeFilterDialog Create(GameObject prefab, List currentSelectType, List displayTypeList) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetPanelDepth(15); - dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0057")); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - GameObject gameObject = UnityEngine.Object.Instantiate(prefab); - dialogBase.SetObj(gameObject); - TypeFilterDialog component = gameObject.GetComponent(); - component.Dialog = dialogBase; - component._firstSelectType = currentSelectType; - component._displayTypeList = displayTypeList; - return component; - } - - private void Start() - { - foreach (CardBasePrm.TribeType value in Enum.GetValues(typeof(CardBasePrm.TribeType))) - { - if (value != CardBasePrm.TribeType.ALL && value != CardBasePrm.TribeType.MAX && (_displayTypeList == null || _displayTypeList.Contains(value))) - { - AddType(value); - } - } - _singleOriginal.gameObject.SetActive(value: false); - UIEventListener.Get(_resetButton.gameObject).onClick = delegate - { - OnClickResetButton(); - }; - _noTypeLabel.gameObject.SetActive(!_grid.GetChildList().Any()); - } - - private void AddType(CardBasePrm.TribeType tribe) - { - GameObject obj = NGUITools.AddChild(_grid.gameObject, _singleOriginal.gameObject); - obj.SetActive(value: true); - TypeFilterSingle component = obj.GetComponent(); - component.Initialize(tribe); - if (_firstSelectType.Contains(tribe)) - { - component.SetSelected(); - } - component.OnValueChange = delegate - { - OnChange.Call(); - }; - _allTypeList.Add(component); - } - - public List GetAllSelectType() - { - List list = new List(); - foreach (TypeFilterSingle allType in _allTypeList) - { - if (allType.IsSelected) - { - list.Add(allType.Type); - } - } - return list; - } - - private void OnClickResetButton() - { - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON); - Action onChange = OnChange; - OnChange = null; - foreach (TypeFilterSingle allType in _allTypeList) - { - allType.Reset(); - } - OnChange = onChange; - OnChange.Call(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/TypeFilterSingle.cs b/SVSim.BattleEngine/Engine/Wizard/TypeFilterSingle.cs deleted file mode 100644 index 6708fe38..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/TypeFilterSingle.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class TypeFilterSingle : MonoBehaviour -{ - [SerializeField] - private UILabel _label; - - [SerializeField] - private UIToggle _toggle; - - private bool _cacheSelected; - - public bool IsSelected => _toggle.value; - - public CardBasePrm.TribeType Type { get; private set; } - - private bool Value - { - set - { - _toggle.value = value; - _cacheSelected = value; - } - } - - public string TribeText => DataMgr.GetTribeNameByKey((int)Type); - - public Action OnValueChange { get; set; } - - public void SetSelected() - { - Value = true; - } - - public void Reset() - { - Value = false; - } - - private void Start() - { - EventDelegate.Add(_toggle.onChange, delegate - { - if (_toggle.value != _cacheSelected) - { - GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF); - _cacheSelected = _toggle.value; - OnValueChange.Call(); - } - }); - } - - public void Initialize(CardBasePrm.TribeType tribe) - { - Type = tribe; - _label.text = TribeText; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UIAtlasManager.cs b/SVSim.BattleEngine/Engine/Wizard/UIAtlasManager.cs index af7a059b..af71f5b2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIAtlasManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIAtlasManager.cs @@ -13,464 +13,7 @@ public class UIAtlasManager MypageComon, Battle, BattleLang, - RoomMatch, - AreaSelect, - DeckEdit, Arena, - Gacha, Profile, - Ranking, - Friend, - CardFrame, - CardFramePhantom, - Tournament, - Quest, - Scenario, - Bingo, - RedEtherCampaign, - NeutralPopularityVote, - BossRush, - Max - } - - private List _atlasList = new List(); - - private List _residentAtlasList = new List(); - - private List _loadPath; - - private bool _isLoadFinish; - - private HashSet _loadedAtlasHash = new HashSet(); - - private bool IsTutorialFinish() - { - if (Data.Load != null && Data.Load.data != null && Data.Load.data._userTutorial.tutorial_step != 100) - { - return true; - } - return false; - } - - public void LoadCurrentScene(Action callback = null) - { - if (_isLoadFinish && callback != null) - { - callback(); - return; - } - if (_loadPath == null) - { - _loadPath = new List(); - _atlasList = new List(); - } - else - { - _loadPath.Clear(); - _atlasList.Clear(); - } - HashSet assetBundleNameSet = GetLoadTargetSet(UIManager.GetInstance().GetCurrentScene()); - if (IsTutorialFinish()) - { - assetBundleNameSet.Add(AssetBundleNames.AreaSelect); - assetBundleNameSet.Add(AssetBundleNames.Battle); - } - UpdateAssetPathFromAssetBundleNames(assetBundleNameSet); - UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadPath, delegate - { - foreach (AssetBundleNames item in assetBundleNameSet) - { - UnityEngine.Object listData = Toolbox.ResourcesManager.LoadObject(GetAtlasPath(item, null, isload: true)); - AddAssetObjList(listData); - } - _isLoadFinish = true; - foreach (AssetBundleNames item2 in assetBundleNameSet) - { - _loadedAtlasHash.Add(item2); - } - if (callback != null) - { - callback(); - } - })); - } - - public void RemoveSceneAtlas(UIManager.ViewScene inLeaveScene) - { - HashSet loadTargetSet = GetLoadTargetSet(inLeaveScene); - HashSet hashSet = new HashSet(_loadedAtlasHash); - hashSet.ExceptWith(loadTargetSet); - List list = new List(hashSet.ToList().Count); - foreach (AssetBundleNames item in hashSet) - { - list.Add(GetAtlasPath(item, null)); - } - if (list.Count != 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(list); - } - foreach (AssetBundleNames loop_name in hashSet) - { - _loadedAtlasHash.RemoveWhere((AssetBundleNames x) => (x == loop_name) ? true : false); - } - } - - public string GetAtlasPath(AssetBundleNames assetname, string singlebundlename = "", bool isload = false) - { - string result = ""; - if (isload) - { - if (string.IsNullOrEmpty(singlebundlename)) - { - switch (assetname) - { - case AssetBundleNames.MypageComon: - result = "Ui/TextureAtlas/MyPageSubTextureAtlas/" + assetname; - break; - case AssetBundleNames.Battle: - result = "Ui/TextureAtlas/BattleTextureAtlas/" + assetname; - break; - case AssetBundleNames.BattleLang: - result = "Uilang/TextureAtlas/BattleLangTextureAtlas/" + assetname; - break; - case AssetBundleNames.RoomMatch: - result = "Ui/TextureAtlas/RoomMatchAtlas/" + assetname; - break; - case AssetBundleNames.AreaSelect: - result = "Ui/TextureAtlas/AreaSelectTextureAtlas/" + assetname; - break; - case AssetBundleNames.DeckEdit: - result = "Ui/TextureAtlas/DeckEditTextureAtlas/" + assetname; - break; - case AssetBundleNames.Arena: - result = "Ui/TextureAtlas/ArenaTextureAtlas/" + assetname; - break; - case AssetBundleNames.Gacha: - result = "Ui/TextureAtlas/GachaTextureAtlas/" + assetname; - break; - case AssetBundleNames.Profile: - result = "Ui/TextureAtlas/Profile/" + assetname; - break; - case AssetBundleNames.Ranking: - result = "Ui/TextureAtlas/Ranking/" + assetname; - break; - case AssetBundleNames.Friend: - result = "Ui/TextureAtlas/Friend/" + assetname; - break; - case AssetBundleNames.CardFrame: - result = "Ui/TextureAtlas/CardFrame/" + assetname; - break; - case AssetBundleNames.CardFramePhantom: - result = "Ui/TextureAtlas/CardFramePhantom/" + assetname; - break; - case AssetBundleNames.Tournament: - result = "Ui/TextureAtlas/Tournament/" + assetname; - break; - case AssetBundleNames.Quest: - result = "Ui/TextureAtlas/Quest/" + assetname; - break; - case AssetBundleNames.Scenario: - result = "Ui/TextureAtlas/Scenario/" + assetname; - break; - case AssetBundleNames.Bingo: - result = "Ui/TextureAtlas/BingoTextureAtlas/" + assetname; - break; - case AssetBundleNames.RedEtherCampaign: - result = "Ui/TextureAtlas/RedEtherCampaign/" + assetname; - break; - case AssetBundleNames.NeutralPopularityVote: - result = $"Ui/TextureAtlas/PopularityVote/{assetname}"; - break; - case AssetBundleNames.BossRush: - result = $"Ui/TextureAtlas/BossRush/{assetname}"; - break; - } - } - else - { - switch (assetname) - { - case AssetBundleNames.MypageComon: - result = "Ui/TextureAtlas/MyPageSubTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Battle: - result = "Ui/TextureAtlas/BattleTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.BattleLang: - result = "Uilang/TextureAtlas/BattleLangTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.RoomMatch: - result = "Ui/TextureAtlas/RoomMatchAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.AreaSelect: - result = "Ui/TextureAtlas/AreaSelectTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Arena: - result = "Ui/TextureAtlas/ArenaTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Gacha: - result = "Ui/TextureAtlas/GachaTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Profile: - result = "Ui/TextureAtlas/Profile/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Ranking: - result = "Ui/TextureAtlas/Ranking/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Friend: - result = "Ui/TextureAtlas/Friend/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Tournament: - result = "Ui/TextureAtlas/Tournament/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Quest: - result = "Ui/TextureAtlas/Quest/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Scenario: - result = "Ui/TextureAtlas/Scenario/" + singlebundlename.ToString(); - break; - case AssetBundleNames.Bingo: - result = "Ui/TextureAtlas/BingoTextureAtlas/" + singlebundlename.ToString(); - break; - case AssetBundleNames.RedEtherCampaign: - result = "Ui/TextureAtlas/RedEtherCampaign/" + singlebundlename.ToString(); - break; - case AssetBundleNames.NeutralPopularityVote: - result = "Ui/TextureAtlas/PopularityVote/" + singlebundlename; - break; - case AssetBundleNames.BossRush: - result = "Ui/TextureAtlas/BossRush/" + singlebundlename; - break; - } - } - } - else - { - string text = "ui_"; - string text2 = ""; - if (string.IsNullOrEmpty(singlebundlename)) - { - if (assetname == AssetBundleNames.BattleLang) - { - text = "uilang_"; - } - text2 = assetname.ToString().ToLower(); - } - else - { - if (singlebundlename.ToString().ToLower().Contains("battlelang")) - { - text = "uilang_"; - } - text2 = singlebundlename.ToString().ToLower(); - } - result = text + text2 + ".unity3d"; - } - return result; - } - - public void AddResidentAtlas(AssetBundleNames atlasName) - { - string atlasPath = GetAtlasPath(atlasName, null, isload: true); - UIAtlas component = Toolbox.ResourcesManager.LoadObject(atlasPath).GetComponent(); - _residentAtlasList.Add(component); - } - - public void RemoveResidentAtlas(AssetBundleNames atlasName) - { - string name = atlasName.ToString(); - int num = _residentAtlasList.FindIndex((UIAtlas atlas) => atlas.name == name); - if (num < 0) - { - Debug.LogError("not found in resident atlas list : " + name); - } - else - { - _residentAtlasList.RemoveAt(num); - } - } - - private HashSet GetLoadTargetSet(UIManager.ViewScene scene) - { - HashSet hashSet = new HashSet(); - switch (scene) - { - case UIManager.ViewScene.MyPage: - hashSet.Add(AssetBundleNames.MypageComon); - break; - case UIManager.ViewScene.Battle: - case UIManager.ViewScene.RankMatch: - hashSet.Add(AssetBundleNames.Battle); - hashSet.Add(AssetBundleNames.BattleLang); - hashSet.Add(AssetBundleNames.Arena); - break; - case UIManager.ViewScene.Room: - hashSet.Add(AssetBundleNames.RoomMatch); - break; - case UIManager.ViewScene.StorySelectPage: - case UIManager.ViewScene.StorySelectionWorld: - case UIManager.ViewScene.AreaSelect: - case UIManager.ViewScene.StoryChapterSelectionFlowChart: - hashSet.Add(AssetBundleNames.AreaSelect); - break; - case UIManager.ViewScene.RedEtherCampaignLobby: - hashSet.Add(AssetBundleNames.AreaSelect); - hashSet.Add(AssetBundleNames.RedEtherCampaign); - break; - case UIManager.ViewScene.DeckCardEdit: - case UIManager.ViewScene.CardAllList: - case UIManager.ViewScene.CardDestruct: - case UIManager.ViewScene.SealedDeckEdit: - hashSet.Add(AssetBundleNames.DeckEdit); - break; - case UIManager.ViewScene.TwoPick: - hashSet.Add(AssetBundleNames.MypageComon); - hashSet.Add(AssetBundleNames.Arena); - break; - case UIManager.ViewScene.Sealed: - case UIManager.ViewScene.Colosseum: - case UIManager.ViewScene.CompetitionLobby: - hashSet.Add(AssetBundleNames.Arena); - break; - case UIManager.ViewScene.SealedCardPackOpen: - case UIManager.ViewScene.Gacha: - case UIManager.ViewScene.BuildDeckPurchasePage: - case UIManager.ViewScene.CardSleevePurchasePage: - case UIManager.ViewScene.ClassSkinPurchasePage: - hashSet.Add(AssetBundleNames.Gacha); - break; - case UIManager.ViewScene.Bingo: - hashSet.Add(AssetBundleNames.Bingo); - hashSet.Add(AssetBundleNames.Quest); - break; - case UIManager.ViewScene.Profile: - case UIManager.ViewScene.CrossoverPortal: - hashSet.Add(AssetBundleNames.Profile); - break; - case UIManager.ViewScene.Ranking: - hashSet.Add(AssetBundleNames.Ranking); - break; - case UIManager.ViewScene.Gathering: - hashSet.Add(AssetBundleNames.Friend); - hashSet.Add(AssetBundleNames.Ranking); - hashSet.Add(AssetBundleNames.Tournament); - break; - case UIManager.ViewScene.Guild: - case UIManager.ViewScene.Friend: - hashSet.Add(AssetBundleNames.Friend); - hashSet.Add(AssetBundleNames.Ranking); - break; - case UIManager.ViewScene.LotteryPage: - hashSet.Add(AssetBundleNames.Arena); - hashSet.Add(AssetBundleNames.Quest); - break; - case UIManager.ViewScene.QuestSelectionPage: - hashSet.Add(AssetBundleNames.Quest); - hashSet.Add(AssetBundleNames.BossRush); - break; - case UIManager.ViewScene.Scenario: - case UIManager.ViewScene.Scenario2: - hashSet.Add(AssetBundleNames.Scenario); - break; - case UIManager.ViewScene.NeutralPopularityVote: - hashSet.Add(AssetBundleNames.NeutralPopularityVote); - break; - case UIManager.ViewScene.BossRushLobby: - hashSet.Add(AssetBundleNames.BossRush); - hashSet.Add(AssetBundleNames.Arena); - hashSet.Add(AssetBundleNames.Quest); - break; - case UIManager.ViewScene.FreePackCampaign: - hashSet.Add(AssetBundleNames.Arena); - break; - } - return hashSet; - } - - private void UpdateAssetPathFromAssetBundleNames(HashSet assetBundleNameSet) - { - _loadPath.Clear(); - foreach (AssetBundleNames item in assetBundleNameSet) - { - string atlasPath = GetAtlasPath(item); - _loadPath.Add(atlasPath); - } - } - - private void AddAssetObjList(UnityEngine.Object listData) - { - try - { - UIAtlas component = ((GameObject)listData).GetComponent(); - if (component != null) - { - _atlasList.Add(component); - } - } - catch - { - } - } - - public List GetAtlasList() - { - return _residentAtlasList.Union(_atlasList).ToList(); - } - - public bool getAssetBundleEnd() - { - return _isLoadFinish; - } - - public void setAssetBundleEnd(bool flag) - { - _isLoadFinish = flag; - } - - public void OnDestroyView(UIManager.ViewScene scene) - { - foreach (AssetBundleNames item in GetLoadTargetSet(scene)) - { - string atlasPath = GetAtlasPath(item); - Toolbox.AssetManager.UnloadAsset(atlasPath); - } - } - - public void AttachAtlas(List obj_list, bool isTargetChildren = true) - { - List atlasList = GetAtlasList(); - if (atlasList == null || atlasList.Count <= 0) - { - return; - } - List list = new List(); - for (int i = 0; i < obj_list.Count; i++) - { - UISprite[] collection = (isTargetChildren ? obj_list[i].GetComponentsInChildren(includeInactive: true) : UnityEngine.Object.FindObjectsOfType()); - list.AddRange(collection); - } - for (int j = 0; j < list.Count; j++) - { - UISprite uISprite = list[j]; - string spriteName = uISprite.spriteName; - if (uISprite.atlas != null || string.IsNullOrEmpty(spriteName) || spriteName == "collider") - { - continue; - } - foreach (UIAtlas item in atlasList) - { - foreach (UISpriteData sprite in item.spriteList) - { - if (spriteName == sprite.name) - { - uISprite.atlas = item; - goto end_IL_00f1; - } - } - continue; - end_IL_00f1: - break; - } - } - } + CardFramePhantom} } diff --git a/SVSim.BattleEngine/Engine/Wizard/UIDragMultiScrollView.cs b/SVSim.BattleEngine/Engine/Wizard/UIDragMultiScrollView.cs deleted file mode 100644 index 1c7530d4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UIDragMultiScrollView.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -[AddComponentMenu("NGUI/Interaction/Drag Multi Scroll View (wizard)")] -public class UIDragMultiScrollView : MonoBehaviour -{ - [SerializeField] - private List _scrollViewList; - - public Action OnPressCallback { private get; set; } - - public Action OnScrollCallback { private get; set; } - - public void AddScrollView(UIScrollView scrollView) - { - if (!_scrollViewList.Contains(scrollView)) - { - _scrollViewList.Add(scrollView); - } - } - - public void RemoveScrollView(UIScrollView scrollView) - { - if (_scrollViewList.Contains(scrollView)) - { - _scrollViewList.Remove(scrollView); - } - } - - public void OnPress(bool pressed) - { - if (!NGUITools.GetActive(this) || _scrollViewList.Count == 0) - { - return; - } - foreach (UIScrollView scrollView in _scrollViewList) - { - scrollView.Press(pressed); - } - OnPressCallback.Call(pressed); - } - - public void OnDrag(Vector2 delta) - { - if (!NGUITools.GetActive(this) || _scrollViewList.Count == 0) - { - return; - } - foreach (UIScrollView scrollView in _scrollViewList) - { - scrollView.Drag(); - } - } - - public void OnScroll(float delta) - { - if (!NGUITools.GetActive(this) || _scrollViewList.Count == 0) - { - return; - } - foreach (UIScrollView scrollView in _scrollViewList) - { - scrollView.Scroll(delta); - } - OnScrollCallback.Call(delta); - } - - public void OnPan(Vector2 delta) - { - if (!NGUITools.GetActive(this) || _scrollViewList.Count == 0) - { - return; - } - foreach (UIScrollView scrollView in _scrollViewList) - { - scrollView.OnPan(delta); - } - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UIGauge.cs b/SVSim.BattleEngine/Engine/Wizard/UIGauge.cs index e39fda17..492d0fb4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIGauge.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIGauge.cs @@ -25,11 +25,6 @@ public class UIGauge : MonoBehaviour } } - public Transform GetTransformGaugeStartEdge() - { - return _barStartEdge.transform; - } - private void UpdateBar(float value) { if (value <= 0f) diff --git a/SVSim.BattleEngine/Engine/Wizard/UILabelEffectOverwriter.cs b/SVSim.BattleEngine/Engine/Wizard/UILabelEffectOverwriter.cs index 62c822c2..768a7418 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UILabelEffectOverwriter.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UILabelEffectOverwriter.cs @@ -42,15 +42,6 @@ public class UILabelEffectOverwriter : ParameterOverwriterBase private EffectParameters _originalParameters; - public UILabel.Effect EffectStyle - { - set - { - _effectStyle = value; - RequestOverwrite(); - } - } - public eColorCodeId EffectColorId { set @@ -60,22 +51,8 @@ public class UILabelEffectOverwriter : ParameterOverwriterBase } } - public Vector2 EffectDistance - { - set - { - _effectDistance = value; - RequestOverwrite(); - } - } - protected override GameObject TargetObject => _targetLabel.gameObject; - private void Reset() - { - _targetLabel = GetComponent(); - } - protected override void SaveOriginalParameters() { _originalParameters = new EffectParameters(_targetLabel); diff --git a/SVSim.BattleEngine/Engine/Wizard/UILabelGradientOverwriter.cs b/SVSim.BattleEngine/Engine/Wizard/UILabelGradientOverwriter.cs index 7cf88a0d..758a594b 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UILabelGradientOverwriter.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UILabelGradientOverwriter.cs @@ -42,15 +42,6 @@ public class UILabelGradientOverwriter : ParameterOverwriterBase private GradientParameters _originalParameters; - public bool ApplyGradient - { - set - { - _applyGradient = value; - RequestOverwrite(); - } - } - public eColorCodeId GradientTopColorId { set @@ -71,11 +62,6 @@ public class UILabelGradientOverwriter : ParameterOverwriterBase protected override GameObject TargetObject => _targetLabel.gameObject; - private void Reset() - { - _targetLabel = GetComponent(); - } - protected override void SaveOriginalParameters() { _originalParameters = new GradientParameters(_targetLabel); diff --git a/SVSim.BattleEngine/Engine/Wizard/UIMarquee.cs b/SVSim.BattleEngine/Engine/Wizard/UIMarquee.cs index 56e85ccb..25226a22 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIMarquee.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIMarquee.cs @@ -7,25 +7,7 @@ public class UIMarquee : MonoBehaviour private enum State { Stop, - WaitForMove, - Move, - Reappear - } - - [SerializeField] - [Range(0f, float.MaxValue)] - private float _secToStartMoving = 1.5f; - - [SerializeField] - [Range(0f, float.MaxValue)] - private float _movePerSec = 100f; - - [SerializeField] - [Range(0f, float.MaxValue)] - private float _secToReappear = 1.5f; - - [SerializeField] - private AnimationCurve _reappearCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); + WaitForMove } [SerializeField] [Range(0f, float.MaxValue)] @@ -66,44 +48,6 @@ public class UIMarquee : MonoBehaviour _widthOfNeedsToScroll = width; } - public void SetDefaultWidthOfNeedsToScroll() - { - _widthOfNeedsToScroll = _panel.width; - } - - private void Update() - { - _timeCount += Time.deltaTime; - switch (_state) - { - case State.WaitForMove: - if (_timeCount >= _secToStartMoving) - { - SetState(State.Move); - } - break; - case State.Move: - if (IsScrollComplete()) - { - SetState(State.Reappear); - SetAlpha(0f); - } - else - { - SetContentPosX(_startX - _movePerSec * _timeCount); - } - break; - case State.Reappear: - SetAlpha(_reappearCurve.Evaluate(_timeCount / _secToReappear)); - if (_timeCount >= _secToReappear) - { - SetState(State.WaitForMove); - SetAlpha(1f); - } - break; - } - } - private void SetState(State state) { _state = state; @@ -127,11 +71,6 @@ public class UIMarquee : MonoBehaviour obj.localPosition = localPosition; } - private bool IsScrollComplete() - { - return _content.transform.localPosition.x - _startX <= (float)(-_content.width); - } - private void SetAlpha(float alpha) { _panel.alpha = alpha; diff --git a/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectGroup.cs b/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectGroup.cs index 7ab78cef..ba0c5524 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectGroup.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectGroup.cs @@ -34,10 +34,6 @@ public class UIParticleEffectGroup : MonoBehaviour private int _saveScreenHeight; - private const string SHADER_NAME = "Cygames/UI/Transparent ColoredAdd"; - - private const float RENDER_TEXTURE_BASE_SIZE = 2048f; - private GameObject CreateParent() { GameObject obj = new GameObject(); @@ -88,36 +84,12 @@ public class UIParticleEffectGroup : MonoBehaviour } } - public void SetEffect(GameObject effect) - { - Vector3 localPosition = effect.transform.localPosition; - GameObject gameObject = CreateParent(); - effect.transform.parent = gameObject.transform; - effect.transform.localPosition = localPosition; - effect.transform.localScale = Vector3.one; - effect.SetLayer(gameObject.layer, isSetChildren: true); - SetEffectCommonSetting(effect); - } - private void SetEffectCommonSetting(GameObject effect) { UpdateRenderTexture(); UpdateUITextureSize(_uiTexture); } - private void Update() - { - if (UIManager.GetInstance().FrontCameraPixelWidth != _saveScreenWidth || UIManager.GetInstance().FrontCameraPixelHeight != _saveScreenHeight) - { - UpdateRenderTexture(); - UpdateUITextureSize(_uiTexture); - } - foreach (AutoUpdateInfo update in _updateList) - { - update.Effect.transform.localPosition = DecideEffectLocalPosition(update.Parent); - } - } - private void UpdateRenderTexture() { if (_renderTexture != null) @@ -156,12 +128,4 @@ public class UIParticleEffectGroup : MonoBehaviour _uiTexture = null; } } - - private void OnDestroy() - { - if (_renderTexture != null) - { - Object.Destroy(_renderTexture); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectManager.cs b/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectManager.cs index 17c6ae18..e28bed23 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectManager.cs @@ -23,20 +23,6 @@ public class UIParticleEffectManager : MonoBehaviour Instance = this; } - public UIParticleEffectGroup StartEffect(Effect2dCreateParam param, UITexture uiTexture, bool isEnableUpdateReposition) - { - UIParticleEffectGroup uIParticleEffectGroup = CreateNewGroup(uiTexture); - uIParticleEffectGroup.StartEffect(param, isEnableUpdateReposition); - return uIParticleEffectGroup; - } - - public UIParticleEffectGroup AddEffect(GameObject effect, UITexture uiTexture) - { - UIParticleEffectGroup uIParticleEffectGroup = CreateNewGroup(uiTexture); - uIParticleEffectGroup.SetEffect(effect); - return uIParticleEffectGroup; - } - public void Remove(UIParticleEffectGroup group) { if (_groupList.Remove(group)) @@ -56,14 +42,4 @@ public class UIParticleEffectManager : MonoBehaviour _groupList.Add(component); return component; } - - public void OnChangeScene() - { - foreach (UIParticleEffectGroup group in _groupList) - { - Object.Destroy(group.gameObject); - } - _groupList.Clear(); - _groupCount = 0; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/UIShaderSprite.cs b/SVSim.BattleEngine/Engine/Wizard/UIShaderSprite.cs index 976ebb4a..0e3c64f5 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIShaderSprite.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIShaderSprite.cs @@ -55,18 +55,4 @@ public class UIShaderSprite : UISprite drawCall.shader = shader; } } - - private void OnDestroy() - { - if (!_isSharedMaterial && _shader != null && base.atlas != null && _materialDic.TryGetValue(base.atlas.GetInstanceID(), out var value)) - { - Material value2 = null; - int instanceID = GetInstanceID(); - if (value.TryGetValue(instanceID, out value2)) - { - Object.Destroy(value2); - value.Remove(instanceID); - } - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/UISpriteAtlasOverwriter.cs b/SVSim.BattleEngine/Engine/Wizard/UISpriteAtlasOverwriter.cs index 2fbd3214..88aea1b4 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UISpriteAtlasOverwriter.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UISpriteAtlasOverwriter.cs @@ -25,20 +25,6 @@ public class UISpriteAtlasOverwriter : MonoBehaviour private readonly bool _includeChildren; - public UISprite[] Sprites - { - get - { - if (!_includeChildren) - { - return new UISprite[1] { _rootObject.GetComponent() }; - } - return _rootObject.GetComponentsInChildren(includeInactive: true); - } - } - - public bool IsRootObjectDestoryed => _rootObject == null; - public TargetObject(GameObject rootObject, bool includeChildren) { _rootObject = rootObject; @@ -54,16 +40,6 @@ public class UISpriteAtlasOverwriter : MonoBehaviour private readonly List _originalSpriteAtlasPairs = new List(); - private void OnDisable() - { - UndoParameters(); - } - - private void LateUpdate() - { - OverwriteAtlas(); - } - public void Init(UIAtlas atlas, TargetObject[] targetObjects) { UndoParameters(); @@ -91,76 +67,4 @@ public class UISpriteAtlasOverwriter : MonoBehaviour } _originalSpriteAtlasPairs.Clear(); } - - private void OverwriteAtlas() - { - if (!(_atlas == null) && _targetObjects != null) - { - TargetObject[] targetObjects = _targetObjects; - foreach (TargetObject targetObject in targetObjects) - { - OverwriteAtlas(targetObject); - } - } - } - - private void OverwriteAtlas(TargetObject targetObject) - { - UISprite[] sprites = targetObject.Sprites; - foreach (UISprite uISprite in sprites) - { - if (!IsExceptionSprite(uISprite)) - { - OverwriteAtlas(uISprite); - } - } - } - - private bool IsExceptionSprite(UISprite sprite) - { - if (_exceptionObjects == null) - { - return false; - } - if (_exceptionObjects.Count() == 0) - { - _exceptionObjects = null; - return false; - } - try - { - TargetObject[] array = _exceptionObjects.ToArray(); - foreach (TargetObject targetObject in array) - { - if (targetObject.IsRootObjectDestoryed) - { - _exceptionObjects.Remove(targetObject); - continue; - } - UISprite[] sprites = targetObject.Sprites; - for (int j = 0; j < sprites.Length; j++) - { - if (sprites[j] == sprite) - { - return true; - } - } - } - } - catch - { - return false; - } - return false; - } - - private void OverwriteAtlas(UISprite targetSprite) - { - if (!(targetSprite.atlas == _atlas) && _atlas.spriteList.Any((UISpriteData s) => s.name == targetSprite.spriteName)) - { - _originalSpriteAtlasPairs.Add(new SpriteAtlasPair(targetSprite)); - targetSprite.atlas = _atlas; - targetSprite.CreatePanel(); - } - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/UIUtil.cs b/SVSim.BattleEngine/Engine/Wizard/UIUtil.cs index cdf6f8ee..5f43b249 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UIUtil.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UIUtil.cs @@ -8,7 +8,6 @@ namespace Wizard; public static class UIUtil { - private const int TEMP_STRING_BUILDER_CAPACITY = 1024; public static StringBuilder _tempStringBuilder = new StringBuilder(1024); @@ -18,13 +17,6 @@ public static class UIUtil return _tempStringBuilder; } - public static void SetPositionX(Transform targetTransform, float x) - { - Vector2 vector = targetTransform.localPosition; - vector.x = x; - targetTransform.localPosition = vector; - } - public static void SetPositionY(Transform targetTransform, float y) { Vector2 vector = targetTransform.localPosition; @@ -46,35 +38,6 @@ public static class UIUtil targetTransform.localPosition = localPosition; } - public static string GetBattleTypeName(NetworkDefine.ServerBattleType battleType) - { - switch (battleType) - { - case NetworkDefine.ServerBattleType.Free: - return Data.SystemText.Get("Battle_0001"); - case NetworkDefine.ServerBattleType.Rank: - return Data.SystemText.Get("Battle_0002"); - case NetworkDefine.ServerBattleType.OpenRoom: - case NetworkDefine.ServerBattleType.RoomTwoPick: - case NetworkDefine.ServerBattleType.Gathering: - case NetworkDefine.ServerBattleType.OfflineEvent: - return Data.SystemText.Get("Battle_0003"); - case NetworkDefine.ServerBattleType.TwoPick: - return Data.SystemText.Get("Battle_0004"); - case NetworkDefine.ServerBattleType.Colosseum: - case NetworkDefine.ServerBattleType.ColosseumTwoPick: - return Data.SystemText.Get("Colosseum_0001"); - case NetworkDefine.ServerBattleType.Competition: - case NetworkDefine.ServerBattleType.CompetitionTwoPick: - return Data.SystemText.Get("Competition_0006"); - case NetworkDefine.ServerBattleType.Sealed: - return Data.SystemText.Get("BattleName_Sealed"); - default: - Debug.LogError($"unsupported BattleType : {battleType}({(int)battleType})"); - return string.Empty; - } - } - public static string GetFormatName(Format format) { return format switch @@ -91,34 +54,6 @@ public static class UIUtil }; } - public static bool IsTwoPickForReplay(BattleParameter battleParameter) - { - if (battleParameter.IsTwoPick) - { - if (battleParameter.TwoPickFormat != TwoPickFormat.Cube && battleParameter.TwoPickFormat != TwoPickFormat.Chaos && battleParameter.TwoPickFormat != TwoPickFormat.BackdraftChaos) - { - return battleParameter.TwoPickFormat != TwoPickFormat.BackdraftCube; - } - return false; - } - return false; - } - - public static string GetFormatSmallSpriteName(Format format) - { - return format switch - { - Format.Rotation => "icon_timesliprotation_s", - Format.Unlimited => "icon_unlimited_s", - Format.PreRotation => "icon_prerotation_s", - Format.Sealed => "icon_sealed_s", - Format.Crossover => "icon_crossover_s", - Format.MyRotation => "icon_myrotation_s", - Format.Avatar => "icon_heroesbattle_s", - _ => string.Empty, - }; - } - public static string GetShortClassName(CardBasePrm.ClanType clan) { switch (clan) @@ -184,11 +119,6 @@ public static class UIUtil return result >= 0; } - public static bool IsValidViewerId(string idString) - { - return IsValidIdDigits(idString, 9); - } - public static string CreateListText(IList list, string separator, string header = null, string footer = null) { StringBuilder tempStringBuilder = GetTempStringBuilder(); @@ -235,13 +165,6 @@ public static class UIUtil UIManager.GetInstance().StartCoroutine(grid.RepositionNextFrame()); } - public static void SetCountryTexture(UITexture texture, string countryCode) - { - bool flag = !string.IsNullOrEmpty(countryCode); - texture.gameObject.SetActive(flag); - texture.mainTexture = (flag ? (Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(countryCode, ResourcesManager.AssetLoadPathType.Country_M, isfetch: true)) as Texture) : null); - } - public static string ExtractStringAlphabet(string str) { return Regex.Replace(str, "[^a-zA-z]", string.Empty); diff --git a/SVSim.BattleEngine/Engine/Wizard/UnlimitedFormatBehavior.cs b/SVSim.BattleEngine/Engine/Wizard/UnlimitedFormatBehavior.cs index 6237ed14..0c6b62b2 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UnlimitedFormatBehavior.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UnlimitedFormatBehavior.cs @@ -2,6 +2,10 @@ using System; using System.Collections.Generic; using System.Linq; using Wizard.DeckCardEdit; +// TODO(engine-cleanup-pass2): 33 of 34 methods unrun in baseline +// Type: Wizard.UnlimitedFormatBehavior +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard; @@ -61,7 +65,7 @@ public class UnlimitedFormatBehavior : IFormatBehavior public bool IsShowFavoriteFilter => true; - public bool IsShowSpotCardFilter => GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(); + public bool IsShowSpotCardFilter => false; // headless: no user inventory / spot cards public bool IsEnableDeckShareButton(int cardNum, int cardNumMax) { @@ -70,22 +74,22 @@ public class UnlimitedFormatBehavior : IFormatBehavior public IDictionary GetCardPool(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetUserOwnCardData(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public Dictionary ClonePossessionCardDictionary(bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().ClonePossessionCardDictionary(isIncludingSpotCard); + return new System.Collections.Generic.Dictionary(); // headless: empty inventory } public int GetPossessionCardNum(int cardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionCardNum(cardId, isIncludingSpotCard); + return 0; // headless: no user card counts } public int GetPossessionBaseCardNum(int baseCardId, bool isIncludingSpotCard) { - return GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardNum(baseCardId, isIncludingSpotCard, CardMasterId); + return 0; // headless: no user card counts } private List GetAvailableCardSetNameList() diff --git a/SVSim.BattleEngine/Engine/Wizard/UserDataDialog.cs b/SVSim.BattleEngine/Engine/Wizard/UserDataDialog.cs deleted file mode 100644 index 52a8f507..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UserDataDialog.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class UserDataDialog : MonoBehaviour -{ - [SerializeField] - private GuildUserDataDialog _inviteView; - - private bool _isFinishLoadResource; - - private List _loadedResourceList = new List(); - - public DialogBase Dialog { get; private set; } - - public static UserDataDialog Create(GameObject prefab, UserInfoBase user, string dialogTitle) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - dialogBase.SetTitleLabel(dialogTitle); - dialogBase.SetSize(DialogBase.Size.S); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn); - UserDataDialog component = UnityEngine.Object.Instantiate(prefab).GetComponent(); - _ = component.gameObject; - dialogBase.SetObj(component.gameObject); - component.Dialog = dialogBase; - component.Initialize(user, dialogBase); - return component; - } - - private void Initialize(UserInfoBase user, DialogBase dialog) - { - UIManager uiManager = UIManager.GetInstance(); - uiManager.StartCoroutine(LoadResource(user, delegate - { - if (base.gameObject != null) - { - _inviteView.SetUserData(user); - } - })); - dialog.OnClose = (Action)Delegate.Combine(dialog.OnClose, (Action)delegate - { - uiManager.StartCoroutine(UnloadImages(delegate - { - if (this != null) - { - UnityEngine.Object.Destroy(base.gameObject); - } - })); - }); - } - - private IEnumerator LoadResource(UserInfoBase userData, Action callBack) - { - _isFinishLoadResource = false; - List resourcePathList = userData.GetUserAssetPathList(); - yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(resourcePathList, delegate - { - _isFinishLoadResource = true; - })); - _loadedResourceList.AddRange(resourcePathList); - callBack.Call(); - } - - private IEnumerator UnloadImages(Action callBack) - { - while (!_isFinishLoadResource) - { - yield return null; - } - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - callBack.Call(); - } - - public void SetDiscriptionLabel(string text) - { - _inviteView.SetDiscriptionLabel(text); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UserGoods.cs b/SVSim.BattleEngine/Engine/Wizard/UserGoods.cs index 1022414c..88ef2e81 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UserGoods.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UserGoods.cs @@ -44,8 +44,6 @@ public class UserGoods public long Id { get; private set; } - public string Name => getUserGoodsName(GoodsType, Id); - public string Thumbnail => GetUserGoodsImageName(GoodsType, Id); public UserGoods(Type type, long userGoodsId) @@ -170,7 +168,7 @@ public class UserGoods private static string GetSkinName(long id) { - ClassCharacterMasterData charaPrmBySkinId = GameMgr.GetIns().GetDataMgr().GetCharaPrmBySkinId((int)id); + ClassCharacterMasterData charaPrmBySkinId = null; // Pre-Phase-5b: no chara master headless if (charaPrmBySkinId == null) { return null; diff --git a/SVSim.BattleEngine/Engine/Wizard/UserInfoBase.cs b/SVSim.BattleEngine/Engine/Wizard/UserInfoBase.cs deleted file mode 100644 index 5963ecf4..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UserInfoBase.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.Collections.Generic; -using LitJson; -using UnityEngine; -using Wizard.RoomMatch; - -namespace Wizard; - -public abstract class UserInfoBase -{ - public int ViewerId { get; private set; } - - public string Name { get; private set; } - - public long EmblemId { get; private set; } - - public string CountryCode { get; private set; } - - public int Rank { get; private set; } - - public int DegreeId { get; private set; } - - public bool? IsFriend { get; private set; } - - public bool? IsFriendRequestSending { get; private set; } - - public bool IsSelf => ViewerId == PlayerStaticData.UserViewerID; - - public UserInfoBase(int viewerId, string name, long emblemId, string country, int rank, int degreeId, bool isFriend) - { - ViewerId = viewerId; - Name = name; - EmblemId = emblemId; - CountryCode = country; - Rank = rank; - DegreeId = degreeId; - IsFriend = isFriend; - } - - public UserInfoBase(JsonData json) - { - ViewerId = json["viewer_id"].ToInt(); - Name = json["name"].ToString(); - EmblemId = json["emblem_id"].ToLong(); - CountryCode = json["country_code"].ToString(); - Rank = json["rank"].ToInt(); - DegreeId = json["degree_id"].ToInt(); - if (json.Keys.Contains("is_friend")) - { - IsFriend = json["is_friend"].ToBoolean(); - } - if (json.Keys.Contains("is_friend_apply")) - { - IsFriendRequestSending = json["is_friend_apply"].ToBoolean(); - } - } - - public UserInfoBase(Player player) - { - ViewerId = player.ViewerId; - Name = player.Name; - EmblemId = player.Emblem; - CountryCode = player.Country; - Rank = player.Rank; - DegreeId = player.Degree; - IsFriend = player.IsFriend; - } - - public UserInfoBase(UserFriend friend) - { - ViewerId = friend.viewerId; - Name = friend.name; - EmblemId = friend.emblemId; - CountryCode = friend.countryCode; - Rank = friend.rank; - DegreeId = friend.degreeId; - IsFriend = friend.IsFriend; - } - - public abstract Texture GetUserEmblemTexture(); - - public abstract Texture GetUserRankTexture(); - - public abstract void InitializeDegreeTexture(UITexture texture); - - public abstract Texture GetUserCountryTexture(); - - public abstract List GetUserAssetPathList(); -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UserListView.cs b/SVSim.BattleEngine/Engine/Wizard/UserListView.cs deleted file mode 100644 index f93b1d8d..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UserListView.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class UserListView : MonoBehaviour -{ - [SerializeField] - private SimpleScrollViewUI _scrollView; - - [SerializeField] - private UIPanel _panel; - - private List _userList; - - private string _actionButtonLabel; - - private Dictionary> _loadQueueDict = new Dictionary>(); - - private LoadQueue _loadQueue = new LoadQueue(); - - private List _loadedResourceList = new List(); - - public Action PlateCustomize { get; set; } - - public int PanelDepth - { - set - { - _panel.depth = value; - } - } - - public Action OnSelect { get; set; } - - public DialogBase Dialog { get; private set; } - - public static UserListView CreateDialog(GameObject prefab, List userList, Action actionButtonEvent, string actionButtonLabel) - { - DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose(); - UserListView component = UnityEngine.Object.Instantiate(prefab).GetComponent(); - dialogBase.SetObj(component.gameObject); - dialogBase.SetSize(DialogBase.Size.M); - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - component.Initialize(dialogBase, userList, actionButtonEvent, actionButtonLabel); - return component; - } - - public static UserListView CreateView(GameObject prefab, GameObject parent, List userList, Action actionButtonEvent, string actionButtonLabel) - { - UserListView component = NGUITools.AddChild(parent, prefab).GetComponent(); - component.Initialize(null, userList, actionButtonEvent, actionButtonLabel); - return component; - } - - private void Initialize(DialogBase dialog, List userList, Action actionButton, string actionButtonLabel) - { - _actionButtonLabel = actionButtonLabel; - _userList = userList; - OnSelect = actionButton; - Dialog = dialog; - UIManager.GetInstance().createInSceneCenterLoading(); - StartCoroutine(LoadFriendUserImages(userList, delegate - { - _scrollView.CreateScrollView(userList.Count, InitializeInviteFriendPlate); - UIManager.GetInstance().closeInSceneCenterLoading(); - })); - } - - private void OnDestroy() - { - UnloadImages(); - } - - private void UnloadImages() - { - if (_loadedResourceList.Count > 0) - { - Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList); - _loadedResourceList.Clear(); - } - } - - private void InitializeInviteFriendPlate(int index, GameObject plateObject) - { - UserListViewPlate component = plateObject.GetComponent(); - component.Initialize(_userList[index], _actionButtonLabel); - component.SetUnderLine(index < _userList.Count - 1); - component.OnAction = delegate(UserInfoBase userInfo) - { - OnSelect.Call(userInfo); - }; - PlateCustomize.Call(component, _userList[index]); - } - - private IEnumerator LoadFriendUserImages(List userList, Action callBack = null) - { - List loadPathList = new List(); - List list = new List(); - _loadQueueDict.Clear(); - for (int i = 0; i < userList.Count; i++) - { - List list2 = new List(userList[i].GetUserAssetPathList().Except(list).Except(_loadedResourceList)); - if (i < _scrollView.ScrollObjectNum) - { - loadPathList.AddRange(list2); - } - else - { - string text = i.ToString(); - _loadQueueDict.Add(text, list2); - LoadQueue.Callback onEnd = delegate(string id) - { - _loadedResourceList.AddRange(_loadQueueDict[id]); - }; - _loadQueue.AddToLast(text, list2, null, onEnd); - } - list.AddRange(list2); - } - if (loadPathList.Count > 0) - { - yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadPathList, null)); - _loadedResourceList.AddRange(loadPathList); - } - _loadQueue.StartLoad(); - callBack.Call(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UserListViewPlate.cs b/SVSim.BattleEngine/Engine/Wizard/UserListViewPlate.cs deleted file mode 100644 index 7d640d71..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UserListViewPlate.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using Cute; -using UnityEngine; - -namespace Wizard; - -public class UserListViewPlate : UserPlateBase -{ - [SerializeField] - private UIButton _actionButton; - - [SerializeField] - private UILabel _actionButtonLabel; - - [SerializeField] - private GameObject _underLine; - - public Action OnAction { get; set; } - - public void Initialize(UserInfoBase userInfo, string actionButtonLabel) - { - InitializeBase(userInfo); - _actionButtonLabel.text = actionButtonLabel; - _actionButton.onClick.Clear(); - _actionButton.onClick.Add(new EventDelegate(delegate - { - OnAction.Call(userInfo); - })); - } - - public void SetUnderLine(bool visible) - { - if (_underLine != null) - { - _underLine.SetActive(visible); - } - } - - public void SetButtonVisible(bool visible) - { - _actionButton.gameObject.SetActive(visible); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UserPlateBase.cs b/SVSim.BattleEngine/Engine/Wizard/UserPlateBase.cs deleted file mode 100644 index 3b2e5267..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UserPlateBase.cs +++ /dev/null @@ -1,35 +0,0 @@ -using UnityEngine; - -namespace Wizard; - -public class UserPlateBase : MonoBehaviour -{ - [SerializeField] - private UITexture _textureEmblem; - - [SerializeField] - private UITexture _textureCountry; - - [SerializeField] - private UITexture _textureRank; - - [SerializeField] - private UILabel _labelMemberName; - - [SerializeField] - private UITexture _textureDegree; - - protected void InitializeBase(UserInfoBase userInfo) - { - InitializeSimplePlate(userInfo); - } - - public void InitializeSimplePlate(UserInfoBase userInfo) - { - _textureEmblem.mainTexture = userInfo.GetUserEmblemTexture(); - _textureRank.mainTexture = userInfo.GetUserRankTexture(); - userInfo.InitializeDegreeTexture(_textureDegree); - _textureCountry.mainTexture = userInfo.GetUserCountryTexture(); - _labelMemberName.text = userInfo.Name; - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UserRegionUpdater.cs b/SVSim.BattleEngine/Engine/Wizard/UserRegionUpdater.cs deleted file mode 100644 index 459329a7..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/UserRegionUpdater.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Cute; - -namespace Wizard; - -public class UserRegionUpdater -{ - private enum UpdateRegionType - { - CURRENT, - INSTALL - } - - private RegionCodeUpdateTask _regionUpdateTask; - - private UpdateRegionType _updateType = UpdateRegionType.INSTALL; - - private bool _isUpdateRegion; - - public UserRegionUpdater() - { - _regionUpdateTask = new RegionCodeUpdateTask(); - } - - public void UpDateRegion(Action callback) - { - string value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.INSTALL_REGION_CODE); - string currentRegionStr = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.CURRENT_REGION_CODE); - if (string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(currentRegionStr)) - { - _isUpdateRegion = true; - _updateType = UpdateRegionType.INSTALL; - } - else if (!string.IsNullOrEmpty(currentRegionStr) && value != currentRegionStr) - { - _isUpdateRegion = true; - _updateType = UpdateRegionType.CURRENT; - } - if (!_isUpdateRegion) - { - callback(); - return; - } - _regionUpdateTask.SetParameter((int)_updateType); - UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(_regionUpdateTask, delegate - { - PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.INSTALL_REGION_CODE, currentRegionStr); - callback(); - }, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode)); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/UtilityDrumrollItemCustomize.cs b/SVSim.BattleEngine/Engine/Wizard/UtilityDrumrollItemCustomize.cs index 6985a442..5224df38 100644 --- a/SVSim.BattleEngine/Engine/Wizard/UtilityDrumrollItemCustomize.cs +++ b/SVSim.BattleEngine/Engine/Wizard/UtilityDrumrollItemCustomize.cs @@ -4,7 +4,6 @@ namespace Wizard; public abstract class UtilityDrumrollItemCustomize : MonoBehaviour { - public abstract void OnUpdate(float angle, Color32 color); public abstract void OnInitialize(int index); } diff --git a/SVSim.BattleEngine/Engine/Wizard/WebViewHelper.cs b/SVSim.BattleEngine/Engine/Wizard/WebViewHelper.cs index bdfd2151..83a00978 100644 --- a/SVSim.BattleEngine/Engine/Wizard/WebViewHelper.cs +++ b/SVSim.BattleEngine/Engine/Wizard/WebViewHelper.cs @@ -37,8 +37,6 @@ public class WebViewHelper NICONICO_PUBLISH } - private const int NICONICO_NOTIFICATION_URLDIALOG_DEPTH = 3000; - private bool _isDestroyedWebView; private DialogBase _webViewDialog; @@ -119,67 +117,6 @@ public class WebViewHelper return "?lang=" + CustomPreference.GetTextLanguage() + "&HASH_ID=" + encodedViewerId + "&SID=" + encodedSessionId + "&SUDID=" + encodedShortUdid; } - private string GetWebviewBaseQueryParametersLangOnly() - { - return "?lang=" + CustomPreference.GetTextLanguage(); - } - - private DialogBase OpenWebView_Inner(WebViewType webviewtype) - { - _isDestroyedWebView = false; - string webViewDialogTitleId = GetWebViewDialogTitleId(webviewtype); - SetWebviewOpenUrl(webviewtype); - DialogBase dialogBase = (_webViewDialog = UIManager.GetInstance().CreateDialogClose(isSystem: false, dontChangeLabelColor: true)); - dialogBase.SetSize(DialogBase.Size.XL); - if (webViewDialogTitleId != null) - { - dialogBase.SetTitleLabel(Data.SystemText.Get(webViewDialogTitleId)); - } - else - { - dialogBase.SetTitleLabel(string.Empty); - dialogBase.SetTitleLineVisible(visible: false); - dialogBase.CloseOnOff(flag: false); - } - if (webviewtype == WebViewType.INFO || webviewtype == WebViewType.LIMITED_INFO || webviewtype == WebViewType.ANNOUNCE) - { - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.NONE); - } - else - { - dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn); - } - dialogBase.SetButtonDelegate(delegate - { - DestroyWebView(); - }, delegate - { - DestroyWebView(); - }, delegate - { - DestroyWebView(); - }); - dialogBase.onCloseWithoutSelect = delegate - { - DestroyWebView(); - }; - dialogBase.SetAnchors(); - dialogBase.SetPanelDepth(3000); - WebViewScreen webViewScreen = WebViewManager.getInstance().m_WebViewScreen; - if (webviewtype == WebViewType.INFO || webviewtype == WebViewType.LIMITED_INFO || webviewtype == WebViewType.ANNOUNCE) - { - Vector4 webViewDisplayRect = dialogBase.GetWebViewDisplayRect(); - webViewScreen.CurBoxCollider.size = new Vector3(webViewDisplayRect.z, webViewDisplayRect.w, 0f); - webViewScreen.CurBoxCollider.center = new Vector3(webViewDisplayRect.x, webViewDisplayRect.y, 0f); - } - else - { - webViewScreen.CurBoxCollider.size = Global.WEBVIEW_NORMAL_SIZE; - webViewScreen.CurBoxCollider.center = Vector2.zero; - } - return dialogBase; - } - private string GetWebViewDialogTitleId(WebViewType webviewtype) { string result = null; @@ -229,13 +166,6 @@ public class WebViewHelper return result; } - private void SetWebviewOpenUrl(WebViewType webviewtype) - { - switch (webviewtype) - { - } - } - private string GetBrowserUrl(WebViewType webviewtype) { string text = null; @@ -382,12 +312,4 @@ public class WebViewHelper { onFinish(); } - - public void OpenUrl(string url) - { - PrepareOpenUrl(delegate - { - BrowserURL.Open(url); - }); - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/WebViewScreen.cs b/SVSim.BattleEngine/Engine/Wizard/WebViewScreen.cs index b6dc1db3..00d14a81 100644 --- a/SVSim.BattleEngine/Engine/Wizard/WebViewScreen.cs +++ b/SVSim.BattleEngine/Engine/Wizard/WebViewScreen.cs @@ -9,9 +9,4 @@ public class WebViewScreen : MonoBehaviour private BoxCollider curBoxCollider; public BoxCollider CurBoxCollider => curBoxCollider; - - public void EditorSetBoxCollieder(BoxCollider setBoxCollider) - { - curBoxCollider = setBoxCollider; - } } diff --git a/SVSim.BattleEngine/Engine/Wizard/WhenGetOffTagCollection.cs b/SVSim.BattleEngine/Engine/Wizard/WhenGetOffTagCollection.cs index 95b234ee..a634d897 100644 --- a/SVSim.BattleEngine/Engine/Wizard/WhenGetOffTagCollection.cs +++ b/SVSim.BattleEngine/Engine/Wizard/WhenGetOffTagCollection.cs @@ -14,8 +14,6 @@ public class WhenGetOffTagCollection : TagCollection protected override AIPlayTagType[] MANAGED_TAG_TYPES => _managedTagTypes; - public List GetOffMetamorphoseList => _getOffMetamorphoseList; - public WhenGetOffTagCollection() : base(TagCollectionType.WhenGetOff) { diff --git a/SVSim.BattleEngine/Engine/Wizard/WizardFirebase.cs b/SVSim.BattleEngine/Engine/Wizard/WizardFirebase.cs deleted file mode 100644 index 3a1b8eec..00000000 --- a/SVSim.BattleEngine/Engine/Wizard/WizardFirebase.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Wizard; - -public class WizardFirebase -{ - public static bool IsEnable => false; - - public static void OnBootSystem() - { - UpdateFirebaseEnable(); - } - - private static void UpdateFirebaseEnable() - { - } - - public static void OnChangeDataUseEnable() - { - UpdateFirebaseEnable(); - } -} diff --git a/SVSim.BattleEngine/Engine/Wizard/_3dCardFrameManager.cs b/SVSim.BattleEngine/Engine/Wizard/_3dCardFrameManager.cs index 4986fa4f..36d8e115 100644 --- a/SVSim.BattleEngine/Engine/Wizard/_3dCardFrameManager.cs +++ b/SVSim.BattleEngine/Engine/Wizard/_3dCardFrameManager.cs @@ -9,18 +9,14 @@ public class _3dCardFrameManager public enum eFrameKind { Normal, - Phantom, - Max - } + Phantom } private enum eCardKind { Follower, Spell, Amulet, - HeroSkill, - Max - } + HeroSkill } private class FrameInfo { @@ -31,10 +27,6 @@ public class _3dCardFrameManager public int[] TargetRarities { get; set; } } - private const string RAINBOW_TEXTURE_NAME = "tx_foil_rainbow"; - - private const string LEGEND_FRAME_MASK_NAME_FORMAT = "tx_mask_CardFrame_{0}_Legend"; - private static readonly eCardKind[] CARD_KINDS = new eCardKind[4] { eCardKind.Follower, @@ -81,22 +73,6 @@ public class _3dCardFrameManager private readonly Material[,,] _frameMaterialList = new Material[2, 4, 5]; - public static List GetCommonLoadAssetList() - { - ResourcesManager resourcesManager = Toolbox.ResourcesManager; - List list = new List(); - list.Add(resourcesManager.GetAssetTypePath("tx_foil_rainbow", ResourcesManager.AssetLoadPathType.CardFrameTextureCommon)); - eCardKind[] cARD_KINDS = CARD_KINDS; - foreach (eCardKind eCardKind in cARD_KINDS) - { - if (!BattleManagerBase.IsTutorial || eCardKind != eCardKind.HeroSkill) - { - list.Add(resourcesManager.GetAssetTypePath(GetLegendFrameMaskName(eCardKind), ResourcesManager.AssetLoadPathType.CardFrameTextureCommon)); - } - } - return list; - } - public static List GetLoadAssetList(eFrameKind frameKind) { ResourcesManager resourcesManager = Toolbox.ResourcesManager; @@ -160,12 +136,6 @@ public class _3dCardFrameManager } } - public void ClearCache() - { - _rainbowTexture = null; - _legendFrameMaskList = null; - } - public void ClearFrameMaterials(eFrameKind frameKind) { FrameInfo frameInfo = FRAME_INFO_TABLE[(int)frameKind]; diff --git a/SVSim.BattleEngine/Engine/Wizard/eColorCodeId.cs b/SVSim.BattleEngine/Engine/Wizard/eColorCodeId.cs index 5c871168..803ccd24 100644 --- a/SVSim.BattleEngine/Engine/Wizard/eColorCodeId.cs +++ b/SVSim.BattleEngine/Engine/Wizard/eColorCodeId.cs @@ -2,47 +2,12 @@ namespace Wizard; public enum eColorCodeId { - CARD_PANEL_QUEST_TITLE_OUTLINE, - CARD_PANEL_QUEST_TITLE_GRAD_TOP, - CARD_PANEL_QUEST_TITLE_GRAD_BOTTOM, QuestBackButtonGradientTop, QuestBackButtonGradientBottom, QuestFooterOutline, QuestFooterGradientTop, QuestFooterGradientBottom, - QuestPeriodColor, QuestSelectButtonTextColor, - QuestSelectButtonOnEffectColor, - QuestSelectButtonRippleEffectColor, - CARD_PANEL_GP_SP_LINE_SPRITE_COLOR, - CARD_PANEL_GP_SP_TITLE_OUTLINE, - CARD_PANEL_GP_SP_TITLE_GRAD_TOP, - CARD_PANEL_GP_SP_TITLE_GRAD_BOTTOM, - CARD_PANEL_GP_SP_ROUND_INFO_OUTLINE, - GP_SP_BACK_BTN_GRAD_TOP, - GP_SP_BACK_BTN_GRAD_BOTTOM, - GP_SP_FOOTER_OUTLINE, - GP_SP_FOOTER_GRAD_TOP, - GP_SP_FOOTER_GRAD_BOTTOM, - GP_SP_WIN_NUM_OUTLINE, - GP_SP_WIN_NUM_GRAD_TOP, - GP_SP_WIN_NUM_GRAD_BOTTOM, - GP_SP_WIN_NUM_UNIT_OUTLINE, - GP_SP_WIN_NUM_UNIT_GRAD_TOP, - GP_SP_WIN_NUM_UNIT_GRAD_BOTTOM, - GP_SP_WIN_OUTLINE, - GP_SP_WIN_GRAD_TOP, - GP_SP_WIN_GRAD_BOTTOM, - GP_SP_LOSE_OUTLINE, - GP_SP_LOSE_GRAD_TOP, - GP_SP_LOSE_GRAD_BOTTOM, - GP_SP_MATCH_COLOR, - GP_SP_DECISION_BTN_2_COLOR, - CARD_PANEL_GP_LINE_SPRITE_COLOR, - CARD_PANEL_GP_TITLE_OUTLINE, - CARD_PANEL_GP_TITLE_GRAD_TOP, - CARD_PANEL_GP_TITLE_GRAD_BOTTOM, - COMPETITION_DECISION_BUTTON_EFFECT_COLOR, WIN_ORB_EFFECT_COLOR, LOSE_ORB_EFFECT_COLOR, DECISION_BTN_2_COLOR, @@ -63,40 +28,5 @@ public enum eColorCodeId SEALED_CLASS_VAMPIRE_EFFECT_COLOR, SEALED_CLASS_BISHOP_EFFECT_COLOR, SEALED_CLASS_NEMESIS_EFFECT_COLOR, - GP10_CARD_PANEL_LINE_SPRITE_COLOR, - GP10_CARD_PANEL_TITLE_OUTLINE, - GP10_CARD_PANEL_TITLE_GRAD_TOP, - GP10_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP10_CARD_PANEL_ROUND_INFO_OUTLINE, - GP11_CARD_PANEL_LINE_SPRITE_COLOR, - GP11_CARD_PANEL_TITLE_OUTLINE, - GP11_CARD_PANEL_TITLE_GRAD_TOP, - GP11_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP11_CARD_PANEL_ROUND_INFO_OUTLINE, - GP12_CARD_PANEL_LINE_SPRITE_COLOR, - GP12_CARD_PANEL_TITLE_OUTLINE, - GP12_CARD_PANEL_TITLE_GRAD_TOP, - GP12_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP12_CARD_PANEL_ROUND_INFO_OUTLINE, - GP13_CARD_PANEL_LINE_SPRITE_COLOR, - GP13_CARD_PANEL_TITLE_OUTLINE, - GP13_CARD_PANEL_TITLE_GRAD_TOP, - GP13_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP13_CARD_PANEL_ROUND_INFO_OUTLINE, - GP14_CARD_PANEL_LINE_SPRITE_COLOR, - GP14_CARD_PANEL_TITLE_OUTLINE, - GP14_CARD_PANEL_TITLE_GRAD_TOP, - GP14_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP14_CARD_PANEL_ROUND_INFO_OUTLINE, - GP15_CARD_PANEL_LINE_SPRITE_COLOR, - GP15_CARD_PANEL_TITLE_OUTLINE, - GP15_CARD_PANEL_TITLE_GRAD_TOP, - GP15_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP15_CARD_PANEL_ROUND_INFO_OUTLINE, - GP16_CARD_PANEL_LINE_SPRITE_COLOR, - GP16_CARD_PANEL_TITLE_OUTLINE, - GP16_CARD_PANEL_TITLE_GRAD_TOP, - GP16_CARD_PANEL_TITLE_GRAD_BOTTOM, - GP16_CARD_PANEL_ROUND_INFO_OUTLINE, MAX } diff --git a/SVSim.BattleEngine/Engine/WrapContentsScrollBarSize.cs b/SVSim.BattleEngine/Engine/WrapContentsScrollBarSize.cs index 027b9aa7..2b71f4bd 100644 --- a/SVSim.BattleEngine/Engine/WrapContentsScrollBarSize.cs +++ b/SVSim.BattleEngine/Engine/WrapContentsScrollBarSize.cs @@ -4,18 +4,6 @@ public class WrapContentsScrollBarSize : MonoBehaviour { public UIWrapContent wrapContent; - private void Start() - { - UIWidget uIWidget = base.gameObject.GetComponent(); - if (uIWidget == null) - { - uIWidget = base.gameObject.AddComponent(); - } - uIWidget.height = wrapContent.itemSize * (Mathf.Abs(wrapContent.minIndex - wrapContent.maxIndex) + 1); - uIWidget.pivot = UIWidget.Pivot.Top; - base.transform.localPosition = new Vector3(0f, (float)wrapContent.itemSize / 2f, 0f); - } - public void ContentUpdate() { UIWidget uIWidget = base.gameObject.GetComponent(); diff --git a/SVSim.BattleEngine/Engine/WrapContentsScrollBarSizeByDirection.cs b/SVSim.BattleEngine/Engine/WrapContentsScrollBarSizeByDirection.cs deleted file mode 100644 index aa5ba1a6..00000000 --- a/SVSim.BattleEngine/Engine/WrapContentsScrollBarSizeByDirection.cs +++ /dev/null @@ -1,48 +0,0 @@ -using UnityEngine; - -public class WrapContentsScrollBarSizeByDirection : MonoBehaviour -{ - [SerializeField] - private UIScrollView _scrollView; - - [SerializeField] - private UIWrapContent _wrapContent; - - private UIWidget _uiWidget; - - private void Start() - { - ContentUpdate(); - } - - public void ContentUpdate() - { - if (_uiWidget == null) - { - SetUpUIWidget(); - } - _uiWidget.pivot = UIWidget.Pivot.TopLeft; - int num = _wrapContent.itemSize * (Mathf.Abs(_wrapContent.minIndex - _wrapContent.maxIndex) + 1); - float num2 = (float)_wrapContent.itemSize / 2f; - switch (_scrollView.movement) - { - case UIScrollView.Movement.Vertical: - _uiWidget.height = num; - base.transform.localPosition = new Vector3(0f, num2, 0f); - break; - case UIScrollView.Movement.Horizontal: - _uiWidget.width = num; - base.transform.localPosition = new Vector3(0f - num2, 0f, 0f); - break; - } - } - - private void SetUpUIWidget() - { - _uiWidget = base.gameObject.GetComponent(); - if (_uiWidget == null) - { - _uiWidget = base.gameObject.AddComponent(); - } - } -} diff --git a/SVSim.BattleEngine/Engine/WrapVariableContentsScrollBarSize.cs b/SVSim.BattleEngine/Engine/WrapVariableContentsScrollBarSize.cs deleted file mode 100644 index 2bf50312..00000000 --- a/SVSim.BattleEngine/Engine/WrapVariableContentsScrollBarSize.cs +++ /dev/null @@ -1,34 +0,0 @@ -using UnityEngine; - -public class WrapVariableContentsScrollBarSize : MonoBehaviour -{ - public UIWrapVariableContentVertical wrapContent; - - private void Start() - { - ContentUpdate(); - } - - public void ContentUpdate() - { - UIWidget uIWidget = base.gameObject.GetComponent(); - if (uIWidget == null) - { - uIWidget = base.gameObject.AddComponent(); - } - int num = 0; - for (int i = 0; i < wrapContent.ItemParamList.Count; i++) - { - num += wrapContent.ItemParamList[i].Size; - } - uIWidget.height = num; - uIWidget.pivot = UIWidget.Pivot.Top; - Vector3 localPosition = Vector3.zero; - if (wrapContent.ItemParamList.Count > 0) - { - float position = wrapContent.ItemParamList[0].Position; - localPosition = new Vector3(localPosition.x, position, localPosition.z); - } - base.transform.localPosition = localPosition; - } -} diff --git a/SVSim.BattleEngine/Engine/YuwanField.cs b/SVSim.BattleEngine/Engine/YuwanField.cs index 727c58e2..0b0064fb 100644 --- a/SVSim.BattleEngine/Engine/YuwanField.cs +++ b/SVSim.BattleEngine/Engine/YuwanField.cs @@ -1,7 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class YuwanField : BackGroundBase { public override int FieldId => 18; @@ -10,74 +11,4 @@ public class YuwanField : BackGroundBase : base(bgmId) { } - - protected override void BattleFieldBuild() - { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_gate_01").gameObject; - _fieldParticles = _fieldModel.transform.Find("Particles08").gameObject; - _fieldParticleSystemDictionary.Add("plasma_gimic_1", _fieldParticles.transform.Find("plasma_gimic_1").GetComponent()); - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_8, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_8_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(-20f, 80f, 700f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-10f, 0f, 0f)); - yield return new WaitForSeconds(2f); - GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CAMERA_ZOOM_OUT); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _gimicCntDictionary[obj.tag]++; - _fieldParticleSystemDictionary["plasma_gimic_1"].Play(); - yield return new WaitForSeconds(1.5f); - _gimicCntDictionary[obj.tag] = 0; - } - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); - } } diff --git a/SVSim.BattleEngine/Engine/iTween.cs b/SVSim.BattleEngine/Engine/iTween.cs index 1b32816c..3fe5ce68 100644 --- a/SVSim.BattleEngine/Engine/iTween.cs +++ b/SVSim.BattleEngine/Engine/iTween.cs @@ -49,17 +49,12 @@ public class iTween : MonoBehaviour public enum LoopType { none, - loop, pingPong } public enum NamedValueColor { - _Color, - _SpecColor, - _Emission, - _ReflectColor - } + _Color } public static class Defaults { @@ -69,18 +64,12 @@ public class iTween : MonoBehaviour public static NamedValueColor namedColorValue = NamedValueColor._Color; - public static LoopType loopType = LoopType.none; - public static EaseType easeType = EaseType.easeOutExpo; - public static float lookSpeed = 3f; - public static bool isLocal = false; public static Space space = Space.Self; - public static bool orientToPath = false; - public static Color color = Color.white; public static float updateTimePercentage = 0.05f; @@ -139,20 +128,14 @@ public class iTween : MonoBehaviour public string _name; - private float runningTime; - private float percentage; private float delayStarted; - private bool kinematic; - private bool isLocal; private bool loop; - private bool reverse; - private bool wasPaused; private bool physics; @@ -237,31 +220,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void FadeFrom(GameObject target, float alpha, float time) - { - FadeFrom(target, Hash("alpha", alpha, "time", time)); - } - - public static void FadeFrom(GameObject target, Hashtable args) - { - ColorFrom(target, args); - } - - public static void FadeTo(GameObject target, float alpha, float time) - { - FadeTo(target, Hash("alpha", alpha, "time", time)); - } - - public static void FadeTo(GameObject target, Hashtable args) - { - ColorTo(target, args); - } - - public static void ColorFrom(GameObject target, Color color, float time) - { - ColorFrom(target, Hash("color", color, "time", time)); - } - public static void ColorFrom(GameObject target, Hashtable args) { Color color = default(Color); @@ -335,11 +293,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void ColorTo(GameObject target, Color color, float time) - { - ColorTo(target, Hash("color", color, "time", time)); - } - public static void ColorTo(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -361,149 +314,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void AudioFrom(GameObject target, float volume, float pitch, float time) - { - AudioFrom(target, Hash("volume", volume, "pitch", pitch, "time", time)); - } - - public static void AudioFrom(GameObject target, Hashtable args) - { - args = CleanArgs(args); - AudioSource audioSource; - if (args.Contains("audiosource")) - { - audioSource = (AudioSource)args["audiosource"]; - } - else - { - if (!target.GetComponent()) - { - Debug.LogError("iTween Error: AudioFrom requires an AudioSource."); - return; - } - audioSource = target.GetComponent(); - } - Vector2 vector = default(Vector2); - Vector2 vector2 = default(Vector2); - vector.x = (vector2.x = audioSource.volume); - vector.y = (vector2.y = audioSource.pitch); - if (args.Contains("volume")) - { - vector2.x = (float)args["volume"]; - } - if (args.Contains("pitch")) - { - vector2.y = (float)args["pitch"]; - } - audioSource.volume = vector2.x; - audioSource.pitch = vector2.y; - args["volume"] = vector.x; - args["pitch"] = vector.y; - if (!args.Contains("easetype")) - { - args.Add("easetype", EaseType.linear); - } - args["type"] = "audio"; - args["method"] = "to"; - Launch(target, args); - } - - public static void AudioTo(GameObject target, float volume, float pitch, float time) - { - AudioTo(target, Hash("volume", volume, "pitch", pitch, "time", time)); - } - - public static void AudioTo(GameObject target, Hashtable args) - { - args = CleanArgs(args); - if (!args.Contains("easetype")) - { - args.Add("easetype", EaseType.linear); - } - args["type"] = "audio"; - args["method"] = "to"; - Launch(target, args); - } - - public static void Stab(GameObject target, AudioClip audioclip, float delay) - { - Stab(target, Hash("audioclip", audioclip, "delay", delay)); - } - - public static void Stab(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "stab"; - Launch(target, args); - } - - public static void LookFrom(GameObject target, Vector3 looktarget, float time) - { - LookFrom(target, Hash("looktarget", looktarget, "time", time)); - } - - public static void LookFrom(GameObject target, Hashtable args) - { - args = CleanArgs(args); - Vector3 eulerAngles = target.transform.eulerAngles; - if (args["looktarget"].GetType() == typeof(Transform)) - { - target.transform.LookAt((Transform)args["looktarget"], ((Vector3?)args["up"]) ?? Defaults.up); - } - else if (args["looktarget"].GetType() == typeof(Vector3)) - { - target.transform.LookAt((Vector3)args["looktarget"], ((Vector3?)args["up"]) ?? Defaults.up); - } - if (args.Contains("axis")) - { - Vector3 eulerAngles2 = target.transform.eulerAngles; - switch ((string)args["axis"]) - { - case "x": - eulerAngles2.y = eulerAngles.y; - eulerAngles2.z = eulerAngles.z; - break; - case "y": - eulerAngles2.x = eulerAngles.x; - eulerAngles2.z = eulerAngles.z; - break; - case "z": - eulerAngles2.x = eulerAngles.x; - eulerAngles2.y = eulerAngles.y; - break; - } - target.transform.eulerAngles = eulerAngles2; - } - args["rotation"] = eulerAngles; - args["type"] = "rotate"; - args["method"] = "to"; - Launch(target, args); - } - - public static void LookTo(GameObject target, Vector3 looktarget, float time) - { - LookTo(target, Hash("looktarget", looktarget, "time", time)); - } - - public static void LookTo(GameObject target, Hashtable args) - { - args = CleanArgs(args); - if (args.Contains("looktarget") && args["looktarget"].GetType() == typeof(Transform)) - { - Transform transform = (Transform)args["looktarget"]; - args["position"] = new Vector3(transform.position.x, transform.position.y, transform.position.z); - args["rotation"] = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z); - } - args["type"] = "look"; - args["method"] = "to"; - Launch(target, args); - } - - public static void MoveTo(GameObject target, Vector3 position, float time) - { - MoveTo(target, Hash("position", position, "time", time)); - } - public static void MoveTo(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -519,11 +329,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void MoveFrom(GameObject target, Vector3 position, float time) - { - MoveFrom(target, Hash("position", position, "time", time)); - } - public static void MoveFrom(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -620,11 +425,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void MoveAdd(GameObject target, Vector3 amount, float time) - { - MoveAdd(target, Hash("amount", amount, "time", time)); - } - public static void MoveAdd(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -646,11 +446,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void ScaleTo(GameObject target, Vector3 scale, float time) - { - ScaleTo(target, Hash("scale", scale, "time", time)); - } - public static void ScaleTo(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -666,80 +461,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void ScaleFrom(GameObject target, Vector3 scale, float time) - { - ScaleFrom(target, Hash("scale", scale, "time", time)); - } - - public static void ScaleFrom(GameObject target, Hashtable args) - { - args = CleanArgs(args); - Vector3 localScale; - Vector3 vector = (localScale = target.transform.localScale); - if (args.Contains("scale")) - { - if (args["scale"].GetType() == typeof(Transform)) - { - localScale = ((Transform)args["scale"]).localScale; - } - else if (args["scale"].GetType() == typeof(Vector3)) - { - localScale = (Vector3)args["scale"]; - } - } - else - { - if (args.Contains("x")) - { - localScale.x = (float)args["x"]; - } - if (args.Contains("y")) - { - localScale.y = (float)args["y"]; - } - if (args.Contains("z")) - { - localScale.z = (float)args["z"]; - } - } - target.transform.localScale = localScale; - args["scale"] = vector; - args["type"] = "scale"; - args["method"] = "to"; - Launch(target, args); - } - - public static void ScaleAdd(GameObject target, Vector3 amount, float time) - { - ScaleAdd(target, Hash("amount", amount, "time", time)); - } - - public static void ScaleAdd(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "scale"; - args["method"] = "add"; - Launch(target, args); - } - - public static void ScaleBy(GameObject target, Vector3 amount, float time) - { - ScaleBy(target, Hash("amount", amount, "time", time)); - } - - public static void ScaleBy(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "scale"; - args["method"] = "by"; - Launch(target, args); - } - - public static void RotateTo(GameObject target, Vector3 rotation, float time) - { - RotateTo(target, Hash("rotation", rotation, "time", time)); - } - public static void RotateTo(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -755,88 +476,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void RotateFrom(GameObject target, Vector3 rotation, float time) - { - RotateFrom(target, Hash("rotation", rotation, "time", time)); - } - - public static void RotateFrom(GameObject target, Hashtable args) - { - args = CleanArgs(args); - bool flag = ((!args.Contains("islocal")) ? Defaults.isLocal : ((bool)args["islocal"])); - Vector3 vector2; - Vector3 vector = ((!flag) ? (vector2 = target.transform.eulerAngles) : (vector2 = target.transform.localEulerAngles)); - if (args.Contains("rotation")) - { - if (args["rotation"].GetType() == typeof(Transform)) - { - vector2 = ((Transform)args["rotation"]).eulerAngles; - } - else if (args["rotation"].GetType() == typeof(Vector3)) - { - vector2 = (Vector3)args["rotation"]; - } - } - else - { - if (args.Contains("x")) - { - vector2.x = (float)args["x"]; - } - if (args.Contains("y")) - { - vector2.y = (float)args["y"]; - } - if (args.Contains("z")) - { - vector2.z = (float)args["z"]; - } - } - if (flag) - { - target.transform.localEulerAngles = vector2; - } - else - { - target.transform.eulerAngles = vector2; - } - args["rotation"] = vector; - args["type"] = "rotate"; - args["method"] = "to"; - Launch(target, args); - } - - public static void RotateAdd(GameObject target, Vector3 amount, float time) - { - RotateAdd(target, Hash("amount", amount, "time", time)); - } - - public static void RotateAdd(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "rotate"; - args["method"] = "add"; - Launch(target, args); - } - - public static void RotateBy(GameObject target, Vector3 amount, float time) - { - RotateBy(target, Hash("amount", amount, "time", time)); - } - - public static void RotateBy(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "rotate"; - args["method"] = "by"; - Launch(target, args); - } - - public static void ShakePosition(GameObject target, Vector3 amount, float time) - { - ShakePosition(target, Hash("amount", amount, "time", time)); - } - public static void ShakePosition(GameObject target, Hashtable args) { args = CleanArgs(args); @@ -845,74 +484,6 @@ public class iTween : MonoBehaviour Launch(target, args); } - public static void ShakeScale(GameObject target, Vector3 amount, float time) - { - ShakeScale(target, Hash("amount", amount, "time", time)); - } - - public static void ShakeScale(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "shake"; - args["method"] = "scale"; - Launch(target, args); - } - - public static void ShakeRotation(GameObject target, Vector3 amount, float time) - { - ShakeRotation(target, Hash("amount", amount, "time", time)); - } - - public static void ShakeRotation(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "shake"; - args["method"] = "rotation"; - Launch(target, args); - } - - public static void PunchPosition(GameObject target, Vector3 amount, float time) - { - PunchPosition(target, Hash("amount", amount, "time", time)); - } - - public static void PunchPosition(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "punch"; - args["method"] = "position"; - args["easetype"] = EaseType.punch; - Launch(target, args); - } - - public static void PunchRotation(GameObject target, Vector3 amount, float time) - { - PunchRotation(target, Hash("amount", amount, "time", time)); - } - - public static void PunchRotation(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "punch"; - args["method"] = "rotation"; - args["easetype"] = EaseType.punch; - Launch(target, args); - } - - public static void PunchScale(GameObject target, Vector3 amount, float time) - { - PunchScale(target, Hash("amount", amount, "time", time)); - } - - public static void PunchScale(GameObject target, Hashtable args) - { - args = CleanArgs(args); - args["type"] = "punch"; - args["method"] = "scale"; - args["easetype"] = EaseType.punch; - Launch(target, args); - } - private void GenerateTargets() { string text = type; @@ -2319,107 +1890,6 @@ public class iTween : MonoBehaviour isRunning = true; } - private IEnumerator TweenRestart() - { - if (delay > 0f) - { - delayStarted = Time.time; - yield return new WaitForSeconds(delay); - } - loop = true; - TweenStart(); - } - - private void TweenUpdate() - { - apply(); - CallBack("onupdate"); - UpdatePercentage(); - } - - private void TweenComplete() - { - isRunning = false; - if (percentage > 0.5f) - { - percentage = 1f; - } - else - { - percentage = 0f; - } - apply(); - if (type == "value") - { - CallBack("onupdate"); - } - if (loopType == LoopType.none) - { - Dispose(); - } - else - { - TweenLoop(); - } - CallBack("oncomplete"); - } - - private void TweenLoop() - { - DisableKinematic(); - switch (loopType) - { - case LoopType.loop: - percentage = 0f; - runningTime = 0f; - apply(); - StartCoroutine("TweenRestart"); - break; - case LoopType.pingPong: - reverse = !reverse; - runningTime = 0f; - StartCoroutine("TweenRestart"); - break; - } - } - - public static Rect RectUpdate(Rect currentValue, Rect targetValue, float speed) - { - return new Rect(FloatUpdate(currentValue.x, targetValue.x, speed), FloatUpdate(currentValue.y, targetValue.y, speed), FloatUpdate(currentValue.width, targetValue.width, speed), FloatUpdate(currentValue.height, targetValue.height, speed)); - } - - public static Vector3 Vector3Update(Vector3 currentValue, Vector3 targetValue, float speed) - { - Vector3 vector = targetValue - currentValue; - currentValue += vector * speed * Time.deltaTime; - return currentValue; - } - - public static Vector2 Vector2Update(Vector2 currentValue, Vector2 targetValue, float speed) - { - Vector2 vector = targetValue - currentValue; - currentValue += vector * speed * Time.deltaTime; - return currentValue; - } - - public static float FloatUpdate(float currentValue, float targetValue, float speed) - { - float num = targetValue - currentValue; - currentValue += num * speed * Time.deltaTime; - return currentValue; - } - - public static void FadeUpdate(GameObject target, Hashtable args) - { - args["a"] = args["alpha"]; - ColorUpdate(target, args); - } - - public static void FadeUpdate(GameObject target, float alpha, float time) - { - FadeUpdate(target, Hash("alpha", alpha, "time", time)); - } - public static void ColorUpdate(GameObject target, Hashtable args) { CleanArgs(args); @@ -2486,59 +1956,6 @@ public class iTween : MonoBehaviour } } - public static void ColorUpdate(GameObject target, Color color, float time) - { - ColorUpdate(target, Hash("color", color, "time", time)); - } - - public static void AudioUpdate(GameObject target, Hashtable args) - { - CleanArgs(args); - Vector2[] array = new Vector2[4]; - float num; - if (args.Contains("time")) - { - num = (float)args["time"]; - num *= Defaults.updateTimePercentage; - } - else - { - num = Defaults.updateTime; - } - AudioSource audioSource; - if (args.Contains("audiosource")) - { - audioSource = (AudioSource)args["audiosource"]; - } - else - { - if (!target.GetComponent()) - { - Debug.LogError("iTween Error: AudioUpdate requires an AudioSource."); - return; - } - audioSource = target.GetComponent(); - } - array[0] = (array[1] = new Vector2(audioSource.volume, audioSource.pitch)); - if (args.Contains("volume")) - { - array[1].x = (float)args["volume"]; - } - if (args.Contains("pitch")) - { - array[1].y = (float)args["pitch"]; - } - array[3].x = Mathf.SmoothDampAngle(array[0].x, array[1].x, ref array[2].x, num); - array[3].y = Mathf.SmoothDampAngle(array[0].y, array[1].y, ref array[2].y, num); - audioSource.volume = array[3].x; - audioSource.pitch = array[3].y; - } - - public static void AudioUpdate(GameObject target, float volume, float pitch, float time) - { - AudioUpdate(target, Hash("volume", volume, "pitch", pitch, "time", time)); - } - public static void RotateUpdate(GameObject target, Hashtable args) { CleanArgs(args); @@ -2599,59 +2016,6 @@ public class iTween : MonoBehaviour RotateUpdate(target, Hash("rotation", rotation, "time", time)); } - public static void ScaleUpdate(GameObject target, Hashtable args) - { - CleanArgs(args); - Vector3[] array = new Vector3[4]; - float num; - if (args.Contains("time")) - { - num = (float)args["time"]; - num *= Defaults.updateTimePercentage; - } - else - { - num = Defaults.updateTime; - } - array[0] = (array[1] = target.transform.localScale); - if (args.Contains("scale")) - { - if (args["scale"].GetType() == typeof(Transform)) - { - Transform transform = (Transform)args["scale"]; - array[1] = transform.localScale; - } - else if (args["scale"].GetType() == typeof(Vector3)) - { - array[1] = (Vector3)args["scale"]; - } - } - else - { - if (args.Contains("x")) - { - array[1].x = (float)args["x"]; - } - if (args.Contains("y")) - { - array[1].y = (float)args["y"]; - } - if (args.Contains("z")) - { - array[1].z = (float)args["z"]; - } - } - array[3].x = Mathf.SmoothDamp(array[0].x, array[1].x, ref array[2].x, num); - array[3].y = Mathf.SmoothDamp(array[0].y, array[1].y, ref array[2].y, num); - array[3].z = Mathf.SmoothDamp(array[0].z, array[1].z, ref array[2].z, num); - target.transform.localScale = array[3]; - } - - public static void ScaleUpdate(GameObject target, Vector3 scale, float time) - { - ScaleUpdate(target, Hash("scale", scale, "time", time)); - } - public static void MoveUpdate(GameObject target, Hashtable args) { CleanArgs(args); @@ -2730,11 +2094,6 @@ public class iTween : MonoBehaviour } } - public static void MoveUpdate(GameObject target, Vector3 position, float time) - { - MoveUpdate(target, Hash("position", position, "time", time)); - } - public static void LookUpdate(GameObject target, Hashtable args) { CleanArgs(args); @@ -2798,32 +2157,6 @@ public class iTween : MonoBehaviour } } - public static void LookUpdate(GameObject target, Vector3 looktarget, float time) - { - LookUpdate(target, Hash("looktarget", looktarget, "time", time)); - } - - public static float PathLength(Transform[] path) - { - Vector3[] array = new Vector3[path.Length]; - float num = 0f; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - Vector3[] pts = PathControlPointGenerator(array); - Vector3 a = Interp(pts, 0f); - int num2 = path.Length * 20; - for (int j = 1; j <= num2; j++) - { - float t = (float)j / (float)num2; - Vector3 vector = Interp(pts, t); - num += Vector3.Distance(a, vector); - a = vector; - } - return num; - } - public static float PathLength(Vector3[] path) { float num = 0f; @@ -2840,303 +2173,6 @@ public class iTween : MonoBehaviour return num; } - public static void PutOnPath(GameObject target, Vector3[] path, float percent) - { - target.transform.position = Interp(PathControlPointGenerator(path), percent); - } - - public static void PutOnPath(Transform target, Vector3[] path, float percent) - { - target.position = Interp(PathControlPointGenerator(path), percent); - } - - public static void PutOnPath(GameObject target, Transform[] path, float percent) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - target.transform.position = Interp(PathControlPointGenerator(array), percent); - } - - public static void PutOnPath(Transform target, Transform[] path, float percent) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - target.position = Interp(PathControlPointGenerator(array), percent); - } - - public static Vector3 PointOnPath(Transform[] path, float percent) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - return Interp(PathControlPointGenerator(array), percent); - } - - public static void DrawLine(Vector3[] line) - { - if (line.Length != 0) - { - DrawLineHelper(line, Defaults.color, "gizmos"); - } - } - - public static void DrawLine(Vector3[] line, Color color) - { - if (line.Length != 0) - { - DrawLineHelper(line, color, "gizmos"); - } - } - - public static void DrawLine(Transform[] line) - { - if (line.Length != 0) - { - Vector3[] array = new Vector3[line.Length]; - for (int i = 0; i < line.Length; i++) - { - array[i] = line[i].position; - } - DrawLineHelper(array, Defaults.color, "gizmos"); - } - } - - public static void DrawLine(Transform[] line, Color color) - { - if (line.Length != 0) - { - Vector3[] array = new Vector3[line.Length]; - for (int i = 0; i < line.Length; i++) - { - array[i] = line[i].position; - } - DrawLineHelper(array, color, "gizmos"); - } - } - - public static void DrawLineGizmos(Vector3[] line) - { - if (line.Length != 0) - { - DrawLineHelper(line, Defaults.color, "gizmos"); - } - } - - public static void DrawLineGizmos(Vector3[] line, Color color) - { - if (line.Length != 0) - { - DrawLineHelper(line, color, "gizmos"); - } - } - - public static void DrawLineGizmos(Transform[] line) - { - if (line.Length != 0) - { - Vector3[] array = new Vector3[line.Length]; - for (int i = 0; i < line.Length; i++) - { - array[i] = line[i].position; - } - DrawLineHelper(array, Defaults.color, "gizmos"); - } - } - - public static void DrawLineGizmos(Transform[] line, Color color) - { - if (line.Length != 0) - { - Vector3[] array = new Vector3[line.Length]; - for (int i = 0; i < line.Length; i++) - { - array[i] = line[i].position; - } - DrawLineHelper(array, color, "gizmos"); - } - } - - public static void DrawLineHandles(Vector3[] line) - { - if (line.Length != 0) - { - DrawLineHelper(line, Defaults.color, "handles"); - } - } - - public static void DrawLineHandles(Vector3[] line, Color color) - { - if (line.Length != 0) - { - DrawLineHelper(line, color, "handles"); - } - } - - public static void DrawLineHandles(Transform[] line) - { - if (line.Length != 0) - { - Vector3[] array = new Vector3[line.Length]; - for (int i = 0; i < line.Length; i++) - { - array[i] = line[i].position; - } - DrawLineHelper(array, Defaults.color, "handles"); - } - } - - public static void DrawLineHandles(Transform[] line, Color color) - { - if (line.Length != 0) - { - Vector3[] array = new Vector3[line.Length]; - for (int i = 0; i < line.Length; i++) - { - array[i] = line[i].position; - } - DrawLineHelper(array, color, "handles"); - } - } - - public static Vector3 PointOnPath(Vector3[] path, float percent) - { - return Interp(PathControlPointGenerator(path), percent); - } - - public static void DrawPath(Vector3[] path) - { - if (path.Length != 0) - { - DrawPathHelper(path, Defaults.color, "gizmos"); - } - } - - public static void DrawPath(Vector3[] path, Color color) - { - if (path.Length != 0) - { - DrawPathHelper(path, color, "gizmos"); - } - } - - public static void DrawPath(Transform[] path) - { - if (path.Length != 0) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - DrawPathHelper(array, Defaults.color, "gizmos"); - } - } - - public static void DrawPath(Transform[] path, Color color) - { - if (path.Length != 0) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - DrawPathHelper(array, color, "gizmos"); - } - } - - public static void DrawPathGizmos(Vector3[] path) - { - if (path.Length != 0) - { - DrawPathHelper(path, Defaults.color, "gizmos"); - } - } - - public static void DrawPathGizmos(Vector3[] path, Color color) - { - if (path.Length != 0) - { - DrawPathHelper(path, color, "gizmos"); - } - } - - public static void DrawPathGizmos(Transform[] path) - { - if (path.Length != 0) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - DrawPathHelper(array, Defaults.color, "gizmos"); - } - } - - public static void DrawPathGizmos(Transform[] path, Color color) - { - if (path.Length != 0) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - DrawPathHelper(array, color, "gizmos"); - } - } - - public static void DrawPathHandles(Vector3[] path) - { - if (path.Length != 0) - { - DrawPathHelper(path, Defaults.color, "handles"); - } - } - - public static void DrawPathHandles(Vector3[] path, Color color) - { - if (path.Length != 0) - { - DrawPathHelper(path, color, "handles"); - } - } - - public static void DrawPathHandles(Transform[] path) - { - if (path.Length != 0) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - DrawPathHelper(array, Defaults.color, "handles"); - } - } - - public static void DrawPathHandles(Transform[] path, Color color) - { - if (path.Length != 0) - { - Vector3[] array = new Vector3[path.Length]; - for (int i = 0; i < path.Length; i++) - { - array[i] = path[i].position; - } - DrawPathHelper(array, color, "handles"); - } - } - public static void Resume(GameObject target) { Component[] components = target.GetComponents(); @@ -3160,20 +2196,6 @@ public class iTween : MonoBehaviour } } - public static void Resume(GameObject target, string type) - { - Component[] components = target.GetComponents(); - components = components; - for (int i = 0; i < components.Length; i++) - { - iTween iTween2 = (iTween)components[i]; - if ((iTween2.type + iTween2.method).Substring(0, type.Length).ToLower() == type.ToLower()) - { - iTween2.enabled = true; - } - } - } - public static void Resume(GameObject target, string type, bool includechildren) { Component[] components = target.GetComponents(); @@ -3196,28 +2218,6 @@ public class iTween : MonoBehaviour } } - public static void Resume() - { - for (int i = 0; i < tweens.Count; i++) - { - Resume((GameObject)tweens[i]["target"]); - } - } - - public static void Resume(string type) - { - ArrayList arrayList = new ArrayList(); - for (int i = 0; i < tweens.Count; i++) - { - GameObject value = (GameObject)tweens[i]["target"]; - arrayList.Insert(arrayList.Count, value); - } - for (int j = 0; j < arrayList.Count; j++) - { - Resume((GameObject)arrayList[j], type); - } - } - public static void Pause(GameObject target) { Component[] components = target.GetComponents(); @@ -3248,26 +2248,6 @@ public class iTween : MonoBehaviour } } - public static void Pause(GameObject target, string type) - { - Component[] components = target.GetComponents(); - components = components; - for (int i = 0; i < components.Length; i++) - { - iTween iTween2 = (iTween)components[i]; - if ((iTween2.type + iTween2.method).Substring(0, type.Length).ToLower() == type.ToLower()) - { - if (iTween2.delay > 0f) - { - iTween2.delay -= Time.time - iTween2.delayStarted; - iTween2.StopCoroutine("TweenDelay"); - } - iTween2.isPaused = true; - iTween2.enabled = false; - } - } - } - public static void Pause(GameObject target, string type, bool includechildren) { Component[] components = target.GetComponents(); @@ -3296,106 +2276,6 @@ public class iTween : MonoBehaviour } } - public static void Pause() - { - for (int i = 0; i < tweens.Count; i++) - { - Pause((GameObject)tweens[i]["target"]); - } - } - - public static void Pause(string type) - { - ArrayList arrayList = new ArrayList(); - for (int i = 0; i < tweens.Count; i++) - { - GameObject value = (GameObject)tweens[i]["target"]; - arrayList.Insert(arrayList.Count, value); - } - for (int j = 0; j < arrayList.Count; j++) - { - Pause((GameObject)arrayList[j], type); - } - } - - public static int Count() - { - return tweens.Count; - } - - public static int Count(string type) - { - int num = 0; - for (int i = 0; i < tweens.Count; i++) - { - Hashtable hashtable = tweens[i]; - if (((string)hashtable["type"] + (string)hashtable["method"]).Substring(0, type.Length).ToLower() == type.ToLower()) - { - num++; - } - } - return num; - } - - public static int Count(GameObject target) - { - Component[] components = target.GetComponents(); - return components.Length; - } - - public static int Count(GameObject target, string type) - { - int num = 0; - Component[] components = target.GetComponents(); - components = components; - for (int i = 0; i < components.Length; i++) - { - iTween iTween2 = (iTween)components[i]; - if ((iTween2.type + iTween2.method).Substring(0, type.Length).ToLower() == type.ToLower()) - { - num++; - } - } - return num; - } - - public static void Stop() - { - for (int i = 0; i < tweens.Count; i++) - { - Stop((GameObject)tweens[i]["target"]); - } - tweens.Clear(); - } - - public static void Stop(string type) - { - ArrayList arrayList = new ArrayList(); - for (int i = 0; i < tweens.Count; i++) - { - GameObject value = (GameObject)tweens[i]["target"]; - arrayList.Insert(arrayList.Count, value); - } - for (int j = 0; j < arrayList.Count; j++) - { - Stop((GameObject)arrayList[j], type); - } - } - - public static void StopByName(string name) - { - ArrayList arrayList = new ArrayList(); - for (int i = 0; i < tweens.Count; i++) - { - GameObject value = (GameObject)tweens[i]["target"]; - arrayList.Insert(arrayList.Count, value); - } - for (int j = 0; j < arrayList.Count; j++) - { - StopByName((GameObject)arrayList[j], name); - } - } - public static void Stop(GameObject target) { Component[] components = target.GetComponents(); @@ -3419,34 +2299,6 @@ public class iTween : MonoBehaviour } } - public static void Stop(GameObject target, string type) - { - Component[] components = target.GetComponents(); - components = components; - for (int i = 0; i < components.Length; i++) - { - iTween iTween2 = (iTween)components[i]; - if ((iTween2.type + iTween2.method).Substring(0, type.Length).ToLower() == type.ToLower()) - { - iTween2.Dispose(); - } - } - } - - public static void StopByName(GameObject target, string name) - { - Component[] components = target.GetComponents(); - components = components; - for (int i = 0; i < components.Length; i++) - { - iTween iTween2 = (iTween)components[i]; - if (iTween2._name == name) - { - iTween2.Dispose(); - } - } - } - public static void Stop(GameObject target, string type, bool includechildren) { Component[] components = target.GetComponents(); @@ -3518,137 +2370,6 @@ public class iTween : MonoBehaviour lastRealTime = Time.realtimeSinceStartup; } - private IEnumerator Start() - { - if (delay > 0f) - { - yield return StartCoroutine("TweenDelay"); - } - TweenStart(); - } - - private void Update() - { - if (!isRunning || physics) - { - return; - } - if (!reverse) - { - if (percentage < 1f) - { - TweenUpdate(); - } - else - { - TweenComplete(); - } - } - else if (percentage > 0f) - { - TweenUpdate(); - } - else - { - TweenComplete(); - } - } - - private void FixedUpdate() - { - if (!isRunning || !physics) - { - return; - } - if (!reverse) - { - if (percentage < 1f) - { - TweenUpdate(); - } - else - { - TweenComplete(); - } - } - else if (percentage > 0f) - { - TweenUpdate(); - } - else - { - TweenComplete(); - } - } - - private void LateUpdate() - { - if (tweenArguments.Contains("looktarget") && isRunning && (type == "move" || type == "shake" || type == "punch")) - { - LookUpdate(base.gameObject, tweenArguments); - } - } - - private void OnEnable() - { - if (isRunning) - { - EnableKinematic(); - } - if (isPaused) - { - isPaused = false; - if (delay > 0f) - { - wasPaused = true; - ResumeDelay(); - } - } - } - - private void OnDisable() - { - DisableKinematic(); - } - - private static void DrawLineHelper(Vector3[] line, Color color, string method) - { - Gizmos.color = color; - for (int i = 0; i < line.Length - 1; i++) - { - if (method == "gizmos") - { - Gizmos.DrawLine(line[i], line[i + 1]); - } - else if (method == "handles") - { - Debug.LogError("iTween Error: Drawing a line with Handles is temporarily disabled because of compatability issues with Unity 2.6!"); - } - } - } - - private static void DrawPathHelper(Vector3[] path, Color color, string method) - { - Vector3[] pts = PathControlPointGenerator(path); - Vector3 to = Interp(pts, 0f); - Gizmos.color = color; - int num = path.Length * 20; - for (int i = 1; i <= num; i++) - { - float t = (float)i / (float)num; - Vector3 vector = Interp(pts, t); - if (method == "gizmos") - { - Gizmos.DrawLine(vector, to); - } - else if (method == "handles") - { - Debug.LogError("iTween Error: Drawing a path with Handles is temporarily disabled because of compatability issues with Unity 2.6!"); - } - to = vector; - } - } - private static Vector3[] PathControlPointGenerator(Vector3[] path) { int num = 2; @@ -3972,27 +2693,6 @@ public class iTween : MonoBehaviour } } - private void UpdatePercentage() - { - if (useRealTime) - { - runningTime += Time.realtimeSinceStartup - lastRealTime; - } - else - { - runningTime += Time.deltaTime; - } - if (reverse) - { - percentage = 1f - runningTime / time; - } - else - { - percentage = runningTime / time; - } - lastRealTime = Time.realtimeSinceStartup; - } - private void CallBack(string callbackType) { if (tweenArguments.Contains(callbackType) && !tweenArguments.Contains("ischild")) @@ -4066,15 +2766,6 @@ public class iTween : MonoBehaviour { } - private void DisableKinematic() - { - } - - private void ResumeDelay() - { - StartCoroutine("TweenDelay"); - } - private float linear(float start, float end, float value) { return Mathf.Lerp(start, end, value); diff --git a/SVSim.BattleEngine/Engine/llField.cs b/SVSim.BattleEngine/Engine/llField.cs index 9a08c3dd..f00d15c4 100644 --- a/SVSim.BattleEngine/Engine/llField.cs +++ b/SVSim.BattleEngine/Engine/llField.cs @@ -1,82 +1,14 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// Post-Phase-5b (2026-07-03) UI stub. Every override in the pre-cull file was +// Unity-3D VFX/iTween/particle-system code driven by BattleCoroutine — never +// invoked headless. The type stays because BattleManagerBase.CreateManager's +// background-id switch instantiates it; inheriting BackGroundBase's no-op +// default virtuals is correct headless behavior. public class llField : BackGroundBase { public override int FieldId => 1002; - protected override void BattleFieldBuild() + public llField(string bgmId = "NONE") + : base(bgmId) { - BattleCoroutine.GetInstance().StartCoroutine(BackGroundBase.ObjectChecker(0.5f, _str3DFieldPath, delegate - { - base.Field = GameObject.Find(_str3DFieldPath); - base.Field.transform.parent = GameMgr.GetIns().m_GameManagerObj.transform; - GimicAudioList = base.Field.GetComponent().GimicAudioList; - _fieldModel = base.Field.transform.Find("md_bf_1002_root").gameObject; - _fieldObjDictionary.Add("horn", _fieldModel.transform.Find("md_bf_1002_01_horn").gameObject); - m_FieldAnimatorDictionary.Add("horn", _fieldObjDictionary["horn"].GetComponent()); - _fieldParticles = _fieldModel.transform.Find("Particles" + FieldId).gameObject; - _fieldParticleSystemDictionary.Add("opening", _fieldParticles.transform.Find("opening").GetComponent()); - _fieldParticleSystemDictionary.Add("shake", _fieldParticles.transform.Find("shake").GetComponent()); - _fieldParticleSystemDictionary.Add("gimic_1", _fieldParticles.transform.Find("gimic_1").GetComponent()); - List list = new List(_fieldObjDictionary.Keys); - List list2 = new List(); - for (int i = 0; i < _fieldObjDictionary.Count; i++) - { - list2.Add(_fieldObjDictionary[list[i]]); - } - GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list2, delegate - { - base.SetShaderGlobalColorBG = base.Field.transform.Find("SetMaterialColorBGManager").GetComponent(); - base.IsLoadDone = true; - }, isBattle: true, isField: true); - })); - } - - public override void StartFieldSetEffect(Vector3 pos) - { - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_SET_1002, pos); - } - - public override void StartFieldTapEffect(int areaId, Vector3 pos) - { - base.StartFieldTapEffect(areaId, pos); - GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_FIELD_TAP_1002_1, pos); - } - - protected override IEnumerator RunFieldOpening() - { - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_appear_1", "se_field_" + _str3DFieldNo, 0f, 0L); - _fieldParticleSystemDictionary["opening"].Play(); - _battleCamera.Camera.transform.localPosition = new Vector3(2100f, -1500f, -1800f); - _battleCamera.Camera.transform.localRotation = Quaternion.Euler(new Vector3(-20f, -30f, 54f)); - Vector3[] bezierQuad = MotionUtils.GetBezierQuad(new Vector3(2100f, -1500f, -1800f), new Vector3(1300f, -1000f, 90f), new Vector3(90f, 120f, -160f), 10); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("path", bezierQuad, "movetopath", false, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", new Vector3(-46f, -109f, 105f), "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad)); - yield return new WaitForSeconds(2f); - iTween.MoveTo(_battleCamera.Camera.gameObject, iTween.Hash("position", _battleCamera.BattleCameraPos, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - iTween.RotateTo(_battleCamera.Camera.gameObject, iTween.Hash("rotation", _battleCamera.BattleCameraRot, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo)); - yield return new WaitForSeconds(0f); - } - - protected override IEnumerator RunFieldGimic(GameObject obj) - { - string tag = obj.tag; - if (tag != null && tag == "FieldGimic1" && _gimicCntDictionary[obj.tag] == 0) - { - _gimicCntDictionary[obj.tag]++; - m_FieldAnimatorDictionary["horn"].SetTrigger("Rotate"); - _fieldParticleSystemDictionary["gimic_1"].Play(); - GameMgr.GetIns().GetSoundMgr().PlaySeByStr($"se_field_{_str3DFieldNo}_gim_1", "se_field_" + _str3DFieldNo, 0f, 0L); - yield return new WaitForSeconds(3f); - _gimicCntDictionary[obj.tag] = 0; - } - } - - protected override IEnumerator RunFieldShake() - { - _fieldParticleSystemDictionary["shake"].Play(); - yield return new WaitForSeconds(0f); } } diff --git a/SVSim.BattleEngine/Rng/HeadlessBattleMgr.cs b/SVSim.BattleEngine/Rng/HeadlessBattleMgr.cs index fed9e539..ef2d869c 100644 --- a/SVSim.BattleEngine/Rng/HeadlessBattleMgr.cs +++ b/SVSim.BattleEngine/Rng/HeadlessBattleMgr.cs @@ -23,6 +23,14 @@ namespace SVSim.BattleEngine.Rng _rng = rng ?? new SeededRandomSource(contentsCreator.RandomSeed); } + // Phase-5 chunk 45: overload for the pre-seeded GameMgr path — fixtures build a GameMgr, + // seed it (SeedCharaIds + SeedNetUser), then hand it to this ctor. Retires the ambient bridge. + public HeadlessBattleMgr(IBattleMgrContentsCreator contentsCreator, IRandomSource rng, GameMgr gameMgr) + : base(contentsCreator, gameMgr) + { + _rng = rng ?? new SeededRandomSource(contentsCreator.RandomSeed); + } + // KNOWN DIVERGENCE: the base StableRandom/StableRandomDouble also bump a private // `stableRandomCount` diagnostic field; these overrides cannot (it's private to the base) and do // not. The field is currently unread anywhere in the engine, so this is harmless; if a future diff --git a/SVSim.BattleEngine/Rng/HeadlessNetworkBattleMgr.cs b/SVSim.BattleEngine/Rng/HeadlessNetworkBattleMgr.cs index c8e89a2b..129d915f 100644 --- a/SVSim.BattleEngine/Rng/HeadlessNetworkBattleMgr.cs +++ b/SVSim.BattleEngine/Rng/HeadlessNetworkBattleMgr.cs @@ -1,3 +1,7 @@ +// TODO(engine-cleanup-pass2): 1 of 3 methods unrun in baseline +// Type: SVSim.BattleEngine.Rng.HeadlessNetworkBattleMgr +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace SVSim.BattleEngine.Rng { // The headless authoritative NETWORK battle mgr — the emitting twin of HeadlessBattleMgr. Emission @@ -19,6 +23,13 @@ namespace SVSim.BattleEngine.Rng _rng = rng ?? new SeededRandomSource(contentsCreator.RandomSeed); } + // Phase-5 chunk 45: overload for the pre-seeded GameMgr path. + public HeadlessNetworkBattleMgr(Wizard.BattleMgr.IBattleMgrContentsCreator contentsCreator, IRandomSource rng, GameMgr gameMgr) + : base(contentsCreator, gameMgr) + { + _rng = rng ?? new SeededRandomSource(contentsCreator.RandomSeed); + } + public override int StableRandom(int val) { double unit = _rng.NextUnit(); diff --git a/SVSim.BattleEngine/Shim/BattleAmbientContext.cs b/SVSim.BattleEngine/Shim/BattleAmbientContext.cs deleted file mode 100644 index 42344dfe..00000000 --- a/SVSim.BattleEngine/Shim/BattleAmbientContext.cs +++ /dev/null @@ -1,48 +0,0 @@ -// AUTHORED SHIM (not copied). Per-battle ambient context that backs the -// AsyncLocal singleton seam for multi-instancing (see docs/superpowers/specs/ -// 2026-06-07-engine-multi-instancing-design.md). The engine's per-battle -// statics (BattleManagerBase.main/IsForecast/IsRandomDraw, GameMgr.GetIns, -// Certification.viewer_id, ToolboxGame.RealTimeNetworkAgent, -// Data.BattleRecoveryInfo) resolve through Current when set; process-shared -// reference data (CardMaster.Default, Data.Master, etc.) stays static. -#nullable enable -using System; -using System.Threading; - -namespace SVSim.BattleEngine.Ambient; - -public sealed class BattleAmbientContext -{ - public BattleManagerBase? Mgr { get; set; } - public GameMgr GameMgr { get; init; } = new(); - public RealTimeNetworkAgent? NetworkAgent { get; set; } - public int ViewerId { get; init; } = 1001; - public bool IsForecast { get; set; } = true; - public bool IsRandomDraw { get; set; } = true; - public Wizard.BattleRecoveryInfo? RecoveryInfo { get; set; } -} - -public static class BattleAmbient -{ - internal static readonly AsyncLocal _current = new(); - - public static BattleAmbientContext? Current => _current.Value; - - public static BattleAmbientContext Require() => - _current.Value ?? throw new InvalidOperationException( - "No ambient battle context. Wrap engine entry points in BattleAmbient.Enter(ctx)."); - - public static Scope Enter(BattleAmbientContext ctx) - { - var prior = _current.Value; - _current.Value = ctx; - return new Scope(prior); - } - - public readonly struct Scope : IDisposable - { - private readonly BattleAmbientContext? _prior; - internal Scope(BattleAmbientContext? prior) { _prior = prior; } - public void Dispose() => _current.Value = _prior; - } -} diff --git a/SVSim.BattleEngine/Shim/External/CriShim.cs b/SVSim.BattleEngine/Shim/External/CriShim.cs deleted file mode 100644 index 0ceace80..00000000 --- a/SVSim.BattleEngine/Shim/External/CriShim.cs +++ /dev/null @@ -1,108 +0,0 @@ -// AUTHORED SHIM (not copied). CRI ADX2 (Atom) audio + CRI Mana (movie) middleware. -// A precompiled SDK with no decompiled source, referenced by the copied audio/movie -// engine files (Cute/AudioManager.cs, Voice.cs, Se.cs, Effect.cs, MoviePlayer.cs). -// Pure cosmetic surface — never on the battle-resolution path; every member is a no-op -// returning a safe default. Signatures mirror the real CRI API as exercised by the -// decomp (arg counts/types taken from the call sites) so the copied code compiles. -using System; - -namespace CriWare -{ - // ---- CRI Atom (audio) ---- - public class CriAtomExPlayer - { - public void SetFadeOutTime(int ms) { } - public void SetFadeInTime(int ms) { } - public void SetFadeInStartOffset(int ms) { } - public void SetStartTime(long ms) { } - public void ResetFaderParameters() { } - public void Update(CriAtomExPlayback playback) { } - public void AttachFader() { } - } - - public static class CriAtomExCategory - { - public static void Mute(string categoryName, bool mute) { } - public static void Pause(string categoryName, bool sw) { } - public static void SetVolume(string categoryName, float volume) { } - } - - public struct CriAtomExPlayback - { - public bool GetNumPlayedSamples(out long numSamples, out int samplingRate) - { numSamples = 0L; samplingRate = 0; return false; } - } - - public class CriAtomExAcb : IDisposable - { - public void Dispose() { } - public bool GetCueInfo(int index, out CriAtomEx.CueInfo cueInfo) - { cueInfo = default; return false; } - } - - public static class CriAtomEx - { - public struct CueInfo { public long length; } - } - - public class CriAtomCueSheet { public CriAtomExAcb acb => null; } - - public class CriAtomSource : UnityEngine.MonoBehaviour - { - public enum Status { Stop, Prep, Playing, PlayEnd, Removed, Removing, Error } - public Status status => Status.Stop; - public CriAtomExPlayer player { get; } = new CriAtomExPlayer(); - public bool loop; - public bool playOnStart; - public float volume; - public bool use3dPositioning; - public string cueSheet; - public string cueName; - public CriAtomExPlayback Play() => default; - public CriAtomExPlayback Play(int cueId) => default; - public CriAtomExPlayback Play(string cue) => default; - public CriAtomExPlayback Play(string sheet, string cue) => default; - public void Stop() { } - public void Pause(bool sw) { } - public void Pause() { } - public void SetAisacControl(string name, float value) { } - public void SetAisacControl(uint id, float value) { } - } - - public static class CriAtom - { - public static CriAtomCueSheet AddCueSheet(string name, string acbPath, string awbPath) => null; - public static CriAtomCueSheet GetCueSheet(string name) => null; - public static void RemoveCueSheet(string name) { } - public static CriAtomExAcb GetAcb(string acbName) => null; - public static void AttachDspBusSetting(string name) { } - } - - // ---- CRI Mana (movie) ---- (CriManaMovieMaterial lives in External/SdkStubs.cs) - public class CriFsBinder { } -} - -namespace CriWare.CriMana -{ - public struct MovieInfo - { - public uint framerateN; - public uint totalFrames; - } - - public class Player - { - public enum Status { Stop, Decheader, WaitPrep, Prep, Ready, Playing, PlayEnd, Error, StopProcessing } - public Status status => Status.Stop; - public MovieInfo movieInfo => default; - public long GetTime() => 0L; - public bool IsPaused() => false; - public void Pause(bool sw) { } - public void Prepare() { } - public void Start() { } - public void Stop() { } - public void SetFile(CriFsBinder binder, string moviePath) { } - public void SetSeekPosition(int frameNumber) { } - public void SetVolume(float volume) { } - } -} diff --git a/SVSim.BattleEngine/Shim/External/LooseEnds.cs b/SVSim.BattleEngine/Shim/External/LooseEnds.cs index 845c2108..37abfbd4 100644 --- a/SVSim.BattleEngine/Shim/External/LooseEnds.cs +++ b/SVSim.BattleEngine/Shim/External/LooseEnds.cs @@ -4,19 +4,19 @@ // (2) a few concrete tangential types referenced directly. (3) minimal third-party // serialization/SDK surface. None is on the battle-resolution path. -namespace Wizard.AutoTest { internal class _ShimAnchor { } } -namespace Wizard.Title { internal class _ShimAnchor { } } -namespace Wizard.ErrorDialog { internal class _ShimAnchor { } } -namespace Wizard.Bingo { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Data.TaskData.SkinPurchase { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Data.TaskData.SpotCardExchange { internal class _ShimAnchor { } } +namespace Wizard.AutoTest { } +namespace Wizard.Title { } +namespace Wizard.ErrorDialog { } +namespace Wizard.Bingo { } +namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase { } +namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase { } +namespace Wizard.Scripts.Network.Data.TaskData.SkinPurchase { } +namespace Wizard.Scripts.Network.Data.TaskData.SpotCardExchange { } // These are NAMESPACES (used as `using` targets in copied files), not types. -namespace Wizard.DeckSelect.FirstDisplayPageIndexGetter { internal class _ShimAnchor { } } -namespace Wizary.StorySelectionWorld { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Data.TableData.Arena.TwoPick { internal class _ShimAnchor { } } +namespace Wizard.DeckSelect.FirstDisplayPageIndexGetter { } +namespace Wizary.StorySelectionWorld { } +namespace Wizard.Scripts.Network.Data.TableData.Arena.TwoPick { } // IManager: a Cute manager interface implemented by NetworkManager/ResourcesManager. namespace Cute { public interface IManager { } } @@ -26,8 +26,6 @@ namespace MessagePack { public static class MessagePackSerializer { - public static byte[] Serialize(T obj) => new byte[0]; - public static T Deserialize(byte[] bytes) => default; public static string ToJson(byte[] bytes) => ""; public static byte[] FromJson(string json) => new byte[0]; } @@ -38,138 +36,22 @@ namespace MiniJSON public static class Json { public static object Deserialize(string json) => null; - public static string Serialize(object obj) => ""; } } -namespace Steamworks -{ - // Steam callback wrapper. Engine constructs via Callback.Create(handler). - public sealed class Callback - { - public delegate void DispatchDelegate(T param); - public static Callback Create(DispatchDelegate func) => new Callback(); - } - public enum EResult { k_EResultOK = 1 } - public struct AppId_t - { - public uint m_AppId; - public AppId_t(uint v) { m_AppId = v; } - public static explicit operator AppId_t(uint v) => new AppId_t(v); - public override string ToString() => m_AppId.ToString(); - } - public struct CSteamID { public ulong m_SteamID; } - public struct HAuthTicket { } - public struct SteamNetworkingIdentity { } - // Microtransaction auth response struct (callback payload). - public struct MicroTxnAuthorizationResponse_t - { - public AppId_t m_unAppID; - public ulong m_ulOrderID; - public byte m_bAuthorized; - } - public struct GetAuthSessionTicketResponse_t - { - public HAuthTicket m_hAuthTicket; - public EResult m_eResult; - } - // Steam warning-message hook delegate. - public delegate void SteamAPIWarningMessageHook_t(int severity, System.Text.StringBuilder debugText); - - public static class SteamAPI - { - public static bool Init() => false; - public static bool RestartAppIfNecessary(AppId_t appId) => false; - public static void RunCallbacks() { } - public static void Shutdown() { } - } - public static class SteamUser - { - public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket, ref SteamNetworkingIdentity identity) { pcbTicket = 0; return default; } - public static CSteamID GetSteamID() => default; - } - public static class SteamUtils { public static AppId_t GetAppID() => default; } - public static class SteamClient { public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t hook) { } } -} - // AOT P/Invoke callback attribute (IL2CPP) + StandaloneFileBrowser anchor. namespace AOT { - public sealed class MonoPInvokeCallbackAttribute : System.Attribute - { - public MonoPInvokeCallbackAttribute(System.Type type) { } - } } namespace SFB { - public struct ExtensionFilter - { - public string Name; - public string[] Extensions; - public ExtensionFilter(string name, params string[] extensions) { Name = name; Extensions = extensions; } - } - public static class StandaloneFileBrowser - { - public static string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) => System.Array.Empty(); - public static string[] OpenFilePanel(string title, string directory, string extension, bool multiselect) => System.Array.Empty(); - } } // ---- third-party SDK namespace anchors (referenced via `using`) ---- -namespace Facebook { internal class _ShimAnchor { } } +namespace Facebook { } namespace Facebook.Unity { - public interface ILoginResult - { - string Error { get; } - bool Cancelled { get; } - string RawResult { get; } - } - public delegate void FacebookDelegate(T result); - public class AccessToken { public string TokenString => ""; public string UserId => ""; public static AccessToken CurrentAccessToken => null; } - public static class FB - { - public static bool IsLoggedIn => false; - public static void LogInWithReadPermissions(System.Collections.Generic.List permissions, FacebookDelegate callback) { } - public static void LogOut() { } - } } namespace RedShellSDK { - public static class RedShellSDK - { - public static void SetApiKey(string apiKey) { } - public static void SetUserId(string userId) { } - public static void SetVerboseLogs(bool verbose) { } - public static System.Collections.IEnumerator MarkConversion() { yield break; } - public static System.Collections.IEnumerator LogEvent(string type) { yield break; } - } } -namespace ZXing -{ - public enum BarcodeFormat { QR_CODE, AZTEC, CODE_128, EAN_13 } - public sealed class Result { public string Text => ""; } - public class BarcodeWriter - { - public BarcodeFormat Format { get; set; } - public ZXing.QrCode.QrCodeEncodingOptions Options { get; set; } - public UnityEngine.Color32[] Write(string contents) => System.Array.Empty(); - } - public class BarcodeReader - { - public bool AutoRotate { get; set; } - public bool TryHarder { get; set; } - public Result Decode(UnityEngine.Color32[] rawColor, int width, int height) => null; - } -} -namespace ZXing.QrCode -{ - public class QrCodeEncodingOptions - { - public ZXing.QrCode.Internal.ErrorCorrectionLevel ErrorCorrection { get; set; } - public int Width { get; set; } - public int Height { get; set; } - public int Margin { get; set; } - } -} -namespace ZXing.QrCode.Internal { public enum ErrorCorrectionLevel { L, M, Q, H } } diff --git a/SVSim.BattleEngine/Shim/External/SdkStubs.cs b/SVSim.BattleEngine/Shim/External/SdkStubs.cs index 2dde9b12..365f1d64 100644 --- a/SVSim.BattleEngine/Shim/External/SdkStubs.cs +++ b/SVSim.BattleEngine/Shim/External/SdkStubs.cs @@ -3,36 +3,14 @@ // resolution path. Namespaces must merely exist (anchors); the few types referenced // by member get a minimal no-op surface. Members grow only as the compile loop demands. -// ---- CriWare audio + movie (CRI types with members live in External/CriShim.cs) ---- -namespace CriWare -{ - internal class _ShimAnchor { } -} -namespace CriWare.CriMana -{ - public class CriManaMovieMaterial : UnityEngine.MonoBehaviour - { - public enum MaxFrameDrop { Disable, One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten } - public MaxFrameDrop maxFrameDrop; - public Player player { get; } = new Player(); - } - internal class _ShimAnchor { } -} - // ---- CodeStage anti-cheat obscured prefs (static k/v facade; no persistence headless) ---- namespace CodeStage.AntiCheat.ObscuredTypes { public static class ObscuredPrefs { - public static bool HasKey(string key) => false; - public static void DeleteKey(string key) { } - public static void DeleteAll() { } - public static void Save() { } public static int GetInt(string key, int defaultValue = 0) => defaultValue; - public static float GetFloat(string key, float defaultValue = 0f) => defaultValue; public static string GetString(string key, string defaultValue = "") => defaultValue; public static void SetInt(string key, int value) { } - public static void SetFloat(string key, float value) { } public static void SetString(string key, string value) { } } } @@ -40,65 +18,29 @@ namespace CodeStage.AntiCheat.ObscuredTypes // ---- Spine animation ---- namespace Spine { - // Spine runtime — minimal hand shim (cosmetic skeletal animation, off battle path). - public class SkeletonData { public System.Collections.Generic.List Skins { get; } = new System.Collections.Generic.List(); } - public class Skin { public string Name { get; set; } } - public class Bone - { - public float WorldX, WorldY, WorldRotationX; - public Skeleton Skeleton => null; - } - public class Skeleton - { - public SkeletonData Data => null; - public Skin Skin => null; - public float ScaleX, ScaleY; - public Bone FindBone(string boneName) => null; - public void SetSkin(string skinName) { } - public void SetSkin(Skin newSkin) { } - public void SetSlotsToSetupPose() { } - public void Update(float delta) { } - } - internal class _ShimAnchor { } } namespace Spine.Unity { - public class SkeletonMecanim : UnityEngine.MonoBehaviour - { - public Spine.Skeleton skeleton => null; - public Spine.Skeleton Skeleton => null; - } - internal class _ShimAnchor { } } // ---- misc third-party namespaces (anchors) ---- -namespace RedShellUnity { internal class _ShimAnchor { } } +namespace RedShellUnity { } namespace PlatformSupport.Collections.ObjectModel { - public class ObservableDictionary : System.Collections.Generic.Dictionary { } - internal class _ShimAnchor { } } -namespace Convention { internal class _ShimAnchor { } } +namespace Convention { } namespace com.adjust.sdk { - public static class Adjust - { - public static bool IsEditor() => true; - public static void addSessionCallbackParameter(string key, string value) { } - } } -namespace BestHTTP.Decompression { internal class _ShimAnchor { } } -namespace BestHTTP.SocketIO.Transports { internal class _ShimAnchor { } } +namespace BestHTTP.Decompression { } +namespace BestHTTP.SocketIO.Transports { } namespace BestHTTP.Decompression.Zlib { - public static class GZipStream { public static byte[] UncompressBuffer(byte[] data) => data; } } // Native plugins (no decomp source) referenced unqualified from global scope. public static class TimeNativePlugin { public static float GetDeviceOperatingTime() => 0f; } -public static class Packsize { public static bool Test() => true; } -public static class DllCheck { public static bool Test() => true; } // The BCL's CollectionExtensions.GetValueOrDefault only binds to IReadOnlyDictionary; // copied code calls it on an IDictionary<,> static type (where the only by-name match is diff --git a/SVSim.BattleEngine/Shim/External/ThirdParty.cs b/SVSim.BattleEngine/Shim/External/ThirdParty.cs index 2ec1f4b6..d69c62bb 100644 --- a/SVSim.BattleEngine/Shim/External/ThirdParty.cs +++ b/SVSim.BattleEngine/Shim/External/ThirdParty.cs @@ -8,25 +8,7 @@ using System; namespace UnityEngine { public partial class Font : Object { } - public enum Space { World, Self } - // NGUI's UIInputOnGUI / UIInput read the legacy IMGUI Event. - public enum EventType - { - MouseDown, MouseUp, MouseMove, MouseDrag, KeyDown, KeyUp, - ScrollWheel, Repaint, Layout, DragUpdated, DragPerform, DragExited, - Ignore, Used, ValidateCommand, ExecuteCommand, ContextClick, - MouseEnterWindow, MouseLeaveWindow, TouchDown, TouchUp, TouchMove, - TouchEnter, TouchLeave, TouchStationary - } - public class Event - { - public static Event current => null; - public EventType type; - public EventType rawType => type; - public KeyCode keyCode; - public EventModifiers modifiers; - public void Use() { } - } + public enum Space { Self } } namespace UnityEngine.Networking @@ -39,11 +21,9 @@ namespace UnityEngine.Networking // ---- BestHTTP Socket.IO ---- namespace BestHTTP.SocketIO { - public interface IManager { } } // ---- Google Play Games ---- namespace GooglePlayGames.BasicApi.Events { - public class Event { } } diff --git a/SVSim.BattleEngine/Shim/Generated/AccountTransferHelper.g.cs b/SVSim.BattleEngine/Shim/Generated/AccountTransferHelper.g.cs index b9a6b73f..ad7251a1 100644 --- a/SVSim.BattleEngine/Shim/Generated/AccountTransferHelper.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/AccountTransferHelper.g.cs @@ -7,32 +7,7 @@ namespace Wizard { public partial class AccountTransferHelper { - public CuteNetworkDefine.ACCOUNT_TYPE PressedTransitongButton; - private string _appleTokenId; - public AccountBase.TransitionOriginalScreen TransitionFromScreen { get; set; } public DialogBase CreateAccountTransferDialog(AccountBase.DisplayType type, AccountBase.TransitionOriginalScreen from, Action close_callback = null) => default!; public void DataTransferByFaceBook() { } - private void startFacebookSign(NetworkTask.ResultCode resultCode) { } - public void DataTransfer(Action close_callback = null) { } - public void GetAppleData(string tokenId) { } - public void DisplayAppleError(AppleLogin.Error error) { } - private void DisplayCannotFindAccountError() { } - public void ShowAccountMagritionConfirmBySocialAccount(NetworkTask.ResultCode resultCode) { } - public void ShowAccountMagritionConfirmByTransferCode(NetworkTask.ResultCode resultCode) { } - private void AddAccountBySocialAccountConfirm() { } - private void DisconnectAccountBySocialAccountConfirm() { } - private void UpdateAccountBySocialAccountConfirm() { } - private void UpdateAccountBySocialAccountConfirmLast() { } - private void UpdateAccountByTransferCodeConfirm() { } - private void AddAccountBySocialAccountExecute() { } - private void CancelAccountBySocialAccount() { } - private void DisconnectAccountBySocialAccountExecute() { } - private void UpdateAccountBySocialAccountExecute() { } - private void UpdateAccountByTransitionCodeExecute() { } - private static void CheckTimeSlipRotationPeriod(Action onFinish) { } - public void ShowAccountDisconnectResult(NetworkTask.ResultCode resultCode) { } - public void ShowAccountChainResult(NetworkTask.ResultCode resultCode) { } - public static void ShowAccountMigrationResult(NetworkTask.ResultCode resultCode) { } - public static void AccountMigrationResultReset() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/AddTokenDeckVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/AddTokenDeckVfx.g.cs deleted file mode 100644 index b06658db..00000000 --- a/SVSim.BattleEngine/Shim/Generated/AddTokenDeckVfx.g.cs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\AddTokenDeckVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class AddTokenDeckVfx -{ - protected const float CARD_UN_SORT_TIME = 0.2f; - public AddTokenDeckVfx(List drawList, VfxBase spawnEffectVfx, BattlePlayerBase selfBattlePlayer, VfxBase skillOrDestroyVfx, bool isVisible) { } - private VfxBase CreateUnSpreadOutVfx(List drawList) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ApplicationFinishManager.g.cs b/SVSim.BattleEngine/Shim/Generated/ApplicationFinishManager.g.cs index 4c74f5ac..b4f48737 100644 --- a/SVSim.BattleEngine/Shim/Generated/ApplicationFinishManager.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ApplicationFinishManager.g.cs @@ -8,15 +8,6 @@ namespace Wizard { public partial class ApplicationFinishManager { - private DialogBase _keyOpenMenuDialog; - private static bool _canQuit; - private DialogBase _quitDialog; - private const int QUIT_DIALOG_SORTING_ORDER = 3; public DialogBase QuitDialog { get; set; } - public static bool CanQuit { get; set; } - public static void ApplicationQuit() { } - public bool WantsToQuit() => default!; - public bool IsQuitDialog() => default!; - public void HandleEscapeDialog() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/AttackTargetSelectTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/AttackTargetSelectTouchProcessor.g.cs index 159cde6a..e9fdc06b 100644 --- a/SVSim.BattleEngine/Shim/Generated/AttackTargetSelectTouchProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/AttackTargetSelectTouchProcessor.g.cs @@ -9,29 +9,8 @@ public partial class AttackTargetSelectTouchProcessor { private enum MouseState { - Idle, - MoveHold, - MoveFree } - private readonly AttackSelectControl _attackSelectControl; - private readonly IPlayerView _battlePlayerView; - private readonly Prediction _prediction; - public bool stopAttack; - private bool evolve; - private MouseState _mouseState; - private Vector2 _positionStart; - public EvolutionSimpleProcessor EvolutionProcessor { get; set; } public AttackTargetSelectTouchProcessor(BattleManagerBase battleMgr, BattleCardBase touchCard, InputMgr inputMgr, Prediction prediction) : base(battleMgr, touchCard, inputMgr) { } - public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public static bool CheckAttackToUnitNotHasGuardError(BattleCardBase attackCard, BattleCardBase targetCard) => default!; - private bool AttackTargetSelectable(BattleCardBase attackCard, BattleCardBase targetCard) => default!; - private bool HasGuardEnemy(BattleCardBase attackCard, BattlePlayerBase battleEnemy) => default!; - private bool DragToAttack(BattleCardBase targetCard) => default!; - protected void SetupTouchProcessorEvents() { } - public bool CheckIsEnd() => default!; - private bool IsShowAlert() => default!; - public VfxWith End() => default!; - private bool UseEvolutionShortcut() => default!; - private bool UseDetailShortcut() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/AvatarBattleBonusItem.g.cs b/SVSim.BattleEngine/Shim/Generated/AvatarBattleBonusItem.g.cs deleted file mode 100644 index a5a31de6..00000000 --- a/SVSim.BattleEngine/Shim/Generated/AvatarBattleBonusItem.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\AvatarBattleBonusItem.cs -using UnityEngine; -namespace Wizard.Battle.UI -{ -public partial class AvatarBattleBonusItem -{ - private UILabel _desc; - private UILabel _costLabel; - private UILabel _signLabel; - private UIDragScrollView _dragScrollView; - private UISprite _separator; - private UISprite _dummyFrame; - public BattlePlayerBase.AvatarBattleDescInfo SkillDescInfo; - public UILabel DescLabel { get; set; } - public UILabel CostLabel { get; set; } - public float Height { get; set; } - public void Setup(BattlePlayerBase.AvatarBattleDescInfo skillDescInfo, UIScrollView scrollView, bool isNeedSeparator, BattleCardBase targetCard) { } - public void SetText(BattleCardBase targetCard, bool isNeedSeparator) { } - private void SetCost(string strCost) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/AvatarBattlePassiveBonusItem.g.cs b/SVSim.BattleEngine/Shim/Generated/AvatarBattlePassiveBonusItem.g.cs deleted file mode 100644 index 1c53aa81..00000000 --- a/SVSim.BattleEngine/Shim/Generated/AvatarBattlePassiveBonusItem.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\AvatarBattlePassiveBonusItem.cs -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.UI -{ -public partial class AvatarBattlePassiveBonusItem -{ - private UILabel _desc; - private UIDragScrollView _dragScrollView; - public BattlePlayerBase.AvatarBattleDescInfo SkillDescInfo; - public UILabel DescLabel { get; set; } - public void Setup(BattlePlayerBase.AvatarBattleDescInfo skillDescInfo, BattleCardBase targetCard, UIScrollView scrollView) { } - public void SetText(BattleCardBase targetCard) { } - private string GetCantChoiceBraveText() => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/AvatarBattleTitleItem.g.cs b/SVSim.BattleEngine/Shim/Generated/AvatarBattleTitleItem.g.cs deleted file mode 100644 index 0bf08076..00000000 --- a/SVSim.BattleEngine/Shim/Generated/AvatarBattleTitleItem.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\AvatarBattleTitleItem.cs -using UnityEngine; -namespace Wizard.Battle.UI -{ -public partial class AvatarBattleTitleItem -{ - private UILabel _titleLabel; - private UIWidget _dummyFrame; - private UIDragScrollView _dragScrollView; - public string TitleText { get; set; } - public float Height { get; set; } - public void Setup(string titleText, UIScrollView scrollView) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/AwakeSkillActivationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/AwakeSkillActivationVfx.g.cs deleted file mode 100644 index be6227ff..00000000 --- a/SVSim.BattleEngine/Shim/Generated/AwakeSkillActivationVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\AwakeSkillActivationVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class AwakeSkillActivationVfx -{ - public const float WAIT_TIME = 0.2f; - public AwakeSkillActivationVfx(IBattleCardView cardView) : base("stt_act_awake_1", "se_stt_act_awake_1", cardView.Transform, 0.2f) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BanishDeckCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/BanishDeckCardVfx.g.cs deleted file mode 100644 index cb4a1559..00000000 --- a/SVSim.BattleEngine/Shim/Generated/BanishDeckCardVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\BanishDeckCardVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class BanishDeckCardVfx -{ - private const float CARD_HIDDEN_TIME = 0.2f; - private const float BANISH_WAIT_TIME = 1.2f; - public BanishDeckCardVfx(IBattleCardView cardView) { } - private void RegisterOpenCardVfx() { } - protected VfxBase MoveCardAndBanish() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BattleCardView_AttackTargetSelectInfo.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleCardView_AttackTargetSelectInfo.g.cs index 8b8b5bed..85950600 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattleCardView_AttackTargetSelectInfo.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattleCardView_AttackTargetSelectInfo.g.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using CriWare; using Cute; using UnityEngine; using Wizard.Battle.Resource; @@ -14,8 +13,6 @@ public partial class BattleCardView public partial class AttackTargetSelectInfo { public readonly Queue _attackPairsCardIsInvolvedIn; - public bool _isBeingSelectedInAttack; - private int _uneffectedByAttackTargettingCount; public AttackSelectControl.AttackPair CurrentAttackPairCardIsInvolvedIn { get; set; } public bool IsCardInvolvedInAttack { get; set; } public bool IsUneffectedByAttackTargetting { get; set; } diff --git a/SVSim.BattleEngine/Shim/Generated/BattleCardView_BuildInfo.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleCardView_BuildInfo.g.cs index 0969d6c0..3e72f85d 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattleCardView_BuildInfo.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattleCardView_BuildInfo.g.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using CriWare; using Cute; using UnityEngine; using Wizard.Battle.Resource; @@ -17,18 +16,6 @@ public partial class BuildInfo { public IReadOnlyBattleCardInfo cardInfo; public BattlePlayerReadOnlyInfoPair _playerInfoPair; - public GameObject gameObject; - public BattleCamera battleCamera; - public BackGroundBase backGround; - public IBattleResourceMgr resourceMgr; - public Func getIsTouchable; - public Func getIsMovable; - public Func getIsOnMove; - public Func getIsFixedUseEnable; - public Func getIsActionCard; - public Func _getIsAbleToAttack; - public Func _getIsUnableToAttackClass; - public Func getHandCardFrameEffectType; // HEADLESS-FIX (M-HC-4a): store cardInfo so the headless BattleCardView can expose CardInfo (the // backing card) — the receive ATTACK path reads BattleCardView.CardInfo.IsClass via // AttackSelectControl.IsCardTranslatable. (Generated stub body was empty; re-apply on regen.) diff --git a/SVSim.BattleEngine/Shim/Generated/BattleEnemyView.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleEnemyView.g.cs index f3883c2d..6061ad73 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattleEnemyView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattleEnemyView.g.cs @@ -8,42 +8,6 @@ namespace Wizard.Battle.View { public partial class BattleEnemyView { - protected string HandDeckObjectName { get; set; } - protected string InPlayCardObjectName { get; set; } - protected string CemeteryObjectName { get; set; } - protected string BanishObjectName { get; set; } - public EnemyChoiceBraveButtonUI EnemyChoiceBraveButtonUI { get; set; } - public Transform ChoiceBraveButtonTransform { get; set; } - public bool IsShowCantChoiceBraveText { get; set; } public BattleEnemyView(BattleEnemy battlePlayer) { } - public void Setup(GameObject statusPanel, GameObject uiContainer, GameObject btlContainer, GameObject battle3DContainer) { } - public VfxBase StartShowChoice(BattleCardBase actCard, SkillBase choiceSkill, List choiceCards, bool isEvol, BattleCardBase accelerateCard, bool isChoiceBrave) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase StartShowSelect(BattleCardBase actCard, SkillBase skill, IEnumerable selectableCards, bool isEvol) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void RegisterPlayCard(BattleCardBase actCard) { } - public void DisableSettingFlag() { } - public SideLogControl GetSideLogControl(bool isSkillTargetSelect) => default!; - public VfxBase RecoveryInHandCards() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryTurnStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase PrepareCardsForAttackSequenceVfx(IBattleCardView attackInitiator, IBattleCardView attackTarget) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private void FloatCardUpwardsDuringAttack(IBattleCardView cardInvolvedInAttack, float timeToReachTopPosition) { } - public VfxBase UpdateHandsSelectState(bool isSelecting) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public bool IsTouchable() => default!; - public void SetTouchable(bool enable) { } - public void ClearPlayQueue() { } - public void ShowCommonPanel() { } - protected AttackSelectControl CreateAttackSelectControl() => default!; - protected HandViewBase CreateHandView(GameObject gameObject) => default!; - protected PlayQueueViewBase CreatePlayQueueView() => default!; - protected InPlayViewBase CreateInPlayView(GameObject gameObject) => default!; - public VfxBase HideCardAttackEffects(IList _targetCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase ReturnActCardAfterFusion(IBattleCardView fusionCardView, bool isFusionMetamorphose = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateBeforeFusionVfx(BattleCardBase fusionCard, List ingredientCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void ShowChoiceBraveButton(bool isNewReplay) { } - public void UpdateChoiceBraveActivatingEffect(bool isActivating) { } - public void HideChoiceBraveButton() { } - public void UpdateChoiceBraveButtonPulsateEffectAndSprite() { } - public void HideChoiceBraveButtonPulsateEffect() { } - public VfxBase SetBp(int num) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public Vector3 GetBPLabelPosition() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/BattleLoadingEndVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleLoadingEndVfx.g.cs deleted file mode 100644 index 58d73d27..00000000 --- a/SVSim.BattleEngine/Shim/Generated/BattleLoadingEndVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\BattleLoadingEndVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class BattleLoadingEndVfx -{ - private readonly BattleManagerBase _battleMgr; - public BattleLoadingEndVfx(BattleManagerBase battleMgr) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BattleLogItem.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleLogItem.g.cs index e4221424..9a7dfa28 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattleLogItem.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattleLogItem.g.cs @@ -9,219 +9,16 @@ public partial class BattleLogItem { public enum CardTextureOption { - Null, - ForceNormal, - ForceEvolution, - DestroyedFollower - } + Null} private enum FrameType { Unit, Field, - Spell, - Class - } + Spell } private enum DescStyle { - Normal, - TurnSelf, - TurnOpponent, - Max - } + Normal } private delegate string FuncDescText(); - private static readonly string[] FRAMESPRITE_SELF; - private static readonly string[] FRAMESPRITE_OPPONENT; - private static readonly string[] FRAMESPRITE_SELECT; - private static readonly Color[] DESC_COL; - private static readonly UIWidget.Pivot[] DESC_PIVOT; - public const string BATTLE_LOG_ICON_PLAY = "battle_log_icon_play"; - public const string BATTLE_LOG_ICON_ENHANCE = "battle_log_icon_enhance"; - public const string BATTLE_LOG_ICON_ACCELERATE = "battle_log_icon_accelerate"; - public const string BATTLE_LOG_ICON_FIGHT = "battle_log_icon_fight"; - public const string BATTLE_LOG_ICON_DESTROY = "battle_log_icon_destroy"; - public const string BATTLE_LOG_ICON_NECROMANCE = "battle_log_icon_necromance"; - public const string BATTLE_LOG_ICON_DRAW = "battle_log_icon_draw"; - public const string BATTLE_LOG_ICON_OVERDRAW = "battle_log_icon_overdraw"; - public const string BATTLE_LOG_ICON_SUMMON = "battle_log_icon_summon"; - public const string BATTLE_LOG_ICON_BUFF = "battle_log_icon_buff"; - public const string BATTLE_LOG_ICON_DEBUFF = "battle_log_icon_debuff"; - public const string BATTLE_LOG_ICON_BANISH = "battle_log_icon_banish"; - public static readonly Color DAMAGE_LABEL_COLOR; - public static readonly Color HEAL_LABEL_COLOR; - private static readonly Color32 CARD_COLOR_GREY; - public static readonly float LOG_ITEM_HEIGHT; - private const float FRAME_POS_X_LEFT = -30f; - private const float FRAME_POS_X_RIGHT = 30f; - private const float FRAME_POS_X_CENTER = 0f; - private const float NO_FRAME_TEXT_OFFSET = -8f; - private const float DESC_LABEL_CENTER_POSITION_X = 42f; - private UISprite _frame; - private UIButton _frameButton; - private UISprite _selectCursor; - private TweenAlpha _selectTween; - private UISprite _separator; - private UITexture _cardTexture; - private UILabel _desc; - private UILabel _num; - private Transform _locator; - private UILabel _rightText; - private UISprite _leftIcon; - private UISprite _rightIcon; - private Transform _fightIcon; - private GameObject _dammyFrame; - private bool isBuff; - private BattlePlayer _battlePlayer; - private BattleManagerBase _battleMgr; - private BattleLogManager _battleLogMgr; - private BattleCardBase _card; - private BattleCardBase _detailCard; - private int _buffMomentCardId; - private LogType _logType; - private bool _isOwner; - private SkillBase _logSkill; - private CardTextureOption _textureOption; - private bool _isCopiedBuff; - public BuffInfo Buff; - public int Turn { get; set; } - public bool IsPlayerSideTurn { get; set; } - public string DivergenceId { get; set; } - public BossRushSpecialSkill BossRushSpecialSkill { get; set; } - public bool IsPlayer { get; set; } - public void SetBuff(BuffInfo buff) { } - public bool IsCopiedBuff() => default!; public static void ClearHeaderTextureCache() { } - public static int GetHeaderTextureCacheNum() => default!; - public CardTextureOption GetTextureOption() => default!; - private void Start() { } - public bool IsOwner() => default!; - public BattleCardBase GetCard() => default!; - public BattleCardBase GetDetailCard() => default!; - public int GetBuffMomentCardId() => default!; - public SkillBase GetLogSkill() => default!; - public void SetLogSkill(SkillBase skill) { } - public void SetDivergenceId(string divergenceId) { } - public Transform GetLocator() => default!; - public LogType GetLogType() => default!; - public float GetPosX() => default!; - public GameObject GetSeparator() => default!; - private int GetTextureId() => default!; - public void Setup(BattleCardBase card, BattlePlayer battlePlayer, BattleManagerBase battleMgr, BattleLogManager battleLogMng, bool isOwner, CardTextureOption textureOption = CardTextureOption.Null, BattleCardBase detailCard = null, bool? isPlayer = null, BuffInfo buff = null, int buffMomentCardId = -1, BossRushSpecialSkill specialSkillInfo = null, List battleLogTextureInfo = null, bool isBattleInfo = false) { } - public void SetupOnReplay(bool isPlayerSideTurn, int turn) { } - public void ReplaceDeckSummonLogCard(BattleCardBase deckSummonCard) { } - public void ReplaceDeckSummonLogCard(List deckSummonCards) { } - public void _SetupCardTexture(BattleCardBase card, CardTextureOption textureOption, int buffMomentCardId, List battleLogTextureInfo) { } - private void _SetupFrame(BattleCardBase card, bool? isPlayer = null, bool isOpponentAllHandSpellCostChange = false, BossRushSpecialSkill specialSkillInfo = null) { } - private void _SetupFrameSelect(BattleCardBase card) { } - private string _GetFrameSpriteName(BattleCardBase card, string[] spriteNameList, bool isOpponentAllHandSpellCostChange = false, BossRushSpecialSkill specialSkillInfo = null) => default!; - private void _SetupDescStyle(DescStyle style) { } - private void _SetupDescColor(DescStyle style) { } - public void SetTurn(bool isSelfTurn, int turn = -1) { } - public void SetCost(int cost, bool isPlayer) { } - private void _SetInner(LogType logType, FuncDescText funcText, string rightValueText = "", int mulliganCount = -1) { } - private void _SetInnerOnSkillTiming(LogType logType, SkillBase skill) { } - private void SetInnerOnSkillTiming(LogType logType) { } - public void UpdateLogType(LogType logType) { } - public void AddNecromanceLog() { } - private void _SetInnerOnDamage(LogType logType, BattleCardBase afterCard, int damageNum, bool isDrainBattle = false) { } - private void SetInnerOnDamage(LogType logType) { } - private void _SetInnerOnHeal(LogType logType, int healNum = -1, bool isDrain = false) { } - private void SetInnerOnHeal(LogType logType) { } - private void _SetInnerOnSkillTarget(LogType logType, bool isMinus = false, string logText = null, string rightValueText = null, int cardWithCount = -1, int[] randomArray = null, bool isDeadInNewReplay = false, bool isNewReplay = false) { } - public void AddUpRightValue(int addValue, string zeroSign = null) { } - public void ChangeDamageLogToDestroy() { } - public void AddDamageAmount(int damage, bool isDamage) { } - public void AddSummonCount(int summonCount) { } - private void CallOnCreateBattleLog(string rightValueText, NewReplayBattleMgr.BattleLogItemType logItemType, bool isMinus = false, bool isNecromance = false, int cardWithCount = -1, int[] randomArray = null, bool isDrain = false, bool isDrainBattle = false, bool isDeadByDamage = false, int mulliganCount = -1) { } - private void _SetInnerCard(LogType logType) { } - private void _SetInnerCard(LogType logType, int num) { } - public void SetBattleLogCardList(int num = 1) { } - public void SetDeckSummonCardList(int num = 1) { } - public void SetFusionInfoList() { } - public void SetFusionIngredientInfoList() { } - public void UpdateBattleLogCardCount(int num) { } - public void SetMulliganChanged(int changedNum) { } - public void SetPlay(LogType logType = LogType.Play) { } - public void SetSummon(int count, SkillBase skill) { } - public void SetAttack(BattleCardBase attackerAfter, bool isDamageDraw, bool isDrainBattle) { } - public void SetAttackCounter(BattleCardBase attackerAfter, bool isDrainBattle) { } - public void SetDrawCard(List drawCards, bool isOverDraw = false) { } - public void SetOverDraw(bool isTurnStartDraw) { } - public void SetOpenDrawCard(SkillBase skill) { } - public void SetOpenCard() { } - public void SetDrawToken(int count, bool isOverDraw = false) { } - public void SetReturnCard(SkillBase skill) { } - public void SetDiscardCardNum(List discardCards, SkillBase skill) { } - public void SetDiscardCard(SkillBase skill) { } - public void SetBanishHandCardNum(List discardCards, SkillBase skill) { } - public void SetBanishDeckCardNum(List discardCards, SkillBase skill) { } - public void SetBanishDeckCard(SkillBase skill) { } - public void SetBanishHandCard(SkillBase skill) { } - public void SetChangeCemetery(int num, SkillBase skill) { } - public void SetClearDestroyedCardList(SkillBase skill) { } - public void SetClearSummonedCardList(SkillBase skill) { } - public void SetChangeChantCount(int num, SkillBase skill) { } - public void SetChangeWhiteRitualStack(int num, SkillBase skill, bool isDebuffSkill) { } - public void SetChangePP(int num, bool isTotal, SkillBase skill) { } - public void SetEP(int ep, SkillBase skill) { } - public void SetEvolution() { } - public void SetEvolutionBySkill(SkillBase skill) { } - public void SetFusion(int materialCount) { } - public void SetFusionIngredient() { } - public void SetGeton() { } - public void SetGetonIngredient() { } - public void SetGetoffIngredient() { } - public void SetCantAttack(CantAttackType type, SkillBase skill) { } - public void SetAttackCountRecovery(SkillBase skill) { } - public void SetChangeDeck(SkillBase skill) { } - public void SetAddDeck(int count, SkillBase skill) { } - public void SetBuffAdd(int addAttack, int addLife, bool isMinusZeroAttack, bool isMinusZeroLife, SkillBase skill, bool isDead, bool isMinus) { } - public void SetBuffAdd(int addAttack, int addLife, int gainAttack, int gainLife, SkillBase skill, bool isInHand) { } - public void SetBuffMultiply(int multiplyAttack, int multiplyLife, SkillBase skill) { } - public void SetBuffAddClass(SkillBase skill) { } - public void SetBuffSetLife(int setLife, bool isClass, SkillBase skill) { } - public void SetBuffAddMaxLife(int addMaxLife, SkillBase skill, bool isDead, bool isDebuffSkill) { } - public void SetBuffInHandAdd(int addAttack, int addLife, SkillBase skill = null, bool isTargetInOpponentHand = false) { } - public void SetBuffInDeckAdd(SkillBase skill, bool isPlayer, int addAttack, int addLife) { } - public void SetHeal(int healAmount) { } - public void SetHealSkill(SkillBase skill, int healAmount) { } - public void SetDamage(BattleCardBase damageAfter, SkillBase skill) { } - public void SetDestroy() { } - public void SetBanish() { } - public void SetMetamorphose(SkillBase skill = null) { } - public void SetUniteMaterial() { } - public void SetBerserkBySkill(SkillBase skill) { } - public void SetLose(SkillBase skill) { } - public void SetLoseCopiedSkill(SkillBase skill, bool isRemain) { } - public void SetChangeClan(CardBasePrm.ClanType newClan, SkillBase skill, bool isTargetInOpponentHand = false) { } - public void SetChangeTribe(List newTribe, SkillBase skill, bool isTargetInOpponentHand = false) { } - public void SetChangePlayCount(int num, SkillBase skill) { } - public void SetGain(SkillGainType type, BattleCardBase gainFrom, int val1 = 0, SkillBase skill = null) { } - public void SetAttachSkill(SkillBase attachedSkill, SkillBase skill, bool isTargetInOpponentHand = false) { } - public void SetShortageDeckWin(SkillBase skill) { } - public void SetTimingWhenPlay(LogType logType, SkillBase skill) { } - public void SetTimingWhenDestroy(SkillBase skill) { } - public void SetTimingWhenLeave(SkillBase skill) { } - public void SetTimingWhenAttackSelfAndOtherAfter(SkillBase skill) { } - public void SetTimingOther(SkillBase skill) { } - public void SetCostChangeCalculate(int num, SkillBase skill = null, bool isTargetInOpponentHand = false) { } - public void SetCostChange(SkillBase skill) { } - public void SetRandomArray(int[] randomArray) { } - public void SetCardTextureColorToGrey() { } - public void SetTokenDrawModifier() { } - public void SetUsePp(SkillBase skill, int usePp) { } - public void SetExclusionTargetList(SkillBase skill) { } - public void SetInnerInReplay(LogType type, string rightValueText, bool isNecromance, int mulliganCount) { } - public void SetInnerOnSkillTimingInReplay(LogType logType, bool isNecromance) { } - public void SetInnerOnDamageInReplay(LogType logType, BattleCardBase card, string rightValueText, bool isDead) { } - public void SetInnerOnHealInReplay(LogType logType, string rightValueText) { } - public void SetInnerOnSkillTargetInReplay(LogType type, bool isMinus, string logText, string rightValueText, bool isDead) { } - public void SetSummonCountInReplay(int summonCount) { } - public static bool IsSameSkillOwner(SkillBase skillA, SkillBase skillB) => default!; - public bool IsSameLog(BattleLogItem logItem) => default!; - public bool IsUseRightText() => default!; - public void SetActiveDammyFrame(bool active) { } - private void OnClickLog() { } - public void OnUnClickLog() { } - public void SetSelectSpriteActive(bool setActive) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/BattleLogManager.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleLogManager.g.cs index 5dd2bb05..14414f57 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattleLogManager.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattleLogManager.g.cs @@ -1,4 +1,8 @@ // AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\BattleLogManager.cs +// TODO(engine-cleanup-pass2): 145 of 159 methods unrun in baseline +// Type: Wizard.Battle.UI.BattleLogManager +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -11,86 +15,16 @@ public partial class BattleLogManager public partial class CostCardLogInfo { } public partial class CardLogInfo { } public delegate void FuncSetup(BattleLogItem logItem); - private const int BATTLELOG_BLOCK_MAX = 30; - private const int SOLOMON_ID = 112341030; - private bool _isBattleLogOpen; - private BattleManagerBase _battleMgr; - private BattlePlayer _battlePlayer; - private WarPair _warBefore; - public BattleLogWindow _logWindow; - private BattleLogButton _logButton; - private GameObject _battleLogRoot; - private GameObject _battleLogButtonRoot; - public BattleLogItem _clickLogItem; - public BattleLogItem _clickSubLogItem; - private List _logItemList; - private List _logItemSetList; - private List _pDestLogItemList; - private List _eDestLogItemList; - private List _pPlayCardLogItemList; - private List _ePlayCardLogItemList; - private List> _pDestLogItemListList; - private List> _eDestLogItemListList; - private List> _pPlayCardLogItemListList; - private List> _ePlayCardLogItemListList; - private List _deckSummonCardObjectList; - private List _pDestroyedLogInfoList; - private List _eDestroyedLogInfoList; - private List _pPlayCardLogInfoList; - private List _ePlayCardLogInfoList; - private Dictionary _deckSummonCardIdList; - public List PlayerFusionCard; - public List EnemyFusionCard; - private List _pDestroyedCostFrameList; - private List _eDestroyedCostFrameList; - private List _pPlayCardCostFrameList; - private List _ePlayCardCostFrameList; - public List PlayerPlayedCard; - public List EnemyPlayedCard; - public List PlayerDestroyedCard; - public List EnemyDestroyedCard; - private int _pDestroyedMinCost; - private int _eDestroyedMinCost; - private int _pPlayCardMinCost; - private int _ePlayCardMinCost; + // PlayerFusionCard / EnemyFusionCard hoisted to BattleManagerBase as instance fields + // (2026-07-02) so concurrent battles don't alias a process-wide list — see + // BattleManagerBase.EnemyFusionCard. private static BattleLogManager _instance; - private int _keyboardSelectLogNumber; - private BattleLogItem _selectBattleLog; - private BattleLogItemSet _oldClickLogItemSet; - private int _oldLogItemSetCount; - private List _logCardList; - private const float CARD_FRAME_HIGHT = 48f; - private const float UI_SCREEN_HIGHT_HALF = 320f; - private const int DEFAULT_DESTROYED_COST = 99; - public const int MAX_COST_NUM = 30; - private bool _alertLayerEnable; - private int _alerOriginalLayer; - private CanNotTouchCardVfx _canNotTouchCardVfx; - private const int ZEUS_SUPREME_ID = 113041020; - private bool _isPlayerSkinEvolved; - private bool _isEnemySkinEvolved; - public bool IsOpen { get; set; } - public static BattleLogItem CreateLogItem(bool isSmall = false) => default!; - public static BattleLogItem CreateBuffLogItem(BattleCardBase card, BattleCardBase detailCard, BuffInfo buff, bool? isPlayer, bool useSmall, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, int buffMomentCardId = -1, BossRushSpecialSkill specialSkillInfo = null) => default!; - public static MyRotationBonusItem CreateMyRotationBonusItem(BattlePlayerBase.MyRotationBonusCondition myRotationBonusCondition, bool isPlayer, bool needSeparator) => default!; - public static AvatarBattleTitleItem CreateAvatarBattleBonusTitleItem(string titleText, UIScrollView scrollView) => default!; - public static AvatarBattleTitleItem CreateAvatarBattleBuffTitleItem(string titleText, UIScrollView scrollView) => default!; - public static AvatarBattleBonusItem CreateAvatarBattleBonusItem(BattlePlayerBase.AvatarBattleDescInfo skillDescInfo, UIScrollView scrollView, bool isNeedSeparator, BattleCardBase targetCard) => default!; - public static AvatarBattlePassiveBonusItem CreateAvatarBattlePassiveBonusItem(BattlePlayerBase.AvatarBattleDescInfo skillDescInfo, BattleCardBase targetCard, UIScrollView scrollView) => default!; - public static BattleLogItem CreateBossRushPlayerSpecialSkillLogItem(BattleCardBase card, BossRushSpecialSkill bossRushSpecialSkill) => default!; - public static BossRushEnemySpecialSkillItem CreateEnemyBossRushSpecialSkillLogItem(BattleCardBase card, BossRushSpecialSkill bossRushSpecialSkill) => default!; - public static void DestroyLogItem(BattleLogItem logItem) { } - public static BattleLogItemSet CreateLogItemSet() => default!; - public static void DestroyLogItemSet(BattleLogItemSet logItemSet) { } public static BattleLogManager GetInstance() => _instance ??= new BattleLogManager(); // HEADLESS-FIX (M9): non-null singleton so the draw's unguarded BattleLog tail (UpdateFusionedCardSkillDrewCard, and the IsBattleLog AddLogSkillDrawCard calls) no-ops instead of NRE on a null instance private BattleLogManager() { } public void SetUp(Transform parent, BattleManagerBase battleMgr, OperateMgr operateMgr, BattlePlayer battlePlayer) { } public void Clear() { } public void ClearDestroyedCardList(bool isPlayer) { } - public void ClearPlayedCardList(bool isPlayer) { } - private void _SetActiveWindow(bool isActive, BattleLogWindow.BattleLogType logType = BattleLogWindow.BattleLogType.Battle, bool isPlayer = true) { } public void SetActiveShowButton(bool isActive) { } - public void ShowLog(BattleLogWindow.BattleLogType logType, bool isPlayer = true) { } public void HideLog() { } public void BeginLogBlockEvolution(BattleCardBase card) { } public VfxBase EndLogBlockEvolution() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); @@ -104,50 +38,14 @@ public partial class BattleLogManager public VfxBase SetupWarActionLog() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxBase BeginLogBlockWar(BattleCardBase attackCard, BattleCardBase attackedCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxBase EndLogBlockWar(BattleCardBase attackCard, BattleCardBase attackedCard, bool needAttack) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private LogType GetTimingLogType(SkillBase skill) => default!; - private void _AddLogSkillTiming(SkillBase skill, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null) { } - private void _AddLogSkillTiming(BattleCardBase ownerCard, LogType logType, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null) { } public void AddNecromanceIcon(SkillBase skill, BattleCardBase card, bool isSpell) { } - private BattleLogItem _AddLogCommonOne(BattleCardBase card, FuncSetup funcSetup, bool isOwner = false, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, List battleLogTextureInfo = null) => default!; - private void _AddLogCommon(List cards, FuncSetup funcSetup, bool isOwner = false, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null) { } - public BattleLogItem AddLogCommonOneAndSetInner(BattleCardBase card, FuncSetup funcSetup, BattleLogItem.CardTextureOption textureOption, List battleLogTextureInfo) => default!; - public void RemoveAllBattleLogSet() { } - public void ParentLogItemToGrid() { } - private int _SetupLogItemSet() => default!; - private int GetMinCost(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - private void SetMinCost(BattleLogWindow.BattleLogType type, bool isPlayer, int value) { } - private List GetCostFrameList(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - private List GetCostCardLogInfoList(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - private List> GetLogListList(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - private List GetLogList(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - private GameObject GetLogObject(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - private UILabel GetEmptyTextLabel(BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - public static Dictionary GetCardCountsByCardId(List cards) => default!; - public static int CompareCardLogInfo(BattleCardBase cardA, BattleCardBase cardB) => default!; - public static int CompareCardLogInfo(CardLogInfo logInfoA, CardLogInfo logInfoB) => default!; - private string GetNameIndex(int cost, int index) => default!; - private void _AddDestLogCommonOne(BattleCardBase card, FuncSetup funcSetup, BattleLogWindow.BattleLogType type, bool isPlayer, List battleLogTextureInfo) { } - private void _ParentDestLogItemToGrid(BattleLogWindow.BattleLogType type, bool isPlayer) { } - private void _SetupLogDestItemList(BattleLogWindow.BattleLogType type, bool isPlayer) { } - private void MakeAndHideCostFrameList(BattleLogWindow.BattleLogType type, bool isPlayer) { } - public void SetupCostFrame() { } public void AddLogDestFollower(BattleLogWindow.BattleLogType type, BattleCardBase card, List battleLogTextureInfo = null) { } - private int GetCardIndex(int cost, int id, BattleLogWindow.BattleLogType type, bool isPlayer) => default!; - public void AddLogCost(int cost, BattleLogWindow.BattleLogType type, bool isPlayer) { } - public void EnableButton() { } - public void DisableButton() { } - private bool _IsAddLogBerserk(BattleCardBase beforeDamage, BattleCardBase afterDamage) => default!; - private bool _IsAddLogAwake(BattleCardBase card, int ppTotalPrev) => default!; - private bool _IsAddLogWar(BattleCardBase attackCard, BattleCardBase attackedCard) => default!; - private BattleLogItem _CreateAttack(bool isCounter, BattleCardBase beforeAttackFrom, BattleCardBase afterAttackFrom, bool isDamageDraw, bool isDrainBattle) => default!; public VfxBase AddLogWar(BattleCardBase attackCard, BattleCardBase attackedCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void AddLogEvolution(BattleCardBase card) { } public void AddLogFusion(BattleCardBase card, List ingrediens) { } public void AddLogSkillGetOn(BattleCardBase card, List ingrediens) { } public void AddLogSkillGetOff(SkillBase skill, List ingrediens) { } public BattleLogItem AddLogTurn(bool isSelfTurn, int turn = -1) => default!; public void AddLogMulliganChanged(BattlePlayerBase player, int changedNum) { } - private BattleLogItem GetSameTypeLogItem(BattleCardBase card, LogType logType) => default!; public void AddLogSkillDrawCard(List drawCards, SkillBase skill, bool isOpen, bool isPlayerDraw, bool isOverDraw) { } public void AddLogSkillDrawToken(List drawCards, SkillBase skill, bool isOpen, bool isOverDraw = false) { } public void AddLogOverDrawCards(List overDrawCards) { } @@ -184,11 +82,9 @@ public partial class BattleLogManager public void AddLogSkillHeal(List beforeHealCards, List healResults) { } public void AddLogHeal(BattleCardBase beforeHealCard, int healAmount) { } public void AddLogSkillDamage(BattleCardBase beforeDamage, BattleCardBase afterDamage, BattleCardBase beforeRefrection, BattleCardBase afterRefrection, SkillBase skill) { } - private void _AddLogDamage(BattleCardBase beforeDamage, BattleCardBase afterDamage, SkillBase skill) { } public void AddLogSkillDeath(List deathCards, SkillBase skill) { } public void AddLogSkillDeath(List deathCards) { } public void AddLogDeath(BattleCardBase deathCard) { } - private void _AddLogDeath(List deathCards) { } public void AddLogSkillEvolution(List evolveCards, SkillBase skill) { } public void AddLogSkillMetamorphose(List pairList, SkillBase skill, bool isTargetInOpponentHand = false, bool isFusion = false) { } public void AddLogSkillUnite(Skill_unite.UniteCardPair pair, SkillBase skill) { } @@ -199,34 +95,17 @@ public partial class BattleLogManager public void AddLogSkillChangeClan(List cards, CardBasePrm.ClanType newClan, SkillBase skill, bool isTargetInOpponentHand = false) { } public void AddLogSkillChangeTribe(List cards, List newTribe, SkillBase skill, bool isTargetInOpponentHand = false) { } public void AddTokenDrawModifier(List targetCards, SkillBase skill) { } - public static string GetTargetCostConditionText(SkillBase skill) => default!; public void AddLogSkillChangePlayCount(BattleCardBase card, int count, SkillBase skill) { } public void AddLogSkillShortageDeckWin(List cards, SkillBase skill) { } public void AddLogCostChange(List cards, SkillBase skill, int cost, bool isSetCost, bool isTargetInOpponentHand, List setCostDifferenceList) { } public void AddLogOpenCard(BattleCardBase card) { } - public void AddLogOpenDrawCard(BattleCardBase card, SkillBase skill) { } - public void AddLogExclusionTargetList(List cards, SkillBase skill) { } public void InsertExclusionTargetListLog(SkillBase skill) { } - private static bool IsSameSkillTiming(LogType logA, LogType logB, bool isSpell) => default!; - private bool _CheckLastAddedSkillOwner(BattleCardBase card, LogType timingLogType) => default!; - private bool ExistSameCardLog(BattleCardBase card, LogType timingLogType) => default!; public void AddLogSkillUsePp(SkillBase skill, BattleCardBase card, int usePp) { } public void AddLogGiveWhiteRitualStack(int num, BattleCardBase targetCard, SkillBase skill) { } public void AddLogDepriveWhiteRitualStack(int num, BattleCardBase targetCard, SkillBase skill) { } public void UpdateSkillTiming(BattleCardBase card, LogType oldType, LogType newType) { } - private bool UpdateDamageAmount(BattleCardBase card, int amount, SkillBase skill, LogType logType) => default!; - private bool UpdateSummonCount(BattleCardBase card, int summonCount, SkillBase skill, bool isPlayerSide) => default!; - public void KeyboardSelectNext(int number) { } - public void KeyboardSelectBack(int number) { } - public void KeyboardSelectNumber(int number) { } - public void KeyboardResetSelect() { } - public void KeyboardUpdateLogList() { } - public void KeyboardUpdateScrollView() { } public static int ConvertPremiumIdToNormalId(int cardId) => default!; public void AddFusionIngredients(BattleCardBase fusionCard, bool isCreateClone) { } - public void ResetFusionIngredients(bool isPlayer) { } - public int GetFusionOrder(BattleCardBase a, BattleCardBase b) => default!; public void UpdateFusionedCardSkillDrewCard(BattleCardBase fusionCard) { } - private void ReplacePlayerBattleLog(bool isPlayer) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/BattleLogUtility.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleLogUtility.g.cs index 4df66e54..fa5ace0b 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattleLogUtility.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattleLogUtility.g.cs @@ -7,56 +7,6 @@ namespace Wizard.Battle.UI public partial class BattleLogUtility { private delegate string FuncGetGainText(BattleCardBase gainFrom, int val1, SkillBase skill); - private static bool _isInitializedStatic; - private static Dictionary _cantAttackTextFunc; - private static Dictionary _attachSkillTextFunc; - private const string NETWORK_SKILL_PREFIX = "Network"; - public const char CARD_COUNT_CHAR = '×'; - public static void SetupStatic() { } - public static string GetCardName(BattleCardBase card) => default!; - public static string GetCardWithCountText(BattleCardBase card, int num) => default!; - public static bool IsAddLogDeath(BattleCardBase card) => default!; - public static string GetSkillTargetPlayerText(SkillBase skill) => default!; - public static string BuildTextTurn(bool isSelfTurn, int turn) => default!; - public static string BuildTextCost(int cost) => default!; - public static string BuildTextMulliganChanged(int changedNum) => default!; - public static string BuildTextSummon(BattleCardBase card, int summonCount) => default!; - public static string BuildTextPlay(BattleCardBase card) => default!; - public static string BuildTextEvolve() => default!; - public static string BuildTextFusion() => default!; - public static string BuildTextGeton() => default!; - public static string BuildTextGetoff() => default!; - public static void GetBuffValueStringFormatted(int addAttack, int addLife, ref string retAttack, ref string retLife, bool isMinusZeroAttack = false, bool isMinusZeroLife = false) { } - public static string BuildTextBuffInHandAdd(int addAttack, int addLife, SkillBase skill, bool isTargetInOpponentHand = false) => default!; - public static string BuildTextBuffInDeckAdd(SkillBase skill, bool isSelf, int addAttack, int addLife) => default!; - public static string BuildTextBuffAdd(int addAttack, int addLife, bool isMinusZeroAttack = false, bool isMinusZeroLife = false) => default!; - public static string BuildTextBuffAdd(int addAttack, int addLife, int gainAttack, int gainLife) => default!; - public static string BuildTextBuffMultiply(int multiplyAttack, int multiplyLife) => default!; - public static string BuildTextDamageCut(int cutAmount) => default!; - public static string BuildTextHeal(BattleCardBase healBefore, int healAmount) => default!; - public static string BuildTextDamage(BattleCardBase damageBefore, BattleCardBase damageAfter) => default!; - public static string BuildTextDestroy(BattleCardBase destroyedCard) => default!; - public static string BuildTextBanish() => default!; - public static string BuildTextMetamorphose(BattleCardBase newCard, BattleCardBase oldCard, SkillBase skill = null, bool isTargetInOpponentHand = false, int metamorphoseCardID = 0) => default!; - public static string BuildTextUniteMaterial() => default!; - public static string BuildTextAwake() => default!; - public static string BuildTextBerserk() => default!; - public static string BuildTextNecromance() => default!; public static string BuildTextLose() => default!; - public static string BuildTextLoseLastWords() => default!; - public static string BuildTextRobLastWords() => default!; - public static string BuildTextChangeClan(CardBasePrm.ClanType newClan, SkillBase skill, bool isTargetInOpponentHand = false) => default!; - public static string BuildTextChangeTribe(CardBasePrm.TribeType newTribe, SkillBase skill, bool isTargetInOpponentHand = false) => default!; - public static string BuildTextChangePlayCount(int cnt) => default!; - public static string BuildTextTimingCallSkill(BattleCardBase card) => default!; - public static string BuildTextTimingWhenPlay(BattleCardBase card) => default!; - public static string BuildTextTimingWhenDestroy(BattleCardBase card) => default!; - public static string BuildTextTimingOther(BattleCardBase card) => default!; - public static string BuildTextCantAttack(CantAttackType type) => default!; - public static string GetPlayerAndPlace(SkillBase skill, SkillFilterCreator.ContentKeyword place) => default!; - public static string BuildTextRandomArray(int[] randomArray) => default!; - public static string BuildTextAttachSkill(SkillBase attachedSkill, SkillBase skill, bool isBuffText, bool isKeyWordCodeDelete = true, bool isNow = true, bool isTargetInOpponentHand = false) => default!; - public static string BuildAttachSkillText(SkillBase attachedSkill, bool isBuffText, bool isKeyWordCodeDelete = true, bool isNow = true) => default!; - private static string DeleteKeywordCode(string battleLogText) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/BattlePlayerView.g.cs b/SVSim.BattleEngine/Shim/Generated/BattlePlayerView.g.cs index ed326dbd..462476d2 100644 --- a/SVSim.BattleEngine/Shim/Generated/BattlePlayerView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BattlePlayerView.g.cs @@ -12,127 +12,12 @@ namespace Wizard.Battle.View { public partial class BattlePlayerView { - public Vector3 firstHitPoint; - public bool moveSeFirst; - public bool isDetailRotating; - public const int CLASS_EFFECT_DIALOG_DEPTH = 31; - public bool _isEvolutionCardLanding; - private int? _detailEffectSavedLayer; - private const int KEY_WORD_START = 0; - private const int KEY_WORD_END = 1; - private const int KEY_WORD_DIALOG_LINE_OBJECT = 0; - private const string KEY_WORD_PRESS_COLOR = "[00d2e4]"; - public const string KEY_WORD_COLOR = "[ffcd45]"; - protected string HandDeckObjectName { get; set; } - protected string InPlayCardObjectName { get; set; } - protected string CemeteryObjectName { get; set; } - protected string BanishObjectName { get; set; } - private ArrowControl ArrowCtrl { get; set; } - private SoundMgr SoundMgr { get; set; } - public BattleCardBase DetailOpenCard { get; set; } - public BattleCardBase SubDetailOpenCard { get; set; } - public GameObject CardMoveEffect { get; set; } - public bool IsMenuOpen { get; set; } - public bool IsMenuCloseEscape { get; set; } - public bool CanPlayerEndTurnImmediately { get; set; } - public bool IsShowTurnEndDialogOfNotAttackingOrPlaying { get; set; } - public bool IsShowTurnEndDialogOfNotUsingHeroSkill { get; set; } - public bool _isEvolutionSkillSelect { get; set; } - public IList GetPopupPanelList { get; set; } - public bool IsEvolutionStart { get; set; } - public bool IsEvolutionVfx { get; set; } - public PlayerChoiceBraveButtonUI PlayerChoiceBraveButtonUI { get; set; } - public Transform ChoiceBraveButtonTransform { get; set; } - public bool IsShowCantChoiceBraveText { get; set; } public BattlePlayerView(BattlePlayer battlePlayer) { } - public void Setup(GameObject statusPanel, GameObject uiContainer, GameObject btlContainer, GameObject battle3DContainer) { } - public void ClearPlayQueue() { } - public void ShowCommonPanel() { } - public void RegisterPlayCard(BattleCardBase actCard) { } - public void DisableSettingFlag() { } - public SideLogControl GetSideLogControl(bool isSkillTargetSelect) => default!; - public VfxBase StartShowChoice(BattleCardBase actCard, SkillBase choiceSkill, List choiceCards, bool isEvol, BattleCardBase accelerateCard, bool isChoiceBrave) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase StartShowSelect(BattleCardBase actCard, SkillBase skill, IEnumerable selectableCards, bool isEvol) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase UpdateHandsSelectState(bool isSelecting) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void GetCardSelectedWithButton(Camera camera, ref UIButton button, ref BattleCardBase card, ref GameObject check) { } - public void ClearDifferentiatePopUp(List deselectionItem) { } - public void LockOnAttackTarget(BattleCardBase Attacker, BattleCardBase Target) { } - public void ReleaseLockOnTarget() { } - public void ReverseDetailCard() { } - public void DetailReverseOver() { } - public void ShowDetailPanel(BattleManagerBase battleMgrBase, OperateMgr operateMgr, BattleCardBase card, DetailPanelControl.ShowRequest showRequest, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, BuffInfo buff = null, string divergenceId = "", int logTextureId = 0) { } - private void ShowDetailCommon(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List cards, DetailPanelControl.ShowRequest showRequest, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, BuffInfo buff = null, string divergenceId = "", int logTextureId = 0) { } - public void ShowDetailPanelList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List cards, DetailPanelControl.ShowRequest showRequest) { } - public void CallOnOpenEvolveDialoguePanel() { } public static bool HasKeyword(CardParameter cardParameter) => default!; - public void HideDetailPanel() { } - public void HideSubDetailPanel() { } - public BattleCardBase GetDetailCard() => default!; - private void OpenCardDetailList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List cards, DetailPanelControl.ShowRequest showRequest, BuffInfo buff, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, string divergenceId = "", int logTextureId = 0, bool useSubDetailPanelControl = false) { } - public void SetDetailScreenPosition(bool right) { } - public void DragArrowStart(BattleManagerBase battleMgr, BattleCardBase attackCard, GameObject arrowHead) { } - public void DragArrowStart(BattleManagerBase battleMgr, GameObject startObject, GameObject arrowHead, bool isTargettingEnemy = true) { } - public void DragArrow(BattleManagerBase battleMgr, GameObject arrowHead, Vector3 pos) { } - public void MoveCardStart(BattleCardBase moveCard, bool isEffectAndSoundOn) { } - public void MoveCard(BattleCardBase hitCard, Vector3 pos) { } - public void MoveCardCancel(BattleCardBase hitCard, Vector3 position, Quaternion rotation, bool IsPress) { } - public void CancelCardDrag(BattleCardBase cardBeingDragged) { } - public void CardMoveEffectSwitch(bool on) { } - public void HideModeEffect(bool on) { } public bool IsMoving() => default!; - public void OffNotHideAndNotCreate() { } - public void LockOnEffectOn(BattleCardBase SelectCard) { } - public Effect DetailPanelSelectEffectOn(BattleCardBase selectedCard, DetailPanelControl.ShowRequest request) => default!; - public void StopBattleLogSelectDetailPanelEffect() { } - public void DetailPanelSelectEffectOff() { } - public bool isDetailAble(BattleCardBase card, DetailPanelControl.ShowRequest showRequest) => default!; - public bool IsDetailOn() => default!; - public bool IsFieldDetailOn() => default!; - public void ShowTurnEndDialog(GameObject return_obj = null) { } - public void ShowPlayerTurnEnd(bool isAuto = false) { } - public virtual void ShowTurnEndPulseEffect() { } - public virtual VfxBase HideTurnEndPulseEffect() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual void ShowTurnEndButton(bool showEffect = true) { } - public void ForceShowTurnEndButton() { } - public void UpdateTurnEndPulseEffect() { } - public void ShowKeyPanel(int page) { } - public void HideKeyPanel() { } - public DialogBase CreateKeyPanel(BattleCardBase card, UILabel label, CardMaster.CardMasterId cardMasterId, CardParameter baseParameter) => default!; public static DialogBase CreateKeyPanel(UILabel label, IList keywordList, CardMaster.CardMasterId cardMasterId) => default!; public static DialogBase CreateKeyPanel(string skillDescription, UILabel label, CardMaster.CardMasterId cardMasterId) => default!; - public static DialogBase CreateClassEffectPanel(List keyWordList, CardMaster.CardMasterId cardMasterId) => default!; - private static DialogBase CreateKeywordsPanel_Inner(string titleTextID, Action funcSetup, UILabel label = null) => default!; - private static void SetKeyWordView(UILabel label, BattleKeywordInfoListMgr keywordInfo, out string keywordText, out int startIndex, out int endIndex) { keywordText = default!; startIndex = default!; endIndex = default!; } - private static List GetKeyWordIndexList(string inText) => default!; - public static List GetKeyWordList(string inText) => default!; - private static void ChangeKeyWordNewLineToSpace(ref string keyWordText) { } - public static bool IsKeyWordUnderLine() => default!; - public static void SetKeyWordColor(GameObject colliderObject, UILabel label, DetailPanelControl control = null) { } - public static void SetLabelColorEvent(UILabel label, GameObject inClickObject = null) { } public static void PressKeyWordColorChange(UILabel label, bool press) { } public static void SetKeyWordLabelColor(UILabel label, string colorCode = "[ffcd45]") { } - public DialogBase ShowRetireConfirmPanel() => default!; - public DialogBase CreateBattleSetting() => default!; - public bool IsTouchable() => default!; - public void SetTouchable(bool enable) { } - public void ResetTouchable() { } - public void AddPopUpPanel(DialogBase dia, BattleDialogItem diaItem) { } - public void AddPopUpPanel(NonDialogPopup popup, BattleDialogItem item) { } - public VfxBase Recovery(bool doseFirst, bool isFocusHand = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase HideCardAttackEffects(IList _targetCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryInHandCards() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryMulligan() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryTurnStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected HandViewBase CreateHandView(GameObject gameObject) => default!; - protected PlayQueueViewBase CreatePlayQueueView() => default!; - protected InPlayViewBase CreateInPlayView(GameObject gameObject) => default!; - public DialogBase ShowFusionCardPlayDialog(EventDelegate onClickOk, Action onClose) => default!; - public void ShowChoiceBraveButton(bool isNewReplay) { } - public void UpdateChoiceBraveActivatingEffect(bool isActivating) { } - public void HideChoiceBraveButton() { } - public void UpdateChoiceBraveButtonPulsateEffectAndSprite() { } - public void HideChoiceBraveButtonPulsateEffect() { } - public VfxBase SetBp(int num) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public Vector3 GetBPLabelPosition() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/BattleStarter.g.cs b/SVSim.BattleEngine/Shim/Generated/BattleStarter.g.cs deleted file mode 100644 index 17d3aaaa..00000000 --- a/SVSim.BattleEngine/Shim/Generated/BattleStarter.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult\BattleStarter.cs -using System.Collections; -using Cute; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class BattleStarter -{ - public void Execute(Parameter param) { } - private IEnumerator ExecuteCoroutine(Parameter param) => default!; - private static void RegisterSelectedStoryInfo(Parameter param) { } - private static void RegisterDeck(DeckData deckData) { } - private static void RegisterBattleData(StoryChapterData chapterData, int chapterCharaId, int chapterClassId) { } - private static IEnumerator StoryStartTaskCoroutine(SelectedStoryInfo storyInfo) => default!; - private static IEnumerator FadeoutCoroutine() => default!; - private static void GoToBattleScene() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BerserkSkillActivationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/BerserkSkillActivationVfx.g.cs deleted file mode 100644 index ef003659..00000000 --- a/SVSim.BattleEngine/Shim/Generated/BerserkSkillActivationVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\BerserkSkillActivationVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class BerserkSkillActivationVfx -{ - public BerserkSkillActivationVfx(IBattleCardView cardView) : base("stt_act_berserk_1", "se_stt_act_berserk_1", cardView.Transform, 0.3f) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BishopInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/BishopInfomationUI.g.cs deleted file mode 100644 index d1818d34..00000000 --- a/SVSim.BattleEngine/Shim/Generated/BishopInfomationUI.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\BishopInfomationUI.cs -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class BishopInfomationUI -{ - private new BattlePlayerBase _player; - private IBattlePlayerView _opponentBattlePlayerView; - private readonly float HANDCARD_YPOSITION; - private readonly float INPLAYCARD_YPOSITION; - private readonly float HANDCARD_XPOSITION; - private readonly float INPLAYCARD_XPOSITION; - private readonly float INFORMATION_UI_HIGHT; - private readonly Vector3 BISHOP_INFORMATION_LOACL_POSITION; - private const string BISHOP_INFORMATION_PATH = "UI/Battle/ClassInfomation_7"; - private const string BISHOP_INFORMATION_UI_PREFAB_PATH = "UI/Battle/BishopSummonInfomation"; - private const string BISHOP_INFORMATION_UI_CHILD = "BishopSummonInfomation_"; - private bool _isPressing; - private List _loadingTokenInfoUIList; - public BishopInfomationUI(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, IBattlePlayerView battleEnemyView, int orderCount, int totalInfoNum) : base(battlePlayerBase, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - public void HideOtherInfomation() { } - public void HideAllInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private void ShowInfo() { } - private void SetTokenInfoUIPosition(GameObject tokenInfoUIObj, bool isInHand, int summonCardIndex) { } - private void HideInfo() { } - private void HideAllInfo() { } - private IEnumerable SelectSummonChantField(IEnumerable cardList) => default!; - private List GetLastWordSummonCard(BattleCardBase ownerCard) => default!; - private void WaitUntilLoadTexture() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BishopSummonTokenInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/BishopSummonTokenInfomationUI.g.cs deleted file mode 100644 index 02add9c7..00000000 --- a/SVSim.BattleEngine/Shim/Generated/BishopSummonTokenInfomationUI.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\BishopSummonTokenInfomationUI.cs -using System; -using Cute; -using UnityEngine; -namespace Wizard.Battle.UI -{ -public partial class BishopSummonTokenInfomationUI -{ - private UILabel _costLabel; - private UILabel _attackLabel; - private UILabel _lifeLabel; - private UIPanel _panel; - private UITexture _texture; - private GameObject _attackLabelRoot; - private GameObject _lifeLabelRoot; - private BattleCardBase _chantCardToSummonToken; - public bool IsLoading { get; set; } - public void SetUnit(int cost, int attack, int life, int order, int id, BattleCardBase chantCardToSummonToken, Action onLoaded = null) { } - public void SetAmulet(int cost, int order, int id, BattleCardBase chantCardToSummonToken, Action onLoaded = null) { } - private void SetCost(int cost) { } - private void SetAttack(int attack) { } - private void SetLife(int life) { } - private void SetSortingOrder(int order) { } - private void SetTexture(int id, bool isUnit, Action onLoaded) { } - private void SetOnDrawEvent() { } - public void SetInfoUIObjectActive(bool isActive) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/BossRushEnemySpecialSkillItem.g.cs b/SVSim.BattleEngine/Shim/Generated/BossRushEnemySpecialSkillItem.g.cs index 310746d8..97538dda 100644 --- a/SVSim.BattleEngine/Shim/Generated/BossRushEnemySpecialSkillItem.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/BossRushEnemySpecialSkillItem.g.cs @@ -2,11 +2,4 @@ using UnityEngine; namespace Wizard.Battle.UI { -public partial class BossRushEnemySpecialSkillItem -{ - private UILabel _desc; - public UILabel DescLabel { get; set; } - public BossRushSpecialSkill BossRushSpecialSkill { get; set; } - public void Setup(BossRushSpecialSkill specialSkill) { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/CanNotTouchCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/CanNotTouchCardVfx.g.cs deleted file mode 100644 index 269dc91b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/CanNotTouchCardVfx.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\CanNotTouchCardVfx.cs -using System; -using System.Collections.Generic; -namespace Wizard.Battle.View.Vfx -{ -public partial class CanNotTouchCardVfx -{ - private bool _canTouchCard; - private bool _isUpdateHandCardsPlayability; - private bool _isEvolveTutorial; - public CanNotTouchCardVfx(bool isUpdateHandCardsPlayability = true, bool isEvolveTutorial = false) { } - public CanNotTouchCardVfx(Func onCheckEnd) { } - public void End(bool isEvolveTutorialEnd = false) { } - public override void Update(float dt, List effectVfxList) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/CardTouchProcessorBase.g.cs b/SVSim.BattleEngine/Shim/Generated/CardTouchProcessorBase.g.cs index 55400daa..f4614dd4 100644 --- a/SVSim.BattleEngine/Shim/Generated/CardTouchProcessorBase.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/CardTouchProcessorBase.g.cs @@ -9,20 +9,10 @@ namespace Wizard.Battle.Touch { public partial class CardTouchProcessorBase { - protected readonly BattleManagerBase _battleMgr; - protected readonly BattlePlayer _battlePlayer; - protected readonly BattleCardBase _firstTouchCard; - protected IEnumerable _targetCards; - protected GameObject _lastFocusedObject; - protected BattleCardBase _lastFocusedCard; - protected InputMgr _inputMgr; public CardTouchProcessorBase(BattleManagerBase battleMgr, BattleCardBase touchCard, InputMgr inputMgr) { } public virtual VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public virtual VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public virtual VfxWith End() => default!; - private BattleCardBase GetBattleCardFromObject(GameObject cardObject) => default!; public virtual bool CheckIsEnd() => default!; - protected virtual void SetupTouchProcessorEvents() { } - protected VfxBase CreateOpenCardDetailVfx(BattleCardBase targetCard, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); } } diff --git a/SVSim.BattleEngine/Shim/Generated/CardVfxCreatorBase.g.cs b/SVSim.BattleEngine/Shim/Generated/CardVfxCreatorBase.g.cs deleted file mode 100644 index c4fea1a8..00000000 --- a/SVSim.BattleEngine/Shim/Generated/CardVfxCreatorBase.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\CardVfxCreatorBase.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class CardVfxCreatorBase -{ - protected readonly bool _isPlayer; - protected readonly BattleCardBase _card; - protected readonly IBattleCardView _battleCardView; - protected readonly IBattleResourceMgr _resourceMgr; - private const float REFRESH_CARD_PARAMETER_WAIT_TIME = 0.2f; - public CardVfxCreatorBase(bool isPlayer, BattleCardBase card, IBattleCardView battleCardView, IBattleResourceMgr resourceMgr) { } - public virtual VfxBase CreateDraw(Vector3 pos, bool isCardRare) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreatePick() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDestroyHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateBanish(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxWithLoading CreateBanishHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => default!; - public virtual VfxBase CreateGeton(Transform vehicleCardTrans, IBattleCardView vehicleCardView, BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxWithLoading CreateFusionHand(BattlePlayerBase battlePlayerBase, IBattleCardView fusionCardView, bool isFusionMetamorphose) => default!; - public virtual VfxBase CreateParameterChange(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool isDead, bool isEvolve, bool skipWait = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateBuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateBuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDebuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDebuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateBuffStartInHand(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true, bool isDebuff = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase CreateChangeBuffStatusVfx(VfxBase originalVfx, bool useWait) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateGuardStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateGuardStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateKillerStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateKillerStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateProtectionStart(ProtectionColorType type) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateProtectionStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateNotBeAttackedStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateNotBeAttackedStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateUntouchableStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateUntouchableStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateQuick(bool hasAttacksRemaining, bool isCardUnableToAttackClass) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateSneakStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateSneakStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateForceCantAttackStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateForceCantAttackStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDrainStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDrainStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateAttack(IBattleCardView attackCardView, IBattleCardView attackTargetCardView) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateAttackFloatUp() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateAttackFloatDown(bool isAttacker, bool isDead, int attackableCount) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateMoving(Vector3 pos) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateDamage(int damage, int currentHealth, int maxHealth, int baseHealth, bool isReflectedDamage, bool isSkillDamage) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected DamageVfx CreateDamageVfx(int damage, bool isReflectedDamage) => default!; - public virtual VfxBase CreateHealing(int healAmount, int currentHealth, int maxHealth, int baseHealth) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateMaskCardInPlay() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateReflectionStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateReflectionStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateHeavenlyAegisStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateHeavenlyAegisStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateChangeAffiliation(BattleCardBase card, CardBasePrm.ClanType clan, bool showEffect) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/CardVoiceInfoCache.g.cs b/SVSim.BattleEngine/Shim/Generated/CardVoiceInfoCache.g.cs index 3af77f27..96d8f10a 100644 --- a/SVSim.BattleEngine/Shim/Generated/CardVoiceInfoCache.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/CardVoiceInfoCache.g.cs @@ -1,16 +1,14 @@ // AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View\CardVoiceInfoCache.cs +// TODO(engine-cleanup-pass2): 4 of 5 methods unrun in baseline +// Type: Wizard.Battle.View.CardVoiceInfoCache +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + using System.Collections.Generic; namespace Wizard.Battle.View { public partial class CardVoiceInfoCache { - private const int CAP_VOICE_DIC = 32; - private const int WARNING_SIZE = 100; - private static Dictionary _voiceInfoDic; public static void ClearCardVoiceInfo() { } - public static void CacheCardVoiceInfoForBattle(IList cardID) { } - public static void CacheCardVoiceInfo(IList cardID, CardMaster.CardMasterId cardMasterId) { } public static IReadOnlyVoiceInfo GetCardVoiceInfoForBattle(int cardID) => HeadlessVoiceInfo.Instance; // HEADLESS-FIX (M7): non-null voice info for the IsRecovery death-voice tail - public static IReadOnlyVoiceInfo GetCardVoiceInfo(int cardID, CardMaster.CardMasterId cardMasterId) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/ChangeChantCountVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ChangeChantCountVfx.g.cs deleted file mode 100644 index 1577006a..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ChangeChantCountVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ChangeChantCountVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ChangeChantCountVfx -{ - public ChangeChantCountVfx(BattleCardBase card, int count, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ChangeInPlayViewVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ChangeInPlayViewVfx.g.cs deleted file mode 100644 index c642702f..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ChangeInPlayViewVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ChangeInPlayViewVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class ChangeInPlayViewVfx -{ - private readonly IBattleCardView _view; - public ChangeInPlayViewVfx(IBattleCardView view) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ChangeWhiteRitualCountVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ChangeWhiteRitualCountVfx.g.cs deleted file mode 100644 index c1d99eb3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ChangeWhiteRitualCountVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ChangeWhiteRitualCountVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class ChangeWhiteRitualCountVfx -{ - public ChangeWhiteRitualCountVfx(BattleCardBase card, int count) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ChapterCharaDecider.g.cs b/SVSim.BattleEngine/Shim/Generated/ChapterCharaDecider.g.cs deleted file mode 100644 index 26d8fa76..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ChapterCharaDecider.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult\ChapterCharaDecider.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class ChapterCharaDecider -{ - public void Execute(Parameter param) { } - private static int GetChapterCharaId(Parameter param) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ChapterCharaDecider__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs b/SVSim.BattleEngine/Shim/Generated/ChapterCharaDecider__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs deleted file mode 100644 index f66d6b31..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ChapterCharaDecider__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.Main/ChapterCharaDecider.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class ChapterCharaDecider -{ - public void Execute(Parameter param) { } - private static int? GetChapterCharaId(Parameter param) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ChoiceBraveTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/ChoiceBraveTouchProcessor.g.cs index 211506f0..0b6968d0 100644 --- a/SVSim.BattleEngine/Shim/Generated/ChoiceBraveTouchProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ChoiceBraveTouchProcessor.g.cs @@ -7,9 +7,6 @@ namespace Wizard.Battle.Touch { public partial class ChoiceBraveTouchProcessor { - public bool EnableCancel; public ChoiceBraveTouchProcessor(BattleManagerBase battleMgr, BattleCardBase card, List choiceSkills) : base(battleMgr, card, battleMgr.TouchControl.GetPrediction(), choiceSkills, isEvolve: false, isChoiceBrave: true) { } - public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxWith End() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/ChoiceTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/ChoiceTouchProcessor.g.cs index 0ba03955..e97cdfc9 100644 --- a/SVSim.BattleEngine/Shim/Generated/ChoiceTouchProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ChoiceTouchProcessor.g.cs @@ -10,39 +10,10 @@ namespace Wizard.Battle.Touch { public partial class ChoiceTouchProcessor { - protected readonly BattleCardBase _actCard; - protected readonly InputMgr _inputMgr; - protected readonly OperateMgr _operateMgr; - protected readonly BattlePlayer _battlePlayer; - protected bool _isSelectNow; - private readonly Prediction _prediction; - private readonly BattleManagerBase _battleManager; - private bool _stopFlag; - protected BattleCardBase _chosenCard; - private List _choiceSkills; - private SkillBase _choiceSkill; - private List _choiceCards; - private List _chosenCards; - private bool _choiceCompleteFlag; - private bool _isEvolve; - private BattleCardBase _accelerateCard; - private BattleUIContainer _battleUIContainer; - private int _choiceNumber; - private const float DETAIL_PANEL_SIZE_PERCENT = 90.5f; - private CanNotTouchCardVfx _canNotTouchCardVfx; - private Action _onCompleteChoice; - private bool _isChoiceBrave; - protected bool IsSelectNow { get; set; } public ChoiceTouchProcessor(BattleManagerBase battleMgr, BattleCardBase actCard, Prediction prediction, List choiceSkills, bool isEvolve, bool isChoiceBrave, BattleCardBase accelerateCard = null) { } public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public virtual VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public virtual VfxWith End() => default!; - protected ITouchProcessor CreateAfterSelectTouchProcessor(BattleCardBase hasSelectionSkillCard) => default!; - private void EnableButtons(bool isUpdateEffectAndSprite) { } - private BattleCardBase GetCardAtMousePosition(Camera camera) => default!; - private IEnumerable GetTargetCards() => default!; public virtual bool CheckIsEnd() => default!; - protected void EnableTurnEndButton() { } - private bool UseDetailShortcut() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/ChoiceUtility.g.cs b/SVSim.BattleEngine/Shim/Generated/ChoiceUtility.g.cs index f7e8f9ae..b1a4531d 100644 --- a/SVSim.BattleEngine/Shim/Generated/ChoiceUtility.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ChoiceUtility.g.cs @@ -7,23 +7,13 @@ namespace Wizard.Battle.Touch { public partial class ChoiceUtility { - public const string SPRITE_UNSELECTED = "btn_common_02_m2_off"; - public const string SPRITE_SELECTED_NORMAL = "btn_common_02_m2_on"; - public const string SPRITE_SELECTED_PRESSED = "btn_common_02_m2_on"; - private const float EVOLUTION_CANCEL_ROTATION_TIME = 0.2f; - private static readonly Vector3 EVOLUTION_CANCEL_ROTATION_ANGLE; - private static readonly Vector3 CARD_DEFAULT_SCALE; - private const float CHANGE_SCALE_TIME = 0.3f; public static int GetNumberOfCardsToSelect(SkillBase choiceSkill) => default!; - public static int GetNumberOfCardsToSelect(BattleCardBase card, bool isEvolve) => default!; public static void ToggleChoiceButtonSprite(UIButton choiceButton, GameObject check, bool setActive, int numberOfCardsToSelect, bool isFusion = false, bool isComplete = false) { } public static void StopChoiceEffects(List choiceCards) { } - public static void PlayCancelEvolveChoiceAnimation(List choiceCards, BattleManagerBase battleMgr) { } public static bool DoesDuplicateCardNotExistInHand(BattleCardBase actingCard) => default!; public static bool DoesChoiceCardHaveSelectSkill(BattleCardBase choiceCard, SkillBase choiceSkill) => default!; public static void SetupActingChoiceCardToBePlayedFromQueue(BattleCardBase actingCard, BattleCardBase choiceCard, BattlePlayerBase battlePlayer, bool isChoiceBrave) { } public static void SetupChoiceCardForSkillTargetSelect(BattleCardBase choiceCard) { } - public static List CreateChoiceTokenCards(BattleCardBase actingCard, IBattlePlayerView playerBattleView, SkillBase choiceSkill, BattleManagerBase battleMgr) => default!; public static List SortSelectedChoiceCards(List allChoiceCards, List selectedChoiceCards) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/Class3dEvolveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/Class3dEvolveVfx.g.cs deleted file mode 100644 index fdbc90f3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/Class3dEvolveVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\Class3dEvolveVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class Class3dEvolveVfx -{ - public Class3dEvolveVfx(BattleCardBase card, IBattleResourceMgr resourceMgr) { } - protected bool IsCardFront(BattleCardBase card) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ClassCardVfxCreatorBase.g.cs b/SVSim.BattleEngine/Shim/Generated/ClassCardVfxCreatorBase.g.cs deleted file mode 100644 index f1e48b4e..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ClassCardVfxCreatorBase.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ClassCardVfxCreatorBase.cs -using System; -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.Player.ClassCharacter; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ClassCardVfxCreatorBase -{ - protected readonly ClassBattleCardViewBase _classBattleCardView; - protected readonly IBattlePlayerView _battleView; - private readonly System.Random _random; - private const int _maxRandValueS = 3; - private const int _maxRandValueL = 2; - private GameObject _leaderFrameMesh; - private const string _leaderFrameMeshName = "Class"; - private IStatusPanelControl StatusPanelControl { get; set; } - private GameObject LeaderFrameMesh { get; set; } - protected ClassCardVfxCreatorBase(bool isPlayer, BattleCardBase card, ClassBattleCardViewBase battleCardView, IBattlePlayerView battleView, IBattleResourceMgr resourceMgr) : base(isPlayer, card, battleCardView, resourceMgr) { } - public VfxBase CreateDamage(int damage, int currentHealth, int maxHealth, int baseHealth, bool isReflectedDamage, bool isSkillDamage) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateHealing(int healAmount, int currentHealth, int maxHealth, int baseHealth) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateCharacterPanelShake() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxBase CreateRetire(BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateReflectionStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateReflectionStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateProtectionStart(ProtectionColorType type) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateProtectionStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected virtual void SetupDamageVfxEvent(DamageVfx vfx) { } - private VfxBase DestroyClassAndClearAllEffectsVfx(BattlePlayerBase battlePlayerBase, bool isRetire) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ClassInfomationUIBase.g.cs b/SVSim.BattleEngine/Shim/Generated/ClassInfomationUIBase.g.cs deleted file mode 100644 index fcffa2be..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ClassInfomationUIBase.g.cs +++ /dev/null @@ -1,77 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\ClassInfomationUIBase.cs -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class ClassInfomationUIBase -{ - protected readonly Vector3 PLAYER_HANDCOUNT_POSITION; - protected readonly Vector3 PLAYER_CLASS_INFOMATION_POSITION_1; - protected readonly Vector3 PLAYER_CLASS_INFOMATION_POSITION_2; - protected readonly Vector3 PLAYER_CROSS_CLASS_INFORMATION_POSITION_1; - protected readonly Vector3 PLAYER_CROSS_CLASS_INFORMATION_POSITION_2; - private readonly Vector3 EVENT_PLAYER_CLASS_INFORMATION_POSITION_1; - private readonly Vector3 EVENT_PLAYER_CLASS_INFORMATION_POSITION_2; - private readonly Vector3 EVENT_PLAYER_CROSS_CLASS_INFORMATION_POSITION_1; - private readonly Vector3 EVENT_PLAYER_CROSS_CLASS_INFORMATION_POSITION_2; - private readonly Vector3 EVENT_ENEMY_CLASS_INFORMATION_POSITION; - private readonly Vector3 EVENT_ENEMY_CROSS_CLASS_INFORMATION_POSITION_1; - private readonly Vector3 EVENT_ENEMY_CROSS_CLASS_INFORMATION_POSITION_2; - protected readonly Vector3 ENEMY_HANDCOUNT_POSITION; - protected readonly Vector3 ENEMY_CLASS_INFORMATION_POSITION; - protected readonly Vector3 ENEMY_CROSS_CLASS_INFORMATION_POSITION_1; - protected readonly Vector3 ENEMY_CROSS_CLASS_INFORMATION_POSITION_2; - protected readonly int FIRST_HAND_COUNT; - protected readonly BattlePlayerBase _player; - protected IBattlePlayerView _selfBattlePlayerView; - protected readonly Vector3 PLAYER_ALERT_POSITION; - protected readonly Vector3 ENEMY_ALERT_POSITION; - protected readonly Vector3 PLAYER_ALERT_LABEL_POSITION; - protected readonly Vector3 ENEMY_ALERT_LABEL_POSITION; - protected readonly Vector2 ALERT_SIZE; - protected readonly Vector2 ALERT_LABEL_SIZE; - protected static readonly Color HAND_COUNT_S; - protected static readonly Color HAND_COUNT_M; - protected static readonly Color HAND_COUNT_L; - protected static readonly Vector3 DOUBLE_INFO_SCALE; - private const int HAND_CARD_WARNING_COLOR_BORDER = 7; - protected bool _isSelectNow; - protected bool _inCardFocus; - protected GameObject _infomationUI; - protected GameObject _alertObject; - protected UILabel _alertlabel; - protected UISprite _alertSprite; - protected GameObject _handCount; - protected UILabel _handCountLabel; - protected UISprite _handCountIcon; - protected WizardUIButton _informationButton; - protected int _orderNum; - protected int _totalInfoNum; - protected bool CanShowOtherInfo { get; set; } - public virtual GameObject GetInfomationUI() => default!; - public ClassInfomationUIBase(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, int orderNum, int totalInfoNum) { } - public virtual void ShowInfomation(bool playEffect = true) { } - public virtual void HideInfomation() { } - public virtual void HideOtherInfomation() { } - public virtual void HideAllInfomation() { } - public virtual void UpdateInfomation() { } - public void UpdateStatusPanelOnBattle(bool isPlayer) { } - public void SetClassInformationUiPosition(bool isPlayer) { } - protected Vector3 GetClassInfomationPosition(bool isPlayer) => default!; - protected virtual void ShowAlert() { } - protected virtual void HideAlert() { } - protected void AlertReset(string text) { } - public virtual VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual void SetUpEvent(BattlePlayerBase player) { } - public virtual void Recovery() { } - public static Color GetHandCardCountColor(int handCardCount) => default!; - private void UpdateHandCardCount(BattlePlayerBase battlePlayer) { } - public void SetIsSelect(bool flg) { } - public void SetInCardFocus(bool flg) { } - public virtual void SetTouchable(bool flag) { } - protected List SelectOtherInfoTarget(List cards) => default!; - public virtual void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ClassPage.g.cs b/SVSim.BattleEngine/Shim/Generated/ClassPage.g.cs index defe82bc..f96cfee0 100644 --- a/SVSim.BattleEngine/Shim/Generated/ClassPage.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ClassPage.g.cs @@ -5,30 +5,4 @@ using Cute; using UnityEngine; namespace Wizard.UI.Profile { -public partial class ClassPage -{ - private UIPanel _panel; - private TweenAlpha _tweenAlpha; - private GameObject _obj_skinChangeBtn; - private UILabel _label_skinChangeBtn; - private UILabel _label_headline_nextExp; - private UILabel _label_nextExp; - private UIGauge _sprite_expGauge; - private UILabel _label_headline_winNum; - private UILabel _label_winNum; - private GameObject _obj_itemListRoot; - private GameObject _partsClassPageItem; - private ProfileUI _mainScript; - private Dictionary _itemDict; - private bool _isDestory; - private void Awake() { } - public void Create(ProfileUI mainScript) { } - public void Init() { } - private void OnDestroy() { } - private void SetClassInfo(int classId) { } - public static string GetCharaTexName(int skinId) => default!; - public IEnumerator Final() => default!; - private void ResetImageSelection() { } - private bool IsDuringResetImageSelection() => default!; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/CommonPrefabContainer.g.cs b/SVSim.BattleEngine/Shim/Generated/CommonPrefabContainer.g.cs index cef25bcb..8e3740c0 100644 --- a/SVSim.BattleEngine/Shim/Generated/CommonPrefabContainer.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/CommonPrefabContainer.g.cs @@ -4,17 +4,8 @@ namespace Wizard.Story.ChapterSelection { public partial class CommonPrefabContainer { - private CharaInfoPanel _charaInfoPanelPrefab; - private SectionInfoPanel _sectionInfoPanelPrefab; - private AreaSelInfo _chapterRewardPanelPrefab; - private StoryChapterSelectDialog _subChapterSelectionDialogPrefab; - private StorySummaryDialog _summaryDialogPrefab; - private StoryLeaderSelectSummaryDialog _summaryWithCharaSelectionDialogPrefab; public CharaInfoPanel CharaInfoPanelPrefab { get; set; } public SectionInfoPanel SectionInfoPanelPrefab { get; set; } public AreaSelInfo ChapterRewardPanelPrefab { get; set; } - public StoryChapterSelectDialog SubChapterSelectionDialogPrefab { get; set; } - public StorySummaryDialog SummaryDialogPrefab { get; set; } - public StoryLeaderSelectSummaryDialog SummaryWithCharaSelectionDialogPrefab { get; set; } } } diff --git a/SVSim.BattleEngine/Shim/Generated/CostChangeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/CostChangeVfx.g.cs deleted file mode 100644 index 8a4c2529..00000000 --- a/SVSim.BattleEngine/Shim/Generated/CostChangeVfx.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\CostChangeVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class CostChangeVfx -{ - private const string COST_DOWN_EFFECT = "stt_act_costdown_1"; - private const string COST_DOWN_EFFECT_SE = "se_stt_act_costdown_1"; - private const string COST_UP_EFFECT = "stt_act_costup_1"; - private const string COST_UP_EFFECT_SE = "se_stt_act_costup_1"; - private const int LORD_ATOMY_ID = 101541020; - public CostChangeVfx(List targetList, bool isSpellCharge, List isCostUpList, bool isStop) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DamageVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DamageVfx.g.cs deleted file mode 100644 index 3fa6130e..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DamageVfx.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DamageVfx.cs -using System.Collections; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DamageVfx -{ - public const int STRONG_DAMAGE_VALUE = 7; - private const float KNOCKBACK_AMOUNT = 0.1f; - protected string _effectName { get; set; } - public DamageVfx(IBattleCardView targetCardView, int damage) : base(targetCardView) { } - protected Vector3 GetKnockbackDirection(IBattleCardView targetCardView) => default!; - protected void SetupNumberAnimation(int value) { } - private IEnumerator KnockbackByDamage(IBattleCardView cardView, float targetLocalY, float moveTime) => default!; - private float Interp(float[] pts, float t) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DamageVfxBase.g.cs b/SVSim.BattleEngine/Shim/Generated/DamageVfxBase.g.cs deleted file mode 100644 index 926b68c0..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DamageVfxBase.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DamageVfxBase.cs -using System; -using System.Collections; -using System.Collections.Generic; -using Cute; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DamageVfxBase -{ - private const float DAMAGE_ANIMATION_LENGTH = 2.5f; - private const float DAMAGE_TEXT_MARGIN = 0.26f; - private const int DAMAGE_MAX_VALUE = 9999; - private const int TEXTURE_SHEET_MAX = 16; - private const float PLAYER_CLASS_DAMAGE_EFFECT_POSITION = 0.4f; - private const float ENEMY_CLASS_DAMAGE_EFFECT_POSITION = 0.3f; - protected BattleManagerBase _battleMgr; - protected readonly IBattleCardView _targetCardView; - private GameObject _numberObject; - private GameObject _damageEffect; - private bool IsLoadEnd; - protected virtual Vector3 StartPosition { get; set; } - protected string _effectName { get; set; } - public bool IsEffectEnd { get; set; } - protected DamageVfxBase(IBattleCardView targetCardView) { } - protected IEnumerator StartShowValue(int value) => default!; - protected virtual void HideValue() { } - protected virtual void SetupNumberAnimation(int value) { } - public void UpdateEffect() { } - public void RemoveCheck() { } - public void DestroyEffect() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckChangeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckChangeVfx.g.cs deleted file mode 100644 index 23861a3a..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckChangeVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DeckChangeVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class DeckChangeVfx -{ - private readonly BattlePlayerBase battlePlayerBase; - public DeckChangeVfx(BattlePlayerBase battlePlayerBase) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckOutWinVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckOutWinVfx.g.cs deleted file mode 100644 index 5513fe7b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckOutWinVfx.g.cs +++ /dev/null @@ -1,18 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DeckOutWinVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DeckOutWinVfx -{ - public static readonly Vector3 CARD_EFFECT_POSITION; - private static readonly float MOVE_TIME; - private static readonly float EFFECT_TIME; - private static readonly float EFFECT_DELAY_TIME; - private static readonly float EFFECT_MOVE_TIME; - private static readonly string DECK_OUT_WIN_EFFECT; - private static readonly string DECK_OUT_EFFECT; - private static readonly string SE_DECK_OUT_WIN; - private static readonly Color CARD_COLOR; - public DeckOutWinVfx(BattlePlayerBase battlePlayer) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckSelectionConfirmDialogDisplay.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckSelectionConfirmDialogDisplay.g.cs deleted file mode 100644 index c185d487..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckSelectionConfirmDialogDisplay.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult\DeckSelectionConfirmDialogDisplay.cs -using Cute; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class DeckSelectionConfirmDialogDisplay -{ - public void Execute(Parameter param) { } - private void OnClickNextButton(Parameter param, bool? isPlayVoice) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckSelectionConfirmDialogDisplay__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckSelectionConfirmDialogDisplay__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs deleted file mode 100644 index 9b42128d..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckSelectionConfirmDialogDisplay__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.Main/DeckSelectionConfirmDialogDisplay.cs -using Cute; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class DeckSelectionConfirmDialogDisplay -{ - public void Execute(Parameter param) { } - private void OnClickNextButton(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckSelectionDialogDisplay.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckSelectionDialogDisplay.g.cs deleted file mode 100644 index ebccf70b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckSelectionDialogDisplay.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult\DeckSelectionDialogDisplay.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class DeckSelectionDialogDisplay -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckSelectionDialogDisplay__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckSelectionDialogDisplay__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs deleted file mode 100644 index fb6cbcaa..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckSelectionDialogDisplay__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.Main/DeckSelectionDialogDisplay.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class DeckSelectionDialogDisplay -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckSelfSummonVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckSelfSummonVfx.g.cs deleted file mode 100644 index 75137cb1..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DeckSelfSummonVfx.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DeckSelfSummonVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class DeckSelfSummonVfx -{ - private const float DECK_BRIGHT_TIME = 0.3f; - private static readonly string DECK_SUMMON_EFFECT_PATH; - private static readonly string DECK_BRIGHT_EFFECT_PATH; - private static readonly string DECK_SUMMON_SE_PATH; - private static readonly string DECK_BRIGHT_SE_PATH; - public DeckSelfSummonVfx(BattleCardBase card, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DeckTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckTouchProcessor.g.cs index 66c2e289..e6053f37 100644 --- a/SVSim.BattleEngine/Shim/Generated/DeckTouchProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/DeckTouchProcessor.g.cs @@ -6,9 +6,6 @@ namespace Wizard.Battle.Touch { public partial class DeckTouchProcessor { - private readonly IBattlePlayerView _battlePlayerView; - private readonly InputMgr _inputMgr; - private bool AlwaysShowStatusPanel { get; set; } public DeckTouchProcessor(IBattlePlayerView battlePlayerView, InputMgr inputMgr) { } public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); diff --git a/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs b/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs index 9ba381dc..86af6015 100644 --- a/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/DeckUpdateTask.g.cs @@ -5,13 +5,9 @@ public partial class DeckUpdateTask { public partial class DeckUpdateTaskParam { } public partial class DeckUpdateTaskParamWithSubClass { } - private const int IS_DECK_DELETE_OFF = 0; - private const int IS_DECK_DELETE_ON = 1; - private Format _updateDeckFormat; public AchievedInfo AchievedInfo { get; set; } public DeckUpdateTask() { } public void SetParameter(int deck_no, int class_id, int leader_skin_id, bool isRandomLeaderSkin, int[] leaderSkinIdList, long sleeve_id, string deck_name, bool is_delete, int[] card_id_array, Format format, string myRotationId) { } public void SetParameterWithSubClass(int deckNo, int classId, int subClassId, int leaderSkinId, bool isRandomLeaderSkin, int[] leaderSkinIdList, long sleeveId, string deckName, bool isDelete, int[] cardIdArray, Format format) { } - protected int Parse() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/DefaultOpeningVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DefaultOpeningVfx.g.cs deleted file mode 100644 index f4eeffd1..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DefaultOpeningVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DefaultOpeningVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class DefaultOpeningVfx -{ - public DefaultOpeningVfx(BackGroundBase backGround) : base(backGround) { } - public override void RegisterOpeningVfx(ClassBattleCardBase playerClass, ClassBattleCardBase enemyClass) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DelaySetupVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DelaySetupVfx.g.cs deleted file mode 100644 index 523f931f..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DelaySetupVfx.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DelaySetupVfx.cs -using System; -using System.Collections.Generic; -namespace Wizard.Battle.View.Vfx -{ -public partial class DelaySetupVfx -{ - private readonly Func _createVfx; - private VfxBase _vfx; - public bool IsEnd { get; set; } - public DelaySetupVfx(Func createVfx) { } - public void Update(float dt, List effectVfxList) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DestroyVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DestroyVfx.g.cs deleted file mode 100644 index 959ffdee..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DestroyVfx.g.cs +++ /dev/null @@ -1,18 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DestroyVfx.cs -using System.Linq; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class DestroyVfx -{ - public partial class FileNamePair { } - protected const float BANISH_WAIT_TIME = 0.4f; - protected readonly IBattleCardView _view; - protected readonly IBattleResourceMgr _resourceMgr; - public static FileNamePair CreateBanishFileNamePair(IBattleCardView battleCardView) => default!; - protected DestroyVfx(IBattleCardView view, IBattleResourceMgr resourceMgr) { } - protected VfxBase CreateUnloadResourceVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected FileNamePair GetDestroyEffectFileNames(BattleCardBase.DeathTypeInformation deathTypes, IBattleCardView battleCardView) => default!; - protected void PlayDestroySE(BattleCardBase.DeathTypeInformation deathTypes) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DestroyVfx_FileNamePair.g.cs b/SVSim.BattleEngine/Shim/Generated/DestroyVfx_FileNamePair.g.cs deleted file mode 100644 index 098699e4..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DestroyVfx_FileNamePair.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DestroyVfx.cs -using System.Linq; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class DestroyVfx -{ -public partial class FileNamePair -{ - public string ObjectFileName { get; set; } - public string SeFileName { get; set; } - public FileNamePair(string baseName) { } - public FileNamePair(string objectFileName, string seFileName) { } -} -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DialogContactMenu.g.cs b/SVSim.BattleEngine/Shim/Generated/DialogContactMenu.g.cs deleted file mode 100644 index dcd1a958..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DialogContactMenu.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.UI.Dialog\DialogContactMenu.cs -using UnityEngine; -using Wizard.UI.ReportToManagement; -namespace Wizard.UI.Dialog -{ -public partial class DialogContactMenu -{ - private DialogBase _dialog; - private UIButton _deleteAccountButton; - private void Start() { } - public void SetDialog(DialogBase dialog) { } - public void OnBtnContact() { } - public void OnBtnReport() { } - private void OnClickDeleteAccountButton() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallenge.g.cs b/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallenge.g.cs index cc9326b0..4446ea42 100644 --- a/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallenge.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallenge.g.cs @@ -5,8 +5,6 @@ namespace Wizard.UI.Dialog { public partial class DialogSpeedChallenge { - private UILabel _label; - private UITexture _texture; public void SetText(string text) { } public void SetTexture(string name) { } } diff --git a/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallengeResult.g.cs b/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallengeResult.g.cs index 0b30d9a6..16c73530 100644 --- a/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallengeResult.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/DialogSpeedChallengeResult.g.cs @@ -5,14 +5,9 @@ namespace Wizard.UI.Dialog { public partial class DialogSpeedChallengeResult { - private UILabel _rank; - private UILabel _text; - private string _url; - private const int RANK_TEXT_START_ID = 4; public void SetRankText(string text) { } public void SetRankWithNumber(int rank) { } public void SetText(string text) { } public void SetUrl(string url) { } - public void OpenBrowser() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/Download.g.cs b/SVSim.BattleEngine/Shim/Generated/Download.g.cs deleted file mode 100644 index 10493fb4..00000000 --- a/SVSim.BattleEngine/Shim/Generated/Download.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult\Download.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class Download -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DownloadConfirmDialogDisplay.g.cs b/SVSim.BattleEngine/Shim/Generated/DownloadConfirmDialogDisplay.g.cs deleted file mode 100644 index 03908ad3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DownloadConfirmDialogDisplay.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.Main\DownloadConfirmDialogDisplay.cs -using Cute; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class DownloadConfirmDialogDisplay -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DownloadInfoGetter.g.cs b/SVSim.BattleEngine/Shim/Generated/DownloadInfoGetter.g.cs deleted file mode 100644 index 14d9e0f1..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DownloadInfoGetter.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult\DownloadInfoGetter.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class DownloadInfoGetter -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DownloadInfoGetter__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs b/SVSim.BattleEngine/Shim/Generated/DownloadInfoGetter__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs deleted file mode 100644 index 19d0f85b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DownloadInfoGetter__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.Main/DownloadInfoGetter.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class DownloadInfoGetter -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DragonInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/DragonInfomationUI.g.cs deleted file mode 100644 index 90b94edc..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DragonInfomationUI.g.cs +++ /dev/null @@ -1,24 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\DragonInfomationUI.cs -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class DragonInfomationUI -{ - private UILabel _label1; - private UILabel _label2; - private GameObject _chainSprite; - public DragonInfomationUI(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(battlePlayerBase, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private void UpdateAwakeCount() { } - public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DrawSpecialTokenVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DrawSpecialTokenVfx.g.cs deleted file mode 100644 index e951eef8..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DrawSpecialTokenVfx.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DrawSpecialTokenVfx.cs -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DrawSpecialTokenVfx -{ - private static readonly float TURN_TIME; - private static readonly float END_MOVE_TIME; - public static readonly Vector3 CARD_EFFECT_ROTATION; - private static readonly float CARD_ROTATE_Y; - public DrawSpecialTokenVfx(List beforeTransformDrawList, List afterTransformDrawList, VfxBase spawnEffectVfx, BattlePlayerBase selfBattlePlayer, SkillBase skill, float beforeTransformWaitTime = 0f, float afterTransformWaitTime = 0.2f, string effectPath = "cmn_token_draw_1") { } - public static VfxBase TokenTransform(List beforeTransformDrawList, List afterTransformDrawList, float beforeTransformWaitTime, float afterTransformWaitTime, string effectPath, SkillBase skill) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DrawTokenVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DrawTokenVfx.g.cs deleted file mode 100644 index 1168a025..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DrawTokenVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DrawTokenVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DrawTokenVfx -{ - private const float HAND_REARRANGE_TIME = 0.3f; - protected float GetRotationYLastToken { get; set; } - public DrawTokenVfx(List drawList, VfxBase spawnEffectVfx, BattlePlayerBase selfBattlePlayer, bool isVisible) { } - public static VfxBase CreateAddTokensToHandVfx(List drawList, BattlePlayerBase selfBattlePlayer, VfxBase destroyVfx) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DummyDeckChangeCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DummyDeckChangeCardVfx.g.cs deleted file mode 100644 index 41794491..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DummyDeckChangeCardVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DummyDeckChangeCardVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DummyDeckChangeCardVfx -{ - private readonly bool m_isPlayer; - private readonly int _changeCount; - public DummyDeckChangeCardVfx(bool isPlayer, int changeCount) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/DummyDeckRemoveCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/DummyDeckRemoveCardVfx.g.cs deleted file mode 100644 index c4183a70..00000000 --- a/SVSim.BattleEngine/Shim/Generated/DummyDeckRemoveCardVfx.g.cs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\DummyDeckRemoveCardVfx.cs -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class DummyDeckRemoveCardVfx -{ - private readonly bool _isPlayer; - private readonly int m_num; - public DummyDeckRemoveCardVfx(bool isPlayer, int num) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EffectBattleVfxBase.g.cs b/SVSim.BattleEngine/Shim/Generated/EffectBattleVfxBase.g.cs deleted file mode 100644 index 2fda2ee3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EffectBattleVfxBase.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EffectBattleVfxBase.cs -using System; -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class EffectBattleVfxBase -{ - protected readonly EffectBattle _effect; - protected readonly IBattleCardView _cardView; - protected readonly GameObject _effectObject; - protected readonly IBattleResourceMgr _resourceMgr; - protected readonly Func _getTargetPositionFunc; - protected Animation _animationObj; - protected EffectBattleVfxBase(EffectBattle effect, IBattleCardView cardView, IBattleResourceMgr resourceMgr, Func getTargetPositionFunc) { } - protected VfxBase CreateStartTweenVfx(EffectMgr.MoveType moveType, EffectMgr.TargetType targetType, Func startPosition, float animationTime, bool isPlayer, IBattleCardView targetCardView = null) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase CreatePlayVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase CreateAnimationAfterVfx(EffectMgr.MoveType moveType) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ElfInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/ElfInfomationUI.g.cs deleted file mode 100644 index 379defd1..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ElfInfomationUI.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\ElfInfomationUI.cs -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class ElfInfomationUI -{ - private UILabel _playCountLabel; - public ElfInfomationUI(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(battlePlayerBase, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public void UpdateInfomation() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private VfxBase UpdatePlayCount(BattlePlayerBase battlePlayer, bool isTurnEnd = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EmotionHideMessageVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EmotionHideMessageVfx.g.cs deleted file mode 100644 index 9facf22b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EmotionHideMessageVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Touch\EmotionHideMessageVfx.cs -using Wizard.Battle.Resource; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.Touch -{ -public partial class EmotionHideMessageVfx -{ - public EmotionHideMessageVfx(IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EnemyClassBattleCardView.g.cs b/SVSim.BattleEngine/Shim/Generated/EnemyClassBattleCardView.g.cs index a22e38a8..6afc393d 100644 --- a/SVSim.BattleEngine/Shim/Generated/EnemyClassBattleCardView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/EnemyClassBattleCardView.g.cs @@ -7,15 +7,7 @@ namespace Wizard.Battle.View { public partial class EnemyClassBattleCardView { - private static readonly Vector3 ENEMY_FORECASTICON_POS; - private readonly PlayerClassCharacter _classCharacter; public IClassCharacter ClassCharacter { get; set; } - public float OriginalRootYPosition { get; set; } public EnemyClassBattleCardView(BuildInfo buildInfo) : base(buildInfo) { } // HEADLESS-FIX (M-HC-4a): chain BuildInfo so the leader view's CardInfo resolves (attack-on-leader targetting) - public void StartOutFrame() { } - public void StartIntoFrame() { } - public float GetCurrentClipTime() => default!; - public bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType) => default!; - public void ClearSpineObject() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/EnemyClassCardVfxCreator.g.cs b/SVSim.BattleEngine/Shim/Generated/EnemyClassCardVfxCreator.g.cs deleted file mode 100644 index 3aa6ddb3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EnemyClassCardVfxCreator.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EnemyClassCardVfxCreator.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class EnemyClassCardVfxCreator -{ - public EnemyClassCardVfxCreator(ClassBattleCardViewBase battleCardView, BattleCardBase card, IBattlePlayerView battleView, IBattleResourceMgr resourceMgr) : base(isPlayer: false, card, battleCardView, battleView, resourceMgr) { } - protected void SetupDamageVfxEvent(DamageVfx vfx) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EnemyDeckOutVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EnemyDeckOutVfx.g.cs deleted file mode 100644 index 7e178044..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EnemyDeckOutVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EnemyDeckOutVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class EnemyDeckOutVfx -{ - private BattleEnemy _battleEnemy; - private BattleManagerBase _battleMgr; - public EnemyDeckOutVfx(BattleEnemy battleEnemy, BattleManagerBase battleMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EnemyMulliganDrawVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EnemyMulliganDrawVfx.g.cs deleted file mode 100644 index b427ca42..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EnemyMulliganDrawVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EnemyMulliganDrawVfx.cs -using System.Collections.Generic; -namespace Wizard.Battle.View.Vfx -{ -public partial class EnemyMulliganDrawVfx -{ - public EnemyMulliganDrawVfx(IEnumerable drawCards, bool isHideCard) : base(drawCards) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EnemyMulliganSwapVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EnemyMulliganSwapVfx.g.cs deleted file mode 100644 index 85beaf93..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EnemyMulliganSwapVfx.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EnemyMulliganSwapVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class EnemyMulliganSwapVfx -{ - private IList m_changeList; - private IList m_PosIndexList; - private const float SCREEN_WIDTH = 800f; - private IList m_drawCards; - private const float CARD_SORT_OFFSET = 220f; - private const float FIRST_CARD_POSITION_X = 180f; - private const float CARD_POSITION_Y = 500f; - private const float CARD_POSITION_Z = -50f; - private static readonly Vector3 CARD_ROTATION; - public EnemyMulliganSwapVfx(IList newCards, IList posList, IList oldCards) { } - private void PrepareBuryCard() { } - private void PrepareDrawCard() { } - private VfxBase BuryAndDrawVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase ReturnOldCardsVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase MoveCardBackToDeck(IBattleCardView view) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EpChangeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EpChangeVfx.g.cs deleted file mode 100644 index 513edc98..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EpChangeVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EpChangeVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class EpChangeVfx -{ - public EpChangeVfx(BattlePlayerBase battlePlayer, int oldUsableEpAmount, int newUsableEpAmount, int maxEp) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EvolutionConfirmation.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolutionConfirmation.g.cs index fc09bcdf..eb39b7b7 100644 --- a/SVSim.BattleEngine/Shim/Generated/EvolutionConfirmation.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/EvolutionConfirmation.g.cs @@ -5,11 +5,7 @@ namespace Wizard.Battle.UI { public partial class EvolutionConfirmation { - private DialogBase _dialog; - public bool IsPossibleToClose { get; set; } - public GameObject ConfirmationButton { get; set; } public EvolutionConfirmation(Transform parent) { } public DialogBase Show(BattlePlayer battlePlayer) => default!; - private VfxBase Hide() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); } } diff --git a/SVSim.BattleEngine/Shim/Generated/EvolutionHideMessageVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolutionHideMessageVfx.g.cs deleted file mode 100644 index cf7afe93..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EvolutionHideMessageVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Touch\EvolutionHideMessageVfx.cs -using Wizard.Battle.Resource; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.Touch -{ -public partial class EvolutionHideMessageVfx -{ - public EvolutionHideMessageVfx(BattleManagerBase battleMgr, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs index e7cf71ef..d638c8f3 100644 --- a/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/EvolutionTouchProcessor.g.cs @@ -11,26 +11,11 @@ namespace Wizard.Battle.Touch { public partial class EvolutionTouchProcessor { - private readonly BattleManagerBase _battleMgr; - private readonly BattlePlayer _battlePlayer; - private readonly IEnumerable _targetCards; - private GameObject _lastFocusedObject; - private BattleCardBase _lastFocusedCard; - private InputMgr _inputMgr; - private IBattleResourceMgr _resourceMgr; - private bool _isForceEnd; - private bool _isDetailPanelEvolution; public Func OnAfterEvolveDragSelect; - private bool _stopSelectFlag; - private List _selectSkills; - private readonly Prediction _prediction; - private readonly Func, List, bool, SkillTargetSelectTouchProcessor> _getSkillTargetSelectTouchProcessorFunc; public EvolutionTouchProcessor(BattleManagerBase battleMgr, InputMgr inputMgr, IBattleResourceMgr resourceMgr, bool inDetailPanelEvolution, Func, List, bool, SkillTargetSelectTouchProcessor> getSkillTargetSelectTouchProcessorFunc, Prediction prediction) { } public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxWith End() => default!; - protected VfxBase CreateEvolutionSelectEndVfx(BattleCardBase targetCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private BattleCardBase GetBattleCardFromObject(GameObject cardObject) => default!; public virtual VfxBase ShowEvolutionMessage() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public virtual bool CheckIsEnd() => default!; public void SetStopSelectFlag() { } diff --git a/SVSim.BattleEngine/Shim/Generated/EvolveImageChangeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolveImageChangeVfx.g.cs deleted file mode 100644 index d18dd744..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EvolveImageChangeVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EvolveImageChangeVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class EvolveImageChangeVfx -{ - public EvolveImageChangeVfx(BattleCardBase card, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EvolveNameChangeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolveNameChangeVfx.g.cs deleted file mode 100644 index d24d69bc..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EvolveNameChangeVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EvolveNameChangeVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class EvolveNameChangeVfx -{ - public EvolveNameChangeVfx(BattleCardBase card) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EvolveUnitMaskCardInPlayVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolveUnitMaskCardInPlayVfx.g.cs deleted file mode 100644 index 62f2a582..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EvolveUnitMaskCardInPlayVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EvolveUnitMaskCardInPlayVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class EvolveUnitMaskCardInPlayVfx -{ - private readonly IBattleCardView _cardView; - private readonly bool _setParticleShader; - public EvolveUnitMaskCardInPlayVfx(IBattleCardView cardView, bool setParticleShader = true) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/EvolveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/EvolveVfx.g.cs deleted file mode 100644 index 1855f941..00000000 --- a/SVSim.BattleEngine/Shim/Generated/EvolveVfx.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\EvolveVfx.cs -using Cute; -using UnityEngine; -using Wizard.Battle.Resource; -using Wizard.Battle.UI; -namespace Wizard.Battle.View.Vfx -{ -public partial class EvolveVfx -{ - private readonly float SHOW_EMOTION_TIME; - private CanNotTouchCardVfx _canNotTouchCardVfx; - private bool _isSelfTurn; - protected virtual bool IsCardFront(BattleCardBase card) => default!; - public EvolveVfx(BattleCardBase card, IBattleResourceMgr resourceMgr, bool isNotConsumeEp = false) { } - private void ToggleTouchable(bool on) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/FallToGroundVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/FallToGroundVfx.g.cs deleted file mode 100644 index 0fa98337..00000000 --- a/SVSim.BattleEngine/Shim/Generated/FallToGroundVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\FallToGroundVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class FallToGroundVfx -{ - public FallToGroundVfx(GameObject cardGameObject) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/FieldBattleCardView.g.cs b/SVSim.BattleEngine/Shim/Generated/FieldBattleCardView.g.cs index dfde9f61..607c8b6e 100644 --- a/SVSim.BattleEngine/Shim/Generated/FieldBattleCardView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/FieldBattleCardView.g.cs @@ -7,15 +7,6 @@ namespace Wizard.Battle.View { public partial class FieldBattleCardView { - public GameObject ChantCountIcon { get; set; } public FieldBattleCardView(BuildInfo buildInfo) : base(buildInfo) { } - public void InitializeVoiceInfo(int cardID) { } - public VfxBase LoadResource() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase GetResourcePathes(List resourceInfos) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void UpdateParameterView(int offence, int life, int cost, string name, bool isOnField, bool isRecovery = false, bool useNormalCost = false) { } - public void UpdateOffence(int offence) { } - public void UpdateLife(int life) { } - public VfxBase ResetCardView(CardParameter baseParameter) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetTillingAndOffset(Vector2 tilling, Vector2 offset) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/FieldCardVfxCreator.g.cs b/SVSim.BattleEngine/Shim/Generated/FieldCardVfxCreator.g.cs deleted file mode 100644 index 6c1f83f8..00000000 --- a/SVSim.BattleEngine/Shim/Generated/FieldCardVfxCreator.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\FieldCardVfxCreator.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class FieldCardVfxCreator -{ - public FieldCardVfxCreator(bool isPlayer, BattleCardBase card, IBattleCardView battleCardView, IBattleResourceMgr resourceMgr) : base(isPlayer, card, battleCardView, resourceMgr) { } - public VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateMaskCardInPlay() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/FieldMaskCardInPlayVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/FieldMaskCardInPlayVfx.g.cs deleted file mode 100644 index ac6c7fd2..00000000 --- a/SVSim.BattleEngine/Shim/Generated/FieldMaskCardInPlayVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\FieldMaskCardInPlayVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class FieldMaskCardInPlayVfx -{ - private readonly IBattleCardView _cardView; - public FieldMaskCardInPlayVfx(IBattleCardView cardView) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ForecastBanishIconAttachVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ForecastBanishIconAttachVfx.g.cs deleted file mode 100644 index 143a463b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ForecastBanishIconAttachVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ForecastBanishIconAttachVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ForecastBanishIconAttachVfx -{ - public const string ICON = "forecast_banish"; - protected string ResourcePath { get; set; } - protected string FORECAST_ICON_NAME { get; set; } - public ForecastBanishIconAttachVfx(IBattleCardView view, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ForecastDamageIconAttachVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ForecastDamageIconAttachVfx.g.cs deleted file mode 100644 index b9a5bce0..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ForecastDamageIconAttachVfx.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ForecastDamageIconAttachVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ForecastDamageIconAttachVfx -{ - public const string ICON = "forecast_damage"; - private readonly int _damage; - protected string ResourcePath { get; set; } - protected string FORECAST_ICON_NAME { get; set; } - public ForecastDamageIconAttachVfx(int damage, IBattleCardView view, IBattleResourceMgr resourceMgr) { } - protected void Setup(GameObject iconObject) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ForecastDeathIconAttachVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ForecastDeathIconAttachVfx.g.cs deleted file mode 100644 index c6bee9d5..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ForecastDeathIconAttachVfx.g.cs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ForecastDeathIconAttachVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ForecastDeathIconAttachVfx -{ - public const string ICON = "forecast_death"; - private const float FIELD_OFFSET = 5f; - protected string ResourcePath { get; set; } - protected string FORECAST_ICON_NAME { get; set; } - public ForecastDeathIconAttachVfx(IBattleCardView view, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ForecastIconVfxBase.g.cs b/SVSim.BattleEngine/Shim/Generated/ForecastIconVfxBase.g.cs deleted file mode 100644 index 6454e8b9..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ForecastIconVfxBase.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ForecastIconVfxBase.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ForecastIconVfxBase -{ - protected readonly IBattleCardView _view; - public const float OFFSET_Z = -0.1f; - protected string FORECAST_ICON_NAME { get; set; } - protected string ResourcePath { get; set; } - protected ForecastIconVfxBase(IBattleCardView view, IBattleResourceMgr resourceMgr) { } - protected virtual void Setup(GameObject iconObject) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ForecastRandomSkillUseCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ForecastRandomSkillUseCardVfx.g.cs deleted file mode 100644 index f61b90e3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ForecastRandomSkillUseCardVfx.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ForecastRandomSkillUseCardVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ForecastRandomSkillUseCardVfx -{ - public const string ICON = "forecast_random"; - private const float FIELD_OFFSET = 35f; - protected string ResourcePath { get; set; } - protected string FORECAST_ICON_NAME { get; set; } - public ForecastRandomSkillUseCardVfx(IBattleCardView view, IBattleResourceMgr resourceMgr) { } - public static ForecastRandomSkillUseCardVfx Create(IBattleCardView view, IBattleResourceMgr resourceMgr) => default!; - protected void Setup(GameObject iconObject) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ForecastRandomSkillUseMessageVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ForecastRandomSkillUseMessageVfx.g.cs deleted file mode 100644 index cabfa471..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ForecastRandomSkillUseMessageVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ForecastRandomSkillUseMessageVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ForecastRandomSkillUseMessageVfx -{ - public ForecastRandomSkillUseMessageVfx(IBattleResourceMgr resourceMgr) { } - public static ForecastRandomSkillUseMessageVfx Create(IBattleResourceMgr resourceMgr) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/Friend_PlayerData.g.cs b/SVSim.BattleEngine/Shim/Generated/Friend_PlayerData.g.cs index a9c62d85..0a950b4d 100644 --- a/SVSim.BattleEngine/Shim/Generated/Friend_PlayerData.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/Friend_PlayerData.g.cs @@ -13,22 +13,12 @@ public partial class Friend public partial class PlayerData { public int ViewerId; - public int ApplyId; - public string Name; public long EmblemId; public int DegreeId; public int Rank; public string Country; - public DateTime ApplyTime; - public DateTime ApplyReceivedTime; - public DateTime BattleTime; - public DateTime TaskTime; public bool isFriend; - public bool isFriendApply; - public bool isFriendApplyRecived; - public BattleParameter BattleParameter; public bool IsSameGuildMember { get; set; } - public int MissionType { get; set; } public PlayerData(string in_Name, long in_EmblemId, int in_DegreeId, int in_Rank, string in_Country) { } public void Copy(UserFriend src) { } } diff --git a/SVSim.BattleEngine/Shim/Generated/FusionSimpleProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/FusionSimpleProcessor.g.cs index d1d7ea49..3024f372 100644 --- a/SVSim.BattleEngine/Shim/Generated/FusionSimpleProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/FusionSimpleProcessor.g.cs @@ -4,17 +4,4 @@ using Wizard.Battle.UI; using Wizard.Battle.View.Vfx; namespace Wizard.Battle.Touch { -public partial class FusionSimpleProcessor -{ - private BattleManagerBase _battleMgr; - private BattleCardBase _card; - private SkillBase _selectSkill; - private Skill_fusion_metamorphose _fusionMetamorphoseSkill; - private ITouchProcessor _nextProcessor; - public FusionSimpleProcessor(BattleManagerBase battleMgr, BattleCardBase card, SkillBase fusionSkill, Skill_fusion_metamorphose fusionMetamorphoseSkill) { } - public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxWith End() => default!; - public virtual bool CheckIsEnd() => default!; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/FusionTargetSelectTouchProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/FusionTargetSelectTouchProcessor.g.cs index b4738355..4c531c54 100644 --- a/SVSim.BattleEngine/Shim/Generated/FusionTargetSelectTouchProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/FusionTargetSelectTouchProcessor.g.cs @@ -6,41 +6,4 @@ using Wizard.Battle.UI; using Wizard.Battle.View.Vfx; namespace Wizard.Battle.Touch { -public partial class FusionTargetSelectTouchProcessor -{ - protected readonly BattleCardBase _actCard; - protected readonly InputMgr _inputMgr; - protected readonly BattlePlayer _battlePlayer; - protected bool _isSelectNow; - private readonly BattleManagerBase _battleManager; - private IEnumerable _targetCards; - private IEnumerable _targetCardObjects; - private bool _stopSelectFlag; - private SkillBase _fusionSkill; - private Skill_fusion_metamorphose _fusionMetamorphoseSkill; - private List _selectedCards; - private bool _selectCompleteFlag; - private int _needSelectCount; - private int _maxSelectCount; - private List _selectableCards; - private BattleUIContainer _battleUIContainer; - private const float CANCEL_TOUCHABLE_WAIT_TIME = 0.2f; - public static readonly Vector3 INIT_LOCAL_EULAR_ANGLE; - private CanNotTouchCardVfx _canNotTouchCardVfx; - private bool _isNoSelectFusion; - protected bool IsSelectNow { get; set; } - public FusionTargetSelectTouchProcessor(BattleManagerBase battleMgr, BattleCardBase actCard, SkillBase fusionSkill, Skill_fusion_metamorphose fusionMetamorphoseSkill) { } - public static FusionTargetSelectTouchProcessor Create(BattleManagerBase battleMgr, BattleCardBase actCard, SkillBase fusionSkill, Skill_fusion_metamorphose fusionMetamorphoseSkill) => default!; - public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private void ChangeSelectFusionIngredientCard(BattleCardBase selectedCard, bool isSelect) { } - private BattleCardBase GetCardAtMousePosition(Camera camera) => default!; - private bool IsSelect() => default!; - private VfxBase MakeTouchEffect(BattleCardBase targetCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public virtual VfxWith End() => default!; - protected virtual void SetTouchable(bool enable) { } - public virtual bool CheckIsEnd() => default!; - private IEnumerable GetTargetCards() => default!; - protected void EnableTurnEndButton(bool showEffect) { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/FusionWaitProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/FusionWaitProcessor.g.cs index 8fc6a9de..f5542a18 100644 --- a/SVSim.BattleEngine/Shim/Generated/FusionWaitProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/FusionWaitProcessor.g.cs @@ -9,13 +9,6 @@ namespace Wizard.Battle.Touch { public partial class FusionWaitProcessor { - private bool _isOpenDialog; - private bool _isOkClicked; - private CanNotTouchCardVfx _canNotTouchVfx; - private DialogBase _dialog; public FusionWaitProcessor(BattleManagerBase battleMgr, BattleCardBase actCard, List selectSkills, Prediction prediction, Func, List, bool, SkillTargetSelectTouchProcessor> getSkillTargetSelectTouchProcessorFunc) : base(battleMgr, actCard, selectSkills, prediction, getSkillTargetSelectTouchProcessorFunc) { } - public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public bool CheckIsEnd() => default!; - public VfxWith End() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/GameObjMgr.g.cs b/SVSim.BattleEngine/Shim/Generated/GameObjMgr.g.cs index d2340805..5db7f760 100644 --- a/SVSim.BattleEngine/Shim/Generated/GameObjMgr.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/GameObjMgr.g.cs @@ -4,34 +4,11 @@ using UnityEngine; using Wizard; public partial class GameObjMgr { - private GameObject m_GameObj; - private GameObject m_UIContainer; - private Camera m_UIContainerCamera; - private GameObject m_SubUIContainer; - private Camera m_SubUICam; - private GameObject m_CameraContainer; - private IList m_AddedUIGameObj; public GameObjMgr(GameObject GameObj) { } - public void CreateUIContainer() { } public void DisposeUIGameObj() { } - public GameObject AddBattleUIContainerChild(GameObject g) => default!; - public GameObject AddUIContainerChild(GameObject GameObj) => default!; public GameObject AddUIContainerChildPrefab(string str) => default!; - public GameObject AddUIContainerChildPrefab(GameObject GameObj) => default!; - public GameObject AddSubUIContainerChild(GameObject GameObj) => default!; - public GameObject AddSubUIContainerChildPrefab(string str) => default!; - public GameObject AddSubUIContainerChildPrefab(GameObject GameObj) => default!; - public GameObject AddCameraContainerChild(GameObject GameObj) => default!; - public GameObject AddCameraContainerChildPrefab(string str) => default!; - public GameObject AddUIManagerChildPrefab(GameObject gobj) => default!; - public GameObject AddUIManagerChildPrefab(string str) => default!; - public NguiObjs AddUIManagerChildPrefab(NguiObjs gobj) => default!; - public GameObject AddUIManagerRootChildPrefab(GameObject gobj) => default!; public GameObject AddUIManagerRootChildPrefab(string str) => default!; - public GameObject GetGameObj() => default!; public GameObject GetUIContainer() => default!; public Camera GetUIContainerCam() => default!; public GameObject GetSubUIContainer() => default!; - public Camera GetSubUICamera() => default!; - public GameObject GetCameraContainer() => default!; } diff --git a/SVSim.BattleEngine/Shim/Generated/GameSetup.g.cs b/SVSim.BattleEngine/Shim/Generated/GameSetup.g.cs index 3cc0f3fa..03ba764a 100644 --- a/SVSim.BattleEngine/Shim/Generated/GameSetup.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/GameSetup.g.cs @@ -5,15 +5,4 @@ using System.Linq; using UnityEngine; namespace Wizard.Title { -public partial class GameSetup -{ - private TemporaryAssetDeleter _temporaryAssetDeleter; - private UserInfoRequest m_userInfoRequest; - private ResourceDownloader m_assetDownloader; - private readonly BattleRecovery _battleRecovery; - private MonoBehaviour m_coroutineObj; - public bool IsRunning { get; set; } - public GameSetup(MonoBehaviour coroutineObj) { } - public IEnumerator StartSetup() => default!; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/GetDeckDataFromCode.g.cs b/SVSim.BattleEngine/Shim/Generated/GetDeckDataFromCode.g.cs index 0cd82c8d..b1346521 100644 --- a/SVSim.BattleEngine/Shim/Generated/GetDeckDataFromCode.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/GetDeckDataFromCode.g.cs @@ -1,12 +1,4 @@ // AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\DeckBuilder\GetDeckDataFromCode.cs namespace DeckBuilder { -public partial class GetDeckDataFromCode -{ - public int ClanId; - public int SubClanId; - public bool IsSubClanSet; - public int[] CardIds; - public string MyRotationId; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/HandCardFrameEffectControl.g.cs b/SVSim.BattleEngine/Shim/Generated/HandCardFrameEffectControl.g.cs index 80f6318d..fd78f687 100644 --- a/SVSim.BattleEngine/Shim/Generated/HandCardFrameEffectControl.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/HandCardFrameEffectControl.g.cs @@ -1,4 +1,8 @@ // AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View\HandCardFrameEffectControl.cs +// TODO(engine-cleanup-pass2): 5 of 6 methods unrun in baseline +// Type: Wizard.Battle.View.HandCardFrameEffectControl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + using System; using UnityEngine; namespace Wizard.Battle.View @@ -6,15 +10,7 @@ namespace Wizard.Battle.View public partial class HandCardFrameEffectControl { public partial struct FrameEffectData { } - private static readonly FrameEffectData[] FRAME_EFFECT_DATA; - private const float FRAME_PLAYBACK_SPEED_NORMAL = 0.5f; - private const float FRAME_PLAYBACK_SPEED_ADDED_EFFECT = 1f; - private Func _funcGetFrameEffectType; - public HandCardFrameEffectType CurrentFrameEffectType { get; set; } public HandCardFrameEffectControl(Func func) { } - public void Show(GameObject root, HandCardFrameEffectType type = HandCardFrameEffectType.NULL) { } - public void Hide(GameObject root) { } - private void InitializeParticle(GameObject root, HandCardFrameEffectType type) { } public static HandCardFrameEffectType[] ToStrFrameEffect(string str) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/HandEffectLoopEndVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/HandEffectLoopEndVfx.g.cs deleted file mode 100644 index 6b27dc1c..00000000 --- a/SVSim.BattleEngine/Shim/Generated/HandEffectLoopEndVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\HandEffectLoopEndVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class HandEffectLoopEndVfx -{ - private readonly IBattleCardView _view; - public HandEffectLoopEndVfx(IBattleCardView view) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/HandEffectLoopStartVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/HandEffectLoopStartVfx.g.cs deleted file mode 100644 index aa8fc548..00000000 --- a/SVSim.BattleEngine/Shim/Generated/HandEffectLoopStartVfx.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\HandEffectLoopStartVfx.cs -using System; -namespace Wizard.Battle.View.Vfx -{ -public partial class HandEffectLoopStartVfx -{ - public enum HandEffectType - { - SpellCharge - } - private readonly IBattleCardView _view; - private readonly Func _getIsActionCard; - private readonly HandEffectType _type; - public HandEffectLoopStartVfx(IBattleCardView view, Func getIsActionCard, HandEffectType type) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/HideForecastRandomSkillUseMessageVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/HideForecastRandomSkillUseMessageVfx.g.cs deleted file mode 100644 index 022df7a7..00000000 --- a/SVSim.BattleEngine/Shim/Generated/HideForecastRandomSkillUseMessageVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\HideForecastRandomSkillUseMessageVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class HideForecastRandomSkillUseMessageVfx -{ - public HideForecastRandomSkillUseMessageVfx() { } - public static HideForecastRandomSkillUseMessageVfx Create() => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/HighRankEvolveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/HighRankEvolveVfx.g.cs deleted file mode 100644 index 599467f8..00000000 --- a/SVSim.BattleEngine/Shim/Generated/HighRankEvolveVfx.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\HighRankEvolveVfx.cs -using Cute; -using UnityEngine; -using Wizard.Battle.Resource; -using Wizard.Battle.UI; -namespace Wizard.Battle.View.Vfx -{ -public partial class HighRankEvolveVfx -{ - private readonly float SHOW_EMOTION_TIME; - private readonly Vector3 EFFECT_POSITION_OFFSET; - private CanNotTouchCardVfx _canNotTouchCardVfx; - private bool _isSelfTurn; - public HighRankEvolveVfx(BattleCardBase card, IBattleResourceMgr resourceMgr, bool isNotConsumeEp = false) { } - private void ToggleTouchable(bool on) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ICardVfxCreator.g.cs b/SVSim.BattleEngine/Shim/Generated/ICardVfxCreator.g.cs deleted file mode 100644 index 4adf2f08..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ICardVfxCreator.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ICardVfxCreator.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial interface ICardVfxCreator -{ - VfxBase CreateDraw(Vector3 pos, bool isCardRare); - VfxBase CreatePick(); - VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase); - VfxBase CreateDestroyHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase); - VfxBase CreateBanish(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase); - VfxWithLoading CreateBanishHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase); - VfxBase CreateGeton(Transform vehicleCardPosition, IBattleCardView vehicleCardView, BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase); - VfxWithLoading CreateFusionHand(BattlePlayerBase battlePlayerBase, IBattleCardView fusionCard, bool isFusionMetamorphose); - VfxBase CreateParameterChange(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool isDead = false, bool isEvolve = false, bool skipWait = false); - VfxBase CreateBuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true); - VfxBase CreateBuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true); - VfxBase CreateDebuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true); - VfxBase CreateDebuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true); - VfxBase CreateBuffStartInHand(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true, bool isDebuff = false); - VfxBase CreateGuardStart(); - VfxBase CreateGuardStop(); - VfxBase CreateKillerStart(); - VfxBase CreateKillerStop(); - VfxBase CreateProtectionStart(ProtectionColorType tyep); - VfxBase CreateProtectionStop(); - VfxBase CreateNotBeAttackedStart(); - VfxBase CreateNotBeAttackedStop(); - VfxBase CreateUntouchableStart(); - VfxBase CreateUntouchableStop(); - VfxBase CreateQuick(bool hasAttacksRemaining, bool isCardUnableToAttackClass); - VfxBase CreateSneakStart(); - VfxBase CreateSneakStop(); - VfxBase CreateForceCantAttackStart(); - VfxBase CreateForceCantAttackStop(); - VfxBase CreateDrainStart(); - VfxBase CreateDrainStop(); - VfxBase CreateAttack(IBattleCardView attackCardView, IBattleCardView attackTargetCardView); - VfxBase CreateAttackFloatUp(); - VfxBase CreateAttackFloatDown(bool isAttacker, bool isDead, int attackableCount); - VfxBase CreateMoving(Vector3 pos); - VfxBase CreateDamage(int damage, int currentHealth, int maxHealth, int baseHealth, bool isReflectedDamage, bool IsSkillDamage); - VfxBase CreateHealing(int healAmount, int currentHealth, int maxHealth, int baseHealth); - VfxBase CreateMaskCardInPlay(); - VfxBase CreateReflectionStart(); - VfxBase CreateReflectionStop(); - VfxBase CreateHeavenlyAegisStart(); - VfxBase CreateHeavenlyAegisStop(); - VfxBase CreateChangeAffiliation(BattleCardBase card, CardBasePrm.ClanType clan, bool showEffect); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ImageSelection.g.cs b/SVSim.BattleEngine/Shim/Generated/ImageSelection.g.cs index 8f8e9ee7..19aec8db 100644 --- a/SVSim.BattleEngine/Shim/Generated/ImageSelection.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ImageSelection.g.cs @@ -17,77 +17,18 @@ public partial class ImageSelection public delegate bool IsNewItemDelegate(); public enum SelectType { - SINGLE, - MULTI } - private GameObject _partsBaseUI; - private GameObject _partsPageGrid; - private GameObject _partsMainItem; - private int _loadPageNumInAdvance; - private int _loadPageMaxNum; - private int _mainItemMaxNumPerPage; - private SelectType _selectType; - private bool _isNotSelectItemToGrey; - private ImageSelectionBaseUI _baseUI; - private PageDisplayFrame[] _pageDisplayFrameList; - private PageDisplayFrame _pageDisplayFrame_Main; - private PageDisplayFrame _pageDisplayFrame_Sub; - private Page _dummyPage; - private List _pageList; - private List _categoryInfoList; - private int _displayPageNo; - private PageItem _selectedPageItem; - private bool _isChangingDisplayPage; - private bool _isInterruptChangeDisplayPage; - private bool _isChangedPrevPageOnDrag; - private bool _isChangedNextPageOnDrag; - private bool _isChangedPrevPageOnPressBtn; - private bool _isChangedNextPageOnPressBtn; - private bool _isPressingPrevPageBtn; - private bool _isPressingNextPageBtn; - private float _timePressingPrevPageBtn; - private float _timePressingNextPageBtn; - private DialogBase _dialog; - public bool IsDuringReset { get; set; } - private void Awake() { } public void Create(int allPanelDepthAddValue = 0, DialogBase dialog = null) { } public List GetSelectedList() => default!; public void SelectAll() { } public void SelectCancelAll() { } - public void SetSelectAll(bool isSelect) { } - public IEnumerator Reset() => default!; - private void UnloadAll() { } public void AddItem(string key, string category, bool isSelectable, IsNewItemDelegate isNewItemMethod, string loadTexPath, string fetchTexPath, bool isDisplaySprite, string name, string[] texts, Action onDisplay, Action onClick = null, Action onPress = null) { } - private void AddDummyPage() { } - private void RemoveDummyPage() { } - private void AddCategoryPage(CategoryInfo categoryInfo) { } public void Open() { } public void Close() { } public void SetDisplayPage(int pageNo) { } public void LoadDisplayPage() { } - public void UnloadAllPageExceptDisplayPage() { } - private void UnloadAllPageExceptBasePage(int basePageNo, int aroundOffset) { } - private void ToPrevPage(bool isPlaySe = false) { } - private void ToNextPage(bool isPlaySe = false) { } - private IEnumerator ChangeDisplayPage(bool isAnimate, bool isToNext = false, bool isPlaySe = false) => default!; - private void InterruptChangeDisplayPage() { } - private void SwapPageDisplayFrame() { } - private void OnClickPageItem(PageItem pageItem, PageDisplayFrame frame) { } - private void OnPressPageItem(PageItem pageItem, PageDisplayFrame frame, GameObject pressItem) { } - private void OnDragStart(GameObject g) { } - private void OnDrag(GameObject g, Vector2 delta) { } - private void OnPressToPrevBtn(GameObject g, bool state) { } - private void OnPressToNextBtn(GameObject g, bool state) { } - private void Update() { } public string GetSelectedItemKey() => default!; public int SelectItemWithKey(string key) => default!; public void SelectMultiItem(List keyList) { } - private PageItem FindItemWithKey(string key, out int pageNo) { pageNo = default!; return default!; } - private void ChangeSelectItem(PageItem item) { } - private void UpdateSelectMark() { } - private void UpdateIsNewItem() { } - private int GetNormalizedPageNo(int pageNo) => default!; - private bool IsOnlyOnePage() => default!; - private void OnDestroy() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/ImmediateVfxMgr.g.cs b/SVSim.BattleEngine/Shim/Generated/ImmediateVfxMgr.g.cs deleted file mode 100644 index a0f48317..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ImmediateVfxMgr.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ImmediateVfxMgr.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class ImmediateVfxMgr -{ - private static ImmediateVfxMgr _instance; - public static ImmediateVfxMgr GetInstance() => default!; - private ImmediateVfxMgr() { } - public void Register(VfxBase vfx) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/InPlayCardFrameEffectControl.g.cs b/SVSim.BattleEngine/Shim/Generated/InPlayCardFrameEffectControl.g.cs index 5ce942d9..3c66c592 100644 --- a/SVSim.BattleEngine/Shim/Generated/InPlayCardFrameEffectControl.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/InPlayCardFrameEffectControl.g.cs @@ -1,22 +1,17 @@ // AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View\InPlayCardFrameEffectControl.cs +// TODO(engine-cleanup-pass2): 11 of 12 methods unrun in baseline +// Type: Wizard.Battle.View.InPlayCardFrameEffectControl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + using System; using UnityEngine; namespace Wizard.Battle.View { public partial class InPlayCardFrameEffectControl { - private readonly Func _getCardTemplateFunc; - private readonly Func _getIsAbleToAttackFunc; - private readonly Func _getIsUnableToAttackClassFunc; - protected CardTemplate CardTemplate { get; set; } - protected bool IsAbleToAttack { get; set; } - protected bool IsUnableToAttackClass { get; set; } public InPlayCardFrameEffectControl(Func getCardTemplateFunc, Func getIsAbleToAttackFunc, Func getIsUnableToAttackClassFunc) { } public virtual void UpdateCanAttackEffect(Func isUnableToAttackClassFunc = null, bool isSelfTurn = true) { } - public virtual void ToggleTargetSelectEffect(bool enable, bool isAttackTargetSelectInitiator = false) { } public virtual void SetIsSelectingAttackTarget(bool enable) { } - protected virtual void ShowFrameEffect(Color effectColor, Action particleSystemModifier = null) { } public virtual void HideFrameEffect() { } - protected virtual GameObject GetInPlayFrameEffect() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/LoadAndPlayEffectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/LoadAndPlayEffectVfx.g.cs deleted file mode 100644 index 22717eb6..00000000 --- a/SVSim.BattleEngine/Shim/Generated/LoadAndPlayEffectVfx.g.cs +++ /dev/null @@ -1,18 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\LoadAndPlayEffectVfx.cs -using System; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class LoadAndPlayEffectVfx -{ - public string LoadFileName { get; set; } - public WaitLoadEffectAndSetSeVfx WaitLoadEffectAndSetSeVfxData { get; set; } - public PlayEffectAndSeVfx PlayEffectAndSeVfxData { get; set; } - public LoadAndPlayEffectVfx(string fileName, string criSeName, Transform baseTransform, float waitTime) { } - public LoadAndPlayEffectVfx(string fileName, string criSeName, Transform baseTransform, float waitTime, bool isFollowAll) { } - public LoadAndPlayEffectVfx(string fileName, string criSeName, Vector3 position, float waitTime, int layer = -1) { } - public LoadAndPlayEffectVfx(string fileName, string criSeName, Func getPosition, float waitTime, int layer = -1) { } - private void Setup(string fileName, string criSeName, Func getPosition, float waitTime, int layer = -1) { } - private void Setup(string fileName, string criSeName, Transform transform, float waitTime, bool isFollowAll) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs b/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs index c701280a..e37ade6b 100644 --- a/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/LoadingViewManager.g.cs @@ -5,36 +5,6 @@ namespace Wizard { public partial class LoadingViewManager { - private LoadingInScene _lodingInSceneObj; - private bool _loadingInSceneForce; - private bool _loadingInSceneCenterForce; - private LoadingInScene _lodingInSceneCenterObj; - private LoadingInScene _lodingInSceneMatchingObj; - private LoadingInScene _lodingInSceneBattleObj; - private LoadingBase _loadingInDownLoad; - private LoadingInScene _loadingInNetworkOffline; - private GameObject _bgDownloadInfo; - private int _loadingCnt; - private const float LOADINGINSCENE_ALPHA = 1f; - private const float LOADINGINSCENE_PANELFADEINDUR = 0.1f; - public bool IsLoadingScene { get; set; } - public void CreateResourceDownload(LoadingDownLoad.eType Type) { } - public void FadeOutResourceDownload() { } - public void CloseResourceDownload() { } - public bool IsOpenAny() => default!; - public bool IsEnableInSceneCenterObj() => default!; - public void CreateInScene(bool notBlack = false, bool notCollider = false, bool force = true, int playIndex = -1) { } - public void CloseInScene(bool force = true) { } - public LoadingInScene CreateInSceneMatching(bool notBlack = false, bool notCollider = false) => default!; - public LoadingInScene CloseInSceneMatching() => default!; - public LoadingInScene CreateInSceneBattle(bool notBlack = false, bool notCollider = false) => default!; - public LoadingInScene CloseInSceneBattle() => default!; public void CreateInSceneCenter(bool notBlack = false, bool notCollider = false, bool force = true, string overrideText = null) { } - public void CloseInSceneCenter(bool force = true, bool disableCollider = false) { } - public void CreateInSceneNetworkOffline() { } - public void CloseInSceneNotNetwork() { } - public void CreateBackgroundDownloadInfo() { } - public void DestroyBackgroundDownloadInfo() { } - public void UpdateLoadingNum(int percent) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/MailTopTask.g.cs b/SVSim.BattleEngine/Shim/Generated/MailTopTask.g.cs index 7775d50b..d996f542 100644 --- a/SVSim.BattleEngine/Shim/Generated/MailTopTask.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/MailTopTask.g.cs @@ -7,9 +7,6 @@ namespace Wizard public partial class MailTopTask { public partial class MailTopTaskParam { } - private int? _pageRequested; - private bool _resetData; - private bool _isTutorial; public int? LastPageRead { get; set; } public long ServerTime { get; set; } public long RequestTime { get; set; } diff --git a/SVSim.BattleEngine/Shim/Generated/MetamorphoseHandCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/MetamorphoseHandCardVfx.g.cs deleted file mode 100644 index 69819153..00000000 --- a/SVSim.BattleEngine/Shim/Generated/MetamorphoseHandCardVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\MetamorphoseHandCardVfx.cs -using System.Linq; -namespace Wizard.Battle.View.Vfx -{ -public partial class MetamorphoseHandCardVfx -{ - public MetamorphoseHandCardVfx(BattleCardBase morphedCard, VfxBase morphVfx, bool isFusion = false) { } - private void HideEnemyCardMesh(BattleCardBase morphedCard) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/MetamorphoseInPlayCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/MetamorphoseInPlayCardVfx.g.cs deleted file mode 100644 index 355747ad..00000000 --- a/SVSim.BattleEngine/Shim/Generated/MetamorphoseInPlayCardVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\MetamorphoseInPlayCardVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class MetamorphoseInPlayCardVfx -{ - public MetamorphoseInPlayCardVfx(BattleCardBase originalCard, BattleCardBase morphedCard, VfxBase morphVfx) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/MoveToDeckVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/MoveToDeckVfx.g.cs deleted file mode 100644 index 95742384..00000000 --- a/SVSim.BattleEngine/Shim/Generated/MoveToDeckVfx.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\MoveToDeckVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class MoveToDeckVfx -{ - private const float MAX_Z_POSITION_MULTIPLIER = 7f; - private const float CARD_ROT_Z_PLAYER = 280f; - private const float CARD_ROT_Z_OPPONENT = -100f; - protected const float CARD_TURN_TIME = 0.2f; - protected const float CARD_MOVE_TIME = 0.2f; - private const float EFFECT_ROTATE_DIFF = 5f; - private bool _isPlayer; - private Vector3 GetCardHolderPos { get; set; } - private float GetCardRotZ { get; set; } - public MoveToDeckVfx(IEnumerable addCards, bool isPlayer) { } - private VfxBase CreateCardMove(BattleCardBase card, bool makeCardEffect) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/MulliganEndVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/MulliganEndVfx.g.cs deleted file mode 100644 index 78e375e9..00000000 --- a/SVSim.BattleEngine/Shim/Generated/MulliganEndVfx.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\MulliganEndVfx.cs -using System.Linq; -using Wizard.Battle.Mulligan; -namespace Wizard.Battle.View.Vfx -{ -public partial class MulliganEndVfx -{ - private readonly MulliganInfoControl m_MlgInfoCtrl; - private readonly BattlePlayerBase _battlePlayer; - private readonly BattlePlayerBase _battleEnemy; - public MulliganEndVfx(MulliganInfoControl mulliganControl, BattlePlayerBase battlePlayer, BattlePlayerBase battleEnemy) { } - private VfxBase HideMulliganCenterUI() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase HandCardReady() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs b/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs index c2542ac1..86ef5475 100644 --- a/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/MyPageTask.g.cs @@ -7,13 +7,4 @@ using UnityEngine; using Wizard.Lottery; namespace Wizard { -public partial class MyPageTask -{ - public partial class MyPageTaskParam { } - private const string MAINTENANCE_TIME_KEY = "maintenance_time"; - public MyPageTask() { } - public void SetParameter() { } - protected int Parse() => default!; - private void ShowNotification(JsonData responseData) { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/MyRotationBonusItem.g.cs b/SVSim.BattleEngine/Shim/Generated/MyRotationBonusItem.g.cs index bf025074..df3f1c60 100644 --- a/SVSim.BattleEngine/Shim/Generated/MyRotationBonusItem.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/MyRotationBonusItem.g.cs @@ -2,14 +2,4 @@ using UnityEngine; namespace Wizard.Battle.UI { -public partial class MyRotationBonusItem -{ - private UISprite _icon; - private UILabel _desc; - private GameObject _separator; - public BattlePlayerBase.MyRotationBonusCondition MyRotationBonusCondition { get; set; } - public bool IsPlayer { get; set; } - public void Setup(BattlePlayerBase.MyRotationBonusCondition myRotationBonusCondition, bool isPlayer, bool needSeparator = false) { } - public void setIconActive() { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/NecromanceInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/NecromanceInfomationUI.g.cs deleted file mode 100644 index f16b60d9..00000000 --- a/SVSim.BattleEngine/Shim/Generated/NecromanceInfomationUI.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\NecromanceInfomationUI.cs -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class NecromanceInfomationUI -{ - private UILabel _label1; - private new BattlePlayerBase _player; - public NecromanceInfomationUI(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(battlePlayerBase, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private void UpdateGraveCount(BattlePlayerBase player) { } - public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/NecromanceSkillActivationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/NecromanceSkillActivationVfx.g.cs deleted file mode 100644 index 533ddd16..00000000 --- a/SVSim.BattleEngine/Shim/Generated/NecromanceSkillActivationVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\NecromanceSkillActivationVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class NecromanceSkillActivationVfx -{ - public NecromanceSkillActivationVfx(IBattleCardView cardView) : base("stt_act_necromance_1", "se_stt_act_necromance_1", () => new Vector3(cardView.GameObject.transform.position.x, cardView.GameObject.transform.position.y, cardView.CardWrapObject.transform.position.z), 0.5f) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/NemesisInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/NemesisInfomationUI.g.cs deleted file mode 100644 index 658506a0..00000000 --- a/SVSim.BattleEngine/Shim/Generated/NemesisInfomationUI.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\NemesisInfomationUI.cs -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class NemesisInfomationUI -{ - private VfxBase _playVfx; - private int _classLife; - private GameObject _resonatePanel; - private GameObject _notResonatePanel; - public NemesisInfomationUI(BattlePlayerBase player, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(player, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private VfxBase UpdateResonance(bool playEffect = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs b/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs index e30b3112..35c475e1 100644 --- a/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/NonDialogPopup.g.cs @@ -5,8 +5,6 @@ namespace Wizard.Battle.View { public partial class NonDialogPopup { - public Action OnClose; public virtual void Close() { } - private void OnDestroy() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/NullBattlePlayerView.g.cs b/SVSim.BattleEngine/Shim/Generated/NullBattlePlayerView.g.cs index 7be4648d..975a9bf5 100644 --- a/SVSim.BattleEngine/Shim/Generated/NullBattlePlayerView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/NullBattlePlayerView.g.cs @@ -7,98 +7,6 @@ namespace Wizard.Battle.View { public partial class NullBattlePlayerView { - public ITurnEndButtonUI TurnEndButtonUI { get; set; } - public GameObject EpIcon { get; set; } - public bool IsSelecting { get; set; } - public HandViewBase HandView { get; set; } - public HandControl HandControl { get; set; } - public BattleCardBase SelectSkillActCard { get; set; } - public GameObject TurnEndBtn { get; set; } - public BattleCardBase m_CurrentTarget { get; set; } - public PlayQueueViewBase PlayQueueView { get; set; } - public AttackSelectControl AttackSelectControl { get; set; } - public InPlayViewBase InPlayView { get; set; } - public GameObject StatusParentPanel { get; set; } - public GameObject AnchorL { get; set; } - public GameObject CommonPanel { get; set; } - public GameObject EpPanel { get; set; } - public UIGrid HandDeck { get; set; } - public UIGrid SetDeck { get; set; } - public GameObject CemeteryParent { get; set; } - public GameObject BanishParent { get; set; } - public bool IsNowTurnEnd { get; set; } - public Action OnCancelSkillTargetSelect { get; set; } - public Action OnCancelPlayCard { get; set; } - public Action OnSelect { get; set; } - public Transform ChoiceBraveButtonTransform { get; set; } - public bool IsShowCantChoiceBraveText { get; set; } public NullBattlePlayerView() { } - public VfxBase Recovery(bool doseFirst, bool isFocusHand) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryTurnStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public IList GetSelectCardList() => default!; - public void ForceStopShowSelect() { } - public void AllClear(bool popUpClose = false, bool isRemoveSideLog = true, bool isStopDrag = true, bool isResetDetail = true) { } - public bool IsTouchable() => default!; - public void LockOnEffectOff() { } - public void ShowCommonPanel() { } - public void DragArrowStop(BattleManagerBase battleMgr) { } - public VfxBase HandUnfocus() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase HandFocus() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public bool ShowAlertMessageTouchCard(ref BattleCardBase hitCard, ref BattleManagerBase battleMgr) => default!; - public void DisableSettingFlag() { } - public void HideAlertDialogue() { } - public void HideAlertDialogue(PanelMgr.BattleAlertType alertType) { } - public bool IsShowingAlert() => default!; - public void ClearPlayQueue() { } - public void ShowAlert(PanelMgr.BattleAlertType AlertType, bool isClass, string text = null) { } - public VfxBase RearrangeHand() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void StopShowSelect(BattleCardBase actCard, bool isAct, bool isTransformskill = false, bool isNewReplayMoveTurn = false) { } - public void RegisterPlayCard(BattleCardBase actCard) { } - public UIButton GetChoiceButtonFromIndex(int index) => default!; - public GameObject GetCheckFromIndex(int index) => default!; - public void SetTouchable(bool enable) { } - public void HideTurnEndButton() { } - public void SetCancelSkillChoiceTransformCards(BattleCardBase actCard, BattleCardBase transformCard) { } - public void SetCancelPlayChoiceTransformCards(BattleCardBase actCard, BattleCardBase transformCard) { } - public void SetCancelPlayCardWithChoice(BattleCardBase actCard, List choiceCards) { } - public void ReleaseLockOnTarget() { } - public void ShowChoiceAlert(BattleCardBase card, bool isEvolve, int count, int max) { } - public void StopChoiceSelectUI() { } - public void HideCommonPanel() { } - public void ClearSelectCardList() { } - public void SetSelectCardList(List list) { } - public Vector3 GetPPLabelPosition() => default!; - public Vector3 GetBPLabelPosition() => default!; - public VfxBase CreateBeforeFusionVfx(BattleCardBase fusionCard, List ingredientCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase ReturnActCardAfterFusion(IBattleCardView fusionCardView, bool isFusionMetamorphose = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public SideLogControl GetSideLogControl(bool isSkillTargetSelect) => default!; - public VfxBase SetIsNowTurnEnd(bool flg) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryInPlayCards() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryClassAndInPlayCardAttachSkillEffect() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryInHandCards() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase RecoveryBattleUI() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateStopAttackFloatVfx(IBattleCardView battleCardView) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateStopShowSelectVfx(BattleCardBase actCard, bool isAct, bool stopChoiceSelectUiImmediately = true, bool isTransformskill = false, bool isNewReplayMoveTurn = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void ClearSelectSkillActCard() { } - public VfxBase StartShowSelect(BattleCardBase actCard, SkillBase skill, IEnumerable selectableCards, bool isEvol) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void CancelPlayCard(BattleCardBase actCard, bool isPlay = false, bool isNewReplayMoveTurn = false) { } - public VfxBase StartShowChoice(BattleCardBase actCard, SkillBase choiceSkill, List choiceCards, bool isEvol, BattleCardBase accelerateCard, bool isChoiceBrave) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void StartShowFusionUI(BattleCardBase actCard, IEnumerable selectableCards, int maxSelectCount, EventDelegate onClickDecision) { } - public VfxBase RemoveFusionSelectedCardFromHand(List selectedCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void StopFusionUI() { } - public void Setup(GameObject statusPanel, GameObject uiContainer, GameObject btlContainer, GameObject battle3DContainer) { } - public VfxBase RecoveryMulligan() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase PrepareCardsForAttackSequenceVfx(IBattleCardView attackInitiator, IBattleCardView attackTarget) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SelectedFusionIngredientCard(int index, bool isActive, int maxSelectCount) { } - public void UpdateFusionUi(bool isTouchableDecisionButton) { } - public void SetNotCancelCollider(List cards, bool isEnable) { } - public void ShowChoiceSelectUI(BattleCardBase actCard, IList choiceCards, SkillBase skill, bool isEvolve, bool isChoiceBrave) { } - public VfxBase HideCardAttackEffects(IList _targetCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void ShowChoiceBraveButton(bool isNewReplay) { } - public void UpdateChoiceBraveActivatingEffect(bool isActivating) { } - public void HideChoiceBraveButton() { } - public void UpdateChoiceBraveButtonPulsateEffectAndSprite() { } - public void HideChoiceBraveButtonPulsateEffect() { } - public VfxBase SetBp(int num) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); } } diff --git a/SVSim.BattleEngine/Shim/Generated/NullEnemyBattleView.g.cs b/SVSim.BattleEngine/Shim/Generated/NullEnemyBattleView.g.cs index f9d52fe0..0935b2cb 100644 --- a/SVSim.BattleEngine/Shim/Generated/NullEnemyBattleView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/NullEnemyBattleView.g.cs @@ -7,11 +7,5 @@ namespace Wizard.Battle.View public partial class NullEnemyBattleView { public NullEnemyBattleView() : base(null) { } - public VfxBase StartShowSelect(BattleCardBase actCard, SkillBase skill, IEnumerable selectableCards, bool isEvol) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase PrepareCardsForAttackSequenceVfx(IBattleCardView attackInitiator, IBattleCardView attackTarget) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected HandViewBase CreateHandView(GameObject gameObject) => default!; - protected InPlayViewBase CreateInPlayView(GameObject gameObject) => default!; - protected PlayQueueViewBase CreatePlayQueueView() => default!; - public VfxBase HideCardAttackEffects(IList _targetCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); } } diff --git a/SVSim.BattleEngine/Shim/Generated/NullFieldBattleCardView.g.cs b/SVSim.BattleEngine/Shim/Generated/NullFieldBattleCardView.g.cs index 0f319e8a..27e82c6a 100644 --- a/SVSim.BattleEngine/Shim/Generated/NullFieldBattleCardView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/NullFieldBattleCardView.g.cs @@ -6,23 +6,6 @@ namespace Wizard.Battle.View { public partial class NullFieldBattleCardView { - public GameObject GameObject { get; set; } public NullFieldBattleCardView(BuildInfo buildInfo) : base(buildInfo) { } - public void UpdateMovability() { } - public VfxBase LoadResource() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase GetResourcePathes(List resourceInfos) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase LoadChoiceTransformCardsResources(BattleCardBase card) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase GetChoiceTransformCardsResourcePathes(BattleCardBase card, List resourceInfos, bool isRecoveryFinish = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void HideCanPlayEffect() { } - public void SetupIconAnimations(BattleCardBase card, SkillCollectionBase skills) { } - public void ShowInHandFrameEffect(bool enable) { } - public void ShowInHandFrameEffect(bool enable, HandCardFrameEffectType type) { } - public void ShowFusionMetamorphoseFrameEffect(bool enable) { } - protected void SetupVoiceObject() { } - public void UpdateParameterView(int offence, int life, int cost, string name, bool isOnField, bool isRecovery = false, bool useNormalCost = false) { } - public void UpdateOffence(int offence) { } - public void UpdateLife(int life) { } - public void UpdateCost(List costList, bool isGenerateInhand, bool playEffect, bool isForceUpdate, bool isOnlyFixedUseCost) { } - public void SetNormalLabelEnable(bool isEnable) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/NullPlayerBattleView.g.cs b/SVSim.BattleEngine/Shim/Generated/NullPlayerBattleView.g.cs index da624392..f2b7599d 100644 --- a/SVSim.BattleEngine/Shim/Generated/NullPlayerBattleView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/NullPlayerBattleView.g.cs @@ -7,14 +7,5 @@ namespace Wizard.Battle.View public partial class NullPlayerBattleView { public NullPlayerBattleView() : base(null) { } - public VfxBase StartShowSelect(BattleCardBase actCard, SkillBase skill, IEnumerable selectableCards, bool isEvol) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void ShowTurnEndPulseEffect() { } - public VfxBase HideTurnEndPulseEffect() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void ShowTurnEndButton(bool showEffect) { } - public void HideTurnEndButton() { } - public VfxBase PrepareCardsForAttackSequenceVfx(IBattleCardView attackInitiator, IBattleCardView attackTarget) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected HandViewBase CreateHandView(GameObject gameObject) => default!; - protected InPlayViewBase CreateInPlayView(GameObject gameObject) => default!; - protected PlayQueueViewBase CreatePlayQueueView() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/NullReplayRecordManager.g.cs b/SVSim.BattleEngine/Shim/Generated/NullReplayRecordManager.g.cs index ca5ea471..45c09367 100644 --- a/SVSim.BattleEngine/Shim/Generated/NullReplayRecordManager.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/NullReplayRecordManager.g.cs @@ -1,4 +1,8 @@ // AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Replay\NullReplayRecordManager.cs +// TODO(engine-cleanup-pass2): 2 of 3 methods unrun in baseline +// Type: Wizard.Battle.Replay.NullReplayRecordManager +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.Replay { public partial class NullReplayRecordManager diff --git a/SVSim.BattleEngine/Shim/Generated/OneShotHeavenlyAegisPlayVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/OneShotHeavenlyAegisPlayVfx.g.cs deleted file mode 100644 index 8b4db9d7..00000000 --- a/SVSim.BattleEngine/Shim/Generated/OneShotHeavenlyAegisPlayVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\OneShotHeavenlyAegisPlayVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class OneShotHeavenlyAegisPlayVfx -{ - private readonly IBattleCardView _cardView; - public OneShotHeavenlyAegisPlayVfx(IBattleCardView cardView) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/OpenCardFromHandVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/OpenCardFromHandVfx.g.cs deleted file mode 100644 index c5e07867..00000000 --- a/SVSim.BattleEngine/Shim/Generated/OpenCardFromHandVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\OpenCardFromHandVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class OpenCardFromHandVfx -{ - private const float CARD_CENTER_STOP_TIME = 0.3f; - private const float WAIT_TIME = 0.5f; - private const float PARENT_TRANSFORM_SCALE = 0.001953125f; - private static readonly Vector3 CARD_TRANSFORM_POSITION; - public OpenCardFromHandVfx(IBattleCardView cardView, bool isLegent) { } - private void PlayCardOpenEffect(IBattleCardView cardView, bool isLegend) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/OpenCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/OpenCardVfx.g.cs deleted file mode 100644 index 3dcfa6b7..00000000 --- a/SVSim.BattleEngine/Shim/Generated/OpenCardVfx.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\OpenCardVfx.cs -using System.Collections; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class OpenCardVfx -{ - public const float CARD_MOVE_TIME = 0.4f; - protected const float CARD_TURN_TIME = 0.39f; - protected static readonly Vector3 CARD_TRANSFORM_POSITION; - protected BattleManagerBase _battleManager; - protected IBattleCardView _cardView; - protected Vector3 _position; - protected bool _isLegend; - protected void Init(IBattleCardView cardView, Vector3 pos, bool isLegend) { } - protected virtual VfxBase PrepareMoveCard(GameObject cardHolder) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase MoveCard() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase MoveCardCenter() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected virtual void PlayCardOpenEffect() { } - protected void cardOpenSoundLg() { } - protected void cardOpenSound() { } - protected void cardDrawSound() { } - public static void RotateToAndShowCardName(IBattleCardView cardView, Hashtable iTweenHash) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/OpponentDrawCardToHandVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/OpponentDrawCardToHandVfx.g.cs deleted file mode 100644 index d19674ad..00000000 --- a/SVSim.BattleEngine/Shim/Generated/OpponentDrawCardToHandVfx.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\OpponentDrawCardToHandVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class OpponentDrawCardToHandVfx -{ - private const float CARD_OPEN_WAIT_TIME = 0.3f; - private const float CARD_SORT_OFFSET = 220f; - private const float FIRST_CARD_POSITION_X = 180f; - private const float CARD_POSITION_Y = 50f; - private const float CARD_POSITION_Z = -50f; - private const float CARD_MOVE_TIME = 0.2f; - private static readonly Vector3 CARD_ROTATION; - public OpponentDrawCardToHandVfx(IEnumerable drawnCards, float inHandTime, bool isOpenDrawSkill = false, bool skipShuffle = false) { } - public VfxBase MoveOpenCenter(IEnumerable drawCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/OpponentDrawCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/OpponentDrawCardVfx.g.cs deleted file mode 100644 index 6a8210b9..00000000 --- a/SVSim.BattleEngine/Shim/Generated/OpponentDrawCardVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\OpponentDrawCardVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class OpponentDrawCardVfx -{ - private const float MAX_Z_POSITION_MULTIPLIER = 7f; - private bool _isOpen; - public OpponentDrawCardVfx(IEnumerable drawCards, bool isOpen = false) { } - private VfxBase MoveSpinVfx(IEnumerable drawCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/OpponentMulliganDrawCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/OpponentMulliganDrawCardVfx.g.cs deleted file mode 100644 index 4bdf3b73..00000000 --- a/SVSim.BattleEngine/Shim/Generated/OpponentMulliganDrawCardVfx.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\OpponentMulliganDrawCardVfx.cs -using System.Collections.Generic; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class OpponentMulliganDrawCardVfx -{ - private const float CARD_SORT_OFFSET = 220f; - private const float FIRST_CARD_POSITION_X = 180f; - private const float CARD_POSITION_Y = 500f; - private const float CARD_POSITION_Z = -50f; - private static readonly Vector3 CARD_ROTATION; - public OpponentMulliganDrawCardVfx(IEnumerable drawCards) { } - private void CardDrawPrepare(IEnumerable drawCards) { } - private VfxBase MoveSpinVfx(IEnumerable drawCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/Page.g.cs b/SVSim.BattleEngine/Shim/Generated/Page.g.cs index 6ca67dfd..85a6cd3a 100644 --- a/SVSim.BattleEngine/Shim/Generated/Page.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/Page.g.cs @@ -2,14 +2,4 @@ using UnityEngine; namespace Wizard.UI.Profile { -public partial class Page -{ - public delegate void DelegatePage(bool isAnimate, int beforeClassId, int afterClassId); - private DelegatePage _onChangeActive; - private DelegatePage _onChangeInactive; - private DelegatePage _onExecuteSetActive; - private bool _isActive; - protected void SetCallback(DelegatePage onChangeActive, DelegatePage onChangeInactive, DelegatePage onExecuteSetActive) { } - public void SetActive(bool isActive, bool isAnimate, int beforeClassId, int afterClassId) { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/Parameter__Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.g.cs b/SVSim.BattleEngine/Shim/Generated/Parameter__Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.g.cs deleted file mode 100644 index cc8f3146..00000000 --- a/SVSim.BattleEngine/Shim/Generated/Parameter__Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult/Parameter.cs -using System; -using UnityEngine; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class Parameter -{ - public MonoBehaviour CoroutineObject { get; set; } - public SelectedStoryInfo SelectedStoryInfo { get; set; } - public Format DeckSelectionDialogDefaultFormat { get; set; } - public DeckAttributeType DeckSelectionDialogDefaultAttribute { get; set; } - public Action DeckSelectionDialogCloseCallback { get; set; } - public Action DeckDecideCallback { get; set; } - public bool IsPlayVoice { get; set; } - public ScenarioTemporaryVoice.DownloadInfo TemporaryVoiceDownloadInfo { get; set; } - public DialogBase DeckSelectionDialog { get; set; } - public DeckData DeckData { get; set; } - public ClassCharacterMasterData ChapterCharaData { get; set; } - public int SectionId { get; set; } - public int? SectionCharaId { get; set; } - public int? SectionClassId { get; set; } - public StoryChapterData ChapterData { get; set; } - public string ChapterId { get; set; } - public int? SubChapterId { get; set; } - public int ChapterCharaId { get; set; } - public int ChapterClassId { get; set; } - public ClassCharacterMasterData CharaDataSelectedInSummaryDialog { get; set; } - public Parameter(MonoBehaviour coroutineObject, SelectedStoryInfo selectedStoryInfo, Format deckSelectionDialogDefaultFormat, DeckAttributeType deckSelectionDialogDefaultAttribute, Action deckSelectionDialogCloseCallback, Action deckDecideCallback) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/Parameter__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs b/SVSim.BattleEngine/Shim/Generated/Parameter__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs deleted file mode 100644 index b0890b7f..00000000 --- a/SVSim.BattleEngine/Shim/Generated/Parameter__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.Main/Parameter.cs -using UnityEngine; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class Parameter -{ - public MonoBehaviour CoroutineObject { get; set; } - public CommonPrefabContainer CommonPrefabContainer { get; set; } - public ScenarioSummary ScenarioSummary { get; set; } - public SelectedStoryInfo SelectedStoryInfo { get; set; } - public StoryChapterData ChapterData { get; set; } - public int ReleasedChapterNum { get; set; } - public int? ReplayChapterIndex { get; set; } - public string[] UnlockedSelections { get; set; } - public DialogBase SubChapterSelectionDialog { get; set; } - public int? SubChapterId { get; set; } - public bool? IsPlayVoice { get; set; } - public ClassCharacterMasterData CharaDataSelectedInSummaryDialog { get; set; } - public ScenarioTemporaryVoice.DownloadInfo TemporaryVoiceDownloadInfo { get; set; } - public DialogBase DeckSelectionDialog { get; set; } - public DeckData DeckData { get; set; } - public ClassCharacterMasterData ChapterCharaData { get; set; } - public StoryEntranceType StoryEntranceType { get; set; } - public StorySectionData SectionData { get; set; } - public int SectionId { get; set; } - public int? SectionCharaId { get; set; } - public int? SectionClassId { get; set; } - public string ChapterId { get; set; } - public int? ChapterCharaId { get; set; } - public int? ChapterClassId { get; set; } - public Parameter(MonoBehaviour coroutineObject, CommonPrefabContainer commonPrefabContainer, ScenarioSummary scenarioSummary, SelectedStoryInfo selectedStoryInfo, StoryChapterData chapterData, int releasedChapterNum, string[] unlockedSelections, int? replayChapterIndex) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayCRISoundVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayCRISoundVfx.g.cs deleted file mode 100644 index e5500142..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayCRISoundVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayCRISoundVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayCRISoundVfx -{ - private readonly IBattleCardView _view; - private readonly string _cueName; - private const string VOICE_HEAD_NAME = "vo_"; - public PlayCRISoundVfx(IBattleCardView view, string cueName) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayEffectAndSeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayEffectAndSeVfx.g.cs deleted file mode 100644 index 2aab2dfd..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayEffectAndSeVfx.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayEffectAndSeVfx.cs -using System; -using CriWare; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayEffectAndSeVfx -{ - public int NowStep { get; set; } - public PlayEffectAndSeVfx(Func getLoadedEffectObject, Transform baseTransform, bool isFollow = false, bool isFollowPosition = false, bool isFollowAll = false) : base(getLoadedEffectObject, baseTransform, isFollow, isFollowPosition, isFollowAll) { } - public PlayEffectAndSeVfx(Func getLoadedEffectObject, Vector3 position, bool isFollow = false, bool isFollowPosition = false) : base(getLoadedEffectObject, position, isFollow, isFollowPosition) { } - public PlayEffectAndSeVfx(Func getLoadedEffectObject, Func getPosition, bool isFollow = false, bool isFollowPosition = false, int layer = -1) : base(getLoadedEffectObject, getPosition, isFollow, isFollowPosition, layer) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayEffectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayEffectVfx.g.cs deleted file mode 100644 index 5a785df9..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayEffectVfx.g.cs +++ /dev/null @@ -1,29 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayEffectVfx.cs -using System; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayEffectVfx -{ - private Func _getLoadedEffectObject; - private Func _getPosition; - protected GameObject _effectObject; - private Effect _effect; - private Transform _targetTransform; - private int _layer; - public bool IsEffectEnd { get; set; } - public bool IsFollow { get; set; } - public bool IsFollowPosition { get; set; } - public bool IsFollowAll { get; set; } - public Func GetLoadedGameObject { get; set; } - public PlayEffectVfx(Func getLoadedEffectObject, Transform baseTransform, bool isFollow = false, bool isFollowPosition = false, bool isFollowAll = false) { } - public PlayEffectVfx(Func getLoadedEffectObject, Vector3 position, bool isFollow = false, bool isFollowPosition = false) { } - public PlayEffectVfx(Func getLoadedEffectObject, Func getPosition, bool isFollow = false, bool isFollowPosition = false, int layer = -1) { } - private void Setup(Func getLoadedEffectObject, Func getPosition) { } - public void Play() { } - public void UpdateEffect() { } - public void RemoveCheck() { } - public void FollowTarget() { } - public void DestroyEffect() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerAndEnemyReadyVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerAndEnemyReadyVfx.g.cs deleted file mode 100644 index 8db2ab0c..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerAndEnemyReadyVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerAndEnemyReadyVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerAndEnemyReadyVfx -{ - private const int INIT_HAND_CARD_NUM = 3; - public PlayerAndEnemyReadyVfx(BattlePlayerBase battlePlayer, BattlePlayerBase battleEnemy) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerClassBattleCardView.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerClassBattleCardView.g.cs index e4e27be7..31c950e1 100644 --- a/SVSim.BattleEngine/Shim/Generated/PlayerClassBattleCardView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/PlayerClassBattleCardView.g.cs @@ -7,15 +7,7 @@ namespace Wizard.Battle.View { public partial class PlayerClassBattleCardView { - private static readonly Vector3 PLAYER_FORECASTICON_POS; - private readonly PlayerClassCharacter _classCharacter; public IClassCharacter ClassCharacter { get; set; } - public float OriginalRootYPosition { get; set; } public PlayerClassBattleCardView(BuildInfo buildInfo) : base(buildInfo) { } // HEADLESS-FIX (M-HC-4a): chain BuildInfo so the leader view's CardInfo resolves (attack-on-leader targetting) - public void StartOutFrame() { } - public void StartIntoFrame() { } - public float GetCurrentClipTime() => default!; - public bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType) => default!; - public void ClearSpineObject() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerClassCardVfxCreator.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerClassCardVfxCreator.g.cs deleted file mode 100644 index 17371419..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerClassCardVfxCreator.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerClassCardVfxCreator.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerClassCardVfxCreator -{ - public PlayerClassCardVfxCreator(ClassBattleCardViewBase battleCardView, BattleCardBase card, IBattlePlayerView battleView, IBattleResourceMgr resourceMgr) : base(isPlayer: true, card, battleCardView, battleView, resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerControllerForOwn.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerControllerForOwn.g.cs index 9f6709ff..a4e90b31 100644 --- a/SVSim.BattleEngine/Shim/Generated/PlayerControllerForOwn.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/PlayerControllerForOwn.g.cs @@ -7,86 +7,4 @@ using UnityEngine; using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; namespace Wizard.RoomMatch { -public partial class PlayerControllerForOwn -{ - private string _battleID; - private bool _isEmitedEnterRoom; - private bool _receiveAliveForDisconnect; - private List _alreadyEmitList; - private const float FAILURE_RETRY_INTERVAL = 5f; - private Coroutine _escapeRoomWaitCoroutine; - private DialogBase _escapeRoomDialog; - public GatheringAutoJoinTaskInfo GatheringAutoJoinTaskInfo; - public bool IsEmitting { get; set; } - public bool IsEmitLeave { get; set; } - public bool IsEmitRelease { get; set; } - private bool IsEnableSendForWatch { get; set; } - public bool IsSendRematch { get; set; } - public bool IsDoneForceClose { get; set; } - public long GetBattleId() => default!; - public PlayerControllerForOwn(Player target, RoomConnectController room) { } - public void Init(bool isRecovery) { } - public void Ready() { } - public void CancelReady() { } - public void CheckGatheringRoom() { } - public void SelectDeck(DeckData deck, bool isDefaultDeck) { } - public void Release() { } - public void SelectDeckForMutliDeck(DeckData deck, bool isDefaultDeck, Action apiEndAction) { } - public void SelectDeckOpen() { } - public void SelectDeckClose() { } - public void FirstTurnSelect(int type) { } - public void CreateRoomServer(RoomConnectController room) { } - public void CreateRoomBattleServer(RoomConnectController room) { } - public void SetBattleId(string battleId) { } - public void SendDeckInfoForWatch(DeckData deck) { } - public void EnterRoomServer(string roomId) { } - private void UpdateSelfRank() { } - private void EnterRoomSuccess(BaseRoomBattleEnterRoomTask task) { } - public void RecoverRoomSuccess(OpenRoomBattleGetRecoveryParamTask task) { } - public void InitilizeRoomBattleServer(string roomId) { } - public static List ConvertResultMap(Dictionary> resultMap, int targetViewerId) => default!; - private static Dictionary CreateSendDeckParameter(DeckData deckData) => default!; - public void SendOwnerChoiceDeckForWatch(DeckData deck) { } - public void SendDraftChoiceDeckForWatch(DeckData[] deck) { } - public void SendOpponentResetForWatch() { } - private void SendRoomNotify(string notifyMsg) { } - public void EnterRoomBattleServer() { } - public void ExitRoom(string roomId) { } - protected void CloseOrExitRoomBeforeInitializeRoomBattleServer() { } - private IEnumerator EscapeRoomReceiveCoroutine(Action onRetry) => default!; - public void StopEscapeRoomReceiveCorutineAndCloseDialog() { } - public void PlayExitRoom() { } - public void KickRoom() { } - public void PlayKick() { } - public void ForceKickRoom() { } - public void OnReceiveAlive() { } - public void CloseRoom() { } - public void ReleaseRoom() { } - public void ForceCloseRoom() { } - public void StartForceCloseRoom() { } - public void OwnerForcecloseRoom() { } - private IEnumerator ForceCloseCoroutine() => default!; - public void Emote(int id) { } - public void SendDeckReset(Action SuccessFunction, Action onFailed = null) { } - public void Send2PickBeginDeckCreateAPIAfterEmit(Action SuccessFunction, Action onFailed = null) { } - public void Emit2PickBeginDeckCreate(int[] candidateClassIds) { } - public void Send2PickSelectClassAPIAfterEmit(int inClassId, Action SuccessFunction) { } - public void Emit2PickSelectClass(int inClassId, List candidateCardList) { } - public void Send2PickSelectCardAPIAfterEmit(int selectedId, Action SuccessFunction) { } - public void Emit2PickSelectCard(List candidateCards) { } - public void EmitRetry2PickDeckCreate() { } - public void SendBanDeck(DeckData deck) { } - public void SendSetDeckForDeckOpenBo1(DeckData deck) { } - public void SendSetMultiDeck(List deckList) { } - public void SendMultiDeckRematch() { } - private void EmitRematch() { } - public void ReceiveRematch() { } - public void SendConventionRetire(Action callback) { } - public void EmitNotifyRoomCreateOrEnter(ROOM_URI id, Dictionary data = null) { } - private void EmitNotify(ROOM_URI id, Dictionary data = null) { } - public void OnAck(Dictionary inObject) { } - private void EmitMsg(string uri, Dictionary dataList = null, Action callback = null, bool isGetableAck = true) { } - private void EmitMsg(ROOM_URI uri, Dictionary dataList = null, Action callback = null, bool isGetableAck = true) { } - public IEnumerator EmitRetry(string uri) => default!; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs index 990191a3..f80866f7 100644 --- a/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/PlayerControllerForWatching.g.cs @@ -10,117 +10,4 @@ using Wizard.ErrorDialog; using Wizard.Scripts.Network.Data.TableData.Arena.TwoPick; namespace Wizard.RoomMatch { -public partial class PlayerControllerForWatching -{ - public partial struct TwoPickChoice { } - public enum SEND_PARAMETER - { - InitWatch, - Watch, - GetDeck, - users, - wSeq, - pRSeq - } - public enum STATE - { - INIT = -1, - PREPARATION = 200, - READY = 201, - LOAD = 202, - LOADEND = 310, - BATTLE = 400, - MAX = 400 - } - private const float WATCH_INTERVAL = 2f; - private const float ADMIN_WATCH_INTERVAL = 0.2f; - private const int LOADING_TIMER = 30; - protected const int ROOM_TIME_OUT = 30; - private const float INIT_WATCH_TIME_OUT_MILLI_SECOND = 15f; - public const string MULTI_DECK_KEY_REMATCH = "MultiDeckRematch"; - private bool _isBattleWatchStart; - private bool isExistBattle; - private bool isEmitEnterRoom; - private NetworkWatchBattleMgr _networkBattleMgr; - private WatchDataHandler _watchDataHandler; - private Coroutine _coroutineBeforeBattle; - private float _constWaitTime; - private Coroutine _timeOutCoroutine; - private Coroutine _timeOutResultCoroutine; - private int _currentState; - private float _roomTimeOutCounter; - protected bool _isTimeOutSelf; - private float _watchEmitInterval; - private bool _receivedBattleInfo; - private bool resetSeq; - public TwoPickWatchData TwoPickData; - public bool isRoomEmitWait; - private int _leaveCountOwner; - private int _leaveCountGuest; - private List _saveTwoPickDeck; - private List _selectPickSide; - public bool IsReceivedInitWatch { get; set; } - public int SeqenceNo { get; set; } - public bool IsExistBattleReceiver { get; set; } - public PlayerControllerForWatching(Player target, RoomConnectController room) { } - public void ResetWatchHandler() { } - public void ResetReceiveEvent() { } - public int GetCurrentState() => default!; - private IEnumerator StartWatch() => default!; - private Dictionary CreateInitWatchData() => default!; - public void Init(bool isRecovery) { } - public void EnterRoomBattleServer() { } - public void InitilizeRoomBattleServer(string roomId) { } - public void EnterRoomServer(string roomId) { } - private void OnSuccessWatchRoom(RoomBattleWatchTaskBase task, string roomId) { } - public void SetupUserInfo(RoomBattleWatchTaskBase.UserInfo receiveData, Player player) { } - private new void ConnectAPI(BaseTask task, Action callback) { } - private void ServerError(int in_ErrorNo) { } - public void OnGatheringError(int resultCode, UIManager.ViewScene scene) { } - public void OnGatheringError(string title, string text, UIManager.ViewScene scene) { } - private void ChangeViewScene(UIManager.ViewScene scene) { } - public void OnReceived(Dictionary received) { } - public void ReceiveLeaveCount(Dictionary received) { } - public void ReceiveWaitTime(float waitTime) { } - public void ReceiveBanDeckDecide(Dictionary received, bool enableEventCall) { } - public static bool IsChangeDeckList(List oldDeckData, List newDeckData) => default!; - public void ReceiveInitWatchDeckList(Dictionary received, bool enableEventCall) { } - private void ReceivedWatch(Dictionary received) { } - public void ReceiveOpponentBeginCreateDeck() { } - public void ReceiveTwoPickBeginCreateDeck(Dictionary getData) { } - public void ReceiveTwoPickSelectClass(Dictionary getData) { } - private void ReceivedGetDeck(Dictionary received) { } - private void StartTimeOut(int timer) { } - private void StopTimeOut() { } - private void StartResultTimeOut(int timer) { } - private void StopResultTimeOut() { } - private IEnumerator StartTimeOutCorutine(int timer) => default!; - private void ShowErrorDialog() { } - private void ReturnScene() { } - private void ChangeScene() { } - private IEnumerator BattleEndCoroutin(Action callback) => default!; - private IEnumerator WaitTillBattleCreate() => default!; - private int DecideFirstUser(int id) => default!; - private bool isOwner(int id) => default!; - private void ParseWatchData(Dictionary received, out int state) { state = default!; } - private void ParseLeaveCount(Dictionary received, int state, bool anyEntry) { } - public TwoPickCardSelectBase.PICK_SIDE GetTwoPickSelectSide(int pickTurn) => default!; - private void ParseTwoPickSelectCard(Dictionary getData) { } - private void Receive2PickSelectCardInfo(Dictionary deckInfo) { } - public void Receive2PickSelectCardSet(Dictionary getData) { } - public void Receive2PickDeckInfo(Dictionary deckInfo) { } - public void ReceiveDraftDeckCreate(Dictionary draftDeck) { } - private void Convert2PickDeckData(Dictionary draftDeck, out List classId, out List skinId, out List[] tempCardIdList) { classId = default!; skinId = default!; tempCardIdList = default!; } - protected void TwoPickCandidateCardSet(Dictionary inGetData) { } - public void TwoPickReset() { } - public void ReceiveTwoPickSelectedCardNumber(Dictionary getData) { } - public void ReceiveRoomNotify(Dictionary getData) { } - public void ReceiveChatStamp(Dictionary getData) { } - protected void TwoPickDeckReset() { } - public void ReceiveDeckEntry(Dictionary getData) { } - public void ReceiveRematch() { } - public void CreateRoomServer(RoomConnectController room) { } - public void EmitGetDeck(int viewerId) { } - public void OnLeaveGuest() { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerController_ROOM_URI.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerController_ROOM_URI.g.cs index bd63fa25..df105f25 100644 --- a/SVSim.BattleEngine/Shim/Generated/PlayerController_ROOM_URI.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/PlayerController_ROOM_URI.g.cs @@ -6,35 +6,4 @@ using UnityEngine; using Wizard.ErrorDialog; namespace Wizard.RoomMatch { -public partial class PlayerController -{ -public enum ROOM_URI -{ -Reenter, -RoomCreate, -RoomEntry, -GatheringEntry, -SetupComplete, -SetupCancel, -CheckGatheringRoom, -Kick, -Leave, -Release, -ForceRelease, -DeckSelect, -DeckConfirm, -BeginCreateDeck, -SelectClass, -SelectCardSet, -DeckEntry, -DeckBan, -Rematch, -TurnSelect, -DeckNotify, -RoomNotify, -ChatStamp, -RoomReady, -RecoveryRoom -} -} } diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerDeckOutVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerDeckOutVfx.g.cs deleted file mode 100644 index b61d8b55..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerDeckOutVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerDeckOutVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerDeckOutVfx -{ - private BattlePlayer _battlePlayer; - private BattleManagerBase _battleMgr; - public PlayerDeckOutVfx(BattlePlayer battlePlayer, BattleManagerBase battleMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerDrawCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerDrawCardVfx.g.cs deleted file mode 100644 index 13864514..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerDrawCardVfx.g.cs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerDrawCardVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerDrawCardVfx -{ - private const float MAX_Z_POSITION_MULTIPLIER = 7f; - public PlayerDrawCardVfx(IEnumerable drawCards, bool isOpenDrawSkill = false) { } - private VfxBase CardOpenVfx(IEnumerable drawCards, bool isOpenDrawSkill = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerEndDrawVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerEndDrawVfx.g.cs deleted file mode 100644 index a6763609..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerEndDrawVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerEndDrawVfx.cs -using System.Collections.Generic; -using System.Linq; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerEndDrawVfx -{ - public PlayerEndDrawVfx(IEnumerable drawCards) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerMulliganDrawVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerMulliganDrawVfx.g.cs deleted file mode 100644 index ee3e941f..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerMulliganDrawVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerMulliganDrawVfx.cs -using System.Collections.Generic; -using Wizard.Battle.Mulligan; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerMulliganDrawVfx -{ - private const float MULLIGAN_WAIT_TIME = 1f; - private const float TIMER_WAIT_TIME = 0.1f; - public PlayerMulliganDrawVfx(IEnumerable cardsDrawn, MulliganInfoControl mulliganInfoControl) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PlayerMulliganSwapVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PlayerMulliganSwapVfx.g.cs deleted file mode 100644 index a4f9c82c..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PlayerMulliganSwapVfx.g.cs +++ /dev/null @@ -1,22 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PlayerMulliganSwapVfx.cs -using System.Collections.Generic; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class PlayerMulliganSwapVfx -{ - private const float CARD_ROT_Z_PLAYER = 280f; - private const float CARD_ROT_Z_OPPONENT = -100f; - private IList m_changeList; - private List _drawCards; - private List _posIndexList; - private bool _isPlayer; - public PlayerMulliganSwapVfx(List newCards, List posList, IList oldCards, bool isPlayer) { } - private VfxBase BuryAndDrawVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private void PrepareBuryCard() { } - private VfxBase ReturnOldCardsVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase MoveCardToDeck(BattleCardBase card) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private Vector3 GetCardHolderPos() => default!; - private float GetCardRotZ() => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PpChangeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PpChangeVfx.g.cs deleted file mode 100644 index 9f470c8d..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PpChangeVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PpChangeVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class PpChangeVfx -{ - public PpChangeVfx(BattlePlayerBase battlePlayer) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/PpIncreaseVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/PpIncreaseVfx.g.cs deleted file mode 100644 index e03da01b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/PpIncreaseVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\PpIncreaseVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class PpIncreaseVfx -{ - public PpIncreaseVfx(BattlePlayerBase battlePlayerBase, int oldPp, int newPp) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ProcessingBase__Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.g.cs b/SVSim.BattleEngine/Shim/Generated/ProcessingBase__Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.g.cs deleted file mode 100644 index de3c0eb7..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ProcessingBase__Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult/ProcessingBase.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ -public partial class ProcessingBase -{ - public IProcessing NextProcessing { get; set; } - public void Execute(Parameter param) { } - protected void ExecuteNextProcessing(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ProcessingBase__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs b/SVSim.BattleEngine/Shim/Generated/ProcessingBase__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs deleted file mode 100644 index 5056b333..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ProcessingBase__Wizard.Story.ChapterSelection.SelectionProcessing.Main.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Story.ChapterSelection.SelectionProcessing.Main/ProcessingBase.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class ProcessingBase -{ - public IProcessing NextProcessing { get; set; } - public void Execute(Parameter param) { } - protected void ExecuteNextProcessing(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ProtectionColorType.g.cs b/SVSim.BattleEngine/Shim/Generated/ProtectionColorType.g.cs deleted file mode 100644 index 1b2a2514..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ProtectionColorType.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED verbatim enum (m1_stub_gen) from Shadowverse_Code_2026-05-23/Wizard.Battle.View.Vfx/ProtectionColorType.cs -namespace Wizard.Battle.View.Vfx -{ -public enum ProtectionColorType -{ -DamageCut, -Indestructible, -MultiInvalid, -DamageReflection -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ReactiveSkillActivationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ReactiveSkillActivationVfx.g.cs deleted file mode 100644 index 11bf045f..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ReactiveSkillActivationVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ReactiveSkillActivationVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class ReactiveSkillActivationVfx -{ - public ReactiveSkillActivationVfx(BattleCardBase ownerCard) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ReadOnlyVoiceInfo.g.cs b/SVSim.BattleEngine/Shim/Generated/ReadOnlyVoiceInfo.g.cs index 8d6400a6..1d84dd1a 100644 --- a/SVSim.BattleEngine/Shim/Generated/ReadOnlyVoiceInfo.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ReadOnlyVoiceInfo.g.cs @@ -6,53 +6,7 @@ namespace Wizard.Battle.View { public partial class ReadOnlyVoiceInfo { - public const string IGNORE_OPTION = "_none"; - public const string NONE_NAME = "none"; - public const int UNION_BURST_NONE = 0; - public const int UNION_BURST_NORMAL = 1; - public const int UNION_BURST_SHORT = 2; - public const int UNION_BURST_NORMAL_60 = 3; - public const int UNION_BURST_SHORT_60 = 4; - public const int UNION_BURST_NORMAL_DIRECTLY = 5; - public const int UNION_BURST_SHORT_DIRECTLY = 6; - public const int UNION_BURST_NORMAL_DIRECTLY_60 = 7; - public const int UNION_BURST_SHORT_DIRECTLY_60 = 8; - public const int UNION_BURST_PLAY = 9; - public const int SKYBOUND_ART_NONE = 10; - public const int SKYBOUND_ART_NORMAL = 11; - public const int SKYBOUND_ART_SHORT = 12; - public const int SKYBOUND_ART_NORMAL_60 = 13; - public const int SKYBOUND_ART_SHORT_60 = 14; - public const int SKYBOUND_ART_NORMAL_DIRECTLY = 15; - public const int SKYBOUND_ART_SHORT_DIRECTLY = 16; - public const int SKYBOUND_ART_NORMAL_DIRECTLY_60 = 17; - public const int SKYBOUND_ART_SHORT_DIRECTLY_60 = 18; - public const int SKYBOUND_ART_PLAY = 19; - public const int SUPER_SKYBOUND_ART_NONE = 20; - public const int SUPER_SKYBOUND_ART_NORMAL = 21; - public const int SUPER_SKYBOUND_ART_SHORT = 22; - public const int SUPER_SKYBOUND_ART_NORMAL_60 = 23; - public const int SUPER_SKYBOUND_ART_SHORT_60 = 24; - public const int SUPER_SKYBOUND_ART_NORMAL_DIRECTLY = 25; - public const int SUPER_SKYBOUND_ART_SHORT_DIRECTLY = 26; - public const int SUPER_SKYBOUND_ART_NORMAL_DIRECTLY_60 = 27; - public const int SUPER_SKYBOUND_ART_SHORT_DIRECTLY_60 = 28; - public const int SUPER_SKYBOUND_ART_PLAY = 29; - private VoiceDictionaries _voiceDictionaries; - private int _destroyCardId; - public bool HasSummonTokenVoice { get; set; } - public string VoiceId { get; set; } public ReadOnlyVoiceInfo(int cardID, CardMaster.CardMasterId cardMasterId) { } - public VoiceAndWaitTime GetPlayVoice(IReadOnlyBattleCardInfo cardInfo, BattlePlayerReadOnlyInfoPair playerPair, int executedFixedUseCostIndex, int skillVoiceIndex) => default!; - public VoiceAndWaitTime GetSummonTokenVoice() => default!; - public VoiceAndWaitTime GetEvolutionVoice() => default!; - public VoiceAndWaitTime GetAttackVoice(bool isEvolution) => default!; - public VoiceAndWaitTime GetDestroyVoice(bool isEvolution, bool isExecutedWhiteRitual) => default!; - public VoiceAndWaitTime GetSkillVoice(bool isEvolution, int skillIndex) => default!; - public int GetSkillVoiceCount(bool isEvolution) => default!; - public void SetDestroyCardId(int id) { } public static bool IsInvalidFileName(string voiceData) => default!; - public int AddAttachSkillVoice(string id) => default!; - public string GetAttachSkillVoice(int index) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/RecoveryEvolveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/RecoveryEvolveVfx.g.cs deleted file mode 100644 index 70662e60..00000000 --- a/SVSim.BattleEngine/Shim/Generated/RecoveryEvolveVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\RecoveryEvolveVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class RecoveryEvolveVfx -{ - public RecoveryEvolveVfx(BattleCardBase card, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/RefreshAttackVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/RefreshAttackVfx.g.cs deleted file mode 100644 index 767d7458..00000000 --- a/SVSim.BattleEngine/Shim/Generated/RefreshAttackVfx.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\RefreshAttackVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class RefreshAttackVfx -{ - private enum RefreshTarget - { - InField, - InHand, - InHandParam, - Max - } - private RefreshCardParamBase[] _refresh; - public RefreshAttackVfx(IBattleCardView targetCardView, int currentAtk, int baseAtk, bool forceUpdate = false, bool isNewReplayMoveTurn = false) { } - public void Play() { } - public void InitAnim() { } - public static Color GetParameterTextColor(int baseValue, int currentValue, int maxValue) => default!; - public static Color GetParameterAttackFrameColor(int baseValue, int currentValue, int maxValue) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/RefreshCardParamBase.g.cs b/SVSim.BattleEngine/Shim/Generated/RefreshCardParamBase.g.cs deleted file mode 100644 index 2084e0ee..00000000 --- a/SVSim.BattleEngine/Shim/Generated/RefreshCardParamBase.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\RefreshCardParamBase.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class RefreshCardParamBase -{ - public delegate UILabel FuncGetLabel(); - protected readonly FuncGetLabel _funcGetLabel; - protected int _newParam; - public RefreshCardParamBase(FuncGetLabel funcGetLabel, int newParam) { } - public void Exec() { } - public void SetNewParam(int newParam) { } - public int GetNewParam() => default!; - public void InitAnim() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/RefreshHealthVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/RefreshHealthVfx.g.cs deleted file mode 100644 index 3967b296..00000000 --- a/SVSim.BattleEngine/Shim/Generated/RefreshHealthVfx.g.cs +++ /dev/null @@ -1,22 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\RefreshHealthVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class RefreshHealthVfx -{ - private enum RefreshTarget - { - InField, - InHand, - InHandParam, - Max - } - private RefreshCardParamBase[] _refresh; - public RefreshHealthVfx(IBattleCardView _targetCardView, int _currentHealth, int _maxHealth, int _baseHealth, bool isNewReplayMoveTurn = false) { } - public RefreshHealthVfx(BattlePlayerBase battlePlayer, bool isNewReplayMoveTurn = false) { } - private void CreateRefresh(IBattleCardView view, int newLife, int maxLife, int baseLife, bool isNewReplayMoveTurn) { } - public void Play() { } - public void InitAnim() { } - public static Color GetParameterHealthFrameColor(int baseValue, int currentValue, int maxValue) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/RemoveChantCountVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/RemoveChantCountVfx.g.cs deleted file mode 100644 index 11591e6d..00000000 --- a/SVSim.BattleEngine/Shim/Generated/RemoveChantCountVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\RemoveChantCountVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class RemoveChantCountVfx -{ - public FieldBattleCardView m_fieldView; - public RemoveChantCountVfx(IBattleCardView cardView) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs b/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs index d34c7359..00f87b7d 100644 --- a/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ReplayController.g.cs @@ -4,26 +4,4 @@ using System.Collections.Generic; using Wizard.RoomMatch; namespace Wizard.Replay { -public partial class ReplayController -{ - private NetworkReplayBattleMgr _networkBattleMgr; - private float _constWaitTime; - private Player OwnTarget; - private Player OppoTarget; - private Dictionary ReplayLog; - private Matching _matching; - public ReplayDataHandler _replayDataHandler { get; set; } - public static void StartPlayReplay(ReplayInfoItem replayInfo, UIManager.ViewScene backScene, UIManager.ChangeViewSceneParam backSceneParam = null) { } - public static void StartPlayReplay(UIManager.ViewScene backScene, UIManager.ChangeViewSceneParam backSceneParam = null, bool isNewReplay = false, string battleId = "") { } - private ReplayController(bool isNewReplay, string battleId) { } - private IEnumerator SetUpBattle(bool isNewReplay, string battleId) => default!; - private void SetupUserInfo(RoomBattleWatchTaskBase.UserInfo reveive, Player player) { } - private void SetupReplayData(bool isNewReplay, string battleId) { } - private IEnumerator WaitTillBattleCreate(bool isNewReplay, string battleId) => default!; - private void OnReplayReady() { } - private int DecideFirstUser(int id) => default!; - private bool IsOwner(int id) => default!; - private void ParseReplayData() { } - private Dictionary ParseData(Player player) => default!; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/ReplayDataHandler.g.cs b/SVSim.BattleEngine/Shim/Generated/ReplayDataHandler.g.cs index 414f23e2..6dddb79e 100644 --- a/SVSim.BattleEngine/Shim/Generated/ReplayDataHandler.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ReplayDataHandler.g.cs @@ -1,41 +1,9 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.RoomMatch\ReplayDataHandler.cs -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using LitJson; -using UnityEngine; +// AUTHORED SHIM (pass-5): ReplayDataHandler kept as minimal no-op subclass of +// WatchDataHandler. Original auto-generated ctor chained `: base(nBattleMgr, room, ...)` +// against a 5-arg WatchDataHandler ctor that referenced types (NetworkWatchBattleMgr, +// RoomConnectController) scheduled for deletion; removed the ctor since nothing +// constructs `new ReplayDataHandler(...)` anywhere. Methods are the two the +// (still-live) NewReplayBattleMgr / NetworkReplayBattleMgr call. namespace Wizard.RoomMatch { -public partial class ReplayDataHandler -{ - private const float WAIT_TIME_SKILL_SELECT_START = 0f; - private const float WAIT_TIME_SKILL_SELECT_CARD = 0.5f; - private const float WAIT_TIME_SKILL_SELECT_CANCEL = 0.5f; - private const float WAIT_TIME_SKILL_SELECT_COMPLETE = 1f; - private const float WAIT_TIME_SKILL_CHOICE_START = 0f; - private const float WAIT_TIME_SKILL_CHOICE_SELECT = 0.2f; - private const float WAIT_TIME_SKILL_CHOICE_CANCEL = 0.5f; - private const float WAIT_TIME_SKILL_CHOICE_COMPLETE = 1f; - private const float WAIT_TIME_SKILL_FUSION_START = 0.5f; - private const float WAIT_TIME_SKILL_FUSION_SELECT = 0.5f; - private const float WAIT_TIME_SKILL_FUSION_COMPLETE = 1f; - private readonly List ReplayExceptUriList; - private readonly List _moveTurnConductOperationType; - private readonly List notResetForwardReplayOperationList; - private NetworkReplayBattleMgr _networkReplayBattleMgr; - private JsonData _stockReceiveReplayOperations; - private int _operationIndex; - public void SetOperationIndex(int index) { } - public ReplayDataHandler(NetworkWatchBattleMgr nBattleMgr, RoomConnectController room, float waitTime, bool isNewReplay, string battleId) : base(nBattleMgr, room, waitTime, isNewReplay, battleId) { } - protected void Setup(NetworkWatchBattleMgr nBattleMgr, RoomConnectController room, float waitTime) { } - public void Stop() { } - protected void ParseBattleWatchData(Dictionary received) { } - protected void CheckConnection() { } - protected IEnumerator StockDataPlayer() => default!; - private IEnumerator NewStockDataPlayer() => default!; - private void ResetForwardReplay(Dictionary frontData) { } - private float GetWaitTimeForSelectSkill(Dictionary frontData) => default!; -} } diff --git a/SVSim.BattleEngine/Shim/Generated/ReplayMoveTurnWindow.g.cs b/SVSim.BattleEngine/Shim/Generated/ReplayMoveTurnWindow.g.cs index eb549ccd..56cb7c8b 100644 --- a/SVSim.BattleEngine/Shim/Generated/ReplayMoveTurnWindow.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/ReplayMoveTurnWindow.g.cs @@ -2,17 +2,4 @@ using UnityEngine; namespace Wizard.Battle.UI { -public partial class ReplayMoveTurnWindow -{ - private static readonly Vector3 WINDOW_POS; - private UIPanel _mainPanel; - public GameObject InnerPanel; - private UIButton _bg; - private UIScrollBar _scrollBar; - private void Awake() { } - private void Start() { } - public void Show() { } - public void AdjustScrollPosition(int currentTurn, int allTurn) { } - public void Hide() { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/ReplayRecordManager.g.cs b/SVSim.BattleEngine/Shim/Generated/ReplayRecordManager.g.cs deleted file mode 100644 index b7d59b2e..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ReplayRecordManager.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Replay\ReplayRecordManager.cs -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.Replay -{ -public partial class ReplayRecordManager -{ - private NetworkBattleReplayOperationRecorder _recorder; - public virtual void SetupRecording(BattleManagerBase battleMgr) { } - public virtual void SetupBattleInfoFilter() { } - protected NetworkBattleReplayOperationRecorder CreateOperationRecorder() => default!; - protected virtual void SetupRecorderEvents(NetworkBattleReplayOperationRecorder operationRecorder, BattleManagerBase battleMgr) { } - public void SetupOperateMgrEvents(BattleManagerBase battleMgr) { } - private void SetupOperateMgrEvents(NetworkBattleReplayOperationRecorder operationRecorder, BattleManagerBase battleMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ReturnCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ReturnCardVfx.g.cs deleted file mode 100644 index 2d2e868c..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ReturnCardVfx.g.cs +++ /dev/null @@ -1,29 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ReturnCardVfx.cs -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ReturnCardVfx -{ - private const float cardWidth = 200f; - private const float enemyCenterY = -225f; - private const float enemyCenterZ = -135f; - private const float playerCenterY = 55f; - private const float playerCenterZ = -135f; - private const float topY = -40f; - private const float topZ = -130f; - private const float bottomY = -40f; - private const float bottomZ = -80f; - public ReturnCardVfx(List playerCardsToReturn, List enemyCardsToReturn, IBattleResourceMgr resourceMgr) { } - protected VfxBase CreateInPlayToHandCardVfx(BattleCardBase targetCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase CreateReturnEffectVfx(BattleCardBase targetCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase CreateLineUpCardsVfx(List playerCardsToReturn, List enemyCardsToReturn) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase CreateLineUpSingleRowVfx(List cardsToReturn, float yCoord, float zCoord, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected float CalculateXCoordInRow(int indexInLine, int totalNumberOfCardsInLine, bool isPlayer) => default!; - protected VfxBase CreateReturnCardsToHandVfx(List playerCardsToReturn, List enemyCardsToReturn) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase NormalImageChangeVfx(BattleCardBase card, IBattleResourceMgr resourceMgr) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/RoomBase.g.cs b/SVSim.BattleEngine/Shim/Generated/RoomBase.g.cs index b1599b28..8a54dbd6 100644 --- a/SVSim.BattleEngine/Shim/Generated/RoomBase.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/RoomBase.g.cs @@ -11,207 +11,10 @@ namespace Wizard.RoomMatch public partial class RoomBase { public delegate void ChangeScene(UIManager.ViewScene in_NextScene, UIManager.ChangeViewSceneParam in_Param, object sceneParam); - private const float BG_SCALE = 1.25f; - private const int BG_ORIGINAL_WIDTH = 2048; - private const int BG_ORIGINAL_HEIGHT = 1024; - private const float BG_WIDTH_SCALE = 56f; - private const float BG_HEIGHT_SCALE = 68f; - private static RoomBase _main; - public static RoomConnectController ConnectController; - protected static bool _isReturnFromBattle; - protected static Player _saveOpponentData; - private bool _isRoomReady; - private bool _isMatchingStart; - private bool _isReceiveSetupComplete; - private bool _isWaitSetupCancel; - private List _roomResourcePathListForUpdateUI; - private List _loadCardAssetList; - private bool _finishLoadCardAsset; - private RoomDeckList _roomDeckList; - private GameObject _CardDetailPrefab; - private GameObject _DeckViewPrefab; - public RoomFriendTask FriendTaskClass; - public RoomInviteFriend RoomInviteFriendClass; - public GameObject m_commentDialog; - public GameObject _stageSelectPrefab; - private SpriteRenderer _BgSprite; - private GameObject _BgEffect; - private GameObject _readyButtonRoot; - private UISprite m_btnReady; - private UILabel _labelReady; - private UISprite m_btnCancelReady; - private GameObject _firstTurnSelectRoot; - public UIButton _firstTurnChangeButton; - public UIButton _firstTurnChangeButtonBG; - public UILabel _firstTurnLabel; - public UIButton ReturnTournamentButton; - private const float WAIT_CANCEL_READY_TIME = 1f; - private bool _deckViewCloseRequest; - private Coroutine _waitCancelReady; - public UILabel m_labelRoomID; - private GameObject _roomIdRoot; - public GameObject RoomIDBaseObject; - private bool _isEventSetting; - private RoomConnectChecker _roomConnectChecker; - private ConventionInfo _conventionInfo; - private GatheringGetSelfInfoTask _gatheringGetSelfInfoTask; - private GameObject _backEffectObject; - private const string BG_IMAGE_NAME = "bg_mausoleum_1_1"; - private const string BG_MATERIAL_NAME = "scn_bg_mausoleum_1"; - private float _roomTimeoutReleaseTimer; - private bool _roomTimeoutReleasePossible; - private const float TIMEOUT_RELEASE_TIME = 1800f; - private int _resourceLoadingCounter; - private bool _isUpdateUIRequest; - private bool _isFinishReadyViewScene; - public static bool IsMatchingFinish; - private RoomRoot _roomRoot; - private Coroutine _setupCorutine; - private bool _isExistOppo; - private bool _isReady; - private static Matching _matchingInstance; - public bool IsRoomReadyComplete { get; set; } - public TopBar TopBar { get; set; } - protected DialogBase _deckDialog { get; set; } - public static DialogBase DeckConfirmDialog { get; set; } - public List RoomResourcePathList { get; set; } - public UICardList UICardListInstance { get; set; } - protected bool IsExistLoadCoroutine { get; set; } - public DeckGroupListData DeckGroupListData { get; set; } - protected ConventionDeckList ConventionDeckList { get; set; } - public bool EnableFirstViewLastUseDeck { get; set; } - public List HoFDeckList { get; set; } - public List WindFallDeckList { get; set; } - public List AvatarDeckList { get; set; } - public CardDetailUI CardDetail { get; set; } - protected DialogBase _treasureCpDialog { get; set; } public DialogBase TreasureCpGradeUpConditionDialog { get; set; } - public bool ReturnTournamentButtonVisible { get; set; } - public bool IsRecoveryRoom { get; set; } - public bool IsConvention { get; set; } - public bool IsGathering { get; set; } - public bool IsTournament { get; set; } - public bool IsTimeoutRelease { get; set; } - protected bool IsDialogLoading { get; set; } - public UIBase UIBase { get; set; } - public bool IsReceiveExitRoom { get; set; } - public bool IsExistOppo { get; set; } - public bool IsReady { get; set; } - public RoomCommonEventHandler CommonEventHandler { get; set; } - public RoomFirstTurnSelect FirstTurnSelect { get; set; } - public RoomRoot RoomRoot { get; set; } - public RoomConnectController.PositionMode OwnRole { get; set; } - public bool IsDeckOpenRule { get; set; } - public BattleParameter BattleParameterInstance { get; set; } - public long SelfSleeveIdForTwoPick { get; set; } - public OpenRoomBattleGetRecoveryParamTask RecoveryTask { get; set; } - public bool IsInitializeDone { get; set; } - public bool IsConnectSuccess { get; set; } - public RoomConnectChecker RoomConnectChecker { get; set; } - protected bool ReadyButtonEnable { get; set; } public static RoomBase GetInstance() => default!; - public static bool IsConnectControllerActive() => default!; public static void OnSoftwareReset() { } - public bool IsNeedStopNodeReceive() => default!; - protected List GetResourcePathList() => default!; - protected virtual void UpdateUIBody() { } - protected void LoadResource(List pathList, Action onFinish) { } - private void RunUpdateUIRequest() { } - protected void UpdateUI() { } - private void UpdateReadyButton() { } - protected virtual void OnChangeReady(bool ready) { } - protected virtual void OnChangeExistOwner(bool exist) { } - protected void OnChangeExistOpponent(bool exist, bool beforeValue) { } - public void SetPlayerAliveCheckDisp(bool disp) { } - public void SetOpponentAliveCheckDisp(bool disp) { } - public void OnInviteCancel() { } - public IEnumerator DisplayInviteFriendInfo(RoomVisitor friend) => default!; - public virtual void DisconnectForceExitRoom() { } - protected virtual void CloseDialog() { } - protected virtual void OnMatchingStart() { } - protected IEnumerator SetupOnlyReturnRoom(bool isBattleEnd) => default!; - protected IEnumerator SetupFinish(bool isBattleEnd) => default!; - protected virtual void SetupFinishAfterNodeParse(bool isBattleEnd) { } - protected virtual void SetupFirstOnly() { } - private void SetupReadyButton() { } - private void SetParent(GameObject parent, GameObject child) { } - protected virtual void SetupSoon() { } - protected virtual void SetupRecovery() { } - private IEnumerator Setup() => default!; - private IEnumerator SetupDeckList() => default!; - private IEnumerator StartTimeOutCorutine(int timer, Action onTimeOut = null) => default!; - private bool IsNeedWaitInitWatch() => default!; - private IEnumerator SetupReturnFromBattle(bool isBattleEnd) => default!; - private void UpdateLastGungnirSuccessTime() { } - protected virtual IEnumerator RecoveryRoom() => default!; - protected IEnumerator RecoveryRoomAfterNodeReceive() => default!; - protected virtual void RecoveryEndToEmitData() { } - private void SetupCommentRestore(bool isBattleEnd) { } - private IEnumerator SetupBase() => default!; - private void SetupBG() { } - public static void SetBgSpriteScale(SpriteRenderer spriteRenderer, float bgScale) { } - public static void AdjustBg(Transform bgSpriteRoot, Transform bgEffectRoot, float bgScale) { } - protected void OnPlayerEventOwnReady() { } - protected void OnPlayerEventOwnReadyCancel() { } - protected void OnPlayerEventOwnKick() { } - protected void OnPlayerEventOpponentEnterRoom() { } - protected void OnPlayerEventOpponentExit() { } - protected void OnPlayerEventOpponentReady() { } - protected void OnPlayerEventOpponentReadyCancel() { } - protected void OnPlayerEventOpponentSelectDeckOpen() { } - protected void OnCloseRoom() { } - public void InitializeRoot(RoomRoot root) { } - public virtual void Initialize() { } - public bool IsTournamentRoomEnd() => default!; - private void CopyConnectControllerSetting() { } - private void InitializeDeckConfirm() { } - public bool EnableFlavorVoice(bool isLocalPlayersDeck) => default!; - protected void SettingDialogCloseToGoBackScene(DialogBase dialog) { } - protected void GetBackSceneAndParam(out UIManager.ViewScene scene, out UIManager.ChangeViewSceneParam param) { scene = default!; param = default!; } - private void InitializeTopBarAndSceneChange() { } - public virtual void onClose() { } - private void ReleaseResource() { } - protected DialogBase ReleaseNetworkAndCreateExitDialog(string title, string msg) => default!; - private void ReleaseRealTimeNetwork() { } - protected void ExitOrRelease(ChangeScene in_Change, UIManager.ViewScene in_NextScene, UIManager.ChangeViewSceneParam in_Param, Action onDestroyEnd = null) { } - public static void DestroyMyRoomInfo() { } - public void CloseAllDialog() { } - protected void ForceCloseRoom() { } - private void SetExistOpponent(bool exist, bool enableEventCall) { } - protected void SetReady(bool ready) { } - public void UpdateBackKeyEnable() { } - protected void SetReadyButtonLabel(string text) { } - protected void SetButtonEnable(GameObject inButtonObject, bool inIsEnable) { } - protected void SetReadyButtonGameObjectActive(bool enable) { } - public void DeckViewClose() { } - public void DeckCardListView(DeckData deck, bool isLocalPlayersDeck) { } - private IEnumerator CardLoadCoroutine(DeckData deck, bool isLocalPlayersDeck) => default!; - private void SetupDeckCardList(DeckData deck) { } - protected void SetFooterBackBtnEnable(bool in_Enable) { } - public DialogBase CreateDialog(string title, string msg, GameObject setObject = null) => default!; - public void CreateChangeSceneDialog(UIManager.ViewScene in_NextScene, UIManager.ChangeViewSceneParam in_Param = null, Action in_MoveCallBack = null) { } - protected virtual string GetAlternativeChangeSceneDialogText() => default!; - protected virtual bool SendReady() => default!; - public void OnBtnReady(GameObject g) { } - private void OnClickTournamentExitButton(GameObject obj) { } - private void OnBtnCancelReady(GameObject g) { } - private void SuccessCancelReady() { } - private IEnumerator WaitCancelReadyCoroutine() => default!; - protected virtual void Update() { } - private void CheckMatching() { } - private void OnRoomReady() { } - public static void OnAlreadySetup() { } - public static void SettingOpponentDispData(bool isOwner, string name, long Emblem, int degree, string contry, int rank, bool isOfficialUser, int highFormatRank) { } - public static void ResetOpponentData() { } - private void AttachEvent() { } - private void CloseLoadingScene() { } - public void CreateReleaseRoomDialog() { } public static void StartDialogLoading() { } public static void FinishDiloagLoading() { } - public void OnGatheringDeckListIsEmpty() { } - protected void AttachPlayerEvent() { } - public DeckData GetDeckByDeckId(int deckId) => default!; - public void SetBattleDeckData(DeckData deck) { } - public static void ExitFailuredErrorDialog() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/RoomConnectController.g.cs b/SVSim.BattleEngine/Shim/Generated/RoomConnectController.g.cs index 9a34d2ec..c8313743 100644 --- a/SVSim.BattleEngine/Shim/Generated/RoomConnectController.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/RoomConnectController.g.cs @@ -22,141 +22,21 @@ public partial class RoomConnectController } public enum BattleRule { - None, - Bo1, - Bo3, - Bo5, - Bo3Ban, - Bo5Ban - } + None } public enum FirstTurn { - INVALID, - RANDOM, - OWNER_FIRST_TURN, - OWNER_SECOND_TURN, - MAX - } + RANDOM } public enum ConnectRoomResult { - IDLE = -1, - TIMEOUT = -2, ERROR = -3, - CONNECT_ERROR = -4, SUCCESS = 0 } private enum RoomSetupErrorAction { - CALL_ACTION, - GO_HOME, - GO_TITLE } - private const float TIMEOUT_SEC = 10f; - public const int SERVER_ROOM_TYPE_NORMAL = 1; - public const int SERVER_ROOM_TYPE_TWOPICK = 2; - public const int SERVER_ROOM_TYPE_TWOPICK_BACK_DRAFT = 3; - public const int SERVER_ROOM_TYPE_BO3 = 4; - public const int SERVER_ROOM_TYPE_BO5 = 5; - public const int SERVER_ROOM_TYPE_TWOPICK_QUBE = 6; - public const int SERVER_ROOM_TYPE_HOF = 7; - public const int SERVER_ROOM_TYPE_TWOPICK_BO3 = 8; - public const int SERVER_ROOM_TYPE_TWOPICK_BO5 = 9; - public const int SERVER_ROOM_TYPE_WINDFALL = 10; - public const int SERVER_ROOM_TYPE_AVATAR = 11; - public const int ID_NUMBER_OF_DIGIT = 5; - public const int CONVENTION_ID_NUMBER_OF_DIGIT = 5; - private string _roomId; - private DialogBase _nodeErrorDialog; - public int TotalBattleNum; - public int TotalWatchBattleNum; - public bool IsRelease; - private Coroutine _timeOutCoroutine; - private RoomWatchEventDispatch _watchEventDispatch; - public bool IsWatchBattleLoadStart; public ConnectRoomResult ConnectRoomResultType { get; set; } public bool IsEnterErrorDeckCount { get; set; } - public bool IsTournament { get; set; } - public bool IsTournamentSettled { get; set; } - public bool IsTournamentTimeOutCheack { get; set; } - public string RoomID { get; set; } - public bool IsEnableGuildInviteButton { get; set; } - public bool IsJoinGuild { get; set; } - public string DisplayRoomID { get; set; } - public bool CanUseNonPossessionCard { get; set; } - public RoomBase RoomUIClass { get; set; } - public Matching MatchingClass { get; set; } - public static RoomDialog RoomDialog { get; set; } - public bool IsDisconnectSelf { get; set; } - public RealTimeNetworkAgent NetworkAgent { get; set; } - public RoomFormatEventHandler FormatEventHandler { get; set; } - public PlayerController OwnCtrl { get; set; } - public PlayerController OppoCtrl { get; set; } - public OpenRoomBattleGetRecoveryParamTask RecoveryTask { get; set; } - public PositionMode PositionModeValue { get; set; } - public BattleParameter BattleParameterInstance { get; set; } - public static bool IsAlreadyStartBattle { get; set; } - public FirstTurn FirstTurnType { get; set; } - public bool IsRoomRecovery { get; set; } - public bool IsConvention { get; set; } - public bool IsGuildChatPost { get; set; } - public ConventionInfo ConventionInfo { get; set; } - public long SelfSleeveIdForTwoPick { get; set; } - public bool IsGathering { get; set; } - public GatheringAutoJoinTaskInfo GatheringAutoJoinTaskInfo { get; set; } - private bool _isAutoJoinEntry { get; set; } - public bool IsReceivedInitWatch { get; set; } - public bool IsConnect { get; set; } - public bool IsAvatar { get; set; } - public bool IsMultiDeckHistoryClearSoon { get; set; } - public bool IsMultiDeckRule { get; set; } - public int SelectDeckCount { get; set; } - public int BattleUseDeckCount { get; set; } - public bool IsShowHighRankFormat { get; set; } - public bool IsTwoPick { get; set; } - public bool IsChaosFormat { get; set; } - public bool IsTwoPickDraftAPI { get; set; } - public bool IsWatch { get; set; } - public bool IsPlayer { get; set; } - public bool IsPermitFriendWatch { get; set; } - public bool IsPermitGuildWatch { get; set; } - public bool IsConventionRematchEnable { get; set; } - public bool IsEnableTurnSelect { get; set; } - public static bool IsDeckBanRule(BattleRule rule) => default!; - public static bool IsMultiDeck(BattleRule rule) => default!; - public static bool IsTwoPickFormat(NetworkDefine.ServerBattleType type) => default!; - public static bool IsShowHighRankRoomRuleFormat(BattleParameter battleFormatBase) => default!; - public static int RuleBattleDeckCount(BattleRule rule) => default!; - public static int RuleSelectDeckCount(BattleRule rule) => default!; - public static bool IsTwoPickDraftMatchingAPI(TwoPickFormat rule) => default!; - public static bool IsNormalMatchingAPI(BattleParameter rule) => default!; - public static DataMgr.BattleType RoomRuleToBattleType(BattleParameter battleParameter) => default!; - public void SetConventionInfo(ConventionRoomBattleWatchTask watchTask) { } public RoomConnectController(InitializeParameter param) { } - public void InitializeWatchEventDispatch() { } - public void RemoveWatchEventDispath(bool isOwn) { } - public Matching_Room CreateMatchingRoom(bool isConvention, bool isGathering, BattleParameter battleParameter) => default!; - public void InitPlayerController() { } - public void InitializeOwnPlayer() { } - public void InitializeOpponentPlayer() { } public IEnumerator StartConnect(string battleId = "") => default!; - private void InitTimeout() { } - private void StartTimeout() { } - public IEnumerator ConnectRecoveryRoom(OpenRoomBattleGetRecoveryParamTask task) => default!; - public IEnumerator ReSetConnectCoroutine(Matching matching) => default!; - private IEnumerator TimeMeasurement(float timeout) => default!; - public void DestroyRealTimeNetwork() { } - private void ExitRoomTask() { } - private IEnumerator ConnectRealTimeNetworkAgent(bool isFirstConnect) => default!; - private void TimeoutInitNetwork() { } - private void ConnectError() { } - private bool IsCheckConnectResultType() => default!; - private bool _ResultCheck(ConnectRoomResult result, RoomSetupErrorAction errorActionType, Action inDialogCloseAction = null) => default!; - public bool IsExistNodeErrorDialog() => default!; - private void _GoHome() { } - private void _MoveView(NetworkTask.ResultCode in_ResultCode) { } - public void ClearRoomRecoveryInfo() { } - public void CommonResultCodeError(int code) { } - private bool ResultCodeError(int code) => default!; - private bool ResultCodeErrorForWatcher(int code) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/RoomConnectController_InitializeParameter.g.cs b/SVSim.BattleEngine/Shim/Generated/RoomConnectController_InitializeParameter.g.cs index 5ff7572c..1d384e0b 100644 --- a/SVSim.BattleEngine/Shim/Generated/RoomConnectController_InitializeParameter.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/RoomConnectController_InitializeParameter.g.cs @@ -14,18 +14,10 @@ public partial class RoomConnectController { public partial class InitializeParameter { - public string RoomId { get; set; } - public PositionMode PositionModeType { get; set; } - public BattleParameter BattleParameterInstance { get; set; } public ConventionInfo ConventionInfo { get; set; } public bool IsPermitFriendWatch { get; set; } public bool IsPermitGuildWatch { get; set; } - public bool IsConvention { get; set; } - public bool IsEnableConventionRematch { get; set; } public bool IsEnableTurnSelect { get; set; } - public bool IsGuildChatPost { get; set; } - public bool IsGathering { get; set; } - public GatheringAutoJoinTaskInfo GatheringAutoJoinTaskInfo { get; set; } public InitializeParameter(PositionMode positionMode, BattleParameter battleParameter, string roomId) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/RoomRuleSelectDialog.g.cs b/SVSim.BattleEngine/Shim/Generated/RoomRuleSelectDialog.g.cs index 6023ef02..8bf23332 100644 --- a/SVSim.BattleEngine/Shim/Generated/RoomRuleSelectDialog.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/RoomRuleSelectDialog.g.cs @@ -9,74 +9,9 @@ public partial class RoomRuleSelectDialog { public enum eRoomBaseRule { - NORMAL, - TWO_PICK, - MAX } - public const string ROOM_PREFAB_PATH_BASE_RULE = "UI/layoutParts/RoomRuleSelectWindow"; - private GameObject _roomDialogPrefab; - private UIGrid _gridRuleCategory; - private GameObject _baseRuleRoot; - private UIButton _baseRuluChangeButton; - private UILabel _baseRuluLabel; - private UIButton _twoPickRuleChangeButton; - private UIButton _normalRuleChangeButton; - private GameObject _twoPickRoot; - private GameObject _normalRuleRoot; - private UILabel _normalRuleLabel; - private UILabel _twoPickLabel; - private GameObject _formatRoot; - private UILabel _formatLabel; - private UIButton _formatChangeButton; - private UIToggle _friendWatchToggle; - private UIToggle _guildWatchToggle; - private RoomRuleSetting _setting; - private static RoomRuleSetting _settingSave; - private static RoomRuleSetting _settingTemp; - private static GameObject _roomDialogPrefabSave; - private bool _is2pick; - private static bool _isSelectBaseRule; - private DialogBase _dialogSelf; - private static readonly Dictionary MaintenanceDataNormal; - private static readonly Dictionary MaintenanceDataTwoPick; - private static readonly Dictionary MaintenanceDataTwoPickCube; - private static readonly Dictionary MaintenanceDataTwoPickChaos; - private static readonly Dictionary FormatMaintenanceDataList; - private static readonly Dictionary TwoPickFormatMaintenanceDataList; - private static List GetRuleListTwoPick(TwoPickFormat twoPickFormat) => default!; - private static List GetRuleListNormal(Format format) => default!; - private List GetCurrentRuleData() => default!; - private static bool IsEnableFormat(Format format) => default!; public static DialogBase Create(RoomRuleSetting ruleSetting, out RoomRuleSelectDialog roomDialog, bool isTwoPick, bool isSelectBaseRule = false) { roomDialog = default!; return default!; } - public void Initialize(RoomRuleSetting setting, DialogBase dialog, bool isTwoPick, bool isSelectBaseRule) { } - private void CheckDefaultSetting() { } - private bool IsMaintenanceBattleRule(RoomConnectController.BattleRule rule) => default!; - private bool IsMaintenanceFormat(Format format) => default!; - private bool IsMaintenanceTwoPickFormat(TwoPickFormat format) => default!; - private bool IsOnlyOneWinType() => default!; - private void RefreshSetting() { } - private void Start() { } - private void Set2PickMode() { } - private void OnClickFriendWatchButton() { } - private void OnClickGuildWatchButton() { } - private void OnChangeNormalRuleButton() { } - private void CreateTwoPickFormatDrumUI(string title, Action onSelected, Action onDecide, Action onCancel, TwoPickFormat[] formatList, Func onDisplay) { } - private void CreateDrumUI(string title, Action onSelected, Action onDecide, Action onCancel, RoomConnectController.BattleRule[] ruleData, Func onDisplay) { } - private void CreateFormatDrumUI(Action onDecide, Action onCancel) { } - private void SetDrumUICommon(string title, DialogBase ruleChangeDrumDialog, Action decideAction, Action cancelAction) { } - private void SaveCurrentSetting() { } - private void OnPushBattleTypeButton() { } - private void OnPushBaseRuluButton() { } public static RoomConnectController.BattleRule GetLastRule(KeyValuePair key, RoomConnectController.BattleRule defaultRule) => default!; public static TwoPickFormat GetLastTwoPickFormat(KeyValuePair key, TwoPickFormat defaultTwoPickFormatType) => default!; - private void OnPushCreateButton() { } - private void OnPushCancelButton() { } - private void OnClickFormatChangeButton() { } - private void OnRuleChangeDecideBOAny() { } - private static void OnRuleChangeDecide2Pick() { } - private static void OnRuleChangeDecideCommon() { } - private static void OnRuleChangeCancel() { } - private static void ReCreateDialog(RoomRuleSetting setting) { } - private bool IsEnablePreRotationFormat() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/RoomRuleSetting.g.cs b/SVSim.BattleEngine/Shim/Generated/RoomRuleSetting.g.cs index 05063ad0..911dccab 100644 --- a/SVSim.BattleEngine/Shim/Generated/RoomRuleSetting.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/RoomRuleSetting.g.cs @@ -5,15 +5,9 @@ namespace Wizard.RoomMatch public partial class RoomRuleSetting { public Action OnDecide; - public Action OnCancel; public BattleParameter BattleParameterInstance { get; set; } public bool EnableFriendWatch { get; set; } public bool EnableGuildWatch { get; set; } - public bool Is2Pick { get; set; } public RoomRuleSetting() { } - public void CopyFrom(RoomRuleSetting src) { } - public static string GetTopBarString(BattleParameter battleParameter, bool isTournament) => default!; - public static string GetBattleTypeString(BattleParameter battleParameter) => default!; - public static string GetWinTypeString(RoomConnectController.BattleRule rule) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/RoyalInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/RoyalInfomationUI.g.cs deleted file mode 100644 index 2f24ecae..00000000 --- a/SVSim.BattleEngine/Shim/Generated/RoyalInfomationUI.g.cs +++ /dev/null @@ -1,43 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\RoyalInfomationUI.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class RoyalInfomationUI -{ - private static readonly Vector3 ICON_POS_INHAND; - private static readonly Vector3 ICON_POS_INPLAY; - private static string ROYAL_ICON_PARENT; - private static readonly Vector3 ICON_SCALE; - private static readonly Vector3 ICON_SCALE_SMALL; - private static readonly Vector3 ICON_SCALE_IN_HAND; - private static readonly Vector3 ICON_SCALE_SMALL_IN_HAND; - private static readonly Vector3 ICON_MARGIN; - private static readonly Vector3 ICON_MARGIN_SMALL; - private static readonly Vector3 ICON_MARGIN_IN_HAND; - private static readonly Vector3 ICON_MARGIN_SMALL_IN_HAND; - private static readonly Vector3 ICON_OFFSET_SMALL; - private static readonly Vector3 ICON_OFFSET_IN_HAND; - private new BattlePlayerBase _player; - public RoyalInfomationUI(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(battlePlayerBase, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - public void HideAllInfomation() { } - public void HideOtherInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private void InitIconTrans(GameObject iconParent, int handIndex) { } - private void ShowIcon() { } - private void HideIcon() { } - private void HideAllIcon() { } - private List RoyalIconSpriteChange(List tribes, GameObject parentObject) => default!; - private GameObject ActivateTribeIcon(CardBasePrm.TribeType tribe, GameObject parentObject) => default!; - private IEnumerable SelectRoyalCard(IEnumerable cardList) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SelectCardProcessor.g.cs b/SVSim.BattleEngine/Shim/Generated/SelectCardProcessor.g.cs index f9a3df25..49018da6 100644 --- a/SVSim.BattleEngine/Shim/Generated/SelectCardProcessor.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/SelectCardProcessor.g.cs @@ -7,32 +7,10 @@ namespace Wizard.Battle.Touch { public partial class SelectCardProcessor { - protected readonly BattleCardBase _actCard; - protected readonly BattleManagerBase _battleManager; - protected readonly InputMgr _inputManager; - protected readonly OperateMgr _operateMgr; - protected readonly BattlePlayer _battlePlayer; - protected readonly IPlayerView _battlePlayerView; - private readonly TouchControl _touchControl; - private readonly BattleUIContainer _battleUIContainer; - private bool _stopSelectFlag; - private bool _isReleaseCard; - private bool _isPressCard; - private const float DRAG_DISTANCE_PC = 300f; - private Vector2 _mousePositionStart; public SelectCardProcessor(BattleManagerBase battleMgr, BattleCardBase actCard, InputMgr inputMgr, bool isPressCard) { } public VfxBase Start() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxBase Update(float dt, Camera camera) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public virtual VfxWith End() => default!; public virtual bool CheckIsEnd() => default!; - private void StopMovingHandCard() { } - private void HideAlert() { } - private bool UseDetailShortcutDoubleClick() => default!; - private bool UsePlayShortcutDoubleClick() => default!; - private bool OverDragDistancePlay() => default!; - private bool IsCancel() => default!; - private bool IsContinueSelection() => default!; - private bool IsStopSelection() => default!; - private bool IsOverDragDistanceHandPlay() => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/SelectedStoryInfo.g.cs b/SVSim.BattleEngine/Shim/Generated/SelectedStoryInfo.g.cs index 45f23200..5aad2659 100644 --- a/SVSim.BattleEngine/Shim/Generated/SelectedStoryInfo.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/SelectedStoryInfo.g.cs @@ -3,64 +3,20 @@ namespace Wizard.Story { public partial class SelectedStoryInfo { - public StoryEntranceType StoryEntranceType { get; set; } public StorySectionData SectionData { get; set; } - public ClassCharacterMasterData SectionCharaData { get; set; } - public ClassCharacterMasterData ChapterCharaData { get; set; } public StoryChapterData ChapterData { get; set; } - public int? SubChapterId { get; set; } - public ScenarioPart Part { get; set; } - public ScenarioOption Option { get; set; } - public ScenarioTemporaryVoice.DownloadInfo TemporaryVoiceDownloadInfo { get; set; } public int? ReleasedChapterNum { get; set; } public int? ReplayChapterIndex { get; set; } - public string[] UnlockedSelections { get; set; } - public string ChosenUnlockChapterId { get; set; } - public bool IsFailure { get; set; } - public bool IsRetire { get; set; } - public bool IsGoBadEnd { get; set; } - public int StoryId { get; set; } public int SectionId { get; set; } - public int? SectionCharaId { get; set; } public int? SectionClassId { get; set; } - public int? ChapterCharaId { get; set; } - public int? ChapterClassId { get; set; } - public string ChapterId { get; set; } public UIManager.ViewScene ChapterSelectionView { get; set; } - public bool IsTutorialCategory { get; set; } - public bool IsTutorial { get; set; } - public bool IsTutorialReplay { get; set; } public StoryApiType StoryApiType { get; set; } public string NextChapterId { get; set; } - public StoryChapterData.ChapterClearStatus ClearStatus { get; set; } public string LastChapterClearTextId { get; set; } - public bool ExistsSecondHalfStory { get; set; } - public bool ExistsBattle { get; set; } - public bool IsSkipBattle { get; set; } - public bool IsDoBattle { get; set; } - public bool IsFixedDeck { get; set; } - public bool IsClassTutorial { get; set; } - public bool IsReleasedAnotherEnding { get; set; } - public string RouteName { get; set; } - public bool IsFirstHalf { get; set; } - public bool IsSecondHalf { get; set; } - public bool IsPlayVoice { get; set; } - public int[] StartStoryIds { get; set; } public int FinishStoryId { get; set; } - public int[] AllSubStoryIds { get; set; } public SelectedStoryInfo(StoryEntranceType type) { } - public void ClearInfoForSectionSelectionScene() { } public void ClearInfoForLeaderSelectionScene() { } public void ClearInfoForChapterSelectionScene() { } - public void SetSection(int sectionId) { } - public void SetSection(StorySectionData sectionData) { } - public void SetSectionChara(int? charaId) { } public void SetSectionChara(ClassCharacterMasterData charaData) { } - public void SetChapterChara(int? charaId) { } - public void SetChapterChara(ClassCharacterMasterData charaData) { } - public void SetChapter(string chapterId, int? subChapterId) { } - public void SetChapter(StoryChapterData chapterData, int? subChapterId) { } - public void SetPart(ScenarioPart part) { } - public void SetOtherInfo(int releasedChapterNum, int? replayChapterIndex, string[] unlockedSelections) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/SetShortageDeckWinVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SetShortageDeckWinVfx.g.cs deleted file mode 100644 index f74f6f99..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SetShortageDeckWinVfx.g.cs +++ /dev/null @@ -1,22 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SetShortageDeckWinVfx.cs -using Cute; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class SetShortageDeckWinVfx -{ - private static readonly float MOVE_TIME; - private static readonly float TURN_TIME_1; - private static readonly float TURN_TIME_2; - private static readonly float END_WAIT_TIME; - private static readonly float END_MOVE_TIME; - private static readonly float MOVE_INTERMEDIATE_TIME; - public static readonly Vector3 CARD_EFFECT_POSITION; - public static readonly Vector3 CARD_EFFECT_ROTATION; - public static readonly Vector3 HALF_ROTATE_Y; - private static readonly float START_CARD_ROTATE_Y; - private static readonly float MIDDLE_CARD_ROTATE_Y; - private static readonly float END_CARD_ROTATE_Y; - public SetShortageDeckWinVfx(bool isPlayer) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ShowCardNumberLabelVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ShowCardNumberLabelVfx.g.cs deleted file mode 100644 index 815a1632..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ShowCardNumberLabelVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ShowCardNumberLabelVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class ShowCardNumberLabelVfx -{ - private readonly IBattleCardView _view; - private readonly bool _isShow; - public ShowCardNumberLabelVfx(IBattleCardView view, bool isShow) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ShowChantCountVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ShowChantCountVfx.g.cs deleted file mode 100644 index e8711164..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ShowChantCountVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ShowChantCountVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ShowChantCountVfx -{ - private static readonly string ICON_PREFAB_PATH; - public ShowChantCountVfx(BattleCardBase card, int count, IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ShowSideLogVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ShowSideLogVfx.g.cs deleted file mode 100644 index 4adf0c16..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ShowSideLogVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ShowSideLogVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class ShowSideLogVfx -{ - public ShowSideLogVfx(BattleCardBase card, SkillBase skill, SideLogControl sideLogControl, string skillDescription, float time, bool isEvol = false, BattlePlayerBase.SideLogInfo info = null, NetworkBattleReceiver.SideLogSkillInfo newReplaySkillInfo = null) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SkillEffectBattleVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SkillEffectBattleVfx.g.cs deleted file mode 100644 index ceb8a1c9..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SkillEffectBattleVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SkillEffectBattleVfx.cs -using System; -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class SkillEffectBattleVfx -{ - public SkillEffectBattleVfx(EffectBattle effect, Func startPosition, IBattleResourceMgr resourceMgr, Func getTargetPositionFunc, float delay, bool isPlayer, IBattleCardView battleCardView, EffectMgr.MoveType moveType, EffectMgr.TargetType targetType, float animationTime, IBattleCardView targetCardView = null) : base(effect, battleCardView, resourceMgr, getTargetPositionFunc) { } - public SkillEffectBattleVfx(EffectBattle effect, IBattleCardView cardView, IBattleResourceMgr resourceMgr, Func startPosition, Func getTargetPositionFunc, float delay, float animationTime, EffectMgr.MoveType moveType, bool isPlayer, Color color) : base(effect, cardView, resourceMgr, getTargetPositionFunc) { } - public SkillEffectBattleVfx(EffectBattle effect, IBattleCardView cardView, IBattleResourceMgr resourceMgr, Func startPosition, Func getTargetPositionFunc, float delay, float animationTime, EffectMgr.MoveType moveType, EffectMgr.TargetType targetType, bool isPlayer) : base(effect, cardView, resourceMgr, getTargetPositionFunc) { } - private void InitializeSkillEffectVfx(float delay, EffectMgr.MoveType moveType, EffectMgr.TargetType targetType, Func startPosition, float animationTime, bool isPlayer, IBattleCardView targetCardView = null) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SkillEvolveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SkillEvolveVfx.g.cs deleted file mode 100644 index d659b581..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SkillEvolveVfx.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SkillEvolveVfx.cs -using System; -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class SkillEvolveVfx -{ - public partial class SetPostEvolveFrameShaderVfx { } - private const float TRAIL_TRAJECTORY_ANGLE = 90f; - private const float SPIN_WAIT_TIME = 0.4f; - private const float FLASH_SKILL_WAIT_TIME = 0.3f; - public SkillEvolveVfx(BattleCardBase card, IBattleResourceMgr resourceMgr, Func getEffectObject, BattleCardBase skillOwnerCard, bool evolveMeWhenAttack) { } - private VfxBase WaitSkillEvolve(BattleCardBase skillOwnerCard) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase FloatUpVfx(BattleCardBase card) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase TransformationFlashVfx(BattleCardBase card, Func getEffectObject) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase PostEvolveSpinVfx(BattleCardBase card) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase FallDownVfx(BattleCardBase card) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public static VfxWith> LoadCardEvolveResources(BattleCardBase evolvedCard, IBattleResourceMgr resourceMgr) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SkillSelectHandCardsVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SkillSelectHandCardsVfx.g.cs deleted file mode 100644 index 6222cd52..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SkillSelectHandCardsVfx.g.cs +++ /dev/null @@ -1,48 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SkillSelectHandCardsVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class SkillSelectHandCardsVfx -{ - public enum Kind - { - Default, - Choice, - ChoiceEvolution - } - private BattleManagerBase m_BattleMgrBase; - private IList m_TargetCards; - private const float UPPER_CORDINATE_Y = 150f; - private const float CENTER_CORDINATE_Y = 0f; - private const float BOTTOM_CORDINATE_Y = -150f; - private const float FOUR_CARDS_HORIZONTAL_BORDER = 350f; - private const float CORDINATE_Z = -20f; - private const float CHOICE_CARD_RATE = 1.7f; - private static Vector3 CHOICE_CARD_POSITION_OFFSET; - private const float CHOICE_ROTATION = -11.5f; - private const float SELECTION_MOVE_Z = -5f / 128f; - private const float ROTATE_TIME = 0.4f; - private const float WAIT_TIME = 0.3f; - private const float ROTATION_RANDOM_RANGE = 10f; - private const float LOOP_TIME_MIN = 1f; - private const float LOOP_TIME_MAX = 1.5f; - private const float MOVE_AND_ROTATE_TIME = 0.3f; - private const float SCALE_TIME = 0.2f; - private readonly Vector3 EFFECT_SCALE; - private readonly Color EFFECT_COLOR_0; - private readonly Color EFFECT_COLOR_1; - private readonly Color EFFECT_COLOR_2; - private readonly Color EFFECT_COLOR_3; - private const int CHOICE_OFFSET_Y = -35; - private Kind _kind; - private bool IsChoice { get; set; } - public SkillSelectHandCardsVfx(IList targets, Kind kind = Kind.Default) { } - private VfxBase MoveHandCardsToCenter(IList PosList) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase ShiftLayer() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase MoveHandCard(IBattleCardView cardView, Vector3 pos, int index) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private void AddChoiceEffect(int index, IBattleCardView cardView) { } - public static IList CalculatePositions(int count, bool isChoice) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SocketIOEventTypes.g.cs b/SVSim.BattleEngine/Shim/Generated/SocketIOEventTypes.g.cs deleted file mode 100644 index 7d4b50f5..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SocketIOEventTypes.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED verbatim enum (m1_stub_gen) from Shadowverse_Code_2026-05-23\BestHTTP.SocketIO\SocketIOEventTypes.cs -namespace BestHTTP.SocketIO -{ -public enum SocketIOEventTypes -{ -Unknown = -1, -Connect, -Disconnect, -Event, -Ack, -Error, -BinaryEvent, -BinaryAck -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SpellBattleCardView.g.cs b/SVSim.BattleEngine/Shim/Generated/SpellBattleCardView.g.cs index 75c7edb6..35041d6d 100644 --- a/SVSim.BattleEngine/Shim/Generated/SpellBattleCardView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/SpellBattleCardView.g.cs @@ -8,13 +8,5 @@ namespace Wizard.Battle.View public partial class SpellBattleCardView { public SpellBattleCardView(BuildInfo buildInfo) : base(buildInfo) { } - public void InitializeVoiceInfo(int cardID) { } - public VfxBase LoadResource() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase GetResourcePathes(List resourceInfos) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase UnloadResource() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void UpdateParameterView(int offence, int life, int cost, string name, bool isOnField, bool isRecovery = false, bool useNormalCost = false) { } - public void UpdateOffence(int offence) { } - public void UpdateLife(int life) { } - protected InPlayCardFrameEffectControl CreateInPlayCardFrameEffectControl(BuildInfo buildInfo) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/SpellCardVfxCreator.g.cs b/SVSim.BattleEngine/Shim/Generated/SpellCardVfxCreator.g.cs deleted file mode 100644 index 4a635ec5..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SpellCardVfxCreator.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SpellCardVfxCreator.cs -using System; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class SpellCardVfxCreator -{ - private Func isActionCard; - public SpellCardVfxCreator(bool isPlayer, BattleCardBase card, IBattleCardView battleCardView, IBattleResourceMgr resourceMgr, Func isActionCard) : base(isPlayer, card, battleCardView, resourceMgr) { } - public VfxBase CreatePick() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateDestroyHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SpellChargeSkillActivationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SpellChargeSkillActivationVfx.g.cs deleted file mode 100644 index 023d994e..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SpellChargeSkillActivationVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SpellChargeSkillActivationVfx.cs -using System.Collections.Generic; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class SpellChargeSkillActivationVfx -{ - private static readonly string SPELL_CHARGE_1_EFFECT; - private static readonly string SPELL_CHARGE_1_SE; - private static readonly string SPELL_CHARGE_2_EFFECT; - private static readonly string SPELL_CHARGE_2_SE; - public SpellChargeSkillActivationVfx(List targetCardList, List addCountList, List waitIntervalList) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SpreadOutVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SpreadOutVfx.g.cs deleted file mode 100644 index 9e0dea46..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SpreadOutVfx.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SpreadOutVfx.cs -using System.Collections.Generic; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class SpreadOutVfx -{ - public partial class SortTransform { } - protected const float Z_SPAWN_OFFSET = 5f; - protected const float CARD_SORT_TIME = 0.2f; - protected const float CARD_WAIT_SORT_TIME = 0.15f; - protected const float BW_MAX = 700f; - protected const float C_BASE_X = 200f; - protected const float TOKEN_SPAWN_TIME = 0.2f; - protected const float FRAME_SPARK_TIME = 0.1f; - protected const float SPECIAL_TOKEN_FRAME_SPARK_TIME = 0.8f; - protected const float EFFECT_ALPHA_CARD_MAX = 30f; - protected const float EFFECT_ALPHA_RATE = 0.8f; - protected const float EFFECT_ALPHA_OFFSET = 0.3f; - protected bool _isVisible; - protected float GetRotationY { get; set; } - protected virtual bool IsPlaySparkEffect { get; set; } - protected VfxBase CreateSpreadOutVfx(List drawList, bool isSpecialTokenDraw = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected Vector3 GetSortPosition(List drawList, int i, int cNum) => default!; - protected Vector3 GetSortRotation(List drawList, int i, int cNum) => default!; - protected List GetSortTransforms(List drawList) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartChoiceSelectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartChoiceSelectVfx.g.cs deleted file mode 100644 index 30dfb1db..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartChoiceSelectVfx.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartChoiceSelectVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class StartChoiceSelectVfx -{ - private IList _targetCards; - private BattleCardBase _actCard; - private BattleCardBase _accelerateCard; - private readonly Vector3 CARD_REVERSE_ROTATION; - private readonly Vector3 CHOICE_CARD_SCALE; - public const float CHOICE_UI_TIME = 0.3f; - public StartChoiceSelectVfx(BattleCardBase actCard, IList list, SkillBase skill, BattleCardBase accelerateCard, bool isHandSelect, bool isEvolve, bool isChoiceBrave) { } - private VfxBase StartSelectVfx(bool isHandSelect, SkillBase skill, bool isEvolve, bool isChoiceBrave) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase HideNonTargetCardAttackEffects() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartEvolutionChoiceEffectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartEvolutionChoiceEffectVfx.g.cs deleted file mode 100644 index f924e329..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartEvolutionChoiceEffectVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartEvolutionChoiceEffectVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class StartEvolutionChoiceEffectVfx -{ - private readonly GameObject _epIconObject; - private bool _isExeption; - public StartEvolutionChoiceEffectVfx(GameObject epIconObject, bool isExeption) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartEvolutionTargetFocusVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartEvolutionTargetFocusVfx.g.cs deleted file mode 100644 index fddab257..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartEvolutionTargetFocusVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartEvolutionTargetFocusVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class StartEvolutionTargetFocusVfx -{ - private GameObject _gameObject; - public StartEvolutionTargetFocusVfx(GameObject gameObject) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartPickCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartPickCardVfx.g.cs deleted file mode 100644 index 641e1ee1..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartPickCardVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartPickCardVfx.cs -using System.Collections; -namespace Wizard.Battle.View.Vfx -{ -public partial class StartPickCardVfx -{ - public partial class WaitUntilCardIsQueuedToBePlayedVfx { } - protected readonly BattleCardBase _card; - protected readonly IBattleCardView _cardView; - protected readonly WaitUntilCardIsQueuedToBePlayedVfx waitUntilCardIsInPlayQueueVfx; - public StartPickCardVfx(IBattleCardView cardView, BattleCardBase card) { } - public VfxBase Cancel() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartPlaySpellVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartPlaySpellVfx.g.cs deleted file mode 100644 index 1072ae3c..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartPlaySpellVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartPlaySpellVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class StartPlaySpellVfx -{ - public StartPlaySpellVfx(IBattleCardView cardView, BattleCardBase card) : base(cardView, card) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartSkillSelectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartSkillSelectVfx.g.cs deleted file mode 100644 index bf8c6bd8..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartSkillSelectVfx.g.cs +++ /dev/null @@ -1,24 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartSkillSelectVfx.cs -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class StartSkillSelectVfx -{ - private readonly BattleCardBase _actCard; - private readonly SkillBase _skill; - private IList _targetCards; - private float WAIT_ITWEEN_TIMEOUT; - private bool _isFusion; - public StartSkillSelectVfx(BattleCardBase actCard, SkillBase skill, IList list, bool isHandSelect = false, bool isFusion = false) { } - private VfxBase StartSelectVfx(bool isHandSelect) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase ShowInPlaySelectFrames() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase ShowInHandSelectFrames() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase HideInHandSelectFrames() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase UpdateCostWithoutFixedUse() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private VfxBase HideNonTargetCardAttackEffects() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private void FloatUpAndDown() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StartSummonCardVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StartSummonCardVfx.g.cs deleted file mode 100644 index d2021a5c..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StartSummonCardVfx.g.cs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StartSummonCardVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class StartSummonCardVfx -{ - private new readonly BattleCardBase _card; - private new readonly IBattleCardView _cardView; - private new WaitUntilCardIsQueuedToBePlayedVfx waitUntilCardIsInPlayQueueVfx; - public StartSummonCardVfx(IBattleCardView cardView, IBattleResourceMgr resourceMgr, BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo = null) : base(cardView, card) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StopArrowMoveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StopArrowMoveVfx.g.cs deleted file mode 100644 index 721c04a8..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StopArrowMoveVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StopArrowMoveVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class StopArrowMoveVfx -{ - private readonly BattleManagerBase _battleMgr; - public StopArrowMoveVfx(BattleManagerBase battleMgr) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StopEvolutionChoiceEffectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StopEvolutionChoiceEffectVfx.g.cs deleted file mode 100644 index ce6e68a5..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StopEvolutionChoiceEffectVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StopEvolutionChoiceEffectVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class StopEvolutionChoiceEffectVfx -{ - private readonly GameObject _epIconObject; - public StopEvolutionChoiceEffectVfx(GameObject epIconObject) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StopEvolutionTargetFocasVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/StopEvolutionTargetFocasVfx.g.cs deleted file mode 100644 index 18814c45..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StopEvolutionTargetFocasVfx.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\StopEvolutionTargetFocasVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class StopEvolutionTargetFocasVfx -{ - private GameObject _gameObject; - public StopEvolutionTargetFocasVfx(GameObject gameObject) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs b/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs index 1058de07..6eac12ee 100644 --- a/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/StoryChapterSelectionUtility.g.cs @@ -9,19 +9,11 @@ namespace Wizard.Story.ChapterSelection public partial class StoryChapterSelectionUtility { public static TopBar CreateTopBar(GameObject parent, SelectedStoryInfo storyInfo, UIManager.ChangeViewSceneParam changeViewSceneParam, int sortingOrder) => default!; - public static UIManager.ViewScene GetBackScene(SelectedStoryInfo storyInfo) => default!; public static TitlePanelBase CreateTitlePanel(GameObject parent, CharaInfoPanel charaInfoPrefab, SectionInfoPanel sectionInfoPrefab, SelectedStoryInfo storyInfo) => default!; - private static TitlePanelBase CreateCharaInfoPanel(GameObject parent, CharaInfoPanel prefab, int charaId) => default!; - private static TitlePanelBase CreateSectionInfoPanel(GameObject parent, SectionInfoPanel prefab, string sectionName) => default!; public static AreaSelInfo CreateChapterRewardPanel(GameObject parent, AreaSelInfo prefab) => default!; public static IEnumerator StoryInfoTaskCoroutine(SelectedStoryInfo storyInfo) => default!; public static IEnumerator LoadAiMasterCoroutine(IReadOnlyList chapterDatas) => default!; - private static List GetAiMasterLoadInfos(IReadOnlyList chapterDatas) => default!; public static void RegisterMaintenanceChapters(IReadOnlyList chapterDatas) { } - private static void RegisterMaintenanceChapter(StoryChapterData chapterData) { } - private static bool IsMaintenanceChapter(StoryChapterData chapterData) => default!; - private static bool IsMaintenanceAiDeck(int aiId) => default!; - public static void RegisterStoryBattleDeck(DeckData deck) { } public static void RegisterStoryBattleData(BattleSettingData data) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/StoryStarter.g.cs b/SVSim.BattleEngine/Shim/Generated/StoryStarter.g.cs deleted file mode 100644 index 8bea52cc..00000000 --- a/SVSim.BattleEngine/Shim/Generated/StoryStarter.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.Main\StoryStarter.cs -using System; -using System.Collections; -using System.Linq; -using Cute; -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class StoryStarter -{ - public void Execute(Parameter param) { } - private IEnumerator ExecuteCoroutine(Parameter param) => default!; - private static void RegisterSelectedStoryInfo(Parameter param) { } - private static IEnumerator RegisterDeckCoroutine(DeckData deckData, bool isFixedDeck, int? chapterClassId) => default!; - private static IEnumerator GetDefaultDeckCoroutine(int classId, Action finishCallback) => default!; - private static void RegisterBattleData(StoryChapterData chapterData, int? chapterCharaId) { } - private static IEnumerator StoryStartTaskCoroutine(SelectedStoryInfo storyInfo) => default!; - private static void ChangeScene(StoryChapterData chapterData) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/StoryWorldDataManager.g.cs b/SVSim.BattleEngine/Shim/Generated/StoryWorldDataManager.g.cs index 9356cf5b..e80cd64a 100644 --- a/SVSim.BattleEngine/Shim/Generated/StoryWorldDataManager.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/StoryWorldDataManager.g.cs @@ -7,16 +7,5 @@ namespace Wizard.Story { public partial class StoryWorldDataManager { - private static readonly string WORLD_LIST_KEY; - private static readonly int TUTORIAL_BACKGROUND_ID; - public IReadOnlyList WorldDatas { get; set; } - public IReadOnlyList SectionDatas { get; set; } - public void SetData(JsonData jsonData) { } - private static List GetWorldDatas(JsonData jsonData) => default!; - private static StorySectionData[] GetSectionDatas(IReadOnlyList worldDatas) => default!; - private static StorySectionData[] GetSectionDatas(JsonData jsonData) => default!; - public StoryWorldData FindWorldDataByWorldId(int worldId) => default!; - public StoryWorldData FindWorldDataBySectionId(int sectionId) => default!; - public StorySectionData FindSectionData(int sectionId) => default!; } } diff --git a/SVSim.BattleEngine/Shim/Generated/SubChapterSelectionDialogDisplay.g.cs b/SVSim.BattleEngine/Shim/Generated/SubChapterSelectionDialogDisplay.g.cs deleted file mode 100644 index 4814fcca..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SubChapterSelectionDialogDisplay.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.Main\SubChapterSelectionDialogDisplay.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class SubChapterSelectionDialogDisplay -{ - public void Execute(Parameter param) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SubChapterStorySectionBtn.g.cs b/SVSim.BattleEngine/Shim/Generated/SubChapterStorySectionBtn.g.cs deleted file mode 100644 index 68bdae12..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SubChapterStorySectionBtn.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard\SubChapterStorySectionBtn.cs -using System; -using System.Collections; -using Cute; -using UnityEngine; -namespace Wizard -{ -public partial class SubChapterStorySectionBtn -{ - private UILabel _clearLabel; - private UILabel _titleLabel; - private UITexture _btnTexture; - private Texture _textureNormalImage; - private Texture _texturePressImage; - public void UnitRead(ScenarioSummary.Data data, StoryChapterData.SubChapterData subChapterData, Action unitReadAction) { } - public void AllRead(Action allAction, string allBtnPath, bool isExistMaintenanceSubChapter) { } - public void Maintenance() { } - private IEnumerator OnPressImage() => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SummaryDialogDisplay.g.cs b/SVSim.BattleEngine/Shim/Generated/SummaryDialogDisplay.g.cs deleted file mode 100644 index 0dcfbbed..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SummaryDialogDisplay.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.Main\SummaryDialogDisplay.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class SummaryDialogDisplay -{ - public void Execute(Parameter param) { } - private void OnClickNextButton(Parameter param, bool isPlayVoice, ClassCharacterMasterData selectedCharaData) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SummonCardPreperationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SummonCardPreperationVfx.g.cs deleted file mode 100644 index 8d606d43..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SummonCardPreperationVfx.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SummonCardPreperationVfx.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class SummonCardPreperationVfx -{ - public SummonCardPreperationVfx(BattleCardBase pickCard) { } - public SummonCardPreperationVfx(IEnumerable summonedCards, IEnumerable overflowCards) { } - private void PrepareCardForSummon(BattleCardBase pickCard, bool isOverflow) { } - private void PrepareCardsForSummon(IEnumerable cards) { } - private void AttachInPlayView(BattleCardBase card) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SummonCardShakeCameraVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SummonCardShakeCameraVfx.g.cs deleted file mode 100644 index 297bb052..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SummonCardShakeCameraVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SummonCardShakeCameraVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class SummonCardShakeCameraVfx -{ - public SummonCardShakeCameraVfx(BattleCardBase pickCard) { } - private int GetShakeCameraCost(BattleCardBase card) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SummonUnitOverflowVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SummonUnitOverflowVfx.g.cs deleted file mode 100644 index 5259ebea..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SummonUnitOverflowVfx.g.cs +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SummonUnitOverflowVfx.cs -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class SummonUnitOverflowVfx -{ - public SummonUnitOverflowVfx(BattleCardBase pickCard, int overflowIndex, bool isToken, IBattleResourceMgr resourceMgr, VfxBase summonEffect = null) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/SummonUnitVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/SummonUnitVfx.g.cs deleted file mode 100644 index 7d4a05ac..00000000 --- a/SVSim.BattleEngine/Shim/Generated/SummonUnitVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\SummonUnitVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class SummonUnitVfx -{ - public SummonUnitVfx(BattleCardBase pickCard, bool isToken, bool playVoice, IBattleResourceMgr resourceMgr, VfxBase summonEffect = null, bool isEvoVoice = false, float voiceWaitTime = -1f, bool isSeSysSummonLandingDuplicateCheck = false) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/TabList.g.cs b/SVSim.BattleEngine/Shim/Generated/TabList.g.cs index 3337af6f..7b96b620 100644 --- a/SVSim.BattleEngine/Shim/Generated/TabList.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/TabList.g.cs @@ -6,22 +6,10 @@ namespace Wizard.UI.Common { public partial class TabList { - private UIGrid _grid; - private Tab _partsTab; - private Transform _transform_tabOff; - private Transform _transform_tabOn; - private List _tabList; - private float _posY_tabOff; - private float _posY_tabOn; - private bool _isEnableSe; - private void Awake() { } public Tab AddTab(UIEventListener.VoidDelegate onClick, string spriteBaseName) => default!; public void Reset() { } public void Reset(bool notSelectTab) { } - private void SetGrid() { } public void SelectTabByIndex(int index, bool isForceSet) { } - private void SelectTab(Tab target, bool isForceSet) { } - private void SetTabListSprites() { } public void SetTabToGrayByIndex(int index, bool disable) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/ThinkIconHideVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ThinkIconHideVfx.g.cs deleted file mode 100644 index 4ed7a3ca..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ThinkIconHideVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ThinkIconHideVfx.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ThinkIconHideVfx -{ - public ThinkIconHideVfx(IBattleResourceMgr resourceMgr) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/ThinkIconShowVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/ThinkIconShowVfx.g.cs deleted file mode 100644 index 50d42e5a..00000000 --- a/SVSim.BattleEngine/Shim/Generated/ThinkIconShowVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\ThinkIconShowVfx.cs -using System; -using UnityEngine; -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class ThinkIconShowVfx -{ - public const string MESAGE_PREFAB_PATH = "UI/Battle/ThinkMessage"; - public ThinkIconShowVfx(Vector3 position, IBattleResourceMgr resourceMgr) { } - public ThinkIconShowVfx(Func getPosition, IBattleResourceMgr resourceMgr) { } - private GameObject CreateMessageObject(IBattleResourceMgr resourceMgr) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/TransportTypes.g.cs b/SVSim.BattleEngine/Shim/Generated/TransportTypes.g.cs deleted file mode 100644 index 67372df7..00000000 --- a/SVSim.BattleEngine/Shim/Generated/TransportTypes.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED verbatim enum (m1_stub_gen) from Shadowverse_Code_2026-05-23\BestHTTP.SocketIO.Transports\TransportTypes.cs -namespace BestHTTP.SocketIO.Transports -{ -public enum TransportTypes -{ -Polling, -WebSocket -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/TurnStartEvolveVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/TurnStartEvolveVfx.g.cs deleted file mode 100644 index 31d796bb..00000000 --- a/SVSim.BattleEngine/Shim/Generated/TurnStartEvolveVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\TurnStartEvolveVfx.cs -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class TurnStartEvolveVfx -{ - private readonly GameObject _epPanel; - private readonly bool _firstEvolve; - public TurnStartEvolveVfx(GameObject epPanel, bool firstEvolve = false) { } - private VfxBase EvolutionPossibleEffect() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/TutorialAction.g.cs b/SVSim.BattleEngine/Shim/Generated/TutorialAction.g.cs deleted file mode 100644 index 64da778b..00000000 --- a/SVSim.BattleEngine/Shim/Generated/TutorialAction.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Tutorial\TutorialAction.cs -using System; -using System.Linq; -using UnityEngine; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.Tutorial -{ -public partial class TutorialAction -{ - public enum ActionType - { - ATTACK, - PLAY, - MULLIGAN_DRAG, - MULLIGAN_SUBMIT, - EVOLVE_DRAG, - EVOLVE_OPEN_DIALOGUE, - EVOLVE, - SELECT_SELF, - SELECT_ENEMY, - OPEN_DETAIL, - POPUP, - WAIT, - NO_ACTION - } - public int targetCardID1; - public int targetCardID2; - public GameObject targetCardObject1; - public GameObject targetCardObject2; - public Func OnBecomeCurrentActionFunc; - public Action OnBecomeCurrentAction; - public Action OnActionSuccess; - public Action OnActionStart; - public Action OnActionCancel; - public ActionType actionType { get; set; } - public TutorialAction(ActionType actionType, int targetCardID1 = -1, int targetCardID2 = -1) { } - public void SetupTargetCards() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/TutorialBattleMgrBase.g.cs b/SVSim.BattleEngine/Shim/Generated/TutorialBattleMgrBase.g.cs index 2933cabb..a625c395 100644 --- a/SVSim.BattleEngine/Shim/Generated/TutorialBattleMgrBase.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/TutorialBattleMgrBase.g.cs @@ -10,122 +10,4 @@ using Wizard.BattleMgr; using Wizard.Story; namespace Wizard.Battle.Tutorial { -public partial class TutorialBattleMgrBase -{ - public partial class CustomQueue { } - public partial class TutorialConstants { } - protected Queue playerActions; - protected TutorialSingleTurnActions currentTurnActions; - protected TutorialAction currentAction; - protected int TutorialPopupCount; - protected int TutorialImageCount; - protected List TutorialDownloadPath; - protected UIButton TutoSkipBtn; - protected List TutoEffectList; - protected ResourcesManager ResourceMgr; - public bool wasTutorialMissionFailed; - private const int REGULAR_TUTORIALS_COUNT = 3; - private readonly Vector3 tapEffectOffsetFromTurnEndButton; - private readonly Vector3 tapEffectOffsetFromMulliganSubmitButton; - private readonly int tapEffectUILayer; - private readonly int tapEffectBattleLayer; - private int currentActionNumber; - private GameObject _dragAndDropObject; - private UIAnchor _dragAndDropAnchor; - private UILabel _dragAndDropLabel; - private DialogBase _dialog; - private readonly Vector2 _dragAndDropAnchorRelativeOffsetInPlay; - private readonly Vector2 _dragAndDropAnchorRelativeOffsetMulligan; - private readonly Color _dragTextTopGradientColor; - private readonly Color _dragTextBottomGradientColor; - private readonly Color _dropTextTopGradientColor; - private readonly Color _dropTextBottomGradientColor; - protected bool IsStoryTutorial { get; set; } - protected bool DisableCustomMouse { get; set; } - public Action OnEnterMulliganAbandonZone { get; set; } - public Action OnExitMulliganAbandonZone { get; set; } - public Func OnMulliganDragSuccess { get; set; } - public bool IsBattleEnd { get; set; } - public bool IsUseTutorialSkip { get; set; } - public int TutorialNumber { get; set; } - protected int PlayerCharaID { get; set; } - protected int EnemyCharaID { get; set; } - protected int EnemyClassID { get; set; } - public int GetMaxDeckCount(bool isSelf) => default!; - public TutorialBattleMgrBase(IBattleMgrContentsCreator contentsCreator) : base(contentsCreator) { } - protected virtual TouchControl CreateTouchControl() => default!; - public IInnerOptionsBuilder CreateEnemyInnerOptionsBuilder() => default!; - public void StartOpening(int FirstAttack) { } - public void SetBattleMenuBtnVisibility() { } - protected void ShowMenuButton() { } - protected void SetupEvent() { } - public void SetupBattlePlayersEvent() { } - protected void AddTutorialEffectToList(Effect effect) { } - protected void DisableAllTutorialEffects() { } - public void FinishBattle() { } - public void DisposeBattleGameObj() { } - private void LoadTutorialResources(Action callback) { } - private void StopTutorial() { } - protected void DisableSkipAndCloseCurrentDialog() { } - private void CloseCurrentDialog() { } - public void SetupCardEvent(BattleCardBase card) { } - protected void SetupInstantEndTurnConditions() { } - public void SetupEnemyAI() { } - public virtual bool IsActionTypeExecutable(TutorialAction.ActionType actionTypeToCompare) => default!; - public virtual bool IsCardSelectableDuringCurrentAction(BattleCardBase card, TutorialAction.ActionType actionType) => default!; - protected virtual bool IsCardTargetableDuringCurrentAction(BattleCardBase card, TutorialAction.ActionType actionType) => default!; - protected void DisplayTutorialPopup(float timeBeforePopupIsDisplayed, Action onCloseAction = null) { } - protected VfxBase CreateTutorialPopupVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected VfxBase CreateTutorialPopupVfx(float timeBeforePopupIsDisplayed, Action onCloseAction = null) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected void DisplayTutorialRewardsPopup(float timeBeforePopupIsDisplayed) { } - protected VfxBase CreateTutorialRewardsPopupVfx(float timeBeforePopupIsDisplayed) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected void SetupStoryAfterWinPopupAction(TutorialAction tutorialAction) { } - private void OnRequestTutorialFinish() { } - protected DialogBase CreateTutorialDialog(Action onCloseAction) => default!; - protected void DisplayNiceAnimation(Vector3 spawnPosition) { } - private Vector3 ConvertBattleCameraToUICameraCoordinates(Vector3 worldPosition) => default!; - protected void SetUpWaitAction(TutorialAction TutorialAction) { } - protected VfxBase WaitActionVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected void SetUpArrowAnimationEvents(TutorialAction tutorialAction, bool setupHandCardEvents = false, EffectMgr.EffectType arrowType = EffectMgr.EffectType.CMN_TUTORIAL_DRAG_1) { } - protected void SetupFingerAnimationEvents(TutorialAction tutorialAction, float rotationAroundZ = 0f, bool playAfterCurrentAnimationEnds = false) { } - protected void SetupFingerAnimationEvents(TutorialAction tutorialAction, Func getObjectToFollow, bool isFingerOverUI = false) { } - protected void SetupFingerAnimationEventsSetLayer(TutorialAction tutorialAction, Func getObjectToFollow, int layer) { } - protected void SetupFingerReleaseAnimationEvents(TutorialAction tutorialAction, bool useTargetCard1) { } - protected void ShowArrowAnimation(GameObject fromObject, GameObject toObject = null, EffectMgr.EffectType arrowtype = EffectMgr.EffectType.CMN_TUTORIAL_DRAG_1) { } - protected void HideArrowAnimation(GameObject targetObject, EffectMgr.EffectType arrowtype = EffectMgr.EffectType.CMN_TUTORIAL_DRAG_1) { } - protected void ShowFingerAnimation(Vector3 spawnPosition, float rotationAroundZ) { } - protected Effect ShowFingerAnimation(GameObject objectToFollow) => default!; - protected void ShowFingerAnimationOnTurnEndButton() { } - protected void HideFingerAnimation() { } - protected Effect HideFingerAnimation(GameObject objectBeingFollowed) => default!; - protected void ShowFingerReleaseAnimation(Vector3 spawnPosition) { } - protected void ShowFingerReleaseAnimation(GameObject objectToFollow) { } - protected void HideFingerReleaseAnimation() { } - protected void HideFingerReleaseAnimation(GameObject objectBeingFollowed) { } - private void ShowDragText(Vector2 relativeOffsetFromAnchor) { } - private void ShowDropText(Vector2 relativeOffsetFromAnchor) { } - private void HideDragAndDropText() { } - private void ShowDragAndDropText(Vector2 relativeOffsetFromAnchor, string textID, Color topGradient, Color bottomGradient) { } - protected void SetupSpellSelectEvents(TutorialAction tutorialAction) { } - protected void SetupEvolveFromDetailPanelEventChain(CustomQueue turnActions, int cardID) { } - protected void SetupEvolveDragArrowEvents(TutorialAction tutorialAction) { } - protected void SetupMulliganDragArrowEvents(TutorialAction tutorialAction) { } - protected void SetupMulliganSubmitEvents(TutorialAction tutorialAction) { } - protected VfxBase ExecuteTutorialAction(TutorialAction.ActionType actionType) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected virtual void ReportSuccessfulActionToServer() { } - public static void ReportSuccessfulActionToServer(int tutorialStep, int actionNumber) { } - public virtual void SetupNextTurnActions() { } - protected virtual VfxBase GetNextTutorialAction() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected virtual void SetupTutorialActionEvents() { } - protected virtual void SetupTutorialInstantEndTurnConditions(Action baseFunctionCall) { } - public VfxBase SetupInitialHandVfx() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - private BattleCardBase CreateInitialHandCard(int cardID, BattlePlayerBase battlePlayerBase) => default!; - protected virtual List CreateInitialPlayerHand() => default!; - protected virtual List CreateInitialEnemyHand() => default!; - protected List CreatePlayerDeck() => default!; - protected List CreateEnemyDeck() => default!; - protected virtual Queue CreatePlayerActions() => default!; - protected virtual Queue CreateEnemyActions() => default!; - protected virtual void InitializeDeck() { } -} } diff --git a/SVSim.BattleEngine/Shim/Generated/TutorialSingleTurnActions.g.cs b/SVSim.BattleEngine/Shim/Generated/TutorialSingleTurnActions.g.cs deleted file mode 100644 index f5a6b31d..00000000 --- a/SVSim.BattleEngine/Shim/Generated/TutorialSingleTurnActions.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.Tutorial\TutorialSingleTurnActions.cs -using System.Collections.Generic; -namespace Wizard.Battle.Tutorial -{ -public partial class TutorialSingleTurnActions -{ - private Queue turnActions; - public TutorialSingleTurnActions(Queue turnActions) { } - public TutorialAction GetNextAction() => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/TutorialStoryStarter.g.cs b/SVSim.BattleEngine/Shim/Generated/TutorialStoryStarter.g.cs deleted file mode 100644 index edaff504..00000000 --- a/SVSim.BattleEngine/Shim/Generated/TutorialStoryStarter.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Story.ChapterSelection.SelectionProcessing.Main\TutorialStoryStarter.cs -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ -public partial class TutorialStoryStarter -{ - public void Execute(Parameter param) { } - private static void RegisterSelectedStoryInfo(Parameter param) { } - private static void RegisterBattleData() { } - private static void ChangeScene(StorySectionData sectionData, StoryChapterData chapterData) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/UIManager.g.cs b/SVSim.BattleEngine/Shim/Generated/UIManager.g.cs index b228ab1f..40456206 100644 --- a/SVSim.BattleEngine/Shim/Generated/UIManager.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/UIManager.g.cs @@ -16,10 +16,7 @@ public partial class UIManager public enum ViewScene { None, - Splash, - Title, MyPage, - CommonBackGround, Battle, Room, RankMatch, @@ -28,156 +25,45 @@ public partial class UIManager StorySelectionWorld, AreaSelect, StoryChapterSelectionFlowChart, - Scenario, - Scenario2, - Prologue, - Ending, QuestSelectionPage, - PracticePuzzle, DeckList, DeckCardEdit, CardAllList, - CardDestruct, - TwoPick, Sealed, SealedCardPackOpen, SealedDeckEdit, - Convention, Colosseum, Gacha, BuildDeckPurchasePage, CardSleevePurchasePage, ClassSkinPurchasePage, Profile, - Ranking, Mission, Mail, BattlePass, - Tutorial1, - Tutorial2, - Tutorial3, - StoryTutorialElf, - StoryTutorialRoyal, - StoryTutorialWitch, - StoryTutorialDragon, - StoryTutorialNecromancer, - StoryTutorialVampire, - StoryTutorialBishop, - StoryTutorialNemesis, Guild, - Friend, LoginBonus, LotteryPage, BeginnerMission, - FreePackCampaign, - Gathering, Competition2Pick, CompetitionLobby, - BossRushLobby, RedEtherCampaignLobby, Bingo, CrossoverPortal, NeutralPopularityVote, - LeaderPopularityVote, - Max - } - public const int FLICK_LOWER_LIMIT_X = 50; - private Footer prefabFooter; - private Footer m_Footer; - private UIAtlasManager _atlasManager; - private GameObject m_myPageUICameraObj; - private DialogBase dialogOriginalClose; - private NguiObjs dialogInputOriginalClose; - private DrumrollDialog _dialogDrumrollOriginal; - private GameObject roomIdInputObj; - private GameObject frontLayer; - private GameObject SystemLayer; - private Camera frontCamera; - private LoadingBase LoadingInDownLoad; - private LoadingInScene lodingInScene; - private LoadingInScene lodingInSceneCenter; - private LoadingInScene lodingInSceneMatching; - private LoadingInScene lodingInSceneBattle; - private LoadingInScene notNetwork; - private GameObject LoadingLayer; - private GameObject NotTouchOriginal; - private GameObject NotTouch; - private FadeManager feadOriginal; - private FadeManager nowFadeObj; - private GameObject MyPageLayer; + LeaderPopularityVote } public UIRoot UIManagerRoot; - public Transform UIRootLoadingTransform; public Camera UIRootLoadingCamera; - private UIRoot _UIRootSystem; - private GameObject _support; - private DialogReportToManagement _reportToManagementDialogParts; - private RewardBase _rewardBase; public GameObject _lotteryApplyPrefab; - private RankWinnerReward _rankWinnerReward; - private GameObject _preventTouchCollider; - public UpdateSocialAccountTask _updateSocialAccountTask; - private UIBase_CardManager uiCardManager; - private NguiObjs OriginalTopBar; - public IList m_CrystalLabelList; - public IList m_RupyLabelList; - public Dictionary BackSceneDict; public Dictionary TopBarBackParameterDict; - private GameObject FirstTipsPrefab; - private GameObject FirstTipsObject; - private GameObject VideoHostingSettingRootPrefab; - private GameObject VideoHostingHUDPrefab; - private VideoHostingHUD VideoHostingHUDObject; - private GameObject _homeDialogPrefab; - private GameObject _legendCrystalBuyDialogPrefab; - private WindowResize _windowResize; - private GameObject[] RootObjects; - private Transform creatSceneUIPoint; - private IDictionary UIBaseList; - private ViewScene nowScene; public DeckCreateMenuUI _deckCreateMenuOriginal; - private SwitchLanguage _switchLanguageOriginal; - private SettingBase settingBaseOriginal; - private SettingBase _optionSettingPrefab; - private SettingFirstBattle _firstSettingOriginal; - private BuyCrystal buyCrystalOriginal; - private AccountBase accountBaseOriginal; - private FriendBase friendBaseOriginal; - private GameObject replayDialogPrefab; - private int m_LockCountOnChangeView; - private Action m_OnFinishChangeView; - private List assetBundleDatas; public bool isErrorProc; public bool isRetryProc; public bool isNoAvailMemory; - private bool _isCreateAssetFileErrorDialog; - private bool _isAssetErrorDialogUse; - public const string YELLOW_COLOR = "[ffca45]"; - public const string WHITE_COLOR = "[ffffff]"; - public const int CHARALIMIT_INPUT_USERNAME = 24; - public const int CHARALIMIT_INPUT_DECKNAME = 30; - public const int CHARALIMIT_INPUT_TRANSITIONCODE = 16; - public const int CHARALIMIT_INPUT_ACCOUNT = 0; - public const int CHARALIMIT_INPUT_DECKCODE = 16; - public const int CHARALIMIT_FIX_USERNAME = 12; - public const int CHARALIMIT_FIX_DECKNAME = 24; - public const int CHARALIMIT_FIX_TRANSITIONCODE = 16; - public const int CHARALIMIT_FIX_ACCOUNT = 0; - public const int CHARALIMIT_FIX_DECKCODE = 16; - public const UIInput.KeyboardType KEYBOARD_USERNAME = UIInput.KeyboardType.Default; - public const UIInput.KeyboardType KEYBOARD_DECKNAME = UIInput.KeyboardType.Default; - public const UIInput.KeyboardType KEYBOARD_DECKCODE = UIInput.KeyboardType.EmailAddress; - public const UIInput.KeyboardType KEYBOARD_TRANSITIONCODE = UIInput.KeyboardType.EmailAddress; - public const UIInput.KeyboardType KEYBOARD_ACCOUNT = UIInput.KeyboardType.EmailAddress; - private const float FLICK_THRESHOLD = 50f; - private const float TOUCH_INVALID_TIME = 1f; - private const int URL_DIALOG_DEPTH = 3000; - private const float CHANGEVIEWSCENE_WAITTIME = 0.5f; - private Dictionary _sceneParam; public Footer _Footer { get; set; } public DialogManager DialogManager { get; set; } public ApplicationFinishManager ApplicationFinishManager { get; set; } public GameObject MyPageUICameraObj { get; set; } - public DialogBase DialogPrefab { get; set; } public NguiObjs TextInputDialogPrefab { get; set; } public DrumrollDialog DrumrollDialogPrefab { get; set; } public DialogBase NowOpenDialog { get; set; } @@ -185,66 +71,20 @@ public partial class UIManager public Camera FrontCamera { get; set; } public int FrontCameraPixelWidth { get; set; } public int FrontCameraPixelHeight { get; set; } - public GameObject FrontLayerObject { get; set; } - public GameObject SystemLayerObject { get; set; } - public GameObject LoadingLayerObject { get; set; } - public LoadingBase LoadingInDownLoadPrefab { get; set; } - public LoadingInScene LoadingInScenePrefab { get; set; } - public LoadingInScene LoadingInSceneCenterPrefab { get; set; } - public LoadingInScene LoadingInSceneMatchingPrefab { get; set; } - public LoadingInScene LoadingInSceneBattlePrefab { get; set; } - public LoadingInScene LoadingForNetworkOfflinePrefab { get; set; } public UIRoot UIRootSystem { get; set; } public GameObject SupportDialogPrefab { get; set; } - public DialogReportToManagement DialogReportToManagement { get; set; } - public GameObject HomeDialogPrefab { get; set; } - public GameObject LegendCrystalBuyDialogPrefab { get; set; } - public bool IsCrystalDialogExe { get; set; } - public bool ApplicationHasFocus { get; set; } public bool isBattleRecovery { get; set; } - public bool IsRoomRecovery { get; set; } public WebViewHelper WebViewHelper { get; set; } public LoadingViewManager LoadingViewManager { get; set; } public bool IsTouchable { get; set; } public AccountTransferHelper AccountTransferHelper { get; set; } - public SwitchLanguage SwitchLanguagePrefab { get; set; } - public SettingBase SettingPrefab { get; set; } - public SettingBase OptionSettingPrefab { get; set; } - public SettingFirstBattle SettingFirstBattle { get; set; } - public BuyCrystal BuyCrystalPrefab { get; set; } - public AccountBase AccountBasePrefab { get; set; } - public GameObject ReplayDialogPrefab { get; set; } - public bool IsAutoCacheClearAfter { get; set; } - public bool IsFadeIn { get; set; } - public void DisposeFooterMenu() { } - public bool IsNowOpenActiveDialog() => default!; public static void ApplicationQuit() { } - private void Update() { } - private void Awake() { } - private void Start() { } - private void OnDestroy() { } public Camera getCamera() => default!; - private IEnumerator WaitUntilLoadComplete() => default!; - public bool IsLocked() => default!; - public void AssetBundleLoad(Action callback = null) { } public string GetSceneAssetPath(UIAtlasManager.AssetBundleNames assetname, string singlebundlename = "", bool isload = false) => default!; - public void AssetBundleLeaveRemove(ViewScene inLeaveScene) { } public void AddResidentAtlas(UIAtlasManager.AssetBundleNames atlasName) { } public void RemoveResidentAtlas(UIAtlasManager.AssetBundleNames atlasName) { } - private ViewScene GetFileResidentInMenu() => default!; public List GetAtlasList() => default!; - public bool getAssetBundleEnd() => default!; - public void setAssetBundleEnd(bool flag) { } - private UIBase ViewOpen(ViewScene openScene, Action beforeOpening = null) => default!; - private UIBase CreateView(ViewScene scene, Action beforeOpening = null) => default!; public void DestroyView(ViewScene scene) { } - private void DestroyView(List sceneList) { } - public void DestroyViewAll() { } - public bool isViewOpen(ViewScene scene) => default!; - public void OffView(ViewScene scene) { } - private void OffView(List sceneList) { } - public void OffViewAll() { } - public void OffViewAllOutside(ViewScene scene) { } public UIBase GetUIBase(ViewScene scene) => default!; public T GetCurrentSceneParam() where T : class => default!; public void OverrideSceneParam(ViewScene scene, object sceneParam) { } @@ -254,26 +94,17 @@ public partial class UIManager public void OnReadyViewScene(bool isFadein, Action onFinishChangeView = null, Action onFinishFadeIn = null) { } public void Force_Increment_LockCountChangeView() { } public void Force_Decrement_LockCountChangeView() { } - public void Increment_LockCountChangeView() { } - public void Decrement_LockCountChangeView() { } - private IEnumerator ChangeViewScene_Main(ViewScene nextScene, ChangeViewSceneParam param) => default!; - private IEnumerator ChangeViewScene_OnFinishWait(ViewScene nextScene, ChangeViewSceneParam param) => default!; public void UpdateFooterMenuTexture(ViewScene scene) { } public ViewScene GetCurrentScene() => default!; - private void SetCurrentScene(ViewScene scene) { } public bool IsCurrentScene(ViewScene scene) => default!; public UIBase GetUiBaseOfCurrentScene() => default!; public void OpenNotTouch() { } public void offNotTouch() { } - private void creatNotTouch() { } public DialogBase CreateDialogClose(bool isSystem = false, bool dontChangeLabelColor = false) => default!; public DialogBase CreateConfirmationDialog(string message) => default!; public void dialogAllClear() { } public void ActiveChangeDialogAll(bool active) { } - public void CloseNotLatestDialogAll() { } - public bool CloseLatestDialog() => default!; public bool isOpenDialog() => default!; - public bool isOpenLoading() => default!; public void createInSceneLoading(bool notBlack = false, bool notCollider = false, bool force = true, int playIndex = -1) { } public void closeInSceneLoading(bool force = true) { } public VfxBase CreateNowLoadingVfx(VfxBase loadResourcesVfx) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); @@ -281,23 +112,14 @@ public partial class UIManager public void closeInSceneCenterLoading(bool force = true, bool disableCollider = false) { } public LoadingInScene createInSceneLoadingMatching(bool notBlack = false, bool notCollider = false) => default!; public LoadingInScene CloseInSceneLoadingMatching() => default!; - public LoadingInScene createInSceneLoadingBattle(bool notBlack = false, bool notCollider = false) => default!; public LoadingInScene CloseInSceneLoadingBattle() => default!; public void createInSceneNotNetwork() { } public void closeInSceneNotNetwork() { } public void CreatFadeOpen(Action onFinishCallback = null) { } public void CreatFadeClose(Action onFinishCallback = null) { } - public void CreatFadeBlack() { } - public void CreatFadeObj() { } public bool isFading() => default!; - public bool IsWizardSetupFinish() => default!; - public IEnumerator CardLoadResident() => default!; - public bool MyPageHomeCardLoadDeck(GameObject returnObj, DeckData deckData, int layer) => default!; public void CardLoadSelect(GameObject returnObj, IList CardNums, int layer, bool is2D, Action onFinish = null, bool isDefaultSleeve = false, CardMaster.CardMasterId cardMasterId = CardMaster.CardMasterId.Default) { } public void CardLoadGachaPack(GameObject returnObj, IList CardNums, int layer, bool is2D, int sleeveId = 3000011) { } - public bool isCardCreatEnd() => default!; - public List getCardListObjs() => default!; - public List getSelectCardListObjs() => default!; public List getCardList2DObjs() => default!; // Shim fix (M5): return a non-null, field-wired no-op so the copied cosmetic helpers it // exposes (UIBase_CardManager.SetNumberLabelStyle/SetNameLabelStyle, read by @@ -306,40 +128,21 @@ public partial class UIManager public UIBase_CardManager getUIBase_CardManager() => UnityEngine.ShimView.Create(); public void setBackScene(GameObject obj, ViewScene backScene) { } public TopBar CreateTopBar(GameObject obj, string titleMsg, ViewScene backScene = ViewScene.None, bool MoneyDraw = true, ChangeViewSceneParam Param = null, bool isWideMode = false) => default!; - public void SetBackButtonParameter(ChangeViewSceneParam in_Param) { } public void RemoveNowSceneBackButtonParameter() { } public void UpDateCrystalNum() { } public void UpDateRupyNum() { } - public void UpdateLastRupyNum(int num) { } - public RankWinnerReward createRankWinnerReward() => default!; public void ShowFooterMenu(bool isShow) { } - private bool IsShowMyPageSubOther() => default!; public static void SetObjectToGrey(GameObject o, bool b, Color? enableTextColor = null, Dictionary changeColorDict = null) { } public void CommonRetry() { } - public void CommonResetGame() { } public FirstTips CheckFirstTips(FirstTips.TipsType TipsType, Action onFinish = null, int startPage = 0) => default!; public FirstTips StartFirstTips(FirstTips.TipsType TipsType, Action onFinish = null, int startPage = 0, int seasonId = 0) => default!; public FirstTips StartFirstTips(IEnumerable tipsTypes, Action onFinish = null, int startPage = 0, int seasonId = 0) => default!; public bool IsActiveFirstTips() => default!; - public IEnumerator FirstTipsStart(int startPage = 0) => default!; - public void CreateVideoHostingHUD(VideoHostingHUD.HUDMode mode) { } - public void DestroyVideoHostingHUD() { } - public VideoHostingHUD GetVideoHostingHUD() => default!; - public DialogBase CreateVideoHostingSettingRoot() => default!; public void SetLayerRecursive(Transform parentObj, int layer) { } - public void SetDeviceOrientation() { } - private IEnumerator SetDeviceOrientationFromBackGround() => default!; - private void OnApplicationPause(bool pauseStatus) { } - private void OnApplicationFocus(bool focus) { } public void AttachAtlas(GameObject obj, bool isTargetChildren = true) { } public void AttachAtlas(List obj_list, bool isTargetChildren = true) { } - private bool WantsToQuit() => default!; public bool IsQuitDialog() => default!; public static void ShowDialogUrl(string title, string url, Action onDialogOpening = null) { } public void CreateAssetFileErrorDialog() { } - public void SetIsAssetErrorDialogUse(bool inValue) { } - private bool IsAssetFileErrorDialogDispScene() => default!; public RewardBase GetRewardDialogPrefab() => default!; - public void DelayExecute(float delayTime, Action func) { } - private IEnumerator DelayExecuteCoroutine(float delayTime, Action func) => default!; } diff --git a/SVSim.BattleEngine/Shim/Generated/UIManager_ChangeViewSceneParam.g.cs b/SVSim.BattleEngine/Shim/Generated/UIManager_ChangeViewSceneParam.g.cs index a08fac6b..e0e7feb1 100644 --- a/SVSim.BattleEngine/Shim/Generated/UIManager_ChangeViewSceneParam.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/UIManager_ChangeViewSceneParam.g.cs @@ -16,22 +16,11 @@ public partial class ChangeViewSceneParam { public Action OnBeforeChange { get; set; } public Action OnChange { get; set; } - public float WaitTime { get; set; } - public bool IsFadeout { get; set; } - public bool IsInactive_AllView { get; set; } - public bool IsInactive_CurrentView { get; set; } - public List InactiveViewList { get; set; } - public bool IsDestroy_CurrentView { get; set; } - public bool IsDestroy_AllDialog { get; set; } - public bool IsShow_LoadingIcon { get; set; } public bool IsShow_CardIntroduction { get; set; } - public bool IsSimpleChange { get; set; } public int MyPageMenuIndex { get; set; } public bool IsCutCardMotion { get; set; } public bool IsUpdateFooterMenuTexture { get; set; } - public Action BeforeOpening { get; set; } public Action OnFinishChangeView { get; set; } public ChangeViewSceneParam() { } - public void NotWait() { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/UnitBattleCardView.g.cs b/SVSim.BattleEngine/Shim/Generated/UnitBattleCardView.g.cs index aaab0ff8..d2952ac1 100644 --- a/SVSim.BattleEngine/Shim/Generated/UnitBattleCardView.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/UnitBattleCardView.g.cs @@ -8,22 +8,6 @@ namespace Wizard.Battle.View public partial class UnitBattleCardView { public UnitBattleCardView(BuildInfo buildInfo) : base(buildInfo) { } - public void InitializeVoiceInfo(int cardID) { } - public VfxBase LoadResource() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); public VfxBase LoadAttackEffect(CardParameter.AttackEffectParameter attackEffectParameter, bool isEvolve) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase GetResourcePathes(List resourceInfos) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase UnloadResource() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void UpdateParameterView(int offence, int life, int cost, string name, bool isOnField, bool isRecovery = false, bool useNormalCost = false) { } - public void UpdateOffence(int offence) { } - public void UpdateLife(int life) { } - public void InitOffenseViewAnim() { } - public void InitLifeViewAnim() { } - public void SetTillingAndOffset(Vector2 tilling, Vector2 offset) { } - public VfxBase ShowAttackFinished() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase ShowAttackFinished(SkillBase skill) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void HideAttackFinished() { } - public VfxBase ResetCardView(CardParameter baseParameter) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - protected InPlayCardFrameEffectControl CreateInPlayCardFrameEffectControl(BuildInfo buildInfo) => default!; - public void SetNormalLabelEnable(bool isEnable) { } } } diff --git a/SVSim.BattleEngine/Shim/Generated/UnitCardVfxCreator.g.cs b/SVSim.BattleEngine/Shim/Generated/UnitCardVfxCreator.g.cs deleted file mode 100644 index 9de90279..00000000 --- a/SVSim.BattleEngine/Shim/Generated/UnitCardVfxCreator.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\UnitCardVfxCreator.cs -using Wizard.Battle.Resource; -namespace Wizard.Battle.View.Vfx -{ -public partial class UnitCardVfxCreator -{ - public UnitCardVfxCreator(bool isPlayer, BattleCardBase card, IBattleCardView battleCardView, IBattleResourceMgr resourceMgr) : base(isPlayer, card, battleCardView, resourceMgr) { } - public VfxBase CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateDamage(int damage, int currentHealth, int maxHealth, int baseHealth, bool isReflectedDamage, bool isSkillDamage) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateMaskCardInPlay() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateHeavenlyAegisStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public VfxBase CreateHeavenlyAegisStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/UpdateEpVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/UpdateEpVfx.g.cs deleted file mode 100644 index 0780477d..00000000 --- a/SVSim.BattleEngine/Shim/Generated/UpdateEpVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\UpdateEpVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class UpdateEpVfx -{ - private readonly IBattlePlayerView m_view; - private readonly int m_evolveAbleCount; - private readonly int m_evolveWaitTurnCount; - public UpdateEpVfx(IBattlePlayerView battlePlayerView, int evolveAbleCount, int evolveWaitTurnCount) { } - public void Play() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/UserInfoRequest.g.cs b/SVSim.BattleEngine/Shim/Generated/UserInfoRequest.g.cs deleted file mode 100644 index 3e17ea16..00000000 --- a/SVSim.BattleEngine/Shim/Generated/UserInfoRequest.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Title\UserInfoRequest.cs -using Cute; -using UnityEngine; -using Wizard.Battle.Recovery; -namespace Wizard.Title -{ -public partial class UserInfoRequest -{ - private readonly MonoBehaviour m_coroutineObj; - public bool IsFinished { get; set; } - public bool IsCanceled { get; set; } - public UserInfoRequest(MonoBehaviour coroutineObj) { } - public void Start() { } - private void OnLoadTaskSuccess(LoadTask loadTask) { } - private void OnReceiveDeleteAccountCanNotReset() { } - public static void DeleteUserData() { } - private void OnReceiveDeleteRegisterInfo(LoadTask task) { } - private void StartAccountDeleteCancel() { } - private void OnSuccessAccountDeleteCancel() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/VampireInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/VampireInfomationUI.g.cs deleted file mode 100644 index c897bd73..00000000 --- a/SVSim.BattleEngine/Shim/Generated/VampireInfomationUI.g.cs +++ /dev/null @@ -1,26 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\VampireInfomationUI.cs -using System.Collections.Generic; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class VampireInfomationUI -{ - private int _classLife; - private bool _isForceBerserk; - private UILabel _label1; - private UILabel _label2; - private GameObject _chainSprite; - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VampireInfomationUI(BattlePlayerBase player, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(player, battlePlayerView, orderCount, totalInfoNum) { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - private VfxBase UpdateRevengeCount(bool isNowForceVerserk, bool isPlayer = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/VideoHostingHUD.g.cs b/SVSim.BattleEngine/Shim/Generated/VideoHostingHUD.g.cs deleted file mode 100644 index 44e1798a..00000000 --- a/SVSim.BattleEngine/Shim/Generated/VideoHostingHUD.g.cs +++ /dev/null @@ -1,85 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\VideoHostingHUD.cs -using System; -using UnityEngine; -using Wizard; -using Wizard.Dialog.Setting; -public partial class VideoHostingHUD -{ - public enum HUDMode - { - Null, - Recording, - Publishing - } - public enum HUDStatus - { - Idle, - Playing, - Pause - } - private static readonly string SETTING_BUTTON_SPRITENAME_PUB_OFF; - private static readonly string SETTING_BUTTON_SPRITENAME_PUB_ON; - private static readonly string SETTING_BUTTON_SPRITENAME_REC_OFF; - private static readonly string SETTING_BUTTON_SPRITENAME_REC_ON; - private const float DELAY_PLAY_SEC = 0.3f; - private const float STATUSPOPUP_ALPHA_MIN = 0f; - private const float STATUSPOPUP_ALPHA_MAX = 1f; - private const float STATUSPOPUP_ALPHA_SPEED = 1f; - private static readonly Vector3 STATUSPOPUP_LABEL_POS_PUBLISHING; - private static readonly Vector3 STATUSPOPUP_LABEL_POS_RECORDING; - public static int CONTROLBUTTON_LAYER_DEFAULT; - public static int CONTROLBUTTON_LAYER_BATTLE; - private UIPanel _statusPopupPanel; - private UILabel _statusPopupLabel; - private UISprite _statusPopupRecSprite; - private float _statusPopupAlpha; - private bool _statusPopupAlphaDown; - private GameObject _controlButtonRoot; - private UIButton _playButton; - private UILabel _playButtonLabel; - private UIButton _settingButton; - private UISprite _settingButtonSprite; - private HUDMode _mode; - private HUDStatus _status; - private Coroutine _coroutine; - private DialogBase _menuDialog; - private VideoHostingHUDFaceCamera _faceCamera; - private bool _isInitialized; - private bool _isReqInitFromSystem; - private void Awake() { } - private void Start() { } - private void OnDestroy() { } - private void Update() { } - public bool GetInitialized() => default!; - public void SetReqInitFromSystem(bool isReq) { } - private void _InitStatusFromSystem() { } - public void Init(HUDMode mode) { } - private void _SetStatus(HUDStatus status) { } - public bool IsSettingMenuDialogOpen() => default!; - public void CloseSettingMenuDialog() { } - private void ChangeControlPopupStatus(HUDMode mode, HUDStatus status) { } - private void ChangeControlButtonStatus(HUDMode mode, HUDStatus status) { } - public void SetControlButtonLayer(int layer) { } - public void SetPushEnablePlay(bool isEnable) { } - public void SetPushEnableSetting(bool isEnable) { } - private void UpdatePopup() { } - private static bool UpdatePingPongByDeltaTime(ref float val, float min, float max, float speed, bool isdown) => default!; - public void InitFaceCameraAdjust() { } - public void EndFaceCameraAdjust() { } - public void SetFaceCameraAdjustSwitchEnable(bool isEnable) { } - public bool GetFaceCameraAdjustSwitchEnable() => default!; - public Transform GetFaceCameraWindowLocator() => default!; - private void OnClickButtonPlay() { } - private void _DelayPlay() { } - private void OnClickButtonSetting() { } - private void OnCloseRecordingMenu() { } - private void OnStartAdjustFaceCameraWindow() { } - private void OnEndAdjustFaceCameraWindow() { } - public void OnStartRecording() { } - public void OnFinishRecording() { } - public void OnPauseRecording() { } - public void OnResumeRecording() { } - public void OnStartPublishing() { } - public void OnFinishPublishing() { } - public void OnPausePublishing() { } -} diff --git a/SVSim.BattleEngine/Shim/Generated/WaitCallbackVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WaitCallbackVfx.g.cs deleted file mode 100644 index d76e0683..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WaitCallbackVfx.g.cs +++ /dev/null @@ -1,8 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WaitCallbackVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class WaitCallbackVfx -{ - public void Callback() { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WaitEventVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WaitEventVfx.g.cs deleted file mode 100644 index e7380b48..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WaitEventVfx.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WaitEventVfx.cs -using System; -using System.Collections.Generic; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class WaitEventVfx -{ - private Func _func; - private float? _timeout; - private float? _startTime; - private WaitEventVfx(Func func, float? timeout = null) { } - public void Update(float dt, List effectVfxList) { } - public static WaitEventVfx Create(Func func, float? timeout = null) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WaitLoadEffectAndSetSeVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WaitLoadEffectAndSetSeVfx.g.cs deleted file mode 100644 index 646f2180..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WaitLoadEffectAndSetSeVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WaitLoadEffectAndSetSeVfx.cs -using System; -using CriWare; -using Cute; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class WaitLoadEffectAndSetSeVfx -{ - public WaitLoadEffectAndSetSeVfx(string fileName, string criSeName, Action setEffectObject) : base(fileName, delegate(GameObject effectObject) { if (!BattleManagerBase.GetIns().IsRecovery && !GameMgr.GetIns().GetSoundMgr().IsRejectNewSound()) { if (effectObject != null && !string.IsNullOrEmpty(criSeName)) { effectObject.AddComponent().cueName = criSeName; } setEffectObject.Call(effectObject); } }) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WaitLoadEffectVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WaitLoadEffectVfx.g.cs deleted file mode 100644 index 142ad9f1..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WaitLoadEffectVfx.g.cs +++ /dev/null @@ -1,14 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WaitLoadEffectVfx.cs -using System; -using System.Collections.Generic; -using Cute; -using UnityEngine; -namespace Wizard.Battle.View.Vfx -{ -public partial class WaitLoadEffectVfx -{ - public int NowStep { get; set; } - public string FileName { get; set; } - public WaitLoadEffectVfx(string fileName, Action setEffectObject) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WaitLoadResourceVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WaitLoadResourceVfx.g.cs deleted file mode 100644 index 2fdcdf85..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WaitLoadResourceVfx.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WaitLoadResourceVfx.cs -using System; -using System.Collections.Generic; -using System.Linq; -using Cute; -namespace Wizard.Battle.View.Vfx -{ -public partial class WaitLoadResourceVfx -{ - private bool m_finishedResourcesLoading; - private readonly Action m_callback; - private readonly Action _callbackImmediately; - public List ResourcePaths { get; set; } - public WaitLoadResourceVfx(string resourcePath, Action callback = null) { } - public WaitLoadResourceVfx(IEnumerable resourcePathCollection, Action callbackImmediately = null) { } - private void StartLoad(IEnumerable resourcePathCollection) { } - public void Update(float dt, List effectVfxList) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WaitLoadVoiceResourceVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WaitLoadVoiceResourceVfx.g.cs deleted file mode 100644 index 5df04500..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WaitLoadVoiceResourceVfx.g.cs +++ /dev/null @@ -1,12 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WaitLoadVoiceResourceVfx.cs -using System.Collections.Generic; -namespace Wizard.Battle.View.Vfx -{ -public partial class WaitLoadVoiceResourceVfx -{ - private readonly IBattleCardView m_view; - private readonly string m_cueName; - public WaitLoadVoiceResourceVfx(IBattleCardView view, string voiceFileName) : base("v/vo_" + voiceFileName + ".acb") { } - public void Update(float dt, List effectVfxList) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs b/SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs deleted file mode 100644 index bd93b1b3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WatchDataHandler.g.cs +++ /dev/null @@ -1,43 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.RoomMatch\WatchDataHandler.cs -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -namespace Wizard.RoomMatch -{ -public partial class WatchDataHandler -{ - protected bool isEmitEnterRoom; - protected NetworkWatchBattleMgr _networkBattleMgr; - protected RoomConnectController _room; - private PlayerControllerForWatching _controllerForWatching; - protected StockReceiveMgr stockReceiveMessageMgr; - protected bool _isNewReplay; - protected string _battleId; - protected Coroutine _coroutineInBattle; - protected const string DATA_PARAM_VID = "vid"; - protected const string DATA_PARAM_URI = "uri"; - protected const string DATA_PARAM_TIME = "time"; - protected const string DATA_PARAM_TYPE = "type"; - protected const string DATA_PARAM_VALUE = "value"; - protected const string DATA_PARAM_CHAT_STAMP = "chatStamp"; - protected float ConstWaitTime; - private bool isFirstSeqSetting; - public int receivedMaxSequenceNum { get; set; } - public bool IsSetFirstCards { get; set; } - public WatchDataHandler(NetworkWatchBattleMgr nBattleMgr, RoomConnectController room, float waitTime, bool isNewReplay = false, string battleId = "") { } - protected virtual void Setup(NetworkWatchBattleMgr nBattleMgr, RoomConnectController room, float waitTime) { } - public virtual void Stop() { } - protected virtual void CheckConnection() { } - public void OnBattleReceived(Dictionary received) { } - protected virtual void ParseBattleWatchData(Dictionary received) { } - private void SetFirstCardsFromDeal(Dictionary received) { } - protected bool IsBattleData(Dictionary data) => default!; - public int GetWatchSequenceNum() => default!; - public int GetCurrentSequenceNumber() => default!; - public bool IsIncludedUri(string uri) => default!; - protected virtual IEnumerator StockDataPlayer() => default!; - protected void NextStockReceive(Dictionary frontData, bool isUpdateSequence = true) { } - public bool isOwner(string idStr) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WhenPlaySkillActivationVfx.g.cs b/SVSim.BattleEngine/Shim/Generated/WhenPlaySkillActivationVfx.g.cs deleted file mode 100644 index 763a1db3..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WhenPlaySkillActivationVfx.g.cs +++ /dev/null @@ -1,9 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.View.Vfx\WhenPlaySkillActivationVfx.cs -namespace Wizard.Battle.View.Vfx -{ -public partial class WhenPlaySkillActivationVfx -{ - private const float WAIT_TIME = 0.25f; - public WhenPlaySkillActivationVfx(IBattleCardView cardView) { } -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/WitchInfomationUI.g.cs b/SVSim.BattleEngine/Shim/Generated/WitchInfomationUI.g.cs deleted file mode 100644 index d7ebb736..00000000 --- a/SVSim.BattleEngine/Shim/Generated/WitchInfomationUI.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -// AUTO-GENERATED no-op stubs (m1_stub_gen) from Shadowverse_Code_2026-05-23\Wizard.Battle.UI\WitchInfomationUI.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using Wizard.Battle.View; -using Wizard.Battle.View.Vfx; -namespace Wizard.Battle.UI -{ -public partial class WitchInfomationUI -{ - private new BattlePlayerBase _player; - private readonly Vector3 SPELL_CHARGE_COUNT_POSITION; - private bool _isPlayer; - public WitchInfomationUI(BattlePlayerBase battlePlayerBase, IBattlePlayerView battlePlayerView, int orderCount, int totalInfoNum) : base(battlePlayerBase, battlePlayerView, orderCount, totalInfoNum) { } - public void ShowInfomation(bool playEffect) { } - public void HideInfomation() { } - public void HideOtherInfomation() { } - public void HideAllInfomation() { } - protected void ShowAlert() { } - protected void HideAlert() { } - public VfxBase LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - public void SetUpEvent(BattlePlayerBase player) { } - public void Recovery() { } - public void SetTouchable(bool flag) { } - private void ShowCount() { } - private void HideCount() { } - private void HideAllCount() { } - private void SpellBoostCountChange(int count, GameObject SpellBoostCount) { } - private IEnumerable SelectSpellBoostCard(IEnumerable cardList) => default!; -} -} diff --git a/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs b/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs index 1e7ad363..a33290be 100644 --- a/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/_BaseClauses.g.cs @@ -2,182 +2,86 @@ // Members live in the sibling .g.cs (base-less); this file only carries inheritance. using UnityEngine; -namespace Wizard.Battle.View.Vfx { public partial class AddTokenDeckVfx : SpreadOutVfx { } } namespace Wizard.Battle.Touch { public partial class AttackTargetSelectTouchProcessor : CardTouchProcessorBase { } } -namespace Wizard.Battle.UI { public partial class AvatarBattleBonusItem : MonoBehaviour { } } -namespace Wizard.Battle.UI { public partial class AvatarBattlePassiveBonusItem : MonoBehaviour { } } -namespace Wizard.Battle.UI { public partial class AvatarBattleTitleItem : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class AwakeSkillActivationVfx : LoadAndPlayEffectVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class BanishDeckCardVfx : OpenCardVfx { } } namespace Wizard.Battle.View { public partial class BattleEnemyView : BattlePlayerViewBase { } } -namespace Wizard.Battle.View.Vfx { public partial class BattleLoadingEndVfx : VfxBase { } } namespace Wizard.Battle.UI { public partial class BattleLogItem : MonoBehaviour { } } namespace Wizard.Battle.View { public partial class BattlePlayerView : BattlePlayerViewBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class BattleStarter : ProcessingBase { } } -namespace Wizard.Battle.View.Vfx { public partial class BerserkSkillActivationVfx : LoadAndPlayEffectVfx { } } -namespace Wizard.Battle.UI { public partial class BishopInfomationUI : ClassInfomationUIBase { } } -namespace Wizard.Battle.UI { public partial class BishopSummonTokenInfomationUI : MonoBehaviour { } } -namespace Wizard.Battle.UI { public partial class BossRushEnemySpecialSkillItem : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class CanNotTouchCardVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ChangeChantCountVfx : ShowChantCountVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class ChangeInPlayViewVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ChangeWhiteRitualCountVfx : VfxWithLoadingSequential { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class ChapterCharaDecider : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class ChapterCharaDecider : ProcessingBase { } } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { } +namespace Wizard.Battle.UI { } +namespace Wizard.Battle.UI { } +namespace Wizard.Battle.UI { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } namespace Wizard.Battle.Touch { public partial class ChoiceBraveTouchProcessor : ChoiceTouchProcessor { } } -namespace Wizard.Battle.View.Vfx { public partial class Class3dEvolveVfx : EvolveVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class ClassCardVfxCreatorBase : CardVfxCreatorBase { } } -namespace Wizard.UI.Profile { public partial class ClassPage : Page { } } +namespace Wizard.UI.Profile { } namespace Wizard.Story.ChapterSelection { public partial class CommonPrefabContainer : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class CostChangeVfx : VfxWithLoadingSequential { } } -namespace Wizard.Battle.View.Vfx { public partial class DamageVfx : DamageVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class DamageVfxBase : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class DeckChangeVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class DeckOutWinVfx : SequentialVfxPlayer { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class DeckSelectionConfirmDialogDisplay : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class DeckSelectionConfirmDialogDisplay : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class DeckSelectionDialogDisplay : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class DeckSelectionDialogDisplay : ProcessingBase { } } -namespace Wizard.Battle.View.Vfx { public partial class DeckSelfSummonVfx : SequentialVfxPlayer { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } namespace Wizard { public partial class DeckUpdateTask : BaseTask { } } -namespace Wizard.Battle.View.Vfx { public partial class DefaultOpeningVfx : OpeningVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class DelaySetupVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class DestroyVfx : VfxWithLoadingSequential { } } -namespace Wizard.UI.Dialog { public partial class DialogContactMenu : MonoBehaviour { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.UI.Dialog { } namespace Wizard.UI.Dialog { public partial class DialogSpeedChallenge : MonoBehaviour { } } namespace Wizard.UI.Dialog { public partial class DialogSpeedChallengeResult : MonoBehaviour { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class Download : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class DownloadConfirmDialogDisplay : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { public partial class DownloadInfoGetter : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class DownloadInfoGetter : ProcessingBase { } } -namespace Wizard.Battle.UI { public partial class DragonInfomationUI : ClassInfomationUIBase { } } -namespace Wizard.Battle.View.Vfx { public partial class DrawSpecialTokenVfx : SpreadOutVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class DrawTokenVfx : SpreadOutVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class DummyDeckChangeCardVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class DummyDeckRemoveCardVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class EffectBattleVfxBase : SequentialVfxPlayer { } } -namespace Wizard.Battle.UI { public partial class ElfInfomationUI : ClassInfomationUIBase { } } -namespace Wizard.Battle.Touch { public partial class EmotionHideMessageVfx : global::Wizard.Battle.View.Vfx.SequentialVfxPlayer { } } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } +namespace Wizard.Battle.UI { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.UI { } namespace Wizard.Battle.View { public partial class EnemyClassBattleCardView : ClassBattleCardViewBase { } } -namespace Wizard.Battle.View.Vfx { public partial class EnemyClassCardVfxCreator : ClassCardVfxCreatorBase { } } -namespace Wizard.Battle.View.Vfx { public partial class EnemyDeckOutVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class EnemyMulliganDrawVfx : OpponentMulliganDrawCardVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class EnemyMulliganSwapVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class EpChangeVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.Touch { public partial class EvolutionHideMessageVfx : global::Wizard.Battle.View.Vfx.SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class EvolveImageChangeVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class EvolveNameChangeVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class EvolveUnitMaskCardInPlayVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class EvolveVfx : EvolveVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class FallToGroundVfx : SequentialVfxPlayer { } } namespace Wizard.Battle.View { public partial class FieldBattleCardView : BattleCardView { } } -namespace Wizard.Battle.View.Vfx { public partial class FieldCardVfxCreator : CardVfxCreatorBase { } } -namespace Wizard.Battle.View.Vfx { public partial class FieldMaskCardInPlayVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ForecastBanishIconAttachVfx : ForecastIconVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ForecastDamageIconAttachVfx : ForecastIconVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ForecastDeathIconAttachVfx : ForecastIconVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ForecastIconVfxBase : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class ForecastRandomSkillUseCardVfx : ForecastIconVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ForecastRandomSkillUseMessageVfx : SequentialVfxPlayer { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } namespace Wizard.Battle.Touch { public partial class FusionWaitProcessor : SetCardProcessor { } } -namespace Wizard.Battle.View.Vfx { public partial class HandEffectLoopEndVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class HandEffectLoopStartVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class HideForecastRandomSkillUseMessageVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class HighRankEvolveVfx : EvolveVfxBase { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } namespace Wizard.UI.Dialog.ImageSelection { public partial class ImageSelection : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class LoadAndPlayEffectVfx : VfxWithLoadingSequential { } } namespace Wizard { public partial class MailTopTask : BaseTask { } } -namespace Wizard.Battle.View.Vfx { public partial class MetamorphoseHandCardVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class MetamorphoseInPlayCardVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class MoveToDeckVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class MulliganEndVfx : SequentialVfxPlayer { } } -namespace Wizard { public partial class MyPageTask : BaseTask { } } -namespace Wizard.Battle.UI { public partial class MyRotationBonusItem : MonoBehaviour { } } -namespace Wizard.Battle.UI { public partial class NecromanceInfomationUI : ClassInfomationUIBase { } } -namespace Wizard.Battle.View.Vfx { public partial class NecromanceSkillActivationVfx : LoadAndPlayEffectVfx { } } -namespace Wizard.Battle.UI { public partial class NemesisInfomationUI : ClassInfomationUIBase { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard { } +namespace Wizard.Battle.UI { } +namespace Wizard.Battle.UI { } +namespace Wizard.Battle.UI { } namespace Wizard.Battle.View { public partial class NonDialogPopup : MonoBehaviour { } } namespace Wizard.Battle.View { public partial class NullClassBattleCardView : NullBattleCardView { } } namespace Wizard.Battle.View { public partial class NullEnemyBattleView : BattleEnemyView { } } namespace Wizard.Battle.View { public partial class NullFieldBattleCardView : FieldBattleCardView { } } namespace Wizard.Battle.View { public partial class NullPlayerBattleView : BattlePlayerView { } } -namespace Wizard.Battle.View.Vfx { public partial class OneShotHeavenlyAegisPlayVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class OpenCardFromHandVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class OpenCardVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class OpponentDrawCardToHandVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class OpponentDrawCardVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class OpponentMulliganDrawCardVfx : SequentialVfxPlayer { } } -namespace Wizard.UI.Profile { public partial class Page : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayCRISoundVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayEffectAndSeVfx : PlayEffectVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayEffectVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerAndEnemyReadyVfx : SequentialVfxPlayer { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.UI.Profile { } +namespace Wizard.Battle.View.Vfx { } namespace Wizard.Battle.View { public partial class PlayerClassBattleCardView : ClassBattleCardViewBase { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerClassCardVfxCreator : ClassCardVfxCreatorBase { } } -namespace Wizard.RoomMatch { public partial class PlayerControllerForOwn : PlayerController { } } -namespace Wizard.RoomMatch { public partial class PlayerControllerForWatching : PlayerController { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerDeckOutVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerDrawCardVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerEndDrawVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerMulliganDrawVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class PlayerMulliganSwapVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class PpChangeVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class PpIncreaseVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class ReactiveSkillActivationVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class RecoveryEvolveVfx : EvolveVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class RefreshAttackVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class RefreshHealthVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class RemoveChantCountVfx : VfxBase { } } -namespace Wizard.RoomMatch { public partial class ReplayDataHandler : WatchDataHandler { } } -namespace Wizard.Battle.UI { public partial class ReplayMoveTurnWindow : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class ReturnCardVfx : SequentialVfxPlayer { } } +namespace Wizard.RoomMatch { } +namespace Wizard.RoomMatch { } +namespace Wizard.RoomMatch { } +namespace Wizard.Battle.UI { } namespace Wizard.RoomMatch { public partial class RoomBase : MonoBehaviour { } } namespace Wizard.RoomMatch { public partial class RoomRuleSelectDialog : MonoBehaviour { } } -namespace Wizard.Battle.UI { public partial class RoyalInfomationUI : ClassInfomationUIBase { } } -namespace Wizard.Battle.View.Vfx { public partial class SetShortageDeckWinVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class ShowCardNumberLabelVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class ShowChantCountVfx : VfxWithLoadingSequential { } } -namespace Wizard.Battle.View.Vfx { public partial class ShowSideLogVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class SkillEffectBattleVfx : EffectBattleVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class SkillEvolveVfx : EvolveVfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class SkillSelectHandCardsVfx : SequentialVfxPlayer { } } +namespace Wizard.Battle.UI { } namespace Wizard.Battle.View { public partial class SpellBattleCardView : BattleCardView { } } -namespace Wizard.Battle.View.Vfx { public partial class SpellCardVfxCreator : CardVfxCreatorBase { } } -namespace Wizard.Battle.View.Vfx { public partial class SpellChargeSkillActivationVfx : VfxWithLoadingSequential { } } -namespace Wizard.Battle.View.Vfx { public partial class SpreadOutVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class StartChoiceSelectVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class StartEvolutionChoiceEffectVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class StartEvolutionTargetFocusVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class StartPickCardVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class StartPlaySpellVfx : StartPickCardVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class StartSkillSelectVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class StartSummonCardVfx : StartPickCardVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class StopArrowMoveVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class StopEvolutionChoiceEffectVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class StopEvolutionTargetFocasVfx : VfxBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class StoryStarter : ProcessingBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class SubChapterSelectionDialogDisplay : ProcessingBase { } } -namespace Wizard { public partial class SubChapterStorySectionBtn : MonoBehaviour { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class SummaryDialogDisplay : ProcessingBase { } } -namespace Wizard.Battle.View.Vfx { public partial class SummonCardPreperationVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class SummonCardShakeCameraVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class SummonUnitOverflowVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class SummonUnitVfx : SequentialVfxPlayer { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } +namespace Wizard { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } namespace Wizard.UI.Common { public partial class TabList : MonoBehaviour { } } -namespace Wizard.Battle.View.Vfx { public partial class ThinkIconHideVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class ThinkIconShowVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class TurnStartEvolveVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.Tutorial { public partial class TutorialBattleMgrBase : BattleManagerBase { } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { public partial class TutorialStoryStarter : ProcessingBase { } } +namespace Wizard.Battle.Tutorial { } +namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { } namespace Wizard.Battle.View { public partial class UnitBattleCardView : BattleCardView { } } -namespace Wizard.Battle.View.Vfx { public partial class UnitCardVfxCreator : CardVfxCreatorBase { } } -namespace Wizard.Battle.View.Vfx { public partial class UpdateEpVfx : VfxBase { } } -namespace Wizard.Battle.UI { public partial class VampireInfomationUI : ClassInfomationUIBase { } } -namespace Wizard.Battle.View.Vfx { public partial class WaitCallbackVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class WaitEventVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class WaitLoadEffectAndSetSeVfx : WaitLoadEffectVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class WaitLoadEffectVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.View.Vfx { public partial class WaitLoadResourceVfx : VfxBase { } } -namespace Wizard.Battle.View.Vfx { public partial class WaitLoadVoiceResourceVfx : WaitLoadResourceVfx { } } -namespace Wizard.Battle.View.Vfx { public partial class WhenPlaySkillActivationVfx : SequentialVfxPlayer { } } -namespace Wizard.Battle.UI { public partial class WitchInfomationUI : ClassInfomationUIBase { } } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.UI { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.View.Vfx { } +namespace Wizard.Battle.UI { } diff --git a/SVSim.BattleEngine/Shim/Generated/_IfaceImpl.g.cs b/SVSim.BattleEngine/Shim/Generated/_IfaceImpl.g.cs index 3d697525..e44744fe 100644 --- a/SVSim.BattleEngine/Shim/Generated/_IfaceImpl.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/_IfaceImpl.g.cs @@ -99,54 +99,6 @@ namespace Wizard.Battle.View { VfxBase global::Wizard.Battle.View.IBattleCardView.HideBattleCardIcon() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); } } -namespace Wizard.Battle.View.Vfx { - using UnityEngine; - public partial class CardVfxCreatorBase : global::Wizard.Battle.View.Vfx.ICardVfxCreator { - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDraw(Vector3 pos, bool isCardRare) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreatePick() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDestroy(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDestroyHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateBanish(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxWithLoading global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateBanishHand(BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => default!; - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateGeton(Transform vehicleCardPosition, IBattleCardView vehicleCardView, BattleCardBase.DeathTypeInformation deathTypes, BattlePlayerBase battlePlayerBase) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxWithLoading global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateFusionHand(BattlePlayerBase battlePlayerBase, IBattleCardView fusionCard, bool isFusionMetamorphose) => default!; - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateParameterChange(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool isDead = false, bool isEvolve = false, bool skipWait = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateBuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateBuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDebuffStart(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDebuffStop(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateBuffStartInHand(BattleCardBase.ParameterChangeInformation parameterChangeInfo, bool useWait = true, bool isDebuff = false) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateGuardStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateGuardStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateKillerStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateKillerStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateProtectionStart(ProtectionColorType tyep) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateProtectionStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateNotBeAttackedStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateNotBeAttackedStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateUntouchableStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateUntouchableStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateQuick(bool hasAttacksRemaining, bool isCardUnableToAttackClass) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateSneakStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateSneakStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateForceCantAttackStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateForceCantAttackStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDrainStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDrainStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateAttack(IBattleCardView attackCardView, IBattleCardView attackTargetCardView) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateAttackFloatUp() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateAttackFloatDown(bool isAttacker, bool isDead, int attackableCount) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateMoving(Vector3 pos) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateDamage(int damage, int currentHealth, int maxHealth, int baseHealth, bool isReflectedDamage, bool IsSkillDamage) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateHealing(int healAmount, int currentHealth, int maxHealth, int baseHealth) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateMaskCardInPlay() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateReflectionStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateReflectionStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateHeavenlyAegisStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateHeavenlyAegisStop() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - VfxBase global::Wizard.Battle.View.Vfx.ICardVfxCreator.CreateChangeAffiliation(BattleCardBase card, CardBasePrm.ClanType clan, bool showEffect) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - } -} namespace Wizard.Battle.View { using System; using System.Collections.Generic; @@ -423,18 +375,4 @@ namespace Wizard.Battle.View { namespace Wizard.Battle.UI { using UnityEngine; using Wizard.Battle.View.Vfx; - public partial class ClassInfomationUIBase : global::Wizard.Battle.UI.IClassInfomationUI { - void global::Wizard.Battle.UI.IClassInfomationUI.ShowInfomation(bool playEffect = true) { } - void global::Wizard.Battle.UI.IClassInfomationUI.NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo) { } - void global::Wizard.Battle.UI.IClassInfomationUI.HideInfomation() { } - void global::Wizard.Battle.UI.IClassInfomationUI.HideOtherInfomation() { } - void global::Wizard.Battle.UI.IClassInfomationUI.HideAllInfomation() { } - VfxBase global::Wizard.Battle.UI.IClassInfomationUI.LoadResources(Transform parent, bool isPlayer) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance(); - void global::Wizard.Battle.UI.IClassInfomationUI.SetUpEvent(BattlePlayerBase player) { } - void global::Wizard.Battle.UI.IClassInfomationUI.Recovery() { } - GameObject global::Wizard.Battle.UI.IClassInfomationUI.GetInfomationUI() => default!; - void global::Wizard.Battle.UI.IClassInfomationUI.SetIsSelect(bool flg) { } - void global::Wizard.Battle.UI.IClassInfomationUI.SetInCardFocus(bool flg) { } - void global::Wizard.Battle.UI.IClassInfomationUI.SetTouchable(bool flg) { } - } } diff --git a/SVSim.BattleEngine/Shim/Generated/_InterfaceReattach.g.cs b/SVSim.BattleEngine/Shim/Generated/_InterfaceReattach.g.cs index 4cdb374c..3c948aef 100644 --- a/SVSim.BattleEngine/Shim/Generated/_InterfaceReattach.g.cs +++ b/SVSim.BattleEngine/Shim/Generated/_InterfaceReattach.g.cs @@ -4,24 +4,8 @@ namespace Wizard.Battle.Replay { public partial class NullReplayRecordManager : global::Wizard.Battle.Replay.IReplayRecordManager { } - public partial class ReplayRecordManager : global::Wizard.Battle.Replay.IReplayRecordManager { } } namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult { - public partial class BattleStarter : global::Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.IProcessing { } - public partial class ChapterCharaDecider : global::Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.IProcessing { } - public partial class DeckSelectionConfirmDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.IProcessing { } - public partial class DeckSelectionDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.IProcessing { } - public partial class Download : global::Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.IProcessing { } - public partial class DownloadInfoGetter : global::Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult.IProcessing { } } namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main { - public partial class ChapterCharaDecider : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class DeckSelectionConfirmDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class DeckSelectionDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class DownloadConfirmDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class DownloadInfoGetter : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class StoryStarter : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class SubChapterSelectionDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class SummaryDialogDisplay : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } - public partial class TutorialStoryStarter : global::Wizard.Story.ChapterSelection.SelectionProcessing.Main.IProcessing { } } diff --git a/SVSim.BattleEngine/Shim/GodObjects/ClosureStubs.cs b/SVSim.BattleEngine/Shim/GodObjects/ClosureStubs.cs index b682cd51..ccef9949 100644 --- a/SVSim.BattleEngine/Shim/GodObjects/ClosureStubs.cs +++ b/SVSim.BattleEngine/Shim/GodObjects/ClosureStubs.cs @@ -1,38 +1,16 @@ -// Empty type stubs to satisfy references from full-surface generated god-object stubs. -// Each is referenced only as a type in a no-op signature; members (if any) surface in a -// later frontier wave and can be filled by m1_stub_gen --type . -public partial class FadeManager { } -public partial class FriendBase { } -public partial class RoomDialog { } -public partial class VideoHostingHUDFaceCamera { } namespace Wizard { - public partial class ConventionRoomBattleWatchTask { } - public partial class OpenRoomBattleGetRecoveryParamTask { } - public partial class ScenarioOption { } - public partial class AppleLogin { public partial class Error { } } - public partial class ScenarioTemporaryVoice { public partial class DownloadInfo { } } } namespace Wizard.RoomMatch { - public partial class PlayerController { public Player Target { get; } } public partial class RoomBase { } - public partial class RoomFormatEventHandler { } - public partial class RoomWatchEventDispatch { } public partial class RoomRoot : global::UIBase { public void CreateChangeSceneDialog(UIManager.ViewScene nextScene, UIManager.ChangeViewSceneParam param = null, System.Action moveCallBack = null) { } } - public partial class RoomConnectChecker { } - public partial class RoomVisitor { } - public partial class RoomInviteFriend { } - public partial class RoomFirstTurnSelect { } - public partial class RoomDeckList { } - public partial class RoomCommonEventHandler { } } namespace Wizard.UIFriend { - public partial class RoomFriendTask { } } namespace Wizard.UI.Common @@ -42,26 +20,20 @@ namespace Wizard.UI.Common namespace Wizard.UI.Dialog.ImageSelection { - public partial class ImageSelectionBaseUI { } } namespace Wizard.Battle.UI { - public partial class BattleLogButton { } - public partial class BattleLogItemSet { } } namespace Wizard.UI.ReportToManagement { - public partial class DialogReportToManagement { public static DialogBase Create(long battleId = -1L) => default!; } } namespace Wizard.Dialog.Setting { - public partial class SettingFirstBattle { } } namespace Cute { - public partial class UpdateSocialAccountTask { } } diff --git a/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs b/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs index 333d63c5..9959347d 100644 --- a/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs +++ b/SVSim.BattleEngine/Shim/GodObjects/GodObjects.cs @@ -15,27 +15,13 @@ public class EffectMgr { public enum EffectType { - NONE, CMN_INPUT_TOUCH_1, CMN_INPUT_TOUCH_2, CMN_INPUT_DRAG_1, CMN_CARD_MOVE_1, CMN_CARD_MOVE_2, CMN_CARD_DRAW_2, CMN_CARD_DRAW_4, CMN_CARD_RETURN_1, CMN_CARD_SET_1, CMN_CARD_SET_2, CMN_CARD_SET_3, CMN_CARD_SET_4, CMN_CARD_ACCELERATE_1, CMN_CARD_CRYSTALLIZE_1, CMN_CARD_RARE_1, CMN_CARD_ATTACK_1, CMN_CARD_LANDING_1, CMN_CARD_TARGET_1, CMN_CARD_TARGET_2, CMN_CARD_TARGET_3, CMN_CARD_TARGET_4, CMN_CARD_SELECT_3, CMN_CARD_DAMAGE_1, CMN_CARD_DAMAGE_3, CMN_CARD_EVO_4, CMN_CLASS_APPEAR_1, CMN_CLASS_DESTROY_1, CMN_CLASS_DECKOUT_1, CMN_UI_COST_1, CMN_UI_COST_2, CMN_UI_COST_3, CMN_UI_COST_4, CMN_UI_EP_2, CMN_UI_EP_3, CMN_UI_EP_4, CMN_UI_EP_5, CMN_UI_EP_6, CMN_UI_TURN_1, CMN_UI_TURN_4, CMN_UI_TURN_5, CMN_UI_TURN_6, CMN_UI_YOURTURN_3, CMN_UI_TARGET_3, CMN_START_VS_1, CMN_START_VS_ST2, CMN_START_CARD_1, CMN_FRAME_BTN_1, CMN_FRAME_BTN_2, CMN_UI_HEROSKILL_1, CMN_UI_HEROSKILL_2, CMN_RESULT_TITLE_1, CMN_RESULT_TITLE_2, CMN_RESULT_TITLE_3, CMN_RESULT_LVUP_1, CMN_RESULT_RANKUP_1, CMN_RESULT_RANKDOWN_1, CMN_RESULT_TIERUP_1, CMN_RESULT_MATCH_1, CMN_RESULT_FAILED_1, CMN_RESULT_ORB_1, CMN_RESULT_ORB_2, CMN_RESULT_GAUGE_1, CMN_RESULT_GAUGE_2, CMN_RESULT_BACK_1, CMN_RESULT_BACK_2, CMN_RESULT_BACK_3, CMN_FIELD_SET_1, CMN_FIELD_SET_2, CMN_FIELD_SET_3, CMN_FIELD_SET_4, CMN_FIELD_SET_5, CMN_FIELD_SET_6, CMN_FIELD_SET_7, CMN_FIELD_SET_8, CMN_FIELD_SET_9, CMN_FIELD_SET_10, CMN_FIELD_SET_20, CMN_FIELD_SET_21, CMN_FIELD_SET_22, CMN_FIELD_SET_23, CMN_FIELD_SET_30, CMN_FIELD_SET_31, CMN_FIELD_SET_32, CMN_FIELD_SET_33, CMN_FIELD_SET_34, CMN_FIELD_SET_41, CMN_FIELD_SET_42, CMN_FIELD_SET_43, CMN_FIELD_SET_51, CMN_FIELD_SET_52, CMN_FIELD_SET_61, CMN_FIELD_SET_62, CMN_FIELD_SET_71, CMN_FIELD_SET_72, CMN_FIELD_SET_74, CMN_FIELD_SET_76, CMN_FIELD_SET_1001, CMN_FIELD_SET_1002, CMN_FIELD_SET_1003, CMN_FIELD_SET_1004, CMN_FIELD_SET_1005, CMN_FIELD_SET_1006, CMN_FIELD_SET_1007, CMN_FIELD_SET_1008, CMN_FIELD_SET_1009, CMN_FIELD_SET_1010, CMN_FIELD_SET_1011, CMN_FIELD_SET_1012, CMN_FIELD_TAP_1_1, CMN_FIELD_TAP_1_2, CMN_FIELD_TAP_2_1, CMN_FIELD_TAP_3_1, CMN_FIELD_TAP_3_2, CMN_FIELD_TAP_4_1, CMN_FIELD_TAP_4_2, CMN_FIELD_TAP_5_1, CMN_FIELD_TAP_6_1, CMN_FIELD_TAP_6_2, CMN_FIELD_TAP_7_1, CMN_FIELD_TAP_8_1, CMN_FIELD_TAP_9_1, CMN_FIELD_TAP_10_1, CMN_FIELD_TAP_10_2, CMN_FIELD_TAP_20_1, CMN_FIELD_TAP_20_2, CMN_FIELD_TAP_21_1, CMN_FIELD_TAP_21_2, CMN_FIELD_TAP_22_1, CMN_FIELD_TAP_23_1, CMN_FIELD_TAP_23_2, CMN_FIELD_TAP_30_1, CMN_FIELD_TAP_31_1, CMN_FIELD_TAP_31_2, CMN_FIELD_TAP_32_1, CMN_FIELD_TAP_33_1, CMN_FIELD_TAP_33_2, CMN_FIELD_TAP_34_1, CMN_FIELD_TAP_41_1, CMN_FIELD_TAP_42_1, CMN_FIELD_TAP_43_1, CMN_FIELD_TAP_51_1, CMN_FIELD_TAP_52_1, CMN_FIELD_TAP_61_1, CMN_FIELD_TAP_61_2, CMN_FIELD_TAP_62_1, CMN_FIELD_TAP_71_1, CMN_FIELD_TAP_72_1, CMN_FIELD_TAP_74_1, CMN_FIELD_TAP_76_1, CMN_FIELD_TAP_1001_1, CMN_FIELD_TAP_1002_1, CMN_FIELD_TAP_1003_1, CMN_FIELD_TAP_1004_1, CMN_FIELD_TAP_1005_1, CMN_FIELD_TAP_1006_1, CMN_FIELD_TAP_1007_1, CMN_FIELD_TAP_1007_2, CMN_FIELD_TAP_1008_1, CMN_FIELD_TAP_1009_1, CMN_FIELD_TAP_1010_1, CMN_FIELD_TAP_1011_1, CMN_FIELD_TAP_1012_1, CMN_MYPAGE_EVO_1, CMN_GACHA_CURSOR_1, CMN_GACHA_OPEN_2, CMN_GACHA_OPEN_3, CMN_GACHA_OPEN_4, CMN_TUTORIAL_DRAG_1, CMN_TUTORIAL_DRAG_2, CMN_TUTORIAL_TAP_1, CMN_TUTORIAL_TAP_2, CMN_TUTORIAL_NICE_1, CMN_CRAFT_CARD_1, CMN_CRAFT_CARD_2, CMN_CRAFT_ICON_1, CMN_CRAFT_TRACK_1, CMN_CRAFT_SPLASH_1, CMN_CRAFT_SPLASH_2, CMN_CRAFT_SPLASH_3, CMN_CRAFT_SPLASH_4, CMN_ENDING_IN_1, CMN_ENDING_LOGO_1, CMN_ENDING_LOGO_2, CMN_ENDING_TEXT_1, CMN_PROLOGUE_NAME_1, CMN_ARENA_ARCANE_1, CMN_ARENA_ARCANE_2, CMN_ARENA_FRAME_1, CMN_ARENA_FRAME_2, CMN_ARENA_FRAME_3, CMN_ARENA_CLASS_1, CMN_ARENA_CLASS_2, CMN_ARENA_DECIDE_1, CMN_ARENA_DECIDE_2, CMN_ARENA_DECIDE_3, CMN_ARENA_DECK_1, CMN_MAP_CHAPTER_1, CMN_MAP_MAPICON_CLEARED, CMN_MAP_MAPICON_NOTCLEARED, CMN_MAP_PLAYERICON, CMN_EMBLEM_GET_1, CMN_FRAME_CHOICE_1, CMN_FRAME_CHOICE_2, CMN_FRAME_CHOICE_3, CMN_FRAME_FUSION, CMN_FRAME_HEROSKILL_1, STT_ACT_PLAY_1, STT_ACT_GUARD_1, STT_ACT_FLAG_1, STT_ACT_REFLECTION_1, STT_LOOP_GUARD_1, STT_LOOP_UP_1, STT_LOOP_DOWN_1, STT_LOOP_SNEAK_1, STT_LOOP_REDUCTION_1, STT_LOOP_PROTECTION_1, STT_LOOP_PROTECTION_2, STT_LOOP_SKILL_INVINCIBLE_1, STT_LOOP_HOLD_4, STT_LOOP_BUFFER_1, STT_LOOP_SPELLCHARGE_1, STT_LOOP_UNATTACKED_1, STT_LOOP_UNSELECTED_1, STT_LOOP_HEAVENLYAEGIS_1, MAX, - } + NONE, CMN_CARD_DRAW_2, CMN_CARD_SET_1, CMN_CARD_SET_2, CMN_CARD_SET_3, CMN_CARD_ACCELERATE_1, CMN_CARD_CRYSTALLIZE_1, CMN_CARD_TARGET_1, CMN_CARD_TARGET_2, CMN_CARD_SELECT_3, CMN_UI_TURN_1, CMN_UI_TURN_5, CMN_UI_TURN_6, CMN_FRAME_BTN_1, CMN_RESULT_TITLE_2, CMN_RESULT_TITLE_3, CMN_FIELD_SET_1, CMN_FIELD_SET_2, CMN_FIELD_SET_3, CMN_FIELD_SET_4, CMN_FIELD_SET_5, CMN_FIELD_SET_6, CMN_FIELD_SET_7, CMN_FIELD_SET_8, CMN_FIELD_SET_9, CMN_FIELD_SET_10, CMN_FIELD_SET_20, CMN_FIELD_SET_21, CMN_FIELD_SET_22, CMN_FIELD_SET_23, CMN_FIELD_SET_30, CMN_FIELD_SET_31, CMN_FIELD_SET_32, CMN_FIELD_SET_33, CMN_FIELD_SET_34, CMN_FIELD_SET_41, CMN_FIELD_SET_42, CMN_FIELD_SET_43, CMN_FIELD_SET_51, CMN_FIELD_SET_52, CMN_FIELD_SET_61, CMN_FIELD_SET_62, CMN_FIELD_SET_71, CMN_FIELD_SET_72, CMN_FIELD_SET_74, CMN_FIELD_SET_76, CMN_FIELD_SET_1001, CMN_FIELD_SET_1002, CMN_FIELD_SET_1003, CMN_FIELD_SET_1004, CMN_FIELD_SET_1005, CMN_FIELD_SET_1006, CMN_FIELD_SET_1007, CMN_FIELD_SET_1008, CMN_FIELD_SET_1009, CMN_FIELD_SET_1010, CMN_FIELD_SET_1011, CMN_FIELD_SET_1012, CMN_FIELD_TAP_1_1, CMN_FIELD_TAP_1_2, CMN_FIELD_TAP_2_1, CMN_FIELD_TAP_3_1, CMN_FIELD_TAP_3_2, CMN_FIELD_TAP_4_1, CMN_FIELD_TAP_4_2, CMN_FIELD_TAP_5_1, CMN_FIELD_TAP_6_1, CMN_FIELD_TAP_6_2, CMN_FIELD_TAP_7_1, CMN_FIELD_TAP_8_1, CMN_FIELD_TAP_9_1, CMN_FIELD_TAP_10_1, CMN_FIELD_TAP_10_2, CMN_FIELD_TAP_20_1, CMN_FIELD_TAP_20_2, CMN_FIELD_TAP_21_1, CMN_FIELD_TAP_21_2, CMN_FIELD_TAP_22_1, CMN_FIELD_TAP_23_1, CMN_FIELD_TAP_23_2, CMN_FIELD_TAP_30_1, CMN_FIELD_TAP_31_1, CMN_FIELD_TAP_31_2, CMN_FIELD_TAP_32_1, CMN_FIELD_TAP_33_1, CMN_FIELD_TAP_33_2, CMN_FIELD_TAP_34_1, CMN_FIELD_TAP_41_1, CMN_FIELD_TAP_42_1, CMN_FIELD_TAP_43_1, CMN_FIELD_TAP_51_1, CMN_FIELD_TAP_52_1, CMN_FIELD_TAP_61_1, CMN_FIELD_TAP_61_2, CMN_FIELD_TAP_62_1, CMN_FIELD_TAP_71_1, CMN_FIELD_TAP_72_1, CMN_FIELD_TAP_74_1, CMN_FIELD_TAP_76_1, CMN_FIELD_TAP_1001_1, CMN_FIELD_TAP_1002_1, CMN_FIELD_TAP_1003_1, CMN_FIELD_TAP_1004_1, CMN_FIELD_TAP_1005_1, CMN_FIELD_TAP_1006_1, CMN_FIELD_TAP_1007_1, CMN_FIELD_TAP_1007_2, CMN_FIELD_TAP_1008_1, CMN_FIELD_TAP_1009_1, CMN_FIELD_TAP_1010_1, CMN_FIELD_TAP_1011_1, CMN_FIELD_TAP_1012_1, CMN_TUTORIAL_TAP_1, CMN_CRAFT_CARD_1, CMN_CRAFT_CARD_2, CMN_CRAFT_ICON_1, CMN_CRAFT_TRACK_1, CMN_CRAFT_SPLASH_1, CMN_CRAFT_SPLASH_2, CMN_CRAFT_SPLASH_3, CMN_CRAFT_SPLASH_4, CMN_MAP_CHAPTER_1, CMN_MAP_MAPICON_CLEARED, CMN_MAP_MAPICON_NOTCLEARED, CMN_MAP_PLAYERICON, } public static System.Collections.IEnumerator LoadAndInstantiate2dEffectCoroutine(string effectName, System.Action> finishCallback) { yield break; } public enum MoveType { - NONE, NONE_REF, LINEAR, LINEAR_REF, LINEAR_LOOK, LINEAR_WAIT_75, LINEAR_FROM_DECK, - REVERSE, REVERSE_CLASS, SKIP, SKIP_CENTER_50, SKIP_LOOK, SKIP_LOOK_ZERO, SKIP_WAIT_75, - SKIP_WAIT_75_FROM_DECK, SKIP_TO_DECK, DIRECT, DIRECT_REF, DIRECT_LOOK, DIRECT_LOOK_SELF_LEADER, - DIRECT_HAND, DIRECT_SELF_HAND, DIRECT_DECK, DIRECT_LEADER, DIRECT_LEADER_REF, LOOK, PARABOLA, - HOMING, HOMING_WAIT, ARC, ARC_LOOK, ARC_UPWARDS, CENTER, CENTER_SELF, CENTER_SELF_REF, - CENTER_TARGET, CENTER_TARGET_REF, CENTER_SELF_ALL, CENTER_SELF_ALL_REF, CENTER_TARGET_ALL, - CENTER_TARGET_ALL_REF, CENTER_SKIP, CENTER_SKIP_50, DIRECT_EPPANEL_SELF, DIRECT_EPPANEL_OPPONENT, - DIRECT_CENTER_DIRECT, NONE_CENTER_TARGET_ALL - } + NONE, SKIP, DIRECT, DIRECT_HAND, DIRECT_DECK, DIRECT_LEADER, CENTER } 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 enum EngineType { NONE, SHURIKEN} public bool IsFieldEffectReady => true; public bool IsBattleUIEffectReady => true; @@ -43,27 +29,15 @@ public class EffectMgr 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 InitCommonEffect(string filePath, bool isBattle = false, bool isField = false, bool isBattleEffect = false, Action callback = null) => new List(); public List SetUIParticleShader(List effectObjList, Action callback, bool isBattle = false, bool isField = false) => new List(); public List SetUIParticleShader(GameObject effectObj, Action callback, bool isBattle = false, bool isField = false) => new List(); - public List LoadUIParticleShader(GameObject effectObj, Action callback, bool isBattle) => new List(); - 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() { } @@ -79,28 +53,36 @@ public partial class GameObjMgr { public GameObjMgr() { } } public class GameMgr { - public static GameMgr GetIns() => SVSim.BattleEngine.Ambient.BattleAmbient.Require().GameMgr; + // Phase-5 chunk 47: the ambient is gone. GameMgr.GetIns() has no scope-based mechanism — + // BattleManagerBase.GetIns() returns null unconditionally, and every direct engine consumer + // was migrated to per-mgr reads through the mgr's own `.GameMgr` property. The residual + // static throws to catch any straggler that still calls it; MultiInstanceEngineTests pins + // the null-null-throw shape. + public static GameMgr GetIns() => + throw new System.InvalidOperationException( + "GameMgr.GetIns() is retired. Read via `mgr.GameMgr` on a BattleManagerBase instance."); 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 { get; set; } - public bool IsWatchBattle { get; set; } - public bool IsReplayBattle { get; set; } + // Six mode flags collapsed to const-false getters in Phase 4 (2026-07-02): headless + // is neither watching, replaying, admin-watching, an AI-network client, a puzzle + // quest, nor a "new replay" — every branch guarded on `!IsWatchBattle` etc. was a + // tautology, and every branch guarded on the positive was dead code. Setters + // dropped: pre-Phase-4 callers wrote `false` at end-of-battle cleanup which is now + // unnecessary. + public bool IsAdminWatch => false; + public bool IsWatchBattle => false; + public bool IsReplayBattle => false; + public bool IsAINetwork => false; + public bool IsPuzzleQuest => false; + public bool IsNewReplayBattle => false; + public bool IsAdmin => false; + // IsNetworkBattle stays writable — headless PvP battles set true; SingleBattleMgr paths stay false. public bool IsNetworkBattle { get; set; } - public bool IsAINetwork { get; set; } - public bool IsPuzzleQuest { get; set; } - public bool HasAuthAdmin { get; set; } - public void ChangeAspectRatio(float newAspectRatio) { } - public void Update() { } private EffectMgr _effect; - private SoundMgr _sound; private DataMgr _data; private GameObjMgr _gameObj = new GameObjMgr(); private PrefabMgr _prefab; @@ -109,7 +91,6 @@ public class GameMgr private NetworkUserInfoData _netUser; public EffectMgr GetEffectMgr() => _effect ??= new EffectMgr(); - public SoundMgr GetSoundMgr() => _sound ??= new SoundMgr(); // Headless: hand back non-null no-op instances. The copied manager types are pure // data/dictionary/no-op holders (no Unity in their ctors); the resolution-path ctor // dereferences these immediately (CreateBackgroundId / CreateManager / UnityEventAgent wiring). @@ -121,26 +102,11 @@ public class GameMgr 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() - { - // No-op: GameMgr is now provisioned by BattleAmbientContext at scope entry. - } - public void CreateMgrIns(GameObject gameobj) { } - public void BuildDeckData() { } public void DestroyBattleManagements() { } - public void Init() { } - public void InitializeSelfInfo() { } - public void SettingSelfInfo(Dictionary info, bool isWatchReplayRecovery) { } - public void SettingOpponentInfo(Dictionary info, bool isWatchReplayRecovery) { } - public void SettingBattleStartSelfInfo(Dictionary info) { } - public void SettingBattleStartOpponentInfo(Dictionary info) { } - public void SettingSelfDeck(List info) { } public bool IsUseUnapprovedList(bool isPlayer) => false; } @@ -151,7 +117,6 @@ public partial class UIManager : UnityEngine.MonoBehaviour { private static UIManager _ins; public static UIManager GetInstance() => _ins ??= new UIManager(); - public static UIManager GetIns() => GetInstance(); } // VideoHostingHUD (members + HUDMode enum) provided by Generated/VideoHostingHUD.g.cs @@ -161,7 +126,6 @@ namespace Wizard // RankWinnerReward, CardDestructTask, CardCreateTask, MissionInfoTask already exist // in the copied set (declared in other files) -- only these three were missing. public partial class MailTopTask { } - public partial class MyPageTask { } public partial class DeckUpdateTask { } // UIManager no-op return types (empty stubs; methods returning them return null) public partial class LoadingViewManager { } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs b/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs index 1906ab02..28ab48e5 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/Primitives.cs @@ -13,14 +13,11 @@ namespace UnityEngine public static Vector2 zero => new Vector2(0, 0); public static Vector2 one => new Vector2(1, 1); public static Vector2 up => new Vector2(0, 1); - public static Vector2 down => new Vector2(0, -1); - public static Vector2 left => new Vector2(-1, 0); public static Vector2 right => new Vector2(1, 0); public float magnitude => (float)Math.Sqrt(x * x + y * y); public float sqrMagnitude => x * x + y * y; public Vector2 normalized { get { float m = magnitude; return m > 1e-6f ? new Vector2(x / m, y / m) : zero; } } public static float Distance(Vector2 a, Vector2 b) => (a - b).magnitude; - public static float Dot(Vector2 a, Vector2 b) => a.x * b.x + a.y * b.y; public static float Angle(Vector2 from, Vector2 to) => 0f; public void Normalize() { var n = normalized; x = n.x; y = n.y; } public static Vector2 Lerp(Vector2 a, Vector2 b, float t) => new Vector2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); @@ -58,12 +55,9 @@ namespace UnityEngine public static float Distance(Vector3 a, Vector3 b) => (a - b).magnitude; public static float SqrMagnitude(Vector3 a) => a.sqrMagnitude; public static float Dot(Vector3 a, Vector3 b) => a.x * b.x + a.y * b.y + a.z * b.z; - public static Vector3 Cross(Vector3 a, Vector3 b) => new Vector3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); public static Vector3 Scale(Vector3 a, Vector3 b) => new Vector3(a.x * b.x, a.y * b.y, a.z * b.z); public void Scale(Vector3 s) { x *= s.x; y *= s.y; z *= s.z; } public static Vector3 Lerp(Vector3 a, Vector3 b, float t) => new Vector3(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t); - public static Vector3 LerpUnclamped(Vector3 a, Vector3 b, float t) => Lerp(a, b, t); - public static Vector3 MoveTowards(Vector3 a, Vector3 b, float d) => b; public static Vector3 operator +(Vector3 a, Vector3 b) => new Vector3(a.x + b.x, a.y + b.y, a.z + b.z); public static Vector3 operator -(Vector3 a, Vector3 b) => new Vector3(a.x - b.x, a.y - b.y, a.z - b.z); public static Vector3 operator -(Vector3 a) => new Vector3(-a.x, -a.y, -a.z); @@ -84,10 +78,7 @@ namespace UnityEngine public static Quaternion Euler(float x, float y, float z) => identity; public static Quaternion Euler(Vector3 e) => identity; public static Quaternion AngleAxis(float angle, Vector3 axis) => identity; - public static Quaternion LookRotation(Vector3 fwd) => identity; public static Quaternion Slerp(Quaternion a, Quaternion b, float t) => identity; - public static Quaternion FromToRotation(Vector3 from, Vector3 to) => identity; - public static Quaternion Inverse(Quaternion rotation) => identity; public Vector3 eulerAngles { get => Vector3.zero; set { } } public static Vector3 operator *(Quaternion q, Vector3 v) => v; public static Quaternion operator *(Quaternion a, Quaternion b) => identity; @@ -102,11 +93,7 @@ namespace UnityEngine public static Color black => new Color(0, 0, 0, 1); public static Color clear => new Color(0, 0, 0, 0); public static Color red => new Color(1, 0, 0, 1); - public static Color green => new Color(0, 1, 0, 1); - public static Color blue => new Color(0, 0, 1, 1); - public static Color yellow => new Color(1, 0.92f, 0.016f, 1); public static Color cyan => new Color(0, 1, 1, 1); - public static Color magenta => new Color(1, 0, 1, 1); public static Color gray => new Color(0.5f, 0.5f, 0.5f, 1); public static Color grey => gray; public static Color Lerp(Color a, Color b, float t) => new Color(a.r + (b.r - a.r) * t, a.g + (b.g - a.g) * t, a.b + (b.b - a.b) * t, a.a + (b.a - a.a) * t); @@ -125,16 +112,9 @@ namespace UnityEngine public static class Mathf { - public const float PI = 3.14159265f; - public const float Infinity = float.PositiveInfinity; - public const float NegativeInfinity = float.NegativeInfinity; - public const float Epsilon = 1.401298E-45f; - public const float Deg2Rad = PI / 180f; - public const float Rad2Deg = 180f / PI; public static float Floor(float f) => (float)Math.Floor(f); public static int FloorToInt(float f) => (int)Math.Floor(f); public static float Ceil(float f) => (float)Math.Ceiling(f); - public static int CeilToInt(float f) => (int)Math.Ceiling(f); public static float Round(float f) => (float)Math.Round(f); public static int RoundToInt(float f) => (int)Math.Round(f); public static float Abs(float f) => Math.Abs(f); @@ -151,45 +131,23 @@ namespace UnityEngine public static int Clamp(int v, int lo, int hi) => Math.Max(lo, Math.Min(hi, v)); public static float Clamp01(float v) => Math.Max(0f, Math.Min(1f, v)); public static float Lerp(float a, float b, float t) => a + (b - a) * Clamp01(t); - public static float LerpUnclamped(float a, float b, float t) => a + (b - a) * t; - public static float LerpAngle(float a, float b, float t) => a + (b - a) * Clamp01(t); - public static float MoveTowards(float a, float b, float d) => b; public static float SmoothDamp(float cur, float target, ref float vel, float time) { vel = 0; return target; } - public static float SmoothDamp(float cur, float target, ref float vel, float time, float maxSpeed) { vel = 0; return target; } public static float SmoothDampAngle(float cur, float target, ref float vel, float time) { vel = 0; return target; } - public static float SmoothStep(float a, float b, float t) => Lerp(a, b, t); public static float Sin(float f) => (float)Math.Sin(f); public static float Cos(float f) => (float)Math.Cos(f); - public static float Tan(float f) => (float)Math.Tan(f); public static float Asin(float f) => (float)Math.Asin(f); - public static float Acos(float f) => (float)Math.Acos(f); - public static float Atan(float f) => (float)Math.Atan(f); public static float Atan2(float y, float x) => (float)Math.Atan2(y, x); public static float Sqrt(float f) => (float)Math.Sqrt(f); public static float Pow(float f, float p) => (float)Math.Pow(f, p); - public static float Exp(float f) => (float)Math.Exp(f); public static float Log(float f) => (float)Math.Log(f); - public static float Log(float f, float b) => (float)Math.Log(f, b); - public static float Log10(float f) => (float)Math.Log10(f); public static float Sign(float f) => Math.Sign(f); public static bool Approximately(float a, float b) => Math.Abs(a - b) < 1e-6f; - public static float Repeat(float t, float length) => t - Floor(t / length) * length; - public static float PingPong(float t, float length) => length - Math.Abs(Repeat(t, length * 2) - length); - public static float DeltaAngle(float a, float b) => Repeat(b - a + 180f, 360f) - 180f; public static float GammaToLinearSpace(float v) => v; - public static float LinearToGammaSpace(float v) => v; } public static class Debug { - public static void Log(object m) { } - public static void LogFormat(string m, params object[] a) { } public static void LogWarning(object m) { } public static void LogError(object m) { } - public static void LogException(Exception e) { } - public static void Assert(bool c) { } - public static void DrawLine(Vector3 a, Vector3 b) { } - public static void DrawRay(Vector3 a, Vector3 b) { } - public static bool isDebugBuild => false; } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityRuntime.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityRuntime.cs index 43e99fbf..d4e9e94c 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityRuntime.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityRuntime.cs @@ -10,23 +10,12 @@ namespace UnityEngine public static Vector3 mousePosition => Vector3.zero; public static Vector2 mouseScrollDelta => Vector2.zero; public static int touchCount => 0; - public static Touch[] touches => new Touch[0]; - public static Touch GetTouch(int i) => default; - public static bool anyKey => false; - public static bool anyKeyDown => false; - public static bool mousePresent => false; public static bool GetMouseButton(int b) => false; public static bool GetMouseButtonDown(int b) => false; public static bool GetMouseButtonUp(int b) => false; public static bool GetKey(KeyCode k) => false; - public static bool GetKey(string n) => false; public static bool GetKeyDown(KeyCode k) => false; - public static bool GetKeyDown(string n) => false; public static bool GetKeyUp(KeyCode k) => false; - public static bool GetButton(string n) => false; - public static bool GetButtonDown(string n) => false; - public static float GetAxis(string n) => 0f; - public static float GetAxisRaw(string n) => 0f; public static string inputString => ""; public static bool multiTouchEnabled { get; set; } } @@ -36,14 +25,8 @@ namespace UnityEngine public static float value => 0f; public static int Range(int minInclusive, int maxExclusive) => minInclusive; public static float Range(float min, float max) => min; - public static Vector2 insideUnitCircle => Vector2.zero; - public static Vector3 insideUnitSphere => Vector3.zero; - public static Vector3 onUnitSphere => Vector3.up; public static Quaternion rotation => Quaternion.identity; - public static Quaternion rotationUniform => Quaternion.identity; public static int seed { get; set; } - public static void InitState(int s) { } - public static Color ColorHSV() => Color.white; } public static partial class Resources @@ -63,11 +46,7 @@ namespace UnityEngine return _loaded.GetOrAdd(path, static p => new GameObject(p)); } public static Object Load(string path, Type t) => Load(path); - public static T[] LoadAll(string path) where T : Object => new T[0]; - public static Object[] LoadAll(string path) => new Object[0]; - public static ResourceRequest LoadAsync(string path) where T : Object => null; public static ResourceRequest LoadAsync(string path) => null; - public static void UnloadAsset(Object o) { } public static AsyncOperation UnloadUnusedAssets() => null; } @@ -75,32 +54,5 @@ namespace UnityEngine public enum KeyCode { - None = 0, - Backspace = 8, Tab = 9, Clear = 12, Return = 13, Pause = 19, Escape = 27, Space = 32, - Exclaim = 33, DoubleQuote = 34, Hash = 35, Dollar = 36, Ampersand = 38, Quote = 39, - LeftParen = 40, RightParen = 41, Asterisk = 42, Plus = 43, Comma = 44, Minus = 45, - Period = 46, Slash = 47, - Alpha0 = 48, Alpha1, Alpha2, Alpha3, Alpha4, Alpha5, Alpha6, Alpha7, Alpha8, Alpha9, - Colon = 58, Semicolon = 59, Less = 60, Equals = 61, Greater = 62, Question = 63, At = 64, - LeftBracket = 91, Backslash = 92, RightBracket = 93, Caret = 94, Underscore = 95, BackQuote = 96, - A = 97, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, - LeftCurlyBracket = 123, Pipe = 124, RightCurlyBracket = 125, Tilde = 126, Delete = 127, - Keypad0 = 256, Keypad1, Keypad2, Keypad3, Keypad4, Keypad5, Keypad6, Keypad7, Keypad8, Keypad9, - KeypadPeriod = 266, KeypadDivide = 267, KeypadMultiply = 268, KeypadMinus = 269, - KeypadPlus = 270, KeypadEnter = 271, KeypadEquals = 272, - UpArrow = 273, DownArrow = 274, RightArrow = 275, LeftArrow = 276, - Insert = 277, Home = 278, End = 279, PageUp = 280, PageDown = 281, - F1 = 282, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, - Numlock = 300, CapsLock = 301, ScrollLock = 302, - RightShift = 303, LeftShift = 304, RightControl = 305, LeftControl = 306, - RightAlt = 307, LeftAlt = 308, RightCommand = 309, LeftCommand = 310, - LeftWindows = 311, RightWindows = 312, AltGr = 313, - Help = 315, Print = 316, SysReq = 317, Break = 318, Menu = 319, - Mouse0 = 323, Mouse1, Mouse2, Mouse3, Mouse4, Mouse5, Mouse6, - JoystickButton0 = 330, JoystickButton1, JoystickButton2, JoystickButton3, - JoystickButton4, JoystickButton5, JoystickButton6, JoystickButton7, - JoystickButton8, JoystickButton9, JoystickButton10, JoystickButton11, - JoystickButton12, JoystickButton13, JoystickButton14, JoystickButton15, - JoystickButton16, JoystickButton17, JoystickButton18, JoystickButton19 - } + None = 0, Tab = 9, Return = 13, Escape = 27, Alpha0 = 48, A = 97, B, D, E, F, N, P, S, X, RightArrow = 275, LeftArrow = 276, RightShift = 303, LeftShift = 304, RightControl = 305, LeftControl = 306, Mouse0 = 323, JoystickButton0 = 330, JoystickButton1 } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs index 1d3a2ae9..ec9c5aa1 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs @@ -17,12 +17,8 @@ namespace UnityEngine public Vector3 extents { get => size * 0.5f; set => size = value * 2f; } public Vector3 min { get => center - extents; set { } } public Vector3 max { get => center + extents; set { } } - public bool Contains(Vector3 p) => false; public void Encapsulate(Vector3 p) { } public void Encapsulate(Bounds b) { } - public void Expand(float amount) { } - public bool Intersects(Bounds b) => false; - public float SqrDistance(Vector3 p) => 0f; } public struct Rect { @@ -32,25 +28,18 @@ namespace UnityEngine public float yMin { get => y; set { height += y - value; y = value; } } public float xMax { get => x + width; set => width = value - x; } public float yMax { get => y + height; set => height = value - y; } - public Vector2 center { get => new Vector2(x + width / 2, y + height / 2); set { } } - public Vector2 size { get => new Vector2(width, height); set { width = value.x; height = value.y; } } public Vector2 position { get => new Vector2(x, y); set { x = value.x; y = value.y; } } public Vector2 min { get => new Vector2(xMin, yMin); set { } } public Vector2 max { get => new Vector2(xMax, yMax); set { } } - public bool Contains(Vector2 p) => false; - public bool Contains(Vector3 p) => false; - public bool Overlaps(Rect other) => false; - public static Rect MinMaxRect(float xmin, float ymin, float xmax, float ymax) => new Rect(xmin, ymin, xmax - xmin, ymax - ymin); public static bool operator ==(Rect a, Rect b) => a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height; public static bool operator !=(Rect a, Rect b) => !(a == b); public override bool Equals(object o) => o is Rect r && this == r; public override int GetHashCode() => x.GetHashCode() ^ (y.GetHashCode() << 2) ^ (width.GetHashCode() << 4) ^ (height.GetHashCode() << 6); } - public struct Matrix4x4 { public static Matrix4x4 identity => new Matrix4x4(); public Vector3 MultiplyPoint(Vector3 p) => p; public Vector3 MultiplyPoint3x4(Vector3 p) => p; public Vector3 MultiplyVector(Vector3 v) => v; public static Matrix4x4 TRS(Vector3 t, Quaternion r, Vector3 s) => identity; public Matrix4x4 inverse => identity; public static Matrix4x4 operator *(Matrix4x4 a, Matrix4x4 b) => identity; public Vector4 GetColumn(int i) => default; public Vector4 GetRow(int i) => default; public float this[int row, int col] { get => 0f; set { } } } + public struct Matrix4x4 { public static Matrix4x4 identity => new Matrix4x4(); public Vector3 MultiplyPoint3x4(Vector3 p) => p; public Vector3 MultiplyVector(Vector3 v) => v; public static Matrix4x4 operator *(Matrix4x4 a, Matrix4x4 b) => identity; } public struct Plane { public Plane(Vector3 normal, Vector3 point) { } public Plane(Vector3 inNormal, float d) { } public Plane(Vector3 a, Vector3 b, Vector3 c) { } public bool Raycast(Ray r, out float enter) { enter = 0; return false; } } public struct Ray { public Ray(Vector3 origin, Vector3 dir) { this.origin = origin; this.direction = dir; } public Vector3 origin; public Vector3 direction; public Vector3 GetPoint(float d) => origin; } - public struct RaycastHit { public Vector3 point; public Vector3 normal; public float distance; public Collider collider; public Transform transform; public GameObject gameObject; } - public struct RaycastHit2D { public Vector3 point; public Vector3 normal; public float distance; public Collider2D collider; public Transform transform; public static implicit operator bool(RaycastHit2D hit) => hit.collider != null; } + public struct RaycastHit { public Vector3 point; public Vector3 normal; public float distance; public Collider collider; } public struct LayerMask { public int value; public static int NameToLayer(string n) => 0; public static string LayerToName(int layer) => ""; public static implicit operator int(LayerMask m) => m.value; public static implicit operator LayerMask(int v) => new LayerMask { value = v }; } // ---- core object model ---- @@ -70,9 +59,7 @@ namespace UnityEngine public static T Instantiate(T original, Vector3 pos, Quaternion rot) where T : Object => original; public static T Instantiate(T original, Vector3 pos, Quaternion rot, Transform parent) where T : Object => original; public static Object Instantiate(Object original) => original; - public static T FindObjectOfType() where T : Object => null; public static T[] FindObjectsOfType() where T : Object => new T[0]; - public static T[] FindObjectsOfType(bool includeInactive) where T : Object => new T[0]; public static Object FindObjectOfType(System.Type t) => null; public static Object[] FindObjectsOfType(System.Type t) => new Object[0]; public static bool operator ==(Object a, Object b) => ReferenceEquals(a, b); @@ -95,25 +82,11 @@ namespace UnityEngine public virtual Transform transform => gameObject.transform; public string tag { get; set; } public T GetComponent() => gameObject.GetComponent(); - public T GetComponent(string type) => gameObject.GetComponent(); - public Component GetComponent(System.Type t) => gameObject.GetComponent(t); - public Component GetComponent(string t) => null; public T GetComponentInChildren() => default; - public T GetComponentInChildren(bool includeInactive) => default; public T[] GetComponentsInChildren() => new T[0]; public T[] GetComponentsInChildren(bool includeInactive) => new T[0]; public T GetComponentInParent() => default; - public T GetComponentInParent(bool includeInactive) => default; - public T[] GetComponentsInParent() => new T[0]; public T[] GetComponents() => new T[0]; - public Component[] GetComponents(System.Type t) => new Component[0]; - public void SendMessage(string method) { } - public void SendMessage(string method, object value) { } - public void SendMessage(string method, object value, SendMessageOptions options) { } - public void SendMessage(string method, SendMessageOptions options) { } - public void BroadcastMessage(string method) { } - public void BroadcastMessage(string method, object parameter) { } - public void BroadcastMessage(string method, object parameter, SendMessageOptions options) { } public bool CompareTag(string t) => false; } @@ -121,7 +94,6 @@ namespace UnityEngine public class MonoBehaviour : Behaviour { - public static void print(object message) { } public Coroutine StartCoroutine(IEnumerator routine) => null; public Coroutine StartCoroutine(string methodName) => null; public void StopCoroutine(IEnumerator routine) { } @@ -129,9 +101,6 @@ namespace UnityEngine public void StopCoroutine(string methodName) { } public void StopAllCoroutines() { } public void Invoke(string methodName, float time) { } - public void CancelInvoke() { } - public void CancelInvoke(string methodName) { } - public bool IsInvoking() => false; } public partial class Transform : Component, IEnumerable @@ -167,30 +136,17 @@ namespace UnityEngine public void SetSiblingIndex(int i) { } public int GetSiblingIndex() => 0; public void SetAsLastSibling() { } - public void SetAsFirstSibling() { } public Vector3 lossyScale => Vector3.one; - public Vector3 forward { get => Vector3.forward; set { } } public Vector3 up { get => Vector3.up; set { } } - public Vector3 right { get => Vector3.right; set { } } - public Transform root => this; public Vector3 TransformPoint(Vector3 p) => p; public Vector3 TransformPoint(float x, float y, float z) => new Vector3(x, y, z); public Vector3 InverseTransformPoint(Vector3 p) => p; - public Vector3 InverseTransformPoint(float x, float y, float z) => new Vector3(x, y, z); public Vector3 TransformDirection(Vector3 d) => d; public Vector3 InverseTransformDirection(Vector3 d) => d; - public Vector3 TransformVector(Vector3 v) => v; - public Vector3 InverseTransformVector(Vector3 v) => v; - public void Translate(Vector3 t) { } - public void Translate(float x, float y, float z) { } public void Rotate(Vector3 e) { } public void Rotate(float x, float y, float z) { } - public void RotateAround(Vector3 point, Vector3 axis, float angle) { } - public void LookAt(Transform t) { } public void LookAt(Transform t, Vector3 worldUp) { } - public void LookAt(Vector3 p) { } public void LookAt(Vector3 p, Vector3 worldUp) { } - public void DetachChildren() { } public Transform Find(string n, bool includeInactive) => Find(n); public IEnumerator GetEnumerator() { yield break; } } @@ -280,33 +236,18 @@ namespace UnityEngine } } public T GetComponent() => (T)(GetOrAddComponent(typeof(T)) ?? default(T)); - public Component GetComponent(Type t) => (Component)GetOrAddComponent(t); - public Component GetComponent(string t) => null; public T GetComponentInChildren() => default; public T GetComponentInChildren(bool includeInactive) => default; public T[] GetComponentsInChildren() => new T[0]; public T[] GetComponentsInChildren(bool includeInactive) => new T[0]; - public T GetComponentInParent() => default; public T GetComponentInParent(bool includeInactive) => default; public T[] GetComponents() => new T[0]; - public Component[] GetComponents(Type t) => new Component[0]; public T AddComponent() where T : Component => (T)(GetOrAddComponent(typeof(T)) ?? default(T)); - public Component AddComponent(Type t) => (Component)GetOrAddComponent(t); public void SendMessage(string method) { } - public void SendMessage(string method, object value) { } public void SendMessage(string method, object value, SendMessageOptions options) { } - public void SendMessage(string method, SendMessageOptions options) { } - public void BroadcastMessage(string method) { } - public void BroadcastMessage(string method, object parameter) { } - public void BroadcastMessage(string method, object parameter, SendMessageOptions options) { } - public bool CompareTag(string t) => false; public static GameObject Find(string n) => null; - public static GameObject FindGameObjectWithTag(string t) => null; - public static GameObject[] FindGameObjectsWithTag(string t) => new GameObject[0]; } - public class ScriptableObject : Object { } - // Factory for no-op view/manager objects that are NOT acquired via GameObject.GetComponent (e.g. // UIManager.getUIBase_CardManager()). Creates the instance and runs the same field-wiring the // component model applies, so the copied cosmetic helpers it exposes resolve headless. @@ -327,45 +268,30 @@ namespace UnityEngine public Material[] materials { get; set; } public Material sharedMaterial { get; set; } public Material[] sharedMaterials { get; set; } - public bool enabled { get; set; } - public bool isVisible => false; public int sortingOrder { get; set; } - public string sortingLayerName { get; set; } - public int sortingLayerID { get; set; } - public Bounds bounds => default; - public ShadowCastingMode shadowCastingMode { get; set; } - public bool receiveShadows { get; set; } } - public enum ShadowCastingMode { Off, On, TwoSided, ShadowsOnly } public class MeshRenderer : Renderer { } - public class SkinnedMeshRenderer : Renderer { public Mesh sharedMesh { get; set; } public Transform rootBone { get; set; } public Transform[] bones { get; set; } } - public class SpriteRenderer : Renderer { public Sprite sprite { get; set; } public Color color { get; set; } } + public class SkinnedMeshRenderer : Renderer { } + public class SpriteRenderer : Renderer { public Color color { get; set; } } public class MeshFilter : Component { public Mesh mesh { get; set; } public Mesh sharedMesh { get; set; } } public class ParticleSystem : Component { public void Play() { } public void Play(bool withChildren) { } public void Stop() { } public void Stop(bool withChildren) { } - public void Pause() { } public void Clear() { } public void Clear(bool withChildren) { } - public void Simulate(float t) { } - public bool isPlaying => false; public bool isPaused => false; public bool isStopped => true; - public bool IsAlive() => false; public bool IsAlive(bool withChildren) => false; - public int particleCount => 0; +public void Clear() { } public int particleCount => 0; public MainModule main => default; - public EmissionModule emission => default; public int GetParticles(Particle[] p) => 0; public void SetParticles(Particle[] p, int n) { } - public struct MainModule { public float duration; public float startLifetime; public bool loop; public float startSpeed; public bool playOnAwake; public float simulationSpeed; public MinMaxGradient startColor; } + public struct MainModule { public bool playOnAwake; public float simulationSpeed; public MinMaxGradient startColor; } public struct MinMaxGradient { public Color color; public MinMaxGradient(Color c) { color = c; } public static implicit operator MinMaxGradient(Color c) => new MinMaxGradient(c); } - public struct EmissionModule { public bool enabled; public float rateOverTime; } - public struct Particle { public Vector3 position; public Vector3 velocity; public Color32 startColor; public float remainingLifetime; } + public struct EmissionModule { } + public struct Particle { public Vector3 position; public Color32 startColor; } } - public class ParticleSystemRenderer : Renderer { public SpriteMaskInteraction maskInteraction { get; set; } public Material trailMaterial { get; set; } } - public enum SpriteMaskInteraction { None, VisibleInsideMask, VisibleOutsideMask } + public class ParticleSystemRenderer : Renderer { } public partial class LODGroup : Component { } public class Collider : Component { public bool enabled { get; set; } } - public class BoxCollider : Collider { public Vector3 size { get; set; } public Vector3 center { get; set; } public bool isTrigger { get; set; } } + public class BoxCollider : Collider { public Vector3 size { get; set; } public Vector3 center { get; set; } } public partial class Rigidbody : Component { } - public class Rigidbody2D : Component { public bool isKinematic { get; set; } } public partial class Material : Object { public Material() { } @@ -378,63 +304,37 @@ namespace UnityEngine public Vector2 mainTextureScale { get; set; } public int renderQueue { get; set; } public string[] shaderKeywords { get; set; } - public float GetFloat(string n) => 0f; - public int GetInt(string n) => 0; public Color GetColor(string n) => Color.white; - public Texture GetTexture(string n) => null; - public Vector4 GetVector(string n) => default; public void SetFloat(string n, float v) { } public void SetInt(string n, int v) { } public void SetColor(string n, Color c) { } public void SetTexture(string n, Texture t) { } - public void SetVector(string n, Vector4 v) { } - public void SetVector(int nameID, Vector4 v) { } - public void SetMatrix(string n, Matrix4x4 m) { } - public void SetTextureOffset(string n, Vector2 o) { } public void EnableKeyword(string k) { } - public void DisableKeyword(string k) { } - public bool IsKeywordEnabled(string k) => false; - public bool HasProperty(string n) => false; } public partial class Mesh : Object { public Vector3[] vertices { get; set; } public int[] triangles { get; set; } public void Clear() { } public void RecalculateBounds() { } } public class Texture : Object { public int width => 0; public int height => 0; } - public partial class Texture2D : Texture { public Texture2D(int w, int h) { } public Texture2D(int w, int h, TextureFormat format, bool mipChain) { } public void Apply() { } public Color GetPixel(int x, int y) => Color.white; public void SetPixel(int x, int y, Color c) { } } - public enum FilterMode { Point, Bilinear, Trilinear } - public enum TextureWrapMode { Repeat, Clamp, Mirror, MirrorOnce } - public enum WrapMode { Once = 1, Loop = 2, PingPong = 4, Default = 0, ClampForever = 8, Clamp = 1 } + public partial class Texture2D : Texture { public Texture2D(int w, int h) { } public Texture2D(int w, int h, TextureFormat format, bool mipChain) { } public void Apply() { } public void SetPixel(int x, int y, Color c) { } } + public enum WrapMode { Once = 1, Default = 0} public struct Keyframe { public float time; public float value; public float inTangent; public float outTangent; public Keyframe(float t, float v) { time = t; value = v; inTangent = 0; outTangent = 0; } public Keyframe(float t, float v, float inT, float outT) { time = t; value = v; inTangent = inT; outTangent = outT; } } - public struct AnimatorStateInfo { public bool IsName(string name) => false; public float normalizedTime => 0f; public int shortNameHash => 0; public int fullPathHash => 0; public float length => 0f; } - public struct AnimatorClipInfo { public AnimationClip clip => null; public float weight => 0f; } - public class RenderTexture : Texture { public RenderTexture(int w, int h, int depth) { } public RenderTexture(int w, int h, int depth, RenderTextureFormat fmt) { } public void Create() { } public void Release() { } public bool IsCreated() => false; public static RenderTexture active { get; set; } public int depth { get; set; } public FilterMode filterMode { get; set; } public TextureWrapMode wrapMode { get; set; } public void DiscardContents() { } public static RenderTexture GetTemporary(int w, int h) => null; public static RenderTexture GetTemporary(int w, int h, int depth) => null; public static RenderTexture GetTemporary(int w, int h, int depth, RenderTextureFormat fmt) => null; public static void ReleaseTemporary(RenderTexture rt) { } } - public partial class Sprite : Object { public Rect rect => default; public Texture2D texture => null; public static Sprite Create(Texture2D t, Rect r, Vector2 pivot) => null; } - public partial class Shader : Object { public static Shader Find(string n) => null; public bool isSupported => true; } - public class AnimationClip : Object { public float length => 0f; public string name { get; set; } public float frameRate => 0f; } - public partial class Animation : Component, IEnumerable { public AnimationClip clip { get; set; } public bool isPlaying => false; public void Play() { } public void Play(string n) { } public void Stop() { } public IEnumerator GetEnumerator() { yield break; } public AnimationState this[string name] => null; } + public struct AnimatorStateInfo { public bool IsName(string name) => false; public float normalizedTime => 0f; public int fullPathHash => 0; public float length => 0f; } + public class RenderTexture : Texture { public RenderTexture(int w, int h, int depth) { } public RenderTexture(int w, int h, int depth, RenderTextureFormat fmt) { } } + public partial class Sprite : Object { public Rect rect => default; public Texture2D texture => null; } + public partial class Shader : Object { public static Shader Find(string n) => null; } + public partial class Animation : Component, IEnumerable { public bool isPlaying => false; public void Play() { } public void Play(string n) { } public IEnumerator GetEnumerator() { yield break; } } public class Animator : Component { - public void SetTrigger(string n) { } public void SetTrigger(int id) { } - public void SetBool(string n, bool v) { } public void SetInteger(string n, int v) { } - public void SetFloat(string n, float v) { } - public bool GetBool(string n) => false; public int GetInteger(string n) => 0; public float GetFloat(string n) => 0f; - public void Play(string n) { } public void Play(int hash) { } - public void Play(string n, int layer) { } public void Play(string n, int layer, float normalizedTime) { } - public void Play(int hash, int layer) { } public void Play(int hash, int layer, float normalizedTime) { } - public void SetLayerWeight(int layer, float w) { } - public float speed { get; set; } public bool enabled { get; set; } - public void ResetTrigger(string n) { } public void ResetTrigger(int id) { } - public void Update(float dt) { } + public void SetTrigger(string n) { } public void Play(string n, int layer, float normalizedTime) { } +public void Play(int hash, int layer, float normalizedTime) { } + public float speed { get; set; } public void Update(float dt) { } public AnimatorStateInfo GetCurrentAnimatorStateInfo(int layer) => default; - public AnimatorClipInfo[] GetCurrentAnimatorClipInfo(int layer) => new AnimatorClipInfo[0]; } public class AnimationCurve { public AnimationCurve() { } public AnimationCurve(params Keyframe[] keys) { } public float Evaluate(float t) => 0f; public int length => 0; public Keyframe[] keys { get; set; } public WrapMode preWrapMode { get; set; } public WrapMode postWrapMode { get; set; } public static AnimationCurve Linear(float a, float b, float c, float d) => new AnimationCurve(); } public class AudioClip : Object { public float length => 0f; } - public partial class AudioSource : Component { public AudioClip clip { get; set; } public float volume { get; set; } public bool isPlaying => false; public bool loop { get; set; } public void Play() { } public void Stop() { } public void Pause() { } } + public partial class AudioSource : Component { public AudioClip clip { get; set; } public float volume { get; set; } } public partial class Camera : Component { public static Camera main => null; - public static Camera current => null; public static int allCamerasCount => 0; - public static Camera[] allCameras => new Camera[0]; public float nearClipPlane { get; set; } public float farClipPlane { get; set; } public float fieldOfView { get; set; } @@ -443,7 +343,6 @@ namespace UnityEngine public float aspect { get; set; } public float depth { get; set; } public int cullingMask { get; set; } - public int pixelWidth => 1920; public int pixelHeight => 1080; public Rect rect { get; set; } public Rect pixelRect { get; set; } @@ -454,47 +353,32 @@ namespace UnityEngine public Vector3 WorldToViewportPoint(Vector3 p) => p; public Vector3 ScreenToWorldPoint(Vector3 p) => p; public Vector3 WorldToScreenPoint(Vector3 p) => p; - public Vector3 ViewportToScreenPoint(Vector3 p) => p; - public Vector3 ScreenToViewportPoint(Vector3 p) => p; public Ray ScreenPointToRay(Vector3 p) => default; - public Ray ViewportPointToRay(Vector3 p) => default; - public void Render() { } } - public enum CameraClearFlags { Skybox = 1, Color = 2, SolidColor = 2, Depth = 3, Nothing = 4 } + public enum CameraClearFlags { Skybox = 1, Color = 2, Depth = 3} public partial struct CharacterInfo { } // ---- coroutine machinery (never pumped headless; types must exist) ---- public class YieldInstruction { } public sealed class Coroutine : YieldInstruction { } - public sealed class WaitForEndOfFrame : YieldInstruction { } public sealed class WaitForSeconds : YieldInstruction { public WaitForSeconds(float s) { } } public sealed class WaitForFixedUpdate : YieldInstruction { } - // ---- input ---- - public struct Touch { public int fingerId; public Vector2 position; public TouchPhase phase; public int tapCount; } - // ---- enums (grow members as the compiler demands) ---- - public enum FontStyle { Normal, Bold, Italic, BoldAndItalic } - public enum TouchPhase { Began, Moved, Stationary, Ended, Canceled } + public enum FontStyle { Normal} // KeyCode lives in UnityRuntime.cs (full enum). - [Flags] public enum HideFlags { None = 0, HideInHierarchy = 1, HideInInspector = 2, DontSaveInEditor = 4, NotEditable = 8, DontSaveInBuild = 16, DontUnloadUnusedAsset = 32, DontSave = 52, HideAndDontSave = 61 } - public enum SendMessageOptions { RequireReceiver, DontRequireReceiver } + [Flags] public enum HideFlags { None = 0, NotEditable = 8, DontSave = 52} + public enum SendMessageOptions { DontRequireReceiver } // ---- attributes: permissive ctors accept any compile-time attribute args ---- public class SerializeField : Attribute { } public class HideInInspector : Attribute { } public class ExecuteInEditMode : Attribute { } - public class ExecuteAlwaysAttribute : Attribute { } - public class DisallowMultipleComponentAttribute : Attribute { } - public class AndroidJavaObject : IDisposable { public AndroidJavaObject(string className, params object[] args) { } public T Call(string method, params object[] args) => default; public void Call(string method, params object[] args) { } public T Get(string name) => default; public void Set(string name, T val) { } public void Dispose() { } } - public class WebCamTexture : Texture { public WebCamTexture() { } public WebCamTexture(int w, int h, int fps) { } public WebCamTexture(string deviceName, int w, int h, int fps) { } public void Play() { } public void Stop() { } public bool isPlaying => false; public Color32[] GetPixels32() => new Color32[0]; public static WebCamDevice[] devices => System.Array.Empty(); } public class AddComponentMenu : Attribute { public AddComponentMenu(string n) { } public AddComponentMenu(string n, int o) { } } public class ContextMenu : Attribute { public ContextMenu(string n) { } } [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class RequireComponent : Attribute { public RequireComponent(Type a) { } public RequireComponent(Type a, Type b) { } public RequireComponent(Type a, Type b, Type c) { } } public class HeaderAttribute : Attribute { public HeaderAttribute(string h) { } } - public class TooltipAttribute : Attribute { public TooltipAttribute(string t) { } } - public class SpaceAttribute : Attribute { public SpaceAttribute() { } public SpaceAttribute(float h) { } } public class RangeAttribute : Attribute { public RangeAttribute(float min, float max) { } } public class MultilineAttribute : Attribute { public MultilineAttribute() { } public MultilineAttribute(int lines) { } } @@ -503,41 +387,26 @@ namespace UnityEngine { public static bool isEditor => false; public static bool isPlaying => true; - public static bool isMobilePlatform => false; public static string persistentDataPath => ""; - public static string dataPath => ""; - public static string temporaryCachePath => ""; public static string version => "1.0"; - public static string identifier => ""; public static int targetFrameRate { get; set; } public static RuntimePlatform platform => RuntimePlatform.WindowsPlayer; - public static SystemLanguage systemLanguage => SystemLanguage.English; - public static void Quit() { } - public static event System.Action focusChanged { add { } remove { } } } - public enum RuntimePlatform { WindowsPlayer, OSXPlayer, IPhonePlayer, Android, WindowsEditor, OSXEditor, LinuxPlayer, XBOX360, BlackBerryPlayer, PS4, XboxOne, Switch, Stadia } - public enum SystemLanguage { English, Japanese, ChineseSimplified, ChineseTraditional, Korean, French, German, Chinese, Unknown } + public enum RuntimePlatform { WindowsPlayer, OSXPlayer, IPhonePlayer, Android, WindowsEditor, OSXEditor, XBOX360, BlackBerryPlayer} public static partial class Time { public static float deltaTime => 0f; public static float time => 0f; public static float unscaledTime => 0f; public static float unscaledDeltaTime => 0f; - public static float fixedDeltaTime => 0.02f; public static float realtimeSinceStartup => 0f; - public static float timeScale { get; set; } public static int frameCount => 0; - public static float timeSinceLevelLoad => 0f; } public static partial class Screen { public static int width => 1920; public static int height => 1080; public static float dpi => 96f; - public static ScreenOrientation orientation { get; set; } public static bool fullScreen { get; set; } - public static Resolution currentResolution => default; } - public enum ScreenOrientation { Portrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight, AutoRotation } - public struct Resolution { public int width; public int height; public int refreshRate; } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs index 1e98338d..db8ed51e 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs @@ -8,8 +8,6 @@ namespace UnityEngine { public class TextAsset : Object { - public string text => ""; - public byte[] bytes => new byte[0]; } public class AsyncOperation @@ -17,7 +15,6 @@ namespace UnityEngine public bool isDone => true; public float progress => 1f; public int priority { get; set; } - public bool allowSceneActivation { get; set; } } public class AssetBundle : Object @@ -25,27 +22,22 @@ namespace UnityEngine public static AssetBundle LoadFromFile(string path) => null; public static AssetBundleCreateRequest LoadFromFileAsync(string path) => null; public string[] GetAllAssetNames() => new string[0]; - public T LoadAsset(string name) where T : Object => null; - public Object LoadAsset(string name) => null; - public Object[] LoadAllAssets() => new Object[0]; public AssetBundleRequest LoadAllAssetsAsync() => null; public void Unload(bool unloadAllLoadedObjects) { } } public class AssetBundleCreateRequest : AsyncOperation { public AssetBundle assetBundle => null; } - public class AssetBundleRequest : AsyncOperation { public Object asset => null; public Object[] allAssets => new Object[0]; } + public class AssetBundleRequest : AsyncOperation { public Object[] allAssets => new Object[0]; } public class Collider2D : Component { public bool enabled { get; set; } } - public partial class BoxCollider2D : Collider2D { public bool isTrigger { get; set; } public Vector2 offset { get; set; } public Vector2 size { get; set; } } + public partial class BoxCollider2D : Collider2D { public Vector2 offset { get; set; } public Vector2 size { get; set; } } public partial class Light : Behaviour { } public class AudioListener : Behaviour { } - public enum RenderTextureFormat { ARGB32, Depth, ARGBHalf, ARGB64, Default } + public enum RenderTextureFormat { ARGB32, Default } public enum RuntimeInitializeLoadType { - AfterSceneLoad, BeforeSceneLoad, AfterAssembliesLoaded, - BeforeSplashScreen, SubsystemRegistration } public sealed class RuntimeInitializeOnLoadMethodAttribute : Attribute @@ -56,19 +48,13 @@ namespace UnityEngine } // Sub-namespace anchors (referenced via `using`; types unmask in later waves if used). -namespace UnityEngine.Experimental { internal class _ShimAnchor { } } -namespace UnityEngine.Experimental.Rendering { internal class _ShimAnchor { } } +namespace UnityEngine.Experimental { } +namespace UnityEngine.Experimental.Rendering { } namespace UnityEngine.SceneManagement { - internal class _ShimAnchor { } - public struct Scene { public string name => ""; public int buildIndex => 0; public bool IsValid() => false; public bool isLoaded => false; } public static class SceneManager { public static void LoadScene(string sceneName) { } - public static void LoadScene(int sceneBuildIndex) { } - public static Scene GetActiveScene() => default; - public static Scene GetSceneByName(string name) => default; - public static int sceneCount => 0; } } namespace UnityEngine.SocialPlatforms @@ -77,5 +63,4 @@ namespace UnityEngine.SocialPlatforms // Cute.IAchievementCallback; adding one here makes the unqualified name ambiguous. public interface IAchievement { } public interface IAchievementDescription { } - public interface ILocalUser { void Authenticate(System.Action callback); } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs index 9c19b81a..d817a377 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShimExt.cs @@ -10,7 +10,6 @@ namespace UnityEngine public partial struct Vector4 { public static Vector4 zero => default; - public static Vector4 one => new Vector4(1f, 1f, 1f, 1f); public static Vector4 operator *(Vector4 a, float s) => new Vector4(a.x * s, a.y * s, a.z * s, a.w * s); public static Vector4 operator *(float s, Vector4 a) => new Vector4(a.x * s, a.y * s, a.z * s, a.w * s); public static Vector4 operator +(Vector4 a, Vector4 b) => new Vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); @@ -33,7 +32,6 @@ namespace UnityEngine public bool hasChanged { get; set; } public Matrix4x4 localToWorldMatrix => default; public Matrix4x4 worldToLocalMatrix => default; - public void Translate(float x, float y) { } public void Rotate(float x, float y) { } public void Translate(Vector3 translation, Space relativeTo) { } public void Rotate(Vector3 eulers, Space relativeTo) { } @@ -63,10 +61,6 @@ namespace UnityEngine public partial class Material { public void CopyPropertiesFromMaterial(Material mat) { } - public void SetVectorArray(string name, Vector4[] values) { } - public void SetVectorArray(int nameID, Vector4[] values) { } - public void SetVectorArray(string name, List values) { } - public void SetVectorArray(int nameID, List values) { } } public partial class Mesh @@ -77,15 +71,11 @@ namespace UnityEngine public Vector2[] uv { get; set; } public Color32[] colors32 { get; set; } public void MarkDynamic() { } - public void RecalculateNormals() { } - public void RecalculateTangents() { } } public partial class Texture2D { public byte[] EncodeToPNG() => Array.Empty(); - public Color32[] GetPixels32() => Array.Empty(); - public void SetPixels32(Color32[] colors) { } public bool LoadImage(byte[] data) => false; } @@ -99,7 +89,6 @@ namespace UnityEngine { public static int PropertyToID(string name) => 0; public static void SetGlobalColor(string name, Color value) { } - public static void SetGlobalColor(int nameID, Color value) { } } public partial class Animation @@ -115,21 +104,14 @@ namespace UnityEngine public bool playOnAwake { get; set; } public int priority { get; set; } public void PlayOneShot(AudioClip clip) { } - public void PlayOneShot(AudioClip clip, float volumeScale) { } } public partial class Camera { public bool enabled { get; set; } - public bool allowMSAA { get; set; } - public int eventMask { get; set; } - public TransparencySortMode transparencySortMode { get; set; } - public void ResetAspect() { } public static int GetAllCameras(Camera[] cameras) => 0; } - public enum TransparencySortMode { Default, Perspective, Orthographic, CustomAxis } - public partial struct CharacterInfo { public int advance; @@ -144,15 +126,7 @@ namespace UnityEngine public static event Action textureRebuilt; public bool GetCharacterInfo(char ch, out CharacterInfo info, int size, FontStyle style) { info = default; return false; } - public bool GetCharacterInfo(char ch, out CharacterInfo info, int size) - { info = default; return false; } - public bool GetCharacterInfo(char ch, out CharacterInfo info) - { info = default; return false; } public void RequestCharactersInTexture(string characters, int size, FontStyle style) { } - public void RequestCharactersInTexture(string characters, int size) { } - public void RequestCharactersInTexture(string characters) { } - // suppress unused-event warning while keeping the API surface - private void _TouchTextureRebuilt() => textureRebuilt?.Invoke(this); } public partial class Light @@ -167,23 +141,18 @@ namespace UnityEngine public partial class Application { - public static string streamingAssetsPath => ""; public static NetworkReachability internetReachability => NetworkReachability.NotReachable; public static void OpenURL(string url) { } } - public enum NetworkReachability { NotReachable, ReachableViaCarrierDataNetwork, ReachableViaLocalAreaNetwork } + public enum NetworkReachability { NotReachable} public partial class Screen { public static int sleepTimeout { get; set; } - public static void SetResolution(int width, int height, bool fullscreen) { } - public static void SetResolution(int width, int height, FullScreenMode mode) { } } - public enum FullScreenMode { ExclusiveFullScreen, FullScreenWindow, MaximizedWindow, Windowed } - - public enum IMECompositionMode { Auto, On, Off } + public enum IMECompositionMode { Auto, On} public partial class Input { @@ -195,7 +164,6 @@ namespace UnityEngine public partial class Resources { public static Object[] FindObjectsOfTypeAll(Type type) => Array.Empty(); - public static T[] FindObjectsOfTypeAll() => Array.Empty(); } } @@ -209,7 +177,6 @@ namespace UnityEngine.Networking public static UnityWebRequest Get(string uri) => new UnityWebRequest(); public UnityWebRequestAsyncOperation SendWebRequest() => new UnityWebRequestAsyncOperation(); public void SetRequestHeader(string name, string value) { } - public string GetResponseHeader(string name) => null; public Dictionary GetResponseHeaders() => new Dictionary(); public bool isDone => true; public float downloadProgress => 1f; @@ -224,19 +191,11 @@ namespace UnityEngine.Networking public class UploadHandlerRaw : UploadHandler { public UploadHandlerRaw(byte[] data) { } } public class DownloadHandlerBuffer : DownloadHandler { } public class UnityWebRequestAsyncOperation : AsyncOperation { } - public static class UnityWebRequestTexture { public static UnityWebRequest GetTexture(string uri) => new UnityWebRequest(); } - public class DownloadHandlerTexture : DownloadHandler { public UnityEngine.Texture2D texture => null; public static UnityEngine.Texture2D GetContent(UnityWebRequest www) => null; } - public class DownloadHandlerAssetBundle : DownloadHandler { public UnityEngine.AssetBundle assetBundle => null; public static UnityEngine.AssetBundle GetContent(UnityWebRequest www) => null; } } namespace UnityEngine { // ---- additional off-battle-path Unity type stubs (CS0246 closure) ---- public sealed class WaitForSecondsRealtime : YieldInstruction { public WaitForSecondsRealtime(float time) { } } - public enum AnimationBlendMode { Blend, Additive } - public class AnimationState { public string name { get; set; } public float speed { get; set; } public float time { get; set; } public float normalizedTime { get; set; } public float length => 0f; public float weight { get; set; } public bool enabled { get; set; } public WrapMode wrapMode { get; set; } public int layer { get; set; } public AnimationBlendMode blendMode { get; set; } public AnimationClip clip => null; } - public class GUIContent { public GUIContent() { } public GUIContent(string text) { } public string text { get; set; } public Texture image { get; set; } } - public class TextEditor { public GUIContent content { get; set; } public string text { get; set; } public void Copy() { } public void Paste() { } public void OnFocus() { } public void SelectAll() { } } - public struct WebCamDevice { public string name => ""; public bool isFrontFacing => false; } - public class Display { public int systemWidth => 0; public int systemHeight => 0; public int renderingWidth => 0; public int renderingHeight => 0; public static Display main => null; public static Display[] displays => Array.Empty(); } + public class AnimationState { public string name { get; set; } public float speed { get; set; } public float time { get; set; } public float length => 0f; } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs index a2eb4db8..34a00060 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs @@ -6,64 +6,25 @@ using System; namespace UnityEngine { - public enum CursorLockMode { None, Locked, Confined } - - public static class Gizmos - { - public static Color color { get; set; } - public static void DrawLine(Vector3 from, Vector3 to) { } - } - public static class Physics2D - { - public static RaycastHit2D GetRayIntersection(Ray ray, float distance = Mathf.Infinity) => default; - public static RaycastHit2D GetRayIntersection(Ray ray, float distance, int layerMask) => default; - public static Collider2D OverlapPoint(Vector2 point, int layerMask) => null; - public static Collider2D[] OverlapPointAll(Vector2 point, int layerMask) => Array.Empty(); - } - public static class Caching - { - public static bool ready => true; - public static bool ClearCache() => true; - } + public enum CursorLockMode { None} public static class GUIUtility { public static string systemCopyBuffer { get; set; } } public static class Cursor { public static CursorLockMode lockState { get; set; } public static bool visible { get; set; } } - public static class ColorUtility - { - public static bool TryParseHtmlString(string htmlString, out Color color) { color = default; return false; } - } - public static class ScreenCapture { public static void CaptureScreenshot(string filename) { } } public static class RenderSettings { public static bool fog { get; set; } } - public static class JsonUtility - { - public static T FromJson(string json) => default!; - public static object FromJson(string json, Type type) => null; - public static string ToJson(object obj) => ""; - public static string ToJson(object obj, bool prettyPrint) => ""; - public static void FromJsonOverwrite(string json, object objectToOverwrite) { } - } public static class Social { - public static UnityEngine.SocialPlatforms.ILocalUser localUser => null; public static void ReportProgress(string achievementID, double progress, Action callback) { } - public static void LoadAchievements(Action callback) { } - public static void LoadAchievementDescriptions(Action callback) { } public static void ShowAchievementsUI() { } } public static class PlayerPrefs { - public static void DeleteAll() { } public static void DeleteKey(string key) { } - public static bool HasKey(string key) => false; - public static void Save() { } - public static float GetFloat(string key, float defaultValue = 0f) => defaultValue; public static int GetInt(string key, int defaultValue = 0) => defaultValue; public static string GetString(string key, string defaultValue = "") => defaultValue; - public static void SetFloat(string key, float value) { } public static void SetInt(string key, int value) { } public static void SetString(string key, string value) { } } @@ -71,8 +32,6 @@ namespace UnityEngine public static class Physics { public static Vector3 gravity { get; set; } - public static bool Raycast(Ray ray, out RaycastHit hit, float maxDistance = float.PositiveInfinity, int layerMask = -1) - { hit = default; return false; } public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hit, float maxDistance = float.PositiveInfinity, int layerMask = -1) { hit = default; return false; } public static RaycastHit[] RaycastAll(Ray ray, float maxDistance = float.PositiveInfinity, int layerMask = -1) @@ -81,35 +40,17 @@ namespace UnityEngine => Array.Empty(); } - public static class GUI - { - public static Color color { get; set; } - public static void Label(Rect position, string text) { } - } - public static class SystemInfo { public static string deviceModel => ""; - public static string deviceName => ""; public static string deviceUniqueIdentifier => ""; public static string operatingSystem => ""; public static string graphicsDeviceName => ""; public static string graphicsDeviceVersion => ""; public static int graphicsShaderLevel => 0; - public static int graphicsMemorySize => 0; public static int systemMemorySize => 0; public static int processorCount => 1; - public static string processorType => ""; - public static bool SupportsRenderTextureFormat(RenderTextureFormat format) => true; public static bool SupportsTextureFormat(TextureFormat format) => true; - public static bool IsFormatSupported(Experimental.Rendering.GraphicsFormat format, Experimental.Rendering.FormatUsage usage) => true; - } - - public static class Graphics - { - public static void Blit(Texture source, RenderTexture dest) { } - public static void Blit(Texture source, RenderTexture dest, Material mat) { } - public static void Blit(Texture source, RenderTexture dest, Material mat, int pass) { } } public static class QualitySettings @@ -123,33 +64,13 @@ namespace UnityEngine public static string ExtractStackTrace() => ""; } - public enum ColorSpace { Uninitialized = -1, Gamma = 0, Linear = 1 } - - public enum RenderTextureReadWrite { Default, Linear, sRGB } + public enum ColorSpace { Linear = 1 } public enum TextureFormat { - Alpha8, ARGB4444, RGB24, RGBA32, ARGB32, RGB565, R16, DXT1, DXT5, - RGBA4444, BGRA32, RHalf, RGHalf, RGBAHalf, RFloat, RGFloat, RGBAFloat, - ARGB64, ASTC_6x6, ETC2_RGB, ETC2_RGBA8, ETC_RGB4, PVRTC_RGB4 - } - - [Flags] - public enum EventModifiers - { - None = 0, Shift = 1, Control = 2, Alt = 4, Command = 8, - Numeric = 16, CapsLock = 32, FunctionKey = 64 - } +ARGB32, ASTC_6x6, ETC2_RGB, ETC2_RGBA8 } } namespace UnityEngine.Experimental.Rendering { - public enum GraphicsFormat { None, R8G8B8A8_UNorm, R16G16B16A16_SFloat, R32G32B32A32_SFloat, D32_SFloat } - [Flags] - public enum FormatUsage { Sample = 1, Linear = 2, Sparse = 4, Render = 8, Blend = 16, MSAA2x = 32 } - public static class GraphicsFormatUtility - { - public static GraphicsFormat GetGraphicsFormat(RenderTextureFormat format, RenderTextureReadWrite readWrite) => GraphicsFormat.None; - public static GraphicsFormat GetGraphicsFormat(TextureFormat format, bool isSRGB) => GraphicsFormat.None; - } } diff --git a/SVSim.BattleEngine/Shim/View/ClosureStubs.cs b/SVSim.BattleEngine/Shim/View/ClosureStubs.cs index 0079eb36..11b23cb1 100644 --- a/SVSim.BattleEngine/Shim/View/ClosureStubs.cs +++ b/SVSim.BattleEngine/Shim/View/ClosureStubs.cs @@ -9,34 +9,20 @@ namespace Wizard.Battle.View { - // nested in BattlePlayerViewBase (decomp); referenced unqualified by BattlePlayerView shell. - public class BattleDialog { } - public enum BattleDialogItem { Menu, Retire } - // nested in BattleCardView/BattleCardBase (decomp); referenced unqualified by *BattleCardView shells. - public class BuildInfo { } } namespace Wizard.Battle.UI { - // private delegate nested in BattleLogUtility (decomp); referenced by its generated partial. - public delegate string FuncGetCantAttackText(); } namespace Wizard.RoomMatch { - // nested enum in PlayerController (decomp); referenced by PlayerControllerForOwn shell. - public enum ROOM_URI { } } namespace Wizard.RoomMatch { - // referenced as field/param types by the watch/replay controller shells (off battle path). - public class TwoPickWatchData { } - public partial class ReplayDataHandler { } } namespace Wizard.Battle.View.Vfx { - // VfxBase subclass declared in StartPickCardVfx.cs (decomp); referenced as a type by StartSummonCardVfx shell. - public class WaitUntilCardIsQueuedToBePlayedVfx { } } diff --git a/SVSim.BattleEngine/Shim/View/HeadlessAttackSelectControl.cs b/SVSim.BattleEngine/Shim/View/HeadlessAttackSelectControl.cs index 849f7148..89ad6da2 100644 --- a/SVSim.BattleEngine/Shim/View/HeadlessAttackSelectControl.cs +++ b/SVSim.BattleEngine/Shim/View/HeadlessAttackSelectControl.cs @@ -13,6 +13,10 @@ // _attackTargetSelectInfo._attackPairsCardIsInvolvedIn animation queue. using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 3 of 4 methods unrun in baseline +// Type: Wizard.Battle.View.HeadlessAttackSelectControl +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.View { diff --git a/SVSim.BattleEngine/Shim/View/HeadlessHandViewStub.cs b/SVSim.BattleEngine/Shim/View/HeadlessHandViewStub.cs index 1a8fb219..475b00ee 100644 --- a/SVSim.BattleEngine/Shim/View/HeadlessHandViewStub.cs +++ b/SVSim.BattleEngine/Shim/View/HeadlessHandViewStub.cs @@ -10,6 +10,10 @@ using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 1 of 5 methods unrun in baseline +// Type: Wizard.Battle.View.HeadlessHandViewStub +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.View { diff --git a/SVSim.BattleEngine/Shim/View/HeadlessPlayQueueViewStub.cs b/SVSim.BattleEngine/Shim/View/HeadlessPlayQueueViewStub.cs index 5244babd..0a8b3ff0 100644 --- a/SVSim.BattleEngine/Shim/View/HeadlessPlayQueueViewStub.cs +++ b/SVSim.BattleEngine/Shim/View/HeadlessPlayQueueViewStub.cs @@ -13,6 +13,10 @@ using UnityEngine; using Wizard.Battle.View.Vfx; +// TODO(engine-cleanup-pass2): 7 of 8 methods unrun in baseline +// Type: Wizard.Battle.View.HeadlessPlayQueueViewStub +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.View { diff --git a/SVSim.BattleEngine/Shim/View/HeadlessVoiceInfo.cs b/SVSim.BattleEngine/Shim/View/HeadlessVoiceInfo.cs index 14940759..6e1f00ea 100644 --- a/SVSim.BattleEngine/Shim/View/HeadlessVoiceInfo.cs +++ b/SVSim.BattleEngine/Shim/View/HeadlessVoiceInfo.cs @@ -1,3 +1,7 @@ +// TODO(engine-cleanup-pass2): 12 of 14 methods unrun in baseline +// Type: Wizard.Battle.View.HeadlessVoiceInfo +// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt + namespace Wizard.Battle.View { // HEADLESS-FIX (M7): a non-null IReadOnlyVoiceInfo singleton for the headless death-voice tail. diff --git a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs index 5790011f..d7d5967f 100644 --- a/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs +++ b/SVSim.BattleEngine/Shim/View/SettingsUiStubs.cs @@ -24,8 +24,8 @@ namespace Wizard.ErrorDialog // back to the static Wizard.Data god-object (CS0718/0722/0723 + missing ButtonType). public class Data { - public enum ContactDisplayType { _NONE_, 表示, MAX } - public enum ButtonType { _NONE_, OK, リトライ, タイトルへ戻る, ホームへ戻る, アプリ終了, バージョンアップ, 推奨端末一覧, MAX } + public enum ContactDisplayType { } + public enum ButtonType { _NONE_, OK, リトライ, タイトルへ戻る, ホームへ戻る, アプリ終了, バージョンアップ, 推奨端末一覧} public string TitleId { get; private set; } public string BodyId { get; private set; } @@ -41,7 +41,7 @@ namespace Wizard.ErrorDialog namespace Wizard.Battle.UI { - public enum CantAttackType { Null, All, Class, NotHasGuard, Unit, Max } + public enum CantAttackType { Null, All, Class, NotHasGuard, Unit} } namespace Wizard.Battle.View @@ -96,50 +96,26 @@ namespace Wizard.Battle.View.Vfx namespace AnimationOrTween { - public enum DisableCondition { DisableAfterReverse = -1, DoNotDisable, DisableAfterForward } - public enum EnableCondition { DoNothing, EnableThenPlay, IgnoreDisabledState } + public enum DisableCondition { DoNotDisable} + public enum EnableCondition { EnableThenPlay, IgnoreDisabledState } } namespace Wizard.UI.LoginBonus { - public class ContinuousData { public ContinuousData(LitJson.JsonData jsonData) { } } - public class NormalData { public NormalData(LitJson.JsonData jsonData) { } } - public class SpecialData { public SpecialData(LitJson.JsonData jsonData) { } } - public class FreeCardPackBoxData { public FreeCardPackBoxData(LitJson.JsonData jsonData) { } } } namespace DeckBuilder { public partial class GenerateDeckCode { } - public partial class GetDeckDataFromCode { } -} - -namespace Wizard.Story.ChapterSelection.SelectionProcessing.BattleResult -{ - public interface IProcessing - { - IProcessing NextProcessing { get; set; } - void Execute(Parameter param); - } - // Parameter is generated full-surface (ctor + props) in Shim/Generated/Parameter__*.g.cs } namespace Wizard.RoomMatch { - public partial class PlayerControllerForWatching { } // SEND_PARAMETER enum is in Generated/PlayerControllerForWatching.g.cs public partial class RoomRuleSetting { } } namespace Cute { - public class SceneChangeParameter { public bool KeepAssets; public SceneType BeforeScene; public SceneType NextScene; public string NextState; } - public class SceneManager - { - public SceneChangeParameter SceneChangeParameter = new SceneChangeParameter(); - public void ChangeScene(string next_scene) { } - public void ChangeScene(string next_scene, string active_state) { } - public void ChangeScene(SceneType type, string active_state = "") { } - } } namespace Wizard.Story @@ -147,54 +123,18 @@ namespace Wizard.Story public enum StoryApiType { None, MainStory, LimitedStory, EventStory } public partial class SelectedStoryInfo { } public partial class StoryWorldDataManager { } - public sealed class StoryWorldData { } // signature-only type pulled by StoryWorldDataManager full-surface (non-battle) } namespace Wizard.Title { - // ITitleProc impls pulled by full-surface stubs; referenced as signature types only (non-battle). - public class BattleRecovery { } - public class ResourceDownloader { } - public class TemporaryAssetDeleter { } } namespace BestHTTP.SocketIO { - // BestHTTP SDK types — minimal hand shim (full-surface would pull the whole SocketIO - // closure). Node-server real-time socket path is Phase-2; these are off the battle path. - public sealed class Packet { public System.Collections.Generic.List Attachments { get; set; } } - public delegate void SocketIOCallback(Socket socket, Packet packet, params object[] args); - public sealed class Socket - { - public string Id => ""; - public Socket On(string eventName, SocketIOCallback callback) => this; - public Socket On(BestHTTP.SocketIO.SocketIOEventTypes type, SocketIOCallback callback) => this; - public Socket Off(string eventName) => this; - public Socket Off() => this; - public Socket Emit(string eventName, params object[] args) => this; - } - public class SocketOptions - { - public bool AutoConnect { get; set; } - public Transports.TransportTypes ConnectWith { get; set; } - public PlatformSupport.Collections.ObjectModel.ObservableDictionary AdditionalQueryParams { get; set; } - } - public sealed class SocketManager - { - public enum States { Initial, Opening, Open, Paused, Pausing, Reconnecting, Closed } - public SocketManager(System.Uri uri) { } - public SocketManager(System.Uri uri, SocketOptions options) { } - public States State => States.Closed; - public Socket Socket { get; } = new Socket(); - public Socket this[string nsp] => Socket; - public void Open() { } - public void Close() { } - public void SettingRealtimeNetworkAgent(object agent) { } - } } // ---- namespace anchors (referenced via `using`/qualified path; no type used yet) ---- -namespace Wizard.Scripts.Network.Task { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Task.Arena { internal class _ShimAnchor { } } -namespace Wizard.Scripts.Network.Task.Arena.TwoPick { internal class _ShimAnchor { } } -namespace BestHTTP.Decompression.Zlib { internal class _ShimAnchor { } } +namespace Wizard.Scripts.Network.Task { } +namespace Wizard.Scripts.Network.Task.Arena { } +namespace Wizard.Scripts.Network.Task.Arena.TwoPick { } +namespace BestHTTP.Decompression.Zlib { } diff --git a/SVSim.BattleEngine/Shim/View/StoryTitleStubs.cs b/SVSim.BattleEngine/Shim/View/StoryTitleStubs.cs index b40e1413..044c838e 100644 --- a/SVSim.BattleEngine/Shim/View/StoryTitleStubs.cs +++ b/SVSim.BattleEngine/Shim/View/StoryTitleStubs.cs @@ -5,7 +5,7 @@ namespace Wizard.Story { - public enum StoryEntranceType { None, MainStory, LimitedStory, EventStory, AllStory } + public enum StoryEntranceType { None, LimitedStory, AllStory } } namespace Wizard.Story.ChapterSelection @@ -14,18 +14,6 @@ namespace Wizard.Story.ChapterSelection public class TitlePanelBase : UnityEngine.MonoBehaviour { public bool IsFinishInit { get; } } } -namespace Wizard.Story.ChapterSelection.SelectionProcessing.Main -{ - // Parallel to the BattleResult submodule (already shimmed); some copied files - // `using` this Main module and reference these unqualified. - public interface IProcessing - { - IProcessing NextProcessing { get; set; } - void Execute(Parameter param); - } - // Parameter is generated full-surface (ctor + props) in Shim/Generated/Parameter__*.g.cs -} - namespace Wizard.UIFriend { public partial class Friend { public partial class PlayerData { } } @@ -34,11 +22,11 @@ namespace Wizard.UIFriend public virtual void SetPlayerData(Friend.PlayerData in_PlayerData, System.Collections.Generic.List in_LoadList) { } } } -namespace Wizard.Title { public partial class GameSetup { } } -namespace Wizard.RoomMatch { public class Player { public long Emblem { get; set; } public int Degree { get; set; } public string Country { get; set; } public string Name { get; set; } public int Rank { get; set; } public bool IsFriend { get; set; } public int ViewerId { get; set; } } } +namespace Wizard.Title { } +namespace Wizard.RoomMatch { } // ---- namespace anchors (referenced via `using`) ---- -namespace Wizard.Scripts.Network.Task.ItemAcquireHistory { internal class _ShimAnchor { } } -namespace Wizard.UI.Profile { internal class _ShimAnchor { } } -namespace Wizard.UI.ReportToManagement { internal class _ShimAnchor { } } -namespace Wizard.Battle.Tutorial { internal class _ShimAnchor { } } +namespace Wizard.Scripts.Network.Task.ItemAcquireHistory { } +namespace Wizard.UI.Profile { } +namespace Wizard.UI.ReportToManagement { } +namespace Wizard.Battle.Tutorial { } diff --git a/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs b/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs index b67f436f..ca4e0d4d 100644 --- a/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs +++ b/SVSim.BattleEngine/Shim/View/StoryWorldStubs.cs @@ -4,23 +4,17 @@ // (BackgroundData/StoryWorldData/IResourceHandle/animation managers, etc.); empty // no-op stubs in their decomp namespaces resolve the references without the closure. -namespace Wizard.Story.ChapterSelection.FlowChart { public class BackgroundView { } } +namespace Wizard.Story.ChapterSelection.FlowChart { } namespace Wizary.StorySelectionWorld { - public class WorldPanel { } - public class WorldPanelView { } - public class SectionButton { } - public class SectionButtonView { } public class StorySelectionWorldScene { public static int? RedirectSectionId { get; set; } } } -namespace Wizard.Scenario2.Resource { public class ResourceManager { } } +namespace Wizard.Scenario2.Resource { } namespace Wizard.UI.Profile { - public class ProfileUI { } - public class ClassPageItem { } } namespace Wizard.Story.ChapterSelection diff --git a/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs b/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs index 95ea752a..c93b80d8 100644 --- a/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs +++ b/SVSim.BattleEngine/Shim/View/TouchProcessorIfaces.cs @@ -18,8 +18,6 @@ namespace Wizard.Battle.Touch public partial class ChoiceTouchProcessor : ITouchProcessor { } public partial class DeckTouchProcessor : ITouchProcessor { } public partial class EvolutionTouchProcessor : ITouchProcessor { } - public partial class FusionSimpleProcessor : ITouchProcessor { } - public partial class FusionTargetSelectTouchProcessor : ITouchProcessor { } public partial class SelectCardProcessor : ITouchProcessor { } // Empty hand stubs: supply the four ITouchProcessor members as no-ops. diff --git a/SVSim.BattleEngine/Shim/View/VfxBaseCtors.cs b/SVSim.BattleEngine/Shim/View/VfxBaseCtors.cs deleted file mode 100644 index c40a9a66..00000000 --- a/SVSim.BattleEngine/Shim/View/VfxBaseCtors.cs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTHORED SHIM (not copied). Parameterless ctors for generated Vfx BASE types whose -// decomp only declares parameterized ctors. A net-new generated derived stub's ctor is -// emitted as `{ }` with an implicit `base()` call (m1_stub_gen doesn't thread base args), -// so when the base lacks a parameterless ctor the derived fails CS7036. These no-op -// parameterless ctors satisfy the implicit base() — purely a compile aid, off battle path. -// (If this recurs broadly, teach m1_stub_gen to emit a guarded no-op parameterless ctor.) - -namespace Wizard.Battle.View.Vfx -{ - public partial class ForecastIconVfxBase { protected ForecastIconVfxBase() { } } - public partial class ShowChantCountVfx { public ShowChantCountVfx() { } } - public partial class EvolveVfx { public EvolveVfx() { } } -} diff --git a/SVSim.BattleEngine/Shim/View/VfxShim.cs b/SVSim.BattleEngine/Shim/View/VfxShim.cs index 5a54cdbd..2f616438 100644 --- a/SVSim.BattleEngine/Shim/View/VfxShim.cs +++ b/SVSim.BattleEngine/Shim/View/VfxShim.cs @@ -16,12 +16,9 @@ namespace Wizard.Battle.View.Vfx public class VfxBase { public virtual bool IsEnd { get; protected set; } = true; - public virtual string CurrentVfxName => GetType().ToString(); public virtual void Update(float dt, List effectVfxList) { } public virtual void Play() { } - public virtual VfxBase Cancel() => this; public virtual bool IsVfxNonEmpty() => false; - public virtual List GetVfxNames() => new List(); } public sealed class NullVfx : VfxBase @@ -62,8 +59,6 @@ namespace Wizard.Battle.View.Vfx public static SequentialVfxPlayer Create(params VfxBase[] vfxCollection) { var p = new SequentialVfxPlayer(); if (vfxCollection != null) p._children.AddRange(vfxCollection); return p; } public void Register(VfxBase vfx) { if (vfx != null) _children.Add(vfx); } - public int Count() => _children.Count; - public List GetAllVfxAsList() => new List(_children); public override bool IsVfxNonEmpty() { foreach (var c in _children) { if (c != null && c.IsVfxNonEmpty()) return true; } @@ -124,32 +119,19 @@ namespace Wizard.Battle.View.Vfx public VfxWith(VfxBase vfx, T1 value1, T2 value2) { Vfx = vfx; Value_1 = value1; Value_2 = value2; } } - // m1_stub_gen drops `event` decls (session-6 gap) — re-add StartSkillSelectVfx.OnStart - // that its generated stub lost. Re-check this if CS1061 on an event name recurs. - public partial class StartSkillSelectVfx { public event System.Action OnStart; } - public class EvolveVfxBase : VfxBase { } - public partial class CanNotTouchCardVfx : VfxBase { } - public partial interface ICardVfxCreator { } - public interface IBattleCardVfxCreator { } // The VFX manager: headless, registration is suppressed (real VfxMgr early-returns // 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 vfx) where T : VfxBase { } - public void Register(T vfx) where T : VfxBase { } public virtual void RegisterSequentialVfx(T vfx) where T : VfxBase { } - public Queue GetSequentialVfxQueues() => new Queue(); public List GetVfxList() => new List(); - public static void CheckAndAddEffectVfxList(VfxBase vfx, List effectVfxList) { } public virtual void Update(float dt) { } public virtual void Cancel() { } public void Dispose() { } - public void Clear() { } } } diff --git a/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs b/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs index 29ab83e1..57ce9195 100644 --- a/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs +++ b/SVSim.BattleEngine/Shim/View/ViewUiTouchStubs.cs @@ -45,14 +45,11 @@ namespace Wizard.Battle.View get => _gameObject ??= new UnityEngine.GameObject(); protected set => _gameObject = value; } - public HandCardFrameEffectControl HandFrameEffect { get; private set; } - public static HandParameter.IconLayout GetCurrentIconLayout() => default!; } public partial class NonDialogPopup : UnityEngine.MonoBehaviour { } // Close() in Generated/NonDialogPopup.g.cs public abstract class BattlePlayerViewBase { public enum BattleDialogItem { Menu, Retire } - public static bool AlwaysShowStatusPanel => true; public bool IsSelecting { get; set; } } public partial class InPlayCardFrameEffectControl { } @@ -64,14 +61,8 @@ namespace Wizard.Battle.UI public partial class BattleLogManager { } public partial class BattleLogWindow : UnityEngine.MonoBehaviour { - public enum BattleLogType { Battle, PlayCardLog, Destruction, Information } - public void HideCardListPanel() { } + public enum BattleLogType { Battle, PlayCardLog, Destruction} } - public partial class AvatarBattleTitleItem : UnityEngine.MonoBehaviour { } - public partial class AvatarBattlePassiveBonusItem : UnityEngine.MonoBehaviour { } - public partial class AvatarBattleBonusItem : UnityEngine.MonoBehaviour { } - public partial class BossRushEnemySpecialSkillItem : UnityEngine.MonoBehaviour { } - public partial class MyRotationBonusItem : UnityEngine.MonoBehaviour { } public partial class EvolutionConfirmation { } } @@ -101,15 +92,10 @@ namespace Wizard.Battle.Replay void SetupBattleInfoFilter(); void SetupOperateMgrEvents(BattleManagerBase battleMgr); } - public class NetworkBattleReplayOperationRecorder - { - public class RecordBattleLogParameter { } - } } namespace Wizard.Replay { - public partial class ReplayController { } } namespace Wizard.RoomMatch diff --git a/SVSim.BattleEngine/Shim/View/WatchDataHandler.cs b/SVSim.BattleEngine/Shim/View/WatchDataHandler.cs new file mode 100644 index 00000000..1d00a26e --- /dev/null +++ b/SVSim.BattleEngine/Shim/View/WatchDataHandler.cs @@ -0,0 +1,14 @@ +// AUTHORED SHIM (pass-5): WatchDataHandler is a compile-time load-bearing type — it appears +// as `WatchDataHandler handler = null` on ~6 method signatures in NetworkBattleReceiver and +// (until this pass ships) on NetworkWatchBattleReceiver. Headless callers always pass null; +// isOwner()/IsIncludedUri() are only reached from the isWatch=true (spectator) branch, which +// the node never enters. Kept as an empty class with the two members compile paths reference, +// returning defaults. Moved out of Shim/Generated/ since the auto-generated ctor referenced +// NetworkWatchBattleMgr + RoomConnectController, both scheduled for deletion in this pass. +namespace Wizard.RoomMatch; + +public partial class WatchDataHandler +{ + public bool IsIncludedUri(string uri) => false; + public bool isOwner(string idStr) => false; +} diff --git a/SVSim.BattleNode/SVSim.BattleNode.csproj b/SVSim.BattleNode/SVSim.BattleNode.csproj index 4816d9b4..f3b82f30 100644 --- a/SVSim.BattleNode/SVSim.BattleNode.csproj +++ b/SVSim.BattleNode/SVSim.BattleNode.csproj @@ -3,6 +3,11 @@ net8.0 enable enable + + $(NoWarn);NU1903 diff --git a/SVSim.BattleNode/Sessions/BattleSession.cs b/SVSim.BattleNode/Sessions/BattleSession.cs index 2042c6cd..d4fbce44 100644 --- a/SVSim.BattleNode/Sessions/BattleSession.cs +++ b/SVSim.BattleNode/Sessions/BattleSession.cs @@ -186,10 +186,10 @@ public sealed class BattleSession if (A is RealParticipant rpA) rpA.Outbound.Clear(); if (B is RealParticipant rpB) rpB.Outbound.Clear(); - // Per-session BattleAmbientContext on the engine isolates per-battle state across concurrent - // sessions (Task 7 of multi-instancing migration), so the historical single-active-engine gate - // (and its matching try/finally Release) is gone — engine setup is unconditional per session, - // and there is no teardown obligation that must run on a throw from the participant tear-down. + // Per-session mgr instance (Phase-5 ambient rip, chunk 47) isolates per-battle state across + // concurrent sessions, so the historical single-active-engine gate (and its matching + // try/finally Release) is gone — engine setup is unconditional per session, and there is no + // teardown obligation that must run on a throw from the participant tear-down. await Task.WhenAll( A.TerminateAsync(BattleFinishReason.NormalFinish), B.TerminateAsync(BattleFinishReason.NormalFinish)) @@ -278,10 +278,10 @@ public sealed class BattleSession { case NetworkBattleUri.Deal when !_engineDealFed: _engineDealFed = true; - _log.LogWarning("BattleSession {Bid}: DEAL DIAG BEFORE: {Diag}", + _log.LogDebug("BattleSession {Bid}: DEAL diag BEFORE: {Diag}", BattleId, _engine.DiagnoseDealState()); ShadowFeed(frame, isPlayerSeat: true, "Deal"); - _log.LogWarning("BattleSession {Bid}: DEAL DIAG AFTER: {Diag}", + _log.LogDebug("BattleSession {Bid}: DEAL diag AFTER: {Diag}", BattleId, _engine.DiagnoseDealState()); break; @@ -338,12 +338,12 @@ public sealed class BattleSession if (_engineSetupAttempted) return; _engineSetupAttempted = true; - // Per-session BattleAmbientContext on the engine isolates per-battle state across concurrent - // sessions (Task 7 of multi-instancing migration), so the historical single-active-engine gate - // (EngineSessionGate.TryAcquire) is gone and engine setup is unconditional. A genuine setup - // failure still surfaces via ComputeFrames' shadow-engine try/catch (it logs + swallows so the - // relay never sees an engine exception, ND6), and IsReady stays false in that case so - // ShadowIngest/ShadowFeedServerFrames no-op for the rest of the battle. + // Per-session mgr instance (Phase-5 ambient rip, chunk 47) isolates per-battle state across + // concurrent sessions, so the historical single-active-engine gate (EngineSessionGate.TryAcquire) + // is gone and engine setup is unconditional. A genuine setup failure still surfaces via + // ComputeFrames' shadow-engine try/catch (it logs + swallows so the relay never sees an engine + // exception, ND6), and IsReady stays false in that case so ShadowIngest/ShadowFeedServerFrames + // no-op for the rest of the battle. // // Seed the engine's StableRandom with BattleSeeds.Stable(MasterSeed) — the SAME value the // Matched frame ships to both clients (InitBattleHandler.cs:28). The clients seed their @@ -362,6 +362,14 @@ public sealed class BattleSession private void ShadowIngest(IBattleParticipant from, MsgEnvelope env) { if (!_engine.IsReady) return; + // Node-only handshake URIs (InitNetwork, InitBattle) have no counterpart on the engine's + // NetworkBattleURI enum — they're pure relay plumbing (see InitNetworkHandler / + // InitBattleHandler). Feeding them to the engine's MapUri throws ArgumentException that + // the outer try/catch swallows, but produces a per-frame warn+stack-trace for every + // battle setup. Skip at the ingest source rather than plumb an ignore-branch through the + // engine (the whole point of the shadow being separate is that node protocol changes + // shouldn't require engine touches). + if (env.Uri is NetworkBattleUri.InitNetwork or NetworkBattleUri.InitBattle) return; bool isPlayerSeat = ReferenceEquals(from, A); var r = _engine.Receive(env, isPlayerSeat); if (r.Diverged) diff --git a/SVSim.BattleNode/Sessions/Engine/EngineGlobalInit.cs b/SVSim.BattleNode/Sessions/Engine/EngineGlobalInit.cs index 09fb77c4..c0ec3369 100644 --- a/SVSim.BattleNode/Sessions/Engine/EngineGlobalInit.cs +++ b/SVSim.BattleNode/Sessions/Engine/EngineGlobalInit.cs @@ -60,11 +60,9 @@ internal static class EngineGlobalInit public static void EnsureInitialized() { - // GameMgr is now per-session (BattleAmbientContext.GameMgr), so its DataMgr/NetworkUserInfoData - // wiring must run on EVERY call — once-per-process gating it (under _done) leaves a second-or- - // later session with an unwired ctx.GameMgr and NREs in NetworkBattleManagerBase.CreateBackgroundId. - // The wiring itself is idempotent (zero-or-null guards), so re-running is safe. - WirePerSessionGameMgr(); + // Phase-5 chunk 46: per-session GameMgr wiring moved to SessionBattleEngine.SetupInternal + // where the session's own GameMgr is in scope. EnsureInitialized only handles the true + // process-globals below. if (_done) return; lock (_gate) @@ -86,14 +84,15 @@ internal static class EngineGlobalInit .SetValue(null, new Crossover()); } - // Suppress VFX / take the virtual-battle resolution path (no live view layer). - BattleManagerBase.IsForecast = true; + // Phase-5 chunk 43: was `BattleManagerBase.IsForecast = true` — a static ambient-bridge + // write that ran before any mgr was constructed, so it stashed in ambient.IsForecast for + // pre-Phase-5 propagation onto the mgr's InstanceIsForecast at attach. With chunk 42's + // ambient rip that propagation is gone and the write became a silent no-op. Init here is + // now redundant: BattleManagerBase.InstanceIsForecast = true by default. - // Post-Task-8: BattleRecoveryInfo lives on the per-session BattleAmbientContext (RecoveryInfo, - // pre-seeded with an uninitialized no-op instance in SessionBattleEngine's field initializer). - // Each session owns its own (IsMulliganEnd=false default), so the MulliganMgrBase.StartDeal - // read resolves per-session — the historical process-global Data.BattleRecoveryInfo write that - // lived here was dead the moment the ambient seam landed (reviewer-flagged in Task 7). + // BattleRecoveryInfo lives on the mgr instance itself (InstanceRecoveryInfo). Historical + // process-global write here was dead the moment the mgr's per-instance slot landed + // (Task 7 / Phase-5a). // --- static CardMaster (full cards.json) ---------------------------------------------- // ALWAYS rebuild + re-inject the FULL master. We must not defer to a possibly-thin @@ -121,46 +120,31 @@ internal static class EngineGlobalInit udidField.SetValue(null, "headless-udid"); // --- Cute.Certification.viewer_id ------------------------------------------------------ - // Post-Task-8: viewer id lives on the per-session BattleAmbientContext (ViewerId, init-only). - // SessionBattleEngine seeds it from ThisViewerId in its field initializer and enters the - // ambient on every Setup/Receive — so the engine's Certification.ViewerId getter - // (BattleAmbient.Require().ViewerId) always resolves cleanly when the engine code is - // reached. The reflection write that used to seed `Certification._viewerIdFallback` is now - // dead (the static is deleted). Left as a comment-only marker so the design intent (this - // viewer id defines the engine's "player" perspective for the IsRecovery target parse) - // stays discoverable from the global init path. + // Viewer id lives on the mgr instance (InstanceViewerId, default 1001 = ThisViewerId). + // Certification.ViewerId's static getter reads the mgr via GetIns()?.InstanceViewerId + // — no seeding needed here. _done = true; } } - // Per-session GameMgr wiring: under the ambient seam, GameMgr.GetIns() resolves to the SESSION's - // BattleAmbientContext.GameMgr — a fresh instance per SessionBattleEngine. So the DataMgr chara ids - // and NetworkUserInfoData seeding must run on every Setup, not just process-once. The reflection - // helpers below are idempotent (SetFieldIfZeroOrNull is a no-op once set; netUser is null-guarded). - private static void WirePerSessionGameMgr() + // Per-session GameMgr wiring: seeds DataMgr chara ids + NetworkUserInfoData on the session's own + // GameMgr. Caller (SessionBattleEngine.SetupInternal) passes _gameMgr BEFORE mgr construction so + // the base ctor's BattlePlayer/DataMgr reads resolve. Idempotent (SetFieldIfZeroOrNull no-ops once + // set; netUser is null-guarded). + public static void WirePerSessionGameMgr(GameMgr gm) { - // --- GameMgr DataMgr leader chara ids -------------------------------------------------- - // Set the backing fields directly: the public SetPlayerCharaId() also pulls MyRotation/ - // AvatarBattle info (more null statics) the resolution path doesn't need. Idempotent - // (plain assignment); only meaningful when still 0. - var dm = GameMgr.GetIns().GetDataMgr(); + var dm = gm.GetDataMgr(); SetFieldIfZeroOrNull(dm, "_playerCharaId", PlayerCharaId); SetFieldIfZeroOrNull(dm, "_enemyCharaId", EnemyCharaId); - // --- NetworkUserInfoData (background lookup on the network mgr's CreateBackgroundId) ---- - // NetworkBattleManagerBase.CreateBackgroundId reads - // GameMgr.GetIns().GetNetworkUserInfoData().GetFieldId() when the RecoveryManager yields no - // bg id. GameMgr leaves _netUser null with no lazy init; seed a no-op instance whose - // _selfInfo carries just fieldId=1 (== ForestField, a valid background). Only seed when - // absent so a HeadlessEngineEnv-set instance is preserved. - if (GameMgr.GetIns().GetNetworkUserInfoData() == null) + if (gm.GetNetworkUserInfoData() == null) { var netUser = new NetworkUserInfoData(); netUser.SetSelfInfo( new Dictionary { ["fieldId"] = 1 }, isWatchReplayRecovery: false); - GameMgr.GetIns().SetNetworkUserInfoData(netUser); + gm.SetNetworkUserInfoData(netUser); } } diff --git a/SVSim.BattleNode/Sessions/Engine/SessionBattleEngine.cs b/SVSim.BattleNode/Sessions/Engine/SessionBattleEngine.cs index 7589e088..6161cf5f 100644 --- a/SVSim.BattleNode/Sessions/Engine/SessionBattleEngine.cs +++ b/SVSim.BattleNode/Sessions/Engine/SessionBattleEngine.cs @@ -1,6 +1,4 @@ extern alias engine; -using BattleAmbient = engine::SVSim.BattleEngine.Ambient.BattleAmbient; -using BattleAmbientContext = engine::SVSim.BattleEngine.Ambient.BattleAmbientContext; using System.Reflection; using System.Runtime.Serialization; using engine::SVSim.BattleEngine.Rng; @@ -18,7 +16,6 @@ using SBattleLoad = engine::SBattleLoad; using CardTemplate = engine::CardTemplate; using GameObject = engine::UnityEngine.GameObject; using RealTimeNetworkAgent = engine::RealTimeNetworkAgent; -using Gungnir = engine::Gungnir; using NetworkNullLogger = engine::NetworkNullLogger; using ToolboxGame = engine::Wizard.ToolboxGame; using GameMgr = engine::GameMgr; @@ -49,20 +46,13 @@ internal sealed class SessionBattleEngine { private const int DefaultLeaderLife = 20; - private readonly BattleAmbientContext _ctx = new() { - ViewerId = EngineGlobalInit.ThisViewerId, - IsForecast = true, - IsRandomDraw = true, - // Per-session BattleRecoveryInfo: the receive-conductor deal path runs under IsRecovery - // (set after mgr construction below) and reads Data.BattleRecoveryInfo.IsMulliganEnd in - // MulliganMgrBase.StartDeal — null reads NRE. Each session owns its own no-op instance with - // IsMulliganEnd=false (the default); GetUninitializedObject skips the JsonData ctor. Each - // SessionBattleEngine carries its own ambient _ctx, so per-session isolation is by construction - // (the EngineGlobalInit fallback only seeded once-per-process and silently fell over for the - // second + later session that entered a fresh ambient — diagnosed Task 7). - RecoveryInfo = (engine::Wizard.BattleRecoveryInfo)FormatterServices - .GetUninitializedObject(typeof(engine::Wizard.BattleRecoveryInfo)), - }; + // Phase-5 chunk 47: was `BattleAmbientContext _ctx` — an ambient-scoped bundle of + // per-session state (GameMgr / ViewerId / IsForecast / IsRandomDraw / RecoveryInfo / + // NetworkAgent) that engine code read via BattleAmbient.Current. The ambient is dead + // (chunk 46 made GetIns() return null); everything that was on _ctx now lives on the mgr + // instance directly. What remains is the per-session GameMgr, kept as a plain field so it + // can be seeded (WirePerSessionGameMgr) BEFORE the mgr ctor reads it via the (cc, gm) overload. + private readonly GameMgr _gameMgr = new(); private HeadlessNetworkBattleMgr? _mgr; private NetworkBattleReceiver? _receiver; @@ -77,16 +67,15 @@ internal sealed class SessionBattleEngine /// the CardClass int value); they select the leader's class via the all-8-class /// ClassCharacterList EngineGlobalInit installs (chara_id == class_id for 1..8). The 3-arg overload /// behavior is preserved by the defaults (1/2), matching the test-harness charaIds. - /// NOTE: GameMgr is now per-session via ; the leader - /// chara ids are set on the SESSION's GameMgr (resolved through the ambient by - /// EngineGlobalInit.WirePerSessionGameMgr), not on a process-wide singleton. This is the Task-7 - /// payoff: concurrent sessions each own their own GameMgr + engine state, so the historical - /// single-active-engine gate (deleted EngineSessionGate) is no longer needed. + /// NOTE: GameMgr is per-session on the mgr instance (Phase-5 ambient rip, chunk 47); leader + /// chara ids are set on the SESSION's _gameMgr (seeded pre-ctor by + /// EngineGlobalInit.WirePerSessionGameMgr), not on a process-wide singleton. This is the + /// multi-instancing payoff: concurrent sessions each own their own GameMgr + engine state, so the + /// historical single-active-engine gate (deleted EngineSessionGate) is no longer needed. public void Setup(int masterSeed, IReadOnlyList seatADeck, IReadOnlyList seatBDeck, int seatAClass = 1, int seatBClass = 2) { - using var _ambient = BattleAmbient.Enter(_ctx); SetupInternal(masterSeed, seatADeck, seatBDeck, seatAClass, seatBClass, rng: null); } @@ -100,7 +89,6 @@ internal sealed class SessionBattleEngine IReadOnlyList seatADeck, IReadOnlyList seatBDeck, int seatAClass = 1, int seatBClass = 2) { - using var _ambient = BattleAmbient.Enter(_ctx); var log = new List(); // The logger needs the mgr to read seat signals at roll time; the mgr is built inside Setup, so the // logger reads it lazily via a closure populated right after construction. @@ -120,12 +108,29 @@ internal sealed class SessionBattleEngine // here rather than throwing into the shadow's no-op path (Phase 2 N2, carried-risk A). EngineGlobalInit.EnsureInitialized(); + // Phase-5 chunk 46: seed the session's own GameMgr (chara ids + net-user) BEFORE mgr + // construction so the base ctor's BattlePlayer/DataMgr reads resolve. Was piggybacked on + // EnsureInitialized via ambient reach; now explicit and per-session. + EngineGlobalInit.WirePerSessionGameMgr(_gameMgr); + // rng defaults to SeededRandomSource(masterSeed) inside the mgr — masterSeed here is the // engine's StableRandom seed (parameter name preserved for API compatibility; callers pass // BattleSeeds.Stable(rootMasterSeed) so the stream is born aligned with the seed the node // ships to both clients in Matched.seed). F-N-5; O-N-2 "bit-aligned anyway". - var mgr = new HeadlessNetworkBattleMgr(new SessionContentsCreator(masterSeed), rng); + // Phase-5 chunk 45: seed the mgr's GameMgr via _ctx (the session's ambient-attached GameMgr) + // and hand it to the mgr's pre-seeded ctor. Eliminates the "ambient reaches into mgr ctor" + // step; equivalent behavior since _gameMgr is the same instance the node reads later. + var mgr = new HeadlessNetworkBattleMgr(new SessionContentsCreator(masterSeed), rng, _gameMgr); if (mgrBox is not null) mgrBox[0] = mgr; // publish for the test roll-logger closure (DebugSetupWithRollLog) + + // Publish the mgr on the ambient EARLY (Phase 5a, 2026-07-02). Pre-Phase-5a the ambient + // stored NetworkAgent/RecoveryInfo/IsForecast/etc. directly, so late-attach was fine. + // Post-5a those fields are instance-backed on the mgr, and every accessor routes through + // BattleManagerBase.GetIns() → ambient.Mgr — so any subsequent setup call that reaches for + // one of them (InstallHeadlessNetworkAgent, SetGameMgrCharaIds, etc.) needs the mgr already + // attached. The later `_mgr = mgr; // Phase-5 chunk 47: was _ctx.Mgr = _mgr — ambient publish is dead.` line is now a no-op re-assignment; + // kept there for readability at the "wire mulligan" seam it originally guarded. + // Phase-5 chunk 47: was _ctx.Mgr = mgr — ambient publish is dead (GetIns() returns null unconditionally). // Recovery mode is the engine's OWN headless replay path: the live view/UI touches on the // receive cycle (BattleUIContainer.DisableMenu, turn-control UI, card-view creation, VFX // waits) are all gated `!IsRecovery` (BattleUIContainer.cs:130, BattleManagerBase.cs:1499+), @@ -157,18 +162,17 @@ internal sealed class SessionBattleEngine // (BattleManagerBase.cs:1110), routing LotteryRandomDrawCard through seeded StableRandom // instead of top-of-deck. Without it the shadow draws DeckCardList[0] every time while // clients draw seeded-random — desynchronizing the hand and every downstream field. - BattleManagerBase.IsRandomDraw = true; + mgr.InstanceIsRandomDraw = true; // Phase-5 chunk 43: was BattleManagerBase.IsRandomDraw static InitLeaderLife(mgr); // a 0-life leader reads as game-over and silently blocks plays InitCardTemplates(mgr); // play/draw resolution touches the (no-op) card view layer InitHeadlessViews(mgr); // turn/play cycle dereferences UI-container + emotion refs - SeedBattleLogManager(); // per-frame filter cleanup reads BattleLogManager fusion lists - InstallHeadlessNetworkAgent(); // turn-flow resolve reads ToolboxGame.RealTimeNetworkAgent + InstallHeadlessNetworkAgent(mgr); // turn-flow resolve reads mgr.InstanceNetworkAgent // Per-session leader class: chara_id == class_id for 1..8 in the all-8-class ClassCharacterList, // so writing the seats' class ordinals into the SESSION's GameMgr DataMgr (resolved through the // ambient — see Setup remarks) resolves each leader's correct class. - SetGameMgrCharaIds(seatAClass, seatBClass); + SetGameMgrCharaIds(mgr.GameMgr, seatAClass, seatBClass); SeedDeck(mgr, seatADeck, isPlayer: true); SeedDeck(mgr, seatBDeck, isPlayer: false); @@ -179,7 +183,7 @@ internal sealed class SessionBattleEngine // resolve to null and NRE on the very next field read. Set ambient.Mgr here so the wiring // resolves the per-session mgr cleanly. _mgr = mgr; - _ctx.Mgr = _mgr; + // Phase-5 chunk 47: was _ctx.Mgr = _mgr — ambient publish is dead. WireMulliganPhase(mgr); // wire OperateReceive.OnReceiveDeal -> StartDeal (deal seats the hand) @@ -194,7 +198,6 @@ internal sealed class SessionBattleEngine /// returned as a detected-desync EVENT (ND6), never silently absorbed. public EngineIngestResult Receive(MsgEnvelope env, bool isPlayerSeat) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null || _receiver is null) throw new InvalidOperationException("Receive before Setup."); @@ -364,25 +367,25 @@ internal sealed class SessionBattleEngine // when _mgr is null (Setup failed and the ComputeFrames try/catch swallowed it, ND6), so a // non-engine session never crashes. Production handlers read ONLY that band. - public int LeaderLife(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).Class.Life; } - public int Pp(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).Pp; } - public int HandCount(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).HandCardList.Count; } - public int DeckCount(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).DeckCardList.Count; } - public int Turn(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).Turn; } + public int LeaderLife(bool playerSeat) => Seat(playerSeat).Class.Life; + public int Pp(bool playerSeat) => Seat(playerSeat).Pp; + public int HandCount(bool playerSeat) => Seat(playerSeat).HandCardList.Count; + public int DeckCount(bool playerSeat) => Seat(playerSeat).DeckCardList.Count; + public int Turn(bool playerSeat) => Seat(playerSeat).Turn; /// Followers in play, excluding the leader (the Class card occupies one slot of /// ClassAndInPlayCardList). - public int BoardCount(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Math.Max(0, Seat(playerSeat).ClassAndInPlayCardList.Count - 1); } + public int BoardCount(bool playerSeat) => Math.Max(0, Seat(playerSeat).ClassAndInPlayCardList.Count - 1); /// The engine Index of the hand card at the given hand position. The receive-path /// Play frame addresses a card by its engine Index (playIdx), which equals deck position + 1 for /// a card dealt from the seeded deck. - public int HandCardIndex(bool playerSeat, int handPos) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).HandCardList[handPos].Index; } + public int HandCardIndex(bool playerSeat, int handPos) => Seat(playerSeat).HandCardList[handPos].Index; /// The real CardId (wire identity) of the hand card at . Lets a /// test locate a specific card in a SHUFFLED opening hand by identity (then read its /// to drive a play), without depending on which shuffled position the card landed at. - public int HandCardId(bool playerSeat, int handPos) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).HandCardList[handPos].CardId; } + public int HandCardId(bool playerSeat, int handPos) => Seat(playerSeat).HandCardList[handPos].CardId; /// The real CardId (wire identity) of the in-play follower at /// (0-based, skipping the leader/Class card at ClassAndInPlayCardList[0] — same convention as @@ -391,7 +394,6 @@ internal sealed class SessionBattleEngine /// engine-resolved actual card carries the wire cardId. public int InPlayCardId(bool playerSeat, int boardPos) { - using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).ClassAndInPlayCardList[boardPos + 1].CardId; } @@ -401,7 +403,6 @@ internal sealed class SessionBattleEngine /// a follower resolves onto the board to build the attack (M-HC-4a). public int InPlayCardIndex(bool playerSeat, int boardPos) { - using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).ClassAndInPlayCardList[boardPos + 1].Index; } @@ -410,7 +411,6 @@ internal sealed class SessionBattleEngine /// attack test assert a follower took the attacker's damage (M-HC-4a follower-vs-follower trade). public int InPlayCardLife(bool playerSeat, int boardPos) { - using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).ClassAndInPlayCardList[boardPos + 1].Life; } @@ -418,7 +418,6 @@ internal sealed class SessionBattleEngine /// ). The damage it deals when it attacks. public int InPlayCardAtk(bool playerSeat, int boardPos) { - using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).ClassAndInPlayCardList[boardPos + 1].Atk; } @@ -427,7 +426,6 @@ internal sealed class SessionBattleEngine /// false — the "attacker is spent" assertion (M-HC-4a). public bool InPlayCardAttackable(bool playerSeat, int boardPos) { - using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).ClassAndInPlayCardList[boardPos + 1].Attackable; } @@ -438,7 +436,6 @@ internal sealed class SessionBattleEngine /// (M-HC-4b). public bool IsEvolved(bool playerSeat, int boardPos) { - using var _ambient = BattleAmbient.Enter(_ctx); return (Seat(playerSeat).ClassAndInPlayCardList[boardPos + 1] as UnitBattleCard)?.IsEvolution ?? false; } @@ -446,12 +443,12 @@ internal sealed class SessionBattleEngine /// evolve spends one EP, so the evolve test asserts this decrements by 1. EP is granted at setup by /// the engine's SetupEvolCount (2 for the game-first seat, 3 for the second) and unlocks once /// EvolveWaitTurnCount has counted down (M-HC-4b). - public int EpCount(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).CurrentEpCount; } + public int EpCount(bool playerSeat) => Seat(playerSeat).CurrentEpCount; /// Turns remaining until may evolve /// (); 0 means evolve is unlocked. Lets a test ramp to /// the evolve-enabled turn deterministically (M-HC-4b). - public int EvolveWaitTurnCount(bool playerSeat) { using var _ambient = BattleAmbient.Enter(_ctx); return Seat(playerSeat).EvolveWaitTurnCount; } + public int EvolveWaitTurnCount(bool playerSeat) => Seat(playerSeat).EvolveWaitTurnCount; /// The engine-RESOLVED play-time cost of the card whose engine Index == /// on (M-HC-3a). This is the discounted cost the play actually paid — @@ -471,7 +468,6 @@ internal sealed class SessionBattleEngine /// session never crashes and a vanilla play simply emits its base cost via the caller's fallback. public int PlayedCardCost(bool playerSeat, int idx, int fallback = 0) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return fallback; var card = FindByIndex(Seat(playerSeat), idx); if (card is null) return fallback; @@ -497,7 +493,6 @@ internal sealed class SessionBattleEngine /// card — so a non-engine session never crashes and a vanilla play emits 0 via the caller's fallback. public int PlayedCardSpellboost(bool playerSeat, int idx, int fallback = 0) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return fallback; var card = FindByIndex(Seat(playerSeat), idx); return card?.SpellChargeCount ?? fallback; @@ -521,7 +516,6 @@ internal sealed class SessionBattleEngine /// the caller's fallback, never crashing. public long PlayedCardId(bool playerSeat, int idx, long fallback = 0) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return fallback; var card = FindByIndex(Seat(playerSeat), idx); return card is null ? fallback : card.CardId; @@ -537,7 +531,6 @@ internal sealed class SessionBattleEngine /// : no engine / no card → fallback, so a non-engine session never crashes. public int PlayedCardClan(bool playerSeat, int idx, int fallback = 0) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return fallback; var card = FindByIndex(Seat(playerSeat), idx); return card is null ? fallback : (int)card.Clan; @@ -561,7 +554,6 @@ internal sealed class SessionBattleEngine /// entry), so this path must hand back a legal wire value. public string PlayedCardTribe(bool playerSeat, int idx, string fallback = "0") { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return fallback; var card = FindByIndex(Seat(playerSeat), idx); if (card is null) return fallback; @@ -599,7 +591,6 @@ internal sealed class SessionBattleEngine /// No-op-returns -1 if the engine isn't set up or no hand card has that Index. internal int SeedHandCardSpellboostCost(bool playerSeat, int idx, int charge) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return -1; BattleCardBase? card = null; foreach (var c in Seat(playerSeat).HandCardList) @@ -623,19 +614,18 @@ internal sealed class SessionBattleEngine /// engine SKIPS the reshuffle the real clients performed. internal bool SelfXorShiftActive { - get { using var _ambient = BattleAmbient.Enter(_ctx); return (_mgr?.XorShiftRandom(isSelf: true)?.IsActive) ?? false; } + get => (_mgr?.XorShiftRandom(isSelf: true)?.IsActive) ?? false; } /// TEST/DEBUG: same as for the OPPONENT seat. internal bool OppoXorShiftActive { - get { using var _ambient = BattleAmbient.Enter(_ctx); return (_mgr?.XorShiftRandom(isSelf: false)?.IsActive) ?? false; } + get => (_mgr?.XorShiftRandom(isSelf: false)?.IsActive) ?? false; } /// DIAGNOSTIC: check if OnReceiveDeal is wired and report deck/hand counts. internal string DiagnoseDealState() { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) return "mgr=null"; var or = _mgr.OperateReceive; bool dealWired = or.OnReceiveDeal != null; @@ -653,7 +643,6 @@ internal sealed class SessionBattleEngine /// after feeding the Ready. internal void SeedOppoIdxChange(int oppoSeed) { - using var _ambient = BattleAmbient.Enter(_ctx); _mgr?.CreateXorShift(-1, oppoSeed); } @@ -662,7 +651,6 @@ internal sealed class SessionBattleEngine /// seed + for the opponent seed. internal void DebugSeedIdxChange(int selfSeed, int oppoSeed) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) throw new InvalidOperationException("DebugSeedIdxChange before Setup."); _mgr.CreateXorShift(selfSeed, oppoSeed); } @@ -674,8 +662,9 @@ internal sealed class SessionBattleEngine /// [NonParallelizable]. internal void DebugSetRandomDraw(bool value) { - using var _ambient = BattleAmbient.Enter(_ctx); - BattleManagerBase.IsRandomDraw = value; + // Phase-5 chunk 43: was ambient-scoped BattleManagerBase.IsRandomDraw = value; now + // writes the mgr instance directly. _mgr is the session's authoritative mgr. + if (_mgr is not null) _mgr.InstanceIsRandomDraw = value; } /// TEST/DEBUG (Phase 4 draw-recompute hypothesis): advance the SHARED _stableRandom @@ -685,7 +674,6 @@ internal sealed class SessionBattleEngine /// is offset; this applies the pre-roll at the same point the real client would. internal void DebugSpinPreroll(int n) { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) throw new InvalidOperationException("DebugSpinPreroll before Setup."); for (int i = 0; i < n; i++) _mgr.StableRandomDouble(); } @@ -699,7 +687,6 @@ internal sealed class SessionBattleEngine /// InitBattleHandler.cs:28). internal double DebugStableRandomDouble() { - using var _ambient = BattleAmbient.Enter(_ctx); if (_mgr is null) throw new InvalidOperationException("DebugStableRandomDouble before Setup."); return _mgr.StableRandomDouble(); } @@ -712,7 +699,6 @@ internal sealed class SessionBattleEngine /// add.idx. A stale value of 0 causes tokens to take Index 0, 1, ... and collide. internal int DebugCardTotalNum(bool playerSeat) { - using var _ambient = BattleAmbient.Enter(_ctx); return _mgr is null ? -1 : _mgr.GetBattlePlayer(playerSeat).cardTotalNum; } @@ -723,8 +709,7 @@ internal sealed class SessionBattleEngine { get { - using var _ambient = BattleAmbient.Enter(_ctx); - return _mgr is null ? -1 + return _mgr is null ? -1 : (int)(typeof(BattleManagerBase) .GetField("stableRandomCount", BindingFlags.Instance | BindingFlags.NonPublic)! .GetValue(_mgr) ?? -1); @@ -832,7 +817,7 @@ internal sealed class SessionBattleEngine // MulliganInfoControl. Node seed (allowed); the control is never shown/updated headless. var prefab = new GameObject(); SeedMulliganInfoControl(prefab); - var prefabData = GameMgr.GetIns().GetPrefabMgr().GetPrefabData(); + var prefabData = mgr.GameMgr.GetPrefabMgr().GetPrefabData(); prefabData["Prefab/UI/MulliganInfo"] = prefab; var phase = new NetworkMulliganPhase(mgr, mgr.NetworkSender); @@ -910,44 +895,30 @@ internal sealed class SessionBattleEngine return card; } - // The per-frame skill-filter cleanup (BattleManagerBase.RemoveUnUseCalledFilterDictionary, run on - // EVERY receive) reads BattleLogManager.GetInstance().EnemyFusionCard.Contains(...) when a card with a - // registered CalledCreateFilter is alive — e.g. a follower with a when_play spell_charge/fanfare skill - // (BattleManagerBase.cs:155). The shim BattleLogManager singleton leaves PlayerFusionCard/EnemyFusionCard - // null (no UI ran SetUp), so that .Contains NREs. Seed both to empty lists — a pure no-op view-state - // seed (the fusion log is cosmetic; nothing headless adds to it). Process-global like the other seeds. - private static void SeedBattleLogManager() - { - var log = BattleLogManager.GetInstance(); - log.PlayerFusionCard ??= new List(); - log.EnemyFusionCard ??= new List(); - } - // The turn-flow + emit bookkeeping reads the global ToolboxGame.RealTimeNetworkAgent (e.g. // RealTimeNetworkAgent.GetIsFirstPlayer/GetTurnState, which delegate to GameMgr's - // NetworkUserInfoData.TurnState; AddActionSequence touches _gungnir). Headless there is no socket - // agent, so seed a no-op one — mirroring HeadlessFixture.NewNetworkEmitBattle. _notEmit short- - // circuits the byte-push before any socket I/O; the shadow engine never originates a send anyway. + // NetworkUserInfoData.TurnState). Headless there is no socket agent, so seed a no-op one — + // mirroring HeadlessFixture.NewNetworkEmitBattle. Since the engine RTA is now a stub with + // no-op method bodies (pass-7 engine cleanup), the historical internal seeds (_gungnir field, + // _notEmit short-circuit) are no longer needed — the stub can't NRE inside its own methods. // NOTE: this is a process-global; one engine per process is assumed for the shadow (revisit for // live multi-session — see design O-N status). Idempotent enough for the per-battle setup. - private static void InstallHeadlessNetworkAgent() + private static void InstallHeadlessNetworkAgent(HeadlessNetworkBattleMgr mgr) { var agent = (RealTimeNetworkAgent)FormatterServices.GetUninitializedObject(typeof(RealTimeNetworkAgent)); agent.SetCurrentMatchingStatus(RealTimeNetworkAgent.MatchingStatus.Prepared); - SetField(agent, "_gungnir", FormatterServices.GetUninitializedObject(typeof(Gungnir))); SetProperty(agent, "NetworkLogger", new NetworkNullLogger()); - SetField(agent, "_notEmit", true); - ToolboxGame.SetRealTimeNetworkBattle(agent); + mgr.InstanceNetworkAgent = agent; // Phase-5 chunk 41: was ToolboxGame.SetRealTimeNetworkBattle(agent) } // Write the two seats' class ordinals into the SESSION's GameMgr DataMgr leader chara ids. Mirrors - // the test seam HeadlessFixture.cs:202-204 (SetField(dm, "_playerCharaId"/"_enemyCharaId", ...)). - // chara_id == class_id for 1..8 in EngineGlobalInit's all-8-class ClassCharacterList, so the ordinal - // selects the class. A non-positive ordinal (e.g. CardClass.None == 0) clamps to the default seat - // (1/2). GameMgr is per-session (BattleAmbientContext.GameMgr); writes resolve through the ambient. - private static void SetGameMgrCharaIds(int a, int b) + // the test seam HeadlessFixture.cs (SetField(dm, "_playerCharaId"/"_enemyCharaId", ...)). chara_id + // == class_id for 1..8 in EngineGlobalInit's all-8-class ClassCharacterList, so the ordinal selects + // the class. A non-positive ordinal (e.g. CardClass.None == 0) clamps to the default seat (1/2). + // GameMgr is per-session (mgr.GameMgr, seeded pre-ctor from _gameMgr). + private static void SetGameMgrCharaIds(GameMgr gm, int a, int b) { - var dm = GameMgr.GetIns().GetDataMgr(); + var dm = gm.GetDataMgr(); SetField(dm, "_playerCharaId", a <= 0 ? 1 : a); SetField(dm, "_enemyCharaId", b <= 0 ? 2 : b); } diff --git a/SVSim.BattleNode/Sessions/Participants/RealParticipant.cs b/SVSim.BattleNode/Sessions/Participants/RealParticipant.cs index 36ae2f4c..db9dcfd6 100644 --- a/SVSim.BattleNode/Sessions/Participants/RealParticipant.cs +++ b/SVSim.BattleNode/Sessions/Participants/RealParticipant.cs @@ -204,9 +204,23 @@ public sealed class RealParticipant : IBattleParticipant, IHasHandshakePhase { if (_diagnosticLogging) { - _log.LogWarning( - "[ws-loop-exit] viewer={Vid} reason={Reason} wsState={State} cancelled={Cancelled}", - ViewerId, exitReason, _ws.State, cancellation.IsCancellationRequested); + // Clean-teardown terminators (normal client close, or a null read after + // cancellation was requested) log at Info; anything else stays Warn so + // genuine crashes stay visible even with diagnostics on. + bool cleanExit = exitReason == "read-returned-null" && + (cancellation.IsCancellationRequested || _ws.State is WebSocketState.CloseReceived or WebSocketState.Closed); + if (cleanExit) + { + _log.LogInformation( + "[ws-loop-exit] viewer={Vid} reason={Reason} wsState={State} cancelled={Cancelled}", + ViewerId, exitReason, _ws.State, cancellation.IsCancellationRequested); + } + else + { + _log.LogWarning( + "[ws-loop-exit] viewer={Vid} reason={Reason} wsState={State} cancelled={Cancelled}", + ViewerId, exitReason, _ws.State, cancellation.IsCancellationRequested); + } } } } @@ -495,7 +509,14 @@ public sealed class RealParticipant : IBattleParticipant, IHasHandshakePhase catch (OperationCanceledException) { if (_diagnosticLogging) - _log.LogWarning("[ws-recv-exit] viewer={Vid} reason=OperationCanceled wsState={State}", ViewerId, _ws.State); + { + // A cancellation-requested cancel is a normal session teardown; a spontaneous + // OperationCanceled without cancellation being requested is a real anomaly. + if (ct.IsCancellationRequested) + _log.LogInformation("[ws-recv-exit] viewer={Vid} reason=OperationCanceled wsState={State}", ViewerId, _ws.State); + else + _log.LogWarning("[ws-recv-exit] viewer={Vid} reason=OperationCanceled wsState={State}", ViewerId, _ws.State); + } return null; } catch (WebSocketException wsex) @@ -508,8 +529,15 @@ public sealed class RealParticipant : IBattleParticipant, IHasHandshakePhase if (result.MessageType == WebSocketMessageType.Close) { if (_diagnosticLogging) - _log.LogWarning("[ws-recv-exit] viewer={Vid} reason=ClientCloseFrame wsState={State} closeStatus={Status} desc={Desc}", - ViewerId, _ws.State, result.CloseStatus, result.CloseStatusDescription); + { + // NormalClosure ("Bye!") at battle-end is expected; abnormal close statuses stay Warn. + if (result.CloseStatus == WebSocketCloseStatus.NormalClosure) + _log.LogInformation("[ws-recv-exit] viewer={Vid} reason=ClientCloseFrame wsState={State} closeStatus={Status} desc={Desc}", + ViewerId, _ws.State, result.CloseStatus, result.CloseStatusDescription); + else + _log.LogWarning("[ws-recv-exit] viewer={Vid} reason=ClientCloseFrame wsState={State} closeStatus={Status} desc={Desc}", + ViewerId, _ws.State, result.CloseStatus, result.CloseStatusDescription); + } return null; } ms.Write(buffer, 0, result.Count); diff --git a/SVSim.Bootstrap/Data/test-fixtures/seeds/pack-stubs.json b/SVSim.Bootstrap/Data/test-fixtures/seeds/pack-stubs.json index 89ee244b..37e0eaa8 100644 --- a/SVSim.Bootstrap/Data/test-fixtures/seeds/pack-stubs.json +++ b/SVSim.Bootstrap/Data/test-fixtures/seeds/pack-stubs.json @@ -37,7 +37,7 @@ "special_sleeve_id": 0, "override_draw_effect_pack_id": 0, "override_ui_effect_pack_id": 0, - "gacha_detail": "7th Anniv stub", + "gacha_detail": "7th", "is_hide": false, "is_new": false, "is_pre_release": false, diff --git a/SVSim.Database/Models/Config/SkipTutorialConfig.cs b/SVSim.Database/Models/Config/SkipTutorialConfig.cs new file mode 100644 index 00000000..6bc792b5 --- /dev/null +++ b/SVSim.Database/Models/Config/SkipTutorialConfig.cs @@ -0,0 +1,21 @@ +namespace SVSim.Database.Models.Config; + +/// +/// When , fresh-signup viewers (via /tool/signup -> +/// ) +/// are initialised at MissionData.TutorialState = 100 — the post-tutorial baseline — +/// instead of the prod default of 1 (TUTORIAL_STEP0). Intended for local dev / two- +/// client PVP smoke where walking through the tutorial after every wiped identity is dead +/// time. Off by default so prod-replicated captures still exercise the real tutorial flow. +/// +/// This only affects the anonymous signup path. +/// (admin import + Steam-social) already lands at state 100 unconditionally. +/// +/// +[ConfigSection("SkipTutorial")] +public class SkipTutorialConfig +{ + public bool Enabled { get; set; } = false; + + public static SkipTutorialConfig ShippedDefaults() => new(); +} diff --git a/SVSim.Database/Repositories/Pack/PackRepository.cs b/SVSim.Database/Repositories/Pack/PackRepository.cs index 702b6048..39a7e1dc 100644 --- a/SVSim.Database/Repositories/Pack/PackRepository.cs +++ b/SVSim.Database/Repositories/Pack/PackRepository.cs @@ -10,6 +10,7 @@ public class PackRepository : IPackRepository public async Task> GetActivePacks(DateTime now) => await _db.Packs + .AsSplitQuery() .Include(p => p.ChildGachas) .Include(p => p.Banners) .Where(p => p.IsEnabled && p.CommenceDate <= now && p.CompleteDate >= now) @@ -23,6 +24,7 @@ public class PackRepository : IPackRepository public async Task GetPack(int parentGachaId) => await _db.Packs + .AsSplitQuery() .Include(p => p.ChildGachas) .Include(p => p.Banners) .FirstOrDefaultAsync(p => p.Id == parentGachaId); diff --git a/SVSim.Database/Repositories/Story/StoryMasterRepository.cs b/SVSim.Database/Repositories/Story/StoryMasterRepository.cs index a246abed..4ec5c63b 100644 --- a/SVSim.Database/Repositories/Story/StoryMasterRepository.cs +++ b/SVSim.Database/Repositories/Story/StoryMasterRepository.cs @@ -28,6 +28,7 @@ public class StoryMasterRepository : IStoryMasterRepository public Task> GetChaptersBySectionCharaAsync(int sectionId, int charaId) => _db.StoryChapters + .AsSplitQuery() .Include(c => c.BattleSettings).Include(c => c.Rewards).Include(c => c.SubChapters) .Where(c => c.SectionId == sectionId && c.CharaId == charaId) .ToListAsync(); @@ -46,6 +47,7 @@ public class StoryMasterRepository : IStoryMasterRepository public Task GetChapterByIdAsync(int storyId) => _db.StoryChapters + .AsSplitQuery() .Include(c => c.BattleSettings).Include(c => c.Rewards).Include(c => c.SubChapters) .FirstOrDefaultAsync(c => c.StoryId == storyId); diff --git a/SVSim.Database/Repositories/Viewer/ViewerRepository.cs b/SVSim.Database/Repositories/Viewer/ViewerRepository.cs index a0656cd2..9b7b4e24 100644 --- a/SVSim.Database/Repositories/Viewer/ViewerRepository.cs +++ b/SVSim.Database/Repositories/Viewer/ViewerRepository.cs @@ -108,7 +108,12 @@ public class ViewerRepository : IViewerRepository // method used to pass) trips that check and silently bypasses the name-entry sub-step. // Empty string flows through /load/index → user_info.name → PlayerStaticData.UserName, // and the title screen surfaces the input dialog. - var viewer = await BuildDefaultViewer(""); + // + // SkipTutorialConfig.Enabled: dev-mode fast path. When true, fresh signups land at + // state 100 (post-tutorial baseline) instead of TUTORIAL_STEP0 — cuts the walk-through- + // tutorial time after every wiped identity in the two-client PVP smoke. Off by default. + int initialTutorialState = _config.Get().Enabled ? 100 : 1; + var viewer = await BuildDefaultViewer("", initialTutorialState: initialTutorialState); viewer.Udid = udid; _dbContext.Set().Add(viewer); diff --git a/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs b/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs index d93f4f87..79ad7f28 100644 --- a/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs +++ b/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs @@ -54,6 +54,7 @@ public class LeaderSkinController : SVSimController } var viewer = await _db.Viewers + .AsSplitQuery() .Include(v => v.Classes).ThenInclude(c => c.Class) .Include(v => v.Classes).ThenInclude(c => c.LeaderSkin) .Include(v => v.LeaderSkins) @@ -115,6 +116,7 @@ public class LeaderSkinController : SVSimController .ToListAsync()).ToHashSet(); var series = await _db.LeaderSkinShopSeries + .AsSplitQuery() .Where(s => s.IsEnabled) .Include(s => s.SetCompletionRewards) .Include(s => s.Products.Where(p => p.IsEnabled)).ThenInclude(p => p.Rewards) @@ -274,6 +276,7 @@ public class LeaderSkinController : SVSimController if (!TryGetViewerId(out long viewerId)) return Unauthorized(); var series = await _db.LeaderSkinShopSeries + .AsSplitQuery() .Include(s => s.SetCompletionRewards) .Include(s => s.Products.Where(p => p.IsEnabled)) .FirstOrDefaultAsync(s => s.Id == request.SeriesId); diff --git a/SVSim.EmulatedEntrypoint/Controllers/RankBattleController.cs b/SVSim.EmulatedEntrypoint/Controllers/RankBattleController.cs index 135ca955..3f9d2c07 100644 --- a/SVSim.EmulatedEntrypoint/Controllers/RankBattleController.cs +++ b/SVSim.EmulatedEntrypoint/Controllers/RankBattleController.cs @@ -166,6 +166,39 @@ public sealed class RankBattleController : ControllerBase var r = await _resolver.ResolveAsync(mode, new BattlePlayer(vid, ctx), ct); + // Human-PvP path: stash battle context so the /finish handler can compose a + // ViewerBattleHistory row. Mirrors the ArenaTwoPick and AI-start hooks. Without + // this, /unlimited_rank_battle/finish and /rotation_rank_battle/finish always find + // a null context and BattleHistoryWriter no-ops (see live server_log 2026-07-02). + // Opponent identity is not yet plumbed through the resolver result (same gap as + // ArenaTwoPick — see its comment); zero placeholders until MatchContext carries the + // second player forward. + if (r.BattleId is not null && long.TryParse(r.BattleId, out var battleIdLong)) + { + _battleContextStore.Set(vid, new BattleContext( + BattleId: battleIdLong, + // Wire battle_type: 2 = rank battle (per docs/api-spec/common/types.ts.md + // #battle-types), same value the AI variant uses (mode is disambiguated + // by URL, not by battle_type). + BattleType: 2, + DeckFormat: format.ToApi(), + TwoPickType: 0, + SelfClassId: (int)ctx.ClassId, + SelfSubClassId: 0, + SelfCharaId: int.TryParse(ctx.CharaId, out var ch) ? ch : 0, + SelfRotationId: "0", + OpponentViewerId: 0, + OpponentName: "", + OpponentClassId: 0, + OpponentSubClassId: 0, + OpponentCharaId: 0, + OpponentCountryCode: "", + OpponentEmblemId: 0, + OpponentDegreeId: 0, + OpponentRotationId: "0", + BattleStartTime: DateTime.UtcNow)); + } + return Ok(new DoMatchingResponseDto { MatchingState = r.MatchingState, diff --git a/SVSim.EmulatedEntrypoint/Controllers/SleeveController.cs b/SVSim.EmulatedEntrypoint/Controllers/SleeveController.cs index 62e54dcf..4e6eec43 100644 --- a/SVSim.EmulatedEntrypoint/Controllers/SleeveController.cs +++ b/SVSim.EmulatedEntrypoint/Controllers/SleeveController.cs @@ -49,6 +49,7 @@ public class SleeveController : SVSimController var ownedSleeveIds = cosmeticsForInfo.SleeveIds.Select(id => (long)id).ToHashSet(); var series = await _db.SleeveShopSeries + .AsSplitQuery() .Where(s => s.IsEnabled) .Include(s => s.Products.Where(p => p.IsEnabled)).ThenInclude(p => p.Rewards) .OrderBy(s => s.Id) diff --git a/SVSim.EmulatedEntrypoint/Middlewares/SessionidMappingMiddleware.cs b/SVSim.EmulatedEntrypoint/Middlewares/SessionidMappingMiddleware.cs index 3bca691b..c8c81979 100644 --- a/SVSim.EmulatedEntrypoint/Middlewares/SessionidMappingMiddleware.cs +++ b/SVSim.EmulatedEntrypoint/Middlewares/SessionidMappingMiddleware.cs @@ -48,15 +48,26 @@ public class SessionidMappingMiddleware : IMiddleware context.Request.Path, sidValue, encodedUdid?.Length ?? 0); } } - else if (hasUdid ^ hasSid) + else if (hasSid && !hasUdid) { - // Only one of the two headers present — usually a client bug or a test that forgot - // to set both. The translation middleware will then fall back to Guid.Empty and - // surface as a generic msgpack/decrypt error, so warn here where the cause is clear. + // Normal post-signup pattern: once /tool/signup completes, the client switches + // to SID-only headers (see CheckController.Signup comment). The translation + // middleware resolves UDID via the SID→UDID cache we stored on the signup + // request, so decryption succeeds. Debug-level so the ~50 post-signup requests + // per session don't drown out real warnings. + _logger.LogDebug( + "SID-only headers for {Path} (post-signup pattern) — SID={Sid}", + context.Request.Path, sid.FirstOrDefault()); + } + else if (hasUdid && !hasSid) + { + // UDID without SID is anomalous — no SID means the translation middleware has + // no cache key to look up and will fall back to Guid.Empty, surfacing as a + // generic msgpack/decrypt error. _logger.LogWarning( - "Only one of UDID/SID headers present for {Path} (hasUdid={HasUdid}, hasSid={HasSid}). " + - "Translation will use Guid.Empty as the encryption key.", - context.Request.Path, hasUdid, hasSid); + "UDID header present without SID for {Path}. Translation will fall back to " + + "Guid.Empty as the encryption key.", + context.Request.Path); } await next.Invoke(context); diff --git a/SVSim.EmulatedEntrypoint/SVSim.EmulatedEntrypoint.csproj b/SVSim.EmulatedEntrypoint/SVSim.EmulatedEntrypoint.csproj index fae6c53a..3ba3dd94 100644 --- a/SVSim.EmulatedEntrypoint/SVSim.EmulatedEntrypoint.csproj +++ b/SVSim.EmulatedEntrypoint/SVSim.EmulatedEntrypoint.csproj @@ -5,6 +5,9 @@ enable enable true + + $(NoWarn);NU1903 diff --git a/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs b/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs index 60285309..6d17883a 100644 --- a/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs +++ b/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs @@ -371,6 +371,24 @@ internal class SVSimTestFactory : WebApplicationFactory await db.SaveChangesAsync(); } + /// + /// Enables SkipTutorial mode by writing the GameConfigs DB row. Fresh signups via + /// + /// will land at MissionData.TutorialState = 100 (post-tutorial) instead of 1. Idempotent. + /// + public async Task EnableSkipTutorialAsync() + { + using var scope = Services.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var json = System.Text.Json.JsonSerializer.Serialize(new { Enabled = true }); + var existing = await db.GameConfigs.FirstOrDefaultAsync(s => s.SectionName == "SkipTutorial"); + if (existing is null) + db.GameConfigs.Add(new GameConfigSection { SectionName = "SkipTutorial", ValueJson = json }); + else + existing.ValueJson = json; + await db.SaveChangesAsync(); + } + /// Convenience: bake the X-Test-Viewer-Id header into a fresh client. public HttpClient CreateAuthenticatedClient(long viewerId) { diff --git a/SVSim.UnitTests/Models/GameConfigurationJsonbTests.cs b/SVSim.UnitTests/Models/GameConfigurationJsonbTests.cs index a855899d..4b71bd2e 100644 --- a/SVSim.UnitTests/Models/GameConfigurationJsonbTests.cs +++ b/SVSim.UnitTests/Models/GameConfigurationJsonbTests.cs @@ -25,15 +25,16 @@ public class GameConfigurationJsonbTests var rows = await db.GameConfigs.AsNoTracking().ToListAsync(); var byName = rows.ToDictionary(r => r.SectionName); - // One row per [ConfigSection]-marked POCO (17 sections today: Player, DefaultGrants, + // One row per [ConfigSection]-marked POCO (18 sections today: Player, DefaultGrants, // DefaultLoadout, Challenge, Rotation, PackRates, MyRotationSchedule, Story, ResourceConfig, // Freeplay, ArenaTwoPick, Matching, CardMasterConfig, ColosseumSeason, ColosseumRounds, - // LoginBonus, Guild). + // LoginBonus, Guild, SkipTutorial). Assert.That(byName.Keys, Is.EquivalentTo(new[] { "Player", "DefaultGrants", "DefaultLoadout", "Challenge", "Rotation", "PackRates", "MyRotationSchedule", "Story", "ResourceConfig", "Freeplay", "ArenaTwoPick", "Matching", "CardMasterConfig", "ColosseumSeason", "ColosseumRounds", "LoginBonus", "Guild", + "SkipTutorial", })); var resources = JsonSerializer.Deserialize(byName["ResourceConfig"].ValueJson)!; diff --git a/SVSim.UnitTests/Repositories/ViewerRepositoryTests.cs b/SVSim.UnitTests/Repositories/ViewerRepositoryTests.cs index 35b8c04a..fd82119c 100644 --- a/SVSim.UnitTests/Repositories/ViewerRepositoryTests.cs +++ b/SVSim.UnitTests/Repositories/ViewerRepositoryTests.cs @@ -141,6 +141,38 @@ public class ViewerRepositoryTests await repo.RegisterAnonymousViewer(Guid.Empty)); } + [Test] + public async Task RegisterAnonymousViewer_default_starts_at_tutorial_step_1() + { + using var factory = new SVSimTestFactory(); + var udid = Guid.NewGuid(); + + using var scope = factory.Services.CreateScope(); + var repo = scope.ServiceProvider.GetRequiredService(); + var viewer = await repo.RegisterAnonymousViewer(udid); + + Assert.That(viewer.MissionData.TutorialState, Is.EqualTo(1), + "Fresh signups default to TUTORIAL_STEP0 (=1) so the client walks through the " + + "real tutorial. SkipTutorialConfig can toggle this to 100 (post-tutorial) for " + + "dev / two-client-smoke fast paths."); + } + + [Test] + public async Task RegisterAnonymousViewer_with_SkipTutorial_enabled_starts_at_state_100() + { + using var factory = new SVSimTestFactory(); + await factory.EnableSkipTutorialAsync(); + var udid = Guid.NewGuid(); + + using var scope = factory.Services.CreateScope(); + var repo = scope.ServiceProvider.GetRequiredService(); + var viewer = await repo.RegisterAnonymousViewer(udid); + + Assert.That(viewer.MissionData.TutorialState, Is.EqualTo(100), + "When SkipTutorialConfig.Enabled is true, fresh signups land at the post-tutorial " + + "baseline (=100) — cuts tutorial-walk-through time in the two-client PVP smoke."); + } + [Test] public async Task RegisterViewer_starts_at_post_tutorial_state() { diff --git a/SVSim.UnitTests/SVSim.UnitTests.csproj b/SVSim.UnitTests/SVSim.UnitTests.csproj index 4ac8a48a..c1531d39 100644 --- a/SVSim.UnitTests/SVSim.UnitTests.csproj +++ b/SVSim.UnitTests/SVSim.UnitTests.csproj @@ -46,9 +46,12 @@ + where the production seed is too large to drive focused integration tests. + MUST be Always (not PreserveNewest): PreserveNewest skips the fixture when the + production seed already in the output dir has a newer mtime (e.g. after a branch + switch). Always guarantees the fixture copy runs after the production copy and wins. --> - PreserveNewest + Always diff --git a/tools/engine-port/ClosureAnalyzer/ClosureAnalyzer.csproj b/tools/engine-port/ClosureAnalyzer/ClosureAnalyzer.csproj new file mode 100644 index 00000000..eda09d89 --- /dev/null +++ b/tools/engine-port/ClosureAnalyzer/ClosureAnalyzer.csproj @@ -0,0 +1,22 @@ + + + + Exe + net8.0 + enable + enable + ClosureAnalyzer + + + + + + + + + + + diff --git a/tools/engine-port/ClosureAnalyzer/Program.cs b/tools/engine-port/ClosureAnalyzer/Program.cs new file mode 100644 index 00000000..e1ff7580 --- /dev/null +++ b/tools/engine-port/ClosureAnalyzer/Program.cs @@ -0,0 +1,1171 @@ +using Microsoft.Build.Locator; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.MSBuild; + +namespace ClosureAnalyzer; + +public static class Program +{ + // Roots — see POSTMORTEM-2026-06-28-pass3-attempt.md §"What the right tool looks like". + // Fully-qualified metadata names so GetTypeByMetadataName can find them directly. + private static readonly string[] HardRoots = + { + "SVSim.BattleNode.Sessions.Engine.SessionBattleEngine", + "SVSim.BattleEngine.Rng.HeadlessBattleMgr", + "SVSim.BattleEngine.Rng.HeadlessNetworkBattleMgr", + "Wizard.Battle.Mulligan.MulliganMgrBase", + "SVSim.BattleEngine.Ambient.BattleAmbientContext", + }; + + private static readonly HashSet NUnitAttributeNames = new(StringComparer.Ordinal) + { + "TestAttribute", "TestCaseAttribute", "TestCaseSourceAttribute", + "TestFixtureAttribute", "TestFixtureSourceAttribute", "TheoryAttribute", + "OneTimeSetUpAttribute", "OneTimeTearDownAttribute", "SetUpAttribute", + "TearDownAttribute", "SetUpFixtureAttribute", + }; + + private static readonly HashSet TrackedAssemblies = new(StringComparer.Ordinal) + { + "SVSim.BattleEngine", "SVSim.BattleNode", "SVSim.BattleEngine.Tests", + }; + + // Only types from THIS assembly are deletion candidates. Everything else is either + // a downstream consumer (BattleNode/Tests) or external (System/NuGet). + private const string CandidateAssembly = "SVSim.BattleEngine"; + + public static async Task Main(string[] args) + { + MSBuildLocator.RegisterDefaults(); + + bool trimMode = args.Contains("--trim"); + var positional = args.Where(a => !a.StartsWith("--")).ToArray(); + + var repoRoot = FindRepoRoot(); + var slnPath = Path.Combine(repoRoot, "DCGEngine.sln"); + var outputPath = positional.Length > 0 + ? positional[0] + : Path.Combine(repoRoot, "..", "..", "data_dumps", "reports", "engine-cleanup", "provably-unreachable.tsv"); + outputPath = Path.GetFullPath(outputPath); + + if (trimMode) + Console.Error.WriteLine("[analyzer] TRIM MODE: will rewrite Shim/Generated/*.g.cs after analysis"); + + Console.Error.WriteLine($"[analyzer] solution: {slnPath}"); + Console.Error.WriteLine($"[analyzer] output: {outputPath}"); + + using var workspace = MSBuildWorkspace.Create(); + workspace.WorkspaceFailed += (_, e) => + { + if (e.Diagnostic.Kind == WorkspaceDiagnosticKind.Failure) + Console.Error.WriteLine($"[workspace] FAIL: {e.Diagnostic.Message}"); + }; + + var solution = await workspace.OpenSolutionAsync(slnPath); + var engineProject = solution.Projects.First(p => p.Name == "SVSim.BattleEngine"); + var nodeProject = solution.Projects.First(p => p.Name == "SVSim.BattleNode"); + var testsProject = solution.Projects.First(p => p.Name == "SVSim.BattleEngine.Tests"); + + Console.Error.WriteLine("[analyzer] compiling SVSim.BattleEngine..."); + var engineComp = await engineProject.GetCompilationAsync() + ?? throw new InvalidOperationException("engine compilation null"); + Console.Error.WriteLine("[analyzer] compiling SVSim.BattleNode..."); + var nodeComp = await nodeProject.GetCompilationAsync() + ?? throw new InvalidOperationException("node compilation null"); + Console.Error.WriteLine("[analyzer] compiling SVSim.BattleEngine.Tests..."); + var testsComp = await testsProject.GetCompilationAsync() + ?? throw new InvalidOperationException("tests compilation null"); + + // MSBuildWorkspace sometimes loads BattleNode without the extern-alias project + // reference to BattleEngine (an upstream NuGet audit warning during restore can + // cause it to bail out before honoring ProjectReference Aliases — guarded against + // by NU1903 suppression in those csprojs, but defensive in case other warnings + // crop up). Detect a missing cross-project lookup and patch the compilation by + // hand so semantic queries through `engine::` resolve correctly. + if (nodeComp.GetTypeByMetadataName("NetworkUserInfoData") is null) + { + var engineRef = engineComp.ToMetadataReference( + aliases: System.Collections.Immutable.ImmutableArray.Create("engine")); + nodeComp = nodeComp.AddReferences(engineRef); + Console.Error.WriteLine("[fixup] nodeComp missing engine reference — re-added with alias=engine"); + } + if (testsComp.GetTypeByMetadataName("NetworkUserInfoData") is null) + { + var engineRef = engineComp.ToMetadataReference( + aliases: System.Collections.Immutable.ImmutableArray.Create("global", "engine")); + testsComp = testsComp.AddReferences(engineRef); + Console.Error.WriteLine("[fixup] testsComp missing engine reference — re-added with aliases=global,engine"); + } + + var compsByTree = new Dictionary(); + foreach (var t in engineComp.SyntaxTrees) compsByTree[t] = engineComp; + foreach (var t in nodeComp.SyntaxTrees) compsByTree[t] = nodeComp; + foreach (var t in testsComp.SyntaxTrees) compsByTree[t] = testsComp; + + // Collect roots. + var roots = new List(); + foreach (var name in HardRoots) + { + var sym = + engineComp.GetTypeByMetadataName(name) ?? + nodeComp.GetTypeByMetadataName(name) ?? + testsComp.GetTypeByMetadataName(name); + if (sym is null) + throw new InvalidOperationException($"root not found in any tracked compilation: {name}"); + roots.Add(sym); + Console.Error.WriteLine($"[root] {name}"); + } + + int testRoots = 0; + foreach (var t in EnumerateTypes(testsComp.GlobalNamespace)) + { + if (HasNUnitAttribute(t)) + { + roots.Add(t); + testRoots++; + } + } + Console.Error.WriteLine($"[root] NUnit-rooted test types: {testRoots}"); + + // Every type defined in SVSim.BattleNode is a root. BattleNode is the consumer of + // BattleEngine; its types are called from the ASP.NET host / DI container / hub + // entrypoints that this static walk can't see. Walking them all is cheap (BattleNode + // is ~110 types) and ensures every BattleEngine API call site is detected. + int nodeRoots = 0; + foreach (var t in EnumerateTypes(nodeComp.GlobalNamespace)) + { + if (t.ContainingAssembly?.Name == "SVSim.BattleNode") + { + roots.Add(t); + nodeRoots++; + } + } + Console.Error.WriteLine($"[root] BattleNode types: {nodeRoots}"); + + // BFS the closure. `seen` is keyed by fully-qualified type name (string) for the + // same reason reachedMembers is — cross-compilation lookups via the engine alias + // produce INamedTypeSymbols whose SymbolEqualityComparer-identity doesn't match + // engineComp's direct view (so NullDetailPanelControl, reached through + // SessionBattleEngine's `using NullDetailPanelControl = engine::NullDetailPanelControl`, + // wasn't recognized as reachable in engineComp's later enumeration pass). + var queue = new Queue(); + var seen = new HashSet(StringComparer.Ordinal); + var seenTypeSymbols = new List(); // for later iteration (override/iface propagation) + string TypeKey(INamedTypeSymbol t) => + t.OriginalDefinition.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + // Method-level: every IMethodSymbol / IPropertySymbol / IFieldSymbol / IEventSymbol + // referenced by reached code. Tracked by SignatureKey rather than ISymbol identity + // because cross-compilation symbol resolution (BattleNode resolving a BattleEngine + // method via an extern-alias project reference) produces an IMethodSymbol whose + // SymbolEqualityComparer-identity does NOT match engineComp's direct view of the + // same method, even though they refer to the same assembly. Display-string keys + // dodge that entirely. + var reachedMembers = new HashSet(StringComparer.Ordinal); + // String literals seen in reachable code — used as a defensive fallback for + // reflection-driven dispatch (typeof(T).GetMethod("X"), Activator.CreateInstance, + // SendMessage by name, etc.). Any member of any reachable type whose Name appears + // here is kept alive even if the static walk says dead. + var literalStrings = new HashSet(StringComparer.Ordinal); + foreach (var r in roots) Enqueue(r, queue); + + long popped = 0; + while (queue.Count > 0) + { + var t = queue.Dequeue(); + var orig = (INamedTypeSymbol)t.OriginalDefinition; + if (!seen.Add(TypeKey(orig))) continue; + seenTypeSymbols.Add(orig); + + popped++; + if (popped % 200 == 0) + Console.Error.WriteLine($"[bfs] popped={popped} queue={queue.Count} seen={seen.Count}"); + + var asmName = orig.ContainingAssembly?.Name; + if (asmName is null || !TrackedAssemblies.Contains(asmName)) + continue; + + // Base + interfaces + containing. + if (orig.BaseType is not null) Enqueue(orig.BaseType, queue); + foreach (var iface in orig.Interfaces) Enqueue(iface, queue); + if (orig.ContainingType is not null) Enqueue(orig.ContainingType, queue); + + // Type's own attributes. + foreach (var attr in orig.GetAttributes()) + if (attr.AttributeClass is not null) + Enqueue(attr.AttributeClass, queue); + + // Generic constraints on the type itself. + foreach (var tp in orig.TypeParameters) + foreach (var con in tp.ConstraintTypes) + EnqueueAny(con, queue); + + // Members. + foreach (var member in orig.GetMembers()) + { + foreach (var attr in member.GetAttributes()) + if (attr.AttributeClass is not null) + Enqueue(attr.AttributeClass, queue); + + switch (member) + { + case IFieldSymbol f: + EnqueueAny(f.Type, queue); + break; + case IPropertySymbol p: + EnqueueAny(p.Type, queue); + foreach (var par in p.Parameters) + { + EnqueueAny(par.Type, queue); + foreach (var pa in par.GetAttributes()) + if (pa.AttributeClass is not null) Enqueue(pa.AttributeClass, queue); + } + break; + case IEventSymbol e: + EnqueueAny(e.Type, queue); + break; + case IMethodSymbol m: + EnqueueAny(m.ReturnType, queue); + foreach (var par in m.Parameters) + { + EnqueueAny(par.Type, queue); + foreach (var pa in par.GetAttributes()) + if (pa.AttributeClass is not null) Enqueue(pa.AttributeClass, queue); + } + foreach (var tp in m.TypeParameters) + foreach (var con in tp.ConstraintTypes) + EnqueueAny(con, queue); + foreach (var iimpl in m.ExplicitInterfaceImplementations) + Enqueue(iimpl.ContainingType, queue); + break; + case INamedTypeSymbol nested: + Enqueue(nested, queue); + break; + } + } + + // Walk syntax of every declaration to catch method-body / initializer / typeof refs. + foreach (var sref in orig.DeclaringSyntaxReferences) + { + var node = sref.GetSyntax(); + var tree = node.SyntaxTree; + if (!compsByTree.TryGetValue(tree, out var comp)) continue; + var model = comp.GetSemanticModel(tree); + + // File-scope using directives (`using Foo = engine::Foo;`) live on the + // CompilationUnit, not inside the type. Walk them so types referenced only + // via aliased usings get into the closure. Without this, the cascade + // deletes types like NullDetailPanelControl that SessionBattleEngine + // references purely through the alias. + // + // GetTypeInfo on the name-syntax inside a using directive returns void + // because it's not an expression context — go through GetAliasInfo + // (for `using X = T;`) and GetSymbolInfo (for plain `using NS;`) instead. + if (tree.GetRoot() is Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax cu) + { + foreach (var usingDir in cu.Usings) + { + // Alias form: `using X = Y;` — GetDeclaredSymbol on the directive + // resolves to an IAliasSymbol whose Target is the real type. + if (usingDir.Alias is not null) + { + if (model.GetDeclaredSymbol(usingDir) is IAliasSymbol alias) + { + AddSymbol(alias.Target, queue); + RecordMember(alias.Target, reachedMembers); + } + } + // Plain form: `using NS;` or `using static T;` — resolve the + // Name itself. + var nameSymbol = model.GetSymbolInfo(usingDir.Name!).Symbol; + AddSymbol(nameSymbol, queue); + RecordMember(nameSymbol, reachedMembers); + // (No longer: enqueue every type in the namespace.) That rule was + // a workaround for dangling `using` directives after every type + // in a namespace got trimmed. With the engine reduced to its + // converged state, keeping types alive just because a file + // imports their namespace is wrong — the third-party SDK shims + // (Facebook.Unity, Steamworks, ZXing, BestHTTP, etc.) only stay + // because of stale `using` directives in engine files that never + // actually reference any type from them. The new dangling-using + // sweep at the end of trim handles the cleanup automatically. + } + } + + foreach (var descendant in node.DescendantNodes()) + { + var ti = model.GetTypeInfo(descendant); + EnqueueAny(ti.Type, queue); + EnqueueAny(ti.ConvertedType, queue); + + var si = model.GetSymbolInfo(descendant); + AddSymbol(si.Symbol, queue); + RecordMember(si.Symbol, reachedMembers); + foreach (var cand in si.CandidateSymbols) + { + AddSymbol(cand, queue); + RecordMember(cand, reachedMembers); + } + + // String literals for reflection-target fallback. + if (descendant is Microsoft.CodeAnalysis.CSharp.Syntax.LiteralExpressionSyntax lit + && lit.IsKind(Microsoft.CodeAnalysis.CSharp.SyntaxKind.StringLiteralExpression)) + { + var s = lit.Token.ValueText; + if (!string.IsNullOrEmpty(s) && s.Length < 200) + literalStrings.Add(s); + } + } + } + } + + Console.Error.WriteLine($"[bfs] closure size: {seen.Count}"); + Console.Error.WriteLine($"[bfs] string literals seen: {literalStrings.Count}"); + Console.Error.WriteLine($"[bfs] initial reached members: {reachedMembers.Count}"); + + // Propagate virtual / interface dispatch within the reachable type set. + // If a method M is reached and any subclass override M' lives on a reachable + // type, M' is also reached. Same for interface impls. Iterate until fixpoint. + var reachedTypeList = seenTypeSymbols + .Where(t => t.ContainingAssembly is not null && TrackedAssemblies.Contains(t.ContainingAssembly.Name)) + .ToList(); + + // Unconditional protection pass — required for COMPILATION, not just reachability: + // 1. Any override of an abstract method must stay. + // 2. Any implementation of an interface member must stay if the interface is in the + // closure. + // 3. Any non-abstract override is conservatively kept — the override's body might + // differ from the base (and confirming equality across the whole vendored + // decompile is not feasible). Cheap to keep, expensive to get wrong. + // 4. Every member of a reachable INTERFACE stays. Explicit interface impls + // reference these members by their fully-qualified name; deleting an interface + // member while its explicit impl survives produces "is not found among members + // of the interface" (CS0539). + foreach (var t in reachedTypeList) + { + if (t.TypeKind == TypeKind.Interface) + { + foreach (var member in t.GetMembers()) + { + reachedMembers.Add(SignatureKey(member)); + if (member is IPropertySymbol ip) + { + if (ip.GetMethod is not null) reachedMembers.Add(SignatureKey(ip.GetMethod)); + if (ip.SetMethod is not null) reachedMembers.Add(SignatureKey(ip.SetMethod)); + } + if (member is IEventSymbol ie) + { + if (ie.AddMethod is not null) reachedMembers.Add(SignatureKey(ie.AddMethod)); + if (ie.RemoveMethod is not null) reachedMembers.Add(SignatureKey(ie.RemoveMethod)); + } + } + } + } + foreach (var t in reachedTypeList) + { + foreach (var member in t.GetMembers()) + { + // Constructors of reachable types always stay. A derived ctor that's removed + // breaks compilation when the base type lacks a parameterless ctor (CS7036), + // and detecting that gates on chasing the base chain — far cheaper to keep + // every ctor than to compute when it's safe to drop. + // + // Static constructors are invoked by the runtime on first access; static + // analysis sees no caller and would mark them dead, but their bodies often + // populate static fields (`_str2Keyword`, etc.) that other reachable code + // reads — removing them produces NullReferenceException at runtime. + if (member is IMethodSymbol mc && + (mc.MethodKind == MethodKind.Constructor || mc.MethodKind == MethodKind.StaticConstructor)) + { + reachedMembers.Add(SignatureKey(mc)); + } + if (member is IMethodSymbol m && m.IsOverride) + { + reachedMembers.Add(SignatureKey(m)); + } + if (member is IPropertySymbol p && p.IsOverride) + { + reachedMembers.Add(SignatureKey(p)); + if (p.GetMethod is not null) reachedMembers.Add(SignatureKey(p.GetMethod)); + if (p.SetMethod is not null) reachedMembers.Add(SignatureKey(p.SetMethod)); + } + if (member is IEventSymbol e && e.IsOverride) + { + reachedMembers.Add(SignatureKey(e)); + } + // User-defined operators come in mandatory pairs (==/!=, , <=/>=) per + // CS0216. Keeping one without the other is a build error. Cheap to keep + // all of them. + if (member is IMethodSymbol mop && + (mop.MethodKind == MethodKind.UserDefinedOperator || mop.MethodKind == MethodKind.Conversion)) + { + reachedMembers.Add(SignatureKey(mop)); + } + // Explicit interface implementations always stay. Belt-and-suspenders on + // top of the AllInterfaces walk below — FindImplementationForInterfaceMember + // can miss in corner cases (e.g. IList vs ICollection both declaring Clear + // with overlapping resolution paths). + if (member is IMethodSymbol mex && mex.ExplicitInterfaceImplementations.Length > 0) + { + reachedMembers.Add(SignatureKey(mex)); + } + if (member is IPropertySymbol pex && pex.ExplicitInterfaceImplementations.Length > 0) + { + reachedMembers.Add(SignatureKey(pex)); + if (pex.GetMethod is not null) reachedMembers.Add(SignatureKey(pex.GetMethod)); + if (pex.SetMethod is not null) reachedMembers.Add(SignatureKey(pex.SetMethod)); + } + if (member is IEventSymbol eex && eex.ExplicitInterfaceImplementations.Length > 0) + { + reachedMembers.Add(SignatureKey(eex)); + } + } + + foreach (var iface in t.AllInterfaces) + { + // EVERY implemented interface — including external (System.Collections.ICollection, + // IComparer, etc.) — needs its impls kept. The interface contract must be + // satisfied for compilation; CS0535 doesn't care whether the interface is in our + // assemblies or in mscorlib. + foreach (var ifaceM in iface.GetMembers()) + { + var impl = t.FindImplementationForInterfaceMember(ifaceM); + if (impl is null) continue; + reachedMembers.Add(SignatureKey(impl)); + if (impl is IPropertySymbol ip) + { + if (ip.GetMethod is not null) reachedMembers.Add(SignatureKey(ip.GetMethod)); + if (ip.SetMethod is not null) reachedMembers.Add(SignatureKey(ip.SetMethod)); + } + if (impl is IEventSymbol ie) + { + if (ie.AddMethod is not null) reachedMembers.Add(SignatureKey(ie.AddMethod)); + if (ie.RemoveMethod is not null) reachedMembers.Add(SignatureKey(ie.RemoveMethod)); + } + } + } + } + Console.Error.WriteLine($"[propagate] members after unconditional override+impl pass: {reachedMembers.Count}"); + + // Chase override → overridden base. Required for compilation: a kept override + // needs its base method to still exist (CS0115). + bool basesChanged = true; + while (basesChanged) + { + basesChanged = false; + foreach (var t in reachedTypeList) + { + foreach (var member in t.GetMembers()) + { + if (member is IMethodSymbol m && m.IsOverride && reachedMembers.Contains(SignatureKey(m))) + { + var b = m.OverriddenMethod; + while (b is not null) + { + if (!reachedMembers.Add(SignatureKey(b))) break; + basesChanged = true; + b = b.OverriddenMethod; + } + } + if (member is IPropertySymbol p && p.IsOverride && reachedMembers.Contains(SignatureKey(p))) + { + var b = p.OverriddenProperty; + while (b is not null) + { + if (!reachedMembers.Add(SignatureKey(b))) break; + if (b.GetMethod is not null) reachedMembers.Add(SignatureKey(b.GetMethod)); + if (b.SetMethod is not null) reachedMembers.Add(SignatureKey(b.SetMethod)); + basesChanged = true; + b = b.OverriddenProperty; + } + } + } + } + } + Console.Error.WriteLine($"[propagate] members after override-base chase: {reachedMembers.Count}"); + + // Build override map once: derivedMethod -> overriddenMethod (all walked). + // Also build interface-impl map: implMethod -> interface method. + bool changed = true; + int rounds = 0; + while (changed) + { + changed = false; + rounds++; + foreach (var t in reachedTypeList) + { + foreach (var m in t.GetMembers().OfType()) + { + var key = SignatureKey(m); + if (reachedMembers.Contains(key)) continue; + + // Override of a reached base method. + var ov = m.OverriddenMethod; + while (ov is not null) + { + if (reachedMembers.Contains(SignatureKey(ov))) + { + reachedMembers.Add(key); + changed = true; + break; + } + ov = ov.OverriddenMethod; + } + if (reachedMembers.Contains(key)) continue; + + // Interface impl: is m the impl of some reached interface method? + foreach (var iface in t.AllInterfaces) + { + bool hit = false; + foreach (var ifaceM in iface.GetMembers().OfType()) + { + if (!reachedMembers.Contains(SignatureKey(ifaceM))) continue; + var impl = t.FindImplementationForInterfaceMember(ifaceM); + if (impl is IMethodSymbol implM && + SymbolEqualityComparer.Default.Equals(implM.OriginalDefinition, m.OriginalDefinition)) + { + reachedMembers.Add(key); + changed = true; + hit = true; + break; + } + } + if (hit) break; + } + } + + // Property/event/field accessors come with the property. If the property + // is reached, its accessors are reached too. + foreach (var p in t.GetMembers().OfType()) + { + if (!reachedMembers.Contains(SignatureKey(p))) continue; + if (p.GetMethod is not null) reachedMembers.Add(SignatureKey(p.GetMethod)); + if (p.SetMethod is not null) reachedMembers.Add(SignatureKey(p.SetMethod)); + } + foreach (var ev in t.GetMembers().OfType()) + { + if (!reachedMembers.Contains(SignatureKey(ev))) continue; + if (ev.AddMethod is not null) reachedMembers.Add(SignatureKey(ev.AddMethod)); + if (ev.RemoveMethod is not null) reachedMembers.Add(SignatureKey(ev.RemoveMethod)); + } + } + } + Console.Error.WriteLine($"[propagate] members after virtual/iface ({rounds} rounds): {reachedMembers.Count}"); + + // Cross-check against the runtime live-methods baseline. Any method named in the + // baseline must stay alive even if static analysis says dead — Harmony captures + // runtime patches we can't see statically. + var baselinePath = Path.Combine( + Path.GetDirectoryName(outputPath)!, "live-methods.baseline.txt"); + var baseline = new HashSet(StringComparer.Ordinal); + if (File.Exists(baselinePath)) + { + foreach (var line in File.ReadAllLines(baselinePath)) + { + var s = line.Trim(); + if (s.Length > 0) baseline.Add(s); + } + Console.Error.WriteLine($"[baseline] loaded {baseline.Count} live-method names from {baselinePath}"); + } + else + { + Console.Error.WriteLine($"[baseline] WARNING: not found at {baselinePath} — skipping cross-check"); + } + + // Emit dead-members.tsv covering every declared method/property/field/event in + // SVSim.BattleEngine that's in a reachable type but NOT referenced. + var deadMembersPath = Path.Combine(Path.GetDirectoryName(outputPath)!, "dead-members.tsv"); + var deadByFile = new Dictionary>(StringComparer.OrdinalIgnoreCase); + // Symbols of dead members, grouped by file. Used by trim mode. + var deadSymbolsByFile = new Dictionary>(StringComparer.OrdinalIgnoreCase); + int deadCount = 0; + int baselineRescues = 0; + + foreach (var t in EnumerateTypes(engineComp.GlobalNamespace)) + { + if (t.ContainingAssembly?.Name != CandidateAssembly) continue; + if (t.IsImplicitlyDeclared) continue; + if (!seen.Contains(TypeKey(t))) continue; // unreachable type — covered by provably-unreachable.tsv + + var typeFullName = FullName(t); + foreach (var member in t.GetMembers()) + { + if (member.IsImplicitlyDeclared) continue; + if (member is not (IMethodSymbol or IPropertySymbol or IFieldSymbol or IEventSymbol)) continue; + // Skip accessors — propagated via owning property/event above. Reporting them + // separately would double-count. + if (member is IMethodSymbol mm && mm.AssociatedSymbol is (IPropertySymbol or IEventSymbol)) continue; + + if (reachedMembers.Contains(SignatureKey(member))) continue; + + // Baseline rescue. + var baselineKey = $"{typeFullName.Replace("global::", "")}.{member.Name}"; + if (baseline.Contains(baselineKey)) + { + baselineRescues++; + continue; + } + + // Reflection-name rescue: if the member's name appears anywhere as a string + // literal in reachable code, conservatively assume it could be a reflection + // target (GetMethod, GetField, SendMessage, Activator). Cheap defensive cover + // for paths the static walk can't see. + if (literalStrings.Contains(member.Name)) + { + baselineRescues++; + continue; + } + + foreach (var sref in member.DeclaringSyntaxReferences) + { + var path = sref.SyntaxTree.FilePath; + if (string.IsNullOrEmpty(path)) continue; + if (!deadByFile.TryGetValue(path, out var list)) + { + list = new(); + deadByFile[path] = list; + } + if (!deadSymbolsByFile.TryGetValue(path, out var symList)) + { + symList = new(); + deadSymbolsByFile[path] = symList; + } + symList.Add(member); + list.Add(new DeadMember( + Kind: member switch + { + IMethodSymbol mx when mx.MethodKind == MethodKind.Constructor => "ctor", + IMethodSymbol => "method", + IPropertySymbol => "property", + IFieldSymbol => "field", + IEventSymbol => "event", + _ => "?" + }, + TypeFullName: typeFullName, + MemberName: member.Name, + Signature: member.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat))); + deadCount++; + } + } + } + + Console.Error.WriteLine($"[summary] dead members: {deadCount} (baseline rescues: {baselineRescues})"); + + await using (var w = new StreamWriter(deadMembersPath)) + { + await w.WriteLineAsync("file_path\tkind\ttype\tmember_name\tsignature"); + foreach (var (path, members) in deadByFile.OrderBy(kv => kv.Key, StringComparer.OrdinalIgnoreCase)) + { + var rel = Path.GetRelativePath(repoRoot, path).Replace('\\', '/'); + foreach (var m in members) + await w.WriteLineAsync($"{rel}\t{m.Kind}\t{m.TypeFullName}\t{m.MemberName}\t{m.Signature}"); + } + } + Console.Error.WriteLine($"[output] wrote: {deadMembersPath}"); + + // Subset for actionable scope: Shim/Generated/*.g.cs files. + var generatedDeadPath = Path.Combine(Path.GetDirectoryName(outputPath)!, "dead-members-generated.tsv"); + int genDeadCount = 0; + int genFiles = 0; + await using (var w = new StreamWriter(generatedDeadPath)) + { + await w.WriteLineAsync("file_path\tkind\ttype\tmember_name\tsignature"); + foreach (var (path, members) in deadByFile.OrderBy(kv => kv.Key, StringComparer.OrdinalIgnoreCase)) + { + if (!path.Replace('\\', '/').Contains("/Shim/Generated/")) continue; + genFiles++; + var rel = Path.GetRelativePath(repoRoot, path).Replace('\\', '/'); + foreach (var m in members) + { + await w.WriteLineAsync($"{rel}\t{m.Kind}\t{m.TypeFullName}\t{m.MemberName}\t{m.Signature}"); + genDeadCount++; + } + } + } + Console.Error.WriteLine($"[output] wrote: {generatedDeadPath} ({genDeadCount} dead in {genFiles} generated files)"); + + // Trim mode moved below so it has access to both deadSymbolsByFile (member-level) + // and the deletableFiles list (type-level) — fully-unreachable files must be + // deleted before partial trims so their stale override declarations don't break + // the build when a reachable base method gets stripped. + + // Enumerate every type in SVSim.BattleEngine. Group by file path. + // A file is fully deletable iff every type declared in it is unreachable. + var byFile = new Dictionary(StringComparer.OrdinalIgnoreCase); + // typeFullName -> set of files declaring it (across partials). + var typeFiles = new Dictionary>(StringComparer.Ordinal); + // file path -> list of (TypeSymbol, reachable) for partial-mixed type-level trim. + var typeSymbolsByFile = new Dictionary>(StringComparer.OrdinalIgnoreCase); + int totalEngineTypes = 0; + int unreachableEngineTypes = 0; + + foreach (var t in EnumerateTypes(engineComp.GlobalNamespace)) + { + if (t.ContainingAssembly?.Name != CandidateAssembly) continue; + // Skip implicitly-declared (compiler-generated, no source). These aren't deletion candidates. + if (t.IsImplicitlyDeclared) continue; + // Skip namespaces (shouldn't appear via GetTypeMembers but defensive). + if (t.TypeKind == TypeKind.Error) continue; + + totalEngineTypes++; + bool reachable = seen.Contains(TypeKey(t)); + if (!reachable) unreachableEngineTypes++; + + var typeFull = FullName(t); + if (!typeFiles.TryGetValue(typeFull, out var typeFilesSet)) + { + typeFilesSet = new(StringComparer.OrdinalIgnoreCase); + typeFiles[typeFull] = typeFilesSet; + } + + foreach (var sref in t.DeclaringSyntaxReferences) + { + var path = sref.SyntaxTree.FilePath; + if (string.IsNullOrEmpty(path)) continue; + if (!byFile.TryGetValue(path, out var rec)) + { + rec = new FileRecord(); + byFile[path] = rec; + } + rec.Types.Add((typeFull, reachable)); + typeFilesSet.Add(path); + + if (!typeSymbolsByFile.TryGetValue(path, out var tsl)) + { + tsl = new(); + typeSymbolsByFile[path] = tsl; + } + tsl.Add((t, reachable)); + } + } + + Console.Error.WriteLine($"[summary] engine types: total={totalEngineTypes} unreachable={unreachableEngineTypes}"); + + var rawDeletableFiles = byFile + .Where(kv => kv.Value.Types.Count > 0 && kv.Value.Types.All(x => !x.reachable)) + .OrderBy(kv => kv.Key, StringComparer.OrdinalIgnoreCase) + .ToList(); + + // Partial-class split-file guard. If a candidate-deletable file declares type T but T + // ALSO has a partial declaration in another file we are NOT deleting, removing this + // file leaves the surviving partial with its base-clause/interface-list pointing at + // members that lived only here — CS0535. Strip such files out of the deletable set + // and treat them as partial-mixed instead. + var rawDeletablePaths = new HashSet(rawDeletableFiles.Select(kv => kv.Key), StringComparer.OrdinalIgnoreCase); + var deletableFiles = new List>(); + var splitRetained = new List(); + foreach (var kv in rawDeletableFiles) + { + bool safe = true; + foreach (var (typeFull, _) in kv.Value.Types) + { + if (!typeFiles.TryGetValue(typeFull, out var allPaths)) continue; + foreach (var p in allPaths) + { + if (StringComparer.OrdinalIgnoreCase.Equals(p, kv.Key)) continue; + if (!rawDeletablePaths.Contains(p)) + { + safe = false; + break; + } + } + if (!safe) break; + } + if (safe) deletableFiles.Add(kv); + else splitRetained.Add(kv.Key); + } + if (splitRetained.Count > 0) + Console.Error.WriteLine($"[guard] partial-split-file retains: {splitRetained.Count} (e.g. {splitRetained[0]})"); + + var partialFiles = byFile + .Where(kv => kv.Value.Types.Any(x => !x.reachable) && kv.Value.Types.Any(x => x.reachable)) + .OrderBy(kv => kv.Key, StringComparer.OrdinalIgnoreCase) + .ToList(); + + Console.Error.WriteLine($"[summary] files fully deletable: {deletableFiles.Count}"); + Console.Error.WriteLine($"[summary] files partial (mixed): {partialFiles.Count}"); + + Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!); + + await using (var w = new StreamWriter(outputPath)) + { + await w.WriteLineAsync("file_path\ttype_count\ttype_names"); + foreach (var (path, rec) in deletableFiles) + { + var rel = Path.GetRelativePath(repoRoot, path).Replace('\\', '/'); + var names = string.Join(",", rec.Types.Select(x => x.full)); + await w.WriteLineAsync($"{rel}\t{rec.Types.Count}\t{names}"); + } + } + + var partialPath = Path.Combine(Path.GetDirectoryName(outputPath)!, "partial-unreachable.tsv"); + await using (var w = new StreamWriter(partialPath)) + { + await w.WriteLineAsync("file_path\tdead_count\tlive_count\tdead_types\tlive_types"); + foreach (var (path, rec) in partialFiles) + { + var rel = Path.GetRelativePath(repoRoot, path).Replace('\\', '/'); + var dead = rec.Types.Where(x => !x.reachable).Select(x => x.full).ToList(); + var live = rec.Types.Where(x => x.reachable).Select(x => x.full).ToList(); + await w.WriteLineAsync($"{rel}\t{dead.Count}\t{live.Count}\t{string.Join(",", dead)}\t{string.Join(",", live)}"); + } + } + + Console.Error.WriteLine($"[output] wrote: {outputPath}"); + Console.Error.WriteLine($"[output] wrote: {partialPath}"); + + if (trimMode) + { + // 1. Delete fully-unreachable files. Their declarations would otherwise have + // `override` clauses pointing at trimmed base methods, breaking the build. + int deletedFullFiles = 0; + foreach (var (path, _) in deletableFiles) + { + if (File.Exists(path)) + { + File.Delete(path); + deletedFullFiles++; + } + } + Console.Error.WriteLine($"[trim] fully-unreachable files deleted: {deletedFullFiles}"); + + // 2. Surgical-trim member declarations from files we keep. + await ApplyTrim(deadSymbolsByFile, repoRoot); + + // 3. Type-level surgical trim of partial-mixed Shim files. The bulk-delete + // path covers fully-unreachable files; this covers files where some types + // are dead but others (live) hold the file open. Targets the long-tail + // `_ShimAnchor` namespace-keepers and dead no-op stubs in Shim/External/, + // Shim/GodObjects/, Shim/UnityEngine/, Shim/View/. + await ApplyTypeTrim(typeSymbolsByFile, repoRoot); + } + return 0; + } + + private static async Task ApplyTypeTrim( + Dictionary> typeSymbolsByFile, + string repoRoot) + { + int filesEdited = 0; + int typesRemoved = 0; + + foreach (var (filePath, types) in typeSymbolsByFile.OrderBy(kv => kv.Key, StringComparer.OrdinalIgnoreCase)) + { + // Scope to Shim/. Engine/ files in partial state are handled member-level above + // and a "dead type, live file" case in Engine/ would be unusual. + var norm = filePath.Replace('\\', '/'); + if (!norm.Contains("/Shim/")) continue; + if (!File.Exists(filePath)) continue; + + // Find dead TOP-LEVEL types whose only declaring file is this one (don't touch + // types whose partials live across multiple files — same split-file safety as + // the file-delete pass). + var deadHere = types + .Where(x => !x.reachable && x.sym.ContainingType is null) + .Select(x => x.sym) + .ToList(); + if (deadHere.Count == 0) continue; + + // Collect syntax nodes to remove. + var nodesByTree = new Dictionary>(); + foreach (var sym in deadHere) + { + foreach (var sref in sym.DeclaringSyntaxReferences) + { + if (sref.SyntaxTree.FilePath != filePath) continue; + var node = sref.GetSyntax(); + var typeDecl = node.AncestorsAndSelf() + .OfType() + .FirstOrDefault(); + if (typeDecl is null) continue; + if (!nodesByTree.TryGetValue(sref.SyntaxTree, out var list)) + { + list = new(); + nodesByTree[sref.SyntaxTree] = list; + } + if (!list.Contains(typeDecl)) list.Add(typeDecl); + } + } + if (nodesByTree.Count == 0) continue; + + var (tree, matched) = nodesByTree.First(); + var root = await tree.GetRootAsync(); + var newRoot = root.RemoveNodes(matched, Microsoft.CodeAnalysis.SyntaxRemoveOptions.KeepNoTrivia); + if (newRoot is null) continue; + + await File.WriteAllTextAsync(filePath, newRoot.ToFullString()); + filesEdited++; + typesRemoved += matched.Count; + } + + Console.Error.WriteLine($"[type-trim] files edited: {filesEdited}, types removed: {typesRemoved}"); + } + + private static async Task ApplyTrim( + Dictionary> deadSymbolsByFile, + string repoRoot) + { + int filesEdited = 0; + int filesDeleted = 0; + int nodesRemoved = 0; + + foreach (var (filePath, members) in deadSymbolsByFile.OrderBy(kv => kv.Key, StringComparer.OrdinalIgnoreCase)) + { + // Trim scope: every BattleEngine source file. Shim/External/ third-party SDK + // stubs (Steamworks, Facebook, MessagePack, ZXing, CriWare, Spine, BestHTTP, + // GooglePlayGames, etc.) only existed because the decompiled engine UI called + // them; with the UI gone, nothing in BattleNode reaches them. The same logic + // applies to Shim/UnityEngine/* (UI/Loading API stubs) and Shim/View/* — they + // were defensive surface for UI paths that no longer exist headless. Trim them + // all; the analyzer's protection rules + the baseline-rescue net keep anything + // BattleNode actually calls. Engine/ never had a /Shim/ subdir, but the check + // is kept for clarity. + var norm = filePath.Replace('\\', '/'); + bool inScope = norm.Contains("/SVSim.BattleEngine/"); + if (!inScope) continue; + if (!File.Exists(filePath)) continue; + + // The symbols' DeclaringSyntaxReferences point at the workspace compilation's + // syntax tree for this file. RemoveNodes operates on node identity within that + // tree — no name-matching needed, no risk of collapsing distinct members that + // happen to share an unqualified name (Clear() on outer instance vs nested + // Defaults.loopType etc). + var nodesByTree = new Dictionary>(); + foreach (var sym in members) + { + foreach (var sref in sym.DeclaringSyntaxReferences) + { + if (sref.SyntaxTree.FilePath != filePath) continue; + var node = sref.GetSyntax(); + var memberDecl = node.AncestorsAndSelf() + .OfType() + .FirstOrDefault(); + if (memberDecl is null) continue; + if (!nodesByTree.TryGetValue(sref.SyntaxTree, out var list)) + { + list = new(); + nodesByTree[sref.SyntaxTree] = list; + } + if (!list.Contains(memberDecl)) list.Add(memberDecl); + } + } + if (nodesByTree.Count == 0) continue; + + var (tree, matched) = nodesByTree.First(); + var root = await tree.GetRootAsync(); + + var newRoot = root.RemoveNodes(matched, Microsoft.CodeAnalysis.SyntaxRemoveOptions.KeepNoTrivia); + if (newRoot is null) continue; + + // Do NOT delete the file even if every member is removed: the partial-class + // declaration carries the type's base-clause/interface-list which other + // generated files (e.g. _BaseClauses.g.cs) depend on, and a partial class + // declared nowhere else would be erased entirely. Just write back the shell. + await File.WriteAllTextAsync(filePath, newRoot.ToFullString()); + filesEdited++; + nodesRemoved += matched.Count; + } + + Console.Error.WriteLine($"[trim] files edited: {filesEdited}, files deleted: {filesDeleted}, nodes removed: {nodesRemoved}"); + } + + private static string? MemberKey(SyntaxNode node) + { + switch (node) + { + case Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax m: + return $"M:{m.Identifier.ValueText}({string.Join(",", m.ParameterList.Parameters.Select(p => p.Type?.ToString() ?? ""))})"; + case Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax c: + return $"C:{c.Identifier.ValueText}({string.Join(",", c.ParameterList.Parameters.Select(p => p.Type?.ToString() ?? ""))})"; + case Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax p: + return $"P:{p.Identifier.ValueText}"; + case Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax e: + return $"E:{e.Identifier.ValueText}"; + case Microsoft.CodeAnalysis.CSharp.Syntax.EventFieldDeclarationSyntax ef: + var n0 = ef.Declaration.Variables.FirstOrDefault()?.Identifier.ValueText; + return n0 is null ? null : $"EF:{n0}"; + case Microsoft.CodeAnalysis.CSharp.Syntax.FieldDeclarationSyntax f: + // Multiple variables in one declaration: key on the first. The trimmer only + // emits whole-declaration removal — if some variables in a multi-decl are + // alive, the analyzer's per-symbol output already separated them, so they + // get distinct DeclaringSyntaxReferences. Keep simple: key on first. + var fname = f.Declaration.Variables.FirstOrDefault()?.Identifier.ValueText; + return fname is null ? null : $"F:{fname}"; + case Microsoft.CodeAnalysis.CSharp.Syntax.IndexerDeclarationSyntax ix: + return $"I:[{string.Join(",", ix.ParameterList.Parameters.Select(p => p.Type?.ToString() ?? ""))}]"; + default: + return null; + } + } + + // Display-string signature used as a cross-compilation-stable member identity. + // For methods, includes container, name, and parameter types. + private static readonly SymbolDisplayFormat KeyFormat = new( + globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted, + typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, + genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters, + memberOptions: SymbolDisplayMemberOptions.IncludeContainingType + | SymbolDisplayMemberOptions.IncludeType + | SymbolDisplayMemberOptions.IncludeParameters, + parameterOptions: SymbolDisplayParameterOptions.IncludeType, + miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes); + + private static string SignatureKey(ISymbol sym) + { + var orig = sym.OriginalDefinition; + return orig.ToDisplayString(KeyFormat); + } + + private static void RecordMember(ISymbol? sym, HashSet reached) + { + if (sym is null) return; + // Extension method invocations resolve to a "reduced" IMethodSymbol whose identity + // differs from the static declaration. Walk to the underlying static method. + if (sym is IMethodSymbol rm && rm.ReducedFrom is not null) sym = rm.ReducedFrom; + switch (sym) + { + case IMethodSymbol m: + reached.Add(SignatureKey(m)); + if (m.AssociatedSymbol is not null) + reached.Add(SignatureKey(m.AssociatedSymbol)); + break; + case IPropertySymbol p: + reached.Add(SignatureKey(p)); + if (p.GetMethod is not null) reached.Add(SignatureKey(p.GetMethod)); + if (p.SetMethod is not null) reached.Add(SignatureKey(p.SetMethod)); + break; + case IFieldSymbol f: + reached.Add(SignatureKey(f)); + break; + case IEventSymbol e: + reached.Add(SignatureKey(e)); + if (e.AddMethod is not null) reached.Add(SignatureKey(e.AddMethod)); + if (e.RemoveMethod is not null) reached.Add(SignatureKey(e.RemoveMethod)); + break; + } + } + + private static void AddSymbol(ISymbol? sym, Queue q) + { + if (sym is null) return; + // Extension method invocations resolve to a reduced IMethodSymbol whose + // ContainingType is the receiver, not the static-method-declaring class. + if (sym is IMethodSymbol rm && rm.ReducedFrom is not null) sym = rm.ReducedFrom; + switch (sym) + { + case INamedTypeSymbol nt: + Enqueue(nt, q); + foreach (var ta in nt.TypeArguments) EnqueueAny(ta, q); + break; + case IMethodSymbol m: + if (m.ContainingType is not null) Enqueue(m.ContainingType, q); + EnqueueAny(m.ReturnType, q); + foreach (var p in m.Parameters) EnqueueAny(p.Type, q); + foreach (var ta in m.TypeArguments) EnqueueAny(ta, q); + break; + case IPropertySymbol p: + if (p.ContainingType is not null) Enqueue(p.ContainingType, q); + EnqueueAny(p.Type, q); + break; + case IFieldSymbol f: + if (f.ContainingType is not null) Enqueue(f.ContainingType, q); + EnqueueAny(f.Type, q); + break; + case IEventSymbol e: + if (e.ContainingType is not null) Enqueue(e.ContainingType, q); + EnqueueAny(e.Type, q); + break; + } + } + + private static void EnqueueAny(ITypeSymbol? type, Queue q) + { + if (type is null) return; + switch (type) + { + case IArrayTypeSymbol a: + EnqueueAny(a.ElementType, q); + break; + case IPointerTypeSymbol p: + EnqueueAny(p.PointedAtType, q); + break; + case INamedTypeSymbol nt: + Enqueue(nt, q); + foreach (var ta in nt.TypeArguments) EnqueueAny(ta, q); + break; + case ITypeParameterSymbol tp: + foreach (var con in tp.ConstraintTypes) EnqueueAny(con, q); + break; + } + } + + private static void Enqueue(INamedTypeSymbol type, Queue q) + { + q.Enqueue((INamedTypeSymbol)type.OriginalDefinition); + } + + private static IEnumerable EnumerateTypes(INamespaceOrTypeSymbol root) + { + if (root is INamespaceSymbol ns) + { + foreach (var t in ns.GetTypeMembers()) + { + yield return t; + foreach (var n in EnumerateNestedTypes(t)) yield return n; + } + foreach (var sub in ns.GetNamespaceMembers()) + foreach (var t in EnumerateTypes(sub)) + yield return t; + } + else if (root is INamedTypeSymbol nt) + { + yield return nt; + foreach (var n in EnumerateNestedTypes(nt)) yield return n; + } + } + + private static IEnumerable EnumerateNestedTypes(INamedTypeSymbol t) + { + foreach (var n in t.GetTypeMembers()) + { + yield return n; + foreach (var nn in EnumerateNestedTypes(n)) yield return nn; + } + } + + private static bool HasNUnitAttribute(INamedTypeSymbol t) + { + foreach (var a in t.GetAttributes()) + if (NUnitAttributeNames.Contains(a.AttributeClass?.Name ?? "")) + return true; + foreach (var m in t.GetMembers()) + foreach (var a in m.GetAttributes()) + if (NUnitAttributeNames.Contains(a.AttributeClass?.Name ?? "")) + return true; + return false; + } + + private static string FullName(INamedTypeSymbol t) => + t.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + + private static string FindRepoRoot() + { + var dir = AppContext.BaseDirectory; + for (int i = 0; i < 10; i++) + { + if (File.Exists(Path.Combine(dir, "DCGEngine.sln"))) + return Path.GetFullPath(dir); + var parent = Directory.GetParent(dir)?.FullName; + if (parent is null || parent == dir) break; + dir = parent; + } + throw new InvalidOperationException( + "could not locate DCGEngine.sln walking up from " + AppContext.BaseDirectory); + } + + private sealed class FileRecord + { + public List<(string full, bool reachable)> Types { get; } = new(); + } + + private sealed record DeadMember(string Kind, string TypeFullName, string MemberName, string Signature); +}