Oath speech in the deep warrior voice, cinematic camera, crowd calls your name

Stand von main 730ac6a2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 21:43:38 +01:00
parent 9c433c61ba
commit 0454683fc3
29 changed files with 1249 additions and 57 deletions

View File

@@ -29,6 +29,7 @@ namespace GladiatorIdle
DuelScene? _scene;
ModelTestScene? _model; // --model3d: 3D-Test
FreedomScene? _freedom; // Freiheit: Clip, Bilanz, Götter
OathScene? _oath; // Schwur des neuen Gladiators nach der Erstellung
OfflineReport? _welcome; // was offline passiert ist (beim Weiterspielen gezeigt)
LeaderboardScene? _board; // Bestenliste (aus dem Menü)
bool _nextLife; // nächste Erstellung behält das Profil (Legenden, Götter)
@@ -38,6 +39,7 @@ namespace GladiatorIdle
static readonly bool DevAdventureRun = Array.IndexOf(Environment.GetCommandLineArgs(), "--adventure") >= 0;
static readonly bool DevBoardRun = Array.IndexOf(Environment.GetCommandLineArgs(), "--leaderboard") >= 0;
static readonly bool DevTutorialRun = Array.IndexOf(Environment.GetCommandLineArgs(), "--tutorial") >= 0;
static readonly bool DevOathRun = Array.IndexOf(Environment.GetCommandLineArgs(), "--oath") >= 0;
static readonly bool Model3DTest = Array.IndexOf(Environment.GetCommandLineArgs(), "--model3d") >= 0;
SettingsOverlay _settings = null!;
bool _paused;
@@ -143,9 +145,21 @@ namespace GladiatorIdle
// eigener Spielstand fürs neue Spiel; vorhandenen laden und Abwesenheit nachrechnen
GameState.SaveFile = "arena.json";
if (Model3DTest) { _model = new ModelTestScene(GraphicsDevice); return; }
var nvArgs = Environment.GetCommandLineArgs();
int nv = Array.IndexOf(nvArgs, "--namevoice");
if (nv >= 0 && nv + 1 < nvArgs.Length)
{
NameVoice.Prepare(nvArgs[nv + 1]);
System.Threading.Tasks.Task.Run(() =>
{
for (int i = 0; i < 300 && NameVoice.Get(NameVoice.Kind.Chant) == null; i++) System.Threading.Thread.Sleep(100);
Exit();
});
}
if (!DevShot.Active && GameState.Load(out var savedUtc) is GameState loaded)
{
_game = loaded;
NameVoice.Prepare(_game.Name); // Ansager und Sprechchor im Hintergrund vorbereiten
var away = _game.ApplyOffline((DateTime.UtcNow - savedUtc).TotalSeconds);
if (away.Seconds >= 120) _welcome = away; // im Hub als erstes Fenster
ToMenu();
@@ -156,7 +170,7 @@ namespace GladiatorIdle
void ToMenu()
{
_hub = null; _scene = null; _creator = null; _intro = null; _freedom = null; _board = null; _paused = false; _nextLife = false;
_hub = null; _scene = null; _creator = null; _intro = null; _freedom = null; _board = null; _oath = null; _paused = false; _nextLife = false;
_menu = new MenuScene(_game != null, _game?.Freedoms ?? 0);
SoundManager.StopAmbience();
}
@@ -188,9 +202,17 @@ namespace GladiatorIdle
int da = Array.IndexOf(cmd, "--duelarena");
if (da >= 0 && da + 1 < cmd.Length && int.TryParse(cmd[da + 1], out int arenaN)) _game.DevArena(arenaN);
_game.Save();
NameVoice.Prepare(_game.Name);
_creator = null;
// Schwur des neuen Gladiators (in Testläufen nur mit --oath)
if (!DevShot.Active || DevOathRun) { _oath = new OathScene(_game); _devTime = 0; return; }
OpenHub();
}
void OpenHub()
{
var sw = Stopwatch.StartNew();
_hub = new HubScene(_game);
_hub = new HubScene(_game!);
DevShot.Log($"timing: hub created in {sw.ElapsedMilliseconds} ms");
}
@@ -292,6 +314,7 @@ namespace GladiatorIdle
}
readonly Stopwatch _updWatch = new();
double _lastUpd, _lastDraw;
double _updMs;
Matrix UiMatrix(out float s, out Vector2 off)
@@ -333,6 +356,16 @@ namespace GladiatorIdle
if (DevShot.Active) DevBoard(dt);
if (_board != null && _board.Done) ToMenu();
}
else if (_oath != null)
{
_oath.Update(dt, input);
if (DevShot.Active)
{
_devTime += dt;
for (int i = 0; i < 18; i++) if (_oath.Time > 0.3f + i * 1.5f && _shots.Add($"o_{i:00}")) { _capture = $"o_{i:00}"; break; }
}
if (_oath.Done) { _oath = null; OpenHub(); if (DevOathRun) Exit(); }
}
else if (_freedom != null)
{
_freedom.Update(dt, input, ui);
@@ -407,6 +440,7 @@ namespace GladiatorIdle
}
base.Update(gameTime);
_updMs += _updWatch.Elapsed.TotalMilliseconds;
_lastUpd = _updWatch.Elapsed.TotalMilliseconds;
}
/// Pause-Menü in der Arena: Weiter / Einstellungen / Hauptmenü / Beenden.
@@ -618,6 +652,14 @@ namespace GladiatorIdle
if (Perf) { PerfStep(); return; }
void Shot(string name) { if (_shots.Add(name)) _capture = name; }
if (_scene.InIntro) { if (_devTime > 2.5) Shot("m_champintro"); return; }
if (CineRun)
{
// Bildserien der Kinofahrten: Countdown, Raserei, K.o./Missio
for (int i = 0; i < 12; i++) if (_devTime > 0.15 + i * 0.28) Shot($"cine_a_{i:00}");
if (d.Player.State == DuelState.Super) for (int i = 0; i < 5; i++) if (d.Player.StateTime > 0.1 + i * 0.25) Shot($"cine_b_{i}");
if (_scene.Over && !_shots.Contains("cine_c_ko")) Shot("cine_c_ko");
for (int i = 0; i < 12; i++) if (_scene.MissioTime > 0.4 + i * 0.7) Shot($"cine_d_{i:00}");
}
if (_scene.Tutorial != DuelScene.TutStep.Off) { Shot("t_" + _scene.Tutorial.ToString().ToLowerInvariant()); }
if (_devTime > 0.5) Shot("m_countdown");
if (d.Time > 0.6) Shot("m_fight");
@@ -649,6 +691,7 @@ namespace GladiatorIdle
/// --perf: 15 s Kampf ohne Aufnahmen, Bildzeiten messen (Mittel, 95. Perzentil).
static readonly bool Perf = Array.IndexOf(Environment.GetCommandLineArgs(), "--perf") >= 0;
static readonly bool Record = Array.IndexOf(Environment.GetCommandLineArgs(), "--record") >= 0;
static readonly bool CineRun = Array.IndexOf(Environment.GetCommandLineArgs(), "--cine") >= 0;
readonly System.Collections.Generic.List<double> _times = new();
int _gcStart = -1, _duelsStarted;
@@ -658,6 +701,7 @@ namespace GladiatorIdle
{
if (_gcStart < 0) { _gcStart = GC.CollectionCount(0); _duelDraw = 0; _duelFrames = 0; }
_times.Add(_lastFrameMs);
if (_lastFrameMs > 30) DevShot.Log($"perf spike {_lastFrameMs:0} ms (upd {_lastUpd:0.0}, draw {_lastDraw:0.0}, gc {GC.CollectionCount(0)}/{GC.CollectionCount(1)}/{GC.CollectionCount(2)}) at {_devTime:0.00}s duel t={_scene!.Duel.Time:0.00} over={_scene.Over} phase-missio={_scene.MissioTime:0.00}");
}
// nach jedem Kampf sofort ein neuer: misst auch den Ruckler beim Duellstart
if (_scene!.Over) { var o = _offer!; EndDuel(); StartDuel(o); _duelsStarted++; }
@@ -698,6 +742,7 @@ namespace GladiatorIdle
Gfx.Draw.UiScale = scale;
if (_model != null) _model.Draw(gd, _sb, scale, offset);
else if (_freedom != null) _freedom.Draw(gd, _sb, _fx, scale, offset);
else if (_oath != null) _oath.Draw(gd, _sb, _fx, scale, offset);
else if (_board != null) _board.Draw(_sb, scale, offset);
else if (_intro != null) _intro.Draw(_sb, scale, offset);
else if (_menu != null) _menu.Draw(_sb, scale, offset);
@@ -709,7 +754,7 @@ namespace GladiatorIdle
if (_paused && !_settings.Open) DrawPause(_sb, ui);
}
// weicher Wechsel zwischen Bildschirmen: neues Bild kommt kurz aus dem Schwarz
object? now = (object?)_model ?? _freedom ?? (object?)_board ?? _intro ?? (object?)_menu ?? _creator ?? (object?)_scene ?? _hub;
object? now = (object?)_model ?? _freedom ?? (object?)_oath ?? (object?)_board ?? _intro ?? (object?)_menu ?? _creator ?? (object?)_scene ?? _hub;
if (!ReferenceEquals(now, _shown)) { _shown = now; _fadeIn = 0; }
_fadeIn = Math.Min(1, _fadeIn + gameTime.ElapsedGameTime.TotalSeconds / 0.3);
if (_fadeIn < 1)
@@ -736,6 +781,7 @@ namespace GladiatorIdle
_sb.End();
}
_drawMs += _drawWatch.Elapsed.TotalMilliseconds; _frames++;
_lastDraw = _drawWatch.Elapsed.TotalMilliseconds;
if (capturing) { } // Bilder mit Aufnahme (PNG speichern) nicht mitzählen
else if (_scene != null) { _duelDraw += _drawWatch.Elapsed.TotalMilliseconds; _duelFrames++; }
else if (_hub != null) { _hubDraw += _drawWatch.Elapsed.TotalMilliseconds; _hubFrames++; }