Freiheit, Ehrenhalle, Götter, Champion-Auftritte; Waffen weichen dem Körper aus

Stand von main 0abffe17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 13:29:26 +01:00
parent a7134b2753
commit bdcf9a4a2c
383 changed files with 554 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ namespace GladiatorIdle.Arena
/// </summary>
internal sealed class DuelScene
{
enum Phase { Countdown, Fight, End }
enum Phase { Intro, Countdown, Fight, End }
const float COUNTDOWN = 2.2f, SPREAD = 1.3f;
@@ -49,6 +49,9 @@ namespace GladiatorIdle.Arena
};
Phase _phase = Phase.Countdown;
readonly string? _introClip; // Auftritt des Champions (Wan-Clip), sonst gleich der Countdown
const float INTRO = 6f;
public bool InIntro => _phase == Phase.Intro;
float _phaseTime, _hitstop, _slowmo, _screenFlash;
float _furyDark, _emberIn; // Raserei: Abdunkeln der Arena, Takt der Funken
Color _flashColor = Color.White;
@@ -94,6 +97,16 @@ namespace GladiatorIdle.Arena
sl[1].Learned = Duel.Perks.HeavyStrike;
sl[2].Learned = Duel.Perks.ShieldWall;
SoundManager.StartAmbient(enemy.IsChampion ? "music_champion" : "music_arena");
if (enemy.IsChampion && enemy.NameKey.StartsWith("champion.")) // Geschichte, kein Effekt: auch bei "Effekte reduzieren"
{
string clip = "champintro_" + enemy.NameKey["champion.".Length..];
if (Assets.RootDir is string root && System.IO.File.Exists(System.IO.Path.Combine(root, "Video", clip + "_00.jpg")))
{
_introClip = clip;
ClipCache.Video(clip); // lädt im Hintergrund
_phase = Phase.Intro;
}
}
}
// ── Takt ────────────────────────────────────────────────────
@@ -110,6 +123,13 @@ namespace GladiatorIdle.Arena
switch (_phase)
{
case Phase.Intro:
if (_phaseTime >= INTRO || input.LeftClick || input.Pressed(Keys.Space) || input.Pressed(Keys.Enter))
{
_phase = Phase.Countdown; _phaseTime = 0;
SoundManager.PlayGong();
}
return;
case Phase.Countdown:
int n = 3 - (int)(_phaseTime / (COUNTDOWN / 3));
if (n != _countShown) { _countShown = n; if (n >= 1) SoundManager.PlayTick(); }
@@ -334,6 +354,31 @@ namespace GladiatorIdle.Arena
Duel.Events.Clear();
}
/// Auftritt des Champions: Clip bildschirmfüllend mit Kinobalken, Name und Titel.
void DrawIntro(SpriteBatch sb, float scale, Vector2 offset)
{
var ui = Matrix.CreateScale(scale) * Matrix.CreateTranslation(offset.X, offset.Y, 0);
sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, ui);
float p = Math.Clamp(_phaseTime / INTRO, 0, 1);
var frames = _introClip != null ? ClipCache.Video(_introClip) : null;
var tex = frames != null ? frames[Math.Min(frames.Length - 1, (int)(p * (frames.Length - 1)))] : _backdrop;
if (tex != null)
{
float k = (1.04f + 0.05f * p) * MathF.Max(Camera.W / tex.Width, Camera.H / tex.Height);
float fade = Math.Clamp(_phaseTime / 0.5f, 0, 1) * Math.Clamp((INTRO - _phaseTime) / 0.4f, 0, 1);
sb.Draw(tex, new Vector2(Camera.W / 2, Camera.H / 2), null, Color.White * fade, 0, new Vector2(tex.Width / 2f, tex.Height / 2f), k, SpriteEffects.None, 0);
}
float bar = Camera.H * 0.11f;
D.Rect(sb, new RectangleF(0, 0, Camera.W, bar), Color.Black);
D.Rect(sb, new RectangleF(0, Camera.H - bar, Camera.W, bar), Color.Black);
float ta = Math.Clamp((_phaseTime - 0.8f) / 0.6f, 0, 1);
D.Glow(sb, new Vector2(Camera.W / 2, Camera.H * 0.78f), new Vector2(Camera.W * 1.4f, 380), Color.Black * (0.7f * ta));
D.Text(sb, Assets.SansBold, 26, L.t("duel.champion").ToUpperInvariant(), new Vector2(Camera.W / 2, Camera.H * 0.72f), D.Sand * ta, Align.Center);
D.Text(sb, Assets.Serif, 96, _enemy.Name, new Vector2(Camera.W / 2, Camera.H * 0.80f), D.Gold * ta, Align.Center, 1.15f - 0.15f * ta);
D.Text(sb, Assets.Sans, 18, L.t("freedom.skip"), new Vector2(Camera.W - 40, Camera.H - bar / 2), D.Sand * 0.6f, Align.Right);
sb.End();
}
void Float(string text, Vector2 pos, Color c, float size) =>
_floaters.Add(new Floater { Text = text, Pos = pos, Color = c, Size = size });
@@ -345,6 +390,7 @@ namespace GladiatorIdle.Arena
public void Draw(GraphicsDevice gd, SpriteBatch sb, BasicEffect fx, float scale, Vector2 offset)
{
D.UiScale = scale;
if (_phase == Phase.Intro) { DrawIntro(sb, scale, offset); return; }
var view = _cam.View(scale, offset);
fx.View = view;
fx.Projection = Matrix.CreateOrthographicOffCenter(0, gd.Viewport.Width, gd.Viewport.Height, 0, 0, 1);