2026-11-08 12:57:20 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using GladiatorIdle.Gfx;
|
|
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
|
|
using D = GladiatorIdle.Gfx.Draw;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GladiatorIdle.Arena
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Arena zwischen den Kämpfen: der eigene Gladiator in der Arena, oben Stufe, Denare und Ruhm,
|
|
|
|
|
|
/// rechts die Gegner zur Wahl (leichter / ebenbürtig / stärker / Champion), unten Schubladen
|
|
|
|
|
|
/// für Gladiator und Ludus. Training und Einnahmen laufen weiter.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed partial class HubScene
|
|
|
|
|
|
{
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
enum Drawer { None, Gladiator, Ludus, Expedition, Hall }
|
|
|
|
|
|
/// Seite im Gladiator-Reiter: Werte & Ausrüstung oder Fähigkeiten.
|
|
|
|
|
|
enum Page { Gear, Skills }
|
|
|
|
|
|
Page _page;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
|
|
|
|
|
|
readonly GameState _game;
|
|
|
|
|
|
readonly Ui _ui = new();
|
|
|
|
|
|
readonly Particles _fx = new();
|
|
|
|
|
|
readonly Crowd _crowd = new(11);
|
|
|
|
|
|
readonly FighterView _hero;
|
|
|
|
|
|
readonly DuelFighter _dummy = new() { IsPlayer = true, X = 0, Facing = 1, MaxHp = 1, Hp = 1 };
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
readonly Stage3D _stage; // dieselbe 3D-Arena wie im Duell
|
|
|
|
|
|
const float HERO_X = 560;
|
|
|
|
|
|
// Gegnerkarten: echte 3D-Figur je Gegner (wie im Duell), in eigene Bildflächen gerendert
|
|
|
|
|
|
readonly Dictionary<string, FighterView> _foeViews = new();
|
|
|
|
|
|
readonly DuelFighter _foeDummy = new() { IsPlayer = false, X = 0, Facing = -1, MaxHp = 1, Hp = 1 };
|
|
|
|
|
|
readonly List<RenderTarget2D> _cardRt = new();
|
|
|
|
|
|
const int CARD_W = 300, CARD_H = 360;
|
|
|
|
|
|
int _cardFrame;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
double _t;
|
|
|
|
|
|
Drawer _drawer;
|
|
|
|
|
|
float _drawerK; // 0 zu, 1 offen (gleitet)
|
2026-11-08 18:43:05 +01:00
|
|
|
|
Drawer _drawerSound; // für den Ton beim Öffnen/Wechseln
|
2026-11-08 12:57:20 +01:00
|
|
|
|
|
|
|
|
|
|
// Meldung nach dem Kampf
|
|
|
|
|
|
string[] _toast = Array.Empty<string>();
|
|
|
|
|
|
Color _toastColor;
|
|
|
|
|
|
double _toastAge = 99;
|
|
|
|
|
|
|
|
|
|
|
|
/// Gewählter Gegner (Kampf beginnt) — von außen abgeholt.
|
|
|
|
|
|
public Offer? Chosen { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public HubScene(GameState game)
|
|
|
|
|
|
{
|
|
|
|
|
|
_game = game;
|
|
|
|
|
|
string hero = Art.Hero(game.Class, game.Look.Preset);
|
|
|
|
|
|
_hero = Assets.Has(hero) ? new FighterView(hero, 0.5f, game.Look.Color) : new FighterView(Art.Fighter(game.Class), 0.5f);
|
|
|
|
|
|
_hero.Preload();
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
_stage = new Stage3D(game.Arena, AppSettings.ReduceMotion);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
_fx.Calm = AppSettings.ReduceMotion;
|
|
|
|
|
|
SoundManager.StartAmbient("music_ludus");
|
2026-11-08 18:43:05 +01:00
|
|
|
|
SoundManager.PlayAmbience("amb_crowd");
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ShowResult(string[] lines, Color color)
|
|
|
|
|
|
{
|
|
|
|
|
|
_toast = lines; _toastColor = color; _toastAge = 0;
|
|
|
|
|
|
_crowd.Excite(color == D.Gold ? 0.8f : 0.1f);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
void EnsureArena() => _stage.SetArena(_game.Arena);
|
|
|
|
|
|
|
|
|
|
|
|
FighterView FoeView(Enemy e)
|
2026-11-08 12:57:20 +01:00
|
|
|
|
{
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
string art = e.Art ?? Art.Enemy(e.NameKey);
|
|
|
|
|
|
if (!_foeViews.TryGetValue(art, out var v))
|
|
|
|
|
|
_foeViews[art] = v = new FighterView(art, 1.7f, -1, _game.Look.Color == 0 ? 6 : 0);
|
|
|
|
|
|
return v;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Gegner der Karten in ihre Bildflächen zeichnen (vor allem anderen: Zielwechsel leert das Bild).
|
|
|
|
|
|
void RenderCards(GraphicsDevice gd, BasicEffect fx, float dt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_drawerK > 0.98f || Modal || _game.Away != null) return;
|
|
|
|
|
|
// 15 Bilder/s reichen für die ruhige Bereit-Haltung (die Bildflächen behalten ihren Inhalt)
|
|
|
|
|
|
_cardFrame++;
|
|
|
|
|
|
var offers = _game.Offers();
|
|
|
|
|
|
if (_cardFrame % 4 != 0 && _cardRt.Count >= offers.Count) { foreach (var o in offers) FoeView(o.Enemy).Update(dt, dt, _foeDummy, 0, AppSettings.ReduceMotion); return; }
|
|
|
|
|
|
var previous = gd.GetRenderTargets();
|
|
|
|
|
|
for (int i = 0; i < offers.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var v = FoeView(offers[i].Enemy);
|
|
|
|
|
|
v.Update(dt, dt, _foeDummy, 0, AppSettings.ReduceMotion);
|
|
|
|
|
|
if (!v.Is3D) continue;
|
|
|
|
|
|
while (_cardRt.Count <= i) _cardRt.Add(new RenderTarget2D(gd, CARD_W, CARD_H, false, SurfaceFormat.Color, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents));
|
|
|
|
|
|
gd.SetRenderTarget(_cardRt[i]);
|
|
|
|
|
|
gd.Clear(Color.Transparent);
|
|
|
|
|
|
fx.View = Matrix.CreateTranslation(0, -Stage.FloorY, 0) * Matrix.CreateScale(0.9f) * Matrix.CreateTranslation(CARD_W / 2f, CARD_H - 10, 0);
|
|
|
|
|
|
fx.Projection = Matrix.CreateOrthographicOffCenter(0, CARD_W, CARD_H, 0, 0, 1);
|
|
|
|
|
|
gd.BlendState = BlendState.AlphaBlend; gd.DepthStencilState = DepthStencilState.None; gd.RasterizerState = RasterizerState.CullNone;
|
|
|
|
|
|
v.DrawBody(gd, fx, _foeDummy, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
gd.SetRenderTargets(previous);
|
|
|
|
|
|
gd.Clear(Color.Black);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ── Takt ────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
public void Update(float dt, Input input, Matrix ui)
|
|
|
|
|
|
{
|
|
|
|
|
|
_t += dt;
|
|
|
|
|
|
_toastAge += dt;
|
|
|
|
|
|
_ui.Begin(input, ui);
|
|
|
|
|
|
_game.Tick(dt); // Training, Einnahmen, Erholung
|
2026-11-09 16:13:28 +01:00
|
|
|
|
float heroX = Homecoming ? UpdateHomecoming(dt, input) : HERO_X; // Heimkehr: läuft von links herein
|
|
|
|
|
|
_hero.Update(dt, dt, _dummy, heroX, AppSettings.ReduceMotion);
|
2026-11-09 21:43:38 +01:00
|
|
|
|
_stage.Cam.CinePivot = new Vector3(HERO_X, Stage.FloorY - Stage.FigH * 0.55f, 0);
|
|
|
|
|
|
if ((_cineIn -= dt) <= 0 && _drawerK < 0.02f && _overlay == Overlay.None && !Modal)
|
|
|
|
|
|
{
|
|
|
|
|
|
_cineIn = 25;
|
|
|
|
|
|
_stage.Cam.Shot(new Camera.Key(0, 0, 0, 0), new Camera.Key(3, 38, -6, 900), new Camera.Key(6.5f, 0, 0, 0)); // sanfte Fahrt um den Gladiator
|
|
|
|
|
|
}
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
_stage.Cam.Update(dt, Camera.W / 2 - 1800, Camera.W / 2 + 1800, AppSettings.ReduceMotion); // weiter weg, ruhige Drift
|
2026-11-09 21:43:38 +01:00
|
|
|
|
_crowd.Alpha = _stage.Cam.FrontAlpha;
|
|
|
|
|
|
Span<Vector3> pts = stackalloc Vector3[] { new(HERO_X - 80, Stage.FloorY - Stage.FigH * 1.1f, 0), new(HERO_X + 80, Stage.FloorY + 12, 0) };
|
|
|
|
|
|
_stage.Cam.KeepInView(pts, _stage.LastScale, _stage.LastOffset, _stage.LastW, _stage.LastH, dt);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
_lastDt = dt;
|
2026-11-08 14:53:03 +01:00
|
|
|
|
UpdateAdventure();
|
2026-11-08 12:57:20 +01:00
|
|
|
|
_crowd.Update(dt);
|
|
|
|
|
|
_fx.Motes(AppSettings.ReduceMotion ? 0 : 50, Camera.W, Camera.H);
|
|
|
|
|
|
_fx.Update(dt);
|
2026-11-08 18:43:05 +01:00
|
|
|
|
if (_drawer != _drawerSound) { _drawerSound = _drawer; SoundManager.PlayDrawer(); }
|
2026-11-08 12:57:20 +01:00
|
|
|
|
float target = _drawer == Drawer.None ? 0 : 1;
|
|
|
|
|
|
_drawerK += (target - _drawerK) * (1 - MathF.Exp(-dt * 14));
|
2026-11-09 16:13:28 +01:00
|
|
|
|
// Feldzugkarte / Reise: Esc geht eine Stufe zurück; ein Bericht oder Ereignis schließt beide
|
|
|
|
|
|
if (_overlay != Overlay.None)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Modal) _overlay = Overlay.None;
|
|
|
|
|
|
else if (input.Pressed(Microsoft.Xna.Framework.Input.Keys.Escape))
|
|
|
|
|
|
{ _overlay = _overlay == Overlay.Journey ? Overlay.Map : Overlay.None; input.PrevKeys = input.Keys; }
|
|
|
|
|
|
if (_overlay == Overlay.Journey) UpdateJourney(dt);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (input.Pressed(Microsoft.Xna.Framework.Input.Keys.Escape) && _drawer != Drawer.None) { _drawer = Drawer.None; input.PrevKeys = input.Keys; }
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawerOpen => _drawer != Drawer.None;
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
float _lastDt = 1 / 60f;
|
2026-11-09 21:43:38 +01:00
|
|
|
|
float _cineIn = 12;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
/// Testlauf: Schublade öffnen ("none", "gladiator", "skills", "ludus", "expedition", "hall"), sofort ganz offen.
|
|
|
|
|
|
public void DevOpen(string d)
|
2026-11-08 12:57:20 +01:00
|
|
|
|
{
|
2026-11-09 16:13:28 +01:00
|
|
|
|
_drawer = d switch { "gladiator" or "skills" => Drawer.Gladiator, "ludus" => Drawer.Ludus, "hall" => Drawer.Hall, _ => Drawer.None };
|
|
|
|
|
|
_overlay = d == "expedition" ? Overlay.Map : Overlay.None;
|
|
|
|
|
|
if (d == "journey") OpenJourney();
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
_page = d == "skills" ? Page.Skills : Page.Gear;
|
|
|
|
|
|
_drawerK = _drawer == Drawer.None ? 0 : 1;
|
|
|
|
|
|
if (d == "gladiator" && _game.Inventory.Count > 0) _sel = _game.Inventory[0].Id;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ── Zeichnen ────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
public void Draw(GraphicsDevice gd, SpriteBatch sb, BasicEffect fx, float scale, Vector2 offset)
|
|
|
|
|
|
{
|
|
|
|
|
|
EnsureArena();
|
|
|
|
|
|
D.UiScale = scale;
|
|
|
|
|
|
var ui = Matrix.CreateScale(scale) * Matrix.CreateTranslation(offset.X, offset.Y, 0);
|
2026-11-09 16:13:28 +01:00
|
|
|
|
// Vollbild: Reise in 3D oder Feldzugkarte
|
|
|
|
|
|
if (_overlay == Overlay.Journey && _game.Away != null) { DrawJourney(gd, sb, fx, scale, offset); return; }
|
|
|
|
|
|
if (_overlay == Overlay.Map)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, ui);
|
|
|
|
|
|
DrawMap(sb);
|
|
|
|
|
|
sb.End();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2026-11-08 12:57:20 +01:00
|
|
|
|
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
var sw = System.Diagnostics.Stopwatch.StartNew();
|
|
|
|
|
|
RenderCards(gd, fx, _lastDt);
|
|
|
|
|
|
double tCards = sw.Elapsed.TotalMilliseconds;
|
|
|
|
|
|
// Arena in 3D wie im Duell: Sand, Mauer, Ränge, Licht; der Gladiator steht mit Schatten darin
|
|
|
|
|
|
_stage.Prepare(gd, scale, offset);
|
|
|
|
|
|
_stage.DrawSet(gd, sb, _t, _crowd.Excitement);
|
|
|
|
|
|
_stage.Shadows(gd, sb, 0, _hero);
|
|
|
|
|
|
_stage.FloorLight(sb, HERO_X, 900, 0.18f);
|
|
|
|
|
|
Stage3D.BeginFigures(gd);
|
|
|
|
|
|
_stage.Use(_hero);
|
|
|
|
|
|
_hero.DrawBody(gd, fx, _dummy, AppSettings.ReduceMotion);
|
|
|
|
|
|
double tStage = sw.Elapsed.TotalMilliseconds;
|
|
|
|
|
|
// oben dunkler Verlauf hinter der Kopfleiste
|
2026-11-08 12:57:20 +01:00
|
|
|
|
sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, ui);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
D.Glow(sb, new Vector2(-200, Camera.H / 2), new Vector2(900, 2000), Color.Black * 0.55f);
|
|
|
|
|
|
D.Glow(sb, new Vector2(Camera.W + 200, Camera.H / 2), new Vector2(900, 2000), Color.Black * 0.45f);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
sb.End();
|
|
|
|
|
|
|
|
|
|
|
|
sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, ui * Matrix.Identity);
|
|
|
|
|
|
_crowd.Draw(sb, AppSettings.ReduceMotion);
|
|
|
|
|
|
sb.End();
|
|
|
|
|
|
sb.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.LinearClamp, null, null, null, ui);
|
|
|
|
|
|
_fx.DrawAdd(sb);
|
|
|
|
|
|
sb.End();
|
|
|
|
|
|
|
|
|
|
|
|
sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, ui);
|
|
|
|
|
|
DrawTopBar(sb);
|
2026-11-08 14:53:03 +01:00
|
|
|
|
DrawBuffs(sb);
|
|
|
|
|
|
if (Modal) DrawModal(sb); // Bericht oder Ereignis: darunter nichts anklickbar
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_drawerK < 0.98f) { if (_game.Away is { } away) DrawAwayCard(sb, away); else DrawOffers(sb); }
|
|
|
|
|
|
DrawDrawerButtons(sb);
|
|
|
|
|
|
DrawToast(sb);
|
|
|
|
|
|
if (_drawerK > 0.01f) DrawDrawer(sb);
|
|
|
|
|
|
}
|
2026-11-08 12:57:20 +01:00
|
|
|
|
sb.End();
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
// Profil (nur Testlauf --perf): Anteile der Hub-Zeichenzeit
|
|
|
|
|
|
if (DevShot.Active && ++_profN % 120 == 0)
|
|
|
|
|
|
DevShot.Log($"hub profile: cards {tCards:0.00} ms, stage {tStage - tCards:0.00} ms, ui {sw.Elapsed.TotalMilliseconds - tStage:0.00} ms, drawer {_drawerK:0.0}");
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
int _profN;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
|
|
|
|
|
|
static int PingPong(double t, int n)
|
|
|
|
|
|
{
|
|
|
|
|
|
int period = 2 * (n - 1), i = (int)t % period;
|
|
|
|
|
|
return i < n ? i : period - i;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ── Kopfleiste ──────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
void DrawTopBar(SpriteBatch sb)
|
|
|
|
|
|
{
|
|
|
|
|
|
float x = 40;
|
|
|
|
|
|
if (Assets.Sprite(_game.Look.EmblemArt) is Texture2D em)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Draw(em, new Vector2(x + 34, 60), null, Color.White, 0, new Vector2(em.Width / 2f, em.Height / 2f), 70f / em.Width, SpriteEffects.None, 0);
|
|
|
|
|
|
x += 80;
|
|
|
|
|
|
}
|
|
|
|
|
|
D.Text(sb, Assets.Serif, 32, $"{_game.Name} · {L.t(_game.ClassDef.Key)}", new Vector2(x, 42), D.Gold);
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 20, string.Format(L.t("char.level"), _game.CharLevel), new Vector2(x, 84), D.Sand);
|
|
|
|
|
|
D.Bar(sb, new RectangleF(x + 110, 74, 300, 20), (float)(_game.CharXp / _game.CharXpToNext), (float)(_game.CharXp / _game.CharXpToNext), D.Blue);
|
|
|
|
|
|
|
|
|
|
|
|
// Denare
|
|
|
|
|
|
float gx = 860;
|
|
|
|
|
|
if (Assets.Sprite("icon_denarius") is Texture2D coin)
|
|
|
|
|
|
sb.Draw(coin, new Vector2(gx, 60), null, Color.White, 0, new Vector2(coin.Width / 2f, coin.Height / 2f), 52f / coin.Width, SpriteEffects.None, 0);
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 30, NumberFormat.Format(_game.Gold), new Vector2(gx + 36, 52), Color.White);
|
|
|
|
|
|
|
|
|
|
|
|
// Arena, Rang, Ruhm bis zum Champion
|
|
|
|
|
|
float rx = Camera.W - 40;
|
|
|
|
|
|
D.Text(sb, Assets.Serif, 28, L.t(ArenaDef.All[_game.Arena].Key), new Vector2(rx, 36), D.Gold, Align.Right);
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 18, string.Format(L.t("arena.rank"), _game.Rank + 1, Balance.RANKS_PER_ARENA), new Vector2(rx - 440, 76), D.Sand);
|
|
|
|
|
|
D.Bar(sb, new RectangleF(rx - 300, 68, 300, 18), (float)(_game.FameRun / _game.FameRequired), (float)(_game.FameRun / _game.FameRequired), D.Gold);
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 15, string.Format(L.t("arena.fame"), NumberFormat.Format(_game.FameRun), NumberFormat.Format(_game.FameRequired)),
|
|
|
|
|
|
new Vector2(rx - 150, 100), D.Dim, Align.Center);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ── Gegner zur Wahl ─────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
void DrawOffers(SpriteBatch sb)
|
|
|
|
|
|
{
|
|
|
|
|
|
var offers = _game.Offers();
|
|
|
|
|
|
float w = offers.Count > 3 ? 220 : 270, gap = 20;
|
|
|
|
|
|
float total = offers.Count * w + (offers.Count - 1) * gap, x0 = Camera.W - 60 - total, y = 170, h = 650;
|
|
|
|
|
|
bool canFight = _game.CanFight;
|
|
|
|
|
|
for (int i = 0; i < offers.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var o = offers[i];
|
|
|
|
|
|
var r = new RectangleF(x0 + i * (w + gap), y, w, h);
|
|
|
|
|
|
bool champ = o.Kind == OfferKind.Champion, hover = canFight && _ui.Hover(r);
|
|
|
|
|
|
var accent = champ ? D.Gold : o.Kind == OfferKind.Hard ? D.Red : o.Kind == OfferKind.Easy ? D.Green : D.Sand;
|
|
|
|
|
|
Ui.Panel(sb, r, hover ? accent : champ ? D.Gold : D.Border, 0.84f);
|
|
|
|
|
|
if (champ) D.Glow(sb, r.Center, new Vector2(w * 1.6f, h * 1.2f), D.Gold * (0.08f + 0.04f * MathF.Sin((float)_t * 3)));
|
|
|
|
|
|
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 18, L.t(o.Key).ToUpperInvariant(), new Vector2(r.Center.X, r.Y + 24), accent, Align.Center);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
// Gegner: 3D-Figur wie im Duell (sonst das Bild)
|
2026-11-08 12:57:20 +01:00
|
|
|
|
string art = o.Enemy.Art ?? Art.Enemy(o.Enemy.NameKey);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
if (i < _cardRt.Count && FoeView(o.Enemy).Is3D)
|
|
|
|
|
|
{
|
|
|
|
|
|
var rt = _cardRt[i];
|
|
|
|
|
|
float k = 330f / CARD_H;
|
|
|
|
|
|
D.Glow(sb, new Vector2(r.Center.X, r.Y + 352), new Vector2(w * 0.9f, 40), Color.Black * 0.5f);
|
|
|
|
|
|
sb.Draw(rt, new Vector2(r.Center.X, r.Y + 352), null, Color.White, 0, new Vector2(CARD_W / 2f, CARD_H - 10), k, SpriteEffects.None, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (Assets.Sprite(art) is Texture2D t)
|
2026-11-08 12:57:20 +01:00
|
|
|
|
{
|
|
|
|
|
|
float k = 300f / t.Height;
|
|
|
|
|
|
sb.Draw(t, new Vector2(r.Center.X, r.Y + 350), null, Color.White, 0, new Vector2(t.Width / 2f, Stage.Feet), k * 1.0f, SpriteEffects.FlipHorizontally, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
D.Text(sb, Assets.Serif, 24, o.Enemy.Name, new Vector2(r.Center.X, r.Y + 372), Color.White, Align.Center);
|
|
|
|
|
|
|
|
|
|
|
|
// Aussichten nach Kampfkraft
|
|
|
|
|
|
double ratio = _game.DuelRatio(o.Enemy);
|
|
|
|
|
|
var (odds, oc) = ratio >= 1.3 ? ("hub.odds.easy", D.Green) : ratio >= 0.85 ? ("hub.odds.even", D.Gold) : ("hub.odds.hard", D.Red);
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 17, L.t(odds), new Vector2(r.Center.X, r.Y + 404), oc, Align.Center);
|
|
|
|
|
|
|
|
|
|
|
|
// Lohn
|
|
|
|
|
|
var (gold, fame, xp) = _game.RewardPreview(o);
|
|
|
|
|
|
float ly = r.Y + 440;
|
|
|
|
|
|
Line(sb, r, ly, L.t("res.gold"), "+" + NumberFormat.Format(gold));
|
|
|
|
|
|
Line(sb, r, ly + 26, L.t("res.fame"), "+" + NumberFormat.Format(fame));
|
|
|
|
|
|
Line(sb, r, ly + 52, "XP", "+" + NumberFormat.Format(xp)); // i18n-ok
|
|
|
|
|
|
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
// Knopf
|
|
|
|
|
|
var fb = new RectangleF(r.X + 16, r.Bottom - 62, r.Width - 32, 48);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
if (_ui.Button(sb, fb, L.t(champ ? "arena.challenge" : "hub.fight"), canFight, selected: champ, size: champ ? 18 : 22, accent: accent))
|
|
|
|
|
|
Chosen = o;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!canFight && _game.Recovery > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var r = new RectangleF(x0, y + h / 2 - 50, total, 100);
|
|
|
|
|
|
D.Rect(sb, r, Color.Black * 0.7f);
|
|
|
|
|
|
D.Text(sb, Assets.Serif, 34, string.Format(L.t("arena.recover"), NumberFormat.Duration(_game.Recovery)), r.Center, D.Red, Align.Center);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void Line(SpriteBatch sb, RectangleF r, float y, string label, string value)
|
|
|
|
|
|
{
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 17, label, new Vector2(r.X + 20, y), D.Dim);
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 18, value, new Vector2(r.Right - 20, y), D.Sand, Align.Right);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ── Ergebnis-Meldung ────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
/// Stand vor einem Kampf (für die Meldung danach).
|
|
|
|
|
|
public (double Gold, double Fame, double Xp, int Level, int Items) Snapshot() =>
|
|
|
|
|
|
(_game.Gold, _game.FameRun, _game.CharXp, _game.CharLevel, _game.Inventory.Count);
|
|
|
|
|
|
|
|
|
|
|
|
public string[] ResultLines((double Gold, double Fame, double Xp, int Level, int Items) before, bool won)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!won) return new[] { L.t("duel.lose"), L.t("hub.lost") };
|
|
|
|
|
|
var lines = new List<string>
|
|
|
|
|
|
{
|
|
|
|
|
|
L.t("duel.win"),
|
|
|
|
|
|
string.Format(L.t("hub.won"), NumberFormat.Format(_game.Gold - before.Gold), NumberFormat.Format(_game.FameRun - before.Fame))
|
|
|
|
|
|
};
|
|
|
|
|
|
if (_game.CharLevel > before.Level) lines.Add(string.Format(L.t("ludus.levelup"), _game.CharLevel));
|
|
|
|
|
|
if (_game.Inventory.Count > before.Items && _game.Inventory.Count > 0)
|
|
|
|
|
|
lines.Add(string.Format(L.t("hub.loot"), ItemName(_game.Inventory[^1])));
|
|
|
|
|
|
return lines.ToArray();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DrawToast(SpriteBatch sb)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_toastAge > 4.5 || _toast.Length == 0 || _drawerK > 0.05f) return;
|
|
|
|
|
|
float a = (float)Math.Clamp(Math.Min(_toastAge * 4, (4.5 - _toastAge) * 2), 0, 1);
|
|
|
|
|
|
float pop = 1 + 0.25f * MathF.Max(0, 1 - (float)_toastAge * 5);
|
|
|
|
|
|
var c = new Vector2(520, 220);
|
|
|
|
|
|
D.Glow(sb, c + new Vector2(0, 40), new Vector2(900, 320), Color.Black * (0.6f * a));
|
|
|
|
|
|
D.Text(sb, Assets.Serif, 64, _toast[0], c, _toastColor * a, Align.Center, pop);
|
|
|
|
|
|
for (int i = 1; i < _toast.Length; i++)
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 24, _toast[i], c + new Vector2(0, 40 + i * 34), Color.White * a, Align.Center);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ── Schubladen ──────────────────────────────────────────────
|
|
|
|
|
|
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
/// Ehrenhalle erst, wenn es dort etwas gibt (nach der ersten Freiheit).
|
|
|
|
|
|
bool HallOpen => _game.Freedoms > 0 || _game.Legends.Count > 0;
|
|
|
|
|
|
|
2026-11-08 12:57:20 +01:00
|
|
|
|
void DrawDrawerButtons(SpriteBatch sb)
|
|
|
|
|
|
{
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
float y = Camera.H - 92, x = 40;
|
|
|
|
|
|
bool Tab(string text, Drawer d, float w, Color? accent = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool hit = _ui.Button(sb, new RectangleF(x, y, w, 60), text, selected: _drawer == d, size: 22, accent: accent);
|
|
|
|
|
|
x += w + 16;
|
|
|
|
|
|
return hit;
|
|
|
|
|
|
}
|
|
|
|
|
|
// Gladiator: freie Attribut- und Fähigkeitspunkte zusammen
|
|
|
|
|
|
int pts = _game.AttrPoints + _game.LearnablePoints;
|
|
|
|
|
|
if (Tab(pts > 0 ? $"{L.t("ludus.gladiator")} ({pts})" : L.t("ludus.gladiator"), Drawer.Gladiator, 260, pts > 0 ? D.Gold : null)) // i18n-ok
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_drawer == Drawer.Gladiator) _drawer = Drawer.None;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
_drawer = Drawer.Gladiator;
|
|
|
|
|
|
// offene Punkte: gleich die passende Seite
|
|
|
|
|
|
if (_game.AttrPoints == 0 && _game.LearnablePoints > 0) _page = Page.Skills;
|
|
|
|
|
|
else if (_game.AttrPoints > 0) _page = Page.Gear;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Tab(L.t("main.ludus"), Drawer.Ludus, 260)) _drawer = _drawer == Drawer.Ludus ? Drawer.None : Drawer.Ludus;
|
2026-11-08 14:53:03 +01:00
|
|
|
|
string ex = _game.Away != null ? $"{L.t("exp.button")} · {NumberFormat.Duration(_game.Away.Left)}" : L.t("exp.button"); // i18n-ok
|
2026-11-09 16:13:28 +01:00
|
|
|
|
if (Tab(ex, Drawer.Expedition, 300, _game.Away != null ? D.Gold : null)) { _drawer = Drawer.None; _overlay = Overlay.Map; SoundManager.PlayDrawer(); } // Feldzugkarte
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
if (HallOpen)
|
|
|
|
|
|
{
|
|
|
|
|
|
int open = _game.Legends.Count(l => !_game.LegendsBeaten.Contains(l.Number));
|
|
|
|
|
|
if (Tab(string.Format(L.t("hall.button"), _game.Legends.Count), Drawer.Hall, 300, open > 0 || _game.GodFavor > 0 ? D.Purple : null))
|
|
|
|
|
|
_drawer = _drawer == Drawer.Hall ? Drawer.None : Drawer.Hall;
|
|
|
|
|
|
}
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DrawDrawer(SpriteBatch sb)
|
|
|
|
|
|
{
|
2026-11-08 18:43:05 +01:00
|
|
|
|
// alle Reiter gleich: Inhalt links (1300 breit), Anleitung rechts daneben, beides gleitet herein
|
|
|
|
|
|
const float W = 1300, GUIDE = 500;
|
|
|
|
|
|
float x = -(W + GUIDE + 20) + (W + GUIDE + 60) * Ease(_drawerK);
|
|
|
|
|
|
var r = new RectangleF(x, 140, W, Camera.H - 260);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
Ui.Panel(sb, r, D.Gold, 0.94f);
|
2026-11-08 18:43:05 +01:00
|
|
|
|
DrawGuide(sb, new RectangleF(r.Right + 20, r.Y, GUIDE, r.Height));
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
if (_drawer == Drawer.Gladiator)
|
|
|
|
|
|
{
|
|
|
|
|
|
// zwei Seiten: Werte & Ausrüstung | Fähigkeiten
|
|
|
|
|
|
int sp = _game.LearnablePoints;
|
|
|
|
|
|
if (_ui.Button(sb, new RectangleF(r.X + 30, r.Y + 20, 300, 50), L.t("char.page.gear"), selected: _page == Page.Gear, size: 21,
|
|
|
|
|
|
accent: _game.AttrPoints > 0 ? D.Gold : null)) _page = Page.Gear;
|
|
|
|
|
|
if (_ui.Button(sb, new RectangleF(r.X + 342, r.Y + 20, 300, 50), sp > 0 ? $"{L.t("char.skills")} ({sp})" : L.t("char.skills"), // i18n-ok
|
|
|
|
|
|
selected: _page == Page.Skills, size: 21, accent: sp > 0 ? D.Gold : null)) _page = Page.Skills;
|
|
|
|
|
|
if (_page == Page.Skills) DrawSkills(sb, r); else DrawGladiator(sb, r);
|
|
|
|
|
|
}
|
2026-11-08 12:57:20 +01:00
|
|
|
|
else if (_drawer == Drawer.Ludus) DrawLudus(sb, r);
|
2026-11-08 13:29:26 +01:00
|
|
|
|
else if (_drawer == Drawer.Hall) DrawHall(sb, r);
|
2026-11-09 16:13:28 +01:00
|
|
|
|
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static float Ease(float k) => 1 - (1 - k) * (1 - k);
|
|
|
|
|
|
|
|
|
|
|
|
void DrawGladiator(SpriteBatch sb, RectangleF r)
|
|
|
|
|
|
{
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
float x = r.X + 30, y = r.Y + 100;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
// Werte mit Attributpunkten, Kampfkraft rechts in derselben Zeile
|
2026-11-08 12:57:20 +01:00
|
|
|
|
D.Text(sb, Assets.SansBold, 20, string.Format(L.t("char.points"), _game.AttrPoints), new Vector2(x, y), _game.AttrPoints > 0 ? D.Gold : D.Dim);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
D.Text(sb, Assets.SansBold, 20, string.Format(L.t("char.power"), NumberFormat.Format(_game.Power())), new Vector2(x + 700, y), D.Sand, Align.Right);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var s = (Stat)i;
|
|
|
|
|
|
float ry = y + 44 + i * 44;
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 21, L.t(TextKeys.Of(s)), new Vector2(x, ry), D.Sand);
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 22, _game.Level(s).ToString(NumberFormat.Culture), new Vector2(x + 300, ry), Color.White, Align.Right);
|
|
|
|
|
|
if (_ui.Button(sb, new RectangleF(x + 320, ry - 17, 44, 34), "+", _game.AttrPoints > 0, size: 22)) // i18n-ok
|
|
|
|
|
|
_game.SpendPoint(s);
|
|
|
|
|
|
}
|
|
|
|
|
|
// Kampfwerte
|
|
|
|
|
|
var c = _game.PlayerCombat();
|
|
|
|
|
|
float cx = x + 420;
|
|
|
|
|
|
Stat2(sb, cx, y + 44, L.t("ludus.hp"), NumberFormat.Format(c.MaxHp));
|
|
|
|
|
|
Stat2(sb, cx, y + 88, L.t("ludus.damage"), NumberFormat.Format(c.Damage));
|
|
|
|
|
|
Stat2(sb, cx, y + 132, L.t("ludus.crit"), NumberFormat.Percent(c.Crit));
|
|
|
|
|
|
|
|
|
|
|
|
// Ausrüstung
|
|
|
|
|
|
y += 240;
|
|
|
|
|
|
if (_ui.Button(sb, new RectangleF(x + 480, y - 22, 220, 44), L.t("char.equipbest"), size: 18))
|
|
|
|
|
|
{
|
2026-11-08 18:43:05 +01:00
|
|
|
|
if (_game.EquipBest() > 0) SoundManager.PlayEquip();
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var slot = (ItemSlot)i;
|
|
|
|
|
|
var it = _game.Equipped[i];
|
|
|
|
|
|
float ry = y + 40 + i * 74;
|
|
|
|
|
|
var row = new RectangleF(x, ry, 700, 66);
|
|
|
|
|
|
D.Rect(sb, row, new Color(30, 22, 15) * 0.9f);
|
|
|
|
|
|
D.Frame(sb, row, it == null ? D.Border : RarityColor(it.Rarity), 2);
|
|
|
|
|
|
if (it != null && Assets.Sprite(it.Def.Icon) is Texture2D icon)
|
|
|
|
|
|
sb.Draw(icon, new Vector2(row.X + 36, row.Center.Y), null, Color.White, 0, new Vector2(icon.Width / 2f, icon.Height / 2f), 56f / icon.Width, SpriteEffects.None, 0);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
string slotText = L.t("slot." + slot.ToString().ToLowerInvariant());
|
|
|
|
|
|
if (_game.SlotLevels[i] > 0) slotText += " · " + string.Format(L.t("forge.level"), _game.SlotLevels[i]); // i18n-ok
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 16, slotText, new Vector2(row.X + 76, row.Y + 18), D.Dim);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
D.Text(sb, Assets.SansBold, 20, it == null ? "–" : ItemName(it), new Vector2(row.X + 76, row.Y + 44), it == null ? D.Dim : RarityColor(it.Rarity)); // i18n-ok
|
|
|
|
|
|
if (it != null && _sel == it.Id) D.Frame(sb, row, Color.White, 3);
|
3D-Arena (Duell, Hub, Freiheit, Erstellung, Bestenliste), Retiarius beidhändig, Waffen je Klasse, Einführung, Willkommen, weniger Reiter, Wirtschaft ohne Taberna, Kantenglättung, Leuchten, weiche Schatten, Gamepad, Absturz-Protokoll
Stand von main 20cd8ba2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:24:20 +01:00
|
|
|
|
// Schmied: diesen Platz verstärken (gilt für jedes Stück, das hier liegt)
|
|
|
|
|
|
double cost = _game.UpgradeSlotCost(slot);
|
|
|
|
|
|
var fr = new RectangleF(row.Right - 214, row.Y + 11, 200, 44);
|
|
|
|
|
|
if (_ui.Button(sb, fr, string.Format(L.t("btn.forge"), NumberFormat.Format(cost)), _game.Gold >= cost, size: 17))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_game.UpgradeSlot(slot)) SoundManager.PlayLevelUp();
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (it != null && !fr.Contains(_ui.Mouse) && _ui.Hit(row)) _sel = it.Id;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
DrawInventory(sb, new RectangleF(r.X + 790, r.Y + 30, 430, r.Height - 60));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void Stat2(SpriteBatch sb, float x, float y, string label, string value)
|
|
|
|
|
|
{
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 19, label, new Vector2(x, y), D.Dim);
|
|
|
|
|
|
D.Text(sb, Assets.SansBold, 21, value, new Vector2(x + 320, y), Color.White, Align.Right);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-10 10:47:49 +01:00
|
|
|
|
/// Ludus: Wert zum Üben gewählt (das Spiel startet die Übung).
|
|
|
|
|
|
public Stat? ChosenTraining;
|
|
|
|
|
|
|
2026-11-08 12:57:20 +01:00
|
|
|
|
void DrawLudus(SpriteBatch sb, RectangleF r)
|
|
|
|
|
|
{
|
|
|
|
|
|
float x = r.X + 30, y = r.Y + 40;
|
|
|
|
|
|
D.Text(sb, Assets.Serif, 30, L.t("main.ludus"), new Vector2(x, y), D.Gold);
|
2026-11-10 10:47:49 +01:00
|
|
|
|
// Trainingsplatz: Kraft (Energie) und vier Übungen
|
|
|
|
|
|
int full = (int)_game.TrainEnergy;
|
|
|
|
|
|
for (int i = 0; i < Balance.TRAIN_ENERGY_MAX; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var pip = new RectangleF(r.Right - 60 - (Balance.TRAIN_ENERGY_MAX - i) * 34, y + 6, 26, 26);
|
|
|
|
|
|
D.Rect(sb, pip, i < full ? D.Gold : new Color(60, 46, 30));
|
|
|
|
|
|
D.Frame(sb, pip, D.Border, 2);
|
|
|
|
|
|
}
|
|
|
|
|
|
string energy = _game.TrainEnergyNextIn > 0 ? string.Format(L.t("ludus.train.next"), NumberFormat.Duration(_game.TrainEnergyNextIn)) : L.t("ludus.train.full");
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 17, energy, new Vector2(r.Right - 60 - Balance.TRAIN_ENERGY_MAX * 34 - 16, y + 10), D.Sand, Align.Right);
|
|
|
|
|
|
y += 46;
|
|
|
|
|
|
D.TextWrap(sb, Assets.Sans, 18, L.t("ludus.train.intro"), new RectangleF(x, y, r.Width - 60, 50), D.Dim);
|
|
|
|
|
|
y += 50;
|
|
|
|
|
|
float bw = (r.Width - 60 - 3 * 12) / 4;
|
|
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var st = (Stat)i;
|
|
|
|
|
|
var b = new RectangleF(x + i * (bw + 12), y, bw, 74);
|
|
|
|
|
|
if (_ui.Button(sb, b, L.t(TextKeys.Of(st)), _game.CanTrain, size: 20, accent: D.Gold) && _game.CanTrain) { ChosenTraining = st; SoundManager.PlayClick(); }
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 15, string.Format(L.t("ludus.train.per"), NumberFormat.Format(_game.TrainXpPerAction(st))), new Vector2(b.Center.X, b.Bottom + 14), D.Dim, Align.Center);
|
|
|
|
|
|
}
|
|
|
|
|
|
y += 112;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
foreach (var u in UpgradeDef.All)
|
|
|
|
|
|
{
|
2026-11-10 10:47:49 +01:00
|
|
|
|
var row = new RectangleF(x, y, r.Width - 60, 72);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
D.Rect(sb, row, new Color(30, 22, 15) * 0.9f);
|
|
|
|
|
|
D.Frame(sb, row, D.Border, 2);
|
|
|
|
|
|
if (Assets.Sprite(Art.Upgrade(u)) is Texture2D icon)
|
|
|
|
|
|
sb.Draw(icon, new Vector2(row.X + 42, row.Center.Y), null, Color.White, 0, new Vector2(icon.Width / 2f, icon.Height / 2f), 64f / icon.Width, SpriteEffects.None, 0);
|
|
|
|
|
|
int level = _game.UpgradeLevel(u.Id);
|
2026-11-10 10:47:49 +01:00
|
|
|
|
D.Text(sb, Assets.SansBold, 21, L.t(u.Key), new Vector2(row.X + 86, row.Y + 20), Color.White);
|
|
|
|
|
|
D.Text(sb, Assets.Sans, 17, string.Format(L.t("ludus.level"), level), new Vector2(row.X + 86, row.Y + 50), D.Sand);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
string desc = u.Stat is Stat s ? string.Format(L.t("upgrade.trainer.desc"), L.t(TextKeys.Of(s))) : L.t(u.Key + ".desc");
|
2026-11-10 10:47:49 +01:00
|
|
|
|
D.TextWrap(sb, Assets.Sans, 17, desc, new RectangleF(row.X + 330, row.Y + 8, row.Width - 330 - 260, 60), D.Dim);
|
2026-11-08 12:57:20 +01:00
|
|
|
|
double cost = _game.UpgradeCost(u.Id);
|
2026-11-10 10:47:49 +01:00
|
|
|
|
if (_ui.Button(sb, new RectangleF(row.Right - 240, row.Y + 12, 224, 48), string.Format(L.t("btn.buy"), NumberFormat.Format(cost)), _game.Gold >= cost, size: 19))
|
2026-11-08 12:57:20 +01:00
|
|
|
|
if (_game.Buy(u.Id)) SoundManager.PlayPurchase();
|
2026-11-10 10:47:49 +01:00
|
|
|
|
y += 78;
|
2026-11-08 12:57:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string ItemName(Item it) => L.t(it.Def.Key) + (it.Level > 0 ? $" +{it.Level}" : ""); // i18n-ok
|
|
|
|
|
|
|
|
|
|
|
|
static Color RarityColor(Rarity r) => r switch
|
|
|
|
|
|
{
|
|
|
|
|
|
Rarity.Good => new Color(110, 200, 90), Rarity.Rare => new Color(90, 160, 240),
|
|
|
|
|
|
Rarity.Epic => new Color(185, 110, 235), Rarity.Legendary => new Color(250, 160, 40),
|
|
|
|
|
|
_ => new Color(190, 175, 150)
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|