Files
GladiatorIdle/Game/Balance.cs

113 lines
7.8 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Linq;
namespace GladiatorIdle
{
/// <summary>
/// Alle Spielzahlen an einer Stelle. Abgestimmt per <c>--playtest</c> (Bot spielt durch,
/// Zeiten je Arena stehen im Log).
/// </summary>
internal static class Balance
{
// ── Werte (Stufen) ──────────────────────────────────────────
/// XP von Stufe <paramref name="level"/> zur nächsten.
public static double XpToNext(int level) => 20 * Math.Pow(1.16, level);
/// Tägliches Training: Grund-XP/s plus dieser Anteil der gesamten Ausbilder-Leistung,
/// fest verteilt (Stärke, Ausdauer, Geschick, Showtalent) – wächst mit den Ausbildern mit.
// ── Training im Ludus (aktiv): Energie, XP je gelungener Aktion ──
public const int TRAIN_ENERGY_MAX = 5;
public const double TRAIN_ENERGY_SECONDS = 12 * 60; // eine neue Einheit
public const double TRAIN_TIME = 30; // Sekunden je Übung
/// Anteil einer Stufe je gelungener Aktion (ohne Ausbilder); ~20 Aktionen je Übung.
public const double TRAIN_LEVEL_PER_ACTION = 0.06;
public const double TRAIN_TRAINER_BONUS = 0.12; // +12 % je Ausbilder-Stufe
public const double EXPEDITION_GOLD = 0.45; // Denare der Expedition (Anteil der Siege)
public const double DRILL_BASE = 1.0;
public const double DRILL_TRAINER_SHARE = 0.6;
public static readonly double[] DRILL_SPLIT = { 0.3, 0.3, 0.2, 0.2 };
// ── Gladiator-Stufe (Kampf-Erfahrung) ───────────────────────
public static double CharXpToNext(int level) => 10 * Math.Pow(1.15, level);
public static double CharXpPerWin(int tier) => 4 * Math.Pow(1.10, tier);
public const int POINTS_PER_LEVEL = 1;
// ── Kampfwerte aus Stufen ───────────────────────────────────
// linear + exponentiell: Training bleibt bis zum Schluss so wichtig wie Ausrüstung
public static double BaseDamage(int str) => (4 + 2.2 * str) * Math.Pow(1.035, str);
public static double BaseHp(int end) => (40 + 10 * end) * Math.Pow(1.035, end);
/// Trefferchance aus Geschick beider Seiten.
public static double HitChance(double myAgi, double foeAgi) =>
Math.Clamp(0.80 + 0.6 * (myAgi - foeAgi) / (myAgi + foeAgi + 10), 0.35, 0.97);
public static double CritChance(double agi) => 0.05 + 0.25 * agi / (agi + 40);
public const double CRIT_MULT = 2.0;
/// Showmanship: mehr Gunst und Ruhm.
public static double CrowdGainMult(int show) => 1 + 0.04 * show;
public static double FameMult(int show) => 1 + 0.02 * show;
// ── Kampf ───────────────────────────────────────────────────
public const double RECOVERY_TIME = 20.0; // nach einer Niederlage
// ── Echtzeit-Duell ──────────────────────────────────────────
/// Gegner-Kampfkraft = Faktor × √(Schaden × Leben). 0,5: bei dem Verhältnis, mit dem Champions
/// sonst automatisch fallen (~0,9), gewinnt ein mittelguter Spieler meistens (Duell-Bot: 55–87 %).
public const double DUEL_POWER_SCALE = 0.5;
/// Lohn je Angebot (leichter / ebenbürtig / stärker).
public const double OFFER_EASY = 0.7, OFFER_EVEN = 1.0, OFFER_HARD = 1.8;
// ── Selbst kämpfen (neues Spiel) ────────────────────────────
/// Schaden eines gegnerischen Treffers im Duell (Anteil am Leben bei Verhältnis 1).
/// 0,055: bei Verhältnis 1 gewinnt man ohne Fähigkeiten etwa jedes zweite bis dritte Duell von vier.
public static double DUEL_ENEMY_HIT = Tune("GI_EHIT", new[] { 0.055 })[0];
/// Gegner im Duell stärker gewichtet, je Arena (die Idle-Werte setzten große Überlegenheit voraus).
/// Abgestimmt mit --playtest (ohne Taberna, Denare nur aus Kämpfen): ~3,0 h bis zur Freiheit
/// (mit Kampfstilen der Gegner), je Arena 14–49 min, mittleres Verhältnis der gewählten Gegner um 1,0–1,1.
public static double[] MANUAL_ENEMY = Tune("GI_ENEMY", new[] { 4.5, 13, 14, 7, 2.6, 0.95, 0.55 });
/// Mehr Ruhm bis zum Champion, damit eine Arena trägt.
public static double[] MANUAL_FAME = Tune("GI_FAME", new[] { 3.0, 3.0, 3.0, 3.0, 2.3, 1.8, 1.2 });
/// Abstimmung im Testlauf: Werte aus einer Umgebungsvariablen (Komma-Liste), sonst Standard.
static double[] Tune(string env, double[] fallback)
{
var v = Environment.GetEnvironmentVariable(env);
if (string.IsNullOrWhiteSpace(v)) return fallback;
var parts = v.Split(',').Select(x => double.Parse(x, System.Globalization.CultureInfo.InvariantCulture)).ToArray();
return parts.Length >= fallback.Length ? parts : fallback;
}
// ── Gegner ──────────────────────────────────────────────────
public const int RANKS_PER_ARENA = 10;
public const int ARENA_COUNT = 7; // 0 = Ludus … 6 = vor dem Kaiser
public static double EnemyHp(int tier) => 45 * Math.Pow(1.28, tier);
public static double EnemyDamage(int tier) => 5 * Math.Pow(1.28, tier);
public static double EnemyAgi(int tier) => 2 + 1.6 * tier;
public const double CHAMPION_HP = 1.9, CHAMPION_DMG = 1.5, CHAMPION_AGI = 1.2;
public static double GoldPerWin(int tier) => 6 * Math.Pow(1.22, tier);
/// Denare je Sieg (Faktor auf GoldPerWin): Kämpfe sind die Haupteinnahme, seit es keine Taberna mehr gibt.
public static double FIGHT_GOLD = Tune("GI_GOLD", new[] { 2.5 })[0];
public static double FamePerWin(int tier) => 1 * Math.Pow(1.22, tier);
/// Ruhm (gesamt in diesem Leben), ab dem der Champion der Arena herausgefordert werden kann.
public static double FameRequired(int arena) => (20 + 15 * arena) * FamePerWin(arena * RANKS_PER_ARENA + RANKS_PER_ARENA - 1);
public const double CHAMPION_REWARD = 5; // Gold und Ruhm × so viel wie ein normaler Sieg
// ── Gunst der Menge (0–100) ─────────────────────────────────
public const double CROWD_WIN = 8, CROWD_LOSS = 25, CROWD_DECAY = 0.15;
/// ×1 bei 0 Gunst bis ×3 bei 100.
public static double CrowdMult(double favor) => 1 + 2 * favor / 100;
// ── Prestige ────────────────────────────────────────────────
/// Gunst der Götter für die Freiheit, aus dem Ruhm dieses Lebens.
public static int FavorForFreedom(double fameRun) =>
Math.Max(10, (int)Math.Floor(10 * Math.Sqrt(fameRun / FameRequired(ARENA_COUNT - 1))));
/// Gold, das der nächste Gladiator erbt: 1 % des verdienten Golds, gedeckelt
/// (sonst kauft er sich am Anfang alles und überspringt die ersten Kapitel).
public static double InheritGold(double goldEarnedRun, int freedoms) => Math.Min(goldEarnedRun * 0.01, 500.0 * freedoms);
// ── Offline ─────────────────────────────────────────────────
public const double OFFLINE_HOURS = 8;
public const double OFFLINE_STEP = 0.5; // Sekunden je Simulationsschritt
}
}