Journey encounters and 360 camera, Ludus training ground, offline gold fix, new music, settings layout, grounded KO, thraex shield, arena name chant

Stand von main 9c35eff2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 10:47:49 +01:00
parent 0454683fc3
commit c516679674
26 changed files with 856 additions and 151 deletions

View File

@@ -120,6 +120,8 @@ namespace GladiatorIdle.Arena
public bool? Spared => _spared;
public float MissioTime => _missio ? _missioT : -1;
public bool Over => _phase == Phase.End;
/// Testläufe: Zeit seit dem Ende des Kampfs.
public float EndTime => _phase == Phase.End ? _phaseTime : -1;
sealed class Floater { public string Text = ""; public Vector2 Pos; public Color Color; public float Size, Age, Life = 1.1f; public bool Big; }
readonly List<Floater> _floaters = new();
@@ -136,6 +138,36 @@ namespace GladiatorIdle.Arena
public TutStep Tutorial => _tut;
public bool TutorialRan { get; private set; }
// ── Training im Ludus: 30 s Übung, jede gelungene Aktion zählt ──
public Stat? Training { get; private set; }
public int TrainActions { get; private set; }
float _trainPop;
public void StartTraining(Stat s)
{
Training = s;
Duel.GuardHp = true;
Duel.EnemyDamageMult = 0.25;
if (s is Stat.Strength or Stat.Showmanship) Duel.EnemyPassive = true; // der Doctore hält still
else Duel.EnemyAttacksOnly = true; // der Doctore greift an: blocken bzw. ausweichen
}
void TrainEvent(DuelEvent e)
{
if (Training is not Stat s || _phase != Phase.Fight) return;
int n = s switch
{
Stat.Strength => e.Type == DuelEventType.Hit && e.ByPlayer ? 1 : 0,
// Ausdauer: nur rechtzeitiges Blocken zählt (Block kurz vor dem Hieb gesetzt), Dauerblock bringt nichts
Stat.Endurance => !e.ByPlayer ? 0 : e.Type == DuelEventType.Parry ? 2
: e.Type == DuelEventType.Blocked && Duel.Time - Duel.Player.BlockSince < 0.5 ? 1 : 0,
Stat.Agility => e.Type == DuelEventType.Dodged && e.ByPlayer ? 1 : 0,
_ => e.ByPlayer && e.Type is DuelEventType.Leap or DuelEventType.Special or DuelEventType.Super ? 2
: e.Type == DuelEventType.Hit && e.ByPlayer ? (e.Crit ? 2 : 1) : 0,
};
if (n > 0) { TrainActions += n; _trainPop = 1; _crowd.Excite(0.08f); }
}
public void StartTutorial()
{
TutorialRan = true;
@@ -284,7 +316,6 @@ namespace GladiatorIdle.Arena
if (!_announced)
{
_announced = true;
NameVoice.Play(NameVoice.Kind.Enter, 1f, 8); // „Gladiator Spartacus!“
if (_enemy.IsChampion) // Champion: von unten nah heran, dann hoch und zurück
Cine(Pivot.Enemy, new(0.01f, -35, -24, 1700), new(1.7f, -55, -16, 1550), new(COUNTDOWN, 0, 0, 0));
else if (_tut == TutStep.Off) // volle Umrundung beider Kämpfer
@@ -305,18 +336,27 @@ namespace GladiatorIdle.Arena
TutUpdate(realDt, input);
Duel.Step(dt);
HandleEvents();
_trainPop = MathF.Max(0, _trainPop - realDt * 3);
if (Training != null && Duel.Time >= Balance.TRAIN_TIME)
{
// Übung vorbei: kein Sieger, kein Gnadenstoß
_phase = Phase.End; _phaseTime = 0; Won = true; _missio = false;
Duel.EnemyPassive = true; Duel.EnemyAttacksOnly = false;
SoundManager.PlayVictory(); SoundManager.PlayCheer();
break;
}
if (Duel.Over)
{
_phase = Phase.End; _phaseTime = 0; Won = Duel.PlayerWon;
// Gnadenstoß: nicht in der Einführung und nicht gegen Legenden
_missio = !TutorialRan && _enemy.Display == null;
if (Won && !_missio) NameVoice.Play(NameVoice.Kind.Chant, 1f, 0);
if (Won) NameVoice.Play(NameVoice.Kind.Chant, 1f, 0); // jeder Sieg: die Menge ruft den Namen
_crowdMercy = Duel.DamageToPlayer >= Duel.Player.MaxHp * 0.3 || Duel.Time >= 25; // tapferer Gegner
if (!Won) _spared = Duel.PlayerParries >= 2 || Duel.Enemy.Hp <= Duel.Enemy.MaxHp * 0.5 || Duel.Time >= 30;
_cam.FocusX = Won ? _pv.X : _ev.X;
// Kinomoment: Kamera kippt nach unten, Nahansicht auf den Sieger über dem Gefallenen
Cine(Pivot.Winner, new(0.6f, Won ? 35 : -35, -20, 1500), new(2.8f, Won ? 70 : -70, -17, 1450));
if (Won) SoundManager.PlayVictory(); else SoundManager.PlayDefeat();
if (Won) { SoundManager.PlayVictory(); SoundManager.PlayCheer(); } else SoundManager.PlayDefeat();
}
break;
case Phase.End:
@@ -458,6 +498,7 @@ namespace GladiatorIdle.Arena
foreach (var e in Duel.Events)
{
TutEvent(e);
TrainEvent(e);
var targetView = e.ByPlayer ? _ev : _pv;
var actorView = e.ByPlayer ? _pv : _ev;
var target = e.ByPlayer ? Duel.Enemy : Duel.Player;
@@ -845,16 +886,25 @@ namespace GladiatorIdle.Arena
if (n >= 1)
D.Text(sb, Assets.Serif, 200, n.ToString(NumberFormat.Culture), new Vector2(Camera.W / 2, 420),
D.Gold * (1 - k * 0.7f), Align.Center, 1.5f - 0.5f * k);
D.Text(sb, Assets.SansBold, 28, L.t(_enemy.Display != null ? "duel.legend" : _enemy.IsChampion ? "duel.champion" : "duel.practice").ToUpperInvariant(),
D.Text(sb, Assets.SansBold, 28, (Training is Stat tt ? string.Format(L.t("ludus.train.title"), L.t(TextKeys.Of(tt))) : L.t(_enemy.Display != null ? "duel.legend" : _enemy.IsChampion ? "duel.champion" : "duel.practice")).ToUpperInvariant(),
new Vector2(Camera.W / 2, 600), D.Sand, Align.Center);
}
if (Training is Stat ts && _phase == Phase.Fight)
{
// Übung: Zeit, Zähler, Hinweis
double left = Math.Max(0, Balance.TRAIN_TIME - Duel.Time);
D.Text(sb, Assets.Serif, 34, string.Format(L.t("ludus.train.title"), L.t(TextKeys.Of(ts))), new Vector2(Camera.W / 2, 150), D.Gold, Align.Center);
D.Text(sb, Assets.SansBold, 26, $"{left:0}s · " + string.Format(L.t("ludus.train.count"), TrainActions), new Vector2(Camera.W / 2, 196), // i18n-ok
Color.Lerp(Color.White, D.Gold, _trainPop), Align.Center, 1 + 0.15f * _trainPop);
D.Text(sb, Assets.Sans, 20, L.t("ludus.train.hint." + ts.ToString().ToLowerInvariant()), new Vector2(Camera.W / 2, 236), D.Sand, Align.Center);
}
if (_phase == Phase.End && _missio && _decidedAt < 0) DrawMissio(sb);
else if (_phase == Phase.End)
{
float since = _missio ? _missioT - _decidedAt : _phaseTime;
float k = MathHelper.Clamp(since / 0.6f, 0, 1);
D.Rect(sb, new RectangleF(0, 0, Camera.W, Camera.H), Color.Black * (0.35f * k));
D.Text(sb, Assets.Serif, 170, L.t(Won ? "duel.win" : "duel.lose"), new Vector2(Camera.W / 2, 400),
D.Text(sb, Assets.Serif, 170, Training != null ? L.t("ludus.train.done") : L.t(Won ? "duel.win" : "duel.lose"), new Vector2(Camera.W / 2, 400),
(Won ? D.Gold : D.Red) * k, Align.Center, 1 + 0.4f * (1 - k));
if (_missio)
{
@@ -929,7 +979,7 @@ namespace GladiatorIdle.Arena
if (!Won) { if (mercy) SoundManager.PlayCheer(); else SoundManager.PlayBoo(); return; }
_mercy = mercy;
bool match = mercy == _crowdMercy;
if (match) { _crowd.Wave(); SoundManager.PlayCheer(); NameVoice.Play(_enemy.IsChampion ? NameVoice.Kind.Win : NameVoice.Kind.Chant, 1f, 0); }
if (match) { _crowd.Wave(); SoundManager.PlayCheer(); if (_enemy.IsChampion) NameVoice.Play(NameVoice.Kind.Win, 1f, 0); }
else SoundManager.PlayBoo();
if (!mercy) { _pv.HoldClip = "powerup"; _cam.Shake(0.35f); SoundManager.PlayFury(); } // Kampfschrei, keine Tötung
Big(L.t(mercy ? "missio.mitte" : "missio.iugula"), mercy ? D.Gold : new Color(255, 120, 70));