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

@@ -38,7 +38,7 @@ namespace GladiatorIdle.Arena
Mesh3D? _jGround, _jPath, _jStone;
string? _jRegion;
float _jX;
int _jLine = -1; float _jLineT;
int _jLine = -1, _jLogShown; float _jLineT;
/// Testlauf: Tageszeit (0 Morgen, 0,25 Mittag, 0,5 Abend, 0,75 Nacht) statt aus der Reisezeit.
public float? DevDayPhase;
// feste Puffer (keine neuen Objekte je Bild)
@@ -54,6 +54,10 @@ namespace GladiatorIdle.Arena
_jHero ??= Assets.Has(hero) ? new FighterView(hero, 0.5f, _game.Look.Color) : new FighterView(Art.Fighter(_game.Class), 0.5f);
_jCam.FollowX = 300; _jCam.FollowZoom = 1.0f;
_jCam.Center = new Vector2(300, Camera.H / 2 + 40);
_jCam.StopCine(); _jCam.Ring = null;
_enc = EncKind.None; _encDelay = -1; _encFigs.Clear(); _encMesh = null; _encStopped = false;
_jShotT = 5; _jShotKind = 3;
_jDummy.Set(DuelState.Ready);
SoundManager.PlayDrawer();
}
@@ -61,10 +65,15 @@ namespace GladiatorIdle.Arena
{
if (_game.Away is not { } away) { _overlay = Overlay.Map; return; }
bool calm = AppSettings.ReduceMotion;
_jX += WALK_SPEED * dt;
bool hold = UpdateEncounter(dt, calm);
if (!hold) _jX += WALK_SPEED * dt;
_jDummy.StateTime += dt;
_jHero!.Update(dt, dt, _jDummy, _jX, calm);
_jCam.FollowX = _jX + 260;
if (!hold) _jCam.CinePivot = new Vector3(_jX, Stage.FloorY - Stage.FigH * 0.6f, 0);
UpdateJourneyCamera(dt, calm);
_jCam.Update(dt, _jX, _jX, calm);
KeepJourneyInView(dt);
_jfx.Calm = calm;
_jfx.Update(dt);
if (_jRegion != away.Region) BuildJourney(away.Region);
@@ -80,8 +89,8 @@ namespace GladiatorIdle.Arena
Mesh3D Grid(string tex, Vector3 tint, float z0, float z1, float y, int nz)
{
var m = new Mesh3D { Tex = Assets.Sprite(tex, "jpg"), Wrap = true, Tint = tint };
const int NX = 30;
float x0 = -4200, x1 = 4200;
const int NX = 44;
float x0 = -6600, x1 = 6600;
for (int i = 0; i < NX; i++)
for (int k = 0; k < nz; k++)
{
@@ -94,7 +103,7 @@ namespace GladiatorIdle.Arena
m.Freeze();
return m;
}
_jGround = Grid(land.Ground, land.GroundTint, -3000, 900, floor, 10);
_jGround = Grid(land.Ground, land.GroundTint, -5000, 5000, floor, 24); // auch hinter der Kamera (360°-Fahrten)
_jPath = Grid(land.Path, land.PathTint, -230, 150, floor - 0.6f, 2);
// Meilenstein
_jStone = new Mesh3D { Tex = Assets.Pixel };
@@ -140,6 +149,7 @@ namespace GladiatorIdle.Arena
bool calm = AppSettings.ReduceMotion;
int vw = gd.Viewport.Width, vh = gd.Viewport.Height;
_jScale = scale; _jOff = offset; _jVw = vw; _jVh = vh;
var v3 = _jCam.View3(); var p3 = _jCam.Proj3(scale, offset, vw, vh);
var ui = Matrix.CreateScale(scale) * Matrix.CreateTranslation(offset.X, offset.Y, 0);
_jFx ??= new BasicEffect(gd) { TextureEnabled = true, VertexColorEnabled = true, PreferPerPixelLighting = true };
@@ -150,12 +160,13 @@ namespace GladiatorIdle.Arena
float camX = _jCam.Center.X;
// fernes Regionsbild (gespiegelt wiederholt, langsamer als der Weg: Parallaxe)
if (Picture(reg.Art) is Texture2D pic)
float picA = _jCam.PlaneAlpha; // Bild nur im Blick nach vorn, beim Drehen in den Nebel ausblenden
if (picA > 0.01f && Picture(reg.Art) is Texture2D pic)
{
const float Z = -5200, W = 7000;
float h = W * pic.Height / pic.Width, bottom = Stage.FloorY + 900, top = bottom - h * 1.15f;
float xl = camX - 9000, xr = camX + 9000, shift = camX * 0.8f;
var c = new Color(sky * (0.92f - 0.55f * night));
var c = new Color(Vector3.Lerp(fog, sky * (0.92f - 0.55f * night), picA));
float u0 = (xl - shift) / W, u1 = (xr - shift) / W;
_jBack[0] = new(new Vector3(xl, top, Z), c, new Vector2(u0, 0)); _jBack[1] = new(new Vector3(xr, top, Z), c, new Vector2(u1, 0));
_jBack[2] = new(new Vector3(xr, bottom, Z), c, new Vector2(u1, 1)); _jBack[3] = _jBack[0]; _jBack[4] = _jBack[2];
@@ -192,7 +203,7 @@ namespace GladiatorIdle.Arena
}
// Meilensteine alle 4 Felder
_jFx.Texture = Assets.Pixel; _jFx.DiffuseColor = Vector3.One;
int c0 = (int)MathF.Floor((camX - 4200) / CELL), c1 = (int)MathF.Ceiling((camX + 4200) / CELL);
int c0 = (int)MathF.Floor((camX - 5600) / CELL), c1 = (int)MathF.Ceiling((camX + 5600) / CELL);
for (int cell = c0; cell <= c1; cell++)
if (cell % 4 == 0)
{
@@ -205,7 +216,7 @@ namespace GladiatorIdle.Arena
}
// Bäume, Büsche, Felsen: je Feld fest ausgewürfelt
foreach (var key in land.Props) if (!_jProps.ContainsKey(key)) _jProps[key] = (new VertexPositionColorTexture[6 * 400], 0);
foreach (var key in land.Props) if (!_jProps.ContainsKey(key)) _jProps[key] = (new VertexPositionColorTexture[6 * 600], 0);
var counts = new Dictionary<string, int>(_jProps.Count);
foreach (var k in _jProps.Keys) counts[k] = 0;
var light = new Color(Vector3.Clamp(amb + sun * 0.55f, Vector3.Zero, Vector3.One));
@@ -222,6 +233,7 @@ namespace GladiatorIdle.Arena
float zr = (float)rng.NextDouble();
// nah am Weg nur Kleines, weiter hinten auch Bäume; selten etwas ganz vorn
float z = zr < 0.45f ? -240 - 520 * (float)rng.NextDouble() : -800 - 2000 * (float)rng.NextDouble();
if (zr > 0.8f) z = 2900 + 1600 * (float)rng.NextDouble(); // hinter der Kamera: sichtbar beim Umrunden
if (!small && z > -380) continue; // Bäume nicht direkt am Weg
float size = (small ? 170 : 720) * (0.75f + 0.55f * (float)rng.NextDouble());
int k = counts[kind];
@@ -250,11 +262,13 @@ namespace GladiatorIdle.Arena
}
}
DrawEncounterSet(gd);
// Gladiator mit Schatten; nachts mit Fackel
var look = new ArenaLook("wood", sunDir, sun, amb, fog, 1600, 6200, Vector3.One, Color.White, 0, false, 0, 1);
_jHero.UseCamera3D(v3, p3);
_jHero.SetLighting(look);
Stage3D.SoftShadows(gd, sb, sunDir, 0.42f * (1 - 0.6f * night), _jHero);
Stage3D.SoftShadows(gd, sb, sunDir, 0.42f * (1 - 0.6f * night), EncShadowFigs());
var torch = _jHero.Chest + new Vector2(70, -40);
if (night > 0.01f)
{
@@ -267,6 +281,8 @@ namespace GladiatorIdle.Arena
}
Stage3D.BeginFigures(gd);
_jHero.DrawBody(gd, fx, _jDummy, calm);
DrawEncounterFigures(gd, fx, v3, p3, look, calm);
DrawCampFire(sb, calm);
sb.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone, _jPlane);
if (night > 0.01f)
{
@@ -291,13 +307,15 @@ namespace GladiatorIdle.Arena
// Tagebuch: Zeilen nach Fortschritt, fest ausgewählt je Reise
int lines = 2 + 2 * away.Duration;
int idx = Math.Min(lines - 1, (int)(k2 * lines));
if (idx != _jLine) { _jLine = idx; _jLineT = 0; }
var order = new int[Adventures.LOG_LINES];
for (int i = 0; i < order.Length; i++) order[i] = i + 1;
new Random(away.Region.GetHashCode() ^ (away.Duration * 7919) ^ (int)(away.Chance * 1000)).Shuffle(order);
if (idx != _jLine) { _jLine = idx; _jLineT = 0; QueueEncounter(order[idx % order.Length]); }
int lineDay = day;
float la = MathHelper.Clamp(_jLineT / 1.2f, 0, 1);
string diary = $"{string.Format(L.t("exp.day"), lineDay)}: {L.t("expedition.log." + order[idx % order.Length])}"; // i18n-ok
int logNo = EncLogShown > 0 ? EncLogShown : order[idx % order.Length];
if (logNo != _jLogShown) { _jLogShown = logNo; _jLineT = 0; }
string diary = $"{string.Format(L.t("exp.day"), lineDay)}: {L.t("expedition.log." + logNo)}"; // i18n-ok
D.Text(sb, Assets.Serif, 28, diary, new Vector2(Camera.W / 2 + 2, 172), Color.Black * (0.7f * la), Align.Center);
D.Text(sb, Assets.Serif, 28, diary, new Vector2(Camera.W / 2, 170), new Color(250, 236, 205) * la, Align.Center);