Neue Töne, Reiter mit Anleitung, Klingen geeicht, Sprung, Vorschaubilder aus 3D

Stand von main 262a2009.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 18:43:05 +01:00
parent cdf0707b26
commit a08764c505
27 changed files with 454 additions and 26 deletions

View File

@@ -19,9 +19,13 @@ namespace GladiatorIdle.Arena
string _mClip = "";
float _mTime, _mBlend = 1;
bool _mFree;
float _lift; // Höhe über dem Boden (Sprungangriff)
public bool Is3D => _model != null;
/// Teamfarbe der 3D-Figur nachträglich ändern (Vorschaubilder der Erstellung).
public void SetModelColor(int color) => _model?.SetColor(color);
void InitModel(int color)
{
_model = Model3D.Load(_art);
@@ -30,6 +34,7 @@ namespace GladiatorIdle.Arena
_model ??= Model3D.Load(DefaultModel);
// Vorlage mit dunkler Haut, aber noch ohne eigenes Modell: Haut des Ersatzmodells abdunkeln
if (!own && _model != null && DarkSkin.Contains(_art)) _model.SetSkin(1);
else if (!own && _model != null && _art.StartsWith("hero_") && _art.EndsWith("_3")) _model.SetSkin(-1); // Vorlage 3: helle Haut
if (_model == null || _model.Clips.Count == 0) { _model = null; return; }
_model.Arm(_art);
_model.SetColor(color);
@@ -147,7 +152,11 @@ namespace GladiatorIdle.Arena
if (name != _mClip) { m.BeginBlend(); _mBlend = 0; _mClip = name; }
_mBlend = MathF.Min(1, _mBlend + realDt / 0.12f);
_mTime = t;
m.Pose(Clip3(name), t, loop, _mBlend, rootY: f.State == DuelState.Leap ? 0.5f : 1);
m.Pose(Clip3(name), t, loop, _mBlend, rootY: f.State == DuelState.Leap ? 0.15f : 1);
// Sprungangriff: eigene Flugkurve (der Clip springt kaum und passt nicht zur kurzen Sprungzeit)
float air = (float)Duel.LEAP_HIT + 0.08f, leapT = (float)f.StateTime;
float lift = f.State == DuelState.Leap && leapT < air ? MathF.Sin(MathF.PI * leapT / air) * 0.55f * Stage.FigH : 0;
_lift += (lift - _lift) * MathF.Min(1, realDt * 30);
}
Matrix ModelWorld(float grow)
@@ -157,7 +166,7 @@ namespace GladiatorIdle.Arena
return _fit * Matrix.CreateRotationY(yaw)
* Matrix.CreateScale(s * (1 - _sq * 0.04f), -s * (1 + _sq * 0.06f), s) // y nach unten
* Matrix.CreateRotationZ(_lean * Facing)
* Matrix.CreateTranslation(X + _off * Facing * 0.35f * Stage.Scale, Stage.FloorY, 0);
* Matrix.CreateTranslation(X + _off * Facing * 0.35f * Stage.Scale, Stage.FloorY - _lift, 0);
}
void DrawModel(GraphicsDevice gd, BasicEffect scene, Color aura, float grow)