2 using System.Collections.Generic;
3 using System.Collections.Immutable;
7 partial class EndMission : Mission
13 partial
void OnStateChangedProjSpecific()
15 SoundPlayer.ForceMusicUpdate();
16 if (Phase == MissionPhase.NoItemsDestroyed)
18 CoroutineManager.Invoke(() =>
20 if (boss !=
null && !boss.
Removed)
22 new CameraTransition(boss, GameMain.GameScreen.Cam, null, Alignment.Center, panDuration: 8, fadeOut: false, startZoom: 1.0f, endZoom: 0.3f * GUI.yScale)
24 RunWhilePaused = false,
25 EndWaitDuration = 3.0f
30 else if (Phase == MissionPhase.AllItemsDestroyed)
32 CoroutineManager.StartCoroutine(wakeUpCoroutine(), name:
"EndMission.wakeUpCoroutine");
34 else if (Phase == MissionPhase.BossKilled)
36 if (!
string.IsNullOrEmpty(endCinematicSound))
38 SoundPlayer.PlaySound(endCinematicSound);
40 CoroutineManager.Invoke(() =>
42 new CameraTransition(boss, GameMain.GameScreen.Cam,
null, Alignment.Center, panDuration: 3, fadeOut:
false, endZoom: 0.1f * GUI.yScale)
44 RunWhilePaused =
false,
45 EndWaitDuration =
float.PositiveInfinity
50 IEnumerable<CoroutineStatus> wakeUpCoroutine()
53 if (boss !=
null && !boss.
Removed)
55 new CameraTransition(boss, GameMain.GameScreen.Cam,
null, Alignment.Center, panDuration: 5.0f, fadeOut:
false, losFadeIn:
false, startZoom: 1.0f, endZoom: 0.4f * GUI.yScale)
57 RunWhilePaused =
false,
62 if (boss !=
null && !boss.
Removed)
66 if (!limb.FreezeBlinkState) {
continue; }
67 limb.FreezeBlinkState =
false;
68 if (limb.LightSource is Lights.LightSource light)
77 partial
void UpdateProjSpecific()
79 if (boss ==
null || boss.Removed) {
return; }
80 if (Phase is MissionPhase.Initial or MissionPhase.NoItemsDestroyed or MissionPhase.SomeItemsDestroyed)
84 foreach (var limb
in boss.AnimController.Limbs)
86 if (limb.Params.BlinkFrequency > 0)
88 limb.FreezeBlinkState =
true;
89 limb.BlinkPhase = -limb.Params.BlinkHoldTime;
90 if (limb.LightSource is Lights.LightSource light)
92 light.Enabled =
false;
99 if (PlayerInput.KeyHit(Microsoft.Xna.Framework.Input.Keys.O))
103 if (PlayerInput.KeyHit(Microsoft.Xna.Framework.Input.Keys.Y))
105 destructibleItems.ForEach(it => it.Condition = 0.0f);
107 if (PlayerInput.KeyHit(Microsoft.Xna.Framework.Input.Keys.U))
109 boss?.SetAllDamage(20000.0f, 0.0f, 0.0f);
116 base.ClientReadInitial(msg);
121 List<Character> minionList =
new List<Character>();
122 for (
int i = 0; i < minionCount; i++)
127 throw new System.Exception($
"Error in EndMission.ClientReadInitial: failed to create a minion (mission: {Prefab.Identifier}, index: {i})");
129 minionList.Add(minion);
131 minions = minionList.ToImmutableArray();
132 if (minions.Length != minionCount)
134 throw new System.Exception(
"Error in EndMission.ClientReadInitial: minion count does not match the server count (" + minionCount +
" != " + minions.Length +
"mission: " +
Prefab.
Identifier +
")");
static Character ReadSpawnData(IReadMessage inc)
readonly AnimController AnimController
override void ClientReadInitial(IReadMessage msg)
override bool DisplayAsFailed
override bool DisplayAsCompleted
readonly float wakeUpCinematicDelay
readonly float bossWakeUpDelay
readonly float cameraWaitDuration
readonly Identifier Identifier